@jskit-ai/http-web 0.2.15 → 0.2.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/fixtures/crud-list-date-filters/App.vue +3 -3
  3. package/fixtures/crud-list-date-filters/main.js +3 -9
  4. package/fixtures/crud-screens/App.vue +14 -0
  5. package/fixtures/crud-screens/index.html +12 -0
  6. package/fixtures/crud-screens/main.js +114 -0
  7. package/fixtures/crud-screens/vite.config.mjs +24 -0
  8. package/fixtures/select-field/main.js +3 -9
  9. package/locales/en.json +1 -2
  10. package/package.json +10 -8
  11. package/patterns/crud-screen-set/PATTERN.md +13 -0
  12. package/patterns/crud-screen-set/example/books/BookEditPage.vue +2 -0
  13. package/patterns/crud-screen-set/example/books/BookFormFields.vue +0 -6
  14. package/patterns/crud-screen-set/example/books/BookListPage.vue +5 -2
  15. package/patterns/crud-screen-set/example/books/BookNewPage.vue +2 -0
  16. package/patterns/crud-screen-set/example/books/BookViewPage.vue +5 -9
  17. package/src/client/components/CrudAddEditScreen.vue +70 -75
  18. package/src/client/components/CrudDeleteAction.vue +26 -14
  19. package/src/client/components/CrudListBulkActionSurface.vue +25 -20
  20. package/src/client/components/CrudListCreateAction.vue +38 -0
  21. package/src/client/components/CrudListDateFilterControl.vue +0 -1
  22. package/src/client/components/CrudListFilterControls.vue +0 -11
  23. package/src/client/components/CrudListFilterSheet.vue +59 -0
  24. package/src/client/components/CrudListFilterSurface.vue +58 -84
  25. package/src/client/components/CrudListRecordActionMenu.vue +14 -18
  26. package/src/client/components/CrudListScreen.vue +305 -245
  27. package/src/client/components/CrudViewScreen.vue +84 -99
  28. package/src/client/composables/records/useCrudAddEdit.js +6 -4
  29. package/src/client/composables/records/useView.js +1 -0
  30. package/src/client/composables/runtime/useViewCore.js +4 -4
  31. package/src/client/composables/useCrudDeleteAction.js +4 -3
  32. package/src/client/types.js +0 -1
  33. package/test/crudAddEditActions.test.js +19 -2
  34. package/test/crudListBulkActionSurface.test.js +3 -2
  35. package/test/crudListDateFilterSurface.browser.test.js +23 -14
  36. package/test/crudListFilterSurface.test.js +11 -7
  37. package/test/crudScreenComponents.test.js +89 -16
  38. package/test/crudScreenPattern.test.js +3 -0
  39. package/test/crudScreensMaterialBaselines.browser.test.js +170 -0
  40. package/test/translation.test.js +6 -2
@@ -1,7 +1,10 @@
1
1
  <script setup>
2
2
  import { computed, unref } from "vue";
3
- import { useRoute } from "vue-router";
3
+ import { useRoute, useRouter } from "vue-router";
4
+ import ShellPageAction from "@jskit-ai/shell-web/client/components/ShellPageAction";
5
+ import ShellPageActions from "@jskit-ai/shell-web/client/components/ShellPageActions";
4
6
  import CrudListBulkActionSurface from "./CrudListBulkActionSurface.vue";
7
+ import CrudListCreateAction from "./CrudListCreateAction.vue";
5
8
  import CrudListFilterSurface from "./CrudListFilterSurface.vue";
6
9
  import CrudListRecordActionMenu from "./CrudListRecordActionMenu.vue";
7
10
  import { useJskitText } from "../i18n.js";
@@ -38,6 +41,7 @@ const resolvedEmptyBody = computed(() =>
38
41
  );
39
42
 
40
43
  const route = useRoute();
44
+ const router = useRouter();
41
45
  const records = computed(() => props.screen.records);
42
46
  const bulkActions = computed(() => props.screen.bulkActions);
43
47
  const rowActions = computed(() => props.screen.rowActions);
