nuxt-ui-tools 1.17.1 → 1.19.0

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 (178) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/module.mjs +1 -0
  3. package/dist/runtime/form/components/page/form-page-header.d.vue.ts +3 -1
  4. package/dist/runtime/form/components/page/form-page-header.vue +44 -34
  5. package/dist/runtime/form/components/page/form-page-header.vue.d.ts +3 -1
  6. package/dist/runtime/form/components/page/form-page-navigation.d.vue.ts +5 -3
  7. package/dist/runtime/form/components/page/form-page-navigation.vue +6 -3
  8. package/dist/runtime/form/components/page/form-page-navigation.vue.d.ts +5 -3
  9. package/dist/runtime/form/components/page/form-page-section.vue +6 -5
  10. package/dist/runtime/form/components/page/form-page-sections.d.vue.ts +4 -3
  11. package/dist/runtime/form/components/page/form-page-sections.vue +7 -2
  12. package/dist/runtime/form/components/page/form-page-sections.vue.d.ts +4 -3
  13. package/dist/runtime/form/components/page/form-page.d.vue.ts +2 -0
  14. package/dist/runtime/form/components/page/form-page.vue +11 -2
  15. package/dist/runtime/form/components/page/form-page.vue.d.ts +2 -0
  16. package/dist/runtime/form/components/renderer/form-field-renderer.vue +6 -4
  17. package/dist/runtime/form/components/renderer/form-field-shell.d.vue.ts +4 -4
  18. package/dist/runtime/form/components/renderer/form-field-shell.vue +28 -4
  19. package/dist/runtime/form/components/renderer/form-field-shell.vue.d.ts +4 -4
  20. package/dist/runtime/form/components/root/form.vue +2 -2
  21. package/dist/runtime/form/components/utils/form-option-choice-label.d.vue.ts +16 -0
  22. package/dist/runtime/form/components/utils/form-option-choice-label.vue +37 -0
  23. package/dist/runtime/form/components/utils/form-option-choice-label.vue.d.ts +16 -0
  24. package/dist/runtime/form/components/utils/form-option-display-value.d.vue.ts +14 -0
  25. package/dist/runtime/form/components/utils/form-option-display-value.vue +20 -0
  26. package/dist/runtime/form/components/utils/form-option-display-value.vue.d.ts +14 -0
  27. package/dist/runtime/form/components/utils/form-option-item-label.d.vue.ts +9 -2
  28. package/dist/runtime/form/components/utils/form-option-item-label.vue +20 -13
  29. package/dist/runtime/form/components/utils/form-option-item-label.vue.d.ts +9 -2
  30. package/dist/runtime/form/components/utils/form-option-leading.d.vue.ts +23 -0
  31. package/dist/runtime/form/components/utils/form-option-leading.vue +41 -0
  32. package/dist/runtime/form/components/utils/form-option-leading.vue.d.ts +23 -0
  33. package/dist/runtime/form/components/utils/form-option-render.d.ts +11 -0
  34. package/dist/runtime/form/components/utils/form-option-render.js +5 -0
  35. package/dist/runtime/form/components/utils/form-option-suffix.d.vue.ts +8 -0
  36. package/dist/runtime/form/components/utils/form-option-suffix.vue +15 -0
  37. package/dist/runtime/form/components/utils/form-option-suffix.vue.d.ts +8 -0
  38. package/dist/runtime/form/components/utils/form-option-value-overlay.d.vue.ts +30 -0
  39. package/dist/runtime/form/components/utils/form-option-value-overlay.vue +44 -0
  40. package/dist/runtime/form/components/utils/form-option-value-overlay.vue.d.ts +30 -0
  41. package/dist/runtime/form/composables/use-choice-group-items.d.ts +27 -0
  42. package/dist/runtime/form/composables/use-choice-group-items.js +24 -0
  43. package/dist/runtime/form/composables/use-field-control.d.ts +6 -6
  44. package/dist/runtime/form/composables/use-field-control.js +9 -21
  45. package/dist/runtime/form/composables/use-field-options.js +8 -4
  46. package/dist/runtime/form/composables/use-form-layout.js +4 -3
  47. package/dist/runtime/form/composables/use-form-page.d.ts +11 -1
  48. package/dist/runtime/form/composables/use-form-page.js +12 -6
  49. package/dist/runtime/form/composables/use-form-runtime.js +1 -1
  50. package/dist/runtime/form/composables/use-option-menu.d.ts +20 -0
  51. package/dist/runtime/form/composables/use-option-menu.js +41 -0
  52. package/dist/runtime/form/fields/array-primitive/types.d.ts +1 -1
  53. package/dist/runtime/form/fields/auto-complete/component.vue +92 -51
  54. package/dist/runtime/form/fields/auto-complete/config.d.ts +1 -0
  55. package/dist/runtime/form/fields/auto-complete/config.js +1 -1
  56. package/dist/runtime/form/fields/auto-complete/types.d.ts +2 -2
  57. package/dist/runtime/form/fields/checkbox-card/component.vue +55 -29
  58. package/dist/runtime/form/fields/checkbox-card/config.d.ts +1 -0
  59. package/dist/runtime/form/fields/checkbox-card/config.js +1 -1
  60. package/dist/runtime/form/fields/checkbox-card/types.d.ts +3 -3
  61. package/dist/runtime/form/fields/checkbox-group/component.vue +18 -4
  62. package/dist/runtime/form/fields/checkbox-group/types.d.ts +2 -2
  63. package/dist/runtime/form/fields/choice-card/choice-card-label.d.vue.ts +7 -0
  64. package/dist/runtime/form/fields/choice-card/choice-card-label.vue +27 -1
  65. package/dist/runtime/form/fields/choice-card/choice-card-label.vue.d.ts +7 -0
  66. package/dist/runtime/form/fields/choice-card/types.d.ts +35 -1
  67. package/dist/runtime/form/fields/choice-card/use-choice-card.d.ts +7 -3
  68. package/dist/runtime/form/fields/choice-card/use-choice-card.js +37 -15
  69. package/dist/runtime/form/fields/choice-card/utils.d.ts +10 -0
  70. package/dist/runtime/form/fields/choice-card/utils.js +6 -0
  71. package/dist/runtime/form/fields/hierarchy/component.vue +3 -2
  72. package/dist/runtime/form/fields/index.d.ts +4 -0
  73. package/dist/runtime/form/fields/radio/component.vue +19 -2
  74. package/dist/runtime/form/fields/radio/types.d.ts +2 -2
  75. package/dist/runtime/form/fields/radio-card/component.vue +58 -28
  76. package/dist/runtime/form/fields/radio-card/config.d.ts +1 -0
  77. package/dist/runtime/form/fields/radio-card/config.js +1 -1
  78. package/dist/runtime/form/fields/radio-card/types.d.ts +3 -3
  79. package/dist/runtime/form/fields/select/component.vue +56 -58
  80. package/dist/runtime/form/fields/select/config.d.ts +1 -0
  81. package/dist/runtime/form/fields/select/config.js +1 -1
  82. package/dist/runtime/form/fields/select/types.d.ts +2 -2
  83. package/dist/runtime/form/types/field-base.d.ts +6 -0
  84. package/dist/runtime/form/types/field-kind.d.ts +3 -1
  85. package/dist/runtime/form/types/field.d.ts +1 -0
  86. package/dist/runtime/form/types/layout.d.ts +6 -0
  87. package/dist/runtime/form/types/options.d.ts +137 -0
  88. package/dist/runtime/form/types/page.d.ts +20 -8
  89. package/dist/runtime/form/types/ui.d.ts +29 -4
  90. package/dist/runtime/form/utils/disabled.d.ts +11 -0
  91. package/dist/runtime/form/utils/disabled.js +11 -0
  92. package/dist/runtime/form/utils/field-instance.js +3 -0
  93. package/dist/runtime/form/utils/options.d.ts +56 -11
  94. package/dist/runtime/form/utils/options.js +86 -0
  95. package/dist/runtime/form/utils/page-surface.d.ts +26 -0
  96. package/dist/runtime/form/utils/page-surface.js +28 -0
  97. package/dist/runtime/form/utils/page.d.ts +21 -1
  98. package/dist/runtime/form/utils/page.js +24 -2
  99. package/dist/runtime/i18n/locales/en.js +28 -8
  100. package/dist/runtime/i18n/locales/fr.js +28 -8
  101. package/dist/runtime/i18n/types.d.ts +46 -7
  102. package/dist/runtime/spreadsheet/components/internal/spreadsheet-import-column-row.d.vue.ts +2 -2
  103. package/dist/runtime/spreadsheet/components/internal/spreadsheet-import-column-row.vue.d.ts +2 -2
  104. package/dist/runtime/table/components/actions/row-actions.d.vue.ts +2 -0
  105. package/dist/runtime/table/components/actions/row-actions.vue +8 -3
  106. package/dist/runtime/table/components/actions/row-actions.vue.d.ts +2 -0
  107. package/dist/runtime/table/components/data-list/data-list-content.vue +7 -1
  108. package/dist/runtime/table/components/data-list/data-list-default.d.vue.ts +16 -16
  109. package/dist/runtime/table/components/data-list/data-list-default.vue +3 -0
  110. package/dist/runtime/table/components/data-list/data-list-default.vue.d.ts +16 -16
  111. package/dist/runtime/table/components/data-list/data-list-layout-switch.vue +7 -9
  112. package/dist/runtime/table/components/data-list/data-list-root.vue +5 -6
  113. package/dist/runtime/table/components/data-list/data-list-sort-menu.vue +3 -1
  114. package/dist/runtime/table/components/data-list/data-list-table.d.vue.ts +8 -1
  115. package/dist/runtime/table/components/data-list/data-list-table.vue +18 -1
  116. package/dist/runtime/table/components/data-list/data-list-table.vue.d.ts +8 -1
  117. package/dist/runtime/table/components/data-list/data-list-view-toggle.d.vue.ts +25 -0
  118. package/dist/runtime/table/components/data-list/data-list-view-toggle.vue +57 -0
  119. package/dist/runtime/table/components/data-list/data-list-view-toggle.vue.d.ts +25 -0
  120. package/dist/runtime/table/components/data-list/sort-menu-panel.vue +1 -1
  121. package/dist/runtime/table/components/filters/tags/boolean-filter-tag.d.vue.ts +2 -2
  122. package/dist/runtime/table/components/filters/tags/boolean-filter-tag.vue.d.ts +2 -2
  123. package/dist/runtime/table/components/filters/tags/date-filter-tag.d.vue.ts +2 -2
  124. package/dist/runtime/table/components/filters/tags/date-filter-tag.vue.d.ts +2 -2
  125. package/dist/runtime/table/components/filters/tags/number-filter-tag.d.vue.ts +2 -2
  126. package/dist/runtime/table/components/filters/tags/number-filter-tag.vue.d.ts +2 -2
  127. package/dist/runtime/table/components/filters/tags/option-filter-tag.d.vue.ts +2 -2
  128. package/dist/runtime/table/components/filters/tags/option-filter-tag.vue.d.ts +2 -2
  129. package/dist/runtime/table/components/filters/tags/text-filter-tag.d.vue.ts +2 -2
  130. package/dist/runtime/table/components/filters/tags/text-filter-tag.vue.d.ts +2 -2
  131. package/dist/runtime/table/components/layout/table-footer.d.vue.ts +6 -4
  132. package/dist/runtime/table/components/layout/table-footer.vue +80 -3
  133. package/dist/runtime/table/components/layout/table-footer.vue.d.ts +6 -4
  134. package/dist/runtime/table/components/summary/summary-content.d.ts +13 -0
  135. package/dist/runtime/table/components/summary/summary-content.js +5 -0
  136. package/dist/runtime/table/components/summary/summary-renderer.d.vue.ts +31 -0
  137. package/dist/runtime/table/components/summary/summary-renderer.vue +282 -0
  138. package/dist/runtime/table/components/summary/summary-renderer.vue.d.ts +31 -0
  139. package/dist/runtime/table/components/summary/summary-row.d.vue.ts +19 -0
  140. package/dist/runtime/table/components/summary/summary-row.vue +102 -0
  141. package/dist/runtime/table/components/summary/summary-row.vue.d.ts +19 -0
  142. package/dist/runtime/table/components/table/table-empty-state.vue +39 -9
  143. package/dist/runtime/table/components/table/table-renderer.vue +1 -1
  144. package/dist/runtime/table/components/table/table-row-actions-control.vue +10 -6
  145. package/dist/runtime/table/components/table/table-selection-control.d.vue.ts +5 -1
  146. package/dist/runtime/table/components/table/table-selection-control.vue +17 -4
  147. package/dist/runtime/table/components/table/table-selection-control.vue.d.ts +5 -1
  148. package/dist/runtime/table/components/table/table-tree-control.vue +2 -1
  149. package/dist/runtime/table/components/table/table-tree-header.vue +0 -1
  150. package/dist/runtime/table/composables/use-table-api.d.ts +2 -0
  151. package/dist/runtime/table/composables/use-table-api.js +8 -0
  152. package/dist/runtime/table/composables/use-table-columns.d.ts +2 -0
  153. package/dist/runtime/table/composables/use-table-controls.d.ts +6 -0
  154. package/dist/runtime/table/composables/use-table-controls.js +6 -3
  155. package/dist/runtime/table/composables/use-table-internals.d.ts +33 -0
  156. package/dist/runtime/table/composables/use-table-internals.js +9 -0
  157. package/dist/runtime/table/composables/use-table-row-labels.d.ts +16 -0
  158. package/dist/runtime/table/composables/use-table-row-labels.js +22 -0
  159. package/dist/runtime/table/composables/use-table-row-summary.d.ts +18 -0
  160. package/dist/runtime/table/composables/use-table-row-summary.js +41 -0
  161. package/dist/runtime/table/constants/mobile.d.ts +79 -0
  162. package/dist/runtime/table/constants/mobile.js +17 -0
  163. package/dist/runtime/table/constants/summary.d.ts +67 -0
  164. package/dist/runtime/table/constants/summary.js +31 -0
  165. package/dist/runtime/table/types/data-list.d.ts +58 -8
  166. package/dist/runtime/table/types/layout.d.ts +73 -0
  167. package/dist/runtime/table/types/remote-options.d.ts +4 -1
  168. package/dist/runtime/table/types/schema.d.ts +9 -1
  169. package/dist/runtime/table/types/table-api.d.ts +12 -0
  170. package/dist/runtime/table/utils/columns/defs.js +3 -1
  171. package/dist/runtime/table/utils/columns/render.d.ts +2 -0
  172. package/dist/runtime/table/utils/columns/render.js +2 -2
  173. package/dist/runtime/table/utils/data-list-ui.d.ts +1 -1
  174. package/dist/runtime/table/utils/data-list-ui.js +3 -1
  175. package/dist/runtime/table/utils/mobile-defaults.d.ts +7 -0
  176. package/dist/runtime/table/utils/mobile-defaults.js +25 -0
  177. package/dist/runtime/table/utils/remote-table-options.js +1 -1
  178. package/package.json +1 -1
