iryx-ui 0.10.2 → 0.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/README.md +593 -496
- package/dist/component-names.d.ts +1 -1
- package/dist/component-names.js +1 -1
- package/dist/components/Alert.vue_vue_type_script_setup_true_lang.js +42 -42
- package/dist/components/Banner.vue_vue_type_script_setup_true_lang.js +40 -40
- package/dist/components/BarChart.vue.d.ts +13 -0
- package/dist/components/BarChart.vue_vue_type_script_setup_true_lang.js +174 -132
- package/dist/components/Breadcrumb.vue_vue_type_script_setup_true_lang.js +28 -28
- package/dist/components/Button.vue_vue_type_script_setup_true_lang.js +14 -14
- package/dist/components/Checkbox.vue_vue_type_script_setup_true_lang.js +37 -30
- package/dist/components/Combobox.vue_vue_type_script_setup_true_lang.js +62 -60
- package/dist/components/DatePicker.vue_vue_type_script_setup_true_lang.js +65 -65
- package/dist/components/DateRangePicker.vue_vue_type_script_setup_true_lang.js +74 -74
- package/dist/components/Dialog.vue_vue_type_script_setup_true_lang.js +34 -34
- package/dist/components/Drawer.js +5 -0
- package/dist/components/Drawer.vue.d.ts +94 -0
- package/dist/components/Drawer.vue_vue_type_script_setup_true_lang.js +144 -0
- package/dist/components/DropdownMenuItems.vue_vue_type_script_setup_true_lang.js +42 -42
- package/dist/components/FileUpload.vue_vue_type_script_setup_true_lang.js +77 -77
- package/dist/components/Icon.vue_vue_type_script_setup_true_lang.js +11 -11
- package/dist/components/Input.vue_vue_type_script_setup_true_lang.js +33 -33
- package/dist/components/NumberInput.vue_vue_type_script_setup_true_lang.js +68 -66
- package/dist/components/Pagination.vue.d.ts +1 -1
- package/dist/components/Pagination.vue_vue_type_script_setup_true_lang.js +37 -37
- package/dist/components/PasswordInput.vue_vue_type_script_setup_true_lang.js +37 -37
- package/dist/components/Progress.vue_vue_type_script_setup_true_lang.js +34 -31
- package/dist/components/Select.vue_vue_type_script_setup_true_lang.js +47 -45
- package/dist/components/Stat.vue_vue_type_script_setup_true_lang.js +27 -27
- package/dist/components/Stepper.vue_vue_type_script_setup_true_lang.js +38 -38
- package/dist/components/Switch.vue_vue_type_script_setup_true_lang.js +9 -2
- package/dist/components/Table.vue_vue_type_script_setup_true_lang.js +87 -87
- package/dist/components/Toaster.vue_vue_type_script_setup_true_lang.js +41 -41
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +54 -52
- package/dist/composables/date.js +12 -15
- package/dist/index.d.ts +1 -0
- package/dist/index.js +55 -54
- package/dist/theme/drawer.d.ts +110 -0
- package/dist/theme/drawer.js +100 -0
- package/dist/theme/index.d.ts +1 -0
- package/package.json +3 -2
- package/theme.css +114 -0
- package/dist/node_modules/.pnpm/@hugeicons_core-free-icons@4.2.3/node_modules/@hugeicons/core-free-icons/dist/esm/index.js +0 -377
- package/dist/node_modules/.pnpm/@hugeicons_vue@1.0.7_vue@3.5.35_typescript@6.0.3_/node_modules/@hugeicons/vue/dist/esm/_virtual/_plugin-vue_export-helper.js +0 -8
- package/dist/node_modules/.pnpm/@hugeicons_vue@1.0.7_vue@3.5.35_typescript@6.0.3_/node_modules/@hugeicons/vue/dist/esm/components/HugeiconsIcon.vue.js +0 -25
- package/dist/node_modules/.pnpm/@hugeicons_vue@1.0.7_vue@3.5.35_typescript@6.0.3_/node_modules/@hugeicons/vue/dist/esm/components/HugeiconsIcon.vue2.js +0 -63
- package/dist/node_modules/.pnpm/@internationalized_date@3.12.3/node_modules/@internationalized/date/dist/private/CalendarDate.js +0 -122
- package/dist/node_modules/.pnpm/@internationalized_date@3.12.3/node_modules/@internationalized/date/dist/private/DateFormatter.js +0 -84
- package/dist/node_modules/.pnpm/@internationalized_date@3.12.3/node_modules/@internationalized/date/dist/private/calendars/GregorianCalendar.js +0 -91
- package/dist/node_modules/.pnpm/@internationalized_date@3.12.3/node_modules/@internationalized/date/dist/private/conversion.js +0 -107
- package/dist/node_modules/.pnpm/@internationalized_date@3.12.3/node_modules/@internationalized/date/dist/private/manipulation.js +0 -159
- package/dist/node_modules/.pnpm/@internationalized_date@3.12.3/node_modules/@internationalized/date/dist/private/queries.js +0 -29
- package/dist/node_modules/.pnpm/@internationalized_date@3.12.3/node_modules/@internationalized/date/dist/private/string.js +0 -37
- package/dist/node_modules/.pnpm/@internationalized_date@3.12.3/node_modules/@internationalized/date/dist/private/utils.js +0 -6
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { useIryxUiConfig as e } from "../config.js";
|
|
2
|
+
import t from "./Icon.js";
|
|
3
|
+
import { checkboxTheme as n } from "../theme/checkbox.js";
|
|
4
|
+
import { computed as r, createBlock as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createTextVNode as c, createVNode as l, defineComponent as u, mergeProps as d, normalizeClass as f, openBlock as p, renderSlot as m, toDisplayString as h, unref as g, withCtx as _ } from "vue";
|
|
5
|
+
import { MinusSignIcon as v, Tick02Icon as y } from "@hugeicons/core-free-icons";
|
|
6
6
|
import { CheckboxIndicator as b, CheckboxRoot as x, Label as S, useForwardPropsEmits as C, useId as w } from "reka-ui";
|
|
7
7
|
//#region src/components/Checkbox.vue?vue&type=script&setup=true&lang.ts
|
|
8
|
-
var T = ["id"], E = /*@__PURE__*/
|
|
8
|
+
var T = ["id"], E = /*@__PURE__*/ u({
|
|
9
|
+
inheritAttrs: !1,
|
|
9
10
|
__name: "Checkbox",
|
|
10
11
|
props: {
|
|
11
12
|
label: {},
|
|
@@ -30,28 +31,31 @@ var T = ["id"], E = /*@__PURE__*/ f({
|
|
|
30
31
|
required: { type: Boolean }
|
|
31
32
|
},
|
|
32
33
|
emits: ["update:modelValue"],
|
|
33
|
-
setup(
|
|
34
|
-
let D =
|
|
34
|
+
setup(u, { emit: E }) {
|
|
35
|
+
let D = u, O = E, k = C(r(() => {
|
|
35
36
|
let { label: e, description: t, size: n, id: r, unstyled: i, class: a, ui: o, ...s } = D;
|
|
36
37
|
return s;
|
|
37
|
-
}), O), A = w(), j =
|
|
38
|
+
}), O), A = w(), j = r(() => D.id ?? A), M = r(() => !!(D.label || D.description)), N = e(), P = r(() => D.unstyled ?? N.unstyled), F = r(() => n({
|
|
38
39
|
size: D.size,
|
|
39
40
|
withText: M.value
|
|
40
|
-
})), I =
|
|
41
|
-
return (
|
|
41
|
+
})), I = r(() => P.value ? D.ui?.wrapper : F.value.wrapper({ class: D.ui?.wrapper })), L = r(() => P.value ? [D.ui?.root, D.class] : F.value.root({ class: [D.ui?.root, D.class] })), R = r(() => P.value ? D.ui?.indicator : F.value.indicator({ class: D.ui?.indicator })), z = r(() => P.value ? D.ui?.content : F.value.content({ class: D.ui?.content })), B = r(() => P.value ? D.ui?.label : F.value.label({ class: D.ui?.label })), V = r(() => P.value ? D.ui?.description : F.value.description({ class: D.ui?.description }));
|
|
42
|
+
return (e, n) => M.value ? (p(), o("div", {
|
|
42
43
|
key: 0,
|
|
43
|
-
class:
|
|
44
|
-
}, [
|
|
44
|
+
class: f(I.value)
|
|
45
|
+
}, [l(g(x), d({ id: j.value }, {
|
|
46
|
+
...g(k),
|
|
47
|
+
...e.$attrs
|
|
48
|
+
}, {
|
|
45
49
|
"aria-describedby": D.description ? `${j.value}-description` : void 0,
|
|
46
50
|
class: L.value
|
|
47
51
|
}), {
|
|
48
|
-
default:
|
|
49
|
-
default:
|
|
52
|
+
default: _(() => [l(g(b), { class: f(R.value) }, {
|
|
53
|
+
default: _(() => [m(e.$slots, "default", {}, () => [D.modelValue === "indeterminate" ? (p(), i(t, {
|
|
50
54
|
key: 0,
|
|
51
|
-
icon: v
|
|
52
|
-
}, null, 8, ["icon"])) : (
|
|
55
|
+
icon: g(v)
|
|
56
|
+
}, null, 8, ["icon"])) : (p(), i(t, {
|
|
53
57
|
key: 1,
|
|
54
|
-
icon:
|
|
58
|
+
icon: g(y)
|
|
55
59
|
}, null, 8, ["icon"]))])]),
|
|
56
60
|
_: 3
|
|
57
61
|
}, 8, ["class"])]),
|
|
@@ -60,27 +64,30 @@ var T = ["id"], E = /*@__PURE__*/ f({
|
|
|
60
64
|
"id",
|
|
61
65
|
"aria-describedby",
|
|
62
66
|
"class"
|
|
63
|
-
]),
|
|
67
|
+
]), s("div", { class: f(z.value) }, [l(g(S), {
|
|
64
68
|
for: j.value,
|
|
65
|
-
class:
|
|
69
|
+
class: f(B.value)
|
|
66
70
|
}, {
|
|
67
|
-
default:
|
|
71
|
+
default: _(() => [m(e.$slots, "label", {}, () => [c(h(D.label), 1)])]),
|
|
68
72
|
_: 3
|
|
69
|
-
}, 8, ["for", "class"]), D.description ||
|
|
73
|
+
}, 8, ["for", "class"]), D.description || e.$slots.description ? (p(), o("p", {
|
|
70
74
|
key: 0,
|
|
71
75
|
id: `${j.value}-description`,
|
|
72
|
-
class:
|
|
73
|
-
}, [
|
|
76
|
+
class: f(V.value)
|
|
77
|
+
}, [m(e.$slots, "description", {}, () => [c(h(D.description), 1)])], 10, T)) : a("", !0)], 2)], 2)) : (p(), i(g(x), d({
|
|
74
78
|
key: 1,
|
|
75
79
|
id: D.id
|
|
76
|
-
},
|
|
77
|
-
|
|
78
|
-
|
|
80
|
+
}, {
|
|
81
|
+
...g(k),
|
|
82
|
+
...e.$attrs
|
|
83
|
+
}, { class: L.value }), {
|
|
84
|
+
default: _(() => [l(g(b), { class: f(R.value) }, {
|
|
85
|
+
default: _(() => [m(e.$slots, "default", {}, () => [D.modelValue === "indeterminate" ? (p(), i(t, {
|
|
79
86
|
key: 0,
|
|
80
|
-
icon: v
|
|
81
|
-
}, null, 8, ["icon"])) : (
|
|
87
|
+
icon: g(v)
|
|
88
|
+
}, null, 8, ["icon"])) : (p(), i(t, {
|
|
82
89
|
key: 1,
|
|
83
|
-
icon:
|
|
90
|
+
icon: g(y)
|
|
84
91
|
}, null, 8, ["icon"]))])]),
|
|
85
92
|
_: 3
|
|
86
93
|
}, 8, ["class"])]),
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { useFormField as i } from "../composables/form.js";
|
|
1
|
+
import { useIryxUiConfig as e } from "../config.js";
|
|
2
|
+
import t from "./Icon.js";
|
|
3
|
+
import { useFormField as n } from "../composables/form.js";
|
|
5
4
|
import { comboboxTheme as ee } from "../theme/combobox.js";
|
|
6
|
-
import { Fragment as
|
|
7
|
-
import {
|
|
5
|
+
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, mergeProps as d, normalizeClass as f, openBlock as p, ref as m, renderList as h, renderSlot as g, toDisplayString as _, unref as v, vShow as te, withCtx as y, withDirectives as b } from "vue";
|
|
6
|
+
import { ArrowDown01Icon as x, Tick02Icon as S } from "@hugeicons/core-free-icons";
|
|
7
|
+
import { ComboboxAnchor as ne, ComboboxContent as re, ComboboxEmpty as ie, ComboboxGroup as ae, ComboboxInput as oe, ComboboxItem as C, ComboboxItemIndicator as w, ComboboxLabel as se, ComboboxPortal as T, ComboboxRoot as E, ComboboxTrigger as D, ComboboxViewport as O, ComboboxVirtualizer as k, useFilter as A, useForwardPropsEmits as j } from "reka-ui";
|
|
8
8
|
//#region src/components/Combobox.vue?vue&type=script&setup=true&lang.ts
|
|
9
|
-
var M = /*@__PURE__*/
|
|
9
|
+
var M = /*@__PURE__*/ u({
|
|
10
|
+
inheritAttrs: !1,
|
|
10
11
|
__name: "Combobox",
|
|
11
12
|
props: {
|
|
12
13
|
items: {},
|
|
@@ -73,9 +74,9 @@ var M = /*@__PURE__*/ f({
|
|
|
73
74
|
"update:open",
|
|
74
75
|
"create"
|
|
75
76
|
],
|
|
76
|
-
setup(
|
|
77
|
-
let N =
|
|
78
|
-
let { items: e, placeholder: t, size: n, invalid:
|
|
77
|
+
setup(u, { emit: M }) {
|
|
78
|
+
let N = u, P = M, F = j(i(() => {
|
|
79
|
+
let { items: e, placeholder: t, size: n, invalid: ee, id: r, emptyText: i, create: a, createLabel: o, virtual: s, estimateSize: c, overscan: l, unstyled: u, class: d, ui: f, ...p } = N;
|
|
79
80
|
return p;
|
|
80
81
|
}), P);
|
|
81
82
|
function I(e) {
|
|
@@ -87,17 +88,17 @@ var M = /*@__PURE__*/ f({
|
|
|
87
88
|
function L(e) {
|
|
88
89
|
return typeof e != "string" && "items" in e;
|
|
89
90
|
}
|
|
90
|
-
let R =
|
|
91
|
+
let R = i(() => {
|
|
91
92
|
let e = N.items ?? [];
|
|
92
93
|
return e.some(L) ? e.map((e) => L(e) ? e : {
|
|
93
94
|
label: "",
|
|
94
95
|
items: [e]
|
|
95
96
|
}) : void 0;
|
|
96
|
-
}), z =
|
|
97
|
+
}), z = i(() => (N.items ?? []).flatMap((e) => L(e) ? e.items.map(I) : [I(e)])), B = i(() => !!N.virtual), V = m(""), H = m("");
|
|
97
98
|
function U(e) {
|
|
98
99
|
H.value = e.target.value;
|
|
99
100
|
}
|
|
100
|
-
let { contains: W } = A({ sensitivity: "base" }), G =
|
|
101
|
+
let { contains: W } = A({ sensitivity: "base" }), G = i(() => {
|
|
101
102
|
let e = H.value.trim();
|
|
102
103
|
return e ? z.value.filter((t) => W(t.label, e)) : z.value;
|
|
103
104
|
});
|
|
@@ -111,7 +112,7 @@ var M = /*@__PURE__*/ f({
|
|
|
111
112
|
document.activeElement === t && t.select();
|
|
112
113
|
}), H.value = "";
|
|
113
114
|
}
|
|
114
|
-
let K =
|
|
115
|
+
let K = i(() => {
|
|
115
116
|
let e = H.value.trim();
|
|
116
117
|
return !!N.create && e.length > 0 && !z.value.some((t) => t.label.toLowerCase() === e.toLowerCase());
|
|
117
118
|
});
|
|
@@ -121,7 +122,7 @@ var M = /*@__PURE__*/ f({
|
|
|
121
122
|
bubbles: !0
|
|
122
123
|
}));
|
|
123
124
|
}
|
|
124
|
-
let J =
|
|
125
|
+
let J = n(), ue = i(() => N.id ?? J?.id.value), Y = i(() => N.invalid ?? J?.invalid.value ?? !1), de = e(), X = i(() => N.unstyled ?? de.unstyled), Z = i(() => ee({
|
|
125
126
|
size: N.size,
|
|
126
127
|
invalid: Y.value,
|
|
127
128
|
disabled: N.disabled
|
|
@@ -130,70 +131,71 @@ var M = /*@__PURE__*/ f({
|
|
|
130
131
|
let n = N.ui?.[e];
|
|
131
132
|
return X.value ? [n, t] : Z.value[e]({ class: [n, t] });
|
|
132
133
|
}
|
|
133
|
-
let $ =
|
|
134
|
-
return (
|
|
134
|
+
let $ = i(() => X.value ? void 0 : Z.value.itemIndicator());
|
|
135
|
+
return (e, n) => (p(), a(v(E), d(v(F), {
|
|
135
136
|
"open-on-click": "",
|
|
136
137
|
class: "contents"
|
|
137
138
|
}), {
|
|
138
|
-
default:
|
|
139
|
-
default:
|
|
139
|
+
default: y(() => [l(v(ne), { class: f(Q("anchor", N.class)) }, {
|
|
140
|
+
default: y(() => [l(v(oe), d({
|
|
140
141
|
id: ue.value,
|
|
141
142
|
modelValue: V.value,
|
|
142
|
-
"onUpdate:modelValue":
|
|
143
|
+
"onUpdate:modelValue": n[0] ||= (e) => V.value = e
|
|
144
|
+
}, e.$attrs, {
|
|
143
145
|
placeholder: N.placeholder,
|
|
144
146
|
"display-value": ce,
|
|
145
147
|
"aria-invalid": Y.value || void 0,
|
|
146
|
-
"aria-describedby":
|
|
147
|
-
class:
|
|
148
|
+
"aria-describedby": v(J)?.describedBy.value,
|
|
149
|
+
class: Q("input"),
|
|
148
150
|
onFocus: le,
|
|
149
151
|
onInput: U
|
|
150
|
-
}, null,
|
|
152
|
+
}), null, 16, [
|
|
151
153
|
"id",
|
|
152
154
|
"modelValue",
|
|
153
155
|
"placeholder",
|
|
154
156
|
"aria-invalid",
|
|
155
157
|
"aria-describedby",
|
|
156
158
|
"class"
|
|
157
|
-
]),
|
|
158
|
-
default:
|
|
159
|
+
]), l(v(D), { class: f(Q("trigger")) }, {
|
|
160
|
+
default: y(() => [l(t, { icon: v(x) }, null, 8, ["icon"])]),
|
|
159
161
|
_: 1
|
|
160
162
|
}, 8, ["class"])]),
|
|
161
163
|
_: 1
|
|
162
|
-
}, 8, ["class"]),
|
|
163
|
-
default:
|
|
164
|
-
class:
|
|
164
|
+
}, 8, ["class"]), l(v(T), null, {
|
|
165
|
+
default: y(() => [l(v(re), {
|
|
166
|
+
class: f(Q("content")),
|
|
165
167
|
position: "popper",
|
|
166
168
|
"side-offset": 4
|
|
167
169
|
}, {
|
|
168
|
-
default:
|
|
169
|
-
default:
|
|
170
|
-
B.value ?
|
|
170
|
+
default: y(() => [l(v(O), { class: f(Q("viewport")) }, {
|
|
171
|
+
default: y(() => [
|
|
172
|
+
B.value ? b((p(), s("div", {
|
|
171
173
|
key: 0,
|
|
172
|
-
class:
|
|
173
|
-
}, [
|
|
174
|
+
class: f(Q("empty"))
|
|
175
|
+
}, [g(e.$slots, "empty", { query: H.value }, () => [c(_(N.emptyText), 1)])], 2)), [[te, !K.value && G.value.length === 0]]) : K.value ? o("", !0) : (p(), a(v(ie), {
|
|
174
176
|
key: 1,
|
|
175
|
-
class:
|
|
177
|
+
class: f(Q("empty"))
|
|
176
178
|
}, {
|
|
177
|
-
default:
|
|
179
|
+
default: y(() => [g(e.$slots, "empty", { query: H.value }, () => [c(_(N.emptyText), 1)])]),
|
|
178
180
|
_: 3
|
|
179
181
|
}, 8, ["class"])),
|
|
180
|
-
|
|
182
|
+
g(e.$slots, "default", {}, () => [B.value ? (p(), a(v(k), {
|
|
181
183
|
key: 0,
|
|
182
184
|
options: G.value,
|
|
183
185
|
"estimate-size": N.estimateSize,
|
|
184
186
|
overscan: N.overscan,
|
|
185
187
|
"text-content": (e) => e.label
|
|
186
188
|
}, {
|
|
187
|
-
default:
|
|
189
|
+
default: y(({ option: e }) => [l(v(C), {
|
|
188
190
|
value: e.value,
|
|
189
191
|
"text-value": e.label,
|
|
190
192
|
disabled: e.disabled,
|
|
191
|
-
class:
|
|
193
|
+
class: f(Q("item"))
|
|
192
194
|
}, {
|
|
193
|
-
default:
|
|
194
|
-
default:
|
|
195
|
+
default: y(() => [l(v(w), { class: f($.value) }, {
|
|
196
|
+
default: y(() => [l(t, { icon: v(S) }, null, 8, ["icon"])]),
|
|
195
197
|
_: 1
|
|
196
|
-
}, 8, ["class"]),
|
|
198
|
+
}, 8, ["class"]), c(" " + _(e.label), 1)]),
|
|
197
199
|
_: 2
|
|
198
200
|
}, 1032, [
|
|
199
201
|
"value",
|
|
@@ -207,27 +209,27 @@ var M = /*@__PURE__*/ f({
|
|
|
207
209
|
"estimate-size",
|
|
208
210
|
"overscan",
|
|
209
211
|
"text-content"
|
|
210
|
-
])) : R.value ? (
|
|
212
|
+
])) : R.value ? (p(!0), s(r, { key: 1 }, h(R.value, (e, n) => (p(), a(v(ae), {
|
|
211
213
|
key: e.label || n,
|
|
212
|
-
class:
|
|
214
|
+
class: f(Q("group"))
|
|
213
215
|
}, {
|
|
214
|
-
default:
|
|
216
|
+
default: y(() => [e.label ? (p(), a(v(se), {
|
|
215
217
|
key: 0,
|
|
216
|
-
class:
|
|
218
|
+
class: f(Q("groupLabel"))
|
|
217
219
|
}, {
|
|
218
|
-
default:
|
|
220
|
+
default: y(() => [c(_(e.label), 1)]),
|
|
219
221
|
_: 2
|
|
220
|
-
}, 1032, ["class"])) :
|
|
222
|
+
}, 1032, ["class"])) : o("", !0), (p(!0), s(r, null, h(e.items, (e) => (p(), a(v(C), {
|
|
221
223
|
key: typeof e == "string" ? e : e.value,
|
|
222
224
|
value: typeof e == "string" ? e : e.value,
|
|
223
225
|
"text-value": typeof e == "string" ? e : e.label,
|
|
224
226
|
disabled: typeof e == "string" ? void 0 : e.disabled,
|
|
225
|
-
class:
|
|
227
|
+
class: f(Q("item"))
|
|
226
228
|
}, {
|
|
227
|
-
default:
|
|
228
|
-
default:
|
|
229
|
+
default: y(() => [l(v(w), { class: f($.value) }, {
|
|
230
|
+
default: y(() => [l(t, { icon: v(S) }, null, 8, ["icon"])]),
|
|
229
231
|
_: 1
|
|
230
|
-
}, 8, ["class"]),
|
|
232
|
+
}, 8, ["class"]), c(" " + _(typeof e == "string" ? e : e.label), 1)]),
|
|
231
233
|
_: 2
|
|
232
234
|
}, 1032, [
|
|
233
235
|
"value",
|
|
@@ -236,17 +238,17 @@ var M = /*@__PURE__*/ f({
|
|
|
236
238
|
"class"
|
|
237
239
|
]))), 128))]),
|
|
238
240
|
_: 2
|
|
239
|
-
}, 1032, ["class"]))), 128)) : (
|
|
241
|
+
}, 1032, ["class"]))), 128)) : (p(!0), s(r, { key: 2 }, h(z.value, (e) => (p(), a(v(C), {
|
|
240
242
|
key: e.value,
|
|
241
243
|
value: e.value,
|
|
242
244
|
"text-value": e.label,
|
|
243
245
|
disabled: e.disabled,
|
|
244
|
-
class:
|
|
246
|
+
class: f(Q("item"))
|
|
245
247
|
}, {
|
|
246
|
-
default:
|
|
247
|
-
default:
|
|
248
|
+
default: y(() => [l(v(w), { class: f($.value) }, {
|
|
249
|
+
default: y(() => [l(t, { icon: v(S) }, null, 8, ["icon"])]),
|
|
248
250
|
_: 1
|
|
249
|
-
}, 8, ["class"]),
|
|
251
|
+
}, 8, ["class"]), c(" " + _(e.label), 1)]),
|
|
250
252
|
_: 2
|
|
251
253
|
}, 1032, [
|
|
252
254
|
"value",
|
|
@@ -254,21 +256,21 @@ var M = /*@__PURE__*/ f({
|
|
|
254
256
|
"disabled",
|
|
255
257
|
"class"
|
|
256
258
|
]))), 128))]),
|
|
257
|
-
K.value ? (
|
|
259
|
+
K.value ? (p(), a(v(C), {
|
|
258
260
|
key: H.value,
|
|
259
261
|
value: H.value,
|
|
260
262
|
"data-create": "",
|
|
261
263
|
"text-value": H.value,
|
|
262
|
-
class:
|
|
264
|
+
class: f(Q("item")),
|
|
263
265
|
onSelect: q
|
|
264
266
|
}, {
|
|
265
|
-
default:
|
|
267
|
+
default: y(() => [g(e.$slots, "create", { query: H.value }, () => [c(_(N.createLabel(H.value.trim())), 1)])]),
|
|
266
268
|
_: 3
|
|
267
269
|
}, 8, [
|
|
268
270
|
"value",
|
|
269
271
|
"text-value",
|
|
270
272
|
"class"
|
|
271
|
-
])) :
|
|
273
|
+
])) : o("", !0)
|
|
272
274
|
]),
|
|
273
275
|
_: 3
|
|
274
276
|
}, 8, ["class"])]),
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { CalendarCell as
|
|
1
|
+
import { useIryxUiConfig as e } from "../config.js";
|
|
2
|
+
import t from "./Icon.js";
|
|
3
|
+
import { useFormField as n } from "../composables/form.js";
|
|
4
|
+
import { formatIsoDate as r, isoToday as i, toCalendarDate as a, toIsoDate as o } from "../composables/date.js";
|
|
5
|
+
import { datePickerTheme as s } from "../theme/date-picker.js";
|
|
6
|
+
import { Fragment as c, computed as l, createBlock as u, createCommentVNode as ee, createElementBlock as d, createElementVNode as f, createTextVNode as p, createVNode as m, defineComponent as h, mergeModels as g, normalizeClass as _, openBlock as v, ref as y, renderList as b, toDisplayString as x, unref as S, useModel as C, withCtx as w } from "vue";
|
|
7
|
+
import { ArrowLeft01Icon as T, ArrowRight01Icon as te, Calendar03Icon as E } from "@hugeicons/core-free-icons";
|
|
8
|
+
import { CalendarCell as D, CalendarCellTrigger as O, CalendarGrid as k, CalendarGridBody as A, CalendarGridHead as j, CalendarGridRow as M, CalendarHeadCell as N, CalendarHeader as P, CalendarHeading as F, CalendarNext as I, CalendarPrev as L, CalendarRoot as R, PopoverContent as z, PopoverPortal as B, PopoverRoot as ne, PopoverTrigger as V } from "reka-ui";
|
|
9
9
|
//#region src/components/DatePicker.vue?vue&type=script&setup=true&lang.ts
|
|
10
10
|
var H = [
|
|
11
11
|
"id",
|
|
12
12
|
"disabled",
|
|
13
13
|
"aria-invalid",
|
|
14
14
|
"aria-describedby"
|
|
15
|
-
], U = { key: 0 }, W = /*@__PURE__*/
|
|
15
|
+
], U = { key: 0 }, W = /*@__PURE__*/ h({
|
|
16
16
|
__name: "DatePicker",
|
|
17
|
-
props: /*@__PURE__*/
|
|
17
|
+
props: /*@__PURE__*/ g({
|
|
18
18
|
size: {},
|
|
19
19
|
placeholder: { default: "Pick a date" },
|
|
20
20
|
disabled: { type: Boolean },
|
|
@@ -44,106 +44,106 @@ var H = [
|
|
|
44
44
|
modelModifiers: {}
|
|
45
45
|
}),
|
|
46
46
|
emits: ["update:modelValue"],
|
|
47
|
-
setup(
|
|
48
|
-
let
|
|
49
|
-
get: () =>
|
|
47
|
+
setup(h) {
|
|
48
|
+
let g = h, W = C(h, "modelValue"), G = y(!1), K = n(), q = l(() => g.id ?? K?.id.value), J = l(() => g.invalid ?? K?.invalid.value ?? !1), Y = e(), X = l(() => g.unstyled ?? Y.unstyled), Z = l({
|
|
49
|
+
get: () => a(W.value),
|
|
50
50
|
set: (e) => {
|
|
51
|
-
W.value =
|
|
51
|
+
W.value = o(e);
|
|
52
52
|
}
|
|
53
|
-
}), re =
|
|
53
|
+
}), re = l(() => a(g.min)), ie = l(() => a(g.max)), Q = l(() => r(W.value, g.locale, g.format));
|
|
54
54
|
function ae() {
|
|
55
|
-
W.value =
|
|
55
|
+
W.value = i(), G.value = !1;
|
|
56
56
|
}
|
|
57
57
|
function oe() {
|
|
58
58
|
W.value = null, G.value = !1;
|
|
59
59
|
}
|
|
60
|
-
let se =
|
|
61
|
-
size:
|
|
60
|
+
let se = l(() => s({
|
|
61
|
+
size: g.size,
|
|
62
62
|
invalid: J.value
|
|
63
63
|
}));
|
|
64
64
|
function $(e, t) {
|
|
65
|
-
let n =
|
|
65
|
+
let n = g.ui?.[e];
|
|
66
66
|
return X.value ? [n, t] : se.value[e]({ class: [n, t] });
|
|
67
67
|
}
|
|
68
|
-
return (
|
|
68
|
+
return (e, n) => (v(), u(S(ne), {
|
|
69
69
|
open: G.value,
|
|
70
|
-
"onUpdate:open":
|
|
70
|
+
"onUpdate:open": n[2] ||= (e) => G.value = e
|
|
71
71
|
}, {
|
|
72
|
-
default:
|
|
73
|
-
default:
|
|
72
|
+
default: w(() => [m(S(V), { "as-child": "" }, {
|
|
73
|
+
default: w(() => [f("button", {
|
|
74
74
|
id: q.value,
|
|
75
75
|
type: "button",
|
|
76
|
-
disabled:
|
|
76
|
+
disabled: g.disabled,
|
|
77
77
|
"aria-invalid": J.value || void 0,
|
|
78
|
-
"aria-describedby":
|
|
79
|
-
class:
|
|
80
|
-
}, [Q.value ? (
|
|
78
|
+
"aria-describedby": S(K)?.describedBy.value,
|
|
79
|
+
class: _($("trigger", g.class))
|
|
80
|
+
}, [Q.value ? (v(), d("span", U, x(Q.value), 1)) : (v(), d("span", {
|
|
81
81
|
key: 1,
|
|
82
|
-
class:
|
|
83
|
-
},
|
|
82
|
+
class: _($("placeholder"))
|
|
83
|
+
}, x(g.placeholder), 3)), m(t, { icon: S(E) }, null, 8, ["icon"])], 10, H)]),
|
|
84
84
|
_: 1
|
|
85
|
-
}),
|
|
86
|
-
default:
|
|
87
|
-
class:
|
|
85
|
+
}), m(S(B), null, {
|
|
86
|
+
default: w(() => [m(S(z), {
|
|
87
|
+
class: _($("content")),
|
|
88
88
|
"side-offset": 4,
|
|
89
89
|
align: "start"
|
|
90
90
|
}, {
|
|
91
|
-
default:
|
|
91
|
+
default: w(() => [m(S(R), {
|
|
92
92
|
modelValue: Z.value,
|
|
93
|
-
"onUpdate:modelValue": [
|
|
93
|
+
"onUpdate:modelValue": [n[0] ||= (e) => Z.value = e, n[1] ||= (e) => G.value = !1],
|
|
94
94
|
"min-value": re.value,
|
|
95
95
|
"max-value": ie.value,
|
|
96
|
-
locale:
|
|
97
|
-
"week-starts-on":
|
|
96
|
+
locale: g.locale,
|
|
97
|
+
"week-starts-on": g.weekStartsOn,
|
|
98
98
|
"fixed-weeks": "",
|
|
99
99
|
"initial-focus": ""
|
|
100
100
|
}, {
|
|
101
|
-
default:
|
|
102
|
-
default:
|
|
103
|
-
|
|
104
|
-
"aria-label":
|
|
105
|
-
class:
|
|
101
|
+
default: w(({ grid: e, weekDays: n }) => [m(S(P), { class: _($("header")) }, {
|
|
102
|
+
default: w(() => [
|
|
103
|
+
m(S(L), {
|
|
104
|
+
"aria-label": g.previousLabel,
|
|
105
|
+
class: _($("nav"))
|
|
106
106
|
}, {
|
|
107
|
-
default:
|
|
107
|
+
default: w(() => [m(t, { icon: S(T) }, null, 8, ["icon"])]),
|
|
108
108
|
_: 1
|
|
109
109
|
}, 8, ["aria-label", "class"]),
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
"aria-label":
|
|
113
|
-
class:
|
|
110
|
+
m(S(F), { class: _($("heading")) }, null, 8, ["class"]),
|
|
111
|
+
m(S(I), {
|
|
112
|
+
"aria-label": g.nextLabel,
|
|
113
|
+
class: _($("nav"))
|
|
114
114
|
}, {
|
|
115
|
-
default:
|
|
115
|
+
default: w(() => [m(t, { icon: S(te) }, null, 8, ["icon"])]),
|
|
116
116
|
_: 1
|
|
117
117
|
}, 8, ["aria-label", "class"])
|
|
118
118
|
]),
|
|
119
119
|
_: 1
|
|
120
|
-
}, 8, ["class"]),
|
|
120
|
+
}, 8, ["class"]), f("div", { class: _($("months")) }, [(v(!0), d(c, null, b(e, (e) => (v(), u(S(k), {
|
|
121
121
|
key: e.value.toString(),
|
|
122
|
-
class:
|
|
122
|
+
class: _($("grid"))
|
|
123
123
|
}, {
|
|
124
|
-
default:
|
|
125
|
-
default:
|
|
126
|
-
default:
|
|
124
|
+
default: w(() => [m(S(j), null, {
|
|
125
|
+
default: w(() => [m(S(M), null, {
|
|
126
|
+
default: w(() => [(v(!0), d(c, null, b(n, (e) => (v(), u(S(N), {
|
|
127
127
|
key: e,
|
|
128
|
-
class:
|
|
128
|
+
class: _($("headCell"))
|
|
129
129
|
}, {
|
|
130
|
-
default:
|
|
130
|
+
default: w(() => [p(x(e), 1)]),
|
|
131
131
|
_: 2
|
|
132
132
|
}, 1032, ["class"]))), 128))]),
|
|
133
133
|
_: 2
|
|
134
134
|
}, 1024)]),
|
|
135
135
|
_: 2
|
|
136
|
-
}, 1024),
|
|
137
|
-
default:
|
|
138
|
-
default:
|
|
136
|
+
}, 1024), m(S(A), null, {
|
|
137
|
+
default: w(() => [(v(!0), d(c, null, b(e.rows, (t, n) => (v(), u(S(M), { key: `week-${n}` }, {
|
|
138
|
+
default: w(() => [(v(!0), d(c, null, b(t, (t) => (v(), u(S(D), {
|
|
139
139
|
key: t.toString(),
|
|
140
140
|
date: t,
|
|
141
|
-
class:
|
|
141
|
+
class: _($("cell"))
|
|
142
142
|
}, {
|
|
143
|
-
default:
|
|
143
|
+
default: w(() => [m(S(O), {
|
|
144
144
|
day: t,
|
|
145
145
|
month: e.value,
|
|
146
|
-
class:
|
|
146
|
+
class: _($("cellTrigger"))
|
|
147
147
|
}, null, 8, [
|
|
148
148
|
"day",
|
|
149
149
|
"month",
|
|
@@ -164,16 +164,16 @@ var H = [
|
|
|
164
164
|
"max-value",
|
|
165
165
|
"locale",
|
|
166
166
|
"week-starts-on"
|
|
167
|
-
]),
|
|
167
|
+
]), f("div", { class: _($("footer")) }, [f("button", {
|
|
168
168
|
type: "button",
|
|
169
|
-
class:
|
|
169
|
+
class: _($("action")),
|
|
170
170
|
onClick: ae
|
|
171
|
-
},
|
|
171
|
+
}, x(g.todayLabel), 3), g.clearable ? (v(), d("button", {
|
|
172
172
|
key: 0,
|
|
173
173
|
type: "button",
|
|
174
|
-
class:
|
|
174
|
+
class: _($("action")),
|
|
175
175
|
onClick: oe
|
|
176
|
-
},
|
|
176
|
+
}, x(g.clearLabel), 3)) : ee("", !0)], 2)]),
|
|
177
177
|
_: 1
|
|
178
178
|
}, 8, ["class"])]),
|
|
179
179
|
_: 1
|