cisse-vue-ui 0.6.0 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{FilterTabs.vue_vue_type_script_setup_true_lang-AFYkni3y.js → FilterTabs.vue_vue_type_script_setup_true_lang-C5vnz3qo.js} +2 -2
- package/dist/{FilterTabs.vue_vue_type_script_setup_true_lang-AFYkni3y.js.map → FilterTabs.vue_vue_type_script_setup_true_lang-C5vnz3qo.js.map} +1 -1
- package/dist/{FormActions.vue_vue_type_script_setup_true_lang-d2aur5Pu.js → TagsInput-CFAC_MSw.js} +1654 -302
- package/dist/TagsInput-CFAC_MSw.js.map +1 -0
- package/dist/{FormActions.vue_vue_type_script_setup_true_lang-DzN_fbUC.cjs → TagsInput-DVebLEH2.cjs} +1649 -297
- package/dist/TagsInput-DVebLEH2.cjs.map +1 -0
- package/dist/cisse-vue-ui.css +10 -0
- package/dist/components/core/index.js +1 -1
- package/dist/components/form/EmailInput.stories.d.ts +13 -0
- package/dist/components/form/EmailInput.test.d.ts +1 -0
- package/dist/components/form/EmailInput.vue.d.ts +32 -0
- package/dist/components/form/InputWrapper.stories.d.ts +16 -0
- package/dist/components/form/InputWrapper.test.d.ts +1 -0
- package/dist/components/form/InputWrapper.vue.d.ts +40 -0
- package/dist/components/form/MoneyInput.stories.d.ts +16 -0
- package/dist/components/form/MoneyInput.test.d.ts +1 -0
- package/dist/components/form/MoneyInput.vue.d.ts +40 -0
- package/dist/components/form/NumberInput.stories.d.ts +14 -0
- package/dist/components/form/NumberInput.test.d.ts +1 -0
- package/dist/components/form/NumberInput.vue.d.ts +39 -0
- package/dist/components/form/OTPInput.stories.d.ts +13 -0
- package/dist/components/form/OTPInput.test.d.ts +1 -0
- package/dist/components/form/OTPInput.vue.d.ts +33 -0
- package/dist/components/form/PasswordInput.stories.d.ts +15 -0
- package/dist/components/form/PasswordInput.test.d.ts +1 -0
- package/dist/components/form/PasswordInput.vue.d.ts +36 -0
- package/dist/components/form/PercentInput.stories.d.ts +12 -0
- package/dist/components/form/PercentInput.test.d.ts +1 -0
- package/dist/components/form/PercentInput.vue.d.ts +38 -0
- package/dist/components/form/PhoneInput.stories.d.ts +13 -0
- package/dist/components/form/PhoneInput.test.d.ts +1 -0
- package/dist/components/form/PhoneInput.vue.d.ts +89 -0
- package/dist/components/form/QuantityInput.stories.d.ts +12 -0
- package/dist/components/form/QuantityInput.test.d.ts +1 -0
- package/dist/components/form/QuantityInput.vue.d.ts +32 -0
- package/dist/components/form/SearchInput.vue.d.ts +18 -4
- package/dist/components/form/TagsInput.stories.d.ts +13 -0
- package/dist/components/form/TagsInput.test.d.ts +1 -0
- package/dist/components/form/TagsInput.vue.d.ts +37 -0
- package/dist/components/form/URLInput.stories.d.ts +11 -0
- package/dist/components/form/URLInput.test.d.ts +1 -0
- package/dist/components/form/URLInput.vue.d.ts +32 -0
- package/dist/components/form/index.cjs +29 -18
- package/dist/components/form/index.cjs.map +1 -1
- package/dist/components/form/index.d.ts +15 -0
- package/dist/components/form/index.js +14 -3
- package/dist/components/index.cjs +29 -18
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.js +15 -4
- package/dist/{index-Bp7Mpfbi.cjs → index-Bl5eyNdr.cjs} +31 -20
- package/dist/index-Bl5eyNdr.cjs.map +1 -0
- package/dist/index-Cke8qLRH.js +95 -0
- package/dist/index-Cke8qLRH.js.map +1 -0
- package/dist/{index-BaWpldIJ.js → index-SNefWfX0.js} +3 -3
- package/dist/{index-BaWpldIJ.js.map → index-SNefWfX0.js.map} +1 -1
- package/dist/index.cjs +30 -19
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +26 -15
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/dist/FormActions.vue_vue_type_script_setup_true_lang-DzN_fbUC.cjs.map +0 -1
- package/dist/FormActions.vue_vue_type_script_setup_true_lang-d2aur5Pu.js.map +0 -1
- package/dist/index-6hQQcCpF.js +0 -84
- package/dist/index-6hQQcCpF.js.map +0 -1
- package/dist/index-Bp7Mpfbi.cjs.map +0 -1
package/dist/{FormActions.vue_vue_type_script_setup_true_lang-d2aur5Pu.js → TagsInput-CFAC_MSw.js}
RENAMED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { defineComponent, createElementBlock, openBlock, renderSlot, createTextVNode, toDisplayString,
|
|
1
|
+
import { defineComponent, createElementBlock, openBlock, renderSlot, createTextVNode, toDisplayString, useSlots, computed, normalizeClass, createCommentVNode, createBlock, unref, mergeModels, useModel, withCtx, withDirectives, createElementVNode, mergeProps, vModelDynamic, ref, watch, createVNode, Teleport, Transition, normalizeStyle, vModelText, Fragment, renderList, nextTick, withModifiers, withKeys, vShow, createSlots, onMounted, TransitionGroup } from "vue";
|
|
2
2
|
import { u as useId } from "./useId-xeHj7rkg.js";
|
|
3
3
|
import { Icon } from "@iconify/vue";
|
|
4
4
|
import { u as useDropdown } from "./useDropdown-iVu14E6s.js";
|
|
5
5
|
import { _ as _export_sfc } from "./_plugin-vue_export-helper-1tPrXgE0.js";
|
|
6
|
-
import { o as onClickOutside,
|
|
7
|
-
import { _ as _sfc_main$
|
|
8
|
-
const _hoisted_1$
|
|
9
|
-
const _sfc_main$
|
|
6
|
+
import { o as onClickOutside, a as useDebounceFn } from "./index-SNefWfX0.js";
|
|
7
|
+
import { _ as _sfc_main$s } from "./Button.vue_vue_type_script_setup_true_lang-CBYr0Z2_.js";
|
|
8
|
+
const _hoisted_1$r = ["data-error", "for"];
|
|
9
|
+
const _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
10
10
|
__name: "FormLabel",
|
|
11
11
|
props: {
|
|
12
12
|
error: { type: [String, Boolean] },
|
|
@@ -20,12 +20,12 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
20
20
|
class: "block text-sm font-medium text-gray-700 data-[error=true]:text-red-500 dark:text-gray-300"
|
|
21
21
|
}, [
|
|
22
22
|
renderSlot(_ctx.$slots, "default")
|
|
23
|
-
], 8, _hoisted_1$
|
|
23
|
+
], 8, _hoisted_1$r);
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
26
|
});
|
|
27
|
-
const _hoisted_1$
|
|
28
|
-
const _sfc_main$
|
|
27
|
+
const _hoisted_1$q = ["id", "data-error", "role", "aria-live"];
|
|
28
|
+
const _sfc_main$q = /* @__PURE__ */ defineComponent({
|
|
29
29
|
__name: "FormHelp",
|
|
30
30
|
props: {
|
|
31
31
|
id: {},
|
|
@@ -44,18 +44,86 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
44
44
|
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
45
45
|
createTextVNode(toDisplayString(__props.text ?? ""), 1)
|
|
46
46
|
])
|
|
47
|
-
], 8, _hoisted_1$
|
|
47
|
+
], 8, _hoisted_1$q);
|
|
48
48
|
};
|
|
49
49
|
}
|
|
50
50
|
});
|
|
51
|
-
const _hoisted_1$
|
|
51
|
+
const _hoisted_1$p = {
|
|
52
52
|
key: 0,
|
|
53
|
-
class: "
|
|
53
|
+
class: "absolute left-3 top-1/2 -translate-y-1/2 pointer-events-none text-gray-400"
|
|
54
54
|
};
|
|
55
|
-
const _hoisted_2$
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
55
|
+
const _hoisted_2$h = {
|
|
56
|
+
key: 1,
|
|
57
|
+
class: "absolute right-3 top-1/2 -translate-y-1/2 flex items-center gap-1"
|
|
58
|
+
};
|
|
59
|
+
const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
60
|
+
__name: "InputWrapper",
|
|
61
|
+
props: {
|
|
62
|
+
icon: {},
|
|
63
|
+
iconRight: {},
|
|
64
|
+
size: { default: "md" },
|
|
65
|
+
invalid: { type: Boolean },
|
|
66
|
+
disabled: { type: Boolean },
|
|
67
|
+
wrapperClass: {}
|
|
68
|
+
},
|
|
69
|
+
setup(__props, { expose: __expose }) {
|
|
70
|
+
const props = __props;
|
|
71
|
+
const slots = useSlots();
|
|
72
|
+
const hasLeftIcon = computed(() => props.icon || slots.icon);
|
|
73
|
+
const hasRightContent = computed(() => props.iconRight || slots.actions);
|
|
74
|
+
const inputClass = computed(() => [
|
|
75
|
+
// Base styles
|
|
76
|
+
"block w-full rounded-xl border text-sm transition-all",
|
|
77
|
+
"border-gray-200 bg-gray-50 text-gray-900 placeholder-gray-400",
|
|
78
|
+
"focus:border-primary-500 focus:ring-2 focus:ring-primary-500 focus:bg-white focus:outline-hidden",
|
|
79
|
+
"disabled:border-gray-200 disabled:bg-gray-100 disabled:text-gray-500 disabled:cursor-not-allowed",
|
|
80
|
+
// Dark mode
|
|
81
|
+
"dark:border-slate-600 dark:bg-slate-700 dark:text-white dark:placeholder-gray-500",
|
|
82
|
+
"dark:focus:border-primary-500 dark:focus:ring-primary-500 dark:focus:bg-slate-600",
|
|
83
|
+
"dark:disabled:bg-slate-800 dark:disabled:text-gray-500",
|
|
84
|
+
// Padding based on icons/actions
|
|
85
|
+
hasLeftIcon.value ? "pl-10" : "pl-4",
|
|
86
|
+
hasRightContent.value ? "pr-10" : "pr-4",
|
|
87
|
+
// Size
|
|
88
|
+
props.size === "sm" && "py-2 text-xs",
|
|
89
|
+
props.size === "md" && "py-3 text-sm",
|
|
90
|
+
props.size === "lg" && "py-4 text-base",
|
|
91
|
+
// Invalid state
|
|
92
|
+
props.invalid && "border-red-500 focus:border-red-500 focus:ring-red-500 dark:border-red-500"
|
|
93
|
+
]);
|
|
94
|
+
__expose({ inputClass });
|
|
95
|
+
return (_ctx, _cache) => {
|
|
96
|
+
return openBlock(), createElementBlock("div", {
|
|
97
|
+
class: normalizeClass(["relative", __props.wrapperClass])
|
|
98
|
+
}, [
|
|
99
|
+
hasLeftIcon.value ? (openBlock(), createElementBlock("div", _hoisted_1$p, [
|
|
100
|
+
renderSlot(_ctx.$slots, "icon", {}, () => [
|
|
101
|
+
__props.icon ? (openBlock(), createBlock(unref(Icon), {
|
|
102
|
+
key: 0,
|
|
103
|
+
icon: __props.icon,
|
|
104
|
+
class: "size-5"
|
|
105
|
+
}, null, 8, ["icon"])) : createCommentVNode("", true)
|
|
106
|
+
])
|
|
107
|
+
])) : createCommentVNode("", true),
|
|
108
|
+
renderSlot(_ctx.$slots, "default", { inputClass: inputClass.value }),
|
|
109
|
+
hasRightContent.value ? (openBlock(), createElementBlock("div", _hoisted_2$h, [
|
|
110
|
+
renderSlot(_ctx.$slots, "actions", {}, () => [
|
|
111
|
+
__props.iconRight ? (openBlock(), createBlock(unref(Icon), {
|
|
112
|
+
key: 0,
|
|
113
|
+
icon: __props.iconRight,
|
|
114
|
+
class: "size-5 text-gray-400 pointer-events-none"
|
|
115
|
+
}, null, 8, ["icon"])) : createCommentVNode("", true)
|
|
116
|
+
])
|
|
117
|
+
])) : createCommentVNode("", true)
|
|
118
|
+
], 2);
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
const _hoisted_1$o = ["id", "disabled", "name", "placeholder", "type", "required", "aria-invalid", "aria-required", "aria-describedby"];
|
|
123
|
+
const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
124
|
+
...{
|
|
125
|
+
inheritAttrs: false
|
|
126
|
+
},
|
|
59
127
|
__name: "FormInput",
|
|
60
128
|
props: /* @__PURE__ */ mergeModels({
|
|
61
129
|
type: { default: "text" },
|
|
@@ -78,79 +146,57 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
78
146
|
const props = __props;
|
|
79
147
|
const modelValue = useModel(__props, "modelValue");
|
|
80
148
|
return (_ctx, _cache) => {
|
|
81
|
-
return
|
|
82
|
-
props.icon
|
|
83
|
-
|
|
84
|
-
icon: props.icon,
|
|
85
|
-
class: "absolute left-3 top-1/2 -translate-y-1/2 size-5 text-gray-400 pointer-events-none"
|
|
86
|
-
}, null, 8, ["icon"])) : createCommentVNode("", true),
|
|
87
|
-
withDirectives(createElementVNode("input", mergeProps({
|
|
88
|
-
id: props.id ?? props.name ?? "",
|
|
89
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => modelValue.value = $event),
|
|
90
|
-
disabled: props.disabled,
|
|
91
|
-
name: props.name ?? "",
|
|
92
|
-
placeholder: props.placeholder,
|
|
93
|
-
type: props.type,
|
|
94
|
-
required: props.required,
|
|
95
|
-
"aria-invalid": props.invalid || void 0,
|
|
96
|
-
"aria-required": props.required || void 0,
|
|
97
|
-
"aria-describedby": props.describedBy || void 0,
|
|
98
|
-
class: [
|
|
99
|
-
baseInputClass,
|
|
100
|
-
"py-3",
|
|
101
|
-
props.icon ? "pl-10" : "pl-4",
|
|
102
|
-
props.iconRight ? "pr-10" : "pr-4"
|
|
103
|
-
]
|
|
104
|
-
}, _ctx.$attrs), null, 16, _hoisted_2$c), [
|
|
105
|
-
[vModelDynamic, modelValue.value]
|
|
106
|
-
]),
|
|
107
|
-
props.iconRight ? (openBlock(), createBlock(unref(Icon), {
|
|
108
|
-
key: 1,
|
|
109
|
-
icon: props.iconRight,
|
|
110
|
-
class: "absolute right-3 top-1/2 -translate-y-1/2 size-5 text-gray-400 pointer-events-none"
|
|
111
|
-
}, null, 8, ["icon"])) : createCommentVNode("", true)
|
|
112
|
-
])) : withDirectives((openBlock(), createElementBlock("input", mergeProps({
|
|
113
|
-
key: 1,
|
|
114
|
-
id: props.id ?? props.name ?? "",
|
|
115
|
-
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => modelValue.value = $event),
|
|
149
|
+
return openBlock(), createBlock(_sfc_main$p, {
|
|
150
|
+
icon: props.icon,
|
|
151
|
+
"icon-right": props.iconRight,
|
|
116
152
|
disabled: props.disabled,
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
153
|
+
invalid: props.invalid
|
|
154
|
+
}, {
|
|
155
|
+
default: withCtx(({ inputClass }) => [
|
|
156
|
+
withDirectives(createElementVNode("input", mergeProps({
|
|
157
|
+
id: props.id ?? props.name ?? "",
|
|
158
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => modelValue.value = $event),
|
|
159
|
+
disabled: props.disabled,
|
|
160
|
+
name: props.name ?? "",
|
|
161
|
+
placeholder: props.placeholder,
|
|
162
|
+
type: props.type,
|
|
163
|
+
required: props.required,
|
|
164
|
+
"aria-invalid": props.invalid || void 0,
|
|
165
|
+
"aria-required": props.required || void 0,
|
|
166
|
+
"aria-describedby": props.describedBy || void 0,
|
|
167
|
+
class: inputClass
|
|
168
|
+
}, _ctx.$attrs), null, 16, _hoisted_1$o), [
|
|
169
|
+
[vModelDynamic, modelValue.value]
|
|
170
|
+
])
|
|
171
|
+
]),
|
|
172
|
+
_: 1
|
|
173
|
+
}, 8, ["icon", "icon-right", "disabled", "invalid"]);
|
|
128
174
|
};
|
|
129
175
|
}
|
|
130
176
|
});
|
|
131
|
-
const _hoisted_1$
|
|
132
|
-
const _hoisted_2$
|
|
133
|
-
const _hoisted_3$
|
|
134
|
-
const _hoisted_4$
|
|
135
|
-
const _hoisted_5$
|
|
177
|
+
const _hoisted_1$n = { class: "relative" };
|
|
178
|
+
const _hoisted_2$g = ["id", "disabled", "aria-expanded", "aria-controls", "aria-invalid", "aria-describedby"];
|
|
179
|
+
const _hoisted_3$f = { class: "flex-1 truncate" };
|
|
180
|
+
const _hoisted_4$b = ["id", "aria-label"];
|
|
181
|
+
const _hoisted_5$8 = {
|
|
136
182
|
key: 0,
|
|
137
183
|
class: "sticky top-0 border-b border-gray-200 bg-white p-2 dark:border-gray-700 dark:bg-gray-800"
|
|
138
184
|
};
|
|
139
|
-
const _hoisted_6$
|
|
140
|
-
const _hoisted_7$
|
|
185
|
+
const _hoisted_6$8 = { class: "flex items-center gap-2 rounded-md border border-gray-300 bg-gray-50 px-2 py-1.5 dark:border-gray-600 dark:bg-gray-900" };
|
|
186
|
+
const _hoisted_7$7 = {
|
|
141
187
|
key: 1,
|
|
142
188
|
class: "px-4 py-3 text-sm text-gray-500 dark:text-gray-400",
|
|
143
189
|
role: "status"
|
|
144
190
|
};
|
|
145
|
-
const _hoisted_8$
|
|
146
|
-
const _hoisted_9$
|
|
147
|
-
const _hoisted_10$
|
|
191
|
+
const _hoisted_8$6 = { class: "py-1" };
|
|
192
|
+
const _hoisted_9$4 = ["aria-selected", "data-index", "onClick", "onMouseenter"];
|
|
193
|
+
const _hoisted_10$4 = {
|
|
148
194
|
key: 1,
|
|
149
195
|
class: "size-4 shrink-0",
|
|
150
196
|
"aria-hidden": "true"
|
|
151
197
|
};
|
|
152
|
-
const _hoisted_11$
|
|
153
|
-
const _sfc_main$
|
|
198
|
+
const _hoisted_11$4 = { class: "flex-1" };
|
|
199
|
+
const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
154
200
|
__name: "FormSelect",
|
|
155
201
|
props: /* @__PURE__ */ mergeModels({
|
|
156
202
|
options: {},
|
|
@@ -270,7 +316,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
270
316
|
return [base, state, text, props.triggerClass];
|
|
271
317
|
});
|
|
272
318
|
return (_ctx, _cache) => {
|
|
273
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
319
|
+
return openBlock(), createElementBlock("div", _hoisted_1$n, [
|
|
274
320
|
createElementVNode("button", {
|
|
275
321
|
id: triggerId.value,
|
|
276
322
|
ref_key: "triggerRef",
|
|
@@ -290,14 +336,14 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
290
336
|
option: selectedOption.value,
|
|
291
337
|
placeholder: __props.placeholder
|
|
292
338
|
}, () => [
|
|
293
|
-
createElementVNode("span", _hoisted_3$
|
|
339
|
+
createElementVNode("span", _hoisted_3$f, toDisplayString(displayValue.value), 1)
|
|
294
340
|
]),
|
|
295
341
|
createVNode(unref(Icon), {
|
|
296
342
|
icon: "lucide:chevron-down",
|
|
297
343
|
class: normalizeClass(["size-4 shrink-0 text-gray-400 transition-transform", unref(isOpen) && "rotate-180"]),
|
|
298
344
|
"aria-hidden": "true"
|
|
299
345
|
}, null, 8, ["class"])
|
|
300
|
-
], 42, _hoisted_2$
|
|
346
|
+
], 42, _hoisted_2$g),
|
|
301
347
|
(openBlock(), createBlock(Teleport, {
|
|
302
348
|
to: "body",
|
|
303
349
|
disabled: !__props.teleport
|
|
@@ -324,8 +370,8 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
324
370
|
!__props.teleport && "absolute mt-1 w-full"
|
|
325
371
|
])
|
|
326
372
|
}, [
|
|
327
|
-
__props.searchable ? (openBlock(), createElementBlock("div", _hoisted_5$
|
|
328
|
-
createElementVNode("div", _hoisted_6$
|
|
373
|
+
__props.searchable ? (openBlock(), createElementBlock("div", _hoisted_5$8, [
|
|
374
|
+
createElementVNode("div", _hoisted_6$8, [
|
|
329
375
|
createVNode(unref(Icon), {
|
|
330
376
|
icon: "lucide:search",
|
|
331
377
|
class: "size-4 text-gray-400",
|
|
@@ -345,8 +391,8 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
345
391
|
])
|
|
346
392
|
])
|
|
347
393
|
])) : createCommentVNode("", true),
|
|
348
|
-
filteredOptions.value.length === 0 ? (openBlock(), createElementBlock("div", _hoisted_7$
|
|
349
|
-
createElementVNode("div", _hoisted_8$
|
|
394
|
+
filteredOptions.value.length === 0 ? (openBlock(), createElementBlock("div", _hoisted_7$7, toDisplayString(__props.noResultsText), 1)) : createCommentVNode("", true),
|
|
395
|
+
createElementVNode("div", _hoisted_8$6, [
|
|
350
396
|
(openBlock(true), createElementBlock(Fragment, null, renderList(filteredOptions.value, (option, index) => {
|
|
351
397
|
return openBlock(), createElementBlock("button", {
|
|
352
398
|
key: String(option.value),
|
|
@@ -373,13 +419,13 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
373
419
|
icon: "lucide:check",
|
|
374
420
|
class: "size-4 shrink-0 text-primary",
|
|
375
421
|
"aria-hidden": "true"
|
|
376
|
-
})) : (openBlock(), createElementBlock("span", _hoisted_10$
|
|
377
|
-
createElementVNode("span", _hoisted_11$
|
|
422
|
+
})) : (openBlock(), createElementBlock("span", _hoisted_10$4)),
|
|
423
|
+
createElementVNode("span", _hoisted_11$4, toDisplayString(option.label), 1)
|
|
378
424
|
])
|
|
379
|
-
], 42, _hoisted_9$
|
|
425
|
+
], 42, _hoisted_9$4);
|
|
380
426
|
}), 128))
|
|
381
427
|
])
|
|
382
|
-
], 14, _hoisted_4$
|
|
428
|
+
], 14, _hoisted_4$b)) : createCommentVNode("", true)
|
|
383
429
|
]),
|
|
384
430
|
_: 3
|
|
385
431
|
})
|
|
@@ -388,8 +434,8 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
388
434
|
};
|
|
389
435
|
}
|
|
390
436
|
});
|
|
391
|
-
const _hoisted_1$
|
|
392
|
-
const _sfc_main$
|
|
437
|
+
const _hoisted_1$m = ["hidden"];
|
|
438
|
+
const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
393
439
|
__name: "FormGroup",
|
|
394
440
|
props: /* @__PURE__ */ mergeModels({
|
|
395
441
|
label: {},
|
|
@@ -430,7 +476,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
430
476
|
}, [
|
|
431
477
|
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
432
478
|
renderSlot(_ctx.$slots, "label", {}, () => [
|
|
433
|
-
__props.label ? (openBlock(), createBlock(_sfc_main$
|
|
479
|
+
__props.label ? (openBlock(), createBlock(_sfc_main$r, {
|
|
434
480
|
key: 0,
|
|
435
481
|
"html-for": inputId.value,
|
|
436
482
|
error: __props.error
|
|
@@ -442,7 +488,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
442
488
|
}, 8, ["html-for", "error"])) : createCommentVNode("", true)
|
|
443
489
|
]),
|
|
444
490
|
renderSlot(_ctx.$slots, "input", {}, () => [
|
|
445
|
-
isSelect.value ? (openBlock(), createBlock(_sfc_main$
|
|
491
|
+
isSelect.value ? (openBlock(), createBlock(_sfc_main$n, mergeProps({
|
|
446
492
|
key: 0,
|
|
447
493
|
modelValue: modelValue.value,
|
|
448
494
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => modelValue.value = $event)
|
|
@@ -450,7 +496,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
450
496
|
id: inputId.value,
|
|
451
497
|
invalid: Boolean(__props.error),
|
|
452
498
|
"described-by": hasError.value ? helpId.value : void 0
|
|
453
|
-
}), null, 16, ["modelValue", "id", "invalid", "described-by"])) : (openBlock(), createBlock(_sfc_main$
|
|
499
|
+
}), null, 16, ["modelValue", "id", "invalid", "described-by"])) : (openBlock(), createBlock(_sfc_main$o, mergeProps({
|
|
454
500
|
key: 1,
|
|
455
501
|
modelValue: modelValue.value,
|
|
456
502
|
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => modelValue.value = $event)
|
|
@@ -460,7 +506,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
460
506
|
"described-by": hasError.value ? helpId.value : void 0
|
|
461
507
|
}), null, 16, ["modelValue", "id", "invalid", "described-by"]))
|
|
462
508
|
]),
|
|
463
|
-
hasError.value ? (openBlock(), createBlock(_sfc_main$
|
|
509
|
+
hasError.value ? (openBlock(), createBlock(_sfc_main$q, {
|
|
464
510
|
key: 0,
|
|
465
511
|
id: helpId.value,
|
|
466
512
|
error: true
|
|
@@ -471,53 +517,61 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
471
517
|
_: 1
|
|
472
518
|
}, 8, ["id"])) : createCommentVNode("", true)
|
|
473
519
|
])
|
|
474
|
-
], 12, _hoisted_1$
|
|
520
|
+
], 12, _hoisted_1$m);
|
|
475
521
|
};
|
|
476
522
|
}
|
|
477
523
|
});
|
|
478
|
-
const _hoisted_1$
|
|
479
|
-
const
|
|
480
|
-
|
|
524
|
+
const _hoisted_1$l = ["name", "placeholder", "disabled"];
|
|
525
|
+
const _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
526
|
+
...{
|
|
527
|
+
inheritAttrs: false
|
|
528
|
+
},
|
|
481
529
|
__name: "SearchInput",
|
|
482
|
-
props: {
|
|
483
|
-
modelValue: {},
|
|
530
|
+
props: /* @__PURE__ */ mergeModels({
|
|
484
531
|
placeholder: { default: "Search..." },
|
|
485
532
|
icon: { default: "lucide:search" },
|
|
486
|
-
disabled: { type: Boolean
|
|
487
|
-
|
|
533
|
+
disabled: { type: Boolean },
|
|
534
|
+
size: { default: "md" },
|
|
535
|
+
name: {}
|
|
536
|
+
}, {
|
|
537
|
+
"modelValue": { default: "" },
|
|
538
|
+
"modelModifiers": {}
|
|
539
|
+
}),
|
|
488
540
|
emits: ["update:modelValue"],
|
|
489
|
-
setup(__props
|
|
490
|
-
const
|
|
491
|
-
const
|
|
492
|
-
const target = event.target;
|
|
493
|
-
emit("update:modelValue", target.value);
|
|
494
|
-
};
|
|
541
|
+
setup(__props) {
|
|
542
|
+
const props = __props;
|
|
543
|
+
const modelValue = useModel(__props, "modelValue");
|
|
495
544
|
return (_ctx, _cache) => {
|
|
496
|
-
return openBlock(),
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
545
|
+
return openBlock(), createBlock(_sfc_main$p, {
|
|
546
|
+
icon: props.icon,
|
|
547
|
+
size: props.size,
|
|
548
|
+
disabled: props.disabled
|
|
549
|
+
}, {
|
|
550
|
+
default: withCtx(({ inputClass }) => [
|
|
551
|
+
withDirectives(createElementVNode("input", mergeProps({
|
|
552
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => modelValue.value = $event),
|
|
553
|
+
type: "text",
|
|
554
|
+
name: props.name,
|
|
555
|
+
placeholder: props.placeholder,
|
|
556
|
+
disabled: props.disabled,
|
|
557
|
+
class: inputClass
|
|
558
|
+
}, _ctx.$attrs), null, 16, _hoisted_1$l), [
|
|
559
|
+
[vModelText, modelValue.value]
|
|
560
|
+
])
|
|
561
|
+
]),
|
|
562
|
+
_: 1
|
|
563
|
+
}, 8, ["icon", "size", "disabled"]);
|
|
510
564
|
};
|
|
511
565
|
}
|
|
512
566
|
});
|
|
513
|
-
const _hoisted_1$
|
|
514
|
-
const _hoisted_2$
|
|
567
|
+
const _hoisted_1$k = ["id", "aria-checked", "aria-labelledby", "aria-describedby", "disabled"];
|
|
568
|
+
const _hoisted_2$f = {
|
|
515
569
|
key: 0,
|
|
516
570
|
class: "flex flex-col"
|
|
517
571
|
};
|
|
518
|
-
const _hoisted_3$
|
|
519
|
-
const _hoisted_4$
|
|
520
|
-
const _sfc_main$
|
|
572
|
+
const _hoisted_3$e = ["id"];
|
|
573
|
+
const _hoisted_4$a = ["id"];
|
|
574
|
+
const _sfc_main$k = /* @__PURE__ */ defineComponent({
|
|
521
575
|
__name: "Switch",
|
|
522
576
|
props: {
|
|
523
577
|
modelValue: { type: Boolean, default: false },
|
|
@@ -581,35 +635,35 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
581
635
|
]),
|
|
582
636
|
"aria-hidden": "true"
|
|
583
637
|
}, null, 2)
|
|
584
|
-
], 10, _hoisted_1$
|
|
585
|
-
__props.label || __props.description ? (openBlock(), createElementBlock("div", _hoisted_2$
|
|
638
|
+
], 10, _hoisted_1$k),
|
|
639
|
+
__props.label || __props.description ? (openBlock(), createElementBlock("div", _hoisted_2$f, [
|
|
586
640
|
__props.label ? (openBlock(), createElementBlock("span", {
|
|
587
641
|
key: 0,
|
|
588
642
|
id: labelId.value,
|
|
589
643
|
class: "text-sm font-medium text-gray-900 dark:text-white"
|
|
590
|
-
}, toDisplayString(__props.label), 9, _hoisted_3$
|
|
644
|
+
}, toDisplayString(__props.label), 9, _hoisted_3$e)) : createCommentVNode("", true),
|
|
591
645
|
__props.description ? (openBlock(), createElementBlock("span", {
|
|
592
646
|
key: 1,
|
|
593
647
|
id: descriptionId.value,
|
|
594
648
|
class: "text-sm text-gray-500 dark:text-gray-400"
|
|
595
|
-
}, toDisplayString(__props.description), 9, _hoisted_4$
|
|
649
|
+
}, toDisplayString(__props.description), 9, _hoisted_4$a)) : createCommentVNode("", true)
|
|
596
650
|
])) : createCommentVNode("", true)
|
|
597
651
|
], 2);
|
|
598
652
|
};
|
|
599
653
|
}
|
|
600
654
|
});
|
|
601
|
-
const _hoisted_1$
|
|
602
|
-
const _hoisted_2$
|
|
655
|
+
const _hoisted_1$j = { class: "w-full" };
|
|
656
|
+
const _hoisted_2$e = {
|
|
603
657
|
key: 0,
|
|
604
658
|
class: "mb-2 flex justify-between text-sm"
|
|
605
659
|
};
|
|
606
|
-
const _hoisted_3$
|
|
607
|
-
const _hoisted_4$
|
|
608
|
-
const _hoisted_5$
|
|
609
|
-
const _hoisted_6$
|
|
610
|
-
const _hoisted_7$
|
|
611
|
-
const _hoisted_8$
|
|
612
|
-
const _sfc_main$
|
|
660
|
+
const _hoisted_3$d = { class: "text-gray-600 dark:text-gray-400" };
|
|
661
|
+
const _hoisted_4$9 = { class: "font-medium text-gray-900 dark:text-white" };
|
|
662
|
+
const _hoisted_5$7 = { class: "text-gray-600 dark:text-gray-400" };
|
|
663
|
+
const _hoisted_6$7 = { class: "relative" };
|
|
664
|
+
const _hoisted_7$6 = ["value", "min", "max", "step", "disabled"];
|
|
665
|
+
const _hoisted_8$5 = { class: "pointer-events-none absolute inset-y-0 left-0 flex items-center" };
|
|
666
|
+
const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
613
667
|
__name: "Slider",
|
|
614
668
|
props: /* @__PURE__ */ mergeModels({
|
|
615
669
|
min: { default: 0 },
|
|
@@ -640,13 +694,13 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
640
694
|
modelValue.value = Number(target.value);
|
|
641
695
|
};
|
|
642
696
|
return (_ctx, _cache) => {
|
|
643
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
644
|
-
__props.showValue ? (openBlock(), createElementBlock("div", _hoisted_2$
|
|
645
|
-
createElementVNode("span", _hoisted_3$
|
|
646
|
-
createElementVNode("span", _hoisted_4$
|
|
647
|
-
createElementVNode("span", _hoisted_5$
|
|
697
|
+
return openBlock(), createElementBlock("div", _hoisted_1$j, [
|
|
698
|
+
__props.showValue ? (openBlock(), createElementBlock("div", _hoisted_2$e, [
|
|
699
|
+
createElementVNode("span", _hoisted_3$d, toDisplayString(__props.min), 1),
|
|
700
|
+
createElementVNode("span", _hoisted_4$9, toDisplayString(displayValue.value), 1),
|
|
701
|
+
createElementVNode("span", _hoisted_5$7, toDisplayString(__props.max), 1)
|
|
648
702
|
])) : createCommentVNode("", true),
|
|
649
|
-
createElementVNode("div", _hoisted_6$
|
|
703
|
+
createElementVNode("div", _hoisted_6$7, [
|
|
650
704
|
createElementVNode("input", {
|
|
651
705
|
type: "range",
|
|
652
706
|
value: modelValue.value,
|
|
@@ -656,8 +710,8 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
656
710
|
disabled: __props.disabled,
|
|
657
711
|
class: "slider-input w-full cursor-pointer appearance-none bg-transparent disabled:cursor-not-allowed disabled:opacity-50",
|
|
658
712
|
onInput: handleInput
|
|
659
|
-
}, null, 40, _hoisted_7$
|
|
660
|
-
createElementVNode("div", _hoisted_8$
|
|
713
|
+
}, null, 40, _hoisted_7$6),
|
|
714
|
+
createElementVNode("div", _hoisted_8$5, [
|
|
661
715
|
createElementVNode("div", {
|
|
662
716
|
class: "h-2 rounded-full bg-primary",
|
|
663
717
|
style: normalizeStyle({ width: `${percentage.value}%` })
|
|
@@ -668,27 +722,27 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
668
722
|
};
|
|
669
723
|
}
|
|
670
724
|
});
|
|
671
|
-
const Slider = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
672
|
-
const _hoisted_1$
|
|
673
|
-
const _hoisted_2$
|
|
674
|
-
const _hoisted_3$
|
|
675
|
-
const _hoisted_4$
|
|
676
|
-
const _hoisted_5$
|
|
677
|
-
const _hoisted_6$
|
|
678
|
-
const _hoisted_7$
|
|
725
|
+
const Slider = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["__scopeId", "data-v-c25e2c2a"]]);
|
|
726
|
+
const _hoisted_1$i = { class: "relative" };
|
|
727
|
+
const _hoisted_2$d = ["id", "disabled", "aria-expanded", "aria-controls"];
|
|
728
|
+
const _hoisted_3$c = { class: "flex-1 truncate" };
|
|
729
|
+
const _hoisted_4$8 = { class: "flex items-center gap-1" };
|
|
730
|
+
const _hoisted_5$6 = ["id", "aria-label"];
|
|
731
|
+
const _hoisted_6$6 = { class: "mb-4 flex items-center justify-between" };
|
|
732
|
+
const _hoisted_7$5 = {
|
|
679
733
|
class: "font-medium text-gray-900 dark:text-white",
|
|
680
734
|
"aria-live": "polite",
|
|
681
735
|
"aria-atomic": "true"
|
|
682
736
|
};
|
|
683
|
-
const _hoisted_8$
|
|
737
|
+
const _hoisted_8$4 = {
|
|
684
738
|
class: "mb-2 grid grid-cols-7 gap-1",
|
|
685
739
|
role: "row"
|
|
686
740
|
};
|
|
687
|
-
const _hoisted_9$
|
|
688
|
-
const _hoisted_10$
|
|
689
|
-
const _hoisted_11$
|
|
690
|
-
const _hoisted_12$
|
|
691
|
-
const _sfc_main$
|
|
741
|
+
const _hoisted_9$3 = ["abbr"];
|
|
742
|
+
const _hoisted_10$3 = ["id", "aria-label"];
|
|
743
|
+
const _hoisted_11$3 = ["aria-label", "aria-selected", "aria-disabled", "disabled", "onClick"];
|
|
744
|
+
const _hoisted_12$2 = { class: "mt-4 border-t border-gray-200 pt-3 dark:border-gray-700" };
|
|
745
|
+
const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
692
746
|
__name: "DatePicker",
|
|
693
747
|
props: /* @__PURE__ */ mergeModels({
|
|
694
748
|
placeholder: { default: "Select date" },
|
|
@@ -812,7 +866,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
812
866
|
return formatter.format(date);
|
|
813
867
|
};
|
|
814
868
|
return (_ctx, _cache) => {
|
|
815
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
869
|
+
return openBlock(), createElementBlock("div", _hoisted_1$i, [
|
|
816
870
|
createElementVNode("button", {
|
|
817
871
|
id: triggerId.value,
|
|
818
872
|
ref_key: "triggerRef",
|
|
@@ -830,8 +884,8 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
830
884
|
onClick: _cache[0] || (_cache[0] = //@ts-ignore
|
|
831
885
|
(...args) => unref(toggle) && unref(toggle)(...args))
|
|
832
886
|
}, [
|
|
833
|
-
createElementVNode("span", _hoisted_3$
|
|
834
|
-
createElementVNode("div", _hoisted_4$
|
|
887
|
+
createElementVNode("span", _hoisted_3$c, toDisplayString(displayValue.value || __props.placeholder), 1),
|
|
888
|
+
createElementVNode("div", _hoisted_4$8, [
|
|
835
889
|
modelValue.value ? (openBlock(), createElementBlock("button", {
|
|
836
890
|
key: 0,
|
|
837
891
|
type: "button",
|
|
@@ -851,7 +905,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
851
905
|
"aria-hidden": "true"
|
|
852
906
|
})
|
|
853
907
|
])
|
|
854
|
-
], 10, _hoisted_2$
|
|
908
|
+
], 10, _hoisted_2$d),
|
|
855
909
|
(openBlock(), createBlock(Teleport, {
|
|
856
910
|
to: "body",
|
|
857
911
|
disabled: !__props.teleport
|
|
@@ -876,7 +930,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
876
930
|
style: normalizeStyle(unref(dropdownStyle)),
|
|
877
931
|
class: "z-9999 w-72 rounded-lg border border-gray-200 bg-white p-4 shadow-lg dark:border-gray-700 dark:bg-gray-800"
|
|
878
932
|
}, [
|
|
879
|
-
createElementVNode("div", _hoisted_6$
|
|
933
|
+
createElementVNode("div", _hoisted_6$6, [
|
|
880
934
|
createElementVNode("button", {
|
|
881
935
|
type: "button",
|
|
882
936
|
class: "rounded p-1 hover:bg-gray-100 dark:hover:bg-gray-700",
|
|
@@ -889,7 +943,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
889
943
|
"aria-hidden": "true"
|
|
890
944
|
})
|
|
891
945
|
]),
|
|
892
|
-
createElementVNode("span", _hoisted_7$
|
|
946
|
+
createElementVNode("span", _hoisted_7$5, toDisplayString(monthYear.value), 1),
|
|
893
947
|
createElementVNode("button", {
|
|
894
948
|
type: "button",
|
|
895
949
|
class: "rounded p-1 hover:bg-gray-100 dark:hover:bg-gray-700",
|
|
@@ -903,14 +957,14 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
903
957
|
})
|
|
904
958
|
])
|
|
905
959
|
]),
|
|
906
|
-
createElementVNode("div", _hoisted_8$
|
|
960
|
+
createElementVNode("div", _hoisted_8$4, [
|
|
907
961
|
(openBlock(true), createElementBlock(Fragment, null, renderList(weekDays.value, (day) => {
|
|
908
962
|
return openBlock(), createElementBlock("div", {
|
|
909
963
|
key: day,
|
|
910
964
|
class: "text-center text-xs font-medium text-gray-500 dark:text-gray-400",
|
|
911
965
|
role: "columnheader",
|
|
912
966
|
abbr: day
|
|
913
|
-
}, toDisplayString(day), 9, _hoisted_9$
|
|
967
|
+
}, toDisplayString(day), 9, _hoisted_9$3);
|
|
914
968
|
}), 128))
|
|
915
969
|
]),
|
|
916
970
|
createElementVNode("div", {
|
|
@@ -937,17 +991,17 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
937
991
|
day.isSelected && "bg-primary text-white font-semibold"
|
|
938
992
|
]),
|
|
939
993
|
onClick: ($event) => selectDate(day)
|
|
940
|
-
}, toDisplayString(day.date.getDate()), 11, _hoisted_11$
|
|
994
|
+
}, toDisplayString(day.date.getDate()), 11, _hoisted_11$3);
|
|
941
995
|
}), 128))
|
|
942
|
-
], 8, _hoisted_10$
|
|
943
|
-
createElementVNode("div", _hoisted_12$
|
|
996
|
+
], 8, _hoisted_10$3),
|
|
997
|
+
createElementVNode("div", _hoisted_12$2, [
|
|
944
998
|
createElementVNode("button", {
|
|
945
999
|
type: "button",
|
|
946
1000
|
class: "w-full rounded py-1.5 text-sm font-medium text-primary hover:bg-primary/10",
|
|
947
1001
|
onClick: _cache[1] || (_cache[1] = ($event) => selectDate({ date: /* @__PURE__ */ new Date(), isDisabled: false }))
|
|
948
1002
|
}, " Today ")
|
|
949
1003
|
])
|
|
950
|
-
], 12, _hoisted_5$
|
|
1004
|
+
], 12, _hoisted_5$6)) : createCommentVNode("", true)
|
|
951
1005
|
]),
|
|
952
1006
|
_: 1
|
|
953
1007
|
})
|
|
@@ -956,27 +1010,27 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
956
1010
|
};
|
|
957
1011
|
}
|
|
958
1012
|
});
|
|
959
|
-
const _hoisted_1$
|
|
960
|
-
const _hoisted_2$
|
|
961
|
-
const _hoisted_3$
|
|
962
|
-
const _hoisted_4$
|
|
963
|
-
const _hoisted_5$
|
|
1013
|
+
const _hoisted_1$h = { class: "space-y-4" };
|
|
1014
|
+
const _hoisted_2$c = ["accept", "multiple", "disabled"];
|
|
1015
|
+
const _hoisted_3$b = { class: "space-y-2" };
|
|
1016
|
+
const _hoisted_4$7 = { class: "text-sm font-medium text-gray-700 dark:text-gray-300" };
|
|
1017
|
+
const _hoisted_5$5 = {
|
|
964
1018
|
key: 0,
|
|
965
1019
|
class: "text-xs text-gray-500 dark:text-gray-400"
|
|
966
1020
|
};
|
|
967
|
-
const _hoisted_6$
|
|
1021
|
+
const _hoisted_6$5 = {
|
|
968
1022
|
key: 1,
|
|
969
1023
|
class: "text-xs text-gray-500 dark:text-gray-400"
|
|
970
1024
|
};
|
|
971
|
-
const _hoisted_7$
|
|
1025
|
+
const _hoisted_7$4 = {
|
|
972
1026
|
key: 0,
|
|
973
1027
|
class: "space-y-2"
|
|
974
1028
|
};
|
|
975
|
-
const _hoisted_8$
|
|
976
|
-
const _hoisted_9$
|
|
977
|
-
const _hoisted_10$
|
|
978
|
-
const _hoisted_11$
|
|
979
|
-
const _sfc_main$
|
|
1029
|
+
const _hoisted_8$3 = { class: "flex-1 min-w-0" };
|
|
1030
|
+
const _hoisted_9$2 = { class: "text-sm font-medium text-gray-700 dark:text-gray-300 truncate" };
|
|
1031
|
+
const _hoisted_10$2 = { class: "text-xs text-gray-500 dark:text-gray-400" };
|
|
1032
|
+
const _hoisted_11$2 = ["onClick"];
|
|
1033
|
+
const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
980
1034
|
__name: "FileUpload",
|
|
981
1035
|
props: {
|
|
982
1036
|
accept: {},
|
|
@@ -1104,7 +1158,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
1104
1158
|
return "heroicons:document";
|
|
1105
1159
|
};
|
|
1106
1160
|
return (_ctx, _cache) => {
|
|
1107
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
1161
|
+
return openBlock(), createElementBlock("div", _hoisted_1$h, [
|
|
1108
1162
|
createElementVNode("div", {
|
|
1109
1163
|
class: normalizeClass(dropzoneClasses.value),
|
|
1110
1164
|
onDrop: withModifiers(handleDrop, ["prevent"]),
|
|
@@ -1121,18 +1175,18 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
1121
1175
|
multiple: __props.multiple,
|
|
1122
1176
|
disabled: __props.disabled,
|
|
1123
1177
|
onChange: handleInputChange
|
|
1124
|
-
}, null, 40, _hoisted_2$
|
|
1125
|
-
createElementVNode("div", _hoisted_3$
|
|
1178
|
+
}, null, 40, _hoisted_2$c),
|
|
1179
|
+
createElementVNode("div", _hoisted_3$b, [
|
|
1126
1180
|
createVNode(unref(Icon), {
|
|
1127
1181
|
icon: "heroicons:cloud-arrow-up",
|
|
1128
1182
|
class: normalizeClass(["size-12 mx-auto text-gray-400", { "text-primary-500": isDragging.value }])
|
|
1129
1183
|
}, null, 8, ["class"]),
|
|
1130
|
-
createElementVNode("p", _hoisted_4$
|
|
1131
|
-
__props.description ? (openBlock(), createElementBlock("p", _hoisted_5$
|
|
1132
|
-
__props.maxSize ? (openBlock(), createElementBlock("p", _hoisted_6$
|
|
1184
|
+
createElementVNode("p", _hoisted_4$7, toDisplayString(__props.label), 1),
|
|
1185
|
+
__props.description ? (openBlock(), createElementBlock("p", _hoisted_5$5, toDisplayString(__props.description), 1)) : createCommentVNode("", true),
|
|
1186
|
+
__props.maxSize ? (openBlock(), createElementBlock("p", _hoisted_6$5, " Max size: " + toDisplayString(formatSize(__props.maxSize)), 1)) : createCommentVNode("", true)
|
|
1133
1187
|
])
|
|
1134
1188
|
], 34),
|
|
1135
|
-
files.value.length > 0 ? (openBlock(), createElementBlock("ul", _hoisted_7$
|
|
1189
|
+
files.value.length > 0 ? (openBlock(), createElementBlock("ul", _hoisted_7$4, [
|
|
1136
1190
|
(openBlock(true), createElementBlock(Fragment, null, renderList(files.value, (uploadedFile) => {
|
|
1137
1191
|
return openBlock(), createElementBlock("li", {
|
|
1138
1192
|
key: uploadedFile.id,
|
|
@@ -1142,9 +1196,9 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
1142
1196
|
icon: getFileIcon(uploadedFile.file),
|
|
1143
1197
|
class: "size-8 text-gray-400"
|
|
1144
1198
|
}, null, 8, ["icon"]),
|
|
1145
|
-
createElementVNode("div", _hoisted_8$
|
|
1146
|
-
createElementVNode("p", _hoisted_9$
|
|
1147
|
-
createElementVNode("p", _hoisted_10$
|
|
1199
|
+
createElementVNode("div", _hoisted_8$3, [
|
|
1200
|
+
createElementVNode("p", _hoisted_9$2, toDisplayString(uploadedFile.file.name), 1),
|
|
1201
|
+
createElementVNode("p", _hoisted_10$2, toDisplayString(formatSize(uploadedFile.file.size)), 1)
|
|
1148
1202
|
]),
|
|
1149
1203
|
createElementVNode("button", {
|
|
1150
1204
|
type: "button",
|
|
@@ -1155,7 +1209,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
1155
1209
|
icon: "heroicons:x-mark",
|
|
1156
1210
|
class: "size-5"
|
|
1157
1211
|
})
|
|
1158
|
-
], 8, _hoisted_11$
|
|
1212
|
+
], 8, _hoisted_11$2)
|
|
1159
1213
|
]);
|
|
1160
1214
|
}), 128))
|
|
1161
1215
|
])) : createCommentVNode("", true)
|
|
@@ -1163,13 +1217,13 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
1163
1217
|
};
|
|
1164
1218
|
}
|
|
1165
1219
|
});
|
|
1166
|
-
const _hoisted_1$
|
|
1167
|
-
const _hoisted_2$
|
|
1168
|
-
const _hoisted_3$
|
|
1220
|
+
const _hoisted_1$g = { class: "flex items-center gap-1" };
|
|
1221
|
+
const _hoisted_2$b = ["disabled", "onClick", "onMousemove"];
|
|
1222
|
+
const _hoisted_3$a = {
|
|
1169
1223
|
key: 0,
|
|
1170
1224
|
class: "ml-2 text-sm font-medium text-gray-700 dark:text-gray-300"
|
|
1171
1225
|
};
|
|
1172
|
-
const _sfc_main$
|
|
1226
|
+
const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
1173
1227
|
__name: "Rating",
|
|
1174
1228
|
props: {
|
|
1175
1229
|
modelValue: { default: 0 },
|
|
@@ -1232,7 +1286,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
1232
1286
|
hoverValue.value = null;
|
|
1233
1287
|
};
|
|
1234
1288
|
return (_ctx, _cache) => {
|
|
1235
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
1289
|
+
return openBlock(), createElementBlock("div", _hoisted_1$g, [
|
|
1236
1290
|
createElementVNode("div", {
|
|
1237
1291
|
class: "flex items-center",
|
|
1238
1292
|
onMouseleave: handleMouseLeave
|
|
@@ -1264,29 +1318,29 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
1264
1318
|
class: normalizeClass([sizeClasses.value, __props.color])
|
|
1265
1319
|
}, null, 8, ["icon", "class"])
|
|
1266
1320
|
], 4)
|
|
1267
|
-
], 42, _hoisted_2$
|
|
1321
|
+
], 42, _hoisted_2$b);
|
|
1268
1322
|
}), 128))
|
|
1269
1323
|
], 32),
|
|
1270
|
-
__props.showValue ? (openBlock(), createElementBlock("span", _hoisted_3$
|
|
1324
|
+
__props.showValue ? (openBlock(), createElementBlock("span", _hoisted_3$a, toDisplayString(__props.modelValue.toFixed(__props.allowHalf ? 1 : 0)), 1)) : createCommentVNode("", true)
|
|
1271
1325
|
]);
|
|
1272
1326
|
};
|
|
1273
1327
|
}
|
|
1274
1328
|
});
|
|
1275
|
-
const _hoisted_1$
|
|
1276
|
-
const _hoisted_2$
|
|
1329
|
+
const _hoisted_1$f = { class: "relative inline-block" };
|
|
1330
|
+
const _hoisted_2$a = {
|
|
1277
1331
|
key: 0,
|
|
1278
1332
|
class: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1"
|
|
1279
1333
|
};
|
|
1280
|
-
const _hoisted_3$
|
|
1281
|
-
const _hoisted_4$
|
|
1282
|
-
const _hoisted_5$
|
|
1283
|
-
const _hoisted_6$
|
|
1284
|
-
const _hoisted_7$
|
|
1334
|
+
const _hoisted_3$9 = ["disabled"];
|
|
1335
|
+
const _hoisted_4$6 = { class: "text-sm font-mono text-gray-700 dark:text-gray-300" };
|
|
1336
|
+
const _hoisted_5$4 = { class: "grid grid-cols-5 gap-2 mb-3" };
|
|
1337
|
+
const _hoisted_6$4 = ["title", "onClick"];
|
|
1338
|
+
const _hoisted_7$3 = {
|
|
1285
1339
|
key: 0,
|
|
1286
1340
|
class: "flex items-center gap-2 pt-3 border-t border-gray-200 dark:border-gray-700"
|
|
1287
1341
|
};
|
|
1288
|
-
const _hoisted_8$
|
|
1289
|
-
const _sfc_main$
|
|
1342
|
+
const _hoisted_8$2 = ["value"];
|
|
1343
|
+
const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
1290
1344
|
__name: "ColorPicker",
|
|
1291
1345
|
props: {
|
|
1292
1346
|
modelValue: { default: "#3b82f6" },
|
|
@@ -1355,8 +1409,8 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
1355
1409
|
isOpen.value = false;
|
|
1356
1410
|
};
|
|
1357
1411
|
return (_ctx, _cache) => {
|
|
1358
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
1359
|
-
__props.label ? (openBlock(), createElementBlock("label", _hoisted_2$
|
|
1412
|
+
return openBlock(), createElementBlock("div", _hoisted_1$f, [
|
|
1413
|
+
__props.label ? (openBlock(), createElementBlock("label", _hoisted_2$a, toDisplayString(__props.label), 1)) : createCommentVNode("", true),
|
|
1360
1414
|
createElementVNode("button", {
|
|
1361
1415
|
type: "button",
|
|
1362
1416
|
class: normalizeClass(["flex items-center gap-2 px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-800 hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors", { "opacity-50 cursor-not-allowed": __props.disabled }]),
|
|
@@ -1367,12 +1421,12 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
1367
1421
|
class: "size-6 rounded border border-gray-200 dark:border-gray-600",
|
|
1368
1422
|
style: normalizeStyle({ backgroundColor: __props.modelValue })
|
|
1369
1423
|
}, null, 4),
|
|
1370
|
-
createElementVNode("span", _hoisted_4$
|
|
1424
|
+
createElementVNode("span", _hoisted_4$6, toDisplayString(__props.modelValue), 1),
|
|
1371
1425
|
createVNode(unref(Icon), {
|
|
1372
1426
|
icon: "heroicons:chevron-down",
|
|
1373
1427
|
class: normalizeClass(["size-4 text-gray-400", { "rotate-180": isOpen.value }])
|
|
1374
1428
|
}, null, 8, ["class"])
|
|
1375
|
-
], 10, _hoisted_3$
|
|
1429
|
+
], 10, _hoisted_3$9),
|
|
1376
1430
|
(openBlock(), createBlock(Teleport, {
|
|
1377
1431
|
to: teleportTarget.value,
|
|
1378
1432
|
disabled: teleportDisabled.value
|
|
@@ -1392,7 +1446,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
1392
1446
|
onClick: _cache[1] || (_cache[1] = withModifiers(() => {
|
|
1393
1447
|
}, ["stop"]))
|
|
1394
1448
|
}, [
|
|
1395
|
-
createElementVNode("div", _hoisted_5$
|
|
1449
|
+
createElementVNode("div", _hoisted_5$4, [
|
|
1396
1450
|
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.swatches, (color) => {
|
|
1397
1451
|
return openBlock(), createElementBlock("button", {
|
|
1398
1452
|
key: color,
|
|
@@ -1411,16 +1465,16 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
1411
1465
|
["#ffffff", "#f9fafb", "#f3f4f6", "#e5e7eb", "#eab308", "#f59e0b"].includes(color) ? "text-gray-800" : "text-white"
|
|
1412
1466
|
]])
|
|
1413
1467
|
}, null, 8, ["class"])) : createCommentVNode("", true)
|
|
1414
|
-
], 14, _hoisted_6$
|
|
1468
|
+
], 14, _hoisted_6$4);
|
|
1415
1469
|
}), 128))
|
|
1416
1470
|
]),
|
|
1417
|
-
__props.showInput ? (openBlock(), createElementBlock("div", _hoisted_7$
|
|
1471
|
+
__props.showInput ? (openBlock(), createElementBlock("div", _hoisted_7$3, [
|
|
1418
1472
|
createElementVNode("input", {
|
|
1419
1473
|
type: "color",
|
|
1420
1474
|
value: __props.modelValue,
|
|
1421
1475
|
class: "size-8 rounded cursor-pointer border-0 p-0",
|
|
1422
1476
|
onInput: handleNativeInput
|
|
1423
|
-
}, null, 40, _hoisted_8$
|
|
1477
|
+
}, null, 40, _hoisted_8$2),
|
|
1424
1478
|
withDirectives(createElementVNode("input", {
|
|
1425
1479
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => inputValue.value = $event),
|
|
1426
1480
|
type: "text",
|
|
@@ -1446,16 +1500,16 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
1446
1500
|
};
|
|
1447
1501
|
}
|
|
1448
1502
|
});
|
|
1449
|
-
const _hoisted_1$
|
|
1450
|
-
const _hoisted_2$
|
|
1503
|
+
const _hoisted_1$e = { class: "space-y-2" };
|
|
1504
|
+
const _hoisted_2$9 = {
|
|
1451
1505
|
key: 0,
|
|
1452
1506
|
class: "flex justify-between text-sm font-medium text-gray-700 dark:text-gray-300"
|
|
1453
1507
|
};
|
|
1454
|
-
const _hoisted_3$
|
|
1508
|
+
const _hoisted_3$8 = {
|
|
1455
1509
|
key: 1,
|
|
1456
1510
|
class: "flex justify-between text-xs text-gray-500 dark:text-gray-400"
|
|
1457
1511
|
};
|
|
1458
|
-
const _sfc_main$
|
|
1512
|
+
const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
1459
1513
|
__name: "RangeSlider",
|
|
1460
1514
|
props: {
|
|
1461
1515
|
modelValue: { default: () => [25, 75] },
|
|
@@ -1533,8 +1587,8 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
1533
1587
|
}
|
|
1534
1588
|
};
|
|
1535
1589
|
return (_ctx, _cache) => {
|
|
1536
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
1537
|
-
__props.showLabels ? (openBlock(), createElementBlock("div", _hoisted_2$
|
|
1590
|
+
return openBlock(), createElementBlock("div", _hoisted_1$e, [
|
|
1591
|
+
__props.showLabels ? (openBlock(), createElementBlock("div", _hoisted_2$9, [
|
|
1538
1592
|
createElementVNode("span", null, toDisplayString(__props.formatLabel(minValue.value)), 1),
|
|
1539
1593
|
createElementVNode("span", null, toDisplayString(__props.formatLabel(maxValue.value)), 1)
|
|
1540
1594
|
])) : createCommentVNode("", true),
|
|
@@ -1567,7 +1621,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
1567
1621
|
onMousedown: _cache[1] || (_cache[1] = ($event) => handleMouseDown("max"))
|
|
1568
1622
|
}, null, 38)
|
|
1569
1623
|
], 2),
|
|
1570
|
-
__props.showMinMax ? (openBlock(), createElementBlock("div", _hoisted_3$
|
|
1624
|
+
__props.showMinMax ? (openBlock(), createElementBlock("div", _hoisted_3$8, [
|
|
1571
1625
|
createElementVNode("span", null, toDisplayString(__props.formatLabel(__props.min)), 1),
|
|
1572
1626
|
createElementVNode("span", null, toDisplayString(__props.formatLabel(__props.max)), 1)
|
|
1573
1627
|
])) : createCommentVNode("", true)
|
|
@@ -1575,18 +1629,18 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
1575
1629
|
};
|
|
1576
1630
|
}
|
|
1577
1631
|
});
|
|
1578
|
-
const _hoisted_1$
|
|
1579
|
-
const _hoisted_2$
|
|
1580
|
-
const _hoisted_3$
|
|
1581
|
-
const _hoisted_4$
|
|
1582
|
-
const _hoisted_5$
|
|
1583
|
-
const _hoisted_6$
|
|
1584
|
-
const _hoisted_7$
|
|
1632
|
+
const _hoisted_1$d = ["aria-expanded", "aria-controls"];
|
|
1633
|
+
const _hoisted_2$8 = ["id", "name", "placeholder", "disabled", "aria-controls"];
|
|
1634
|
+
const _hoisted_3$7 = { class: "flex items-center gap-1" };
|
|
1635
|
+
const _hoisted_4$5 = ["id", "aria-label", "aria-multiselectable"];
|
|
1636
|
+
const _hoisted_5$3 = ["aria-selected", "aria-disabled", "disabled", "onClick"];
|
|
1637
|
+
const _hoisted_6$3 = { class: "flex-1" };
|
|
1638
|
+
const _hoisted_7$2 = {
|
|
1585
1639
|
key: 1,
|
|
1586
1640
|
class: "px-3 py-2 text-center text-sm text-gray-500 dark:text-gray-400",
|
|
1587
1641
|
role: "status"
|
|
1588
1642
|
};
|
|
1589
|
-
const _sfc_main$
|
|
1643
|
+
const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
1590
1644
|
__name: "Combobox",
|
|
1591
1645
|
props: {
|
|
1592
1646
|
modelValue: {},
|
|
@@ -1717,10 +1771,10 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
1717
1771
|
class: "flex-1 border-none bg-transparent text-sm text-gray-900 outline-hidden placeholder:text-gray-400 dark:text-gray-100 dark:placeholder:text-gray-500",
|
|
1718
1772
|
onClick: _cache[1] || (_cache[1] = withModifiers(() => {
|
|
1719
1773
|
}, ["stop"]))
|
|
1720
|
-
}, null, 8, _hoisted_2$
|
|
1774
|
+
}, null, 8, _hoisted_2$8)), [
|
|
1721
1775
|
[vModelText, search.value]
|
|
1722
1776
|
]),
|
|
1723
|
-
createElementVNode("div", _hoisted_3$
|
|
1777
|
+
createElementVNode("div", _hoisted_3$7, [
|
|
1724
1778
|
__props.clearable && selectedOptions.value.length > 0 && !__props.disabled ? (openBlock(), createElementBlock("button", {
|
|
1725
1779
|
key: 0,
|
|
1726
1780
|
type: "button",
|
|
@@ -1743,7 +1797,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
1743
1797
|
"aria-hidden": "true"
|
|
1744
1798
|
}, null, 8, ["class"])
|
|
1745
1799
|
])
|
|
1746
|
-
], 10, _hoisted_1$
|
|
1800
|
+
], 10, _hoisted_1$d),
|
|
1747
1801
|
(openBlock(), createBlock(Teleport, {
|
|
1748
1802
|
to: teleportTarget.value,
|
|
1749
1803
|
disabled: teleportDisabled.value
|
|
@@ -1793,16 +1847,16 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
1793
1847
|
class: "size-3"
|
|
1794
1848
|
})) : createCommentVNode("", true)
|
|
1795
1849
|
], 2)) : createCommentVNode("", true),
|
|
1796
|
-
createElementVNode("span", _hoisted_6$
|
|
1850
|
+
createElementVNode("span", _hoisted_6$3, toDisplayString(option.label), 1),
|
|
1797
1851
|
!__props.multiple && isSelected(option) ? (openBlock(), createBlock(unref(Icon), {
|
|
1798
1852
|
key: 1,
|
|
1799
1853
|
icon: "lucide:check",
|
|
1800
1854
|
class: "size-4 text-primary",
|
|
1801
1855
|
"aria-hidden": "true"
|
|
1802
1856
|
})) : createCommentVNode("", true)
|
|
1803
|
-
], 10, _hoisted_5$
|
|
1804
|
-
}), 128)) : (openBlock(), createElementBlock("div", _hoisted_7$
|
|
1805
|
-
], 8, _hoisted_4$
|
|
1857
|
+
], 10, _hoisted_5$3);
|
|
1858
|
+
}), 128)) : (openBlock(), createElementBlock("div", _hoisted_7$2, toDisplayString(__props.noResultsText), 1))
|
|
1859
|
+
], 8, _hoisted_4$5)) : createCommentVNode("", true)
|
|
1806
1860
|
]),
|
|
1807
1861
|
_: 1
|
|
1808
1862
|
})
|
|
@@ -1811,30 +1865,30 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
1811
1865
|
};
|
|
1812
1866
|
}
|
|
1813
1867
|
});
|
|
1814
|
-
const _hoisted_1$
|
|
1815
|
-
const _hoisted_2$
|
|
1868
|
+
const _hoisted_1$c = { class: "relative" };
|
|
1869
|
+
const _hoisted_2$7 = {
|
|
1816
1870
|
key: 0,
|
|
1817
1871
|
class: "text-red-500 ml-0.5"
|
|
1818
1872
|
};
|
|
1819
|
-
const _hoisted_3$
|
|
1820
|
-
const _hoisted_4$
|
|
1873
|
+
const _hoisted_3$6 = ["id", "disabled", "aria-invalid", "aria-describedby"];
|
|
1874
|
+
const _hoisted_4$4 = {
|
|
1821
1875
|
key: 0,
|
|
1822
1876
|
class: "flex items-center gap-2 flex-1"
|
|
1823
1877
|
};
|
|
1824
|
-
const _hoisted_5$
|
|
1825
|
-
const _hoisted_6$
|
|
1826
|
-
const _hoisted_7 = {
|
|
1878
|
+
const _hoisted_5$2 = { class: "flex size-8 items-center justify-center rounded bg-gray-100 dark:bg-gray-800" };
|
|
1879
|
+
const _hoisted_6$2 = { class: "text-gray-700 dark:text-gray-300 font-mono text-xs truncate" };
|
|
1880
|
+
const _hoisted_7$1 = {
|
|
1827
1881
|
key: 1,
|
|
1828
1882
|
class: "flex-1 text-gray-400 dark:text-gray-500"
|
|
1829
1883
|
};
|
|
1830
|
-
const _hoisted_8 = { class: "relative mb-4" };
|
|
1831
|
-
const _hoisted_9 = ["placeholder"];
|
|
1832
|
-
const _hoisted_10 = {
|
|
1884
|
+
const _hoisted_8$1 = { class: "relative mb-4" };
|
|
1885
|
+
const _hoisted_9$1 = ["placeholder"];
|
|
1886
|
+
const _hoisted_10$1 = {
|
|
1833
1887
|
key: 0,
|
|
1834
1888
|
class: "absolute right-3 top-1/2 -translate-y-1/2"
|
|
1835
1889
|
};
|
|
1836
|
-
const _hoisted_11 = { class: "max-h-64 overflow-y-auto" };
|
|
1837
|
-
const _hoisted_12 = {
|
|
1890
|
+
const _hoisted_11$1 = { class: "max-h-64 overflow-y-auto" };
|
|
1891
|
+
const _hoisted_12$1 = {
|
|
1838
1892
|
key: 0,
|
|
1839
1893
|
class: "py-8 text-center text-sm text-gray-500"
|
|
1840
1894
|
};
|
|
@@ -1845,7 +1899,7 @@ const _hoisted_13 = {
|
|
|
1845
1899
|
const _hoisted_14 = ["title", "onClick"];
|
|
1846
1900
|
const _hoisted_15 = { class: "mt-4 flex items-center justify-between border-t border-gray-200 pt-4 dark:border-gray-700" };
|
|
1847
1901
|
const _hoisted_16 = { class: "text-xs text-gray-500" };
|
|
1848
|
-
const _sfc_main$
|
|
1902
|
+
const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
1849
1903
|
__name: "IconPicker",
|
|
1850
1904
|
props: /* @__PURE__ */ mergeModels({
|
|
1851
1905
|
label: {},
|
|
@@ -1969,15 +2023,15 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
1969
2023
|
searchQuery.value = "";
|
|
1970
2024
|
}
|
|
1971
2025
|
return (_ctx, _cache) => {
|
|
1972
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
1973
|
-
__props.label ? (openBlock(), createBlock(_sfc_main$
|
|
2026
|
+
return openBlock(), createElementBlock("div", _hoisted_1$c, [
|
|
2027
|
+
__props.label ? (openBlock(), createBlock(_sfc_main$r, {
|
|
1974
2028
|
key: 0,
|
|
1975
2029
|
"html-for": inputId.value,
|
|
1976
2030
|
error: __props.error
|
|
1977
2031
|
}, {
|
|
1978
2032
|
default: withCtx(() => [
|
|
1979
2033
|
createTextVNode(toDisplayString(__props.label) + " ", 1),
|
|
1980
|
-
__props.required ? (openBlock(), createElementBlock("span", _hoisted_2$
|
|
2034
|
+
__props.required ? (openBlock(), createElementBlock("span", _hoisted_2$7, "*")) : createCommentVNode("", true)
|
|
1981
2035
|
]),
|
|
1982
2036
|
_: 1
|
|
1983
2037
|
}, 8, ["html-for", "error"])) : createCommentVNode("", true),
|
|
@@ -1993,15 +2047,15 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
1993
2047
|
]]),
|
|
1994
2048
|
onClick: openPicker
|
|
1995
2049
|
}, [
|
|
1996
|
-
modelValue.value ? (openBlock(), createElementBlock("div", _hoisted_4$
|
|
1997
|
-
createElementVNode("div", _hoisted_5$
|
|
2050
|
+
modelValue.value ? (openBlock(), createElementBlock("div", _hoisted_4$4, [
|
|
2051
|
+
createElementVNode("div", _hoisted_5$2, [
|
|
1998
2052
|
createVNode(unref(Icon), {
|
|
1999
2053
|
icon: modelValue.value,
|
|
2000
2054
|
class: "size-5 text-gray-700 dark:text-gray-300"
|
|
2001
2055
|
}, null, 8, ["icon"])
|
|
2002
2056
|
]),
|
|
2003
|
-
createElementVNode("span", _hoisted_6$
|
|
2004
|
-
])) : (openBlock(), createElementBlock("span", _hoisted_7, toDisplayString(__props.placeholder), 1)),
|
|
2057
|
+
createElementVNode("span", _hoisted_6$2, toDisplayString(modelValue.value), 1)
|
|
2058
|
+
])) : (openBlock(), createElementBlock("span", _hoisted_7$1, toDisplayString(__props.placeholder), 1)),
|
|
2005
2059
|
modelValue.value && !__props.disabled ? (openBlock(), createElementBlock("button", {
|
|
2006
2060
|
key: 2,
|
|
2007
2061
|
type: "button",
|
|
@@ -2017,8 +2071,8 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
2017
2071
|
icon: "lucide:chevron-down",
|
|
2018
2072
|
class: "size-4 text-gray-400"
|
|
2019
2073
|
})
|
|
2020
|
-
], 10, _hoisted_3$
|
|
2021
|
-
__props.help && !hasError.value ? (openBlock(), createBlock(_sfc_main$
|
|
2074
|
+
], 10, _hoisted_3$6),
|
|
2075
|
+
__props.help && !hasError.value ? (openBlock(), createBlock(_sfc_main$q, {
|
|
2022
2076
|
key: 1,
|
|
2023
2077
|
id: helpId.value
|
|
2024
2078
|
}, {
|
|
@@ -2027,7 +2081,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
2027
2081
|
]),
|
|
2028
2082
|
_: 1
|
|
2029
2083
|
}, 8, ["id"])) : createCommentVNode("", true),
|
|
2030
|
-
hasError.value ? (openBlock(), createBlock(_sfc_main$
|
|
2084
|
+
hasError.value ? (openBlock(), createBlock(_sfc_main$q, {
|
|
2031
2085
|
key: 2,
|
|
2032
2086
|
id: helpId.value,
|
|
2033
2087
|
error: true
|
|
@@ -2048,7 +2102,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
2048
2102
|
onClick: _cache[1] || (_cache[1] = withModifiers(() => {
|
|
2049
2103
|
}, ["stop"]))
|
|
2050
2104
|
}, [
|
|
2051
|
-
createElementVNode("div", _hoisted_8, [
|
|
2105
|
+
createElementVNode("div", _hoisted_8$1, [
|
|
2052
2106
|
createVNode(unref(Icon), {
|
|
2053
2107
|
icon: "lucide:search",
|
|
2054
2108
|
class: "absolute left-3 top-1/2 size-4 -translate-y-1/2 text-gray-400"
|
|
@@ -2059,18 +2113,18 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
2059
2113
|
placeholder: __props.placeholder,
|
|
2060
2114
|
class: "w-full rounded-md border border-gray-300 bg-white py-2 pl-10 pr-4 text-sm text-gray-800 placeholder-gray-400 focus:border-primary focus:outline-none focus:ring-1 focus:ring-primary dark:border-gray-700 dark:bg-gray-800 dark:text-gray-200 dark:placeholder-gray-500",
|
|
2061
2115
|
autofocus: ""
|
|
2062
|
-
}, null, 8, _hoisted_9), [
|
|
2116
|
+
}, null, 8, _hoisted_9$1), [
|
|
2063
2117
|
[vModelText, searchQuery.value]
|
|
2064
2118
|
]),
|
|
2065
|
-
isLoading.value ? (openBlock(), createElementBlock("div", _hoisted_10, [
|
|
2119
|
+
isLoading.value ? (openBlock(), createElementBlock("div", _hoisted_10$1, [
|
|
2066
2120
|
createVNode(unref(Icon), {
|
|
2067
2121
|
icon: "lucide:loader-2",
|
|
2068
2122
|
class: "size-4 animate-spin text-gray-400"
|
|
2069
2123
|
})
|
|
2070
2124
|
])) : createCommentVNode("", true)
|
|
2071
2125
|
]),
|
|
2072
|
-
createElementVNode("div", _hoisted_11, [
|
|
2073
|
-
displayedIcons.value.length === 0 && searchQuery.value ? (openBlock(), createElementBlock("div", _hoisted_12, ' Aucune icône trouvée pour "' + toDisplayString(searchQuery.value) + '" ', 1)) : (openBlock(), createElementBlock("div", _hoisted_13, [
|
|
2126
|
+
createElementVNode("div", _hoisted_11$1, [
|
|
2127
|
+
displayedIcons.value.length === 0 && searchQuery.value ? (openBlock(), createElementBlock("div", _hoisted_12$1, ' Aucune icône trouvée pour "' + toDisplayString(searchQuery.value) + '" ', 1)) : (openBlock(), createElementBlock("div", _hoisted_13, [
|
|
2074
2128
|
(openBlock(true), createElementBlock(Fragment, null, renderList(displayedIcons.value, (icon) => {
|
|
2075
2129
|
return openBlock(), createElementBlock("button", {
|
|
2076
2130
|
key: icon,
|
|
@@ -2104,19 +2158,19 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
2104
2158
|
};
|
|
2105
2159
|
}
|
|
2106
2160
|
});
|
|
2107
|
-
const _hoisted_1$
|
|
2108
|
-
const _hoisted_2 = { class: "flex items-center gap-3" };
|
|
2109
|
-
const _hoisted_3 = { class: "text-lg font-semibold text-gray-900 dark:text-white" };
|
|
2110
|
-
const _hoisted_4 = {
|
|
2161
|
+
const _hoisted_1$b = { class: "flex items-center justify-between" };
|
|
2162
|
+
const _hoisted_2$6 = { class: "flex items-center gap-3" };
|
|
2163
|
+
const _hoisted_3$5 = { class: "text-lg font-semibold text-gray-900 dark:text-white" };
|
|
2164
|
+
const _hoisted_4$3 = {
|
|
2111
2165
|
key: 0,
|
|
2112
2166
|
class: "text-sm text-gray-500 dark:text-gray-400"
|
|
2113
2167
|
};
|
|
2114
|
-
const _hoisted_5 = { class: "p-5 sm:p-6" };
|
|
2115
|
-
const _hoisted_6 = {
|
|
2168
|
+
const _hoisted_5$1 = { class: "p-5 sm:p-6" };
|
|
2169
|
+
const _hoisted_6$1 = {
|
|
2116
2170
|
key: 0,
|
|
2117
2171
|
class: "px-5 py-4 bg-gray-50 dark:bg-slate-800/50 border-t border-gray-100 dark:border-slate-700"
|
|
2118
2172
|
};
|
|
2119
|
-
const _sfc_main$
|
|
2173
|
+
const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
2120
2174
|
__name: "FormSection",
|
|
2121
2175
|
props: /* @__PURE__ */ mergeModels({
|
|
2122
2176
|
title: {},
|
|
@@ -2150,8 +2204,8 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
2150
2204
|
]),
|
|
2151
2205
|
onClick: _cache[0] || (_cache[0] = ($event) => __props.collapsible && toggleCollapse())
|
|
2152
2206
|
}, [
|
|
2153
|
-
createElementVNode("div", _hoisted_1$
|
|
2154
|
-
createElementVNode("div", _hoisted_2, [
|
|
2207
|
+
createElementVNode("div", _hoisted_1$b, [
|
|
2208
|
+
createElementVNode("div", _hoisted_2$6, [
|
|
2155
2209
|
__props.icon ? (openBlock(), createElementBlock("div", {
|
|
2156
2210
|
key: 0,
|
|
2157
2211
|
class: normalizeClass([
|
|
@@ -2176,12 +2230,12 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
2176
2230
|
}, null, 8, ["icon", "class"])
|
|
2177
2231
|
], 2)) : createCommentVNode("", true),
|
|
2178
2232
|
createElementVNode("div", null, [
|
|
2179
|
-
createElementVNode("h2", _hoisted_3, [
|
|
2233
|
+
createElementVNode("h2", _hoisted_3$5, [
|
|
2180
2234
|
renderSlot(_ctx.$slots, "title", {}, () => [
|
|
2181
2235
|
createTextVNode(toDisplayString(__props.title), 1)
|
|
2182
2236
|
])
|
|
2183
2237
|
]),
|
|
2184
|
-
__props.subtitle ? (openBlock(), createElementBlock("p", _hoisted_4, [
|
|
2238
|
+
__props.subtitle ? (openBlock(), createElementBlock("p", _hoisted_4$3, [
|
|
2185
2239
|
renderSlot(_ctx.$slots, "subtitle", {}, () => [
|
|
2186
2240
|
createTextVNode(toDisplayString(__props.subtitle), 1)
|
|
2187
2241
|
])
|
|
@@ -2205,12 +2259,12 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
2205
2259
|
renderSlot(_ctx.$slots, "header-actions")
|
|
2206
2260
|
])
|
|
2207
2261
|
], 2),
|
|
2208
|
-
withDirectives(createElementVNode("div", _hoisted_5, [
|
|
2262
|
+
withDirectives(createElementVNode("div", _hoisted_5$1, [
|
|
2209
2263
|
renderSlot(_ctx.$slots, "default")
|
|
2210
2264
|
], 512), [
|
|
2211
2265
|
[vShow, !isCollapsed.value]
|
|
2212
2266
|
]),
|
|
2213
|
-
_ctx.$slots.footer ? withDirectives((openBlock(), createElementBlock("div", _hoisted_6, [
|
|
2267
|
+
_ctx.$slots.footer ? withDirectives((openBlock(), createElementBlock("div", _hoisted_6$1, [
|
|
2214
2268
|
renderSlot(_ctx.$slots, "footer")
|
|
2215
2269
|
], 512)), [
|
|
2216
2270
|
[vShow, !isCollapsed.value]
|
|
@@ -2219,8 +2273,8 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
2219
2273
|
};
|
|
2220
2274
|
}
|
|
2221
2275
|
});
|
|
2222
|
-
const _hoisted_1 = { key: 1 };
|
|
2223
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
2276
|
+
const _hoisted_1$a = { key: 1 };
|
|
2277
|
+
const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
2224
2278
|
__name: "FormActions",
|
|
2225
2279
|
props: {
|
|
2226
2280
|
submitLabel: { default: "Enregistrer" },
|
|
@@ -2249,7 +2303,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
2249
2303
|
__props.stackOnMobile && "flex-col sm:flex-row"
|
|
2250
2304
|
])
|
|
2251
2305
|
}, [
|
|
2252
|
-
__props.showCancel ? (openBlock(), createBlock(_sfc_main$
|
|
2306
|
+
__props.showCancel ? (openBlock(), createBlock(_sfc_main$s, {
|
|
2253
2307
|
key: 0,
|
|
2254
2308
|
type: "button",
|
|
2255
2309
|
variant: "outline",
|
|
@@ -2269,7 +2323,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
2269
2323
|
]),
|
|
2270
2324
|
_: 1
|
|
2271
2325
|
}, 8, ["disabled", "class"])) : createCommentVNode("", true),
|
|
2272
|
-
createVNode(_sfc_main$
|
|
2326
|
+
createVNode(_sfc_main$s, {
|
|
2273
2327
|
type: "submit",
|
|
2274
2328
|
variant: __props.submitVariant,
|
|
2275
2329
|
disabled: __props.disabled || __props.loading,
|
|
@@ -2287,7 +2341,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
2287
2341
|
class: "w-5 h-5"
|
|
2288
2342
|
}, null, 8, ["icon"])) : createCommentVNode("", true),
|
|
2289
2343
|
createTextVNode(" " + toDisplayString(__props.submitLabel), 1)
|
|
2290
|
-
], 64)) : (openBlock(), createElementBlock("span", _hoisted_1, toDisplayString(__props.loadingLabel || __props.submitLabel + "..."), 1))
|
|
2344
|
+
], 64)) : (openBlock(), createElementBlock("span", _hoisted_1$a, toDisplayString(__props.loadingLabel || __props.submitLabel + "..."), 1))
|
|
2291
2345
|
]),
|
|
2292
2346
|
_: 1
|
|
2293
2347
|
}, 8, ["variant", "disabled", "loading", "class"]),
|
|
@@ -2296,23 +2350,1321 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
2296
2350
|
};
|
|
2297
2351
|
}
|
|
2298
2352
|
});
|
|
2353
|
+
const _hoisted_1$9 = ["id", "name", "placeholder", "disabled", "required", "aria-invalid", "aria-required", "aria-describedby"];
|
|
2354
|
+
const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
2355
|
+
...{
|
|
2356
|
+
inheritAttrs: false
|
|
2357
|
+
},
|
|
2358
|
+
__name: "EmailInput",
|
|
2359
|
+
props: /* @__PURE__ */ mergeModels({
|
|
2360
|
+
placeholder: { default: "Enter email address..." },
|
|
2361
|
+
size: { default: "md" },
|
|
2362
|
+
disabled: { type: Boolean },
|
|
2363
|
+
showValidation: { type: Boolean, default: true },
|
|
2364
|
+
name: {},
|
|
2365
|
+
id: {},
|
|
2366
|
+
required: { type: Boolean },
|
|
2367
|
+
describedBy: {}
|
|
2368
|
+
}, {
|
|
2369
|
+
"modelValue": { default: "" },
|
|
2370
|
+
"modelModifiers": {}
|
|
2371
|
+
}),
|
|
2372
|
+
emits: ["update:modelValue"],
|
|
2373
|
+
setup(__props) {
|
|
2374
|
+
const props = __props;
|
|
2375
|
+
const modelValue = useModel(__props, "modelValue");
|
|
2376
|
+
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
2377
|
+
const isValid = computed(() => {
|
|
2378
|
+
if (!modelValue.value) return null;
|
|
2379
|
+
return emailRegex.test(modelValue.value);
|
|
2380
|
+
});
|
|
2381
|
+
const isTouched = ref(false);
|
|
2382
|
+
const showStatus = computed(() => {
|
|
2383
|
+
return props.showValidation && isTouched.value && !!modelValue.value;
|
|
2384
|
+
});
|
|
2385
|
+
function handleBlur() {
|
|
2386
|
+
isTouched.value = true;
|
|
2387
|
+
}
|
|
2388
|
+
return (_ctx, _cache) => {
|
|
2389
|
+
return openBlock(), createBlock(_sfc_main$p, {
|
|
2390
|
+
icon: "lucide:mail",
|
|
2391
|
+
size: __props.size,
|
|
2392
|
+
disabled: __props.disabled,
|
|
2393
|
+
invalid: showStatus.value && isValid.value === false
|
|
2394
|
+
}, {
|
|
2395
|
+
default: withCtx(({ inputClass }) => [
|
|
2396
|
+
withDirectives(createElementVNode("input", mergeProps({
|
|
2397
|
+
id: __props.id ?? __props.name,
|
|
2398
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => modelValue.value = $event),
|
|
2399
|
+
type: "email",
|
|
2400
|
+
name: __props.name,
|
|
2401
|
+
placeholder: __props.placeholder,
|
|
2402
|
+
disabled: __props.disabled,
|
|
2403
|
+
required: __props.required,
|
|
2404
|
+
"aria-invalid": showStatus.value && isValid.value === false || void 0,
|
|
2405
|
+
"aria-required": __props.required || void 0,
|
|
2406
|
+
"aria-describedby": __props.describedBy,
|
|
2407
|
+
class: inputClass
|
|
2408
|
+
}, _ctx.$attrs, { onBlur: handleBlur }), null, 16, _hoisted_1$9), [
|
|
2409
|
+
[vModelText, modelValue.value]
|
|
2410
|
+
])
|
|
2411
|
+
]),
|
|
2412
|
+
actions: withCtx(() => [
|
|
2413
|
+
showStatus.value && isValid.value ? (openBlock(), createBlock(unref(Icon), {
|
|
2414
|
+
key: 0,
|
|
2415
|
+
icon: "lucide:check-circle",
|
|
2416
|
+
class: "size-5 text-emerald-500"
|
|
2417
|
+
})) : showStatus.value && isValid.value === false ? (openBlock(), createBlock(unref(Icon), {
|
|
2418
|
+
key: 1,
|
|
2419
|
+
icon: "lucide:alert-circle",
|
|
2420
|
+
class: "size-5 text-red-500"
|
|
2421
|
+
})) : createCommentVNode("", true)
|
|
2422
|
+
]),
|
|
2423
|
+
_: 1
|
|
2424
|
+
}, 8, ["size", "disabled", "invalid"]);
|
|
2425
|
+
};
|
|
2426
|
+
}
|
|
2427
|
+
});
|
|
2428
|
+
const _hoisted_1$8 = ["id", "type", "name", "placeholder", "disabled", "required", "aria-required", "aria-describedby"];
|
|
2429
|
+
const _hoisted_2$5 = ["disabled"];
|
|
2430
|
+
const _hoisted_3$4 = {
|
|
2431
|
+
key: 0,
|
|
2432
|
+
class: "mt-2"
|
|
2433
|
+
};
|
|
2434
|
+
const _hoisted_4$2 = { class: "h-1.5 w-full rounded-full bg-gray-200 dark:bg-slate-700 overflow-hidden" };
|
|
2435
|
+
const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
2436
|
+
...{
|
|
2437
|
+
inheritAttrs: false
|
|
2438
|
+
},
|
|
2439
|
+
__name: "PasswordInput",
|
|
2440
|
+
props: /* @__PURE__ */ mergeModels({
|
|
2441
|
+
placeholder: { default: "Enter password..." },
|
|
2442
|
+
size: { default: "md" },
|
|
2443
|
+
disabled: { type: Boolean },
|
|
2444
|
+
showStrength: { type: Boolean, default: false },
|
|
2445
|
+
name: {},
|
|
2446
|
+
id: {},
|
|
2447
|
+
required: { type: Boolean },
|
|
2448
|
+
describedBy: {},
|
|
2449
|
+
minLength: { default: 8 }
|
|
2450
|
+
}, {
|
|
2451
|
+
"modelValue": { default: "" },
|
|
2452
|
+
"modelModifiers": {}
|
|
2453
|
+
}),
|
|
2454
|
+
emits: ["update:modelValue"],
|
|
2455
|
+
setup(__props) {
|
|
2456
|
+
const props = __props;
|
|
2457
|
+
const modelValue = useModel(__props, "modelValue");
|
|
2458
|
+
const showPassword = ref(false);
|
|
2459
|
+
const strength = computed(() => {
|
|
2460
|
+
const password = modelValue.value;
|
|
2461
|
+
if (!password) return null;
|
|
2462
|
+
let score = 0;
|
|
2463
|
+
if (password.length >= props.minLength) score++;
|
|
2464
|
+
if (password.length >= 12) score++;
|
|
2465
|
+
if (/[a-z]/.test(password)) score++;
|
|
2466
|
+
if (/[A-Z]/.test(password)) score++;
|
|
2467
|
+
if (/[0-9]/.test(password)) score++;
|
|
2468
|
+
if (/[^a-zA-Z0-9]/.test(password)) score++;
|
|
2469
|
+
if (score <= 2) return "weak";
|
|
2470
|
+
if (score <= 3) return "fair";
|
|
2471
|
+
if (score <= 4) return "good";
|
|
2472
|
+
return "strong";
|
|
2473
|
+
});
|
|
2474
|
+
const strengthConfig = computed(() => {
|
|
2475
|
+
const configs = {
|
|
2476
|
+
weak: { label: "Weak", color: "bg-red-500", width: "w-1/4" },
|
|
2477
|
+
fair: { label: "Fair", color: "bg-orange-500", width: "w-2/4" },
|
|
2478
|
+
good: { label: "Good", color: "bg-yellow-500", width: "w-3/4" },
|
|
2479
|
+
strong: { label: "Strong", color: "bg-emerald-500", width: "w-full" }
|
|
2480
|
+
};
|
|
2481
|
+
return strength.value ? configs[strength.value] : null;
|
|
2482
|
+
});
|
|
2483
|
+
function toggleVisibility() {
|
|
2484
|
+
showPassword.value = !showPassword.value;
|
|
2485
|
+
}
|
|
2486
|
+
return (_ctx, _cache) => {
|
|
2487
|
+
var _a, _b;
|
|
2488
|
+
return openBlock(), createElementBlock("div", null, [
|
|
2489
|
+
createVNode(_sfc_main$p, {
|
|
2490
|
+
icon: "lucide:lock",
|
|
2491
|
+
size: __props.size,
|
|
2492
|
+
disabled: __props.disabled
|
|
2493
|
+
}, {
|
|
2494
|
+
default: withCtx(({ inputClass }) => [
|
|
2495
|
+
withDirectives(createElementVNode("input", mergeProps({
|
|
2496
|
+
id: __props.id ?? __props.name,
|
|
2497
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => modelValue.value = $event),
|
|
2498
|
+
type: showPassword.value ? "text" : "password",
|
|
2499
|
+
name: __props.name,
|
|
2500
|
+
placeholder: __props.placeholder,
|
|
2501
|
+
disabled: __props.disabled,
|
|
2502
|
+
required: __props.required,
|
|
2503
|
+
"aria-required": __props.required || void 0,
|
|
2504
|
+
"aria-describedby": __props.describedBy,
|
|
2505
|
+
class: inputClass
|
|
2506
|
+
}, _ctx.$attrs, { autocomplete: "new-password" }), null, 16, _hoisted_1$8), [
|
|
2507
|
+
[vModelDynamic, modelValue.value]
|
|
2508
|
+
])
|
|
2509
|
+
]),
|
|
2510
|
+
actions: withCtx(() => [
|
|
2511
|
+
createElementVNode("button", {
|
|
2512
|
+
type: "button",
|
|
2513
|
+
disabled: __props.disabled,
|
|
2514
|
+
class: "p-1 rounded hover:bg-gray-100 dark:hover:bg-slate-600 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",
|
|
2515
|
+
onClick: toggleVisibility
|
|
2516
|
+
}, [
|
|
2517
|
+
createVNode(unref(Icon), {
|
|
2518
|
+
icon: showPassword.value ? "lucide:eye-off" : "lucide:eye",
|
|
2519
|
+
class: "size-5 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300"
|
|
2520
|
+
}, null, 8, ["icon"])
|
|
2521
|
+
], 8, _hoisted_2$5)
|
|
2522
|
+
]),
|
|
2523
|
+
_: 1
|
|
2524
|
+
}, 8, ["size", "disabled"]),
|
|
2525
|
+
__props.showStrength && modelValue.value ? (openBlock(), createElementBlock("div", _hoisted_3$4, [
|
|
2526
|
+
createElementVNode("div", _hoisted_4$2, [
|
|
2527
|
+
createElementVNode("div", {
|
|
2528
|
+
class: normalizeClass([
|
|
2529
|
+
"h-full rounded-full transition-all duration-300",
|
|
2530
|
+
(_a = strengthConfig.value) == null ? void 0 : _a.color,
|
|
2531
|
+
(_b = strengthConfig.value) == null ? void 0 : _b.width
|
|
2532
|
+
])
|
|
2533
|
+
}, null, 2)
|
|
2534
|
+
]),
|
|
2535
|
+
strengthConfig.value ? (openBlock(), createElementBlock("p", {
|
|
2536
|
+
key: 0,
|
|
2537
|
+
class: normalizeClass([
|
|
2538
|
+
"mt-1 text-xs font-medium",
|
|
2539
|
+
strength.value === "weak" && "text-red-500",
|
|
2540
|
+
strength.value === "fair" && "text-orange-500",
|
|
2541
|
+
strength.value === "good" && "text-yellow-600 dark:text-yellow-500",
|
|
2542
|
+
strength.value === "strong" && "text-emerald-500"
|
|
2543
|
+
])
|
|
2544
|
+
}, toDisplayString(strengthConfig.value.label), 3)) : createCommentVNode("", true)
|
|
2545
|
+
])) : createCommentVNode("", true)
|
|
2546
|
+
]);
|
|
2547
|
+
};
|
|
2548
|
+
}
|
|
2549
|
+
});
|
|
2550
|
+
const _hoisted_1$7 = ["disabled"];
|
|
2551
|
+
const _hoisted_2$4 = { class: "text-lg leading-none" };
|
|
2552
|
+
const _hoisted_3$3 = ["id", "value", "name", "placeholder", "disabled", "required", "aria-required", "aria-describedby"];
|
|
2553
|
+
const _hoisted_4$1 = { class: "text-xs text-gray-400 font-medium" };
|
|
2554
|
+
const _hoisted_5 = {
|
|
2555
|
+
key: 0,
|
|
2556
|
+
class: "absolute z-50 mt-1 w-full bg-white dark:bg-slate-800 border border-gray-200 dark:border-slate-700 rounded-xl shadow-lg overflow-hidden"
|
|
2557
|
+
};
|
|
2558
|
+
const _hoisted_6 = { class: "p-2 border-b border-gray-100 dark:border-slate-700" };
|
|
2559
|
+
const _hoisted_7 = { class: "max-h-48 overflow-y-auto" };
|
|
2560
|
+
const _hoisted_8 = ["onClick"];
|
|
2561
|
+
const _hoisted_9 = { class: "text-lg" };
|
|
2562
|
+
const _hoisted_10 = { class: "flex-1 text-sm text-gray-700 dark:text-gray-300" };
|
|
2563
|
+
const _hoisted_11 = { class: "text-sm text-gray-400" };
|
|
2564
|
+
const _hoisted_12 = {
|
|
2565
|
+
key: 0,
|
|
2566
|
+
class: "px-3 py-4 text-center text-sm text-gray-500"
|
|
2567
|
+
};
|
|
2568
|
+
const defaultCountries = [
|
|
2569
|
+
{ code: "FR", name: "France", dialCode: "+33", flag: "🇫🇷", format: "# ## ## ## ##" },
|
|
2570
|
+
{ code: "US", name: "United States", dialCode: "+1", flag: "🇺🇸", format: "(###) ###-####" },
|
|
2571
|
+
{ code: "GB", name: "United Kingdom", dialCode: "+44", flag: "🇬🇧", format: "#### ######" },
|
|
2572
|
+
{ code: "DE", name: "Germany", dialCode: "+49", flag: "🇩🇪", format: "### #######" },
|
|
2573
|
+
{ code: "ES", name: "Spain", dialCode: "+34", flag: "🇪🇸", format: "### ### ###" },
|
|
2574
|
+
{ code: "IT", name: "Italy", dialCode: "+39", flag: "🇮🇹", format: "### ### ####" },
|
|
2575
|
+
{ code: "BE", name: "Belgium", dialCode: "+32", flag: "🇧🇪", format: "### ## ## ##" },
|
|
2576
|
+
{ code: "CH", name: "Switzerland", dialCode: "+41", flag: "🇨🇭", format: "## ### ## ##" },
|
|
2577
|
+
{ code: "CA", name: "Canada", dialCode: "+1", flag: "🇨🇦", format: "(###) ###-####" },
|
|
2578
|
+
{ code: "AU", name: "Australia", dialCode: "+61", flag: "🇦🇺", format: "### ### ###" },
|
|
2579
|
+
{ code: "ML", name: "Mali", dialCode: "+223", flag: "🇲🇱", format: "## ## ## ##" },
|
|
2580
|
+
{ code: "SN", name: "Senegal", dialCode: "+221", flag: "🇸🇳", format: "## ### ## ##" },
|
|
2581
|
+
{ code: "CI", name: "Côte d'Ivoire", dialCode: "+225", flag: "🇨🇮", format: "## ## ## ## ##" },
|
|
2582
|
+
{ code: "MA", name: "Morocco", dialCode: "+212", flag: "🇲🇦", format: "## ## ## ## ##" },
|
|
2583
|
+
{ code: "TN", name: "Tunisia", dialCode: "+216", flag: "🇹🇳", format: "## ### ###" },
|
|
2584
|
+
{ code: "DZ", name: "Algeria", dialCode: "+213", flag: "🇩🇿", format: "### ## ## ##" }
|
|
2585
|
+
];
|
|
2586
|
+
function formatPhoneWithPattern(value, pattern) {
|
|
2587
|
+
if (!pattern) return value;
|
|
2588
|
+
const digits = value.replace(/\D/g, "");
|
|
2589
|
+
let result = "";
|
|
2590
|
+
let digitIndex = 0;
|
|
2591
|
+
for (const char of pattern) {
|
|
2592
|
+
if (digitIndex >= digits.length) break;
|
|
2593
|
+
if (char === "#") {
|
|
2594
|
+
result += digits[digitIndex];
|
|
2595
|
+
digitIndex++;
|
|
2596
|
+
} else {
|
|
2597
|
+
result += char;
|
|
2598
|
+
}
|
|
2599
|
+
}
|
|
2600
|
+
return result;
|
|
2601
|
+
}
|
|
2602
|
+
function getPhoneDigits(value) {
|
|
2603
|
+
return value.replace(/\D/g, "");
|
|
2604
|
+
}
|
|
2605
|
+
const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
2606
|
+
...{
|
|
2607
|
+
inheritAttrs: false
|
|
2608
|
+
},
|
|
2609
|
+
__name: "PhoneInput",
|
|
2610
|
+
props: /* @__PURE__ */ mergeModels({
|
|
2611
|
+
placeholder: { default: "Phone number" },
|
|
2612
|
+
size: { default: "md" },
|
|
2613
|
+
disabled: { type: Boolean },
|
|
2614
|
+
showDialCode: { type: Boolean, default: false },
|
|
2615
|
+
name: {},
|
|
2616
|
+
id: {},
|
|
2617
|
+
required: { type: Boolean },
|
|
2618
|
+
describedBy: {},
|
|
2619
|
+
defaultCountry: { default: "FR" },
|
|
2620
|
+
countries: { default: () => defaultCountries }
|
|
2621
|
+
}, {
|
|
2622
|
+
"modelValue": { default: "" },
|
|
2623
|
+
"modelModifiers": {}
|
|
2624
|
+
}),
|
|
2625
|
+
emits: ["update:modelValue"],
|
|
2626
|
+
setup(__props, { expose: __expose }) {
|
|
2627
|
+
const props = __props;
|
|
2628
|
+
const modelValue = useModel(__props, "modelValue");
|
|
2629
|
+
const selectedCountry = ref(
|
|
2630
|
+
props.countries.find((c) => c.code === props.defaultCountry) || props.countries[0]
|
|
2631
|
+
);
|
|
2632
|
+
const showDropdown = ref(false);
|
|
2633
|
+
const searchQuery = ref("");
|
|
2634
|
+
const dropdownRef = ref(null);
|
|
2635
|
+
const filteredCountries = computed(() => {
|
|
2636
|
+
if (!searchQuery.value) return props.countries;
|
|
2637
|
+
const query = searchQuery.value.toLowerCase();
|
|
2638
|
+
return props.countries.filter(
|
|
2639
|
+
(c) => c.name.toLowerCase().includes(query) || c.dialCode.includes(query) || c.code.toLowerCase().includes(query)
|
|
2640
|
+
);
|
|
2641
|
+
});
|
|
2642
|
+
const fullNumber = computed(() => {
|
|
2643
|
+
if (!modelValue.value) return "";
|
|
2644
|
+
return `${selectedCountry.value.dialCode}${modelValue.value}`;
|
|
2645
|
+
});
|
|
2646
|
+
const displayValue = computed(() => {
|
|
2647
|
+
const formatted = formatPhoneWithPattern(modelValue.value, selectedCountry.value.format);
|
|
2648
|
+
if (props.showDialCode && modelValue.value) {
|
|
2649
|
+
return `${selectedCountry.value.dialCode} ${formatted}`;
|
|
2650
|
+
}
|
|
2651
|
+
return formatted;
|
|
2652
|
+
});
|
|
2653
|
+
function selectCountry(country) {
|
|
2654
|
+
selectedCountry.value = country;
|
|
2655
|
+
showDropdown.value = false;
|
|
2656
|
+
searchQuery.value = "";
|
|
2657
|
+
}
|
|
2658
|
+
function parsePhoneWithDialCode(value) {
|
|
2659
|
+
const cleaned = value.replace(/\s/g, "");
|
|
2660
|
+
if (cleaned.startsWith("+") || cleaned.startsWith("00")) {
|
|
2661
|
+
const withPlus = cleaned.startsWith("00") ? "+" + cleaned.slice(2) : cleaned;
|
|
2662
|
+
for (const country of props.countries) {
|
|
2663
|
+
if (withPlus.startsWith(country.dialCode)) {
|
|
2664
|
+
const digits = withPlus.slice(country.dialCode.length).replace(/\D/g, "");
|
|
2665
|
+
return { digits, country };
|
|
2666
|
+
}
|
|
2667
|
+
}
|
|
2668
|
+
}
|
|
2669
|
+
return { digits: getPhoneDigits(value) };
|
|
2670
|
+
}
|
|
2671
|
+
function handleInput(event) {
|
|
2672
|
+
const target = event.target;
|
|
2673
|
+
const inputValue = target.value;
|
|
2674
|
+
const { digits, country } = parsePhoneWithDialCode(inputValue);
|
|
2675
|
+
if (country) {
|
|
2676
|
+
selectedCountry.value = country;
|
|
2677
|
+
}
|
|
2678
|
+
modelValue.value = digits;
|
|
2679
|
+
}
|
|
2680
|
+
function handlePaste(event) {
|
|
2681
|
+
var _a;
|
|
2682
|
+
const pastedData = (_a = event.clipboardData) == null ? void 0 : _a.getData("text");
|
|
2683
|
+
if (!pastedData) return;
|
|
2684
|
+
const { digits, country } = parsePhoneWithDialCode(pastedData);
|
|
2685
|
+
if (country) {
|
|
2686
|
+
event.preventDefault();
|
|
2687
|
+
selectedCountry.value = country;
|
|
2688
|
+
modelValue.value = digits;
|
|
2689
|
+
}
|
|
2690
|
+
}
|
|
2691
|
+
function handleClickOutside(event) {
|
|
2692
|
+
if (dropdownRef.value && !dropdownRef.value.contains(event.target)) {
|
|
2693
|
+
showDropdown.value = false;
|
|
2694
|
+
searchQuery.value = "";
|
|
2695
|
+
}
|
|
2696
|
+
}
|
|
2697
|
+
watch(showDropdown, (isOpen) => {
|
|
2698
|
+
if (isOpen) {
|
|
2699
|
+
document.addEventListener("click", handleClickOutside);
|
|
2700
|
+
} else {
|
|
2701
|
+
document.removeEventListener("click", handleClickOutside);
|
|
2702
|
+
}
|
|
2703
|
+
});
|
|
2704
|
+
__expose({ selectedCountry, fullNumber });
|
|
2705
|
+
return (_ctx, _cache) => {
|
|
2706
|
+
return openBlock(), createElementBlock("div", {
|
|
2707
|
+
class: "relative",
|
|
2708
|
+
ref_key: "dropdownRef",
|
|
2709
|
+
ref: dropdownRef
|
|
2710
|
+
}, [
|
|
2711
|
+
createVNode(_sfc_main$p, {
|
|
2712
|
+
size: __props.size,
|
|
2713
|
+
disabled: __props.disabled
|
|
2714
|
+
}, {
|
|
2715
|
+
icon: withCtx(() => [
|
|
2716
|
+
createElementVNode("button", {
|
|
2717
|
+
type: "button",
|
|
2718
|
+
disabled: __props.disabled,
|
|
2719
|
+
class: "flex items-center gap-1 pr-2 border-r border-gray-200 dark:border-slate-600 hover:bg-gray-50 dark:hover:bg-slate-600 -ml-1 pl-1 py-1 rounded-l transition-colors disabled:opacity-50 disabled:cursor-not-allowed",
|
|
2720
|
+
onClick: _cache[0] || (_cache[0] = withModifiers(($event) => showDropdown.value = !showDropdown.value, ["stop"]))
|
|
2721
|
+
}, [
|
|
2722
|
+
createElementVNode("span", _hoisted_2$4, toDisplayString(selectedCountry.value.flag), 1),
|
|
2723
|
+
createVNode(unref(Icon), {
|
|
2724
|
+
icon: "lucide:chevron-down",
|
|
2725
|
+
class: normalizeClass([
|
|
2726
|
+
"size-3 text-gray-400 transition-transform",
|
|
2727
|
+
showDropdown.value && "rotate-180"
|
|
2728
|
+
])
|
|
2729
|
+
}, null, 8, ["class"])
|
|
2730
|
+
], 8, _hoisted_1$7)
|
|
2731
|
+
]),
|
|
2732
|
+
default: withCtx(({ inputClass }) => [
|
|
2733
|
+
createElementVNode("input", mergeProps({
|
|
2734
|
+
id: __props.id ?? __props.name,
|
|
2735
|
+
value: displayValue.value,
|
|
2736
|
+
type: "tel",
|
|
2737
|
+
name: __props.name,
|
|
2738
|
+
placeholder: __props.placeholder,
|
|
2739
|
+
disabled: __props.disabled,
|
|
2740
|
+
required: __props.required,
|
|
2741
|
+
"aria-required": __props.required || void 0,
|
|
2742
|
+
"aria-describedby": __props.describedBy,
|
|
2743
|
+
class: [inputClass, "pl-20"]
|
|
2744
|
+
}, _ctx.$attrs, {
|
|
2745
|
+
onInput: handleInput,
|
|
2746
|
+
onPaste: handlePaste
|
|
2747
|
+
}), null, 16, _hoisted_3$3)
|
|
2748
|
+
]),
|
|
2749
|
+
actions: withCtx(() => [
|
|
2750
|
+
createElementVNode("span", _hoisted_4$1, toDisplayString(selectedCountry.value.dialCode), 1)
|
|
2751
|
+
]),
|
|
2752
|
+
_: 1
|
|
2753
|
+
}, 8, ["size", "disabled"]),
|
|
2754
|
+
createVNode(Transition, {
|
|
2755
|
+
"enter-active-class": "transition-all duration-200 ease-out",
|
|
2756
|
+
"enter-from-class": "opacity-0 -translate-y-2",
|
|
2757
|
+
"enter-to-class": "opacity-100 translate-y-0",
|
|
2758
|
+
"leave-active-class": "transition-all duration-150 ease-in",
|
|
2759
|
+
"leave-from-class": "opacity-100 translate-y-0",
|
|
2760
|
+
"leave-to-class": "opacity-0 -translate-y-2"
|
|
2761
|
+
}, {
|
|
2762
|
+
default: withCtx(() => [
|
|
2763
|
+
showDropdown.value ? (openBlock(), createElementBlock("div", _hoisted_5, [
|
|
2764
|
+
createElementVNode("div", _hoisted_6, [
|
|
2765
|
+
withDirectives(createElementVNode("input", {
|
|
2766
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => searchQuery.value = $event),
|
|
2767
|
+
type: "text",
|
|
2768
|
+
placeholder: "Search countries...",
|
|
2769
|
+
class: "w-full px-3 py-2 text-sm border border-gray-200 dark:border-slate-600 rounded-lg bg-gray-50 dark:bg-slate-700 text-gray-900 dark:text-white placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-primary-500"
|
|
2770
|
+
}, null, 512), [
|
|
2771
|
+
[vModelText, searchQuery.value]
|
|
2772
|
+
])
|
|
2773
|
+
]),
|
|
2774
|
+
createElementVNode("ul", _hoisted_7, [
|
|
2775
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(filteredCountries.value, (country) => {
|
|
2776
|
+
return openBlock(), createElementBlock("li", {
|
|
2777
|
+
key: country.code,
|
|
2778
|
+
class: normalizeClass(["flex items-center gap-3 px-3 py-2 cursor-pointer hover:bg-gray-50 dark:hover:bg-slate-700 transition-colors", selectedCountry.value.code === country.code && "bg-primary-50 dark:bg-primary-900/20"]),
|
|
2779
|
+
onClick: ($event) => selectCountry(country)
|
|
2780
|
+
}, [
|
|
2781
|
+
createElementVNode("span", _hoisted_9, toDisplayString(country.flag), 1),
|
|
2782
|
+
createElementVNode("span", _hoisted_10, toDisplayString(country.name), 1),
|
|
2783
|
+
createElementVNode("span", _hoisted_11, toDisplayString(country.dialCode), 1)
|
|
2784
|
+
], 10, _hoisted_8);
|
|
2785
|
+
}), 128)),
|
|
2786
|
+
filteredCountries.value.length === 0 ? (openBlock(), createElementBlock("li", _hoisted_12, " No countries found ")) : createCommentVNode("", true)
|
|
2787
|
+
])
|
|
2788
|
+
])) : createCommentVNode("", true)
|
|
2789
|
+
]),
|
|
2790
|
+
_: 1
|
|
2791
|
+
})
|
|
2792
|
+
], 512);
|
|
2793
|
+
};
|
|
2794
|
+
}
|
|
2795
|
+
});
|
|
2796
|
+
const _hoisted_1$6 = ["disabled"];
|
|
2797
|
+
const _hoisted_2$3 = ["id", "value", "name", "placeholder", "disabled", "required", "min", "max", "step", "aria-required", "aria-describedby"];
|
|
2798
|
+
const _hoisted_3$2 = ["disabled"];
|
|
2799
|
+
const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
2800
|
+
...{
|
|
2801
|
+
inheritAttrs: false
|
|
2802
|
+
},
|
|
2803
|
+
__name: "NumberInput",
|
|
2804
|
+
props: /* @__PURE__ */ mergeModels({
|
|
2805
|
+
placeholder: { default: "0" },
|
|
2806
|
+
size: { default: "md" },
|
|
2807
|
+
disabled: { type: Boolean },
|
|
2808
|
+
min: {},
|
|
2809
|
+
max: {},
|
|
2810
|
+
step: { default: 1 },
|
|
2811
|
+
name: {},
|
|
2812
|
+
id: {},
|
|
2813
|
+
required: { type: Boolean },
|
|
2814
|
+
describedBy: {},
|
|
2815
|
+
showStepper: { type: Boolean, default: true }
|
|
2816
|
+
}, {
|
|
2817
|
+
"modelValue": { default: null },
|
|
2818
|
+
"modelModifiers": {}
|
|
2819
|
+
}),
|
|
2820
|
+
emits: ["update:modelValue"],
|
|
2821
|
+
setup(__props) {
|
|
2822
|
+
const props = __props;
|
|
2823
|
+
const modelValue = useModel(__props, "modelValue");
|
|
2824
|
+
const canDecrement = computed(() => {
|
|
2825
|
+
if (props.disabled) return false;
|
|
2826
|
+
if (modelValue.value === null) return true;
|
|
2827
|
+
if (props.min !== void 0) return modelValue.value > props.min;
|
|
2828
|
+
return true;
|
|
2829
|
+
});
|
|
2830
|
+
const canIncrement = computed(() => {
|
|
2831
|
+
if (props.disabled) return false;
|
|
2832
|
+
if (modelValue.value === null) return true;
|
|
2833
|
+
if (props.max !== void 0) return modelValue.value < props.max;
|
|
2834
|
+
return true;
|
|
2835
|
+
});
|
|
2836
|
+
function increment() {
|
|
2837
|
+
if (!canIncrement.value) return;
|
|
2838
|
+
const current = modelValue.value ?? 0;
|
|
2839
|
+
const newValue = current + props.step;
|
|
2840
|
+
modelValue.value = props.max !== void 0 ? Math.min(newValue, props.max) : newValue;
|
|
2841
|
+
}
|
|
2842
|
+
function decrement() {
|
|
2843
|
+
if (!canDecrement.value) return;
|
|
2844
|
+
const current = modelValue.value ?? 0;
|
|
2845
|
+
const newValue = current - props.step;
|
|
2846
|
+
modelValue.value = props.min !== void 0 ? Math.max(newValue, props.min) : newValue;
|
|
2847
|
+
}
|
|
2848
|
+
function handleInput(event) {
|
|
2849
|
+
const target = event.target;
|
|
2850
|
+
const value = target.value === "" ? null : parseFloat(target.value);
|
|
2851
|
+
if (value !== null && !isNaN(value)) {
|
|
2852
|
+
let clampedValue = value;
|
|
2853
|
+
if (props.min !== void 0) clampedValue = Math.max(clampedValue, props.min);
|
|
2854
|
+
if (props.max !== void 0) clampedValue = Math.min(clampedValue, props.max);
|
|
2855
|
+
modelValue.value = clampedValue;
|
|
2856
|
+
} else {
|
|
2857
|
+
modelValue.value = null;
|
|
2858
|
+
}
|
|
2859
|
+
}
|
|
2860
|
+
return (_ctx, _cache) => {
|
|
2861
|
+
return openBlock(), createBlock(_sfc_main$p, {
|
|
2862
|
+
size: __props.size,
|
|
2863
|
+
disabled: __props.disabled
|
|
2864
|
+
}, createSlots({
|
|
2865
|
+
default: withCtx(({ inputClass }) => [
|
|
2866
|
+
createElementVNode("input", mergeProps({
|
|
2867
|
+
id: __props.id ?? __props.name,
|
|
2868
|
+
value: modelValue.value,
|
|
2869
|
+
type: "number",
|
|
2870
|
+
name: __props.name,
|
|
2871
|
+
placeholder: __props.placeholder,
|
|
2872
|
+
disabled: __props.disabled,
|
|
2873
|
+
required: __props.required,
|
|
2874
|
+
min: __props.min,
|
|
2875
|
+
max: __props.max,
|
|
2876
|
+
step: __props.step,
|
|
2877
|
+
"aria-required": __props.required || void 0,
|
|
2878
|
+
"aria-describedby": __props.describedBy,
|
|
2879
|
+
class: [inputClass, "text-center", __props.showStepper && "pl-12 pr-12"]
|
|
2880
|
+
}, _ctx.$attrs, { onInput: handleInput }), null, 16, _hoisted_2$3)
|
|
2881
|
+
]),
|
|
2882
|
+
_: 2
|
|
2883
|
+
}, [
|
|
2884
|
+
__props.showStepper ? {
|
|
2885
|
+
name: "icon",
|
|
2886
|
+
fn: withCtx(() => [
|
|
2887
|
+
createElementVNode("button", {
|
|
2888
|
+
type: "button",
|
|
2889
|
+
disabled: !canDecrement.value,
|
|
2890
|
+
class: "p-1 rounded hover:bg-gray-100 dark:hover:bg-slate-600 transition-colors disabled:opacity-30 disabled:cursor-not-allowed",
|
|
2891
|
+
onClick: decrement
|
|
2892
|
+
}, [
|
|
2893
|
+
createVNode(unref(Icon), {
|
|
2894
|
+
icon: "lucide:minus",
|
|
2895
|
+
class: "size-4 text-gray-500"
|
|
2896
|
+
})
|
|
2897
|
+
], 8, _hoisted_1$6)
|
|
2898
|
+
]),
|
|
2899
|
+
key: "0"
|
|
2900
|
+
} : void 0,
|
|
2901
|
+
__props.showStepper ? {
|
|
2902
|
+
name: "actions",
|
|
2903
|
+
fn: withCtx(() => [
|
|
2904
|
+
createElementVNode("button", {
|
|
2905
|
+
type: "button",
|
|
2906
|
+
disabled: !canIncrement.value,
|
|
2907
|
+
class: "p-1 rounded hover:bg-gray-100 dark:hover:bg-slate-600 transition-colors disabled:opacity-30 disabled:cursor-not-allowed",
|
|
2908
|
+
onClick: increment
|
|
2909
|
+
}, [
|
|
2910
|
+
createVNode(unref(Icon), {
|
|
2911
|
+
icon: "lucide:plus",
|
|
2912
|
+
class: "size-4 text-gray-500"
|
|
2913
|
+
})
|
|
2914
|
+
], 8, _hoisted_3$2)
|
|
2915
|
+
]),
|
|
2916
|
+
key: "1"
|
|
2917
|
+
} : void 0
|
|
2918
|
+
]), 1032, ["size", "disabled"]);
|
|
2919
|
+
};
|
|
2920
|
+
}
|
|
2921
|
+
});
|
|
2922
|
+
const _hoisted_1$5 = { class: "text-sm font-medium text-gray-500 dark:text-gray-400" };
|
|
2923
|
+
const _hoisted_2$2 = ["id", "value", "name", "placeholder", "disabled", "required", "aria-required", "aria-describedby"];
|
|
2924
|
+
const _hoisted_3$1 = { class: "text-sm font-medium text-gray-500 dark:text-gray-400" };
|
|
2925
|
+
const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
2926
|
+
...{
|
|
2927
|
+
inheritAttrs: false
|
|
2928
|
+
},
|
|
2929
|
+
__name: "MoneyInput",
|
|
2930
|
+
props: /* @__PURE__ */ mergeModels({
|
|
2931
|
+
placeholder: { default: "0.00" },
|
|
2932
|
+
size: { default: "md" },
|
|
2933
|
+
disabled: { type: Boolean },
|
|
2934
|
+
currency: { default: "EUR" },
|
|
2935
|
+
min: {},
|
|
2936
|
+
max: {},
|
|
2937
|
+
decimals: { default: 2 },
|
|
2938
|
+
name: {},
|
|
2939
|
+
id: {},
|
|
2940
|
+
required: { type: Boolean },
|
|
2941
|
+
describedBy: {}
|
|
2942
|
+
}, {
|
|
2943
|
+
"modelValue": { default: null },
|
|
2944
|
+
"modelModifiers": {}
|
|
2945
|
+
}),
|
|
2946
|
+
emits: ["update:modelValue"],
|
|
2947
|
+
setup(__props) {
|
|
2948
|
+
const currencyConfig = {
|
|
2949
|
+
EUR: { symbol: "€", locale: "fr-FR", position: "suffix" },
|
|
2950
|
+
USD: { symbol: "$", locale: "en-US", position: "prefix" },
|
|
2951
|
+
GBP: { symbol: "£", locale: "en-GB", position: "prefix" },
|
|
2952
|
+
XOF: { symbol: "CFA", locale: "fr-FR", position: "suffix" },
|
|
2953
|
+
MAD: { symbol: "DH", locale: "fr-MA", position: "suffix" },
|
|
2954
|
+
CHF: { symbol: "CHF", locale: "fr-CH", position: "suffix" },
|
|
2955
|
+
CAD: { symbol: "CA$", locale: "en-CA", position: "prefix" }
|
|
2956
|
+
};
|
|
2957
|
+
const props = __props;
|
|
2958
|
+
const modelValue = useModel(__props, "modelValue");
|
|
2959
|
+
const config = computed(() => currencyConfig[props.currency]);
|
|
2960
|
+
const displayValue = ref("");
|
|
2961
|
+
function formatForDisplay(value) {
|
|
2962
|
+
if (value === null) return "";
|
|
2963
|
+
return value.toLocaleString(config.value.locale, {
|
|
2964
|
+
minimumFractionDigits: props.decimals,
|
|
2965
|
+
maximumFractionDigits: props.decimals
|
|
2966
|
+
});
|
|
2967
|
+
}
|
|
2968
|
+
function parseDisplayValue(value) {
|
|
2969
|
+
if (!value) return null;
|
|
2970
|
+
const cleaned = value.replace(/\s/g, "").replace(/,/g, ".");
|
|
2971
|
+
const parsed = parseFloat(cleaned);
|
|
2972
|
+
return isNaN(parsed) ? null : parsed;
|
|
2973
|
+
}
|
|
2974
|
+
watch(
|
|
2975
|
+
() => modelValue.value,
|
|
2976
|
+
(newValue) => {
|
|
2977
|
+
displayValue.value = formatForDisplay(newValue);
|
|
2978
|
+
},
|
|
2979
|
+
{ immediate: true }
|
|
2980
|
+
);
|
|
2981
|
+
function handleInput(event) {
|
|
2982
|
+
const target = event.target;
|
|
2983
|
+
displayValue.value = target.value;
|
|
2984
|
+
}
|
|
2985
|
+
function handleBlur() {
|
|
2986
|
+
const parsed = parseDisplayValue(displayValue.value);
|
|
2987
|
+
if (parsed !== null) {
|
|
2988
|
+
let clampedValue = parsed;
|
|
2989
|
+
if (props.min !== void 0) clampedValue = Math.max(clampedValue, props.min);
|
|
2990
|
+
if (props.max !== void 0) clampedValue = Math.min(clampedValue, props.max);
|
|
2991
|
+
modelValue.value = clampedValue;
|
|
2992
|
+
displayValue.value = formatForDisplay(clampedValue);
|
|
2993
|
+
} else {
|
|
2994
|
+
modelValue.value = null;
|
|
2995
|
+
displayValue.value = "";
|
|
2996
|
+
}
|
|
2997
|
+
}
|
|
2998
|
+
return (_ctx, _cache) => {
|
|
2999
|
+
return openBlock(), createBlock(_sfc_main$p, {
|
|
3000
|
+
size: __props.size,
|
|
3001
|
+
disabled: __props.disabled
|
|
3002
|
+
}, createSlots({
|
|
3003
|
+
default: withCtx(({ inputClass }) => [
|
|
3004
|
+
createElementVNode("input", mergeProps({
|
|
3005
|
+
id: __props.id ?? __props.name,
|
|
3006
|
+
value: displayValue.value,
|
|
3007
|
+
type: "text",
|
|
3008
|
+
inputmode: "decimal",
|
|
3009
|
+
name: __props.name,
|
|
3010
|
+
placeholder: __props.placeholder,
|
|
3011
|
+
disabled: __props.disabled,
|
|
3012
|
+
required: __props.required,
|
|
3013
|
+
"aria-required": __props.required || void 0,
|
|
3014
|
+
"aria-describedby": __props.describedBy,
|
|
3015
|
+
class: [inputClass, "text-right"]
|
|
3016
|
+
}, _ctx.$attrs, {
|
|
3017
|
+
onInput: handleInput,
|
|
3018
|
+
onBlur: handleBlur
|
|
3019
|
+
}), null, 16, _hoisted_2$2)
|
|
3020
|
+
]),
|
|
3021
|
+
_: 2
|
|
3022
|
+
}, [
|
|
3023
|
+
config.value.position === "prefix" ? {
|
|
3024
|
+
name: "icon",
|
|
3025
|
+
fn: withCtx(() => [
|
|
3026
|
+
createElementVNode("span", _hoisted_1$5, toDisplayString(config.value.symbol), 1)
|
|
3027
|
+
]),
|
|
3028
|
+
key: "0"
|
|
3029
|
+
} : void 0,
|
|
3030
|
+
config.value.position === "suffix" ? {
|
|
3031
|
+
name: "actions",
|
|
3032
|
+
fn: withCtx(() => [
|
|
3033
|
+
createElementVNode("span", _hoisted_3$1, toDisplayString(config.value.symbol), 1)
|
|
3034
|
+
]),
|
|
3035
|
+
key: "1"
|
|
3036
|
+
} : void 0
|
|
3037
|
+
]), 1032, ["size", "disabled"]);
|
|
3038
|
+
};
|
|
3039
|
+
}
|
|
3040
|
+
});
|
|
3041
|
+
const _hoisted_1$4 = ["id", "value", "name", "placeholder", "disabled", "required", "min", "max", "step", "aria-required", "aria-describedby"];
|
|
3042
|
+
const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
3043
|
+
...{
|
|
3044
|
+
inheritAttrs: false
|
|
3045
|
+
},
|
|
3046
|
+
__name: "PercentInput",
|
|
3047
|
+
props: /* @__PURE__ */ mergeModels({
|
|
3048
|
+
placeholder: { default: "0" },
|
|
3049
|
+
size: { default: "md" },
|
|
3050
|
+
disabled: { type: Boolean },
|
|
3051
|
+
min: { default: 0 },
|
|
3052
|
+
max: { default: 100 },
|
|
3053
|
+
decimals: { default: 0 },
|
|
3054
|
+
name: {},
|
|
3055
|
+
id: {},
|
|
3056
|
+
required: { type: Boolean },
|
|
3057
|
+
describedBy: {}
|
|
3058
|
+
}, {
|
|
3059
|
+
"modelValue": { default: null },
|
|
3060
|
+
"modelModifiers": {}
|
|
3061
|
+
}),
|
|
3062
|
+
emits: ["update:modelValue"],
|
|
3063
|
+
setup(__props) {
|
|
3064
|
+
const props = __props;
|
|
3065
|
+
const modelValue = useModel(__props, "modelValue");
|
|
3066
|
+
const displayValue = computed({
|
|
3067
|
+
get: () => modelValue.value !== null ? modelValue.value.toString() : "",
|
|
3068
|
+
set: (val) => {
|
|
3069
|
+
if (val === "") {
|
|
3070
|
+
modelValue.value = null;
|
|
3071
|
+
return;
|
|
3072
|
+
}
|
|
3073
|
+
const parsed = parseFloat(val);
|
|
3074
|
+
if (!isNaN(parsed)) {
|
|
3075
|
+
let clamped = parsed;
|
|
3076
|
+
if (props.min !== void 0) clamped = Math.max(clamped, props.min);
|
|
3077
|
+
if (props.max !== void 0) clamped = Math.min(clamped, props.max);
|
|
3078
|
+
modelValue.value = clamped;
|
|
3079
|
+
}
|
|
3080
|
+
}
|
|
3081
|
+
});
|
|
3082
|
+
function handleInput(event) {
|
|
3083
|
+
const target = event.target;
|
|
3084
|
+
displayValue.value = target.value;
|
|
3085
|
+
}
|
|
3086
|
+
return (_ctx, _cache) => {
|
|
3087
|
+
return openBlock(), createBlock(_sfc_main$p, {
|
|
3088
|
+
size: __props.size,
|
|
3089
|
+
disabled: __props.disabled
|
|
3090
|
+
}, {
|
|
3091
|
+
default: withCtx(({ inputClass }) => [
|
|
3092
|
+
createElementVNode("input", mergeProps({
|
|
3093
|
+
id: __props.id ?? __props.name,
|
|
3094
|
+
value: displayValue.value,
|
|
3095
|
+
type: "number",
|
|
3096
|
+
inputmode: "decimal",
|
|
3097
|
+
name: __props.name,
|
|
3098
|
+
placeholder: __props.placeholder,
|
|
3099
|
+
disabled: __props.disabled,
|
|
3100
|
+
required: __props.required,
|
|
3101
|
+
min: __props.min,
|
|
3102
|
+
max: __props.max,
|
|
3103
|
+
step: __props.decimals > 0 ? Math.pow(10, -__props.decimals) : 1,
|
|
3104
|
+
"aria-required": __props.required || void 0,
|
|
3105
|
+
"aria-describedby": __props.describedBy,
|
|
3106
|
+
class: [inputClass, "text-right pr-10"]
|
|
3107
|
+
}, _ctx.$attrs, { onInput: handleInput }), null, 16, _hoisted_1$4)
|
|
3108
|
+
]),
|
|
3109
|
+
actions: withCtx(() => [..._cache[0] || (_cache[0] = [
|
|
3110
|
+
createElementVNode("span", { class: "text-sm font-medium text-gray-500 dark:text-gray-400" }, "%", -1)
|
|
3111
|
+
])]),
|
|
3112
|
+
_: 1
|
|
3113
|
+
}, 8, ["size", "disabled"]);
|
|
3114
|
+
};
|
|
3115
|
+
}
|
|
3116
|
+
});
|
|
3117
|
+
const _hoisted_1$3 = { class: "inline-flex items-center gap-2 bg-gray-50 dark:bg-slate-700 rounded-xl p-1 border border-gray-200 dark:border-slate-600" };
|
|
3118
|
+
const _hoisted_2$1 = ["disabled"];
|
|
3119
|
+
const _hoisted_3 = ["id", "value", "name", "disabled", "required", "min", "max"];
|
|
3120
|
+
const _hoisted_4 = ["disabled"];
|
|
3121
|
+
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
3122
|
+
...{
|
|
3123
|
+
inheritAttrs: false
|
|
3124
|
+
},
|
|
3125
|
+
__name: "QuantityInput",
|
|
3126
|
+
props: /* @__PURE__ */ mergeModels({
|
|
3127
|
+
size: { default: "md" },
|
|
3128
|
+
disabled: { type: Boolean },
|
|
3129
|
+
min: { default: 1 },
|
|
3130
|
+
max: {},
|
|
3131
|
+
step: { default: 1 },
|
|
3132
|
+
name: {},
|
|
3133
|
+
id: {},
|
|
3134
|
+
required: { type: Boolean }
|
|
3135
|
+
}, {
|
|
3136
|
+
"modelValue": { default: 1 },
|
|
3137
|
+
"modelModifiers": {}
|
|
3138
|
+
}),
|
|
3139
|
+
emits: ["update:modelValue"],
|
|
3140
|
+
setup(__props) {
|
|
3141
|
+
const props = __props;
|
|
3142
|
+
const modelValue = useModel(__props, "modelValue");
|
|
3143
|
+
const canDecrement = computed(() => {
|
|
3144
|
+
if (props.disabled) return false;
|
|
3145
|
+
if (props.min !== void 0) return modelValue.value > props.min;
|
|
3146
|
+
return true;
|
|
3147
|
+
});
|
|
3148
|
+
const canIncrement = computed(() => {
|
|
3149
|
+
if (props.disabled) return false;
|
|
3150
|
+
if (props.max !== void 0) return modelValue.value < props.max;
|
|
3151
|
+
return true;
|
|
3152
|
+
});
|
|
3153
|
+
function increment() {
|
|
3154
|
+
if (!canIncrement.value) return;
|
|
3155
|
+
const newValue = modelValue.value + props.step;
|
|
3156
|
+
modelValue.value = props.max !== void 0 ? Math.min(newValue, props.max) : newValue;
|
|
3157
|
+
}
|
|
3158
|
+
function decrement() {
|
|
3159
|
+
if (!canDecrement.value) return;
|
|
3160
|
+
const newValue = modelValue.value - props.step;
|
|
3161
|
+
modelValue.value = props.min !== void 0 ? Math.max(newValue, props.min) : newValue;
|
|
3162
|
+
}
|
|
3163
|
+
function handleInput(event) {
|
|
3164
|
+
const target = event.target;
|
|
3165
|
+
const value = parseInt(target.value, 10);
|
|
3166
|
+
if (!isNaN(value)) {
|
|
3167
|
+
let clampedValue = value;
|
|
3168
|
+
if (props.min !== void 0) clampedValue = Math.max(clampedValue, props.min);
|
|
3169
|
+
if (props.max !== void 0) clampedValue = Math.min(clampedValue, props.max);
|
|
3170
|
+
modelValue.value = clampedValue;
|
|
3171
|
+
}
|
|
3172
|
+
}
|
|
3173
|
+
const sizeClasses = computed(() => ({
|
|
3174
|
+
button: {
|
|
3175
|
+
sm: "size-7",
|
|
3176
|
+
md: "size-9",
|
|
3177
|
+
lg: "size-11"
|
|
3178
|
+
}[props.size],
|
|
3179
|
+
icon: {
|
|
3180
|
+
sm: "size-3",
|
|
3181
|
+
md: "size-4",
|
|
3182
|
+
lg: "size-5"
|
|
3183
|
+
}[props.size],
|
|
3184
|
+
input: {
|
|
3185
|
+
sm: "text-sm w-10",
|
|
3186
|
+
md: "text-base w-12",
|
|
3187
|
+
lg: "text-lg w-14"
|
|
3188
|
+
}[props.size]
|
|
3189
|
+
}));
|
|
3190
|
+
return (_ctx, _cache) => {
|
|
3191
|
+
return openBlock(), createElementBlock("div", _hoisted_1$3, [
|
|
3192
|
+
createElementVNode("button", {
|
|
3193
|
+
type: "button",
|
|
3194
|
+
disabled: !canDecrement.value,
|
|
3195
|
+
class: normalizeClass([
|
|
3196
|
+
"flex items-center justify-center rounded-lg bg-white dark:bg-slate-600 border border-gray-200 dark:border-slate-500 transition-all",
|
|
3197
|
+
"hover:bg-gray-50 dark:hover:bg-slate-500 hover:border-gray-300 dark:hover:border-slate-400",
|
|
3198
|
+
"disabled:opacity-40 disabled:cursor-not-allowed disabled:hover:bg-white dark:disabled:hover:bg-slate-600",
|
|
3199
|
+
"shadow-sm",
|
|
3200
|
+
sizeClasses.value.button
|
|
3201
|
+
]),
|
|
3202
|
+
onClick: decrement
|
|
3203
|
+
}, [
|
|
3204
|
+
createVNode(unref(Icon), {
|
|
3205
|
+
icon: "lucide:minus",
|
|
3206
|
+
class: normalizeClass(["text-gray-600 dark:text-gray-300", sizeClasses.value.icon])
|
|
3207
|
+
}, null, 8, ["class"])
|
|
3208
|
+
], 10, _hoisted_2$1),
|
|
3209
|
+
createElementVNode("input", mergeProps({
|
|
3210
|
+
id: __props.id ?? __props.name,
|
|
3211
|
+
value: modelValue.value,
|
|
3212
|
+
type: "number",
|
|
3213
|
+
name: __props.name,
|
|
3214
|
+
disabled: __props.disabled,
|
|
3215
|
+
required: __props.required,
|
|
3216
|
+
min: __props.min,
|
|
3217
|
+
max: __props.max,
|
|
3218
|
+
class: [
|
|
3219
|
+
"bg-transparent text-center font-semibold text-gray-900 dark:text-white",
|
|
3220
|
+
"focus:outline-none appearance-none",
|
|
3221
|
+
"[&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none",
|
|
3222
|
+
"disabled:opacity-50",
|
|
3223
|
+
sizeClasses.value.input
|
|
3224
|
+
]
|
|
3225
|
+
}, _ctx.$attrs, { onInput: handleInput }), null, 16, _hoisted_3),
|
|
3226
|
+
createElementVNode("button", {
|
|
3227
|
+
type: "button",
|
|
3228
|
+
disabled: !canIncrement.value,
|
|
3229
|
+
class: normalizeClass([
|
|
3230
|
+
"flex items-center justify-center rounded-lg bg-white dark:bg-slate-600 border border-gray-200 dark:border-slate-500 transition-all",
|
|
3231
|
+
"hover:bg-gray-50 dark:hover:bg-slate-500 hover:border-gray-300 dark:hover:border-slate-400",
|
|
3232
|
+
"disabled:opacity-40 disabled:cursor-not-allowed disabled:hover:bg-white dark:disabled:hover:bg-slate-600",
|
|
3233
|
+
"shadow-sm",
|
|
3234
|
+
sizeClasses.value.button
|
|
3235
|
+
]),
|
|
3236
|
+
onClick: increment
|
|
3237
|
+
}, [
|
|
3238
|
+
createVNode(unref(Icon), {
|
|
3239
|
+
icon: "lucide:plus",
|
|
3240
|
+
class: normalizeClass(["text-gray-600 dark:text-gray-300", sizeClasses.value.icon])
|
|
3241
|
+
}, null, 8, ["class"])
|
|
3242
|
+
], 10, _hoisted_4)
|
|
3243
|
+
]);
|
|
3244
|
+
};
|
|
3245
|
+
}
|
|
3246
|
+
});
|
|
3247
|
+
const _hoisted_1$2 = ["id", "name", "placeholder", "disabled", "required", "aria-invalid", "aria-required", "aria-describedby"];
|
|
3248
|
+
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
3249
|
+
...{
|
|
3250
|
+
inheritAttrs: false
|
|
3251
|
+
},
|
|
3252
|
+
__name: "URLInput",
|
|
3253
|
+
props: /* @__PURE__ */ mergeModels({
|
|
3254
|
+
placeholder: { default: "https://example.com" },
|
|
3255
|
+
size: { default: "md" },
|
|
3256
|
+
disabled: { type: Boolean },
|
|
3257
|
+
showValidation: { type: Boolean, default: true },
|
|
3258
|
+
name: {},
|
|
3259
|
+
id: {},
|
|
3260
|
+
required: { type: Boolean },
|
|
3261
|
+
describedBy: {}
|
|
3262
|
+
}, {
|
|
3263
|
+
"modelValue": { default: "" },
|
|
3264
|
+
"modelModifiers": {}
|
|
3265
|
+
}),
|
|
3266
|
+
emits: ["update:modelValue"],
|
|
3267
|
+
setup(__props) {
|
|
3268
|
+
const props = __props;
|
|
3269
|
+
const modelValue = useModel(__props, "modelValue");
|
|
3270
|
+
const urlRegex = /^(https?:\/\/)?([\da-z.-]+)\.([a-z.]{2,6})([/\w .-]*)*\/?$/;
|
|
3271
|
+
const isValid = computed(() => {
|
|
3272
|
+
if (!modelValue.value) return null;
|
|
3273
|
+
return urlRegex.test(modelValue.value);
|
|
3274
|
+
});
|
|
3275
|
+
const isTouched = ref(false);
|
|
3276
|
+
const showStatus = computed(() => {
|
|
3277
|
+
return props.showValidation && isTouched.value && !!modelValue.value;
|
|
3278
|
+
});
|
|
3279
|
+
function handleBlur() {
|
|
3280
|
+
isTouched.value = true;
|
|
3281
|
+
}
|
|
3282
|
+
function openUrl() {
|
|
3283
|
+
if (isValid.value && modelValue.value) {
|
|
3284
|
+
const url = modelValue.value.startsWith("http") ? modelValue.value : `https://${modelValue.value}`;
|
|
3285
|
+
window.open(url, "_blank");
|
|
3286
|
+
}
|
|
3287
|
+
}
|
|
3288
|
+
return (_ctx, _cache) => {
|
|
3289
|
+
return openBlock(), createBlock(_sfc_main$p, {
|
|
3290
|
+
icon: "lucide:link",
|
|
3291
|
+
size: __props.size,
|
|
3292
|
+
disabled: __props.disabled,
|
|
3293
|
+
invalid: showStatus.value && isValid.value === false
|
|
3294
|
+
}, {
|
|
3295
|
+
default: withCtx(({ inputClass }) => [
|
|
3296
|
+
withDirectives(createElementVNode("input", mergeProps({
|
|
3297
|
+
id: __props.id ?? __props.name,
|
|
3298
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => modelValue.value = $event),
|
|
3299
|
+
type: "url",
|
|
3300
|
+
name: __props.name,
|
|
3301
|
+
placeholder: __props.placeholder,
|
|
3302
|
+
disabled: __props.disabled,
|
|
3303
|
+
required: __props.required,
|
|
3304
|
+
"aria-invalid": showStatus.value && isValid.value === false || void 0,
|
|
3305
|
+
"aria-required": __props.required || void 0,
|
|
3306
|
+
"aria-describedby": __props.describedBy,
|
|
3307
|
+
class: inputClass
|
|
3308
|
+
}, _ctx.$attrs, { onBlur: handleBlur }), null, 16, _hoisted_1$2), [
|
|
3309
|
+
[vModelText, modelValue.value]
|
|
3310
|
+
])
|
|
3311
|
+
]),
|
|
3312
|
+
actions: withCtx(() => [
|
|
3313
|
+
showStatus.value && isValid.value && modelValue.value ? (openBlock(), createElementBlock("button", {
|
|
3314
|
+
key: 0,
|
|
3315
|
+
type: "button",
|
|
3316
|
+
class: "p-1 rounded hover:bg-gray-100 dark:hover:bg-slate-600 transition-colors",
|
|
3317
|
+
title: "Open URL",
|
|
3318
|
+
onClick: openUrl
|
|
3319
|
+
}, [
|
|
3320
|
+
createVNode(unref(Icon), {
|
|
3321
|
+
icon: "lucide:external-link",
|
|
3322
|
+
class: "size-4 text-gray-400 hover:text-primary-500"
|
|
3323
|
+
})
|
|
3324
|
+
])) : showStatus.value && isValid.value === false ? (openBlock(), createBlock(unref(Icon), {
|
|
3325
|
+
key: 1,
|
|
3326
|
+
icon: "lucide:alert-circle",
|
|
3327
|
+
class: "size-5 text-red-500"
|
|
3328
|
+
})) : createCommentVNode("", true)
|
|
3329
|
+
]),
|
|
3330
|
+
_: 1
|
|
3331
|
+
}, 8, ["size", "disabled", "invalid"]);
|
|
3332
|
+
};
|
|
3333
|
+
}
|
|
3334
|
+
});
|
|
3335
|
+
const _hoisted_1$1 = ["value", "type", "name", "disabled", "onInput", "onKeydown"];
|
|
3336
|
+
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
3337
|
+
...{
|
|
3338
|
+
inheritAttrs: false
|
|
3339
|
+
},
|
|
3340
|
+
__name: "OTPInput",
|
|
3341
|
+
props: /* @__PURE__ */ mergeModels({
|
|
3342
|
+
length: { default: 6 },
|
|
3343
|
+
size: { default: "md" },
|
|
3344
|
+
disabled: { type: Boolean },
|
|
3345
|
+
autoFocus: { type: Boolean, default: true },
|
|
3346
|
+
name: {},
|
|
3347
|
+
masked: { type: Boolean, default: false }
|
|
3348
|
+
}, {
|
|
3349
|
+
"modelValue": { default: "" },
|
|
3350
|
+
"modelModifiers": {}
|
|
3351
|
+
}),
|
|
3352
|
+
emits: /* @__PURE__ */ mergeModels(["complete"], ["update:modelValue"]),
|
|
3353
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
3354
|
+
const props = __props;
|
|
3355
|
+
const emit = __emit;
|
|
3356
|
+
const modelValue = useModel(__props, "modelValue");
|
|
3357
|
+
const inputRefs = ref([]);
|
|
3358
|
+
const digits = computed(() => {
|
|
3359
|
+
const arr = modelValue.value.split("");
|
|
3360
|
+
while (arr.length < props.length) {
|
|
3361
|
+
arr.push("");
|
|
3362
|
+
}
|
|
3363
|
+
return arr.slice(0, props.length);
|
|
3364
|
+
});
|
|
3365
|
+
const sizeClasses = computed(() => ({
|
|
3366
|
+
input: {
|
|
3367
|
+
sm: "size-10 text-lg",
|
|
3368
|
+
md: "size-12 text-xl",
|
|
3369
|
+
lg: "size-14 text-2xl"
|
|
3370
|
+
}[props.size],
|
|
3371
|
+
gap: {
|
|
3372
|
+
sm: "gap-2",
|
|
3373
|
+
md: "gap-3",
|
|
3374
|
+
lg: "gap-4"
|
|
3375
|
+
}[props.size]
|
|
3376
|
+
}));
|
|
3377
|
+
function updateValue(index, value) {
|
|
3378
|
+
const newDigits = [...digits.value];
|
|
3379
|
+
newDigits[index] = value.slice(-1);
|
|
3380
|
+
modelValue.value = newDigits.join("");
|
|
3381
|
+
if (modelValue.value.length === props.length && !modelValue.value.includes("")) {
|
|
3382
|
+
emit("complete", modelValue.value);
|
|
3383
|
+
}
|
|
3384
|
+
}
|
|
3385
|
+
function handleInput(event, index) {
|
|
3386
|
+
const target = event.target;
|
|
3387
|
+
const value = target.value.replace(/\D/g, "");
|
|
3388
|
+
if (value) {
|
|
3389
|
+
updateValue(index, value);
|
|
3390
|
+
if (index < props.length - 1) {
|
|
3391
|
+
nextTick(() => {
|
|
3392
|
+
var _a;
|
|
3393
|
+
(_a = inputRefs.value[index + 1]) == null ? void 0 : _a.focus();
|
|
3394
|
+
});
|
|
3395
|
+
}
|
|
3396
|
+
}
|
|
3397
|
+
}
|
|
3398
|
+
function handleKeydown(event, index) {
|
|
3399
|
+
var _a, _b, _c;
|
|
3400
|
+
const target = event.target;
|
|
3401
|
+
if (event.key === "Backspace") {
|
|
3402
|
+
if (!target.value && index > 0) {
|
|
3403
|
+
(_a = inputRefs.value[index - 1]) == null ? void 0 : _a.focus();
|
|
3404
|
+
}
|
|
3405
|
+
updateValue(index, "");
|
|
3406
|
+
} else if (event.key === "ArrowLeft" && index > 0) {
|
|
3407
|
+
(_b = inputRefs.value[index - 1]) == null ? void 0 : _b.focus();
|
|
3408
|
+
} else if (event.key === "ArrowRight" && index < props.length - 1) {
|
|
3409
|
+
(_c = inputRefs.value[index + 1]) == null ? void 0 : _c.focus();
|
|
3410
|
+
}
|
|
3411
|
+
}
|
|
3412
|
+
function handlePaste(event) {
|
|
3413
|
+
var _a;
|
|
3414
|
+
event.preventDefault();
|
|
3415
|
+
const pastedData = (_a = event.clipboardData) == null ? void 0 : _a.getData("text").replace(/\D/g, "").slice(0, props.length);
|
|
3416
|
+
if (pastedData) {
|
|
3417
|
+
modelValue.value = pastedData;
|
|
3418
|
+
const focusIndex = Math.min(pastedData.length, props.length - 1);
|
|
3419
|
+
nextTick(() => {
|
|
3420
|
+
var _a2;
|
|
3421
|
+
(_a2 = inputRefs.value[focusIndex]) == null ? void 0 : _a2.focus();
|
|
3422
|
+
});
|
|
3423
|
+
}
|
|
3424
|
+
}
|
|
3425
|
+
function handleFocus(event) {
|
|
3426
|
+
const target = event.target;
|
|
3427
|
+
target.select();
|
|
3428
|
+
}
|
|
3429
|
+
watch(
|
|
3430
|
+
() => modelValue.value,
|
|
3431
|
+
(newValue) => {
|
|
3432
|
+
if (newValue.length === props.length) {
|
|
3433
|
+
emit("complete", newValue);
|
|
3434
|
+
}
|
|
3435
|
+
}
|
|
3436
|
+
);
|
|
3437
|
+
onMounted(() => {
|
|
3438
|
+
var _a;
|
|
3439
|
+
if (props.autoFocus) {
|
|
3440
|
+
(_a = inputRefs.value[0]) == null ? void 0 : _a.focus();
|
|
3441
|
+
}
|
|
3442
|
+
});
|
|
3443
|
+
function setInputRef(el, index) {
|
|
3444
|
+
if (el) {
|
|
3445
|
+
inputRefs.value[index] = el;
|
|
3446
|
+
}
|
|
3447
|
+
}
|
|
3448
|
+
__expose({ focus: () => {
|
|
3449
|
+
var _a;
|
|
3450
|
+
return (_a = inputRefs.value[0]) == null ? void 0 : _a.focus();
|
|
3451
|
+
} });
|
|
3452
|
+
return (_ctx, _cache) => {
|
|
3453
|
+
return openBlock(), createElementBlock("div", {
|
|
3454
|
+
class: normalizeClass(["inline-flex", sizeClasses.value.gap])
|
|
3455
|
+
}, [
|
|
3456
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(digits.value, (digit, index) => {
|
|
3457
|
+
return openBlock(), createElementBlock("input", {
|
|
3458
|
+
key: index,
|
|
3459
|
+
ref_for: true,
|
|
3460
|
+
ref: (el) => setInputRef(el, index),
|
|
3461
|
+
value: digit,
|
|
3462
|
+
type: __props.masked ? "password" : "text",
|
|
3463
|
+
inputmode: "numeric",
|
|
3464
|
+
name: __props.name ? `${__props.name}-${index}` : void 0,
|
|
3465
|
+
disabled: __props.disabled,
|
|
3466
|
+
maxlength: "1",
|
|
3467
|
+
autocomplete: "one-time-code",
|
|
3468
|
+
class: normalizeClass([
|
|
3469
|
+
"text-center font-semibold rounded-xl border-2 transition-all",
|
|
3470
|
+
"bg-gray-50 dark:bg-slate-700 text-gray-900 dark:text-white",
|
|
3471
|
+
"border-gray-200 dark:border-slate-600",
|
|
3472
|
+
"focus:border-primary-500 focus:ring-2 focus:ring-primary-500 focus:ring-offset-2 focus:outline-none",
|
|
3473
|
+
"disabled:opacity-50 disabled:cursor-not-allowed",
|
|
3474
|
+
digit ? "border-primary-300 dark:border-primary-500/50" : "",
|
|
3475
|
+
sizeClasses.value.input
|
|
3476
|
+
]),
|
|
3477
|
+
onInput: ($event) => handleInput($event, index),
|
|
3478
|
+
onKeydown: ($event) => handleKeydown($event, index),
|
|
3479
|
+
onPaste: handlePaste,
|
|
3480
|
+
onFocus: handleFocus
|
|
3481
|
+
}, null, 42, _hoisted_1$1);
|
|
3482
|
+
}), 128))
|
|
3483
|
+
], 2);
|
|
3484
|
+
};
|
|
3485
|
+
}
|
|
3486
|
+
});
|
|
3487
|
+
const _hoisted_1 = ["onClick"];
|
|
3488
|
+
const _hoisted_2 = ["id", "name", "placeholder", "disabled", "required"];
|
|
3489
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
3490
|
+
...{
|
|
3491
|
+
inheritAttrs: false
|
|
3492
|
+
},
|
|
3493
|
+
__name: "TagsInput",
|
|
3494
|
+
props: /* @__PURE__ */ mergeModels({
|
|
3495
|
+
placeholder: { default: "Add tag..." },
|
|
3496
|
+
size: { default: "md" },
|
|
3497
|
+
disabled: { type: Boolean },
|
|
3498
|
+
max: {},
|
|
3499
|
+
allowDuplicates: { type: Boolean, default: false },
|
|
3500
|
+
name: {},
|
|
3501
|
+
id: {},
|
|
3502
|
+
required: { type: Boolean }
|
|
3503
|
+
}, {
|
|
3504
|
+
"modelValue": { default: () => [] },
|
|
3505
|
+
"modelModifiers": {}
|
|
3506
|
+
}),
|
|
3507
|
+
emits: ["update:modelValue"],
|
|
3508
|
+
setup(__props, { expose: __expose }) {
|
|
3509
|
+
const props = __props;
|
|
3510
|
+
const modelValue = useModel(__props, "modelValue");
|
|
3511
|
+
const inputValue = ref("");
|
|
3512
|
+
const inputRef = ref(null);
|
|
3513
|
+
const canAddMore = computed(() => {
|
|
3514
|
+
if (props.max !== void 0) return modelValue.value.length < props.max;
|
|
3515
|
+
return true;
|
|
3516
|
+
});
|
|
3517
|
+
const sizeClasses = computed(() => ({
|
|
3518
|
+
wrapper: {
|
|
3519
|
+
sm: "min-h-9 py-1.5 px-2 gap-1",
|
|
3520
|
+
md: "min-h-11 py-2 px-3 gap-1.5",
|
|
3521
|
+
lg: "min-h-13 py-2.5 px-4 gap-2"
|
|
3522
|
+
}[props.size],
|
|
3523
|
+
tag: {
|
|
3524
|
+
sm: "text-xs px-2 py-0.5",
|
|
3525
|
+
md: "text-sm px-2.5 py-1",
|
|
3526
|
+
lg: "text-base px-3 py-1.5"
|
|
3527
|
+
}[props.size],
|
|
3528
|
+
input: {
|
|
3529
|
+
sm: "text-xs",
|
|
3530
|
+
md: "text-sm",
|
|
3531
|
+
lg: "text-base"
|
|
3532
|
+
}[props.size],
|
|
3533
|
+
icon: {
|
|
3534
|
+
sm: "size-3",
|
|
3535
|
+
md: "size-3.5",
|
|
3536
|
+
lg: "size-4"
|
|
3537
|
+
}[props.size]
|
|
3538
|
+
}));
|
|
3539
|
+
function addTag(value) {
|
|
3540
|
+
const trimmed = value.trim();
|
|
3541
|
+
if (!trimmed) return;
|
|
3542
|
+
if (!canAddMore.value) return;
|
|
3543
|
+
if (!props.allowDuplicates && modelValue.value.includes(trimmed)) return;
|
|
3544
|
+
modelValue.value = [...modelValue.value, trimmed];
|
|
3545
|
+
inputValue.value = "";
|
|
3546
|
+
}
|
|
3547
|
+
function removeTag(index) {
|
|
3548
|
+
if (props.disabled) return;
|
|
3549
|
+
modelValue.value = modelValue.value.filter((_, i) => i !== index);
|
|
3550
|
+
}
|
|
3551
|
+
function handleKeydown(event) {
|
|
3552
|
+
if (event.key === "Enter" || event.key === ",") {
|
|
3553
|
+
event.preventDefault();
|
|
3554
|
+
addTag(inputValue.value);
|
|
3555
|
+
} else if (event.key === "Backspace" && !inputValue.value && modelValue.value.length > 0) {
|
|
3556
|
+
removeTag(modelValue.value.length - 1);
|
|
3557
|
+
}
|
|
3558
|
+
}
|
|
3559
|
+
function handleBlur() {
|
|
3560
|
+
if (inputValue.value) {
|
|
3561
|
+
addTag(inputValue.value);
|
|
3562
|
+
}
|
|
3563
|
+
}
|
|
3564
|
+
function focusInput() {
|
|
3565
|
+
var _a;
|
|
3566
|
+
(_a = inputRef.value) == null ? void 0 : _a.focus();
|
|
3567
|
+
}
|
|
3568
|
+
__expose({ focus: focusInput });
|
|
3569
|
+
return (_ctx, _cache) => {
|
|
3570
|
+
return openBlock(), createElementBlock("div", {
|
|
3571
|
+
class: normalizeClass([
|
|
3572
|
+
"flex flex-wrap items-center rounded-xl border transition-all cursor-text",
|
|
3573
|
+
"bg-gray-50 dark:bg-slate-700",
|
|
3574
|
+
"border-gray-200 dark:border-slate-600",
|
|
3575
|
+
"focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500 focus-within:bg-white dark:focus-within:bg-slate-600",
|
|
3576
|
+
__props.disabled && "opacity-50 cursor-not-allowed",
|
|
3577
|
+
sizeClasses.value.wrapper
|
|
3578
|
+
]),
|
|
3579
|
+
onClick: focusInput
|
|
3580
|
+
}, [
|
|
3581
|
+
createVNode(TransitionGroup, {
|
|
3582
|
+
name: "tag",
|
|
3583
|
+
tag: "div",
|
|
3584
|
+
class: "flex flex-wrap gap-1.5"
|
|
3585
|
+
}, {
|
|
3586
|
+
default: withCtx(() => [
|
|
3587
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(modelValue.value, (tag, index) => {
|
|
3588
|
+
return openBlock(), createElementBlock("span", {
|
|
3589
|
+
key: tag + index,
|
|
3590
|
+
class: normalizeClass([
|
|
3591
|
+
"inline-flex items-center gap-1 rounded-lg font-medium",
|
|
3592
|
+
"bg-primary-100 dark:bg-primary-900/30 text-primary-700 dark:text-primary-300",
|
|
3593
|
+
sizeClasses.value.tag
|
|
3594
|
+
])
|
|
3595
|
+
}, [
|
|
3596
|
+
createTextVNode(toDisplayString(tag) + " ", 1),
|
|
3597
|
+
!__props.disabled ? (openBlock(), createElementBlock("button", {
|
|
3598
|
+
key: 0,
|
|
3599
|
+
type: "button",
|
|
3600
|
+
class: "rounded-full hover:bg-primary-200 dark:hover:bg-primary-800/50 transition-colors p-0.5",
|
|
3601
|
+
onClick: withModifiers(($event) => removeTag(index), ["stop"])
|
|
3602
|
+
}, [
|
|
3603
|
+
createVNode(unref(Icon), {
|
|
3604
|
+
icon: "lucide:x",
|
|
3605
|
+
class: normalizeClass(["text-primary-500", sizeClasses.value.icon])
|
|
3606
|
+
}, null, 8, ["class"])
|
|
3607
|
+
], 8, _hoisted_1)) : createCommentVNode("", true)
|
|
3608
|
+
], 2);
|
|
3609
|
+
}), 128))
|
|
3610
|
+
]),
|
|
3611
|
+
_: 1
|
|
3612
|
+
}),
|
|
3613
|
+
canAddMore.value ? withDirectives((openBlock(), createElementBlock("input", mergeProps({
|
|
3614
|
+
key: 0,
|
|
3615
|
+
id: __props.id ?? __props.name,
|
|
3616
|
+
ref_key: "inputRef",
|
|
3617
|
+
ref: inputRef,
|
|
3618
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => inputValue.value = $event),
|
|
3619
|
+
type: "text",
|
|
3620
|
+
name: __props.name,
|
|
3621
|
+
placeholder: modelValue.value.length === 0 ? __props.placeholder : "",
|
|
3622
|
+
disabled: __props.disabled,
|
|
3623
|
+
required: __props.required && modelValue.value.length === 0,
|
|
3624
|
+
class: [
|
|
3625
|
+
"flex-1 min-w-20 bg-transparent border-none focus:outline-none",
|
|
3626
|
+
"text-gray-900 dark:text-white placeholder-gray-400",
|
|
3627
|
+
sizeClasses.value.input
|
|
3628
|
+
]
|
|
3629
|
+
}, _ctx.$attrs, {
|
|
3630
|
+
onKeydown: handleKeydown,
|
|
3631
|
+
onBlur: handleBlur
|
|
3632
|
+
}), null, 16, _hoisted_2)), [
|
|
3633
|
+
[vModelText, inputValue.value]
|
|
3634
|
+
]) : createCommentVNode("", true)
|
|
3635
|
+
], 2);
|
|
3636
|
+
};
|
|
3637
|
+
}
|
|
3638
|
+
});
|
|
3639
|
+
const TagsInput = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-fcace07c"]]);
|
|
2299
3640
|
export {
|
|
2300
3641
|
Slider as S,
|
|
2301
|
-
|
|
2302
|
-
_sfc_main$
|
|
2303
|
-
_sfc_main$
|
|
2304
|
-
_sfc_main$
|
|
2305
|
-
_sfc_main$
|
|
2306
|
-
_sfc_main$
|
|
2307
|
-
_sfc_main$
|
|
2308
|
-
_sfc_main$
|
|
2309
|
-
_sfc_main$
|
|
2310
|
-
_sfc_main$
|
|
2311
|
-
_sfc_main$
|
|
2312
|
-
_sfc_main$
|
|
2313
|
-
_sfc_main$
|
|
2314
|
-
_sfc_main$
|
|
2315
|
-
_sfc_main$
|
|
2316
|
-
_sfc_main as
|
|
3642
|
+
TagsInput as T,
|
|
3643
|
+
_sfc_main$r as _,
|
|
3644
|
+
_sfc_main$q as a,
|
|
3645
|
+
_sfc_main$o as b,
|
|
3646
|
+
_sfc_main$n as c,
|
|
3647
|
+
_sfc_main$m as d,
|
|
3648
|
+
_sfc_main$l as e,
|
|
3649
|
+
_sfc_main$k as f,
|
|
3650
|
+
_sfc_main$i as g,
|
|
3651
|
+
_sfc_main$h as h,
|
|
3652
|
+
_sfc_main$g as i,
|
|
3653
|
+
_sfc_main$f as j,
|
|
3654
|
+
_sfc_main$e as k,
|
|
3655
|
+
_sfc_main$d as l,
|
|
3656
|
+
_sfc_main$c as m,
|
|
3657
|
+
_sfc_main$b as n,
|
|
3658
|
+
_sfc_main$a as o,
|
|
3659
|
+
_sfc_main$p as p,
|
|
3660
|
+
_sfc_main$9 as q,
|
|
3661
|
+
_sfc_main$8 as r,
|
|
3662
|
+
_sfc_main$7 as s,
|
|
3663
|
+
_sfc_main$6 as t,
|
|
3664
|
+
_sfc_main$5 as u,
|
|
3665
|
+
_sfc_main$4 as v,
|
|
3666
|
+
_sfc_main$3 as w,
|
|
3667
|
+
_sfc_main$2 as x,
|
|
3668
|
+
_sfc_main$1 as y
|
|
2317
3669
|
};
|
|
2318
|
-
//# sourceMappingURL=
|
|
3670
|
+
//# sourceMappingURL=TagsInput-CFAC_MSw.js.map
|