@@ -0,0 +1,41 @@
1
+ import { useCookie } from "nuxt/app";
2
+ import { computed, ref } from "vue";
3
+ import { useResponsiveValue } from "#ui-tools/shared";
4
+ import { isFunction } from "../../shared/utils/predicate.js";
5
+ import {
6
+ TABLE_SUMMARY_DEFAULT_ENABLED,
7
+ TABLE_SUMMARY_PREFERENCE_MAX_AGE
8
+ } from "../constants/summary.js";
9
+ export function useTableRowSummary(params) {
10
+ const summary = computed(() => params.schema.value.table?.summary);
11
+ const enabled = useResponsiveValue(() => {
12
+ const configured = summary.value?.enabled;
13
+ const resolved = isFunction(configured) ? configured() : configured;
14
+ return String(resolved ?? TABLE_SUMMARY_DEFAULT_ENABLED);
15
+ }, "boolean");
16
+ const available = computed(
17
+ () => summary.value !== void 0 && !params.tree.enabled.value && params.layout.tableEnabled.value && params.layout.activeLayout.value === "table" && (enabled.value ?? true)
18
+ );
19
+ const persistPreferences = computed(() => params.schema.value.persistence?.preferences !== false);
20
+ const cookieName = `${encodeURIComponent(params.schema.value.tableKey)}::view`;
21
+ const stored = useCookie(cookieName, {
22
+ decode: (value) => value === "table" ? "table" : null,
23
+ default: () => null,
24
+ encode: (value) => value ?? "",
25
+ maxAge: TABLE_SUMMARY_PREFERENCE_MAX_AGE
26
+ });
27
+ const session = ref(null);
28
+ const choice = computed({
29
+ get: () => persistPreferences.value ? stored.value : session.value,
30
+ set: (next) => {
31
+ if (persistPreferences.value) stored.value = next;
32
+ else session.value = next;
33
+ }
34
+ });
35
+ const active = computed(() => available.value && choice.value === null);
36
+ function setActive(next) {
37
+ if (!available.value) return;
38
+ choice.value = next ? null : "table";
39
+ }
40
+ return { active, available, setActive };
41
+ }
@@ -0,0 +1,79 @@
1
+ /**
2
+ * The classes the package adds below the `md` breakpoint, so every control a thumb reaches has a
3
+ * 44px tap target. `layerDataListMobileDefaults` puts them under the classes a slot already has,
4
+ * which keeps the app's own slot classes and lets them win where they conflict. Desktop sizing is
5
+ * untouched.
6
+ */
7
+ export declare const DATA_LIST_MOBILE_DEFAULTS: {
8
+ readonly columnPanel: {
9
+ readonly ui: {
10
+ readonly trigger: "min-h-11 min-w-11";
11
+ };
12
+ };
13
+ readonly content: {
14
+ readonly ui: {
15
+ readonly retry: "min-h-11 min-w-11";
16
+ };
17
+ };
18
+ readonly filterPanel: {
19
+ readonly ui: {
20
+ readonly trigger: "min-h-11 min-w-11";
21
+ };
22
+ };
23
+ readonly filterTags: {
24
+ readonly ui: {
25
+ readonly sheetTrigger: "min-h-11 min-w-11";
26
+ };
27
+ };
28
+ readonly infiniteLoader: {
29
+ readonly ui: {
30
+ readonly loadMore: "min-h-11 min-w-11";
31
+ readonly retry: "min-h-11 min-w-11";
32
+ };
33
+ };
34
+ readonly layoutSwitch: {
35
+ readonly ui: {
36
+ readonly trigger: "min-h-11 min-w-11";
37
+ };
38
+ };
39
+ readonly pagination: {
40
+ readonly ui: {
41
+ readonly button: "min-h-11 min-w-11";
42
+ };
43
+ };
44
+ readonly refresh: {
45
+ readonly ui: {
46
+ readonly base: "min-h-11 min-w-11";
47
+ };
48
+ };
49
+ readonly search: {
50
+ readonly ui: {
51
+ readonly base: "min-h-11";
52
+ readonly clear: "min-h-11 min-w-11";
53
+ };
54
+ };
55
+ readonly selectionActions: {
56
+ readonly ui: {
57
+ readonly action: "h-11 min-w-11";
58
+ readonly dismiss: "size-11";
59
+ readonly overflow: "size-11";
60
+ };
61
+ };
62
+ readonly sortMenu: {
63
+ readonly ui: {
64
+ readonly trigger: "min-h-11 min-w-11";
65
+ };
66
+ };
67
+ readonly table: {
68
+ readonly ui: {
69
+ readonly emptyAction: "min-h-11 min-w-11";
70
+ readonly rowAction: "min-h-11 min-w-11";
71
+ readonly selectControl: "relative before:absolute before:top-1/2 before:left-1/2 before:size-11 before:-translate-x-1/2 before:-translate-y-1/2";
72
+ };
73
+ };
74
+ readonly viewToggle: {
75
+ readonly ui: {
76
+ readonly base: "min-h-11 min-w-11";
77
+ };
78
+ };
79
+ };
@@ -0,0 +1,17 @@
1
+ const TOUCH_TARGET = "min-h-11 min-w-11";
2
+ const TOUCH_AREA = "relative before:absolute before:top-1/2 before:left-1/2 before:size-11 before:-translate-x-1/2 before:-translate-y-1/2";
3
+ export const DATA_LIST_MOBILE_DEFAULTS = {
4
+ columnPanel: { ui: { trigger: TOUCH_TARGET } },
5
+ content: { ui: { retry: TOUCH_TARGET } },
6
+ filterPanel: { ui: { trigger: TOUCH_TARGET } },
7
+ filterTags: { ui: { sheetTrigger: TOUCH_TARGET } },
8
+ infiniteLoader: { ui: { loadMore: TOUCH_TARGET, retry: TOUCH_TARGET } },
9
+ layoutSwitch: { ui: { trigger: TOUCH_TARGET } },
10
+ pagination: { ui: { button: TOUCH_TARGET } },
11
+ refresh: { ui: { base: TOUCH_TARGET } },
12
+ search: { ui: { base: "min-h-11", clear: TOUCH_TARGET } },
13
+ selectionActions: { ui: { action: "h-11 min-w-11", dismiss: "size-11", overflow: "size-11" } },
14
+ sortMenu: { ui: { trigger: TOUCH_TARGET } },
15
+ table: { ui: { emptyAction: TOUCH_TARGET, rowAction: TOUCH_TARGET, selectControl: TOUCH_AREA } },
16
+ viewToggle: { ui: { base: TOUCH_TARGET } }
17
+ };
@@ -0,0 +1,67 @@
1
+ /** Summary rows below the `md` breakpoint, the full table from `md` up. */
2
+ export declare const TABLE_SUMMARY_DEFAULT_ENABLED = "true md:false";
3
+ /** How long the reader's summary/table choice is remembered, in seconds. */
4
+ export declare const TABLE_SUMMARY_PREFERENCE_MAX_AGE: number;
5
+ /** Separates the values of a summary row's detail line. */
6
+ export declare const TABLE_SUMMARY_DETAILS_SEPARATOR = " \u00B7 ";
7
+ /** From this many rows on, only the rows on screen are rendered, as in the table. */
8
+ export declare const TABLE_SUMMARY_VIRTUALIZE_THRESHOLD = 40;
9
+ /** Placeholder rows of a first load, however short the viewport is. */
10
+ export declare const TABLE_SUMMARY_SKELETON_MIN_ROWS = 6;
11
+ /** Rows from the end of a cursor list at which the next page is requested. */
12
+ export declare const TABLE_SUMMARY_LOAD_MORE_THRESHOLD = 6;
13
+ /** What each control size gives a row, in px: its font, side gutter, height and leading tile. */
14
+ export declare const TABLE_SUMMARY_SIZE_TOKENS: {
15
+ lg: {
16
+ font: number;
17
+ gutter: number;
18
+ row: number;
19
+ tile: number;
20
+ };
21
+ md: {
22
+ font: number;
23
+ gutter: number;
24
+ row: number;
25
+ tile: number;
26
+ };
27
+ sm: {
28
+ font: number;
29
+ gutter: number;
30
+ row: number;
31
+ tile: number;
32
+ };
33
+ xl: {
34
+ font: number;
35
+ gutter: number;
36
+ row: number;
37
+ tile: number;
38
+ };
39
+ xs: {
40
+ font: number;
41
+ gutter: number;
42
+ row: number;
43
+ tile: number;
44
+ };
45
+ };
46
+ /**
47
+ * The classes of every summary slot. Rows sit on the default surface, never on the page's tint,
48
+ * with a hairline between them; the app's `ui.summary.ui` is merged over these.
49
+ */
50
+ export declare const TABLE_SUMMARY_SLOT_CLASSES: {
51
+ readonly actions: "nut-dl-summary__actions flex shrink-0 items-center pe-[calc(var(--nut-dl-summary-x)/2)]";
52
+ readonly body: "nut-dl-summary__body min-w-0 flex-1";
53
+ readonly details: "nut-dl-summary__details min-w-0 truncate";
54
+ readonly header: "nut-dl-summary__header flex min-h-11 shrink-0 items-center gap-1 border-b border-muted bg-default pe-[var(--nut-dl-summary-x)] text-[length:var(--nut-dl-summary-meta)] font-medium text-muted";
55
+ readonly leading: "nut-dl-summary__leading flex size-[var(--nut-dl-summary-tile)] shrink-0 items-center justify-center overflow-hidden rounded-lg bg-accented text-xs font-semibold text-muted empty:hidden";
56
+ readonly list: "nut-dl-summary__list";
57
+ readonly loadingMore: "nut-dl-summary__more flex min-h-[var(--nut-dl-summary-row-h)] items-center justify-center gap-2.5 text-[12.5px] text-muted";
58
+ readonly main: "nut-dl-summary__main flex min-w-0 flex-1 items-center gap-3 py-2.5 text-start focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-primary";
59
+ readonly meta: "nut-dl-summary__meta mt-0.5 flex min-w-0 items-center gap-2 text-[length:var(--nut-dl-summary-meta)] leading-snug text-muted";
60
+ readonly root: "nut-dl-summary relative flex min-h-0 flex-col bg-default";
61
+ readonly row: "nut-dl-summary__row relative flex min-h-[var(--nut-dl-summary-row-h)] items-stretch border-b border-muted bg-default";
62
+ readonly select: "nut-dl-summary__select flex shrink-0 items-center";
63
+ readonly skeleton: "nut-dl-summary__skeleton flex min-h-[var(--nut-dl-summary-row-h)] items-center gap-3 border-b border-muted px-[var(--nut-dl-summary-x)]";
64
+ readonly status: "nut-dl-summary__status shrink-0 empty:hidden";
65
+ readonly title: "nut-dl-summary__title block truncate text-[length:var(--nut-dl-summary-font)] leading-snug font-semibold text-highlighted";
66
+ readonly viewport: "nut-dl-summary__viewport relative min-h-0 overflow-x-hidden overflow-y-auto";
67
+ };
@@ -0,0 +1,31 @@
1
+ export const TABLE_SUMMARY_DEFAULT_ENABLED = "true md:false";
2
+ export const TABLE_SUMMARY_PREFERENCE_MAX_AGE = 60 * 60 * 24 * 365;
3
+ export const TABLE_SUMMARY_DETAILS_SEPARATOR = " \xB7 ";
4
+ export const TABLE_SUMMARY_VIRTUALIZE_THRESHOLD = 40;
5
+ export const TABLE_SUMMARY_SKELETON_MIN_ROWS = 6;
6
+ export const TABLE_SUMMARY_LOAD_MORE_THRESHOLD = 6;
7
+ export const TABLE_SUMMARY_SIZE_TOKENS = {
8
+ lg: { font: 14, gutter: 16, row: 72, tile: 36 },
9
+ md: { font: 13.5, gutter: 14, row: 64, tile: 32 },
10
+ sm: { font: 13, gutter: 12, row: 60, tile: 32 },
11
+ xl: { font: 15, gutter: 16, row: 80, tile: 40 },
12
+ xs: { font: 12.5, gutter: 12, row: 56, tile: 28 }
13
+ };
14
+ export const TABLE_SUMMARY_SLOT_CLASSES = {
15
+ actions: "nut-dl-summary__actions flex shrink-0 items-center pe-[calc(var(--nut-dl-summary-x)/2)]",
16
+ body: "nut-dl-summary__body min-w-0 flex-1",
17
+ details: "nut-dl-summary__details min-w-0 truncate",
18
+ header: "nut-dl-summary__header flex min-h-11 shrink-0 items-center gap-1 border-b border-muted bg-default pe-[var(--nut-dl-summary-x)] text-[length:var(--nut-dl-summary-meta)] font-medium text-muted",
19
+ leading: "nut-dl-summary__leading flex size-[var(--nut-dl-summary-tile)] shrink-0 items-center justify-center overflow-hidden rounded-lg bg-accented text-xs font-semibold text-muted empty:hidden",
20
+ list: "nut-dl-summary__list",
21
+ loadingMore: "nut-dl-summary__more flex min-h-[var(--nut-dl-summary-row-h)] items-center justify-center gap-2.5 text-[12.5px] text-muted",
22
+ main: "nut-dl-summary__main flex min-w-0 flex-1 items-center gap-3 py-2.5 text-start focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-primary",
23
+ meta: "nut-dl-summary__meta mt-0.5 flex min-w-0 items-center gap-2 text-[length:var(--nut-dl-summary-meta)] leading-snug text-muted",
24
+ root: "nut-dl-summary relative flex min-h-0 flex-col bg-default",
25
+ row: "nut-dl-summary__row relative flex min-h-[var(--nut-dl-summary-row-h)] items-stretch border-b border-muted bg-default",
26
+ select: "nut-dl-summary__select flex shrink-0 items-center",
27
+ skeleton: "nut-dl-summary__skeleton flex min-h-[var(--nut-dl-summary-row-h)] items-center gap-3 border-b border-muted px-[var(--nut-dl-summary-x)]",
28
+ status: "nut-dl-summary__status shrink-0 empty:hidden",
29
+ title: "nut-dl-summary__title block truncate text-[length:var(--nut-dl-summary-font)] leading-snug font-semibold text-highlighted",
30
+ viewport: "nut-dl-summary__viewport relative min-h-0 overflow-x-hidden overflow-y-auto"
31
+ };
@@ -6,6 +6,7 @@ import type { PaginationProps } from '@nuxt/ui/components/Pagination.vue';
6
6
  import type { SelectProps } from '@nuxt/ui/components/Select.vue';
