@nuxt/ui 2.13.0 → 2.14.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.
- package/README.md +8 -8
- package/dist/module.d.mts +61 -2
- package/dist/module.d.ts +61 -2
- package/dist/module.json +2 -2
- package/dist/module.mjs +27 -23
- package/dist/runtime/components/data/Table.vue +16 -4
- package/dist/runtime/components/data/Table.vue.d.ts +21 -3
- package/dist/runtime/components/elements/Accordion.vue +11 -2
- package/dist/runtime/components/elements/Accordion.vue.d.ts +1 -1
- package/dist/runtime/components/elements/Alert.vue +2 -2
- package/dist/runtime/components/elements/Alert.vue.d.ts +4 -3
- package/dist/runtime/components/elements/Avatar.vue.d.ts +1 -1
- package/dist/runtime/components/elements/AvatarGroup.d.ts +1 -1
- package/dist/runtime/components/elements/Badge.vue.d.ts +2 -2
- package/dist/runtime/components/elements/Button.vue.d.ts +62 -36
- package/dist/runtime/components/elements/ButtonGroup.d.ts +1 -1
- package/dist/runtime/components/elements/Carousel.vue +19 -12
- package/dist/runtime/components/elements/Carousel.vue.d.ts +4 -4
- package/dist/runtime/components/elements/Chip.vue.d.ts +2 -2
- package/dist/runtime/components/elements/Dropdown.vue +3 -1
- package/dist/runtime/components/elements/Dropdown.vue.d.ts +3 -3
- package/dist/runtime/components/elements/Icon.vue.d.ts +1 -1
- package/dist/runtime/components/elements/Kbd.vue.d.ts +1 -1
- package/dist/runtime/components/elements/Link.vue +1 -1
- package/dist/runtime/components/elements/Link.vue.d.ts +61 -35
- package/dist/runtime/components/elements/Meter.vue +4 -0
- package/dist/runtime/components/elements/Meter.vue.d.ts +1 -1
- package/dist/runtime/components/elements/MeterGroup.d.ts +1 -1
- package/dist/runtime/components/elements/Progress.vue +4 -1
- package/dist/runtime/components/elements/Progress.vue.d.ts +5 -5
- package/dist/runtime/components/forms/Checkbox.vue +1 -6
- package/dist/runtime/components/forms/Checkbox.vue.d.ts +5 -14
- package/dist/runtime/components/forms/Form.vue +6 -3
- package/dist/runtime/components/forms/Form.vue.d.ts +1 -1
- package/dist/runtime/components/forms/FormGroup.vue +20 -17
- package/dist/runtime/components/forms/FormGroup.vue.d.ts +2 -2
- package/dist/runtime/components/forms/Input.vue +1 -0
- package/dist/runtime/components/forms/Input.vue.d.ts +5 -5
- package/dist/runtime/components/forms/InputMenu.vue +4 -1
- package/dist/runtime/components/forms/InputMenu.vue.d.ts +6 -6
- package/dist/runtime/components/forms/Radio.vue +5 -11
- package/dist/runtime/components/forms/Radio.vue.d.ts +5 -5
- package/dist/runtime/components/forms/RadioGroup.vue +1 -0
- package/dist/runtime/components/forms/RadioGroup.vue.d.ts +3 -3
- package/dist/runtime/components/forms/Range.vue.d.ts +3 -3
- package/dist/runtime/components/forms/Select.vue.d.ts +5 -5
- package/dist/runtime/components/forms/SelectMenu.vue +4 -1
- package/dist/runtime/components/forms/SelectMenu.vue.d.ts +6 -6
- package/dist/runtime/components/forms/Textarea.vue +5 -1
- package/dist/runtime/components/forms/Textarea.vue.d.ts +14 -5
- package/dist/runtime/components/forms/Toggle.vue +3 -1
- package/dist/runtime/components/forms/Toggle.vue.d.ts +3 -3
- package/dist/runtime/components/layout/Card.vue +1 -1
- package/dist/runtime/components/layout/Card.vue.d.ts +1 -1
- package/dist/runtime/components/layout/Container.vue.d.ts +1 -1
- package/dist/runtime/components/layout/Divider.vue +8 -1
- package/dist/runtime/components/layout/Divider.vue.d.ts +15 -4
- package/dist/runtime/components/layout/Skeleton.vue.d.ts +1 -1
- package/dist/runtime/components/navigation/Breadcrumb.vue.d.ts +1 -1
- package/dist/runtime/components/navigation/CommandPalette.vue +3 -1
- package/dist/runtime/components/navigation/CommandPalette.vue.d.ts +2 -2
- package/dist/runtime/components/navigation/CommandPaletteGroup.vue +3 -1
- package/dist/runtime/components/navigation/CommandPaletteGroup.vue.d.ts +1 -1
- package/dist/runtime/components/navigation/HorizontalNavigation.vue.d.ts +1 -1
- package/dist/runtime/components/navigation/Pagination.vue.d.ts +1 -1
- package/dist/runtime/components/navigation/Tabs.vue +8 -8
- package/dist/runtime/components/navigation/Tabs.vue.d.ts +10 -1
- package/dist/runtime/components/navigation/VerticalNavigation.vue.d.ts +1 -1
- package/dist/runtime/components/overlays/ContextMenu.vue.d.ts +3 -3
- package/dist/runtime/components/overlays/Modal.vue +3 -1
- package/dist/runtime/components/overlays/Modal.vue.d.ts +5 -5
- package/dist/runtime/components/overlays/Modals.client.vue +12 -0
- package/dist/runtime/components/overlays/Notification.vue +2 -2
- package/dist/runtime/components/overlays/Notification.vue.d.ts +4 -3
- package/dist/runtime/components/overlays/Notifications.vue.d.ts +1 -1
- package/dist/runtime/components/overlays/Popover.vue +3 -1
- package/dist/runtime/components/overlays/Popover.vue.d.ts +3 -3
- package/dist/runtime/components/overlays/Slideover.vue +3 -1
- package/dist/runtime/components/overlays/Slideover.vue.d.ts +5 -5
- package/dist/runtime/components/overlays/Tooltip.vue.d.ts +2 -2
- package/dist/runtime/composables/useFormGroup.d.ts +1 -1
- package/dist/runtime/composables/useFormGroup.mjs +9 -12
- package/dist/runtime/composables/useModal.d.ts +12 -0
- package/dist/runtime/composables/useModal.mjs +37 -0
- package/dist/runtime/plugins/modals.d.ts +2 -0
- package/dist/runtime/plugins/modals.mjs +10 -0
- package/dist/runtime/types/component.d.ts +14 -0
- package/dist/runtime/types/divider.d.ts +3 -0
- package/dist/runtime/types/form.d.ts +2 -1
- package/dist/runtime/types/index.d.ts +2 -0
- package/dist/runtime/types/modal.d.ts +18 -0
- package/dist/runtime/types/progress.d.ts +2 -0
- package/dist/runtime/types/range.d.ts +2 -0
- package/dist/runtime/types/toggle.d.ts +2 -0
- package/dist/runtime/ui.config/data/table.d.ts +7 -0
- package/dist/runtime/ui.config/data/table.mjs +10 -3
- package/dist/runtime/ui.config/elements/accordion.d.ts +1 -0
- package/dist/runtime/ui.config/elements/accordion.mjs +1 -0
- package/dist/runtime/ui.config/forms/formGroup.d.ts +1 -0
- package/dist/runtime/ui.config/forms/formGroup.mjs +1 -0
- package/dist/runtime/ui.config/forms/input.d.ts +11 -0
- package/dist/runtime/ui.config/forms/input.mjs +11 -0
- package/dist/runtime/ui.config/forms/select.d.ts +11 -0
- package/dist/runtime/ui.config/forms/textarea.d.ts +11 -0
- package/dist/runtime/ui.config/layout/divider.d.ts +19 -2
- package/dist/runtime/ui.config/layout/divider.mjs +20 -3
- package/dist/runtime/utils/index.mjs +9 -0
- package/dist/runtime/utils/link.d.ts +24 -11
- package/dist/runtime/utils/link.mjs +26 -13
- package/package.json +21 -19
- package/dist/runtime/utils/uid.d.ts +0 -1
- package/dist/runtime/utils/uid.mjs +0 -5
|
@@ -36,7 +36,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
36
36
|
validator(value: string): boolean;
|
|
37
37
|
};
|
|
38
38
|
color: {
|
|
39
|
-
type:
|
|
39
|
+
type: PropType<any>;
|
|
40
40
|
default: () => any;
|
|
41
41
|
validator(value: string): any;
|
|
42
42
|
};
|
|
@@ -61,8 +61,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
61
61
|
isIndeterminate: import("vue").ComputedRef<boolean>;
|
|
62
62
|
isSteps: import("vue").ComputedRef<boolean>;
|
|
63
63
|
realMax: import("vue").ComputedRef<number | null>;
|
|
64
|
-
percent: import("vue").ComputedRef<number>;
|
|
65
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").
|
|
64
|
+
percent: import("vue").ComputedRef<number | undefined>;
|
|
65
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
66
66
|
value: {
|
|
67
67
|
type: NumberConstructor;
|
|
68
68
|
default: null;
|
|
@@ -99,7 +99,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
99
99
|
validator(value: string): boolean;
|
|
100
100
|
};
|
|
101
101
|
color: {
|
|
102
|
-
type:
|
|
102
|
+
type: PropType<any>;
|
|
103
103
|
default: () => any;
|
|
104
104
|
validator(value: string): any;
|
|
105
105
|
};
|
|
@@ -115,7 +115,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
115
115
|
size: "sm" | "2xs" | "md" | "xs" | "lg" | "xl" | "2xl";
|
|
116
116
|
ui: any;
|
|
117
117
|
value: number;
|
|
118
|
-
color:
|
|
118
|
+
color: any;
|
|
119
119
|
class: any;
|
|
120
120
|
max: number | any[];
|
|
121
121
|
indicator: boolean;
|
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
:required="required"
|
|
9
9
|
:value="value"
|
|
10
10
|
:disabled="disabled"
|
|
11
|
-
:checked="checked"
|
|
12
11
|
:indeterminate="indeterminate"
|
|
13
12
|
type="checkbox"
|
|
14
13
|
:class="inputClass"
|
|
@@ -60,13 +59,9 @@ export default defineComponent({
|
|
|
60
59
|
type: Boolean,
|
|
61
60
|
default: false
|
|
62
61
|
},
|
|
63
|
-
checked: {
|
|
64
|
-
type: Boolean,
|
|
65
|
-
default: false
|
|
66
|
-
},
|
|
67
62
|
indeterminate: {
|
|
68
63
|
type: Boolean,
|
|
69
|
-
default:
|
|
64
|
+
default: void 0
|
|
70
65
|
},
|
|
71
66
|
help: {
|
|
72
67
|
type: String,
|
|
@@ -20,13 +20,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
20
20
|
type: BooleanConstructor;
|
|
21
21
|
default: boolean;
|
|
22
22
|
};
|
|
23
|
-
checked: {
|
|
24
|
-
type: BooleanConstructor;
|
|
25
|
-
default: boolean;
|
|
26
|
-
};
|
|
27
23
|
indeterminate: {
|
|
28
24
|
type: BooleanConstructor;
|
|
29
|
-
default:
|
|
25
|
+
default: undefined;
|
|
30
26
|
};
|
|
31
27
|
help: {
|
|
32
28
|
type: StringConstructor;
|
|
@@ -63,11 +59,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
63
59
|
[x: string]: unknown;
|
|
64
60
|
}, string>>;
|
|
65
61
|
toggle: import("vue").WritableComputedRef<boolean | unknown[]>;
|
|
66
|
-
inputId: import("vue").
|
|
62
|
+
inputId: import("vue").ComputedRef<string | undefined>;
|
|
67
63
|
name: import("vue").ComputedRef<string | undefined>;
|
|
68
64
|
inputClass: import("vue").ComputedRef<string>;
|
|
69
65
|
onChange: (event: Event) => void;
|
|
70
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "update:modelValue")[], "change" | "update:modelValue", import("vue").
|
|
66
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "update:modelValue")[], "change" | "update:modelValue", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
71
67
|
id: {
|
|
72
68
|
type: StringConstructor;
|
|
73
69
|
default: () => null;
|
|
@@ -88,13 +84,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
88
84
|
type: BooleanConstructor;
|
|
89
85
|
default: boolean;
|
|
90
86
|
};
|
|
91
|
-
checked: {
|
|
92
|
-
type: BooleanConstructor;
|
|
93
|
-
default: boolean;
|
|
94
|
-
};
|
|
95
87
|
indeterminate: {
|
|
96
88
|
type: BooleanConstructor;
|
|
97
|
-
default:
|
|
89
|
+
default: undefined;
|
|
98
90
|
};
|
|
99
91
|
help: {
|
|
100
92
|
type: StringConstructor;
|
|
@@ -133,14 +125,13 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
133
125
|
value: string | number | boolean | Record<string, any>;
|
|
134
126
|
id: string;
|
|
135
127
|
color: any;
|
|
136
|
-
name: string;
|
|
137
128
|
class: any;
|
|
129
|
+
name: string;
|
|
138
130
|
label: string;
|
|
139
131
|
modelValue: boolean | unknown[];
|
|
140
132
|
indeterminate: boolean;
|
|
141
133
|
disabled: boolean;
|
|
142
134
|
required: boolean;
|
|
143
|
-
checked: boolean;
|
|
144
135
|
help: string;
|
|
145
136
|
inputClass: string;
|
|
146
137
|
}, {}>;
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
<script>
|
|
8
8
|
import { provide, ref, defineComponent, onUnmounted, onMounted } from "vue";
|
|
9
9
|
import { useEventBus } from "@vueuse/core";
|
|
10
|
-
import {
|
|
10
|
+
import { useId } from "#imports";
|
|
11
11
|
class FormException extends Error {
|
|
12
12
|
constructor(message) {
|
|
13
13
|
super(message);
|
|
@@ -36,7 +36,8 @@ export default defineComponent({
|
|
|
36
36
|
},
|
|
37
37
|
emits: ["submit", "error"],
|
|
38
38
|
setup(props, { expose, emit }) {
|
|
39
|
-
const
|
|
39
|
+
const formId = useId();
|
|
40
|
+
const bus = useEventBus(`form-${formId}`);
|
|
40
41
|
onMounted(() => {
|
|
41
42
|
bus.on(async (event) => {
|
|
42
43
|
if (event.type !== "submit" && props.validateOn?.includes(event.type)) {
|
|
@@ -85,7 +86,9 @@ export default defineComponent({
|
|
|
85
86
|
} else {
|
|
86
87
|
errors.value = await getErrors();
|
|
87
88
|
}
|
|
88
|
-
if (
|
|
89
|
+
if (errors.value.length > 0) {
|
|
90
|
+
if (opts.silent)
|
|
91
|
+
return false;
|
|
89
92
|
throw new FormException(
|
|
90
93
|
`Form validation failed: ${JSON.stringify(errors.value, null, 2)}`
|
|
91
94
|
);
|
|
@@ -23,7 +23,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
23
23
|
};
|
|
24
24
|
}, {
|
|
25
25
|
onSubmit: (payload: Event) => Promise<void>;
|
|
26
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("error" | "submit")[], "error" | "submit", import("vue").
|
|
26
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("error" | "submit")[], "error" | "submit", import("vue").PublicProps, 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>>;
|
|
29
29
|
default: undefined;
|
|
@@ -1,22 +1,24 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div :class="ui.wrapper" v-bind="attrs">
|
|
3
|
-
<div
|
|
4
|
-
<
|
|
5
|
-
<
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
<
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
3
|
+
<div :class="ui.inner">
|
|
4
|
+
<div v-if="label || $slots.label" :class="[ui.label.wrapper, size]">
|
|
5
|
+
<label :for="inputId" :class="[ui.label.base, required ? ui.label.required : '']">
|
|
6
|
+
<slot v-if="$slots.label" name="label" v-bind="{ error, label, name, hint, description, help }" />
|
|
7
|
+
<template v-else>{{ label }}</template>
|
|
8
|
+
</label>
|
|
9
|
+
<span v-if="hint || $slots.hint" :class="[ui.hint]">
|
|
10
|
+
<slot v-if="$slots.hint" name="hint" v-bind="{ error, label, name, hint, description, help }" />
|
|
11
|
+
<template v-else>{{ hint }}</template>
|
|
12
|
+
</span>
|
|
13
|
+
</div>
|
|
13
14
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
<p v-if="description || $slots.description" :class="[ui.description, size]">
|
|
16
|
+
<slot v-if="$slots.description" name="description" v-bind="{ error, label, name, hint, description, help }" />
|
|
17
|
+
<template v-else>
|
|
18
|
+
{{ description }}
|
|
19
|
+
</template>
|
|
20
|
+
</p>
|
|
21
|
+
</div>
|
|
20
22
|
|
|
21
23
|
<div :class="[label ? ui.container : '']">
|
|
22
24
|
<slot v-bind="{ error }" />
|
|
@@ -43,6 +45,7 @@ import { useUI } from "../../composables/useUI";
|
|
|
43
45
|
import { mergeConfig } from "../../utils";
|
|
44
46
|
import appConfig from "#build/app.config";
|
|
45
47
|
import { formGroup } from "#ui/ui.config";
|
|
48
|
+
import { useId } from "#imports";
|
|
46
49
|
const config = mergeConfig(appConfig.ui.strategy, appConfig.ui.formGroup, formGroup);
|
|
47
50
|
export default defineComponent({
|
|
48
51
|
inheritAttrs: false,
|
|
@@ -102,7 +105,7 @@ export default defineComponent({
|
|
|
102
105
|
return props.error && typeof props.error === "string" || typeof props.error === "boolean" ? props.error : formErrors?.value?.find((error2) => error2.path === props.name)?.message;
|
|
103
106
|
});
|
|
104
107
|
const size = computed(() => ui.value.size[props.size ?? config.default.size]);
|
|
105
|
-
const inputId = ref();
|
|
108
|
+
const inputId = ref(useId());
|
|
106
109
|
provide("form-group", {
|
|
107
110
|
error,
|
|
108
111
|
inputId,
|
|
@@ -54,7 +54,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
54
54
|
inputId: Ref<any>;
|
|
55
55
|
size: import("vue").ComputedRef<any>;
|
|
56
56
|
error: import("vue").ComputedRef<string | boolean | undefined>;
|
|
57
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").
|
|
57
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
58
58
|
name: {
|
|
59
59
|
type: StringConstructor;
|
|
60
60
|
default: null;
|
|
@@ -105,8 +105,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
105
105
|
size: FormGroupSize;
|
|
106
106
|
ui: any;
|
|
107
107
|
description: string;
|
|
108
|
-
name: string;
|
|
109
108
|
class: any;
|
|
109
|
+
name: string;
|
|
110
110
|
label: string;
|
|
111
111
|
required: boolean;
|
|
112
112
|
help: string;
|
|
@@ -211,6 +211,7 @@ export default defineComponent({
|
|
|
211
211
|
ui.value.form,
|
|
212
212
|
rounded.value,
|
|
213
213
|
ui.value.placeholder,
|
|
214
|
+
props.type === "file" && [ui.value.file.base, ui.value.file.padding[size.value]],
|
|
214
215
|
ui.value.size[size.value],
|
|
215
216
|
props.padded ? ui.value.padding[size.value] : "p-0",
|
|
216
217
|
variant?.replaceAll("{color}", color.value),
|
|
@@ -110,7 +110,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
110
110
|
[x: string]: unknown;
|
|
111
111
|
}, string>>;
|
|
112
112
|
name: import("vue").ComputedRef<string | undefined>;
|
|
113
|
-
inputId: import("vue").
|
|
113
|
+
inputId: import("vue").ComputedRef<string | undefined>;
|
|
114
114
|
input: import("vue").Ref<HTMLInputElement | null>;
|
|
115
115
|
isLeading: import("vue").ComputedRef<string | true>;
|
|
116
116
|
isTrailing: import("vue").ComputedRef<string | true>;
|
|
@@ -124,7 +124,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
124
124
|
onInput: (event: Event) => void;
|
|
125
125
|
onChange: (event: Event) => void;
|
|
126
126
|
onBlur: (event: FocusEvent) => void;
|
|
127
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("blur" | "update:modelValue")[], "blur" | "update:modelValue", import("vue").
|
|
127
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("blur" | "update:modelValue")[], "blur" | "update:modelValue", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
128
128
|
modelValue: {
|
|
129
129
|
type: (NumberConstructor | StringConstructor)[];
|
|
130
130
|
default: string;
|
|
@@ -238,20 +238,20 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
238
238
|
icon: string;
|
|
239
239
|
color: any;
|
|
240
240
|
type: string;
|
|
241
|
+
class: any;
|
|
241
242
|
name: string;
|
|
242
243
|
leading: boolean;
|
|
243
|
-
|
|
244
|
+
variant: InputVariant;
|
|
244
245
|
modelValue: string | number;
|
|
245
246
|
loading: boolean;
|
|
246
247
|
disabled: boolean;
|
|
247
|
-
variant: InputVariant;
|
|
248
|
-
required: boolean;
|
|
249
248
|
placeholder: string;
|
|
250
249
|
padded: boolean;
|
|
251
250
|
loadingIcon: string;
|
|
252
251
|
leadingIcon: string;
|
|
253
252
|
trailingIcon: string;
|
|
254
253
|
trailing: boolean;
|
|
254
|
+
required: boolean;
|
|
255
255
|
autofocus: boolean;
|
|
256
256
|
inputClass: string;
|
|
257
257
|
autofocusDelay: number;
|
|
@@ -97,7 +97,8 @@ import {
|
|
|
97
97
|
ComboboxButton as HComboboxButton,
|
|
98
98
|
ComboboxOptions as HComboboxOptions,
|
|
99
99
|
ComboboxOption as HComboboxOption,
|
|
100
|
-
ComboboxInput as HComboboxInput
|
|
100
|
+
ComboboxInput as HComboboxInput,
|
|
101
|
+
provideUseId
|
|
101
102
|
} from "@headlessui/vue";
|
|
102
103
|
import { computedAsync, useDebounceFn } from "@vueuse/core";
|
|
103
104
|
import { defu } from "defu";
|
|
@@ -111,6 +112,7 @@ import { get, mergeConfig } from "../../utils";
|
|
|
111
112
|
import { useInjectButtonGroup } from "../../composables/useButtonGroup";
|
|
112
113
|
import appConfig from "#build/app.config";
|
|
113
114
|
import { input, inputMenu } from "#ui/ui.config";
|
|
115
|
+
import { useId } from "#imports";
|
|
114
116
|
const config = mergeConfig(appConfig.ui.strategy, appConfig.ui.input, input);
|
|
115
117
|
const configMenu = mergeConfig(appConfig.ui.strategy, appConfig.ui.inputMenu, inputMenu);
|
|
116
118
|
export default defineComponent({
|
|
@@ -392,6 +394,7 @@ export default defineComponent({
|
|
|
392
394
|
function onChange(event) {
|
|
393
395
|
query.value = event.target.value;
|
|
394
396
|
}
|
|
397
|
+
provideUseId(() => useId());
|
|
395
398
|
return {
|
|
396
399
|
// eslint-disable-next-line vue/no-dupe-keys
|
|
397
400
|
ui,
|
|
@@ -142,7 +142,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
142
142
|
[x: string]: unknown;
|
|
143
143
|
}, string>>;
|
|
144
144
|
name: import("vue").ComputedRef<string | undefined>;
|
|
145
|
-
inputId: import("vue").
|
|
145
|
+
inputId: import("vue").ComputedRef<string | undefined>;
|
|
146
146
|
popper: import("vue").ComputedRef<PopperOptions>;
|
|
147
147
|
trigger: import("vue").Ref<import("@vueuse/core").MaybeElement>;
|
|
148
148
|
container: import("vue").Ref<import("@vueuse/core").MaybeElement>;
|
|
@@ -160,7 +160,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
160
160
|
query: import("vue").WritableComputedRef<string>;
|
|
161
161
|
onUpdate: (event: any) => void;
|
|
162
162
|
onChange: (event: any) => void;
|
|
163
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "close" | "update:modelValue" | "open" | "update:query")[], "change" | "close" | "update:modelValue" | "open" | "update:query", import("vue").
|
|
163
|
+
}, unknown, {}, {}, 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<{
|
|
164
164
|
modelValue: {
|
|
165
165
|
type: (ObjectConstructor | NumberConstructor | StringConstructor | ArrayConstructor)[];
|
|
166
166
|
default: string;
|
|
@@ -296,9 +296,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
296
296
|
default: () => {};
|
|
297
297
|
};
|
|
298
298
|
}>> & {
|
|
299
|
+
onClose?: ((...args: any[]) => any) | undefined;
|
|
299
300
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
300
301
|
onChange?: ((...args: any[]) => any) | undefined;
|
|
301
|
-
onClose?: ((...args: any[]) => any) | undefined;
|
|
302
302
|
onOpen?: ((...args: any[]) => any) | undefined;
|
|
303
303
|
"onUpdate:query"?: ((...args: any[]) => any) | undefined;
|
|
304
304
|
}, {
|
|
@@ -307,6 +307,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
307
307
|
id: string;
|
|
308
308
|
icon: string;
|
|
309
309
|
color: any;
|
|
310
|
+
class: any;
|
|
310
311
|
options: string[] | {
|
|
311
312
|
[key: string]: any;
|
|
312
313
|
disabled?: boolean | undefined;
|
|
@@ -315,19 +316,18 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
315
316
|
name: string;
|
|
316
317
|
leading: boolean;
|
|
317
318
|
search: (query: string) => Promise<any[]> | any[];
|
|
318
|
-
|
|
319
|
+
variant: InputVariant;
|
|
319
320
|
modelValue: string | number | unknown[] | Record<string, any>;
|
|
320
321
|
by: string;
|
|
321
322
|
loading: boolean;
|
|
322
323
|
disabled: boolean;
|
|
323
|
-
variant: InputVariant;
|
|
324
|
-
required: boolean;
|
|
325
324
|
placeholder: string;
|
|
326
325
|
padded: boolean;
|
|
327
326
|
loadingIcon: string;
|
|
328
327
|
leadingIcon: string;
|
|
329
328
|
trailingIcon: string;
|
|
330
329
|
trailing: boolean;
|
|
330
|
+
required: boolean;
|
|
331
331
|
inputClass: string;
|
|
332
332
|
nullable: boolean;
|
|
333
333
|
query: string;
|
|
@@ -26,21 +26,20 @@
|
|
|
26
26
|
</template>
|
|
27
27
|
|
|
28
28
|
<script>
|
|
29
|
-
import { computed, defineComponent, inject, toRef
|
|
29
|
+
import { computed, defineComponent, inject, toRef } from "vue";
|
|
30
30
|
import { twMerge, twJoin } from "tailwind-merge";
|
|
31
31
|
import { useUI } from "../../composables/useUI";
|
|
32
|
+
import { useFormGroup } from "../../composables/useFormGroup";
|
|
32
33
|
import { mergeConfig } from "../../utils";
|
|
33
34
|
import appConfig from "#build/app.config";
|
|
34
35
|
import { radio } from "#ui/ui.config";
|
|
35
|
-
import {
|
|
36
|
-
import { useFormGroup } from "../../composables/useFormGroup";
|
|
36
|
+
import { useId } from "#imports";
|
|
37
37
|
const config = mergeConfig(appConfig.ui.strategy, appConfig.ui.radio, radio);
|
|
38
38
|
export default defineComponent({
|
|
39
|
-
inheritAttrs: false,
|
|
40
39
|
props: {
|
|
41
40
|
id: {
|
|
42
41
|
type: String,
|
|
43
|
-
default:
|
|
42
|
+
default: null
|
|
44
43
|
},
|
|
45
44
|
value: {
|
|
46
45
|
type: [String, Number, Boolean],
|
|
@@ -93,14 +92,9 @@ export default defineComponent({
|
|
|
93
92
|
emits: ["update:modelValue", "change"],
|
|
94
93
|
setup(props, { emit }) {
|
|
95
94
|
const { ui, attrs } = useUI("radio", toRef(props, "ui"), config, toRef(props, "class"));
|
|
95
|
+
const inputId = props.id ?? useId();
|
|
96
96
|
const radioGroup = inject("radio-group", null);
|
|
97
97
|
const { emitFormChange, color, name } = radioGroup ?? useFormGroup(props, config);
|
|
98
|
-
const inputId = ref(props.id);
|
|
99
|
-
onMounted(() => {
|
|
100
|
-
if (!inputId.value) {
|
|
101
|
-
inputId.value = uid();
|
|
102
|
-
}
|
|
103
|
-
});
|
|
104
98
|
const pick = computed({
|
|
105
99
|
get() {
|
|
106
100
|
return props.modelValue;
|
|
@@ -2,7 +2,7 @@ import type { PropType } from 'vue';
|
|
|
2
2
|
declare const _default: import("vue").DefineComponent<{
|
|
3
3
|
id: {
|
|
4
4
|
type: StringConstructor;
|
|
5
|
-
default:
|
|
5
|
+
default: null;
|
|
6
6
|
};
|
|
7
7
|
value: {
|
|
8
8
|
type: (BooleanConstructor | NumberConstructor | StringConstructor)[];
|
|
@@ -50,7 +50,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
50
50
|
default: () => {};
|
|
51
51
|
};
|
|
52
52
|
}, {
|
|
53
|
-
inputId:
|
|
53
|
+
inputId: string;
|
|
54
54
|
ui: import("vue").ComputedRef<any>;
|
|
55
55
|
attrs: import("vue").ComputedRef<Pick<{
|
|
56
56
|
[x: string]: unknown;
|
|
@@ -58,10 +58,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
58
58
|
pick: import("vue").WritableComputedRef<string | number | boolean | Record<string, any>>;
|
|
59
59
|
name: import("vue").ComputedRef<string | undefined>;
|
|
60
60
|
inputClass: import("vue").ComputedRef<string>;
|
|
61
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "update:modelValue")[], "change" | "update:modelValue", import("vue").
|
|
61
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "update:modelValue")[], "change" | "update:modelValue", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
62
62
|
id: {
|
|
63
63
|
type: StringConstructor;
|
|
64
|
-
default:
|
|
64
|
+
default: null;
|
|
65
65
|
};
|
|
66
66
|
value: {
|
|
67
67
|
type: (BooleanConstructor | NumberConstructor | StringConstructor)[];
|
|
@@ -116,8 +116,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
116
116
|
value: string | number | boolean;
|
|
117
117
|
id: string;
|
|
118
118
|
color: any;
|
|
119
|
-
name: string;
|
|
120
119
|
class: any;
|
|
120
|
+
name: string;
|
|
121
121
|
label: string;
|
|
122
122
|
modelValue: string | number | boolean | Record<string, any>;
|
|
123
123
|
disabled: boolean;
|
|
@@ -53,7 +53,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
53
53
|
}, string>>;
|
|
54
54
|
normalizedOptions: import("vue").ComputedRef<any[]>;
|
|
55
55
|
onUpdate: (value: any) => void;
|
|
56
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "update:modelValue")[], "change" | "update:modelValue", import("vue").
|
|
56
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "update:modelValue")[], "change" | "update:modelValue", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
57
57
|
modelValue: {
|
|
58
58
|
type: (ObjectConstructor | NumberConstructor | StringConstructor)[];
|
|
59
59
|
default: string;
|
|
@@ -105,10 +105,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
105
105
|
}, {
|
|
106
106
|
ui: any;
|
|
107
107
|
color: any;
|
|
108
|
-
|
|
108
|
+
class: any;
|
|
109
109
|
options: unknown[];
|
|
110
110
|
name: string;
|
|
111
|
-
|
|
111
|
+
legend: string;
|
|
112
112
|
modelValue: string | number | Record<string, any>;
|
|
113
113
|
disabled: boolean;
|
|
114
114
|
optionAttribute: string;
|
|
@@ -57,7 +57,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
57
57
|
[x: string]: unknown;
|
|
58
58
|
}, string>>;
|
|
59
59
|
name: import("vue").ComputedRef<string | undefined>;
|
|
60
|
-
inputId: import("vue").
|
|
60
|
+
inputId: import("vue").ComputedRef<string | undefined>;
|
|
61
61
|
value: import("vue").WritableComputedRef<number>;
|
|
62
62
|
wrapperClass: import("vue").ComputedRef<string>;
|
|
63
63
|
inputClass: import("vue").ComputedRef<string>;
|
|
@@ -68,7 +68,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
68
68
|
width: string;
|
|
69
69
|
}>;
|
|
70
70
|
onChange: (event: Event) => void;
|
|
71
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "update:modelValue")[], "change" | "update:modelValue", import("vue").
|
|
71
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "update:modelValue")[], "change" | "update:modelValue", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
72
72
|
modelValue: {
|
|
73
73
|
type: NumberConstructor;
|
|
74
74
|
default: number;
|
|
@@ -127,8 +127,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
127
127
|
ui: any;
|
|
128
128
|
id: string;
|
|
129
129
|
color: any;
|
|
130
|
-
name: string;
|
|
131
130
|
class: any;
|
|
131
|
+
name: string;
|
|
132
132
|
modelValue: number;
|
|
133
133
|
disabled: boolean;
|
|
134
134
|
max: number;
|
|
@@ -102,7 +102,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
102
102
|
[x: string]: unknown;
|
|
103
103
|
}, string>>;
|
|
104
104
|
name: ComputedRef<string | undefined>;
|
|
105
|
-
inputId:
|
|
105
|
+
inputId: ComputedRef<string | undefined>;
|
|
106
106
|
normalizedOptionsWithPlaceholder: ComputedRef<{
|
|
107
107
|
disabled?: boolean | undefined;
|
|
108
108
|
children: {
|
|
@@ -121,7 +121,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
121
121
|
trailingWrapperIconClass: ComputedRef<string>;
|
|
122
122
|
onInput: (event: Event) => void;
|
|
123
123
|
onChange: (event: Event) => void;
|
|
124
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "update:modelValue")[], "change" | "update:modelValue", import("vue").
|
|
124
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "update:modelValue")[], "change" | "update:modelValue", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
125
125
|
modelValue: {
|
|
126
126
|
type: (ObjectConstructor | NumberConstructor | StringConstructor)[];
|
|
127
127
|
default: string;
|
|
@@ -226,21 +226,21 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
226
226
|
id: string;
|
|
227
227
|
icon: string;
|
|
228
228
|
color: any;
|
|
229
|
+
class: any;
|
|
229
230
|
options: unknown[];
|
|
230
231
|
name: string;
|
|
231
232
|
leading: boolean;
|
|
232
|
-
|
|
233
|
+
variant: SelectVariant;
|
|
233
234
|
modelValue: string | number | Record<string, any>;
|
|
234
235
|
loading: boolean;
|
|
235
236
|
disabled: boolean;
|
|
236
|
-
variant: SelectVariant;
|
|
237
|
-
required: boolean;
|
|
238
237
|
placeholder: string;
|
|
239
238
|
padded: boolean;
|
|
240
239
|
loadingIcon: string;
|
|
241
240
|
leadingIcon: string;
|
|
242
241
|
trailingIcon: string;
|
|
243
242
|
trailing: boolean;
|
|
243
|
+
required: boolean;
|
|
244
244
|
optionAttribute: string;
|
|
245
245
|
valueAttribute: string;
|
|
246
246
|
selectClass: string;
|
|
@@ -133,7 +133,8 @@ import {
|
|
|
133
133
|
Listbox as HListbox,
|
|
134
134
|
ListboxButton as HListboxButton,
|
|
135
135
|
ListboxOptions as HListboxOptions,
|
|
136
|
-
ListboxOption as HListboxOption
|
|
136
|
+
ListboxOption as HListboxOption,
|
|
137
|
+
provideUseId
|
|
137
138
|
} from "@headlessui/vue";
|
|
138
139
|
import { computedAsync, useDebounceFn } from "@vueuse/core";
|
|
139
140
|
import { defu } from "defu";
|
|
@@ -147,6 +148,7 @@ import { get, mergeConfig } from "../../utils";
|
|
|
147
148
|
import { useInjectButtonGroup } from "../../composables/useButtonGroup";
|
|
148
149
|
import appConfig from "#build/app.config";
|
|
149
150
|
import { select, selectMenu } from "#ui/ui.config";
|
|
151
|
+
import { useId } from "#imports";
|
|
150
152
|
const config = mergeConfig(appConfig.ui.strategy, appConfig.ui.select, select);
|
|
151
153
|
const configMenu = mergeConfig(appConfig.ui.strategy, appConfig.ui.selectMenu, selectMenu);
|
|
152
154
|
export default defineComponent({
|
|
@@ -474,6 +476,7 @@ export default defineComponent({
|
|
|
474
476
|
function onChange(event) {
|
|
475
477
|
query.value = event.target.value;
|
|
476
478
|
}
|
|
479
|
+
provideUseId(() => useId());
|
|
477
480
|
return {
|
|
478
481
|
// eslint-disable-next-line vue/no-dupe-keys
|
|
479
482
|
ui,
|
|
@@ -158,7 +158,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
158
158
|
[x: string]: unknown;
|
|
159
159
|
}, string>>;
|
|
160
160
|
name: import("vue").ComputedRef<string | undefined>;
|
|
161
|
-
inputId: import("vue").
|
|
161
|
+
inputId: import("vue").ComputedRef<string | undefined>;
|
|
162
162
|
popper: import("vue").ComputedRef<PopperOptions>;
|
|
163
163
|
trigger: import("vue").Ref<import("@vueuse/core").MaybeElement>;
|
|
164
164
|
container: import("vue").Ref<import("@vueuse/core").MaybeElement>;
|
|
@@ -179,7 +179,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
179
179
|
query: import("vue").WritableComputedRef<string>;
|
|
180
180
|
onUpdate: (event: any) => void;
|
|
181
181
|
onChange: (event: any) => void;
|
|
182
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "close" | "update:modelValue" | "open" | "update:query")[], "change" | "close" | "update:modelValue" | "open" | "update:query", import("vue").
|
|
182
|
+
}, unknown, {}, {}, 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<{
|
|
183
183
|
modelValue: {
|
|
184
184
|
type: (ObjectConstructor | NumberConstructor | StringConstructor | ArrayConstructor)[];
|
|
185
185
|
default: string;
|
|
@@ -331,9 +331,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
331
331
|
default: () => {};
|
|
332
332
|
};
|
|
333
333
|
}>> & {
|
|
334
|
+
onClose?: ((...args: any[]) => any) | undefined;
|
|
334
335
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
335
336
|
onChange?: ((...args: any[]) => any) | undefined;
|
|
336
|
-
onClose?: ((...args: any[]) => any) | undefined;
|
|
337
337
|
onOpen?: ((...args: any[]) => any) | undefined;
|
|
338
338
|
"onUpdate:query"?: ((...args: any[]) => any) | undefined;
|
|
339
339
|
}, {
|
|
@@ -342,6 +342,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
342
342
|
id: string;
|
|
343
343
|
icon: string;
|
|
344
344
|
color: any;
|
|
345
|
+
class: any;
|
|
345
346
|
options: string[] | {
|
|
346
347
|
[key: string]: any;
|
|
347
348
|
disabled?: boolean | undefined;
|
|
@@ -349,20 +350,19 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
349
350
|
popper: PopperOptions;
|
|
350
351
|
name: string;
|
|
351
352
|
leading: boolean;
|
|
352
|
-
|
|
353
|
+
variant: SelectVariant;
|
|
353
354
|
modelValue: string | number | unknown[] | Record<string, any>;
|
|
354
355
|
by: string;
|
|
355
356
|
loading: boolean;
|
|
356
357
|
disabled: boolean;
|
|
357
358
|
multiple: boolean;
|
|
358
|
-
variant: SelectVariant;
|
|
359
|
-
required: boolean;
|
|
360
359
|
placeholder: string;
|
|
361
360
|
padded: boolean;
|
|
362
361
|
loadingIcon: string;
|
|
363
362
|
leadingIcon: string;
|
|
364
363
|
trailingIcon: string;
|
|
365
364
|
trailing: boolean;
|
|
365
|
+
required: boolean;
|
|
366
366
|
query: string;
|
|
367
367
|
selectedIcon: string;
|
|
368
368
|
optionAttribute: string;
|