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
|
@@ -7,6 +7,8 @@ export interface CheckboxProps extends CheckboxRootProps {
|
|
|
7
7
|
description?: string;
|
|
8
8
|
size?: 'sm' | 'md' | 'lg';
|
|
9
9
|
id?: string;
|
|
10
|
+
/** Mark as failing validation. Taken from the enclosing `IFormField` when omitted. */
|
|
11
|
+
invalid?: boolean;
|
|
10
12
|
/** Skip built-in classes; you take over styling entirely. */
|
|
11
13
|
unstyled?: boolean;
|
|
12
14
|
class?: ClassValue;
|
|
@@ -36,6 +38,7 @@ declare const __VLS_base: import("vue").DefineComponent<CheckboxProps, {}, {}, {
|
|
|
36
38
|
"onUpdate:modelValue"?: ((value: boolean | "indeterminate") => any) | undefined;
|
|
37
39
|
}>, {
|
|
38
40
|
unstyled: boolean;
|
|
41
|
+
invalid: boolean;
|
|
39
42
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
40
43
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
41
44
|
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 { checkboxTheme as r } from "../theme/checkbox.js";
|
|
5
|
+
import { 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, renderSlot as h, toDisplayString as g, unref as _, withCtx as v } from "vue";
|
|
6
|
+
import { MinusSignIcon as y, Tick02Icon as b } from "@hugeicons/core-free-icons";
|
|
7
|
+
import { CheckboxIndicator as x, CheckboxRoot as S, Label as C, useForwardPropsEmits as w, useId as T } from "reka-ui";
|
|
7
8
|
//#region src/components/Checkbox.vue?vue&type=script&setup=true&lang.ts
|
|
8
|
-
var
|
|
9
|
+
var E = ["id"], D = /*@__PURE__*/ d({
|
|
9
10
|
inheritAttrs: !1,
|
|
10
11
|
__name: "Checkbox",
|
|
11
12
|
props: {
|
|
@@ -13,6 +14,10 @@ var T = ["id"], E = /*@__PURE__*/ u({
|
|
|
13
14
|
description: {},
|
|
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
|
|
@@ -36,69 +41,81 @@ var T = ["id"], E = /*@__PURE__*/ u({
|
|
|
36
41
|
required: { type: Boolean }
|
|
37
42
|
},
|
|
38
43
|
emits: ["update:modelValue"],
|
|
39
|
-
setup(
|
|
40
|
-
let
|
|
41
|
-
let { label: e, description: t, size: n, id: r,
|
|
42
|
-
return
|
|
43
|
-
}),
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
44
|
+
setup(d, { emit: D }) {
|
|
45
|
+
let O = d, k = D, A = w(i(() => {
|
|
46
|
+
let { label: e, description: t, size: n, id: r, invalid: i, unstyled: a, class: o, ui: s, ...c } = O;
|
|
47
|
+
return c;
|
|
48
|
+
}), k), j = T(), M = n(), N = i(() => O.invalid ?? M?.invalid.value ?? !1), P = i(() => O.id ?? M?.id.value ?? j);
|
|
49
|
+
M && (M.id.value = P.value);
|
|
50
|
+
let F = i(() => !!(O.label || O.description)), I = e(), L = i(() => O.unstyled ?? I.unstyled), R = i(() => r({
|
|
51
|
+
size: O.size,
|
|
52
|
+
withText: F.value,
|
|
53
|
+
invalid: N.value
|
|
54
|
+
})), z = i(() => L.value ? O.ui?.wrapper : R.value.wrapper({ class: O.ui?.wrapper })), B = i(() => L.value ? [O.ui?.root, O.class] : R.value.root({ class: [O.ui?.root, O.class] })), V = i(() => L.value ? O.ui?.indicator : R.value.indicator({ class: O.ui?.indicator })), H = i(() => L.value ? O.ui?.content : R.value.content({ class: O.ui?.content })), U = i(() => L.value ? O.ui?.label : R.value.label({ class: O.ui?.label })), W = i(() => L.value ? O.ui?.description : R.value.description({ class: O.ui?.description }));
|
|
55
|
+
return (e, n) => F.value ? (m(), s("div", {
|
|
48
56
|
key: 0,
|
|
49
|
-
class:
|
|
50
|
-
}, [
|
|
51
|
-
...
|
|
57
|
+
class: p(z.value)
|
|
58
|
+
}, [u(_(S), f({ id: P.value }, {
|
|
59
|
+
..._(A),
|
|
52
60
|
...e.$attrs
|
|
53
61
|
}, {
|
|
54
|
-
"aria-
|
|
55
|
-
|
|
62
|
+
"aria-invalid": N.value || void 0,
|
|
63
|
+
"aria-describedby": O.description ? `${P.value}-description` : void 0,
|
|
64
|
+
class: B.value
|
|
56
65
|
}), {
|
|
57
|
-
default:
|
|
58
|
-
default:
|
|
66
|
+
default: v(() => [u(_(x), { class: p(V.value) }, {
|
|
67
|
+
default: v(() => [h(e.$slots, "default", {}, () => [O.modelValue === "indeterminate" ? (m(), a(t, {
|
|
59
68
|
key: 0,
|
|
60
|
-
icon:
|
|
61
|
-
}, null, 8, ["icon"])) : (
|
|
69
|
+
icon: _(y)
|
|
70
|
+
}, null, 8, ["icon"])) : (m(), a(t, {
|
|
62
71
|
key: 1,
|
|
63
|
-
icon:
|
|
72
|
+
icon: _(b)
|
|
64
73
|
}, null, 8, ["icon"]))])]),
|
|
65
74
|
_: 3
|
|
66
75
|
}, 8, ["class"])]),
|
|
67
76
|
_: 3
|
|
68
77
|
}, 16, [
|
|
69
78
|
"id",
|
|
79
|
+
"aria-invalid",
|
|
70
80
|
"aria-describedby",
|
|
71
81
|
"class"
|
|
72
|
-
]),
|
|
73
|
-
for:
|
|
74
|
-
class:
|
|
82
|
+
]), c("div", { class: p(H.value) }, [u(_(C), {
|
|
83
|
+
for: P.value,
|
|
84
|
+
class: p(U.value)
|
|
75
85
|
}, {
|
|
76
|
-
default:
|
|
86
|
+
default: v(() => [h(e.$slots, "label", {}, () => [l(g(O.label), 1)])]),
|
|
77
87
|
_: 3
|
|
78
|
-
}, 8, ["for", "class"]),
|
|
88
|
+
}, 8, ["for", "class"]), O.description || e.$slots.description ? (m(), s("p", {
|
|
79
89
|
key: 0,
|
|
80
|
-
id: `${
|
|
81
|
-
class:
|
|
82
|
-
}, [
|
|
90
|
+
id: `${P.value}-description`,
|
|
91
|
+
class: p(W.value)
|
|
92
|
+
}, [h(e.$slots, "description", {}, () => [l(g(O.description), 1)])], 10, E)) : o("", !0)], 2)], 2)) : (m(), a(_(S), f({
|
|
83
93
|
key: 1,
|
|
84
|
-
id:
|
|
94
|
+
id: P.value
|
|
85
95
|
}, {
|
|
86
|
-
...
|
|
96
|
+
..._(A),
|
|
87
97
|
...e.$attrs
|
|
88
|
-
}, {
|
|
89
|
-
|
|
90
|
-
|
|
98
|
+
}, {
|
|
99
|
+
"aria-invalid": N.value || void 0,
|
|
100
|
+
class: B.value
|
|
101
|
+
}), {
|
|
102
|
+
default: v(() => [u(_(x), { class: p(V.value) }, {
|
|
103
|
+
default: v(() => [h(e.$slots, "default", {}, () => [O.modelValue === "indeterminate" ? (m(), a(t, {
|
|
91
104
|
key: 0,
|
|
92
|
-
icon:
|
|
93
|
-
}, null, 8, ["icon"])) : (
|
|
105
|
+
icon: _(y)
|
|
106
|
+
}, null, 8, ["icon"])) : (m(), a(t, {
|
|
94
107
|
key: 1,
|
|
95
|
-
icon:
|
|
108
|
+
icon: _(b)
|
|
96
109
|
}, null, 8, ["icon"]))])]),
|
|
97
110
|
_: 3
|
|
98
111
|
}, 8, ["class"])]),
|
|
99
112
|
_: 3
|
|
100
|
-
}, 16, [
|
|
113
|
+
}, 16, [
|
|
114
|
+
"id",
|
|
115
|
+
"aria-invalid",
|
|
116
|
+
"class"
|
|
117
|
+
]));
|
|
101
118
|
}
|
|
102
119
|
});
|
|
103
120
|
//#endregion
|
|
104
|
-
export {
|
|
121
|
+
export { D as default };
|
|
@@ -167,7 +167,9 @@ var E = /*@__PURE__*/ u({
|
|
|
167
167
|
bubbles: !0
|
|
168
168
|
}));
|
|
169
169
|
}
|
|
170
|
-
let q = n(), J = i(() => D.id ?? q?.id.value)
|
|
170
|
+
let q = n(), J = i(() => D.id ?? q?.id.value);
|
|
171
|
+
q && D.id && (q.id.value = D.id);
|
|
172
|
+
let Y = i(() => D.invalid ?? q?.invalid.value ?? !1), Oe = e(), X = i(() => D.unstyled ?? Oe.unstyled), Z = i(() => ee({
|
|
171
173
|
size: D.size,
|
|
172
174
|
chips: H.value,
|
|
173
175
|
invalid: Y.value,
|
|
@@ -79,7 +79,8 @@ var B = /*@__PURE__*/ h({
|
|
|
79
79
|
default: O(() => [m(T(ne), null, {
|
|
80
80
|
default: O(() => [m(T(te), { class: _($("overlay")) }, null, 8, ["class"]), m(T(ee), {
|
|
81
81
|
class: _(Z.value ? [B.ui?.content, B.class] : Q.value.content({ class: [B.ui?.content, B.class] })),
|
|
82
|
-
"aria-label": B.label
|
|
82
|
+
"aria-label": B.label,
|
|
83
|
+
"aria-describedby": void 0
|
|
83
84
|
}, {
|
|
84
85
|
default: O(() => [
|
|
85
86
|
m(T(R), null, {
|
|
@@ -37,7 +37,9 @@ var y = /*@__PURE__*/ u({
|
|
|
37
37
|
},
|
|
38
38
|
emits: ["update:modelValue"],
|
|
39
39
|
setup(u, { emit: y }) {
|
|
40
|
-
let b = u, x = y, S = r(), C = o(() => b.id ?? S?.id.value)
|
|
40
|
+
let b = u, x = y, S = r(), C = o(() => b.id ?? S?.id.value);
|
|
41
|
+
S && b.id && (S.id.value = b.id);
|
|
42
|
+
let w = o(() => {
|
|
41
43
|
let e = b.modelValue;
|
|
42
44
|
return !e || !t(e) ? !1 : b.minValue && e < b.minValue || b.maxValue && e > b.maxValue ? !0 : b.isUnavailable?.(e) ?? !1;
|
|
43
45
|
}), T = o(() => (b.invalid ?? S?.invalid.value ?? !1) || w.value), E = e(), D = o(() => b.unstyled ?? E.unstyled), O = o(() => {
|
|
@@ -52,7 +52,9 @@ var D = [
|
|
|
52
52
|
}),
|
|
53
53
|
emits: ["update:modelValue"],
|
|
54
54
|
setup(p) {
|
|
55
|
-
let m = p, k = b(p, "modelValue"), A = _(!1), j = a(), M = s(() => m.id ?? j?.id.value)
|
|
55
|
+
let m = p, k = b(p, "modelValue"), A = _(!1), j = a(), M = s(() => m.id ?? j?.id.value);
|
|
56
|
+
j && m.id && (j.id.value = m.id);
|
|
57
|
+
let N = s(() => m.invalid ?? j?.invalid.value ?? !1), P = e(), F = s(() => m.unstyled ?? P.unstyled), I = s(() => n(k.value, m.locale, m.format));
|
|
56
58
|
function L() {
|
|
57
59
|
k.value = r(), A.value = !1;
|
|
58
60
|
}
|
|
@@ -2,10 +2,10 @@ import { useIryxUiConfig as e } from "../config.js";
|
|
|
2
2
|
import t from "./Icon.js";
|
|
3
3
|
import { formatIsoDate as n, toCalendarDate as r, toIsoDate as i } from "../composables/date.js";
|
|
4
4
|
import { calendarTheme as ee } from "../theme/calendar.js";
|
|
5
|
-
import { useFormField as
|
|
6
|
-
import { datePickerTheme as
|
|
7
|
-
import { Fragment as
|
|
8
|
-
import { ArrowLeft01Icon as
|
|
5
|
+
import { useFormField as te } from "../composables/form.js";
|
|
6
|
+
import { datePickerTheme as a } from "../theme/date-picker.js";
|
|
7
|
+
import { Fragment as o, computed as s, createBlock as c, createCommentVNode as l, createElementBlock as u, createElementVNode as d, createTextVNode as f, createVNode as p, defineComponent as m, mergeModels as h, normalizeClass as g, openBlock as _, ref as v, renderList as y, shallowRef as b, toDisplayString as x, unref as S, useModel as C, watch as w, withCtx as T } from "vue";
|
|
8
|
+
import { ArrowLeft01Icon as E, ArrowRight01Icon as ne, Calendar03Icon as re } from "@hugeicons/core-free-icons";
|
|
9
9
|
import { PopoverContent as D, PopoverPortal as O, PopoverRoot as k, PopoverTrigger as A, RangeCalendarCell as j, RangeCalendarCellTrigger as M, RangeCalendarGrid as N, RangeCalendarGridBody as P, RangeCalendarGridHead as F, RangeCalendarGridRow as I, RangeCalendarHeadCell as L, RangeCalendarHeader as R, RangeCalendarHeading as z, RangeCalendarNext as B, RangeCalendarPrev as V, RangeCalendarRoot as ie } from "reka-ui";
|
|
10
10
|
//#region src/components/DateRangePicker.vue?vue&type=script&setup=true&lang.ts
|
|
11
11
|
var H = [
|
|
@@ -13,9 +13,9 @@ var H = [
|
|
|
13
13
|
"disabled",
|
|
14
14
|
"aria-invalid",
|
|
15
15
|
"aria-describedby"
|
|
16
|
-
], U = { key: 0 }, W = /*@__PURE__*/
|
|
16
|
+
], U = { key: 0 }, W = /*@__PURE__*/ m({
|
|
17
17
|
__name: "DateRangePicker",
|
|
18
|
-
props: /*@__PURE__*/
|
|
18
|
+
props: /*@__PURE__*/ h({
|
|
19
19
|
size: {},
|
|
20
20
|
placeholder: { default: "Pick a date range" },
|
|
21
21
|
disabled: { type: Boolean },
|
|
@@ -54,30 +54,32 @@ var H = [
|
|
|
54
54
|
modelModifiers: {}
|
|
55
55
|
}),
|
|
56
56
|
emits: ["update:modelValue"],
|
|
57
|
-
setup(
|
|
58
|
-
let
|
|
57
|
+
setup(m) {
|
|
58
|
+
let h = m, W = C(m, "modelValue"), G = v(!1), K = te(), q = s(() => h.id ?? K?.id.value);
|
|
59
|
+
K && h.id && (K.id.value = h.id);
|
|
60
|
+
let J = s(() => h.invalid ?? K?.invalid.value ?? !1), Y = e(), ae = s(() => h.unstyled ?? Y.unstyled), X = b({
|
|
59
61
|
start: r(W.value?.start),
|
|
60
62
|
end: r(W.value?.end)
|
|
61
63
|
});
|
|
62
64
|
function Z(e) {
|
|
63
65
|
return i(e.start) === (W.value?.start ?? null) && i(e.end) === (W.value?.end ?? null);
|
|
64
66
|
}
|
|
65
|
-
|
|
67
|
+
w(W, () => {
|
|
66
68
|
Z(X.value) || (X.value = {
|
|
67
69
|
start: r(W.value?.start),
|
|
68
70
|
end: r(W.value?.end)
|
|
69
71
|
});
|
|
70
|
-
}, { deep: !0 }),
|
|
72
|
+
}, { deep: !0 }), w(X, (e) => {
|
|
71
73
|
Z(e) || (W.value = {
|
|
72
74
|
start: i(e.start),
|
|
73
75
|
end: i(e.end)
|
|
74
76
|
});
|
|
75
77
|
});
|
|
76
|
-
let oe =
|
|
77
|
-
let e = n(W.value?.start,
|
|
78
|
-
return !e && !t ? "" : t ? `${e}${
|
|
78
|
+
let oe = s(() => r(h.min)), se = s(() => r(h.max)), Q = s(() => {
|
|
79
|
+
let e = n(W.value?.start, h.locale, h.format), t = n(W.value?.end, h.locale, h.format);
|
|
80
|
+
return !e && !t ? "" : t ? `${e}${h.separator}${t}` : e;
|
|
79
81
|
});
|
|
80
|
-
|
|
82
|
+
w(W, (e) => {
|
|
81
83
|
G.value && e?.start && e?.end && (G.value = !1);
|
|
82
84
|
}, { deep: !0 });
|
|
83
85
|
function ce() {
|
|
@@ -86,97 +88,97 @@ var H = [
|
|
|
86
88
|
end: null
|
|
87
89
|
}, G.value = !1;
|
|
88
90
|
}
|
|
89
|
-
let le =
|
|
90
|
-
...
|
|
91
|
-
size:
|
|
91
|
+
let le = s(() => ({
|
|
92
|
+
...a({
|
|
93
|
+
size: h.size,
|
|
92
94
|
invalid: J.value
|
|
93
95
|
}),
|
|
94
96
|
...ee({ range: !0 })
|
|
95
97
|
}));
|
|
96
98
|
function $(e, t) {
|
|
97
|
-
let n =
|
|
99
|
+
let n = h.ui?.[e];
|
|
98
100
|
return ae.value ? [n, t] : le.value[e]({ class: [n, t] });
|
|
99
101
|
}
|
|
100
|
-
return (e, n) => (
|
|
102
|
+
return (e, n) => (_(), c(S(k), {
|
|
101
103
|
open: G.value,
|
|
102
104
|
"onUpdate:open": n[1] ||= (e) => G.value = e
|
|
103
105
|
}, {
|
|
104
|
-
default:
|
|
105
|
-
default:
|
|
106
|
+
default: T(() => [p(S(A), { "as-child": "" }, {
|
|
107
|
+
default: T(() => [d("button", {
|
|
106
108
|
id: q.value,
|
|
107
109
|
type: "button",
|
|
108
|
-
disabled:
|
|
110
|
+
disabled: h.disabled,
|
|
109
111
|
"aria-invalid": J.value || void 0,
|
|
110
|
-
"aria-describedby":
|
|
111
|
-
class:
|
|
112
|
-
}, [Q.value ? (
|
|
112
|
+
"aria-describedby": S(K)?.describedBy.value,
|
|
113
|
+
class: g($("trigger", h.class))
|
|
114
|
+
}, [Q.value ? (_(), u("span", U, x(Q.value), 1)) : (_(), u("span", {
|
|
113
115
|
key: 1,
|
|
114
|
-
class:
|
|
115
|
-
},
|
|
116
|
+
class: g($("placeholder"))
|
|
117
|
+
}, x(h.placeholder), 3)), p(t, { icon: S(re) }, null, 8, ["icon"])], 10, H)]),
|
|
116
118
|
_: 1
|
|
117
|
-
}),
|
|
118
|
-
default:
|
|
119
|
-
class:
|
|
119
|
+
}), p(S(O), null, {
|
|
120
|
+
default: T(() => [p(S(D), {
|
|
121
|
+
class: g($("content")),
|
|
120
122
|
"side-offset": 4,
|
|
121
123
|
align: "start"
|
|
122
124
|
}, {
|
|
123
|
-
default:
|
|
125
|
+
default: T(() => [p(S(ie), {
|
|
124
126
|
modelValue: X.value,
|
|
125
127
|
"onUpdate:modelValue": n[0] ||= (e) => X.value = e,
|
|
126
128
|
"min-value": oe.value,
|
|
127
129
|
"max-value": se.value,
|
|
128
|
-
locale:
|
|
129
|
-
"week-starts-on":
|
|
130
|
-
"number-of-months":
|
|
130
|
+
locale: h.locale,
|
|
131
|
+
"week-starts-on": h.weekStartsOn,
|
|
132
|
+
"number-of-months": h.months,
|
|
131
133
|
"fixed-weeks": "",
|
|
132
134
|
"initial-focus": ""
|
|
133
135
|
}, {
|
|
134
|
-
default:
|
|
135
|
-
default:
|
|
136
|
-
|
|
137
|
-
"aria-label":
|
|
138
|
-
class:
|
|
136
|
+
default: T(({ grid: e, weekDays: n }) => [p(S(R), { class: g($("header")) }, {
|
|
137
|
+
default: T(() => [
|
|
138
|
+
p(S(V), {
|
|
139
|
+
"aria-label": h.previousLabel,
|
|
140
|
+
class: g($("nav"))
|
|
139
141
|
}, {
|
|
140
|
-
default:
|
|
142
|
+
default: T(() => [p(t, { icon: S(E) }, null, 8, ["icon"])]),
|
|
141
143
|
_: 1
|
|
142
144
|
}, 8, ["aria-label", "class"]),
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
"aria-label":
|
|
146
|
-
class:
|
|
145
|
+
p(S(z), { class: g($("heading")) }, null, 8, ["class"]),
|
|
146
|
+
p(S(B), {
|
|
147
|
+
"aria-label": h.nextLabel,
|
|
148
|
+
class: g($("nav"))
|
|
147
149
|
}, {
|
|
148
|
-
default:
|
|
150
|
+
default: T(() => [p(t, { icon: S(ne) }, null, 8, ["icon"])]),
|
|
149
151
|
_: 1
|
|
150
152
|
}, 8, ["aria-label", "class"])
|
|
151
153
|
]),
|
|
152
154
|
_: 1
|
|
153
|
-
}, 8, ["class"]),
|
|
155
|
+
}, 8, ["class"]), d("div", { class: g($("months")) }, [(_(!0), u(o, null, y(e, (e) => (_(), c(S(N), {
|
|
154
156
|
key: e.value.toString(),
|
|
155
|
-
class:
|
|
157
|
+
class: g($("grid"))
|
|
156
158
|
}, {
|
|
157
|
-
default:
|
|
158
|
-
default:
|
|
159
|
-
default:
|
|
159
|
+
default: T(() => [p(S(F), null, {
|
|
160
|
+
default: T(() => [p(S(I), null, {
|
|
161
|
+
default: T(() => [(_(!0), u(o, null, y(n, (e) => (_(), c(S(L), {
|
|
160
162
|
key: e,
|
|
161
|
-
class:
|
|
163
|
+
class: g($("headCell"))
|
|
162
164
|
}, {
|
|
163
|
-
default:
|
|
165
|
+
default: T(() => [f(x(e), 1)]),
|
|
164
166
|
_: 2
|
|
165
167
|
}, 1032, ["class"]))), 128))]),
|
|
166
168
|
_: 2
|
|
167
169
|
}, 1024)]),
|
|
168
170
|
_: 2
|
|
169
|
-
}, 1024),
|
|
170
|
-
default:
|
|
171
|
-
default:
|
|
171
|
+
}, 1024), p(S(P), null, {
|
|
172
|
+
default: T(() => [(_(!0), u(o, null, y(e.rows, (t, n) => (_(), c(S(I), { key: `week-${n}` }, {
|
|
173
|
+
default: T(() => [(_(!0), u(o, null, y(t, (t) => (_(), c(S(j), {
|
|
172
174
|
key: t.toString(),
|
|
173
175
|
date: t,
|
|
174
|
-
class:
|
|
176
|
+
class: g($("cell"))
|
|
175
177
|
}, {
|
|
176
|
-
default:
|
|
178
|
+
default: T(() => [p(S(M), {
|
|
177
179
|
day: t,
|
|
178
180
|
month: e.value,
|
|
179
|
-
class:
|
|
181
|
+
class: g($("cellTrigger"))
|
|
180
182
|
}, null, 8, [
|
|
181
183
|
"day",
|
|
182
184
|
"month",
|
|
@@ -198,14 +200,14 @@ var H = [
|
|
|
198
200
|
"locale",
|
|
199
201
|
"week-starts-on",
|
|
200
202
|
"number-of-months"
|
|
201
|
-
]),
|
|
203
|
+
]), h.clearable ? (_(), u("div", {
|
|
202
204
|
key: 0,
|
|
203
|
-
class:
|
|
204
|
-
}, [
|
|
205
|
+
class: g($("footer"))
|
|
206
|
+
}, [d("button", {
|
|
205
207
|
type: "button",
|
|
206
|
-
class:
|
|
208
|
+
class: g($("action")),
|
|
207
209
|
onClick: ce
|
|
208
|
-
},
|
|
210
|
+
}, x(h.clearLabel), 3)], 2)) : l("", !0)]),
|
|
209
211
|
_: 1
|
|
210
212
|
}, 8, ["class"])]),
|
|
211
213
|
_: 1
|
|
@@ -48,7 +48,9 @@ var E = /*@__PURE__*/ u({
|
|
|
48
48
|
},
|
|
49
49
|
emits: ["update:modelValue", "submit"],
|
|
50
50
|
setup(u, { emit: E }) {
|
|
51
|
-
let D = u, O = E, k = n(), A = a(() => D.id ?? k?.id.value)
|
|
51
|
+
let D = u, O = E, k = n(), A = a(() => D.id ?? k?.id.value);
|
|
52
|
+
k && D.id && (k.id.value = D.id);
|
|
53
|
+
let j = a(() => D.invalid ?? k?.invalid.value ?? !1), M = e(), N = a(() => D.unstyled ?? M.unstyled), P = a(() => r({
|
|
52
54
|
size: D.size,
|
|
53
55
|
invalid: j.value
|
|
54
56
|
}));
|
|
@@ -83,7 +85,10 @@ var E = /*@__PURE__*/ u({
|
|
|
83
85
|
isEmpty: r
|
|
84
86
|
})]),
|
|
85
87
|
_: 2
|
|
86
|
-
}, 1032, ["class"]), l(m(S), {
|
|
88
|
+
}, 1032, ["class"]), l(m(S), {
|
|
89
|
+
id: A.value,
|
|
90
|
+
class: d(F("input"))
|
|
91
|
+
}, null, 8, ["id", "class"])]),
|
|
87
92
|
_: 2
|
|
88
93
|
}, 1032, ["class"]), D.controls ? (f(), c(i, { key: 0 }, [n ? (f(), c(i, { key: 1 }, [l(m(T), {
|
|
89
94
|
"aria-label": D.submitLabel,
|
|
@@ -54,7 +54,9 @@ var D = [
|
|
|
54
54
|
}),
|
|
55
55
|
emits: /*@__PURE__*/ f(["reject"], ["update:modelValue"]),
|
|
56
56
|
setup(d, { emit: f }) {
|
|
57
|
-
let A = d, j = f, M = b(d, "modelValue"), N = r(), P = o(() => A.id ?? N?.id.value)
|
|
57
|
+
let A = d, j = f, M = b(d, "modelValue"), N = r(), P = o(() => A.id ?? N?.id.value);
|
|
58
|
+
N && A.id && (N.id.value = A.id);
|
|
59
|
+
let F = o(() => A.invalid ?? N?.invalid.value ?? !1), I = e(), L = o(() => A.unstyled ?? I.unstyled), R = g([]);
|
|
58
60
|
function z(e) {
|
|
59
61
|
if (!A.accept) return !0;
|
|
60
62
|
let t = e.name.toLowerCase(), n = e.type.toLowerCase();
|
|
@@ -2,10 +2,10 @@ import { useIryxUiConfig as e } from "../config.js";
|
|
|
2
2
|
import { formFieldContextKey as t, getByPath as n, useForm as r } from "../composables/form.js";
|
|
3
3
|
import { formFieldTheme as i } from "../theme/form.js";
|
|
4
4
|
import a from "./Label.js";
|
|
5
|
-
import { computed as o, createBlock as s, createCommentVNode as c, createElementBlock as l, createTextVNode as u, defineComponent as d, normalizeClass as f, openBlock as p, provide as m,
|
|
6
|
-
import { useId as
|
|
5
|
+
import { computed as o, createBlock as s, createCommentVNode as c, createElementBlock as l, createTextVNode as u, defineComponent as d, normalizeClass as f, openBlock as p, provide as m, ref as h, renderSlot as g, toDisplayString as _, unref as v, watch as y, withCtx as b } from "vue";
|
|
6
|
+
import { useId as x } from "reka-ui";
|
|
7
7
|
//#region src/components/FormField.vue?vue&type=script&setup=true&lang.ts
|
|
8
|
-
var
|
|
8
|
+
var S = ["data-iryx-field"], C = ["id"], w = ["id"], T = ["id"], E = /*@__PURE__*/ d({
|
|
9
9
|
__name: "FormField",
|
|
10
10
|
props: {
|
|
11
11
|
name: {},
|
|
@@ -28,73 +28,76 @@ var x = ["data-iryx-field"], S = ["id"], C = ["id"], w = ["id"], T = /*@__PURE__
|
|
|
28
28
|
ui: {}
|
|
29
29
|
},
|
|
30
30
|
setup(d) {
|
|
31
|
-
let
|
|
31
|
+
let E = d, D = r(), O = x(), k = h(O), A = o(() => E.error ?? D?.errorFor(E.name)), j = o(() => {
|
|
32
32
|
let e = [];
|
|
33
|
-
return
|
|
33
|
+
return E.description && e.push(`${O}-description`), A.value ? e.push(`${O}-error`) : E.help && e.push(`${O}-help`), e.length ? e.join(" ") : void 0;
|
|
34
34
|
});
|
|
35
|
-
|
|
36
|
-
if (!
|
|
37
|
-
let e =
|
|
38
|
-
(e.includes("change") || e.includes("input")) &&
|
|
35
|
+
y(() => E.name && D ? n(D.state.value, E.name) : void 0, () => {
|
|
36
|
+
if (!E.name || !D) return;
|
|
37
|
+
let e = D.validateOn.value;
|
|
38
|
+
(e.includes("change") || e.includes("input")) && D.validateField(E.name);
|
|
39
39
|
});
|
|
40
|
-
function
|
|
41
|
-
!
|
|
40
|
+
function M() {
|
|
41
|
+
!E.name || !D || D.validateOn.value.includes("blur") && D.validateField(E.name);
|
|
42
42
|
}
|
|
43
|
-
let
|
|
44
|
-
function
|
|
45
|
-
return
|
|
43
|
+
let N = e(), P = o(() => E.unstyled ?? N.unstyled), F = i();
|
|
44
|
+
function I(e, t) {
|
|
45
|
+
return P.value ? t : F[e]({ class: t });
|
|
46
46
|
}
|
|
47
47
|
return m(t, {
|
|
48
|
-
id:
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
48
|
+
id: k,
|
|
49
|
+
labelId: o(() => E.label ? `${O}-label` : void 0),
|
|
50
|
+
name: o(() => E.name),
|
|
51
|
+
invalid: o(() => !!A.value),
|
|
52
|
+
describedBy: j
|
|
52
53
|
}), (e, t) => (p(), l("div", {
|
|
53
|
-
"data-iryx-field":
|
|
54
|
-
class: f(
|
|
55
|
-
onFocusout:
|
|
54
|
+
"data-iryx-field": E.name,
|
|
55
|
+
class: f(P.value ? E.class : v(F).root({ class: [E.ui?.root, E.class] })),
|
|
56
|
+
onFocusout: M
|
|
56
57
|
}, [
|
|
57
|
-
|
|
58
|
+
E.label || E.hint || e.$slots.hint ? (p(), l("div", {
|
|
58
59
|
key: 0,
|
|
59
|
-
class: f(
|
|
60
|
-
}, [
|
|
60
|
+
class: f(I("header", E.ui?.header))
|
|
61
|
+
}, [E.label ? (p(), s(a, {
|
|
61
62
|
key: 0,
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
id: `${v(O)}-label`,
|
|
64
|
+
for: k.value,
|
|
65
|
+
required: E.required,
|
|
66
|
+
class: f(E.ui?.label)
|
|
65
67
|
}, {
|
|
66
|
-
default:
|
|
68
|
+
default: b(() => [u(_(E.label), 1)]),
|
|
67
69
|
_: 1
|
|
68
70
|
}, 8, [
|
|
71
|
+
"id",
|
|
69
72
|
"for",
|
|
70
73
|
"required",
|
|
71
74
|
"class"
|
|
72
|
-
])) : c("", !0),
|
|
75
|
+
])) : c("", !0), E.hint || e.$slots.hint ? (p(), l("span", {
|
|
73
76
|
key: 1,
|
|
74
|
-
class: f(
|
|
75
|
-
}, [
|
|
76
|
-
|
|
77
|
+
class: f(I("hint", E.ui?.hint))
|
|
78
|
+
}, [g(e.$slots, "hint", {}, () => [u(_(E.hint), 1)])], 2)) : c("", !0)], 2)) : c("", !0),
|
|
79
|
+
E.description ? (p(), l("p", {
|
|
77
80
|
key: 1,
|
|
78
|
-
id: `${
|
|
79
|
-
class: f(
|
|
80
|
-
},
|
|
81
|
-
|
|
82
|
-
id:
|
|
83
|
-
error:
|
|
81
|
+
id: `${v(O)}-description`,
|
|
82
|
+
class: f(I("description", E.ui?.description))
|
|
83
|
+
}, _(E.description), 11, C)) : c("", !0),
|
|
84
|
+
g(e.$slots, "default", {
|
|
85
|
+
id: v(O),
|
|
86
|
+
error: A.value
|
|
84
87
|
}),
|
|
85
|
-
|
|
88
|
+
A.value ? (p(), l("p", {
|
|
86
89
|
key: 2,
|
|
87
|
-
id: `${
|
|
90
|
+
id: `${v(O)}-error`,
|
|
88
91
|
role: "alert",
|
|
89
92
|
"aria-live": "polite",
|
|
90
|
-
class: f(
|
|
91
|
-
},
|
|
93
|
+
class: f(I("error", E.ui?.error))
|
|
94
|
+
}, _(A.value), 11, w)) : E.help ? (p(), l("p", {
|
|
92
95
|
key: 3,
|
|
93
|
-
id: `${
|
|
94
|
-
class: f(
|
|
95
|
-
},
|
|
96
|
-
], 42,
|
|
96
|
+
id: `${v(O)}-help`,
|
|
97
|
+
class: f(I("help", E.ui?.help))
|
|
98
|
+
}, _(E.help), 11, T)) : c("", !0)
|
|
99
|
+
], 42, S));
|
|
97
100
|
}
|
|
98
101
|
});
|
|
99
102
|
//#endregion
|
|
100
|
-
export {
|
|
103
|
+
export { E as default };
|