@@ -50,6 +54,10 @@ const hasBulkActions = computed(() => Boolean(unref(bulkActions.value.hasActions
50
54
  const hasRowActions = computed(() => Boolean(unref(rowActions.value.hasActions)));
51
55
  const hasViewUrl = computed(() => Boolean(props.screen.hasViewUrl));
52
56
  const hasEditUrl = computed(() => Boolean(props.screen.hasEditUrl));
57
+ const trailingActionCount = computed(() =>
58
+ Number(hasViewUrl.value) + Number(hasEditUrl.value) + Number(hasRowActions.value)
59
+ );
60
+ const trailingActionsWidth = computed(() => `${trailingActionCount.value * 48 + 16}px`);
53
61
 
54
62
  function resolveListRecordTitle(record) {
55
63
  return props.screen.resolveRecordTitle(record);
@@ -69,6 +77,24 @@ function resolveEditLocation(record) {
69
77
  return path ? { path, query: route.query } : null;
70
78
  }
71
79
 
80
+ // A card or row opens its record: the view page, or the edit page when the list has no view.
81
+ function resolveOpenLocation(row) {
82
+ if (row.synthetic) {
83
+ return null;
84
+ }
85
+ return (hasViewUrl.value && resolveViewLocation(row.record)) || (hasEditUrl.value && resolveEditLocation(row.record)) || null;
86
+ }
87
+
88
+ // A click anywhere on a table row opens it, except on the row's own controls.
89
+ function openRow(row, event) {
90
+ const location = resolveOpenLocation(row);
91
+ const target = event.target instanceof Element ? event.target : null;
92
+ if (!location || target?.closest("a, button, input, label, select, textarea, [role='button'], [role='checkbox']")) {
93
+ return;
94
+ }
95
+ void router.push(location);
96
+ }
97
+
72
98
  function hasRowActionsFor(record, index) {
73
99
  return rowActions.value.hasVisibleActionsFor(record, index);
74
100
  }
@@ -97,333 +123,367 @@ function setSelectableRowsSelected(selected = true) {
97
123
  </script>
98
124
 
99
125
  <template>
100
- <section class="crud-screen crud-screen--operator crud-list-element d-flex flex-column ga-4">
101
- <div class="crud-list-actions">
102
- <v-btn
103
- color="primary"
104
- variant="tonal"
126
+ <section class="crud-screen crud-list">
127
+ <ShellPageActions>
128
+ <ShellPageAction
129
+ icon="$refresh"
130
+ :label="records.isFetching ? t('jskit.http.actions.refreshing') : t('jskit.http.actions.refresh')"
105
131
  :disabled="records.isFetching"
106
132
  @click="records.reload"
107
- >
108
- {{ records.isFetching ? t("jskit.http.actions.refreshing") : t("jskit.http.actions.refresh") }}
109
- </v-btn>
110
- <v-btn
111
- v-if="listPrimaryAction"
112
- class="crud-list-primary-action"
113
- color="primary"
114
- variant="flat"
115
- :to="listPrimaryAction"
116
- >
117
- {{ resolvedCreateLabel }}
118
- </v-btn>
133
+ />
134
+ </ShellPageActions>
135
+ <CrudListCreateAction v-if="listPrimaryAction" :label="resolvedCreateLabel" :to="listPrimaryAction" />
136
+
137
+ <div class="crud-list-toolbar">
138
+ <v-text-field
139
+ v-if="records.searchEnabled"
140
+ v-model="records.searchQuery"
141
+ :placeholder="records.searchPlaceholder || records.searchLabel"
142
+ :aria-label="records.searchLabel"
143
+ variant="solo-filled"
144
+ bg-color="surface-container-high"
145
+ flat
146
+ rounded="pill"
147
+ single-line
148
+ hide-details
149
+ clearable
150
+ prepend-inner-icon="$search"
151
+ class="crud-list-search"
152
+ :aria-busy="records.isSearchDebouncing ? 'true' : undefined"
153
+ />
154
+ <CrudListFilterSurface
155
+ :filters="listFilters"
156
+ :runtime="filterRuntime"
157
+ />
119
158
  </div>
159
+ <CrudListBulkActionSurface :runtime="bulkActions" />
160
+
161
+ <v-skeleton-loader v-if="records.showListSkeleton" type="list-item-two-line@5" />
162
+ <template v-else>
163
+ <div v-if="records.loadError" class="crud-list-state">
164
+ <v-icon icon="$cloudOff" size="48" class="crud-list-state__icon" />
165
+ <p class="text-body-large">{{ resolvedLoadErrorBody }}</p>
166
+ <v-btn
167
+ color="secondary-container"
168
+ prepend-icon="$refresh"
169
+ :disabled="records.isFetching"
170
+ @click="records.reload"
171
+ >
172
+ {{ records.isFetching ? t("jskit.http.actions.retrying") : t("jskit.http.actions.retry") }}
173
+ </v-btn>
174
+ </div>
120
175
 
121
- <v-sheet rounded="lg" border class="crud-list-panel">
122
- <div class="crud-list-toolbar">
123
- <v-text-field
124
- v-if="records.searchEnabled"
125
- v-model="records.searchQuery"
126
- :label="records.searchLabel"
127
- :placeholder="records.searchPlaceholder"
128
- variant="outlined"
129
- density="comfortable"
130
- hide-details="auto"
131
- clearable
132
- class="crud-list-search"
133
- :aria-busy="records.isSearchDebouncing ? 'true' : undefined"
134
- />
135
- <CrudListFilterSurface
136
- :filters="listFilters"
137
- :runtime="filterRuntime"
138
- />
176
+ <div v-else-if="displayRows.length < 1" class="crud-list-state">
177
+ <v-icon icon="$inbox" size="48" class="crud-list-state__icon" />
178
+ <p class="text-body-large">{{ resolvedEmptyBody }}</p>
179
+ <v-btn v-if="listPrimaryAction" prepend-icon="$add" :to="listPrimaryAction">
180
+ {{ resolvedCreateLabel }}
181
+ </v-btn>
139
182
  </div>
140
- <CrudListBulkActionSurface :runtime="bulkActions" />
141
183
 
142
- <template v-if="records.showListSkeleton">
143
- <div class="pa-4">
144
- <v-skeleton-loader type="text@2, list-item-two-line@5" />
145
- </div>
146
- </template>
147
184
  <template v-else>
148
- <div v-if="records.loadError" class="crud-list-state">
149
- <p class="text-body-2 text-medium-emphasis mb-4">{{ resolvedLoadErrorBody }}</p>
150
- <v-btn
151
- color="primary"
152
- variant="tonal"
153
- :disabled="records.isFetching"
154
- @click="records.reload"
185
+ <div class="crud-list-cards">
186
+ <v-card
187
+ v-for="row in displayRows"
188
+ :key="row.key"
189
+ class="crud-list-card"
155
190
  >
156
- {{ records.isFetching ? t("jskit.http.actions.retrying") : t("jskit.http.actions.retry") }}
157
- </v-btn>
158
- </div>
159
-
160
- <div v-else-if="displayRows.length < 1" class="crud-list-state">
161
- <p class="text-body-2 text-medium-emphasis mb-4">{{ resolvedEmptyBody }}</p>
162
- <v-btn v-if="listPrimaryAction" color="primary" variant="flat" :to="listPrimaryAction">
163
- {{ resolvedCreateLabel }}
164
- </v-btn>
191
+ <div class="crud-list-card__header">
192
+ <v-checkbox-btn
193
+ v-if="hasBulkActions && row.selectable !== false"
194
+ :model-value="isBulkRowSelected(row)"
195
+ :aria-label="t('jskit.http.crud.list.selectRecord', { title: resolveListRecordTitle(row.record) })"
196
+ class="crud-list-card__control"
197
+ @update:model-value="setBulkRowSelected(row, $event)"
198
+ />
199
+ <div class="crud-list-card__heading">
200
+ <RouterLink
201
+ v-if="resolveOpenLocation(row)"
202
+ class="crud-list-card__title crud-list-card__link"
203
+ :to="resolveOpenLocation(row)"
204
+ >
205
+ {{ resolveListRecordTitle(row.record) }}
206
+ </RouterLink>
207
+ <div v-else class="crud-list-card__title">{{ resolveListRecordTitle(row.record) }}</div>
208
+ </div>
209
+ <CrudListRecordActionMenu
210
+ v-if="(hasViewUrl && hasEditUrl) || hasRowActionsFor(row.record, row.index)"
211
+ class="crud-list-card__control"
212
+ :record="row.record"
213
+ :index="row.index"
214
+ :title="resolveListRecordTitle(row.record)"
215
+ :row-actions="rowActions"
216
+ :show-edit="hasViewUrl && hasEditUrl && !row.synthetic"
217
+ :edit-location="resolveEditLocation(row.record)"
218
+ />
219
+ </div>
220
+ <div class="crud-list-card__fields">
221
+ <slot
222
+ name="card-fields"
223
+ :record="row.record"
224
+ :records="records"
225
+ :index="row.index"
226
+ :row="row"
227
+ :format-list-card-value="formatListCardValue"
228
+ />
229
+ </div>
230
+ </v-card>
165
231
  </div>
166
232
 
167
- <template v-else>
168
- <div class="crud-list-cards">
169
- <v-sheet
170
- v-for="row in displayRows"
171
- :key="row.key"
172
- rounded="lg"
173
- border
174
- class="crud-list-card"
175
- >
176
- <div class="crud-list-card__header">
177
- <v-checkbox-btn
178
- v-if="hasBulkActions && row.selectable !== false"
179
- :model-value="isBulkRowSelected(row)"
180
- :aria-label="t('jskit.http.crud.list.selectRecord', { title: resolveListRecordTitle(row.record) })"
181
- class="crud-list-card__select"
182
- @update:model-value="setBulkRowSelected(row, $event)"
183
- />
184
- <div class="min-w-0">
185
- <div class="crud-list-card__title">{{ resolveListRecordTitle(row.record) }}</div>
186
- <div class="text-caption text-medium-emphasis">
187
- {{ row.recordKey }}
188
- </div>
189
- </div>
190
- <CrudListRecordActionMenu
191
- v-if="hasViewUrl || hasEditUrl || hasRowActionsFor(row.record, row.index)"
192
- :record="row.record"
193
- :index="row.index"
194
- :row-actions="rowActions"
195
- :show-view="hasViewUrl && !row.synthetic"
196
- :show-edit="hasEditUrl && !row.synthetic"
197
- :view-location="resolveViewLocation(row.record)"
198
- :edit-location="resolveEditLocation(row.record)"
233
+ <div class="crud-list-table">
234
+ <v-table>
235
+ <thead>
236
+ <tr>
237
+ <th v-if="hasBulkActions" class="crud-list-table__select">
238
+ <v-checkbox-btn
239
+ :model-value="allSelectableRowsSelected()"
240
+ :indeterminate="
241
+ someSelectableRowsSelected() &&
242
+ !allSelectableRowsSelected()
243
+ "
244
+ :aria-label="t('jskit.http.crud.list.selectVisibleRows')"
245
+ @update:model-value="setSelectableRowsSelected($event)"
246
+ />
247
+ </th>
248
+ <slot name="table-header" />
249
+ <th
250
+ v-if="trailingActionCount > 0"
251
+ class="crud-list-table__actions"
252
+ :style="{ width: trailingActionsWidth }"
199
253
  />
200
- </div>
201
- <div class="crud-list-card__fields">
254
+ </tr>
255
+ </thead>
256
+ <tbody>
257
+ <tr
258
+ v-for="row in displayRows"
259
+ :key="row.key"
260
+ :class="{ 'crud-list-table__row--link': resolveOpenLocation(row) }"
261
+ @click="openRow(row, $event)"
262
+ >
263
+ <td v-if="hasBulkActions" class="crud-list-table__select">
264
+ <v-checkbox-btn
265
+ v-if="row.selectable !== false"
266
+ :model-value="isBulkRowSelected(row)"
267
+ :aria-label="t('jskit.http.crud.list.selectRecord', { title: resolveListRecordTitle(row.record) })"
268
+ @update:model-value="setBulkRowSelected(row, $event)"
269
+ />
270
+ </td>
202
271
  <slot
203
- name="card-fields"
272
+ name="table-row"
204
273
  :record="row.record"
205
274
  :records="records"
206
275
  :index="row.index"
207
276
  :row="row"
208
- :format-list-card-value="formatListCardValue"
209
277
  />
210
- </div>
211
- </v-sheet>
212
- </div>
213
-
214
- <div class="crud-list-table">
215
- <v-table density="comfortable">
216
- <thead>
217
- <tr>
218
- <th v-if="hasBulkActions" class="crud-list-table__select">
219
- <v-checkbox-btn
220
- :model-value="allSelectableRowsSelected()"
221
- :indeterminate="
222
- someSelectableRowsSelected() &&
223
- !allSelectableRowsSelected()
224
- "
225
- :aria-label="t('jskit.http.crud.list.selectVisibleRows')"
226
- @update:model-value="setSelectableRowsSelected($event)"
227
- />
228
- </th>
229
- <slot name="table-header" />
230
- <th v-if="hasViewUrl" class="text-right" />
231
- <th v-if="hasEditUrl" class="text-right" />
232
- <th v-if="hasRowActions" class="text-right" />
233
- </tr>
234
- </thead>
235
- <tbody>
236
- <tr v-for="row in displayRows" :key="row.key">
237
- <td v-if="hasBulkActions" class="crud-list-table__select">
238
- <v-checkbox-btn
239
- v-if="row.selectable !== false"
240
- :model-value="isBulkRowSelected(row)"
241
- :aria-label="t('jskit.http.crud.list.selectRecord', { title: resolveListRecordTitle(row.record) })"
242
- @update:model-value="setBulkRowSelected(row, $event)"
243
- />
244
- </td>
245
- <slot
246
- name="table-row"
278
+ <td v-if="trailingActionCount > 0" class="crud-list-table__actions">
279
+ <v-btn
280
+ v-if="hasViewUrl && !row.synthetic"
281
+ icon
282
+ variant="text"
283
+ color="on-surface-variant"
284
+ :to="resolveViewLocation(row.record)"
285
+ :disabled="!resolveViewLocation(row.record)"
286
+ :aria-label="t('jskit.http.actions.open')"
287
+ >
288
+ <v-icon icon="$chevronRight" />
289
+ <v-tooltip activator="parent" location="top" :text="t('jskit.http.actions.open')" />
290
+ </v-btn>
291
+ <v-btn
292
+ v-if="hasEditUrl && !row.synthetic"
293
+ icon
294
+ variant="text"
295
+ color="on-surface-variant"
296
+ :to="resolveEditLocation(row.record)"
297
+ :disabled="!resolveEditLocation(row.record)"
298
+ :aria-label="t('jskit.http.actions.edit')"
299
+ >
300
+ <v-icon icon="$edit" />
301
+ <v-tooltip activator="parent" location="top" :text="t('jskit.http.actions.edit')" />
302
+ </v-btn>
303
+ <CrudListRecordActionMenu
304
+ v-if="hasRowActions && hasRowActionsFor(row.record, row.index)"
247
305
  :record="row.record"
248
- :records="records"
249
306
  :index="row.index"
250
- :row="row"
307
+ :title="resolveListRecordTitle(row.record)"
308
+ :row-actions="rowActions"
251
309
  />
252
- <td v-if="hasViewUrl" class="text-right">
253
- <v-btn
254
- v-if="!row.synthetic"
255
- size="small"
256
- color="primary"
257
- variant="outlined"
258
- :to="resolveViewLocation(row.record)"
259
- :disabled="!resolveViewLocation(row.record)"
260
- >
261
- {{ t("jskit.http.actions.open") }}
262
- </v-btn>
263
- </td>
264
- <td v-if="hasEditUrl" class="text-right">
265
- <v-btn
266
- v-if="!row.synthetic"
267
- size="small"
268
- color="primary"
269
- variant="tonal"
270
- :to="resolveEditLocation(row.record)"
271
- :disabled="!resolveEditLocation(row.record)"
272
- >
273
- {{ t("jskit.http.actions.edit") }}
274
- </v-btn>
275
- </td>
276
- <td v-if="hasRowActions" class="text-right">
277
- <CrudListRecordActionMenu
278
- v-if="hasRowActionsFor(row.record, row.index)"
279
- :record="row.record"
280
- :index="row.index"
281
- :row-actions="rowActions"
282
- :button-label="t('jskit.http.actions.more')"
283
- button-variant="outlined"
284
- />
285
- </td>
286
- </tr>
287
- </tbody>
288
- </v-table>
289
- </div>
290
- </template>
291
-
292
- <div v-if="records.hasMore" class="d-flex justify-center pa-4">
293
- <v-btn
294
- color="primary"
295
- variant="outlined"
296
- :disabled="records.isLoadingMore"
297
- @click="records.loadMore"
298
- >
299
- {{ records.isLoadingMore ? t("jskit.http.actions.loadingMore") : t("jskit.http.actions.loadMore") }}
300
- </v-btn>
310
+ </td>
311
+ </tr>
312
+ </tbody>
313
+ </v-table>
301
314
  </div>
302
315
  </template>
303
- </v-sheet>
304
-
305
- <v-btn
306
- v-if="listPrimaryAction"
307
- class="crud-list-fab"
308
- color="primary"
309
- variant="flat"
310
- :to="listPrimaryAction"
311
- >
312
- {{ resolvedCreateLabel }}
313
- </v-btn>
316
+
317
+ <div v-if="records.hasMore" class="crud-list-more">
318
+ <v-btn
319
+ variant="outlined"
320
+ color="primary"
321
+ :disabled="records.isLoadingMore"
322
+ @click="records.loadMore"
323
+ >
324
+ {{ records.isLoadingMore ? t("jskit.http.actions.loadingMore") : t("jskit.http.actions.loadMore") }}
325
+ </v-btn>
326
+ </div>
327
+ </template>
314
328
  </section>
315
329
  </template>
316
330
 
317
331
  <style scoped>
318
- .crud-list-actions {
332
+ /* The list picks cards or a table from its own width, so it never scrolls sideways beside a drawer or a detail pane. */
333
+ .crud-list {
334
+ container: crud-list / inline-size;
319
335
  display: flex;
320
- flex-wrap: wrap;
321
- gap: 0.5rem;
322
- justify-content: flex-end;
336
+ flex-direction: column;
337
+ gap: 16px;
338
+ min-width: 0;
323
339
  }
324
340
 
325
- .crud-list-panel {
326
- overflow: hidden;
341
+ .crud-list-toolbar {
342
+ display: flex;
343
+ flex-direction: column;
344
+ gap: 12px;
345
+ min-width: 0;
327
346
  }
328
347
 
329
- .crud-list-toolbar {
330
- padding: 1rem;
348
+ .crud-list-toolbar:empty {
349
+ display: none;
331
350
  }
332
351
 
333
352
  .crud-list-search {
334
- max-width: 26rem;
353
+ max-width: 720px;
354
+ width: 100%;
335
355
  }
336
356
 
337
357
  .crud-list-state {
358
+ align-items: center;
359
+ color: rgb(var(--v-theme-on-surface-variant));
360
+ display: flex;
361
+ flex-direction: column;
362
+ gap: 16px;
338
363
  margin-inline: auto;
339
- max-width: 30rem;
340
- padding: 2rem 1rem;
364
+ max-width: 480px;
365
+ padding: 48px 16px;
341
366
  text-align: center;
342
367
  }
343
368
 
344
369
  .crud-list-cards {
345
370
  display: flex;
346
371
  flex-direction: column;
347
- gap: 0.75rem;
348
- padding: 0 1rem 1rem;
372
+ gap: 8px;
349
373
  }
350
374
 
351
375
  .crud-list-card {
352
- padding: 0.875rem;
376
+ padding: 16px;
377
+ position: relative;
353
378
  }
354
379
 
355
380
  .crud-list-card__header {
356
381
  align-items: flex-start;
357
382
  display: flex;
358
- gap: 0.75rem;
359
- justify-content: space-between;
383
+ gap: 12px;
360
384
  }
361
385
 
362
- .crud-list-card__select {
386
+ .crud-list-card__heading {
387
+ flex: 1 1 auto;
388
+ min-width: 0;
389
+ }
390
+
391
+ .crud-list-card__control {
363
392
  flex: 0 0 auto;
364
- margin-inline-start: -0.35rem;
365
- margin-top: -0.35rem;
393
+ margin-block: -8px;
394
+ position: relative;
395
+ z-index: 1;
366
396
  }
367
397
 
368
398
  .crud-list-card__title {
399
+ color: rgb(var(--v-theme-on-surface));
400
+ display: block;
369
401
  font-size: 1rem;
370
- font-weight: 650;
371
- line-height: 1.25;
402
+ font-weight: 500;
403
+ letter-spacing: 0.009375rem;
404
+ line-height: 1.5rem;
372
405
  overflow-wrap: anywhere;
406
+ text-decoration: none;
407
+ }
408
+
409
+ /* The title link covers the whole card, so a tap anywhere opens the record; the card's controls sit above it. */
410
+ .crud-list-card__link::after {
411
+ border-radius: inherit;
412
+ content: "";
413
+ inset: 0;
414
+ position: absolute;
415
+ transition: background-color 200ms cubic-bezier(0.2, 0, 0, 1);
416
+ }
417
+
418
+ .crud-list-card__link:hover::after {
419
+ background: rgba(var(--v-theme-on-surface), var(--v-hover-opacity));
420
+ }
421
+
422
+ .crud-list-card__link:focus-visible {
423
+ outline: none;
424
+ }
425
+
426
+ .crud-list-card__link:focus-visible::after {
427
+ outline: 3px solid rgb(var(--v-theme-secondary));
428
+ outline-offset: 2px;
373
429
  }
374
430
 
375
431
  .crud-list-card__fields {
432
+ color: rgb(var(--v-theme-on-surface-variant));
376
433
  display: grid;
377
- gap: 0.65rem;
378
- margin-top: 0.85rem;
434
+ gap: 8px;
435
+ }
436
+
437
+ .crud-list-card__fields:not(:empty) {
438
+ margin-top: 12px;
379
439
  }
380
440
 
381
441
  .crud-list-table {
382
442
  display: none;
383
- overflow-x: auto;
384
443
  }
385
444
 
386
- .crud-list-table__select {
387
- width: 3rem;
445
+ .crud-list-table :deep(table) {
446
+ table-layout: fixed;
388
447
  }
389
448
 
390
- .crud-list-fab {
391
- bottom: calc(5rem + env(safe-area-inset-bottom, 0px));
392
- display: flex;
393
- position: fixed;
394
- right: 1rem;
395
- z-index: 6;
449
+ .crud-list-table :deep(th),
450
+ .crud-list-table :deep(td) {
451
+ overflow: hidden;
452
+ text-overflow: ellipsis;
453
+ white-space: nowrap;
396
454
  }
397
455
 
398
- @media (min-width: 960px) {
399
- .crud-list-cards {
400
- display: none;
401
- }
456
+ .crud-list-table__select {
457
+ width: 56px;
458
+ }
402
459
 
403
- .crud-list-table {
404
- display: block;
405
- }
460
+ .crud-list-table .crud-list-table__actions {
461
+ overflow: visible;
462
+ padding-inline: 8px;
463
+ text-align: end;
464
+ }
406
465
 
407
- .crud-list-fab {
408
- display: none;
409
- }
466
+ .crud-list-table__row--link {
467
+ cursor: pointer;
410
468
  }
411
469
 
412
- @media (max-width: 960px) {
413
- .crud-list-actions {
414
- width: 100%;
415
- }
470
+ .crud-list-table__row--link:hover > td {
471
+ background: rgba(var(--v-theme-on-surface), var(--v-hover-opacity));
472
+ }
416
473
 
417
- .crud-list-element :deep(.v-btn) {
418
- min-height: 48px;
419
- }
474
+ .crud-list-more {
475
+ display: flex;
476
+ justify-content: center;
477
+ padding: 8px 0 16px;
478
+ }
420
479
 
421
- .crud-list-primary-action {
480
+ @container crud-list (min-width: 720px) {
481
+ .crud-list-cards {
422
482
  display: none;
423
483
  }
424
484
 
425
- .crud-list-search {
426
- max-width: none;
485
+ .crud-list-table {
486
+ display: block;
427
487
  }
428
488
  }
429
489
  </style>