iryx-ui 0.18.2 → 0.18.4
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/components/Checkbox.vue.d.ts +3 -0
- package/dist/components/Checkbox.vue_vue_type_script_setup_true_lang.js +59 -42
- package/dist/components/Combobox.vue_vue_type_script_setup_true_lang.js +3 -1
- package/dist/components/CommandPalette.vue_vue_type_script_setup_true_lang.js +2 -1
- package/dist/components/DateField.vue_vue_type_script_setup_true_lang.js +3 -1
- package/dist/components/DatePicker.vue_vue_type_script_setup_true_lang.js +3 -1
- package/dist/components/DateRangePicker.vue_vue_type_script_setup_true_lang.js +65 -63
- package/dist/components/Editable.vue_vue_type_script_setup_true_lang.js +7 -2
- package/dist/components/FileUpload.vue_vue_type_script_setup_true_lang.js +3 -1
- package/dist/components/FormField.vue_vue_type_script_setup_true_lang.js +50 -47
- package/dist/components/Input.vue_vue_type_script_setup_true_lang.js +6 -4
- package/dist/components/NumberInput.vue_vue_type_script_setup_true_lang.js +3 -1
- package/dist/components/PinInput.vue.d.ts +1 -0
- package/dist/components/PinInput.vue_vue_type_script_setup_true_lang.js +40 -32
- package/dist/components/RadioGroup.vue.d.ts +3 -0
- package/dist/components/RadioGroup.vue_vue_type_script_setup_true_lang.js +49 -31
- package/dist/components/Select.vue.d.ts +3 -0
- package/dist/components/Select.vue_vue_type_script_setup_true_lang.js +65 -46
- package/dist/components/SignaturePad.vue_vue_type_script_setup_true_lang.js +3 -1
- package/dist/components/Slider.vue_vue_type_script_setup_true_lang.js +58 -53
- package/dist/components/Switch.vue.d.ts +3 -0
- package/dist/components/Switch.vue_vue_type_script_setup_true_lang.js +50 -33
- package/dist/components/TagsInput.vue_vue_type_script_setup_true_lang.js +3 -1
- package/dist/components/Textarea.vue_vue_type_script_setup_true_lang.js +5 -3
- package/dist/components/TimeField.vue_vue_type_script_setup_true_lang.js +3 -1
- package/dist/composables/form.d.ts +8 -1
- package/dist/index.js +9 -9
- package/dist/theme/checkbox.d.ts +15 -0
- package/dist/theme/checkbox.js +2 -1
- package/dist/theme/radio-group.d.ts +15 -0
- package/dist/theme/radio-group.js +2 -1
- package/dist/theme/select.d.ts +15 -0
- package/dist/theme/select.js +8 -5
- package/dist/theme/switch.d.ts +15 -0
- package/dist/theme/switch.js +2 -1
- package/dist/theme/timeline.js +5 -5
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useIryxUiConfig as e } from "../config.js";
|
|
2
2
|
import t from "./Icon.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { useFormField as n } from "../composables/form.js";
|
|
4
|
+
import { inputTheme as r } from "../theme/input.js";
|
|
5
5
|
import { computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createVNode as l, defineComponent as u, mergeModels as d, mergeProps as f, normalizeClass as p, onBeforeUnmount as m, openBlock as h, ref as g, renderSlot as _, unref as v, useModel as y, useSlots as b, watch as x, withKeys as S } from "vue";
|
|
6
6
|
import { Cancel01Icon as C, Loading03Icon as w } from "@hugeicons/core-free-icons";
|
|
7
7
|
//#region src/components/Input.vue?vue&type=script&setup=true&lang.ts
|
|
@@ -55,7 +55,9 @@ var T = [
|
|
|
55
55
|
"url",
|
|
56
56
|
"tel",
|
|
57
57
|
"password"
|
|
58
|
-
].includes(D.type) ? !1 : void 0), k = y(u, "modelValue"), A = b(), j =
|
|
58
|
+
].includes(D.type) ? !1 : void 0), k = y(u, "modelValue"), A = b(), j = n(), M = i(() => D.id ?? j?.id.value);
|
|
59
|
+
j && D.id && (j.id.value = D.id);
|
|
60
|
+
let N = i(() => D.invalid ?? j?.invalid.value ?? !1), P = e(), F = i(() => D.unstyled ?? P.unstyled), I = g(k.value), L;
|
|
59
61
|
function R() {
|
|
60
62
|
L !== void 0 && (clearTimeout(L), L = void 0);
|
|
61
63
|
}
|
|
@@ -81,7 +83,7 @@ var T = [
|
|
|
81
83
|
R(), I.value = "", k.value = "", V.value?.focus();
|
|
82
84
|
}
|
|
83
85
|
d({ input: V });
|
|
84
|
-
let U = i(() => I.value !== "" && I.value != null), W = i(() => D.clearable && U.value && !D.disabled), G = i(() => D.loading || W.value || !!A.trailing), K = i(() =>
|
|
86
|
+
let U = i(() => I.value !== "" && I.value != null), W = i(() => D.clearable && U.value && !D.disabled), G = i(() => D.loading || W.value || !!A.trailing), K = i(() => r({
|
|
85
87
|
size: D.size,
|
|
86
88
|
invalid: N.value
|
|
87
89
|
}));
|
|
@@ -57,7 +57,9 @@ var M = [
|
|
|
57
57
|
}),
|
|
58
58
|
emits: ["update:modelValue"],
|
|
59
59
|
setup(_) {
|
|
60
|
-
let v = _, F = w(_, "modelValue"), I = n(), L = f(() => v.id ?? I?.id.value)
|
|
60
|
+
let v = _, F = w(_, "modelValue"), I = n(), L = f(() => v.id ?? I?.id.value);
|
|
61
|
+
I && v.id && (I.id.value = v.id);
|
|
62
|
+
let R = f(() => v.invalid ?? I?.invalid.value ?? !1), z = e(), B = f(() => v.unstyled ?? z.unstyled), V = S(""), H = S(!1);
|
|
61
63
|
function U(e) {
|
|
62
64
|
return e ? v.locale ? o(e, v.locale, v.precision) : v.precision == null ? e : l(e, v.precision) ?? e : "";
|
|
63
65
|
}
|
|
@@ -55,6 +55,7 @@ declare const __VLS_base: import("vue").DefineComponent<PinInputProps, {}, {}, {
|
|
|
55
55
|
length: number;
|
|
56
56
|
unstyled: boolean;
|
|
57
57
|
separator: string;
|
|
58
|
+
invalid: boolean;
|
|
58
59
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
59
60
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
60
61
|
declare const _default: typeof __VLS_export;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { useIryxUiConfig as e } from "../config.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { useFormField as t } from "../composables/form.js";
|
|
3
|
+
import { pinInputTheme as n } from "../theme/pin-input.js";
|
|
4
|
+
import { Fragment as r, computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createTextVNode as c, createVNode as l, defineComponent as u, normalizeClass as d, openBlock as f, renderList as p, renderSlot as m, toDisplayString as h, unref as g, withCtx as _ } from "vue";
|
|
5
|
+
import { PinInputInput as v, PinInputRoot as y } from "reka-ui";
|
|
5
6
|
//#region src/components/PinInput.vue?vue&type=script&setup=true&lang.ts
|
|
6
|
-
var
|
|
7
|
+
var b = /*@__PURE__*/ u({
|
|
7
8
|
__name: "PinInput",
|
|
8
9
|
props: {
|
|
9
10
|
modelValue: {},
|
|
@@ -15,7 +16,10 @@ var y = /*@__PURE__*/ l({
|
|
|
15
16
|
groupSize: {},
|
|
16
17
|
separator: { default: "–" },
|
|
17
18
|
disabled: { type: Boolean },
|
|
18
|
-
invalid: {
|
|
19
|
+
invalid: {
|
|
20
|
+
type: Boolean,
|
|
21
|
+
default: void 0
|
|
22
|
+
},
|
|
19
23
|
size: {},
|
|
20
24
|
id: {},
|
|
21
25
|
unstyled: {
|
|
@@ -31,43 +35,47 @@ var y = /*@__PURE__*/ l({
|
|
|
31
35
|
ui: {}
|
|
32
36
|
},
|
|
33
37
|
emits: ["update:modelValue", "complete"],
|
|
34
|
-
setup(
|
|
35
|
-
let
|
|
36
|
-
let e =
|
|
37
|
-
return !e || e <= 0 ? /* @__PURE__ */ new Set() : new Set(
|
|
38
|
-
}),
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
38
|
+
setup(u, { emit: b }) {
|
|
39
|
+
let x = u, S = b, C = i(() => (x.modelValue ?? "").split("")), w = (e) => e.join(""), T = i(() => Array.from({ length: x.length }, (e, t) => t)), E = i(() => {
|
|
40
|
+
let e = x.groupSize;
|
|
41
|
+
return !e || e <= 0 ? /* @__PURE__ */ new Set() : new Set(T.value.filter((t) => (t + 1) % e === 0 && t !== x.length - 1));
|
|
42
|
+
}), D = t(), O = i(() => x.id ?? D?.id.value);
|
|
43
|
+
D && x.id && (D.id.value = x.id);
|
|
44
|
+
let k = i(() => x.invalid ?? D?.invalid.value ?? !1), A = e(), j = i(() => x.unstyled ?? A.unstyled), M = i(() => n({
|
|
45
|
+
size: x.size,
|
|
46
|
+
invalid: k.value
|
|
47
|
+
})), N = i(() => j.value ? [x.ui?.root, x.class] : M.value.root({ class: [x.ui?.root, x.class] })), P = i(() => j.value ? x.ui?.input : M.value.input({ class: x.ui?.input })), F = i(() => j.value ? x.ui?.separator : M.value.separator({ class: x.ui?.separator }));
|
|
48
|
+
return (e, t) => (f(), a(g(y), {
|
|
49
|
+
"aria-describedby": g(D)?.describedBy.value,
|
|
50
|
+
"model-value": C.value,
|
|
51
|
+
type: x.type,
|
|
52
|
+
mask: x.mask,
|
|
53
|
+
otp: x.otp,
|
|
54
|
+
placeholder: x.placeholder,
|
|
55
|
+
disabled: x.disabled,
|
|
56
|
+
class: d(N.value),
|
|
57
|
+
"onUpdate:modelValue": t[0] ||= (e) => S("update:modelValue", w(e)),
|
|
58
|
+
onComplete: t[1] ||= (e) => S("complete", w(e))
|
|
53
59
|
}, {
|
|
54
|
-
default:
|
|
60
|
+
default: _(() => [(f(!0), s(r, null, p(T.value, (t) => (f(), s(r, { key: t }, [l(g(v), {
|
|
61
|
+
id: t === 0 ? O.value : void 0,
|
|
55
62
|
index: t,
|
|
56
63
|
spellcheck: "false",
|
|
57
|
-
"aria-invalid":
|
|
58
|
-
class:
|
|
64
|
+
"aria-invalid": k.value || void 0,
|
|
65
|
+
class: d(P.value)
|
|
59
66
|
}, null, 8, [
|
|
67
|
+
"id",
|
|
60
68
|
"index",
|
|
61
69
|
"aria-invalid",
|
|
62
70
|
"class"
|
|
63
|
-
]),
|
|
71
|
+
]), E.value.has(t) ? (f(), s("span", {
|
|
64
72
|
key: 0,
|
|
65
|
-
class:
|
|
73
|
+
class: d(F.value),
|
|
66
74
|
"aria-hidden": "true"
|
|
67
|
-
}, [
|
|
75
|
+
}, [m(e.$slots, "separator", {}, () => [c(h(x.separator), 1)])], 2)) : o("", !0)], 64))), 128))]),
|
|
68
76
|
_: 3
|
|
69
77
|
}, 8, [
|
|
70
|
-
"
|
|
78
|
+
"aria-describedby",
|
|
71
79
|
"model-value",
|
|
72
80
|
"type",
|
|
73
81
|
"mask",
|
|
@@ -79,4 +87,4 @@ var y = /*@__PURE__*/ l({
|
|
|
79
87
|
}
|
|
80
88
|
});
|
|
81
89
|
//#endregion
|
|
82
|
-
export {
|
|
90
|
+
export { b as default };
|
|
@@ -11,6 +11,8 @@ export interface RadioGroupProps extends RadioGroupRootProps {
|
|
|
11
11
|
/** Options to render. Strings are expanded to `{ label, value }`. */
|
|
12
12
|
items?: (RadioGroupItemOption | string)[];
|
|
13
13
|
size?: 'sm' | 'md' | 'lg';
|
|
14
|
+
/** Mark as failing validation. Taken from the enclosing `IFormField` when omitted. */
|
|
15
|
+
invalid?: boolean;
|
|
14
16
|
/** Skip built-in classes; you take over styling entirely. */
|
|
15
17
|
unstyled?: boolean;
|
|
16
18
|
class?: ClassValue;
|
|
@@ -31,6 +33,7 @@ declare const __VLS_base: import("vue").DefineComponent<RadioGroupProps, {}, {},
|
|
|
31
33
|
"onUpdate:modelValue"?: ((payload: import("reka-ui").AcceptableValue) => any) | undefined;
|
|
32
34
|
}>, {
|
|
33
35
|
unstyled: boolean;
|
|
36
|
+
invalid: boolean;
|
|
34
37
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
35
38
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
36
39
|
declare const _default: typeof __VLS_export;
|
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
import { useIryxUiConfig as e } from "../config.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { useFormField as t } from "../composables/form.js";
|
|
3
|
+
import { radioGroupTheme as n } from "../theme/radio-group.js";
|
|
4
|
+
import { Fragment as r, computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createTextVNode as l, createVNode as u, defineComponent as d, mergeProps as f, normalizeClass as p, openBlock as m, renderList as h, renderSlot as g, toDisplayString as _, unref as v, withCtx as y } from "vue";
|
|
5
|
+
import { Label as b, RadioGroupIndicator as x, RadioGroupItem as S, RadioGroupRoot as C, useForwardPropsEmits as w, useId as T } from "reka-ui";
|
|
5
6
|
//#region src/components/RadioGroup.vue?vue&type=script&setup=true&lang.ts
|
|
6
|
-
var
|
|
7
|
+
var E = ["id"], D = /*@__PURE__*/ d({
|
|
7
8
|
__name: "RadioGroup",
|
|
8
9
|
props: {
|
|
9
10
|
items: {},
|
|
10
11
|
size: {},
|
|
12
|
+
invalid: {
|
|
13
|
+
type: Boolean,
|
|
14
|
+
default: void 0
|
|
15
|
+
},
|
|
11
16
|
unstyled: {
|
|
12
17
|
type: Boolean,
|
|
13
18
|
default: void 0
|
|
@@ -31,29 +36,37 @@ var T = ["id"], E = /*@__PURE__*/ u({
|
|
|
31
36
|
required: { type: Boolean }
|
|
32
37
|
},
|
|
33
38
|
emits: ["update:modelValue"],
|
|
34
|
-
setup(
|
|
35
|
-
let
|
|
36
|
-
let { items: e, size: t,
|
|
37
|
-
return
|
|
38
|
-
}),
|
|
39
|
+
setup(d, { emit: D }) {
|
|
40
|
+
let O = d, k = D, A = w(i(() => {
|
|
41
|
+
let { items: e, size: t, invalid: n, unstyled: r, class: i, ui: a, ...o } = O;
|
|
42
|
+
return o;
|
|
43
|
+
}), k), j = i(() => (O.items ?? []).map((e) => typeof e == "string" ? {
|
|
39
44
|
label: e,
|
|
40
45
|
value: e
|
|
41
|
-
} : e)),
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
46
|
+
} : e)), M = T(), N = t();
|
|
47
|
+
N && (N.id.value = void 0);
|
|
48
|
+
let P = i(() => O.invalid ?? N?.invalid.value ?? !1), F = e(), I = i(() => O.unstyled ?? F.unstyled), L = i(() => n({
|
|
49
|
+
size: O.size,
|
|
50
|
+
orientation: O.orientation ?? "vertical",
|
|
51
|
+
invalid: P.value
|
|
52
|
+
})), R = i(() => I.value ? [O.ui?.root, O.class] : L.value.root({ class: [O.ui?.root, O.class] })), z = i(() => I.value ? O.ui?.item : L.value.item({ class: O.ui?.item })), B = i(() => I.value ? O.ui?.label : L.value.label({ class: O.ui?.label })), V = i(() => I.value ? O.ui?.description : L.value.description({ class: O.ui?.description }));
|
|
53
|
+
return (e, t) => (m(), a(v(C), f(v(A), {
|
|
54
|
+
"aria-labelledby": v(N)?.labelId.value,
|
|
55
|
+
"aria-invalid": P.value || void 0,
|
|
56
|
+
"aria-describedby": v(N)?.describedBy.value,
|
|
57
|
+
class: R.value
|
|
58
|
+
}), {
|
|
59
|
+
default: y(() => [g(e.$slots, "default", {}, () => [(m(!0), s(r, null, h(j.value, (e) => (m(), s("div", {
|
|
47
60
|
key: e.value,
|
|
48
|
-
class:
|
|
49
|
-
}, [
|
|
50
|
-
id: `${
|
|
61
|
+
class: p(I.value ? void 0 : L.value.wrapper())
|
|
62
|
+
}, [u(v(S), {
|
|
63
|
+
id: `${v(M)}-${e.value}`,
|
|
51
64
|
value: e.value,
|
|
52
65
|
disabled: e.disabled,
|
|
53
|
-
"aria-describedby": e.description ? `${
|
|
54
|
-
class:
|
|
66
|
+
"aria-describedby": e.description ? `${v(M)}-${e.value}-description` : void 0,
|
|
67
|
+
class: p(z.value)
|
|
55
68
|
}, {
|
|
56
|
-
default:
|
|
69
|
+
default: y(() => [u(v(x), { class: p(I.value ? void 0 : L.value.indicator()) }, null, 8, ["class"])]),
|
|
57
70
|
_: 1
|
|
58
71
|
}, 8, [
|
|
59
72
|
"id",
|
|
@@ -61,20 +74,25 @@ var T = ["id"], E = /*@__PURE__*/ u({
|
|
|
61
74
|
"disabled",
|
|
62
75
|
"aria-describedby",
|
|
63
76
|
"class"
|
|
64
|
-
]),
|
|
65
|
-
for: `${
|
|
66
|
-
class:
|
|
77
|
+
]), c("div", { class: p(I.value ? void 0 : L.value.content()) }, [u(v(b), {
|
|
78
|
+
for: `${v(M)}-${e.value}`,
|
|
79
|
+
class: p(B.value)
|
|
67
80
|
}, {
|
|
68
|
-
default:
|
|
81
|
+
default: y(() => [l(_(e.label), 1)]),
|
|
69
82
|
_: 2
|
|
70
|
-
}, 1032, ["for", "class"]), e.description ? (
|
|
83
|
+
}, 1032, ["for", "class"]), e.description ? (m(), s("p", {
|
|
71
84
|
key: 0,
|
|
72
|
-
id: `${
|
|
73
|
-
class:
|
|
74
|
-
},
|
|
85
|
+
id: `${v(M)}-${e.value}-description`,
|
|
86
|
+
class: p(V.value)
|
|
87
|
+
}, _(e.description), 11, E)) : o("", !0)], 2)], 2))), 128))])]),
|
|
75
88
|
_: 3
|
|
76
|
-
}, 16, [
|
|
89
|
+
}, 16, [
|
|
90
|
+
"aria-labelledby",
|
|
91
|
+
"aria-invalid",
|
|
92
|
+
"aria-describedby",
|
|
93
|
+
"class"
|
|
94
|
+
]));
|
|
77
95
|
}
|
|
78
96
|
});
|
|
79
97
|
//#endregion
|
|
80
|
-
export {
|
|
98
|
+
export { D as default };
|
|
@@ -21,6 +21,8 @@ export interface SelectProps extends SelectRootProps {
|
|
|
21
21
|
size?: 'sm' | 'md' | 'lg';
|
|
22
22
|
/** Lands on the trigger, so a `<label for>` names the control. */
|
|
23
23
|
id?: string;
|
|
24
|
+
/** Mark as failing validation. Taken from the enclosing `IFormField` when omitted. */
|
|
25
|
+
invalid?: boolean;
|
|
24
26
|
/** Skip built-in classes; you take over styling entirely. */
|
|
25
27
|
unstyled?: boolean;
|
|
26
28
|
class?: ClassValue;
|
|
@@ -45,6 +47,7 @@ declare const __VLS_base: import("vue").DefineComponent<SelectProps, {}, {}, {},
|
|
|
45
47
|
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
46
48
|
}>, {
|
|
47
49
|
unstyled: boolean;
|
|
50
|
+
invalid: boolean;
|
|
48
51
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
49
52
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
50
53
|
declare const _default: typeof __VLS_export;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { useIryxUiConfig as e } from "../config.js";
|
|
2
2
|
import t from "./Icon.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
3
|
+
import { useFormField as n } from "../composables/form.js";
|
|
4
|
+
import { selectTheme as r } from "../theme/select.js";
|
|
5
|
+
import { Fragment as i, computed as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createTextVNode as l, createVNode as u, defineComponent as d, guardReactiveProps as f, mergeProps as p, normalizeClass as m, normalizeProps as h, openBlock as g, renderList as _, renderSlot as v, toDisplayString as y, unref as b, withCtx as x } from "vue";
|
|
6
|
+
import { ArrowDown01Icon as S, Tick02Icon as C } from "@hugeicons/core-free-icons";
|
|
7
|
+
import { SelectContent as w, SelectGroup as T, SelectIcon as E, SelectItem as D, SelectItemIndicator as O, SelectItemText as k, SelectLabel as A, SelectPortal as ee, SelectRoot as te, SelectTrigger as j, SelectValue as M, SelectViewport as N, useForwardPropsEmits as P } from "reka-ui";
|
|
7
8
|
//#region src/components/Select.vue?vue&type=script&setup=true&lang.ts
|
|
8
|
-
var
|
|
9
|
+
var F = /*@__PURE__*/ d({
|
|
9
10
|
inheritAttrs: !1,
|
|
10
11
|
__name: "Select",
|
|
11
12
|
props: {
|
|
@@ -13,6 +14,10 @@ var I = /*@__PURE__*/ u({
|
|
|
13
14
|
placeholder: {},
|
|
14
15
|
size: {},
|
|
15
16
|
id: {},
|
|
17
|
+
invalid: {
|
|
18
|
+
type: Boolean,
|
|
19
|
+
default: void 0
|
|
20
|
+
},
|
|
16
21
|
unstyled: {
|
|
17
22
|
type: Boolean,
|
|
18
23
|
default: void 0
|
|
@@ -38,67 +43,81 @@ var I = /*@__PURE__*/ u({
|
|
|
38
43
|
required: { type: Boolean }
|
|
39
44
|
},
|
|
40
45
|
emits: ["update:modelValue", "update:open"],
|
|
41
|
-
setup(
|
|
42
|
-
let
|
|
43
|
-
let { items: e, placeholder: t, size: n, id: r,
|
|
44
|
-
return
|
|
45
|
-
}),
|
|
46
|
-
function
|
|
46
|
+
setup(d, { emit: F }) {
|
|
47
|
+
let I = d, L = F, R = P(a(() => {
|
|
48
|
+
let { items: e, placeholder: t, size: n, id: r, invalid: i, unstyled: a, class: o, ui: s, ...c } = I;
|
|
49
|
+
return c;
|
|
50
|
+
}), L);
|
|
51
|
+
function z(e) {
|
|
47
52
|
return typeof e == "string" ? {
|
|
48
53
|
label: e,
|
|
49
54
|
value: e
|
|
50
55
|
} : e;
|
|
51
56
|
}
|
|
52
|
-
function
|
|
57
|
+
function B(e) {
|
|
53
58
|
return typeof e != "string" && "items" in e;
|
|
54
59
|
}
|
|
55
|
-
let
|
|
56
|
-
let e =
|
|
57
|
-
if (e.some(
|
|
60
|
+
let V = a(() => {
|
|
61
|
+
let e = I.items ?? [];
|
|
62
|
+
if (e.some(B)) return e.map((e) => B(e) ? {
|
|
58
63
|
label: e.label,
|
|
59
|
-
options: e.items.map(
|
|
64
|
+
options: e.items.map(z)
|
|
60
65
|
} : {
|
|
61
66
|
label: "",
|
|
62
|
-
options: [
|
|
67
|
+
options: [z(e)]
|
|
63
68
|
});
|
|
64
|
-
}),
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
69
|
+
}), H = a(() => (I.items ?? []).flatMap((e) => B(e) ? e.items.map(z) : [z(e)])), U = n(), W = a(() => I.id ?? U?.id.value);
|
|
70
|
+
U && I.id && (U.id.value = I.id);
|
|
71
|
+
let G = a(() => I.invalid ?? U?.invalid.value ?? !1), K = e(), q = a(() => I.unstyled ?? K.unstyled), J = a(() => r({
|
|
72
|
+
size: I.size,
|
|
73
|
+
invalid: G.value
|
|
74
|
+
})), Y = a(() => q.value ? [I.ui?.trigger, I.class] : J.value.trigger({ class: [I.ui?.trigger, I.class] })), X = a(() => q.value ? I.ui?.content : J.value.content({ class: I.ui?.content })), Z = a(() => q.value ? I.ui?.viewport : J.value.viewport({ class: I.ui?.viewport })), Q = a(() => q.value ? I.ui?.item : J.value.item({ class: I.ui?.item })), $ = a(() => q.value ? void 0 : J.value.itemIndicator()), ne = a(() => q.value ? I.ui?.group : J.value.group({ class: I.ui?.group })), re = a(() => q.value ? I.ui?.groupLabel : J.value.groupLabel({ class: I.ui?.groupLabel }));
|
|
75
|
+
return (e, n) => (g(), o(b(te), h(f(b(R))), {
|
|
76
|
+
default: x(() => [u(b(j), p({
|
|
77
|
+
id: W.value,
|
|
78
|
+
"aria-invalid": G.value || void 0,
|
|
79
|
+
"aria-describedby": b(U)?.describedBy.value
|
|
80
|
+
}, e.$attrs, { class: Y.value }), {
|
|
81
|
+
default: x(() => [u(b(M), {
|
|
68
82
|
class: "truncate",
|
|
69
|
-
placeholder:
|
|
70
|
-
}, null, 8, ["placeholder"]),
|
|
71
|
-
default:
|
|
83
|
+
placeholder: I.placeholder
|
|
84
|
+
}, null, 8, ["placeholder"]), u(b(E), { "as-child": "" }, {
|
|
85
|
+
default: x(() => [u(t, { icon: b(S) }, null, 8, ["icon"])]),
|
|
72
86
|
_: 1
|
|
73
87
|
})]),
|
|
74
88
|
_: 1
|
|
75
|
-
}, 16, [
|
|
76
|
-
|
|
77
|
-
|
|
89
|
+
}, 16, [
|
|
90
|
+
"id",
|
|
91
|
+
"aria-invalid",
|
|
92
|
+
"aria-describedby",
|
|
93
|
+
"class"
|
|
94
|
+
]), u(b(ee), null, {
|
|
95
|
+
default: x(() => [u(b(w), {
|
|
96
|
+
class: m(X.value),
|
|
78
97
|
position: "item-aligned"
|
|
79
98
|
}, {
|
|
80
|
-
default:
|
|
81
|
-
default:
|
|
99
|
+
default: x(() => [u(b(N), { class: m(Z.value) }, {
|
|
100
|
+
default: x(() => [v(e.$slots, "default", {}, () => [V.value ? (g(!0), c(i, { key: 0 }, _(V.value, (e, n) => (g(), o(b(T), {
|
|
82
101
|
key: e.label || n,
|
|
83
|
-
class:
|
|
102
|
+
class: m(ne.value)
|
|
84
103
|
}, {
|
|
85
|
-
default:
|
|
104
|
+
default: x(() => [e.label ? (g(), o(b(A), {
|
|
86
105
|
key: 0,
|
|
87
|
-
class:
|
|
106
|
+
class: m(re.value)
|
|
88
107
|
}, {
|
|
89
|
-
default:
|
|
108
|
+
default: x(() => [l(y(e.label), 1)]),
|
|
90
109
|
_: 2
|
|
91
|
-
}, 1032, ["class"])) :
|
|
110
|
+
}, 1032, ["class"])) : s("", !0), (g(!0), c(i, null, _(e.options, (e) => (g(), o(b(D), {
|
|
92
111
|
key: e.value,
|
|
93
112
|
value: e.value,
|
|
94
113
|
disabled: e.disabled,
|
|
95
|
-
class:
|
|
114
|
+
class: m(Q.value)
|
|
96
115
|
}, {
|
|
97
|
-
default:
|
|
98
|
-
default:
|
|
116
|
+
default: x(() => [u(b(O), { class: m($.value) }, {
|
|
117
|
+
default: x(() => [u(t, { icon: b(C) }, null, 8, ["icon"])]),
|
|
99
118
|
_: 1
|
|
100
|
-
}, 8, ["class"]),
|
|
101
|
-
default:
|
|
119
|
+
}, 8, ["class"]), u(b(k), null, {
|
|
120
|
+
default: x(() => [l(y(e.label), 1)]),
|
|
102
121
|
_: 2
|
|
103
122
|
}, 1024)]),
|
|
104
123
|
_: 2
|
|
@@ -108,17 +127,17 @@ var I = /*@__PURE__*/ u({
|
|
|
108
127
|
"class"
|
|
109
128
|
]))), 128))]),
|
|
110
129
|
_: 2
|
|
111
|
-
}, 1032, ["class"]))), 128)) : (
|
|
130
|
+
}, 1032, ["class"]))), 128)) : (g(!0), c(i, { key: 1 }, _(H.value, (e) => (g(), o(b(D), {
|
|
112
131
|
key: e.value,
|
|
113
132
|
value: e.value,
|
|
114
133
|
disabled: e.disabled,
|
|
115
|
-
class:
|
|
134
|
+
class: m(Q.value)
|
|
116
135
|
}, {
|
|
117
|
-
default:
|
|
118
|
-
default:
|
|
136
|
+
default: x(() => [u(b(O), { class: m($.value) }, {
|
|
137
|
+
default: x(() => [u(t, { icon: b(C) }, null, 8, ["icon"])]),
|
|
119
138
|
_: 1
|
|
120
|
-
}, 8, ["class"]),
|
|
121
|
-
default:
|
|
139
|
+
}, 8, ["class"]), u(b(k), null, {
|
|
140
|
+
default: x(() => [l(y(e.label), 1)]),
|
|
122
141
|
_: 2
|
|
123
142
|
}, 1024)]),
|
|
124
143
|
_: 2
|
|
@@ -138,4 +157,4 @@ var I = /*@__PURE__*/ u({
|
|
|
138
157
|
}
|
|
139
158
|
});
|
|
140
159
|
//#endregion
|
|
141
|
-
export {
|
|
160
|
+
export { F as default };
|
|
@@ -54,7 +54,9 @@ var x = [
|
|
|
54
54
|
"clear"
|
|
55
55
|
],
|
|
56
56
|
setup(d, { expose: w, emit: T }) {
|
|
57
|
-
let E = d, D = T, O = _(), k = _([]), A = !1, j = 0, M = () => k.value.at(-1), N = r(), P = s(() => E.id ?? N?.id.value)
|
|
57
|
+
let E = d, D = T, O = _(), k = _([]), A = !1, j = 0, M = () => k.value.at(-1), N = r(), P = s(() => E.id ?? N?.id.value);
|
|
58
|
+
N && E.id && (N.id.value = E.id);
|
|
59
|
+
let F = s(() => E.invalid ?? N?.invalid.value ?? !1), I = s(() => !i(k.value));
|
|
58
60
|
function L() {
|
|
59
61
|
if (E.penColor !== "currentColor") return E.penColor;
|
|
60
62
|
let e = O.value;
|