vlite3 1.4.30 → 1.4.32
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.js +19 -16
- package/components/Accordion/AccordionContent.vue.js +2 -2
- package/components/Accordion/AccordionItem.vue.js +38 -36
- package/components/CategoryManager/CategoryManager.vue2.js +3 -2
- package/components/Chart/GanttChart.vue.d.ts +13 -1
- package/components/Chart/GanttChart.vue.js +2 -2
- package/components/Chart/GanttChart.vue2.js +1185 -607
- package/components/Chart/GanttChartDateUtils.d.ts +38 -0
- package/components/Chart/GanttChartDateUtils.js +79 -0
- package/components/Chart/GanttChartDependencyUtils.d.ts +92 -0
- package/components/Chart/GanttChartDependencyUtils.js +113 -0
- package/components/Chart/GanttChartResizePreviewUtils.d.ts +52 -0
- package/components/Chart/GanttChartResizePreviewUtils.js +53 -0
- package/components/Chart/GanttChartTooltipUtils.d.ts +41 -0
- package/components/Chart/GanttChartTooltipUtils.js +63 -0
- package/components/Chart/index.d.ts +3 -1
- package/components/Chart/types.d.ts +76 -1
- package/components/Chart/types.js +8 -0
- package/components/FilePicker/FilePickerDropzone.vue.js +1 -1
- package/components/FilePicker/index.vue.js +2 -4
- package/components/Form/AccordionView.vue2.js +5 -2
- package/components/Form/AccordionView.vue3.js +250 -0
- package/components/Form/Form.vue.d.ts +0 -2
- package/components/Form/Form.vue.js +1 -1
- package/components/Form/Form.vue2.js +415 -354
- package/components/Form/FormField.vue.js +175 -196
- package/components/Form/FormFields.vue.js +1 -1
- package/components/Form/FormFields.vue2.js +60 -60
- package/components/Form/FormSkeleton.vue.js +50 -35
- package/components/Form/TableView.vue.js +59 -43
- package/components/Form/composables/useForm.js +159 -148
- package/components/Form/index.vue2.js +8 -8
- package/components/Form/utils/form.utils.d.ts +2 -0
- package/components/Form/utils/form.utils.js +17 -13
- package/components/GoogleMap.vue.d.ts +1 -1
- package/components/PanZoomViewport/PanZoomViewport.vue.d.ts +189 -0
- package/components/PanZoomViewport/PanZoomViewport.vue.js +7 -0
- package/components/PanZoomViewport/PanZoomViewport.vue2.js +536 -0
- package/components/PanZoomViewport/index.d.ts +2 -0
- package/components/PanZoomViewport/types.d.ts +121 -0
- package/components/ScaleGenerator/ScaleGenerator.vue.d.ts +3 -0
- package/components/ScaleGenerator/ScaleGenerator.vue.js +5 -108
- package/components/ScaleGenerator/ScaleGenerator.vue2.js +143 -2
- package/components/ScaleGenerator/types.d.ts +2 -0
- package/components/Screen/ScreenFilter.vue.js +18 -17
- package/components/SeoProvider/SeoProvider.vue.d.ts +4 -1
- package/components/SeoProvider/SeoProvider.vue.js +39 -33
- package/components/SeoProvider/domAdapter.d.ts +1 -4
- package/components/SeoProvider/domAdapter.js +71 -58
- package/components/SeoProvider/index.d.ts +5 -2
- package/components/SeoProvider/normalizeSeo.d.ts +10 -49
- package/components/SeoProvider/normalizeSeo.js +246 -182
- package/components/SeoProvider/plainText.d.ts +8 -0
- package/components/SeoProvider/plainText.js +117 -0
- package/components/SeoProvider/seoUrl.d.ts +13 -0
- package/components/SeoProvider/seoUrl.js +25 -0
- package/components/SeoProvider/structuredData.d.ts +100 -0
- package/components/SeoProvider/structuredData.js +33 -0
- package/components/SeoProvider/types.d.ts +47 -109
- package/components/Tabes/Tabes.vue.d.ts +10 -1
- package/components/Tabes/Tabes.vue.js +1 -1
- package/components/Tabes/Tabes.vue2.js +271 -170
- package/components/Tabes/TabesMarkerGeometry.d.ts +34 -0
- package/components/Tabes/TabesMarkerGeometry.js +21 -0
- package/components/Tabes/tabes.utils.d.ts +14 -0
- package/components/Tabes/tabes.utils.js +26 -0
- package/components/Tabes/types.d.ts +32 -0
- package/components/ThemeProvider/ThemeProvider.vue.d.ts +2 -0
- package/components/ThemeProvider/ThemeProvider.vue.js +29 -23
- package/components/ThemeProvider/index.d.ts +1 -1
- package/components/ThemeProvider/themeVars.d.ts +9 -13
- package/components/ThemeProvider/themeVars.js +173 -125
- package/components/ThemeProvider/types.d.ts +10 -0
- package/components/index.d.ts +2 -1
- package/index.d.ts +1 -0
- package/index.js +415 -387
- package/package.json +3 -2
- package/style.css +1 -1
- package/components/Form/AccordionView.vue.js +0 -222
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { defineComponent as J, computed as K,
|
|
2
|
-
import { isComponent as
|
|
1
|
+
import { defineComponent as J, computed as K, shallowRef as Q, openBlock as o, createElementBlock as u, normalizeClass as v, Fragment as b, renderList as W, withMemo as X, unref as m, createBlock as p, withCtx as U, resolveDynamicComponent as D, createTextVNode as A, toDisplayString as x, createCommentVNode as i, createElementVNode as Y, createVNode as Z, renderSlot as _, markRaw as ee } from "vue";
|
|
2
|
+
import { isComponent as h, getNestedValue as V, fieldRendersOwnErrorMessage as te, resolveFieldType as ae } from "./utils/form.utils.js";
|
|
3
3
|
import B from "../Label.vue.js";
|
|
4
|
-
import
|
|
5
|
-
import { resolveI18nText as
|
|
6
|
-
const
|
|
4
|
+
import ne from "./FormField.vue.js";
|
|
5
|
+
import { resolveI18nText as se } from "../../utils/i18n.js";
|
|
6
|
+
const re = {
|
|
7
7
|
key: 0,
|
|
8
8
|
class: "text-destructive ml-0.5"
|
|
9
|
-
},
|
|
9
|
+
}, oe = ["onFocusin", "onFocusout"], ue = ["for"], le = {
|
|
10
10
|
key: 0,
|
|
11
11
|
class: "text-destructive ml-0.5"
|
|
12
|
-
},
|
|
12
|
+
}, ce = {
|
|
13
13
|
key: 0,
|
|
14
14
|
class: "text-destructive ml-0.5"
|
|
15
|
-
},
|
|
15
|
+
}, ge = /* @__PURE__ */ J({
|
|
16
16
|
__name: "FormFields",
|
|
17
17
|
props: {
|
|
18
18
|
schema: {},
|
|
@@ -32,10 +32,10 @@ const se = {
|
|
|
32
32
|
layout: { default: "vertical" }
|
|
33
33
|
},
|
|
34
34
|
emits: ["change", "addonAction"],
|
|
35
|
-
setup(n, { emit:
|
|
36
|
-
const r = n, k =
|
|
35
|
+
setup(n, { emit: E }) {
|
|
36
|
+
const r = n, k = E, q = K(() => {
|
|
37
37
|
if (r.className) return r.className;
|
|
38
|
-
}), s = (t) =>
|
|
38
|
+
}), s = (t) => ae(t, {
|
|
39
39
|
values: r.values,
|
|
40
40
|
globalValues: r.values,
|
|
41
41
|
isUpdate: r.isUpdate
|
|
@@ -43,27 +43,27 @@ const se = {
|
|
|
43
43
|
if (!r.excludeTypes || r.excludeTypes.length === 0) return !0;
|
|
44
44
|
const a = s(t);
|
|
45
45
|
return !a || !r.excludeTypes.includes(a);
|
|
46
|
-
}, F = (t) => V(r.values, t.name),
|
|
46
|
+
}, F = (t) => V(r.values, t.name), g = (t) => r.errors[t.name] || "", $ = (t) => r.isFieldVisible ? r.isFieldVisible(t) : !0, R = (t) => r.isFieldDisabled ? r.isFieldDisabled(t) : t.disabled === !0, C = (t) => r.isFieldReadonly ? r.isFieldReadonly(t) : t.readonly === !0, l = (t) => t.labelI18n ? se(
|
|
47
47
|
t.labelI18n,
|
|
48
48
|
typeof t.label == "string" ? t.label : void 0
|
|
49
|
-
) ?? t.label : t.label,
|
|
49
|
+
) ?? t.label : t.label, L = (t) => {
|
|
50
50
|
if (t)
|
|
51
|
-
return
|
|
51
|
+
return h(t) ? ee(t) : t;
|
|
52
52
|
}, S = (t, a) => {
|
|
53
53
|
k("change", t.name, a);
|
|
54
|
-
}, j = (t) => t.itemClass || "",
|
|
54
|
+
}, j = (t) => t.itemClass || "", M = (t, a) => {
|
|
55
55
|
k("change", t, a);
|
|
56
|
-
}, H = (t) => {
|
|
57
|
-
k("addonAction", t);
|
|
58
|
-
}, g = (t) => t && typeof t == "object" && t.name ? t.name : null, y = Q({}), M = (t) => {
|
|
59
|
-
y.value[t] = !0;
|
|
60
56
|
}, O = (t) => {
|
|
61
|
-
|
|
62
|
-
},
|
|
57
|
+
k("addonAction", t);
|
|
58
|
+
}, y = (t) => t && typeof t == "object" && t.name ? t.name : null, c = Q({}), P = (t) => {
|
|
59
|
+
c.value[t] || (c.value = { ...c.value, [t]: !0 });
|
|
60
|
+
}, H = (t) => {
|
|
61
|
+
c.value[t] && (c.value = { ...c.value, [t]: !1 });
|
|
62
|
+
}, N = (t) => {
|
|
63
63
|
const a = F(t), e = s(t);
|
|
64
|
-
let
|
|
64
|
+
let d = a != null && a !== "" && !(Array.isArray(a) && a.length === 0);
|
|
65
65
|
const z = typeof a == "number" && !isNaN(a);
|
|
66
|
-
return e === "dateRangePicker" && a && typeof a == "object" && (
|
|
66
|
+
return e === "dateRangePicker" && a && typeof a == "object" && (d = !!(a.startDate || a.endDate || a.start || a.end)), T(t) || e === "number" ? c.value[t.name] || d || z : d || z;
|
|
67
67
|
}, T = (t) => {
|
|
68
68
|
const a = s(t) || "text";
|
|
69
69
|
return ["text", "email", "password", "tel", "url", "search", "textarea"].includes(a);
|
|
@@ -85,14 +85,14 @@ const se = {
|
|
|
85
85
|
].includes(a);
|
|
86
86
|
}, f = (t) => {
|
|
87
87
|
const a = l(t);
|
|
88
|
-
if (!(!a ||
|
|
88
|
+
if (!(!a || h(a)))
|
|
89
89
|
return a;
|
|
90
90
|
};
|
|
91
91
|
return (t, a) => (o(), u("div", {
|
|
92
|
-
class:
|
|
92
|
+
class: v([
|
|
93
93
|
n.layout === "inline" ? "flex flex-row flex-wrap items-end w-full " : "grid",
|
|
94
94
|
n.variant === "floating" ? "gap-5 mt-1" : "gap-4",
|
|
95
|
-
|
|
95
|
+
q.value
|
|
96
96
|
])
|
|
97
97
|
}, [
|
|
98
98
|
(o(!0), u(b, null, W(n.schema, (e) => (o(), u(b, {
|
|
@@ -101,10 +101,10 @@ const se = {
|
|
|
101
101
|
$(e) && I(e) ? X([
|
|
102
102
|
e,
|
|
103
103
|
F(e),
|
|
104
|
-
|
|
104
|
+
g(e),
|
|
105
|
+
R(e),
|
|
105
106
|
C(e),
|
|
106
|
-
|
|
107
|
-
y.value[e.name],
|
|
107
|
+
c.value[e.name],
|
|
108
108
|
n.variant,
|
|
109
109
|
n.size,
|
|
110
110
|
n.rounded,
|
|
@@ -112,12 +112,12 @@ const se = {
|
|
|
112
112
|
n.showRequiredAsterisk,
|
|
113
113
|
n.fieldLoading[e.name],
|
|
114
114
|
s(e),
|
|
115
|
-
m(
|
|
116
|
-
|
|
117
|
-
|
|
115
|
+
m(h)(s(e)) || s(e) === "customFields" ? n.values : null,
|
|
116
|
+
y(e.addonLeft) ? m(V)(n.values, y(e.addonLeft)) : null,
|
|
117
|
+
y(e.addonRight) ? m(V)(n.values, y(e.addonRight)) : null
|
|
118
118
|
], () => (o(), u("div", {
|
|
119
119
|
key: 0,
|
|
120
|
-
class:
|
|
120
|
+
class: v([
|
|
121
121
|
"max-md:col-span-full! form-field-item relative",
|
|
122
122
|
j(e),
|
|
123
123
|
n.layout === "inline" ? " " : ""
|
|
@@ -130,35 +130,35 @@ const se = {
|
|
|
130
130
|
class: "mb-2 block font-medium"
|
|
131
131
|
}, {
|
|
132
132
|
default: U(() => [
|
|
133
|
-
m(
|
|
133
|
+
m(h)(l(e)) ? (o(), p(D(L(l(e))), { key: 0 })) : (o(), u(b, { key: 1 }, [
|
|
134
134
|
A(x(l(e)) + " ", 1),
|
|
135
|
-
e.required && n.showRequiredAsterisk ? (o(), u("span",
|
|
135
|
+
e.required && n.showRequiredAsterisk ? (o(), u("span", re, "*")) : i("", !0)
|
|
136
136
|
], 64))
|
|
137
137
|
]),
|
|
138
138
|
_: 2
|
|
139
|
-
}, 1032, ["for"])) :
|
|
139
|
+
}, 1032, ["for"])) : i("", !0),
|
|
140
140
|
Y("div", {
|
|
141
|
-
class:
|
|
141
|
+
class: v(["relative", [
|
|
142
142
|
s(e) === "check" || s(e) === "switch" && e.props?.switchVariant === "basic" ? "w-auto" : "w-full",
|
|
143
143
|
s(e) === "switch" || s(e) === "check" ? "mt-auto" : ""
|
|
144
144
|
]]),
|
|
145
|
-
onFocusin: (
|
|
146
|
-
onFocusout: (
|
|
145
|
+
onFocusin: (d) => P(e.name),
|
|
146
|
+
onFocusout: (d) => H(e.name)
|
|
147
147
|
}, [
|
|
148
148
|
w(e) && f(e) && !T(e) ? (o(), u("label", {
|
|
149
149
|
key: 0,
|
|
150
150
|
for: e.name,
|
|
151
|
-
class:
|
|
151
|
+
class: v([
|
|
152
152
|
"absolute transition-all duration-200 ease-in-out pointer-events-none z-20",
|
|
153
|
-
|
|
153
|
+
N(e) ? "-top-2.5 left-3 text-xs bg-background px-1 text-black shadow-[0_4px_4px_-4px_bg-background]" : `top-1/2 -translate-y-1/2 text-sm text-muted-foreground/70 ${G(e)}`
|
|
154
154
|
])
|
|
155
155
|
}, [
|
|
156
|
-
m(
|
|
156
|
+
m(h)(l(e)) ? (o(), p(D(L(l(e))), { key: 0 })) : (o(), u(b, { key: 1 }, [
|
|
157
157
|
A(x(l(e)) + " ", 1),
|
|
158
|
-
e.required ? (o(), u("span",
|
|
158
|
+
e.required ? (o(), u("span", le, "*")) : i("", !0)
|
|
159
159
|
], 64))
|
|
160
|
-
], 10,
|
|
161
|
-
Z(
|
|
160
|
+
], 10, ue)) : i("", !0),
|
|
161
|
+
Z(ne, {
|
|
162
162
|
field: r.variant === "floating" ? {
|
|
163
163
|
...e,
|
|
164
164
|
placeholder: void 0,
|
|
@@ -166,23 +166,23 @@ const se = {
|
|
|
166
166
|
props: { ...e.props || {}, id: e.name }
|
|
167
167
|
} : { ...e, props: { ...e.props || {}, id: e.name } },
|
|
168
168
|
value: F(e),
|
|
169
|
-
floatingActive:
|
|
169
|
+
floatingActive: N(e),
|
|
170
170
|
label: s(e) === "customFields" ? void 0 : w(e) ? f(e) : void 0,
|
|
171
171
|
values: n.values,
|
|
172
172
|
errors: n.errors,
|
|
173
173
|
variant: n.variant,
|
|
174
174
|
size: n.size,
|
|
175
175
|
rounded: n.rounded,
|
|
176
|
-
disabled:
|
|
177
|
-
readonly:
|
|
178
|
-
error:
|
|
176
|
+
disabled: R(e),
|
|
177
|
+
readonly: C(e),
|
|
178
|
+
error: g(e),
|
|
179
179
|
isUpdate: n.isUpdate,
|
|
180
180
|
loading: n.fieldLoading[e.name],
|
|
181
|
-
onChange: (
|
|
182
|
-
onAddonChange:
|
|
183
|
-
onAddonAction:
|
|
181
|
+
onChange: (d) => S(e, d),
|
|
182
|
+
onAddonChange: M,
|
|
183
|
+
onAddonAction: O
|
|
184
184
|
}, null, 8, ["field", "value", "floatingActive", "label", "values", "errors", "variant", "size", "rounded", "disabled", "readonly", "error", "isUpdate", "loading", "onChange"])
|
|
185
|
-
], 42,
|
|
185
|
+
], 42, oe),
|
|
186
186
|
s(e) === "check" || s(e) === "switch" && e.props?.switchVariant === "basic" ? (o(), p(B, {
|
|
187
187
|
key: 1,
|
|
188
188
|
for: e.name,
|
|
@@ -190,22 +190,22 @@ const se = {
|
|
|
190
190
|
}, {
|
|
191
191
|
default: U(() => [
|
|
192
192
|
A(x(l(e)) + " ", 1),
|
|
193
|
-
e.required ? (o(), u("span",
|
|
193
|
+
e.required ? (o(), u("span", ce, "*")) : i("", !0)
|
|
194
194
|
]),
|
|
195
195
|
_: 2
|
|
196
|
-
}, 1032, ["for"])) :
|
|
197
|
-
|
|
196
|
+
}, 1032, ["for"])) : i("", !0),
|
|
197
|
+
g(e) && !m(te)(s(e)) ? (o(), u("p", {
|
|
198
198
|
key: 2,
|
|
199
|
-
class:
|
|
199
|
+
class: v([
|
|
200
200
|
n.layout === "inline" ? "pt-2 capitalize bottom-0 left-0 mt-0 -text-fs-2.5 text-destructive whitespace-nowrap" : "mt-1 -text-fs-2.5 text-destructive"
|
|
201
201
|
])
|
|
202
|
-
}, x(
|
|
203
|
-
], 2)), a, 0) :
|
|
202
|
+
}, x(g(e)), 3)) : i("", !0)
|
|
203
|
+
], 2)), a, 0) : i("", !0)
|
|
204
204
|
], 64))), 128)),
|
|
205
205
|
_(t.$slots, "default", {}, void 0, !0)
|
|
206
206
|
], 2));
|
|
207
207
|
}
|
|
208
208
|
});
|
|
209
209
|
export {
|
|
210
|
-
|
|
210
|
+
ge as default
|
|
211
211
|
};
|
|
@@ -1,50 +1,65 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
const
|
|
1
|
+
import { defineComponent as _, computed as x, openBlock as s, createElementBlock as t, Fragment as i, renderList as p, isMemoSame as f, createElementVNode as l } from "vue";
|
|
2
|
+
const B = { class: "form-skeleton w-full animate-pulse" }, C = {
|
|
3
3
|
key: 0,
|
|
4
4
|
class: "space-y-6"
|
|
5
|
-
},
|
|
5
|
+
}, E = { class: "form-group-body p-4.5 space-y-6" }, F = {
|
|
6
6
|
key: 1,
|
|
7
7
|
class: "space-y-6"
|
|
8
|
-
},
|
|
8
|
+
}, N = /* @__PURE__ */ _({
|
|
9
9
|
__name: "FormSkeleton",
|
|
10
10
|
props: {
|
|
11
11
|
rows: { default: 4 },
|
|
12
12
|
isGrouped: { type: Boolean, default: !1 }
|
|
13
13
|
},
|
|
14
|
-
setup(
|
|
15
|
-
const
|
|
16
|
-
return (
|
|
17
|
-
|
|
18
|
-
(s(),
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
14
|
+
setup(v) {
|
|
15
|
+
const k = v, y = x(() => k.rows);
|
|
16
|
+
return (G, e) => (s(), t("div", B, [
|
|
17
|
+
v.isGrouped ? (s(), t("div", C, [
|
|
18
|
+
(s(), t(i, null, p(2, (n, g, w, o) => {
|
|
19
|
+
const r = [n];
|
|
20
|
+
if (o && o.key === n && f(o, r)) return o;
|
|
21
|
+
const d = (s(), t("div", {
|
|
22
|
+
key: n,
|
|
23
|
+
class: "form-group border rounded overflow-hidden bg-body"
|
|
24
|
+
}, [
|
|
25
|
+
e[8] || (e[8] = l("div", { class: "form-group-header bg-muted/50 px-4 py-3 border-b flex flex-col gap-2" }, [
|
|
26
|
+
l("div", { class: "h-5 bg-muted rounded w-1/3" }),
|
|
27
|
+
l("div", { class: "h-3 bg-muted rounded w-1/2" })
|
|
28
|
+
], -1)),
|
|
29
|
+
l("div", E, [
|
|
30
|
+
(s(), t(i, null, p(2, (m, S, L, u) => {
|
|
31
|
+
const a = [m];
|
|
32
|
+
if (u && u.key === m && f(u, a)) return u;
|
|
33
|
+
const b = (s(), t("div", {
|
|
34
|
+
key: m,
|
|
35
|
+
class: "space-y-2"
|
|
36
|
+
}, [
|
|
37
|
+
e[6] || (e[6] = l("div", { class: "h-4 bg-muted rounded w-1/4" }, null, -1)),
|
|
38
|
+
e[7] || (e[7] = l("div", { class: "h-10 bg-muted rounded w-full" }, null, -1))
|
|
39
|
+
]));
|
|
40
|
+
return b.memo = a, b;
|
|
41
|
+
}, e, 0), 64))
|
|
42
|
+
])
|
|
43
|
+
]));
|
|
44
|
+
return d.memo = r, d;
|
|
45
|
+
}, e, 2), 64))
|
|
46
|
+
])) : (s(), t("div", F, [
|
|
47
|
+
(s(!0), t(i, null, p(y.value, (n, g, w, o) => {
|
|
48
|
+
const r = [n, y.value];
|
|
49
|
+
if (o && o.key === n && f(o, r)) return o;
|
|
50
|
+
const d = (s(), t("div", {
|
|
51
|
+
key: n,
|
|
52
|
+
class: "space-y-2"
|
|
53
|
+
}, [
|
|
54
|
+
e[9] || (e[9] = l("div", { class: "h-4 bg-muted rounded w-1/4" }, null, -1)),
|
|
55
|
+
e[10] || (e[10] = l("div", { class: "h-10 bg-muted rounded w-full" }, null, -1))
|
|
56
|
+
]));
|
|
57
|
+
return d.memo = r, d;
|
|
58
|
+
}, e, 4), 128))
|
|
44
59
|
]))
|
|
45
60
|
]));
|
|
46
61
|
}
|
|
47
62
|
});
|
|
48
63
|
export {
|
|
49
|
-
|
|
64
|
+
N as default
|
|
50
65
|
};
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { VueDraggable as
|
|
3
|
-
import
|
|
4
|
-
const
|
|
1
|
+
import { defineComponent as y, computed as f, openBlock as o, createElementBlock as t, normalizeStyle as v, createCommentVNode as n, Fragment as u, renderList as b, normalizeClass as R, toDisplayString as s, createVNode as x, unref as k, withCtx as B, isMemoSame as F, createBlock as N, createElementVNode as g } from "vue";
|
|
2
|
+
import { VueDraggable as C } from "vue-draggable-plus";
|
|
3
|
+
import S from "./TableRow.vue.js";
|
|
4
|
+
const U = { class: "custom-fields-table border border-border rounded overflow-hidden bg-background min-w-0 max-w-full w-full" }, V = {
|
|
5
5
|
key: 0,
|
|
6
6
|
class: "w-10 flex-none p-3 border-r border-border"
|
|
7
|
-
},
|
|
7
|
+
}, D = {
|
|
8
8
|
key: 1,
|
|
9
9
|
class: "w-10 flex-none p-3 text-center border-r border-border"
|
|
10
|
-
},
|
|
10
|
+
}, T = {
|
|
11
11
|
key: 2,
|
|
12
12
|
class: "p-3 border-l border-border"
|
|
13
|
-
},
|
|
13
|
+
}, H = {
|
|
14
14
|
key: 1,
|
|
15
15
|
class: "flex flex-col items-center justify-center py-6 text-center bg-muted/5"
|
|
16
|
-
},
|
|
16
|
+
}, E = { class: "text-sm font-medium text-foreground" }, j = { class: "text-xs text-muted-foreground mt-1" }, M = /* @__PURE__ */ y({
|
|
17
17
|
__name: "TableView",
|
|
18
18
|
props: {
|
|
19
19
|
rows: {},
|
|
@@ -35,25 +35,25 @@ const B = { class: "custom-fields-table border border-border rounded overflow-hi
|
|
|
35
35
|
onDragUpdate: { type: Function }
|
|
36
36
|
},
|
|
37
37
|
setup(e) {
|
|
38
|
-
const
|
|
39
|
-
const
|
|
40
|
-
return
|
|
38
|
+
const d = e, w = f(() => {
|
|
39
|
+
const a = [];
|
|
40
|
+
return d.draggable && !d.disabled && !d.readonly && a.push("2.5rem"), d.showRowNumbers && a.push("2.5rem"), a.push(...d.visibleSchemaFields.map(() => "minmax(0, 1fr)")), d.canRemoveRow && a.push("2.5rem"), a.join(" ");
|
|
41
41
|
});
|
|
42
|
-
return (
|
|
43
|
-
e.columnHeaders.length > 1 ? (o(),
|
|
42
|
+
return (a, h) => (o(), t("div", U, [
|
|
43
|
+
e.columnHeaders.length > 1 ? (o(), t("div", {
|
|
44
44
|
key: 0,
|
|
45
45
|
class: "grid border-b border-border bg-muted/50 text-gray-800 text-xs font-semibold uppercase tracking-wider min-w-0",
|
|
46
|
-
style:
|
|
46
|
+
style: v({ gridTemplateColumns: w.value })
|
|
47
47
|
}, [
|
|
48
|
-
e.draggable && !e.disabled && !e.readonly ? (o(),
|
|
49
|
-
e.showRowNumbers ? (o(),
|
|
50
|
-
(o(!0),
|
|
48
|
+
e.draggable && !e.disabled && !e.readonly ? (o(), t("div", V)) : n("", !0),
|
|
49
|
+
e.showRowNumbers ? (o(), t("div", D, " # ")) : n("", !0),
|
|
50
|
+
(o(!0), t(u, null, b(e.columnHeaders, (r, l) => (o(), t("div", {
|
|
51
51
|
key: l,
|
|
52
|
-
class:
|
|
53
|
-
},
|
|
54
|
-
e.canRemoveRow ? (o(),
|
|
55
|
-
], 4)) :
|
|
56
|
-
|
|
52
|
+
class: R(["p-3 min-w-0 truncate", { "border-l border-border": l > 0 }])
|
|
53
|
+
}, s(r), 3))), 128)),
|
|
54
|
+
e.canRemoveRow ? (o(), t("div", T)) : n("", !0)
|
|
55
|
+
], 4)) : n("", !0),
|
|
56
|
+
x(k(C), {
|
|
57
57
|
"model-value": e.rows,
|
|
58
58
|
"onUpdate:modelValue": e.onDragUpdate,
|
|
59
59
|
disabled: !e.draggable || e.disabled || e.readonly,
|
|
@@ -62,32 +62,48 @@ const B = { class: "custom-fields-table border border-border rounded overflow-hi
|
|
|
62
62
|
"ghost-class": "opacity-50",
|
|
63
63
|
class: "divide-y divide-border min-w-0"
|
|
64
64
|
}, {
|
|
65
|
-
default:
|
|
66
|
-
(o(!0),
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
65
|
+
default: B(() => [
|
|
66
|
+
(o(!0), t(u, null, b(e.rows, (r, l, z, i) => {
|
|
67
|
+
const m = [
|
|
68
|
+
r,
|
|
69
|
+
l,
|
|
70
|
+
e.visibleSchemaFields,
|
|
71
|
+
e.disabled,
|
|
72
|
+
e.readonly,
|
|
73
|
+
e.isUpdate,
|
|
74
|
+
e.showRowNumbers,
|
|
75
|
+
e.canRemoveRow,
|
|
76
|
+
e.draggable,
|
|
77
|
+
e.helpers.getRowErrorsHash(l)
|
|
78
|
+
];
|
|
79
|
+
if (i && i.key === r._id && F(i, m)) return i;
|
|
80
|
+
const c = (o(), N(S, {
|
|
81
|
+
key: r._id,
|
|
82
|
+
row: r,
|
|
83
|
+
"row-index": l,
|
|
84
|
+
fields: e.visibleSchemaFields,
|
|
85
|
+
draggable: e.draggable,
|
|
86
|
+
disabled: e.disabled,
|
|
87
|
+
readonly: e.readonly,
|
|
88
|
+
"is-update": e.isUpdate,
|
|
89
|
+
"show-row-numbers": e.showRowNumbers,
|
|
90
|
+
"can-remove-row": e.canRemoveRow,
|
|
91
|
+
helpers: e.helpers,
|
|
92
|
+
"on-field-change": e.onFieldChange,
|
|
93
|
+
"on-remove-row": e.onRemoveRow
|
|
94
|
+
}, null, 8, ["row", "row-index", "fields", "draggable", "disabled", "readonly", "is-update", "show-row-numbers", "can-remove-row", "helpers", "on-field-change", "on-remove-row"]));
|
|
95
|
+
return c.memo = m, c;
|
|
96
|
+
}, h, 0), 128))
|
|
81
97
|
]),
|
|
82
98
|
_: 1
|
|
83
99
|
}, 8, ["model-value", "onUpdate:modelValue", "disabled"]),
|
|
84
|
-
e.rows.length === 0 ? (o(),
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
])) :
|
|
100
|
+
e.rows.length === 0 ? (o(), t("div", H, [
|
|
101
|
+
g("p", E, s(e.emptyTitle), 1),
|
|
102
|
+
g("p", j, s(e.emptyDescription), 1)
|
|
103
|
+
])) : n("", !0)
|
|
88
104
|
]));
|
|
89
105
|
}
|
|
90
106
|
});
|
|
91
107
|
export {
|
|
92
|
-
|
|
108
|
+
M as default
|
|
93
109
|
};
|