nuxt-ui-tools 0.1.0 → 0.1.1

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 (164) hide show
  1. package/dist/module.d.mts +4 -0
  2. package/dist/module.json +1 -1
  3. package/dist/module.mjs +30 -15
  4. package/dist/runtime/form/components/actions/FormActions.d.vue.ts +0 -2
  5. package/dist/runtime/form/components/actions/FormActions.vue +5 -8
  6. package/dist/runtime/form/components/actions/FormActions.vue.d.ts +0 -2
  7. package/dist/runtime/form/components/layout/DrawerLayout.vue +5 -1
  8. package/dist/runtime/form/components/layout/ModalLayout.vue +5 -1
  9. package/dist/runtime/form/components/renderer/FormCompositeControl.d.vue.ts +15 -0
  10. package/dist/runtime/form/components/renderer/FormCompositeControl.vue +13 -0
  11. package/dist/runtime/form/components/renderer/FormCompositeControl.vue.d.ts +15 -0
  12. package/dist/runtime/form/components/renderer/FormFieldRenderer.d.vue.ts +1 -0
  13. package/dist/runtime/form/components/renderer/FormFieldRenderer.vue +19 -3
  14. package/dist/runtime/form/components/renderer/FormFieldRenderer.vue.d.ts +1 -0
  15. package/dist/runtime/form/components/renderer/FormFieldShell.d.vue.ts +4 -4
  16. package/dist/runtime/form/components/renderer/FormFieldShell.vue +15 -1
  17. package/dist/runtime/form/components/renderer/FormFieldShell.vue.d.ts +4 -4
  18. package/dist/runtime/form/components/root/Form.vue +5 -3
  19. package/dist/runtime/form/composables/use-field-control.d.ts +1 -1
  20. package/dist/runtime/form/composables/use-field-control.js +4 -0
  21. package/dist/runtime/form/composables/use-field-options.d.ts +1 -1
  22. package/dist/runtime/form/composables/use-field-options.js +75 -31
  23. package/dist/runtime/form/composables/use-form-field-chrome.d.ts +3 -0
  24. package/dist/runtime/form/composables/use-form-field-chrome.js +9 -0
  25. package/dist/runtime/form/composables/use-form-runtime.js +17 -5
  26. package/dist/runtime/form/fields/array-list/component.vue +4 -1
  27. package/dist/runtime/form/fields/auto-complete/component.vue +23 -16
  28. package/dist/runtime/form/fields/checkbox-card/component.vue +28 -29
  29. package/dist/runtime/form/fields/checkbox-group/component.vue +28 -29
  30. package/dist/runtime/form/fields/color-picker/component.vue +4 -2
  31. package/dist/runtime/form/fields/date-family/component.vue +9 -4
  32. package/dist/runtime/form/fields/hierarchy/SelectionCheckbox.d.vue.ts +13 -0
  33. package/dist/runtime/form/fields/hierarchy/SelectionCheckbox.vue +24 -0
  34. package/dist/runtime/form/fields/hierarchy/SelectionCheckbox.vue.d.ts +13 -0
  35. package/dist/runtime/form/fields/hierarchy/SelectionRadio.d.vue.ts +14 -0
  36. package/dist/runtime/form/fields/hierarchy/SelectionRadio.vue +27 -0
  37. package/dist/runtime/form/fields/hierarchy/SelectionRadio.vue.d.ts +14 -0
  38. package/dist/runtime/form/fields/hierarchy/component.vue +257 -142
  39. package/dist/runtime/form/fields/hierarchy/utils.d.ts +9 -0
  40. package/dist/runtime/form/fields/hierarchy/utils.js +32 -0
  41. package/dist/runtime/form/fields/input-group/component.vue +7 -30
  42. package/dist/runtime/form/fields/matrix/component.vue +9 -3
  43. package/dist/runtime/form/fields/phone-number/component.vue +7 -2
  44. package/dist/runtime/form/fields/rating/component.vue +25 -2
  45. package/dist/runtime/form/fields/select/component.vue +29 -21
  46. package/dist/runtime/form/fields/switch-group/component.vue +8 -3
  47. package/dist/runtime/form/fields/time/component.vue +7 -5
  48. package/dist/runtime/form/fields/upload/component.vue +5 -3
  49. package/dist/runtime/form/types/api.d.ts +9 -3
  50. package/dist/runtime/form/types/field-base.d.ts +3 -1
  51. package/dist/runtime/form/types/runtime.d.ts +2 -0
  52. package/dist/runtime/form/types/ui.d.ts +1 -0
  53. package/dist/runtime/form/utils/api.js +3 -0
  54. package/dist/runtime/form/utils/options.d.ts +11 -2
  55. package/dist/runtime/form/utils/options.js +57 -9
  56. package/dist/runtime/form/utils/state.js +10 -2
  57. package/dist/runtime/i18n/locales/en.js +38 -0
  58. package/dist/runtime/i18n/locales/fr.js +38 -0
  59. package/dist/runtime/i18n/types.d.ts +38 -0
  60. package/dist/runtime/i18n/use-locale.d.ts +2 -2
  61. package/dist/runtime/i18n/use-locale.js +3 -3
  62. package/dist/runtime/table/components/DataList.d.vue.ts +2 -0
  63. package/dist/runtime/table/components/DataList.vue.d.ts +2 -0
  64. package/dist/runtime/table/components/actions/RowActions.d.vue.ts +4 -2
  65. package/dist/runtime/table/components/actions/RowActions.vue +2 -0
  66. package/dist/runtime/table/components/actions/RowActions.vue.d.ts +4 -2
  67. package/dist/runtime/table/components/data-list/DataListAddFilter.d.vue.ts +5 -3
  68. package/dist/runtime/table/components/data-list/DataListAddFilter.vue +6 -1
  69. package/dist/runtime/table/components/data-list/DataListAddFilter.vue.d.ts +5 -3
  70. package/dist/runtime/table/components/data-list/DataListContent.d.vue.ts +24 -17
  71. package/dist/runtime/table/components/data-list/DataListContent.vue +70 -17
  72. package/dist/runtime/table/components/data-list/DataListContent.vue.d.ts +24 -17
  73. package/dist/runtime/table/components/data-list/DataListDefault.d.vue.ts +2 -0
  74. package/dist/runtime/table/components/data-list/DataListDefault.vue.d.ts +2 -0
  75. package/dist/runtime/table/components/data-list/DataListFilterTags.d.vue.ts +2 -0
  76. package/dist/runtime/table/components/data-list/DataListFilterTags.vue.d.ts +2 -0
  77. package/dist/runtime/table/components/data-list/DataListLayoutSwitch.vue +17 -11
  78. package/dist/runtime/table/components/data-list/DataListRoot.vue +2 -46
  79. package/dist/runtime/table/components/data-list/DataListSortMenu.vue +6 -0
  80. package/dist/runtime/table/components/filters/shared/DynamicFilterPicker.d.vue.ts +5 -0
  81. package/dist/runtime/table/components/filters/shared/DynamicFilterPicker.vue +182 -59
  82. package/dist/runtime/table/components/filters/shared/DynamicFilterPicker.vue.d.ts +5 -0
  83. package/dist/runtime/table/components/filters/shared/FilterMatchModeButton.d.vue.ts +3 -1
  84. package/dist/runtime/table/components/filters/shared/FilterMatchModeButton.vue +29 -5
  85. package/dist/runtime/table/components/filters/shared/FilterMatchModeButton.vue.d.ts +3 -1
  86. package/dist/runtime/table/components/filters/shared/FilterMatchModePanel.d.vue.ts +17 -0
  87. package/dist/runtime/table/components/filters/shared/FilterMatchModePanel.vue +47 -0
  88. package/dist/runtime/table/components/filters/shared/FilterMatchModePanel.vue.d.ts +17 -0
  89. package/dist/runtime/table/components/filters/shared/FilterOptionMultipleList.d.vue.ts +3 -1
  90. package/dist/runtime/table/components/filters/shared/FilterOptionMultipleList.vue +12 -3
  91. package/dist/runtime/table/components/filters/shared/FilterOptionMultipleList.vue.d.ts +3 -1
  92. package/dist/runtime/table/components/filters/shared/FilterOptionPickerContent.d.vue.ts +3 -0
  93. package/dist/runtime/table/components/filters/shared/FilterOptionPickerContent.vue +11 -1
  94. package/dist/runtime/table/components/filters/shared/FilterOptionPickerContent.vue.d.ts +3 -0
  95. package/dist/runtime/table/components/filters/shared/FilterOptionRow.d.vue.ts +3 -0
  96. package/dist/runtime/table/components/filters/shared/FilterOptionRow.vue +48 -9
  97. package/dist/runtime/table/components/filters/shared/FilterOptionRow.vue.d.ts +3 -0
  98. package/dist/runtime/table/components/filters/shared/FilterOptionSingleList.d.vue.ts +3 -0
  99. package/dist/runtime/table/components/filters/shared/FilterOptionSingleList.vue +35 -9
  100. package/dist/runtime/table/components/filters/shared/FilterOptionSingleList.vue.d.ts +3 -0
  101. package/dist/runtime/table/components/filters/shared/FilterOptionTreeContent.d.vue.ts +3 -0
  102. package/dist/runtime/table/components/filters/shared/FilterOptionTreeContent.vue +77 -20
  103. package/dist/runtime/table/components/filters/shared/FilterOptionTreeContent.vue.d.ts +3 -0
  104. package/dist/runtime/table/components/filters/shared/FilterPopoverShell.d.vue.ts +27 -0
  105. package/dist/runtime/table/components/filters/shared/FilterPopoverShell.vue +36 -0
  106. package/dist/runtime/table/components/filters/shared/FilterPopoverShell.vue.d.ts +27 -0
  107. package/dist/runtime/table/components/filters/shared/FilterSearchablePanel.d.vue.ts +3 -0
  108. package/dist/runtime/table/components/filters/shared/FilterSearchablePanel.vue +40 -10
  109. package/dist/runtime/table/components/filters/shared/FilterSearchablePanel.vue.d.ts +3 -0
  110. package/dist/runtime/table/components/filters/shared/FilterStageTransition.d.vue.ts +23 -0
  111. package/dist/runtime/table/components/filters/shared/FilterStageTransition.vue +21 -0
  112. package/dist/runtime/table/components/filters/shared/FilterStageTransition.vue.d.ts +23 -0
  113. package/dist/runtime/table/components/filters/shared/FilterTriggerTag.d.vue.ts +3 -2
  114. package/dist/runtime/table/components/filters/shared/FilterTriggerTag.vue +26 -25
  115. package/dist/runtime/table/components/filters/shared/FilterTriggerTag.vue.d.ts +3 -2
  116. package/dist/runtime/table/components/filters/tags/BooleanFilterTag.d.vue.ts +1 -1
  117. package/dist/runtime/table/components/filters/tags/BooleanFilterTag.vue +75 -22
  118. package/dist/runtime/table/components/filters/tags/BooleanFilterTag.vue.d.ts +1 -1
  119. package/dist/runtime/table/components/filters/tags/DateFilterTag.d.vue.ts +3 -1
  120. package/dist/runtime/table/components/filters/tags/DateFilterTag.vue +254 -160
  121. package/dist/runtime/table/components/filters/tags/DateFilterTag.vue.d.ts +3 -1
  122. package/dist/runtime/table/components/filters/tags/FilterTagsBar.d.vue.ts +7 -6
  123. package/dist/runtime/table/components/filters/tags/FilterTagsBar.vue +12 -27
  124. package/dist/runtime/table/components/filters/tags/FilterTagsBar.vue.d.ts +7 -6
  125. package/dist/runtime/table/components/filters/tags/NumberFilterTag.d.vue.ts +3 -2
  126. package/dist/runtime/table/components/filters/tags/NumberFilterTag.vue +192 -106
  127. package/dist/runtime/table/components/filters/tags/NumberFilterTag.vue.d.ts +3 -2
  128. package/dist/runtime/table/components/filters/tags/OptionFilterTag.d.vue.ts +3 -2
  129. package/dist/runtime/table/components/filters/tags/OptionFilterTag.vue +110 -48
  130. package/dist/runtime/table/components/filters/tags/OptionFilterTag.vue.d.ts +3 -2
  131. package/dist/runtime/table/components/filters/tags/TextFilterTag.d.vue.ts +3 -2
  132. package/dist/runtime/table/components/filters/tags/TextFilterTag.vue +120 -57
  133. package/dist/runtime/table/components/filters/tags/TextFilterTag.vue.d.ts +3 -2
  134. package/dist/runtime/table/components/grid/GridRenderer.vue +1 -1
  135. package/dist/runtime/table/components/layout/TableFooter.vue +1 -0
  136. package/dist/runtime/table/components/table/TableRenderer.vue +18 -9
  137. package/dist/runtime/table/composables/use-filter-tag-session.d.ts +3 -4
  138. package/dist/runtime/table/composables/use-filter-tag-session.js +12 -32
  139. package/dist/runtime/table/composables/use-query-state.d.ts +3 -3
  140. package/dist/runtime/table/composables/use-query-state.js +7 -32
  141. package/dist/runtime/table/composables/use-table-api.js +2 -2
  142. package/dist/runtime/table/composables/use-table-columns.d.ts +1 -11
  143. package/dist/runtime/table/composables/use-table-filter-presentation.d.ts +0 -3
  144. package/dist/runtime/table/composables/use-table-filter-presentation.js +0 -9
  145. package/dist/runtime/table/composables/use-table-filters.js +18 -7
  146. package/dist/runtime/table/composables/use-table-internals.d.ts +3 -42
  147. package/dist/runtime/table/types/actions.d.ts +1 -1
  148. package/dist/runtime/table/types/data-list.d.ts +41 -8
  149. package/dist/runtime/table/types/filters.d.ts +4 -0
  150. package/dist/runtime/table/utils/actions.d.ts +1 -1
  151. package/dist/runtime/table/utils/columns/menu.d.ts +2 -11
  152. package/dist/runtime/table/utils/columns/render.d.ts +2 -9
  153. package/dist/runtime/table/utils/columns/render.js +4 -4
  154. package/dist/runtime/table/utils/data-list-ui.d.ts +3 -1
  155. package/dist/runtime/table/utils/data-list-ui.js +45 -0
  156. package/dist/runtime/table/utils/filters/editor-size.d.ts +11 -0
  157. package/dist/runtime/table/utils/filters/editor-size.js +45 -0
  158. package/dist/runtime/table/utils/filters/index.d.ts +1 -1
  159. package/dist/runtime/table/utils/filters/index.js +1 -1
  160. package/dist/runtime/table/utils/query-state.d.ts +18 -1
  161. package/dist/runtime/table/utils/query-state.js +109 -0
  162. package/package.json +4 -2
  163. package/dist/runtime/table/utils/filters/operators.d.ts +0 -4
  164. package/dist/runtime/table/utils/filters/operators.js +0 -6
