@nuxt/ui 2.19.2 → 2.21.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 (105) hide show
  1. package/README.md +2 -2
  2. package/dist/module.d.mts +2 -0
  3. package/dist/module.d.ts +2 -0
  4. package/dist/module.json +1 -1
  5. package/dist/module.mjs +16 -11
  6. package/dist/runtime/components/data/Table.vue +88 -38
  7. package/dist/runtime/components/data/Table.vue.d.ts +73 -61
  8. package/dist/runtime/components/elements/Accordion.vue +3 -1
  9. package/dist/runtime/components/elements/Accordion.vue.d.ts +25 -24
  10. package/dist/runtime/components/elements/Alert.vue +2 -2
  11. package/dist/runtime/components/elements/Alert.vue.d.ts +39 -39
  12. package/dist/runtime/components/elements/Avatar.vue +2 -2
  13. package/dist/runtime/components/elements/Avatar.vue.d.ts +3 -3
  14. package/dist/runtime/components/elements/AvatarGroup.d.ts +11 -9
  15. package/dist/runtime/components/elements/AvatarGroup.js +2 -2
  16. package/dist/runtime/components/elements/Badge.vue +71 -4
  17. package/dist/runtime/components/elements/Badge.vue.d.ts +131 -4
  18. package/dist/runtime/components/elements/Button.vue +2 -2
  19. package/dist/runtime/components/elements/Button.vue.d.ts +20 -20
  20. package/dist/runtime/components/elements/ButtonGroup.d.ts +15 -13
  21. package/dist/runtime/components/elements/ButtonGroup.js +2 -2
  22. package/dist/runtime/components/elements/Carousel.vue +1 -2
  23. package/dist/runtime/components/elements/Carousel.vue.d.ts +43 -41
  24. package/dist/runtime/components/elements/Chip.vue.d.ts +5 -5
  25. package/dist/runtime/components/elements/Dropdown.vue +2 -2
  26. package/dist/runtime/components/elements/Dropdown.vue.d.ts +7 -7
  27. package/dist/runtime/components/elements/Kbd.vue +2 -2
  28. package/dist/runtime/components/elements/Link.vue +15 -4
  29. package/dist/runtime/components/elements/Link.vue.d.ts +30 -29
  30. package/dist/runtime/components/elements/Meter.vue.d.ts +3 -3
  31. package/dist/runtime/components/elements/MeterGroup.d.ts +20 -18
  32. package/dist/runtime/components/elements/MeterGroup.js +1 -1
  33. package/dist/runtime/components/elements/Progress.vue.d.ts +2 -2
  34. package/dist/runtime/components/forms/Checkbox.vue +2 -2
  35. package/dist/runtime/components/forms/Checkbox.vue.d.ts +2 -2
  36. package/dist/runtime/components/forms/Form.vue +6 -5
  37. package/dist/runtime/components/forms/FormGroup.vue.d.ts +2 -2
  38. package/dist/runtime/components/forms/Input.vue +2 -2
  39. package/dist/runtime/components/forms/Input.vue.d.ts +3 -3
  40. package/dist/runtime/components/forms/InputMenu.vue +37 -7
  41. package/dist/runtime/components/forms/InputMenu.vue.d.ts +13 -12
  42. package/dist/runtime/components/forms/Radio.vue +2 -2
  43. package/dist/runtime/components/forms/Radio.vue.d.ts +2 -2
  44. package/dist/runtime/components/forms/RadioGroup.vue +1 -1
  45. package/dist/runtime/components/forms/RadioGroup.vue.d.ts +4 -4
  46. package/dist/runtime/components/forms/Range.vue +2 -2
  47. package/dist/runtime/components/forms/Range.vue.d.ts +2 -2
  48. package/dist/runtime/components/forms/Select.vue +2 -2
  49. package/dist/runtime/components/forms/Select.vue.d.ts +3 -3
  50. package/dist/runtime/components/forms/SelectMenu.vue +48 -25
  51. package/dist/runtime/components/forms/SelectMenu.vue.d.ts +12 -11
  52. package/dist/runtime/components/forms/Textarea.vue +2 -2
  53. package/dist/runtime/components/forms/Textarea.vue.d.ts +3 -3
  54. package/dist/runtime/components/forms/Toggle.vue +2 -2
  55. package/dist/runtime/components/forms/Toggle.vue.d.ts +1 -1
  56. package/dist/runtime/components/layout/Card.vue +2 -2
  57. package/dist/runtime/components/layout/Card.vue.d.ts +1 -1
  58. package/dist/runtime/components/layout/Container.vue +2 -2
  59. package/dist/runtime/components/layout/Container.vue.d.ts +1 -1
  60. package/dist/runtime/components/layout/Divider.vue +2 -2
  61. package/dist/runtime/components/layout/Divider.vue.d.ts +19 -19
  62. package/dist/runtime/components/layout/Skeleton.vue +2 -2
  63. package/dist/runtime/components/layout/Skeleton.vue.d.ts +1 -1
  64. package/dist/runtime/components/navigation/Breadcrumb.vue +2 -2
  65. package/dist/runtime/components/navigation/Breadcrumb.vue.d.ts +3 -3
  66. package/dist/runtime/components/navigation/CommandPalette.vue.d.ts +26 -26
  67. package/dist/runtime/components/navigation/CommandPaletteGroup.vue.d.ts +3 -3
  68. package/dist/runtime/components/navigation/HorizontalNavigation.vue +2 -2
  69. package/dist/runtime/components/navigation/HorizontalNavigation.vue.d.ts +164 -22
  70. package/dist/runtime/components/navigation/Pagination.vue.d.ts +38 -38
  71. package/dist/runtime/components/navigation/Tabs.vue.d.ts +2 -2
  72. package/dist/runtime/components/navigation/VerticalNavigation.vue +2 -2
  73. package/dist/runtime/components/navigation/VerticalNavigation.vue.d.ts +186 -44
  74. package/dist/runtime/components/overlays/ContextMenu.vue +2 -2
  75. package/dist/runtime/components/overlays/ContextMenu.vue.d.ts +1 -1
  76. package/dist/runtime/components/overlays/Notification.vue +8 -4
  77. package/dist/runtime/components/overlays/Notification.vue.d.ts +50 -41
  78. package/dist/runtime/components/overlays/Notifications.vue +4 -4
  79. package/dist/runtime/components/overlays/Notifications.vue.d.ts +55 -46
  80. package/dist/runtime/components/overlays/Popover.vue.d.ts +1 -1
  81. package/dist/runtime/components/overlays/Tooltip.vue.d.ts +2 -2
  82. package/dist/runtime/types/checkbox.d.ts +3 -0
  83. package/dist/runtime/types/divider.d.ts +1 -1
  84. package/dist/runtime/types/index.d.ts +1 -0
  85. package/dist/runtime/types/index.js +1 -0
  86. package/dist/runtime/types/link.d.ts +1 -1
  87. package/dist/runtime/types/utils.d.ts +1 -1
  88. package/dist/runtime/ui.config/data/table.d.ts +9 -8
  89. package/dist/runtime/ui.config/elements/accordion.d.ts +1 -1
  90. package/dist/runtime/ui.config/elements/alert.d.ts +5 -4
  91. package/dist/runtime/ui.config/elements/badge.d.ts +15 -0
  92. package/dist/runtime/ui.config/elements/badge.js +15 -0
  93. package/dist/runtime/ui.config/elements/carousel.d.ts +3 -2
  94. package/dist/runtime/ui.config/elements/dropdown.d.ts +2 -1
  95. package/dist/runtime/ui.config/forms/inputMenu.d.ts +2 -1
  96. package/dist/runtime/ui.config/forms/selectMenu.d.ts +1 -1
  97. package/dist/runtime/ui.config/layout/divider.d.ts +4 -3
  98. package/dist/runtime/ui.config/navigation/commandPalette.d.ts +2 -1
  99. package/dist/runtime/ui.config/navigation/horizontalNavigation.d.ts +5 -4
  100. package/dist/runtime/ui.config/navigation/pagination.d.ts +7 -6
  101. package/dist/runtime/ui.config/navigation/verticalNavigation.d.ts +5 -4
  102. package/dist/runtime/ui.config/overlays/notification.d.ts +6 -5
  103. package/dist/runtime/utils/index.d.ts +1 -0
  104. package/dist/runtime/utils/index.js +4 -3
  105. package/package.json +28 -25
