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
@@ -6,12 +6,12 @@ type __VLS_Props = {
6
6
  };
7
7
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
8
8
  reset: () => any;
9
- assign: (header: number) => any;
10
9
  ignore: () => any;
10
+ assign: (header: number) => any;
11
11
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
12
12
  onReset?: (() => any) | undefined;
13
- onAssign?: ((header: number) => any) | undefined;
14
13
  onIgnore?: (() => any) | undefined;
14
+ onAssign?: ((header: number) => any) | undefined;
15
15
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
16
16
  declare const _default: typeof __VLS_export;
17
17
  export default _default;
@@ -12,8 +12,10 @@ type __VLS_Props = {
12
12
  declare var __VLS_8: {
13
13
  items: DropdownMenuItem[][];
14
14
  open: boolean;
15
+ label: string | undefined;
15
16
  }, __VLS_24: {
16
17
  items: DropdownMenuItem[][];
18
+ label: string | undefined;
17
19
  open: boolean;
18
20
  };
19
21
  type __VLS_Slots = {} & {
@@ -6,6 +6,7 @@ import { computed, ref, useAttrs } from "vue";
6
6
  import { useDataListBreakpoint } from "../../composables/use-data-list-breakpoint";
7
7
  import { useTableInternals } from "../../composables/use-table-internals";
8
8
  import { useTableRowActionScope } from "../../composables/use-table-row-actions";
9
+ import { useTableRowLabels } from "../../composables/use-table-row-labels";
9
10
  import { createRowActionDropdownGroups, resolveVisibleTableRowActions } from "../../utils";
10
11
  defineOptions({
11
12
  inheritAttrs: false
@@ -40,6 +41,10 @@ function runSheetItem(item) {
40
41
  item.onSelect?.(new Event("select"));
41
42
  }
42
43
  const scope = useTableRowActionScope();
44
+ const labels = useTableRowLabels();
45
+ const label = computed(
46
+ () => scope ? labels.rowActions({ index: scope.value.index, row: scope.value.row }) : void 0
47
+ );
43
48
  const portal = computed(() => props.portal ?? true);
44
49
  const visibleActions = computed(() => {
45
50
  if (!scope?.value) {
@@ -66,7 +71,7 @@ const items = computed(() => {
66
71
  v-if="scope && visibleActions.length && items.length && isMobile"
67
72
  v-model:open="sheetOpen"
68
73
  direction="bottom"
69
- title="Actions"
74
+ :title="label"
70
75
  :ui="{
71
76
  header: 'sr-only',
72
77
  content: 'nut-dl-sheet rounded-t-[16px]',
@@ -74,7 +79,7 @@ const items = computed(() => {
74
79
  body: 'p-0 pb-4'
75
80
  }"
76
81
  >
77
- <slot :items="items" :open="sheetOpen" />
82
+ <slot :items="items" :open="sheetOpen" :label="label" />
78
83
  <template #body>
79
84
  <div class="px-[10px] pt-2">
80
85
  <template v-for="(item, index) in sheetItems" :key="index">
@@ -111,7 +116,7 @@ const items = computed(() => {
111
116
  v-bind="attrs"
112
117
  >
113
118
  <template #default="slotProps">
114
- <slot v-bind="slotProps" :items="items" />
119
+ <slot v-bind="slotProps" :items="items" :label="label" />
115
120
  </template>
116
121
  </UDropdownMenu>
117
122
  </template>
@@ -12,8 +12,10 @@ type __VLS_Props = {
12
12
  declare var __VLS_8: {
13
13
  items: DropdownMenuItem[][];
14
14
  open: boolean;
15
+ label: string | undefined;
15
16
  }, __VLS_24: {
16
17
  items: DropdownMenuItem[][];
18
+ label: string | undefined;
17
19
  open: boolean;
18
20
  };
19
21
  type __VLS_Slots = {} & {
@@ -44,6 +44,7 @@ const viewportStyle = computed(() => {
44
44
  }
45
45
  return void 0;
46
46
  });
47
+ const presentation = computed(() => internals.rowSummary.active.value ? "summary" : "table");
47
48
  const rootUi = computed(() => dataListUi.ui.value.content?.ui);
48
49
  const resolvedSize = computed(
49
50
  () => props.size ?? dataListUi.ui.value.content?.size ?? dataListUi.controlSize.value
@@ -136,7 +137,12 @@ watch(
136
137
  mode="out-in"
137
138
  >
138
139
  <slot v-if="internals.controls.tableLayout.value === 'table'" name="table" :rows="rows">
139
- <DataListTable :size="resolvedSize" :fill="fit !== 'content'" class="min-h-0 flex-1">
140
+ <DataListTable
141
+ :key="presentation"
142
+ :size="resolvedSize"
143
+ :fill="fit !== 'content'"
144
+ class="min-h-0 flex-1"
145
+ >
140
146
  <template v-if="$slots.error" #error="scope">
141
147
  <slot name="error" v-bind="scope" />
142
148
  </template>
@@ -5,21 +5,21 @@ type __VLS_Props = {
5
5
  height?: string | number;
6
6
  ui?: DataListDefaultUi;
7
7
  };
8
- declare var __VLS_1: {}, __VLS_18: {}, __VLS_52: {
8
+ declare var __VLS_1: {}, __VLS_18: {}, __VLS_57: {
9
9
  layout: import("../../types/index.js").TableLayout;
10
- }, __VLS_55: {
10
+ }, __VLS_60: {
11
11
  layout: import("../../types/index.js").TableLayout;
12
- }, __VLS_58: any, __VLS_61: {
12
+ }, __VLS_63: any, __VLS_66: {
13
13
  layout: string;
14
14
  refresh: () => void;
15
15
  hasActiveQuery: boolean;
16
16
  clearQuery: () => void;
17
- }, __VLS_64: {}, __VLS_67: {}, __VLS_70: {}, __VLS_80: {
17
+ }, __VLS_69: {}, __VLS_72: {}, __VLS_75: {}, __VLS_85: {
18
18
  loadedCount: number;
19
- }, __VLS_83: {
19
+ }, __VLS_88: {
20
20
  error: {};
21
21
  retry: () => Promise<import("@tanstack/vue-query").InfiniteQueryObserverRefetchErrorResult<unknown, unknown> | import("@tanstack/vue-query").InfiniteQueryObserverSuccessResult<unknown, unknown> | import("@tanstack/vue-query").InfiniteQueryObserverLoadingErrorResult<unknown, unknown> | import("@tanstack/vue-query").InfiniteQueryObserverPendingResult<unknown, unknown> | import("@tanstack/vue-query").InfiniteQueryObserverPlaceholderResult<unknown, unknown> | undefined>;
22
- }, __VLS_86: {
22
+ }, __VLS_91: {
23
23
  loadedCount: number;
24
24
  totalCount: number | null;
25
25
  };
@@ -28,25 +28,25 @@ type __VLS_Slots = {} & {
28
28
  } & {
29
29
  actions?: (props: typeof __VLS_18) => any;
30
30
  } & {
31
- 'initial-loading'?: (props: typeof __VLS_52) => any;
31
+ 'initial-loading'?: (props: typeof __VLS_57) => any;
32
32
  } & {
33
- loading?: (props: typeof __VLS_55) => any;
33
+ loading?: (props: typeof __VLS_60) => any;
34
34
  } & {
35
- error?: (props: typeof __VLS_58) => any;
35
+ error?: (props: typeof __VLS_63) => any;
36
36
  } & {
37
- empty?: (props: typeof __VLS_61) => any;
37
+ empty?: (props: typeof __VLS_66) => any;
38
38
  } & {
39
- 'empty-table'?: (props: typeof __VLS_64) => any;
39
+ 'empty-table'?: (props: typeof __VLS_69) => any;
40
40
  } & {
41
- 'empty-grid'?: (props: typeof __VLS_67) => any;
41
+ 'empty-grid'?: (props: typeof __VLS_72) => any;
42
42
  } & {
43
- refreshing?: (props: typeof __VLS_70) => any;
43
+ refreshing?: (props: typeof __VLS_75) => any;
44
44
  } & {
45
- 'loading-more'?: (props: typeof __VLS_80) => any;
45
+ 'loading-more'?: (props: typeof __VLS_85) => any;
46
46
  } & {
47
- 'load-more-error'?: (props: typeof __VLS_83) => any;
47
+ 'load-more-error'?: (props: typeof __VLS_88) => any;
48
48
  } & {
49
- end?: (props: typeof __VLS_86) => any;
49
+ end?: (props: typeof __VLS_91) => any;
50
50
  };
51
51
  declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
52
52
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -15,6 +15,7 @@ import DataListRefresh from "./data-list-refresh.vue";
15
15
  import DataListSearch from "./data-list-search.vue";
16
16
  import DataListSelectionActions from "./data-list-selection-actions.vue";
17
17
  import DataListSortMenu from "./data-list-sort-menu.vue";
18
+ import DataListViewToggle from "./data-list-view-toggle.vue";
18
19
  const props = defineProps({
19
20
  title: { type: String, required: false },
20
21
  description: { type: String, required: false },
@@ -98,6 +99,8 @@ function humanizeKey(value) {
98
99
  <DataListColumnPanel v-if="controls.columns" />
99
100
  <DataListRefresh v-if="controls.refresh" />
100
101
  <DataListLayoutSwitch v-if="controls.layout" />
102
+ <!-- Offset pagination carries the toggle in its footer; the other modes have none. -->
103
+ <DataListViewToggle v-if="internals.pagination.mode.value !== 'offset'" />
101
104
  </div>
102
105
  </div>
103
106
  </header>
@@ -5,21 +5,21 @@ type __VLS_Props = {
5
5
  height?: string | number;
6
6
  ui?: DataListDefaultUi;
7
7
  };
8
- declare var __VLS_1: {}, __VLS_18: {}, __VLS_52: {
8
+ declare var __VLS_1: {}, __VLS_18: {}, __VLS_57: {
9
9
  layout: import("../../types/index.js").TableLayout;
10
- }, __VLS_55: {
10
+ }, __VLS_60: {
11
11
  layout: import("../../types/index.js").TableLayout;
12
- }, __VLS_58: any, __VLS_61: {
12
+ }, __VLS_63: any, __VLS_66: {
13
13
  layout: string;
14
14
  refresh: () => void;
15
15
  hasActiveQuery: boolean;
16
16
  clearQuery: () => void;
17
- }, __VLS_64: {}, __VLS_67: {}, __VLS_70: {}, __VLS_80: {
17
+ }, __VLS_69: {}, __VLS_72: {}, __VLS_75: {}, __VLS_85: {
18
18
  loadedCount: number;
19
- }, __VLS_83: {
19
+ }, __VLS_88: {
20
20
  error: {};
21
21
  retry: () => Promise<import("@tanstack/vue-query").InfiniteQueryObserverRefetchErrorResult<unknown, unknown> | import("@tanstack/vue-query").InfiniteQueryObserverSuccessResult<unknown, unknown> | import("@tanstack/vue-query").InfiniteQueryObserverLoadingErrorResult<unknown, unknown> | import("@tanstack/vue-query").InfiniteQueryObserverPendingResult<unknown, unknown> | import("@tanstack/vue-query").InfiniteQueryObserverPlaceholderResult<unknown, unknown> | undefined>;
22
- }, __VLS_86: {
22
+ }, __VLS_91: {
23
23
  loadedCount: number;
24
24
  totalCount: number | null;
25
25
  };
@@ -28,25 +28,25 @@ type __VLS_Slots = {} & {
28
28
  } & {
29
29
  actions?: (props: typeof __VLS_18) => any;
30
30
  } & {
31
- 'initial-loading'?: (props: typeof __VLS_52) => any;
31
+ 'initial-loading'?: (props: typeof __VLS_57) => any;
32
32
  } & {
33
- loading?: (props: typeof __VLS_55) => any;
33
+ loading?: (props: typeof __VLS_60) => any;
34
34
  } & {
35
- error?: (props: typeof __VLS_58) => any;
35
+ error?: (props: typeof __VLS_63) => any;
36
36
  } & {
37
- empty?: (props: typeof __VLS_61) => any;
37
+ empty?: (props: typeof __VLS_66) => any;
38
38
  } & {
39
- 'empty-table'?: (props: typeof __VLS_64) => any;
39
+ 'empty-table'?: (props: typeof __VLS_69) => any;
40
40
  } & {
41
- 'empty-grid'?: (props: typeof __VLS_67) => any;
41
+ 'empty-grid'?: (props: typeof __VLS_72) => any;
42
42
  } & {
43
- refreshing?: (props: typeof __VLS_70) => any;
43
+ refreshing?: (props: typeof __VLS_75) => any;
44
44
  } & {
45
- 'loading-more'?: (props: typeof __VLS_80) => any;
45
+ 'loading-more'?: (props: typeof __VLS_85) => any;
46
46
  } & {
47
- 'load-more-error'?: (props: typeof __VLS_83) => any;
47
+ 'load-more-error'?: (props: typeof __VLS_88) => any;
48
48
  } & {
49
- end?: (props: typeof __VLS_86) => any;
49
+ end?: (props: typeof __VLS_91) => any;
50
50
  };
51
51
  declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
52
52
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -8,6 +8,10 @@ import { useDataListBreakpoint } from "../../composables/use-data-list-breakpoin
8
8
  import { useDataListUi } from "../../composables/use-data-list-ui";
9
9
  import { useTableInternals } from "../../composables/use-table-internals";
10
10
  import { mergeDataListProps, mergeDataListUiClass } from "../../utils";
11
+ const LAYOUT_LABEL_KEYS = {
12
+ grid: "table.header.gridView",
13
+ table: "table.header.tableView"
14
+ };
11
15
  const props = defineProps({
12
16
  size: { type: String, required: false },
13
17
  labels: { type: Boolean, required: false },
@@ -59,21 +63,15 @@ function setLayout(layout) {
59
63
  :size="resolvedSize"
60
64
  :class="mergeDataListUiClass('nut-dl-layout', void 0, resolvedUi.root)"
61
65
  >
62
- <UTooltip
63
- v-for="layout in order"
64
- :key="layout"
65
- :text="layout === 'table' ? t('table.header.tableView') : t('table.header.gridView')"
66
- >
66
+ <UTooltip v-for="layout in order" :key="layout" :text="t(LAYOUT_LABEL_KEYS[layout])">
67
67
  <UButton
68
68
  v-bind="buttonProps(internals.controls.tableLayout.value === layout)"
69
69
  :data-active="internals.controls.tableLayout.value === layout"
70
70
  :icon="
71
71
  controlProps.icons?.[layout] ?? (layout === 'table' ? 'i-lucide-menu' : 'i-lucide-box')
72
72
  "
73
- :label="labels ? layout === 'table' ? 'Table' : 'Grid' : void 0"
74
- :aria-label="
75
- layout === 'table' ? t('table.header.tableView') : t('table.header.gridView')
76
- "
73
+ :label="labels ? t(LAYOUT_LABEL_KEYS[layout]) : void 0"
74
+ :aria-label="t(LAYOUT_LABEL_KEYS[layout])"
77
75
  :ui="{
78
76
  base: mergeDataListUiClass('nut-dl-layout__btn', void 0, resolvedUi.trigger),
79
77
  label: resolvedUi.triggerLabel,
@@ -7,6 +7,7 @@ import { useDataListBreakpoint } from "../../composables/use-data-list-breakpoin
7
7
  import { provideDataListUi } from "../../composables/use-data-list-ui";
8
8
  import { provideTableInternals } from "../../composables/use-table-internals";
9
9
  import { mergeDataListUiConfig } from "../../utils";
10
+ import { layerDataListMobileDefaults } from "../../utils/mobile-defaults";
10
11
  const props = defineProps({
11
12
  table: { type: Object, required: true },
12
13
  locale: { type: Object, required: false },
@@ -26,14 +27,12 @@ provideDataListUi(
26
27
  props.density,
27
28
  props.size
28
29
  );
29
- if (!isMobile.value || !merged.mobile) {
30
+ if (!isMobile.value) {
30
31
  return merged;
31
32
  }
32
- return mergeDataListUiConfig(
33
- merged,
34
- merged.mobile,
35
- merged.mobile.density,
36
- merged.mobile.control?.size
33
+ const { mobile } = merged;
34
+ return layerDataListMobileDefaults(
35
+ mobile ? mergeDataListUiConfig(merged, mobile, mobile.density, mobile.control?.size) : merged
37
36
  );
38
37
  })
39
38
  );
@@ -39,7 +39,9 @@ const resolvedUi = computed(() => ({
39
39
  ...dataListUi.ui.value.sortMenu?.ui,
40
40
  ...props.ui
41
41
  }));
42
- const visible = computed(() => props.layouts.includes(internals.controls.tableLayout.value));
42
+ const visible = computed(
43
+ () => props.layouts.includes(internals.controls.tableLayout.value) || internals.rowSummary.active.value && sortKeys.value.length > 0
44
+ );
43
45
  const triggerControlProps = computed(
44
46
  () => mergeDataListProps(
45
47
  { color: "neutral", size: resolvedSize.value, variant: "outline" },
@@ -1,13 +1,20 @@
1
1
  import type { DataListControlSize, DataListTableUi } from '../../types/index.js';
2
+ /**
3
+ * The table layout. Summary rows are its compact presentation, so they share its states and slots.
4
+ * The template carries no comment on purpose: in development a root comment turns the root into a
5
+ * fragment, which a transition around this component cannot leave, so the next view never comes in.
6
+ */
2
7
  type __VLS_Props = {
3
8
  height?: string;
4
9
  size?: DataListControlSize;
5
10
  fill?: boolean;
6
11
  ui?: DataListTableUi;
7
12
  };
8
- declare var __VLS_10: string, __VLS_11: any;
13
+ declare var __VLS_10: string, __VLS_11: any, __VLS_22: string, __VLS_23: any;
9
14
  type __VLS_Slots = {} & {
10
15
  [K in NonNullable<typeof __VLS_10>]?: (props: typeof __VLS_11) => any;
16
+ } & {
17
+ [K in NonNullable<typeof __VLS_22>]?: (props: typeof __VLS_23) => any;
11
18
  };
12
19
  declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
13
20
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -1,6 +1,8 @@
1
1
  <script setup>
2
2
  import { computed } from "vue";
3
3
  import { useDataListUi } from "../../composables/use-data-list-ui";
4
+ import { useTableInternals } from "../../composables/use-table-internals";
5
+ import SummaryRenderer from "../summary/summary-renderer.vue";
4
6
  import TableRenderer from "../table/table-renderer.vue";
5
7
  const props = defineProps({
6
8
  height: { type: String, required: false },
@@ -8,10 +10,14 @@ const props = defineProps({
8
10
  fill: { type: Boolean, required: false },
9
11
  ui: { type: Object, required: false }
10
12
  });
13
+ const internals = useTableInternals();
11
14
  const dataListUi = useDataListUi();
12
15
  const resolvedSize = computed(
13
16
  () => props.size ?? dataListUi.ui.value.table?.size ?? dataListUi.controlSize.value
14
17
  );
18
+ const summarySize = computed(
19
+ () => props.size ?? dataListUi.ui.value.summary?.size ?? resolvedSize.value
20
+ );
15
21
  const resolvedUi = computed(() => ({
16
22
  ...dataListUi.ui.value.table?.ui,
17
23
  ...props.ui
@@ -19,7 +25,18 @@ const resolvedUi = computed(() => ({
19
25
  </script>
20
26
 
21
27
  <template>
22
- <TableRenderer :height="height" :size="resolvedSize" :fill="fill" :ui="resolvedUi">
28
+ <SummaryRenderer
29
+ v-if="internals.rowSummary.active.value"
30
+ :height="height"
31
+ :size="summarySize"
32
+ :fill="fill"
33
+ :ui="dataListUi.ui.value.summary?.ui"
34
+ >
35
+ <template v-for="(_, name) in $slots" #[name]="scope">
36
+ <slot :name="name" v-bind="scope ?? {}" />
37
+ </template>
38
+ </SummaryRenderer>
39
+ <TableRenderer v-else :height="height" :size="resolvedSize" :fill="fill" :ui="resolvedUi">
23
40
  <template v-for="(_, name) in $slots" #[name]="scope">
24
41
  <slot :name="name" v-bind="scope ?? {}" />
25
42
  </template>
@@ -1,13 +1,20 @@
1
1
  import type { DataListControlSize, DataListTableUi } from '../../types/index.js';
2
+ /**
3
+ * The table layout. Summary rows are its compact presentation, so they share its states and slots.
4
+ * The template carries no comment on purpose: in development a root comment turns the root into a
5
+ * fragment, which a transition around this component cannot leave, so the next view never comes in.
6
+ */
2
7
  type __VLS_Props = {
3
8
  height?: string;
4
9
  size?: DataListControlSize;
5
10
  fill?: boolean;
6
11
  ui?: DataListTableUi;
7
12
  };
8
- declare var __VLS_10: string, __VLS_11: any;
13
+ declare var __VLS_10: string, __VLS_11: any, __VLS_22: string, __VLS_23: any;
9
14
  type __VLS_Slots = {} & {
10
15
  [K in NonNullable<typeof __VLS_10>]?: (props: typeof __VLS_11) => any;
16
+ } & {
17
+ [K in NonNullable<typeof __VLS_22>]?: (props: typeof __VLS_23) => any;
11
18
  };
12
19
  declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
13
20
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -0,0 +1,25 @@
1
+ import type { DataListControlSize, DataListViewToggleProps, DataListViewToggleUi } from '../../types/index.js';
2
+ type __VLS_Props = {
3
+ size?: DataListControlSize;
4
+ ui?: DataListViewToggleUi;
5
+ props?: DataListViewToggleProps;
6
+ };
7
+ declare function toggle(): void;
8
+ declare var __VLS_1: {
9
+ active: boolean;
10
+ available: boolean;
11
+ label: string;
12
+ toggle: typeof toggle;
13
+ };
14
+ type __VLS_Slots = {} & {
15
+ default?: (props: typeof __VLS_1) => any;
16
+ };
17
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
18
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
19
+ declare const _default: typeof __VLS_export;
20
+ export default _default;
21
+ type __VLS_WithSlots<T, S> = T & {
22
+ new (): {
23
+ $slots: S;
24
+ };
25
+ };
@@ -0,0 +1,57 @@
1
+ <script setup>
2
+ import UButton from "@nuxt/ui/components/Button.vue";
3
+ import { computed } from "vue";
4
+ import { useUiToolsLocale } from "#ui-tools/i18n";
5
+ import { useDataListUi } from "../../composables/use-data-list-ui";
6
+ import { useTableInternals } from "../../composables/use-table-internals";
7
+ import { mergeDataListProps, mergeDataListUiClass } from "../../utils";
8
+ const props = defineProps({
9
+ size: { type: String, required: false },
10
+ ui: { type: Object, required: false },
11
+ props: { type: Object, required: false }
12
+ });
13
+ const internals = useTableInternals();
14
+ const dataListUi = useDataListUi();
15
+ const { t } = useUiToolsLocale();
16
+ const { rowSummary } = internals;
17
+ const resolvedSize = computed(
18
+ () => props.size ?? dataListUi.ui.value.viewToggle?.size ?? dataListUi.controlSize.value
19
+ );
20
+ const resolvedUi = computed(() => ({
21
+ ...dataListUi.ui.value.viewToggle?.ui,
22
+ ...props.ui
23
+ }));
24
+ const label = computed(
25
+ () => t(rowSummary.active.value ? "table.header.tableView" : "table.header.summaryView")
26
+ );
27
+ const buttonProps = computed(
28
+ () => mergeDataListProps(
29
+ { color: "primary", size: resolvedSize.value, variant: "link" },
30
+ dataListUi.ui.value.viewToggle?.props?.button,
31
+ props.props?.button
32
+ )
33
+ );
34
+ function toggle() {
35
+ rowSummary.setActive(!rowSummary.active.value);
36
+ }
37
+ </script>
38
+
39
+ <template>
40
+ <slot
41
+ :active="rowSummary.active.value"
42
+ :available="rowSummary.available.value"
43
+ :label="label"
44
+ :toggle="toggle"
45
+ >
46
+ <UButton
47
+ v-if="internals.controls.headerControls.value.summary"
48
+ v-bind="buttonProps"
49
+ :label="label"
50
+ :ui="{
51
+ ...resolvedUi,
52
+ base: mergeDataListUiClass('nut-dl-view-toggle font-semibold', void 0, resolvedUi.base)
53
+ }"
54
+ @click="toggle"
55
+ />
56
+ </slot>
57
+ </template>
@@ -0,0 +1,25 @@
1
+ import type { DataListControlSize, DataListViewToggleProps, DataListViewToggleUi } from '../../types/index.js';
2
+ type __VLS_Props = {
3
+ size?: DataListControlSize;
4
+ ui?: DataListViewToggleUi;
5
+ props?: DataListViewToggleProps;
6
+ };
7
+ declare function toggle(): void;
8
+ declare var __VLS_1: {
9
+ active: boolean;
10
+ available: boolean;
11
+ label: string;
12
+ toggle: typeof toggle;
13
+ };
14
+ type __VLS_Slots = {} & {
15
+ default?: (props: typeof __VLS_1) => any;
16
+ };
17
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
18
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
19
+ declare const _default: typeof __VLS_export;
20
+ export default _default;
21
+ type __VLS_WithSlots<T, S> = T & {
22
+ new (): {
23
+ $slots: S;
24
+ };
25
+ };
@@ -77,7 +77,7 @@ function humanize(value) {
77
77
  :aria-checked="activeDirection === dir"
78
78
  class="flex min-w-0 items-center justify-center gap-1.5 overflow-hidden rounded-[5px] px-1 font-medium whitespace-nowrap outline-none transition-colors focus-visible:ring-2 focus-visible:ring-primary/40"
79
79
  :class="[
80
- compact ? 'h-7 text-[12px]' : 'h-8 text-[12.5px]',
80
+ compact ? 'h-7 text-[12px]' : 'h-11 text-[13px]',
81
81
  activeDirection === dir ? 'nut-dl-sort__dir--active bg-default text-highlighted shadow-[0_0_0_1px_var(--ui-border)]' : 'text-muted hover:text-default'
82
82
  ]"
83
83
  @click="emit('selectDirection', dir)"
@@ -27,12 +27,12 @@ type __VLS_Slots = {} & {
27
27
  trigger?: (props: typeof __VLS_10) => any;
28
28
  };
29
29
  declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
30
- back: () => any;
31
30
  dismiss: () => any;
31
+ back: () => any;
32
32
  sessionClosed: () => any;
33
33
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
34
- onBack?: (() => any) | undefined;
35
34
  onDismiss?: (() => any) | undefined;
35
+ onBack?: (() => any) | undefined;
36
36
  onSessionClosed?: (() => any) | undefined;
37
37
  }>, {
38
38
  header: boolean;
@@ -27,12 +27,12 @@ type __VLS_Slots = {} & {
27
27
  trigger?: (props: typeof __VLS_10) => any;
28
28
  };
29
29
  declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
30
- back: () => any;
31
30
  dismiss: () => any;
31
+ back: () => any;
32
32
  sessionClosed: () => any;
33
33
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
34
- onBack?: (() => any) | undefined;
35
34
  onDismiss?: (() => any) | undefined;
35
+ onBack?: (() => any) | undefined;
36
36
  onSessionClosed?: (() => any) | undefined;
37
37
  }>, {
38
38
  header: boolean;
@@ -29,12 +29,12 @@ type __VLS_Slots = {} & {
29
29
  trigger?: (props: typeof __VLS_10) => any;
30
30
  };
31
31
  declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
32
- back: () => any;
33
32
  dismiss: () => any;
33
+ back: () => any;
34
34
  sessionClosed: () => any;
35
35
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
36
- onBack?: (() => any) | undefined;
37
36
  onDismiss?: (() => any) | undefined;
37
+ onBack?: (() => any) | undefined;
38
38
  onSessionClosed?: (() => any) | undefined;
39
39
  }>, {
40
40
  header: boolean;
@@ -29,12 +29,12 @@ type __VLS_Slots = {} & {
29
29
  trigger?: (props: typeof __VLS_10) => any;
30
30
  };
31
31
  declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
32
- back: () => any;
33
32
  dismiss: () => any;
33
+ back: () => any;
34
34
  sessionClosed: () => any;
35
35
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
36
- onBack?: (() => any) | undefined;
37
36
  onDismiss?: (() => any) | undefined;
37
+ onBack?: (() => any) | undefined;
38
38
  onSessionClosed?: (() => any) | undefined;
39
39
  }>, {
40
40
  header: boolean;
@@ -28,12 +28,12 @@ type __VLS_Slots = {} & {
28
28
  trigger?: (props: typeof __VLS_10) => any;
29
29
  };
30
30
  declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
31
- back: () => any;
32
31
  dismiss: () => any;
32
+ back: () => any;
33
33
  sessionClosed: () => any;
34
34
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
35
- onBack?: (() => any) | undefined;
36
35
  onDismiss?: (() => any) | undefined;
36
+ onBack?: (() => any) | undefined;
37
37
  onSessionClosed?: (() => any) | undefined;
38
38
  }>, {
39
39
  header: boolean;
@@ -28,12 +28,12 @@ type __VLS_Slots = {} & {
28
28
  trigger?: (props: typeof __VLS_10) => any;
29
29
  };
30
30
  declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
31
- back: () => any;
32
31
  dismiss: () => any;
32
+ back: () => any;
33
33
  sessionClosed: () => any;
34
34
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
35
- onBack?: (() => any) | undefined;
36
35
  onDismiss?: (() => any) | undefined;
36
+ onBack?: (() => any) | undefined;
37
37
  onSessionClosed?: (() => any) | undefined;
38
38
  }>, {
39
39
  header: boolean;