vlite3 0.9.2 → 0.9.3
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/Alert.vue.js +40 -38
- package/components/Carousel/Carousel.vue.d.ts +2 -2
- package/components/Carousel/Carousel.vue.js +2 -2
- package/components/Carousel/Carousel.vue2.js +1 -1
- package/components/DataTable/DataTableRow.vue.js +1 -1
- package/components/DateTime/DateTime.vue.js +31 -0
- package/components/DateTime/DateTime.vue2.js +4 -0
- package/components/DateTime/index.d.ts +1 -0
- package/components/Form/CustomFields.vue.d.ts +2 -0
- package/components/Form/CustomFields.vue.js +2 -2
- package/components/Form/CustomFields.vue2.js +121 -99
- package/components/Form/FormField.vue.js +1 -0
- package/components/Form/types.d.ts +1 -0
- package/components/List/ListFieldRow.vue.js +1 -1
- package/components/Screen/Screen.vue.js +69 -69
- package/components/Screen/ScreenFilter.vue.js +3 -2
- package/components/Screen/components/ScreenEmptyState.vue.js +11 -10
- package/core/config.d.ts +2 -2
- package/core/config.js +7 -7
- package/core/index.js +3 -3
- package/index.d.ts +1 -1
- package/index.js +2 -2
- package/package.json +1 -1
- package/style.css +9 -9
- package/types/config.type.d.ts +1 -1
- package/components/Date/Date.vue.js +0 -21
- package/components/Date/Date.vue2.js +0 -4
- package/components/Date/index.d.ts +0 -1
- /package/components/{Date/Date.vue.d.ts → DateTime/DateTime.vue.d.ts} +0 -0
package/components/Alert.vue.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as V, ref as B, computed as t, useSlots as N, openBlock as
|
|
2
|
-
import
|
|
3
|
-
import { $t as
|
|
1
|
+
import { defineComponent as V, ref as B, computed as t, useSlots as N, openBlock as r, createElementBlock as i, normalizeClass as l, renderSlot as p, createBlock as S, createCommentVNode as a, createElementVNode as v, toDisplayString as f, createTextVNode as T, createVNode as j } from "vue";
|
|
2
|
+
import b from "./Icon.vue.js";
|
|
3
|
+
import { $t as m } from "../utils/i18n.js";
|
|
4
4
|
const D = ["role"], E = {
|
|
5
5
|
key: 1,
|
|
6
6
|
class: "text-sm opacity-90 [&_p]:leading-relaxed"
|
|
@@ -18,67 +18,69 @@ const D = ["role"], E = {
|
|
|
18
18
|
class: { default: "" }
|
|
19
19
|
},
|
|
20
20
|
emits: ["close"],
|
|
21
|
-
setup(s, { emit:
|
|
22
|
-
const e = s,
|
|
23
|
-
u.value = !1,
|
|
24
|
-
}, d = t(() => e.titleI18n ?
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
21
|
+
setup(s, { emit: y }) {
|
|
22
|
+
const e = s, x = y, u = B(!0), h = () => {
|
|
23
|
+
u.value = !1, x("close");
|
|
24
|
+
}, d = t(() => e.titleI18n ? m(e.titleI18n) : e.title), c = t(
|
|
25
|
+
() => e.descriptionI18n ? m(e.descriptionI18n) : e.description
|
|
26
|
+
), k = t(() => ({
|
|
27
|
+
danger: "bg-danger-subtle text-danger-subtle-fg border-danger-subtle-border/20",
|
|
28
|
+
primary: "bg-primary-light text-primary-light-fg border-primary/10",
|
|
29
|
+
success: "bg-success-subtle text-success-subtle-fg border-success-subtle-border/20",
|
|
30
|
+
warning: "bg-warning-subtle text-warning-subtle-fg border-warning-subtle-border/20"
|
|
29
31
|
})[e.variant]), w = t(() => ({
|
|
30
|
-
primary: "text-primary!",
|
|
31
|
-
success: "text-success-
|
|
32
|
-
warning: "text-warning-
|
|
33
|
-
danger: "text-danger-
|
|
34
|
-
})[e.variant]),
|
|
32
|
+
primary: "text-primary-light-fg!",
|
|
33
|
+
success: "text-success-subtle-fg!",
|
|
34
|
+
warning: "text-warning-subtle-fg!",
|
|
35
|
+
danger: "text-danger-subtle-fg!"
|
|
36
|
+
})[e.variant]), o = t(() => !c.value && !N().default), C = t(() => [
|
|
35
37
|
"relative w-full rounded-lg border px-4 [&>svg]:absolute [&>svg]:left-4 [&>svg]:text-foreground",
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
38
|
+
o.value ? "py-3" : "pt-4 pb-2",
|
|
39
|
+
o.value ? "[&>svg]:top-1/2 [&>svg]:-translate-y-1/2" : "[&>svg]:top-4 top-4 [&>svg+div]:translate-y-[-3px]",
|
|
40
|
+
k.value,
|
|
39
41
|
e.class
|
|
40
42
|
].join(" ")), I = t(() => [
|
|
41
43
|
"font-medium leading-none tracking-tight text-inherit!",
|
|
42
|
-
|
|
44
|
+
o.value ? "" : "mb-1"
|
|
43
45
|
].join(" ")), $ = t(() => e.role ? e.role : ["danger", "warning"].includes(e.variant) ? "alert" : "status");
|
|
44
|
-
return (n, g) => u.value ? (
|
|
46
|
+
return (n, g) => u.value ? (r(), i("div", {
|
|
45
47
|
key: 0,
|
|
46
|
-
class:
|
|
48
|
+
class: l(C.value),
|
|
47
49
|
role: $.value
|
|
48
50
|
}, [
|
|
49
51
|
p(n.$slots, "icon", {}, () => [
|
|
50
|
-
s.icon ? (
|
|
52
|
+
s.icon ? (r(), S(b, {
|
|
51
53
|
key: 0,
|
|
52
54
|
icon: s.icon,
|
|
53
|
-
class:
|
|
54
|
-
}, null, 8, ["icon", "class"])) :
|
|
55
|
+
class: l(["h-4 w-4", w.value])
|
|
56
|
+
}, null, 8, ["icon", "class"])) : a("", !0)
|
|
55
57
|
]),
|
|
56
58
|
v("div", {
|
|
57
|
-
class:
|
|
59
|
+
class: l({ "pl-7": s.icon || n.$slots.icon, "pr-6": s.closable })
|
|
58
60
|
}, [
|
|
59
|
-
d.value ? (
|
|
61
|
+
d.value ? (r(), i("h5", {
|
|
60
62
|
key: 0,
|
|
61
|
-
class:
|
|
62
|
-
},
|
|
63
|
-
c.value || n.$slots.default ? (
|
|
63
|
+
class: l(I.value)
|
|
64
|
+
}, f(d.value), 3)) : a("", !0),
|
|
65
|
+
c.value || n.$slots.default ? (r(), i("div", E, [
|
|
64
66
|
p(n.$slots, "default", {}, () => [
|
|
65
|
-
T(
|
|
67
|
+
T(f(c.value), 1)
|
|
66
68
|
])
|
|
67
|
-
])) :
|
|
69
|
+
])) : a("", !0)
|
|
68
70
|
], 2),
|
|
69
|
-
s.closable ? (
|
|
71
|
+
s.closable ? (r(), i("button", {
|
|
70
72
|
key: 0,
|
|
71
73
|
type: "button",
|
|
72
|
-
onClick:
|
|
73
|
-
class:
|
|
74
|
+
onClick: h,
|
|
75
|
+
class: l(["absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2", [o.value ? "top-1/2 -translate-y-1/2" : "top-4"]])
|
|
74
76
|
}, [
|
|
75
|
-
j(
|
|
77
|
+
j(b, {
|
|
76
78
|
icon: "lucide:x",
|
|
77
79
|
class: "h-4 w-4"
|
|
78
80
|
}),
|
|
79
81
|
g[0] || (g[0] = v("span", { class: "sr-only" }, "Close", -1))
|
|
80
|
-
], 2)) :
|
|
81
|
-
], 10, D)) :
|
|
82
|
+
], 2)) : a("", !0)
|
|
83
|
+
], 10, D)) : a("", !0);
|
|
82
84
|
}
|
|
83
85
|
});
|
|
84
86
|
export {
|
|
@@ -352,7 +352,7 @@ declare function __VLS_template(): {
|
|
|
352
352
|
};
|
|
353
353
|
}>> & Readonly<{
|
|
354
354
|
"onSlide-change"?: ((index: number) => any) | undefined;
|
|
355
|
-
}>, "focus" | "state" | "direction" | "
|
|
355
|
+
}>, "focus" | "state" | "direction" | "draggable" | "easing" | "goNext" | "gap" | "pagination" | "paginationSize" | "paginationVisibility" | "paginationHoverInitialTimeout" | "paginationHoverEdgeThreshold" | "autoPlay" | "autoPlayInterval" | "itemsToShow" | "speed" | "mousewheel" | "loop" | "currentItem" | "bufferSize" | "maxDomElements" | "goToSlide" | "goPrev" | "autoFocus" | "wheelOptions" | "canGoNext" | "canGoPrev"> & import('vue').ShallowUnwrapRef<{
|
|
356
356
|
goToSlide: (index: number, smooth?: boolean) => void;
|
|
357
357
|
goNext: (smooth?: boolean) => void;
|
|
358
358
|
goPrev: (smooth?: boolean) => void;
|
|
@@ -778,7 +778,7 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
778
778
|
};
|
|
779
779
|
}>> & Readonly<{
|
|
780
780
|
"onSlide-change"?: ((index: number) => any) | undefined;
|
|
781
|
-
}>, "focus" | "state" | "direction" | "
|
|
781
|
+
}>, "focus" | "state" | "direction" | "draggable" | "easing" | "goNext" | "gap" | "pagination" | "paginationSize" | "paginationVisibility" | "paginationHoverInitialTimeout" | "paginationHoverEdgeThreshold" | "autoPlay" | "autoPlayInterval" | "itemsToShow" | "speed" | "mousewheel" | "loop" | "currentItem" | "bufferSize" | "maxDomElements" | "goToSlide" | "goPrev" | "autoFocus" | "wheelOptions" | "canGoNext" | "canGoPrev"> & import('vue').ShallowUnwrapRef<{
|
|
782
782
|
goToSlide: (index: number, smooth?: boolean) => void;
|
|
783
783
|
goNext: (smooth?: boolean) => void;
|
|
784
784
|
goPrev: (smooth?: boolean) => void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./Carousel.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import r from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const f = /* @__PURE__ */ r(o, [["__scopeId", "data-v-e8fba320"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
f as default
|
|
7
7
|
};
|
|
@@ -6,7 +6,7 @@ const w = { class: "carousel-wrapper" }, V = /* @__PURE__ */ g({
|
|
|
6
6
|
props: {
|
|
7
7
|
data: { default: () => [] },
|
|
8
8
|
pagination: { type: [String, Array, Boolean], default: "dots" },
|
|
9
|
-
paginationSize: { default: "
|
|
9
|
+
paginationSize: { default: "sm" },
|
|
10
10
|
paginationPosition: { default: "bottom-center" },
|
|
11
11
|
paginationVisibility: {},
|
|
12
12
|
paginationHoverInitialTimeout: {},
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent as C, computed as S, openBlock as s, createElementBlock as d, 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
|
-
import T from "../
|
|
4
|
+
import T from "../DateTime/DateTime.vue.js";
|
|
5
5
|
const E = ["data-state"], H = { class: "flex items-center justify-center" }, I = ["title", "innerHTML"], j = /* @__PURE__ */ C({
|
|
6
6
|
__name: "DataTableRow",
|
|
7
7
|
props: {
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { defineComponent as D, computed as n, openBlock as _, createElementBlock as g, toDisplayString as h } from "vue";
|
|
2
|
+
import s from "dayjs";
|
|
3
|
+
import { useVLiteConfig as y } from "../../core/config.js";
|
|
4
|
+
const V = /* @__PURE__ */ D({
|
|
5
|
+
__name: "DateTime",
|
|
6
|
+
props: {
|
|
7
|
+
value: {},
|
|
8
|
+
format: {}
|
|
9
|
+
},
|
|
10
|
+
setup(m) {
|
|
11
|
+
const t = m, i = y(), c = n(() => t.format || i?.components?.datetime?.format || "MM/DD/YYYY"), f = n(() => {
|
|
12
|
+
if (!t.value) return "--";
|
|
13
|
+
if (typeof t.value == "string") {
|
|
14
|
+
const e = t.value.trim();
|
|
15
|
+
if (/^([01]?\d|2[0-3]):([0-5]\d)(:([0-5]\d))?$/.test(e)) {
|
|
16
|
+
const r = e.split(":"), u = r[0].padStart(2, "0"), l = r[1], p = r[2] || "00", d = `1970-01-01T${u}:${l}:${p}`, a = s(d);
|
|
17
|
+
if (a.isValid()) {
|
|
18
|
+
const v = t.format || "h:mm A";
|
|
19
|
+
return a.format(v);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
const o = s(t.value);
|
|
24
|
+
return o.isValid() ? o.format(c.value) : String(t.value);
|
|
25
|
+
});
|
|
26
|
+
return (o, e) => (_(), g("span", null, h(f.value), 1));
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
export {
|
|
30
|
+
V as default
|
|
31
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as DateTime } from './DateTime.vue';
|
|
@@ -8,6 +8,7 @@ interface Props {
|
|
|
8
8
|
size?: InputSize;
|
|
9
9
|
rounded?: InputRounded;
|
|
10
10
|
disabled?: boolean;
|
|
11
|
+
draggable?: boolean;
|
|
11
12
|
minRows?: number;
|
|
12
13
|
maxRows?: number;
|
|
13
14
|
addButtonText?: string;
|
|
@@ -33,6 +34,7 @@ declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, imp
|
|
|
33
34
|
isUpdate: boolean;
|
|
34
35
|
modelValue: Record<string, any>[];
|
|
35
36
|
headers: string[];
|
|
37
|
+
draggable: boolean;
|
|
36
38
|
minRows: number;
|
|
37
39
|
addButtonText: string;
|
|
38
40
|
showRowNumbers: boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./CustomFields.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const r = /* @__PURE__ */ t(o, [["__scopeId", "data-v-877e3c1c"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
r as default
|
|
7
7
|
};
|
|
@@ -1,27 +1,32 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
1
|
+
import { defineComponent as H, computed as c, shallowRef as q, watch as G, openBlock as o, createElementBlock as n, createElementVNode as g, createBlock as J, withCtx as B, createTextVNode as K, toDisplayString as m, createCommentVNode as i, createVNode as b, Fragment as y, renderList as p, normalizeClass as x, unref as O, isMemoSame as P } from "vue";
|
|
2
|
+
import { VueDraggable as Q } from "vue-draggable-plus";
|
|
3
|
+
import W from "./FormField.vue.js";
|
|
4
|
+
import F from "../Button.vue.js";
|
|
5
|
+
import X from "../Label.vue.js";
|
|
6
|
+
import Y from "../Icon.vue.js";
|
|
7
|
+
import { $t as h } from "../../utils/i18n.js";
|
|
8
|
+
const Z = { class: "custom-fields-wrapper" }, ee = { class: "flex justify-between items-center mb-2" }, te = { class: "custom-fields-table border border-border rounded overflow-hidden bg-background" }, ae = {
|
|
7
9
|
key: 0,
|
|
8
10
|
class: "flex border-b border-border bg-muted/50 text-gray-800 text-xs font-semibold uppercase tracking-wider"
|
|
9
|
-
},
|
|
11
|
+
}, le = {
|
|
10
12
|
key: 0,
|
|
11
|
-
class: "w-10 flex-none p-3
|
|
12
|
-
},
|
|
13
|
+
class: "w-10 flex-none p-3 border-r border-border"
|
|
14
|
+
}, re = {
|
|
13
15
|
key: 1,
|
|
14
|
-
class: "w-10 flex-none p-3"
|
|
16
|
+
class: "w-10 flex-none p-3 text-center border-r border-border"
|
|
15
17
|
}, se = {
|
|
16
|
-
key:
|
|
17
|
-
class: "w-10 flex-none
|
|
18
|
-
},
|
|
18
|
+
key: 2,
|
|
19
|
+
class: "w-10 flex-none p-3"
|
|
20
|
+
}, oe = {
|
|
19
21
|
key: 1,
|
|
22
|
+
class: "w-10 flex-none flex items-center justify-center text-xs text-muted-foreground border-r border-border bg-muted/20"
|
|
23
|
+
}, ne = {
|
|
24
|
+
key: 2,
|
|
20
25
|
class: "w-10 flex-none flex items-center justify-center border-l border-border bg-muted/20"
|
|
21
|
-
},
|
|
26
|
+
}, de = {
|
|
22
27
|
key: 1,
|
|
23
28
|
class: "flex flex-col items-center justify-center py-6 text-center bg-muted/5"
|
|
24
|
-
},
|
|
29
|
+
}, ie = { class: "text-sm font-medium text-foreground" }, ue = { class: "text-xs text-muted-foreground mt-1" }, ye = /* @__PURE__ */ H({
|
|
25
30
|
__name: "CustomFields",
|
|
26
31
|
props: {
|
|
27
32
|
modelValue: { default: () => [] },
|
|
@@ -31,6 +36,7 @@ const W = { class: "custom-fields-wrapper" }, X = { class: "flex justify-between
|
|
|
31
36
|
size: { default: "md" },
|
|
32
37
|
rounded: { default: "md" },
|
|
33
38
|
disabled: { type: Boolean, default: !1 },
|
|
39
|
+
draggable: { type: Boolean, default: !1 },
|
|
34
40
|
minRows: { default: 0 },
|
|
35
41
|
maxRows: {},
|
|
36
42
|
addButtonText: { default: "Add Row" },
|
|
@@ -42,144 +48,160 @@ const W = { class: "custom-fields-wrapper" }, X = { class: "flex justify-between
|
|
|
42
48
|
isUpdate: { type: Boolean, default: !1 }
|
|
43
49
|
},
|
|
44
50
|
emits: ["update:modelValue", "change"],
|
|
45
|
-
setup(
|
|
46
|
-
const t =
|
|
47
|
-
const e =
|
|
51
|
+
setup(r, { emit: $ }) {
|
|
52
|
+
const t = r, R = $, k = c(() => t.labelI18n ? h(t.labelI18n) : t.label), D = c(() => {
|
|
53
|
+
const e = h("vlite.customFields.emptyTitle");
|
|
48
54
|
return e !== "vlite.customFields.emptyTitle" ? e : "No items added";
|
|
49
|
-
}),
|
|
50
|
-
const e =
|
|
55
|
+
}), U = c(() => {
|
|
56
|
+
const e = h("vlite.customFields.emptyDescription");
|
|
51
57
|
return e !== "vlite.customFields.emptyDescription" ? e : "Add a new item to get started";
|
|
52
|
-
}), l =
|
|
53
|
-
|
|
58
|
+
}), l = q([]), _ = () => `row_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`;
|
|
59
|
+
G(
|
|
54
60
|
() => t.modelValue,
|
|
55
61
|
(e) => {
|
|
56
|
-
Array.isArray(e) ? l.value = e.map((
|
|
57
|
-
const
|
|
62
|
+
Array.isArray(e) ? l.value = e.map((a, d) => {
|
|
63
|
+
const s = l.value[d];
|
|
58
64
|
return {
|
|
59
|
-
...
|
|
60
|
-
_id:
|
|
65
|
+
...a,
|
|
66
|
+
_id: s?._id || _()
|
|
61
67
|
};
|
|
62
68
|
}) : l.value = [];
|
|
63
69
|
},
|
|
64
70
|
{ immediate: !0, deep: !0 }
|
|
65
71
|
);
|
|
66
|
-
const
|
|
72
|
+
const j = () => {
|
|
67
73
|
const e = {};
|
|
68
|
-
for (const
|
|
69
|
-
const
|
|
70
|
-
e[
|
|
74
|
+
for (const a of t.schema) {
|
|
75
|
+
const d = typeof a.value == "function" ? a.value() : a.value;
|
|
76
|
+
e[a.name] = d ?? null;
|
|
71
77
|
}
|
|
72
|
-
return { ...e, _id:
|
|
73
|
-
},
|
|
78
|
+
return { ...e, _id: _() };
|
|
79
|
+
}, z = () => {
|
|
74
80
|
if (t.disabled || t.maxRows && l.value.length >= t.maxRows) return;
|
|
75
|
-
const e = [...l.value,
|
|
76
|
-
l.value = e,
|
|
77
|
-
},
|
|
81
|
+
const e = [...l.value, j()];
|
|
82
|
+
l.value = e, f(e);
|
|
83
|
+
}, A = (e) => {
|
|
78
84
|
if (t.disabled || l.value.length <= t.minRows) return;
|
|
79
|
-
const s = [...l.value];
|
|
80
|
-
s.splice(e, 1), l.value = s, h(s);
|
|
81
|
-
}, U = (e, s, r) => {
|
|
82
85
|
const a = [...l.value];
|
|
83
|
-
a
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
},
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
86
|
+
a.splice(e, 1), l.value = a, f(a);
|
|
87
|
+
}, E = (e, a, d) => {
|
|
88
|
+
const s = [...l.value];
|
|
89
|
+
s[e] = {
|
|
90
|
+
...s[e],
|
|
91
|
+
[a]: d.value
|
|
92
|
+
}, l.value = s, f(s);
|
|
93
|
+
}, T = (e) => {
|
|
94
|
+
l.value = e, f(e);
|
|
95
|
+
}, f = (e) => {
|
|
96
|
+
const a = e.map(({ _id: d, ...s }) => s);
|
|
97
|
+
R("update:modelValue", a), R("change", a);
|
|
98
|
+
}, S = (e, a) => l.value[e]?.[a], I = c(() => !(t.disabled || t.maxRows && l.value.length >= t.maxRows)), w = c(() => t.disabled ? !1 : l.value.length > t.minRows), C = c(() => t.headers && t.headers.length > 0 ? t.headers : t.schema.map((e) => e.labelI18n ? h(e.labelI18n) : e.label || e.name));
|
|
99
|
+
return (e, a) => (o(), n("div", Z, [
|
|
100
|
+
g("div", ee, [
|
|
101
|
+
k.value ? (o(), J(X, {
|
|
94
102
|
key: 0,
|
|
95
103
|
class: "text-sm font-medium text-foreground"
|
|
96
104
|
}, {
|
|
97
|
-
default:
|
|
98
|
-
|
|
105
|
+
default: B(() => [
|
|
106
|
+
K(m(k.value), 1)
|
|
99
107
|
]),
|
|
100
108
|
_: 1
|
|
101
|
-
})) :
|
|
102
|
-
|
|
109
|
+
})) : i("", !0),
|
|
110
|
+
b(F, {
|
|
103
111
|
type: "button",
|
|
104
112
|
variant: "outline",
|
|
105
113
|
size: "xs",
|
|
106
114
|
rounded: "full",
|
|
107
115
|
icon: "lucide:plus",
|
|
108
|
-
disabled: !
|
|
109
|
-
onClick:
|
|
116
|
+
disabled: !I.value,
|
|
117
|
+
onClick: z
|
|
110
118
|
}, null, 8, ["disabled"])
|
|
111
119
|
]),
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
(o(
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
120
|
+
g("div", te, [
|
|
121
|
+
C.value.length > 0 ? (o(), n("div", ae, [
|
|
122
|
+
r.draggable ? (o(), n("div", le)) : i("", !0),
|
|
123
|
+
r.showRowNumbers ? (o(), n("div", re, " # ")) : i("", !0),
|
|
124
|
+
(o(!0), n(y, null, p(C.value, (d, s) => (o(), n("div", {
|
|
125
|
+
key: s,
|
|
126
|
+
class: x(["flex-1 p-3 min-w-0 truncate", { "border-l border-border": s > 0 }])
|
|
127
|
+
}, m(d), 3))), 128)),
|
|
128
|
+
w.value ? (o(), n("div", se)) : i("", !0)
|
|
129
|
+
])) : i("", !0),
|
|
130
|
+
b(O(Q), {
|
|
131
|
+
"model-value": l.value,
|
|
132
|
+
"onUpdate:modelValue": T,
|
|
133
|
+
disabled: !r.draggable || r.disabled,
|
|
134
|
+
animation: 150,
|
|
135
|
+
handle: ".drag-handle",
|
|
136
|
+
"ghost-class": "opacity-50",
|
|
124
137
|
class: "divide-y divide-border"
|
|
125
138
|
}, {
|
|
126
|
-
default:
|
|
127
|
-
(o(!0), n(
|
|
128
|
-
const
|
|
129
|
-
if (
|
|
130
|
-
const
|
|
131
|
-
key:
|
|
139
|
+
default: B(() => [
|
|
140
|
+
(o(!0), n(y, null, p(l.value, (d, s, ce, v) => {
|
|
141
|
+
const V = [d, r.disabled, r.isUpdate, r.showRowNumbers, w.value, r.draggable, s];
|
|
142
|
+
if (v && v.key === d._id && P(v, V)) return v;
|
|
143
|
+
const N = (o(), n("div", {
|
|
144
|
+
key: d._id,
|
|
132
145
|
class: "flex group bg-white transition-colors"
|
|
133
146
|
}, [
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
147
|
+
r.draggable ? (o(), n("div", {
|
|
148
|
+
key: 0,
|
|
149
|
+
class: x(["w-10 flex-none flex items-center justify-center border-r border-border bg-muted/5 drag-handle transition-colors", r.disabled ? "cursor-not-allowed opacity-50" : "cursor-grab active:cursor-grabbing hover:bg-muted/10 text-muted-foreground hover:text-foreground"])
|
|
150
|
+
}, [
|
|
151
|
+
b(Y, {
|
|
152
|
+
icon: "lucide:grip-vertical",
|
|
153
|
+
class: "w-4 h-4"
|
|
154
|
+
})
|
|
155
|
+
], 2)) : i("", !0),
|
|
156
|
+
r.showRowNumbers ? (o(), n("div", oe, m(s + 1), 1)) : i("", !0),
|
|
157
|
+
(o(!0), n(y, null, p(r.schema, (u, L) => (o(), n("div", {
|
|
158
|
+
key: u.name,
|
|
159
|
+
class: x(["flex-1 min-w-0 relative", { "border-l border-border": L > 0 }])
|
|
138
160
|
}, [
|
|
139
|
-
|
|
161
|
+
b(W, {
|
|
140
162
|
field: {
|
|
141
|
-
...
|
|
163
|
+
...u,
|
|
142
164
|
props: {
|
|
143
|
-
...
|
|
144
|
-
...
|
|
165
|
+
...u.type === "multiSelect" ? { showControls: !1, wrap: !1 } : {},
|
|
166
|
+
...u.props || {}
|
|
145
167
|
},
|
|
146
168
|
label: void 0
|
|
147
169
|
},
|
|
148
|
-
value:
|
|
149
|
-
values:
|
|
170
|
+
value: S(s, u.name),
|
|
171
|
+
values: r.values || {},
|
|
150
172
|
variant: "transparent",
|
|
151
173
|
size: "sm",
|
|
152
174
|
rounded: "none",
|
|
153
|
-
disabled:
|
|
154
|
-
isUpdate:
|
|
175
|
+
disabled: r.disabled,
|
|
176
|
+
isUpdate: r.isUpdate,
|
|
155
177
|
class: "w-full h-full min-h-[40px]",
|
|
156
|
-
onChange: (
|
|
178
|
+
onChange: (M) => E(s, u.name, M)
|
|
157
179
|
}, null, 8, ["field", "value", "values", "disabled", "isUpdate", "onChange"])
|
|
158
180
|
], 2))), 128)),
|
|
159
|
-
w.value ? (o(), n("div",
|
|
160
|
-
|
|
181
|
+
w.value ? (o(), n("div", ne, [
|
|
182
|
+
b(F, {
|
|
161
183
|
type: "button",
|
|
162
184
|
variant: "ghost",
|
|
163
185
|
size: "xs",
|
|
164
186
|
icon: "lucide:trash-2",
|
|
165
|
-
disabled:
|
|
166
|
-
onClick: (
|
|
187
|
+
disabled: r.disabled,
|
|
188
|
+
onClick: (u) => A(s)
|
|
167
189
|
}, null, 8, ["disabled", "onClick"])
|
|
168
|
-
])) :
|
|
190
|
+
])) : i("", !0)
|
|
169
191
|
]));
|
|
170
|
-
return
|
|
171
|
-
},
|
|
192
|
+
return N.memo = V, N;
|
|
193
|
+
}, a, 0), 128))
|
|
172
194
|
]),
|
|
173
195
|
_: 1
|
|
174
|
-
}),
|
|
175
|
-
l.value.length === 0 ? (o(), n("div",
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
])) :
|
|
196
|
+
}, 8, ["model-value", "disabled"]),
|
|
197
|
+
l.value.length === 0 ? (o(), n("div", de, [
|
|
198
|
+
g("p", ie, m(D.value), 1),
|
|
199
|
+
g("p", ue, m(U.value), 1)
|
|
200
|
+
])) : i("", !0)
|
|
179
201
|
])
|
|
180
202
|
]));
|
|
181
203
|
}
|
|
182
204
|
});
|
|
183
205
|
export {
|
|
184
|
-
|
|
206
|
+
ye as default
|
|
185
207
|
};
|
|
@@ -211,6 +211,7 @@ const pe = /* @__PURE__ */ I({
|
|
|
211
211
|
modelValue: Array.isArray(e.value) ? e.value : [],
|
|
212
212
|
schema: e.field.props?.schema || [],
|
|
213
213
|
headers: e.field.props?.headers || [],
|
|
214
|
+
draggable: e.field.props?.draggable || !1,
|
|
214
215
|
values: e.values,
|
|
215
216
|
variant: e.variant,
|
|
216
217
|
size: e.size,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent as V, ref as D, computed as f, openBlock as l, createElementBlock as a, normalizeClass as s, createElementVNode as v, createBlock as u, createCommentVNode as T, toDisplayString as w, renderSlot as C, resolveDynamicComponent as B, Fragment as m, createVNode as S } from "vue";
|
|
2
2
|
import x from "../Icon.vue.js";
|
|
3
3
|
import b from "../Price/Price.vue.js";
|
|
4
|
-
import h from "../
|
|
4
|
+
import h from "../DateTime/DateTime.vue.js";
|
|
5
5
|
import { $t as I } from "../../utils/i18n.js";
|
|
6
6
|
import { getObjectValue as N, formatNumber as Y, getStatusColorClass as F } from "./utils.js";
|
|
7
7
|
const A = { class: "flex items-center gap-2 min-w-0" }, E = { class: "text-xs font-normal text-muted-foreground leading-snug truncate" }, O = { class: "min-w-0" }, z = {
|