@@ -32,7 +32,7 @@
32
32
  </template>
33
33
 
34
34
  <script>
35
- import { isEqual } from "ohash";
35
+ import { isEqual, diff } from "ohash";
36
36
  import { defineComponent } from "vue";
37
37
  import { nuxtLinkProps } from "../../utils";
38
38
  export default defineComponent({
@@ -60,7 +60,7 @@ export default defineComponent({
60
60
  default: false
61
61
  },
62
62
  exactQuery: {
63
- type: Boolean,
63
+ type: [Boolean, String],
64
64
  default: false
65
65
  },
66
66
  exactHash: {
@@ -73,9 +73,20 @@ export default defineComponent({
73
73
  }
74
74
  },
75
75
  setup(props) {
76
+ function isPartiallyEqual(item1, item2) {
77
+ const diffedKeys = diff(item1, item2).reduce((filtered, q) => {
78
+ if (q.type === "added") {
79
+ filtered.push(q.key);
80
+ }
81
+ return filtered;
82
+ }, []);
83
+ return isEqual(item1, item2, { excludeKeys: (key) => diffedKeys.includes(key) });
84
+ }
76
85
  function resolveLinkClass(route, $route, { isActive, isExactActive }) {
77
- if (props.exactQuery && !isEqual(route.query, $route.query)) {
78
- return props.inactiveClass;
86
+ if (props.exactQuery === "partial") {
87
+ if (!isPartiallyEqual(route.query, $route.query)) return props.inactiveClass;
88
+ } else if (props.exactQuery === true) {
89
+ if (!isEqual(route.query, $route.query)) return props.inactiveClass;
79
90
  }
80
91
  if (props.exactHash && route.hash !== $route.hash) {
81
92
  return props.inactiveClass;
@@ -1,3 +1,4 @@
1
+ import { type PropType } from 'vue';
1
2
  declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
2
3
  as: {
3
4
  type: StringConstructor;
@@ -20,7 +21,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
20
21
  default: boolean;
21
22
  };
22
23
  exactQuery: {
23
- type: BooleanConstructor;
24
+ type: PropType<boolean | "partial">;
24
25
  default: boolean;
25
26
  };
26
27
  exactHash: {
@@ -32,67 +33,67 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
32
33
  default: any;
33
34
  };
34
35
  to: {
35
- readonly type: import("vue").PropType<import("vue-router").RouteLocationRaw>;
36
+ readonly type: PropType<import("vue-router").RouteLocationRaw>;
36
37
  readonly default: any;
37
38
  readonly required: false;
38
39
  };
39
40
  href: {
40
- readonly type: import("vue").PropType<import("vue-router").RouteLocationRaw>;
41
+ readonly type: PropType<import("vue-router").RouteLocationRaw>;
41
42
  readonly default: any;
42
43
  readonly required: false;
43
44
  };
44
45
  target: {
45
- readonly type: import("vue").PropType<import("#app").NuxtLinkProps["target"]>;
46
+ readonly type: PropType<import("#app").NuxtLinkProps["target"]>;
46
47
  readonly default: any;
47
48
  readonly required: false;
48
49
  };
49
50
  rel: {
50
- readonly type: import("vue").PropType<any>;
51
+ readonly type: PropType<any>;
51
52
  readonly default: any;
52
53
  readonly required: false;
53
54
  };
54
55
  noRel: {
55
- readonly type: import("vue").PropType<import("#app").NuxtLinkProps["noRel"]>;
56
+ readonly type: PropType<import("#app").NuxtLinkProps["noRel"]>;
56
57
  readonly default: any;
57
58
  readonly required: false;
58
59
  };
59
60
  prefetch: {
60
- readonly type: import("vue").PropType<import("#app").NuxtLinkProps["prefetch"]>;
61
+ readonly type: PropType<import("#app").NuxtLinkProps["prefetch"]>;
61
62
  readonly default: any;
62
63
  readonly required: false;
63
64
  };
64
65
  noPrefetch: {
65
- readonly type: import("vue").PropType<import("#app").NuxtLinkProps["noPrefetch"]>;
66
+ readonly type: PropType<import("#app").NuxtLinkProps["noPrefetch"]>;
66
67
  readonly default: any;
67
68
  readonly required: false;
68
69
  };
69
70
  activeClass: {
70
- readonly type: import("vue").PropType<import("#app").NuxtLinkProps["activeClass"]>;
71
+ readonly type: PropType<import("#app").NuxtLinkProps["activeClass"]>;
71
72
  readonly default: any;
72
73
  readonly required: false;
73
74
  };
74
75
  exactActiveClass: {
75
- readonly type: import("vue").PropType<import("#app").NuxtLinkProps["exactActiveClass"]>;
76
+ readonly type: PropType<import("#app").NuxtLinkProps["exactActiveClass"]>;
76
77
  readonly default: any;
77
78
  readonly required: false;
78
79
  };
79
80
  prefetchedClass: {
80
- readonly type: import("vue").PropType<import("#app").NuxtLinkProps["prefetchedClass"]>;
81
+ readonly type: PropType<import("#app").NuxtLinkProps["prefetchedClass"]>;
81
82
  readonly default: any;
82
83
  readonly required: false;
83
84
  };
84
85
  replace: {
85
- readonly type: import("vue").PropType<import("#app").NuxtLinkProps["replace"]>;
86
+ readonly type: PropType<import("#app").NuxtLinkProps["replace"]>;
86
87
  readonly default: any;
87
88
  readonly required: false;
88
89
  };
89
90
  ariaCurrentValue: {
90
- readonly type: import("vue").PropType<import("#app").NuxtLinkProps["ariaCurrentValue"]>;
91
+ readonly type: PropType<import("#app").NuxtLinkProps["ariaCurrentValue"]>;
91
92
  readonly default: any;
92
93
  readonly required: false;
93
94
  };
94
95
  external: {
95
- readonly type: import("vue").PropType<import("#app").NuxtLinkProps["external"]>;
96
+ readonly type: PropType<import("#app").NuxtLinkProps["external"]>;
96
97
  readonly default: any;
97
98
  readonly required: false;
98
99
  };
@@ -123,7 +124,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
123
124
  default: boolean;
124
125
  };
125
126
  exactQuery: {
126
- type: BooleanConstructor;
127
+ type: PropType<boolean | "partial">;
127
128
  default: boolean;
128
129
  };
129
130
  exactHash: {
@@ -135,67 +136,67 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
135
136
  default: any;
136
137
  };
137
138
  to: {
138
- readonly type: import("vue").PropType<import("vue-router").RouteLocationRaw>;
139
+ readonly type: PropType<import("vue-router").RouteLocationRaw>;
139
140
  readonly default: any;
140
141
  readonly required: false;
141
142
  };
142
143
  href: {
143
- readonly type: import("vue").PropType<import("vue-router").RouteLocationRaw>;
144
+ readonly type: PropType<import("vue-router").RouteLocationRaw>;
144
145
  readonly default: any;
145
146
  readonly required: false;
146
147
  };
147
148
  target: {
148
- readonly type: import("vue").PropType<import("#app").NuxtLinkProps["target"]>;
149
+ readonly type: PropType<import("#app").NuxtLinkProps["target"]>;
149
150
  readonly default: any;
150
151
  readonly required: false;
151
152
  };
152
153
  rel: {
153
- readonly type: import("vue").PropType<any>;
154
+ readonly type: PropType<any>;
154
155
  readonly default: any;
155
156
  readonly required: false;
156
157
  };
157
158
  noRel: {
158
- readonly type: import("vue").PropType<import("#app").NuxtLinkProps["noRel"]>;
159
+ readonly type: PropType<import("#app").NuxtLinkProps["noRel"]>;
159
160
  readonly default: any;
160
161
  readonly required: false;
161
162
  };
162
163
  prefetch: {
163
- readonly type: import("vue").PropType<import("#app").NuxtLinkProps["prefetch"]>;
164
+ readonly type: PropType<import("#app").NuxtLinkProps["prefetch"]>;
164
165
  readonly default: any;
165
166
  readonly required: false;
166
167
  };
167
168
  noPrefetch: {
168
- readonly type: import("vue").PropType<import("#app").NuxtLinkProps["noPrefetch"]>;
169
+ readonly type: PropType<import("#app").NuxtLinkProps["noPrefetch"]>;
169
170
  readonly default: any;
170
171
  readonly required: false;
171
172
  };
172
173
  activeClass: {
173
- readonly type: import("vue").PropType<import("#app").NuxtLinkProps["activeClass"]>;
174
+ readonly type: PropType<import("#app").NuxtLinkProps["activeClass"]>;
174
175
  readonly default: any;
175
176
  readonly required: false;
176
177
  };
177
178
  exactActiveClass: {
178
- readonly type: import("vue").PropType<import("#app").NuxtLinkProps["exactActiveClass"]>;
179
+ readonly type: PropType<import("#app").NuxtLinkProps["exactActiveClass"]>;
179
180
  readonly default: any;
180
181
  readonly required: false;
181
182
  };
182
183
  prefetchedClass: {
183
- readonly type: import("vue").PropType<import("#app").NuxtLinkProps["prefetchedClass"]>;
184
+ readonly type: PropType<import("#app").NuxtLinkProps["prefetchedClass"]>;
184
185
  readonly default: any;
185
186
  readonly required: false;
186
187
  };
187
188
  replace: {
188
- readonly type: import("vue").PropType<import("#app").NuxtLinkProps["replace"]>;
189
+ readonly type: PropType<import("#app").NuxtLinkProps["replace"]>;
189
190
  readonly default: any;
190
191
  readonly required: false;
191
192
  };
192
193
  ariaCurrentValue: {
193
- readonly type: import("vue").PropType<import("#app").NuxtLinkProps["ariaCurrentValue"]>;
194
+ readonly type: PropType<import("#app").NuxtLinkProps["ariaCurrentValue"]>;
194
195
  readonly default: any;
195
196
  readonly required: false;
196
197
  };
197
198
  external: {
198
- readonly type: import("vue").PropType<import("#app").NuxtLinkProps["external"]>;
199
+ readonly type: PropType<import("#app").NuxtLinkProps["external"]>;
199
200
  readonly default: any;
200
201
  readonly required: false;
201
202
  };
@@ -216,7 +217,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
216
217
  as: string;
217
218
  active: boolean;
218
219
  exact: boolean;
219
- exactQuery: boolean;
220
+ exactQuery: boolean | "partial";
220
221
  exactHash: boolean;
221
222
  inactiveClass: string;
222
223
  href: string | import("vue-router").RouteLocationAsRelativeGeneric | import("vue-router").RouteLocationAsPathGeneric;
@@ -256,11 +256,9 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
256
256
  default: () => {};
257
257
  };
258
258
  }>> & Readonly<{}>, {
259
- size: "xs" | "sm" | "2xs" | "md" | "lg" | "xl" | "2xl";
259
+ size: "sm" | "xs" | "2xs" | "md" | "lg" | "xl" | "2xl";
260
260
  class: any;
261
261
  max: number;
262
- color: MeterColor;
263
- label: string;
264
262
  ui: {
265
263
  wrapper?: string;
266
264
  indicator?: DeepPartial<{
@@ -341,6 +339,8 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
341
339
  } & {
342
340
  strategy?: Strategy;
343
341
  };
342
+ color: MeterColor;
343
+ label: string;
344
344
  icon: string;
345
345
  value: number;
346
346
  indicator: boolean;
@@ -1,5 +1,5 @@
1
1
  import type { VNode, SlotsType, PropType } from 'vue';
2
- import type { Strategy, MeterSize } from '../../types/index.js';
2
+ import type { DeepPartial, Strategy, MeterSize } from '../../types/index.js';
3
3
  import type Meter from './Meter.vue.js';
4
4
  declare const meterGroupConfig: {
5
5
  wrapper: string;
@@ -79,7 +79,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
79
79
  default: () => "";
80
80
  };
81
81
  ui: {
82
- type: PropType<Partial<typeof meterGroupConfig> & {
82
+ type: PropType<DeepPartial<typeof meterGroupConfig> & {
83
83
  strategy?: Strategy;
84
84
  }>;
85
85
  default: () => {};
@@ -113,22 +113,21 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
113
113
  default: () => "";
114
114
  };
115
115
  ui: {
116
- type: PropType<Partial<typeof meterGroupConfig> & {
116
+ type: PropType<DeepPartial<typeof meterGroupConfig> & {
117
117
  strategy?: Strategy;
118
118
  }>;
119
119
  default: () => {};
120
120
  };
121
121
  }>> & Readonly<{}>, {
122
- size: "xs" | "sm" | "2xs" | "md" | "lg" | "xl" | "2xl";
123
- ui: Partial<{
124
- wrapper: string;
125
- base: string;
126
- background: string;
127
- transition: string;
128
- rounded: string;
129
- shadow: string;
130
- list: string;
131
- orientation: {
122
+ ui: {
123
+ wrapper?: string;
124
+ base?: string;
125
+ background?: string;
126
+ transition?: string;
127
+ rounded?: string;
128
+ shadow?: string;
129
+ list?: string;
130
+ orientation?: DeepPartial<{
132
131
  'rounded-none': {
133
132
  left: string;
134
133
  right: string;
@@ -165,16 +164,19 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
165
164
  left: string;
166
165
  right: string;
167
166
  };
168
- };
169
- default: {
167
+ }, any>;
168
+ default?: DeepPartial<{
170
169
  size: string;
171
170
  icon: string;
172
- };
173
- }> & {
171
+ }, any>;
172
+ } & {
173
+ [key: string]: any;
174
+ } & {
174
175
  strategy?: Strategy;
175
176
  };
176
- icon: string;
177
+ size: "sm" | "xs" | "2xs" | "md" | "lg" | "xl" | "2xl";
177
178
  class: any;
179
+ icon: string;
178
180
  max: number;
179
181
  min: number;
180
182
  indicator: boolean;
@@ -2,7 +2,7 @@ import { h, cloneVNode, computed, toRef, defineComponent } from "vue";
2
2
  import { twJoin } from "tailwind-merge";
3
3
  import UIcon from "../elements/Icon.vue";
4
4
  import { useUI } from "../../composables/useUI.js";
5
- import { mergeConfig, getSlotsChildren } from "../../utils/index.js";
5
+ import { getSlotsChildren, mergeConfig } from "../../utils/index.js";
6
6
  import appConfig from "#build/app.config";
7
7
  import { meter, meterGroup } from "#ui/ui.config";
8
8
  const meterConfig = mergeConfig(appConfig.ui.strategy, appConfig.ui.meter, meter);
@@ -268,11 +268,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
268
268
  default: () => {};
269
269
  };
270
270
  }>> & Readonly<{}>, {
271
- size: "xs" | "sm" | "2xs" | "md" | "lg" | "xl" | "2xl";
271
+ size: "sm" | "xs" | "2xs" | "md" | "lg" | "xl" | "2xl";
272
272
  class: any;
273
273
  max: number | any[];
274
274
  animation: "carousel" | "carousel-inverse" | "swing" | "elastic";
275
- color: "primary" | "red" | "orange" | "amber" | "yellow" | "lime" | "green" | "emerald" | "teal" | "cyan" | "sky" | "blue" | "indigo" | "violet" | "purple" | "fuchsia" | "pink" | "rose";
276
275
  ui: {
277
276
  wrapper?: string;
278
277
  indicator?: DeepPartial<{
@@ -351,6 +350,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
351
350
  } & {
352
351
  strategy?: Strategy;
353
352
  };
353
+ color: "primary" | "red" | "orange" | "amber" | "yellow" | "lime" | "green" | "emerald" | "teal" | "cyan" | "sky" | "blue" | "indigo" | "violet" | "purple" | "fuchsia" | "pink" | "rose";
354
354
  value: number;
355
355
  indicator: boolean;
356
356
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -31,10 +31,10 @@
31
31
 
32
32
  <script>
33
33
  import { computed, toRef, defineComponent } from "vue";
34
- import { twMerge, twJoin } from "tailwind-merge";
34
+ import { twJoin } from "tailwind-merge";
35
35
  import { useUI } from "../../composables/useUI";
36
36
  import { useFormGroup } from "../../composables/useFormGroup";
37
- import { mergeConfig } from "../../utils";
37
+ import { mergeConfig, twMerge } from "../../utils";
38
38
  import appConfig from "#build/app.config";
39
39
  import { checkbox } from "#ui/ui.config";
40
40
  import { useId } from "#app";
@@ -166,8 +166,6 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
166
166
  required: boolean;
167
167
  class: any;
168
168
  disabled: boolean;
169
- color: "primary" | "red" | "orange" | "amber" | "yellow" | "lime" | "green" | "emerald" | "teal" | "cyan" | "sky" | "blue" | "indigo" | "violet" | "purple" | "fuchsia" | "pink" | "rose";
170
- label: string;
171
169
  ui: {
172
170
  wrapper?: string;
173
171
  container?: string;
@@ -190,6 +188,8 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
190
188
  } & {
191
189
  strategy?: Strategy;
192
190
  };
191
+ color: "primary" | "red" | "orange" | "amber" | "yellow" | "lime" | "green" | "emerald" | "teal" | "cyan" | "sky" | "blue" | "indigo" | "violet" | "purple" | "fuchsia" | "pink" | "rose";
192
+ label: string;
193
193
  id: string;
194
194
  modelValue: boolean | any[];
195
195
  value: string | number | boolean | Record<string, any>;
@@ -38,6 +38,7 @@ export default defineComponent({
38
38
  setup(props, { expose, emit }) {
39
39
  const formId = useId();
40
40
  const bus = useEventBus(`form-${formId}`);
41
+ const parsedValue = ref(null);
41
42
  onMounted(() => {
42
43
  bus.on(async (event) => {
43
44
  if (event.type !== "submit" && props.validateOn?.includes(event.type)) {
@@ -60,7 +61,7 @@ export default defineComponent({
60
61
  if (errors2) {
61
62
  errs = errs.concat(errors2);
62
63
  } else {
63
- Object.assign(props.state, result);
64
+ parsedValue.value = result;
64
65
  }
65
66
  }
66
67
  return errs;
@@ -95,7 +96,7 @@ export default defineComponent({
95
96
  if (props.validateOn?.includes("submit")) {
96
97
  await validate();
97
98
  }
98
- event.data = props.state;
99
+ event.data = props.schema ? parsedValue.value : props.state;
99
100
  emit("submit", event);
100
101
  } catch (error) {
101
102
  if (!(error instanceof FormException)) {
@@ -187,10 +188,10 @@ async function validateValibotSchema(state, schema) {
187
188
  }
188
189
  async function validateJoiSchema(state, schema) {
189
190
  try {
190
- await schema.validateAsync(state, { abortEarly: false });
191
+ const result = await schema.validateAsync(state, { abortEarly: false });
191
192
  return {
192
193
  errors: null,
193
- result: state
194
+ result
194
195
  };
195
196
  } catch (error) {
196
197
  if (isJoiError(error)) {
@@ -243,7 +244,7 @@ async function validateSuperstructSchema(state, schema) {
243
244
  }
244
245
  async function validateYupSchema(state, schema) {
245
246
  try {
246
- const result = schema.validateSync(state, { abortEarly: false });
247
+ const result = await schema.validate(state, { abortEarly: false });
247
248
  return {
248
249
  errors: null,
249
250
  result
@@ -158,8 +158,6 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
158
158
  required: boolean;
159
159
  size: FormGroupSize;
160
160
  class: any;
161
- label: string;
162
- error: string | boolean;
163
161
  ui: {
164
162
  wrapper?: string;
165
163
  inner?: string;
@@ -189,6 +187,8 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
189
187
  } & {
190
188
  strategy?: Strategy;
191
189
  };
190
+ label: string;
191
+ error: string | boolean;
192
192
  description: string;
193
193
  help: string;
194
194
  hint: string;
@@ -32,12 +32,12 @@
32
32
 
33
33
  <script>
34
34
  import { ref, computed, toRef, onMounted, defineComponent } from "vue";
35
- import { twMerge, twJoin } from "tailwind-merge";
35
+ import { twJoin } from "tailwind-merge";
36
36
  import { defu } from "defu";
37
37
  import UIcon from "../elements/Icon.vue";
38
38
  import { useUI } from "../../composables/useUI";
39
39
  import { useFormGroup } from "../../composables/useFormGroup";
40
- import { mergeConfig, looseToNumber } from "../../utils";
40
+ import { looseToNumber, mergeConfig, twMerge } from "../../utils";
41
41
  import { useInjectButtonGroup } from "../../composables/useButtonGroup";
42
42
  import appConfig from "#build/app.config";
43
43
  import { input } from "#ui/ui.config";
@@ -462,9 +462,6 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
462
462
  size: InputSize;
463
463
  class: any;
464
464
  disabled: boolean;
465
- leading: boolean;
466
- color: InputColor;
467
- variant: InputVariant;
468
465
  ui: {
469
466
  wrapper?: string;
470
467
  base?: string;
@@ -578,6 +575,9 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
578
575
  } & {
579
576
  strategy?: Strategy;
580
577
  };
578
+ color: InputColor;
579
+ variant: InputVariant;
580
+ leading: boolean;
581
581
  id: string;
582
582
  icon: string;
583
583
  modelValue: string | number;
@@ -48,7 +48,7 @@
48
48
  v-slot="{ active, selected, disabled: optionDisabled }"
49
49
  :key="index"
50
50
  as="template"
51
- :value="valueAttribute ? option[valueAttribute] : option"
51
+ :value="valueAttribute ? accessor(option, valueAttribute) : option"
52
52
  :disabled="option.disabled"
53
53
  >
54
54
  <li :class="[uiMenu.option.base, uiMenu.option.rounded, uiMenu.option.padding, uiMenu.option.size, uiMenu.option.color, active ? uiMenu.option.active : uiMenu.option.inactive, selected && uiMenu.option.selected, optionDisabled && uiMenu.option.disabled]">
@@ -102,13 +102,14 @@ import {
102
102
  } from "@headlessui/vue";
103
103
  import { computedAsync, useDebounceFn } from "@vueuse/core";
104
104
  import { defu } from "defu";
105
- import { twMerge, twJoin } from "tailwind-merge";
105
+ import { twJoin } from "tailwind-merge";
106
+ import { isEqual } from "ohash";
106
107
  import UIcon from "../elements/Icon.vue";
107
108
  import UAvatar from "../elements/Avatar.vue";
108
109
  import { useUI } from "../../composables/useUI";
109
110
  import { usePopper } from "../../composables/usePopper";
110
111
  import { useFormGroup } from "../../composables/useFormGroup";
111
- import { get, mergeConfig } from "../../utils";
112
+ import { get, mergeConfig, twMerge } from "../../utils";
112
113
  import { useInjectButtonGroup } from "../../composables/useButtonGroup";
113
114
  import appConfig from "#build/app.config";
114
115
  import { input, inputMenu } from "#ui/ui.config";
@@ -281,6 +282,20 @@ export default defineComponent({
281
282
  const { size: sizeButtonGroup, rounded } = useInjectButtonGroup({ ui, props });
282
283
  const { emitFormBlur, emitFormChange, inputId, color, size: sizeFormGroup, name } = useFormGroup(props, config);
283
284
  const size = computed(() => sizeButtonGroup.value ?? sizeFormGroup.value);
285
+ const by = computed(() => {
286
+ if (!props.by) return void 0;
287
+ if (typeof props.by === "function") {
288
+ return props.by;
289
+ }
290
+ const key = props.by;
291
+ const hasDot = key.indexOf(".");
292
+ if (hasDot > 0) {
293
+ return (a, z) => {
294
+ return accessor(a, key) === accessor(z, key);
295
+ };
296
+ }
297
+ return key;
298
+ });
284
299
  const internalQuery = ref("");
285
300
  const query = computed({
286
301
  get() {
@@ -292,11 +307,24 @@ export default defineComponent({
292
307
  }
293
308
  });
294
309
  const label = computed(() => {
295
- if (!props.modelValue) {
296
- return;
310
+ if (!props.modelValue) return null;
311
+ function getValue(value) {
312
+ if (props.valueAttribute) {
313
+ return accessor(value, props.valueAttribute);
314
+ }
315
+ return value;
316
+ }
317
+ function compareValues(value1, value2) {
318
+ if (by.value && typeof by.value !== "function" && typeof value1 === "object" && typeof value2 === "object") {
319
+ return isEqual(value1[props.by], value2[props.by]);
320
+ }
321
+ return isEqual(value1, value2);
297
322
  }
298
323
  if (props.valueAttribute) {
299
- const option = options.value.find((option2) => option2[props.valueAttribute] === props.modelValue);
324
+ const option = options.value.find((option2) => {
325
+ const optionValue = getValue(option2);
326
+ return compareValues(optionValue, props.modelValue);
327
+ });
300
328
  return option ? accessor(option, props.optionAttribute) : null;
301
329
  } else {
302
330
  return ["string", "number"].includes(typeof props.modelValue) ? props.modelValue : accessor(props.modelValue, props.optionAttribute);
@@ -443,7 +471,9 @@ export default defineComponent({
443
471
  query,
444
472
  accessor,
445
473
  onUpdate,
446
- onQueryChange
474
+ onQueryChange,
475
+ // eslint-disable-next-line vue/no-dupe-keys
476
+ by
447
477
  };
448
478
  }
449
479
  });
@@ -145,7 +145,7 @@ declare const configMenu: {
145
145
  };
146
146
  avatar: {
147
147
  base: string;
148
- size: "2xs";
148
+ size: import("../../types/avatar").AvatarSize;
149
149
  };
150
150
  chip: {
151
151
  base: string;
@@ -467,7 +467,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
467
467
  };
468
468
  avatar: {
469
469
  base: string;
470
- size: "2xs";
470
+ size: import("../../types/avatar").AvatarSize;
471
471
  };
472
472
  chip: {
473
473
  base: string;
@@ -523,6 +523,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
523
523
  accessor: <T extends Record<string, any>>(obj: T, key: string) => any;
524
524
  onUpdate: (value: any) => void;
525
525
  onQueryChange: (event: any) => void;
526
+ by: import("vue").ComputedRef<string | ((a: any, z: any) => boolean)>;
526
527
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "close" | "update:modelValue" | "open" | "update:query")[], "change" | "close" | "update:modelValue" | "open" | "update:query", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
527
528
  modelValue: {
528
529
  type: PropType<string | number | object | Array<any> | null>;
@@ -678,12 +679,6 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
678
679
  size: InputSize;
679
680
  class: any;
680
681
  disabled: boolean;
681
- search: (query: string) => Promise<any[]> | any[];
682
- leading: boolean;
683
- popper: PopperOptions;
684
- color: InputColor;
685
- variant: InputVariant;
686
- query: string;
687
682
  ui: {
688
683
  wrapper?: string;
689
684
  base?: string;
@@ -797,6 +792,12 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
797
792
  } & {
798
793
  strategy?: Strategy;
799
794
  };
795
+ color: InputColor;
796
+ variant: InputVariant;
797
+ search: (query: string) => Promise<any[]> | any[];
798
+ leading: boolean;
799
+ popper: PopperOptions;
800
+ query: string;
800
801
  id: string;
801
802
  icon: string;
802
803
  options: string[] | {
@@ -856,7 +857,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
856
857
  };
857
858
  avatar: {
858
859
  base: string;
859
- size: "2xs";
860
+ size: import("../../types/avatar").AvatarSize;
860
861
  };
861
862
  chip: {
862
863
  base: string;
@@ -1533,9 +1534,6 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
1533
1534
  }>> & Readonly<{}>, {
1534
1535
  size: import("../../types/avatar").AvatarSize;
1535
1536
  class: any;
1536
- as: string | Record<string, any>;
1537
- text: string;
1538
- alt: string;
1539
1537
  ui: {
1540
1538
  wrapper?: string;
1541
1539
  background?: string;
@@ -1599,6 +1597,9 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
1599
1597
  } & {
1600
1598
  strategy?: Strategy;
1601
1599
  };
1600
+ as: string | Record<string, any>;
1601
+ text: string;
1602
+ alt: string;
1602
1603
  icon: string;
1603
1604
  src: string | boolean;
1604
1605
  chipColor: import("../../types/avatar").AvatarChipColor;