vlite3 1.4.32 → 1.4.34
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 +7 -0
- package/components/Alert.vue.js +45 -40
- package/components/Barcode/Barcode.vue.js +34 -21
- package/components/CategoryManager/CategoryNode.vue.js +30 -30
- package/components/CategoryMenu/CategoryMenu.vue.js +9 -11
- package/components/Chart/GanttChart.vue.d.ts +5 -1
- package/components/Chart/GanttChart.vue.js +2 -2
- package/components/Chart/GanttChart.vue2.js +977 -812
- package/components/Chart/GanttChartConnectorRouting.d.ts +83 -0
- package/components/Chart/GanttChartConnectorRouting.js +405 -0
- package/components/Chart/GanttChartDependencyUtils.js +43 -47
- package/components/Chart/types.d.ts +16 -1
- package/components/ColorPicker/ColorIro.vue2.js +78 -64
- package/components/ColorPicker/ColorPicker.vue.d.ts +5 -0
- package/components/ColorPicker/ColorPicker.vue.js +110 -64
- package/components/ColorPicker/constants.d.ts +2 -0
- package/components/ColorPicker/constants.js +4 -0
- package/components/ColorPicker/index.d.ts +1 -0
- package/components/Dropdown/Dropdown.vue.js +100 -97
- package/components/ExportData/ExportData.vue.js +85 -63
- package/components/FilePreview/FilePreview.vue.js +31 -13
- package/components/Form/FormField.vue.js +9 -8
- package/components/ImportData/ImportStep1.vue.js +80 -75
- package/components/Kanban/Kanban.vue.d.ts +16 -2
- package/components/Kanban/Kanban.vue.js +2 -2
- package/components/Kanban/Kanban.vue2.js +150 -86
- package/components/Kanban/types.d.ts +37 -0
- package/components/QRCode/QRCode.vue.js +31 -26
- package/components/ToastNotification.vue.js +1 -1
- package/components/ToastNotification.vue2.js +3 -3
- package/components/index.d.ts +1 -1
- package/composables/useKeyStroke.d.ts +18 -0
- package/composables/useKeyStroke.js +103 -77
- package/composables/useTheme.js +1 -1
- package/directives/vScrollReveal.js +23 -18
- package/index.d.ts +1 -0
- package/index.js +235 -233
- package/package.json +11 -4
- package/style.css +1 -1
- package/utils/UtilsModuleInterop.d.ts +6 -0
- package/utils/UtilsModuleInterop.js +9 -0
- package/utils/environment.d.ts +29 -0
- package/utils/environment.js +4 -0
- package/utils/functions.js +14 -13
|
@@ -69,7 +69,7 @@ const Be = /* @__PURE__ */ q({
|
|
|
69
69
|
richTextEditor: t(se)
|
|
70
70
|
}, P = t(s), e = d, h = j, o = (a, l) => {
|
|
71
71
|
h("change", { value: a, data: l });
|
|
72
|
-
},
|
|
72
|
+
}, R = (a) => {
|
|
73
73
|
h("change", { value: a });
|
|
74
74
|
}, u = c(() => K(e.field, {
|
|
75
75
|
values: e.values,
|
|
@@ -92,7 +92,7 @@ const Be = /* @__PURE__ */ q({
|
|
|
92
92
|
}, y = X(
|
|
93
93
|
e.field.placeholderI18n,
|
|
94
94
|
e.field.placeholder
|
|
95
|
-
),
|
|
95
|
+
), k = e.variant === "floating" && e.label && !e.floatingActive, f = k ? "" : y;
|
|
96
96
|
if (a === "text" || a === "email" || a === "password" || a === "tel" || a === "url" || a === "search" || a === "textarea" || !a)
|
|
97
97
|
return {
|
|
98
98
|
...i,
|
|
@@ -185,7 +185,7 @@ const Be = /* @__PURE__ */ q({
|
|
|
185
185
|
triggerProps: {
|
|
186
186
|
variant: e.variant === "floating" ? "outline-floating" : e.variant || "outline",
|
|
187
187
|
size: e.size,
|
|
188
|
-
...
|
|
188
|
+
...k ? { text: "" } : {}
|
|
189
189
|
}
|
|
190
190
|
};
|
|
191
191
|
if (a === "multiSelect")
|
|
@@ -233,7 +233,7 @@ const Be = /* @__PURE__ */ q({
|
|
|
233
233
|
variant: e.variant === "floating" ? "outline-floating" : e.variant || "outline",
|
|
234
234
|
size: e.size,
|
|
235
235
|
class: "px-3!",
|
|
236
|
-
...
|
|
236
|
+
...k ? { text: "" } : {}
|
|
237
237
|
}
|
|
238
238
|
};
|
|
239
239
|
if (a === "dateRangePicker")
|
|
@@ -298,7 +298,8 @@ const Be = /* @__PURE__ */ q({
|
|
|
298
298
|
modelValue: e.value || "#000000",
|
|
299
299
|
variant: e.variant,
|
|
300
300
|
size: e.size,
|
|
301
|
-
rounded: e.rounded
|
|
301
|
+
rounded: e.rounded,
|
|
302
|
+
allowReset: e.field.props?.allowReset ?? !1
|
|
302
303
|
};
|
|
303
304
|
if (a === "iconPicker")
|
|
304
305
|
return {
|
|
@@ -342,14 +343,14 @@ const Be = /* @__PURE__ */ q({
|
|
|
342
343
|
}), N = c(() => {
|
|
343
344
|
const a = u.value;
|
|
344
345
|
return a === "text" || a === "email" || a === "password" || a === "tel" || a === "url" || a === "search" || a === "textarea" || a === "switch" || a === "check" || !a ? {
|
|
345
|
-
"update:modelValue":
|
|
346
|
+
"update:modelValue": R
|
|
346
347
|
} : a === "number" && x.value ? {
|
|
347
348
|
"update:modelValue": (l) => {
|
|
348
349
|
const n = l === "" ? void 0 : Number(l);
|
|
349
350
|
h("change", { value: isNaN(n) ? void 0 : n });
|
|
350
351
|
}
|
|
351
352
|
} : a === "number" ? {
|
|
352
|
-
"update:modelValue":
|
|
353
|
+
"update:modelValue": R
|
|
353
354
|
} : a === "select" ? {
|
|
354
355
|
onSelect: (l) => {
|
|
355
356
|
o(l.value, l.data);
|
|
@@ -381,7 +382,7 @@ const Be = /* @__PURE__ */ q({
|
|
|
381
382
|
o(l);
|
|
382
383
|
}
|
|
383
384
|
} : a === "tags" ? {
|
|
384
|
-
"update:modelValue":
|
|
385
|
+
"update:modelValue": R,
|
|
385
386
|
change: (l) => o(l)
|
|
386
387
|
} : a === "richTextEditor" ? {
|
|
387
388
|
"update:modelValue": (l) => o(l)
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import q from "../Textarea.vue.js";
|
|
1
|
+
import { defineComponent as J, ref as y, computed as d, openBlock as V, createElementBlock as F, createElementVNode as o, toDisplayString as n, withModifiers as E, normalizeClass as M, createVNode as v, createCommentVNode as K, withCtx as L, createTextVNode as W } from "vue";
|
|
2
|
+
import S from "../Icon.vue.js";
|
|
3
|
+
import q from "../Button.vue.js";
|
|
4
|
+
import G from "../Textarea.vue.js";
|
|
6
5
|
import { showToast as h } from "../../composables/useNotifications.js";
|
|
7
6
|
import { $t as k } from "../../utils/i18n.js";
|
|
8
7
|
import { camelCase as g } from "../../utils/functions.js";
|
|
9
|
-
|
|
8
|
+
import { resolveModuleRuntime as Q } from "../../utils/UtilsModuleInterop.js";
|
|
9
|
+
const X = { class: "space-y-2" }, Y = { class: "font-medium text-md" }, Z = { class: "space-y-6" }, ee = { class: "flex flex-col items-center justify-center pointer-events-none" }, te = { class: "w-12 h-12 rounded-full bg-primary/10 flex items-center justify-center mb-4 text-primary" }, re = { class: "font-medium text-foreground mb-1" }, ae = { class: "text-sm text-muted-foreground" }, oe = {
|
|
10
10
|
key: 0,
|
|
11
11
|
class: "mt-4 text-sm font-semibold text-primary bg-background px-3 py-1 rounded-md border border-border shadow-sm inline-block"
|
|
12
|
-
},
|
|
12
|
+
}, se = { class: "flex items-center gap-3 mb-4" }, ie = { class: "w-8 h-8 rounded-lg bg-secondary flex items-center justify-center text-secondary-foreground" }, ne = { class: "font-medium text-foreground leading-none" }, le = { class: "flex justify-end mt-3" }, ge = /* @__PURE__ */ J({
|
|
13
13
|
__name: "ImportStep1",
|
|
14
14
|
props: {
|
|
15
15
|
importMethod: {},
|
|
@@ -29,133 +29,138 @@ const G = { class: "space-y-2" }, Q = { class: "font-medium text-md" }, X = { cl
|
|
|
29
29
|
"next"
|
|
30
30
|
],
|
|
31
31
|
setup(l, { emit: P }) {
|
|
32
|
-
const
|
|
33
|
-
const
|
|
34
|
-
return
|
|
35
|
-
}, D =
|
|
36
|
-
if (
|
|
37
|
-
const e =
|
|
38
|
-
e.type === "text/csv" || e.name.endsWith(".csv") ?
|
|
32
|
+
const b = l, i = P, s = (r, e, a) => {
|
|
33
|
+
const t = a ? k(r, a) : k(r);
|
|
34
|
+
return t !== r ? t : e;
|
|
35
|
+
}, D = y(null), m = y(!1), c = y(""), T = (r) => {
|
|
36
|
+
if (r.preventDefault(), m.value = !1, r.dataTransfer?.files && r.dataTransfer.files.length > 0) {
|
|
37
|
+
const e = r.dataTransfer.files[0];
|
|
38
|
+
e.type === "text/csv" || e.name.endsWith(".csv") ? w(e) : h(s("vlite.importData.csvOnly", "Please upload a CSV file"), "error");
|
|
39
39
|
}
|
|
40
|
-
},
|
|
41
|
-
i("update:csvFile",
|
|
40
|
+
}, w = (r) => {
|
|
41
|
+
i("update:csvFile", r), i("update:importMethod", "file");
|
|
42
42
|
const e = new FileReader();
|
|
43
43
|
e.onload = (a) => {
|
|
44
|
-
a.target?.result &&
|
|
45
|
-
}, e.readAsText(
|
|
46
|
-
},
|
|
47
|
-
i("update:importMethod", "paste"), c.value &&
|
|
48
|
-
},
|
|
49
|
-
const e = g(
|
|
50
|
-
return
|
|
51
|
-
a[g(
|
|
52
|
-
a[g(u)] =
|
|
44
|
+
a.target?.result && _(a.target.result);
|
|
45
|
+
}, e.readAsText(r);
|
|
46
|
+
}, j = () => {
|
|
47
|
+
i("update:importMethod", "paste"), c.value && _(c.value);
|
|
48
|
+
}, O = (r) => {
|
|
49
|
+
const e = g(r), a = {};
|
|
50
|
+
return b.fields.forEach((t) => {
|
|
51
|
+
a[g(t.field)] = t.field, a[g(t.title)] = t.field, t.matchings?.forEach((u) => {
|
|
52
|
+
a[g(u)] = t.field;
|
|
53
53
|
});
|
|
54
54
|
}), a[e] || "";
|
|
55
|
-
},
|
|
55
|
+
}, _ = async (r) => {
|
|
56
56
|
try {
|
|
57
|
-
|
|
57
|
+
const e = await import("papaparse"), a = Q(
|
|
58
|
+
e,
|
|
59
|
+
(t) => !!(t && typeof t == "object" && "parse" in t && typeof t.parse == "function")
|
|
60
|
+
);
|
|
61
|
+
if (!a) throw new Error("The CSV import runtime is unavailable.");
|
|
62
|
+
a.parse(r, {
|
|
58
63
|
header: !0,
|
|
59
64
|
skipEmptyLines: !0,
|
|
60
|
-
complete: (
|
|
61
|
-
if (!
|
|
65
|
+
complete: (t) => {
|
|
66
|
+
if (!t.data || t.data.length === 0) {
|
|
62
67
|
h(s("vlite.importData.emptyCsv", "The CSV file is empty."), "warning");
|
|
63
68
|
return;
|
|
64
69
|
}
|
|
65
|
-
const
|
|
66
|
-
i("update:headers",
|
|
67
|
-
const
|
|
70
|
+
const u = Object.keys(t.data[0]);
|
|
71
|
+
i("update:headers", u);
|
|
72
|
+
const A = t.data.map((p) => {
|
|
68
73
|
const f = {};
|
|
69
74
|
return Object.keys(p).forEach((x) => {
|
|
70
|
-
f[x] = p[x] ||
|
|
75
|
+
f[x] = p[x] || b.fields.find((R) => R.field === x)?.defaultValue;
|
|
71
76
|
}), f;
|
|
72
77
|
});
|
|
73
|
-
i("update:importData",
|
|
74
|
-
const
|
|
75
|
-
|
|
76
|
-
const f =
|
|
77
|
-
|
|
78
|
-
}), i("update:mappings",
|
|
78
|
+
i("update:importData", A), i("update:preview", t.data.slice(0, 3));
|
|
79
|
+
const C = {};
|
|
80
|
+
u.forEach((p) => {
|
|
81
|
+
const f = O(p);
|
|
82
|
+
C[p] = f || "";
|
|
83
|
+
}), i("update:mappings", C), i("next");
|
|
79
84
|
},
|
|
80
|
-
error: (
|
|
81
|
-
s("vlite.importData.parseError", "Failed to parse CSV: ") +
|
|
85
|
+
error: (t) => h(
|
|
86
|
+
s("vlite.importData.parseError", "Failed to parse CSV: ") + t.message,
|
|
82
87
|
"error"
|
|
83
88
|
)
|
|
84
89
|
});
|
|
85
90
|
} catch (e) {
|
|
86
91
|
h(s("vlite.importData.processError", "Error processing CSV data"), "error"), console.error(e);
|
|
87
92
|
}
|
|
88
|
-
},
|
|
89
|
-
const e =
|
|
90
|
-
e.files && e.files.length > 0 &&
|
|
91
|
-
},
|
|
93
|
+
}, $ = (r) => {
|
|
94
|
+
const e = r.target;
|
|
95
|
+
e.files && e.files.length > 0 && w(e.files[0]);
|
|
96
|
+
}, I = d(() => s("vlite.importData.uploadData", "Upload Data")), z = d(() => s("vlite.importData.dragDrop", "Drag & drop a file here or click to browse")), B = d(() => s("vlite.importData.csvOnlyHint", "Only CSV files are supported")), H = d(() => s("vlite.importData.pasteData", "Or paste CSV/Excel data")), N = d(() => s("vlite.importData.process", "Process Data")), U = d(() => s("vlite.importData.pastePlaceholder", `id, name, email
|
|
92
97
|
1, John Doe, john@example.com`));
|
|
93
|
-
return (
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
class:
|
|
98
|
+
return (r, e) => (V(), F("div", X, [
|
|
99
|
+
o("h5", Y, n(I.value), 1),
|
|
100
|
+
o("div", Z, [
|
|
101
|
+
o("div", {
|
|
102
|
+
class: M([
|
|
98
103
|
"relative border-2 border-dashed rounded-xl p-8 text-center cursor-pointer transition-colors",
|
|
99
104
|
l.importMethod === "file" ? "border-primary bg-primary/5" : "border-border hover:border-primary/50",
|
|
100
105
|
m.value ? "border-primary bg-primary/10 scale-[1.01]" : ""
|
|
101
106
|
]),
|
|
102
107
|
onClick: e[0] || (e[0] = (a) => D.value?.click()),
|
|
103
|
-
onDragover: e[1] || (e[1] =
|
|
104
|
-
onDragleave: e[2] || (e[2] =
|
|
105
|
-
onDrop:
|
|
108
|
+
onDragover: e[1] || (e[1] = E((a) => m.value = !0, ["prevent"])),
|
|
109
|
+
onDragleave: e[2] || (e[2] = E((a) => m.value = !1, ["prevent"])),
|
|
110
|
+
onDrop: T
|
|
106
111
|
}, [
|
|
107
|
-
|
|
112
|
+
o("input", {
|
|
108
113
|
type: "file",
|
|
109
114
|
ref_key: "fileInput",
|
|
110
115
|
ref: D,
|
|
111
116
|
class: "hidden",
|
|
112
117
|
accept: ".csv",
|
|
113
|
-
onChange:
|
|
118
|
+
onChange: $
|
|
114
119
|
}, null, 544),
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
v(
|
|
120
|
+
o("div", ee, [
|
|
121
|
+
o("div", te, [
|
|
122
|
+
v(S, {
|
|
118
123
|
icon: "lucide:upload-cloud",
|
|
119
124
|
class: "w-6 h-6"
|
|
120
125
|
})
|
|
121
126
|
]),
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
l.csvFile ? (
|
|
127
|
+
o("p", re, n(z.value), 1),
|
|
128
|
+
o("p", ae, n(B.value), 1),
|
|
129
|
+
l.csvFile ? (V(), F("p", oe, n(l.csvFile.name) + " (" + n((l.csvFile.size / 1024).toFixed(2)) + " KB) ", 1)) : K("", !0)
|
|
125
130
|
])
|
|
126
131
|
], 34),
|
|
127
|
-
|
|
128
|
-
class:
|
|
132
|
+
o("div", {
|
|
133
|
+
class: M([
|
|
129
134
|
"border rounded-xl p-6 transition-colors",
|
|
130
135
|
l.importMethod === "paste" ? "border-primary shadow-sm ring-1 ring-primary/20" : "border-border"
|
|
131
136
|
])
|
|
132
137
|
}, [
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
v(
|
|
138
|
+
o("div", se, [
|
|
139
|
+
o("div", ie, [
|
|
140
|
+
v(S, {
|
|
136
141
|
icon: "lucide:clipboard-paste",
|
|
137
142
|
class: "w-4 h-4"
|
|
138
143
|
})
|
|
139
144
|
]),
|
|
140
|
-
|
|
141
|
-
|
|
145
|
+
o("div", null, [
|
|
146
|
+
o("p", ne, n(H.value), 1)
|
|
142
147
|
])
|
|
143
148
|
]),
|
|
144
|
-
v(
|
|
149
|
+
v(G, {
|
|
145
150
|
modelValue: c.value,
|
|
146
151
|
"onUpdate:modelValue": e[3] || (e[3] = (a) => c.value = a),
|
|
147
152
|
class: "w-full h-32",
|
|
148
153
|
placeholder: U.value
|
|
149
154
|
}, null, 8, ["modelValue", "placeholder"]),
|
|
150
|
-
|
|
151
|
-
v(
|
|
155
|
+
o("div", le, [
|
|
156
|
+
v(q, {
|
|
152
157
|
variant: "secondary",
|
|
153
158
|
size: "sm",
|
|
154
|
-
onClick:
|
|
159
|
+
onClick: j,
|
|
155
160
|
disabled: !c.value
|
|
156
161
|
}, {
|
|
157
|
-
default:
|
|
158
|
-
|
|
162
|
+
default: L(() => [
|
|
163
|
+
W(n(N.value), 1)
|
|
159
164
|
]),
|
|
160
165
|
_: 1
|
|
161
166
|
}, 8, ["disabled"])
|
|
@@ -166,5 +171,5 @@ const G = { class: "space-y-2" }, Q = { class: "font-medium text-md" }, X = { cl
|
|
|
166
171
|
}
|
|
167
172
|
});
|
|
168
173
|
export {
|
|
169
|
-
|
|
174
|
+
ge as default
|
|
170
175
|
};
|
|
@@ -32,12 +32,26 @@ declare const __VLS_component: import('vue').DefineComponent<KanbanProps, {}, {}
|
|
|
32
32
|
change: (payload: KanbanChangeEvent) => any;
|
|
33
33
|
move: (payload: KanbanMoveEvent) => any;
|
|
34
34
|
"update:data": (val: Record<string | number, any[]>) => any;
|
|
35
|
-
"item-
|
|
35
|
+
"item-move-failed": (payload: {
|
|
36
|
+
itemId: string | number;
|
|
37
|
+
toColumnId: string | number;
|
|
38
|
+
fromColumnId: string | number;
|
|
39
|
+
newPosition: number;
|
|
40
|
+
item: any;
|
|
41
|
+
error: unknown;
|
|
42
|
+
}) => any;
|
|
36
43
|
}, string, import('vue').PublicProps, Readonly<KanbanProps> & Readonly<{
|
|
37
44
|
onChange?: (payload: KanbanChangeEvent) => any;
|
|
38
45
|
onMove?: (payload: KanbanMoveEvent) => any;
|
|
39
46
|
"onUpdate:data"?: (val: Record<string | number, any[]>) => any;
|
|
40
|
-
"onItem-
|
|
47
|
+
"onItem-move-failed"?: (payload: {
|
|
48
|
+
itemId: string | number;
|
|
49
|
+
toColumnId: string | number;
|
|
50
|
+
fromColumnId: string | number;
|
|
51
|
+
newPosition: number;
|
|
52
|
+
item: any;
|
|
53
|
+
error: unknown;
|
|
54
|
+
}) => any;
|
|
41
55
|
}>, {
|
|
42
56
|
class: string;
|
|
43
57
|
group: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./Kanban.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-2dd0633e"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
p as default
|
|
7
7
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as G, ref as K, watch as U, openBlock as C, createElementBlock as P, normalizeClass as j, Fragment as q, renderList as w, createBlock as z, withCtx as v, renderSlot as g, mergeProps as h } from "vue";
|
|
2
|
+
import F from "./KanbanBoard.vue.js";
|
|
3
|
+
const T = /* @__PURE__ */ G({
|
|
4
4
|
__name: "Kanban",
|
|
5
5
|
props: {
|
|
6
6
|
columns: {},
|
|
@@ -17,109 +17,173 @@ const U = /* @__PURE__ */ D({
|
|
|
17
17
|
draggableClass: {},
|
|
18
18
|
ghostClass: {},
|
|
19
19
|
class: { default: "h-full w-full" },
|
|
20
|
-
isItemDisabled: {}
|
|
20
|
+
isItemDisabled: {},
|
|
21
|
+
onItemMoved: {}
|
|
21
22
|
},
|
|
22
|
-
emits: ["change", "move", "update:data", "item-
|
|
23
|
-
setup(
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
[() =>
|
|
27
|
-
([e,
|
|
28
|
-
if (
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
23
|
+
emits: ["change", "move", "update:data", "item-move-failed"],
|
|
24
|
+
setup(l, { emit: B }) {
|
|
25
|
+
const s = l, c = B, u = K({}), d = K({}), p = K(!1);
|
|
26
|
+
U(
|
|
27
|
+
[() => s.data, () => s.rawData],
|
|
28
|
+
([e, a]) => {
|
|
29
|
+
if (!p.value)
|
|
30
|
+
if (a && Array.isArray(a)) {
|
|
31
|
+
const o = {};
|
|
32
|
+
s.columns.forEach((t) => o[t.id] = []), a.forEach((t) => {
|
|
33
|
+
const i = t[s.groupKey];
|
|
34
|
+
o[i] ? o[i].push({ ...t }) : o[i] = [{ ...t }];
|
|
35
|
+
}), Object.keys(o).forEach((t) => {
|
|
36
|
+
o[t].sort((i, r) => (i[s.positionKey] || 0) - (r[s.positionKey] || 0));
|
|
37
|
+
}), d.value = o;
|
|
38
|
+
} else e && (d.value = { ...e });
|
|
37
39
|
},
|
|
38
40
|
{ immediate: !0, deep: !0 }
|
|
39
41
|
);
|
|
40
|
-
const
|
|
41
|
-
let
|
|
42
|
-
return
|
|
43
|
-
},
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
42
|
+
const A = (e, a) => {
|
|
43
|
+
let o = 0, t = 0;
|
|
44
|
+
return a > 0 && (o = Number(e[a - 1]?.[s.positionKey]) || 0), a < e.length - 1 && (t = Number(e[a + 1]?.[s.positionKey]) || 0), o === 0 && t === 0 ? 1024 : o === 0 ? t / 2 : t === 0 ? o + 1024 : (o + t) / 2;
|
|
45
|
+
}, E = (e) => {
|
|
46
|
+
p.value = !0;
|
|
47
|
+
try {
|
|
48
|
+
const a = s.itemKey, o = { ...d.value }, t = [...o[e.toColumnId] || []];
|
|
49
|
+
let i = t.find((n) => n?.[a] === e.itemId) || e.item;
|
|
50
|
+
const r = t.findIndex((n) => n?.[a] === e.itemId);
|
|
51
|
+
if (r >= 0)
|
|
52
|
+
i = t.splice(r, 1)[0];
|
|
53
|
+
else if (e.fromColumnId === e.toColumnId) {
|
|
54
|
+
const n = t.findIndex((m) => m?.[a] === e.itemId);
|
|
55
|
+
n >= 0 && (i = t.splice(n, 1)[0]);
|
|
56
|
+
}
|
|
57
|
+
if (!i) return;
|
|
58
|
+
if (i[s.positionKey] = e.previousPosition, i[s.groupKey] = e.previousGroupValue, e.fromColumnId === e.toColumnId) {
|
|
59
|
+
const n = Math.min(Math.max(e.oldIndex, 0), t.length);
|
|
60
|
+
t.splice(n, 0, i), o[e.toColumnId] = t;
|
|
61
|
+
} else {
|
|
62
|
+
o[e.toColumnId] = t;
|
|
63
|
+
const n = [...o[e.fromColumnId] || []], m = n.findIndex((f) => f?.[a] === e.itemId);
|
|
64
|
+
m >= 0 && n.splice(m, 1);
|
|
65
|
+
const I = Math.min(Math.max(e.oldIndex, 0), n.length);
|
|
66
|
+
n.splice(I, 0, i), o[e.fromColumnId] = n;
|
|
67
|
+
}
|
|
68
|
+
d.value = o, s.data && c("update:data", { ...o });
|
|
69
|
+
} finally {
|
|
70
|
+
queueMicrotask(() => {
|
|
71
|
+
p.value = !1;
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
}, k = async (e, a, o, t) => {
|
|
75
|
+
const i = d.value[e];
|
|
76
|
+
if (!i) return;
|
|
77
|
+
const r = i[a];
|
|
78
|
+
if (!r) return;
|
|
79
|
+
const n = r[s.itemKey], m = r[s.positionKey], I = r[s.groupKey], f = A(i, a);
|
|
80
|
+
r[s.positionKey] = f, r[s.groupKey] = e;
|
|
81
|
+
const y = () => E({
|
|
82
|
+
itemId: n,
|
|
83
|
+
item: r,
|
|
84
|
+
fromColumnId: o,
|
|
85
|
+
toColumnId: e,
|
|
86
|
+
oldIndex: t,
|
|
87
|
+
previousPosition: m,
|
|
88
|
+
previousGroupValue: I
|
|
89
|
+
}), V = {
|
|
90
|
+
fromColumnId: o,
|
|
91
|
+
oldIndex: t,
|
|
92
|
+
newIndex: a,
|
|
93
|
+
previousPosition: m,
|
|
94
|
+
revert: y
|
|
95
|
+
};
|
|
96
|
+
c("move", {
|
|
97
|
+
itemId: n,
|
|
98
|
+
item: r,
|
|
99
|
+
fromColumnId: o,
|
|
100
|
+
toColumnId: e,
|
|
101
|
+
oldIndex: t,
|
|
102
|
+
newIndex: a
|
|
103
|
+
});
|
|
104
|
+
const D = s.onItemMoved;
|
|
105
|
+
if (D)
|
|
106
|
+
try {
|
|
107
|
+
await D(n, e, f, r, V) === !1 && y();
|
|
108
|
+
} catch (M) {
|
|
109
|
+
y(), c("item-move-failed", {
|
|
110
|
+
itemId: n,
|
|
111
|
+
toColumnId: e,
|
|
112
|
+
fromColumnId: o,
|
|
113
|
+
newPosition: f,
|
|
114
|
+
item: r,
|
|
115
|
+
error: M
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
}, b = (e) => s.columns.find((a) => a.id === e)?.disabled === !0, $ = (e) => {
|
|
119
|
+
if (c("change", e), e.type === "remove")
|
|
120
|
+
u.value.remove = { columnId: e.columnId, event: e.event };
|
|
53
121
|
else if (e.type === "add")
|
|
54
|
-
|
|
122
|
+
u.value.add = { columnId: e.columnId, event: e.event };
|
|
55
123
|
else if (e.type === "update") {
|
|
56
|
-
if (
|
|
57
|
-
|
|
124
|
+
if (b(e.columnId)) {
|
|
125
|
+
u.value = {};
|
|
58
126
|
return;
|
|
59
127
|
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
newIndex: e.event.newIndex
|
|
67
|
-
});
|
|
128
|
+
k(
|
|
129
|
+
e.columnId,
|
|
130
|
+
e.event.newIndex,
|
|
131
|
+
e.columnId,
|
|
132
|
+
e.event.oldIndex
|
|
133
|
+
);
|
|
68
134
|
}
|
|
69
|
-
if (
|
|
70
|
-
const { remove:
|
|
71
|
-
if (
|
|
72
|
-
|
|
135
|
+
if (u.value.remove && u.value.add) {
|
|
136
|
+
const { remove: a, add: o } = u.value;
|
|
137
|
+
if (b(a.columnId) || b(o.columnId)) {
|
|
138
|
+
u.value = {};
|
|
73
139
|
return;
|
|
74
140
|
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
newIndex: t.event.newIndex
|
|
82
|
-
}), r.value = {};
|
|
141
|
+
k(
|
|
142
|
+
o.columnId,
|
|
143
|
+
o.event.newIndex,
|
|
144
|
+
a.columnId,
|
|
145
|
+
a.event.oldIndex
|
|
146
|
+
), u.value = {};
|
|
83
147
|
}
|
|
84
148
|
setTimeout(() => {
|
|
85
|
-
|
|
149
|
+
u.value = {};
|
|
86
150
|
}, 100);
|
|
87
|
-
},
|
|
88
|
-
|
|
89
|
-
},
|
|
90
|
-
return (e,
|
|
91
|
-
class:
|
|
151
|
+
}, L = (e, a) => {
|
|
152
|
+
d.value[e] = a, s.data && c("update:data", { ...s.data, [e]: a });
|
|
153
|
+
}, N = (e) => d.value[e] || [];
|
|
154
|
+
return (e, a) => (C(), P("div", {
|
|
155
|
+
class: j([
|
|
92
156
|
"flex gap-4 scrollbar-thin overflow-x-auto p-1 scrollbar-thin-x scrollable-container",
|
|
93
|
-
|
|
157
|
+
s.class
|
|
94
158
|
])
|
|
95
159
|
}, [
|
|
96
|
-
(
|
|
97
|
-
key:
|
|
98
|
-
column:
|
|
99
|
-
group:
|
|
100
|
-
"item-key":
|
|
101
|
-
"load-data":
|
|
102
|
-
"column-data":
|
|
103
|
-
"board-class":
|
|
104
|
-
"header-class":
|
|
105
|
-
"body-class":
|
|
106
|
-
"draggable-class":
|
|
107
|
-
"ghost-class":
|
|
108
|
-
"is-item-disabled":
|
|
109
|
-
onChange:
|
|
110
|
-
"onUpdate:columnData": (
|
|
160
|
+
(C(!0), P(q, null, w(l.columns, (o) => (C(), z(F, {
|
|
161
|
+
key: o.id,
|
|
162
|
+
column: o,
|
|
163
|
+
group: l.group,
|
|
164
|
+
"item-key": l.itemKey,
|
|
165
|
+
"load-data": l.loadData,
|
|
166
|
+
"column-data": N(o.id),
|
|
167
|
+
"board-class": l.boardClass,
|
|
168
|
+
"header-class": l.headerClass,
|
|
169
|
+
"body-class": l.bodyClass,
|
|
170
|
+
"draggable-class": l.draggableClass,
|
|
171
|
+
"ghost-class": l.ghostClass,
|
|
172
|
+
"is-item-disabled": l.isItemDisabled,
|
|
173
|
+
onChange: $,
|
|
174
|
+
"onUpdate:columnData": (t) => L(o.id, t)
|
|
111
175
|
}, {
|
|
112
|
-
header:
|
|
113
|
-
|
|
176
|
+
header: v((t) => [
|
|
177
|
+
g(e.$slots, "column-header", h({ ref_for: !0 }, t), void 0, !0)
|
|
114
178
|
]),
|
|
115
|
-
"prepend-item":
|
|
116
|
-
|
|
179
|
+
"prepend-item": v((t) => [
|
|
180
|
+
g(e.$slots, "prepend-item", h({ ref_for: !0 }, t), void 0, !0)
|
|
117
181
|
]),
|
|
118
|
-
item:
|
|
119
|
-
|
|
182
|
+
item: v((t) => [
|
|
183
|
+
g(e.$slots, "item", h({ ref_for: !0 }, t), void 0, !0)
|
|
120
184
|
]),
|
|
121
|
-
"append-item":
|
|
122
|
-
|
|
185
|
+
"append-item": v((t) => [
|
|
186
|
+
g(e.$slots, "append-item", h({ ref_for: !0 }, t), void 0, !0)
|
|
123
187
|
]),
|
|
124
188
|
_: 3
|
|
125
189
|
}, 8, ["column", "group", "item-key", "load-data", "column-data", "board-class", "header-class", "body-class", "draggable-class", "ghost-class", "is-item-disabled", "onUpdate:columnData"]))), 128))
|
|
@@ -127,5 +191,5 @@ const U = /* @__PURE__ */ D({
|
|
|
127
191
|
}
|
|
128
192
|
});
|
|
129
193
|
export {
|
|
130
|
-
|
|
194
|
+
T as default
|
|
131
195
|
};
|