cisse-vue-ui 0.2.7 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +666 -664
- package/dist/{Switch.vue_vue_type_script_setup_true_lang-dRPxDu8I.js → DatePicker.vue_vue_type_script_setup_true_lang-DgGJ5-8v.js} +372 -60
- package/dist/DatePicker.vue_vue_type_script_setup_true_lang-DgGJ5-8v.js.map +1 -0
- package/dist/{Switch.vue_vue_type_script_setup_true_lang-wRTWorCd.cjs → DatePicker.vue_vue_type_script_setup_true_lang-qux1VNn0.cjs} +371 -59
- package/dist/DatePicker.vue_vue_type_script_setup_true_lang-qux1VNn0.cjs.map +1 -0
- package/dist/Dropdown.vue_vue_type_script_setup_true_lang-B9DsCY8M.js.map +1 -1
- package/dist/Dropdown.vue_vue_type_script_setup_true_lang-nMP2OxXp.cjs.map +1 -1
- package/dist/PageLayout.vue_vue_type_script_setup_true_lang-Bnw5L-xO.cjs.map +1 -1
- package/dist/PageLayout.vue_vue_type_script_setup_true_lang-D8uD3-Fe.js.map +1 -1
- package/dist/{CollapsibleCard.vue_vue_type_script_setup_true_lang-Y1wvT4aS.js → Popover.vue_vue_type_script_setup_true_lang-Q7gRZsT9.js} +203 -43
- package/dist/Popover.vue_vue_type_script_setup_true_lang-Q7gRZsT9.js.map +1 -0
- package/dist/{CollapsibleCard.vue_vue_type_script_setup_true_lang-ClNZxjzF.cjs → Popover.vue_vue_type_script_setup_true_lang-dvlDTcf1.cjs} +191 -31
- package/dist/Popover.vue_vue_type_script_setup_true_lang-dvlDTcf1.cjs.map +1 -0
- package/dist/{EmptyState.vue_vue_type_script_setup_true_lang-mlqLBP5W.cjs → Skeleton.vue_vue_type_script_setup_true_lang-D2S5g9s5.cjs} +325 -72
- package/dist/Skeleton.vue_vue_type_script_setup_true_lang-D2S5g9s5.cjs.map +1 -0
- package/dist/{EmptyState.vue_vue_type_script_setup_true_lang-CrVvFwXA.js → Skeleton.vue_vue_type_script_setup_true_lang-DRC4EADS.js} +326 -73
- package/dist/Skeleton.vue_vue_type_script_setup_true_lang-DRC4EADS.js.map +1 -0
- package/dist/_plugin-vue_export-helper-1tPrXgE0.js +11 -0
- package/dist/_plugin-vue_export-helper-1tPrXgE0.js.map +1 -0
- package/dist/_plugin-vue_export-helper-DM9IkUGy.cjs +10 -0
- package/dist/_plugin-vue_export-helper-DM9IkUGy.cjs.map +1 -0
- package/dist/cisse-vue-ui.css +83 -0
- package/dist/components/core/Avatar.stories.d.ts +12 -0
- package/dist/components/core/Button.stories.d.ts +18 -0
- package/dist/components/core/CardComponent.stories.d.ts +10 -0
- package/dist/components/core/CollapsibleCard.stories.d.ts +10 -0
- package/dist/components/core/Dropdown.stories.d.ts +11 -0
- package/dist/components/core/Popover.stories.d.ts +10 -0
- package/dist/components/core/Popover.vue.d.ts +42 -0
- package/dist/components/core/StatusBadge.stories.d.ts +13 -0
- package/dist/components/core/Stepper.stories.d.ts +12 -0
- package/dist/components/core/Tabs.stories.d.ts +10 -0
- package/dist/components/core/Tooltip.stories.d.ts +10 -0
- package/dist/components/core/Tooltip.vue.d.ts +32 -0
- package/dist/components/core/index.cjs +15 -13
- package/dist/components/core/index.cjs.map +1 -1
- package/dist/components/core/index.d.ts +4 -0
- package/dist/components/core/index.js +4 -2
- package/dist/components/feedback/Alert.stories.d.ts +13 -0
- package/dist/components/feedback/EmptyState.stories.d.ts +13 -0
- package/dist/components/feedback/LoadingSpinner.stories.d.ts +11 -0
- package/dist/components/feedback/Modal.stories.d.ts +11 -0
- package/dist/components/feedback/PaginationControls.stories.d.ts +12 -0
- package/dist/components/feedback/Progress.stories.d.ts +14 -0
- package/dist/components/feedback/Progress.vue.d.ts +30 -0
- package/dist/components/feedback/Skeleton.stories.d.ts +15 -0
- package/dist/components/feedback/Skeleton.vue.d.ts +19 -0
- package/dist/components/feedback/Toast.stories.d.ts +12 -0
- package/dist/components/feedback/Toast.vue.d.ts +23 -0
- package/dist/components/feedback/ToastContainer.vue.d.ts +22 -0
- package/dist/components/feedback/index.cjs +12 -8
- package/dist/components/feedback/index.cjs.map +1 -1
- package/dist/components/feedback/index.d.ts +8 -0
- package/dist/components/feedback/index.js +6 -2
- package/dist/components/form/Checkbox.stories.d.ts +13 -0
- package/dist/components/form/DatePicker.stories.d.ts +15 -0
- package/dist/components/form/DatePicker.vue.d.ts +34 -0
- package/dist/components/form/FormGroup.stories.d.ts +10 -0
- package/dist/components/form/FormInput.stories.d.ts +12 -0
- package/dist/components/form/FormSelect.stories.d.ts +11 -0
- package/dist/components/form/Slider.stories.d.ts +13 -0
- package/dist/components/form/Slider.vue.d.ts +29 -0
- package/dist/components/form/Switch.stories.d.ts +11 -0
- package/dist/components/form/index.cjs +10 -8
- 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 -1
- package/dist/components/index.cjs +37 -29
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.js +12 -4
- package/dist/components/layout/BaseLayout.stories.d.ts +9 -0
- package/dist/components/layout/BaseLayout.vue.d.ts +1 -1
- package/dist/components/layout/PageLayout.stories.d.ts +10 -0
- package/dist/components/type/BadgeType.stories.d.ts +13 -0
- package/dist/components/type/BooleanType.stories.d.ts +12 -0
- package/dist/components/type/DateType.stories.d.ts +12 -0
- package/dist/components/type/NumberType.stories.d.ts +11 -0
- package/dist/components/type/TextType.stories.d.ts +10 -0
- package/dist/composables/index.cjs +7 -6
- package/dist/composables/index.cjs.map +1 -1
- package/dist/composables/index.d.ts +1 -0
- package/dist/composables/index.js +3 -2
- package/dist/composables/useToast.d.ts +30 -0
- package/dist/index-BQtfDfYo.js +59 -0
- package/dist/index-BQtfDfYo.js.map +1 -0
- package/dist/index-CzzlUYhY.cjs +58 -0
- package/dist/index-CzzlUYhY.cjs.map +1 -0
- package/dist/index.cjs +45 -36
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +15 -6
- package/dist/style.css +1 -1
- package/dist/useDropdown-DHFnd259.cjs.map +1 -1
- package/dist/useDropdown-iVu14E6s.js.map +1 -1
- package/dist/{useModal-Aq8hn152.js → useToast-DT9hFfpM.js} +49 -1
- package/dist/useToast-DT9hFfpM.js.map +1 -0
- package/dist/{useModal-DDF_ZS8C.cjs → useToast-nJXpFz_M.cjs} +49 -1
- package/dist/useToast-nJXpFz_M.cjs.map +1 -0
- package/package.json +21 -2
- package/dist/CollapsibleCard.vue_vue_type_script_setup_true_lang-ClNZxjzF.cjs.map +0 -1
- package/dist/CollapsibleCard.vue_vue_type_script_setup_true_lang-Y1wvT4aS.js.map +0 -1
- package/dist/EmptyState.vue_vue_type_script_setup_true_lang-CrVvFwXA.js.map +0 -1
- package/dist/EmptyState.vue_vue_type_script_setup_true_lang-mlqLBP5W.cjs.map +0 -1
- package/dist/Switch.vue_vue_type_script_setup_true_lang-dRPxDu8I.js.map +0 -1
- package/dist/Switch.vue_vue_type_script_setup_true_lang-wRTWorCd.cjs.map +0 -1
- package/dist/index-CCWZb44b.cjs +0 -50
- package/dist/index-CCWZb44b.cjs.map +0 -1
- package/dist/index-RD8wq3O6.js +0 -51
- package/dist/index-RD8wq3O6.js.map +0 -1
- package/dist/useModal-Aq8hn152.js.map +0 -1
- package/dist/useModal-DDF_ZS8C.cjs.map +0 -1
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { defineComponent, createElementBlock, openBlock, renderSlot, createTextVNode, toDisplayString, mergeModels, useModel, withDirectives, mergeProps, vModelDynamic, ref, computed, watch, createElementVNode, createBlock, normalizeClass, createVNode, unref, Teleport, Transition, withCtx, createCommentVNode, normalizeStyle, vModelText, Fragment, renderList, nextTick } from "vue";
|
|
1
|
+
import { defineComponent, createElementBlock, openBlock, renderSlot, createTextVNode, toDisplayString, mergeModels, useModel, withDirectives, mergeProps, vModelDynamic, ref, computed, watch, createElementVNode, createBlock, normalizeClass, createVNode, unref, Teleport, Transition, withCtx, createCommentVNode, normalizeStyle, vModelText, Fragment, renderList, nextTick, withModifiers } from "vue";
|
|
2
2
|
import { Icon } from "@iconify/vue";
|
|
3
3
|
import { u as useDropdown } from "./useDropdown-iVu14E6s.js";
|
|
4
|
-
|
|
5
|
-
const
|
|
4
|
+
import { _ as _export_sfc } from "./_plugin-vue_export-helper-1tPrXgE0.js";
|
|
5
|
+
const _hoisted_1$8 = ["data-error", "for"];
|
|
6
|
+
const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
6
7
|
__name: "FormLabel",
|
|
7
8
|
props: {
|
|
8
9
|
error: { type: [String, Boolean] },
|
|
@@ -16,12 +17,12 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
16
17
|
class: "block text-sm font-medium text-gray-700 data-[error=true]:text-red-500 dark:text-gray-300"
|
|
17
18
|
}, [
|
|
18
19
|
renderSlot(_ctx.$slots, "default")
|
|
19
|
-
], 8, _hoisted_1$
|
|
20
|
+
], 8, _hoisted_1$8);
|
|
20
21
|
};
|
|
21
22
|
}
|
|
22
23
|
});
|
|
23
|
-
const _hoisted_1$
|
|
24
|
-
const _sfc_main$
|
|
24
|
+
const _hoisted_1$7 = ["data-error"];
|
|
25
|
+
const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
25
26
|
__name: "FormHelp",
|
|
26
27
|
props: {
|
|
27
28
|
error: { type: Boolean },
|
|
@@ -36,12 +37,12 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
36
37
|
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
37
38
|
createTextVNode(toDisplayString(__props.text ?? ""), 1)
|
|
38
39
|
])
|
|
39
|
-
], 8, _hoisted_1$
|
|
40
|
+
], 8, _hoisted_1$7);
|
|
40
41
|
};
|
|
41
42
|
}
|
|
42
43
|
});
|
|
43
|
-
const _hoisted_1$
|
|
44
|
-
const _sfc_main$
|
|
44
|
+
const _hoisted_1$6 = ["id", "disabled", "name", "placeholder", "type"];
|
|
45
|
+
const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
45
46
|
__name: "FormInput",
|
|
46
47
|
props: /* @__PURE__ */ mergeModels({
|
|
47
48
|
type: { default: "text" },
|
|
@@ -67,32 +68,32 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
67
68
|
placeholder: __props.placeholder,
|
|
68
69
|
type: __props.type,
|
|
69
70
|
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 invalid:border-pink-500 invalid:text-pink-600 focus:border-primary focus:ring-1 focus:ring-primary focus:outline-none focus:invalid:border-pink-500 focus:invalid:ring-pink-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"
|
|
70
|
-
}, _ctx.$attrs), null, 16, _hoisted_1$
|
|
71
|
+
}, _ctx.$attrs), null, 16, _hoisted_1$6)), [
|
|
71
72
|
[vModelDynamic, modelValue.value]
|
|
72
73
|
]);
|
|
73
74
|
};
|
|
74
75
|
}
|
|
75
76
|
});
|
|
76
|
-
const _hoisted_1$
|
|
77
|
-
const _hoisted_2$
|
|
78
|
-
const _hoisted_3$
|
|
79
|
-
const _hoisted_4$
|
|
77
|
+
const _hoisted_1$5 = { class: "relative" };
|
|
78
|
+
const _hoisted_2$4 = ["id", "disabled"];
|
|
79
|
+
const _hoisted_3$3 = { class: "flex-1 truncate" };
|
|
80
|
+
const _hoisted_4$3 = {
|
|
80
81
|
key: 0,
|
|
81
82
|
class: "sticky top-0 border-b border-gray-200 bg-white p-2 dark:border-gray-700 dark:bg-gray-800"
|
|
82
83
|
};
|
|
83
|
-
const _hoisted_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" };
|
|
84
|
-
const _hoisted_6 = {
|
|
84
|
+
const _hoisted_5$2 = { 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" };
|
|
85
|
+
const _hoisted_6$2 = {
|
|
85
86
|
key: 1,
|
|
86
87
|
class: "px-4 py-3 text-sm text-gray-500 dark:text-gray-400"
|
|
87
88
|
};
|
|
88
|
-
const _hoisted_7 = { class: "py-1" };
|
|
89
|
-
const _hoisted_8 = ["data-index", "onClick", "onMouseenter"];
|
|
90
|
-
const _hoisted_9 = {
|
|
89
|
+
const _hoisted_7$2 = { class: "py-1" };
|
|
90
|
+
const _hoisted_8$2 = ["data-index", "onClick", "onMouseenter"];
|
|
91
|
+
const _hoisted_9$1 = {
|
|
91
92
|
key: 1,
|
|
92
93
|
class: "size-4 shrink-0"
|
|
93
94
|
};
|
|
94
|
-
const _hoisted_10 = { class: "flex-1" };
|
|
95
|
-
const _sfc_main$
|
|
95
|
+
const _hoisted_10$1 = { class: "flex-1" };
|
|
96
|
+
const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
96
97
|
__name: "FormSelect",
|
|
97
98
|
props: /* @__PURE__ */ mergeModels({
|
|
98
99
|
options: {},
|
|
@@ -205,7 +206,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
205
206
|
return [base, state, text, props.triggerClass];
|
|
206
207
|
});
|
|
207
208
|
return (_ctx, _cache) => {
|
|
208
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
209
|
+
return openBlock(), createElementBlock("div", _hoisted_1$5, [
|
|
209
210
|
createElementVNode("button", {
|
|
210
211
|
ref_key: "triggerRef",
|
|
211
212
|
ref: triggerRef,
|
|
@@ -220,13 +221,13 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
220
221
|
option: selectedOption.value,
|
|
221
222
|
placeholder: __props.placeholder
|
|
222
223
|
}, () => [
|
|
223
|
-
createElementVNode("span", _hoisted_3$
|
|
224
|
+
createElementVNode("span", _hoisted_3$3, toDisplayString(displayValue.value), 1)
|
|
224
225
|
]),
|
|
225
226
|
createVNode(unref(Icon), {
|
|
226
227
|
icon: "lucide:chevron-down",
|
|
227
228
|
class: normalizeClass(["size-4 shrink-0 text-gray-400 transition-transform", unref(isOpen) && "rotate-180"])
|
|
228
229
|
}, null, 8, ["class"])
|
|
229
|
-
], 42, _hoisted_2$
|
|
230
|
+
], 42, _hoisted_2$4),
|
|
230
231
|
(openBlock(), createBlock(Teleport, {
|
|
231
232
|
to: "body",
|
|
232
233
|
disabled: !__props.teleport
|
|
@@ -250,8 +251,8 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
250
251
|
!__props.teleport && "absolute mt-1 w-full"
|
|
251
252
|
])
|
|
252
253
|
}, [
|
|
253
|
-
__props.searchable ? (openBlock(), createElementBlock("div", _hoisted_4$
|
|
254
|
-
createElementVNode("div", _hoisted_5, [
|
|
254
|
+
__props.searchable ? (openBlock(), createElementBlock("div", _hoisted_4$3, [
|
|
255
|
+
createElementVNode("div", _hoisted_5$2, [
|
|
255
256
|
createVNode(unref(Icon), {
|
|
256
257
|
icon: "lucide:search",
|
|
257
258
|
class: "size-4 text-gray-400"
|
|
@@ -269,8 +270,8 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
269
270
|
])
|
|
270
271
|
])
|
|
271
272
|
])) : createCommentVNode("", true),
|
|
272
|
-
filteredOptions.value.length === 0 ? (openBlock(), createElementBlock("div", _hoisted_6, toDisplayString(__props.noResultsText), 1)) : createCommentVNode("", true),
|
|
273
|
-
createElementVNode("div", _hoisted_7, [
|
|
273
|
+
filteredOptions.value.length === 0 ? (openBlock(), createElementBlock("div", _hoisted_6$2, toDisplayString(__props.noResultsText), 1)) : createCommentVNode("", true),
|
|
274
|
+
createElementVNode("div", _hoisted_7$2, [
|
|
274
275
|
(openBlock(true), createElementBlock(Fragment, null, renderList(filteredOptions.value, (option, index) => {
|
|
275
276
|
return openBlock(), createElementBlock("button", {
|
|
276
277
|
key: String(option.value),
|
|
@@ -294,10 +295,10 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
294
295
|
key: 0,
|
|
295
296
|
icon: "lucide:check",
|
|
296
297
|
class: "size-4 shrink-0 text-primary"
|
|
297
|
-
})) : (openBlock(), createElementBlock("span", _hoisted_9)),
|
|
298
|
-
createElementVNode("span", _hoisted_10, toDisplayString(option.label), 1)
|
|
298
|
+
})) : (openBlock(), createElementBlock("span", _hoisted_9$1)),
|
|
299
|
+
createElementVNode("span", _hoisted_10$1, toDisplayString(option.label), 1)
|
|
299
300
|
])
|
|
300
|
-
], 42, _hoisted_8);
|
|
301
|
+
], 42, _hoisted_8$2);
|
|
301
302
|
}), 128))
|
|
302
303
|
])
|
|
303
304
|
], 6)) : createCommentVNode("", true)
|
|
@@ -309,8 +310,8 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
309
310
|
};
|
|
310
311
|
}
|
|
311
312
|
});
|
|
312
|
-
const _hoisted_1$
|
|
313
|
-
const _sfc_main$
|
|
313
|
+
const _hoisted_1$4 = ["hidden"];
|
|
314
|
+
const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
314
315
|
__name: "FormGroup",
|
|
315
316
|
props: /* @__PURE__ */ mergeModels({
|
|
316
317
|
label: {},
|
|
@@ -343,7 +344,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
343
344
|
}, [
|
|
344
345
|
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
345
346
|
renderSlot(_ctx.$slots, "label", {}, () => [
|
|
346
|
-
__props.label ? (openBlock(), createBlock(_sfc_main$
|
|
347
|
+
__props.label ? (openBlock(), createBlock(_sfc_main$8, {
|
|
347
348
|
key: 0,
|
|
348
349
|
"html-for": __props.id ?? __props.name,
|
|
349
350
|
error: __props.error
|
|
@@ -355,17 +356,17 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
355
356
|
}, 8, ["html-for", "error"])) : createCommentVNode("", true)
|
|
356
357
|
]),
|
|
357
358
|
renderSlot(_ctx.$slots, "input", {}, () => [
|
|
358
|
-
isSelect.value ? (openBlock(), createBlock(_sfc_main$
|
|
359
|
+
isSelect.value ? (openBlock(), createBlock(_sfc_main$5, mergeProps({
|
|
359
360
|
key: 0,
|
|
360
361
|
modelValue: modelValue.value,
|
|
361
362
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => modelValue.value = $event)
|
|
362
|
-
}, { ..._ctx.$attrs, ..._ctx.$props }), null, 16, ["modelValue"])) : (openBlock(), createBlock(_sfc_main$
|
|
363
|
+
}, { ..._ctx.$attrs, ..._ctx.$props }), null, 16, ["modelValue"])) : (openBlock(), createBlock(_sfc_main$6, mergeProps({
|
|
363
364
|
key: 1,
|
|
364
365
|
modelValue: modelValue.value,
|
|
365
366
|
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => modelValue.value = $event)
|
|
366
367
|
}, { ..._ctx.$attrs, ..._ctx.$props }), null, 16, ["modelValue"]))
|
|
367
368
|
]),
|
|
368
|
-
__props.error && typeof __props.error === "string" ? (openBlock(), createBlock(_sfc_main$
|
|
369
|
+
__props.error && typeof __props.error === "string" ? (openBlock(), createBlock(_sfc_main$7, {
|
|
369
370
|
key: 0,
|
|
370
371
|
error: true
|
|
371
372
|
}, {
|
|
@@ -375,13 +376,13 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
375
376
|
_: 1
|
|
376
377
|
})) : createCommentVNode("", true)
|
|
377
378
|
])
|
|
378
|
-
], 12, _hoisted_1$
|
|
379
|
+
], 12, _hoisted_1$4);
|
|
379
380
|
};
|
|
380
381
|
}
|
|
381
382
|
});
|
|
382
|
-
const _hoisted_1$
|
|
383
|
-
const _hoisted_2$
|
|
384
|
-
const _sfc_main$
|
|
383
|
+
const _hoisted_1$3 = { class: "relative" };
|
|
384
|
+
const _hoisted_2$3 = ["disabled", "placeholder", "value"];
|
|
385
|
+
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
385
386
|
__name: "SearchInput",
|
|
386
387
|
props: {
|
|
387
388
|
modelValue: {},
|
|
@@ -397,7 +398,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
397
398
|
emit("update:modelValue", target.value);
|
|
398
399
|
};
|
|
399
400
|
return (_ctx, _cache) => {
|
|
400
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
401
|
+
return openBlock(), createElementBlock("div", _hoisted_1$3, [
|
|
401
402
|
createVNode(unref(Icon), {
|
|
402
403
|
icon: __props.icon,
|
|
403
404
|
class: "absolute top-1/2 left-3 h-5 w-5 -translate-y-1/2 text-gray-400"
|
|
@@ -409,25 +410,25 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
409
410
|
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",
|
|
410
411
|
type: "text",
|
|
411
412
|
onInput: handleInput
|
|
412
|
-
}, null, 40, _hoisted_2$
|
|
413
|
+
}, null, 40, _hoisted_2$3)
|
|
413
414
|
]);
|
|
414
415
|
};
|
|
415
416
|
}
|
|
416
417
|
});
|
|
417
|
-
const _hoisted_1 = ["aria-checked", "disabled"];
|
|
418
|
-
const _hoisted_2 = {
|
|
418
|
+
const _hoisted_1$2 = ["aria-checked", "disabled"];
|
|
419
|
+
const _hoisted_2$2 = {
|
|
419
420
|
key: 0,
|
|
420
421
|
class: "flex flex-col"
|
|
421
422
|
};
|
|
422
|
-
const _hoisted_3 = {
|
|
423
|
+
const _hoisted_3$2 = {
|
|
423
424
|
key: 0,
|
|
424
425
|
class: "text-sm font-medium text-gray-900 dark:text-white"
|
|
425
426
|
};
|
|
426
|
-
const _hoisted_4 = {
|
|
427
|
+
const _hoisted_4$2 = {
|
|
427
428
|
key: 1,
|
|
428
429
|
class: "text-sm text-gray-500 dark:text-gray-400"
|
|
429
430
|
};
|
|
430
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
431
|
+
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
431
432
|
__name: "Switch",
|
|
432
433
|
props: {
|
|
433
434
|
modelValue: { type: Boolean, default: false },
|
|
@@ -482,22 +483,333 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
482
483
|
__props.modelValue ? translateSizes[__props.size] : "translate-x-1"
|
|
483
484
|
])
|
|
484
485
|
}, null, 2)
|
|
485
|
-
], 10, _hoisted_1),
|
|
486
|
-
__props.label || __props.description ? (openBlock(), createElementBlock("div", _hoisted_2, [
|
|
487
|
-
__props.label ? (openBlock(), createElementBlock("span", _hoisted_3, toDisplayString(__props.label), 1)) : createCommentVNode("", true),
|
|
488
|
-
__props.description ? (openBlock(), createElementBlock("span", _hoisted_4, toDisplayString(__props.description), 1)) : createCommentVNode("", true)
|
|
486
|
+
], 10, _hoisted_1$2),
|
|
487
|
+
__props.label || __props.description ? (openBlock(), createElementBlock("div", _hoisted_2$2, [
|
|
488
|
+
__props.label ? (openBlock(), createElementBlock("span", _hoisted_3$2, toDisplayString(__props.label), 1)) : createCommentVNode("", true),
|
|
489
|
+
__props.description ? (openBlock(), createElementBlock("span", _hoisted_4$2, toDisplayString(__props.description), 1)) : createCommentVNode("", true)
|
|
489
490
|
])) : createCommentVNode("", true)
|
|
490
491
|
], 2);
|
|
491
492
|
};
|
|
492
493
|
}
|
|
493
494
|
});
|
|
495
|
+
const _hoisted_1$1 = { class: "w-full" };
|
|
496
|
+
const _hoisted_2$1 = {
|
|
497
|
+
key: 0,
|
|
498
|
+
class: "mb-2 flex justify-between text-sm"
|
|
499
|
+
};
|
|
500
|
+
const _hoisted_3$1 = { class: "text-gray-600 dark:text-gray-400" };
|
|
501
|
+
const _hoisted_4$1 = { class: "font-medium text-gray-900 dark:text-white" };
|
|
502
|
+
const _hoisted_5$1 = { class: "text-gray-600 dark:text-gray-400" };
|
|
503
|
+
const _hoisted_6$1 = { class: "relative" };
|
|
504
|
+
const _hoisted_7$1 = ["value", "min", "max", "step", "disabled"];
|
|
505
|
+
const _hoisted_8$1 = { class: "pointer-events-none absolute inset-y-0 left-0 flex items-center" };
|
|
506
|
+
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
507
|
+
__name: "Slider",
|
|
508
|
+
props: /* @__PURE__ */ mergeModels({
|
|
509
|
+
min: { default: 0 },
|
|
510
|
+
max: { default: 100 },
|
|
511
|
+
step: { default: 1 },
|
|
512
|
+
disabled: { type: Boolean, default: false },
|
|
513
|
+
showValue: { type: Boolean, default: false },
|
|
514
|
+
formatValue: {}
|
|
515
|
+
}, {
|
|
516
|
+
"modelValue": { default: 0 },
|
|
517
|
+
"modelModifiers": {}
|
|
518
|
+
}),
|
|
519
|
+
emits: ["update:modelValue"],
|
|
520
|
+
setup(__props) {
|
|
521
|
+
const props = __props;
|
|
522
|
+
const modelValue = useModel(__props, "modelValue");
|
|
523
|
+
const percentage = computed(() => {
|
|
524
|
+
return (modelValue.value - props.min) / (props.max - props.min) * 100;
|
|
525
|
+
});
|
|
526
|
+
const displayValue = computed(() => {
|
|
527
|
+
if (props.formatValue) {
|
|
528
|
+
return props.formatValue(modelValue.value);
|
|
529
|
+
}
|
|
530
|
+
return modelValue.value.toString();
|
|
531
|
+
});
|
|
532
|
+
const handleInput = (event) => {
|
|
533
|
+
const target = event.target;
|
|
534
|
+
modelValue.value = Number(target.value);
|
|
535
|
+
};
|
|
536
|
+
return (_ctx, _cache) => {
|
|
537
|
+
return openBlock(), createElementBlock("div", _hoisted_1$1, [
|
|
538
|
+
__props.showValue ? (openBlock(), createElementBlock("div", _hoisted_2$1, [
|
|
539
|
+
createElementVNode("span", _hoisted_3$1, toDisplayString(__props.min), 1),
|
|
540
|
+
createElementVNode("span", _hoisted_4$1, toDisplayString(displayValue.value), 1),
|
|
541
|
+
createElementVNode("span", _hoisted_5$1, toDisplayString(__props.max), 1)
|
|
542
|
+
])) : createCommentVNode("", true),
|
|
543
|
+
createElementVNode("div", _hoisted_6$1, [
|
|
544
|
+
createElementVNode("input", {
|
|
545
|
+
type: "range",
|
|
546
|
+
value: modelValue.value,
|
|
547
|
+
min: __props.min,
|
|
548
|
+
max: __props.max,
|
|
549
|
+
step: __props.step,
|
|
550
|
+
disabled: __props.disabled,
|
|
551
|
+
class: "slider-input w-full cursor-pointer appearance-none bg-transparent disabled:cursor-not-allowed disabled:opacity-50",
|
|
552
|
+
onInput: handleInput
|
|
553
|
+
}, null, 40, _hoisted_7$1),
|
|
554
|
+
createElementVNode("div", _hoisted_8$1, [
|
|
555
|
+
createElementVNode("div", {
|
|
556
|
+
class: "h-2 rounded-full bg-primary",
|
|
557
|
+
style: normalizeStyle({ width: `${percentage.value}%` })
|
|
558
|
+
}, null, 4)
|
|
559
|
+
])
|
|
560
|
+
])
|
|
561
|
+
]);
|
|
562
|
+
};
|
|
563
|
+
}
|
|
564
|
+
});
|
|
565
|
+
const Slider = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-89741e22"]]);
|
|
566
|
+
const _hoisted_1 = { class: "relative" };
|
|
567
|
+
const _hoisted_2 = ["disabled"];
|
|
568
|
+
const _hoisted_3 = { class: "flex-1 truncate" };
|
|
569
|
+
const _hoisted_4 = { class: "flex items-center gap-1" };
|
|
570
|
+
const _hoisted_5 = { class: "mb-4 flex items-center justify-between" };
|
|
571
|
+
const _hoisted_6 = { class: "font-medium text-gray-900 dark:text-white" };
|
|
572
|
+
const _hoisted_7 = { class: "mb-2 grid grid-cols-7 gap-1" };
|
|
573
|
+
const _hoisted_8 = { class: "grid grid-cols-7 gap-1" };
|
|
574
|
+
const _hoisted_9 = ["disabled", "onClick"];
|
|
575
|
+
const _hoisted_10 = { class: "mt-4 border-t border-gray-200 pt-3 dark:border-gray-700" };
|
|
576
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
577
|
+
__name: "DatePicker",
|
|
578
|
+
props: /* @__PURE__ */ mergeModels({
|
|
579
|
+
placeholder: { default: "Select date" },
|
|
580
|
+
format: { default: "short" },
|
|
581
|
+
locale: { default: "en-US" },
|
|
582
|
+
disabled: { type: Boolean, default: false },
|
|
583
|
+
minDate: {},
|
|
584
|
+
maxDate: {},
|
|
585
|
+
teleport: { type: Boolean, default: true }
|
|
586
|
+
}, {
|
|
587
|
+
"modelValue": { default: null },
|
|
588
|
+
"modelModifiers": {}
|
|
589
|
+
}),
|
|
590
|
+
emits: ["update:modelValue"],
|
|
591
|
+
setup(__props) {
|
|
592
|
+
const props = __props;
|
|
593
|
+
const modelValue = useModel(__props, "modelValue");
|
|
594
|
+
const triggerRef = ref();
|
|
595
|
+
const calendarRef = ref();
|
|
596
|
+
const { isOpen, dropdownStyle, toggle, close } = useDropdown(triggerRef, calendarRef, {
|
|
597
|
+
teleport: props.teleport,
|
|
598
|
+
gap: 4
|
|
599
|
+
});
|
|
600
|
+
const currentMonth = ref(modelValue.value ? new Date(modelValue.value) : /* @__PURE__ */ new Date());
|
|
601
|
+
const weekDays = computed(() => {
|
|
602
|
+
const days = [];
|
|
603
|
+
const formatter = new Intl.DateTimeFormat(props.locale, { weekday: "short" });
|
|
604
|
+
for (let i = 0; i < 7; i++) {
|
|
605
|
+
const date = new Date(2024, 0, i);
|
|
606
|
+
days.push(formatter.format(date));
|
|
607
|
+
}
|
|
608
|
+
return days;
|
|
609
|
+
});
|
|
610
|
+
const monthYear = computed(() => {
|
|
611
|
+
const formatter = new Intl.DateTimeFormat(props.locale, { month: "long", year: "numeric" });
|
|
612
|
+
return formatter.format(currentMonth.value);
|
|
613
|
+
});
|
|
614
|
+
const calendarDays = computed(() => {
|
|
615
|
+
const year = currentMonth.value.getFullYear();
|
|
616
|
+
const month = currentMonth.value.getMonth();
|
|
617
|
+
const firstDay = new Date(year, month, 1);
|
|
618
|
+
const lastDay = new Date(year, month + 1, 0);
|
|
619
|
+
const days = [];
|
|
620
|
+
let startDay = firstDay.getDay();
|
|
621
|
+
startDay = startDay === 0 ? 6 : startDay - 1;
|
|
622
|
+
for (let i = startDay - 1; i >= 0; i--) {
|
|
623
|
+
const date = new Date(year, month, -i);
|
|
624
|
+
days.push({
|
|
625
|
+
date,
|
|
626
|
+
isCurrentMonth: false,
|
|
627
|
+
isToday: false,
|
|
628
|
+
isSelected: false,
|
|
629
|
+
isDisabled: isDateDisabled(date)
|
|
630
|
+
});
|
|
631
|
+
}
|
|
632
|
+
const today = /* @__PURE__ */ new Date();
|
|
633
|
+
for (let i = 1; i <= lastDay.getDate(); i++) {
|
|
634
|
+
const date = new Date(year, month, i);
|
|
635
|
+
days.push({
|
|
636
|
+
date,
|
|
637
|
+
isCurrentMonth: true,
|
|
638
|
+
isToday: isSameDay(date, today),
|
|
639
|
+
isSelected: modelValue.value ? isSameDay(date, modelValue.value) : false,
|
|
640
|
+
isDisabled: isDateDisabled(date)
|
|
641
|
+
});
|
|
642
|
+
}
|
|
643
|
+
const remainingDays = 42 - days.length;
|
|
644
|
+
for (let i = 1; i <= remainingDays; i++) {
|
|
645
|
+
const date = new Date(year, month + 1, i);
|
|
646
|
+
days.push({
|
|
647
|
+
date,
|
|
648
|
+
isCurrentMonth: false,
|
|
649
|
+
isToday: false,
|
|
650
|
+
isSelected: false,
|
|
651
|
+
isDisabled: isDateDisabled(date)
|
|
652
|
+
});
|
|
653
|
+
}
|
|
654
|
+
return days;
|
|
655
|
+
});
|
|
656
|
+
const displayValue = computed(() => {
|
|
657
|
+
if (!modelValue.value) return "";
|
|
658
|
+
const formatter = new Intl.DateTimeFormat(props.locale, {
|
|
659
|
+
dateStyle: props.format
|
|
660
|
+
});
|
|
661
|
+
return formatter.format(modelValue.value);
|
|
662
|
+
});
|
|
663
|
+
const isSameDay = (a, b) => {
|
|
664
|
+
return a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate();
|
|
665
|
+
};
|
|
666
|
+
const isDateDisabled = (date) => {
|
|
667
|
+
if (props.minDate && date < props.minDate) return true;
|
|
668
|
+
if (props.maxDate && date > props.maxDate) return true;
|
|
669
|
+
return false;
|
|
670
|
+
};
|
|
671
|
+
const prevMonth = () => {
|
|
672
|
+
currentMonth.value = new Date(currentMonth.value.getFullYear(), currentMonth.value.getMonth() - 1, 1);
|
|
673
|
+
};
|
|
674
|
+
const nextMonth = () => {
|
|
675
|
+
currentMonth.value = new Date(currentMonth.value.getFullYear(), currentMonth.value.getMonth() + 1, 1);
|
|
676
|
+
};
|
|
677
|
+
const selectDate = (day) => {
|
|
678
|
+
if (day.isDisabled) return;
|
|
679
|
+
modelValue.value = day.date;
|
|
680
|
+
close();
|
|
681
|
+
};
|
|
682
|
+
const clear = () => {
|
|
683
|
+
modelValue.value = null;
|
|
684
|
+
};
|
|
685
|
+
return (_ctx, _cache) => {
|
|
686
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
687
|
+
createElementVNode("button", {
|
|
688
|
+
ref_key: "triggerRef",
|
|
689
|
+
ref: triggerRef,
|
|
690
|
+
type: "button",
|
|
691
|
+
disabled: __props.disabled,
|
|
692
|
+
class: normalizeClass([
|
|
693
|
+
"flex w-full items-center justify-between gap-2 rounded-md border px-3 py-2 text-sm text-left transition",
|
|
694
|
+
__props.disabled ? "cursor-not-allowed border-gray-200 bg-gray-50 text-gray-500 dark:border-gray-800 dark:bg-gray-950" : 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",
|
|
695
|
+
modelValue.value ? "text-gray-900 dark:text-white" : "text-gray-400 dark:text-gray-500"
|
|
696
|
+
]),
|
|
697
|
+
onClick: _cache[0] || (_cache[0] = //@ts-ignore
|
|
698
|
+
(...args) => unref(toggle) && unref(toggle)(...args))
|
|
699
|
+
}, [
|
|
700
|
+
createElementVNode("span", _hoisted_3, toDisplayString(displayValue.value || __props.placeholder), 1),
|
|
701
|
+
createElementVNode("div", _hoisted_4, [
|
|
702
|
+
modelValue.value ? (openBlock(), createElementBlock("button", {
|
|
703
|
+
key: 0,
|
|
704
|
+
type: "button",
|
|
705
|
+
class: "rounded p-0.5 hover:bg-gray-100 dark:hover:bg-gray-800",
|
|
706
|
+
onClick: withModifiers(clear, ["stop"])
|
|
707
|
+
}, [
|
|
708
|
+
createVNode(unref(Icon), {
|
|
709
|
+
icon: "lucide:x",
|
|
710
|
+
class: "size-4 text-gray-400"
|
|
711
|
+
})
|
|
712
|
+
])) : createCommentVNode("", true),
|
|
713
|
+
createVNode(unref(Icon), {
|
|
714
|
+
icon: "lucide:calendar",
|
|
715
|
+
class: "size-4 text-gray-400"
|
|
716
|
+
})
|
|
717
|
+
])
|
|
718
|
+
], 10, _hoisted_2),
|
|
719
|
+
(openBlock(), createBlock(Teleport, {
|
|
720
|
+
to: "body",
|
|
721
|
+
disabled: !__props.teleport
|
|
722
|
+
}, [
|
|
723
|
+
createVNode(Transition, {
|
|
724
|
+
"enter-active-class": "transition duration-100 ease-out",
|
|
725
|
+
"enter-from-class": "opacity-0 scale-95",
|
|
726
|
+
"enter-to-class": "opacity-100 scale-100",
|
|
727
|
+
"leave-active-class": "transition duration-75 ease-in",
|
|
728
|
+
"leave-from-class": "opacity-100 scale-100",
|
|
729
|
+
"leave-to-class": "opacity-0 scale-95"
|
|
730
|
+
}, {
|
|
731
|
+
default: withCtx(() => [
|
|
732
|
+
unref(isOpen) ? (openBlock(), createElementBlock("div", {
|
|
733
|
+
key: 0,
|
|
734
|
+
ref_key: "calendarRef",
|
|
735
|
+
ref: calendarRef,
|
|
736
|
+
style: normalizeStyle(unref(dropdownStyle)),
|
|
737
|
+
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"
|
|
738
|
+
}, [
|
|
739
|
+
createElementVNode("div", _hoisted_5, [
|
|
740
|
+
createElementVNode("button", {
|
|
741
|
+
type: "button",
|
|
742
|
+
class: "rounded p-1 hover:bg-gray-100 dark:hover:bg-gray-700",
|
|
743
|
+
onClick: prevMonth
|
|
744
|
+
}, [
|
|
745
|
+
createVNode(unref(Icon), {
|
|
746
|
+
icon: "lucide:chevron-left",
|
|
747
|
+
class: "size-5 text-gray-600 dark:text-gray-400"
|
|
748
|
+
})
|
|
749
|
+
]),
|
|
750
|
+
createElementVNode("span", _hoisted_6, toDisplayString(monthYear.value), 1),
|
|
751
|
+
createElementVNode("button", {
|
|
752
|
+
type: "button",
|
|
753
|
+
class: "rounded p-1 hover:bg-gray-100 dark:hover:bg-gray-700",
|
|
754
|
+
onClick: nextMonth
|
|
755
|
+
}, [
|
|
756
|
+
createVNode(unref(Icon), {
|
|
757
|
+
icon: "lucide:chevron-right",
|
|
758
|
+
class: "size-5 text-gray-600 dark:text-gray-400"
|
|
759
|
+
})
|
|
760
|
+
])
|
|
761
|
+
]),
|
|
762
|
+
createElementVNode("div", _hoisted_7, [
|
|
763
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(weekDays.value, (day) => {
|
|
764
|
+
return openBlock(), createElementBlock("div", {
|
|
765
|
+
key: day,
|
|
766
|
+
class: "text-center text-xs font-medium text-gray-500 dark:text-gray-400"
|
|
767
|
+
}, toDisplayString(day), 1);
|
|
768
|
+
}), 128))
|
|
769
|
+
]),
|
|
770
|
+
createElementVNode("div", _hoisted_8, [
|
|
771
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(calendarDays.value, (day, index) => {
|
|
772
|
+
return openBlock(), createElementBlock("button", {
|
|
773
|
+
key: index,
|
|
774
|
+
type: "button",
|
|
775
|
+
disabled: day.isDisabled,
|
|
776
|
+
class: normalizeClass([
|
|
777
|
+
"h-8 w-8 rounded text-sm transition",
|
|
778
|
+
day.isDisabled && "cursor-not-allowed opacity-30",
|
|
779
|
+
!day.isCurrentMonth && "text-gray-400 dark:text-gray-600",
|
|
780
|
+
day.isCurrentMonth && !day.isSelected && !day.isToday && "text-gray-900 hover:bg-gray-100 dark:text-white dark:hover:bg-gray-700",
|
|
781
|
+
day.isToday && !day.isSelected && "bg-gray-100 font-semibold text-gray-900 dark:bg-gray-700 dark:text-white",
|
|
782
|
+
day.isSelected && "bg-primary text-white font-semibold"
|
|
783
|
+
]),
|
|
784
|
+
onClick: ($event) => selectDate(day)
|
|
785
|
+
}, toDisplayString(day.date.getDate()), 11, _hoisted_9);
|
|
786
|
+
}), 128))
|
|
787
|
+
]),
|
|
788
|
+
createElementVNode("div", _hoisted_10, [
|
|
789
|
+
createElementVNode("button", {
|
|
790
|
+
type: "button",
|
|
791
|
+
class: "w-full rounded py-1.5 text-sm font-medium text-primary hover:bg-primary/10",
|
|
792
|
+
onClick: _cache[1] || (_cache[1] = ($event) => selectDate({ date: /* @__PURE__ */ new Date(), isDisabled: false }))
|
|
793
|
+
}, " Today ")
|
|
794
|
+
])
|
|
795
|
+
], 4)) : createCommentVNode("", true)
|
|
796
|
+
]),
|
|
797
|
+
_: 1
|
|
798
|
+
})
|
|
799
|
+
], 8, ["disabled"]))
|
|
800
|
+
]);
|
|
801
|
+
};
|
|
802
|
+
}
|
|
803
|
+
});
|
|
494
804
|
export {
|
|
495
|
-
|
|
496
|
-
_sfc_main$
|
|
497
|
-
_sfc_main$
|
|
498
|
-
_sfc_main$
|
|
499
|
-
_sfc_main$
|
|
500
|
-
_sfc_main$
|
|
501
|
-
_sfc_main as
|
|
805
|
+
Slider as S,
|
|
806
|
+
_sfc_main$8 as _,
|
|
807
|
+
_sfc_main$7 as a,
|
|
808
|
+
_sfc_main$6 as b,
|
|
809
|
+
_sfc_main$5 as c,
|
|
810
|
+
_sfc_main$4 as d,
|
|
811
|
+
_sfc_main$3 as e,
|
|
812
|
+
_sfc_main$2 as f,
|
|
813
|
+
_sfc_main as g
|
|
502
814
|
};
|
|
503
|
-
//# sourceMappingURL=
|
|
815
|
+
//# sourceMappingURL=DatePicker.vue_vue_type_script_setup_true_lang-DgGJ5-8v.js.map
|