@nuxt/ui 2.11.0 → 2.12.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.
- package/dist/module.d.mts +294 -48
- package/dist/module.d.ts +294 -48
- package/dist/module.json +1 -1
- package/dist/module.mjs +6 -4
- package/dist/runtime/components/data/Table.vue +29 -21
- package/dist/runtime/components/data/Table.vue.d.ts +28 -19
- package/dist/runtime/components/elements/Accordion.vue +10 -6
- package/dist/runtime/components/elements/Accordion.vue.d.ts +11 -11
- package/dist/runtime/components/elements/Alert.vue +12 -6
- package/dist/runtime/components/elements/Alert.vue.d.ts +12 -17
- package/dist/runtime/components/elements/Avatar.vue +2 -2
- package/dist/runtime/components/elements/Avatar.vue.d.ts +7 -7
- package/dist/runtime/components/elements/AvatarGroup.d.ts +7 -7
- package/dist/runtime/components/elements/AvatarGroup.mjs +2 -2
- package/dist/runtime/components/elements/Badge.vue +2 -2
- package/dist/runtime/components/elements/Badge.vue.d.ts +7 -7
- package/dist/runtime/components/elements/Button.vue +8 -6
- package/dist/runtime/components/elements/Button.vue.d.ts +9 -8
- package/dist/runtime/components/elements/ButtonGroup.d.ts +7 -7
- package/dist/runtime/components/elements/ButtonGroup.mjs +3 -16
- package/dist/runtime/components/elements/Chip.vue +2 -2
- package/dist/runtime/components/elements/Chip.vue.d.ts +9 -9
- package/dist/runtime/components/elements/Dropdown.vue +68 -19
- package/dist/runtime/components/elements/Dropdown.vue.d.ts +37 -9
- package/dist/runtime/components/elements/Kbd.vue +2 -2
- package/dist/runtime/components/elements/Kbd.vue.d.ts +7 -7
- package/dist/runtime/components/elements/Link.vue +2 -2
- package/dist/runtime/components/elements/Meter.vue +2 -2
- package/dist/runtime/components/elements/Meter.vue.d.ts +7 -7
- package/dist/runtime/components/elements/MeterGroup.d.ts +9 -9
- package/dist/runtime/components/elements/MeterGroup.mjs +8 -21
- package/dist/runtime/components/elements/Progress.vue +5 -94
- package/dist/runtime/components/elements/Progress.vue.d.ts +123 -1
- package/dist/runtime/components/forms/Checkbox.vue +7 -7
- package/dist/runtime/components/forms/Checkbox.vue.d.ts +8 -8
- package/dist/runtime/components/forms/Form.vue +17 -8
- package/dist/runtime/components/forms/Form.vue.d.ts +1 -1
- package/dist/runtime/components/forms/FormGroup.vue +2 -2
- package/dist/runtime/components/forms/FormGroup.vue.d.ts +7 -7
- package/dist/runtime/components/forms/Input.vue +8 -8
- package/dist/runtime/components/forms/Input.vue.d.ts +11 -11
- package/dist/runtime/components/forms/InputMenu.vue +410 -0
- package/dist/runtime/components/forms/InputMenu.vue.d.ts +331 -0
- package/dist/runtime/components/forms/Radio.vue +7 -7
- package/dist/runtime/components/forms/Radio.vue.d.ts +7 -7
- package/dist/runtime/components/forms/RadioGroup.vue +5 -5
- package/dist/runtime/components/forms/RadioGroup.vue.d.ts +13 -13
- package/dist/runtime/components/forms/Range.vue +5 -5
- package/dist/runtime/components/forms/Range.vue.d.ts +8 -8
- package/dist/runtime/components/forms/Select.vue +8 -8
- package/dist/runtime/components/forms/Select.vue.d.ts +10 -10
- package/dist/runtime/components/forms/SelectMenu.vue +69 -36
- package/dist/runtime/components/forms/SelectMenu.vue.d.ts +40 -20
- package/dist/runtime/components/forms/Textarea.vue +3 -3
- package/dist/runtime/components/forms/Textarea.vue.d.ts +10 -10
- package/dist/runtime/components/forms/Toggle.vue +10 -10
- package/dist/runtime/components/forms/Toggle.vue.d.ts +16 -15
- package/dist/runtime/components/layout/Card.vue +2 -2
- package/dist/runtime/components/layout/Card.vue.d.ts +7 -7
- package/dist/runtime/components/layout/Container.vue +2 -2
- package/dist/runtime/components/layout/Container.vue.d.ts +7 -7
- package/dist/runtime/components/layout/Divider.vue +3 -8
- package/dist/runtime/components/layout/Divider.vue.d.ts +7 -7
- package/dist/runtime/components/layout/Skeleton.vue +2 -2
- package/dist/runtime/components/layout/Skeleton.vue.d.ts +7 -7
- package/dist/runtime/components/navigation/Breadcrumb.vue +9 -6
- package/dist/runtime/components/navigation/Breadcrumb.vue.d.ts +10 -7
- package/dist/runtime/components/navigation/CommandPalette.vue +42 -33
- package/dist/runtime/components/navigation/CommandPalette.vue.d.ts +16 -9
- package/dist/runtime/components/navigation/CommandPaletteGroup.vue +1 -3
- package/dist/runtime/components/navigation/Pagination.vue +16 -11
- package/dist/runtime/components/navigation/Pagination.vue.d.ts +16 -7
- package/dist/runtime/components/navigation/Tabs.vue +8 -5
- package/dist/runtime/components/navigation/Tabs.vue.d.ts +9 -9
- package/dist/runtime/components/navigation/VerticalNavigation.vue +56 -39
- package/dist/runtime/components/navigation/VerticalNavigation.vue.d.ts +14 -10
- package/dist/runtime/components/overlays/ContextMenu.vue +4 -3
- package/dist/runtime/components/overlays/ContextMenu.vue.d.ts +7 -7
- package/dist/runtime/components/overlays/Modal.vue +3 -6
- package/dist/runtime/components/overlays/Modal.vue.d.ts +8 -8
- package/dist/runtime/components/overlays/Notification.vue +7 -7
- package/dist/runtime/components/overlays/Notification.vue.d.ts +7 -7
- package/dist/runtime/components/overlays/Notifications.vue +2 -2
- package/dist/runtime/components/overlays/Notifications.vue.d.ts +7 -7
- package/dist/runtime/components/overlays/Popover.vue +54 -17
- package/dist/runtime/components/overlays/Popover.vue.d.ts +21 -11
- package/dist/runtime/components/overlays/Slideover.vue +6 -6
- package/dist/runtime/components/overlays/Slideover.vue.d.ts +8 -8
- package/dist/runtime/components/overlays/Tooltip.vue +6 -5
- package/dist/runtime/components/overlays/Tooltip.vue.d.ts +7 -7
- package/dist/runtime/composables/useFormGroup.d.ts +3 -3
- package/dist/runtime/composables/useFormGroup.mjs +1 -1
- package/dist/runtime/composables/useShortcuts.mjs +3 -1
- package/dist/runtime/composables/useUI.d.ts +3 -3
- package/dist/runtime/types/alert.d.ts +5 -0
- package/dist/runtime/types/breadcrumb.d.ts +3 -0
- package/dist/runtime/types/dropdown.d.ts +2 -0
- package/dist/runtime/types/form.d.ts +2 -1
- package/dist/runtime/types/popper.d.ts +2 -0
- package/dist/runtime/types/utils.d.ts +4 -4
- package/dist/runtime/types/vertical-navigation.d.ts +1 -0
- package/dist/runtime/ui.config/data/table.d.ts +2 -2
- package/dist/runtime/ui.config/elements/accordion.d.ts +1 -1
- package/dist/runtime/ui.config/elements/alert.d.ts +5 -4
- package/dist/runtime/ui.config/elements/alert.mjs +1 -0
- package/dist/runtime/ui.config/elements/button.d.ts +4 -0
- package/dist/runtime/ui.config/elements/button.mjs +4 -0
- package/dist/runtime/ui.config/elements/buttonGroup.d.ts +92 -0
- package/dist/runtime/ui.config/elements/buttonGroup.mjs +12 -1
- package/dist/runtime/ui.config/elements/dropdown.d.ts +3 -1
- package/dist/runtime/ui.config/elements/dropdown.mjs +4 -2
- package/dist/runtime/ui.config/elements/meterGroup.d.ts +40 -0
- package/dist/runtime/ui.config/elements/meterGroup.mjs +14 -1
- package/dist/runtime/ui.config/forms/checkbox.d.ts +3 -0
- package/dist/runtime/ui.config/forms/checkbox.mjs +3 -0
- package/dist/runtime/ui.config/forms/input.d.ts +2 -0
- package/dist/runtime/ui.config/forms/input.mjs +14 -12
- package/dist/runtime/ui.config/forms/inputMenu.d.ts +64 -0
- package/dist/runtime/ui.config/forms/inputMenu.mjs +62 -0
- package/dist/runtime/ui.config/forms/radio.d.ts +3 -0
- package/dist/runtime/ui.config/forms/radio.mjs +3 -0
- package/dist/runtime/ui.config/forms/select.d.ts +2 -0
- package/dist/runtime/ui.config/forms/select.mjs +1 -0
- package/dist/runtime/ui.config/forms/selectMenu.d.ts +18 -11
- package/dist/runtime/ui.config/forms/selectMenu.mjs +12 -41
- package/dist/runtime/ui.config/forms/textarea.d.ts +2 -0
- package/dist/runtime/ui.config/forms/textarea.mjs +1 -0
- package/dist/runtime/ui.config/index.d.ts +1 -0
- package/dist/runtime/ui.config/index.mjs +1 -0
- package/dist/runtime/ui.config/layout/card.mjs +1 -1
- package/dist/runtime/ui.config/layout/divider.d.ts +6 -1
- package/dist/runtime/ui.config/layout/divider.mjs +5 -0
- package/dist/runtime/ui.config/navigation/breadcrumb.d.ts +1 -0
- package/dist/runtime/ui.config/navigation/breadcrumb.mjs +2 -1
- package/dist/runtime/ui.config/navigation/commandPalette.d.ts +5 -1
- package/dist/runtime/ui.config/navigation/commandPalette.mjs +5 -1
- package/dist/runtime/ui.config/navigation/pagination.d.ts +6 -6
- package/dist/runtime/ui.config/navigation/verticalNavigation.d.ts +6 -1
- package/dist/runtime/ui.config/navigation/verticalNavigation.mjs +5 -0
- package/dist/runtime/ui.config/overlays/contextMenu.mjs +1 -1
- package/dist/runtime/ui.config/overlays/modal.d.ts +1 -0
- package/dist/runtime/ui.config/overlays/modal.mjs +3 -2
- package/dist/runtime/ui.config/overlays/notification.d.ts +5 -4
- package/dist/runtime/ui.config/overlays/notification.mjs +1 -0
- package/dist/runtime/ui.config/overlays/popover.d.ts +1 -0
- package/dist/runtime/ui.config/overlays/popover.mjs +2 -1
- package/dist/runtime/ui.config/overlays/slideover.d.ts +5 -0
- package/dist/runtime/ui.config/overlays/slideover.mjs +5 -0
- package/dist/runtime/ui.config/overlays/tooltip.d.ts +1 -0
- package/dist/runtime/ui.config/overlays/tooltip.mjs +2 -1
- package/dist/runtime/ui.config/{_popperArrow.d.ts → popper.d.ts} +1 -2
- package/dist/runtime/ui.config/popper.mjs +9 -0
- package/dist/runtime/ui.css +1 -13
- package/dist/runtime/utils/index.mjs +11 -3
- package/dist/runtime/utils/uid.mjs +2 -1
- package/dist/types.d.mts +2 -2
- package/dist/types.d.ts +1 -1
- package/package.json +29 -28
- package/dist/runtime/ui.config/_popperArrow.mjs +0 -8
|
@@ -19,15 +19,15 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
19
19
|
};
|
|
20
20
|
icon: {
|
|
21
21
|
type: StringConstructor;
|
|
22
|
-
default:
|
|
22
|
+
default: () => any;
|
|
23
23
|
};
|
|
24
24
|
class: {
|
|
25
25
|
type: PropType<any>;
|
|
26
|
-
default:
|
|
26
|
+
default: () => "";
|
|
27
27
|
};
|
|
28
28
|
ui: {
|
|
29
|
-
type: PropType<
|
|
30
|
-
default:
|
|
29
|
+
type: PropType<any>;
|
|
30
|
+
default: () => {};
|
|
31
31
|
};
|
|
32
32
|
}, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
33
33
|
[key: string]: any;
|
|
@@ -51,19 +51,19 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
51
51
|
};
|
|
52
52
|
icon: {
|
|
53
53
|
type: StringConstructor;
|
|
54
|
-
default:
|
|
54
|
+
default: () => any;
|
|
55
55
|
};
|
|
56
56
|
class: {
|
|
57
57
|
type: PropType<any>;
|
|
58
|
-
default:
|
|
58
|
+
default: () => "";
|
|
59
59
|
};
|
|
60
60
|
ui: {
|
|
61
|
-
type: PropType<
|
|
62
|
-
default:
|
|
61
|
+
type: PropType<any>;
|
|
62
|
+
default: () => {};
|
|
63
63
|
};
|
|
64
64
|
}>>, {
|
|
65
65
|
size: "sm" | "md" | "xs" | "2xs" | "lg" | "xl" | "2xl";
|
|
66
|
-
ui:
|
|
66
|
+
ui: any;
|
|
67
67
|
icon: string;
|
|
68
68
|
class: any;
|
|
69
69
|
max: number;
|
|
@@ -35,15 +35,15 @@ export default defineComponent({
|
|
|
35
35
|
},
|
|
36
36
|
icon: {
|
|
37
37
|
type: String,
|
|
38
|
-
default:
|
|
38
|
+
default: () => meterGroupConfig.default.icon
|
|
39
39
|
},
|
|
40
40
|
class: {
|
|
41
41
|
type: [String, Object, Array],
|
|
42
|
-
default:
|
|
42
|
+
default: () => ""
|
|
43
43
|
},
|
|
44
44
|
ui: {
|
|
45
45
|
type: Object,
|
|
46
|
-
default:
|
|
46
|
+
default: () => ({})
|
|
47
47
|
}
|
|
48
48
|
},
|
|
49
49
|
setup(props, { slots }) {
|
|
@@ -55,20 +55,7 @@ export default defineComponent({
|
|
|
55
55
|
const normalizedMin = computed(() => props.min > props.max ? props.max : props.min);
|
|
56
56
|
const normalizedMax = computed(() => props.max < props.min ? props.min : props.max);
|
|
57
57
|
const children = computed(() => getSlotsChildren(slots));
|
|
58
|
-
const rounded = computed(() =>
|
|
59
|
-
const roundedMap = {
|
|
60
|
-
"rounded-none": { left: "rounded-s-none", right: "rounded-e-none" },
|
|
61
|
-
"rounded-sm": { left: "rounded-s-sm", right: "rounded-e-sm" },
|
|
62
|
-
rounded: { left: "rounded-s", right: "rounded-e" },
|
|
63
|
-
"rounded-md": { left: "rounded-s-md", right: "rounded-e-md" },
|
|
64
|
-
"rounded-lg": { left: "rounded-s-lg", right: "rounded-e-lg" },
|
|
65
|
-
"rounded-xl": { left: "rounded-s-xl", right: "rounded-e-xl" },
|
|
66
|
-
"rounded-2xl": { left: "rounded-s-2xl", right: "rounded-e-2xl" },
|
|
67
|
-
"rounded-3xl": { left: "rounded-s-3xl", right: "rounded-e-3xl" },
|
|
68
|
-
"rounded-full": { left: "rounded-s-full", right: "rounded-e-full" }
|
|
69
|
-
};
|
|
70
|
-
return roundedMap[ui.value.rounded];
|
|
71
|
-
});
|
|
58
|
+
const rounded = computed(() => ui.value.orientation[ui.value.rounded]);
|
|
72
59
|
function clampPercent(value, min, max) {
|
|
73
60
|
if (min == max) {
|
|
74
61
|
return value < min ? 0 : 100;
|
|
@@ -98,7 +85,7 @@ export default defineComponent({
|
|
|
98
85
|
vProps.ui.wrapper = node.props?.ui?.wrapper || "";
|
|
99
86
|
vProps.ui.wrapper += [
|
|
100
87
|
node.props?.ui?.wrapper,
|
|
101
|
-
|
|
88
|
+
ui.value.background,
|
|
102
89
|
ui.value.transition
|
|
103
90
|
].filter(Boolean).join(" ");
|
|
104
91
|
vProps.ui.meter = node.props?.ui?.meter || {};
|
|
@@ -114,8 +101,8 @@ export default defineComponent({
|
|
|
114
101
|
labels.value[index] = node.props.label;
|
|
115
102
|
const clone = cloneVNode(node, vProps);
|
|
116
103
|
delete clone.children?.label;
|
|
117
|
-
delete clone.props
|
|
118
|
-
delete clone.props
|
|
104
|
+
delete clone.props?.indicator;
|
|
105
|
+
delete clone.props?.label;
|
|
119
106
|
return clone;
|
|
120
107
|
}));
|
|
121
108
|
const baseClass = computed(() => {
|
|
@@ -151,7 +138,7 @@ export default defineComponent({
|
|
|
151
138
|
} else if (slots.indicator) {
|
|
152
139
|
vNodeSlots[0] = slots.indicator({ percent: percent.value });
|
|
153
140
|
}
|
|
154
|
-
vNodeSlots[2] = h("ol", { class:
|
|
141
|
+
vNodeSlots[2] = h("ol", { class: ui.value.list }, labels.value.map((label, key) => {
|
|
155
142
|
const labelClass = computed(() => {
|
|
156
143
|
return twJoin(
|
|
157
144
|
uiMeter.value.label.base,
|
|
@@ -34,7 +34,7 @@ export default defineComponent({
|
|
|
34
34
|
inheritAttrs: false,
|
|
35
35
|
props: {
|
|
36
36
|
value: {
|
|
37
|
-
type:
|
|
37
|
+
type: Number,
|
|
38
38
|
default: null
|
|
39
39
|
},
|
|
40
40
|
max: {
|
|
@@ -68,11 +68,11 @@ export default defineComponent({
|
|
|
68
68
|
},
|
|
69
69
|
class: {
|
|
70
70
|
type: [String, Object, Array],
|
|
71
|
-
default:
|
|
71
|
+
default: () => ""
|
|
72
72
|
},
|
|
73
73
|
ui: {
|
|
74
74
|
type: Object,
|
|
75
|
-
default:
|
|
75
|
+
default: () => ({})
|
|
76
76
|
}
|
|
77
77
|
},
|
|
78
78
|
setup(props) {
|
|
@@ -151,7 +151,7 @@ export default defineComponent({
|
|
|
151
151
|
}
|
|
152
152
|
return classes.join(" ");
|
|
153
153
|
}
|
|
154
|
-
const isIndeterminate = computed(() =>
|
|
154
|
+
const isIndeterminate = computed(() => props.value === void 0 || props.value === null);
|
|
155
155
|
const isSteps = computed(() => Array.isArray(props.max));
|
|
156
156
|
const realMax = computed(() => {
|
|
157
157
|
if (isIndeterminate.value) {
|
|
@@ -191,94 +191,5 @@ export default defineComponent({
|
|
|
191
191
|
</script>
|
|
192
192
|
|
|
193
193
|
<style scoped>
|
|
194
|
-
|
|
195
|
-
progress:indeterminate {
|
|
196
|
-
@apply relative;
|
|
197
|
-
|
|
198
|
-
&:after {
|
|
199
|
-
@apply content-[''];
|
|
200
|
-
@apply absolute inset-0;
|
|
201
|
-
@apply bg-current;
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
&::-webkit-progress-value {
|
|
205
|
-
@apply bg-current;
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
&::-moz-progress-bar {
|
|
209
|
-
@apply bg-current;
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
&.bar-animation-carousel {
|
|
213
|
-
&:after {
|
|
214
|
-
animation: carousel 2s ease-in-out infinite;
|
|
215
|
-
}
|
|
216
|
-
&::-webkit-progress-value {
|
|
217
|
-
animation: carousel 2s ease-in-out infinite;
|
|
218
|
-
}
|
|
219
|
-
&::-moz-progress-bar {
|
|
220
|
-
animation: carousel 2s ease-in-out infinite;
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
&.bar-animation-carousel-inverse {
|
|
225
|
-
&:after {
|
|
226
|
-
animation: carousel-inverse 2s ease-in-out infinite;
|
|
227
|
-
}
|
|
228
|
-
&::-webkit-progress-value {
|
|
229
|
-
animation: carousel-inverse 2s ease-in-out infinite;
|
|
230
|
-
}
|
|
231
|
-
&::-moz-progress-bar {
|
|
232
|
-
animation: carousel-inverse 2s ease-in-out infinite;
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
&.bar-animation-swing {
|
|
237
|
-
&:after {
|
|
238
|
-
animation: swing 3s ease-in-out infinite;
|
|
239
|
-
}
|
|
240
|
-
&::-webkit-progress-value {
|
|
241
|
-
animation: swing 3s ease-in-out infinite;
|
|
242
|
-
}
|
|
243
|
-
&::-moz-progress-bar {
|
|
244
|
-
animation: swing 3s ease-in-out infinite;
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
&.bar-animation-elastic {
|
|
249
|
-
&::after {
|
|
250
|
-
animation: elastic 3s ease-in-out infinite;
|
|
251
|
-
}
|
|
252
|
-
&::-webkit-progress-value {
|
|
253
|
-
animation: elastic 3s ease-in-out infinite;
|
|
254
|
-
}
|
|
255
|
-
&::-moz-progress-bar {
|
|
256
|
-
animation: elastic 3s ease-in-out infinite;
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
@keyframes carousel {
|
|
262
|
-
0%, 100% { width: 50% }
|
|
263
|
-
0% { transform: translateX(-100%) }
|
|
264
|
-
100% { transform: translateX(200%) }
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
@keyframes carousel-inverse {
|
|
268
|
-
0%, 100% { width: 50% }
|
|
269
|
-
0% { transform: translateX(200%) }
|
|
270
|
-
100% { transform: translateX(-100%) }
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
@keyframes swing {
|
|
274
|
-
0%, 100% { width: 50% }
|
|
275
|
-
0%, 100% { transform: translateX(-25%) }
|
|
276
|
-
50% { transform: translateX(125%) }
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
@keyframes elastic {
|
|
280
|
-
/* Firefox doesn't do "margin: 0 auto", we have to play with margin-left */
|
|
281
|
-
0%, 100% { width: 50%; margin-left: 25%; }
|
|
282
|
-
50% { width: 90%; margin-left: 5% }
|
|
283
|
-
}
|
|
194
|
+
progress:indeterminate{@apply relative}progress:indeterminate:after{@apply content-[""];@apply absolute inset-0;@apply bg-current}progress:indeterminate::-webkit-progress-value{@apply bg-current}progress:indeterminate::-moz-progress-bar{@apply bg-current}progress:indeterminate.bar-animation-carousel:after{animation:carousel 2s ease-in-out infinite}progress:indeterminate.bar-animation-carousel::-webkit-progress-value{animation:carousel 2s ease-in-out infinite}progress:indeterminate.bar-animation-carousel::-moz-progress-bar{animation:carousel 2s ease-in-out infinite}progress:indeterminate.bar-animation-carousel-inverse:after{animation:carousel-inverse 2s ease-in-out infinite}progress:indeterminate.bar-animation-carousel-inverse::-webkit-progress-value{animation:carousel-inverse 2s ease-in-out infinite}progress:indeterminate.bar-animation-carousel-inverse::-moz-progress-bar{animation:carousel-inverse 2s ease-in-out infinite}progress:indeterminate.bar-animation-swing:after{animation:swing 3s ease-in-out infinite}progress:indeterminate.bar-animation-swing::-webkit-progress-value{animation:swing 3s ease-in-out infinite}progress:indeterminate.bar-animation-swing::-moz-progress-bar{animation:swing 3s ease-in-out infinite}progress:indeterminate.bar-animation-elastic:after{animation:elastic 3s ease-in-out infinite}progress:indeterminate.bar-animation-elastic::-webkit-progress-value{animation:elastic 3s ease-in-out infinite}progress:indeterminate.bar-animation-elastic::-moz-progress-bar{animation:elastic 3s ease-in-out infinite}@keyframes carousel{0%,to{width:50%}0%{transform:translateX(-100%)}to{transform:translateX(200%)}}@keyframes carousel-inverse{0%,to{width:50%}0%{transform:translateX(200%)}to{transform:translateX(-100%)}}@keyframes swing{0%,to{width:50%}0%,to{transform:translateX(-25%)}50%{transform:translateX(125%)}}@keyframes elastic{0%,to{margin-left:25%;width:50%}50%{margin-left:5%;width:90%}}
|
|
284
195
|
</style>
|
|
@@ -1,2 +1,124 @@
|
|
|
1
|
-
|
|
1
|
+
import type { PropType } from 'vue';
|
|
2
|
+
declare const _default: import("vue").DefineComponent<{
|
|
3
|
+
value: {
|
|
4
|
+
type: NumberConstructor;
|
|
5
|
+
default: null;
|
|
6
|
+
};
|
|
7
|
+
max: {
|
|
8
|
+
type: (NumberConstructor | {
|
|
9
|
+
(arrayLength: number): any[];
|
|
10
|
+
(...items: any[]): any[];
|
|
11
|
+
new (arrayLength: number): any[];
|
|
12
|
+
new (...items: any[]): any[];
|
|
13
|
+
isArray(arg: any): arg is any[];
|
|
14
|
+
readonly prototype: any[];
|
|
15
|
+
from<T>(arrayLike: ArrayLike<T>): T[];
|
|
16
|
+
from<T_1, U>(arrayLike: ArrayLike<T_1>, mapfn: (v: T_1, k: number) => U, thisArg?: any): U[];
|
|
17
|
+
from<T_2>(iterable: Iterable<T_2> | ArrayLike<T_2>): T_2[];
|
|
18
|
+
from<T_3, U_1>(iterable: Iterable<T_3> | ArrayLike<T_3>, mapfn: (v: T_3, k: number) => U_1, thisArg?: any): U_1[];
|
|
19
|
+
of<T_4>(...items: T_4[]): T_4[];
|
|
20
|
+
readonly [Symbol.species]: ArrayConstructor;
|
|
21
|
+
})[];
|
|
22
|
+
default: number;
|
|
23
|
+
};
|
|
24
|
+
indicator: {
|
|
25
|
+
type: BooleanConstructor;
|
|
26
|
+
default: boolean;
|
|
27
|
+
};
|
|
28
|
+
animation: {
|
|
29
|
+
type: PropType<"carousel" | "carousel-inverse" | "swing" | "elastic">;
|
|
30
|
+
default: () => any;
|
|
31
|
+
validator(value: string): boolean;
|
|
32
|
+
};
|
|
33
|
+
size: {
|
|
34
|
+
type: PropType<"sm" | "md" | "xs" | "2xs" | "lg" | "xl" | "2xl">;
|
|
35
|
+
default: () => any;
|
|
36
|
+
validator(value: string): boolean;
|
|
37
|
+
};
|
|
38
|
+
color: {
|
|
39
|
+
type: StringConstructor;
|
|
40
|
+
default: () => any;
|
|
41
|
+
validator(value: string): any;
|
|
42
|
+
};
|
|
43
|
+
class: {
|
|
44
|
+
type: PropType<any>;
|
|
45
|
+
default: () => "";
|
|
46
|
+
};
|
|
47
|
+
ui: {
|
|
48
|
+
type: PropType<any>;
|
|
49
|
+
default: () => {};
|
|
50
|
+
};
|
|
51
|
+
}, {
|
|
52
|
+
ui: import("vue").ComputedRef<any>;
|
|
53
|
+
attrs: import("vue").ComputedRef<Pick<{
|
|
54
|
+
[x: string]: unknown;
|
|
55
|
+
}, string>>;
|
|
56
|
+
indicatorContainerClass: import("vue").ComputedRef<string>;
|
|
57
|
+
indicatorClass: import("vue").ComputedRef<string>;
|
|
58
|
+
progressClass: import("vue").ComputedRef<string>;
|
|
59
|
+
stepsClass: import("vue").ComputedRef<string>;
|
|
60
|
+
stepClasses: (index: string | number) => string;
|
|
61
|
+
isIndeterminate: import("vue").ComputedRef<boolean>;
|
|
62
|
+
isSteps: import("vue").ComputedRef<boolean>;
|
|
63
|
+
realMax: import("vue").ComputedRef<number | null>;
|
|
64
|
+
percent: import("vue").ComputedRef<number>;
|
|
65
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
66
|
+
value: {
|
|
67
|
+
type: NumberConstructor;
|
|
68
|
+
default: null;
|
|
69
|
+
};
|
|
70
|
+
max: {
|
|
71
|
+
type: (NumberConstructor | {
|
|
72
|
+
(arrayLength: number): any[];
|
|
73
|
+
(...items: any[]): any[];
|
|
74
|
+
new (arrayLength: number): any[];
|
|
75
|
+
new (...items: any[]): any[];
|
|
76
|
+
isArray(arg: any): arg is any[];
|
|
77
|
+
readonly prototype: any[];
|
|
78
|
+
from<T>(arrayLike: ArrayLike<T>): T[];
|
|
79
|
+
from<T_1, U>(arrayLike: ArrayLike<T_1>, mapfn: (v: T_1, k: number) => U, thisArg?: any): U[];
|
|
80
|
+
from<T_2>(iterable: Iterable<T_2> | ArrayLike<T_2>): T_2[];
|
|
81
|
+
from<T_3, U_1>(iterable: Iterable<T_3> | ArrayLike<T_3>, mapfn: (v: T_3, k: number) => U_1, thisArg?: any): U_1[];
|
|
82
|
+
of<T_4>(...items: T_4[]): T_4[];
|
|
83
|
+
readonly [Symbol.species]: ArrayConstructor;
|
|
84
|
+
})[];
|
|
85
|
+
default: number;
|
|
86
|
+
};
|
|
87
|
+
indicator: {
|
|
88
|
+
type: BooleanConstructor;
|
|
89
|
+
default: boolean;
|
|
90
|
+
};
|
|
91
|
+
animation: {
|
|
92
|
+
type: PropType<"carousel" | "carousel-inverse" | "swing" | "elastic">;
|
|
93
|
+
default: () => any;
|
|
94
|
+
validator(value: string): boolean;
|
|
95
|
+
};
|
|
96
|
+
size: {
|
|
97
|
+
type: PropType<"sm" | "md" | "xs" | "2xs" | "lg" | "xl" | "2xl">;
|
|
98
|
+
default: () => any;
|
|
99
|
+
validator(value: string): boolean;
|
|
100
|
+
};
|
|
101
|
+
color: {
|
|
102
|
+
type: StringConstructor;
|
|
103
|
+
default: () => any;
|
|
104
|
+
validator(value: string): any;
|
|
105
|
+
};
|
|
106
|
+
class: {
|
|
107
|
+
type: PropType<any>;
|
|
108
|
+
default: () => "";
|
|
109
|
+
};
|
|
110
|
+
ui: {
|
|
111
|
+
type: PropType<any>;
|
|
112
|
+
default: () => {};
|
|
113
|
+
};
|
|
114
|
+
}>>, {
|
|
115
|
+
size: "sm" | "md" | "xs" | "2xs" | "lg" | "xl" | "2xl";
|
|
116
|
+
ui: any;
|
|
117
|
+
value: number;
|
|
118
|
+
color: string;
|
|
119
|
+
class: any;
|
|
120
|
+
max: number | any[];
|
|
121
|
+
indicator: boolean;
|
|
122
|
+
animation: "carousel" | "carousel-inverse" | "swing" | "elastic";
|
|
123
|
+
}, {}>;
|
|
2
124
|
export default _default;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div :class="ui.wrapper">
|
|
3
|
-
<div class="
|
|
3
|
+
<div :class="ui.container">
|
|
4
4
|
<input
|
|
5
5
|
:id="inputId"
|
|
6
6
|
v-model="toggle"
|
|
@@ -11,13 +11,12 @@
|
|
|
11
11
|
:checked="checked"
|
|
12
12
|
:indeterminate="indeterminate"
|
|
13
13
|
type="checkbox"
|
|
14
|
-
class="form-checkbox"
|
|
15
14
|
:class="inputClass"
|
|
16
15
|
v-bind="attrs"
|
|
17
16
|
@change="onChange"
|
|
18
17
|
>
|
|
19
18
|
</div>
|
|
20
|
-
<div v-if="label || $slots.label" class="
|
|
19
|
+
<div v-if="label || $slots.label" :class="ui.inner">
|
|
21
20
|
<label :for="inputId" :class="ui.label">
|
|
22
21
|
<slot name="label">{{ label }}</slot>
|
|
23
22
|
<span v-if="required" :class="ui.required">*</span>
|
|
@@ -94,11 +93,11 @@ export default defineComponent({
|
|
|
94
93
|
},
|
|
95
94
|
class: {
|
|
96
95
|
type: [String, Object, Array],
|
|
97
|
-
default:
|
|
96
|
+
default: () => ""
|
|
98
97
|
},
|
|
99
98
|
ui: {
|
|
100
99
|
type: Object,
|
|
101
|
-
default:
|
|
100
|
+
default: () => ({})
|
|
102
101
|
}
|
|
103
102
|
},
|
|
104
103
|
emits: ["update:modelValue", "change"],
|
|
@@ -120,11 +119,12 @@ export default defineComponent({
|
|
|
120
119
|
const inputClass = computed(() => {
|
|
121
120
|
return twMerge(twJoin(
|
|
122
121
|
ui.value.base,
|
|
122
|
+
ui.value.form,
|
|
123
123
|
ui.value.rounded,
|
|
124
124
|
ui.value.background,
|
|
125
125
|
ui.value.border,
|
|
126
|
-
ui.value.ring.replaceAll("{color}", color.value),
|
|
127
|
-
ui.value.color.replaceAll("{color}", color.value)
|
|
126
|
+
color.value && ui.value.ring.replaceAll("{color}", color.value),
|
|
127
|
+
color.value && ui.value.color.replaceAll("{color}", color.value)
|
|
128
128
|
), props.inputClass);
|
|
129
129
|
});
|
|
130
130
|
return {
|
|
@@ -51,11 +51,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
51
51
|
};
|
|
52
52
|
class: {
|
|
53
53
|
type: PropType<any>;
|
|
54
|
-
default:
|
|
54
|
+
default: () => "";
|
|
55
55
|
};
|
|
56
56
|
ui: {
|
|
57
|
-
type: PropType<
|
|
58
|
-
default:
|
|
57
|
+
type: PropType<any>;
|
|
58
|
+
default: () => {};
|
|
59
59
|
};
|
|
60
60
|
}, {
|
|
61
61
|
ui: import("vue").ComputedRef<any>;
|
|
@@ -63,7 +63,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
63
63
|
[x: string]: unknown;
|
|
64
64
|
}, string>>;
|
|
65
65
|
toggle: import("vue").WritableComputedRef<boolean | unknown[]>;
|
|
66
|
-
inputId: import("vue").Ref<string |
|
|
66
|
+
inputId: import("vue").Ref<string | undefined>;
|
|
67
67
|
name: import("vue").ComputedRef<string | undefined>;
|
|
68
68
|
inputClass: import("vue").ComputedRef<string>;
|
|
69
69
|
onChange: (event: Event) => void;
|
|
@@ -119,17 +119,17 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
119
119
|
};
|
|
120
120
|
class: {
|
|
121
121
|
type: PropType<any>;
|
|
122
|
-
default:
|
|
122
|
+
default: () => "";
|
|
123
123
|
};
|
|
124
124
|
ui: {
|
|
125
|
-
type: PropType<
|
|
126
|
-
default:
|
|
125
|
+
type: PropType<any>;
|
|
126
|
+
default: () => {};
|
|
127
127
|
};
|
|
128
128
|
}>> & {
|
|
129
129
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
130
130
|
onChange?: ((...args: any[]) => any) | undefined;
|
|
131
131
|
}, {
|
|
132
|
-
ui:
|
|
132
|
+
ui: any;
|
|
133
133
|
value: string | number | boolean | Record<string, any>;
|
|
134
134
|
id: string;
|
|
135
135
|
color: any;
|
|
@@ -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
|
-
|
|
41
|
-
|
|
42
|
-
|
|
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(
|
|
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
|
|
140
|
+
errors.value = errors.value.filter((err) => err.path !== path);
|
|
132
141
|
} else {
|
|
133
142
|
errors.value = [];
|
|
134
143
|
}
|
|
@@ -201,7 +210,7 @@ async function getValibotError(state, schema) {
|
|
|
201
210
|
const result = await schema._parse(state);
|
|
202
211
|
if (result.issues) {
|
|
203
212
|
return result.issues.map((issue) => ({
|
|
204
|
-
path: issue.path
|
|
213
|
+
path: issue.path?.map((p) => p.key).join(".") || "",
|
|
205
214
|
message: issue.message
|
|
206
215
|
}));
|
|
207
216
|
}
|
|
@@ -22,7 +22,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
22
22
|
default: () => string[];
|
|
23
23
|
};
|
|
24
24
|
}, {
|
|
25
|
-
onSubmit: (
|
|
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>>;
|
|
@@ -36,11 +36,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
36
36
|
};
|
|
37
37
|
class: {
|
|
38
38
|
type: PropType<any>;
|
|
39
|
-
default:
|
|
39
|
+
default: () => "";
|
|
40
40
|
};
|
|
41
41
|
ui: {
|
|
42
|
-
type: PropType<
|
|
43
|
-
default:
|
|
42
|
+
type: PropType<any>;
|
|
43
|
+
default: () => {};
|
|
44
44
|
};
|
|
45
45
|
eagerValidation: {
|
|
46
46
|
type: BooleanConstructor;
|
|
@@ -90,11 +90,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
90
90
|
};
|
|
91
91
|
class: {
|
|
92
92
|
type: PropType<any>;
|
|
93
|
-
default:
|
|
93
|
+
default: () => "";
|
|
94
94
|
};
|
|
95
95
|
ui: {
|
|
96
|
-
type: PropType<
|
|
97
|
-
default:
|
|
96
|
+
type: PropType<any>;
|
|
97
|
+
default: () => {};
|
|
98
98
|
};
|
|
99
99
|
eagerValidation: {
|
|
100
100
|
type: BooleanConstructor;
|
|
@@ -103,7 +103,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
103
103
|
}>>, {
|
|
104
104
|
error: string | boolean;
|
|
105
105
|
size: FormGroupSize;
|
|
106
|
-
ui:
|
|
106
|
+
ui: any;
|
|
107
107
|
description: string;
|
|
108
108
|
name: string;
|
|
109
109
|
class: any;
|
|
@@ -8,8 +8,7 @@
|
|
|
8
8
|
:type="type"
|
|
9
9
|
:required="required"
|
|
10
10
|
:placeholder="placeholder"
|
|
11
|
-
:disabled="disabled
|
|
12
|
-
class="form-input"
|
|
11
|
+
:disabled="disabled"
|
|
13
12
|
:class="inputClass"
|
|
14
13
|
v-bind="attrs"
|
|
15
14
|
@input="onInput"
|
|
@@ -148,11 +147,11 @@ export default defineComponent({
|
|
|
148
147
|
},
|
|
149
148
|
class: {
|
|
150
149
|
type: [String, Object, Array],
|
|
151
|
-
default:
|
|
150
|
+
default: () => ""
|
|
152
151
|
},
|
|
153
152
|
ui: {
|
|
154
153
|
type: Object,
|
|
155
|
-
default:
|
|
154
|
+
default: () => ({})
|
|
156
155
|
},
|
|
157
156
|
modelModifiers: {
|
|
158
157
|
type: Object,
|
|
@@ -209,6 +208,7 @@ export default defineComponent({
|
|
|
209
208
|
const variant = ui.value.color?.[color.value]?.[props.variant] || ui.value.variant[props.variant];
|
|
210
209
|
return twMerge(twJoin(
|
|
211
210
|
ui.value.base,
|
|
211
|
+
ui.value.form,
|
|
212
212
|
rounded.value,
|
|
213
213
|
ui.value.placeholder,
|
|
214
214
|
ui.value.size[size.value],
|
|
@@ -246,9 +246,9 @@ export default defineComponent({
|
|
|
246
246
|
const leadingIconClass = computed(() => {
|
|
247
247
|
return twJoin(
|
|
248
248
|
ui.value.icon.base,
|
|
249
|
-
appConfig.ui.colors.includes(color.value) && ui.value.icon.color.replaceAll("{color}", color.value),
|
|
249
|
+
color.value && appConfig.ui.colors.includes(color.value) && ui.value.icon.color.replaceAll("{color}", color.value),
|
|
250
250
|
ui.value.icon.size[size.value],
|
|
251
|
-
props.loading &&
|
|
251
|
+
props.loading && ui.value.icon.loading
|
|
252
252
|
);
|
|
253
253
|
});
|
|
254
254
|
const trailingWrapperIconClass = computed(() => {
|
|
@@ -261,9 +261,9 @@ export default defineComponent({
|
|
|
261
261
|
const trailingIconClass = computed(() => {
|
|
262
262
|
return twJoin(
|
|
263
263
|
ui.value.icon.base,
|
|
264
|
-
appConfig.ui.colors.includes(color.value) && ui.value.icon.color.replaceAll("{color}", color.value),
|
|
264
|
+
color.value && appConfig.ui.colors.includes(color.value) && ui.value.icon.color.replaceAll("{color}", color.value),
|
|
265
265
|
ui.value.icon.size[size.value],
|
|
266
|
-
props.loading && !isLeading.value &&
|
|
266
|
+
props.loading && !isLeading.value && ui.value.icon.loading
|
|
267
267
|
);
|
|
268
268
|
});
|
|
269
269
|
return {
|