7
7
  import type { ComputedRef } from 'vue';
8
8
  import type { TableInternals } from '../composables/use-table-internals.js';
9
+ import type { TableEmptySchema } from './layout.js';
9
10
  import type { TableLayout } from './utils.js';
10
11
  export interface DataListTable {
11
12
  schema: ComputedRef<{
@@ -211,6 +212,14 @@ export interface DataListLayoutSwitchUi {
211
212
  triggerLeadingIcon?: DataListUiClass;
212
213
  triggerTrailingIcon?: DataListUiClass;
213
214
  }
215
+ /** UI slots rendered by the summary/table toggle. */
216
+ export interface DataListViewToggleUi {
217
+ [slot: string]: DataListUiClass | undefined;
218
+ base?: DataListUiClass;
219
+ label?: DataListUiClass;
220
+ leadingIcon?: DataListUiClass;
221
+ trailingIcon?: DataListUiClass;
222
+ }
214
223
  /** UI slots rendered by the content state boundary. */
215
224
  export interface DataListContentUi {
216
225
  root?: DataListUiClass;
@@ -244,6 +253,35 @@ export interface DataListTableUi {
244
253
  loading?: DataListUiClass;
245
254
  loadingOverlay?: DataListUiClass;
246
255
  emptyOverlay?: DataListUiClass;
256
+ /** The empty state's button: the reset of a filtered list and the first-use `empty.action`. */
257
+ emptyAction?: DataListUiClass;
258
+ /** The row-actions button at the end of each row, in the table and in summary rows. */
259
+ rowAction?: DataListUiClass;
260
+ /** The tap area around a selection checkbox, a row's or the select-all one, in the table and in summary rows. */
261
+ selectControl?: DataListUiClass;
262
+ }
263
+ /** UI slots rendered by summary rows, the compact presentation of the table layout. */
264
+ export interface DataListSummaryUi {
265
+ root?: DataListUiClass;
266
+ viewport?: DataListUiClass;
267
+ /** The select-all strip above the rows, present when the list has selection. */
268
+ header?: DataListUiClass;
269
+ list?: DataListUiClass;
270
+ row?: DataListUiClass;
271
+ /** The checkbox cell of a row and of the select-all strip. */
272
+ select?: DataListUiClass;
273
+ /** The tappable part of a row: everything between the checkbox and the actions. */
274
+ main?: DataListUiClass;
275
+ leading?: DataListUiClass;
276
+ body?: DataListUiClass;
277
+ title?: DataListUiClass;
278
+ /** The line under the title, holding the status and the details. */
279
+ meta?: DataListUiClass;
280
+ status?: DataListUiClass;
281
+ details?: DataListUiClass;
282
+ actions?: DataListUiClass;
283
+ skeleton?: DataListUiClass;
284
+ loadingMore?: DataListUiClass;
247
285
  }
248
286
  /** UI slots rendered by the grid mode and its built-in states. */
249
287
  export interface DataListGridUi {
@@ -356,16 +394,19 @@ export interface DataListLayoutSwitchProps {
356
394
  /** Icons per layout; defaults to list and box icons. */
357
395
  icons?: Partial<Record<TableLayout, string>>;
358
396
  }
359
- /** Component props exposed by the table renderer controls. */
397
+ /** Component props exposed by the summary/table toggle. */
398
+ export interface DataListViewToggleProps {
399
+ button?: DataListButtonProps;
400
+ }
401
+ /** Component props exposed by the table renderer controls, shared by summary rows. */
360
402
  export interface DataListTableProps {
361
403
  checkbox?: DataListCheckboxProps;
362
404
  rowActions?: DataListButtonProps;
363
- /** Empty state copy; `description: false` hides the second line. */
364
- empty?: {
365
- icon?: string;
366
- title?: string;
367
- description?: string | false;
368
- };
405
+ /**
406
+ * Empty state copy and first-use action shared by every list. A list's own `empty` schema
407
+ * field wins, field by field. `description: false` hides the second line.
408
+ */
409
+ empty?: TableEmptySchema;
369
410
  }
370
411
  /** Component props exposed by offset pagination. */
371
412
  export interface DataListPaginationProps {
@@ -432,13 +473,22 @@ export interface DataListUiConfig {
432
473
  columnPanel?: DataListPartConfig<DataListColumnPanelUi, DataListColumnPanelProps>;
433
474
  sortMenu?: DataListPartConfig<DataListSortMenuUi, DataListSortMenuProps>;
434
475
  layoutSwitch?: DataListPartConfig<DataListLayoutSwitchUi, DataListLayoutSwitchProps>;
476
+ viewToggle?: DataListPartConfig<DataListViewToggleUi, DataListViewToggleProps>;
435
477
  content?: DataListPartConfig<DataListContentUi>;
436
478
  table?: DataListTableConfig;
479
+ summary?: DataListPartConfig<DataListSummaryUi>;
437
480
  grid?: DataListGridConfig;
438
481
  pagination?: DataListPartConfig<DataListPaginationUi, DataListPaginationProps>;
439
482
  infiniteLoader?: DataListPartConfig<DataListInfiniteLoaderUi, DataListInfiniteLoaderProps>;
440
483
  selectionActions?: DataListPartConfig<DataListSelectionActionsUi, DataListSelectionActionsProps>;
441
- /** Overrides merged on top of this config while the viewport is below the `md` breakpoint. */
484
+ /**
485
+ * Overrides merged on top of this config while the viewport is below the `md` breakpoint.
486
+ *
487
+ * Below `md` the package also adds a 44px touch target (`min-h-11 min-w-11` and alike) to the
488
+ * controls a thumb reaches, under the classes of each `ui` slot: yours add to them and win only
489
+ * where they conflict. To shrink a control back, state the conflicting utilities, for example
490
+ * `min-h-0 min-w-0`.
491
+ */
442
492
  mobile?: Omit<DataListUiConfig, 'mobile'>;
443
493
  }
444
494
  export interface DataListGridConfig extends DataListPartConfig<DataListGridUi> {
@@ -1,3 +1,5 @@
1
+ import type { ButtonProps } from '@nuxt/ui/components/Button.vue';
2
+ import type { LinkProps } from '@nuxt/ui/components/Link.vue';
1
3
  import type { TableColumnCollection, TableSummaryRequest, TableSummaryScope, TableSummaryValue } from './columns.js';
2
4
  import type { TableTreeSchema } from './tree.js';
3
5
  import type { GenericObject, TableDefaultSort, TableGridSortOption, TableLayout, TableRowRenderParams, RenderableType, TableSortKey, TableTextValue } from './utils.js';
@@ -5,6 +7,27 @@ export interface TablePersistenceOptions {
5
7
  state?: boolean;
6
8
  preferences?: boolean;
7
9
  }
10
+ /**
11
+ * The button of a first-use empty state. Any Nuxt UI button prop applies; `label` may be lazy so
12
+ * it follows the locale.
13
+ */
14
+ export interface TableEmptyAction extends Omit<ButtonProps, 'ui' | 'label'> {
15
+ label: TableTextValue;
16
+ /** Runs on click. Use `to` instead to navigate. */
17
+ onClick?: (event: MouseEvent) => void;
18
+ }
19
+ /**
20
+ * What a list shows when it has no records at all. Anything left out keeps the localized default.
21
+ * A list hidden by filters or a search always offers to reset them instead, never `action`.
22
+ */
23
+ export interface TableEmptySchema {
24
+ icon?: string;
25
+ title?: TableTextValue;
26
+ /** `false` hides the second line. */
27
+ description?: TableTextValue | false;
28
+ /** The first thing to do in an empty list, such as creating the first record. */
29
+ action?: TableEmptyAction;
30
+ }
8
31
  export type TableLayoutControl<TLayout extends TableLayout = TableLayout> = boolean | string | Partial<Record<TLayout, boolean | string>> | (() => boolean | string | Partial<Record<TLayout, boolean | string>>);
9
32
  export interface TableControlsSchema {
10
33
  refresh?: TableLayoutControl;
@@ -13,6 +36,8 @@ export interface TableControlsSchema {
13
36
  filters?: TableLayoutControl;
14
37
  sort?: TableLayoutControl;
15
38
  actions?: TableLayoutControl;
39
+ /** The toggle between summary rows and the full table, offered while `table.summary` is active. */
40
+ summary?: TableLayoutControl;
16
41
  }
17
42
  export interface TableSelectionSchema {
18
43
  mode?: false | true | 'auto';
@@ -59,6 +84,54 @@ export interface TableTableSchema<TRow extends GenericObject = GenericObject, TC
59
84
  defaultSorting?: TableDefaultSort<TSortKey>;
60
85
  selection?: boolean | 'auto';
61
86
  summaries?: TableSummariesSchema<TRow>;
87
+ /**
88
+ * Reads each record as one compact row instead of a line of columns, the way a phone screen
89
+ * needs it. Off until configured; see `TableRowSummarySchema` for when it applies.
90
+ */
91
+ summary?: TableRowSummarySchema<TRow, TContext, TPageContext>;
92
+ }
93
+ /** One value of a summary row's detail line. Empty values are skipped. */
94
+ export type TableRowSummaryValue = string | number | null | undefined | false;
95
+ /**
96
+ * A record as one summary row: an identity, one status, a couple of useful values and the row
97
+ * actions. Every callback receives the params a grid card gets, with `layout: 'table'`.
98
+ *
99
+ * Summary rows replace the column table, so columns, column sorting and the totals row are not
100
+ * shown while they are active. Filters, search, selection, row actions and pagination work as in
101
+ * the table, and a toggle brings the full table back.
102
+ *
103
+ * @example
104
+ * summary: {
105
+ * leading: ({ row }) => h(UAvatar, { text: initials(row.name), size: 'md' }),
106
+ * title: ({ row }) => row.name,
107
+ * status: ({ row }) => h(UBadge, { label: STATUS[row.status], variant: 'subtle' }),
108
+ * details: ({ row }) => [row.kind, row.city],
109
+ * to: ({ row }) => `/accounts/${row.id}`,
110
+ * }
111
+ */
112
+ export interface TableRowSummarySchema<TRow extends GenericObject = GenericObject, TContext extends GenericObject = GenericObject, TPageContext extends GenericObject = GenericObject> {
113
+ /**
114
+ * Where summary rows replace the column table: `true`, `false`, a responsive string, or a
115
+ * getter returning either. The reader can still switch to the table from the toggle.
116
+ * @default 'true md:false' Summary rows below the `md` breakpoint, the table from `md` up.
117
+ * @example 'true lg:false' // summary rows on tablets too
118
+ */
119
+ enabled?: boolean | string | (() => boolean | string);
120
+ /** The record's identity. One line, cut with an ellipsis when it does not fit. */
121
+ title: (params: TableRowRenderParams<TRow, TContext, TPageContext>) => string | number;
122
+ /**
123
+ * A 32px tile before the title: an avatar, an icon, initials. It is clipped to a rounded
124
+ * square, so pass an element that fills it.
125
+ */
126
+ leading?: (params: TableRowRenderParams<TRow, TContext, TPageContext>) => RenderableType;
127
+ /** One status pill, first on the line under the title. */
128
+ status?: (params: TableRowRenderParams<TRow, TContext, TPageContext>) => RenderableType;
129
+ /** The two or so values worth reading without opening the record, joined with " · ". */
130
+ details?: (params: TableRowRenderParams<TRow, TContext, TPageContext>) => TableRowSummaryValue[];
131
+ /** Makes the row a link to the record. Return `undefined` for a row that is not one. */
132
+ to?: (params: TableRowRenderParams<TRow, TContext, TPageContext>) => LinkProps['to'] | undefined;
133
+ /** Runs when the row is tapped. With `to`, it runs before the navigation. */
134
+ onSelect?: (params: TableRowRenderParams<TRow, TContext, TPageContext>) => void;
62
135
  }
63
136
  export interface TableSummariesSchema<TRow extends GenericObject = GenericObject> {
64
137
  /** Rows the aggregates describe; defaults to `filtered`. */
@@ -39,7 +39,10 @@ export interface RemoteTableOptionsConfig<TRow extends GenericObject, TOption ex
39
39
  * values the loaded pages do not contain. Defaults to `'id'`.
40
40
  */
41
41
  valueKey?: TableKnownFieldPath<TRow> | 'id';
42
- /** Filters applied to every request, e.g. active accounts only. */
42
+ /**
43
+ * Filters applied to every page request, e.g. active accounts only. The lookup of selected
44
+ * values ignores them, so a value the filters now exclude still shows its label.
45
+ */
43
46
  filters?: readonly TableResolvedFilterGroup<TableKnownFieldPath<TRow> | string>[];
44
47
  /** Page type and size. Must match what the endpoint pages by. Defaults to cursor pages of 25. */
45
48
  pagination?: RemoteOptionsPagination;
@@ -1,14 +1,22 @@
1
1
  import type { TableBulkAction, TableRowAction, TableToolbarAction } from './actions.js';
2
2
  import type { TableContextDataFromItems, TableContextItem, TablePageContextItem } from './context.js';
3
3
  import type { TableFiltersSchema } from './filters.js';
4
- import type { TableControlsSchema, TableGridSchema, TablePaginationSchema, TablePersistenceOptions, TableSelectionSchema, TableTableSchema } from './layout.js';
4
+ import type { TableControlsSchema, TableEmptySchema, TableGridSchema, TablePaginationSchema, TablePersistenceOptions, TableSelectionSchema, TableTableSchema } from './layout.js';
5
5
  import type { InferTableSourceRow, ExtractTableSourceResult, NormalizeTableSource, TableCursorPageResult, TableSource, TableSourceExecutionResult } from './source.js';
6
6
  import type { TableKnownFieldPath, TableLayout, TableRowKey, TableSortKey, GenericObject } from './utils.js';
7
7
  export interface TableSchema<TRow extends GenericObject = GenericObject, TContextItems extends TableContextItem[] = TableContextItem[], TPageContextItems extends TablePageContextItem<TRow, TableContextDataFromItems<TContextItems>>[] = TablePageContextItem<TRow, TableContextDataFromItems<TContextItems>>[], TFilterKey extends string = TableKnownFieldPath<TRow>, TSortKey extends string = TableSortKey<TRow>> {
8
8
  tableKey: string;
9
9
  rowKey: TableRowKey<TRow>;
10
10
  source: TableSource<TRow, TableContextDataFromItems<TContextItems>, TRow[] | TableSourceExecutionResult<TRow> | TableCursorPageResult<TRow>>;
11
+ /**
12
+ * Names a record for assistive technology, in "Select {label}" and "Actions for {label}".
13
+ * Without it the controls name the row by its position on the page.
14
+ * @example (row) => row.name
15
+ */
16
+ rowLabel?: (row: TRow) => string | number | null | undefined;
11
17
  defaultLayout?: TableLayout;
18
+ /** What the list shows while it has no records at all. See `TableEmptySchema`. */
19
+ empty?: TableEmptySchema;
12
20
  pagination?: TablePaginationSchema;
13
21
  context?: TContextItems;
14
22
  pageContext?: TPageContextItems;
@@ -103,6 +103,18 @@ export interface TableApi<TSchema = TableSchemaView> {
103
103
  }>;
104
104
  set: (layout: TableLayout) => void;
105
105
  };
106
+ /**
107
+ * Summary rows, the compact presentation of the table layout. With no `table.summary` in the
108
+ * schema, or where it is not enabled, `state.available` is `false` and `set` has no effect.
109
+ */
110
+ summary: {
111
+ state: ComputedRef<{
112
+ active: boolean;
113
+ available: boolean;
114
+ }>;
115
+ /** Shows the summary rows (`true`) or the full table (`false`), and remembers the choice. */
116
+ set: (active: boolean) => void;
117
+ };
106
118
  filters: {
107
119
  state: ComputedRef<TableFilterState>;
108
120
  search: WritableComputedRef<string>;
@@ -48,7 +48,9 @@ export function createColumnDefs(options) {
48
48
  canHide: false,
49
49
  internal: "selection",
50
50
  label: "",
51
- render: ({ row, index }) => selection.cell({ row: { id: options.params.selection.getRowId({ index, row }) } }),
51
+ render: ({ row, index }) => selection.cell({
52
+ row: { id: options.params.selection.getRowId({ index, row }), index, original: row }
53
+ }),
52
54
  renderHeader: () => selection.header(),
53
55
  sortable: false
54
56
  },
@@ -9,6 +9,8 @@ export declare function createSelectionColumn(options: {
9
9
  cell: ({ row }: {
10
10
  row: {
11
11
  id: string;
12
+ original: GenericObject;
13
+ index: number;
12
14
  };
13
15
  }) => import("vue/jsx-runtime").JSX.Element;
14
16
  enableHiding: boolean;
@@ -29,7 +29,8 @@ export function createSelectionColumn(options) {
29
29
  TableSelectionControl,
30
30
  {
31
31
  modelValue: options.params.selection.isRowSelected({ rowId }),
32
- ariaLabel: "Select row",
32
+ row: row.original,
33
+ index: row.index,
33
34
  onToggle: (event) => options.params.selection.toggleRowSelection({
34
35
  rowId,
35
36
  selected: !options.params.selection.isRowSelected({ rowId }),
@@ -46,7 +47,6 @@ export function createSelectionColumn(options) {
46
47
  TableSelectionControl,
47
48
  {
48
49
  modelValue: options.params.selection.allSelected.value ? true : options.params.selection.partiallySelected.value ? "indeterminate" : false,
49
- ariaLabel: "Select all rows",
50
50
  onToggle: () => options.params.selection.toggleAllRows({
51
51
  selected: !options.params.selection.allSelected.value
52
52
  })
@@ -122,6 +122,6 @@ export declare function resolveDataListTableDensity(density: DataListDensity): {
122
122
  export declare function resolveDataListContentShellClass(options: {
123
123
  layout: 'table' | 'grid';
124
124
  surface: DataListContentSurface;
125
- }): "grid gap-5" | "overflow-hidden" | "grid gap-5 overflow-hidden rounded-md border border-default bg-default" | "overflow-hidden rounded-md border border-default bg-default";
125
+ }): "overflow-hidden" | "grid gap-5 overflow-hidden rounded-md border border-default bg-default" | "grid gap-5" | "overflow-hidden rounded-md border border-default bg-default";
126
126
  /** Merges application and root DataList defaults without losing nested UI slots. */
127
127
  export declare function mergeDataListUiConfig(appUi: DataListUiConfig | undefined, componentUi: DataListUiConfig | undefined, density?: DataListDensity, size?: DataListControlSize): DataListUiConfig;
@@ -205,7 +205,9 @@ export function mergeDataListUiConfig(appUi, componentUi, density, size) {
205
205
  search: mergeSearchConfig(appUi?.search, componentUi?.search),
206
206
  selectionActions: mergePartConfig(appUi?.selectionActions, componentUi?.selectionActions),
207
207
  sortMenu: mergePartConfig(appUi?.sortMenu, componentUi?.sortMenu),
208
- table: mergeUiConfig(appUi?.table, componentUi?.table)
208
+ summary: mergeUiConfig(appUi?.summary, componentUi?.summary),
209
+ table: mergeUiConfig(appUi?.table, componentUi?.table),
210
+ viewToggle: mergePartConfig(appUi?.viewToggle, componentUi?.viewToggle)
209
211
  };
210
212
  }
211
213
  function mergeUiConfig(appDefaults, componentConfig) {
@@ -0,0 +1,7 @@
1
+ import type { DataListUiConfig } from '../types/index.js';
2
+ /**
3
+ * Adds the package's mobile defaults to a config: a 44px touch target on every control a thumb
4
+ * reaches. Their classes go under the classes each slot already has, so an app's own slot classes
5
+ * are kept and win wherever they conflict.
6
+ */
7
+ export declare function layerDataListMobileDefaults(config: DataListUiConfig): DataListUiConfig;
@@ -0,0 +1,25 @@
1
+ import { isObject, isString } from "../../shared/utils/predicate.js";
2
+ import { DATA_LIST_MOBILE_DEFAULTS } from "../constants/mobile.js";
3
+ import { mergeDataListUiClass } from "./data-list-ui.js";
4
+ function isClassEntry(entry) {
5
+ return isString(entry[1]);
6
+ }
7
+ function readPart(config, name) {
8
+ const part = new Map(Object.entries(config)).get(name);
9
+ return isObject(part) ? part : {};
10
+ }
11
+ function layerPart(config, name, defaults) {
12
+ const own = readPart(config, name);
13
+ const ui = isObject(own.ui) ? own.ui : {};
14
+ const classes = new Map(Object.entries(ui).filter(isClassEntry));
15
+ const added = Object.entries(defaults).filter(isClassEntry).map(
16
+ ([slot, base]) => [slot, mergeDataListUiClass(base, void 0, classes.get(slot))]
17
+ );
18
+ return { ...own, ui: { ...ui, ...Object.fromEntries(added) } };
19
+ }
20
+ export function layerDataListMobileDefaults(config) {
21
+ const layered = Object.entries(DATA_LIST_MOBILE_DEFAULTS).map(
22
+ ([name, defaults]) => [name, layerPart(config, name, defaults.ui)]
23
+ );
24
+ return Object.assign({}, config, Object.fromEntries(layered));
25
+ }
@@ -8,7 +8,7 @@ export function remoteTableOptions(query, config) {
8
8
  function request(params) {
9
9
  const { page } = params;
10
10
  return {
11
- filters: [...config.filters ?? [], ...params.filters ?? []],
11
+ filters: params.filters ?? [...config.filters ?? []],
12
12
  pagination: pagination.type === "cursor" ? { count: "none", cursor: page.cursor, mode: "cursor", pageSize: page.size } : { count: "exact", mode: "offset", pageIndex: page.index - 1, pageSize: page.size },
13
13
  search: { fields: [...fields], value: params.search },
14
14
  sorting: params.filters ? [] : [...sorting]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nuxt-ui-tools",
3
- "version": "1.17.1",
3
+ "version": "1.19.0",
4
4
  "description": "Nuxt module and runtime toolkit for UI-heavy Nuxt applications",
5
5
  "homepage": "https://github.com/ChronicStone/nuxt-ui-tools#readme",
6
6
  "bugs": "https://github.com/ChronicStone/nuxt-ui-tools/issues",