@nuxt/ui 2.15.2 → 2.17.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 (78) hide show
  1. package/README.md +0 -10
  2. package/dist/module.d.mts +4 -24
  3. package/dist/module.d.ts +4 -24
  4. package/dist/module.json +1 -1
  5. package/dist/module.mjs +108 -329
  6. package/dist/runtime/components/data/Table.vue +33 -2
  7. package/dist/runtime/components/data/Table.vue.d.ts +25 -35
  8. package/dist/runtime/components/elements/Accordion.vue.d.ts +1 -1
  9. package/dist/runtime/components/elements/Alert.vue +11 -7
  10. package/dist/runtime/components/elements/Alert.vue.d.ts +6 -6
  11. package/dist/runtime/components/elements/Avatar.vue.d.ts +10 -10
  12. package/dist/runtime/components/elements/Badge.vue.d.ts +5 -5
  13. package/dist/runtime/components/elements/Button.vue.d.ts +9 -9
  14. package/dist/runtime/components/elements/Carousel.vue.d.ts +1 -1
  15. package/dist/runtime/components/elements/Chip.vue.d.ts +8 -8
  16. package/dist/runtime/components/elements/Dropdown.vue.d.ts +1 -1
  17. package/dist/runtime/components/elements/Kbd.vue.d.ts +2 -2
  18. package/dist/runtime/components/elements/Link.vue.d.ts +3 -3
  19. package/dist/runtime/components/elements/Meter.vue.d.ts +5 -5
  20. package/dist/runtime/components/elements/Progress.vue.d.ts +3 -3
  21. package/dist/runtime/components/forms/Checkbox.vue.d.ts +10 -10
  22. package/dist/runtime/components/forms/Form.vue +8 -11
  23. package/dist/runtime/components/forms/Form.vue.d.ts +7 -12
  24. package/dist/runtime/components/forms/FormGroup.vue.d.ts +7 -7
  25. package/dist/runtime/components/forms/Input.vue +2 -2
  26. package/dist/runtime/components/forms/Input.vue.d.ts +14 -14
  27. package/dist/runtime/components/forms/InputMenu.vue +6 -0
  28. package/dist/runtime/components/forms/InputMenu.vue.d.ts +30 -21
  29. package/dist/runtime/components/forms/Radio.vue.d.ts +11 -11
  30. package/dist/runtime/components/forms/RadioGroup.vue.d.ts +8 -8
  31. package/dist/runtime/components/forms/Range.vue.d.ts +8 -8
  32. package/dist/runtime/components/forms/Select.vue +2 -2
  33. package/dist/runtime/components/forms/Select.vue.d.ts +13 -13
  34. package/dist/runtime/components/forms/SelectMenu.vue +7 -1
  35. package/dist/runtime/components/forms/SelectMenu.vue.d.ts +30 -21
  36. package/dist/runtime/components/forms/Textarea.vue.d.ts +12 -12
  37. package/dist/runtime/components/forms/Toggle.vue.d.ts +7 -7
  38. package/dist/runtime/components/layout/Card.vue.d.ts +1 -1
  39. package/dist/runtime/components/layout/Container.vue.d.ts +1 -1
  40. package/dist/runtime/components/layout/Divider.vue.d.ts +5 -5
  41. package/dist/runtime/components/layout/Skeleton.vue.d.ts +1 -1
  42. package/dist/runtime/components/navigation/Breadcrumb.vue +2 -1
  43. package/dist/runtime/components/navigation/Breadcrumb.vue.d.ts +1 -1
  44. package/dist/runtime/components/navigation/CommandPalette.vue +5 -1
  45. package/dist/runtime/components/navigation/CommandPalette.vue.d.ts +10 -10
  46. package/dist/runtime/components/navigation/HorizontalNavigation.vue.d.ts +1 -1
  47. package/dist/runtime/components/navigation/Pagination.vue +5 -0
  48. package/dist/runtime/components/navigation/Pagination.vue.d.ts +10 -1
  49. package/dist/runtime/components/navigation/Tabs.vue +5 -1
  50. package/dist/runtime/components/navigation/Tabs.vue.d.ts +11 -2
  51. package/dist/runtime/components/navigation/VerticalNavigation.vue.d.ts +1 -1
  52. package/dist/runtime/components/overlays/ContextMenu.vue.d.ts +3 -3
  53. package/dist/runtime/components/overlays/Modal.vue.d.ts +5 -5
  54. package/dist/runtime/components/overlays/Notification.vue +12 -6
  55. package/dist/runtime/components/overlays/Notification.vue.d.ts +8 -8
  56. package/dist/runtime/components/overlays/Notifications.vue.d.ts +3 -1
  57. package/dist/runtime/components/overlays/Popover.vue.d.ts +2 -2
  58. package/dist/runtime/components/overlays/Slideover.vue +43 -6
  59. package/dist/runtime/components/overlays/Slideover.vue.d.ts +9 -8
  60. package/dist/runtime/components/overlays/Tooltip.vue.d.ts +2 -2
  61. package/dist/runtime/composables/useCarouselScroll.mjs +2 -0
  62. package/dist/runtime/composables/useFormGroup.d.ts +1 -1
  63. package/dist/runtime/composables/usePopper.d.ts +8 -8
  64. package/dist/runtime/composables/useToast.d.ts +2 -0
  65. package/dist/runtime/composables/useToast.mjs +13 -1
  66. package/dist/runtime/types/link.d.ts +1 -1
  67. package/dist/runtime/types/slideover.d.ts +11 -12
  68. package/dist/runtime/ui.config/data/table.d.ts +1 -0
  69. package/dist/runtime/ui.config/data/table.mjs +1 -0
  70. package/dist/runtime/ui.config/forms/input.d.ts +0 -8
  71. package/dist/runtime/ui.config/forms/input.mjs +1 -9
  72. package/dist/runtime/ui.config/forms/select.d.ts +0 -8
  73. package/dist/runtime/ui.config/forms/textarea.d.ts +0 -8
  74. package/dist/runtime/ui.config/overlays/slideover.d.ts +3 -0
  75. package/dist/runtime/ui.config/overlays/slideover.mjs +4 -1
  76. package/dist/runtime/utils/colors.d.ts +11 -0
  77. package/dist/runtime/utils/colors.mjs +299 -0
  78. package/package.json +30 -30
