iryx-ui 0.16.0 → 0.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/component-names.d.ts +1 -1
- package/dist/component-names.js +1 -1
- package/dist/components/Calendar.js +5 -0
- package/dist/components/Calendar.vue.d.ts +69 -0
- package/dist/components/Calendar.vue_vue_type_script_setup_true_lang.js +168 -0
- package/dist/components/Combobox.vue.d.ts +9 -9
- package/dist/components/Combobox.vue_vue_type_script_setup_true_lang.js +180 -144
- package/dist/components/DateField.js +5 -0
- package/dist/components/DateField.vue.d.ts +38 -0
- package/dist/components/DateField.vue_vue_type_script_setup_true_lang.js +94 -0
- package/dist/components/DatePicker.vue.d.ts +7 -2
- package/dist/components/DatePicker.vue_vue_type_script_setup_true_lang.js +73 -124
- package/dist/components/DateRangePicker.vue.d.ts +2 -2
- package/dist/components/DateRangePicker.vue_vue_type_script_setup_true_lang.js +81 -78
- package/dist/components/DropdownMenu.vue.d.ts +13 -6
- package/dist/components/DropdownMenu.vue_vue_type_script_setup_true_lang.js +28 -22
- package/dist/components/Editable.js +5 -0
- package/dist/components/Editable.vue.d.ts +81 -0
- package/dist/components/Editable.vue_vue_type_script_setup_true_lang.js +140 -0
- package/dist/components/HoverCard.js +5 -0
- package/dist/components/HoverCard.vue.d.ts +68 -0
- package/dist/components/HoverCard.vue_vue_type_script_setup_true_lang.js +79 -0
- package/dist/components/TagsInput.vue.d.ts +2 -2
- package/dist/components/TimeField.vue_vue_type_script_setup_true_lang.js +17 -14
- package/dist/components/index.d.ts +4 -0
- package/dist/components/index.js +124 -116
- package/dist/index.d.ts +4 -0
- package/dist/index.js +130 -122
- package/dist/theme/accordion.d.ts +0 -15
- package/dist/theme/alert.d.ts +0 -3
- package/dist/theme/avatar.d.ts +0 -3
- package/dist/theme/banner.d.ts +0 -6
- package/dist/theme/bar-chart.d.ts +0 -18
- package/dist/theme/breadcrumb.d.ts +0 -3
- package/dist/theme/calendar.d.ts +62 -0
- package/dist/theme/calendar.js +29 -0
- package/dist/theme/card.d.ts +0 -6
- package/dist/theme/chart-legend.d.ts +0 -3
- package/dist/theme/checkbox.d.ts +0 -6
- package/dist/theme/color-picker.d.ts +0 -6
- package/dist/theme/combobox.js +4 -4
- package/dist/theme/command-palette.d.ts +0 -6
- package/dist/theme/container.d.ts +0 -3
- package/dist/theme/container.js +3 -3
- package/dist/theme/date-field.d.ts +65 -0
- package/dist/theme/date-field.js +21 -0
- package/dist/theme/date-picker.d.ts +0 -195
- package/dist/theme/date-picker.js +2 -24
- package/dist/theme/donut-chart.d.ts +0 -18
- package/dist/theme/dropdown-menu.d.ts +3 -0
- package/dist/theme/dropdown-menu.js +1 -0
- package/dist/theme/editable.d.ts +77 -0
- package/dist/theme/editable.js +26 -0
- package/dist/theme/empty-state.d.ts +0 -3
- package/dist/theme/file-upload.d.ts +0 -39
- package/dist/theme/hover-card.d.ts +92 -0
- package/dist/theme/hover-card.js +28 -0
- package/dist/theme/index.d.ts +4 -0
- package/dist/theme/input.d.ts +0 -18
- package/dist/theme/kbd.d.ts +0 -3
- package/dist/theme/line-chart.d.ts +0 -18
- package/dist/theme/navigation-menu.d.ts +0 -48
- package/dist/theme/number-input.d.ts +0 -3
- package/dist/theme/page-header.d.ts +0 -3
- package/dist/theme/password-input.d.ts +0 -23
- package/dist/theme/pin-input.d.ts +0 -3
- package/dist/theme/popover.d.ts +0 -6
- package/dist/theme/progress.d.ts +0 -51
- package/dist/theme/scroll-area.d.ts +0 -3
- package/dist/theme/separator.d.ts +0 -3
- package/dist/theme/sidebar.d.ts +0 -54
- package/dist/theme/skeleton.d.ts +0 -3
- package/dist/theme/skeleton.js +1 -1
- package/dist/theme/slider.d.ts +0 -6
- package/dist/theme/sparkline.d.ts +0 -11
- package/dist/theme/splitter.d.ts +0 -3
- package/dist/theme/stat.d.ts +0 -12
- package/dist/theme/stat.js +2 -2
- package/dist/theme/switch.d.ts +0 -6
- package/dist/theme/table.d.ts +0 -39
- package/dist/theme/tabs.d.ts +0 -12
- package/dist/theme/time-field.d.ts +0 -3
- package/dist/theme/timeline.d.ts +0 -18
- package/dist/theme/toast.d.ts +0 -3
- package/dist/theme/toggle.d.ts +0 -23
- package/dist/theme/tree.d.ts +0 -3
- package/package.json +1 -1
|
@@ -2,11 +2,11 @@ import { useIryxUiConfig as e } from "../config.js";
|
|
|
2
2
|
import t from "./Icon.js";
|
|
3
3
|
import { useFormField as n } from "../composables/form.js";
|
|
4
4
|
import { comboboxTheme as ee } from "../theme/combobox.js";
|
|
5
|
-
import { Fragment as r, computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s,
|
|
6
|
-
import { ArrowDown01Icon as
|
|
7
|
-
import { ComboboxAnchor as
|
|
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, watch as ne, withCtx as y, withDirectives as re, withKeys as ie, withModifiers as ae } from "vue";
|
|
6
|
+
import { ArrowDown01Icon as oe, Cancel01Icon as b, Tick02Icon as x } from "@hugeicons/core-free-icons";
|
|
7
|
+
import { ComboboxAnchor as se, ComboboxCancel as ce, ComboboxContent as le, ComboboxEmpty as ue, ComboboxGroup as de, ComboboxInput as S, ComboboxItem as C, ComboboxItemIndicator as w, ComboboxLabel as T, ComboboxPortal as fe, ComboboxRoot as pe, ComboboxTrigger as me, ComboboxViewport as he, ComboboxVirtualizer as ge, TagsInputInput as _e, TagsInputItem as ve, TagsInputItemDelete as ye, TagsInputItemText as be, TagsInputRoot as xe, useFilter as Se, useForwardPropsEmits as Ce } from "reka-ui";
|
|
8
8
|
//#region src/components/Combobox.vue?vue&type=script&setup=true&lang.ts
|
|
9
|
-
var
|
|
9
|
+
var E = /*@__PURE__*/ u({
|
|
10
10
|
inheritAttrs: !1,
|
|
11
11
|
__name: "Combobox",
|
|
12
12
|
props: {
|
|
@@ -86,185 +86,221 @@ var _e = ["aria-label", "onClick"], O = /*@__PURE__*/ d({
|
|
|
86
86
|
"update:open",
|
|
87
87
|
"create"
|
|
88
88
|
],
|
|
89
|
-
setup(
|
|
90
|
-
let
|
|
91
|
-
|
|
92
|
-
e !== void 0 && (
|
|
89
|
+
setup(u, { emit: E }) {
|
|
90
|
+
let D = u, O = E, k = m(D.modelValue ?? D.defaultValue);
|
|
91
|
+
ne(() => D.modelValue, (e) => {
|
|
92
|
+
e !== void 0 && (k.value = e);
|
|
93
93
|
});
|
|
94
|
-
function
|
|
95
|
-
|
|
94
|
+
function A(e) {
|
|
95
|
+
k.value = e, O("update:modelValue", e);
|
|
96
96
|
}
|
|
97
|
-
let
|
|
98
|
-
if (!
|
|
99
|
-
let e =
|
|
97
|
+
let we = i(() => {
|
|
98
|
+
if (!D.clearable || D.disabled) return !1;
|
|
99
|
+
let e = k.value;
|
|
100
100
|
return Array.isArray(e) ? e.length > 0 : e != null && e !== "";
|
|
101
|
-
}),
|
|
102
|
-
let { items: e, placeholder: t, size: n, invalid: ee, id: r, emptyText: i, clearable: a, clearLabel: o, removeLabel: s, create: c, createLabel: l, virtual: u, estimateSize: d, overscan: f, unstyled: p, class: m, ui: h, defaultValue: g, modelValue: _, ...v } =
|
|
101
|
+
}), j = Ce(i(() => {
|
|
102
|
+
let { items: e, placeholder: t, size: n, invalid: ee, id: r, emptyText: i, clearable: a, clearLabel: o, removeLabel: s, create: c, createLabel: l, virtual: u, estimateSize: d, overscan: f, unstyled: p, class: m, ui: h, defaultValue: g, modelValue: _, ...v } = D;
|
|
103
103
|
return {
|
|
104
104
|
...v,
|
|
105
|
-
modelValue:
|
|
105
|
+
modelValue: k.value
|
|
106
106
|
};
|
|
107
|
-
}),
|
|
108
|
-
function
|
|
107
|
+
}), O);
|
|
108
|
+
function M(e) {
|
|
109
109
|
return typeof e == "string" ? {
|
|
110
110
|
label: e,
|
|
111
111
|
value: e
|
|
112
112
|
} : e;
|
|
113
113
|
}
|
|
114
|
-
function
|
|
114
|
+
function N(e) {
|
|
115
115
|
return typeof e != "string" && "items" in e;
|
|
116
116
|
}
|
|
117
|
-
let
|
|
118
|
-
let e =
|
|
119
|
-
return e.some(
|
|
117
|
+
let P = i(() => {
|
|
118
|
+
let e = D.items ?? [];
|
|
119
|
+
return e.some(N) ? e.map((e) => N(e) ? e : {
|
|
120
120
|
label: "",
|
|
121
121
|
items: [e]
|
|
122
122
|
}) : void 0;
|
|
123
|
-
}),
|
|
124
|
-
function
|
|
125
|
-
|
|
123
|
+
}), F = i(() => (D.items ?? []).flatMap((e) => N(e) ? e.items.map(M) : [M(e)])), I = i(() => !!D.virtual), L = m(""), R = m("");
|
|
124
|
+
function z(e) {
|
|
125
|
+
R.value = e.target.value;
|
|
126
126
|
}
|
|
127
|
-
let { contains:
|
|
128
|
-
let e =
|
|
129
|
-
return e ?
|
|
130
|
-
}),
|
|
131
|
-
let e =
|
|
132
|
-
return Array.isArray(e) ? e.map((e) =>
|
|
127
|
+
let { contains: Te } = Se({ sensitivity: "base" }), B = i(() => {
|
|
128
|
+
let e = R.value.trim();
|
|
129
|
+
return e ? F.value.filter((t) => Te(t.label, e)) : F.value;
|
|
130
|
+
}), V = i(() => {
|
|
131
|
+
let e = k.value;
|
|
132
|
+
return Array.isArray(e) ? e.map((e) => F.value.find((t) => t.value === e) ?? {
|
|
133
133
|
label: String(e),
|
|
134
134
|
value: String(e)
|
|
135
135
|
}) : [];
|
|
136
|
-
}),
|
|
137
|
-
function
|
|
138
|
-
let t =
|
|
139
|
-
Array.isArray(t) &&
|
|
136
|
+
}), H = i(() => !!D.multiple && V.value.length > 0);
|
|
137
|
+
function Ee(e) {
|
|
138
|
+
let t = k.value;
|
|
139
|
+
Array.isArray(t) && A(t.filter((t) => t !== e));
|
|
140
140
|
}
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
141
|
+
let U = i({
|
|
142
|
+
get: () => V.value,
|
|
143
|
+
set: (e) => A(e.map((e) => e.value))
|
|
144
|
+
});
|
|
145
|
+
function W(e) {
|
|
146
|
+
let t = (e) => F.value.find((t) => t.value === e)?.label ?? String(e ?? "");
|
|
147
|
+
return Array.isArray(e) ? H.value ? "" : e.map(t).join(", ") : e == null || e === "" ? "" : t(e);
|
|
147
148
|
}
|
|
148
|
-
function
|
|
149
|
+
function G(e) {
|
|
149
150
|
let t = e.target;
|
|
150
151
|
requestAnimationFrame(() => {
|
|
151
152
|
document.activeElement === t && t.select();
|
|
152
|
-
}),
|
|
153
|
+
}), R.value = "";
|
|
153
154
|
}
|
|
154
155
|
let K = i(() => {
|
|
155
|
-
let e =
|
|
156
|
-
return !!
|
|
156
|
+
let e = R.value.trim();
|
|
157
|
+
return !!D.create && e.length > 0 && !F.value.some((t) => t.label.toLowerCase() === e.toLowerCase());
|
|
157
158
|
});
|
|
158
|
-
function
|
|
159
|
-
e.preventDefault(),
|
|
159
|
+
function De(e) {
|
|
160
|
+
e.preventDefault(), O("create", R.value.trim()), e.target?.dispatchEvent(new KeyboardEvent("keydown", {
|
|
160
161
|
key: "Escape",
|
|
161
162
|
bubbles: !0
|
|
162
163
|
}));
|
|
163
164
|
}
|
|
164
|
-
let
|
|
165
|
-
size:
|
|
166
|
-
chips:
|
|
165
|
+
let q = n(), J = i(() => D.id ?? q?.id.value), Y = i(() => D.invalid ?? q?.invalid.value ?? !1), Oe = e(), X = i(() => D.unstyled ?? Oe.unstyled), Z = i(() => ee({
|
|
166
|
+
size: D.size,
|
|
167
|
+
chips: H.value,
|
|
167
168
|
invalid: Y.value,
|
|
168
|
-
disabled:
|
|
169
|
+
disabled: D.disabled
|
|
169
170
|
}));
|
|
170
171
|
function Q(e, t) {
|
|
171
|
-
let n =
|
|
172
|
+
let n = D.ui?.[e];
|
|
172
173
|
return X.value ? [n, t] : Z.value[e]({ class: [n, t] });
|
|
173
174
|
}
|
|
174
175
|
let $ = i(() => X.value ? void 0 : Z.value.itemIndicator());
|
|
175
|
-
return (e, n) => (
|
|
176
|
+
return (e, n) => (p(), a(v(pe), d(v(j), {
|
|
176
177
|
"open-on-click": "",
|
|
177
|
-
"reset-model-value-on-clear":
|
|
178
|
+
"reset-model-value-on-clear": D.clearable || D.resetModelValueOnClear,
|
|
178
179
|
class: "contents",
|
|
179
|
-
"onUpdate:modelValue": n[
|
|
180
|
+
"onUpdate:modelValue": n[4] ||= (e) => k.value = e
|
|
180
181
|
}), {
|
|
181
|
-
default:
|
|
182
|
-
default:
|
|
183
|
-
|
|
182
|
+
default: y(() => [l(v(se), { class: f(Q("anchor", D.class)) }, {
|
|
183
|
+
default: y(() => [D.multiple ? (p(), a(v(xe), {
|
|
184
|
+
key: 0,
|
|
185
|
+
modelValue: U.value,
|
|
186
|
+
"onUpdate:modelValue": n[2] ||= (e) => U.value = e,
|
|
187
|
+
delimiter: "",
|
|
188
|
+
disabled: D.disabled,
|
|
189
|
+
class: "contents"
|
|
190
|
+
}, {
|
|
191
|
+
default: y(() => [(p(!0), s(r, null, h(V.value, (n) => (p(), a(v(ve), {
|
|
184
192
|
key: String(n.value),
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
option: n,
|
|
188
|
-
remove: () => G(n.value)
|
|
189
|
-
}, () => [c("span", { class: p(Q("tagText")) }, v(n.label), 3), c("button", {
|
|
190
|
-
type: "button",
|
|
191
|
-
tabindex: "-1",
|
|
192
|
-
"aria-label": k.removeLabel(n.label),
|
|
193
|
-
class: p(Q("tagDelete")),
|
|
194
|
-
onClick: ne((e) => G(n.value), ["stop"])
|
|
195
|
-
}, [u(t, { icon: y(C) }, null, 8, ["icon"])], 10, _e)])], 2))), 128)),
|
|
196
|
-
u(y(ce), f({
|
|
197
|
-
id: Ce.value,
|
|
198
|
-
modelValue: B.value,
|
|
199
|
-
"onUpdate:modelValue": n[0] ||= (e) => B.value = e
|
|
200
|
-
}, e.$attrs, {
|
|
201
|
-
placeholder: k.placeholder,
|
|
202
|
-
"display-value": xe,
|
|
203
|
-
"aria-invalid": Y.value || void 0,
|
|
204
|
-
"aria-describedby": y(J)?.describedBy.value,
|
|
205
|
-
class: Q("input"),
|
|
206
|
-
onFocus: Se,
|
|
207
|
-
onInput: ve,
|
|
208
|
-
onKeydown: be
|
|
209
|
-
}), null, 16, [
|
|
210
|
-
"id",
|
|
211
|
-
"modelValue",
|
|
212
|
-
"placeholder",
|
|
213
|
-
"aria-invalid",
|
|
214
|
-
"aria-describedby",
|
|
215
|
-
"class"
|
|
216
|
-
]),
|
|
217
|
-
N.value ? (m(), a(y(ie), {
|
|
218
|
-
key: 0,
|
|
219
|
-
"aria-label": k.clearLabel,
|
|
220
|
-
class: p(Q("clear"))
|
|
193
|
+
value: n,
|
|
194
|
+
class: f(Q("tag"))
|
|
221
195
|
}, {
|
|
222
|
-
default:
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
196
|
+
default: y(() => [g(e.$slots, "tag", {
|
|
197
|
+
option: n,
|
|
198
|
+
remove: () => Ee(n.value)
|
|
199
|
+
}, () => [l(v(be), { class: f(Q("tagText")) }, {
|
|
200
|
+
default: y(() => [c(_(n.label), 1)]),
|
|
201
|
+
_: 2
|
|
202
|
+
}, 1032, ["class"]), l(v(ye), {
|
|
203
|
+
"aria-label": D.removeLabel(n.label),
|
|
204
|
+
class: f(Q("tagDelete"))
|
|
205
|
+
}, {
|
|
206
|
+
default: y(() => [l(t, { icon: v(b) }, null, 8, ["icon"])]),
|
|
207
|
+
_: 1
|
|
208
|
+
}, 8, ["aria-label", "class"])])]),
|
|
209
|
+
_: 2
|
|
210
|
+
}, 1032, ["value", "class"]))), 128)), l(v(S), {
|
|
211
|
+
id: J.value,
|
|
212
|
+
modelValue: L.value,
|
|
213
|
+
"onUpdate:modelValue": n[1] ||= (e) => L.value = e,
|
|
214
|
+
"as-child": "",
|
|
215
|
+
"display-value": W
|
|
227
216
|
}, {
|
|
228
|
-
default:
|
|
217
|
+
default: y(() => [l(v(_e), d(e.$attrs, {
|
|
218
|
+
placeholder: D.placeholder,
|
|
219
|
+
"aria-invalid": Y.value || void 0,
|
|
220
|
+
"aria-describedby": v(q)?.describedBy.value,
|
|
221
|
+
class: Q("input"),
|
|
222
|
+
onKeydown: n[0] ||= ie(ae(() => {}, ["prevent"]), ["enter"]),
|
|
223
|
+
onFocus: G,
|
|
224
|
+
onInput: z
|
|
225
|
+
}), null, 16, [
|
|
226
|
+
"placeholder",
|
|
227
|
+
"aria-invalid",
|
|
228
|
+
"aria-describedby",
|
|
229
|
+
"class"
|
|
230
|
+
])]),
|
|
229
231
|
_: 1
|
|
230
|
-
}, 8, ["
|
|
231
|
-
|
|
232
|
+
}, 8, ["id", "modelValue"])]),
|
|
233
|
+
_: 3
|
|
234
|
+
}, 8, ["modelValue", "disabled"])) : (p(), a(v(S), d({
|
|
235
|
+
key: 1,
|
|
236
|
+
id: J.value,
|
|
237
|
+
modelValue: L.value,
|
|
238
|
+
"onUpdate:modelValue": n[3] ||= (e) => L.value = e
|
|
239
|
+
}, e.$attrs, {
|
|
240
|
+
placeholder: D.placeholder,
|
|
241
|
+
"display-value": W,
|
|
242
|
+
"aria-invalid": Y.value || void 0,
|
|
243
|
+
"aria-describedby": v(q)?.describedBy.value,
|
|
244
|
+
class: Q("input"),
|
|
245
|
+
onFocus: G,
|
|
246
|
+
onInput: z
|
|
247
|
+
}), null, 16, [
|
|
248
|
+
"id",
|
|
249
|
+
"modelValue",
|
|
250
|
+
"placeholder",
|
|
251
|
+
"aria-invalid",
|
|
252
|
+
"aria-describedby",
|
|
253
|
+
"class"
|
|
254
|
+
])), we.value ? (p(), a(v(ce), {
|
|
255
|
+
key: 2,
|
|
256
|
+
"aria-label": D.clearLabel,
|
|
257
|
+
class: f(Q("clear"))
|
|
258
|
+
}, {
|
|
259
|
+
default: y(() => [l(t, { icon: v(b) }, null, 8, ["icon"])]),
|
|
260
|
+
_: 1
|
|
261
|
+
}, 8, ["aria-label", "class"])) : (p(), a(v(me), {
|
|
262
|
+
key: 3,
|
|
263
|
+
class: f(Q("trigger"))
|
|
264
|
+
}, {
|
|
265
|
+
default: y(() => [l(t, { icon: v(oe) }, null, 8, ["icon"])]),
|
|
266
|
+
_: 1
|
|
267
|
+
}, 8, ["class"]))]),
|
|
232
268
|
_: 3
|
|
233
|
-
}, 8, ["class"]),
|
|
234
|
-
default:
|
|
235
|
-
class:
|
|
269
|
+
}, 8, ["class"]), l(v(fe), null, {
|
|
270
|
+
default: y(() => [l(v(le), {
|
|
271
|
+
class: f(Q("content")),
|
|
236
272
|
position: "popper",
|
|
237
273
|
"side-offset": 4
|
|
238
274
|
}, {
|
|
239
|
-
default:
|
|
240
|
-
default:
|
|
241
|
-
|
|
275
|
+
default: y(() => [l(v(he), { class: f(Q("viewport")) }, {
|
|
276
|
+
default: y(() => [
|
|
277
|
+
I.value ? re((p(), s("div", {
|
|
242
278
|
key: 0,
|
|
243
|
-
class:
|
|
244
|
-
}, [
|
|
279
|
+
class: f(Q("empty"))
|
|
280
|
+
}, [g(e.$slots, "empty", { query: R.value }, () => [c(_(D.emptyText), 1)])], 2)), [[te, !K.value && B.value.length === 0]]) : K.value ? o("", !0) : (p(), a(v(ue), {
|
|
245
281
|
key: 1,
|
|
246
|
-
class:
|
|
282
|
+
class: f(Q("empty"))
|
|
247
283
|
}, {
|
|
248
|
-
default:
|
|
284
|
+
default: y(() => [g(e.$slots, "empty", { query: R.value }, () => [c(_(D.emptyText), 1)])]),
|
|
249
285
|
_: 3
|
|
250
286
|
}, 8, ["class"])),
|
|
251
|
-
|
|
287
|
+
g(e.$slots, "default", {}, () => [I.value ? (p(), a(v(ge), {
|
|
252
288
|
key: 0,
|
|
253
|
-
options:
|
|
254
|
-
"estimate-size":
|
|
255
|
-
overscan:
|
|
289
|
+
options: B.value,
|
|
290
|
+
"estimate-size": D.estimateSize,
|
|
291
|
+
overscan: D.overscan,
|
|
256
292
|
"text-content": (e) => e.label
|
|
257
293
|
}, {
|
|
258
|
-
default:
|
|
294
|
+
default: y(({ option: e }) => [l(v(C), {
|
|
259
295
|
value: e.value,
|
|
260
296
|
"text-value": e.label,
|
|
261
297
|
disabled: e.disabled,
|
|
262
|
-
class:
|
|
298
|
+
class: f(Q("item"))
|
|
263
299
|
}, {
|
|
264
|
-
default:
|
|
265
|
-
default:
|
|
300
|
+
default: y(() => [l(v(w), { class: f($.value) }, {
|
|
301
|
+
default: y(() => [l(t, { icon: v(x) }, null, 8, ["icon"])]),
|
|
266
302
|
_: 1
|
|
267
|
-
}, 8, ["class"]),
|
|
303
|
+
}, 8, ["class"]), c(" " + _(e.label), 1)]),
|
|
268
304
|
_: 2
|
|
269
305
|
}, 1032, [
|
|
270
306
|
"value",
|
|
@@ -278,27 +314,27 @@ var _e = ["aria-label", "onClick"], O = /*@__PURE__*/ d({
|
|
|
278
314
|
"estimate-size",
|
|
279
315
|
"overscan",
|
|
280
316
|
"text-content"
|
|
281
|
-
])) :
|
|
317
|
+
])) : P.value ? (p(!0), s(r, { key: 1 }, h(P.value, (e, n) => (p(), a(v(de), {
|
|
282
318
|
key: e.label || n,
|
|
283
|
-
class:
|
|
319
|
+
class: f(Q("group"))
|
|
284
320
|
}, {
|
|
285
|
-
default:
|
|
321
|
+
default: y(() => [e.label ? (p(), a(v(T), {
|
|
286
322
|
key: 0,
|
|
287
|
-
class:
|
|
323
|
+
class: f(Q("groupLabel"))
|
|
288
324
|
}, {
|
|
289
|
-
default:
|
|
325
|
+
default: y(() => [c(_(e.label), 1)]),
|
|
290
326
|
_: 2
|
|
291
|
-
}, 1032, ["class"])) : o("", !0), (
|
|
327
|
+
}, 1032, ["class"])) : o("", !0), (p(!0), s(r, null, h(e.items, (e) => (p(), a(v(C), {
|
|
292
328
|
key: typeof e == "string" ? e : e.value,
|
|
293
329
|
value: typeof e == "string" ? e : e.value,
|
|
294
330
|
"text-value": typeof e == "string" ? e : e.label,
|
|
295
331
|
disabled: typeof e == "string" ? void 0 : e.disabled,
|
|
296
|
-
class:
|
|
332
|
+
class: f(Q("item"))
|
|
297
333
|
}, {
|
|
298
|
-
default:
|
|
299
|
-
default:
|
|
334
|
+
default: y(() => [l(v(w), { class: f($.value) }, {
|
|
335
|
+
default: y(() => [l(t, { icon: v(x) }, null, 8, ["icon"])]),
|
|
300
336
|
_: 1
|
|
301
|
-
}, 8, ["class"]),
|
|
337
|
+
}, 8, ["class"]), c(" " + _(typeof e == "string" ? e : e.label), 1)]),
|
|
302
338
|
_: 2
|
|
303
339
|
}, 1032, [
|
|
304
340
|
"value",
|
|
@@ -307,17 +343,17 @@ var _e = ["aria-label", "onClick"], O = /*@__PURE__*/ d({
|
|
|
307
343
|
"class"
|
|
308
344
|
]))), 128))]),
|
|
309
345
|
_: 2
|
|
310
|
-
}, 1032, ["class"]))), 128)) : (
|
|
346
|
+
}, 1032, ["class"]))), 128)) : (p(!0), s(r, { key: 2 }, h(F.value, (e) => (p(), a(v(C), {
|
|
311
347
|
key: e.value,
|
|
312
348
|
value: e.value,
|
|
313
349
|
"text-value": e.label,
|
|
314
350
|
disabled: e.disabled,
|
|
315
|
-
class:
|
|
351
|
+
class: f(Q("item"))
|
|
316
352
|
}, {
|
|
317
|
-
default:
|
|
318
|
-
default:
|
|
353
|
+
default: y(() => [l(v(w), { class: f($.value) }, {
|
|
354
|
+
default: y(() => [l(t, { icon: v(x) }, null, 8, ["icon"])]),
|
|
319
355
|
_: 1
|
|
320
|
-
}, 8, ["class"]),
|
|
356
|
+
}, 8, ["class"]), c(" " + _(e.label), 1)]),
|
|
321
357
|
_: 2
|
|
322
358
|
}, 1032, [
|
|
323
359
|
"value",
|
|
@@ -325,15 +361,15 @@ var _e = ["aria-label", "onClick"], O = /*@__PURE__*/ d({
|
|
|
325
361
|
"disabled",
|
|
326
362
|
"class"
|
|
327
363
|
]))), 128))]),
|
|
328
|
-
K.value ? (
|
|
329
|
-
key:
|
|
330
|
-
value:
|
|
364
|
+
K.value ? (p(), a(v(C), {
|
|
365
|
+
key: R.value,
|
|
366
|
+
value: R.value,
|
|
331
367
|
"data-create": "",
|
|
332
|
-
"text-value":
|
|
333
|
-
class:
|
|
334
|
-
onSelect:
|
|
368
|
+
"text-value": R.value,
|
|
369
|
+
class: f(Q("item")),
|
|
370
|
+
onSelect: De
|
|
335
371
|
}, {
|
|
336
|
-
default:
|
|
372
|
+
default: y(() => [g(e.$slots, "create", { query: R.value }, () => [c(_(D.createLabel(R.value.trim())), 1)])]),
|
|
337
373
|
_: 3
|
|
338
374
|
}, 8, [
|
|
339
375
|
"value",
|
|
@@ -352,4 +388,4 @@ var _e = ["aria-label", "onClick"], O = /*@__PURE__*/ d({
|
|
|
352
388
|
}
|
|
353
389
|
});
|
|
354
390
|
//#endregion
|
|
355
|
-
export {
|
|
391
|
+
export { E as default };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export interface DateFieldProps {
|
|
2
|
+
/** ISO `YYYY-MM-DD`, never a `Date`. See `composables/date.ts` for why. */
|
|
3
|
+
modelValue?: string | null;
|
|
4
|
+
/** Earliest and latest allowed, in the same ISO form. */
|
|
5
|
+
minValue?: string;
|
|
6
|
+
maxValue?: string;
|
|
7
|
+
/** Orders the segments and names the months — `en-GB` gives day first. */
|
|
8
|
+
locale?: string;
|
|
9
|
+
/** Refuse a date. Given an ISO `YYYY-MM-DD` string. */
|
|
10
|
+
isUnavailable?: (date: string) => boolean;
|
|
11
|
+
size?: 'sm' | 'md' | 'lg';
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
readonly?: boolean;
|
|
14
|
+
invalid?: boolean;
|
|
15
|
+
id?: string;
|
|
16
|
+
/** Submitted with a surrounding native form. */
|
|
17
|
+
name?: string;
|
|
18
|
+
required?: boolean;
|
|
19
|
+
/** Skip built-in classes; you take over styling entirely. */
|
|
20
|
+
unstyled?: boolean;
|
|
21
|
+
class?: string;
|
|
22
|
+
/** Override classes per slot, e.g. `{ segment: 'px-1' }`. */
|
|
23
|
+
ui?: {
|
|
24
|
+
root?: string;
|
|
25
|
+
segment?: string;
|
|
26
|
+
literal?: string;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
declare const __VLS_export: import("vue").DefineComponent<DateFieldProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
30
|
+
"update:modelValue": (value: string | null) => any;
|
|
31
|
+
}, string, import("vue").PublicProps, Readonly<DateFieldProps> & Readonly<{
|
|
32
|
+
"onUpdate:modelValue"?: ((value: string | null) => any) | undefined;
|
|
33
|
+
}>, {
|
|
34
|
+
unstyled: boolean;
|
|
35
|
+
invalid: boolean;
|
|
36
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
37
|
+
declare const _default: typeof __VLS_export;
|
|
38
|
+
export default _default;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { useIryxUiConfig as e } from "../config.js";
|
|
2
|
+
import { toCalendarDate as t, toIsoDate as n } from "../composables/date.js";
|
|
3
|
+
import { useFormField as r } from "../composables/form.js";
|
|
4
|
+
import { dateFieldTheme as i } from "../theme/date-field.js";
|
|
5
|
+
import { Fragment as a, computed as o, createBlock as s, createElementBlock as c, createTextVNode as l, defineComponent as u, normalizeClass as d, openBlock as f, renderList as p, toDisplayString as m, unref as h, withCtx as g } from "vue";
|
|
6
|
+
import { DateFieldInput as _, DateFieldRoot as v } from "reka-ui";
|
|
7
|
+
//#region src/components/DateField.vue?vue&type=script&setup=true&lang.ts
|
|
8
|
+
var y = /*@__PURE__*/ u({
|
|
9
|
+
__name: "DateField",
|
|
10
|
+
props: {
|
|
11
|
+
modelValue: {},
|
|
12
|
+
minValue: {},
|
|
13
|
+
maxValue: {},
|
|
14
|
+
locale: {},
|
|
15
|
+
isUnavailable: {},
|
|
16
|
+
size: {},
|
|
17
|
+
disabled: { type: Boolean },
|
|
18
|
+
readonly: { type: Boolean },
|
|
19
|
+
invalid: {
|
|
20
|
+
type: Boolean,
|
|
21
|
+
default: void 0
|
|
22
|
+
},
|
|
23
|
+
id: {},
|
|
24
|
+
name: {},
|
|
25
|
+
required: { type: Boolean },
|
|
26
|
+
unstyled: {
|
|
27
|
+
type: Boolean,
|
|
28
|
+
default: void 0
|
|
29
|
+
},
|
|
30
|
+
class: {},
|
|
31
|
+
ui: {}
|
|
32
|
+
},
|
|
33
|
+
emits: ["update:modelValue"],
|
|
34
|
+
setup(u, { emit: y }) {
|
|
35
|
+
let b = u, x = y, S = r(), C = o(() => b.id ?? S?.id.value), w = o(() => {
|
|
36
|
+
let e = b.modelValue;
|
|
37
|
+
return !e || !t(e) ? !1 : b.minValue && e < b.minValue || b.maxValue && e > b.maxValue ? !0 : b.isUnavailable?.(e) ?? !1;
|
|
38
|
+
}), T = o(() => (b.invalid ?? S?.invalid.value ?? !1) || w.value), E = e(), D = o(() => b.unstyled ?? E.unstyled), O = o(() => {
|
|
39
|
+
let e = b.isUnavailable;
|
|
40
|
+
if (e) return (t) => {
|
|
41
|
+
let r = n(t);
|
|
42
|
+
return r ? e(r) : !1;
|
|
43
|
+
};
|
|
44
|
+
}), k = o(() => i({
|
|
45
|
+
size: b.size,
|
|
46
|
+
invalid: T.value
|
|
47
|
+
})), A = o(() => D.value ? [b.ui?.root, b.class] : k.value.root({ class: [b.ui?.root, b.class] })), j = o(() => D.value ? b.ui?.segment : k.value.segment({ class: b.ui?.segment })), M = o(() => D.value ? b.ui?.literal : k.value.literal({ class: b.ui?.literal }));
|
|
48
|
+
return (e, r) => (f(), s(h(v), {
|
|
49
|
+
id: C.value,
|
|
50
|
+
"model-value": h(t)(b.modelValue),
|
|
51
|
+
"min-value": h(t)(b.minValue),
|
|
52
|
+
"max-value": h(t)(b.maxValue),
|
|
53
|
+
locale: b.locale,
|
|
54
|
+
"is-date-unavailable": O.value,
|
|
55
|
+
disabled: b.disabled,
|
|
56
|
+
readonly: b.readonly,
|
|
57
|
+
name: b.name,
|
|
58
|
+
required: b.required,
|
|
59
|
+
"aria-invalid": T.value || void 0,
|
|
60
|
+
"aria-describedby": h(S)?.describedBy.value,
|
|
61
|
+
class: d(A.value),
|
|
62
|
+
"onUpdate:modelValue": r[0] ||= (e) => x("update:modelValue", h(n)(e))
|
|
63
|
+
}, {
|
|
64
|
+
default: g(({ segments: e }) => [(f(!0), c(a, null, p(e, (e) => (f(), c(a, { key: e.part }, [e.part === "literal" ? (f(), c("span", {
|
|
65
|
+
key: 0,
|
|
66
|
+
class: d(M.value)
|
|
67
|
+
}, m(e.value), 3)) : (f(), s(h(_), {
|
|
68
|
+
key: 1,
|
|
69
|
+
part: e.part,
|
|
70
|
+
class: d(j.value)
|
|
71
|
+
}, {
|
|
72
|
+
default: g(() => [l(m(e.value), 1)]),
|
|
73
|
+
_: 2
|
|
74
|
+
}, 1032, ["part", "class"]))], 64))), 128))]),
|
|
75
|
+
_: 1
|
|
76
|
+
}, 8, [
|
|
77
|
+
"id",
|
|
78
|
+
"model-value",
|
|
79
|
+
"min-value",
|
|
80
|
+
"max-value",
|
|
81
|
+
"locale",
|
|
82
|
+
"is-date-unavailable",
|
|
83
|
+
"disabled",
|
|
84
|
+
"readonly",
|
|
85
|
+
"name",
|
|
86
|
+
"required",
|
|
87
|
+
"aria-invalid",
|
|
88
|
+
"aria-describedby",
|
|
89
|
+
"class"
|
|
90
|
+
]));
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
//#endregion
|
|
94
|
+
export { y as default };
|
|
@@ -15,6 +15,11 @@ export interface DatePickerProps {
|
|
|
15
15
|
format?: Intl.DateTimeFormatOptions;
|
|
16
16
|
/** 0 is Sunday. Defaults to the locale's own convention. */
|
|
17
17
|
weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
18
|
+
/**
|
|
19
|
+
* Refuse a date — a taken slot, a closed day. Given an ISO `YYYY-MM-DD`
|
|
20
|
+
* string. Unavailable days are struck through rather than hidden.
|
|
21
|
+
*/
|
|
22
|
+
isUnavailable?: (date: string) => boolean;
|
|
18
23
|
/** Offer a "clear" action in the footer. */
|
|
19
24
|
clearable?: boolean;
|
|
20
25
|
/** Footer and navigation labels — override for non-English apps. */
|
|
@@ -42,11 +47,11 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
|
|
|
42
47
|
}>, {
|
|
43
48
|
unstyled: boolean;
|
|
44
49
|
placeholder: string;
|
|
50
|
+
previousLabel: string;
|
|
51
|
+
nextLabel: string;
|
|
45
52
|
invalid: boolean;
|
|
46
53
|
clearLabel: string;
|
|
47
54
|
todayLabel: string;
|
|
48
|
-
previousLabel: string;
|
|
49
|
-
nextLabel: string;
|
|
50
55
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
51
56
|
declare const _default: typeof __VLS_export;
|
|
52
57
|
export default _default;
|