@nuxt/ui 2.11.1 → 2.12.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 (74) hide show
  1. package/dist/module.d.mts +100 -28
  2. package/dist/module.d.ts +100 -28
  3. package/dist/module.json +1 -1
  4. package/dist/module.mjs +2 -2
  5. package/dist/runtime/components/data/Table.vue +26 -18
  6. package/dist/runtime/components/data/Table.vue.d.ts +21 -12
  7. package/dist/runtime/components/elements/Accordion.vue +8 -4
  8. package/dist/runtime/components/elements/Accordion.vue.d.ts +4 -4
  9. package/dist/runtime/components/elements/Alert.vue +8 -2
  10. package/dist/runtime/components/elements/Alert.vue.d.ts +5 -10
  11. package/dist/runtime/components/elements/Button.vue +6 -3
  12. package/dist/runtime/components/elements/Button.vue.d.ts +119 -1
  13. package/dist/runtime/components/elements/Chip.vue.d.ts +2 -2
  14. package/dist/runtime/components/elements/Dropdown.vue +66 -17
  15. package/dist/runtime/components/elements/Dropdown.vue.d.ts +31 -4
  16. package/dist/runtime/components/elements/Link.vue +9 -4
  17. package/dist/runtime/components/elements/Link.vue.d.ts +194 -4
  18. package/dist/runtime/components/forms/Form.vue +16 -7
  19. package/dist/runtime/components/forms/Form.vue.d.ts +1 -1
  20. package/dist/runtime/components/forms/Input.vue +1 -1
  21. package/dist/runtime/components/forms/Input.vue.d.ts +1 -1
  22. package/dist/runtime/components/forms/InputMenu.vue +419 -0
  23. package/dist/runtime/components/forms/InputMenu.vue.d.ts +332 -0
  24. package/dist/runtime/components/forms/RadioGroup.vue +1 -1
  25. package/dist/runtime/components/forms/Select.vue +1 -1
  26. package/dist/runtime/components/forms/Select.vue.d.ts +1 -1
  27. package/dist/runtime/components/forms/SelectMenu.vue +70 -21
  28. package/dist/runtime/components/forms/SelectMenu.vue.d.ts +31 -10
  29. package/dist/runtime/components/forms/Toggle.vue +1 -1
  30. package/dist/runtime/components/forms/Toggle.vue.d.ts +2 -1
  31. package/dist/runtime/components/layout/Divider.vue +4 -5
  32. package/dist/runtime/components/navigation/Breadcrumb.vue +8 -5
  33. package/dist/runtime/components/navigation/Breadcrumb.vue.d.ts +4 -2
  34. package/dist/runtime/components/navigation/CommandPalette.vue.d.ts +3 -3
  35. package/dist/runtime/components/navigation/Pagination.vue +9 -4
  36. package/dist/runtime/components/navigation/Pagination.vue.d.ts +9 -0
  37. package/dist/runtime/components/navigation/VerticalNavigation.vue +53 -38
  38. package/dist/runtime/components/navigation/VerticalNavigation.vue.d.ts +8 -5
  39. package/dist/runtime/components/overlays/Modal.vue.d.ts +1 -1
  40. package/dist/runtime/components/overlays/Popover.vue +49 -13
  41. package/dist/runtime/components/overlays/Popover.vue.d.ts +14 -4
  42. package/dist/runtime/components/overlays/Slideover.vue.d.ts +1 -1
  43. package/dist/runtime/components/overlays/Tooltip.vue +1 -1
  44. package/dist/runtime/composables/useShortcuts.mjs +3 -1
  45. package/dist/runtime/types/alert.d.ts +5 -0
  46. package/dist/runtime/types/breadcrumb.d.ts +1 -0
  47. package/dist/runtime/types/chip.d.ts +4 -0
  48. package/dist/runtime/types/dropdown.d.ts +2 -0
  49. package/dist/runtime/types/form.d.ts +1 -0
  50. package/dist/runtime/types/index.d.ts +1 -0
  51. package/dist/runtime/types/link.d.ts +3 -0
  52. package/dist/runtime/types/tooltip.d.ts +7 -0
  53. package/dist/runtime/types/vertical-navigation.d.ts +1 -0
  54. package/dist/runtime/ui.config/forms/input.mjs +12 -12
  55. package/dist/runtime/ui.config/forms/inputMenu.d.ts +64 -0
  56. package/dist/runtime/ui.config/forms/inputMenu.mjs +62 -0
  57. package/dist/runtime/ui.config/forms/selectMenu.d.ts +14 -12
  58. package/dist/runtime/ui.config/forms/selectMenu.mjs +7 -41
  59. package/dist/runtime/ui.config/index.d.ts +1 -0
  60. package/dist/runtime/ui.config/index.mjs +1 -0
  61. package/dist/runtime/ui.config/layout/card.mjs +1 -1
  62. package/dist/runtime/ui.config/navigation/breadcrumb.d.ts +1 -0
  63. package/dist/runtime/ui.config/navigation/breadcrumb.mjs +1 -0
  64. package/dist/runtime/ui.config/navigation/verticalNavigation.d.ts +5 -0
  65. package/dist/runtime/ui.config/navigation/verticalNavigation.mjs +5 -0
  66. package/dist/runtime/ui.config/popper.mjs +2 -1
  67. package/dist/runtime/utils/index.d.ts +1 -0
  68. package/dist/runtime/utils/index.mjs +12 -3
  69. package/dist/runtime/utils/link.d.ts +58 -0
  70. package/dist/runtime/utils/link.mjs +111 -0
  71. package/dist/runtime/utils/uid.mjs +2 -1
  72. package/dist/types.d.mts +2 -2
  73. package/dist/types.d.ts +1 -1
  74. package/package.json +31 -28
