cisse-vue-ui 0.5.17 → 0.5.22
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 -666
- package/dist/Button.vue_vue_type_script_setup_true_lang-DKE8elsf.js +236 -0
- package/dist/Button.vue_vue_type_script_setup_true_lang-DKE8elsf.js.map +1 -0
- package/dist/Button.vue_vue_type_script_setup_true_lang-DrGM65ny.cjs +235 -0
- package/dist/Button.vue_vue_type_script_setup_true_lang-DrGM65ny.cjs.map +1 -0
- package/dist/{RangeSlider.vue_vue_type_script_setup_true_lang-y3zIxWfI.js → Combobox.vue_vue_type_script_setup_true_lang-DhcLb6DX.js} +408 -185
- package/dist/Combobox.vue_vue_type_script_setup_true_lang-DhcLb6DX.js.map +1 -0
- package/dist/{RangeSlider.vue_vue_type_script_setup_true_lang-Cv1OwT9S.cjs → Combobox.vue_vue_type_script_setup_true_lang-FdUrjmSG.cjs} +435 -212
- package/dist/Combobox.vue_vue_type_script_setup_true_lang-FdUrjmSG.cjs.map +1 -0
- package/dist/{ListSkeleton.vue_vue_type_script_setup_true_lang-Bech-H58.js → ConfirmDialog.vue_vue_type_script_setup_true_lang-CNucAMQg.js} +226 -248
- package/dist/ConfirmDialog.vue_vue_type_script_setup_true_lang-CNucAMQg.js.map +1 -0
- package/dist/{ListSkeleton.vue_vue_type_script_setup_true_lang-CHoagJ0-.cjs → ConfirmDialog.vue_vue_type_script_setup_true_lang-DXb9wQQv.cjs} +225 -247
- package/dist/ConfirmDialog.vue_vue_type_script_setup_true_lang-DXb9wQQv.cjs.map +1 -0
- package/dist/{Timeline.vue_vue_type_script_setup_true_lang-CuPF4MPe.js → DarkModeToggle.vue_vue_type_script_setup_true_lang-43fxlbro.js} +209 -415
- package/dist/DarkModeToggle.vue_vue_type_script_setup_true_lang-43fxlbro.js.map +1 -0
- package/dist/{Timeline.vue_vue_type_script_setup_true_lang-CqeiZOID.cjs → DarkModeToggle.vue_vue_type_script_setup_true_lang-BoB48313.cjs} +234 -440
- package/dist/DarkModeToggle.vue_vue_type_script_setup_true_lang-BoB48313.cjs.map +1 -0
- package/dist/Dropdown.vue_vue_type_script_setup_true_lang-C3pr8BwC.js.map +1 -1
- package/dist/Dropdown.vue_vue_type_script_setup_true_lang-DKxcVBKu.cjs.map +1 -1
- package/dist/PageLayout.vue_vue_type_script_setup_true_lang-D22uNeS1.cjs.map +1 -1
- package/dist/PageLayout.vue_vue_type_script_setup_true_lang-kT7np2ir.js.map +1 -1
- package/dist/cisse-vue-ui.css +51 -51
- package/dist/components/core/AccordionItem.stories.d.ts +10 -0
- package/dist/components/core/Avatar.vue.d.ts +1 -1
- package/dist/components/core/Button.vue.d.ts +1 -1
- package/dist/components/core/CardComponent.stories.d.ts +3 -0
- package/dist/components/core/CardComponent.vue.d.ts +15 -2
- 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/MobileList.stories.d.ts +13 -0
- package/dist/components/core/MobileList.vue.d.ts +6 -0
- package/dist/components/core/ResponsiveList.stories.d.ts +15 -0
- package/dist/components/core/ResponsiveList.vue.d.ts +6 -0
- package/dist/components/core/TabPanel.stories.d.ts +8 -0
- package/dist/components/core/TableAction.stories.d.ts +14 -0
- package/dist/components/core/TableComponent.stories.d.ts +2 -0
- package/dist/components/core/TableComponent.vue.d.ts +6 -0
- package/dist/components/core/index.cjs +22 -20
- package/dist/components/core/index.cjs.map +1 -1
- package/dist/components/core/index.d.ts +2 -0
- package/dist/components/core/index.js +16 -14
- package/dist/components/core/index.js.map +1 -1
- package/dist/components/feedback/CardSkeleton.stories.d.ts +11 -0
- package/dist/components/feedback/CardSkeleton.test.d.ts +1 -0
- package/dist/components/feedback/CardSkeleton.vue.d.ts +1 -1
- 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/ListSkeleton.stories.d.ts +12 -0
- package/dist/components/feedback/ListSkeleton.test.d.ts +1 -0
- package/dist/components/feedback/ListSkeleton.vue.d.ts +1 -1
- package/dist/components/feedback/Modal.vue.d.ts +11 -2
- package/dist/components/feedback/NotificationComponent.stories.d.ts +14 -0
- package/dist/components/feedback/NotificationList.stories.d.ts +11 -0
- package/dist/components/feedback/Progress.vue.d.ts +1 -1
- package/dist/components/feedback/Skeleton.vue.d.ts +1 -1
- package/dist/components/feedback/TableSkeleton.stories.d.ts +12 -0
- package/dist/components/feedback/TableSkeleton.test.d.ts +1 -0
- package/dist/components/feedback/TableSkeleton.vue.d.ts +1 -1
- package/dist/components/feedback/ToastContainer.stories.d.ts +15 -0
- package/dist/components/feedback/index.cjs +17 -15
- 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 -4
- package/dist/components/feedback/index.js.map +1 -1
- 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/FileUpload.vue.d.ts +1 -1
- package/dist/components/form/FormHelp.stories.d.ts +11 -0
- package/dist/components/form/FormLabel.stories.d.ts +12 -0
- package/dist/components/form/FormSelect.stories.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/index.cjs +55 -51
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.js +36 -32
- package/dist/components/index.js.map +1 -1
- package/dist/composables/index.cjs +3 -2
- package/dist/composables/index.cjs.map +1 -1
- package/dist/composables/index.js +9 -8
- package/dist/composables/index.js.map +1 -1
- package/dist/index-D7HVSFi2.cjs +337 -0
- package/dist/index-D7HVSFi2.cjs.map +1 -0
- package/dist/index-DZYqrXV0.js +75 -0
- package/dist/index-DZYqrXV0.js.map +1 -0
- package/dist/index-Dghdw1yo.js +338 -0
- package/dist/index-Dghdw1yo.js.map +1 -0
- package/dist/index-DjEv91o4.cjs +74 -0
- package/dist/index-DjEv91o4.cjs.map +1 -0
- package/dist/index.cjs +59 -54
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +46 -41
- package/dist/index.js.map +1 -1
- package/dist/style.css +1 -1
- 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/useDropdown-DHFnd259.cjs.map +1 -1
- package/dist/useDropdown-iVu14E6s.js.map +1 -1
- 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 +168 -168
- 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/ListSkeleton.vue_vue_type_script_setup_true_lang-Bech-H58.js.map +0 -1
- package/dist/ListSkeleton.vue_vue_type_script_setup_true_lang-CHoagJ0-.cjs.map +0 -1
- package/dist/RangeSlider.vue_vue_type_script_setup_true_lang-Cv1OwT9S.cjs.map +0 -1
- package/dist/RangeSlider.vue_vue_type_script_setup_true_lang-y3zIxWfI.js.map +0 -1
- package/dist/Timeline.vue_vue_type_script_setup_true_lang-CqeiZOID.cjs.map +0 -1
- package/dist/Timeline.vue_vue_type_script_setup_true_lang-CuPF4MPe.js.map +0 -1
- package/dist/index-5Ru0o5KY.js +0 -71
- package/dist/index-5Ru0o5KY.js.map +0 -1
- package/dist/index-CnDEGRt-.cjs +0 -70
- package/dist/index-CnDEGRt-.cjs.map +0 -1
- package/dist/useToast-CRh_sG82.cjs.map +0 -1
- package/dist/useToast-DwFOkewC.js.map +0 -1
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
import { defineComponent, computed, createElementBlock, openBlock, createCommentVNode, renderSlot, normalizeClass, createElementVNode, createTextVNode, toDisplayString, useSlots, createVNode, Fragment, renderList,
|
|
2
|
-
import { _ as _sfc_main$
|
|
3
|
-
import {
|
|
1
|
+
import { defineComponent, computed, createBlock, createElementBlock, openBlock, createCommentVNode, renderSlot, normalizeClass, createElementVNode, createTextVNode, toDisplayString, useSlots, createVNode, Fragment, renderList, resolveDynamicComponent, withCtx, createSlots, ref, watch, unref, withDirectives, vModelText, withModifiers, Teleport, Transition, normalizeStyle, nextTick, resolveComponent, mergeProps, provide, inject, vShow, onMounted, onUnmounted } from "vue";
|
|
2
|
+
import { _ as _sfc_main$l, u as useBreakpoints } from "./index-Dghdw1yo.js";
|
|
3
|
+
import { b as _sfc_main$j, a as _sfc_main$k, c as _sfc_main$r } from "./Button.vue_vue_type_script_setup_true_lang-DKE8elsf.js";
|
|
4
|
+
import { e as _sfc_main$m, d as _sfc_main$n, c as _sfc_main$o, b as _sfc_main$p, a as _sfc_main$q } from "./BadgeType.vue_vue_type_script_setup_true_lang-CnB5eNEM.js";
|
|
4
5
|
import { Icon } from "@iconify/vue";
|
|
5
6
|
import { u as useDropdown } from "./useDropdown-iVu14E6s.js";
|
|
6
|
-
|
|
7
|
-
const
|
|
7
|
+
import { u as useDarkMode } from "./useDarkMode-Cl5QWTlC.js";
|
|
8
|
+
const _hoisted_1$d = {
|
|
9
|
+
key: 1,
|
|
10
|
+
class: "flex flex-col overflow-hidden rounded-lg bg-white shadow-md dark:bg-slate-950"
|
|
11
|
+
};
|
|
12
|
+
const _hoisted_2$a = { class: "flex flex-col gap-0.5" };
|
|
8
13
|
const _hoisted_3$7 = {
|
|
9
14
|
key: 1,
|
|
10
15
|
class: "text-sm font-normal text-gray-600 dark:text-gray-400"
|
|
@@ -16,7 +21,11 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
16
21
|
title: {},
|
|
17
22
|
description: {},
|
|
18
23
|
titleClass: {},
|
|
19
|
-
dividerClass: {}
|
|
24
|
+
dividerClass: {},
|
|
25
|
+
loading: { type: Boolean, default: false },
|
|
26
|
+
loadingLines: { default: 3 },
|
|
27
|
+
loadingAvatar: { type: Boolean, default: false },
|
|
28
|
+
loadingActions: { type: Boolean, default: false }
|
|
20
29
|
},
|
|
21
30
|
setup(__props) {
|
|
22
31
|
const props = __props;
|
|
@@ -27,7 +36,12 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
27
36
|
() => props.dividerClass || "border-gray-200 dark:border-gray-700"
|
|
28
37
|
);
|
|
29
38
|
return (_ctx, _cache) => {
|
|
30
|
-
return openBlock(),
|
|
39
|
+
return __props.loading ? (openBlock(), createBlock(_sfc_main$j, {
|
|
40
|
+
key: 0,
|
|
41
|
+
lines: __props.loadingLines,
|
|
42
|
+
"show-avatar": __props.loadingAvatar,
|
|
43
|
+
"show-actions": __props.loadingActions
|
|
44
|
+
}, null, 8, ["lines", "show-avatar", "show-actions"])) : (openBlock(), createElementBlock("div", _hoisted_1$d, [
|
|
31
45
|
_ctx.$slots.header ? (openBlock(), createElementBlock("div", {
|
|
32
46
|
key: 0,
|
|
33
47
|
class: normalizeClass(["border-b", dividerClasses.value])
|
|
@@ -37,7 +51,7 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
37
51
|
key: 1,
|
|
38
52
|
class: normalizeClass(["flex items-center justify-between border-b px-5 py-3", dividerClasses.value])
|
|
39
53
|
}, [
|
|
40
|
-
createElementVNode("div", _hoisted_2$
|
|
54
|
+
createElementVNode("div", _hoisted_2$a, [
|
|
41
55
|
__props.title || _ctx.$slots.title ? (openBlock(), createElementBlock("span", {
|
|
42
56
|
key: 0,
|
|
43
57
|
class: normalizeClass(["text-md font-semibold", titleClasses.value])
|
|
@@ -57,12 +71,15 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
57
71
|
])
|
|
58
72
|
], 2)) : createCommentVNode("", true),
|
|
59
73
|
renderSlot(_ctx.$slots, "default")
|
|
60
|
-
]);
|
|
74
|
+
]));
|
|
61
75
|
};
|
|
62
76
|
}
|
|
63
77
|
});
|
|
64
|
-
const _hoisted_1$
|
|
65
|
-
const _hoisted_2$
|
|
78
|
+
const _hoisted_1$c = { class: "overflow-hidden" };
|
|
79
|
+
const _hoisted_2$9 = {
|
|
80
|
+
key: 1,
|
|
81
|
+
class: "overflow-x-auto"
|
|
82
|
+
};
|
|
66
83
|
const _hoisted_3$6 = { class: "w-full divide-y divide-black/10 text-left dark:divide-white/10" };
|
|
67
84
|
const _hoisted_4$5 = { class: "bg-black/5 text-sm font-semibold text-gray-600 uppercase dark:bg-white/5 dark:text-gray-400" };
|
|
68
85
|
const _hoisted_5$3 = {
|
|
@@ -102,7 +119,9 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
|
102
119
|
selectableFilter: {},
|
|
103
120
|
keyField: { default: "id" },
|
|
104
121
|
sortBy: {},
|
|
105
|
-
sortDirection: {}
|
|
122
|
+
sortDirection: {},
|
|
123
|
+
loading: { type: Boolean, default: false },
|
|
124
|
+
loadingRows: { default: 5 }
|
|
106
125
|
},
|
|
107
126
|
emits: ["select", "selectAll", "sort"],
|
|
108
127
|
setup(__props, { emit: __emit }) {
|
|
@@ -110,14 +129,14 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
|
110
129
|
const props = __props;
|
|
111
130
|
const emit = __emit;
|
|
112
131
|
const typeComponents = {
|
|
113
|
-
text: _sfc_main$
|
|
114
|
-
number: _sfc_main$
|
|
115
|
-
date: _sfc_main$
|
|
116
|
-
boolean: _sfc_main$
|
|
117
|
-
badge: _sfc_main$
|
|
132
|
+
text: _sfc_main$q,
|
|
133
|
+
number: _sfc_main$p,
|
|
134
|
+
date: _sfc_main$o,
|
|
135
|
+
boolean: _sfc_main$n,
|
|
136
|
+
badge: _sfc_main$m
|
|
118
137
|
};
|
|
119
138
|
const getTypeComponent = (type = "text") => {
|
|
120
|
-
return typeComponents[type] || _sfc_main$
|
|
139
|
+
return typeComponents[type] || _sfc_main$q;
|
|
121
140
|
};
|
|
122
141
|
const visibleProperties = computed(() => props.properties.filter((p) => !p.hidden));
|
|
123
142
|
const getKey = (item) => {
|
|
@@ -191,13 +210,17 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
|
191
210
|
return props.sortBy === property.name;
|
|
192
211
|
};
|
|
193
212
|
return (_ctx, _cache) => {
|
|
194
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
195
|
-
|
|
213
|
+
return openBlock(), createElementBlock("div", _hoisted_1$c, [
|
|
214
|
+
__props.loading ? (openBlock(), createBlock(_sfc_main$k, {
|
|
215
|
+
key: 0,
|
|
216
|
+
rows: __props.loadingRows,
|
|
217
|
+
columns: visibleProperties.value.length
|
|
218
|
+
}, null, 8, ["rows", "columns"])) : (openBlock(), createElementBlock("div", _hoisted_2$9, [
|
|
196
219
|
createElementVNode("table", _hoisted_3$6, [
|
|
197
220
|
createElementVNode("thead", _hoisted_4$5, [
|
|
198
221
|
createElementVNode("tr", null, [
|
|
199
222
|
__props.selectable ? (openBlock(), createElementBlock("th", _hoisted_5$3, [
|
|
200
|
-
createVNode(_sfc_main$
|
|
223
|
+
createVNode(_sfc_main$l, {
|
|
201
224
|
"model-value": allSelected.value,
|
|
202
225
|
indeterminate: someSelected.value,
|
|
203
226
|
disabled: selectableItems.value.length === 0,
|
|
@@ -256,7 +279,7 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
|
256
279
|
class: normalizeClass(["hover:bg-black/5 dark:hover:bg-white/5 transition-colors", { "bg-primary/5 dark:bg-primary/10": isSelected(item) }])
|
|
257
280
|
}, [
|
|
258
281
|
__props.selectable ? (openBlock(), createElementBlock("td", _hoisted_11$1, [
|
|
259
|
-
isSelectable(item) ? (openBlock(), createBlock(_sfc_main$
|
|
282
|
+
isSelectable(item) ? (openBlock(), createBlock(_sfc_main$l, {
|
|
260
283
|
key: 0,
|
|
261
284
|
"model-value": isSelected(item),
|
|
262
285
|
"onUpdate:modelValue": ($event) => handleSelect(item)
|
|
@@ -289,17 +312,17 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
|
289
312
|
], 2);
|
|
290
313
|
}), 128))
|
|
291
314
|
])
|
|
292
|
-
])
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
]))
|
|
315
|
+
]),
|
|
316
|
+
!__props.items || __props.items.length === 0 ? (openBlock(), createElementBlock("div", _hoisted_13, [
|
|
317
|
+
renderSlot(_ctx.$slots, "empty")
|
|
318
|
+
])) : createCommentVNode("", true)
|
|
319
|
+
]))
|
|
297
320
|
]);
|
|
298
321
|
};
|
|
299
322
|
}
|
|
300
323
|
});
|
|
301
|
-
const _hoisted_1$
|
|
302
|
-
const _hoisted_2$
|
|
324
|
+
const _hoisted_1$b = { class: "space-y-3" };
|
|
325
|
+
const _hoisted_2$8 = { class: "flex items-center gap-3 p-3" };
|
|
303
326
|
const _hoisted_3$5 = { class: "text-sm text-gray-600 dark:text-gray-400" };
|
|
304
327
|
const _hoisted_4$4 = {
|
|
305
328
|
key: 0,
|
|
@@ -324,7 +347,9 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
324
347
|
keyField: { default: "id" },
|
|
325
348
|
selectable: { type: Boolean, default: false },
|
|
326
349
|
selectedItems: {},
|
|
327
|
-
selectableFilter: {}
|
|
350
|
+
selectableFilter: {},
|
|
351
|
+
loading: { type: Boolean, default: false },
|
|
352
|
+
loadingItems: { default: 5 }
|
|
328
353
|
},
|
|
329
354
|
emits: ["select", "selectAll"],
|
|
330
355
|
setup(__props, { emit: __emit }) {
|
|
@@ -364,257 +389,68 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
364
389
|
};
|
|
365
390
|
const hasEmptySlot = computed(() => !!slots.empty);
|
|
366
391
|
return (_ctx, _cache) => {
|
|
367
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
368
|
-
__props.
|
|
392
|
+
return openBlock(), createElementBlock("div", _hoisted_1$b, [
|
|
393
|
+
__props.loading ? (openBlock(), createBlock(_sfc_main$i, { key: 0 }, {
|
|
369
394
|
default: withCtx(() => [
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
createElementVNode("span", _hoisted_3$5, toDisplayString(allSelected.value ? "Tout désélectionner" : "Tout sélectionner"), 1),
|
|
377
|
-
__props.selectedItems && __props.selectedItems.size > 0 ? (openBlock(), createElementBlock("span", _hoisted_4$4, " (" + toDisplayString(__props.selectedItems.size) + " sélectionné" + toDisplayString(__props.selectedItems.size > 1 ? "s" : "") + ") ", 1)) : createCommentVNode("", true)
|
|
378
|
-
])
|
|
395
|
+
createVNode(_sfc_main$r, {
|
|
396
|
+
items: __props.loadingItems,
|
|
397
|
+
"show-avatar": "",
|
|
398
|
+
"show-secondary": "",
|
|
399
|
+
"show-action": ""
|
|
400
|
+
}, null, 8, ["items"])
|
|
379
401
|
]),
|
|
380
402
|
_: 1
|
|
381
|
-
})) :
|
|
382
|
-
|
|
383
|
-
return openBlock(), createBlock(_sfc_main$i, {
|
|
384
|
-
key: getKey(item),
|
|
385
|
-
class: normalizeClass(["hover:shadow-lg transition-all duration-200", {
|
|
386
|
-
"ring-2 ring-primary": isSelected(item)
|
|
387
|
-
}])
|
|
388
|
-
}, {
|
|
403
|
+
})) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
404
|
+
__props.selectable && selectableItems.value.length > 0 ? (openBlock(), createBlock(_sfc_main$i, { key: 0 }, {
|
|
389
405
|
default: withCtx(() => [
|
|
390
|
-
createElementVNode("div",
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
renderSlot(_ctx.$slots, "avatar", { item }),
|
|
399
|
-
createElementVNode("div", _hoisted_8$2, [
|
|
400
|
-
renderSlot(_ctx.$slots, "content", { item })
|
|
401
|
-
]),
|
|
402
|
-
createElementVNode("div", _hoisted_9$2, [
|
|
403
|
-
renderSlot(_ctx.$slots, "actions", { item })
|
|
404
|
-
])
|
|
406
|
+
createElementVNode("div", _hoisted_2$8, [
|
|
407
|
+
createVNode(_sfc_main$l, {
|
|
408
|
+
"model-value": allSelected.value,
|
|
409
|
+
indeterminate: someSelected.value,
|
|
410
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => emit("selectAll"))
|
|
411
|
+
}, null, 8, ["model-value", "indeterminate"]),
|
|
412
|
+
createElementVNode("span", _hoisted_3$5, toDisplayString(allSelected.value ? "Tout désélectionner" : "Tout sélectionner"), 1),
|
|
413
|
+
__props.selectedItems && __props.selectedItems.size > 0 ? (openBlock(), createElementBlock("span", _hoisted_4$4, " (" + toDisplayString(__props.selectedItems.size) + " sélectionné" + toDisplayString(__props.selectedItems.size > 1 ? "s" : "") + ") ", 1)) : createCommentVNode("", true)
|
|
405
414
|
])
|
|
406
415
|
]),
|
|
407
|
-
_:
|
|
408
|
-
}
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
416
|
+
_: 1
|
|
417
|
+
})) : createCommentVNode("", true),
|
|
418
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.items, (item) => {
|
|
419
|
+
return openBlock(), createBlock(_sfc_main$i, {
|
|
420
|
+
key: getKey(item),
|
|
421
|
+
class: normalizeClass(["hover:shadow-lg transition-all duration-200", {
|
|
422
|
+
"ring-2 ring-primary": isSelected(item)
|
|
423
|
+
}])
|
|
424
|
+
}, {
|
|
425
|
+
default: withCtx(() => [
|
|
426
|
+
createElementVNode("div", _hoisted_5$2, [
|
|
427
|
+
__props.selectable ? (openBlock(), createElementBlock("div", _hoisted_6$2, [
|
|
428
|
+
isSelectable(item) ? (openBlock(), createBlock(_sfc_main$l, {
|
|
429
|
+
key: 0,
|
|
430
|
+
"model-value": isSelected(item),
|
|
431
|
+
"onUpdate:modelValue": ($event) => handleSelect(item)
|
|
432
|
+
}, null, 8, ["model-value", "onUpdate:modelValue"])) : (openBlock(), createElementBlock("div", _hoisted_7$2))
|
|
433
|
+
])) : createCommentVNode("", true),
|
|
434
|
+
renderSlot(_ctx.$slots, "avatar", { item }),
|
|
435
|
+
createElementVNode("div", _hoisted_8$2, [
|
|
436
|
+
renderSlot(_ctx.$slots, "content", { item })
|
|
437
|
+
]),
|
|
438
|
+
createElementVNode("div", _hoisted_9$2, [
|
|
439
|
+
renderSlot(_ctx.$slots, "actions", { item })
|
|
440
|
+
])
|
|
441
|
+
])
|
|
442
|
+
]),
|
|
443
|
+
_: 2
|
|
444
|
+
}, 1032, ["class"]);
|
|
445
|
+
}), 128)),
|
|
446
|
+
__props.items.length === 0 && hasEmptySlot.value ? (openBlock(), createElementBlock("div", _hoisted_10$1, [
|
|
447
|
+
renderSlot(_ctx.$slots, "empty")
|
|
448
|
+
])) : createCommentVNode("", true)
|
|
449
|
+
], 64))
|
|
413
450
|
]);
|
|
414
451
|
};
|
|
415
452
|
}
|
|
416
453
|
});
|
|
417
|
-
const localProvidedStateMap = /* @__PURE__ */ new WeakMap();
|
|
418
|
-
const injectLocal = /* @__NO_SIDE_EFFECTS__ */ (...args) => {
|
|
419
|
-
var _getCurrentInstance;
|
|
420
|
-
const key = args[0];
|
|
421
|
-
const instance = (_getCurrentInstance = getCurrentInstance()) === null || _getCurrentInstance === void 0 ? void 0 : _getCurrentInstance.proxy;
|
|
422
|
-
const owner = instance !== null && instance !== void 0 ? instance : getCurrentScope();
|
|
423
|
-
if (owner == null && !hasInjectionContext()) throw new Error("injectLocal must be called in setup");
|
|
424
|
-
if (owner && localProvidedStateMap.has(owner) && key in localProvidedStateMap.get(owner)) return localProvidedStateMap.get(owner)[key];
|
|
425
|
-
return inject(...args);
|
|
426
|
-
};
|
|
427
|
-
const isClient = typeof window !== "undefined" && typeof document !== "undefined";
|
|
428
|
-
typeof WorkerGlobalScope !== "undefined" && globalThis instanceof WorkerGlobalScope;
|
|
429
|
-
const toString = Object.prototype.toString;
|
|
430
|
-
const isObject = (val) => toString.call(val) === "[object Object]";
|
|
431
|
-
function increaseWithUnit(target, delta) {
|
|
432
|
-
var _target$match;
|
|
433
|
-
if (typeof target === "number") return target + delta;
|
|
434
|
-
const value = ((_target$match = target.match(/^-?\d+\.?\d*/)) === null || _target$match === void 0 ? void 0 : _target$match[0]) || "";
|
|
435
|
-
const unit = target.slice(value.length);
|
|
436
|
-
const result = Number.parseFloat(value) + delta;
|
|
437
|
-
if (Number.isNaN(result)) return target;
|
|
438
|
-
return result + unit;
|
|
439
|
-
}
|
|
440
|
-
function pxValue(px) {
|
|
441
|
-
return px.endsWith("rem") ? Number.parseFloat(px) * 16 : Number.parseFloat(px);
|
|
442
|
-
}
|
|
443
|
-
function toArray(value) {
|
|
444
|
-
return Array.isArray(value) ? value : [value];
|
|
445
|
-
}
|
|
446
|
-
function getLifeCycleTarget(target) {
|
|
447
|
-
return getCurrentInstance();
|
|
448
|
-
}
|
|
449
|
-
function tryOnMounted(fn, sync = true, target) {
|
|
450
|
-
if (getLifeCycleTarget()) onMounted(fn, target);
|
|
451
|
-
else if (sync) fn();
|
|
452
|
-
else nextTick(fn);
|
|
453
|
-
}
|
|
454
|
-
function watchImmediate(source, cb, options) {
|
|
455
|
-
return watch(source, cb, {
|
|
456
|
-
...options,
|
|
457
|
-
immediate: true
|
|
458
|
-
});
|
|
459
|
-
}
|
|
460
|
-
const defaultWindow = isClient ? window : void 0;
|
|
461
|
-
function unrefElement(elRef) {
|
|
462
|
-
var _$el;
|
|
463
|
-
const plain = toValue(elRef);
|
|
464
|
-
return (_$el = plain === null || plain === void 0 ? void 0 : plain.$el) !== null && _$el !== void 0 ? _$el : plain;
|
|
465
|
-
}
|
|
466
|
-
function useEventListener(...args) {
|
|
467
|
-
const register = (el, event, listener, options) => {
|
|
468
|
-
el.addEventListener(event, listener, options);
|
|
469
|
-
return () => el.removeEventListener(event, listener, options);
|
|
470
|
-
};
|
|
471
|
-
const firstParamTargets = computed(() => {
|
|
472
|
-
const test = toArray(toValue(args[0])).filter((e) => e != null);
|
|
473
|
-
return test.every((e) => typeof e !== "string") ? test : void 0;
|
|
474
|
-
});
|
|
475
|
-
return watchImmediate(() => {
|
|
476
|
-
var _firstParamTargets$va, _firstParamTargets$va2;
|
|
477
|
-
return [
|
|
478
|
-
(_firstParamTargets$va = (_firstParamTargets$va2 = firstParamTargets.value) === null || _firstParamTargets$va2 === void 0 ? void 0 : _firstParamTargets$va2.map((e) => unrefElement(e))) !== null && _firstParamTargets$va !== void 0 ? _firstParamTargets$va : [defaultWindow].filter((e) => e != null),
|
|
479
|
-
toArray(toValue(firstParamTargets.value ? args[1] : args[0])),
|
|
480
|
-
toArray(unref(firstParamTargets.value ? args[2] : args[1])),
|
|
481
|
-
toValue(firstParamTargets.value ? args[3] : args[2])
|
|
482
|
-
];
|
|
483
|
-
}, ([raw_targets, raw_events, raw_listeners, raw_options], _, onCleanup) => {
|
|
484
|
-
if (!(raw_targets === null || raw_targets === void 0 ? void 0 : raw_targets.length) || !(raw_events === null || raw_events === void 0 ? void 0 : raw_events.length) || !(raw_listeners === null || raw_listeners === void 0 ? void 0 : raw_listeners.length)) return;
|
|
485
|
-
const optionsClone = isObject(raw_options) ? { ...raw_options } : raw_options;
|
|
486
|
-
const cleanups = raw_targets.flatMap((el) => raw_events.flatMap((event) => raw_listeners.map((listener) => register(el, event, listener, optionsClone))));
|
|
487
|
-
onCleanup(() => {
|
|
488
|
-
cleanups.forEach((fn) => fn());
|
|
489
|
-
});
|
|
490
|
-
}, { flush: "post" });
|
|
491
|
-
}
|
|
492
|
-
// @__NO_SIDE_EFFECTS__
|
|
493
|
-
function useMounted() {
|
|
494
|
-
const isMounted = shallowRef(false);
|
|
495
|
-
const instance = getCurrentInstance();
|
|
496
|
-
if (instance) onMounted(() => {
|
|
497
|
-
isMounted.value = true;
|
|
498
|
-
}, instance);
|
|
499
|
-
return isMounted;
|
|
500
|
-
}
|
|
501
|
-
// @__NO_SIDE_EFFECTS__
|
|
502
|
-
function useSupported(callback) {
|
|
503
|
-
const isMounted = /* @__PURE__ */ useMounted();
|
|
504
|
-
return computed(() => {
|
|
505
|
-
isMounted.value;
|
|
506
|
-
return Boolean(callback());
|
|
507
|
-
});
|
|
508
|
-
}
|
|
509
|
-
const ssrWidthSymbol = Symbol("vueuse-ssr-width");
|
|
510
|
-
// @__NO_SIDE_EFFECTS__
|
|
511
|
-
function useSSRWidth() {
|
|
512
|
-
const ssrWidth = hasInjectionContext() ? /* @__PURE__ */ injectLocal(ssrWidthSymbol, null) : null;
|
|
513
|
-
return typeof ssrWidth === "number" ? ssrWidth : void 0;
|
|
514
|
-
}
|
|
515
|
-
function useMediaQuery(query, options = {}) {
|
|
516
|
-
const { window: window$1 = defaultWindow, ssrWidth = /* @__PURE__ */ useSSRWidth() } = options;
|
|
517
|
-
const isSupported = /* @__PURE__ */ useSupported(() => window$1 && "matchMedia" in window$1 && typeof window$1.matchMedia === "function");
|
|
518
|
-
const ssrSupport = shallowRef(typeof ssrWidth === "number");
|
|
519
|
-
const mediaQuery = shallowRef();
|
|
520
|
-
const matches = shallowRef(false);
|
|
521
|
-
const handler = (event) => {
|
|
522
|
-
matches.value = event.matches;
|
|
523
|
-
};
|
|
524
|
-
watchEffect(() => {
|
|
525
|
-
if (ssrSupport.value) {
|
|
526
|
-
ssrSupport.value = !isSupported.value;
|
|
527
|
-
matches.value = toValue(query).split(",").some((queryString) => {
|
|
528
|
-
const not = queryString.includes("not all");
|
|
529
|
-
const minWidth = queryString.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/);
|
|
530
|
-
const maxWidth = queryString.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/);
|
|
531
|
-
let res = Boolean(minWidth || maxWidth);
|
|
532
|
-
if (minWidth && res) res = ssrWidth >= pxValue(minWidth[1]);
|
|
533
|
-
if (maxWidth && res) res = ssrWidth <= pxValue(maxWidth[1]);
|
|
534
|
-
return not ? !res : res;
|
|
535
|
-
});
|
|
536
|
-
return;
|
|
537
|
-
}
|
|
538
|
-
if (!isSupported.value) return;
|
|
539
|
-
mediaQuery.value = window$1.matchMedia(toValue(query));
|
|
540
|
-
matches.value = mediaQuery.value.matches;
|
|
541
|
-
});
|
|
542
|
-
useEventListener(mediaQuery, "change", handler, { passive: true });
|
|
543
|
-
return computed(() => matches.value);
|
|
544
|
-
}
|
|
545
|
-
// @__NO_SIDE_EFFECTS__
|
|
546
|
-
function useBreakpoints(breakpoints, options = {}) {
|
|
547
|
-
function getValue$1(k, delta) {
|
|
548
|
-
let v = toValue(breakpoints[toValue(k)]);
|
|
549
|
-
if (delta != null) v = increaseWithUnit(v, delta);
|
|
550
|
-
if (typeof v === "number") v = `${v}px`;
|
|
551
|
-
return v;
|
|
552
|
-
}
|
|
553
|
-
const { window: window$1 = defaultWindow, strategy = "min-width", ssrWidth = /* @__PURE__ */ useSSRWidth() } = options;
|
|
554
|
-
const ssrSupport = typeof ssrWidth === "number";
|
|
555
|
-
const mounted = ssrSupport ? shallowRef(false) : { value: true };
|
|
556
|
-
if (ssrSupport) tryOnMounted(() => mounted.value = !!window$1);
|
|
557
|
-
function match(query, size) {
|
|
558
|
-
if (!mounted.value && ssrSupport) return query === "min" ? ssrWidth >= pxValue(size) : ssrWidth <= pxValue(size);
|
|
559
|
-
if (!window$1) return false;
|
|
560
|
-
return window$1.matchMedia(`(${query}-width: ${size})`).matches;
|
|
561
|
-
}
|
|
562
|
-
const greaterOrEqual = (k) => {
|
|
563
|
-
return useMediaQuery(() => `(min-width: ${getValue$1(k)})`, options);
|
|
564
|
-
};
|
|
565
|
-
const smallerOrEqual = (k) => {
|
|
566
|
-
return useMediaQuery(() => `(max-width: ${getValue$1(k)})`, options);
|
|
567
|
-
};
|
|
568
|
-
const shortcutMethods = Object.keys(breakpoints).reduce((shortcuts, k) => {
|
|
569
|
-
Object.defineProperty(shortcuts, k, {
|
|
570
|
-
get: () => strategy === "min-width" ? greaterOrEqual(k) : smallerOrEqual(k),
|
|
571
|
-
enumerable: true,
|
|
572
|
-
configurable: true
|
|
573
|
-
});
|
|
574
|
-
return shortcuts;
|
|
575
|
-
}, {});
|
|
576
|
-
function current() {
|
|
577
|
-
const points = Object.keys(breakpoints).map((k) => [
|
|
578
|
-
k,
|
|
579
|
-
shortcutMethods[k],
|
|
580
|
-
pxValue(getValue$1(k))
|
|
581
|
-
]).sort((a, b) => a[2] - b[2]);
|
|
582
|
-
return computed(() => points.filter(([, v]) => v.value).map(([k]) => k));
|
|
583
|
-
}
|
|
584
|
-
return Object.assign(shortcutMethods, {
|
|
585
|
-
greaterOrEqual,
|
|
586
|
-
smallerOrEqual,
|
|
587
|
-
greater(k) {
|
|
588
|
-
return useMediaQuery(() => `(min-width: ${getValue$1(k, 0.1)})`, options);
|
|
589
|
-
},
|
|
590
|
-
smaller(k) {
|
|
591
|
-
return useMediaQuery(() => `(max-width: ${getValue$1(k, -0.1)})`, options);
|
|
592
|
-
},
|
|
593
|
-
between(a, b) {
|
|
594
|
-
return useMediaQuery(() => `(min-width: ${getValue$1(a)}) and (max-width: ${getValue$1(b, -0.1)})`, options);
|
|
595
|
-
},
|
|
596
|
-
isGreater(k) {
|
|
597
|
-
return match("min", getValue$1(k, 0.1));
|
|
598
|
-
},
|
|
599
|
-
isGreaterOrEqual(k) {
|
|
600
|
-
return match("min", getValue$1(k));
|
|
601
|
-
},
|
|
602
|
-
isSmaller(k) {
|
|
603
|
-
return match("max", getValue$1(k, -0.1));
|
|
604
|
-
},
|
|
605
|
-
isSmallerOrEqual(k) {
|
|
606
|
-
return match("max", getValue$1(k));
|
|
607
|
-
},
|
|
608
|
-
isInBetween(a, b) {
|
|
609
|
-
return match("min", getValue$1(a)) && match("max", getValue$1(b, -0.1));
|
|
610
|
-
},
|
|
611
|
-
current,
|
|
612
|
-
active() {
|
|
613
|
-
const bps = current();
|
|
614
|
-
return computed(() => bps.value.length === 0 ? "" : bps.value.at(strategy === "min-width" ? -1 : 0));
|
|
615
|
-
}
|
|
616
|
-
});
|
|
617
|
-
}
|
|
618
454
|
const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
619
455
|
__name: "ResponsiveList",
|
|
620
456
|
props: {
|
|
@@ -626,7 +462,9 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
626
462
|
selectableFilter: {},
|
|
627
463
|
breakpoint: { default: "lg" },
|
|
628
464
|
sortBy: {},
|
|
629
|
-
sortDirection: {}
|
|
465
|
+
sortDirection: {},
|
|
466
|
+
loading: { type: Boolean, default: false },
|
|
467
|
+
loadingRows: { default: 5 }
|
|
630
468
|
},
|
|
631
469
|
emits: ["select", "selectAll", "sort"],
|
|
632
470
|
setup(__props, { emit: __emit }) {
|
|
@@ -662,7 +500,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
662
500
|
return !!slots[`cell-${key}`];
|
|
663
501
|
};
|
|
664
502
|
const hasActionsSlot = computed(() => !!slots.actions);
|
|
665
|
-
const breakpoints =
|
|
503
|
+
const breakpoints = useBreakpoints({
|
|
666
504
|
sm: 640,
|
|
667
505
|
md: 768,
|
|
668
506
|
lg: 1024,
|
|
@@ -679,6 +517,8 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
679
517
|
selectable: __props.selectable,
|
|
680
518
|
"selected-items": __props.selectedItems,
|
|
681
519
|
"selectable-filter": __props.selectableFilter,
|
|
520
|
+
loading: __props.loading,
|
|
521
|
+
"loading-items": __props.loadingRows,
|
|
682
522
|
onSelect: _cache[0] || (_cache[0] = ($event) => emit("select", $event)),
|
|
683
523
|
onSelectAll: _cache[1] || (_cache[1] = ($event) => emit("selectAll"))
|
|
684
524
|
}, {
|
|
@@ -697,7 +537,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
697
537
|
renderSlot(_ctx.$slots, "empty")
|
|
698
538
|
]),
|
|
699
539
|
_: 3
|
|
700
|
-
}, 8, ["items", "key-field", "selectable", "selected-items", "selectable-filter"])) : (openBlock(), createBlock(_sfc_main$i, { key: 1 }, {
|
|
540
|
+
}, 8, ["items", "key-field", "selectable", "selected-items", "selectable-filter", "loading", "loading-items"])) : (openBlock(), createBlock(_sfc_main$i, { key: 1 }, {
|
|
701
541
|
default: withCtx(() => [
|
|
702
542
|
createVNode(_sfc_main$h, {
|
|
703
543
|
items: __props.items,
|
|
@@ -708,6 +548,8 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
708
548
|
"selectable-filter": __props.selectableFilter,
|
|
709
549
|
"sort-by": __props.sortBy,
|
|
710
550
|
"sort-direction": __props.sortDirection,
|
|
551
|
+
loading: __props.loading,
|
|
552
|
+
"loading-rows": __props.loadingRows,
|
|
711
553
|
onSelect: _cache[2] || (_cache[2] = ($event) => emit("select", $event)),
|
|
712
554
|
onSelectAll: _cache[3] || (_cache[3] = ($event) => emit("selectAll")),
|
|
713
555
|
onSort: _cache[4] || (_cache[4] = (col, dir) => emit("sort", col, dir))
|
|
@@ -738,7 +580,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
738
580
|
]),
|
|
739
581
|
key: "0"
|
|
740
582
|
} : void 0
|
|
741
|
-
]), 1032, ["items", "properties", "key-field", "selectable", "selected-items", "selectable-filter", "sort-by", "sort-direction"])
|
|
583
|
+
]), 1032, ["items", "properties", "key-field", "selectable", "selected-items", "selectable-filter", "sort-by", "sort-direction", "loading", "loading-rows"])
|
|
742
584
|
]),
|
|
743
585
|
_: 3
|
|
744
586
|
}))
|
|
@@ -746,11 +588,11 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
746
588
|
};
|
|
747
589
|
}
|
|
748
590
|
});
|
|
749
|
-
const _hoisted_1$
|
|
591
|
+
const _hoisted_1$a = {
|
|
750
592
|
key: 0,
|
|
751
593
|
class: "mb-2 block text-sm font-medium text-gray-700 dark:text-gray-300"
|
|
752
594
|
};
|
|
753
|
-
const _hoisted_2$
|
|
595
|
+
const _hoisted_2$7 = { class: "relative" };
|
|
754
596
|
const _hoisted_3$4 = ["disabled", "placeholder"];
|
|
755
597
|
const _hoisted_4$3 = ["disabled"];
|
|
756
598
|
const _hoisted_5$1 = {
|
|
@@ -866,8 +708,8 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
866
708
|
ref: containerRef,
|
|
867
709
|
class: "autocomplete-container"
|
|
868
710
|
}, [
|
|
869
|
-
__props.label ? (openBlock(), createElementBlock("label", _hoisted_1$
|
|
870
|
-
createElementVNode("div", _hoisted_2$
|
|
711
|
+
__props.label ? (openBlock(), createElementBlock("label", _hoisted_1$a, toDisplayString(__props.label), 1)) : createCommentVNode("", true),
|
|
712
|
+
createElementVNode("div", _hoisted_2$7, [
|
|
871
713
|
createElementVNode("div", {
|
|
872
714
|
ref_key: "inputWrapperRef",
|
|
873
715
|
ref: inputWrapperRef,
|
|
@@ -1042,103 +884,10 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
1042
884
|
};
|
|
1043
885
|
}
|
|
1044
886
|
});
|
|
1045
|
-
const
|
|
1046
|
-
|
|
1047
|
-
props: {
|
|
1048
|
-
variant: { default: "primary" },
|
|
1049
|
-
size: { default: "md" },
|
|
1050
|
-
icon: {},
|
|
1051
|
-
iconRight: {},
|
|
1052
|
-
loading: { type: Boolean },
|
|
1053
|
-
disabled: { type: Boolean },
|
|
1054
|
-
block: { type: Boolean },
|
|
1055
|
-
href: {},
|
|
1056
|
-
to: {},
|
|
1057
|
-
type: { default: "button" }
|
|
1058
|
-
},
|
|
1059
|
-
emits: ["click"],
|
|
1060
|
-
setup(__props, { emit: __emit }) {
|
|
1061
|
-
const props = __props;
|
|
1062
|
-
const emit = __emit;
|
|
1063
|
-
const variantClasses = {
|
|
1064
|
-
primary: "bg-primary text-primary-foreground hover:bg-primary/90 focus:ring-primary",
|
|
1065
|
-
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/90 focus:ring-secondary",
|
|
1066
|
-
outline: "border border-gray-300 bg-transparent text-gray-700 hover:bg-gray-50 focus:ring-primary dark:border-gray-600 dark:text-gray-300 dark:hover:bg-gray-800",
|
|
1067
|
-
ghost: "bg-transparent text-gray-700 hover:bg-gray-100 focus:ring-primary dark:text-gray-300 dark:hover:bg-gray-800",
|
|
1068
|
-
danger: "bg-red-500 text-white hover:bg-red-600 focus:ring-red-500",
|
|
1069
|
-
success: "bg-green-500 text-white hover:bg-green-600 focus:ring-green-500"
|
|
1070
|
-
};
|
|
1071
|
-
const sizeClasses = {
|
|
1072
|
-
xs: "px-2 py-1 text-xs gap-1",
|
|
1073
|
-
sm: "px-3 py-1.5 text-sm gap-1.5",
|
|
1074
|
-
md: "px-4 py-2 text-sm gap-2",
|
|
1075
|
-
lg: "px-5 py-2.5 text-base gap-2",
|
|
1076
|
-
xl: "px-6 py-3 text-lg gap-2.5"
|
|
1077
|
-
};
|
|
1078
|
-
const iconSizeClasses = {
|
|
1079
|
-
xs: "size-3",
|
|
1080
|
-
sm: "size-4",
|
|
1081
|
-
md: "size-4",
|
|
1082
|
-
lg: "size-5",
|
|
1083
|
-
xl: "size-6"
|
|
1084
|
-
};
|
|
1085
|
-
const classes = computed(() => [
|
|
1086
|
-
"inline-flex items-center justify-center font-medium rounded-lg transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed",
|
|
1087
|
-
variantClasses[props.variant],
|
|
1088
|
-
sizeClasses[props.size],
|
|
1089
|
-
props.block && "w-full"
|
|
1090
|
-
]);
|
|
1091
|
-
const component = computed(() => {
|
|
1092
|
-
if (props.to) {
|
|
1093
|
-
try {
|
|
1094
|
-
const RouterLink = resolveComponent("RouterLink");
|
|
1095
|
-
if (typeof RouterLink !== "string") return RouterLink;
|
|
1096
|
-
} catch {
|
|
1097
|
-
}
|
|
1098
|
-
}
|
|
1099
|
-
if (props.href) return "a";
|
|
1100
|
-
return "button";
|
|
1101
|
-
});
|
|
1102
|
-
const componentProps = computed(() => {
|
|
1103
|
-
if (props.to) return { to: props.to };
|
|
1104
|
-
if (props.href) return { href: props.href };
|
|
1105
|
-
return { type: props.type, disabled: props.disabled || props.loading };
|
|
1106
|
-
});
|
|
1107
|
-
const handleClick = (event) => {
|
|
1108
|
-
if (props.disabled || props.loading) return;
|
|
1109
|
-
emit("click", event);
|
|
1110
|
-
};
|
|
1111
|
-
return (_ctx, _cache) => {
|
|
1112
|
-
return openBlock(), createBlock(resolveDynamicComponent(component.value), mergeProps(componentProps.value, {
|
|
1113
|
-
class: classes.value,
|
|
1114
|
-
onClick: handleClick
|
|
1115
|
-
}), {
|
|
1116
|
-
default: withCtx(() => [
|
|
1117
|
-
__props.loading ? (openBlock(), createBlock(unref(Icon), {
|
|
1118
|
-
key: 0,
|
|
1119
|
-
icon: "lucide:loader-2",
|
|
1120
|
-
class: normalizeClass([iconSizeClasses[__props.size], "animate-spin"])
|
|
1121
|
-
}, null, 8, ["class"])) : __props.icon ? (openBlock(), createBlock(unref(Icon), {
|
|
1122
|
-
key: 1,
|
|
1123
|
-
icon: __props.icon,
|
|
1124
|
-
class: normalizeClass(iconSizeClasses[__props.size])
|
|
1125
|
-
}, null, 8, ["icon", "class"])) : createCommentVNode("", true),
|
|
1126
|
-
renderSlot(_ctx.$slots, "default"),
|
|
1127
|
-
__props.iconRight && !__props.loading ? (openBlock(), createBlock(unref(Icon), {
|
|
1128
|
-
key: 2,
|
|
1129
|
-
icon: __props.iconRight,
|
|
1130
|
-
class: normalizeClass(iconSizeClasses[__props.size])
|
|
1131
|
-
}, null, 8, ["icon", "class"])) : createCommentVNode("", true)
|
|
1132
|
-
]),
|
|
1133
|
-
_: 3
|
|
1134
|
-
}, 16, ["class"]);
|
|
1135
|
-
};
|
|
1136
|
-
}
|
|
1137
|
-
});
|
|
1138
|
-
const _hoisted_1$8 = { class: "relative inline-block" };
|
|
1139
|
-
const _hoisted_2$5 = ["src", "alt"];
|
|
887
|
+
const _hoisted_1$9 = { class: "relative inline-block" };
|
|
888
|
+
const _hoisted_2$6 = ["src", "alt"];
|
|
1140
889
|
const _hoisted_3$3 = { key: 1 };
|
|
1141
|
-
const _sfc_main$
|
|
890
|
+
const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
1142
891
|
__name: "Avatar",
|
|
1143
892
|
props: {
|
|
1144
893
|
src: {},
|
|
@@ -1184,7 +933,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
1184
933
|
});
|
|
1185
934
|
const showImage = computed(() => props.src && !imageError.value);
|
|
1186
935
|
return (_ctx, _cache) => {
|
|
1187
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
936
|
+
return openBlock(), createElementBlock("div", _hoisted_1$9, [
|
|
1188
937
|
createElementVNode("div", {
|
|
1189
938
|
class: normalizeClass([
|
|
1190
939
|
"flex items-center justify-center overflow-hidden bg-gray-200 font-medium text-gray-600 dark:bg-gray-700 dark:text-gray-300",
|
|
@@ -1198,7 +947,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
1198
947
|
alt: __props.alt || __props.name,
|
|
1199
948
|
class: "size-full object-cover",
|
|
1200
949
|
onError: _cache[0] || (_cache[0] = ($event) => imageError.value = true)
|
|
1201
|
-
}, null, 40, _hoisted_2$
|
|
950
|
+
}, null, 40, _hoisted_2$6)) : initials.value ? (openBlock(), createElementBlock("span", _hoisted_3$3, toDisplayString(initials.value), 1)) : (openBlock(), createBlock(unref(Icon), {
|
|
1202
951
|
key: 2,
|
|
1203
952
|
icon: "lucide:user",
|
|
1204
953
|
class: "size-1/2"
|
|
@@ -1216,9 +965,9 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
1216
965
|
};
|
|
1217
966
|
}
|
|
1218
967
|
});
|
|
1219
|
-
const _hoisted_1$
|
|
1220
|
-
const _hoisted_2$
|
|
1221
|
-
const _sfc_main$
|
|
968
|
+
const _hoisted_1$8 = ["aria-selected", "disabled", "onClick"];
|
|
969
|
+
const _hoisted_2$5 = { class: "mt-4" };
|
|
970
|
+
const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
1222
971
|
__name: "Tabs",
|
|
1223
972
|
props: {
|
|
1224
973
|
tabs: {},
|
|
@@ -1283,18 +1032,18 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
1283
1032
|
activeTab.value === tab.key ? variantClasses[__props.variant].active : variantClasses[__props.variant].inactive
|
|
1284
1033
|
]),
|
|
1285
1034
|
onClick: ($event) => selectTab(tab)
|
|
1286
|
-
}, toDisplayString(tab.label), 11, _hoisted_1$
|
|
1035
|
+
}, toDisplayString(tab.label), 11, _hoisted_1$8);
|
|
1287
1036
|
}), 128))
|
|
1288
1037
|
], 2),
|
|
1289
|
-
createElementVNode("div", _hoisted_2$
|
|
1038
|
+
createElementVNode("div", _hoisted_2$5, [
|
|
1290
1039
|
renderSlot(_ctx.$slots, "default", { activeTab: activeTab.value })
|
|
1291
1040
|
])
|
|
1292
1041
|
]);
|
|
1293
1042
|
};
|
|
1294
1043
|
}
|
|
1295
1044
|
});
|
|
1296
|
-
const _hoisted_1$
|
|
1297
|
-
const _sfc_main$
|
|
1045
|
+
const _hoisted_1$7 = { role: "tabpanel" };
|
|
1046
|
+
const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
1298
1047
|
__name: "TabPanel",
|
|
1299
1048
|
props: {
|
|
1300
1049
|
value: {}
|
|
@@ -1304,7 +1053,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
1304
1053
|
const activeTab = inject("activeTab");
|
|
1305
1054
|
const isActive = computed(() => (activeTab == null ? void 0 : activeTab.value) === props.value);
|
|
1306
1055
|
return (_ctx, _cache) => {
|
|
1307
|
-
return withDirectives((openBlock(), createElementBlock("div", _hoisted_1$
|
|
1056
|
+
return withDirectives((openBlock(), createElementBlock("div", _hoisted_1$7, [
|
|
1308
1057
|
renderSlot(_ctx.$slots, "default")
|
|
1309
1058
|
], 512)), [
|
|
1310
1059
|
[vShow, isActive.value]
|
|
@@ -1312,11 +1061,11 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
1312
1061
|
};
|
|
1313
1062
|
}
|
|
1314
1063
|
});
|
|
1315
|
-
const _hoisted_1$
|
|
1064
|
+
const _hoisted_1$6 = {
|
|
1316
1065
|
key: 2,
|
|
1317
1066
|
class: "text-sm font-semibold"
|
|
1318
1067
|
};
|
|
1319
|
-
const _sfc_main$
|
|
1068
|
+
const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
1320
1069
|
__name: "Stepper",
|
|
1321
1070
|
props: {
|
|
1322
1071
|
steps: {},
|
|
@@ -1385,7 +1134,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
1385
1134
|
key: 1,
|
|
1386
1135
|
icon: step.icon,
|
|
1387
1136
|
class: "size-6"
|
|
1388
|
-
}, null, 8, ["icon"])) : (openBlock(), createElementBlock("span", _hoisted_1$
|
|
1137
|
+
}, null, 8, ["icon"])) : (openBlock(), createElementBlock("span", _hoisted_1$6, toDisplayString(index + 1), 1))
|
|
1389
1138
|
], 2),
|
|
1390
1139
|
createElementVNode("div", {
|
|
1391
1140
|
class: normalizeClass([
|
|
@@ -1413,7 +1162,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
1413
1162
|
};
|
|
1414
1163
|
}
|
|
1415
1164
|
});
|
|
1416
|
-
const _sfc_main$
|
|
1165
|
+
const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
1417
1166
|
__name: "CollapsibleCard",
|
|
1418
1167
|
props: {
|
|
1419
1168
|
title: {},
|
|
@@ -1509,7 +1258,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
1509
1258
|
};
|
|
1510
1259
|
}
|
|
1511
1260
|
});
|
|
1512
|
-
const _sfc_main$
|
|
1261
|
+
const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
1513
1262
|
__name: "Tooltip",
|
|
1514
1263
|
props: {
|
|
1515
1264
|
content: {},
|
|
@@ -1584,7 +1333,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
1584
1333
|
};
|
|
1585
1334
|
}
|
|
1586
1335
|
});
|
|
1587
|
-
const _sfc_main$
|
|
1336
|
+
const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
1588
1337
|
__name: "Popover",
|
|
1589
1338
|
props: {
|
|
1590
1339
|
position: { default: "bottom" },
|
|
@@ -1667,17 +1416,17 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
1667
1416
|
};
|
|
1668
1417
|
}
|
|
1669
1418
|
});
|
|
1670
|
-
const _hoisted_1$
|
|
1419
|
+
const _hoisted_1$5 = {
|
|
1671
1420
|
key: 0,
|
|
1672
1421
|
class: "flex items-center justify-between px-4 py-3 border-b border-gray-200 dark:border-gray-700"
|
|
1673
1422
|
};
|
|
1674
|
-
const _hoisted_2$
|
|
1423
|
+
const _hoisted_2$4 = { class: "text-lg font-semibold text-gray-900 dark:text-white" };
|
|
1675
1424
|
const _hoisted_3$2 = { class: "flex-1 overflow-y-auto p-4" };
|
|
1676
1425
|
const _hoisted_4$2 = {
|
|
1677
1426
|
key: 1,
|
|
1678
1427
|
class: "px-4 py-3 border-t border-gray-200 dark:border-gray-700"
|
|
1679
1428
|
};
|
|
1680
|
-
const _sfc_main$
|
|
1429
|
+
const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
1681
1430
|
__name: "Drawer",
|
|
1682
1431
|
props: {
|
|
1683
1432
|
modelValue: { type: Boolean },
|
|
@@ -1796,9 +1545,9 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
1796
1545
|
role: "dialog",
|
|
1797
1546
|
"aria-modal": "true"
|
|
1798
1547
|
}, [
|
|
1799
|
-
__props.title || __props.showClose || _ctx.$slots.header ? (openBlock(), createElementBlock("div", _hoisted_1$
|
|
1548
|
+
__props.title || __props.showClose || _ctx.$slots.header ? (openBlock(), createElementBlock("div", _hoisted_1$5, [
|
|
1800
1549
|
renderSlot(_ctx.$slots, "header", {}, () => [
|
|
1801
|
-
createElementVNode("h2", _hoisted_2$
|
|
1550
|
+
createElementVNode("h2", _hoisted_2$4, toDisplayString(__props.title), 1)
|
|
1802
1551
|
]),
|
|
1803
1552
|
__props.showClose ? (openBlock(), createElementBlock("button", {
|
|
1804
1553
|
key: 0,
|
|
@@ -1826,9 +1575,9 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
1826
1575
|
};
|
|
1827
1576
|
}
|
|
1828
1577
|
});
|
|
1829
|
-
const _hoisted_1$
|
|
1830
|
-
const _hoisted_2$
|
|
1831
|
-
const _sfc_main$
|
|
1578
|
+
const _hoisted_1$4 = { "aria-label": "Breadcrumb" };
|
|
1579
|
+
const _hoisted_2$3 = { class: "flex items-center flex-wrap gap-1 text-sm" };
|
|
1580
|
+
const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
1832
1581
|
__name: "Breadcrumb",
|
|
1833
1582
|
props: {
|
|
1834
1583
|
items: {},
|
|
@@ -1839,8 +1588,8 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
1839
1588
|
emits: ["click"],
|
|
1840
1589
|
setup(__props) {
|
|
1841
1590
|
return (_ctx, _cache) => {
|
|
1842
|
-
return openBlock(), createElementBlock("nav", _hoisted_1$
|
|
1843
|
-
createElementVNode("ol", _hoisted_2$
|
|
1591
|
+
return openBlock(), createElementBlock("nav", _hoisted_1$4, [
|
|
1592
|
+
createElementVNode("ol", _hoisted_2$3, [
|
|
1844
1593
|
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.items, (item, index) => {
|
|
1845
1594
|
return openBlock(), createElementBlock("li", {
|
|
1846
1595
|
key: index,
|
|
@@ -1882,8 +1631,8 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
1882
1631
|
};
|
|
1883
1632
|
}
|
|
1884
1633
|
});
|
|
1885
|
-
const _hoisted_1$
|
|
1886
|
-
const _sfc_main$
|
|
1634
|
+
const _hoisted_1$3 = { class: "divide-y divide-gray-200 dark:divide-gray-700 border border-gray-200 dark:border-gray-700 rounded-lg overflow-hidden" };
|
|
1635
|
+
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
1887
1636
|
__name: "Accordion",
|
|
1888
1637
|
props: {
|
|
1889
1638
|
mode: { default: "single" },
|
|
@@ -1909,17 +1658,17 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
1909
1658
|
isOpen
|
|
1910
1659
|
});
|
|
1911
1660
|
return (_ctx, _cache) => {
|
|
1912
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
1661
|
+
return openBlock(), createElementBlock("div", _hoisted_1$3, [
|
|
1913
1662
|
renderSlot(_ctx.$slots, "default")
|
|
1914
1663
|
]);
|
|
1915
1664
|
};
|
|
1916
1665
|
}
|
|
1917
1666
|
});
|
|
1918
|
-
const _hoisted_1$
|
|
1919
|
-
const _hoisted_2$
|
|
1667
|
+
const _hoisted_1$2 = ["disabled", "aria-expanded"];
|
|
1668
|
+
const _hoisted_2$2 = { class: "flex items-center gap-2 font-medium" };
|
|
1920
1669
|
const _hoisted_3$1 = { class: "overflow-hidden" };
|
|
1921
1670
|
const _hoisted_4$1 = { class: "px-4 py-3 bg-gray-50 dark:bg-gray-900 text-gray-700 dark:text-gray-300" };
|
|
1922
|
-
const _sfc_main$
|
|
1671
|
+
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
1923
1672
|
__name: "AccordionItem",
|
|
1924
1673
|
props: {
|
|
1925
1674
|
itemKey: {},
|
|
@@ -1947,7 +1696,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
1947
1696
|
"aria-expanded": isOpen.value,
|
|
1948
1697
|
onClick: toggle
|
|
1949
1698
|
}, [
|
|
1950
|
-
createElementVNode("span", _hoisted_2$
|
|
1699
|
+
createElementVNode("span", _hoisted_2$2, [
|
|
1951
1700
|
__props.icon ? (openBlock(), createBlock(unref(Icon), {
|
|
1952
1701
|
key: 0,
|
|
1953
1702
|
icon: __props.icon,
|
|
@@ -1959,7 +1708,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
1959
1708
|
icon: "heroicons:chevron-down",
|
|
1960
1709
|
class: normalizeClass(["w-5 h-5 transition-transform duration-200", { "rotate-180": isOpen.value }])
|
|
1961
1710
|
}, null, 8, ["class"])
|
|
1962
|
-
], 10, _hoisted_1$
|
|
1711
|
+
], 10, _hoisted_1$2),
|
|
1963
1712
|
createVNode(Transition, {
|
|
1964
1713
|
"enter-active-class": "transition-all duration-200 ease-out",
|
|
1965
1714
|
"enter-from-class": "opacity-0 max-h-0",
|
|
@@ -1983,11 +1732,11 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
1983
1732
|
};
|
|
1984
1733
|
}
|
|
1985
1734
|
});
|
|
1986
|
-
const _hoisted_1 = {
|
|
1735
|
+
const _hoisted_1$1 = {
|
|
1987
1736
|
key: 0,
|
|
1988
1737
|
class: "relative"
|
|
1989
1738
|
};
|
|
1990
|
-
const _hoisted_2 = { class: "flex items-start gap-4" };
|
|
1739
|
+
const _hoisted_2$1 = { class: "flex items-start gap-4" };
|
|
1991
1740
|
const _hoisted_3 = { class: "flex-1 min-w-0 pt-0.5" };
|
|
1992
1741
|
const _hoisted_4 = { class: "flex items-center justify-between gap-2" };
|
|
1993
1742
|
const _hoisted_5 = { class: "text-sm font-medium text-gray-900 dark:text-white" };
|
|
@@ -2010,7 +1759,7 @@ const _hoisted_12 = {
|
|
|
2010
1759
|
key: 0,
|
|
2011
1760
|
class: "text-xs text-gray-500 dark:text-gray-400"
|
|
2012
1761
|
};
|
|
2013
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
1762
|
+
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
2014
1763
|
__name: "Timeline",
|
|
2015
1764
|
props: {
|
|
2016
1765
|
items: {},
|
|
@@ -2056,7 +1805,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
2056
1805
|
}
|
|
2057
1806
|
};
|
|
2058
1807
|
return (_ctx, _cache) => {
|
|
2059
|
-
return __props.orientation === "vertical" ? (openBlock(), createElementBlock("div", _hoisted_1, [
|
|
1808
|
+
return __props.orientation === "vertical" ? (openBlock(), createElementBlock("div", _hoisted_1$1, [
|
|
2060
1809
|
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.items, (item, index) => {
|
|
2061
1810
|
return openBlock(), createElementBlock("div", {
|
|
2062
1811
|
key: item.key,
|
|
@@ -2066,7 +1815,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
2066
1815
|
key: 0,
|
|
2067
1816
|
class: normalizeClass(["absolute left-4 top-8 w-0.5 h-full -ml-px", getStatusClasses(item.status).line])
|
|
2068
1817
|
}, null, 2)) : createCommentVNode("", true),
|
|
2069
|
-
createElementVNode("div", _hoisted_2, [
|
|
1818
|
+
createElementVNode("div", _hoisted_2$1, [
|
|
2070
1819
|
createElementVNode("div", {
|
|
2071
1820
|
class: normalizeClass(["relative z-10 flex items-center justify-center w-8 h-8 rounded-full flex-shrink-0", getStatusClasses(item.status).dot])
|
|
2072
1821
|
}, [
|
|
@@ -2118,6 +1867,51 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
2118
1867
|
};
|
|
2119
1868
|
}
|
|
2120
1869
|
});
|
|
1870
|
+
const _hoisted_1 = ["aria-label"];
|
|
1871
|
+
const _hoisted_2 = {
|
|
1872
|
+
key: 0,
|
|
1873
|
+
class: "text-sm font-medium"
|
|
1874
|
+
};
|
|
1875
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
1876
|
+
__name: "DarkModeToggle",
|
|
1877
|
+
props: {
|
|
1878
|
+
size: { default: "md" },
|
|
1879
|
+
lightIcon: { default: "lucide:sun" },
|
|
1880
|
+
darkIcon: { default: "lucide:moon" },
|
|
1881
|
+
showLabel: { type: Boolean, default: false },
|
|
1882
|
+
storageKey: { default: "dark-mode" }
|
|
1883
|
+
},
|
|
1884
|
+
setup(__props) {
|
|
1885
|
+
const props = __props;
|
|
1886
|
+
const { isDark, toggle } = useDarkMode({ storageKey: props.storageKey });
|
|
1887
|
+
const sizeClasses = {
|
|
1888
|
+
sm: { button: "p-1.5", icon: "h-4 w-4" },
|
|
1889
|
+
md: { button: "p-2", icon: "h-5 w-5" },
|
|
1890
|
+
lg: { button: "p-2.5", icon: "h-6 w-6" }
|
|
1891
|
+
};
|
|
1892
|
+
return (_ctx, _cache) => {
|
|
1893
|
+
return openBlock(), createElementBlock("button", {
|
|
1894
|
+
type: "button",
|
|
1895
|
+
class: normalizeClass([
|
|
1896
|
+
sizeClasses[__props.size].button,
|
|
1897
|
+
"inline-flex items-center gap-2 rounded-lg transition-colors",
|
|
1898
|
+
"text-gray-600 hover:bg-gray-100 hover:text-gray-900",
|
|
1899
|
+
"dark:text-gray-400 dark:hover:bg-gray-800 dark:hover:text-gray-100",
|
|
1900
|
+
"focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2"
|
|
1901
|
+
]),
|
|
1902
|
+
"aria-label": unref(isDark) ? "Switch to light mode" : "Switch to dark mode",
|
|
1903
|
+
onClick: _cache[0] || (_cache[0] = //@ts-ignore
|
|
1904
|
+
(...args) => unref(toggle) && unref(toggle)(...args))
|
|
1905
|
+
}, [
|
|
1906
|
+
createVNode(unref(Icon), {
|
|
1907
|
+
icon: unref(isDark) ? __props.darkIcon : __props.lightIcon,
|
|
1908
|
+
class: normalizeClass(sizeClasses[__props.size].icon)
|
|
1909
|
+
}, null, 8, ["icon", "class"]),
|
|
1910
|
+
__props.showLabel ? (openBlock(), createElementBlock("span", _hoisted_2, toDisplayString(unref(isDark) ? "Dark" : "Light"), 1)) : createCommentVNode("", true)
|
|
1911
|
+
], 10, _hoisted_1);
|
|
1912
|
+
};
|
|
1913
|
+
}
|
|
1914
|
+
});
|
|
2121
1915
|
export {
|
|
2122
1916
|
_sfc_main$i as _,
|
|
2123
1917
|
_sfc_main$h as a,
|
|
@@ -2139,4 +1933,4 @@ export {
|
|
|
2139
1933
|
_sfc_main$1 as q,
|
|
2140
1934
|
_sfc_main as r
|
|
2141
1935
|
};
|
|
2142
|
-
//# sourceMappingURL=
|
|
1936
|
+
//# sourceMappingURL=DarkModeToggle.vue_vue_type_script_setup_true_lang-43fxlbro.js.map
|