Fixed rules table on mobile

This commit is contained in:
Will Browning 2024-05-04 09:42:34 +01:00
parent 731d33ac2c
commit e7a723df1c
3 changed files with 104 additions and 102 deletions

10
composer.lock generated
View File

@ -11316,16 +11316,16 @@
},
{
"name": "spatie/ignition",
"version": "1.14.0",
"version": "1.14.1",
"source": {
"type": "git",
"url": "https://github.com/spatie/ignition.git",
"reference": "80385994caed328f6f9c9952926932e65b9b774c"
"reference": "c23cc018c5f423d2f413b99f84655fceb6549811"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/spatie/ignition/zipball/80385994caed328f6f9c9952926932e65b9b774c",
"reference": "80385994caed328f6f9c9952926932e65b9b774c",
"url": "https://api.github.com/repos/spatie/ignition/zipball/c23cc018c5f423d2f413b99f84655fceb6549811",
"reference": "c23cc018c5f423d2f413b99f84655fceb6549811",
"shasum": ""
},
"require": {
@ -11395,7 +11395,7 @@
"type": "github"
}
],
"time": "2024-04-26T08:45:51+00:00"
"time": "2024-05-03T15:56:16+00:00"
},
{
"name": "spatie/laravel-ignition",

18
package-lock.json generated
View File

@ -1602,9 +1602,9 @@
"integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA=="
},
"node_modules/electron-to-chromium": {
"version": "1.4.755",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.755.tgz",
"integrity": "sha512-9nop+3jZxSHIxe1EzEUcjDXzK+3qOv3fY5w0sE88nIZUntbv1aXWmoxGWlklX5XSO4txCpLssWkUSh8RQPovBg=="
"version": "1.4.756",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.756.tgz",
"integrity": "sha512-RJKZ9+vEBMeiPAvKNWyZjuYyUqMndcP1f335oHqn3BEQbs2NFtVrnK5+6Xg5wSM9TknNNpWghGDUCKGYF+xWXw=="
},
"node_modules/emoji-regex": {
"version": "10.3.0",
@ -2536,9 +2536,9 @@
}
},
"node_modules/minipass": {
"version": "7.0.4",
"resolved": "https://registry.npmjs.org/minipass/-/minipass-7.0.4.tgz",
"integrity": "sha512-jYofLM5Dam9279rdkWzqHozUo4ybjdZmCsDHePy5V/PbBcVMiSZR97gmAy45aqi8CK1lG2ECd356FU86avfwUQ==",
"version": "7.1.0",
"resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.0.tgz",
"integrity": "sha512-oGZRv2OT1lO2UF1zUcwdTb3wqUwI0kBGTgt/T7OdSj6M6N5m3o5uPf0AIW6lVxGGoiWUR7e2AwTE+xiwK8WQig==",
"engines": {
"node": ">=16 || 14 >=14.17"
}
@ -3699,9 +3699,9 @@
"peer": true
},
"node_modules/update-browserslist-db": {
"version": "1.0.14",
"resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.14.tgz",
"integrity": "sha512-JixKH8GR2pWYshIPUg/NujK3JO7JiqEEUiNArE86NQyrgUuZeTlZQN3xuS/yiV5Kb48ev9K6RqNkaJjXsdg7Jw==",
"version": "1.0.15",
"resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.15.tgz",
"integrity": "sha512-K9HWH62x3/EalU1U6sjSZiylm9C8tgq2mSvshZpqc7QE69RaA2qjhkW2HlNA0tFpEbtyFz7HTqbSdN4MSwUodA==",
"funding": [
{
"type": "opencollective",

View File

@ -30,97 +30,99 @@
</div>
<div v-if="rows.length" class="bg-white shadow">
<table class="table-auto w-full">
<thead class="border-b border-grey-100 text-grey-400">
<tr>
<th scope="col" class="p-3"></th>
<th scope="col" class="p-3 text-left">Created</th>
<th scope="col" class="p-3 text-left">Name</th>
<th scope="col" class="p-3 text-left">Active</th>
<th scope="col" class="p-3 text-left">
Applied
<span
class="tooltip outline-none"
data-tippy-content="This is the number of times that the rule has been applied. Hover over the count to see when it was last applied."
>
<icon name="info" class="inline-block w-4 h-4 text-grey-300 fill-current" />
</span>
</th>
<th scope="col" class="p-3"></th>
</tr>
</thead>
<draggable
:component-data="{ type: 'transition', name: 'flip-list' }"
v-model="rows"
item-key="id"
tag="tbody"
handle=".handle"
:group="{ name: 'description' }"
ghost-class="ghost"
@change="reorderRules"
@update="debounceToolips"
>
<template #item="{ element }">
<tr class="border-b border-grey-100 h-20">
<td scope="row" class="p-3">
<icon
name="menu"
class="handle block w-6 h-6 text-grey-300 fill-current cursor-pointer"
/>
</td>
<td scope="row" class="p-3">
<div class="vgt-responsive">
<table class="table-auto w-full">
<thead class="border-b border-grey-100 text-grey-400">
<tr>
<th scope="col" class="p-3"></th>
<th scope="col" class="p-3 text-left">Created</th>
<th scope="col" class="p-3 text-left">Name</th>
<th scope="col" class="p-3 text-left">Active</th>
<th scope="col" class="p-3 text-left">
Applied
<span
class="tooltip outline-none cursor-default text-sm text-grey-500"
:data-tippy-content="$filters.formatDate(element.created_at)"
>{{ $filters.timeAgo(element.created_at) }}
</span>
</td>
<td scope="row" class="p-3">
<span class="font-medium text-grey-700">{{ element.name }}</span>
</td>
<td scope="row" class="p-3">
<Toggle
v-model="element.active"
@on="activateRule(element.id)"
@off="deactivateRule(element.id)"
/>
</td>
<td scope="row" class="p-3">
<span
v-if="element.last_applied"
class="tooltip outline-none cursor-default font-semibold text-indigo-800"
:data-tippy-content="
$filters.timeAgo(element.last_applied) +
' (' +
$filters.formatDate(element.last_applied) +
')'
"
>{{ element.applied.toLocaleString() }}
</span>
<span v-else>{{ element.applied.toLocaleString() }} </span>
</td>
<td scope="row" class="p-3 text-right w-0 min-w-fit whitespace-nowrap">
<button
@click="openEditModal(element)"
as="button"
type="button"
class="text-indigo-500 hover:text-indigo-800 font-medium"
class="tooltip outline-none"
data-tippy-content="This is the number of times that the rule has been applied. Hover over the count to see when it was last applied."
>
Edit
</button>
<button
@click="openDeleteModal(element.id)"
as="button"
type="button"
class="text-indigo-500 hover:text-indigo-800 font-medium ml-4"
>
Delete
</button>
</td>
<icon name="info" class="inline-block w-4 h-4 text-grey-300 fill-current" />
</span>
</th>
<th scope="col" class="p-3"></th>
</tr>
</template>
</draggable>
</table>
</thead>
<draggable
:component-data="{ type: 'transition', name: 'flip-list' }"
v-model="rows"
item-key="id"
tag="tbody"
handle=".handle"
:group="{ name: 'description' }"
ghost-class="ghost"
@change="reorderRules"
@update="debounceToolips"
>
<template #item="{ element }">
<tr class="border-b border-grey-100 h-20">
<td scope="row" class="p-3">
<icon
name="menu"
class="handle block w-6 h-6 text-grey-300 fill-current cursor-pointer"
/>
</td>
<td scope="row" class="p-3">
<span
class="tooltip outline-none cursor-default text-sm text-grey-500"
:data-tippy-content="$filters.formatDate(element.created_at)"
>{{ $filters.timeAgo(element.created_at) }}
</span>
</td>
<td scope="row" class="p-3">
<span class="font-medium text-grey-700">{{ element.name }}</span>
</td>
<td scope="row" class="p-3">
<Toggle
v-model="element.active"
@on="activateRule(element.id)"
@off="deactivateRule(element.id)"
/>
</td>
<td scope="row" class="p-3">
<span
v-if="element.last_applied"
class="tooltip outline-none cursor-default font-semibold text-indigo-800"
:data-tippy-content="
$filters.timeAgo(element.last_applied) +
' (' +
$filters.formatDate(element.last_applied) +
')'
"
>{{ element.applied.toLocaleString() }}
</span>
<span v-else>{{ element.applied.toLocaleString() }} </span>
</td>
<td scope="row" class="p-3 text-right w-0 min-w-fit whitespace-nowrap">
<button
@click="openEditModal(element)"
as="button"
type="button"
class="text-indigo-500 hover:text-indigo-800 font-medium"
>
Edit
</button>
<button
@click="openDeleteModal(element.id)"
as="button"
type="button"
class="text-indigo-500 hover:text-indigo-800 font-medium ml-4"
>
Delete
</button>
</td>
</tr>
</template>
</draggable>
</table>
</div>
</div>
<div v-else-if="search" class="text-center">