cisse-vue-ui 0.8.4 → 0.9.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 -4
- package/dist/{CheckboxGroup.vue_vue_type_script_setup_true_lang-B190Yija.js → CheckboxGroup.vue_vue_type_script_setup_true_lang-ZP02bMgY.js} +2 -2
- package/dist/{CheckboxGroup.vue_vue_type_script_setup_true_lang-B190Yija.js.map → CheckboxGroup.vue_vue_type_script_setup_true_lang-ZP02bMgY.js.map} +1 -1
- package/dist/{ConfirmDialog.vue_vue_type_script_setup_true_lang-DWs2V7xX.js → ConfirmDialog.vue_vue_type_script_setup_true_lang-C5KHLMvx.js} +37 -184
- package/dist/ConfirmDialog.vue_vue_type_script_setup_true_lang-C5KHLMvx.js.map +1 -0
- package/dist/{ConfirmDialog.vue_vue_type_script_setup_true_lang-BGUoa5fT.cjs → ConfirmDialog.vue_vue_type_script_setup_true_lang-CLfy0-Wb.cjs} +33 -180
- package/dist/ConfirmDialog.vue_vue_type_script_setup_true_lang-CLfy0-Wb.cjs.map +1 -0
- package/dist/{FilterTabs.vue_vue_type_script_setup_true_lang-DYxh-wFx.cjs → FilterTabs.vue_vue_type_script_setup_true_lang-COkZbeGG.cjs} +1259 -208
- package/dist/FilterTabs.vue_vue_type_script_setup_true_lang-COkZbeGG.cjs.map +1 -0
- package/dist/{FilterTabs.vue_vue_type_script_setup_true_lang-BmJHgkBs.js → FilterTabs.vue_vue_type_script_setup_true_lang-CzpYHtc5.js} +1268 -217
- package/dist/FilterTabs.vue_vue_type_script_setup_true_lang-CzpYHtc5.js.map +1 -0
- package/dist/ListSkeleton.vue_vue_type_script_setup_true_lang-BHopJ9RG.js +298 -0
- package/dist/ListSkeleton.vue_vue_type_script_setup_true_lang-BHopJ9RG.js.map +1 -0
- package/dist/ListSkeleton.vue_vue_type_script_setup_true_lang-Bo3HqgX0.cjs +297 -0
- package/dist/ListSkeleton.vue_vue_type_script_setup_true_lang-Bo3HqgX0.cjs.map +1 -0
- package/dist/components/core/AccordionItem.test.d.ts +1 -0
- package/dist/components/core/Breadcrumb.stories.d.ts +5 -0
- package/dist/components/core/CardWrapper.stories.d.ts +32 -0
- package/dist/components/core/CardWrapper.test.d.ts +1 -0
- package/dist/components/core/CardWrapper.vue.d.ts +129 -0
- package/dist/components/core/CollapsibleCard.vue.d.ts +1 -1
- package/dist/components/core/DataTable.stories.d.ts +38 -0
- package/dist/components/core/Dropdown.vue.d.ts +1 -1
- package/dist/components/core/Popover.vue.d.ts +2 -2
- package/dist/components/core/Tooltip.stories.d.ts +3 -0
- package/dist/components/core/index.cjs +39 -22
- package/dist/components/core/index.cjs.map +1 -1
- package/dist/components/core/index.d.ts +4 -1
- package/dist/components/core/index.js +39 -22
- package/dist/components/core/table/DataTable.test.d.ts +1 -0
- package/dist/components/core/{TableComponent.vue.d.ts → table/DataTable.vue.d.ts} +60 -7
- package/dist/components/core/table/Table.stories.d.ts +27 -0
- package/dist/components/core/table/atoms/Caption.test.d.ts +1 -0
- package/dist/components/core/table/atoms/Caption.vue.d.ts +26 -0
- package/dist/components/core/table/atoms/Col.test.d.ts +1 -0
- package/dist/components/core/table/atoms/Col.vue.d.ts +8 -0
- package/dist/components/core/table/atoms/Colgroup.test.d.ts +1 -0
- package/dist/components/core/table/atoms/Colgroup.vue.d.ts +17 -0
- package/dist/components/core/table/atoms/Table.test.d.ts +1 -0
- package/dist/components/core/table/atoms/Table.vue.d.ts +46 -0
- package/dist/components/core/table/atoms/Tbody.test.d.ts +1 -0
- package/dist/components/core/table/atoms/Tbody.vue.d.ts +17 -0
- package/dist/components/core/table/atoms/Td.test.d.ts +1 -0
- package/dist/components/core/table/atoms/Td.vue.d.ts +43 -0
- package/dist/components/core/table/atoms/Tfoot.test.d.ts +1 -0
- package/dist/components/core/table/atoms/Tfoot.vue.d.ts +17 -0
- package/dist/components/core/table/atoms/Th.test.d.ts +1 -0
- package/dist/components/core/table/atoms/Th.vue.d.ts +64 -0
- package/dist/components/core/table/atoms/Thead.test.d.ts +1 -0
- package/dist/components/core/table/atoms/Thead.vue.d.ts +17 -0
- package/dist/components/core/table/atoms/Tr.test.d.ts +1 -0
- package/dist/components/core/table/atoms/Tr.vue.d.ts +35 -0
- package/dist/components/core/table/atoms/index.d.ts +10 -0
- package/dist/components/core/table/index.d.ts +3 -0
- package/dist/components/core/table/molecules/ExpandableRow.test.d.ts +1 -0
- package/dist/components/core/table/molecules/ExpandableRow.vue.d.ts +47 -0
- package/dist/components/core/table/molecules/TableFooter.test.d.ts +1 -0
- package/dist/components/core/table/molecules/TableFooter.vue.d.ts +21 -0
- package/dist/components/core/table/molecules/TableHeader.test.d.ts +1 -0
- package/dist/components/core/table/molecules/TableHeader.vue.d.ts +49 -0
- package/dist/components/core/table/molecules/TableRow.test.d.ts +1 -0
- package/dist/components/core/table/molecules/TableRow.vue.d.ts +59 -0
- package/dist/components/core/table/molecules/index.d.ts +4 -0
- package/dist/components/feedback/Progress.vue.d.ts +1 -1
- package/dist/components/feedback/TableSkeleton.vue.d.ts +1 -1
- package/dist/components/feedback/index.cjs +14 -14
- package/dist/components/feedback/index.js +14 -14
- package/dist/components/form/Combobox.vue.d.ts +1 -1
- package/dist/components/form/DatePicker.vue.d.ts +1 -1
- package/dist/components/form/FormSection.vue.d.ts +1 -1
- package/dist/components/form/IconPicker.stories.d.ts +19 -0
- package/dist/components/form/IconPicker.test.d.ts +1 -0
- package/dist/components/form/InputWrapper.stories.d.ts +0 -5
- package/dist/components/form/Rating.vue.d.ts +1 -1
- package/dist/components/form/SearchInput.vue.d.ts +1 -1
- package/dist/components/form/index.js +2 -2
- package/dist/components/index.cjs +53 -36
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.js +65 -48
- package/dist/composables/index.cjs +15 -8
- package/dist/composables/index.cjs.map +1 -1
- package/dist/composables/index.d.ts +7 -0
- package/dist/composables/index.js +12 -5
- package/dist/composables/useColumnResize.d.ts +38 -0
- package/dist/composables/useColumnResize.test.d.ts +1 -0
- package/dist/composables/useColumnVisibility.d.ts +44 -0
- package/dist/composables/useColumnVisibility.test.d.ts +1 -0
- package/dist/composables/useEditableCell.d.ts +51 -0
- package/dist/composables/useEditableCell.test.d.ts +1 -0
- package/dist/composables/usePagination.d.ts +44 -0
- package/dist/composables/usePagination.test.d.ts +1 -0
- package/dist/composables/usePinnedRows.d.ts +41 -0
- package/dist/composables/usePinnedRows.test.d.ts +1 -0
- package/dist/composables/useTableKeyboardNavigation.d.ts +52 -0
- package/dist/composables/useTableKeyboardNavigation.test.d.ts +1 -0
- package/dist/composables/useVirtualScroll.d.ts +32 -0
- package/dist/composables/useVirtualScroll.test.d.ts +1 -0
- package/dist/index-0kwQORZJ.js +114 -0
- package/dist/index-0kwQORZJ.js.map +1 -0
- package/dist/{index-LFQFhClN.cjs → index-BMSH4AOz.cjs} +54 -37
- package/dist/{index-LFQFhClN.cjs.map → index-BMSH4AOz.cjs.map} +1 -1
- package/dist/{index-SNefWfX0.js → index-BaWpldIJ.js} +3 -3
- package/dist/{index-SNefWfX0.js.map → index-BaWpldIJ.js.map} +1 -1
- package/dist/index.cjs +69 -45
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +79 -55
- package/dist/style.css +1 -1
- package/dist/types/components.d.ts +1 -1
- package/dist/types/property.d.ts +8 -0
- package/dist/usePagination-BGwbICFC.js +135 -0
- package/dist/usePagination-BGwbICFC.js.map +1 -0
- package/dist/usePagination-gvvh1zqA.cjs +134 -0
- package/dist/usePagination-gvvh1zqA.cjs.map +1 -0
- package/dist/useVirtualScroll-BivP86fA.cjs +869 -0
- package/dist/useVirtualScroll-BivP86fA.cjs.map +1 -0
- package/dist/useVirtualScroll-YeZru2Eo.js +870 -0
- package/dist/useVirtualScroll-YeZru2Eo.js.map +1 -0
- package/package.json +1 -1
- package/dist/ConfirmDialog.vue_vue_type_script_setup_true_lang-BGUoa5fT.cjs.map +0 -1
- package/dist/ConfirmDialog.vue_vue_type_script_setup_true_lang-DWs2V7xX.js.map +0 -1
- package/dist/FilterTabs.vue_vue_type_script_setup_true_lang-BmJHgkBs.js.map +0 -1
- package/dist/FilterTabs.vue_vue_type_script_setup_true_lang-DYxh-wFx.cjs.map +0 -1
- package/dist/ListSkeleton.vue_vue_type_script_setup_true_lang-BwtEbaiT.js +0 -150
- package/dist/ListSkeleton.vue_vue_type_script_setup_true_lang-BwtEbaiT.js.map +0 -1
- package/dist/ListSkeleton.vue_vue_type_script_setup_true_lang-DtwwmfWr.cjs +0 -149
- package/dist/ListSkeleton.vue_vue_type_script_setup_true_lang-DtwwmfWr.cjs.map +0 -1
- package/dist/components/core/TableComponent.stories.d.ts +0 -16
- package/dist/index-CyL_6V7D.js +0 -97
- package/dist/index-CyL_6V7D.js.map +0 -1
- package/dist/useDarkMode-Cl5QWTlC.js +0 -53
- package/dist/useDarkMode-Cl5QWTlC.js.map +0 -1
- package/dist/useDarkMode-DLZcJEUQ.cjs +0 -52
- package/dist/useDarkMode-DLZcJEUQ.cjs.map +0 -1
- package/dist/useToast-Bk60GArg.cjs +0 -176
- package/dist/useToast-Bk60GArg.cjs.map +0 -1
- package/dist/useToast-ina5g3mj.js +0 -177
- package/dist/useToast-ina5g3mj.js.map +0 -1
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { defineComponent, computed, createBlock, createElementBlock, openBlock, createCommentVNode, renderSlot, normalizeClass, createElementVNode, createTextVNode, toDisplayString, useSlots,
|
|
2
|
-
import { _ as _sfc_main$o, u as useBreakpoints } from "./index-SNefWfX0.js";
|
|
3
|
-
import { a as _sfc_main$m, _ as _sfc_main$n, b as _sfc_main$u } from "./ListSkeleton.vue_vue_type_script_setup_true_lang-BwtEbaiT.js";
|
|
4
|
-
import { e as _sfc_main$p, d as _sfc_main$q, c as _sfc_main$r, b as _sfc_main$s, a as _sfc_main$t } from "./BadgeType.vue_vue_type_script_setup_true_lang-tHRMWBb-.js";
|
|
1
|
+
import { defineComponent, computed, createBlock, createElementBlock, openBlock, createCommentVNode, renderSlot, normalizeClass, createElementVNode, createTextVNode, toDisplayString, useSlots, withKeys, withModifiers, normalizeStyle, unref, useAttrs, toRefs, provide, reactive, mergeProps, normalizeProps, guardReactiveProps, inject, Fragment, withCtx, createVNode, renderList, resolveDynamicComponent, ref, createSlots, watch, withDirectives, vModelText, Teleport, Transition, nextTick, resolveComponent, vShow, onMounted, onUnmounted, mergeModels, useModel } from "vue";
|
|
5
2
|
import { Icon } from "@iconify/vue";
|
|
3
|
+
import { b as _sfc_main$B, a as _sfc_main$I, _ as _sfc_main$J, c as _sfc_main$K } from "./ListSkeleton.vue_vue_type_script_setup_true_lang-BHopJ9RG.js";
|
|
4
|
+
import { _ as _sfc_main$C, a as useBreakpoints } from "./index-BaWpldIJ.js";
|
|
5
|
+
import { e as _sfc_main$D, d as _sfc_main$E, c as _sfc_main$F, b as _sfc_main$G, a as _sfc_main$H } from "./BadgeType.vue_vue_type_script_setup_true_lang-tHRMWBb-.js";
|
|
6
|
+
import { a as usePagination, u as useDarkMode } from "./usePagination-BGwbICFC.js";
|
|
6
7
|
import { u as useDropdown } from "./useDropdown-XITCE_SM.js";
|
|
7
8
|
import { u as useId } from "./useId-xeHj7rkg.js";
|
|
8
|
-
|
|
9
|
-
const _hoisted_1$h = {
|
|
9
|
+
const _hoisted_1$o = {
|
|
10
10
|
key: 1,
|
|
11
11
|
class: "flex flex-col overflow-hidden rounded-lg bg-white shadow-md dark:bg-slate-950"
|
|
12
12
|
};
|
|
13
|
-
const _hoisted_2$
|
|
14
|
-
const _hoisted_3$
|
|
13
|
+
const _hoisted_2$g = { class: "flex flex-col gap-0.5" };
|
|
14
|
+
const _hoisted_3$a = {
|
|
15
15
|
key: 1,
|
|
16
16
|
class: "text-sm font-normal text-gray-600 dark:text-gray-400"
|
|
17
17
|
};
|
|
18
|
-
const _hoisted_4$
|
|
19
|
-
const _sfc_main$
|
|
18
|
+
const _hoisted_4$7 = { class: "flex gap-2" };
|
|
19
|
+
const _sfc_main$A = /* @__PURE__ */ defineComponent({
|
|
20
20
|
__name: "CardComponent",
|
|
21
21
|
props: {
|
|
22
22
|
title: {},
|
|
@@ -37,12 +37,12 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
|
37
37
|
() => props.dividerClass || "border-gray-200 dark:border-gray-700"
|
|
38
38
|
);
|
|
39
39
|
return (_ctx, _cache) => {
|
|
40
|
-
return __props.loading ? (openBlock(), createBlock(_sfc_main$
|
|
40
|
+
return __props.loading ? (openBlock(), createBlock(_sfc_main$B, {
|
|
41
41
|
key: 0,
|
|
42
42
|
lines: __props.loadingLines,
|
|
43
43
|
"show-avatar": __props.loadingAvatar,
|
|
44
44
|
"show-actions": __props.loadingActions
|
|
45
|
-
}, null, 8, ["lines", "show-avatar", "show-actions"])) : (openBlock(), createElementBlock("div", _hoisted_1$
|
|
45
|
+
}, null, 8, ["lines", "show-avatar", "show-actions"])) : (openBlock(), createElementBlock("div", _hoisted_1$o, [
|
|
46
46
|
_ctx.$slots.header ? (openBlock(), createElementBlock("div", {
|
|
47
47
|
key: 0,
|
|
48
48
|
class: normalizeClass(["border-b", dividerClasses.value])
|
|
@@ -52,7 +52,7 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
|
52
52
|
key: 1,
|
|
53
53
|
class: normalizeClass(["flex items-center justify-between border-b px-5 py-3", dividerClasses.value])
|
|
54
54
|
}, [
|
|
55
|
-
createElementVNode("div", _hoisted_2$
|
|
55
|
+
createElementVNode("div", _hoisted_2$g, [
|
|
56
56
|
__props.title || _ctx.$slots.title ? (openBlock(), createElementBlock("span", {
|
|
57
57
|
key: 0,
|
|
58
58
|
class: normalizeClass(["text-md font-semibold", titleClasses.value])
|
|
@@ -61,13 +61,13 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
|
61
61
|
createTextVNode(toDisplayString(__props.title), 1)
|
|
62
62
|
])
|
|
63
63
|
], 2)) : createCommentVNode("", true),
|
|
64
|
-
__props.description || _ctx.$slots.description ? (openBlock(), createElementBlock("span", _hoisted_3$
|
|
64
|
+
__props.description || _ctx.$slots.description ? (openBlock(), createElementBlock("span", _hoisted_3$a, [
|
|
65
65
|
renderSlot(_ctx.$slots, "description", {}, () => [
|
|
66
66
|
createTextVNode(toDisplayString(__props.description), 1)
|
|
67
67
|
])
|
|
68
68
|
])) : createCommentVNode("", true)
|
|
69
69
|
]),
|
|
70
|
-
createElementVNode("div", _hoisted_4$
|
|
70
|
+
createElementVNode("div", _hoisted_4$7, [
|
|
71
71
|
renderSlot(_ctx.$slots, "actions")
|
|
72
72
|
])
|
|
73
73
|
], 2)) : createCommentVNode("", true),
|
|
@@ -76,73 +76,841 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
|
76
76
|
};
|
|
77
77
|
}
|
|
78
78
|
});
|
|
79
|
-
const _hoisted_1$
|
|
80
|
-
const _hoisted_2$
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
};
|
|
84
|
-
const
|
|
85
|
-
const
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
|
|
79
|
+
const _hoisted_1$n = ["role", "tabindex", "onKeydown"];
|
|
80
|
+
const _hoisted_2$f = ["src", "alt"];
|
|
81
|
+
const _hoisted_3$9 = ["src", "alt"];
|
|
82
|
+
const _hoisted_4$6 = { class: "flex items-center gap-3" };
|
|
83
|
+
const _hoisted_5$4 = { class: "flex flex-col gap-0.5" };
|
|
84
|
+
const _hoisted_6$3 = ["src", "alt"];
|
|
85
|
+
const _sfc_main$z = /* @__PURE__ */ defineComponent({
|
|
86
|
+
__name: "CardWrapper",
|
|
87
|
+
props: {
|
|
88
|
+
title: {},
|
|
89
|
+
description: {},
|
|
90
|
+
icon: {},
|
|
91
|
+
shadow: { default: "md" },
|
|
92
|
+
rounded: { default: "lg" },
|
|
93
|
+
padding: { default: "none" },
|
|
94
|
+
headerPadding: { default: "md" },
|
|
95
|
+
border: { default: "none" },
|
|
96
|
+
variant: { default: "default" },
|
|
97
|
+
accent: { default: "none" },
|
|
98
|
+
headerDivider: { type: Boolean, default: true },
|
|
99
|
+
footerDivider: { type: Boolean, default: true },
|
|
100
|
+
clickable: { type: Boolean, default: false },
|
|
101
|
+
selected: { type: Boolean, default: false },
|
|
102
|
+
disabled: { type: Boolean, default: false },
|
|
103
|
+
image: {},
|
|
104
|
+
imageAlt: {},
|
|
105
|
+
imagePosition: { default: "top" },
|
|
106
|
+
imageHeight: { default: "200px" },
|
|
107
|
+
imageWidth: { default: "200px" },
|
|
108
|
+
loading: { type: Boolean, default: false },
|
|
109
|
+
loadingLines: { default: 3 },
|
|
110
|
+
loadingAvatar: { type: Boolean, default: false },
|
|
111
|
+
loadingActions: { type: Boolean, default: false },
|
|
112
|
+
cardClass: {},
|
|
113
|
+
headerClass: {},
|
|
114
|
+
titleClass: {},
|
|
115
|
+
descriptionClass: {},
|
|
116
|
+
iconClass: {},
|
|
117
|
+
iconElementClass: {},
|
|
118
|
+
contentClass: {},
|
|
119
|
+
footerClass: {},
|
|
120
|
+
dividerClass: {},
|
|
121
|
+
actionsClass: {},
|
|
122
|
+
imageClass: {}
|
|
123
|
+
},
|
|
124
|
+
emits: ["click"],
|
|
125
|
+
setup(__props, { emit: __emit }) {
|
|
126
|
+
const props = __props;
|
|
127
|
+
const emit = __emit;
|
|
128
|
+
const slots = useSlots();
|
|
129
|
+
const hasHeader = computed(
|
|
130
|
+
() => props.title || props.description || props.icon || slots.header || slots.title || slots.description || slots.icon || slots.actions
|
|
131
|
+
);
|
|
132
|
+
const hasFooter = computed(() => !!slots.footer);
|
|
133
|
+
const hasImage = computed(() => !!props.image || !!slots.image);
|
|
134
|
+
const isHorizontal = computed(() => props.imagePosition === "left" || props.imagePosition === "right");
|
|
135
|
+
const shadowClasses = computed(() => {
|
|
136
|
+
const map = {
|
|
137
|
+
none: "",
|
|
138
|
+
sm: "shadow-sm",
|
|
139
|
+
md: "shadow-md",
|
|
140
|
+
lg: "shadow-lg",
|
|
141
|
+
xl: "shadow-xl"
|
|
142
|
+
};
|
|
143
|
+
return map[props.shadow];
|
|
144
|
+
});
|
|
145
|
+
const roundedClasses = computed(() => {
|
|
146
|
+
const map = {
|
|
147
|
+
none: "rounded-none",
|
|
148
|
+
sm: "rounded-sm",
|
|
149
|
+
md: "rounded-md",
|
|
150
|
+
lg: "rounded-lg",
|
|
151
|
+
xl: "rounded-xl",
|
|
152
|
+
full: "rounded-3xl"
|
|
153
|
+
};
|
|
154
|
+
return map[props.rounded];
|
|
155
|
+
});
|
|
156
|
+
const paddingClasses = computed(() => {
|
|
157
|
+
const map = {
|
|
158
|
+
none: "",
|
|
159
|
+
sm: "p-3",
|
|
160
|
+
md: "p-5",
|
|
161
|
+
lg: "p-6"
|
|
162
|
+
};
|
|
163
|
+
return map[props.padding];
|
|
164
|
+
});
|
|
165
|
+
const headerPaddingClasses = computed(() => {
|
|
166
|
+
const map = {
|
|
167
|
+
none: "",
|
|
168
|
+
sm: "px-3 py-2",
|
|
169
|
+
md: "px-5 py-3",
|
|
170
|
+
lg: "px-6 py-4"
|
|
171
|
+
};
|
|
172
|
+
return map[props.headerPadding];
|
|
173
|
+
});
|
|
174
|
+
const footerPaddingClasses = computed(() => {
|
|
175
|
+
const map = {
|
|
176
|
+
none: "",
|
|
177
|
+
sm: "px-3 py-2",
|
|
178
|
+
md: "px-5 py-3",
|
|
179
|
+
lg: "px-6 py-4"
|
|
180
|
+
};
|
|
181
|
+
return map[props.headerPadding];
|
|
182
|
+
});
|
|
183
|
+
const borderClasses = computed(() => {
|
|
184
|
+
const map = {
|
|
185
|
+
none: "",
|
|
186
|
+
default: "border border-gray-200 dark:border-gray-700",
|
|
187
|
+
primary: "border border-primary-500 dark:border-primary-400",
|
|
188
|
+
secondary: "border border-secondary-500 dark:border-secondary-400"
|
|
189
|
+
};
|
|
190
|
+
return map[props.border];
|
|
191
|
+
});
|
|
192
|
+
const variantClasses = computed(() => {
|
|
193
|
+
const map = {
|
|
194
|
+
default: "bg-white dark:bg-slate-950",
|
|
195
|
+
glass: "bg-white/15 backdrop-blur-sm",
|
|
196
|
+
outline: "bg-transparent",
|
|
197
|
+
flat: "bg-gray-50 dark:bg-slate-900"
|
|
198
|
+
};
|
|
199
|
+
return map[props.variant];
|
|
200
|
+
});
|
|
201
|
+
const accentClasses = computed(() => {
|
|
202
|
+
if (props.accent === "none") return "";
|
|
203
|
+
const colorMap = {
|
|
204
|
+
primary: "border-primary-500",
|
|
205
|
+
secondary: "border-secondary-500",
|
|
206
|
+
success: "border-emerald-500",
|
|
207
|
+
warning: "border-amber-500",
|
|
208
|
+
danger: "border-red-500",
|
|
209
|
+
info: "border-blue-500"
|
|
210
|
+
};
|
|
211
|
+
const position = isHorizontal.value ? "border-l-4" : "border-t-4";
|
|
212
|
+
return `${position} ${colorMap[props.accent]}`;
|
|
213
|
+
});
|
|
214
|
+
const interactiveClasses = computed(() => {
|
|
215
|
+
if (props.disabled) {
|
|
216
|
+
return "opacity-60 cursor-not-allowed";
|
|
217
|
+
}
|
|
218
|
+
if (props.clickable) {
|
|
219
|
+
return "cursor-pointer transition-all duration-200 hover:shadow-lg hover:-translate-y-0.5 active:translate-y-0 active:shadow-md";
|
|
220
|
+
}
|
|
221
|
+
return "";
|
|
222
|
+
});
|
|
223
|
+
const selectedClasses = computed(() => {
|
|
224
|
+
if (!props.selected) return "";
|
|
225
|
+
return "ring-2 ring-primary-500 ring-offset-2 dark:ring-offset-slate-900";
|
|
226
|
+
});
|
|
227
|
+
const computedDividerClass = computed(
|
|
228
|
+
() => props.dividerClass || "border-gray-200 dark:border-gray-700"
|
|
229
|
+
);
|
|
230
|
+
const computedTitleClass = computed(
|
|
231
|
+
() => props.titleClass || "text-gray-800 dark:text-gray-200"
|
|
232
|
+
);
|
|
233
|
+
const computedDescriptionClass = computed(
|
|
234
|
+
() => props.descriptionClass || "text-gray-600 dark:text-gray-400"
|
|
235
|
+
);
|
|
236
|
+
const computedIconClass = computed(
|
|
237
|
+
() => props.iconClass || "flex items-center justify-center size-10 rounded-lg bg-primary-100 dark:bg-primary-900/30"
|
|
238
|
+
);
|
|
239
|
+
const computedIconElementClass = computed(
|
|
240
|
+
() => props.iconElementClass || "size-5 text-primary-600 dark:text-primary-400"
|
|
241
|
+
);
|
|
242
|
+
const imageContainerClasses = computed(() => {
|
|
243
|
+
const base = "overflow-hidden flex-shrink-0";
|
|
244
|
+
switch (props.imagePosition) {
|
|
245
|
+
case "left":
|
|
246
|
+
return `${base} rounded-l-lg`;
|
|
247
|
+
case "right":
|
|
248
|
+
return `${base} rounded-r-lg`;
|
|
249
|
+
case "top":
|
|
250
|
+
return `${base} rounded-t-lg`;
|
|
251
|
+
case "bottom":
|
|
252
|
+
return `${base} rounded-b-lg`;
|
|
253
|
+
case "background":
|
|
254
|
+
return "absolute inset-0";
|
|
255
|
+
default:
|
|
256
|
+
return base;
|
|
257
|
+
}
|
|
258
|
+
});
|
|
259
|
+
const imageStyle = computed(() => {
|
|
260
|
+
if (props.imagePosition === "background") {
|
|
261
|
+
return {};
|
|
262
|
+
}
|
|
263
|
+
if (isHorizontal.value) {
|
|
264
|
+
return { width: props.imageWidth };
|
|
265
|
+
}
|
|
266
|
+
return { height: props.imageHeight };
|
|
267
|
+
});
|
|
268
|
+
const handleClick = (event) => {
|
|
269
|
+
if (props.disabled) return;
|
|
270
|
+
if (props.clickable) {
|
|
271
|
+
emit("click", event);
|
|
272
|
+
}
|
|
273
|
+
};
|
|
274
|
+
return (_ctx, _cache) => {
|
|
275
|
+
return __props.loading ? (openBlock(), createBlock(_sfc_main$B, {
|
|
276
|
+
key: 0,
|
|
277
|
+
lines: __props.loadingLines,
|
|
278
|
+
"show-avatar": __props.loadingAvatar,
|
|
279
|
+
"show-actions": __props.loadingActions
|
|
280
|
+
}, null, 8, ["lines", "show-avatar", "show-actions"])) : (openBlock(), createElementBlock("div", {
|
|
281
|
+
key: 1,
|
|
282
|
+
class: normalizeClass([
|
|
283
|
+
"overflow-hidden relative",
|
|
284
|
+
isHorizontal.value ? "flex" : "flex flex-col",
|
|
285
|
+
__props.imagePosition === "right" && "flex-row-reverse",
|
|
286
|
+
shadowClasses.value,
|
|
287
|
+
roundedClasses.value,
|
|
288
|
+
borderClasses.value,
|
|
289
|
+
variantClasses.value,
|
|
290
|
+
accentClasses.value,
|
|
291
|
+
interactiveClasses.value,
|
|
292
|
+
selectedClasses.value,
|
|
293
|
+
__props.cardClass
|
|
294
|
+
]),
|
|
295
|
+
role: __props.clickable ? "button" : void 0,
|
|
296
|
+
tabindex: __props.clickable && !__props.disabled ? 0 : void 0,
|
|
297
|
+
onClick: handleClick,
|
|
298
|
+
onKeydown: [
|
|
299
|
+
withKeys(handleClick, ["enter"]),
|
|
300
|
+
withKeys(withModifiers(handleClick, ["prevent"]), ["space"])
|
|
301
|
+
]
|
|
302
|
+
}, [
|
|
303
|
+
hasImage.value && __props.imagePosition === "background" ? (openBlock(), createElementBlock("div", {
|
|
304
|
+
key: 0,
|
|
305
|
+
class: normalizeClass(imageContainerClasses.value)
|
|
306
|
+
}, [
|
|
307
|
+
renderSlot(_ctx.$slots, "image", {}, () => [
|
|
308
|
+
__props.image ? (openBlock(), createElementBlock("img", {
|
|
309
|
+
key: 0,
|
|
310
|
+
src: __props.image,
|
|
311
|
+
alt: __props.imageAlt || "",
|
|
312
|
+
class: normalizeClass(["w-full h-full object-cover", __props.imageClass])
|
|
313
|
+
}, null, 10, _hoisted_2$f)) : createCommentVNode("", true)
|
|
314
|
+
]),
|
|
315
|
+
_cache[0] || (_cache[0] = createElementVNode("div", { class: "absolute inset-0 bg-gradient-to-t from-black/60 to-transparent" }, null, -1))
|
|
316
|
+
], 2)) : createCommentVNode("", true),
|
|
317
|
+
hasImage.value && (__props.imagePosition === "left" || __props.imagePosition === "top") ? (openBlock(), createElementBlock("div", {
|
|
318
|
+
key: 1,
|
|
319
|
+
class: normalizeClass(imageContainerClasses.value),
|
|
320
|
+
style: normalizeStyle(imageStyle.value)
|
|
321
|
+
}, [
|
|
322
|
+
renderSlot(_ctx.$slots, "image", {}, () => [
|
|
323
|
+
__props.image ? (openBlock(), createElementBlock("img", {
|
|
324
|
+
key: 0,
|
|
325
|
+
src: __props.image,
|
|
326
|
+
alt: __props.imageAlt || "",
|
|
327
|
+
class: normalizeClass(["w-full h-full object-cover", __props.imageClass])
|
|
328
|
+
}, null, 10, _hoisted_3$9)) : createCommentVNode("", true)
|
|
329
|
+
])
|
|
330
|
+
], 6)) : createCommentVNode("", true),
|
|
331
|
+
createElementVNode("div", {
|
|
332
|
+
class: normalizeClass(["flex flex-col flex-1 min-w-0", __props.imagePosition === "background" && "relative z-10"])
|
|
333
|
+
}, [
|
|
334
|
+
_ctx.$slots.header ? (openBlock(), createElementBlock("div", {
|
|
335
|
+
key: 0,
|
|
336
|
+
class: normalizeClass([
|
|
337
|
+
__props.headerDivider && "border-b",
|
|
338
|
+
computedDividerClass.value,
|
|
339
|
+
__props.headerClass
|
|
340
|
+
])
|
|
341
|
+
}, [
|
|
342
|
+
renderSlot(_ctx.$slots, "header")
|
|
343
|
+
], 2)) : hasHeader.value ? (openBlock(), createElementBlock("div", {
|
|
344
|
+
key: 1,
|
|
345
|
+
class: normalizeClass([
|
|
346
|
+
"flex items-center justify-between gap-4",
|
|
347
|
+
headerPaddingClasses.value,
|
|
348
|
+
__props.headerDivider && "border-b",
|
|
349
|
+
computedDividerClass.value,
|
|
350
|
+
__props.headerClass,
|
|
351
|
+
__props.imagePosition === "background" && "text-white border-white/20"
|
|
352
|
+
])
|
|
353
|
+
}, [
|
|
354
|
+
createElementVNode("div", _hoisted_4$6, [
|
|
355
|
+
__props.icon || _ctx.$slots.icon ? (openBlock(), createElementBlock("div", {
|
|
356
|
+
key: 0,
|
|
357
|
+
class: normalizeClass(computedIconClass.value)
|
|
358
|
+
}, [
|
|
359
|
+
renderSlot(_ctx.$slots, "icon", {}, () => [
|
|
360
|
+
__props.icon ? (openBlock(), createBlock(unref(Icon), {
|
|
361
|
+
key: 0,
|
|
362
|
+
icon: __props.icon,
|
|
363
|
+
class: normalizeClass(computedIconElementClass.value)
|
|
364
|
+
}, null, 8, ["icon", "class"])) : createCommentVNode("", true)
|
|
365
|
+
])
|
|
366
|
+
], 2)) : createCommentVNode("", true),
|
|
367
|
+
createElementVNode("div", _hoisted_5$4, [
|
|
368
|
+
__props.title || _ctx.$slots.title ? (openBlock(), createElementBlock("span", {
|
|
369
|
+
key: 0,
|
|
370
|
+
class: normalizeClass([
|
|
371
|
+
"text-md font-semibold",
|
|
372
|
+
__props.imagePosition === "background" ? "text-white" : computedTitleClass.value
|
|
373
|
+
])
|
|
374
|
+
}, [
|
|
375
|
+
renderSlot(_ctx.$slots, "title", {}, () => [
|
|
376
|
+
createTextVNode(toDisplayString(__props.title), 1)
|
|
377
|
+
])
|
|
378
|
+
], 2)) : createCommentVNode("", true),
|
|
379
|
+
__props.description || _ctx.$slots.description ? (openBlock(), createElementBlock("span", {
|
|
380
|
+
key: 1,
|
|
381
|
+
class: normalizeClass([
|
|
382
|
+
"text-sm font-normal",
|
|
383
|
+
__props.imagePosition === "background" ? "text-white/80" : computedDescriptionClass.value
|
|
384
|
+
])
|
|
385
|
+
}, [
|
|
386
|
+
renderSlot(_ctx.$slots, "description", {}, () => [
|
|
387
|
+
createTextVNode(toDisplayString(__props.description), 1)
|
|
388
|
+
])
|
|
389
|
+
], 2)) : createCommentVNode("", true)
|
|
390
|
+
])
|
|
391
|
+
]),
|
|
392
|
+
_ctx.$slots.actions ? (openBlock(), createElementBlock("div", {
|
|
393
|
+
key: 0,
|
|
394
|
+
class: normalizeClass(["flex gap-2", __props.actionsClass])
|
|
395
|
+
}, [
|
|
396
|
+
renderSlot(_ctx.$slots, "actions")
|
|
397
|
+
], 2)) : createCommentVNode("", true)
|
|
398
|
+
], 2)) : createCommentVNode("", true),
|
|
399
|
+
createElementVNode("div", {
|
|
400
|
+
class: normalizeClass(["flex-1", paddingClasses.value, __props.contentClass])
|
|
401
|
+
}, [
|
|
402
|
+
renderSlot(_ctx.$slots, "default")
|
|
403
|
+
], 2),
|
|
404
|
+
hasFooter.value ? (openBlock(), createElementBlock("div", {
|
|
405
|
+
key: 2,
|
|
406
|
+
class: normalizeClass([
|
|
407
|
+
__props.footerDivider && "border-t",
|
|
408
|
+
computedDividerClass.value,
|
|
409
|
+
footerPaddingClasses.value,
|
|
410
|
+
__props.footerClass,
|
|
411
|
+
__props.imagePosition === "background" && "text-white border-white/20"
|
|
412
|
+
])
|
|
413
|
+
}, [
|
|
414
|
+
renderSlot(_ctx.$slots, "footer")
|
|
415
|
+
], 2)) : createCommentVNode("", true)
|
|
416
|
+
], 2),
|
|
417
|
+
hasImage.value && (__props.imagePosition === "right" || __props.imagePosition === "bottom") ? (openBlock(), createElementBlock("div", {
|
|
418
|
+
key: 2,
|
|
419
|
+
class: normalizeClass(imageContainerClasses.value),
|
|
420
|
+
style: normalizeStyle(imageStyle.value)
|
|
421
|
+
}, [
|
|
422
|
+
renderSlot(_ctx.$slots, "image", {}, () => [
|
|
423
|
+
__props.image ? (openBlock(), createElementBlock("img", {
|
|
424
|
+
key: 0,
|
|
425
|
+
src: __props.image,
|
|
426
|
+
alt: __props.imageAlt || "",
|
|
427
|
+
class: normalizeClass(["w-full h-full object-cover", __props.imageClass])
|
|
428
|
+
}, null, 10, _hoisted_6$3)) : createCommentVNode("", true)
|
|
429
|
+
])
|
|
430
|
+
], 6)) : createCommentVNode("", true)
|
|
431
|
+
], 42, _hoisted_1$n));
|
|
432
|
+
};
|
|
433
|
+
}
|
|
434
|
+
});
|
|
435
|
+
const _hoisted_1$m = { class: "overflow-x-auto" };
|
|
436
|
+
const TableContextKey = Symbol("TableContext");
|
|
437
|
+
const _sfc_main$y = /* @__PURE__ */ defineComponent({
|
|
438
|
+
...{
|
|
439
|
+
inheritAttrs: false
|
|
440
|
+
},
|
|
441
|
+
__name: "Table",
|
|
442
|
+
props: {
|
|
443
|
+
striped: { type: Boolean, default: false },
|
|
444
|
+
bordered: { type: Boolean, default: false },
|
|
445
|
+
hover: { type: Boolean, default: true },
|
|
446
|
+
compact: { type: Boolean, default: false },
|
|
447
|
+
stickyHeader: { type: Boolean, default: false }
|
|
448
|
+
},
|
|
449
|
+
setup(__props) {
|
|
450
|
+
const attrs = useAttrs();
|
|
451
|
+
const props = __props;
|
|
452
|
+
const tableClasses = computed(() => [
|
|
453
|
+
"w-full text-left",
|
|
454
|
+
props.bordered ? "border border-gray-200 dark:border-gray-700" : ""
|
|
455
|
+
]);
|
|
456
|
+
const wrapperClasses = computed(() => [
|
|
457
|
+
"overflow-hidden",
|
|
458
|
+
props.stickyHeader ? "max-h-[600px] overflow-y-auto" : ""
|
|
459
|
+
]);
|
|
460
|
+
const { striped, bordered, hover, compact, stickyHeader } = toRefs(props);
|
|
461
|
+
provide(TableContextKey, reactive({
|
|
462
|
+
striped,
|
|
463
|
+
bordered,
|
|
464
|
+
hover,
|
|
465
|
+
compact,
|
|
466
|
+
stickyHeader
|
|
467
|
+
}));
|
|
468
|
+
return (_ctx, _cache) => {
|
|
469
|
+
return openBlock(), createElementBlock("div", {
|
|
470
|
+
class: normalizeClass(wrapperClasses.value)
|
|
471
|
+
}, [
|
|
472
|
+
createElementVNode("div", _hoisted_1$m, [
|
|
473
|
+
createElementVNode("table", mergeProps(unref(attrs), { class: tableClasses.value }), [
|
|
474
|
+
renderSlot(_ctx.$slots, "default")
|
|
475
|
+
], 16)
|
|
476
|
+
])
|
|
477
|
+
], 2);
|
|
478
|
+
};
|
|
479
|
+
}
|
|
480
|
+
});
|
|
481
|
+
const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
482
|
+
...{
|
|
483
|
+
inheritAttrs: false
|
|
484
|
+
},
|
|
485
|
+
__name: "Caption",
|
|
486
|
+
props: {
|
|
487
|
+
position: { default: "top" },
|
|
488
|
+
srOnly: { type: Boolean, default: false }
|
|
489
|
+
},
|
|
490
|
+
setup(__props) {
|
|
491
|
+
const attrs = useAttrs();
|
|
492
|
+
return (_ctx, _cache) => {
|
|
493
|
+
return openBlock(), createElementBlock("caption", mergeProps(unref(attrs), {
|
|
494
|
+
class: [
|
|
495
|
+
__props.position === "bottom" ? "caption-bottom" : "caption-top",
|
|
496
|
+
__props.srOnly ? "sr-only" : "py-2 text-sm text-gray-600 dark:text-gray-400"
|
|
497
|
+
]
|
|
498
|
+
}), [
|
|
499
|
+
renderSlot(_ctx.$slots, "default")
|
|
500
|
+
], 16);
|
|
501
|
+
};
|
|
502
|
+
}
|
|
503
|
+
});
|
|
504
|
+
const _sfc_main$w = /* @__PURE__ */ defineComponent({
|
|
505
|
+
...{
|
|
506
|
+
inheritAttrs: false
|
|
507
|
+
},
|
|
508
|
+
__name: "Colgroup",
|
|
509
|
+
setup(__props) {
|
|
510
|
+
const attrs = useAttrs();
|
|
511
|
+
return (_ctx, _cache) => {
|
|
512
|
+
return openBlock(), createElementBlock("colgroup", normalizeProps(guardReactiveProps(unref(attrs))), [
|
|
513
|
+
renderSlot(_ctx.$slots, "default")
|
|
514
|
+
], 16);
|
|
515
|
+
};
|
|
516
|
+
}
|
|
517
|
+
});
|
|
518
|
+
const _hoisted_1$l = ["span"];
|
|
519
|
+
const _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
520
|
+
...{
|
|
521
|
+
inheritAttrs: false
|
|
522
|
+
},
|
|
523
|
+
__name: "Col",
|
|
524
|
+
props: {
|
|
525
|
+
span: {},
|
|
526
|
+
width: {}
|
|
527
|
+
},
|
|
528
|
+
setup(__props) {
|
|
529
|
+
const props = __props;
|
|
530
|
+
const attrs = useAttrs();
|
|
531
|
+
const colStyles = computed(() => ({
|
|
532
|
+
width: props.width
|
|
533
|
+
}));
|
|
534
|
+
return (_ctx, _cache) => {
|
|
535
|
+
return openBlock(), createElementBlock("col", mergeProps(unref(attrs), {
|
|
536
|
+
span: __props.span,
|
|
537
|
+
style: colStyles.value
|
|
538
|
+
}), null, 16, _hoisted_1$l);
|
|
539
|
+
};
|
|
540
|
+
}
|
|
541
|
+
});
|
|
542
|
+
const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
543
|
+
...{
|
|
544
|
+
inheritAttrs: false
|
|
545
|
+
},
|
|
546
|
+
__name: "Thead",
|
|
547
|
+
setup(__props) {
|
|
548
|
+
const context = inject(TableContextKey);
|
|
549
|
+
const attrs = useAttrs();
|
|
550
|
+
const theadClasses = computed(() => [
|
|
551
|
+
"text-sm font-semibold text-gray-600 uppercase dark:text-gray-400",
|
|
552
|
+
(context == null ? void 0 : context.bordered) ? "border-b border-gray-200 dark:border-gray-700" : "border-b border-black/10 dark:border-white/10",
|
|
553
|
+
(context == null ? void 0 : context.stickyHeader) ? "sticky top-0 z-10" : ""
|
|
554
|
+
]);
|
|
555
|
+
return (_ctx, _cache) => {
|
|
556
|
+
return openBlock(), createElementBlock("thead", mergeProps(unref(attrs), {
|
|
557
|
+
class: [theadClasses.value, "bg-black/5 dark:bg-white/5"]
|
|
558
|
+
}), [
|
|
559
|
+
renderSlot(_ctx.$slots, "default")
|
|
560
|
+
], 16);
|
|
561
|
+
};
|
|
562
|
+
}
|
|
563
|
+
});
|
|
564
|
+
const _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
565
|
+
...{
|
|
566
|
+
inheritAttrs: false
|
|
567
|
+
},
|
|
568
|
+
__name: "Tbody",
|
|
569
|
+
setup(__props) {
|
|
570
|
+
const context = inject(TableContextKey);
|
|
571
|
+
const attrs = useAttrs();
|
|
572
|
+
const tbodyClasses = computed(() => [
|
|
573
|
+
"font-medium",
|
|
574
|
+
(context == null ? void 0 : context.bordered) ? "divide-y divide-gray-200 dark:divide-gray-700" : "divide-y divide-black/10 dark:divide-white/10"
|
|
575
|
+
]);
|
|
576
|
+
return (_ctx, _cache) => {
|
|
577
|
+
return openBlock(), createElementBlock("tbody", mergeProps(unref(attrs), { class: tbodyClasses.value }), [
|
|
578
|
+
renderSlot(_ctx.$slots, "default")
|
|
579
|
+
], 16);
|
|
580
|
+
};
|
|
581
|
+
}
|
|
582
|
+
});
|
|
583
|
+
const _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
584
|
+
...{
|
|
585
|
+
inheritAttrs: false
|
|
586
|
+
},
|
|
587
|
+
__name: "Tfoot",
|
|
588
|
+
setup(__props) {
|
|
589
|
+
const context = inject(TableContextKey);
|
|
590
|
+
const attrs = useAttrs();
|
|
591
|
+
const tfootClasses = computed(() => [
|
|
592
|
+
"text-sm font-medium text-gray-600 dark:text-gray-400",
|
|
593
|
+
(context == null ? void 0 : context.bordered) ? "border-t border-gray-200 dark:border-gray-700" : "border-t border-black/10 dark:border-white/10"
|
|
594
|
+
]);
|
|
595
|
+
return (_ctx, _cache) => {
|
|
596
|
+
return openBlock(), createElementBlock("tfoot", mergeProps(unref(attrs), {
|
|
597
|
+
class: [tfootClasses.value, "bg-black/5 dark:bg-white/5"]
|
|
598
|
+
}), [
|
|
599
|
+
renderSlot(_ctx.$slots, "default")
|
|
600
|
+
], 16);
|
|
601
|
+
};
|
|
602
|
+
}
|
|
603
|
+
});
|
|
604
|
+
const _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
605
|
+
...{
|
|
606
|
+
inheritAttrs: false
|
|
607
|
+
},
|
|
608
|
+
__name: "Tr",
|
|
609
|
+
props: {
|
|
610
|
+
selected: { type: Boolean, default: false },
|
|
611
|
+
clickable: { type: Boolean, default: false },
|
|
612
|
+
disabled: { type: Boolean, default: false },
|
|
613
|
+
even: { type: Boolean }
|
|
614
|
+
},
|
|
615
|
+
emits: ["click"],
|
|
616
|
+
setup(__props, { emit: __emit }) {
|
|
617
|
+
const props = __props;
|
|
618
|
+
const attrs = useAttrs();
|
|
619
|
+
const emit = __emit;
|
|
620
|
+
const context = inject(TableContextKey);
|
|
621
|
+
const rowClasses = computed(() => [
|
|
622
|
+
"transition-colors",
|
|
623
|
+
// Hover effect
|
|
624
|
+
(context == null ? void 0 : context.hover) && !props.disabled ? "hover:bg-black/5 dark:hover:bg-white/5" : "",
|
|
625
|
+
// Selected state
|
|
626
|
+
props.selected ? "bg-primary-50 dark:bg-primary-900/20" : "",
|
|
627
|
+
// Striped (only apply if not selected)
|
|
628
|
+
(context == null ? void 0 : context.striped) && props.even && !props.selected ? "bg-black/[0.02] dark:bg-white/[0.02]" : "",
|
|
629
|
+
// Clickable
|
|
630
|
+
props.clickable && !props.disabled ? "cursor-pointer" : "",
|
|
631
|
+
// Disabled
|
|
632
|
+
props.disabled ? "opacity-50 cursor-not-allowed" : ""
|
|
633
|
+
]);
|
|
634
|
+
const handleClick = (event) => {
|
|
635
|
+
if (props.clickable && !props.disabled) {
|
|
636
|
+
emit("click", event);
|
|
637
|
+
}
|
|
638
|
+
};
|
|
639
|
+
return (_ctx, _cache) => {
|
|
640
|
+
return openBlock(), createElementBlock("tr", mergeProps(unref(attrs), {
|
|
641
|
+
class: rowClasses.value,
|
|
642
|
+
onClick: handleClick
|
|
643
|
+
}), [
|
|
644
|
+
renderSlot(_ctx.$slots, "default")
|
|
645
|
+
], 16);
|
|
646
|
+
};
|
|
647
|
+
}
|
|
648
|
+
});
|
|
649
|
+
const _hoisted_1$k = ["colspan", "rowspan", "scope", "aria-sort"];
|
|
650
|
+
const _hoisted_2$e = {
|
|
92
651
|
key: 0,
|
|
93
652
|
d: "M7 14l5-5 5 5H7z"
|
|
94
653
|
};
|
|
95
|
-
const
|
|
654
|
+
const _hoisted_3$8 = {
|
|
96
655
|
key: 1,
|
|
97
656
|
d: "M7 10l5 5 5-5H7z"
|
|
98
657
|
};
|
|
99
|
-
const
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
const _hoisted_11$1 = {
|
|
105
|
-
key: 0,
|
|
106
|
-
class: "px-3 py-4"
|
|
107
|
-
};
|
|
108
|
-
const _hoisted_12$1 = {
|
|
109
|
-
key: 1,
|
|
110
|
-
class: "flex items-center justify-end gap-2 px-3 py-4"
|
|
111
|
-
};
|
|
112
|
-
const _hoisted_13 = { key: 0 };
|
|
113
|
-
const _sfc_main$k = /* @__PURE__ */ defineComponent({
|
|
114
|
-
__name: "TableComponent",
|
|
658
|
+
const _sfc_main$q = /* @__PURE__ */ defineComponent({
|
|
659
|
+
...{
|
|
660
|
+
inheritAttrs: false
|
|
661
|
+
},
|
|
662
|
+
__name: "Th",
|
|
115
663
|
props: {
|
|
116
|
-
|
|
117
|
-
|
|
664
|
+
sortable: { type: Boolean, default: false },
|
|
665
|
+
sorted: { type: Boolean, default: false },
|
|
666
|
+
sortDirection: { default: "asc" },
|
|
667
|
+
align: { default: "left" },
|
|
668
|
+
width: {},
|
|
669
|
+
minWidth: {},
|
|
670
|
+
maxWidth: {},
|
|
671
|
+
sticky: { type: Boolean, default: false },
|
|
672
|
+
stickyLeft: { default: "0" },
|
|
673
|
+
colspan: {},
|
|
674
|
+
rowspan: {},
|
|
675
|
+
scope: { default: "col" },
|
|
676
|
+
resizable: { type: Boolean, default: false },
|
|
677
|
+
resizing: { type: Boolean, default: false }
|
|
678
|
+
},
|
|
679
|
+
emits: ["sort", "resizeStart"],
|
|
680
|
+
setup(__props, { emit: __emit }) {
|
|
681
|
+
const props = __props;
|
|
682
|
+
const attrs = useAttrs();
|
|
683
|
+
const emit = __emit;
|
|
684
|
+
const context = inject(TableContextKey);
|
|
685
|
+
const thClasses = computed(() => [
|
|
686
|
+
// Padding
|
|
687
|
+
(context == null ? void 0 : context.compact) ? "px-2 py-2" : "px-3 py-3",
|
|
688
|
+
// Alignment
|
|
689
|
+
props.align === "center" ? "text-center" : props.align === "right" ? "text-right" : "text-left",
|
|
690
|
+
// Sortable hover
|
|
691
|
+
props.sortable ? "cursor-pointer select-none hover:bg-black/5 dark:hover:bg-white/5" : "",
|
|
692
|
+
// Border for bordered tables
|
|
693
|
+
(context == null ? void 0 : context.bordered) ? "border-r border-gray-200 dark:border-gray-700 last:border-r-0" : "",
|
|
694
|
+
// Sticky column
|
|
695
|
+
props.sticky ? "sticky bg-black/5 dark:bg-white/5 z-20" : "",
|
|
696
|
+
// Resizable
|
|
697
|
+
props.resizable ? "relative" : ""
|
|
698
|
+
]);
|
|
699
|
+
const thStyles = computed(() => ({
|
|
700
|
+
width: props.width,
|
|
701
|
+
minWidth: props.minWidth,
|
|
702
|
+
maxWidth: props.maxWidth,
|
|
703
|
+
left: props.sticky ? props.stickyLeft : void 0
|
|
704
|
+
}));
|
|
705
|
+
const handleSort = () => {
|
|
706
|
+
if (props.sortable) {
|
|
707
|
+
emit("sort");
|
|
708
|
+
}
|
|
709
|
+
};
|
|
710
|
+
return (_ctx, _cache) => {
|
|
711
|
+
return openBlock(), createElementBlock("th", mergeProps(unref(attrs), {
|
|
712
|
+
class: thClasses.value,
|
|
713
|
+
style: thStyles.value,
|
|
714
|
+
colspan: __props.colspan,
|
|
715
|
+
rowspan: __props.rowspan,
|
|
716
|
+
scope: __props.scope,
|
|
717
|
+
"aria-sort": __props.sortable ? __props.sorted ? __props.sortDirection === "asc" ? "ascending" : "descending" : "none" : void 0,
|
|
718
|
+
onClick: handleSort
|
|
719
|
+
}), [
|
|
720
|
+
createElementVNode("div", {
|
|
721
|
+
class: normalizeClass(["flex items-center gap-1", {
|
|
722
|
+
"justify-center": __props.align === "center",
|
|
723
|
+
"justify-end": __props.align === "right"
|
|
724
|
+
}])
|
|
725
|
+
}, [
|
|
726
|
+
renderSlot(_ctx.$slots, "default"),
|
|
727
|
+
__props.sortable ? (openBlock(), createElementBlock("svg", {
|
|
728
|
+
key: 0,
|
|
729
|
+
class: normalizeClass([
|
|
730
|
+
"size-4 transition-colors flex-shrink-0",
|
|
731
|
+
__props.sorted ? "text-primary-500" : "text-gray-400"
|
|
732
|
+
]),
|
|
733
|
+
viewBox: "0 0 24 24",
|
|
734
|
+
fill: "currentColor"
|
|
735
|
+
}, [
|
|
736
|
+
__props.sorted && __props.sortDirection === "asc" ? (openBlock(), createElementBlock("path", _hoisted_2$e)) : __props.sorted && __props.sortDirection === "desc" ? (openBlock(), createElementBlock("path", _hoisted_3$8)) : (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
737
|
+
_cache[2] || (_cache[2] = createElementVNode("path", {
|
|
738
|
+
d: "M7 14l5-5 5 5H7z",
|
|
739
|
+
class: "opacity-40"
|
|
740
|
+
}, null, -1)),
|
|
741
|
+
_cache[3] || (_cache[3] = createElementVNode("path", {
|
|
742
|
+
d: "M7 10l5 5 5-5H7z",
|
|
743
|
+
class: "opacity-40"
|
|
744
|
+
}, null, -1))
|
|
745
|
+
], 64))
|
|
746
|
+
], 2)) : createCommentVNode("", true)
|
|
747
|
+
], 2),
|
|
748
|
+
__props.resizable ? (openBlock(), createElementBlock("div", {
|
|
749
|
+
key: 0,
|
|
750
|
+
class: normalizeClass([
|
|
751
|
+
"absolute top-0 right-0 bottom-0 w-1 cursor-col-resize select-none",
|
|
752
|
+
"hover:bg-primary-400 dark:hover:bg-primary-500",
|
|
753
|
+
"transition-colors",
|
|
754
|
+
__props.resizing ? "bg-primary-500" : "bg-transparent"
|
|
755
|
+
]),
|
|
756
|
+
role: "separator",
|
|
757
|
+
"aria-orientation": "vertical",
|
|
758
|
+
tabindex: "-1",
|
|
759
|
+
onMousedown: _cache[0] || (_cache[0] = withModifiers(($event) => emit("resizeStart", $event), ["stop"])),
|
|
760
|
+
onTouchstart: _cache[1] || (_cache[1] = withModifiers(($event) => emit("resizeStart", $event), ["stop"]))
|
|
761
|
+
}, null, 34)) : createCommentVNode("", true)
|
|
762
|
+
], 16, _hoisted_1$k);
|
|
763
|
+
};
|
|
764
|
+
}
|
|
765
|
+
});
|
|
766
|
+
const _hoisted_1$j = ["colspan", "rowspan"];
|
|
767
|
+
const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
768
|
+
...{
|
|
769
|
+
inheritAttrs: false
|
|
770
|
+
},
|
|
771
|
+
__name: "Td",
|
|
772
|
+
props: {
|
|
773
|
+
align: { default: "left" },
|
|
774
|
+
main: { type: Boolean, default: false },
|
|
775
|
+
className: {},
|
|
776
|
+
truncate: { type: Boolean, default: false },
|
|
777
|
+
width: {},
|
|
778
|
+
sticky: { type: Boolean, default: false },
|
|
779
|
+
stickyLeft: { default: "0" },
|
|
780
|
+
colspan: {},
|
|
781
|
+
rowspan: {}
|
|
782
|
+
},
|
|
783
|
+
setup(__props) {
|
|
784
|
+
const props = __props;
|
|
785
|
+
const attrs = useAttrs();
|
|
786
|
+
const context = inject(TableContextKey);
|
|
787
|
+
const tdClasses = computed(() => [
|
|
788
|
+
// Padding
|
|
789
|
+
(context == null ? void 0 : context.compact) ? "px-2 py-2" : "px-3 py-4",
|
|
790
|
+
// Alignment
|
|
791
|
+
props.align === "center" ? "text-center" : props.align === "right" ? "text-right" : "text-left",
|
|
792
|
+
// Main column styling
|
|
793
|
+
props.main ? "text-sm font-semibold text-gray-900 dark:text-gray-100" : "text-xs font-medium text-gray-600 dark:text-gray-400",
|
|
794
|
+
// Truncate
|
|
795
|
+
props.truncate ? "truncate" : "",
|
|
796
|
+
// Border for bordered tables
|
|
797
|
+
(context == null ? void 0 : context.bordered) ? "border-r border-gray-200 dark:border-gray-700 last:border-r-0" : "",
|
|
798
|
+
// Sticky column
|
|
799
|
+
props.sticky ? "sticky bg-white dark:bg-gray-900 z-10" : "",
|
|
800
|
+
// Custom className
|
|
801
|
+
props.className || ""
|
|
802
|
+
]);
|
|
803
|
+
const tdStyles = computed(() => ({
|
|
804
|
+
width: props.width,
|
|
805
|
+
maxWidth: props.truncate ? props.width || "200px" : void 0,
|
|
806
|
+
left: props.sticky ? props.stickyLeft : void 0
|
|
807
|
+
}));
|
|
808
|
+
return (_ctx, _cache) => {
|
|
809
|
+
return openBlock(), createElementBlock("td", mergeProps(unref(attrs), {
|
|
810
|
+
class: tdClasses.value,
|
|
811
|
+
style: tdStyles.value,
|
|
812
|
+
colspan: __props.colspan,
|
|
813
|
+
rowspan: __props.rowspan
|
|
814
|
+
}), [
|
|
815
|
+
renderSlot(_ctx.$slots, "default")
|
|
816
|
+
], 16, _hoisted_1$j);
|
|
817
|
+
};
|
|
818
|
+
}
|
|
819
|
+
});
|
|
820
|
+
const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
821
|
+
__name: "TableHeader",
|
|
822
|
+
props: {
|
|
823
|
+
columns: {},
|
|
118
824
|
selectable: { type: Boolean, default: false },
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
825
|
+
allSelected: { type: Boolean, default: false },
|
|
826
|
+
someSelected: { type: Boolean, default: false },
|
|
827
|
+
selectableCount: { default: 0 },
|
|
122
828
|
sortBy: {},
|
|
123
829
|
sortDirection: {},
|
|
124
|
-
|
|
125
|
-
loadingRows: { default: 5 }
|
|
830
|
+
showActions: { type: Boolean, default: false }
|
|
126
831
|
},
|
|
127
|
-
emits: ["
|
|
832
|
+
emits: ["selectAll", "sort"],
|
|
128
833
|
setup(__props, { emit: __emit }) {
|
|
129
|
-
const slots = useSlots();
|
|
130
834
|
const props = __props;
|
|
835
|
+
const emit = __emit;
|
|
836
|
+
const handleSort = (property) => {
|
|
837
|
+
if (!property.sortable) return;
|
|
838
|
+
const newDirection = props.sortBy === property.name && props.sortDirection === "asc" ? "desc" : "asc";
|
|
839
|
+
emit("sort", property.name, newDirection);
|
|
840
|
+
};
|
|
841
|
+
return (_ctx, _cache) => {
|
|
842
|
+
return openBlock(), createBlock(_sfc_main$r, null, {
|
|
843
|
+
default: withCtx(() => [
|
|
844
|
+
__props.selectable ? (openBlock(), createBlock(_sfc_main$q, {
|
|
845
|
+
key: 0,
|
|
846
|
+
width: "48px"
|
|
847
|
+
}, {
|
|
848
|
+
default: withCtx(() => [
|
|
849
|
+
createVNode(_sfc_main$C, {
|
|
850
|
+
"model-value": __props.allSelected,
|
|
851
|
+
indeterminate: __props.someSelected,
|
|
852
|
+
disabled: __props.selectableCount === 0,
|
|
853
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => emit("selectAll"))
|
|
854
|
+
}, null, 8, ["model-value", "indeterminate", "disabled"])
|
|
855
|
+
]),
|
|
856
|
+
_: 1
|
|
857
|
+
})) : createCommentVNode("", true),
|
|
858
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.columns, (column) => {
|
|
859
|
+
return openBlock(), createBlock(_sfc_main$q, {
|
|
860
|
+
key: column.name,
|
|
861
|
+
sortable: column.sortable,
|
|
862
|
+
sorted: __props.sortBy === column.name,
|
|
863
|
+
"sort-direction": __props.sortDirection,
|
|
864
|
+
align: column.align,
|
|
865
|
+
width: column.width,
|
|
866
|
+
"min-width": column.minWidth,
|
|
867
|
+
"max-width": column.maxWidth,
|
|
868
|
+
onSort: ($event) => handleSort(column)
|
|
869
|
+
}, {
|
|
870
|
+
default: withCtx(() => [
|
|
871
|
+
renderSlot(_ctx.$slots, "header-" + column.name, { column }, () => [
|
|
872
|
+
createTextVNode(toDisplayString(column.label ?? column.name), 1)
|
|
873
|
+
])
|
|
874
|
+
]),
|
|
875
|
+
_: 2
|
|
876
|
+
}, 1032, ["sortable", "sorted", "sort-direction", "align", "width", "min-width", "max-width", "onSort"]);
|
|
877
|
+
}), 128)),
|
|
878
|
+
__props.showActions ? (openBlock(), createBlock(_sfc_main$q, {
|
|
879
|
+
key: 1,
|
|
880
|
+
align: "right",
|
|
881
|
+
width: "100px"
|
|
882
|
+
})) : createCommentVNode("", true)
|
|
883
|
+
]),
|
|
884
|
+
_: 3
|
|
885
|
+
});
|
|
886
|
+
};
|
|
887
|
+
}
|
|
888
|
+
});
|
|
889
|
+
const _hoisted_1$i = { class: "flex items-center justify-end gap-2" };
|
|
890
|
+
const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
891
|
+
__name: "TableRow",
|
|
892
|
+
props: {
|
|
893
|
+
item: {},
|
|
894
|
+
columns: {},
|
|
895
|
+
selectable: { type: Boolean, default: false },
|
|
896
|
+
selected: { type: Boolean, default: false },
|
|
897
|
+
canSelect: { type: Boolean, default: true },
|
|
898
|
+
clickable: { type: Boolean, default: false },
|
|
899
|
+
even: { type: Boolean, default: false },
|
|
900
|
+
showActions: { type: Boolean, default: false }
|
|
901
|
+
},
|
|
902
|
+
emits: ["select", "click"],
|
|
903
|
+
setup(__props, { emit: __emit }) {
|
|
131
904
|
const emit = __emit;
|
|
132
905
|
const typeComponents = {
|
|
133
|
-
text: _sfc_main$
|
|
134
|
-
number: _sfc_main$
|
|
135
|
-
date: _sfc_main$
|
|
136
|
-
boolean: _sfc_main$
|
|
137
|
-
badge: _sfc_main$
|
|
906
|
+
text: _sfc_main$H,
|
|
907
|
+
number: _sfc_main$G,
|
|
908
|
+
date: _sfc_main$F,
|
|
909
|
+
boolean: _sfc_main$E,
|
|
910
|
+
badge: _sfc_main$D
|
|
138
911
|
};
|
|
139
912
|
const getTypeComponent = (type = "text") => {
|
|
140
|
-
return typeComponents[type] || _sfc_main$
|
|
141
|
-
};
|
|
142
|
-
const visibleProperties = computed(() => props.properties.filter((p) => !p.hidden));
|
|
143
|
-
const getKey = (item) => {
|
|
144
|
-
const keyValue = item[props.keyField];
|
|
145
|
-
return String(keyValue ?? Math.random());
|
|
913
|
+
return typeComponents[type] || _sfc_main$H;
|
|
146
914
|
};
|
|
147
915
|
const getItemValue = (item, property) => {
|
|
148
916
|
if (property.name.includes(".")) {
|
|
@@ -158,21 +926,272 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
|
|
|
158
926
|
}
|
|
159
927
|
return item[property.name];
|
|
160
928
|
};
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
929
|
+
return (_ctx, _cache) => {
|
|
930
|
+
return openBlock(), createBlock(_sfc_main$r, {
|
|
931
|
+
selected: __props.selected,
|
|
932
|
+
clickable: __props.clickable,
|
|
933
|
+
even: __props.even,
|
|
934
|
+
onClick: _cache[1] || (_cache[1] = (e) => emit("click", e))
|
|
935
|
+
}, {
|
|
936
|
+
default: withCtx(() => [
|
|
937
|
+
__props.selectable ? (openBlock(), createBlock(_sfc_main$p, {
|
|
938
|
+
key: 0,
|
|
939
|
+
width: "48px"
|
|
940
|
+
}, {
|
|
941
|
+
default: withCtx(() => [
|
|
942
|
+
__props.canSelect ? (openBlock(), createBlock(_sfc_main$C, {
|
|
943
|
+
key: 0,
|
|
944
|
+
"model-value": __props.selected,
|
|
945
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => emit("select"))
|
|
946
|
+
}, null, 8, ["model-value"])) : createCommentVNode("", true)
|
|
947
|
+
]),
|
|
948
|
+
_: 1
|
|
949
|
+
})) : createCommentVNode("", true),
|
|
950
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.columns, (column) => {
|
|
951
|
+
return openBlock(), createBlock(_sfc_main$p, {
|
|
952
|
+
key: column.name,
|
|
953
|
+
align: column.align,
|
|
954
|
+
main: column.main,
|
|
955
|
+
"class-name": column.className,
|
|
956
|
+
truncate: column.truncate,
|
|
957
|
+
width: column.width
|
|
958
|
+
}, {
|
|
959
|
+
default: withCtx(() => [
|
|
960
|
+
renderSlot(_ctx.$slots, "cell-" + column.name, {
|
|
961
|
+
item: __props.item,
|
|
962
|
+
value: getItemValue(__props.item, column),
|
|
963
|
+
column
|
|
964
|
+
}, () => [
|
|
965
|
+
(openBlock(), createBlock(resolveDynamicComponent(getTypeComponent(column.type || "text")), {
|
|
966
|
+
value: getItemValue(__props.item, column)
|
|
967
|
+
}, null, 8, ["value"]))
|
|
968
|
+
])
|
|
969
|
+
]),
|
|
970
|
+
_: 2
|
|
971
|
+
}, 1032, ["align", "main", "class-name", "truncate", "width"]);
|
|
972
|
+
}), 128)),
|
|
973
|
+
__props.showActions ? (openBlock(), createBlock(_sfc_main$p, {
|
|
974
|
+
key: 1,
|
|
975
|
+
align: "right"
|
|
976
|
+
}, {
|
|
977
|
+
default: withCtx(() => [
|
|
978
|
+
createElementVNode("div", _hoisted_1$i, [
|
|
979
|
+
renderSlot(_ctx.$slots, "actions", { item: __props.item })
|
|
980
|
+
])
|
|
981
|
+
]),
|
|
982
|
+
_: 3
|
|
983
|
+
})) : createCommentVNode("", true)
|
|
984
|
+
]),
|
|
985
|
+
_: 3
|
|
986
|
+
}, 8, ["selected", "clickable", "even"]);
|
|
987
|
+
};
|
|
988
|
+
}
|
|
989
|
+
});
|
|
990
|
+
const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
991
|
+
__name: "TableFooter",
|
|
992
|
+
props: {
|
|
993
|
+
colSpan: {}
|
|
994
|
+
},
|
|
995
|
+
setup(__props) {
|
|
996
|
+
return (_ctx, _cache) => {
|
|
997
|
+
return openBlock(), createBlock(_sfc_main$r, null, {
|
|
998
|
+
default: withCtx(() => [
|
|
999
|
+
createVNode(_sfc_main$p, {
|
|
1000
|
+
colspan: __props.colSpan,
|
|
1001
|
+
class: "text-center"
|
|
1002
|
+
}, {
|
|
1003
|
+
default: withCtx(() => [
|
|
1004
|
+
renderSlot(_ctx.$slots, "default")
|
|
1005
|
+
]),
|
|
1006
|
+
_: 3
|
|
1007
|
+
}, 8, ["colspan"])
|
|
1008
|
+
]),
|
|
1009
|
+
_: 3
|
|
1010
|
+
});
|
|
1011
|
+
};
|
|
1012
|
+
}
|
|
1013
|
+
});
|
|
1014
|
+
const _hoisted_1$h = ["disabled", "aria-expanded"];
|
|
1015
|
+
const _hoisted_2$d = { class: "p-4" };
|
|
1016
|
+
const _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
1017
|
+
...{
|
|
1018
|
+
inheritAttrs: false
|
|
1019
|
+
},
|
|
1020
|
+
__name: "ExpandableRow",
|
|
1021
|
+
props: {
|
|
1022
|
+
colspan: {},
|
|
1023
|
+
defaultExpanded: { type: Boolean, default: false },
|
|
1024
|
+
expanded: { type: Boolean, default: void 0 },
|
|
1025
|
+
selected: { type: Boolean, default: false },
|
|
1026
|
+
disabled: { type: Boolean, default: false },
|
|
1027
|
+
expandOnRowClick: { type: Boolean, default: false }
|
|
1028
|
+
},
|
|
1029
|
+
emits: ["update:expanded", "click"],
|
|
1030
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
1031
|
+
const props = __props;
|
|
1032
|
+
const emit = __emit;
|
|
1033
|
+
const attrs = useAttrs();
|
|
1034
|
+
const internalExpanded = ref(props.defaultExpanded);
|
|
1035
|
+
const isExpanded = computed({
|
|
1036
|
+
get: () => props.expanded !== void 0 ? props.expanded : internalExpanded.value,
|
|
1037
|
+
set: (value) => {
|
|
1038
|
+
internalExpanded.value = value;
|
|
1039
|
+
emit("update:expanded", value);
|
|
1040
|
+
}
|
|
1041
|
+
});
|
|
1042
|
+
const toggle = () => {
|
|
1043
|
+
if (!props.disabled) {
|
|
1044
|
+
isExpanded.value = !isExpanded.value;
|
|
169
1045
|
}
|
|
170
1046
|
};
|
|
171
|
-
const
|
|
172
|
-
|
|
173
|
-
|
|
1047
|
+
const handleRowClick = (event) => {
|
|
1048
|
+
emit("click", event);
|
|
1049
|
+
if (props.expandOnRowClick) {
|
|
1050
|
+
toggle();
|
|
1051
|
+
}
|
|
1052
|
+
};
|
|
1053
|
+
__expose({ toggle, isExpanded });
|
|
1054
|
+
return (_ctx, _cache) => {
|
|
1055
|
+
return openBlock(), createElementBlock(Fragment, null, [
|
|
1056
|
+
createVNode(_sfc_main$r, mergeProps(unref(attrs), {
|
|
1057
|
+
selected: __props.selected,
|
|
1058
|
+
disabled: __props.disabled,
|
|
1059
|
+
clickable: "",
|
|
1060
|
+
onClick: handleRowClick
|
|
1061
|
+
}), {
|
|
1062
|
+
default: withCtx(() => [
|
|
1063
|
+
createVNode(_sfc_main$p, {
|
|
1064
|
+
width: "40px",
|
|
1065
|
+
class: "!p-2"
|
|
1066
|
+
}, {
|
|
1067
|
+
default: withCtx(() => [
|
|
1068
|
+
createElementVNode("button", {
|
|
1069
|
+
type: "button",
|
|
1070
|
+
disabled: __props.disabled,
|
|
1071
|
+
class: "flex size-6 items-center justify-center rounded transition-colors hover:bg-black/10 dark:hover:bg-white/10 disabled:opacity-50 disabled:cursor-not-allowed",
|
|
1072
|
+
"aria-expanded": isExpanded.value,
|
|
1073
|
+
"aria-label": "Toggle row details",
|
|
1074
|
+
onClick: withModifiers(toggle, ["stop"])
|
|
1075
|
+
}, [
|
|
1076
|
+
(openBlock(), createElementBlock("svg", {
|
|
1077
|
+
class: normalizeClass(["size-4 transition-transform", { "rotate-90": isExpanded.value }]),
|
|
1078
|
+
viewBox: "0 0 24 24",
|
|
1079
|
+
fill: "currentColor"
|
|
1080
|
+
}, [..._cache[0] || (_cache[0] = [
|
|
1081
|
+
createElementVNode("path", { d: "M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z" }, null, -1)
|
|
1082
|
+
])], 2))
|
|
1083
|
+
], 8, _hoisted_1$h)
|
|
1084
|
+
]),
|
|
1085
|
+
_: 1
|
|
1086
|
+
}),
|
|
1087
|
+
renderSlot(_ctx.$slots, "row")
|
|
1088
|
+
]),
|
|
1089
|
+
_: 3
|
|
1090
|
+
}, 16, ["selected", "disabled"]),
|
|
1091
|
+
isExpanded.value ? (openBlock(), createBlock(_sfc_main$r, {
|
|
1092
|
+
key: 0,
|
|
1093
|
+
class: "bg-gray-50 dark:bg-gray-800/50"
|
|
1094
|
+
}, {
|
|
1095
|
+
default: withCtx(() => [
|
|
1096
|
+
createVNode(_sfc_main$p, {
|
|
1097
|
+
colspan: __props.colspan + 1,
|
|
1098
|
+
class: "!p-0"
|
|
1099
|
+
}, {
|
|
1100
|
+
default: withCtx(() => [
|
|
1101
|
+
createElementVNode("div", _hoisted_2$d, [
|
|
1102
|
+
renderSlot(_ctx.$slots, "expanded")
|
|
1103
|
+
])
|
|
1104
|
+
]),
|
|
1105
|
+
_: 3
|
|
1106
|
+
}, 8, ["colspan"])
|
|
1107
|
+
]),
|
|
1108
|
+
_: 3
|
|
1109
|
+
})) : createCommentVNode("", true)
|
|
1110
|
+
], 64);
|
|
1111
|
+
};
|
|
1112
|
+
}
|
|
1113
|
+
});
|
|
1114
|
+
const _hoisted_1$g = { class: "overflow-hidden" };
|
|
1115
|
+
const _hoisted_2$c = {
|
|
1116
|
+
key: 1,
|
|
1117
|
+
class: "flex flex-col items-center justify-center py-12 text-center"
|
|
1118
|
+
};
|
|
1119
|
+
const _hoisted_3$7 = { class: "flex flex-col items-center gap-3" };
|
|
1120
|
+
const _hoisted_4$5 = { class: "text-sm text-gray-600 dark:text-gray-400" };
|
|
1121
|
+
const _hoisted_5$3 = {
|
|
1122
|
+
key: 3,
|
|
1123
|
+
class: "flex flex-col items-center justify-center py-12 text-center"
|
|
1124
|
+
};
|
|
1125
|
+
const _sfc_main$k = /* @__PURE__ */ defineComponent({
|
|
1126
|
+
__name: "DataTable",
|
|
1127
|
+
props: {
|
|
1128
|
+
properties: {},
|
|
1129
|
+
items: {},
|
|
1130
|
+
selectable: { type: Boolean, default: false },
|
|
1131
|
+
selectedItems: {},
|
|
1132
|
+
selectableFilter: {},
|
|
1133
|
+
keyField: { default: "id" },
|
|
1134
|
+
sortBy: {},
|
|
1135
|
+
sortDirection: {},
|
|
1136
|
+
loading: { type: Boolean, default: false },
|
|
1137
|
+
loadingRows: { default: 5 },
|
|
1138
|
+
error: { type: Boolean, default: false },
|
|
1139
|
+
errorMessage: { default: "An error occurred while loading data." },
|
|
1140
|
+
striped: { type: Boolean, default: false },
|
|
1141
|
+
bordered: { type: Boolean, default: false },
|
|
1142
|
+
hover: { type: Boolean, default: true },
|
|
1143
|
+
compact: { type: Boolean, default: false },
|
|
1144
|
+
stickyHeader: { type: Boolean, default: false },
|
|
1145
|
+
clickableRows: { type: Boolean, default: false },
|
|
1146
|
+
paginated: { type: Boolean, default: false },
|
|
1147
|
+
pageSize: { default: 10 },
|
|
1148
|
+
pageSizeOptions: { default: () => [10, 20, 50, 100] },
|
|
1149
|
+
showPageSize: { type: Boolean, default: true },
|
|
1150
|
+
currentPage: {},
|
|
1151
|
+
totalItems: {}
|
|
1152
|
+
},
|
|
1153
|
+
emits: ["select", "selectAll", "sort", "rowClick", "update:currentPage", "update:pageSize"],
|
|
1154
|
+
setup(__props, { emit: __emit }) {
|
|
1155
|
+
const slots = useSlots();
|
|
1156
|
+
const props = __props;
|
|
1157
|
+
const emit = __emit;
|
|
1158
|
+
const visibleProperties = computed(() => props.properties.filter((p) => !p.hidden));
|
|
1159
|
+
const {
|
|
1160
|
+
currentPage: internalPage,
|
|
1161
|
+
pageSize: internalPageSize,
|
|
1162
|
+
totalPages,
|
|
1163
|
+
paginatedItems,
|
|
1164
|
+
setPageSize: setInternalPageSize,
|
|
1165
|
+
goToPage
|
|
1166
|
+
} = usePagination({
|
|
1167
|
+
items: computed(() => props.items),
|
|
1168
|
+
pageSize: props.pageSize,
|
|
1169
|
+
initialPage: props.currentPage ?? 1
|
|
1170
|
+
});
|
|
1171
|
+
const effectivePage = computed(() => props.currentPage ?? internalPage.value);
|
|
1172
|
+
const effectivePageSize = computed(() => props.pageSize ?? internalPageSize.value);
|
|
1173
|
+
const effectiveTotalPages = computed(() => {
|
|
1174
|
+
if (props.totalItems !== void 0) {
|
|
1175
|
+
return Math.ceil(props.totalItems / effectivePageSize.value);
|
|
174
1176
|
}
|
|
175
|
-
return
|
|
1177
|
+
return totalPages.value;
|
|
1178
|
+
});
|
|
1179
|
+
const displayItems = computed(() => {
|
|
1180
|
+
if (!props.paginated) return props.items;
|
|
1181
|
+
if (props.totalItems !== void 0) return props.items;
|
|
1182
|
+
return paginatedItems.value;
|
|
1183
|
+
});
|
|
1184
|
+
const handlePageChange = (page) => {
|
|
1185
|
+
goToPage(page);
|
|
1186
|
+
emit("update:currentPage", page);
|
|
1187
|
+
};
|
|
1188
|
+
const handlePageSizeChange = (size) => {
|
|
1189
|
+
setInternalPageSize(size);
|
|
1190
|
+
emit("update:pageSize", size);
|
|
1191
|
+
};
|
|
1192
|
+
const getKey = (item) => {
|
|
1193
|
+
const keyValue = item[props.keyField];
|
|
1194
|
+
return String(keyValue ?? Math.random());
|
|
176
1195
|
};
|
|
177
1196
|
const selectableItems = computed(() => {
|
|
178
1197
|
if (!props.selectableFilter) return props.items;
|
|
@@ -201,123 +1220,139 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
|
|
|
201
1220
|
const handleSelect = (item) => {
|
|
202
1221
|
emit("select", getKey(item));
|
|
203
1222
|
};
|
|
204
|
-
const
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
emit("sort", property.name, newDirection);
|
|
209
|
-
};
|
|
210
|
-
const isSortedColumn = (property) => {
|
|
211
|
-
return props.sortBy === property.name;
|
|
1223
|
+
const handleRowClick = (item, event) => {
|
|
1224
|
+
if (props.clickableRows) {
|
|
1225
|
+
emit("rowClick", item, event);
|
|
1226
|
+
}
|
|
212
1227
|
};
|
|
1228
|
+
const hasActionSlot = computed(() => !!slots.action);
|
|
213
1229
|
return (_ctx, _cache) => {
|
|
214
1230
|
return openBlock(), createElementBlock("div", _hoisted_1$g, [
|
|
215
|
-
__props.loading ? (openBlock(), createBlock(_sfc_main$
|
|
1231
|
+
__props.loading ? (openBlock(), createBlock(_sfc_main$I, {
|
|
216
1232
|
key: 0,
|
|
217
1233
|
rows: __props.loadingRows,
|
|
218
1234
|
columns: visibleProperties.value.length
|
|
219
|
-
}, null, 8, ["rows", "columns"])) : (openBlock(), createElementBlock("div", _hoisted_2$c, [
|
|
220
|
-
|
|
221
|
-
createElementVNode("
|
|
222
|
-
createElementVNode("
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
1235
|
+
}, null, 8, ["rows", "columns"])) : __props.error ? (openBlock(), createElementBlock("div", _hoisted_2$c, [
|
|
1236
|
+
renderSlot(_ctx.$slots, "error", {}, () => [
|
|
1237
|
+
createElementVNode("div", _hoisted_3$7, [
|
|
1238
|
+
_cache[2] || (_cache[2] = createElementVNode("svg", {
|
|
1239
|
+
class: "size-12 text-red-400",
|
|
1240
|
+
fill: "none",
|
|
1241
|
+
viewBox: "0 0 24 24",
|
|
1242
|
+
stroke: "currentColor"
|
|
1243
|
+
}, [
|
|
1244
|
+
createElementVNode("path", {
|
|
1245
|
+
"stroke-linecap": "round",
|
|
1246
|
+
"stroke-linejoin": "round",
|
|
1247
|
+
"stroke-width": "1.5",
|
|
1248
|
+
d: "M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"
|
|
1249
|
+
})
|
|
1250
|
+
], -1)),
|
|
1251
|
+
createElementVNode("p", _hoisted_4$5, toDisplayString(__props.errorMessage), 1)
|
|
1252
|
+
])
|
|
1253
|
+
])
|
|
1254
|
+
])) : __props.items && __props.items.length > 0 ? (openBlock(), createBlock(_sfc_main$y, {
|
|
1255
|
+
key: 2,
|
|
1256
|
+
striped: __props.striped,
|
|
1257
|
+
bordered: __props.bordered,
|
|
1258
|
+
hover: __props.hover,
|
|
1259
|
+
compact: __props.compact,
|
|
1260
|
+
"sticky-header": __props.stickyHeader
|
|
1261
|
+
}, {
|
|
1262
|
+
default: withCtx(() => [
|
|
1263
|
+
createVNode(_sfc_main$u, null, {
|
|
1264
|
+
default: withCtx(() => [
|
|
1265
|
+
createVNode(_sfc_main$o, {
|
|
1266
|
+
columns: visibleProperties.value,
|
|
1267
|
+
selectable: __props.selectable,
|
|
1268
|
+
"all-selected": allSelected.value,
|
|
1269
|
+
"some-selected": someSelected.value,
|
|
1270
|
+
"selectable-count": selectableItems.value.length,
|
|
1271
|
+
"sort-by": __props.sortBy,
|
|
1272
|
+
"sort-direction": __props.sortDirection,
|
|
1273
|
+
"show-actions": hasActionSlot.value,
|
|
1274
|
+
onSelectAll: _cache[0] || (_cache[0] = ($event) => emit("selectAll")),
|
|
1275
|
+
onSort: _cache[1] || (_cache[1] = (col, dir) => emit("sort", col, dir))
|
|
1276
|
+
}, createSlots({ _: 2 }, [
|
|
1277
|
+
renderList(visibleProperties.value, (column) => {
|
|
1278
|
+
return {
|
|
1279
|
+
name: `header-${column.name}`,
|
|
1280
|
+
fn: withCtx((slotProps) => [
|
|
1281
|
+
renderSlot(_ctx.$slots, "header-" + column.name, normalizeProps(guardReactiveProps(slotProps)))
|
|
1282
|
+
])
|
|
1283
|
+
};
|
|
1284
|
+
})
|
|
1285
|
+
]), 1032, ["columns", "selectable", "all-selected", "some-selected", "selectable-count", "sort-by", "sort-direction", "show-actions"])
|
|
1286
|
+
]),
|
|
1287
|
+
_: 3
|
|
1288
|
+
}),
|
|
1289
|
+
createVNode(_sfc_main$t, null, {
|
|
1290
|
+
default: withCtx(() => [
|
|
1291
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(displayItems.value, (item, index) => {
|
|
1292
|
+
return openBlock(), createBlock(_sfc_main$n, {
|
|
1293
|
+
key: getKey(item),
|
|
1294
|
+
item,
|
|
1295
|
+
columns: visibleProperties.value,
|
|
1296
|
+
selectable: __props.selectable,
|
|
1297
|
+
selected: isSelected(item),
|
|
1298
|
+
"can-select": isSelectable(item),
|
|
1299
|
+
clickable: __props.clickableRows,
|
|
1300
|
+
even: index % 2 === 1,
|
|
1301
|
+
"show-actions": hasActionSlot.value,
|
|
1302
|
+
onSelect: ($event) => handleSelect(item),
|
|
1303
|
+
onClick: (e) => handleRowClick(item, e)
|
|
1304
|
+
}, createSlots({
|
|
1305
|
+
actions: withCtx(({ item: rowItem }) => [
|
|
1306
|
+
renderSlot(_ctx.$slots, "action", { item: rowItem })
|
|
238
1307
|
]),
|
|
239
|
-
|
|
1308
|
+
_: 2
|
|
240
1309
|
}, [
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
isSortedColumn(property) ? "text-primary-500" : "text-gray-400"
|
|
255
|
-
]),
|
|
256
|
-
viewBox: "0 0 24 24",
|
|
257
|
-
fill: "currentColor"
|
|
258
|
-
}, [
|
|
259
|
-
isSortedColumn(property) && __props.sortDirection === "asc" ? (openBlock(), createElementBlock("path", _hoisted_7$3)) : isSortedColumn(property) && __props.sortDirection === "desc" ? (openBlock(), createElementBlock("path", _hoisted_8$3)) : (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
260
|
-
_cache[1] || (_cache[1] = createElementVNode("path", {
|
|
261
|
-
d: "M7 14l5-5 5 5H7z",
|
|
262
|
-
class: "opacity-40"
|
|
263
|
-
}, null, -1)),
|
|
264
|
-
_cache[2] || (_cache[2] = createElementVNode("path", {
|
|
265
|
-
d: "M7 10l5 5 5-5H7z",
|
|
266
|
-
class: "opacity-40"
|
|
267
|
-
}, null, -1))
|
|
268
|
-
], 64))
|
|
269
|
-
], 2)) : createCommentVNode("", true)
|
|
270
|
-
], 2)
|
|
271
|
-
], 10, _hoisted_6$3);
|
|
272
|
-
}), 128)),
|
|
273
|
-
hasActionSlot.value ? (openBlock(), createElementBlock("th", _hoisted_9$3)) : createCommentVNode("", true)
|
|
274
|
-
])
|
|
275
|
-
]),
|
|
276
|
-
createElementVNode("tbody", _hoisted_10$2, [
|
|
277
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.items, (item) => {
|
|
278
|
-
return openBlock(), createElementBlock("tr", {
|
|
279
|
-
key: getKey(item),
|
|
280
|
-
class: normalizeClass(["hover:bg-black/5 dark:hover:bg-white/5 transition-colors", { "bg-primary/5 dark:bg-primary/10": isSelected(item) }])
|
|
281
|
-
}, [
|
|
282
|
-
__props.selectable ? (openBlock(), createElementBlock("td", _hoisted_11$1, [
|
|
283
|
-
isSelectable(item) ? (openBlock(), createBlock(_sfc_main$o, {
|
|
284
|
-
key: 0,
|
|
285
|
-
"model-value": isSelected(item),
|
|
286
|
-
"onUpdate:modelValue": ($event) => handleSelect(item)
|
|
287
|
-
}, null, 8, ["model-value", "onUpdate:modelValue"])) : createCommentVNode("", true)
|
|
288
|
-
])) : createCommentVNode("", true),
|
|
289
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(visibleProperties.value, (property) => {
|
|
290
|
-
return openBlock(), createElementBlock("td", {
|
|
291
|
-
key: property.name,
|
|
292
|
-
class: normalizeClass([
|
|
293
|
-
getAlignmentClass(property.align),
|
|
294
|
-
getMainClass(property.main),
|
|
295
|
-
property.className,
|
|
296
|
-
"px-3 py-4"
|
|
297
|
-
])
|
|
298
|
-
}, [
|
|
299
|
-
renderSlot(_ctx.$slots, "item-" + property.name, {
|
|
300
|
-
item,
|
|
301
|
-
property,
|
|
302
|
-
value: getItemValue(item, property)
|
|
303
|
-
}, () => [
|
|
304
|
-
(openBlock(), createBlock(resolveDynamicComponent(getTypeComponent(property.type || "text")), {
|
|
305
|
-
value: getItemValue(item, property)
|
|
306
|
-
}, null, 8, ["value"]))
|
|
307
|
-
])
|
|
308
|
-
], 2);
|
|
309
|
-
}), 128)),
|
|
310
|
-
hasActionSlot.value ? (openBlock(), createElementBlock("td", _hoisted_12$1, [
|
|
311
|
-
renderSlot(_ctx.$slots, "action", { item })
|
|
312
|
-
])) : createCommentVNode("", true)
|
|
313
|
-
], 2);
|
|
314
|
-
}), 128))
|
|
315
|
-
])
|
|
1310
|
+
renderList(visibleProperties.value, (column) => {
|
|
1311
|
+
return {
|
|
1312
|
+
name: `cell-${column.name}`,
|
|
1313
|
+
fn: withCtx((slotProps) => [
|
|
1314
|
+
renderSlot(_ctx.$slots, "item-" + column.name, mergeProps({ ref_for: true }, slotProps))
|
|
1315
|
+
])
|
|
1316
|
+
};
|
|
1317
|
+
})
|
|
1318
|
+
]), 1032, ["item", "columns", "selectable", "selected", "can-select", "clickable", "even", "show-actions", "onSelect", "onClick"]);
|
|
1319
|
+
}), 128))
|
|
1320
|
+
]),
|
|
1321
|
+
_: 3
|
|
1322
|
+
})
|
|
316
1323
|
]),
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
1324
|
+
_: 3
|
|
1325
|
+
}, 8, ["striped", "bordered", "hover", "compact", "sticky-header"])) : (openBlock(), createElementBlock("div", _hoisted_5$3, [
|
|
1326
|
+
renderSlot(_ctx.$slots, "empty", {}, () => [
|
|
1327
|
+
_cache[3] || (_cache[3] = createElementVNode("div", { class: "flex flex-col items-center gap-3" }, [
|
|
1328
|
+
createElementVNode("svg", {
|
|
1329
|
+
class: "size-12 text-gray-300 dark:text-gray-600",
|
|
1330
|
+
fill: "none",
|
|
1331
|
+
viewBox: "0 0 24 24",
|
|
1332
|
+
stroke: "currentColor"
|
|
1333
|
+
}, [
|
|
1334
|
+
createElementVNode("path", {
|
|
1335
|
+
"stroke-linecap": "round",
|
|
1336
|
+
"stroke-linejoin": "round",
|
|
1337
|
+
"stroke-width": "1.5",
|
|
1338
|
+
d: "M20 13V6a2 2 0 00-2-2H6a2 2 0 00-2 2v7m16 0v5a2 2 0 01-2 2H6a2 2 0 01-2-2v-5m16 0h-2.586a1 1 0 00-.707.293l-2.414 2.414a1 1 0 01-.707.293h-3.172a1 1 0 01-.707-.293l-2.414-2.414A1 1 0 006.586 13H4"
|
|
1339
|
+
})
|
|
1340
|
+
]),
|
|
1341
|
+
createElementVNode("p", { class: "text-sm text-gray-500 dark:text-gray-400" }, "No data available")
|
|
1342
|
+
], -1))
|
|
1343
|
+
])
|
|
1344
|
+
])),
|
|
1345
|
+
__props.paginated && __props.items && __props.items.length > 0 && !__props.loading && !__props.error ? (openBlock(), createBlock(_sfc_main$J, {
|
|
1346
|
+
key: 4,
|
|
1347
|
+
"current-page": effectivePage.value,
|
|
1348
|
+
"total-pages": effectiveTotalPages.value,
|
|
1349
|
+
"page-size": effectivePageSize.value,
|
|
1350
|
+
"page-size-options": __props.pageSizeOptions,
|
|
1351
|
+
"show-page-size": __props.showPageSize,
|
|
1352
|
+
class: "mt-4",
|
|
1353
|
+
"onUpdate:currentPage": handlePageChange,
|
|
1354
|
+
"onUpdate:pageSize": handlePageSizeChange
|
|
1355
|
+
}, null, 8, ["current-page", "total-pages", "page-size", "page-size-options", "show-page-size"])) : createCommentVNode("", true)
|
|
321
1356
|
]);
|
|
322
1357
|
};
|
|
323
1358
|
}
|
|
@@ -391,9 +1426,9 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
391
1426
|
const hasEmptySlot = computed(() => !!slots.empty);
|
|
392
1427
|
return (_ctx, _cache) => {
|
|
393
1428
|
return openBlock(), createElementBlock("div", _hoisted_1$f, [
|
|
394
|
-
__props.loading ? (openBlock(), createBlock(_sfc_main$
|
|
1429
|
+
__props.loading ? (openBlock(), createBlock(_sfc_main$A, { key: 0 }, {
|
|
395
1430
|
default: withCtx(() => [
|
|
396
|
-
createVNode(_sfc_main$
|
|
1431
|
+
createVNode(_sfc_main$K, {
|
|
397
1432
|
items: __props.loadingItems,
|
|
398
1433
|
"show-avatar": "",
|
|
399
1434
|
"show-secondary": "",
|
|
@@ -402,10 +1437,10 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
402
1437
|
]),
|
|
403
1438
|
_: 1
|
|
404
1439
|
})) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
405
|
-
__props.selectable && selectableItems.value.length > 0 ? (openBlock(), createBlock(_sfc_main$
|
|
1440
|
+
__props.selectable && selectableItems.value.length > 0 ? (openBlock(), createBlock(_sfc_main$A, { key: 0 }, {
|
|
406
1441
|
default: withCtx(() => [
|
|
407
1442
|
createElementVNode("div", _hoisted_2$b, [
|
|
408
|
-
createVNode(_sfc_main$
|
|
1443
|
+
createVNode(_sfc_main$C, {
|
|
409
1444
|
"model-value": allSelected.value,
|
|
410
1445
|
indeterminate: someSelected.value,
|
|
411
1446
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => emit("selectAll"))
|
|
@@ -417,7 +1452,7 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
417
1452
|
_: 1
|
|
418
1453
|
})) : createCommentVNode("", true),
|
|
419
1454
|
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.items, (item) => {
|
|
420
|
-
return openBlock(), createBlock(_sfc_main$
|
|
1455
|
+
return openBlock(), createBlock(_sfc_main$A, {
|
|
421
1456
|
key: getKey(item),
|
|
422
1457
|
class: normalizeClass(["hover:shadow-lg transition-all duration-200", {
|
|
423
1458
|
"ring-2 ring-primary": isSelected(item)
|
|
@@ -426,7 +1461,7 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
426
1461
|
default: withCtx(() => [
|
|
427
1462
|
createElementVNode("div", _hoisted_5$2, [
|
|
428
1463
|
__props.selectable ? (openBlock(), createElementBlock("div", _hoisted_6$2, [
|
|
429
|
-
isSelectable(item) ? (openBlock(), createBlock(_sfc_main$
|
|
1464
|
+
isSelectable(item) ? (openBlock(), createBlock(_sfc_main$C, {
|
|
430
1465
|
key: 0,
|
|
431
1466
|
"model-value": isSelected(item),
|
|
432
1467
|
"onUpdate:modelValue": ($event) => handleSelect(item)
|
|
@@ -538,9 +1573,9 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
538
1573
|
renderSlot(_ctx.$slots, "empty")
|
|
539
1574
|
]),
|
|
540
1575
|
_: 3
|
|
541
|
-
}, 8, ["items", "key-field", "selectable", "selected-items", "selectable-filter", "loading", "loading-items"])) : (openBlock(), createBlock(_sfc_main$
|
|
1576
|
+
}, 8, ["items", "key-field", "selectable", "selected-items", "selectable-filter", "loading", "loading-items"])) : (openBlock(), createBlock(_sfc_main$A, { key: 1 }, {
|
|
542
1577
|
default: withCtx(() => [
|
|
543
|
-
createVNode(_sfc_main$k, {
|
|
1578
|
+
createVNode(unref(_sfc_main$k), {
|
|
544
1579
|
items: __props.items,
|
|
545
1580
|
properties: tableProperties.value,
|
|
546
1581
|
"key-field": __props.keyField,
|
|
@@ -1241,7 +2276,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
1241
2276
|
};
|
|
1242
2277
|
const hasCustomHeader = () => !!slots.header;
|
|
1243
2278
|
return (_ctx, _cache) => {
|
|
1244
|
-
return openBlock(), createBlock(_sfc_main$
|
|
2279
|
+
return openBlock(), createBlock(_sfc_main$A, null, createSlots({
|
|
1245
2280
|
default: withCtx(() => [
|
|
1246
2281
|
createVNode(Transition, {
|
|
1247
2282
|
"enter-active-class": "transition-all duration-200 ease-out",
|
|
@@ -2277,27 +3312,43 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
2277
3312
|
}
|
|
2278
3313
|
});
|
|
2279
3314
|
export {
|
|
2280
|
-
_sfc_main$
|
|
2281
|
-
_sfc_main$
|
|
2282
|
-
_sfc_main$
|
|
2283
|
-
_sfc_main$
|
|
2284
|
-
_sfc_main$
|
|
2285
|
-
_sfc_main$
|
|
2286
|
-
_sfc_main$
|
|
2287
|
-
_sfc_main$
|
|
2288
|
-
_sfc_main$
|
|
2289
|
-
_sfc_main
|
|
2290
|
-
|
|
2291
|
-
_sfc_main$
|
|
2292
|
-
_sfc_main$
|
|
2293
|
-
_sfc_main$
|
|
2294
|
-
_sfc_main$
|
|
2295
|
-
_sfc_main$
|
|
2296
|
-
_sfc_main$
|
|
2297
|
-
_sfc_main$
|
|
2298
|
-
_sfc_main$
|
|
2299
|
-
_sfc_main$
|
|
2300
|
-
_sfc_main$
|
|
2301
|
-
_sfc_main as
|
|
3315
|
+
_sfc_main$9 as A,
|
|
3316
|
+
_sfc_main$8 as B,
|
|
3317
|
+
_sfc_main$7 as C,
|
|
3318
|
+
_sfc_main$6 as D,
|
|
3319
|
+
_sfc_main$5 as E,
|
|
3320
|
+
_sfc_main$4 as F,
|
|
3321
|
+
_sfc_main$3 as G,
|
|
3322
|
+
_sfc_main$2 as H,
|
|
3323
|
+
_sfc_main$1 as I,
|
|
3324
|
+
_sfc_main as J,
|
|
3325
|
+
TableContextKey as T,
|
|
3326
|
+
_sfc_main$A as _,
|
|
3327
|
+
_sfc_main$z as a,
|
|
3328
|
+
_sfc_main$y as b,
|
|
3329
|
+
_sfc_main$x as c,
|
|
3330
|
+
_sfc_main$w as d,
|
|
3331
|
+
_sfc_main$v as e,
|
|
3332
|
+
_sfc_main$u as f,
|
|
3333
|
+
_sfc_main$t as g,
|
|
3334
|
+
_sfc_main$s as h,
|
|
3335
|
+
_sfc_main$r as i,
|
|
3336
|
+
_sfc_main$q as j,
|
|
3337
|
+
_sfc_main$p as k,
|
|
3338
|
+
_sfc_main$o as l,
|
|
3339
|
+
_sfc_main$n as m,
|
|
3340
|
+
_sfc_main$m as n,
|
|
3341
|
+
_sfc_main$l as o,
|
|
3342
|
+
_sfc_main$k as p,
|
|
3343
|
+
_sfc_main$j as q,
|
|
3344
|
+
_sfc_main$i as r,
|
|
3345
|
+
_sfc_main$h as s,
|
|
3346
|
+
_sfc_main$g as t,
|
|
3347
|
+
_sfc_main$f as u,
|
|
3348
|
+
_sfc_main$e as v,
|
|
3349
|
+
_sfc_main$d as w,
|
|
3350
|
+
_sfc_main$c as x,
|
|
3351
|
+
_sfc_main$b as y,
|
|
3352
|
+
_sfc_main$a as z
|
|
2302
3353
|
};
|
|
2303
|
-
//# sourceMappingURL=FilterTabs.vue_vue_type_script_setup_true_lang-
|
|
3354
|
+
//# sourceMappingURL=FilterTabs.vue_vue_type_script_setup_true_lang-CzpYHtc5.js.map
|