@@ -321,8 +321,16 @@ function resolveFieldDefault(field, ctx) {
321
321
  return typeof value === "function" ? cloneFormValue(value({ ctx })) : cloneFormValue(value);
322
322
  if (fieldInstance.type.is("checkbox")) return false;
323
323
  if (fieldInstance.type.is("switch")) return resolveSwitchDefault(field);
324
- if (fieldInstance.type.is("checkbox-group")) return [];
325
- if (fieldInstance.type.isAny(["tree", "tree-select", "cascader"]) && Object.getOwnPropertyDescriptor(field, "multiple")?.value === true)
324
+ if (fieldInstance.type.isAny(["checkbox-group", "checkbox-card", "switch-group"])) return [];
325
+ if (fieldInstance.type.isAny([
326
+ "auto-complete",
327
+ "select",
328
+ "file",
329
+ "upload",
330
+ "tree",
331
+ "tree-select",
332
+ "cascader"
333
+ ]) && Object.getOwnPropertyDescriptor(field, "multiple")?.value === true)
326
334
  return [];
327
335
  if (fieldInstance.type.is("tag")) return [];
328
336
  if (fieldInstance.type.is("slider")) return 0;
@@ -14,6 +14,44 @@ export default defineUiToolsLocale({
14
14
  fields: {
15
15
  text: {
16
16
  defaultPlaceholder: "Enter a value"
17
+ },
18
+ options: {
19
+ refresh: "Refresh",
20
+ create: "Create option",
21
+ creating: "Creating\u2026",
22
+ createNamed: 'Create "{label}"'
23
+ },
24
+ hierarchy: {
25
+ search: "Search",
26
+ empty: "No matching options",
27
+ clear: "Clear selection"
28
+ },
29
+ rating: {
30
+ value: "{value} of {max}"
31
+ },
32
+ date: {
33
+ start: "Start",
34
+ end: "End",
35
+ clear: "Clear value"
36
+ },
37
+ time: {
38
+ format: "HH:mm",
39
+ hour: "Hour",
40
+ minute: "Minute",
41
+ clear: "Clear time"
42
+ },
43
+ color: {
44
+ open: "Open color picker",
45
+ clear: "Clear color"
46
+ },
47
+ upload: {
48
+ upload: "Upload",
49
+ remove: "Remove",
50
+ failed: "Upload failed."
51
+ },
52
+ phone: {
53
+ country: "Country calling code",
54
+ number: "Phone number"
17
55
  }
18
56
  }
19
57
  },
@@ -14,6 +14,44 @@ export default defineUiToolsLocale({
14
14
  fields: {
15
15
  text: {
16
16
  defaultPlaceholder: "Saisissez une valeur"
17
+ },
18
+ options: {
19
+ refresh: "Actualiser",
20
+ create: "Cr\xE9er une option",
21
+ creating: "Cr\xE9ation\u2026",
22
+ createNamed: "Cr\xE9er \xAB {label} \xBB"
23
+ },
24
+ hierarchy: {
25
+ search: "Rechercher",
26
+ empty: "Aucune option correspondante",
27
+ clear: "Effacer la s\xE9lection"
28
+ },
29
+ rating: {
30
+ value: "{value} sur {max}"
31
+ },
32
+ date: {
33
+ start: "D\xE9but",
34
+ end: "Fin",
35
+ clear: "Effacer la valeur"
36
+ },
37
+ time: {
38
+ format: "HH:mm",
39
+ hour: "Heure",
40
+ minute: "Minute",
41
+ clear: "Effacer l\u2019heure"
42
+ },
43
+ color: {
44
+ open: "Ouvrir le s\xE9lecteur de couleur",
45
+ clear: "Effacer la couleur"
46
+ },
47
+ upload: {
48
+ upload: "T\xE9l\xE9verser",
49
+ remove: "Supprimer",
50
+ failed: "\xC9chec du t\xE9l\xE9versement."
51
+ },
52
+ phone: {
53
+ country: "Indicatif du pays",
54
+ number: "Num\xE9ro de t\xE9l\xE9phone"
17
55
  }
18
56
  }
19
57
  },
@@ -238,6 +238,44 @@ export interface UiToolsFormMessages {
238
238
  text: {
239
239
  defaultPlaceholder: string;
240
240
  };
241
+ options: {
242
+ refresh: string;
243
+ create: string;
244
+ creating: string;
245
+ createNamed: string;
246
+ };
247
+ hierarchy: {
248
+ search: string;
249
+ empty: string;
250
+ clear: string;
251
+ };
252
+ rating: {
253
+ value: string;
254
+ };
255
+ date: {
256
+ start: string;
257
+ end: string;
258
+ clear: string;
259
+ };
260
+ time: {
261
+ format: string;
262
+ hour: string;
263
+ minute: string;
264
+ clear: string;
265
+ };
266
+ color: {
267
+ open: string;
268
+ clear: string;
269
+ };
270
+ upload: {
271
+ upload: string;
272
+ remove: string;
273
+ failed: string;
274
+ };
275
+ phone: {
276
+ country: string;
277
+ number: string;
278
+ };
241
279
  };
242
280
  }
243
281
  export interface Messages {
@@ -1,6 +1,6 @@
1
1
  import { type InjectionKey, type Ref } from 'vue';
2
- import type { Locale, Messages } from '#ui-tools/i18n/types';
2
+ import type { Locale, Messages } from './types.js';
3
3
  export declare const uiToolsLocaleContextInjectionKey: InjectionKey<Ref<Locale<Messages> | undefined>>;
4
4
  export declare function useUiToolsLocaleRef(localeOverrides?: Ref<Locale<Messages> | undefined>): import("vue").ComputedRef<Locale<Messages>>;
5
- export declare function useUiToolsLocale(localeOverrides?: Ref<Locale<Messages> | undefined>): import("#ui-tools/i18n/utils").UiToolsLocaleContext<Messages>;
5
+ export declare function useUiToolsLocale(localeOverrides?: Ref<Locale<Messages> | undefined>): import("./utils.js").UiToolsLocaleContext<Messages>;
6
6
  export declare function provideUiToolsLocale(locale: Ref<Locale<Messages> | undefined>): void;
@@ -1,8 +1,8 @@
1
1
  import { useLocale as useNuxtUiLocale } from "@nuxt/ui/composables/useLocale";
2
2
  import { computed, inject, provide } from "vue";
3
- import { fr } from "#ui-tools/i18n/locales";
4
- import en from "#ui-tools/i18n/locales/en";
5
- import { buildUiToolsLocaleContext } from "#ui-tools/i18n/utils";
3
+ import { fr } from "./locales/index.js";
4
+ import en from "./locales/en.js";
5
+ import { buildUiToolsLocaleContext } from "./utils.js";
6
6
  export const uiToolsLocaleContextInjectionKey = Symbol.for("nuxt-ui-tools.locale-context");
7
7
  export function useUiToolsLocaleRef(localeOverrides) {
8
8
  const nuxtUiLocale = useNuxtUiLocale();
@@ -20,6 +20,8 @@ type __VLS_Props = {
20
20
  declare var __VLS_15: {}, __VLS_18: {}, __VLS_21: {
21
21
  layout: string;
22
22
  refresh: () => void;
23
+ hasActiveQuery: boolean;
24
+ clearQuery: () => void;
23
25
  }, __VLS_24: {}, __VLS_27: {}, __VLS_30: {
24
26
  layout: "table" | "grid";
25
27
  }, __VLS_33: {
@@ -20,6 +20,8 @@ type __VLS_Props = {
20
20
  declare var __VLS_15: {}, __VLS_18: {}, __VLS_21: {
21
21
  layout: string;
22
22
  refresh: () => void;
23
+ hasActiveQuery: boolean;
24
+ clearQuery: () => void;
23
25
  }, __VLS_24: {}, __VLS_27: {}, __VLS_30: {
24
26
  layout: "table" | "grid";
25
27
  }, __VLS_33: {
@@ -1,14 +1,16 @@
1
- import type { DropdownMenuProps } from '@nuxt/ui';
1
+ import type { DropdownMenuProps } from '@nuxt/ui/components/DropdownMenu.vue';
2
+ import type { DataListControlSize } from '../../types/index.js';
2
3
  type __VLS_Props = {
3
4
  content?: DropdownMenuProps['content'];
4
5
  modal?: DropdownMenuProps['modal'];
5
6
  portal?: DropdownMenuProps['portal'];
6
7
  arrow?: DropdownMenuProps['arrow'];
7
8
  disabled?: DropdownMenuProps['disabled'];
9
+ size?: DataListControlSize;
8
10
  ui?: DropdownMenuProps['ui'];
9
11
  };
10
12
  declare var __VLS_9: {
11
- items: import("@nuxt/ui").DropdownMenuItem[];
13
+ items: import("@nuxt/ui/runtime/components/DropdownMenu.d.vue.js").DropdownMenuItem[];
12
14
  open: boolean;
13
15
  };
14
16
  type __VLS_Slots = {} & {
@@ -13,6 +13,7 @@ const props = defineProps({
13
13
  portal: { type: [Boolean, String], required: false, skipCheck: true },
14
14
  arrow: { type: [Boolean, Object], required: false },
15
15
  disabled: { type: Boolean, required: false },
16
+ size: { type: String, required: false },
16
17
  ui: { type: Object, required: false }
17
18
  });
18
19
  const attrs = useAttrs();
@@ -44,6 +45,7 @@ const items = computed(() => {
44
45
  :portal="portal"
45
46
  :arrow="props.arrow"
46
47
  :disabled="props.disabled"
48
+ :size="props.size"
47
49
  :ui="props.ui"
48
50
  v-bind="attrs"
49
51
  >
@@ -1,14 +1,16 @@
1
- import type { DropdownMenuProps } from '@nuxt/ui';
1
+ import type { DropdownMenuProps } from '@nuxt/ui/components/DropdownMenu.vue';
2
+ import type { DataListControlSize } from '../../types/index.js';
2
3
  type __VLS_Props = {
3
4
  content?: DropdownMenuProps['content'];
4
5
  modal?: DropdownMenuProps['modal'];
5
6
  portal?: DropdownMenuProps['portal'];
6
7
  arrow?: DropdownMenuProps['arrow'];
7
8
  disabled?: DropdownMenuProps['disabled'];
9
+ size?: DataListControlSize;
8
10
  ui?: DropdownMenuProps['ui'];
9
11
  };
10
12
  declare var __VLS_9: {
11
- items: import("@nuxt/ui").DropdownMenuItem[];
13
+ items: import("@nuxt/ui/runtime/components/DropdownMenu.d.vue.js").DropdownMenuItem[];
12
14
  open: boolean;
13
15
  };
14
16
  type __VLS_Slots = {} & {
@@ -1,20 +1,22 @@
1
- import type { DataListAddFilterUi, DataListControlSize } from '../../types/index.js';
1
+ import type { DataListAddFilterUi, DataListControlSize, TableUiFilterDefinition } from '../../types/index.js';
2
2
  type __VLS_Props = {
3
3
  size?: DataListControlSize;
4
4
  ui?: DataListAddFilterUi;
5
5
  };
6
- declare var __VLS_11: {
6
+ declare var __VLS_12: {
7
7
  open: () => void;
8
8
  close: () => void;
9
9
  toggle: () => void;
10
10
  openState: boolean;
11
+ stage: "editor" | "match-mode" | "picker";
12
+ definition: TableUiFilterDefinition | undefined;
11
13
  triggerProps: {
12
14
  type: string;
13
15
  'aria-expanded': boolean;
14
16
  };
15
17
  };
16
18
  type __VLS_Slots = {} & {
17
- trigger?: (props: typeof __VLS_11) => any;
19
+ trigger?: (props: typeof __VLS_12) => any;
18
20
  };
19
21
  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>;
20
22
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -11,6 +11,9 @@ const props = defineProps({
11
11
  });
12
12
  const dataListUi = useDataListUi();
13
13
  const definitions = computed(() => internals.filterPresentation.dormantDynamicDefinitions.value);
14
+ const sessionDefinition = computed(
15
+ () => internals.filterPresentation.dynamicSessionDefinition.value
16
+ );
14
17
  const resolvedSize = computed(
15
18
  () => props.size ?? dataListUi.ui.value.addFilter?.size ?? dataListUi.controlSize.value
16
19
  );
@@ -25,12 +28,14 @@ function getLabel(definition) {
25
28
 
26
29
  <template>
27
30
  <DynamicFilterPicker
28
- v-if="definitions.length"
31
+ v-if="definitions.length || sessionDefinition"
29
32
  :definitions="definitions"
33
+ :session-definition="sessionDefinition"
30
34
  :get-label="getLabel"
31
35
  :size="resolvedSize"
32
36
  :ui="resolvedUi"
33
37
  @select="internals.filterPresentation.activateDynamicFilter({ key: $event })"
38
+ @release="internals.filterPresentation.releaseDynamicSession({ key: $event })"
34
39
  >
35
40
  <template v-if="$slots.trigger" #trigger="scope">
36
41
  <slot name="trigger" v-bind="scope" />
@@ -1,20 +1,22 @@
1
- import type { DataListAddFilterUi, DataListControlSize } from '../../types/index.js';
1
+ import type { DataListAddFilterUi, DataListControlSize, TableUiFilterDefinition } from '../../types/index.js';
2
2
  type __VLS_Props = {
3
3
  size?: DataListControlSize;
4
4
  ui?: DataListAddFilterUi;
5
5
  };
6
- declare var __VLS_11: {
6
+ declare var __VLS_12: {
7
7
  open: () => void;
8
8
  close: () => void;
9
9
  toggle: () => void;
10
10
  openState: boolean;
11
+ stage: "editor" | "match-mode" | "picker";
12
+ definition: TableUiFilterDefinition | undefined;
11
13
  triggerProps: {
12
14
  type: string;
13
15
  'aria-expanded': boolean;
14
16
  };
15
17
  };
16
18
  type __VLS_Slots = {} & {
17
- trigger?: (props: typeof __VLS_11) => any;
19
+ trigger?: (props: typeof __VLS_12) => any;
18
20
  };
19
21
  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>;
20
22
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -6,31 +6,38 @@ type __VLS_Props = {
6
6
  ui?: DataListContentUi;
7
7
  };
8
8
  declare function refresh(): void;
9
+ declare function clearQuery(): void;
9
10
  declare var __VLS_1: {}, __VLS_4: "loading" | "initial-loading", __VLS_5: {
10
11
  layout: "table" | "grid";
11
12
  }, __VLS_7: {
12
13
  error: {};
13
14
  retry: typeof refresh;
14
- }, __VLS_9: {
15
+ }, __VLS_22: {
15
16
  layout: "table" | "grid";
16
17
  refresh: typeof refresh;
17
- }, __VLS_11: {
18
+ hasActiveQuery: boolean;
19
+ clearQuery: typeof clearQuery;
20
+ }, __VLS_24: {
18
21
  layout: "table" | "grid";
19
22
  rows: object[];
20
23
  loading: boolean;
21
24
  empty: boolean;
22
25
  error: unknown;
23
- }, __VLS_19: {
26
+ }, __VLS_32: {
24
27
  rows: object[];
25
- }, __VLS_28: {}, __VLS_30: {
28
+ }, __VLS_41: {}, __VLS_43: {
26
29
  layout: string;
27
30
  refresh: typeof refresh;
28
- }, __VLS_32: {
31
+ hasActiveQuery: boolean;
32
+ clearQuery: typeof clearQuery;
33
+ }, __VLS_45: {
29
34
  rows: object[];
30
- }, __VLS_41: {}, __VLS_43: {
35
+ }, __VLS_54: {}, __VLS_56: {
31
36
  layout: string;
32
37
  refresh: typeof refresh;
33
- }, __VLS_45: {}, __VLS_47: {};
38
+ hasActiveQuery: boolean;
39
+ clearQuery: typeof clearQuery;
40
+ }, __VLS_58: {}, __VLS_60: {};
34
41
  type __VLS_Slots = {} & {
35
42
  [K in NonNullable<typeof __VLS_4>]?: (props: typeof __VLS_5) => any;
36
43
  } & {
@@ -38,25 +45,25 @@ type __VLS_Slots = {} & {
38
45
  } & {
39
46
  error?: (props: typeof __VLS_7) => any;
40
47
  } & {
41
- empty?: (props: typeof __VLS_9) => any;
48
+ empty?: (props: typeof __VLS_22) => any;
42
49
  } & {
43
- content?: (props: typeof __VLS_11) => any;
50
+ content?: (props: typeof __VLS_24) => any;
44
51
  } & {
45
- table?: (props: typeof __VLS_19) => any;
52
+ table?: (props: typeof __VLS_32) => any;
46
53
  } & {
47
- 'empty-table'?: (props: typeof __VLS_28) => any;
54
+ 'empty-table'?: (props: typeof __VLS_41) => any;
48
55
  } & {
49
- empty?: (props: typeof __VLS_30) => any;
56
+ empty?: (props: typeof __VLS_43) => any;
50
57
  } & {
51
- grid?: (props: typeof __VLS_32) => any;
58
+ grid?: (props: typeof __VLS_45) => any;
52
59
  } & {
53
- 'empty-grid'?: (props: typeof __VLS_41) => any;
60
+ 'empty-grid'?: (props: typeof __VLS_54) => any;
54
61
  } & {
55
- empty?: (props: typeof __VLS_43) => any;
62
+ empty?: (props: typeof __VLS_56) => any;
56
63
  } & {
57
- refreshing?: (props: typeof __VLS_45) => any;
64
+ refreshing?: (props: typeof __VLS_58) => any;
58
65
  } & {
59
- after?: (props: typeof __VLS_47) => any;
66
+ after?: (props: typeof __VLS_60) => any;
60
67
  };
61
68
  declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
62
69
  transition: boolean;
@@ -1,4 +1,6 @@
1
1
  <script setup>
2
+ import UButton from "@nuxt/ui/components/Button.vue";
3
+ import UIcon from "@nuxt/ui/components/Icon.vue";
2
4
  import { computed, nextTick, ref, watch } from "vue";
3
5
  import { useUiToolsLocale } from "#ui-tools/i18n";
4
6
  import { useDataListUi } from "../../composables/use-data-list-ui";
@@ -24,6 +26,9 @@ const loading = computed(
24
26
  );
25
27
  const error = computed(() => rows.value.length ? null : internals.queryContent.error.value);
26
28
  const empty = computed(() => !loading.value && !error.value && rows.value.length === 0);
29
+ const hasActiveQuery = computed(
30
+ () => internals.filters.hasActiveSearch.value || internals.filters.hasActiveUiFilters.value
31
+ );
27
32
  const refreshing = computed(
28
33
  () => rows.value.length > 0 && (internals.queryContent.status.value.isRefreshing || internals.queryContent.status.value.isRevalidating)
29
34
  );
@@ -42,6 +47,10 @@ const shellClass = computed(
42
47
  function refresh() {
43
48
  void internals.queryContent.refreshData()();
44
49
  }
50
+ function clearQuery() {
51
+ internals.filters.searchQuery.value = "";
52
+ internals.filters.clearAllFilters();
53
+ }
45
54
  watch(
46
55
  () => internals.controls.tableLayout.value,
47
56
  () => {
@@ -87,31 +96,61 @@ watch(
87
96
  )
88
97
  "
89
98
  >
90
- <div :class="mergeDataListUiClass('grid max-w-sm gap-3', rootUi?.errorBody, ui?.errorBody)">
91
- <div
99
+ <div
100
+ :class="
101
+ mergeDataListUiClass(
102
+ 'flex max-w-md items-start gap-3 text-left',
103
+ rootUi?.errorBody,
104
+ ui?.errorBody
105
+ )
106
+ "
107
+ >
108
+ <span
92
109
  :class="
110
+ mergeDataListUiClass(
111
+ 'grid size-9 shrink-0 place-items-center rounded-md bg-error/10 text-error',
112
+ rootUi?.errorIcon,
113
+ ui?.errorIcon
114
+ )
115
+ "
116
+ >
117
+ <UIcon name="i-lucide-cloud-alert" class="size-4" />
118
+ </span>
119
+ <div :class="mergeDataListUiClass('min-w-0 flex-1', rootUi?.errorCopy, ui?.errorCopy)">
120
+ <div
121
+ :class="
93
122
  mergeDataListUiClass(
94
123
  'font-medium text-highlighted',
95
124
  rootUi?.errorTitle,
96
125
  ui?.errorTitle
97
126
  )
98
127
  "
99
- >
100
- {{ t("table.states.gridError.title") }}
101
- </div>
102
- <button
103
- type="button"
104
- :class="
128
+ >
129
+ {{ t("table.states.gridError.title") }}
130
+ </div>
131
+ <p
132
+ :class="
105
133
  mergeDataListUiClass(
106
- 'mx-auto rounded-md border border-default px-3 py-1.5 text-sm text-default hover:bg-elevated',
107
- rootUi?.retry,
108
- ui?.retry
134
+ 'mt-0.5 text-sm leading-5 text-muted',
135
+ rootUi?.errorDescription,
136
+ ui?.errorDescription
109
137
  )
110
138
  "
111
- @click="refresh"
112
- >
113
- {{ t("table.states.gridError.action") }}
114
- </button>
139
+ >
140
+ {{ t("table.states.gridError.description") }}
141
+ </p>
142
+ <UButton
143
+ color="neutral"
144
+ variant="soft"
145
+ size="sm"
146
+ icon="i-lucide-refresh-cw"
147
+ class="mt-3"
148
+ :ui="{ base: mergeDataListUiClass(rootUi?.retry, ui?.retry) }"
149
+ @click="refresh"
150
+ >
151
+ {{ t("table.states.gridError.action") }}
152
+ </UButton>
153
+ </div>
115
154
  </div>
116
155
  </div>
117
156
  </slot>
@@ -120,6 +159,8 @@ watch(
120
159
  name="empty"
121
160
  :layout="internals.controls.tableLayout.value"
122
161
  :refresh="refresh"
162
+ :has-active-query="hasActiveQuery"
163
+ :clear-query="clearQuery"
123
164
  />
124
165
  <slot
125
166
  v-else
@@ -140,7 +181,13 @@ watch(
140
181
  <DataListTable>
141
182
  <template #empty>
142
183
  <slot name="empty-table">
143
- <slot name="empty" :layout="'table'" :refresh="refresh" />
184
+ <slot
185
+ name="empty"
186
+ :layout="'table'"
187
+ :refresh="refresh"
188
+ :has-active-query="hasActiveQuery"
189
+ :clear-query="clearQuery"
190
+ />
144
191
  </slot>
145
192
  </template>
146
193
  </DataListTable>
@@ -149,7 +196,13 @@ watch(
149
196
  <DataListGrid>
150
197
  <template #empty>
151
198
  <slot name="empty-grid">
152
- <slot name="empty" :layout="'grid'" :refresh="refresh" />
199
+ <slot
200
+ name="empty"
201
+ :layout="'grid'"
202
+ :refresh="refresh"
203
+ :has-active-query="hasActiveQuery"
204
+ :clear-query="clearQuery"
205
+ />
153
206
  </slot>
154
207
  </template>
155
208
  </DataListGrid>
@@ -6,31 +6,38 @@ type __VLS_Props = {
6
6
  ui?: DataListContentUi;
7
7
  };
8
8
  declare function refresh(): void;
9
+ declare function clearQuery(): void;
9
10
  declare var __VLS_1: {}, __VLS_4: "loading" | "initial-loading", __VLS_5: {
10
11
  layout: "table" | "grid";
11
12
  }, __VLS_7: {
12
13
  error: {};
13
14
  retry: typeof refresh;
14
- }, __VLS_9: {
15
+ }, __VLS_22: {
15
16
  layout: "table" | "grid";
16
17
  refresh: typeof refresh;
17
- }, __VLS_11: {
18
+ hasActiveQuery: boolean;
19
+ clearQuery: typeof clearQuery;
20
+ }, __VLS_24: {
18
21
  layout: "table" | "grid";
19
22
  rows: object[];
20
23
  loading: boolean;
21
24
  empty: boolean;
22
25
  error: unknown;
23
- }, __VLS_19: {
26
+ }, __VLS_32: {
24
27
  rows: object[];
25
- }, __VLS_28: {}, __VLS_30: {
28
+ }, __VLS_41: {}, __VLS_43: {
26
29
  layout: string;
27
30
  refresh: typeof refresh;
28
- }, __VLS_32: {
31
+ hasActiveQuery: boolean;
32
+ clearQuery: typeof clearQuery;
33
+ }, __VLS_45: {
29
34
  rows: object[];
30
- }, __VLS_41: {}, __VLS_43: {
35
+ }, __VLS_54: {}, __VLS_56: {
31
36
  layout: string;
32
37
  refresh: typeof refresh;
33
- }, __VLS_45: {}, __VLS_47: {};
38
+ hasActiveQuery: boolean;
39
+ clearQuery: typeof clearQuery;
40
+ }, __VLS_58: {}, __VLS_60: {};
34
41
  type __VLS_Slots = {} & {
35
42
  [K in NonNullable<typeof __VLS_4>]?: (props: typeof __VLS_5) => any;
36
43
  } & {
@@ -38,25 +45,25 @@ type __VLS_Slots = {} & {
38
45
  } & {
39
46
  error?: (props: typeof __VLS_7) => any;
40
47
  } & {
41
- empty?: (props: typeof __VLS_9) => any;
48
+ empty?: (props: typeof __VLS_22) => any;
42
49
  } & {
43
- content?: (props: typeof __VLS_11) => any;
50
+ content?: (props: typeof __VLS_24) => any;
44
51
  } & {
45
- table?: (props: typeof __VLS_19) => any;
52
+ table?: (props: typeof __VLS_32) => any;
46
53
  } & {
47
- 'empty-table'?: (props: typeof __VLS_28) => any;
54
+ 'empty-table'?: (props: typeof __VLS_41) => any;
48
55
  } & {
49
- empty?: (props: typeof __VLS_30) => any;
56
+ empty?: (props: typeof __VLS_43) => any;
50
57
  } & {
51
- grid?: (props: typeof __VLS_32) => any;
58
+ grid?: (props: typeof __VLS_45) => any;
52
59
  } & {
53
- 'empty-grid'?: (props: typeof __VLS_41) => any;
60
+ 'empty-grid'?: (props: typeof __VLS_54) => any;
54
61
  } & {
55
- empty?: (props: typeof __VLS_43) => any;
62
+ empty?: (props: typeof __VLS_56) => any;
56
63
  } & {
57
- refreshing?: (props: typeof __VLS_45) => any;
64
+ refreshing?: (props: typeof __VLS_58) => any;
58
65
  } & {
59
- after?: (props: typeof __VLS_47) => any;
66
+ after?: (props: typeof __VLS_60) => any;
60
67
  };
61
68
  declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
62
69
  transition: boolean;
@@ -15,6 +15,8 @@ declare var __VLS_1: {}, __VLS_13: {}, __VLS_42: {
15
15
  }, __VLS_51: {
16
16
  layout: string;
17
17
  refresh: () => void;
18
+ hasActiveQuery: boolean;
19
+ clearQuery: () => void;
18
20
  }, __VLS_54: {}, __VLS_57: {}, __VLS_60: {}, __VLS_70: {
19
21
  loadedCount: number;
20
22
  }, __VLS_73: {
@@ -15,6 +15,8 @@ declare var __VLS_1: {}, __VLS_13: {}, __VLS_42: {
15
15
  }, __VLS_51: {
16
16
  layout: string;
17
17
  refresh: () => void;
18
+ hasActiveQuery: boolean;
19
+ clearQuery: () => void;
18
20
  }, __VLS_54: {}, __VLS_57: {}, __VLS_60: {}, __VLS_70: {
19
21
  loadedCount: number;
20
22
  }, __VLS_73: {