@@ -1,13 +1,24 @@
1
1
  <template>
2
2
  <div :class="ui.wrapper" v-bind="attrs">
3
3
  <table :class="[ui.base, ui.divide]">
4
+ <slot v-if="$slots.caption || caption" name="caption">
5
+ <caption :class="ui.caption">
6
+ {{ caption }}
7
+ </caption>
8
+ </slot>
4
9
  <thead :class="ui.thead">
5
10
  <tr :class="ui.tr.base">
6
11
  <th v-if="modelValue" scope="col" :class="ui.checkbox.padding">
7
12
  <UCheckbox :model-value="indeterminate || selected.length === rows.length" :indeterminate="indeterminate" v-bind="ui.default.checkbox" aria-label="Select all" @change="onChange" />
8
13
  </th>
9
14
 
10
- <th v-for="(column, index) in columns" :key="index" scope="col" :class="[ui.th.base, ui.th.padding, ui.th.color, ui.th.font, ui.th.size, column.class]">
15
+ <th
16
+ v-for="(column, index) in columns"
17
+ :key="index"
18
+ scope="col"
19
+ :class="[ui.th.base, ui.th.padding, ui.th.color, ui.th.font, ui.th.size, column.class]"
20
+ :aria-sort="getAriaSort(column)"
21
+ >
11
22
  <slot :name="`${column.key}-header`" :column="column" :sort="sort" :on-sort="onSort">
12
23
  <UButton
13
24
  v-if="column.sortable"
