vlite3 0.9.6 → 0.9.8
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/components/Accordion/Accordion.vue.d.ts +1 -1
- package/components/Accordion/AccordionItem.vue.d.ts +1 -1
- package/components/Accordion/AccordionTrigger.vue.d.ts +1 -1
- package/components/Alert.vue.d.ts +1 -1
- package/components/Avatar.vue.d.ts +2 -2
- package/components/Avatar.vue.js +1 -1
- package/components/AvatarUploader/AvatarUploader.vue.d.ts +1 -1
- package/components/BackButton.vue.d.ts +1 -1
- package/components/Badge.vue.d.ts +1 -1
- package/components/Barcode/Barcode.vue.d.ts +1 -1
- package/components/Breadcrumb/Breadcrumb.vue.d.ts +1 -1
- package/components/Button.vue.d.ts +2 -2
- package/components/CheckBox.vue.d.ts +1 -1
- package/components/Chip/Chip.vue.d.ts +1 -1
- package/components/DataTable/DataTable.vue.js +55 -54
- package/components/DataTable/DataTableHeader.vue.js +5 -3
- package/components/DataTable/DataTableRow.vue.js +23 -24
- package/components/DatePicker.vue.js +93 -67
- package/components/DateRangePicker.vue.js +28 -26
- package/components/Dropdown/DropdownBooleanItem.vue.js +12 -9
- package/components/Dropdown/DropdownMenu.vue.js +2 -2
- package/components/Dropdown/DropdownMenu.vue2.js +51 -51
- package/components/Form/CustomFields.vue.d.ts +4 -0
- package/components/Form/CustomFields.vue.js +2 -2
- package/components/Form/CustomFields.vue2.js +147 -115
- package/components/Form/FormField.vue.d.ts +2 -1
- package/components/Form/FormField.vue.js +3 -0
- package/components/Form/FormFields.vue.js +2 -2
- package/components/Form/FormFields.vue2.js +38 -37
- package/components/Form/composables/useForm.d.ts +1 -1
- package/components/Form/composables/useForm.js +142 -125
- package/components/Form/types.d.ts +6 -0
- package/components/Form/utils/form.utils.js +115 -106
- package/components/Input.vue.d.ts +3 -3
- package/components/Kanban/KanbanBoard.vue2.js +29 -27
- package/components/List/List.vue.d.ts +1 -1
- package/components/List/List.vue.js +1 -1
- package/components/Navbar/Navbar.vue.d.ts +2 -2
- package/components/Navbar/NavbarItem.vue.d.ts +1 -1
- package/components/Navbar/NavbarTabs.vue.d.ts +1 -1
- package/components/NumberInput.vue.d.ts +1 -1
- package/components/OTPInput/OTPInput.vue.d.ts +1 -1
- package/components/PermissionMatrix/PermissionEditor.vue.d.ts +2 -2
- package/components/PermissionMatrix/PermissionMatrix.vue.d.ts +2 -2
- package/components/ProgressBar/ProgressBar.vue.d.ts +1 -1
- package/components/Screen/Screen.vue.d.ts +1 -1
- package/components/SidePanel.vue.d.ts +1 -1
- package/components/Spinner/Spinner.vue.d.ts +2 -2
- package/components/Stats/Stats.vue.d.ts +1 -1
- package/components/StatusChip/StatusChip.vue.d.ts +1 -1
- package/index.js +255 -254
- package/package.json +2 -2
- package/style.css +6 -1
- package/utils/functions.d.ts +25 -10
- package/utils/functions.js +112 -70
|
@@ -25,9 +25,9 @@ declare const __VLS_component: import('vue').DefineComponent<AccordionProps, {},
|
|
|
25
25
|
onChange?: (value: string | string[]) => any;
|
|
26
26
|
"onUpdate:modelValue"?: (value: string | string[]) => any;
|
|
27
27
|
}>, {
|
|
28
|
+
class: string;
|
|
28
29
|
variant: import('./types').AccordionVariant;
|
|
29
30
|
size: import('./types').AccordionSize;
|
|
30
|
-
class: string;
|
|
31
31
|
disabled: boolean;
|
|
32
32
|
items: import('./types').AccordionItemSchema[];
|
|
33
33
|
attached: boolean;
|
|
@@ -40,9 +40,9 @@ declare const __VLS_component: import('vue').DefineComponent<Props, {}, {}, {},
|
|
|
40
40
|
}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
|
|
41
41
|
onToggle?: (id: string) => any;
|
|
42
42
|
}>, {
|
|
43
|
+
class: string;
|
|
43
44
|
variant: AccordionVariant;
|
|
44
45
|
size: AccordionSize;
|
|
45
|
-
class: string;
|
|
46
46
|
disabled: boolean;
|
|
47
47
|
attached: boolean;
|
|
48
48
|
showIndex: boolean;
|
|
@@ -28,8 +28,8 @@ declare const __VLS_component: import('vue').DefineComponent<Props, {}, {}, {},
|
|
|
28
28
|
}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
|
|
29
29
|
onClick?: (event: MouseEvent) => any;
|
|
30
30
|
}>, {
|
|
31
|
-
size: AccordionSize;
|
|
32
31
|
class: string;
|
|
32
|
+
size: AccordionSize;
|
|
33
33
|
chevron: boolean;
|
|
34
34
|
showIndex: boolean;
|
|
35
35
|
iconVariant: IconVariant;
|
|
@@ -25,8 +25,8 @@ declare const __VLS_component: import('vue').DefineComponent<Props, {}, {}, {},
|
|
|
25
25
|
}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
|
|
26
26
|
onClose?: () => any;
|
|
27
27
|
}>, {
|
|
28
|
-
variant: AlertVariant;
|
|
29
28
|
class: string;
|
|
29
|
+
variant: AlertVariant;
|
|
30
30
|
closable: boolean;
|
|
31
31
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
32
32
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
@@ -17,11 +17,11 @@ declare function __VLS_template(): {
|
|
|
17
17
|
};
|
|
18
18
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
19
19
|
declare const __VLS_component: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
20
|
-
size: AvatarSize;
|
|
21
|
-
rounded: AvatarRounded;
|
|
22
20
|
class: string;
|
|
23
21
|
src: string;
|
|
24
22
|
alt: string;
|
|
23
|
+
size: AvatarSize;
|
|
24
|
+
rounded: AvatarRounded;
|
|
25
25
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
26
26
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
27
27
|
export default _default;
|
package/components/Avatar.vue.js
CHANGED
|
@@ -31,7 +31,7 @@ const y = ["src", "alt"], z = { key: 0 }, A = /* @__PURE__ */ k({
|
|
|
31
31
|
xs: "h-6 w-6 text-[10px]",
|
|
32
32
|
sm: "h-8 w-8 text-xs",
|
|
33
33
|
md: "h-10 w-10 text-sm",
|
|
34
|
-
lg: "h-
|
|
34
|
+
lg: "h-14 w-14 text-base",
|
|
35
35
|
xl: "h-18 w-18 text-lg",
|
|
36
36
|
"2xl": "h-20 w-20 text-xl"
|
|
37
37
|
}, h = {
|
|
@@ -21,9 +21,9 @@ declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, imp
|
|
|
21
21
|
onError?: (error: string) => any;
|
|
22
22
|
"onUpdate:modelValue"?: (value: any) => any;
|
|
23
23
|
}>, {
|
|
24
|
+
alt: string;
|
|
24
25
|
size: AvatarSize;
|
|
25
26
|
rounded: AvatarRounded;
|
|
26
|
-
alt: string;
|
|
27
27
|
disabled: boolean;
|
|
28
28
|
loading: boolean;
|
|
29
29
|
modelValue: any;
|
|
@@ -15,9 +15,9 @@ export interface BackButtonProps {
|
|
|
15
15
|
fallback?: string;
|
|
16
16
|
}
|
|
17
17
|
declare const _default: import('vue').DefineComponent<BackButtonProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<BackButtonProps> & Readonly<{}>, {
|
|
18
|
-
size: ButtonSize;
|
|
19
18
|
icon: string;
|
|
20
19
|
class: string;
|
|
20
|
+
size: ButtonSize;
|
|
21
21
|
fallback: string;
|
|
22
22
|
tooltip: string;
|
|
23
23
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLButtonElement>;
|
|
@@ -15,10 +15,10 @@ declare function __VLS_template(): {
|
|
|
15
15
|
};
|
|
16
16
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
17
17
|
declare const __VLS_component: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
18
|
+
class: any;
|
|
18
19
|
variant: BadgeVariant | string;
|
|
19
20
|
size: "xs" | "sm" | "md" | "lg";
|
|
20
21
|
rounded: "none" | "sm" | "md" | "lg" | "xl" | "2xl" | "full" | string;
|
|
21
|
-
class: any;
|
|
22
22
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
23
23
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
24
24
|
export default _default;
|
|
@@ -9,9 +9,9 @@ export interface BarcodeProps {
|
|
|
9
9
|
margin?: number;
|
|
10
10
|
}
|
|
11
11
|
declare const _default: import('vue').DefineComponent<BarcodeProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<BarcodeProps> & Readonly<{}>, {
|
|
12
|
-
format: string;
|
|
13
12
|
width: number;
|
|
14
13
|
height: number;
|
|
14
|
+
format: string;
|
|
15
15
|
displayValue: boolean;
|
|
16
16
|
margin: number;
|
|
17
17
|
lineColor: string;
|
|
@@ -19,9 +19,9 @@ declare const __VLS_component: import('vue').DefineComponent<BreadcrumbProps, {}
|
|
|
19
19
|
index: number;
|
|
20
20
|
}) => any;
|
|
21
21
|
}>, {
|
|
22
|
+
class: string;
|
|
22
23
|
variant: BreadcrumbVariant;
|
|
23
24
|
size: BreadcrumbSize;
|
|
24
|
-
class: string;
|
|
25
25
|
separator: BreadcrumbSeparator;
|
|
26
26
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLElement>;
|
|
27
27
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
@@ -10,11 +10,11 @@ declare function __VLS_template(): {
|
|
|
10
10
|
};
|
|
11
11
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
12
12
|
declare const __VLS_component: import('vue').DefineComponent<ButtonProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<ButtonProps> & Readonly<{}>, {
|
|
13
|
+
type: "button" | "submit" | "reset";
|
|
14
|
+
class: any;
|
|
13
15
|
variant: ButtonVariant;
|
|
14
16
|
size: ButtonSize;
|
|
15
17
|
rounded: ButtonRounded;
|
|
16
|
-
type: "button" | "submit" | "reset";
|
|
17
|
-
class: any;
|
|
18
18
|
disabled: boolean;
|
|
19
19
|
loading: boolean;
|
|
20
20
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLButtonElement>;
|
|
@@ -18,8 +18,8 @@ declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, imp
|
|
|
18
18
|
"onUpdate:modelValue"?: (value: boolean) => any;
|
|
19
19
|
"onUpdate:checked"?: (value: boolean) => any;
|
|
20
20
|
}>, {
|
|
21
|
-
size: CheckboxSize;
|
|
22
21
|
class: string;
|
|
22
|
+
size: CheckboxSize;
|
|
23
23
|
disabled: boolean;
|
|
24
24
|
modelValue: boolean;
|
|
25
25
|
checked: boolean;
|
|
@@ -20,9 +20,9 @@ declare const __VLS_component: import('vue').DefineComponent<ExtendedProps, {},
|
|
|
20
20
|
onDelete?: (event: MouseEvent) => any;
|
|
21
21
|
}>, {
|
|
22
22
|
text: string;
|
|
23
|
+
class: string;
|
|
23
24
|
variant: ChipVariant | string;
|
|
24
25
|
size: import('./types').ChipSize;
|
|
25
|
-
class: string;
|
|
26
26
|
disabled: boolean;
|
|
27
27
|
clickable: boolean;
|
|
28
28
|
deletable: boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as pe, inject as ye, computed as r, ref as y, watch as g, openBlock as i, createElementBlock as m, createBlock as F, normalizeClass as
|
|
1
|
+
import { defineComponent as pe, inject as ye, computed as r, ref as y, watch as g, openBlock as i, createElementBlock as m, createBlock as F, normalizeClass as D, createSlots as K, withCtx as x, renderSlot as $, createVNode as B, createCommentVNode as A, createElementVNode as f, Fragment as N, renderList as E, normalizeStyle as Y, isMemoSame as W, mergeProps as X, unref as q } from "vue";
|
|
2
2
|
import we from "../CheckBox.vue.js";
|
|
3
3
|
import Pe from "../Button.vue.js";
|
|
4
4
|
import Se from "../ConfirmationModal.vue.js";
|
|
@@ -12,8 +12,8 @@ import { SCREEN_CONTEXT_KEY as xe } from "./types.js";
|
|
|
12
12
|
const $e = { class: "space-y-6.5" }, Be = { class: "overflow-x-auto w-full" }, Ee = { class: "hover:bg-transparent" }, Re = {
|
|
13
13
|
key: 0,
|
|
14
14
|
scope: "col",
|
|
15
|
-
class: "w-[
|
|
16
|
-
style: { width: "
|
|
15
|
+
class: "w-[40px] px-0 text-center font-medium text-muted-foreground",
|
|
16
|
+
style: { width: "40px" }
|
|
17
17
|
}, ze = { class: "flex items-center justify-center" }, Ae = { class: "[&_tr:last-child]:border-0" }, Ne = {
|
|
18
18
|
key: 0,
|
|
19
19
|
class: "w-[48px] px-0 py-4 align-middle text-center",
|
|
@@ -69,9 +69,9 @@ const $e = { class: "space-y-6.5" }, Be = { class: "overflow-x-auto w-full" }, E
|
|
|
69
69
|
if (n in e[0]) return n;
|
|
70
70
|
}
|
|
71
71
|
return "_id";
|
|
72
|
-
}, Q = (e) => e.sortKey || e.field, a = o, b = G,
|
|
72
|
+
}, Q = (e) => e.sortKey || e.field, a = o, b = G, R = ye(xe, null), j = r(() => R?.disableSearch ? !1 : a.showSearch), P = r(() => a.hideSelectable ? !1 : R ? R.forceSelectable : !0), d = r(() => J(a.rows, a.keyField)), u = y({ field: "", order: "" }), S = y(
|
|
73
73
|
a.pageInfo?.itemsPerPage || a.paginationProps?.itemsPerPage || 10
|
|
74
|
-
), h = y(a.pageInfo?.currentPage || 1), p = y(a.search || ""),
|
|
74
|
+
), h = y(a.pageInfo?.currentPage || 1), p = y(a.search || ""), k = y(!1), Z = r(() => a.loading);
|
|
75
75
|
g(
|
|
76
76
|
() => a.search,
|
|
77
77
|
(e) => {
|
|
@@ -86,12 +86,12 @@ const $e = { class: "space-y-6.5" }, Be = { class: "overflow-x-auto w-full" }, E
|
|
|
86
86
|
}), g(
|
|
87
87
|
() => a.pageInfo?.itemsPerPage,
|
|
88
88
|
(e) => {
|
|
89
|
-
e !== void 0 && (
|
|
89
|
+
e !== void 0 && (S.value = e);
|
|
90
90
|
}
|
|
91
91
|
), g(
|
|
92
92
|
() => a.paginationProps?.itemsPerPage,
|
|
93
93
|
(e) => {
|
|
94
|
-
e !== void 0 && (
|
|
94
|
+
e !== void 0 && (S.value = e);
|
|
95
95
|
}
|
|
96
96
|
), g(
|
|
97
97
|
() => a.pageInfo?.currentPage,
|
|
@@ -138,20 +138,20 @@ const $e = { class: "space-y-6.5" }, Be = { class: "overflow-x-auto w-full" }, E
|
|
|
138
138
|
}, ae = (e) => {
|
|
139
139
|
h.value = e, z();
|
|
140
140
|
}, oe = (e) => {
|
|
141
|
-
|
|
141
|
+
S.value = e, h.value = 1, b("update:itemsPerPage", e), z();
|
|
142
142
|
}, se = (e) => b("rowClick", e), ne = () => {
|
|
143
|
-
b("delete", _.value),
|
|
143
|
+
b("delete", _.value), k.value = !1;
|
|
144
144
|
};
|
|
145
145
|
let U = null;
|
|
146
146
|
const z = () => {
|
|
147
147
|
U && clearTimeout(U), U = setTimeout(() => {
|
|
148
148
|
const e = {
|
|
149
|
-
pagination: { page: h.value, limit:
|
|
149
|
+
pagination: { page: h.value, limit: S.value },
|
|
150
150
|
sort: { ...u.value },
|
|
151
151
|
search: p.value,
|
|
152
152
|
filter: {}
|
|
153
153
|
};
|
|
154
|
-
b("change", e),
|
|
154
|
+
b("change", e), R?.onTableChange?.(e);
|
|
155
155
|
}, 10);
|
|
156
156
|
};
|
|
157
157
|
g(
|
|
@@ -192,54 +192,54 @@ const $e = { class: "space-y-6.5" }, Be = { class: "overflow-x-auto w-full" }, E
|
|
|
192
192
|
"show-search": j.value,
|
|
193
193
|
placeholder: o.searchPlaceholder,
|
|
194
194
|
placeholderI18n: o.searchPlaceholderI18n,
|
|
195
|
-
class:
|
|
195
|
+
class: D(o.toolbarClass),
|
|
196
196
|
"search-class": o.toolbarSearchClass
|
|
197
197
|
}, K({ _: 2 }, [
|
|
198
198
|
e.$slots?.["toolbar-left"] ? {
|
|
199
199
|
name: "left",
|
|
200
|
-
fn:
|
|
201
|
-
|
|
200
|
+
fn: x(() => [
|
|
201
|
+
$(e.$slots, "toolbar-left")
|
|
202
202
|
]),
|
|
203
203
|
key: "0"
|
|
204
204
|
} : void 0,
|
|
205
205
|
s.value.size > 0 ? {
|
|
206
206
|
name: "delete",
|
|
207
|
-
fn:
|
|
208
|
-
|
|
207
|
+
fn: x(() => [
|
|
208
|
+
B(Pe, {
|
|
209
209
|
rounded: "full",
|
|
210
210
|
variant: "outline",
|
|
211
211
|
size: "lg",
|
|
212
212
|
icon: "lucide:trash-2",
|
|
213
|
-
onClick: t[0] || (t[0] = (l) =>
|
|
213
|
+
onClick: t[0] || (t[0] = (l) => k.value = !0)
|
|
214
214
|
})
|
|
215
215
|
]),
|
|
216
216
|
key: "1"
|
|
217
217
|
} : void 0,
|
|
218
218
|
e.$slots?.["toolbar-right"] ? {
|
|
219
219
|
name: "right",
|
|
220
|
-
fn:
|
|
221
|
-
|
|
220
|
+
fn: x(() => [
|
|
221
|
+
$(e.$slots, "toolbar-right")
|
|
222
222
|
]),
|
|
223
223
|
key: "2"
|
|
224
224
|
} : void 0
|
|
225
225
|
]), 1032, ["modelValue", "show-search", "placeholder", "placeholderI18n", "class", "search-class"])) : A("", !0),
|
|
226
226
|
f("div", {
|
|
227
|
-
class:
|
|
227
|
+
class: D(re.value)
|
|
228
228
|
}, [
|
|
229
229
|
f("div", Be, [
|
|
230
230
|
f("table", {
|
|
231
|
-
class:
|
|
231
|
+
class: D([ie.value, "data-table"])
|
|
232
232
|
}, [
|
|
233
233
|
f("thead", {
|
|
234
|
-
class:
|
|
234
|
+
class: D([
|
|
235
235
|
"[&_tr]:border-b [&_tr]:border-border bg-muted",
|
|
236
236
|
o.variant === "raised" ? "[&_th:first-child]:rounded-tl-lg [&_th:last-child]:rounded-tr-lg" : ""
|
|
237
237
|
])
|
|
238
238
|
}, [
|
|
239
239
|
f("tr", Ee, [
|
|
240
|
-
|
|
240
|
+
P.value ? (i(), m("th", Re, [
|
|
241
241
|
f("div", ze, [
|
|
242
|
-
|
|
242
|
+
B(we, {
|
|
243
243
|
"model-value": M.value,
|
|
244
244
|
indeterminate: O.value,
|
|
245
245
|
size: "xs",
|
|
@@ -247,7 +247,7 @@ const $e = { class: "space-y-6.5" }, Be = { class: "overflow-x-auto w-full" }, E
|
|
|
247
247
|
}, null, 8, ["model-value", "indeterminate"])
|
|
248
248
|
])
|
|
249
249
|
])) : A("", !0),
|
|
250
|
-
(i(!0), m(N, null,
|
|
250
|
+
(i(!0), m(N, null, E(o.headers, (l) => (i(), F(Ie, {
|
|
251
251
|
key: l.field,
|
|
252
252
|
header: l,
|
|
253
253
|
"sort-config": u.value,
|
|
@@ -260,21 +260,21 @@ const $e = { class: "space-y-6.5" }, Be = { class: "overflow-x-auto w-full" }, E
|
|
|
260
260
|
])
|
|
261
261
|
], 2),
|
|
262
262
|
f("tbody", Ae, [
|
|
263
|
-
Z.value ? (i(!0), m(N, { key: 0 },
|
|
264
|
-
const
|
|
265
|
-
if (v && v.key === "skeleton-" + l && W(v,
|
|
266
|
-
const
|
|
263
|
+
Z.value ? (i(!0), m(N, { key: 0 }, E(Math.min(S.value, 15), (l, n, ge, v) => {
|
|
264
|
+
const C = [];
|
|
265
|
+
if (v && v.key === "skeleton-" + l && W(v, C)) return v;
|
|
266
|
+
const I = (i(), m("tr", {
|
|
267
267
|
key: "skeleton-" + l,
|
|
268
268
|
class: "border-b border-border/70 bg-background transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted"
|
|
269
269
|
}, [
|
|
270
|
-
|
|
270
|
+
P.value ? (i(), m("td", Ne, [...t[8] || (t[8] = [
|
|
271
271
|
f("div", { class: "flex items-center justify-center" }, [
|
|
272
272
|
f("div", { class: "h-4 w-4 rounded-[4px] bg-muted/50 animate-pulse" })
|
|
273
273
|
], -1)
|
|
274
274
|
])])) : A("", !0),
|
|
275
|
-
(i(!0), m(N, null,
|
|
276
|
-
key:
|
|
277
|
-
class:
|
|
275
|
+
(i(!0), m(N, null, E(o.headers, (T) => (i(), m("td", {
|
|
276
|
+
key: T.field,
|
|
277
|
+
class: D(["p-5! align-middle last:pr-6!", [T.hideOnMobile ? "hidden md:table-cell" : ""]])
|
|
278
278
|
}, [
|
|
279
279
|
f("div", {
|
|
280
280
|
class: "rounded-md bg-muted/50 animate-pulse h-4",
|
|
@@ -282,23 +282,24 @@ const $e = { class: "space-y-6.5" }, Be = { class: "overflow-x-auto w-full" }, E
|
|
|
282
282
|
}, null, 4)
|
|
283
283
|
], 2))), 128))
|
|
284
284
|
]));
|
|
285
|
-
return
|
|
286
|
-
}, t, 2), 128)) : o.rows.length > 0 ? (i(!0), m(N, { key: 1 },
|
|
287
|
-
const
|
|
285
|
+
return I.memo = C, I;
|
|
286
|
+
}, t, 2), 128)) : o.rows.length > 0 ? (i(!0), m(N, { key: 1 }, E(o.rows, (l, n, ge, v) => {
|
|
287
|
+
const C = [
|
|
288
288
|
l,
|
|
289
289
|
s.value.has(c(l, d.value)),
|
|
290
|
+
P.value,
|
|
290
291
|
o.compact,
|
|
291
292
|
o.striped,
|
|
292
293
|
o.hoverable
|
|
293
294
|
];
|
|
294
|
-
if (v && v.key === c(l, d.value) && W(v,
|
|
295
|
-
const
|
|
295
|
+
if (v && v.key === c(l, d.value) && W(v, C)) return v;
|
|
296
|
+
const I = (i(), F(Te, {
|
|
296
297
|
key: c(l, d.value),
|
|
297
298
|
row: l,
|
|
298
299
|
headers: o.headers,
|
|
299
300
|
index: n,
|
|
300
301
|
"key-field": d.value,
|
|
301
|
-
selectable:
|
|
302
|
+
selectable: P.value,
|
|
302
303
|
"is-selected": s.value.has(c(l, d.value)),
|
|
303
304
|
hoverable: o.hoverable,
|
|
304
305
|
striped: o.striped,
|
|
@@ -307,21 +308,21 @@ const $e = { class: "space-y-6.5" }, Be = { class: "overflow-x-auto w-full" }, E
|
|
|
307
308
|
onRowClick: se,
|
|
308
309
|
class: "[&_td:last-child]:pr-3.5!"
|
|
309
310
|
}, K({ _: 2 }, [
|
|
310
|
-
|
|
311
|
-
name:
|
|
312
|
-
fn:
|
|
313
|
-
|
|
311
|
+
E(o.headers, (T) => ({
|
|
312
|
+
name: T.field,
|
|
313
|
+
fn: x((be) => [
|
|
314
|
+
$(e.$slots, T.field, X({ ref_for: !0 }, be))
|
|
314
315
|
])
|
|
315
316
|
}))
|
|
316
317
|
]), 1032, ["row", "headers", "index", "key-field", "selectable", "is-selected", "hoverable", "striped", "compact"]));
|
|
317
|
-
return
|
|
318
|
+
return I.memo = C, I;
|
|
318
319
|
}, t, 4), 128)) : (i(), m("tr", Ve, [
|
|
319
320
|
f("td", {
|
|
320
|
-
colspan:
|
|
321
|
+
colspan: P.value ? o.headers.length + 1 : o.headers.length,
|
|
321
322
|
class: "align-middle hover:bg-transparent"
|
|
322
323
|
}, [
|
|
323
|
-
|
|
324
|
-
|
|
324
|
+
$(e.$slots, "empty", {}, () => [
|
|
325
|
+
B(q(Ce), {
|
|
325
326
|
title: ce.value,
|
|
326
327
|
description: ue.value,
|
|
327
328
|
icon: o.emptyIcon,
|
|
@@ -329,8 +330,8 @@ const $e = { class: "space-y-6.5" }, Be = { class: "overflow-x-auto w-full" }, E
|
|
|
329
330
|
}, K({ _: 2 }, [
|
|
330
331
|
e.$slots["empty-action"] ? {
|
|
331
332
|
name: "action",
|
|
332
|
-
fn:
|
|
333
|
-
|
|
333
|
+
fn: x(() => [
|
|
334
|
+
$(e.$slots, "empty-action")
|
|
334
335
|
]),
|
|
335
336
|
key: "0"
|
|
336
337
|
} : void 0
|
|
@@ -343,7 +344,7 @@ const $e = { class: "space-y-6.5" }, Be = { class: "overflow-x-auto w-full" }, E
|
|
|
343
344
|
])
|
|
344
345
|
], 2),
|
|
345
346
|
o.showPagination && o.pageInfo && o.pageInfo.totalPages > 1 ? (i(), m("div", Ue, [
|
|
346
|
-
|
|
347
|
+
B(q(ke), X({
|
|
347
348
|
"current-page": h.value,
|
|
348
349
|
"total-pages": o.pageInfo.totalPages,
|
|
349
350
|
"total-items": o.pageInfo.totalItems
|
|
@@ -352,16 +353,16 @@ const $e = { class: "space-y-6.5" }, Be = { class: "overflow-x-auto w-full" }, E
|
|
|
352
353
|
"onUpdate:itemsPerPage": oe
|
|
353
354
|
}), null, 16, ["current-page", "total-pages", "total-items"])
|
|
354
355
|
])) : A("", !0),
|
|
355
|
-
|
|
356
|
-
show:
|
|
357
|
-
"onUpdate:show": t[6] || (t[6] = (l) =>
|
|
356
|
+
B(Se, {
|
|
357
|
+
show: k.value,
|
|
358
|
+
"onUpdate:show": t[6] || (t[6] = (l) => k.value = l),
|
|
358
359
|
title: me.value,
|
|
359
360
|
description: fe.value,
|
|
360
361
|
"confirm-text": ve.value,
|
|
361
362
|
"cancel-text": he.value,
|
|
362
363
|
variant: "danger",
|
|
363
364
|
onConfirm: ne,
|
|
364
|
-
onCancel: t[7] || (t[7] = (l) =>
|
|
365
|
+
onCancel: t[7] || (t[7] = (l) => k.value = !1)
|
|
365
366
|
}, null, 8, ["show", "title", "description", "confirm-text", "cancel-text"])
|
|
366
367
|
]));
|
|
367
368
|
}
|
|
@@ -27,8 +27,8 @@ const w = { class: "text-xs font-bold! uppercase tracking-wider text-gray-900 tr
|
|
|
27
27
|
);
|
|
28
28
|
return (p, k) => (n(), l("th", {
|
|
29
29
|
scope: "col",
|
|
30
|
-
class: r(["
|
|
31
|
-
t.compact ? "py-2" : "py-3!",
|
|
30
|
+
class: r(["px-3 text-left align-middle font-medium text-muted-foreground transition-colors [&:has([role=checkbox])]:pr-0 overflow-hidden", [
|
|
31
|
+
t.compact ? "py-2.5!" : "py-3!",
|
|
32
32
|
t.header.sortable !== !1 && t.tableSortable ? "cursor-pointer hover:bg-muted/50" : "",
|
|
33
33
|
t.header.hideOnMobile ? "hidden md:table-cell" : ""
|
|
34
34
|
]]),
|
|
@@ -41,7 +41,9 @@ const w = { class: "text-xs font-bold! uppercase tracking-wider text-gray-900 tr
|
|
|
41
41
|
t.tableSortable && t.header.sortable !== !1 ? (n(), l("span", S, [
|
|
42
42
|
x(v, {
|
|
43
43
|
icon: f.value,
|
|
44
|
-
class: r(["w-3.5 h-3.5 transition-all text-muted-foreground mt-0.5", [
|
|
44
|
+
class: r(["w-3.5 h-3.5 transition-all text-muted-foreground mt-0.5", [
|
|
45
|
+
d.value ? "opacity-100 text-foreground" : "opacity-0 group-hover:opacity-100"
|
|
46
|
+
]])
|
|
45
47
|
}, null, 8, ["icon", "class"])
|
|
46
48
|
])) : y("", !0)
|
|
47
49
|
], 2)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as C, computed as S, openBlock as
|
|
1
|
+
import { defineComponent as C, computed as S, openBlock as o, createElementBlock as a, normalizeClass as u, withModifiers as B, createElementVNode as M, createVNode as p, createCommentVNode as N, Fragment as V, renderList as z, renderSlot as F, createBlock as m } from "vue";
|
|
2
2
|
import L from "../CheckBox.vue.js";
|
|
3
3
|
import $ from "../Price/Price.vue.js";
|
|
4
4
|
import T from "../DateTime/DateTime.vue.js";
|
|
@@ -17,21 +17,21 @@ const E = ["data-state"], H = { class: "flex items-center justify-center" }, I =
|
|
|
17
17
|
},
|
|
18
18
|
emits: ["select", "rowClick"],
|
|
19
19
|
setup(t, { emit: f }) {
|
|
20
|
-
const
|
|
20
|
+
const d = t, r = f, n = (l, i) => {
|
|
21
21
|
if (!(!l || !i))
|
|
22
|
-
return i.includes(".") ? i.split(".").reduce((e,
|
|
23
|
-
}, g = (l, i, e) => l.format ? l.format(i, e) : i == null ? "-" : l.type === "number" ? new Intl.NumberFormat("en-US").format(Number(i)) : String(i),
|
|
24
|
-
const
|
|
25
|
-
if (l.capitalize &&
|
|
26
|
-
const c =
|
|
27
|
-
c &&
|
|
22
|
+
return i.includes(".") ? i.split(".").reduce((e, s) => e?.[s], l) : l[i];
|
|
23
|
+
}, g = (l, i, e) => l.format ? l.format(i, e) : i == null ? "-" : l.type === "number" ? new Intl.NumberFormat("en-US").format(Number(i)) : String(i), x = (l, i, e) => {
|
|
24
|
+
const s = [];
|
|
25
|
+
if (l.capitalize && s.push("capitalize"), l.addStatusColor) {
|
|
26
|
+
const c = w(i);
|
|
27
|
+
c && s.push(c);
|
|
28
28
|
}
|
|
29
29
|
if (typeof l.class == "function") {
|
|
30
30
|
const c = l.class(i, e);
|
|
31
|
-
c &&
|
|
32
|
-
} else l.class &&
|
|
33
|
-
return
|
|
34
|
-
},
|
|
31
|
+
c && s.push(c);
|
|
32
|
+
} else l.class && s.push(l.class);
|
|
33
|
+
return s.join(" ");
|
|
34
|
+
}, w = (l) => {
|
|
35
35
|
const i = {
|
|
36
36
|
active: "text-success font-medium",
|
|
37
37
|
inactive: "text-muted-foreground",
|
|
@@ -52,12 +52,12 @@ const E = ["data-state"], H = { class: "flex items-center justify-center" }, I =
|
|
|
52
52
|
left: "text-left",
|
|
53
53
|
center: "text-center",
|
|
54
54
|
right: "text-right"
|
|
55
|
-
})[l.align || "left"], b = S(() => n(
|
|
56
|
-
r("rowClick", { row:
|
|
55
|
+
})[l.align || "left"], b = S(() => n(d.row, d.keyField)), k = () => {
|
|
56
|
+
r("rowClick", { row: d.row, index: d.index });
|
|
57
57
|
}, v = () => {
|
|
58
58
|
r("select", b.value);
|
|
59
59
|
};
|
|
60
|
-
return (l, i) => (
|
|
60
|
+
return (l, i) => (o(), a("tr", {
|
|
61
61
|
class: u(["border-b data-[state=selected]:bg-muted h-full", [
|
|
62
62
|
t.hoverable ? "hover:bg-muted/20" : "",
|
|
63
63
|
t.striped && t.index % 2 === 1 ? "bg-muted/20" : "bg-background",
|
|
@@ -67,10 +67,9 @@ const E = ["data-state"], H = { class: "flex items-center justify-center" }, I =
|
|
|
67
67
|
"data-state": t.isSelected ? "selected" : void 0,
|
|
68
68
|
onClick: k
|
|
69
69
|
}, [
|
|
70
|
-
t.selectable ? (
|
|
70
|
+
t.selectable ? (o(), a("td", {
|
|
71
71
|
key: 0,
|
|
72
|
-
class: "
|
|
73
|
-
style: { width: "48px" },
|
|
72
|
+
class: "px-0! py-1! align-middle text-center",
|
|
74
73
|
onClick: i[0] || (i[0] = B(() => {
|
|
75
74
|
}, ["stop"]))
|
|
76
75
|
}, [
|
|
@@ -82,13 +81,13 @@ const E = ["data-state"], H = { class: "flex items-center justify-center" }, I =
|
|
|
82
81
|
}, null, 8, ["model-value"])
|
|
83
82
|
])
|
|
84
83
|
])) : N("", !0),
|
|
85
|
-
(
|
|
84
|
+
(o(!0), a(V, null, z(t.headers, (e) => (o(), a("td", {
|
|
86
85
|
key: e.field,
|
|
87
86
|
class: u(["align-middle overflow-hidden", [
|
|
88
|
-
t.compact ? "
|
|
87
|
+
t.compact ? "py-1! -text-fs-1.5! max-sm:pr-10!" : "py-3! pr-5! max-sm:pr-10! -text-fs-1.5!",
|
|
89
88
|
y(e),
|
|
90
89
|
e.hideOnMobile ? "hidden md:table-cell" : "",
|
|
91
|
-
|
|
90
|
+
x(e, n(t.row, e.field), t.row)
|
|
92
91
|
]])
|
|
93
92
|
}, [
|
|
94
93
|
F(l.$slots, e.field, {
|
|
@@ -97,17 +96,17 @@ const E = ["data-state"], H = { class: "flex items-center justify-center" }, I =
|
|
|
97
96
|
index: t.index,
|
|
98
97
|
field: e.field
|
|
99
98
|
}, () => [
|
|
100
|
-
e.type === "price" ? (
|
|
99
|
+
e.type === "price" ? (o(), m($, {
|
|
101
100
|
key: 0,
|
|
102
101
|
value: n(t.row, e.field),
|
|
103
102
|
class: "truncate block",
|
|
104
103
|
title: String(n(t.row, e.field))
|
|
105
|
-
}, null, 8, ["value", "title"])) : e.type === "date" ? (
|
|
104
|
+
}, null, 8, ["value", "title"])) : e.type === "date" ? (o(), m(T, {
|
|
106
105
|
key: 1,
|
|
107
106
|
value: n(t.row, e.field),
|
|
108
107
|
class: "truncate block",
|
|
109
108
|
title: String(n(t.row, e.field))
|
|
110
|
-
}, null, 8, ["value", "title"])) : (
|
|
109
|
+
}, null, 8, ["value", "title"])) : (o(), a("span", {
|
|
111
110
|
key: 2,
|
|
112
111
|
class: "truncate block",
|
|
113
112
|
title: String(n(t.row, e.field)),
|