@@ -1,5 +1,5 @@
1
1
  import type { PropType } from 'vue';
2
- import { omit } from '../../utils';
2
+ import { twJoin } from 'tailwind-merge';
3
3
  import type { DropdownItem, PopperOptions } from '../../types';
4
4
  declare const _default: import("vue").DefineComponent<{
5
5
  items: {
@@ -11,6 +11,10 @@ declare const _default: import("vue").DefineComponent<{
11
11
  default: string;
12
12
  validator: (value: string) => boolean;
13
13
  };
14
+ open: {
15
+ type: BooleanConstructor;
16
+ default: undefined;
17
+ };
14
18
  disabled: {
15
19
  type: BooleanConstructor;
16
20
  default: boolean;
@@ -44,11 +48,25 @@ declare const _default: import("vue").DefineComponent<{
44
48
  trigger: import("vue").Ref<import("@vueuse/core").MaybeElement>;
45
49
  container: import("vue").Ref<import("@vueuse/core").MaybeElement>;
46
50
  containerStyle: import("vue").ComputedRef<{
51
+ paddingTop?: undefined;
52
+ paddingBottom?: undefined;
53
+ paddingLeft?: undefined;
54
+ paddingRight?: undefined;
55
+ } | {
47
56
  paddingTop: string;
48
57
  paddingBottom: string;
58
+ paddingLeft?: undefined;
59
+ paddingRight?: undefined;
49
60
  } | {
61
+ paddingLeft: string;
62
+ paddingRight: string;
50
63
  paddingTop?: undefined;
51
64
  paddingBottom?: undefined;
65
+ } | {
66
+ paddingTop: string;
67
+ paddingBottom: string;
68
+ paddingLeft: string;
69
+ paddingRight: string;
52
70
  }>;
53
71
  onMouseOver: () => void;
54
72
  onMouseLeave: () => void;
@@ -58,9 +76,11 @@ declare const _default: import("vue").DefineComponent<{
58
76
  close: any;
59
77
  isExternal: any;
60
78
  }) => void;
61
- omit: typeof omit;
79
+ getNuxtLinkProps: (props: any) => {};
80
+ twMerge: (...classLists: import("tailwind-merge").ClassNameValue[]) => string;
81
+ twJoin: typeof twJoin;
62
82
  NuxtLink: string | import("vue").ConcreteComponent<{}, any, any, import("vue").ComputedOptions, import("vue").MethodOptions>;
63
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
83
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:open"[], "update:open", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
64
84
  items: {
65
85
  type: PropType<DropdownItem[][]>;
66
86
  default: () => never[];
@@ -70,6 +90,10 @@ declare const _default: import("vue").DefineComponent<{
70
90
  default: string;
71
91
  validator: (value: string) => boolean;
72
92
  };
93
+ open: {
94
+ type: BooleanConstructor;
95
+ default: undefined;
96
+ };
73
97
  disabled: {
74
98
  type: BooleanConstructor;
75
99
  default: boolean;
@@ -94,12 +118,15 @@ declare const _default: import("vue").DefineComponent<{
94
118
  type: PropType<any>;
95
119
  default: () => {};
96
120
  };
97
- }>>, {
121
+ }>> & {
122
+ "onUpdate:open"?: ((...args: any[]) => any) | undefined;
123
+ }, {
98
124
  ui: any;
99
125
  popper: PopperOptions;
100
126
  class: any;
101
127
  disabled: boolean;
102
128
  items: DropdownItem[][];
129
+ open: boolean;
103
130
  mode: "click" | "hover";
104
131
  openDelay: number;
105
132
  closeDelay: number;
@@ -2,6 +2,7 @@
2
2
  <component
3
3
  :is="as"
4
4
  v-if="!to"
5
+ :type="type"
5
6
  :disabled="disabled"
6
7
  v-bind="$attrs"
7
8
  :class="active ? activeClass : inactiveClass"
@@ -21,7 +22,7 @@
21
22
  :role="disabled ? 'link' : undefined"
22
23
  :rel="rel"
23
24
  :target="target"
24
- :class="active ? activeClass : resolveLinkClass(route, $route, { isActive, isExactActive })"
25
+ :class="active !== undefined ? (active ? activeClass : inactiveClass) : resolveLinkClass(route, $route, { isActive, isExactActive })"
25
26
  @click="(e) => !isExternal && navigate(e)"
26
27
  >
27
28
  <slot v-bind="{ isActive: exact ? isExactActive : isActive }" />
@@ -32,22 +33,26 @@
32
33
  <script>
33
34
  import { isEqual } from "ohash";
34
35
  import { defineComponent } from "vue";
35
- import { NuxtLink } from "#components";
36
+ import { nuxtLinkProps } from "../../utils";
36
37
  export default defineComponent({
37
38
  inheritAttrs: false,
38
39
  props: {
39
- ...NuxtLink.props,
40
+ ...nuxtLinkProps,
40
41
  as: {
41
42
  type: String,
42
43
  default: "button"
43
44
  },
45
+ type: {
46
+ type: String,
47
+ default: "button"
48
+ },
44
49
  disabled: {
45
50
  type: Boolean,
46
51
  default: null
47
52
  },
48
53
  active: {
49
54
  type: Boolean,
50
- default: false
55
+ default: void 0
51
56
  },
52
57
  exact: {
53
58
  type: Boolean,
@@ -1,9 +1,199 @@
1
- declare const _default: import("vue").DefineComponent<any, {
1
+ declare const _default: import("vue").DefineComponent<{
2
+ as: {
3
+ type: StringConstructor;
4
+ default: string;
5
+ };
6
+ type: {
7
+ type: StringConstructor;
8
+ default: string;
9
+ };
10
+ disabled: {
11
+ type: BooleanConstructor;
12
+ default: null;
13
+ };
14
+ active: {
15
+ type: BooleanConstructor;
16
+ default: undefined;
17
+ };
18
+ exact: {
19
+ type: BooleanConstructor;
20
+ default: boolean;
21
+ };
22
+ exactQuery: {
23
+ type: BooleanConstructor;
24
+ default: boolean;
25
+ };
26
+ exactHash: {
27
+ type: BooleanConstructor;
28
+ default: boolean;
29
+ };
30
+ inactiveClass: {
31
+ type: StringConstructor;
32
+ default: undefined;
33
+ };
34
+ to: {
35
+ readonly type: import("vue").PropType<import("vue-router").RouteLocationRaw>;
36
+ readonly default: undefined;
37
+ };
38
+ href: {
39
+ readonly type: import("vue").PropType<import("vue-router").RouteLocationRaw>;
40
+ readonly default: undefined;
41
+ };
42
+ target: {
43
+ readonly type: import("vue").PropType<(string & {}) | "_blank" | "_parent" | "_self" | "_top" | null>;
44
+ readonly default: undefined;
45
+ };
46
+ rel: {
47
+ readonly type: StringConstructor;
48
+ readonly default: undefined;
49
+ };
50
+ noRel: {
51
+ readonly type: BooleanConstructor;
52
+ readonly default: undefined;
53
+ };
54
+ prefetch: {
55
+ readonly type: BooleanConstructor;
56
+ readonly default: undefined;
57
+ };
58
+ noPrefetch: {
59
+ readonly type: BooleanConstructor;
60
+ readonly default: undefined;
61
+ };
62
+ activeClass: {
63
+ readonly type: StringConstructor;
64
+ readonly default: undefined;
65
+ };
66
+ exactActiveClass: {
67
+ readonly type: StringConstructor;
68
+ readonly default: undefined;
69
+ };
70
+ prefetchedClass: {
71
+ readonly type: StringConstructor;
72
+ readonly default: undefined;
73
+ };
74
+ replace: {
75
+ readonly type: BooleanConstructor;
76
+ readonly default: undefined;
77
+ };
78
+ ariaCurrentValue: {
79
+ readonly type: StringConstructor;
80
+ readonly default: undefined;
81
+ };
82
+ external: {
83
+ readonly type: BooleanConstructor;
84
+ readonly default: undefined;
85
+ };
86
+ }, {
2
87
  resolveLinkClass: (route: any, $route: any, { isActive, isExactActive }: {
3
88
  isActive: boolean;
4
89
  isExactActive: boolean;
5
- }) => any;
6
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<any>, {} | {
7
- [x: string]: any;
90
+ }) => string | undefined;
91
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
92
+ as: {
93
+ type: StringConstructor;
94
+ default: string;
95
+ };
96
+ type: {
97
+ type: StringConstructor;
98
+ default: string;
99
+ };
100
+ disabled: {
101
+ type: BooleanConstructor;
102
+ default: null;
103
+ };
104
+ active: {
105
+ type: BooleanConstructor;
106
+ default: undefined;
107
+ };
108
+ exact: {
109
+ type: BooleanConstructor;
110
+ default: boolean;
111
+ };
112
+ exactQuery: {
113
+ type: BooleanConstructor;
114
+ default: boolean;
115
+ };
116
+ exactHash: {
117
+ type: BooleanConstructor;
118
+ default: boolean;
119
+ };
120
+ inactiveClass: {
121
+ type: StringConstructor;
122
+ default: undefined;
123
+ };
124
+ to: {
125
+ readonly type: import("vue").PropType<import("vue-router").RouteLocationRaw>;
126
+ readonly default: undefined;
127
+ };
128
+ href: {
129
+ readonly type: import("vue").PropType<import("vue-router").RouteLocationRaw>;
130
+ readonly default: undefined;
131
+ };
132
+ target: {
133
+ readonly type: import("vue").PropType<(string & {}) | "_blank" | "_parent" | "_self" | "_top" | null>;
134
+ readonly default: undefined;
135
+ };
136
+ rel: {
137
+ readonly type: StringConstructor;
138
+ readonly default: undefined;
139
+ };
140
+ noRel: {
141
+ readonly type: BooleanConstructor;
142
+ readonly default: undefined;
143
+ };
144
+ prefetch: {
145
+ readonly type: BooleanConstructor;
146
+ readonly default: undefined;
147
+ };
148
+ noPrefetch: {
149
+ readonly type: BooleanConstructor;
150
+ readonly default: undefined;
151
+ };
152
+ activeClass: {
153
+ readonly type: StringConstructor;
154
+ readonly default: undefined;
155
+ };
156
+ exactActiveClass: {
157
+ readonly type: StringConstructor;
158
+ readonly default: undefined;
159
+ };
160
+ prefetchedClass: {
161
+ readonly type: StringConstructor;
162
+ readonly default: undefined;
163
+ };
164
+ replace: {
165
+ readonly type: BooleanConstructor;
166
+ readonly default: undefined;
167
+ };
168
+ ariaCurrentValue: {
169
+ readonly type: StringConstructor;
170
+ readonly default: undefined;
171
+ };
172
+ external: {
173
+ readonly type: BooleanConstructor;
174
+ readonly default: undefined;
175
+ };
176
+ }>>, {
177
+ type: string;
178
+ replace: boolean;
179
+ as: string;
180
+ disabled: boolean;
181
+ to: import("vue-router").RouteLocationRaw;
182
+ href: import("vue-router").RouteLocationRaw;
183
+ target: (string & {}) | "_blank" | "_parent" | "_self" | "_top" | null;
184
+ rel: string;
185
+ noRel: boolean;
186
+ prefetch: boolean;
187
+ noPrefetch: boolean;
188
+ activeClass: string;
189
+ exactActiveClass: string;
190
+ prefetchedClass: string;
191
+ ariaCurrentValue: string;
192
+ external: boolean;
193
+ active: boolean;
194
+ exact: boolean;
195
+ exactQuery: boolean;
196
+ exactHash: boolean;
197
+ inactiveClass: string;
8
198
  }, {}>;
9
199
  export default _default;
@@ -5,7 +5,7 @@
5
5
  </template>
6
6
 
7
7
  <script>
8
- import { provide, ref, defineComponent } from "vue";
8
+ import { provide, ref, defineComponent, onUnmounted, onMounted } from "vue";
9
9
  import { useEventBus } from "@vueuse/core";
10
10
  import { uid } from "../../utils/uid";
11
11
  class FormException extends Error {
@@ -37,10 +37,15 @@ export default defineComponent({
37
37
  emits: ["submit", "error"],
38
38
  setup(props, { expose, emit }) {
39
39
  const bus = useEventBus(`form-${uid()}`);
40
- bus.on(async (event) => {
41
- if (event.type !== "submit" && props.validateOn?.includes(event.type)) {
42
- await validate(event.path, { silent: true });
43
- }
40
+ onMounted(() => {
41
+ bus.on(async (event) => {
42
+ if (event.type !== "submit" && props.validateOn?.includes(event.type)) {
43
+ await validate(event.path, { silent: true });
44
+ }
45
+ });
46
+ });
47
+ onUnmounted(() => {
48
+ bus.reset();
44
49
  });
45
50
  const errors = ref([]);
46
51
  provide("form-errors", errors);
@@ -83,7 +88,8 @@ export default defineComponent({
83
88
  }
84
89
  return props.state;
85
90
  }
86
- async function onSubmit(event) {
91
+ async function onSubmit(payload) {
92
+ const event = payload;
87
93
  try {
88
94
  if (props.validateOn?.includes("submit")) {
89
95
  await validate();
@@ -120,6 +126,9 @@ export default defineComponent({
120
126
  errors.value = errs;
121
127
  }
122
128
  },
129
+ async submit() {
130
+ await onSubmit(new Event("submit"));
131
+ },
123
132
  getErrors(path) {
124
133
  if (path) {
125
134
  return errors.value.filter((err) => err.path === path);
@@ -128,7 +137,7 @@ export default defineComponent({
128
137
  },
129
138
  clear(path) {
130
139
  if (path) {
131
- errors.value = errors.value.filter((err) => err.path === path);
140
+ errors.value = errors.value.filter((err) => err.path !== path);
132
141
  } else {
133
142
  errors.value = [];
134
143
  }
@@ -22,7 +22,7 @@ declare const _default: import("vue").DefineComponent<{
22
22
  default: () => string[];
23
23
  };
24
24
  }, {
25
- onSubmit: (event: SubmitEvent) => Promise<void>;
25
+ onSubmit: (payload: Event) => Promise<void>;
26
26
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("error" | "submit")[], "error" | "submit", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
27
27
  schema: {
28
28
  type: PropType<ZodSchema<any, import("zod").ZodTypeDef, any>> | PropType<YupObjectSchema<any, import("yup").AnyObject, any, "">> | PropType<JoiSchema> | PropType<ValibotObjectSchema<any>>;
@@ -8,7 +8,7 @@
8
8
  :type="type"
9
9
  :required="required"
10
10
  :placeholder="placeholder"
11
- :disabled="disabled || loading"
11
+ :disabled="disabled"
12
12
  :class="inputClass"
13
13
  v-bind="attrs"
14
14
  @input="onInput"
@@ -239,6 +239,7 @@ declare const _default: import("vue").DefineComponent<{
239
239
  color: any;
240
240
  type: string;
241
241
  name: string;
242
+ leading: boolean;
242
243
  class: any;
243
244
  modelValue: string | number;
244
245
  loading: boolean;
@@ -251,7 +252,6 @@ declare const _default: import("vue").DefineComponent<{
251
252
  leadingIcon: string;
252
253
  trailingIcon: string;
253
254
  trailing: boolean;
254
- leading: boolean;
255
255
  autofocus: boolean;
256
256
  inputClass: string;
257
257
  autofocusDelay: number;