@@ -160,6 +171,10 @@ export default defineComponent({
160
171
  type: Object,
161
172
  default: () => config.default.emptyState
162
173
  },
174
+ caption: {
175
+ type: String,
176
+ default: null
177
+ },
163
178
  progress: {
164
179
  type: Object,
165
180
  default: () => config.default.progress
@@ -259,6 +274,21 @@ export default defineComponent({
259
274
  function getRowData(row, rowKey, defaultValue = "") {
260
275
  return get(row, rowKey, defaultValue);
261
276
  }
277
+ function getAriaSort(column) {
278
+ if (!column.sortable) {
279
+ return void 0;
280
+ }
281
+ if (sort.value.column !== column.key) {
282
+ return "none";
283
+ }
284
+ if (sort.value.direction === "asc") {
285
+ return "ascending";
286
+ }
287
+ if (sort.value.direction === "desc") {
288
+ return "descending";
289
+ }
290
+ return void 0;
291
+ }
262
292
  return {
263
293
  // eslint-disable-next-line vue/no-dupe-keys
264
294
  ui,
@@ -279,7 +309,8 @@ export default defineComponent({
279
309
  onSort,
280
310
  onSelect,
281
311
  onChange,
282
- getRowData
312
+ getRowData,
313
+ getAriaSort
283
314
  };
284
315
  }
285
316
  });
@@ -1,6 +1,14 @@
1
- import type { PropType } from 'vue';
1
+ import type { PropType, AriaAttributes } from 'vue';
2
2
  import type { Button, ProgressAnimation } from '../../types';
3
3
  declare function defaultComparator<T>(a: T, z: T): boolean;
4
+ interface Column {
5
+ key: string;
6
+ sortable?: boolean;
7
+ sort?: (a: any, b: any, direction: 'asc' | 'desc') => number;
8
+ direction?: 'asc' | 'desc';
9
+ class?: string;
10
+ [key: string]: any;
11
+ }
4
12
  declare const _default: import("vue").DefineComponent<{
5
13
  modelValue: {
6
14
  type: ArrayConstructor;
@@ -17,14 +25,7 @@ declare const _default: import("vue").DefineComponent<{
17
25
  default: () => never[];
18
26
  };
19
27
  columns: {
20
- type: PropType<{
21
- [key: string]: any;
22
- key: string;
23
- sortable?: boolean | undefined;
24
- sort?: ((a: any, b: any, direction: 'asc' | 'desc') => number) | undefined;
25
- direction?: "asc" | "desc" | undefined;
26
- class?: string | undefined;
27
- }[]>;
28
+ type: PropType<Column[]>;
28
29
  default: null;
29
30
  };
30
31
  columnAttribute: {
@@ -72,6 +73,10 @@ declare const _default: import("vue").DefineComponent<{
72
73
  }>;
73
74
  default: () => any;
74
75
  };
76
+ caption: {
77
+ type: StringConstructor;
78
+ default: null;
79
+ };
75
80
  progress: {
76
81
  type: PropType<{
77
82
  color: any;
@@ -96,14 +101,7 @@ declare const _default: import("vue").DefineComponent<{
96
101
  column: string;
97
102
  direction: 'asc' | 'desc';
98
103
  }>;
99
- columns: import("vue").ComputedRef<{
100
- [key: string]: any;
101
- key: string;
102
- sortable?: boolean | undefined;
103
- sort?: ((a: any, b: any, direction: 'asc' | 'desc') => number) | undefined;
104
- direction?: "asc" | "desc" | undefined;
105
- class?: string | undefined;
106
- }[]>;
104
+ columns: import("vue").ComputedRef<Column[]>;
107
105
  rows: import("vue").ComputedRef<{
108
106
  [key: string]: any;
109
107
  }[]>;
@@ -119,6 +117,7 @@ declare const _default: import("vue").DefineComponent<{
119
117
  onSelect: (row: any) => void;
120
118
  onChange: (checked: boolean) => void;
121
119
  getRowData: (row: Object, rowKey: string | string[], defaultValue?: any) => any;
120
+ getAriaSort: (column: Column) => AriaAttributes['aria-sort'];
122
121
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "update:sort")[], "update:modelValue" | "update:sort", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
123
122
  modelValue: {
124
123
  type: ArrayConstructor;
@@ -135,14 +134,7 @@ declare const _default: import("vue").DefineComponent<{
135
134
  default: () => never[];
136
135
  };
137
136
  columns: {
138
- type: PropType<{
139
- [key: string]: any;
140
- key: string;
141
- sortable?: boolean | undefined;
142
- sort?: ((a: any, b: any, direction: 'asc' | 'desc') => number) | undefined;
143
- direction?: "asc" | "desc" | undefined;
144
- class?: string | undefined;
145
- }[]>;
137
+ type: PropType<Column[]>;
146
138
  default: null;
147
139
  };
148
140
  columnAttribute: {
@@ -190,6 +182,10 @@ declare const _default: import("vue").DefineComponent<{
190
182
  }>;
191
183
  default: () => any;
192
184
  };
185
+ caption: {
186
+ type: StringConstructor;
187
+ default: null;
188
+ };
193
189
  progress: {
194
190
  type: PropType<{
195
191
  color: any;
@@ -213,21 +209,16 @@ declare const _default: import("vue").DefineComponent<{
213
209
  column: string;
214
210
  direction: 'asc' | 'desc';
215
211
  };
212
+ caption: string;
216
213
  progress: {
217
214
  color: any;
218
215
  animation: ProgressAnimation;
219
216
  };
220
- ui: any;
221
217
  class: any;
218
+ columns: Column[];
219
+ ui: any;
220
+ loading: boolean;
222
221
  modelValue: unknown[];
223
- columns: {
224
- [key: string]: any;
225
- key: string;
226
- sortable?: boolean | undefined;
227
- sort?: ((a: any, b: any, direction: 'asc' | 'desc') => number) | undefined;
228
- direction?: "asc" | "desc" | undefined;
229
- class?: string | undefined;
230
- }[];
231
222
  by: string | Function;
232
223
  rows: {
233
224
  [key: string]: any;
@@ -237,7 +228,6 @@ declare const _default: import("vue").DefineComponent<{
237
228
  sortButton: Button;
238
229
  sortAscIcon: string;
239
230
  sortDescIcon: string;
240
- loading: boolean;
241
231
  loadingState: {
242
232
  icon: string;
243
233
  label: string;
@@ -86,8 +86,8 @@ declare const _default: import("vue").DefineComponent<{
86
86
  }>> & {
87
87
  onOpen?: ((...args: any[]) => any) | undefined;
88
88
  }, {
89
- ui: any;
90
89
  class: any;
90
+ ui: any;
91
91
  defaultOpen: boolean;
92
92
  unmount: boolean;
93
93
  items: AccordionItem[];
@@ -2,7 +2,7 @@
2
2
  <div :class="alertClass" v-bind="attrs">
3
3
  <div class="flex" :class="[ui.gap, { 'items-start': (description || $slots.description), 'items-center': !description && !$slots.description }]">
4
4
  <slot name="icon" :icon="icon">
5
- <UIcon v-if="icon" :name="icon" :ui="ui.icon.base" />
5
+ <UIcon v-if="icon" :name="icon" :class="ui.icon.base" />
6
6
  </slot>
7
7
  <slot name="avatar" :avatar="avatar">
8
8
  <UAvatar v-if="avatar" v-bind="{ size: ui.avatar.size, ...avatar }" :class="ui.avatar.base" />
@@ -14,19 +14,23 @@
14
14
  {{ title }}
15
15
  </slot>
16
16
  </p>
17
- <p v-if="description || $slots.description" :class="twMerge(ui.description, !(title && $slots.title) && 'mt-0 leading-5')">
17
+ <div v-if="description || $slots.description" :class="twMerge(ui.description, !(title && $slots.title) && 'mt-0 leading-5')">
18
18
  <slot name="description" :description="description">
19
19
  {{ description }}
20
20
  </slot>
21
- </p>
21
+ </div>
22
22
 
23
- <div v-if="(description || $slots.description) && actions.length" :class="ui.actions">
24
- <UButton v-for="(action, index) of actions" :key="index" v-bind="{ ...(ui.default.actionButton || {}), ...action }" @click.stop="onAction(action)" />
23
+ <div v-if="(description || $slots.description) && (actions.length || $slots.actions)" :class="ui.actions">
24
+ <slot name="actions">
25
+ <UButton v-for="(action, index) of actions" :key="index" v-bind="{ ...(ui.default.actionButton || {}), ...action }" @click.stop="onAction(action)" />
26
+ </slot>
25
27
  </div>
26
28
  </div>
27
29
  <div v-if="closeButton || (!description && !$slots.description && actions.length)" :class="twMerge(ui.actions, 'mt-0')">
28
- <template v-if="!description && !$slots.description && actions.length">
29
- <UButton v-for="(action, index) of actions" :key="index" v-bind="{ ...(ui.default.actionButton || {}), ...action }" @click.stop="onAction(action)" />
30
+ <template v-if="!description && !$slots.description && (actions.length || $slots.actions)">
31
+ <slot name="actions">
32
+ <UButton v-for="(action, index) of actions" :key="index" v-bind="{ ...(ui.default.actionButton || {}), ...action }" @click.stop="onAction(action)" />
33
+ </slot>
30
34
  </template>
31
35
 
32
36
  <UButton v-if="closeButton" aria-label="Close" v-bind="{ ...(ui.default.closeButton || {}), ...closeButton }" @click.stop="$emit('close')" />
@@ -97,15 +97,15 @@ declare const _default: import("vue").DefineComponent<{
97
97
  }>> & {
98
98
  onClose?: ((...args: any[]) => any) | undefined;
99
99
  }, {
100
- ui: any;
101
100
  title: string;
102
- description: string;
103
- icon: string;
101
+ class: any;
104
102
  avatar: Avatar;
105
- closeButton: Button;
106
- actions: AlertAction[];
107
103
  color: any;
108
- class: any;
109
104
  variant: AlertVariant;
105
+ ui: any;
106
+ icon: string;
107
+ description: string;
108
+ closeButton: Button;
109
+ actions: AlertAction[];
110
110
  }, {}>;
111
111
  export default _default;
@@ -2,11 +2,11 @@ import type { PropType } from 'vue';
2
2
  import type { AvatarSize } from '../../types';
3
3
  declare const _default: import("vue").DefineComponent<{
4
4
  as: {
5
- type: (ObjectConstructor | StringConstructor)[];
5
+ type: (StringConstructor | ObjectConstructor)[];
6
6
  default: string;
7
7
  };
8
8
  src: {
9
- type: (BooleanConstructor | StringConstructor)[];
9
+ type: (StringConstructor | BooleanConstructor)[];
10
10
  default: null;
11
11
  };
12
12
  alt: {
@@ -37,7 +37,7 @@ declare const _default: import("vue").DefineComponent<{
37
37
  validator(value: string): boolean;
38
38
  };
39
39
  chipText: {
40
- type: (NumberConstructor | StringConstructor)[];
40
+ type: (StringConstructor | NumberConstructor)[];
41
41
  default: null;
42
42
  };
43
43
  imgClass: {
@@ -67,11 +67,11 @@ declare const _default: import("vue").DefineComponent<{
67
67
  onError: () => void;
68
68
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
69
69
  as: {
70
- type: (ObjectConstructor | StringConstructor)[];
70
+ type: (StringConstructor | ObjectConstructor)[];
71
71
  default: string;
72
72
  };
73
73
  src: {
74
- type: (BooleanConstructor | StringConstructor)[];
74
+ type: (StringConstructor | BooleanConstructor)[];
75
75
  default: null;
76
76
  };
77
77
  alt: {
@@ -102,7 +102,7 @@ declare const _default: import("vue").DefineComponent<{
102
102
  validator(value: string): boolean;
103
103
  };
104
104
  chipText: {
105
- type: (NumberConstructor | StringConstructor)[];
105
+ type: (StringConstructor | NumberConstructor)[];
106
106
  default: null;
107
107
  };
108
108
  imgClass: {
@@ -118,14 +118,14 @@ declare const _default: import("vue").DefineComponent<{
118
118
  default: () => {};
119
119
  };
120
120
  }>>, {
121
- alt: string;
122
121
  size: AvatarSize;
123
- ui: any;
124
- icon: string;
122
+ text: string;
125
123
  class: any;
126
124
  as: string | Record<string, any>;
125
+ ui: any;
126
+ icon: string;
127
127
  src: string | boolean;
128
- text: string;
128
+ alt: string;
129
129
  chipColor: any;
130
130
  chipPosition: "top-right" | "bottom-right" | "top-left" | "bottom-left";
131
131
  chipText: string | number;
@@ -17,7 +17,7 @@ declare const _default: import("vue").DefineComponent<{
17
17
  validator(value: string): boolean;
18
18
  };
19
19
  label: {
20
- type: (NumberConstructor | StringConstructor)[];
20
+ type: (StringConstructor | NumberConstructor)[];
21
21
  default: null;
22
22
  };
23
23
  class: {
@@ -50,7 +50,7 @@ declare const _default: import("vue").DefineComponent<{
50
50
  validator(value: string): boolean;
51
51
  };
52
52
  label: {
53
- type: (NumberConstructor | StringConstructor)[];
53
+ type: (StringConstructor | NumberConstructor)[];
54
54
  default: null;
55
55
  };
56
56
  class: {
@@ -63,10 +63,10 @@ declare const _default: import("vue").DefineComponent<{
63
63
  };
64
64
  }>>, {
65
65
  size: BadgeSize;
66
- ui: any;
67
- color: any;
66
+ label: string | number;
68
67
  class: any;
68
+ color: any;
69
69
  variant: BadgeVariant;
70
- label: string | number;
70
+ ui: any;
71
71
  }, {}>;
72
72
  export default _default;
@@ -305,13 +305,12 @@ declare const _default: import("vue").DefineComponent<{
305
305
  readonly required: false;
306
306
  };
307
307
  }>>, {
308
+ replace: NuxtLinkProps;
308
309
  size: ButtonSize;
309
- ui: any;
310
- truncate: boolean;
311
- icon: string;
312
- color: any;
313
310
  type: string;
311
+ label: string;
314
312
  class: any;
313
+ truncate: boolean;
315
314
  target: NuxtLinkProps;
316
315
  rel: NuxtLinkProps;
317
316
  noRel: NuxtLinkProps;
@@ -320,22 +319,23 @@ declare const _default: import("vue").DefineComponent<{
320
319
  activeClass: NuxtLinkProps;
321
320
  exactActiveClass: NuxtLinkProps;
322
321
  prefetchedClass: NuxtLinkProps;
323
- replace: NuxtLinkProps;
324
322
  ariaCurrentValue: NuxtLinkProps;
325
323
  external: NuxtLinkProps;
326
324
  leading: boolean;
325
+ color: any;
327
326
  variant: ButtonVariant;
328
- label: string;
329
- loading: boolean;
330
327
  disabled: boolean;
328
+ to: RouteLocationRaw;
329
+ href: RouteLocationRaw;
330
+ ui: any;
331
331
  block: boolean;
332
+ loading: boolean;
332
333
  padded: boolean;
334
+ icon: string;
333
335
  loadingIcon: string;
334
336
  leadingIcon: string;
335
337
  trailingIcon: string;
336
338
  trailing: boolean;
337
339
  square: boolean;
338
- to: RouteLocationRaw;
339
- href: RouteLocationRaw;
340
340
  }, {}>;
341
341
  export default _default;
@@ -89,8 +89,8 @@ declare const _default: import("vue").DefineComponent<{
89
89
  default: undefined;
90
90
  };
91
91
  }>>, {
92
- ui: Partial<any>;
93
92
  class: any;
93
+ ui: Partial<any>;
94
94
  items: any[];
95
95
  arrows: boolean;
96
96
  indicators: boolean;
@@ -1,7 +1,7 @@
1
1
  import type { PropType } from 'vue';
2
2
  declare const _default: import("vue").DefineComponent<{
3
3
  size: {
4
- type: PropType<"sm" | "2xs" | "md" | "xs" | "3xs" | "lg" | "xl" | "2xl" | "3xl">;
4
+ type: PropType<"sm" | "2xs" | "md" | "xs" | "lg" | "xl" | "2xl" | "3xs" | "3xl">;
5
5
  default: () => any;
6
6
  validator(value: string): boolean;
7
7
  };
@@ -16,7 +16,7 @@ declare const _default: import("vue").DefineComponent<{
16
16
  validator(value: string): boolean;
17
17
  };
18
18
  text: {
19
- type: (NumberConstructor | StringConstructor)[];
19
+ type: (StringConstructor | NumberConstructor)[];
20
20
  default: null;
21
21
  };
22
22
  inset: {
@@ -43,7 +43,7 @@ declare const _default: import("vue").DefineComponent<{
43
43
  chipClass: import("vue").ComputedRef<string>;
44
44
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
45
45
  size: {
46
- type: PropType<"sm" | "2xs" | "md" | "xs" | "3xs" | "lg" | "xl" | "2xl" | "3xl">;
46
+ type: PropType<"sm" | "2xs" | "md" | "xs" | "lg" | "xl" | "2xl" | "3xs" | "3xl">;
47
47
  default: () => any;
48
48
  validator(value: string): boolean;
49
49
  };
@@ -58,7 +58,7 @@ declare const _default: import("vue").DefineComponent<{
58
58
  validator(value: string): boolean;
59
59
  };
60
60
  text: {
61
- type: (NumberConstructor | StringConstructor)[];
61
+ type: (StringConstructor | NumberConstructor)[];
62
62
  default: null;
63
63
  };
64
64
  inset: {
@@ -78,13 +78,13 @@ declare const _default: import("vue").DefineComponent<{
78
78
  default: () => {};
79
79
  };
80
80
  }>>, {
81
- size: "sm" | "2xs" | "md" | "xs" | "3xs" | "lg" | "xl" | "2xl" | "3xl";
82
- ui: any;
83
- color: any;
81
+ size: "sm" | "2xs" | "md" | "xs" | "lg" | "xl" | "2xl" | "3xs" | "3xl";
82
+ text: string | number;
84
83
  class: any;
85
84
  inset: boolean;
86
85
  position: "top-right" | "bottom-right" | "top-left" | "bottom-left";
87
- text: string | number;
86
+ color: any;
87
+ ui: any;
88
88
  show: boolean;
89
89
  }, {}>;
90
90
  export default _default;
@@ -122,10 +122,10 @@ declare const _default: import("vue").DefineComponent<{
122
122
  }>> & {
123
123
  "onUpdate:open"?: ((...args: any[]) => any) | undefined;
124
124
  }, {
125
- ui: any;
126
125
  class: any;
127
126
  popper: PopperOptions;
128
127
  disabled: boolean;
128
+ ui: any;
129
129
  open: boolean;
130
130
  items: DropdownItem[][];
131
131
  mode: "click" | "hover";
@@ -43,9 +43,9 @@ declare const _default: import("vue").DefineComponent<{
43
43
  default: () => {};
44
44
  };
45
45
  }>>, {
46
- size: KbdSize;
47
- ui: any;
48
46
  value: string;
47
+ size: KbdSize;
49
48
  class: any;
49
+ ui: any;
50
50
  }, {}>;
51
51
  export default _default;
@@ -200,6 +200,7 @@ declare const _default: import("vue").DefineComponent<{
200
200
  readonly required: false;
201
201
  };
202
202
  }>>, {
203
+ replace: NuxtLinkProps;
203
204
  type: string;
204
205
  target: NuxtLinkProps;
205
206
  rel: NuxtLinkProps;
@@ -209,17 +210,16 @@ declare const _default: import("vue").DefineComponent<{
209
210
  activeClass: NuxtLinkProps;
210
211
  exactActiveClass: NuxtLinkProps;
211
212
  prefetchedClass: NuxtLinkProps;
212
- replace: NuxtLinkProps;
213
213
  ariaCurrentValue: NuxtLinkProps;
214
214
  external: NuxtLinkProps;
215
215
  as: string;
216
216
  disabled: boolean;
217
- to: RouteLocationRaw;
218
- href: RouteLocationRaw;
219
217
  active: boolean;
220
218
  exact: boolean;
221
219
  exactQuery: boolean;
222
220
  exactHash: boolean;
223
221
  inactiveClass: string;
222
+ to: RouteLocationRaw;
223
+ href: RouteLocationRaw;
224
224
  }, {}>;
225
225
  export default _default;
@@ -100,16 +100,16 @@ declare const _default: import("vue").DefineComponent<{
100
100
  default: () => {};
101
101
  };
102
102
  }>>, {
103
+ value: number;
103
104
  size: "sm" | "2xs" | "md" | "xs" | "lg" | "xl" | "2xl";
105
+ label: string;
106
+ class: any;
107
+ color: any;
104
108
  ui: any;
105
- value: number;
106
109
  icon: string;
107
- color: any;
108
- class: any;
109
- label: string;
110
110
  max: number;
111
- min: number;
112
111
  indicator: boolean;
112
+ min: number;
113
113
  }, SlotsType<{
114
114
  indicator?: {
115
115
  percent: number;
@@ -112,11 +112,11 @@ declare const _default: import("vue").DefineComponent<{
112
112
  default: () => {};
113
113
  };
114
114
  }>>, {
115
- size: "sm" | "2xs" | "md" | "xs" | "lg" | "xl" | "2xl";
116
- ui: any;
117
115
  value: number;
118
- color: any;
116
+ size: "sm" | "2xs" | "md" | "xs" | "lg" | "xl" | "2xl";
119
117
  class: any;
118
+ color: any;
119
+ ui: any;
120
120
  max: number | any[];
121
121
  indicator: boolean;
122
122
  animation: "carousel" | "carousel-inverse" | "swing" | "elastic";
@@ -5,7 +5,7 @@ declare const _default: import("vue").DefineComponent<{
5
5
  default: () => null;
6
6
  };
7
7
  value: {
8
- type: (ObjectConstructor | BooleanConstructor | NumberConstructor | StringConstructor)[];
8
+ type: (StringConstructor | BooleanConstructor | ObjectConstructor | NumberConstructor)[];
9
9
  default: null;
10
10
  };
11
11
  modelValue: {
@@ -69,7 +69,7 @@ declare const _default: import("vue").DefineComponent<{
69
69
  default: () => null;
70
70
  };
71
71
  value: {
72
- type: (ObjectConstructor | BooleanConstructor | NumberConstructor | StringConstructor)[];
72
+ type: (StringConstructor | BooleanConstructor | ObjectConstructor | NumberConstructor)[];
73
73
  default: null;
74
74
  };
75
75
  modelValue: {
@@ -118,20 +118,20 @@ declare const _default: import("vue").DefineComponent<{
118
118
  default: () => {};
119
119
  };
120
120
  }>> & {
121
- "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
122
121
  onChange?: ((...args: any[]) => any) | undefined;
122
+ "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
123
123
  }, {
124
- ui: any;
125
124
  value: string | number | boolean | Record<string, any>;
126
- id: string;
127
- color: any;
128
- class: any;
129
125
  name: string;
130
- modelValue: boolean | unknown[];
126
+ required: boolean;
131
127
  label: string;
132
- indeterminate: boolean;
128
+ class: any;
129
+ color: any;
133
130
  disabled: boolean;
134
- required: boolean;
131
+ ui: any;
132
+ id: string;
133
+ modelValue: boolean | unknown[];
134
+ indeterminate: boolean;
135
135
  help: string;
136
136
  inputClass: string;
137
137
  }, {}>;
@@ -18,7 +18,7 @@ class FormException extends Error {
18
18
  export default defineComponent({
19
19
  props: {
20
20
  schema: {
21
- type: Object,
21
+ type: [Object, Function],
22
22
  default: void 0
23
23
  },
24
24
  state: {
@@ -124,7 +124,6 @@ export default defineComponent({
124
124
  validate,
125
125
  errors,
126
126
  setErrors(errs, path) {
127
- errors.value = errs;
128
127
  if (path) {
129
128
  errors.value = errors.value.filter(
130
129
  (error) => error.path !== path
@@ -211,16 +210,14 @@ async function getJoiErrors(state, schema) {
211
210
  }
212
211
  }
213
212
  function isValibotSchema(schema) {
214
- return schema._parse !== void 0;
213
+ return "_parse" in schema || "_run" in schema || typeof schema === "function" && "schema" in schema;
215
214
  }
216
215
  async function getValibotError(state, schema) {
217
- const result = await schema._parse(state);
218
- if (result.issues) {
219
- return result.issues.map((issue) => ({
220
- path: issue.path?.map((p) => p.key).join(".") || "",
221
- message: issue.message
222
- }));
223
- }
224
- return [];
216
+ const result = await ("_parse" in schema ? schema._parse(state) : "_run" in schema ? schema._run({ typed: false, value: state }, {}) : schema(state));
217
+ return result.issues?.map((issue) => ({
218
+ // We know that the key for a form schema is always a string or a number
219
+ path: issue.path?.map((item) => item.key).join(".") || "",
220
+ message: issue.message
221
+ })) || [];
225
222
  }
226
223
  </script>