cisse-vue-ui 0.5.21 → 0.5.23
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/{ListSkeleton.vue_vue_type_script_setup_true_lang-D3_Oddwt.js → Button.vue_vue_type_script_setup_true_lang-CD9QPOeU.js} +114 -10
- package/dist/Button.vue_vue_type_script_setup_true_lang-CD9QPOeU.js.map +1 -0
- package/dist/{ListSkeleton.vue_vue_type_script_setup_true_lang-CrEu33_J.cjs → Button.vue_vue_type_script_setup_true_lang-Cev21KGJ.cjs} +113 -9
- package/dist/Button.vue_vue_type_script_setup_true_lang-Cev21KGJ.cjs.map +1 -0
- package/dist/{RangeSlider.vue_vue_type_script_setup_true_lang-ClH-pyK8.cjs → Combobox.vue_vue_type_script_setup_true_lang-D9TIId4E.cjs} +621 -266
- package/dist/Combobox.vue_vue_type_script_setup_true_lang-D9TIId4E.cjs.map +1 -0
- package/dist/{RangeSlider.vue_vue_type_script_setup_true_lang-B79_S1JL.js → Combobox.vue_vue_type_script_setup_true_lang-DCLKWzhc.js} +595 -240
- package/dist/Combobox.vue_vue_type_script_setup_true_lang-DCLKWzhc.js.map +1 -0
- package/dist/{Skeleton.vue_vue_type_script_setup_true_lang-CsDMGhaT.cjs → ConfirmDialog.vue_vue_type_script_setup_true_lang-CwHYxBhR.cjs} +290 -128
- package/dist/ConfirmDialog.vue_vue_type_script_setup_true_lang-CwHYxBhR.cjs.map +1 -0
- package/dist/{Skeleton.vue_vue_type_script_setup_true_lang-Q4PcIELi.js → ConfirmDialog.vue_vue_type_script_setup_true_lang-Dm4kLAnr.js} +291 -129
- package/dist/ConfirmDialog.vue_vue_type_script_setup_true_lang-Dm4kLAnr.js.map +1 -0
- package/dist/{Timeline.vue_vue_type_script_setup_true_lang-C5SKEGPG.cjs → DarkModeToggle.vue_vue_type_script_setup_true_lang-CSxGvdSP.cjs} +192 -408
- package/dist/DarkModeToggle.vue_vue_type_script_setup_true_lang-CSxGvdSP.cjs.map +1 -0
- package/dist/{Timeline.vue_vue_type_script_setup_true_lang-ykGksWXN.js → DarkModeToggle.vue_vue_type_script_setup_true_lang-D1Q43mhJ.js} +153 -369
- package/dist/DarkModeToggle.vue_vue_type_script_setup_true_lang-D1Q43mhJ.js.map +1 -0
- package/dist/{Dropdown.vue_vue_type_script_setup_true_lang-DKxcVBKu.cjs → Dropdown.vue_vue_type_script_setup_true_lang-DNeh9Gi-.cjs} +32 -15
- package/dist/Dropdown.vue_vue_type_script_setup_true_lang-DNeh9Gi-.cjs.map +1 -0
- package/dist/{Dropdown.vue_vue_type_script_setup_true_lang-C3pr8BwC.js → Dropdown.vue_vue_type_script_setup_true_lang-DXV811zB.js} +32 -15
- package/dist/Dropdown.vue_vue_type_script_setup_true_lang-DXV811zB.js.map +1 -0
- package/dist/{PageLayout.vue_vue_type_script_setup_true_lang-D22uNeS1.cjs → PageLayout.vue_vue_type_script_setup_true_lang-C0YzyJnK.cjs} +2 -2
- package/dist/{PageLayout.vue_vue_type_script_setup_true_lang-D22uNeS1.cjs.map → PageLayout.vue_vue_type_script_setup_true_lang-C0YzyJnK.cjs.map} +1 -1
- package/dist/{PageLayout.vue_vue_type_script_setup_true_lang-kT7np2ir.js → PageLayout.vue_vue_type_script_setup_true_lang-ClzYGS8h.js} +2 -2
- package/dist/{PageLayout.vue_vue_type_script_setup_true_lang-kT7np2ir.js.map → PageLayout.vue_vue_type_script_setup_true_lang-ClzYGS8h.js.map} +1 -1
- package/dist/components/core/AccordionItem.vue.d.ts +2 -0
- package/dist/components/core/DarkModeToggle.stories.d.ts +15 -0
- package/dist/components/core/DarkModeToggle.test.d.ts +1 -0
- package/dist/components/core/DarkModeToggle.vue.d.ts +21 -0
- package/dist/components/core/Dropdown.vue.d.ts +2 -0
- package/dist/components/core/Popover.vue.d.ts +2 -0
- package/dist/components/core/Tooltip.vue.d.ts +2 -0
- package/dist/components/core/index.cjs +23 -21
- package/dist/components/core/index.cjs.map +1 -1
- package/dist/components/core/index.d.ts +2 -0
- package/dist/components/core/index.js +17 -15
- package/dist/components/core/index.js.map +1 -1
- package/dist/components/core/index.test.d.ts +1 -0
- package/dist/components/feedback/ConfirmDialog.stories.d.ts +12 -0
- package/dist/components/feedback/ConfirmDialog.test.d.ts +1 -0
- package/dist/components/feedback/ConfirmDialog.vue.d.ts +53 -0
- package/dist/components/feedback/LoadingSpinner.vue.d.ts +6 -1
- package/dist/components/feedback/Modal.vue.d.ts +18 -3
- package/dist/components/feedback/Progress.vue.d.ts +1 -1
- package/dist/components/feedback/index.cjs +17 -16
- package/dist/components/feedback/index.cjs.map +1 -1
- package/dist/components/feedback/index.d.ts +2 -0
- package/dist/components/feedback/index.js +6 -5
- package/dist/components/feedback/index.test.d.ts +1 -0
- package/dist/components/form/Checkbox.vue.d.ts +2 -0
- package/dist/components/form/ColorPicker.vue.d.ts +3 -0
- package/dist/components/form/Combobox.stories.d.ts +15 -0
- package/dist/components/form/Combobox.test.d.ts +1 -0
- package/dist/components/form/Combobox.vue.d.ts +46 -0
- package/dist/components/form/DatePicker.vue.d.ts +2 -0
- package/dist/components/form/FormHelp.vue.d.ts +2 -0
- package/dist/components/form/Switch.vue.d.ts +2 -0
- package/dist/components/form/index.cjs +17 -16
- package/dist/components/form/index.cjs.map +1 -1
- package/dist/components/form/index.d.ts +2 -0
- package/dist/components/form/index.js +3 -2
- package/dist/components/form/index.test.d.ts +1 -0
- package/dist/components/index.cjs +57 -54
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.js +35 -32
- package/dist/components/index.test.d.ts +1 -0
- package/dist/components/layout/index.cjs +1 -1
- package/dist/components/layout/index.js +1 -1
- package/dist/components/layout/index.test.d.ts +1 -0
- package/dist/components/type/index.test.d.ts +1 -0
- package/dist/composables/index.cjs +9 -2
- package/dist/composables/index.cjs.map +1 -1
- package/dist/composables/index.d.ts +2 -0
- package/dist/composables/index.js +15 -8
- package/dist/composables/index.js.map +1 -1
- package/dist/composables/index.test.d.ts +1 -0
- package/dist/composables/useDarkMode.test.d.ts +1 -0
- package/dist/composables/useDropdown.test.d.ts +1 -0
- package/dist/composables/useExportCSV.test.d.ts +1 -0
- package/dist/composables/useFocusTrap.d.ts +41 -0
- package/dist/composables/useFocusTrap.test.d.ts +1 -0
- package/dist/composables/useId.d.ts +42 -0
- package/dist/composables/useId.test.d.ts +1 -0
- package/dist/composables/useModal.d.ts +1 -1
- package/dist/composables/useModal.test.d.ts +1 -0
- package/dist/index-BMoLBt6A.js +75 -0
- package/dist/index-BMoLBt6A.js.map +1 -0
- package/dist/index-CJwlO351.js +347 -0
- package/dist/index-CJwlO351.js.map +1 -0
- package/dist/index-CUNU12xk.cjs +346 -0
- package/dist/index-CUNU12xk.cjs.map +1 -0
- package/dist/index-DwFvFW-3.cjs +74 -0
- package/dist/index-DwFvFW-3.cjs.map +1 -0
- package/dist/index.cjs +67 -57
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +51 -41
- package/dist/index.js.map +1 -1
- package/dist/index.test.d.ts +1 -0
- package/dist/style.css +1 -1
- package/dist/types/form.d.ts +4 -0
- package/dist/types/index.test.d.ts +1 -0
- package/dist/useDarkMode-Cl5QWTlC.js +53 -0
- package/dist/useDarkMode-Cl5QWTlC.js.map +1 -0
- package/dist/useDarkMode-DLZcJEUQ.cjs +52 -0
- package/dist/useDarkMode-DLZcJEUQ.cjs.map +1 -0
- package/dist/useFocusTrap-AnlJsihM.js +120 -0
- package/dist/useFocusTrap-AnlJsihM.js.map +1 -0
- package/dist/useFocusTrap-kcxO8AeU.cjs +119 -0
- package/dist/useFocusTrap-kcxO8AeU.cjs.map +1 -0
- package/dist/useId-nxrBaIC9.cjs +25 -0
- package/dist/useId-nxrBaIC9.cjs.map +1 -0
- package/dist/useId-xeHj7rkg.js +26 -0
- package/dist/useId-xeHj7rkg.js.map +1 -0
- package/dist/{useToast-CRh_sG82.cjs → useToast-Bk60GArg.cjs} +1 -50
- package/dist/useToast-Bk60GArg.cjs.map +1 -0
- package/dist/{useToast-DwFOkewC.js → useToast-ina5g3mj.js} +6 -55
- package/dist/useToast-ina5g3mj.js.map +1 -0
- package/package.json +9 -8
- package/dist/Checkbox.vue_vue_type_script_setup_true_lang-B-nLCCNY.js +0 -54
- package/dist/Checkbox.vue_vue_type_script_setup_true_lang-B-nLCCNY.js.map +0 -1
- package/dist/Checkbox.vue_vue_type_script_setup_true_lang-DIoHDji4.cjs +0 -53
- package/dist/Checkbox.vue_vue_type_script_setup_true_lang-DIoHDji4.cjs.map +0 -1
- package/dist/Dropdown.vue_vue_type_script_setup_true_lang-C3pr8BwC.js.map +0 -1
- package/dist/Dropdown.vue_vue_type_script_setup_true_lang-DKxcVBKu.cjs.map +0 -1
- package/dist/ListSkeleton.vue_vue_type_script_setup_true_lang-CrEu33_J.cjs.map +0 -1
- package/dist/ListSkeleton.vue_vue_type_script_setup_true_lang-D3_Oddwt.js.map +0 -1
- package/dist/RangeSlider.vue_vue_type_script_setup_true_lang-B79_S1JL.js.map +0 -1
- package/dist/RangeSlider.vue_vue_type_script_setup_true_lang-ClH-pyK8.cjs.map +0 -1
- package/dist/Skeleton.vue_vue_type_script_setup_true_lang-CsDMGhaT.cjs.map +0 -1
- package/dist/Skeleton.vue_vue_type_script_setup_true_lang-Q4PcIELi.js.map +0 -1
- package/dist/Timeline.vue_vue_type_script_setup_true_lang-C5SKEGPG.cjs.map +0 -1
- package/dist/Timeline.vue_vue_type_script_setup_true_lang-ykGksWXN.js.map +0 -1
- package/dist/index-C3NAM2ds.js +0 -72
- package/dist/index-C3NAM2ds.js.map +0 -1
- package/dist/index-Ti1RIOEG.cjs +0 -71
- package/dist/index-Ti1RIOEG.cjs.map +0 -1
- package/dist/useToast-CRh_sG82.cjs.map +0 -1
- package/dist/useToast-DwFOkewC.js.map +0 -1
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const vue = require("vue");
|
|
3
|
+
const useId = require("./useId-nxrBaIC9.cjs");
|
|
3
4
|
const vue$1 = require("@iconify/vue");
|
|
4
5
|
const useDropdown = require("./useDropdown-DHFnd259.cjs");
|
|
5
6
|
const _pluginVue_exportHelper = require("./_plugin-vue_export-helper-DM9IkUGy.cjs");
|
|
6
|
-
const
|
|
7
|
-
const
|
|
7
|
+
const index = require("./index-CUNU12xk.cjs");
|
|
8
|
+
const _hoisted_1$d = ["data-error", "for"];
|
|
9
|
+
const _sfc_main$d = /* @__PURE__ */ vue.defineComponent({
|
|
8
10
|
__name: "FormLabel",
|
|
9
11
|
props: {
|
|
10
12
|
error: { type: [String, Boolean] },
|
|
@@ -18,32 +20,36 @@ const _sfc_main$c = /* @__PURE__ */ vue.defineComponent({
|
|
|
18
20
|
class: "block text-sm font-medium text-gray-700 data-[error=true]:text-red-500 dark:text-gray-300"
|
|
19
21
|
}, [
|
|
20
22
|
vue.renderSlot(_ctx.$slots, "default")
|
|
21
|
-
], 8, _hoisted_1$
|
|
23
|
+
], 8, _hoisted_1$d);
|
|
22
24
|
};
|
|
23
25
|
}
|
|
24
26
|
});
|
|
25
|
-
const _hoisted_1$
|
|
26
|
-
const _sfc_main$
|
|
27
|
+
const _hoisted_1$c = ["id", "data-error", "role", "aria-live"];
|
|
28
|
+
const _sfc_main$c = /* @__PURE__ */ vue.defineComponent({
|
|
27
29
|
__name: "FormHelp",
|
|
28
30
|
props: {
|
|
31
|
+
id: {},
|
|
29
32
|
error: { type: Boolean },
|
|
30
33
|
text: {}
|
|
31
34
|
},
|
|
32
35
|
setup(__props) {
|
|
33
36
|
return (_ctx, _cache) => {
|
|
34
37
|
return vue.openBlock(), vue.createElementBlock("p", {
|
|
38
|
+
id: __props.id,
|
|
35
39
|
"data-error": __props.error,
|
|
40
|
+
role: __props.error ? "alert" : void 0,
|
|
41
|
+
"aria-live": __props.error ? "polite" : void 0,
|
|
36
42
|
class: "mt-2 text-sm text-gray-400 peer-user-invalid:visible data-[error=true]:text-red-500 dark:text-gray-500"
|
|
37
43
|
}, [
|
|
38
44
|
vue.renderSlot(_ctx.$slots, "default", {}, () => [
|
|
39
45
|
vue.createTextVNode(vue.toDisplayString(__props.text ?? ""), 1)
|
|
40
46
|
])
|
|
41
|
-
], 8, _hoisted_1$
|
|
47
|
+
], 8, _hoisted_1$c);
|
|
42
48
|
};
|
|
43
49
|
}
|
|
44
50
|
});
|
|
45
|
-
const _hoisted_1$
|
|
46
|
-
const _sfc_main$
|
|
51
|
+
const _hoisted_1$b = ["id", "disabled", "name", "placeholder", "type", "required", "aria-invalid", "aria-required", "aria-describedby"];
|
|
52
|
+
const _sfc_main$b = /* @__PURE__ */ vue.defineComponent({
|
|
47
53
|
__name: "FormInput",
|
|
48
54
|
props: /* @__PURE__ */ vue.mergeModels({
|
|
49
55
|
type: { default: "text" },
|
|
@@ -52,49 +58,59 @@ const _sfc_main$a = /* @__PURE__ */ vue.defineComponent({
|
|
|
52
58
|
disabled: { type: Boolean },
|
|
53
59
|
invalid: { type: Boolean },
|
|
54
60
|
id: {},
|
|
55
|
-
name: {}
|
|
61
|
+
name: {},
|
|
62
|
+
required: { type: Boolean },
|
|
63
|
+
describedBy: {}
|
|
56
64
|
}, {
|
|
57
65
|
"modelValue": {},
|
|
58
66
|
"modelModifiers": {}
|
|
59
67
|
}),
|
|
60
68
|
emits: ["update:modelValue"],
|
|
61
69
|
setup(__props) {
|
|
70
|
+
const props = __props;
|
|
62
71
|
const modelValue = vue.useModel(__props, "modelValue");
|
|
63
72
|
return (_ctx, _cache) => {
|
|
64
73
|
return vue.withDirectives((vue.openBlock(), vue.createElementBlock("input", vue.mergeProps({
|
|
65
|
-
id:
|
|
74
|
+
id: props.id ?? props.name ?? "",
|
|
66
75
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => modelValue.value = $event),
|
|
67
|
-
disabled:
|
|
68
|
-
name:
|
|
69
|
-
placeholder:
|
|
70
|
-
type:
|
|
76
|
+
disabled: props.disabled,
|
|
77
|
+
name: props.name ?? "",
|
|
78
|
+
placeholder: props.placeholder,
|
|
79
|
+
type: props.type,
|
|
80
|
+
required: props.required,
|
|
81
|
+
"aria-invalid": props.invalid || void 0,
|
|
82
|
+
"aria-required": props.required || void 0,
|
|
83
|
+
"aria-describedby": props.describedBy || void 0,
|
|
71
84
|
class: "mt-1 block w-full rounded-md border border-gray-300 bg-white px-3 py-2 text-sm text-gray-800 placeholder-gray-400 shadow-sm user-invalid:border-red-500 user-invalid:text-red-600 focus:border-primary focus:ring-1 focus:ring-primary focus:outline-none focus:user-invalid:border-red-500 focus:user-invalid:ring-red-500 disabled:border-gray-200 disabled:bg-gray-50 disabled:text-gray-500 disabled:shadow-none dark:border-gray-700 dark:bg-gray-900 dark:text-gray-200 dark:placeholder-gray-500 dark:focus:border-primary dark:focus:ring-primary dark:disabled:border-gray-800 dark:disabled:bg-gray-950 dark:disabled:text-gray-500"
|
|
72
|
-
}, _ctx.$attrs), null, 16, _hoisted_1$
|
|
85
|
+
}, _ctx.$attrs), null, 16, _hoisted_1$b)), [
|
|
73
86
|
[vue.vModelDynamic, modelValue.value]
|
|
74
87
|
]);
|
|
75
88
|
};
|
|
76
89
|
}
|
|
77
90
|
});
|
|
78
|
-
const _hoisted_1$
|
|
79
|
-
const _hoisted_2$
|
|
80
|
-
const _hoisted_3$
|
|
81
|
-
const _hoisted_4$
|
|
91
|
+
const _hoisted_1$a = { class: "relative" };
|
|
92
|
+
const _hoisted_2$9 = ["id", "disabled", "aria-expanded", "aria-controls", "aria-invalid", "aria-describedby"];
|
|
93
|
+
const _hoisted_3$8 = { class: "flex-1 truncate" };
|
|
94
|
+
const _hoisted_4$6 = ["id", "aria-label"];
|
|
95
|
+
const _hoisted_5$5 = {
|
|
82
96
|
key: 0,
|
|
83
97
|
class: "sticky top-0 border-b border-gray-200 bg-white p-2 dark:border-gray-700 dark:bg-gray-800"
|
|
84
98
|
};
|
|
85
|
-
const
|
|
86
|
-
const
|
|
99
|
+
const _hoisted_6$5 = { 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" };
|
|
100
|
+
const _hoisted_7$5 = {
|
|
87
101
|
key: 1,
|
|
88
|
-
class: "px-4 py-3 text-sm text-gray-500 dark:text-gray-400"
|
|
102
|
+
class: "px-4 py-3 text-sm text-gray-500 dark:text-gray-400",
|
|
103
|
+
role: "status"
|
|
89
104
|
};
|
|
90
|
-
const
|
|
91
|
-
const
|
|
92
|
-
const
|
|
105
|
+
const _hoisted_8$4 = { class: "py-1" };
|
|
106
|
+
const _hoisted_9$2 = ["aria-selected", "data-index", "onClick", "onMouseenter"];
|
|
107
|
+
const _hoisted_10$2 = {
|
|
93
108
|
key: 1,
|
|
94
|
-
class: "size-4 shrink-0"
|
|
109
|
+
class: "size-4 shrink-0",
|
|
110
|
+
"aria-hidden": "true"
|
|
95
111
|
};
|
|
96
|
-
const
|
|
97
|
-
const _sfc_main$
|
|
112
|
+
const _hoisted_11$2 = { class: "flex-1" };
|
|
113
|
+
const _sfc_main$a = /* @__PURE__ */ vue.defineComponent({
|
|
98
114
|
__name: "FormSelect",
|
|
99
115
|
props: /* @__PURE__ */ vue.mergeModels({
|
|
100
116
|
options: {},
|
|
@@ -105,6 +121,8 @@ const _sfc_main$9 = /* @__PURE__ */ vue.defineComponent({
|
|
|
105
121
|
invalid: { type: Boolean },
|
|
106
122
|
id: {},
|
|
107
123
|
name: {},
|
|
124
|
+
required: { type: Boolean },
|
|
125
|
+
describedBy: {},
|
|
108
126
|
teleport: { type: Boolean, default: true },
|
|
109
127
|
searchable: { type: Boolean, default: false },
|
|
110
128
|
noResultsText: { default: "No results found" },
|
|
@@ -116,6 +134,9 @@ const _sfc_main$9 = /* @__PURE__ */ vue.defineComponent({
|
|
|
116
134
|
emits: ["update:modelValue"],
|
|
117
135
|
setup(__props) {
|
|
118
136
|
const props = __props;
|
|
137
|
+
const { id: generatedId, related } = useId.useId({ prefix: "select", id: props.id });
|
|
138
|
+
const triggerId = vue.computed(() => props.id ?? props.name ?? generatedId.value);
|
|
139
|
+
const listboxId = vue.computed(() => related("listbox"));
|
|
119
140
|
const modelValue = vue.useModel(__props, "modelValue");
|
|
120
141
|
const searchQuery = vue.ref("");
|
|
121
142
|
const triggerRef = vue.ref();
|
|
@@ -185,9 +206,9 @@ const _sfc_main$9 = /* @__PURE__ */ vue.defineComponent({
|
|
|
185
206
|
const handleKeydown = (event) => {
|
|
186
207
|
baseHandleKeydown(event, {
|
|
187
208
|
itemCount: filteredOptions.value.length,
|
|
188
|
-
onSelect: (
|
|
189
|
-
if (filteredOptions.value[
|
|
190
|
-
selectOption(filteredOptions.value[
|
|
209
|
+
onSelect: (index2) => {
|
|
210
|
+
if (filteredOptions.value[index2]) {
|
|
211
|
+
selectOption(filteredOptions.value[index2]);
|
|
191
212
|
}
|
|
192
213
|
},
|
|
193
214
|
onOpen: open,
|
|
@@ -207,14 +228,19 @@ const _sfc_main$9 = /* @__PURE__ */ vue.defineComponent({
|
|
|
207
228
|
return [base, state, text, props.triggerClass];
|
|
208
229
|
});
|
|
209
230
|
return (_ctx, _cache) => {
|
|
210
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
231
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$a, [
|
|
211
232
|
vue.createElementVNode("button", {
|
|
212
|
-
id:
|
|
233
|
+
id: triggerId.value,
|
|
213
234
|
ref_key: "triggerRef",
|
|
214
235
|
ref: triggerRef,
|
|
215
236
|
type: "button",
|
|
216
237
|
disabled: __props.disabled,
|
|
217
238
|
class: vue.normalizeClass(triggerClasses.value),
|
|
239
|
+
"aria-haspopup": "listbox",
|
|
240
|
+
"aria-expanded": vue.unref(isOpen),
|
|
241
|
+
"aria-controls": listboxId.value,
|
|
242
|
+
"aria-invalid": __props.invalid || void 0,
|
|
243
|
+
"aria-describedby": __props.describedBy || void 0,
|
|
218
244
|
onClick: toggle,
|
|
219
245
|
onKeydown: handleKeydown
|
|
220
246
|
}, [
|
|
@@ -222,13 +248,14 @@ const _sfc_main$9 = /* @__PURE__ */ vue.defineComponent({
|
|
|
222
248
|
option: selectedOption.value,
|
|
223
249
|
placeholder: __props.placeholder
|
|
224
250
|
}, () => [
|
|
225
|
-
vue.createElementVNode("span", _hoisted_3$
|
|
251
|
+
vue.createElementVNode("span", _hoisted_3$8, vue.toDisplayString(displayValue.value), 1)
|
|
226
252
|
]),
|
|
227
253
|
vue.createVNode(vue.unref(vue$1.Icon), {
|
|
228
254
|
icon: "lucide:chevron-down",
|
|
229
|
-
class: vue.normalizeClass(["size-4 shrink-0 text-gray-400 transition-transform", vue.unref(isOpen) && "rotate-180"])
|
|
255
|
+
class: vue.normalizeClass(["size-4 shrink-0 text-gray-400 transition-transform", vue.unref(isOpen) && "rotate-180"]),
|
|
256
|
+
"aria-hidden": "true"
|
|
230
257
|
}, null, 8, ["class"])
|
|
231
|
-
], 42, _hoisted_2$
|
|
258
|
+
], 42, _hoisted_2$9),
|
|
232
259
|
(vue.openBlock(), vue.createBlock(vue.Teleport, {
|
|
233
260
|
to: "body",
|
|
234
261
|
disabled: !__props.teleport
|
|
@@ -244,19 +271,23 @@ const _sfc_main$9 = /* @__PURE__ */ vue.defineComponent({
|
|
|
244
271
|
default: vue.withCtx(() => [
|
|
245
272
|
vue.unref(isOpen) ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
246
273
|
key: 0,
|
|
274
|
+
id: listboxId.value,
|
|
247
275
|
ref_key: "dropdownRef",
|
|
248
276
|
ref: dropdownRef,
|
|
277
|
+
role: "listbox",
|
|
278
|
+
"aria-label": __props.placeholder || "Select an option",
|
|
249
279
|
style: vue.normalizeStyle(vue.unref(dropdownStyle)),
|
|
250
280
|
class: vue.normalizeClass([
|
|
251
281
|
"z-[9999] max-h-60 overflow-auto rounded-lg border border-gray-200 bg-white shadow-lg dark:border-gray-700 dark:bg-gray-800",
|
|
252
282
|
!__props.teleport && "absolute mt-1 w-full"
|
|
253
283
|
])
|
|
254
284
|
}, [
|
|
255
|
-
__props.searchable ? (vue.openBlock(), vue.createElementBlock("div",
|
|
256
|
-
vue.createElementVNode("div",
|
|
285
|
+
__props.searchable ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_5$5, [
|
|
286
|
+
vue.createElementVNode("div", _hoisted_6$5, [
|
|
257
287
|
vue.createVNode(vue.unref(vue$1.Icon), {
|
|
258
288
|
icon: "lucide:search",
|
|
259
|
-
class: "size-4 text-gray-400"
|
|
289
|
+
class: "size-4 text-gray-400",
|
|
290
|
+
"aria-hidden": "true"
|
|
260
291
|
}),
|
|
261
292
|
vue.withDirectives(vue.createElementVNode("input", {
|
|
262
293
|
ref_key: "searchInputRef",
|
|
@@ -265,44 +296,48 @@ const _sfc_main$9 = /* @__PURE__ */ vue.defineComponent({
|
|
|
265
296
|
type: "text",
|
|
266
297
|
class: "flex-1 bg-transparent text-sm outline-none dark:text-white",
|
|
267
298
|
placeholder: "Search...",
|
|
299
|
+
"aria-label": "Search options",
|
|
268
300
|
onKeydown: handleKeydown
|
|
269
301
|
}, null, 544), [
|
|
270
302
|
[vue.vModelText, searchQuery.value]
|
|
271
303
|
])
|
|
272
304
|
])
|
|
273
305
|
])) : vue.createCommentVNode("", true),
|
|
274
|
-
filteredOptions.value.length === 0 ? (vue.openBlock(), vue.createElementBlock("div",
|
|
275
|
-
vue.createElementVNode("div",
|
|
276
|
-
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(filteredOptions.value, (option,
|
|
306
|
+
filteredOptions.value.length === 0 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_7$5, vue.toDisplayString(__props.noResultsText), 1)) : vue.createCommentVNode("", true),
|
|
307
|
+
vue.createElementVNode("div", _hoisted_8$4, [
|
|
308
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(filteredOptions.value, (option, index2) => {
|
|
277
309
|
return vue.openBlock(), vue.createElementBlock("button", {
|
|
278
310
|
key: String(option.value),
|
|
279
311
|
type: "button",
|
|
280
|
-
"
|
|
312
|
+
role: "option",
|
|
313
|
+
"aria-selected": modelValue.value === option.value,
|
|
314
|
+
"data-index": index2,
|
|
281
315
|
class: vue.normalizeClass([
|
|
282
316
|
"flex w-full items-center gap-2 px-3 py-2 text-left text-sm transition-colors",
|
|
283
|
-
vue.unref(highlightedIndex) ===
|
|
317
|
+
vue.unref(highlightedIndex) === index2 && "bg-gray-100 dark:bg-gray-700",
|
|
284
318
|
modelValue.value === option.value && "bg-primary/10 text-primary",
|
|
285
319
|
modelValue.value !== option.value && "text-gray-700 dark:text-gray-200"
|
|
286
320
|
]),
|
|
287
321
|
onClick: ($event) => selectOption(option),
|
|
288
|
-
onMouseenter: ($event) => highlightedIndex.value =
|
|
322
|
+
onMouseenter: ($event) => highlightedIndex.value = index2
|
|
289
323
|
}, [
|
|
290
324
|
vue.renderSlot(_ctx.$slots, "option", {
|
|
291
325
|
option,
|
|
292
326
|
selected: modelValue.value === option.value,
|
|
293
|
-
index
|
|
327
|
+
index: index2
|
|
294
328
|
}, () => [
|
|
295
329
|
modelValue.value === option.value ? (vue.openBlock(), vue.createBlock(vue.unref(vue$1.Icon), {
|
|
296
330
|
key: 0,
|
|
297
331
|
icon: "lucide:check",
|
|
298
|
-
class: "size-4 shrink-0 text-primary"
|
|
299
|
-
|
|
300
|
-
vue.
|
|
332
|
+
class: "size-4 shrink-0 text-primary",
|
|
333
|
+
"aria-hidden": "true"
|
|
334
|
+
})) : (vue.openBlock(), vue.createElementBlock("span", _hoisted_10$2)),
|
|
335
|
+
vue.createElementVNode("span", _hoisted_11$2, vue.toDisplayString(option.label), 1)
|
|
301
336
|
])
|
|
302
|
-
], 42,
|
|
337
|
+
], 42, _hoisted_9$2);
|
|
303
338
|
}), 128))
|
|
304
339
|
])
|
|
305
|
-
], 6)) : vue.createCommentVNode("", true)
|
|
340
|
+
], 14, _hoisted_4$6)) : vue.createCommentVNode("", true)
|
|
306
341
|
]),
|
|
307
342
|
_: 3
|
|
308
343
|
})
|
|
@@ -311,8 +346,8 @@ const _sfc_main$9 = /* @__PURE__ */ vue.defineComponent({
|
|
|
311
346
|
};
|
|
312
347
|
}
|
|
313
348
|
});
|
|
314
|
-
const _hoisted_1$
|
|
315
|
-
const _sfc_main$
|
|
349
|
+
const _hoisted_1$9 = ["hidden"];
|
|
350
|
+
const _sfc_main$9 = /* @__PURE__ */ vue.defineComponent({
|
|
316
351
|
__name: "FormGroup",
|
|
317
352
|
props: /* @__PURE__ */ vue.mergeModels({
|
|
318
353
|
label: {},
|
|
@@ -327,6 +362,8 @@ const _sfc_main$8 = /* @__PURE__ */ vue.defineComponent({
|
|
|
327
362
|
invalid: { type: Boolean },
|
|
328
363
|
id: {},
|
|
329
364
|
name: {},
|
|
365
|
+
required: { type: Boolean },
|
|
366
|
+
describedBy: {},
|
|
330
367
|
options: {}
|
|
331
368
|
}, {
|
|
332
369
|
"modelValue": {},
|
|
@@ -336,8 +373,12 @@ const _sfc_main$8 = /* @__PURE__ */ vue.defineComponent({
|
|
|
336
373
|
setup(__props) {
|
|
337
374
|
const props = __props;
|
|
338
375
|
const modelValue = vue.useModel(__props, "modelValue");
|
|
376
|
+
const { id: generatedId, related } = useId.useId({ prefix: "field", id: props.id });
|
|
377
|
+
const inputId = vue.computed(() => props.id ?? props.name ?? generatedId.value);
|
|
378
|
+
const helpId = vue.computed(() => related("help"));
|
|
339
379
|
const computedCols = vue.computed(() => `span ${props.cols} / span ${props.cols}`);
|
|
340
380
|
const isSelect = vue.computed(() => props.select === true);
|
|
381
|
+
const hasError = vue.computed(() => props.error && typeof props.error === "string");
|
|
341
382
|
return (_ctx, _cache) => {
|
|
342
383
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
343
384
|
style: vue.normalizeStyle({ gridColumn: computedCols.value }),
|
|
@@ -345,9 +386,9 @@ const _sfc_main$8 = /* @__PURE__ */ vue.defineComponent({
|
|
|
345
386
|
}, [
|
|
346
387
|
vue.renderSlot(_ctx.$slots, "default", {}, () => [
|
|
347
388
|
vue.renderSlot(_ctx.$slots, "label", {}, () => [
|
|
348
|
-
__props.label ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
389
|
+
__props.label ? (vue.openBlock(), vue.createBlock(_sfc_main$d, {
|
|
349
390
|
key: 0,
|
|
350
|
-
"html-for":
|
|
391
|
+
"html-for": inputId.value,
|
|
351
392
|
error: __props.error
|
|
352
393
|
}, {
|
|
353
394
|
default: vue.withCtx(() => [
|
|
@@ -357,33 +398,42 @@ const _sfc_main$8 = /* @__PURE__ */ vue.defineComponent({
|
|
|
357
398
|
}, 8, ["html-for", "error"])) : vue.createCommentVNode("", true)
|
|
358
399
|
]),
|
|
359
400
|
vue.renderSlot(_ctx.$slots, "input", {}, () => [
|
|
360
|
-
isSelect.value ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
401
|
+
isSelect.value ? (vue.openBlock(), vue.createBlock(_sfc_main$a, vue.mergeProps({
|
|
361
402
|
key: 0,
|
|
362
403
|
modelValue: modelValue.value,
|
|
363
404
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => modelValue.value = $event)
|
|
364
|
-
}, { ..._ctx.$attrs, ..._ctx.$props }
|
|
405
|
+
}, { ..._ctx.$attrs, ..._ctx.$props }, {
|
|
406
|
+
id: inputId.value,
|
|
407
|
+
invalid: Boolean(__props.error),
|
|
408
|
+
"described-by": hasError.value ? helpId.value : void 0
|
|
409
|
+
}), null, 16, ["modelValue", "id", "invalid", "described-by"])) : (vue.openBlock(), vue.createBlock(_sfc_main$b, vue.mergeProps({
|
|
365
410
|
key: 1,
|
|
366
411
|
modelValue: modelValue.value,
|
|
367
412
|
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => modelValue.value = $event)
|
|
368
|
-
}, { ..._ctx.$attrs, ..._ctx.$props }
|
|
413
|
+
}, { ..._ctx.$attrs, ..._ctx.$props }, {
|
|
414
|
+
id: inputId.value,
|
|
415
|
+
invalid: Boolean(__props.error),
|
|
416
|
+
"described-by": hasError.value ? helpId.value : void 0
|
|
417
|
+
}), null, 16, ["modelValue", "id", "invalid", "described-by"]))
|
|
369
418
|
]),
|
|
370
|
-
|
|
419
|
+
hasError.value ? (vue.openBlock(), vue.createBlock(_sfc_main$c, {
|
|
371
420
|
key: 0,
|
|
421
|
+
id: helpId.value,
|
|
372
422
|
error: true
|
|
373
423
|
}, {
|
|
374
424
|
default: vue.withCtx(() => [
|
|
375
425
|
vue.createTextVNode(vue.toDisplayString(__props.error), 1)
|
|
376
426
|
]),
|
|
377
427
|
_: 1
|
|
378
|
-
})) : vue.createCommentVNode("", true)
|
|
428
|
+
}, 8, ["id"])) : vue.createCommentVNode("", true)
|
|
379
429
|
])
|
|
380
|
-
], 12, _hoisted_1$
|
|
430
|
+
], 12, _hoisted_1$9);
|
|
381
431
|
};
|
|
382
432
|
}
|
|
383
433
|
});
|
|
384
|
-
const _hoisted_1$
|
|
385
|
-
const _hoisted_2$
|
|
386
|
-
const _sfc_main$
|
|
434
|
+
const _hoisted_1$8 = { class: "relative" };
|
|
435
|
+
const _hoisted_2$8 = ["disabled", "placeholder", "value"];
|
|
436
|
+
const _sfc_main$8 = /* @__PURE__ */ vue.defineComponent({
|
|
387
437
|
__name: "SearchInput",
|
|
388
438
|
props: {
|
|
389
439
|
modelValue: {},
|
|
@@ -399,7 +449,7 @@ const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
|
|
|
399
449
|
emit("update:modelValue", target.value);
|
|
400
450
|
};
|
|
401
451
|
return (_ctx, _cache) => {
|
|
402
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
452
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$8, [
|
|
403
453
|
vue.createVNode(vue.unref(vue$1.Icon), {
|
|
404
454
|
icon: __props.icon,
|
|
405
455
|
class: "absolute top-1/2 left-3 h-5 w-5 -translate-y-1/2 text-gray-400"
|
|
@@ -411,37 +461,36 @@ const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
|
|
|
411
461
|
class: "focus:border-primary focus:ring-primary w-full rounded-lg border border-gray-300 bg-white py-2 pr-4 pl-10 text-gray-900 placeholder-gray-400 transition-colors disabled:cursor-not-allowed disabled:opacity-50 dark:border-gray-600 dark:bg-gray-800 dark:text-gray-100 dark:placeholder-gray-500",
|
|
412
462
|
type: "text",
|
|
413
463
|
onInput: handleInput
|
|
414
|
-
}, null, 40, _hoisted_2$
|
|
464
|
+
}, null, 40, _hoisted_2$8)
|
|
415
465
|
]);
|
|
416
466
|
};
|
|
417
467
|
}
|
|
418
468
|
});
|
|
419
|
-
const _hoisted_1$
|
|
420
|
-
const _hoisted_2$
|
|
469
|
+
const _hoisted_1$7 = ["id", "aria-checked", "aria-labelledby", "aria-describedby", "disabled"];
|
|
470
|
+
const _hoisted_2$7 = {
|
|
421
471
|
key: 0,
|
|
422
472
|
class: "flex flex-col"
|
|
423
473
|
};
|
|
424
|
-
const _hoisted_3$
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
};
|
|
428
|
-
const _hoisted_4$4 = {
|
|
429
|
-
key: 1,
|
|
430
|
-
class: "text-sm text-gray-500 dark:text-gray-400"
|
|
431
|
-
};
|
|
432
|
-
const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent({
|
|
474
|
+
const _hoisted_3$7 = ["id"];
|
|
475
|
+
const _hoisted_4$5 = ["id"];
|
|
476
|
+
const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
|
|
433
477
|
__name: "Switch",
|
|
434
478
|
props: {
|
|
435
479
|
modelValue: { type: Boolean, default: false },
|
|
436
480
|
label: {},
|
|
437
481
|
description: {},
|
|
438
482
|
disabled: { type: Boolean },
|
|
439
|
-
size: { default: "md" }
|
|
483
|
+
size: { default: "md" },
|
|
484
|
+
id: {}
|
|
440
485
|
},
|
|
441
486
|
emits: ["update:modelValue"],
|
|
442
487
|
setup(__props, { emit: __emit }) {
|
|
443
488
|
const props = __props;
|
|
444
489
|
const emit = __emit;
|
|
490
|
+
const { id: generatedId, related } = useId.useId({ prefix: "switch", id: props.id });
|
|
491
|
+
const switchId = vue.computed(() => props.id ?? generatedId.value);
|
|
492
|
+
const labelId = vue.computed(() => related("label"));
|
|
493
|
+
const descriptionId = vue.computed(() => related("description"));
|
|
445
494
|
const toggle = () => {
|
|
446
495
|
if (props.disabled) return;
|
|
447
496
|
emit("update:modelValue", !props.modelValue);
|
|
@@ -466,9 +515,12 @@ const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent({
|
|
|
466
515
|
class: vue.normalizeClass(["inline-flex items-start gap-3", __props.disabled ? "cursor-not-allowed opacity-50" : "cursor-pointer"])
|
|
467
516
|
}, [
|
|
468
517
|
vue.createElementVNode("button", {
|
|
518
|
+
id: switchId.value,
|
|
469
519
|
type: "button",
|
|
470
520
|
role: "switch",
|
|
471
521
|
"aria-checked": __props.modelValue,
|
|
522
|
+
"aria-labelledby": __props.label ? labelId.value : void 0,
|
|
523
|
+
"aria-describedby": __props.description ? descriptionId.value : void 0,
|
|
472
524
|
disabled: __props.disabled,
|
|
473
525
|
class: vue.normalizeClass([
|
|
474
526
|
"relative inline-flex shrink-0 items-center rounded-full transition-colors focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2",
|
|
@@ -482,29 +534,38 @@ const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent({
|
|
|
482
534
|
"inline-block transform rounded-full bg-white shadow-sm transition-transform",
|
|
483
535
|
dotSizes[__props.size],
|
|
484
536
|
__props.modelValue ? translateSizes[__props.size] : "translate-x-1"
|
|
485
|
-
])
|
|
537
|
+
]),
|
|
538
|
+
"aria-hidden": "true"
|
|
486
539
|
}, null, 2)
|
|
487
|
-
], 10, _hoisted_1$
|
|
488
|
-
__props.label || __props.description ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$
|
|
489
|
-
__props.label ? (vue.openBlock(), vue.createElementBlock("span",
|
|
490
|
-
|
|
540
|
+
], 10, _hoisted_1$7),
|
|
541
|
+
__props.label || __props.description ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$7, [
|
|
542
|
+
__props.label ? (vue.openBlock(), vue.createElementBlock("span", {
|
|
543
|
+
key: 0,
|
|
544
|
+
id: labelId.value,
|
|
545
|
+
class: "text-sm font-medium text-gray-900 dark:text-white"
|
|
546
|
+
}, vue.toDisplayString(__props.label), 9, _hoisted_3$7)) : vue.createCommentVNode("", true),
|
|
547
|
+
__props.description ? (vue.openBlock(), vue.createElementBlock("span", {
|
|
548
|
+
key: 1,
|
|
549
|
+
id: descriptionId.value,
|
|
550
|
+
class: "text-sm text-gray-500 dark:text-gray-400"
|
|
551
|
+
}, vue.toDisplayString(__props.description), 9, _hoisted_4$5)) : vue.createCommentVNode("", true)
|
|
491
552
|
])) : vue.createCommentVNode("", true)
|
|
492
553
|
], 2);
|
|
493
554
|
};
|
|
494
555
|
}
|
|
495
556
|
});
|
|
496
|
-
const _hoisted_1$
|
|
497
|
-
const _hoisted_2$
|
|
557
|
+
const _hoisted_1$6 = { class: "w-full" };
|
|
558
|
+
const _hoisted_2$6 = {
|
|
498
559
|
key: 0,
|
|
499
560
|
class: "mb-2 flex justify-between text-sm"
|
|
500
561
|
};
|
|
501
|
-
const _hoisted_3$
|
|
502
|
-
const _hoisted_4$
|
|
503
|
-
const _hoisted_5$
|
|
504
|
-
const _hoisted_6$
|
|
505
|
-
const _hoisted_7$
|
|
562
|
+
const _hoisted_3$6 = { class: "text-gray-600 dark:text-gray-400" };
|
|
563
|
+
const _hoisted_4$4 = { class: "font-medium text-gray-900 dark:text-white" };
|
|
564
|
+
const _hoisted_5$4 = { class: "text-gray-600 dark:text-gray-400" };
|
|
565
|
+
const _hoisted_6$4 = { class: "relative" };
|
|
566
|
+
const _hoisted_7$4 = ["value", "min", "max", "step", "disabled"];
|
|
506
567
|
const _hoisted_8$3 = { class: "pointer-events-none absolute inset-y-0 left-0 flex items-center" };
|
|
507
|
-
const _sfc_main$
|
|
568
|
+
const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent({
|
|
508
569
|
__name: "Slider",
|
|
509
570
|
props: /* @__PURE__ */ vue.mergeModels({
|
|
510
571
|
min: { default: 0 },
|
|
@@ -535,13 +596,13 @@ const _sfc_main$5 = /* @__PURE__ */ vue.defineComponent({
|
|
|
535
596
|
modelValue.value = Number(target.value);
|
|
536
597
|
};
|
|
537
598
|
return (_ctx, _cache) => {
|
|
538
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
539
|
-
__props.showValue ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$
|
|
540
|
-
vue.createElementVNode("span", _hoisted_3$
|
|
541
|
-
vue.createElementVNode("span", _hoisted_4$
|
|
542
|
-
vue.createElementVNode("span", _hoisted_5$
|
|
599
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$6, [
|
|
600
|
+
__props.showValue ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$6, [
|
|
601
|
+
vue.createElementVNode("span", _hoisted_3$6, vue.toDisplayString(__props.min), 1),
|
|
602
|
+
vue.createElementVNode("span", _hoisted_4$4, vue.toDisplayString(displayValue.value), 1),
|
|
603
|
+
vue.createElementVNode("span", _hoisted_5$4, vue.toDisplayString(__props.max), 1)
|
|
543
604
|
])) : vue.createCommentVNode("", true),
|
|
544
|
-
vue.createElementVNode("div", _hoisted_6$
|
|
605
|
+
vue.createElementVNode("div", _hoisted_6$4, [
|
|
545
606
|
vue.createElementVNode("input", {
|
|
546
607
|
type: "range",
|
|
547
608
|
value: modelValue.value,
|
|
@@ -551,7 +612,7 @@ const _sfc_main$5 = /* @__PURE__ */ vue.defineComponent({
|
|
|
551
612
|
disabled: __props.disabled,
|
|
552
613
|
class: "slider-input w-full cursor-pointer appearance-none bg-transparent disabled:cursor-not-allowed disabled:opacity-50",
|
|
553
614
|
onInput: handleInput
|
|
554
|
-
}, null, 40, _hoisted_7$
|
|
615
|
+
}, null, 40, _hoisted_7$4),
|
|
555
616
|
vue.createElementVNode("div", _hoisted_8$3, [
|
|
556
617
|
vue.createElementVNode("div", {
|
|
557
618
|
class: "h-2 rounded-full bg-primary",
|
|
@@ -563,18 +624,27 @@ const _sfc_main$5 = /* @__PURE__ */ vue.defineComponent({
|
|
|
563
624
|
};
|
|
564
625
|
}
|
|
565
626
|
});
|
|
566
|
-
const Slider = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main$
|
|
567
|
-
const _hoisted_1$
|
|
568
|
-
const _hoisted_2$
|
|
569
|
-
const _hoisted_3$
|
|
570
|
-
const _hoisted_4$
|
|
571
|
-
const _hoisted_5$
|
|
572
|
-
const _hoisted_6$
|
|
573
|
-
const _hoisted_7$
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
627
|
+
const Slider = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main$6, [["__scopeId", "data-v-a411f1b4"]]);
|
|
628
|
+
const _hoisted_1$5 = { class: "relative" };
|
|
629
|
+
const _hoisted_2$5 = ["id", "disabled", "aria-expanded", "aria-controls"];
|
|
630
|
+
const _hoisted_3$5 = { class: "flex-1 truncate" };
|
|
631
|
+
const _hoisted_4$3 = { class: "flex items-center gap-1" };
|
|
632
|
+
const _hoisted_5$3 = ["id", "aria-label"];
|
|
633
|
+
const _hoisted_6$3 = { class: "mb-4 flex items-center justify-between" };
|
|
634
|
+
const _hoisted_7$3 = {
|
|
635
|
+
class: "font-medium text-gray-900 dark:text-white",
|
|
636
|
+
"aria-live": "polite",
|
|
637
|
+
"aria-atomic": "true"
|
|
638
|
+
};
|
|
639
|
+
const _hoisted_8$2 = {
|
|
640
|
+
class: "mb-2 grid grid-cols-7 gap-1",
|
|
641
|
+
role: "row"
|
|
642
|
+
};
|
|
643
|
+
const _hoisted_9$1 = ["abbr"];
|
|
644
|
+
const _hoisted_10$1 = ["id", "aria-label"];
|
|
645
|
+
const _hoisted_11$1 = ["aria-label", "aria-selected", "aria-disabled", "disabled", "onClick"];
|
|
646
|
+
const _hoisted_12 = { class: "mt-4 border-t border-gray-200 pt-3 dark:border-gray-700" };
|
|
647
|
+
const _sfc_main$5 = /* @__PURE__ */ vue.defineComponent({
|
|
578
648
|
__name: "DatePicker",
|
|
579
649
|
props: /* @__PURE__ */ vue.mergeModels({
|
|
580
650
|
placeholder: { default: "Select date" },
|
|
@@ -583,7 +653,8 @@ const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
|
|
|
583
653
|
disabled: { type: Boolean, default: false },
|
|
584
654
|
minDate: {},
|
|
585
655
|
maxDate: {},
|
|
586
|
-
teleport: { type: Boolean, default: true }
|
|
656
|
+
teleport: { type: Boolean, default: true },
|
|
657
|
+
id: {}
|
|
587
658
|
}, {
|
|
588
659
|
"modelValue": { default: null },
|
|
589
660
|
"modelModifiers": {}
|
|
@@ -591,6 +662,10 @@ const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
|
|
|
591
662
|
emits: ["update:modelValue"],
|
|
592
663
|
setup(__props) {
|
|
593
664
|
const props = __props;
|
|
665
|
+
const { related } = useId.useId({ prefix: "datepicker", id: props.id });
|
|
666
|
+
const triggerId = vue.computed(() => related("trigger"));
|
|
667
|
+
const calendarId = vue.computed(() => related("calendar"));
|
|
668
|
+
const gridId = vue.computed(() => related("grid"));
|
|
594
669
|
const modelValue = vue.useModel(__props, "modelValue");
|
|
595
670
|
const triggerRef = vue.ref();
|
|
596
671
|
const calendarRef = vue.ref();
|
|
@@ -683,13 +758,26 @@ const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
|
|
|
683
758
|
const clear = () => {
|
|
684
759
|
modelValue.value = null;
|
|
685
760
|
};
|
|
761
|
+
const getDateLabel = (date) => {
|
|
762
|
+
const formatter = new Intl.DateTimeFormat(props.locale, {
|
|
763
|
+
weekday: "long",
|
|
764
|
+
year: "numeric",
|
|
765
|
+
month: "long",
|
|
766
|
+
day: "numeric"
|
|
767
|
+
});
|
|
768
|
+
return formatter.format(date);
|
|
769
|
+
};
|
|
686
770
|
return (_ctx, _cache) => {
|
|
687
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
771
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$5, [
|
|
688
772
|
vue.createElementVNode("button", {
|
|
773
|
+
id: triggerId.value,
|
|
689
774
|
ref_key: "triggerRef",
|
|
690
775
|
ref: triggerRef,
|
|
691
776
|
type: "button",
|
|
692
777
|
disabled: __props.disabled,
|
|
778
|
+
"aria-expanded": vue.unref(isOpen),
|
|
779
|
+
"aria-haspopup": "dialog",
|
|
780
|
+
"aria-controls": calendarId.value,
|
|
693
781
|
class: vue.normalizeClass([
|
|
694
782
|
"flex w-full items-center justify-between gap-2 rounded-md border px-3 py-2 text-sm text-left transition",
|
|
695
783
|
__props.disabled ? "cursor-not-allowed border-gray-200 bg-gray-50 text-gray-500 dark:border-gray-800 dark:bg-gray-950" : vue.unref(isOpen) ? "border-primary ring-2 ring-primary/20 bg-white dark:bg-gray-900" : "border-gray-300 bg-white hover:border-gray-400 dark:border-gray-700 dark:bg-gray-900",
|
|
@@ -698,25 +786,28 @@ const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
|
|
|
698
786
|
onClick: _cache[0] || (_cache[0] = //@ts-ignore
|
|
699
787
|
(...args) => vue.unref(toggle) && vue.unref(toggle)(...args))
|
|
700
788
|
}, [
|
|
701
|
-
vue.createElementVNode("span", _hoisted_3$
|
|
702
|
-
vue.createElementVNode("div", _hoisted_4$
|
|
789
|
+
vue.createElementVNode("span", _hoisted_3$5, vue.toDisplayString(displayValue.value || __props.placeholder), 1),
|
|
790
|
+
vue.createElementVNode("div", _hoisted_4$3, [
|
|
703
791
|
modelValue.value ? (vue.openBlock(), vue.createElementBlock("button", {
|
|
704
792
|
key: 0,
|
|
705
793
|
type: "button",
|
|
706
794
|
class: "rounded p-0.5 hover:bg-gray-100 dark:hover:bg-gray-800",
|
|
795
|
+
"aria-label": "Clear date",
|
|
707
796
|
onClick: vue.withModifiers(clear, ["stop"])
|
|
708
797
|
}, [
|
|
709
798
|
vue.createVNode(vue.unref(vue$1.Icon), {
|
|
710
799
|
icon: "lucide:x",
|
|
711
|
-
class: "size-4 text-gray-400"
|
|
800
|
+
class: "size-4 text-gray-400",
|
|
801
|
+
"aria-hidden": "true"
|
|
712
802
|
})
|
|
713
803
|
])) : vue.createCommentVNode("", true),
|
|
714
804
|
vue.createVNode(vue.unref(vue$1.Icon), {
|
|
715
805
|
icon: "lucide:calendar",
|
|
716
|
-
class: "size-4 text-gray-400"
|
|
806
|
+
class: "size-4 text-gray-400",
|
|
807
|
+
"aria-hidden": "true"
|
|
717
808
|
})
|
|
718
809
|
])
|
|
719
|
-
], 10, _hoisted_2$
|
|
810
|
+
], 10, _hoisted_2$5),
|
|
720
811
|
(vue.openBlock(), vue.createBlock(vue.Teleport, {
|
|
721
812
|
to: "body",
|
|
722
813
|
disabled: !__props.teleport
|
|
@@ -732,47 +823,66 @@ const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
|
|
|
732
823
|
default: vue.withCtx(() => [
|
|
733
824
|
vue.unref(isOpen) ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
734
825
|
key: 0,
|
|
826
|
+
id: calendarId.value,
|
|
735
827
|
ref_key: "calendarRef",
|
|
736
828
|
ref: calendarRef,
|
|
829
|
+
role: "dialog",
|
|
830
|
+
"aria-modal": "true",
|
|
831
|
+
"aria-label": `Choose date, ${monthYear.value}`,
|
|
737
832
|
style: vue.normalizeStyle(vue.unref(dropdownStyle)),
|
|
738
833
|
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"
|
|
739
834
|
}, [
|
|
740
|
-
vue.createElementVNode("div",
|
|
835
|
+
vue.createElementVNode("div", _hoisted_6$3, [
|
|
741
836
|
vue.createElementVNode("button", {
|
|
742
837
|
type: "button",
|
|
743
838
|
class: "rounded p-1 hover:bg-gray-100 dark:hover:bg-gray-700",
|
|
839
|
+
"aria-label": "Previous month",
|
|
744
840
|
onClick: prevMonth
|
|
745
841
|
}, [
|
|
746
842
|
vue.createVNode(vue.unref(vue$1.Icon), {
|
|
747
843
|
icon: "lucide:chevron-left",
|
|
748
|
-
class: "size-5 text-gray-600 dark:text-gray-400"
|
|
844
|
+
class: "size-5 text-gray-600 dark:text-gray-400",
|
|
845
|
+
"aria-hidden": "true"
|
|
749
846
|
})
|
|
750
847
|
]),
|
|
751
|
-
vue.createElementVNode("span",
|
|
848
|
+
vue.createElementVNode("span", _hoisted_7$3, vue.toDisplayString(monthYear.value), 1),
|
|
752
849
|
vue.createElementVNode("button", {
|
|
753
850
|
type: "button",
|
|
754
851
|
class: "rounded p-1 hover:bg-gray-100 dark:hover:bg-gray-700",
|
|
852
|
+
"aria-label": "Next month",
|
|
755
853
|
onClick: nextMonth
|
|
756
854
|
}, [
|
|
757
855
|
vue.createVNode(vue.unref(vue$1.Icon), {
|
|
758
856
|
icon: "lucide:chevron-right",
|
|
759
|
-
class: "size-5 text-gray-600 dark:text-gray-400"
|
|
857
|
+
class: "size-5 text-gray-600 dark:text-gray-400",
|
|
858
|
+
"aria-hidden": "true"
|
|
760
859
|
})
|
|
761
860
|
])
|
|
762
861
|
]),
|
|
763
|
-
vue.createElementVNode("div",
|
|
862
|
+
vue.createElementVNode("div", _hoisted_8$2, [
|
|
764
863
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(weekDays.value, (day) => {
|
|
765
864
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
766
865
|
key: day,
|
|
767
|
-
class: "text-center text-xs font-medium text-gray-500 dark:text-gray-400"
|
|
768
|
-
|
|
866
|
+
class: "text-center text-xs font-medium text-gray-500 dark:text-gray-400",
|
|
867
|
+
role: "columnheader",
|
|
868
|
+
abbr: day
|
|
869
|
+
}, vue.toDisplayString(day), 9, _hoisted_9$1);
|
|
769
870
|
}), 128))
|
|
770
871
|
]),
|
|
771
|
-
vue.createElementVNode("div",
|
|
772
|
-
|
|
872
|
+
vue.createElementVNode("div", {
|
|
873
|
+
id: gridId.value,
|
|
874
|
+
class: "grid grid-cols-7 gap-1",
|
|
875
|
+
role: "grid",
|
|
876
|
+
"aria-label": monthYear.value
|
|
877
|
+
}, [
|
|
878
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(calendarDays.value, (day, index2) => {
|
|
773
879
|
return vue.openBlock(), vue.createElementBlock("button", {
|
|
774
|
-
key:
|
|
880
|
+
key: index2,
|
|
775
881
|
type: "button",
|
|
882
|
+
role: "gridcell",
|
|
883
|
+
"aria-label": getDateLabel(day.date),
|
|
884
|
+
"aria-selected": day.isSelected,
|
|
885
|
+
"aria-disabled": day.isDisabled || void 0,
|
|
776
886
|
disabled: day.isDisabled,
|
|
777
887
|
class: vue.normalizeClass([
|
|
778
888
|
"h-8 w-8 rounded text-sm transition",
|
|
@@ -783,17 +893,17 @@ const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
|
|
|
783
893
|
day.isSelected && "bg-primary text-white font-semibold"
|
|
784
894
|
]),
|
|
785
895
|
onClick: ($event) => selectDate(day)
|
|
786
|
-
}, vue.toDisplayString(day.date.getDate()), 11,
|
|
896
|
+
}, vue.toDisplayString(day.date.getDate()), 11, _hoisted_11$1);
|
|
787
897
|
}), 128))
|
|
788
|
-
]),
|
|
789
|
-
vue.createElementVNode("div",
|
|
898
|
+
], 8, _hoisted_10$1),
|
|
899
|
+
vue.createElementVNode("div", _hoisted_12, [
|
|
790
900
|
vue.createElementVNode("button", {
|
|
791
901
|
type: "button",
|
|
792
902
|
class: "w-full rounded py-1.5 text-sm font-medium text-primary hover:bg-primary/10",
|
|
793
903
|
onClick: _cache[1] || (_cache[1] = ($event) => selectDate({ date: /* @__PURE__ */ new Date(), isDisabled: false }))
|
|
794
904
|
}, " Today ")
|
|
795
905
|
])
|
|
796
|
-
],
|
|
906
|
+
], 12, _hoisted_5$3)) : vue.createCommentVNode("", true)
|
|
797
907
|
]),
|
|
798
908
|
_: 1
|
|
799
909
|
})
|
|
@@ -802,19 +912,19 @@ const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
|
|
|
802
912
|
};
|
|
803
913
|
}
|
|
804
914
|
});
|
|
805
|
-
const _hoisted_1$
|
|
806
|
-
const _hoisted_2$
|
|
807
|
-
const _hoisted_3$
|
|
808
|
-
const _hoisted_4$
|
|
809
|
-
const _hoisted_5$
|
|
915
|
+
const _hoisted_1$4 = { class: "space-y-4" };
|
|
916
|
+
const _hoisted_2$4 = ["accept", "multiple", "disabled"];
|
|
917
|
+
const _hoisted_3$4 = { class: "space-y-2" };
|
|
918
|
+
const _hoisted_4$2 = { class: "text-sm font-medium text-gray-700 dark:text-gray-300" };
|
|
919
|
+
const _hoisted_5$2 = {
|
|
810
920
|
key: 0,
|
|
811
921
|
class: "text-xs text-gray-500 dark:text-gray-400"
|
|
812
922
|
};
|
|
813
|
-
const _hoisted_6$
|
|
923
|
+
const _hoisted_6$2 = {
|
|
814
924
|
key: 1,
|
|
815
925
|
class: "text-xs text-gray-500 dark:text-gray-400"
|
|
816
926
|
};
|
|
817
|
-
const _hoisted_7$
|
|
927
|
+
const _hoisted_7$2 = {
|
|
818
928
|
key: 0,
|
|
819
929
|
class: "space-y-2"
|
|
820
930
|
};
|
|
@@ -822,7 +932,7 @@ const _hoisted_8$1 = { class: "flex-1 min-w-0" };
|
|
|
822
932
|
const _hoisted_9 = { class: "text-sm font-medium text-gray-700 dark:text-gray-300 truncate" };
|
|
823
933
|
const _hoisted_10 = { class: "text-xs text-gray-500 dark:text-gray-400" };
|
|
824
934
|
const _hoisted_11 = ["onClick"];
|
|
825
|
-
const _sfc_main$
|
|
935
|
+
const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
|
|
826
936
|
__name: "FileUpload",
|
|
827
937
|
props: {
|
|
828
938
|
accept: {},
|
|
@@ -897,9 +1007,9 @@ const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
|
|
|
897
1007
|
}
|
|
898
1008
|
};
|
|
899
1009
|
const removeFile = (id) => {
|
|
900
|
-
const
|
|
901
|
-
if (
|
|
902
|
-
const removed = files.value.splice(
|
|
1010
|
+
const index2 = files.value.findIndex((f) => f.id === id);
|
|
1011
|
+
if (index2 > -1) {
|
|
1012
|
+
const removed = files.value.splice(index2, 1)[0];
|
|
903
1013
|
emit("file-removed", removed.file);
|
|
904
1014
|
}
|
|
905
1015
|
};
|
|
@@ -950,7 +1060,7 @@ const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
|
|
|
950
1060
|
return "heroicons:document";
|
|
951
1061
|
};
|
|
952
1062
|
return (_ctx, _cache) => {
|
|
953
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
1063
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$4, [
|
|
954
1064
|
vue.createElementVNode("div", {
|
|
955
1065
|
class: vue.normalizeClass(dropzoneClasses.value),
|
|
956
1066
|
onDrop: vue.withModifiers(handleDrop, ["prevent"]),
|
|
@@ -967,18 +1077,18 @@ const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
|
|
|
967
1077
|
multiple: __props.multiple,
|
|
968
1078
|
disabled: __props.disabled,
|
|
969
1079
|
onChange: handleInputChange
|
|
970
|
-
}, null, 40, _hoisted_2$
|
|
971
|
-
vue.createElementVNode("div", _hoisted_3$
|
|
1080
|
+
}, null, 40, _hoisted_2$4),
|
|
1081
|
+
vue.createElementVNode("div", _hoisted_3$4, [
|
|
972
1082
|
vue.createVNode(vue.unref(vue$1.Icon), {
|
|
973
1083
|
icon: "heroicons:cloud-arrow-up",
|
|
974
1084
|
class: vue.normalizeClass(["w-12 h-12 mx-auto text-gray-400", { "text-primary-500": isDragging.value }])
|
|
975
1085
|
}, null, 8, ["class"]),
|
|
976
|
-
vue.createElementVNode("p", _hoisted_4$
|
|
977
|
-
__props.description ? (vue.openBlock(), vue.createElementBlock("p", _hoisted_5$
|
|
978
|
-
__props.maxSize ? (vue.openBlock(), vue.createElementBlock("p", _hoisted_6$
|
|
1086
|
+
vue.createElementVNode("p", _hoisted_4$2, vue.toDisplayString(__props.label), 1),
|
|
1087
|
+
__props.description ? (vue.openBlock(), vue.createElementBlock("p", _hoisted_5$2, vue.toDisplayString(__props.description), 1)) : vue.createCommentVNode("", true),
|
|
1088
|
+
__props.maxSize ? (vue.openBlock(), vue.createElementBlock("p", _hoisted_6$2, " Max size: " + vue.toDisplayString(formatSize(__props.maxSize)), 1)) : vue.createCommentVNode("", true)
|
|
979
1089
|
])
|
|
980
1090
|
], 34),
|
|
981
|
-
files.value.length > 0 ? (vue.openBlock(), vue.createElementBlock("ul", _hoisted_7$
|
|
1091
|
+
files.value.length > 0 ? (vue.openBlock(), vue.createElementBlock("ul", _hoisted_7$2, [
|
|
982
1092
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(files.value, (uploadedFile) => {
|
|
983
1093
|
return vue.openBlock(), vue.createElementBlock("li", {
|
|
984
1094
|
key: uploadedFile.id,
|
|
@@ -1009,13 +1119,13 @@ const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
|
|
|
1009
1119
|
};
|
|
1010
1120
|
}
|
|
1011
1121
|
});
|
|
1012
|
-
const _hoisted_1$
|
|
1013
|
-
const _hoisted_2$
|
|
1014
|
-
const _hoisted_3$
|
|
1122
|
+
const _hoisted_1$3 = { class: "flex items-center gap-1" };
|
|
1123
|
+
const _hoisted_2$3 = ["disabled", "onClick", "onMousemove"];
|
|
1124
|
+
const _hoisted_3$3 = {
|
|
1015
1125
|
key: 0,
|
|
1016
1126
|
class: "ml-2 text-sm font-medium text-gray-700 dark:text-gray-300"
|
|
1017
1127
|
};
|
|
1018
|
-
const _sfc_main$
|
|
1128
|
+
const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
|
|
1019
1129
|
__name: "Rating",
|
|
1020
1130
|
props: {
|
|
1021
1131
|
modelValue: { default: 0 },
|
|
@@ -1048,29 +1158,29 @@ const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
|
|
|
1048
1158
|
return "w-6 h-6";
|
|
1049
1159
|
}
|
|
1050
1160
|
});
|
|
1051
|
-
const getStarState = (
|
|
1161
|
+
const getStarState = (index2) => {
|
|
1052
1162
|
const value = displayValue.value;
|
|
1053
|
-
if (value >=
|
|
1054
|
-
if (props.allowHalf && value >=
|
|
1163
|
+
if (value >= index2) return "full";
|
|
1164
|
+
if (props.allowHalf && value >= index2 - 0.5) return "half";
|
|
1055
1165
|
return "empty";
|
|
1056
1166
|
};
|
|
1057
|
-
const handleClick = (
|
|
1167
|
+
const handleClick = (index2, event) => {
|
|
1058
1168
|
if (props.readonly || props.disabled) return;
|
|
1059
|
-
let value =
|
|
1169
|
+
let value = index2;
|
|
1060
1170
|
if (props.allowHalf) {
|
|
1061
1171
|
const rect = event.target.getBoundingClientRect();
|
|
1062
1172
|
const isLeftHalf = event.clientX - rect.left < rect.width / 2;
|
|
1063
|
-
value = isLeftHalf ?
|
|
1173
|
+
value = isLeftHalf ? index2 - 0.5 : index2;
|
|
1064
1174
|
}
|
|
1065
1175
|
emit("update:modelValue", value);
|
|
1066
1176
|
};
|
|
1067
|
-
const handleMouseMove = (
|
|
1177
|
+
const handleMouseMove = (index2, event) => {
|
|
1068
1178
|
if (props.readonly || props.disabled) return;
|
|
1069
|
-
let value =
|
|
1179
|
+
let value = index2;
|
|
1070
1180
|
if (props.allowHalf) {
|
|
1071
1181
|
const rect = event.target.getBoundingClientRect();
|
|
1072
1182
|
const isLeftHalf = event.clientX - rect.left < rect.width / 2;
|
|
1073
|
-
value = isLeftHalf ?
|
|
1183
|
+
value = isLeftHalf ? index2 - 0.5 : index2;
|
|
1074
1184
|
}
|
|
1075
1185
|
hoverValue.value = value;
|
|
1076
1186
|
};
|
|
@@ -1078,22 +1188,22 @@ const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
|
|
|
1078
1188
|
hoverValue.value = null;
|
|
1079
1189
|
};
|
|
1080
1190
|
return (_ctx, _cache) => {
|
|
1081
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
1191
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$3, [
|
|
1082
1192
|
vue.createElementVNode("div", {
|
|
1083
1193
|
class: "flex items-center",
|
|
1084
1194
|
onMouseleave: handleMouseLeave
|
|
1085
1195
|
}, [
|
|
1086
|
-
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(__props.max, (
|
|
1196
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(__props.max, (index2) => {
|
|
1087
1197
|
return vue.openBlock(), vue.createElementBlock("button", {
|
|
1088
|
-
key:
|
|
1198
|
+
key: index2,
|
|
1089
1199
|
type: "button",
|
|
1090
1200
|
class: vue.normalizeClass(["relative focus:outline-none focus:ring-2 focus:ring-primary-500 focus:ring-offset-1 rounded", [
|
|
1091
1201
|
__props.readonly || __props.disabled ? "cursor-default" : "cursor-pointer",
|
|
1092
1202
|
__props.disabled && "opacity-50"
|
|
1093
1203
|
]]),
|
|
1094
1204
|
disabled: __props.readonly || __props.disabled,
|
|
1095
|
-
onClick: ($event) => handleClick(
|
|
1096
|
-
onMousemove: ($event) => handleMouseMove(
|
|
1205
|
+
onClick: ($event) => handleClick(index2, $event),
|
|
1206
|
+
onMousemove: ($event) => handleMouseMove(index2, $event)
|
|
1097
1207
|
}, [
|
|
1098
1208
|
vue.createVNode(vue.unref(vue$1.Icon), {
|
|
1099
1209
|
icon: __props.emptyIcon,
|
|
@@ -1102,7 +1212,7 @@ const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
|
|
|
1102
1212
|
vue.createElementVNode("div", {
|
|
1103
1213
|
class: "absolute inset-0 overflow-hidden",
|
|
1104
1214
|
style: vue.normalizeStyle({
|
|
1105
|
-
width: getStarState(
|
|
1215
|
+
width: getStarState(index2) === "full" ? "100%" : getStarState(index2) === "half" ? "50%" : "0%"
|
|
1106
1216
|
})
|
|
1107
1217
|
}, [
|
|
1108
1218
|
vue.createVNode(vue.unref(vue$1.Icon), {
|
|
@@ -1110,29 +1220,29 @@ const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
|
|
|
1110
1220
|
class: vue.normalizeClass([sizeClasses.value, __props.color])
|
|
1111
1221
|
}, null, 8, ["icon", "class"])
|
|
1112
1222
|
], 4)
|
|
1113
|
-
], 42, _hoisted_2$
|
|
1223
|
+
], 42, _hoisted_2$3);
|
|
1114
1224
|
}), 128))
|
|
1115
1225
|
], 32),
|
|
1116
|
-
__props.showValue ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_3$
|
|
1226
|
+
__props.showValue ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_3$3, vue.toDisplayString(__props.modelValue.toFixed(__props.allowHalf ? 1 : 0)), 1)) : vue.createCommentVNode("", true)
|
|
1117
1227
|
]);
|
|
1118
1228
|
};
|
|
1119
1229
|
}
|
|
1120
1230
|
});
|
|
1121
|
-
const _hoisted_1$
|
|
1122
|
-
const _hoisted_2$
|
|
1231
|
+
const _hoisted_1$2 = { class: "relative inline-block" };
|
|
1232
|
+
const _hoisted_2$2 = {
|
|
1123
1233
|
key: 0,
|
|
1124
1234
|
class: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1"
|
|
1125
1235
|
};
|
|
1126
|
-
const _hoisted_3$
|
|
1127
|
-
const _hoisted_4 = { class: "text-sm font-mono text-gray-700 dark:text-gray-300" };
|
|
1128
|
-
const _hoisted_5 = { class: "grid grid-cols-5 gap-2 mb-3" };
|
|
1129
|
-
const _hoisted_6 = ["title", "onClick"];
|
|
1130
|
-
const _hoisted_7 = {
|
|
1236
|
+
const _hoisted_3$2 = ["disabled"];
|
|
1237
|
+
const _hoisted_4$1 = { class: "text-sm font-mono text-gray-700 dark:text-gray-300" };
|
|
1238
|
+
const _hoisted_5$1 = { class: "grid grid-cols-5 gap-2 mb-3" };
|
|
1239
|
+
const _hoisted_6$1 = ["title", "onClick"];
|
|
1240
|
+
const _hoisted_7$1 = {
|
|
1131
1241
|
key: 0,
|
|
1132
1242
|
class: "flex items-center gap-2 pt-3 border-t border-gray-200 dark:border-gray-700"
|
|
1133
1243
|
};
|
|
1134
1244
|
const _hoisted_8 = ["value"];
|
|
1135
|
-
const _sfc_main$
|
|
1245
|
+
const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
|
|
1136
1246
|
__name: "ColorPicker",
|
|
1137
1247
|
props: {
|
|
1138
1248
|
modelValue: { default: "#3b82f6" },
|
|
@@ -1160,11 +1270,14 @@ const _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
|
|
|
1160
1270
|
] },
|
|
1161
1271
|
showInput: { type: Boolean, default: true },
|
|
1162
1272
|
disabled: { type: Boolean, default: false },
|
|
1163
|
-
label: {}
|
|
1273
|
+
label: {},
|
|
1274
|
+
teleport: { type: [String, Boolean], default: false }
|
|
1164
1275
|
},
|
|
1165
1276
|
emits: ["update:modelValue"],
|
|
1166
1277
|
setup(__props, { emit: __emit }) {
|
|
1167
1278
|
const props = __props;
|
|
1279
|
+
const teleportDisabled = vue.computed(() => props.teleport === false);
|
|
1280
|
+
const teleportTarget = vue.computed(() => props.teleport === false ? "body" : props.teleport);
|
|
1168
1281
|
const emit = __emit;
|
|
1169
1282
|
const isOpen = vue.ref(false);
|
|
1170
1283
|
const inputValue = vue.ref(props.modelValue);
|
|
@@ -1198,8 +1311,8 @@ const _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
|
|
|
1198
1311
|
isOpen.value = false;
|
|
1199
1312
|
};
|
|
1200
1313
|
return (_ctx, _cache) => {
|
|
1201
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$
|
|
1202
|
-
__props.label ? (vue.openBlock(), vue.createElementBlock("label", _hoisted_2$
|
|
1314
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$2, [
|
|
1315
|
+
__props.label ? (vue.openBlock(), vue.createElementBlock("label", _hoisted_2$2, vue.toDisplayString(__props.label), 1)) : vue.createCommentVNode("", true),
|
|
1203
1316
|
vue.createElementVNode("button", {
|
|
1204
1317
|
type: "button",
|
|
1205
1318
|
class: vue.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 }]),
|
|
@@ -1210,90 +1323,95 @@ const _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
|
|
|
1210
1323
|
class: "w-6 h-6 rounded border border-gray-200 dark:border-gray-600",
|
|
1211
1324
|
style: vue.normalizeStyle({ backgroundColor: __props.modelValue })
|
|
1212
1325
|
}, null, 4),
|
|
1213
|
-
vue.createElementVNode("span", _hoisted_4, vue.toDisplayString(__props.modelValue), 1),
|
|
1326
|
+
vue.createElementVNode("span", _hoisted_4$1, vue.toDisplayString(__props.modelValue), 1),
|
|
1214
1327
|
vue.createVNode(vue.unref(vue$1.Icon), {
|
|
1215
1328
|
icon: "heroicons:chevron-down",
|
|
1216
1329
|
class: vue.normalizeClass(["w-4 h-4 text-gray-400", { "rotate-180": isOpen.value }])
|
|
1217
1330
|
}, null, 8, ["class"])
|
|
1218
|
-
], 10, _hoisted_3$
|
|
1219
|
-
vue.
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1331
|
+
], 10, _hoisted_3$2),
|
|
1332
|
+
(vue.openBlock(), vue.createBlock(vue.Teleport, {
|
|
1333
|
+
to: teleportTarget.value,
|
|
1334
|
+
disabled: teleportDisabled.value
|
|
1335
|
+
}, [
|
|
1336
|
+
vue.createVNode(vue.Transition, {
|
|
1337
|
+
"enter-active-class": "transition duration-100 ease-out",
|
|
1338
|
+
"enter-from-class": "opacity-0 scale-95",
|
|
1339
|
+
"enter-to-class": "opacity-100 scale-100",
|
|
1340
|
+
"leave-active-class": "transition duration-75 ease-in",
|
|
1341
|
+
"leave-from-class": "opacity-100 scale-100",
|
|
1342
|
+
"leave-to-class": "opacity-0 scale-95"
|
|
1343
|
+
}, {
|
|
1344
|
+
default: vue.withCtx(() => [
|
|
1345
|
+
isOpen.value ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
1346
|
+
key: 0,
|
|
1347
|
+
class: "absolute z-50 mt-2 p-3 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-lg",
|
|
1348
|
+
onClick: _cache[1] || (_cache[1] = vue.withModifiers(() => {
|
|
1349
|
+
}, ["stop"]))
|
|
1350
|
+
}, [
|
|
1351
|
+
vue.createElementVNode("div", _hoisted_5$1, [
|
|
1352
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(__props.swatches, (color) => {
|
|
1353
|
+
return vue.openBlock(), vue.createElementBlock("button", {
|
|
1354
|
+
key: color,
|
|
1355
|
+
type: "button",
|
|
1356
|
+
class: vue.normalizeClass(["w-8 h-8 rounded-lg border-2 transition-transform hover:scale-110 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:ring-offset-1", [
|
|
1357
|
+
__props.modelValue === color ? "border-primary-500 ring-2 ring-primary-500 ring-offset-1" : "border-transparent"
|
|
1358
|
+
]]),
|
|
1359
|
+
style: vue.normalizeStyle({ backgroundColor: color }),
|
|
1360
|
+
title: color,
|
|
1361
|
+
onClick: ($event) => selectColor(color)
|
|
1362
|
+
}, [
|
|
1363
|
+
__props.modelValue === color ? (vue.openBlock(), vue.createBlock(vue.unref(vue$1.Icon), {
|
|
1364
|
+
key: 0,
|
|
1365
|
+
icon: "heroicons:check",
|
|
1366
|
+
class: vue.normalizeClass(["w-4 h-4 mx-auto", [
|
|
1367
|
+
["#ffffff", "#f9fafb", "#f3f4f6", "#e5e7eb", "#eab308", "#f59e0b"].includes(color) ? "text-gray-800" : "text-white"
|
|
1368
|
+
]])
|
|
1369
|
+
}, null, 8, ["class"])) : vue.createCommentVNode("", true)
|
|
1370
|
+
], 14, _hoisted_6$1);
|
|
1371
|
+
}), 128))
|
|
1372
|
+
]),
|
|
1373
|
+
__props.showInput ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_7$1, [
|
|
1374
|
+
vue.createElementVNode("input", {
|
|
1375
|
+
type: "color",
|
|
1376
|
+
value: __props.modelValue,
|
|
1377
|
+
class: "w-8 h-8 rounded cursor-pointer border-0 p-0",
|
|
1378
|
+
onInput: handleNativeInput
|
|
1379
|
+
}, null, 40, _hoisted_8),
|
|
1380
|
+
vue.withDirectives(vue.createElementVNode("input", {
|
|
1381
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => inputValue.value = $event),
|
|
1382
|
+
type: "text",
|
|
1383
|
+
class: "flex-1 px-2 py-1 text-sm font-mono border border-gray-300 dark:border-gray-600 rounded bg-white dark:bg-gray-700 text-gray-900 dark:text-white",
|
|
1384
|
+
placeholder: "#000000",
|
|
1385
|
+
onChange: handleInputChange,
|
|
1386
|
+
onKeyup: vue.withKeys(handleInputChange, ["enter"])
|
|
1387
|
+
}, null, 544), [
|
|
1388
|
+
[vue.vModelText, inputValue.value]
|
|
1389
|
+
])
|
|
1390
|
+
])) : vue.createCommentVNode("", true)
|
|
1273
1391
|
])) : vue.createCommentVNode("", true)
|
|
1274
|
-
])
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1392
|
+
]),
|
|
1393
|
+
_: 1
|
|
1394
|
+
}),
|
|
1395
|
+
isOpen.value ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
1396
|
+
key: 0,
|
|
1397
|
+
class: "fixed inset-0 z-40",
|
|
1398
|
+
onClick: closePicker
|
|
1399
|
+
})) : vue.createCommentVNode("", true)
|
|
1400
|
+
], 8, ["to", "disabled"]))
|
|
1283
1401
|
]);
|
|
1284
1402
|
};
|
|
1285
1403
|
}
|
|
1286
1404
|
});
|
|
1287
|
-
const _hoisted_1 = { class: "space-y-2" };
|
|
1288
|
-
const _hoisted_2 = {
|
|
1405
|
+
const _hoisted_1$1 = { class: "space-y-2" };
|
|
1406
|
+
const _hoisted_2$1 = {
|
|
1289
1407
|
key: 0,
|
|
1290
1408
|
class: "flex justify-between text-sm font-medium text-gray-700 dark:text-gray-300"
|
|
1291
1409
|
};
|
|
1292
|
-
const _hoisted_3 = {
|
|
1410
|
+
const _hoisted_3$1 = {
|
|
1293
1411
|
key: 1,
|
|
1294
1412
|
class: "flex justify-between text-xs text-gray-500 dark:text-gray-400"
|
|
1295
1413
|
};
|
|
1296
|
-
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
1414
|
+
const _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
|
|
1297
1415
|
__name: "RangeSlider",
|
|
1298
1416
|
props: {
|
|
1299
1417
|
modelValue: { default: () => [25, 75] },
|
|
@@ -1371,8 +1489,8 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
1371
1489
|
}
|
|
1372
1490
|
};
|
|
1373
1491
|
return (_ctx, _cache) => {
|
|
1374
|
-
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
|
|
1375
|
-
__props.showLabels ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2, [
|
|
1492
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$1, [
|
|
1493
|
+
__props.showLabels ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$1, [
|
|
1376
1494
|
vue.createElementVNode("span", null, vue.toDisplayString(__props.formatLabel(minValue.value)), 1),
|
|
1377
1495
|
vue.createElementVNode("span", null, vue.toDisplayString(__props.formatLabel(maxValue.value)), 1)
|
|
1378
1496
|
])) : vue.createCommentVNode("", true),
|
|
@@ -1405,7 +1523,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
1405
1523
|
onMousedown: _cache[1] || (_cache[1] = ($event) => handleMouseDown("max"))
|
|
1406
1524
|
}, null, 38)
|
|
1407
1525
|
], 2),
|
|
1408
|
-
__props.showMinMax ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3, [
|
|
1526
|
+
__props.showMinMax ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$1, [
|
|
1409
1527
|
vue.createElementVNode("span", null, vue.toDisplayString(__props.formatLabel(__props.min)), 1),
|
|
1410
1528
|
vue.createElementVNode("span", null, vue.toDisplayString(__props.formatLabel(__props.max)), 1)
|
|
1411
1529
|
])) : vue.createCommentVNode("", true)
|
|
@@ -1413,17 +1531,254 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
1413
1531
|
};
|
|
1414
1532
|
}
|
|
1415
1533
|
});
|
|
1534
|
+
const _hoisted_1 = ["aria-expanded", "aria-controls"];
|
|
1535
|
+
const _hoisted_2 = ["id", "name", "placeholder", "disabled", "aria-controls"];
|
|
1536
|
+
const _hoisted_3 = { class: "flex items-center gap-1" };
|
|
1537
|
+
const _hoisted_4 = ["id", "aria-label", "aria-multiselectable"];
|
|
1538
|
+
const _hoisted_5 = ["aria-selected", "aria-disabled", "disabled", "onClick"];
|
|
1539
|
+
const _hoisted_6 = { class: "flex-1" };
|
|
1540
|
+
const _hoisted_7 = {
|
|
1541
|
+
key: 1,
|
|
1542
|
+
class: "px-3 py-2 text-center text-sm text-gray-500 dark:text-gray-400",
|
|
1543
|
+
role: "status"
|
|
1544
|
+
};
|
|
1545
|
+
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
1546
|
+
__name: "Combobox",
|
|
1547
|
+
props: {
|
|
1548
|
+
modelValue: {},
|
|
1549
|
+
options: {},
|
|
1550
|
+
placeholder: { default: "Select..." },
|
|
1551
|
+
searchPlaceholder: { default: "Search..." },
|
|
1552
|
+
multiple: { type: Boolean, default: false },
|
|
1553
|
+
disabled: { type: Boolean, default: false },
|
|
1554
|
+
clearable: { type: Boolean, default: false },
|
|
1555
|
+
noResultsText: { default: "No results found" },
|
|
1556
|
+
name: {},
|
|
1557
|
+
id: {},
|
|
1558
|
+
teleport: { type: [String, Boolean], default: false }
|
|
1559
|
+
},
|
|
1560
|
+
emits: ["update:modelValue"],
|
|
1561
|
+
setup(__props, { emit: __emit }) {
|
|
1562
|
+
const props = __props;
|
|
1563
|
+
const { id: generatedId, related } = useId.useId({ prefix: "combobox", id: props.id });
|
|
1564
|
+
const inputId = vue.computed(() => props.id ?? generatedId.value);
|
|
1565
|
+
const listboxId = vue.computed(() => related("listbox"));
|
|
1566
|
+
const teleportDisabled = vue.computed(() => props.teleport === false);
|
|
1567
|
+
const teleportTarget = vue.computed(() => props.teleport === false ? "body" : props.teleport);
|
|
1568
|
+
const emit = __emit;
|
|
1569
|
+
const containerRef = vue.ref();
|
|
1570
|
+
const inputRef = vue.ref();
|
|
1571
|
+
const isOpen = vue.ref(false);
|
|
1572
|
+
const search = vue.ref("");
|
|
1573
|
+
index.onClickOutside(containerRef, () => {
|
|
1574
|
+
isOpen.value = false;
|
|
1575
|
+
});
|
|
1576
|
+
const filteredOptions = vue.computed(() => {
|
|
1577
|
+
if (!search.value) return props.options;
|
|
1578
|
+
const query = search.value.toLowerCase();
|
|
1579
|
+
return props.options.filter(
|
|
1580
|
+
(opt) => opt.label.toLowerCase().includes(query)
|
|
1581
|
+
);
|
|
1582
|
+
});
|
|
1583
|
+
const selectedOptions = vue.computed(() => {
|
|
1584
|
+
if (props.modelValue === null || props.modelValue === void 0) return [];
|
|
1585
|
+
const values = Array.isArray(props.modelValue) ? props.modelValue : [props.modelValue];
|
|
1586
|
+
return props.options.filter((opt) => values.includes(opt.value));
|
|
1587
|
+
});
|
|
1588
|
+
const displayValue = vue.computed(() => {
|
|
1589
|
+
var _a;
|
|
1590
|
+
if (selectedOptions.value.length === 0) return "";
|
|
1591
|
+
if (props.multiple) {
|
|
1592
|
+
return selectedOptions.value.map((o) => o.label).join(", ");
|
|
1593
|
+
}
|
|
1594
|
+
return ((_a = selectedOptions.value[0]) == null ? void 0 : _a.label) || "";
|
|
1595
|
+
});
|
|
1596
|
+
const isSelected = (option) => {
|
|
1597
|
+
if (props.modelValue === null || props.modelValue === void 0) return false;
|
|
1598
|
+
if (Array.isArray(props.modelValue)) {
|
|
1599
|
+
return props.modelValue.includes(option.value);
|
|
1600
|
+
}
|
|
1601
|
+
return props.modelValue === option.value;
|
|
1602
|
+
};
|
|
1603
|
+
const toggleOption = (option) => {
|
|
1604
|
+
if (option.disabled) return;
|
|
1605
|
+
if (props.multiple) {
|
|
1606
|
+
const currentValues = Array.isArray(props.modelValue) ? [...props.modelValue] : [];
|
|
1607
|
+
const index2 = currentValues.indexOf(option.value);
|
|
1608
|
+
if (index2 === -1) {
|
|
1609
|
+
currentValues.push(option.value);
|
|
1610
|
+
} else {
|
|
1611
|
+
currentValues.splice(index2, 1);
|
|
1612
|
+
}
|
|
1613
|
+
emit("update:modelValue", currentValues);
|
|
1614
|
+
} else {
|
|
1615
|
+
emit("update:modelValue", option.value);
|
|
1616
|
+
isOpen.value = false;
|
|
1617
|
+
search.value = "";
|
|
1618
|
+
}
|
|
1619
|
+
};
|
|
1620
|
+
const clear = () => {
|
|
1621
|
+
emit("update:modelValue", props.multiple ? [] : null);
|
|
1622
|
+
search.value = "";
|
|
1623
|
+
};
|
|
1624
|
+
const openDropdown = () => {
|
|
1625
|
+
if (props.disabled) return;
|
|
1626
|
+
isOpen.value = true;
|
|
1627
|
+
vue.nextTick(() => {
|
|
1628
|
+
var _a;
|
|
1629
|
+
(_a = inputRef.value) == null ? void 0 : _a.focus();
|
|
1630
|
+
});
|
|
1631
|
+
};
|
|
1632
|
+
vue.watch(isOpen, (open) => {
|
|
1633
|
+
if (!open) {
|
|
1634
|
+
search.value = "";
|
|
1635
|
+
}
|
|
1636
|
+
});
|
|
1637
|
+
return (_ctx, _cache) => {
|
|
1638
|
+
return vue.openBlock(), vue.createElementBlock("div", {
|
|
1639
|
+
ref_key: "containerRef",
|
|
1640
|
+
ref: containerRef,
|
|
1641
|
+
class: "relative"
|
|
1642
|
+
}, [
|
|
1643
|
+
vue.createElementVNode("div", {
|
|
1644
|
+
role: "combobox",
|
|
1645
|
+
"aria-expanded": isOpen.value,
|
|
1646
|
+
"aria-haspopup": "listbox",
|
|
1647
|
+
"aria-controls": listboxId.value,
|
|
1648
|
+
class: vue.normalizeClass([
|
|
1649
|
+
"flex min-h-[42px] w-full cursor-pointer items-center rounded-lg border bg-white px-3 py-2 transition-colors",
|
|
1650
|
+
"dark:bg-gray-900",
|
|
1651
|
+
__props.disabled ? "cursor-not-allowed border-gray-200 bg-gray-50 dark:border-gray-700 dark:bg-gray-800" : isOpen.value ? "border-primary ring-2 ring-primary/20" : "border-gray-300 hover:border-gray-400 dark:border-gray-600 dark:hover:border-gray-500"
|
|
1652
|
+
]),
|
|
1653
|
+
onClick: openDropdown
|
|
1654
|
+
}, [
|
|
1655
|
+
!isOpen.value ? (vue.openBlock(), vue.createElementBlock("span", {
|
|
1656
|
+
key: 0,
|
|
1657
|
+
class: vue.normalizeClass([
|
|
1658
|
+
"flex-1 truncate text-sm",
|
|
1659
|
+
selectedOptions.value.length ? "text-gray-900 dark:text-gray-100" : "text-gray-400 dark:text-gray-500"
|
|
1660
|
+
])
|
|
1661
|
+
}, vue.toDisplayString(displayValue.value || __props.placeholder), 3)) : vue.withDirectives((vue.openBlock(), vue.createElementBlock("input", {
|
|
1662
|
+
key: 1,
|
|
1663
|
+
id: inputId.value,
|
|
1664
|
+
ref_key: "inputRef",
|
|
1665
|
+
ref: inputRef,
|
|
1666
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => search.value = $event),
|
|
1667
|
+
type: "text",
|
|
1668
|
+
name: __props.name,
|
|
1669
|
+
placeholder: __props.searchPlaceholder,
|
|
1670
|
+
disabled: __props.disabled,
|
|
1671
|
+
"aria-autocomplete": "list",
|
|
1672
|
+
"aria-controls": listboxId.value,
|
|
1673
|
+
class: "flex-1 border-none bg-transparent text-sm text-gray-900 outline-none placeholder:text-gray-400 dark:text-gray-100 dark:placeholder:text-gray-500",
|
|
1674
|
+
onClick: _cache[1] || (_cache[1] = vue.withModifiers(() => {
|
|
1675
|
+
}, ["stop"]))
|
|
1676
|
+
}, null, 8, _hoisted_2)), [
|
|
1677
|
+
[vue.vModelText, search.value]
|
|
1678
|
+
]),
|
|
1679
|
+
vue.createElementVNode("div", _hoisted_3, [
|
|
1680
|
+
__props.clearable && selectedOptions.value.length > 0 && !__props.disabled ? (vue.openBlock(), vue.createElementBlock("button", {
|
|
1681
|
+
key: 0,
|
|
1682
|
+
type: "button",
|
|
1683
|
+
class: "rounded p-0.5 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300",
|
|
1684
|
+
"aria-label": "Clear selection",
|
|
1685
|
+
onClick: vue.withModifiers(clear, ["stop"])
|
|
1686
|
+
}, [
|
|
1687
|
+
vue.createVNode(vue.unref(vue$1.Icon), {
|
|
1688
|
+
icon: "lucide:x",
|
|
1689
|
+
class: "h-4 w-4",
|
|
1690
|
+
"aria-hidden": "true"
|
|
1691
|
+
})
|
|
1692
|
+
])) : vue.createCommentVNode("", true),
|
|
1693
|
+
vue.createVNode(vue.unref(vue$1.Icon), {
|
|
1694
|
+
icon: "lucide:chevron-down",
|
|
1695
|
+
class: vue.normalizeClass([
|
|
1696
|
+
"h-4 w-4 text-gray-400 transition-transform",
|
|
1697
|
+
isOpen.value && "rotate-180"
|
|
1698
|
+
]),
|
|
1699
|
+
"aria-hidden": "true"
|
|
1700
|
+
}, null, 8, ["class"])
|
|
1701
|
+
])
|
|
1702
|
+
], 10, _hoisted_1),
|
|
1703
|
+
(vue.openBlock(), vue.createBlock(vue.Teleport, {
|
|
1704
|
+
to: teleportTarget.value,
|
|
1705
|
+
disabled: teleportDisabled.value
|
|
1706
|
+
}, [
|
|
1707
|
+
vue.createVNode(vue.Transition, {
|
|
1708
|
+
"enter-active-class": "transition duration-100 ease-out",
|
|
1709
|
+
"enter-from-class": "transform scale-95 opacity-0",
|
|
1710
|
+
"enter-to-class": "transform scale-100 opacity-100",
|
|
1711
|
+
"leave-active-class": "transition duration-75 ease-in",
|
|
1712
|
+
"leave-from-class": "transform scale-100 opacity-100",
|
|
1713
|
+
"leave-to-class": "transform scale-95 opacity-0"
|
|
1714
|
+
}, {
|
|
1715
|
+
default: vue.withCtx(() => [
|
|
1716
|
+
isOpen.value ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
1717
|
+
key: 0,
|
|
1718
|
+
id: listboxId.value,
|
|
1719
|
+
role: "listbox",
|
|
1720
|
+
"aria-label": __props.placeholder,
|
|
1721
|
+
"aria-multiselectable": __props.multiple || void 0,
|
|
1722
|
+
class: "absolute z-50 mt-1 max-h-60 w-full overflow-auto rounded-lg border border-gray-200 bg-white py-1 shadow-lg dark:border-gray-700 dark:bg-gray-900"
|
|
1723
|
+
}, [
|
|
1724
|
+
filteredOptions.value.length ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 0 }, vue.renderList(filteredOptions.value, (option) => {
|
|
1725
|
+
return vue.openBlock(), vue.createElementBlock("button", {
|
|
1726
|
+
key: option.value,
|
|
1727
|
+
type: "button",
|
|
1728
|
+
role: "option",
|
|
1729
|
+
"aria-selected": isSelected(option),
|
|
1730
|
+
"aria-disabled": option.disabled || void 0,
|
|
1731
|
+
disabled: option.disabled,
|
|
1732
|
+
class: vue.normalizeClass([
|
|
1733
|
+
"flex w-full items-center gap-2 px-3 py-2 text-left text-sm transition-colors",
|
|
1734
|
+
option.disabled ? "cursor-not-allowed text-gray-400 dark:text-gray-500" : isSelected(option) ? "bg-primary/10 text-primary dark:bg-primary/20" : "text-gray-700 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-800"
|
|
1735
|
+
]),
|
|
1736
|
+
onClick: ($event) => toggleOption(option)
|
|
1737
|
+
}, [
|
|
1738
|
+
__props.multiple ? (vue.openBlock(), vue.createElementBlock("span", {
|
|
1739
|
+
key: 0,
|
|
1740
|
+
class: vue.normalizeClass([
|
|
1741
|
+
"flex h-4 w-4 items-center justify-center rounded border",
|
|
1742
|
+
isSelected(option) ? "border-primary bg-primary text-white" : "border-gray-300 dark:border-gray-600"
|
|
1743
|
+
]),
|
|
1744
|
+
"aria-hidden": "true"
|
|
1745
|
+
}, [
|
|
1746
|
+
isSelected(option) ? (vue.openBlock(), vue.createBlock(vue.unref(vue$1.Icon), {
|
|
1747
|
+
key: 0,
|
|
1748
|
+
icon: "lucide:check",
|
|
1749
|
+
class: "h-3 w-3"
|
|
1750
|
+
})) : vue.createCommentVNode("", true)
|
|
1751
|
+
], 2)) : vue.createCommentVNode("", true),
|
|
1752
|
+
vue.createElementVNode("span", _hoisted_6, vue.toDisplayString(option.label), 1),
|
|
1753
|
+
!__props.multiple && isSelected(option) ? (vue.openBlock(), vue.createBlock(vue.unref(vue$1.Icon), {
|
|
1754
|
+
key: 1,
|
|
1755
|
+
icon: "lucide:check",
|
|
1756
|
+
class: "h-4 w-4 text-primary",
|
|
1757
|
+
"aria-hidden": "true"
|
|
1758
|
+
})) : vue.createCommentVNode("", true)
|
|
1759
|
+
], 10, _hoisted_5);
|
|
1760
|
+
}), 128)) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_7, vue.toDisplayString(__props.noResultsText), 1))
|
|
1761
|
+
], 8, _hoisted_4)) : vue.createCommentVNode("", true)
|
|
1762
|
+
]),
|
|
1763
|
+
_: 1
|
|
1764
|
+
})
|
|
1765
|
+
], 8, ["to", "disabled"]))
|
|
1766
|
+
], 512);
|
|
1767
|
+
};
|
|
1768
|
+
}
|
|
1769
|
+
});
|
|
1416
1770
|
exports.Slider = Slider;
|
|
1417
|
-
exports._sfc_main = _sfc_main$
|
|
1418
|
-
exports._sfc_main$1 = _sfc_main$
|
|
1419
|
-
exports._sfc_main$10 = _sfc_main$
|
|
1420
|
-
exports._sfc_main$11 = _sfc_main;
|
|
1421
|
-
exports._sfc_main$
|
|
1422
|
-
exports._sfc_main$
|
|
1423
|
-
exports._sfc_main$
|
|
1424
|
-
exports._sfc_main$
|
|
1425
|
-
exports._sfc_main$
|
|
1426
|
-
exports._sfc_main$
|
|
1427
|
-
exports._sfc_main$
|
|
1428
|
-
exports._sfc_main$
|
|
1429
|
-
|
|
1771
|
+
exports._sfc_main = _sfc_main$d;
|
|
1772
|
+
exports._sfc_main$1 = _sfc_main$c;
|
|
1773
|
+
exports._sfc_main$10 = _sfc_main$2;
|
|
1774
|
+
exports._sfc_main$11 = _sfc_main$1;
|
|
1775
|
+
exports._sfc_main$12 = _sfc_main;
|
|
1776
|
+
exports._sfc_main$2 = _sfc_main$b;
|
|
1777
|
+
exports._sfc_main$3 = _sfc_main$a;
|
|
1778
|
+
exports._sfc_main$4 = _sfc_main$9;
|
|
1779
|
+
exports._sfc_main$5 = _sfc_main$8;
|
|
1780
|
+
exports._sfc_main$6 = _sfc_main$7;
|
|
1781
|
+
exports._sfc_main$7 = _sfc_main$5;
|
|
1782
|
+
exports._sfc_main$8 = _sfc_main$4;
|
|
1783
|
+
exports._sfc_main$9 = _sfc_main$3;
|
|
1784
|
+
//# sourceMappingURL=Combobox.vue_vue_type_script_setup_true_lang-D9TIId4E.cjs.map
|