vlite3 0.7.15 → 0.8.2
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 +35 -22
- package/components/Accordion/AccordionContent.vue.js +2 -2
- package/components/Accordion/AccordionContent.vue2.js +1 -1
- package/components/Breadcrumb/Breadcrumb.vue.js +2 -2
- package/components/Breadcrumb/Breadcrumb.vue2.js +44 -44
- package/components/Carousel/Carousel.vue.js +1 -1
- package/components/Carousel/Carousel.vue2.js +3 -3
- package/components/ColorPicker/ColorIro.vue3.js +2 -2
- package/components/ColorPicker/ColorPicker.vue.js +2 -2
- package/components/CommandPalette/CommandPaletteContent.vue.js +1 -1
- package/components/CommandPalette/CommandPaletteContent.vue2.js +2 -2
- package/components/Dropdown/DropdownTrigger.vue.js +1 -1
- package/components/FilePicker/FilePicker.vue.js +16 -16
- package/components/FileTree/FileTree.vue.js +5 -147
- package/components/FileTree/FileTree.vue2.js +164 -2
- package/components/FileTree/FileTreeNode.vue.js +89 -84
- package/components/Form/CustomFields.vue.js +2 -2
- package/components/Form/CustomFields.vue2.js +1 -1
- package/components/Form/Form.vue.js +1 -1
- package/components/Form/Form.vue2.js +133 -129
- package/components/Form/FormField.vue.d.ts +3 -0
- package/components/Form/FormField.vue.js +85 -82
- package/components/Form/FormFields.vue.d.ts +2 -0
- package/components/Form/FormFields.vue.js +2 -2
- package/components/Form/FormFields.vue2.js +55 -52
- package/components/Form/composables/useForm.d.ts +2 -0
- package/components/Form/composables/useForm.js +113 -107
- package/components/ImportData/ImportData.vue.js +157 -142
- package/components/ImportData/ImportStep1.vue.d.ts +6 -0
- package/components/ImportData/ImportStep1.vue.js +69 -61
- package/components/ImportData/ImportStep2.vue.js +5 -98
- package/components/ImportData/ImportStep2.vue2.js +105 -2
- package/components/Kanban/Kanban.vue.js +1 -1
- package/components/Kanban/Kanban.vue2.js +1 -1
- package/components/Kanban/KanbanBoard.vue.js +1 -1
- package/components/Kanban/KanbanBoard.vue2.js +92 -83
- package/components/Kanban/useKanbanBoard.d.ts +1 -1
- package/components/Kanban/useKanbanBoard.js +17 -17
- package/components/List/ListFieldRow.vue.js +4 -6
- package/components/MultiSelect/MultiSelect.vue.js +10 -4
- package/components/NavbarCommandPalette.vue.js +2 -2
- package/components/NumberInput.vue.js +2 -2
- package/components/NumberInput.vue2.js +1 -1
- package/components/PermissionMatrix/PermissionEditor.vue.d.ts +2 -0
- package/components/PermissionMatrix/PermissionEditor.vue.js +25 -23
- package/components/PermissionMatrix/PermissionEditorMatrix.vue.d.ts +4 -1
- package/components/PermissionMatrix/PermissionEditorMatrix.vue.js +2 -2
- package/components/PermissionMatrix/PermissionEditorMatrix.vue2.js +48 -45
- package/components/Screen/ScreenFilter.vue.js +1 -1
- package/components/Timeline/Timeline.vue.js +62 -57
- package/components/ToastNotification.vue.js +2 -2
- package/components/ToastNotification.vue2.js +103 -88
- package/components/Workbook/Workbook.vue.js +5 -152
- package/components/Workbook/Workbook.vue2.js +166 -2
- package/package.json +1 -1
- package/style.css +3 -3
- /package/components/ColorPicker/{ColorIro.vue2.js → ColorIro.vue.js} +0 -0
|
@@ -1,144 +1,159 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import { useNotifications as
|
|
4
|
-
import
|
|
5
|
-
const
|
|
1
|
+
import { defineComponent as P, ref as Y, onUnmounted as F, openBlock as o, createElementBlock as i, createBlock as y, Teleport as U, Fragment as v, renderList as _, createElementVNode as m, normalizeClass as g, createVNode as w, TransitionGroup as q, withCtx as k, unref as H, isMemoSame as J, normalizeStyle as K, toDisplayString as p, createCommentVNode as T, createTextVNode as Q } from "vue";
|
|
2
|
+
import R from "./Icon.vue.js";
|
|
3
|
+
import { useNotifications as W } from "../composables/useNotifications.js";
|
|
4
|
+
import X from "./Button.vue.js";
|
|
5
|
+
const Z = {
|
|
6
6
|
class: "toast-provider pointer-events-none fixed inset-0 z-[9999999999] overflow-hidden",
|
|
7
7
|
"aria-live": "polite"
|
|
8
|
-
},
|
|
8
|
+
}, ee = { class: "flex-1 min-w-0" }, te = { class: "text-sm font-medium leading-tight mt-0.5" }, re = {
|
|
9
9
|
key: 0,
|
|
10
10
|
class: "text-sm mt-1 leading-relaxed opacity-90"
|
|
11
|
-
},
|
|
11
|
+
}, se = 3, C = 14, ce = /* @__PURE__ */ P({
|
|
12
12
|
__name: "ToastNotification",
|
|
13
13
|
props: {
|
|
14
14
|
position: {},
|
|
15
15
|
expand: { type: Boolean }
|
|
16
16
|
},
|
|
17
|
-
setup(
|
|
18
|
-
const { notifications:
|
|
17
|
+
setup(oe) {
|
|
18
|
+
const { notifications: z, removeToast: B, globalConfig: b, pauseTimers: $, resumeTimers: S } = W(), c = Y(!1), V = [
|
|
19
19
|
"top-left",
|
|
20
20
|
"top-center",
|
|
21
21
|
"top-right",
|
|
22
22
|
"bottom-left",
|
|
23
23
|
"bottom-center",
|
|
24
24
|
"bottom-right"
|
|
25
|
-
],
|
|
25
|
+
], d = (e) => z.value.filter((t) => t.position === e).slice().reverse(), N = {
|
|
26
26
|
"top-left": "top-0 left-0 py-4",
|
|
27
27
|
"top-center": "top-0 left-1/2 -translate-x-1/2 py-4",
|
|
28
28
|
"top-right": "top-0 right-0 py-4",
|
|
29
29
|
"bottom-left": "bottom-2.5 left-0",
|
|
30
30
|
"bottom-center": "bottom-2.5 left-1/2 -translate-x-1/2",
|
|
31
31
|
"bottom-right": "bottom-2.5 right-0"
|
|
32
|
-
},
|
|
33
|
-
const r =
|
|
34
|
-
if (!(
|
|
32
|
+
}, E = (e, s, t) => {
|
|
33
|
+
const r = t.includes("bottom"), l = c.value || b.value.expand;
|
|
34
|
+
if (!(e < se) && !l)
|
|
35
35
|
return {
|
|
36
36
|
opacity: 0,
|
|
37
37
|
pointerEvents: "none",
|
|
38
38
|
transform: r ? "translateY(20px) scale(0.95)" : "translateY(-20px) scale(0.95)",
|
|
39
39
|
zIndex: -1
|
|
40
40
|
};
|
|
41
|
-
if (
|
|
41
|
+
if (l)
|
|
42
42
|
return {
|
|
43
|
-
transform: `translate3d(0, ${
|
|
43
|
+
transform: `translate3d(0, ${e * ((r ? -1 : 1) * (100 + C))}%, 0) scale(1)`,
|
|
44
44
|
opacity: 1,
|
|
45
|
-
zIndex: s -
|
|
45
|
+
zIndex: s - e
|
|
46
46
|
};
|
|
47
|
-
const
|
|
47
|
+
const a = 1 - e * 0.05, u = r ? -1 : 1;
|
|
48
48
|
return {
|
|
49
|
-
transform: `translate3d(0, ${
|
|
49
|
+
transform: `translate3d(0, ${e * C * u}px, -${e}px) scale(${a})`,
|
|
50
50
|
opacity: 1,
|
|
51
|
-
zIndex: s -
|
|
51
|
+
zIndex: s - e
|
|
52
52
|
};
|
|
53
|
-
},
|
|
54
|
-
"--entrance-offset":
|
|
53
|
+
}, I = (e, s) => s !== 0 ? {} : {
|
|
54
|
+
"--entrance-offset": e.includes("bottom") ? "25px" : "-25px",
|
|
55
55
|
"--entrance-opacity": "0.6"
|
|
56
|
-
},
|
|
57
|
-
|
|
58
|
-
},
|
|
56
|
+
}, M = (e) => {
|
|
57
|
+
e.action && (e.action.onClick(), B(e.id));
|
|
58
|
+
}, h = {
|
|
59
59
|
error: "lucide:octagon-x",
|
|
60
60
|
success: "lucide:circle-check",
|
|
61
61
|
info: "lucide:info",
|
|
62
62
|
warning: "lucide:triangle-alert",
|
|
63
63
|
default: "lucide:bell"
|
|
64
|
-
},
|
|
64
|
+
}, x = {
|
|
65
65
|
default: "bg-gray-100 border-border text-foreground shadow-lg",
|
|
66
66
|
success: "bg-success text-success-fg border-success-fg/30 dark:border-success-fg/10 shadow-lg",
|
|
67
67
|
error: "bg-danger text-danger-fg border-danger-fg/30 dark:border-danger-fg/10 shadow-lg",
|
|
68
68
|
warning: "bg-warning-light text-warning-fg border-warning-fg/30 shadow-lg",
|
|
69
69
|
info: "bg-gray-100 text-gray-900 border/50 shadow-lg"
|
|
70
|
-
},
|
|
71
|
-
let
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
-
},
|
|
75
|
-
|
|
76
|
-
|
|
70
|
+
}, D = (e) => x[e] || x.default;
|
|
71
|
+
let n = null;
|
|
72
|
+
const O = () => {
|
|
73
|
+
n && (clearTimeout(n), n = null), c.value = !0, $();
|
|
74
|
+
}, j = () => {
|
|
75
|
+
n = setTimeout(() => {
|
|
76
|
+
c.value = !1, S();
|
|
77
77
|
}, 400);
|
|
78
|
-
}, M = (t) => {
|
|
79
|
-
const s = t.includes("bottom") ? "bottom" : "top", e = t.includes("right") ? "right" : t.includes("left") ? "left" : "center";
|
|
80
|
-
return `${s} ${e}`;
|
|
81
78
|
};
|
|
82
|
-
|
|
83
|
-
(
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
79
|
+
F(() => {
|
|
80
|
+
n && clearTimeout(n);
|
|
81
|
+
});
|
|
82
|
+
const A = (e) => {
|
|
83
|
+
const s = e.includes("bottom") ? "bottom" : "top", t = e.includes("right") ? "right" : e.includes("left") ? "left" : "center";
|
|
84
|
+
return `${s} ${t}`;
|
|
85
|
+
};
|
|
86
|
+
return (e, s) => (o(), i("div", Z, [
|
|
87
|
+
(o(), y(U, { to: "body" }, [
|
|
88
|
+
(o(), i(v, null, _(V, (t) => m("div", {
|
|
89
|
+
key: t,
|
|
90
|
+
class: g(["fixed z-[9999999999]! px-4 flex flex-col gap-2 transition-all duration-300 max-w-full sm:max-w-120", [
|
|
91
|
+
N[t],
|
|
92
|
+
t.includes("center") ? "items-center" : t.includes("right") ? "items-end" : "items-start"
|
|
89
93
|
]]),
|
|
90
|
-
onMouseenter:
|
|
91
|
-
onMouseleave:
|
|
94
|
+
onMouseenter: O,
|
|
95
|
+
onMouseleave: j
|
|
92
96
|
}, [
|
|
93
|
-
|
|
94
|
-
class:
|
|
97
|
+
m("div", {
|
|
98
|
+
class: g(["relative w-full transition-all pointer-events-auto", [{ "flex-col-reverse": t.includes("top") }]])
|
|
95
99
|
}, [
|
|
96
|
-
|
|
97
|
-
name:
|
|
100
|
+
w(q, {
|
|
101
|
+
name: d(t).length <= 1 ? "first-toast" : "stack-toast",
|
|
98
102
|
tag: "div",
|
|
99
|
-
class:
|
|
100
|
-
|
|
103
|
+
class: g(["w-full grid grid-cols-1 grid-rows-1", [
|
|
104
|
+
t.includes("center") ? "justify-items-center" : t.includes("right") ? "justify-items-end" : "justify-items-start"
|
|
101
105
|
]]),
|
|
102
106
|
style: { "min-height": "20px" }
|
|
103
107
|
}, {
|
|
104
|
-
default:
|
|
105
|
-
(o(!0),
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
default: y(() => [
|
|
137
|
-
q(m(r.action.label), 1)
|
|
108
|
+
default: k(() => [
|
|
109
|
+
(o(!0), i(v, null, _(d(t), (r, l, L, a) => {
|
|
110
|
+
const u = [
|
|
111
|
+
r,
|
|
112
|
+
l,
|
|
113
|
+
d(t).length,
|
|
114
|
+
c.value,
|
|
115
|
+
H(b).expand
|
|
116
|
+
];
|
|
117
|
+
if (a && a.key === r.id && J(a, u)) return a;
|
|
118
|
+
const f = (o(), i("div", {
|
|
119
|
+
key: r.id,
|
|
120
|
+
class: g(["toast-item col-start-1 h-max row-start-1 mb-1 w-auto border pl-4 pr-6 py-2.5 flex gap-2.5 items-start transition-all duration-300 ease-[cubic-bezier(0.16,1,0.3,1)] transform-gpu", [
|
|
121
|
+
D(r.type),
|
|
122
|
+
r.description || r.action ? "rounded-xl" : "rounded-full"
|
|
123
|
+
]]),
|
|
124
|
+
style: K([
|
|
125
|
+
E(l, d(t).length, t),
|
|
126
|
+
I(t, l),
|
|
127
|
+
{
|
|
128
|
+
"--hover-offset": t.includes("bottom") ? "-5px" : "5px",
|
|
129
|
+
"transform-origin": A(t)
|
|
130
|
+
}
|
|
131
|
+
])
|
|
132
|
+
}, [
|
|
133
|
+
w(R, {
|
|
134
|
+
icon: h[r.type] || h.default,
|
|
135
|
+
class: "w-5 h-5 shrink-0 mt-0.5"
|
|
136
|
+
}, null, 8, ["icon"]),
|
|
137
|
+
m("div", ee, [
|
|
138
|
+
m("p", te, p(r.message), 1),
|
|
139
|
+
r.description ? (o(), i("p", re, p(r.description), 1)) : T("", !0)
|
|
138
140
|
]),
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
141
|
+
r.action ? (o(), y(X, {
|
|
142
|
+
key: 0,
|
|
143
|
+
type: "button",
|
|
144
|
+
size: "xs",
|
|
145
|
+
variant: "outline",
|
|
146
|
+
class: "ml-2 shrink-0 h-8 px-3 text-xs bg-transparent border-current/20 hover:bg-black/5 dark:hover:bg-white/10",
|
|
147
|
+
onClick: (G) => M(r)
|
|
148
|
+
}, {
|
|
149
|
+
default: k(() => [
|
|
150
|
+
Q(p(r.action.label), 1)
|
|
151
|
+
]),
|
|
152
|
+
_: 2
|
|
153
|
+
}, 1032, ["onClick"])) : T("", !0)
|
|
154
|
+
], 6));
|
|
155
|
+
return f.memo = u, f;
|
|
156
|
+
}, s, 0), 128))
|
|
142
157
|
]),
|
|
143
158
|
_: 2
|
|
144
159
|
}, 1032, ["name", "class"])
|
|
@@ -149,5 +164,5 @@ const Q = {
|
|
|
149
164
|
}
|
|
150
165
|
});
|
|
151
166
|
export {
|
|
152
|
-
|
|
167
|
+
ce as default
|
|
153
168
|
};
|
|
@@ -1,154 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
const L = { class: "flex flex-col w-full font-sans" }, M = { class: "flex items-end w-full border-b px-1" }, j = {
|
|
6
|
-
key: 0,
|
|
7
|
-
class: "flex items-center"
|
|
8
|
-
}, q = {
|
|
9
|
-
key: 0,
|
|
10
|
-
class: "shrink-0 mb-1"
|
|
11
|
-
}, G = { class: "flex items-center mb-0.5 z-20 sticky right-0 ml-auto box-decoration-clone" }, H = { key: 0 }, K = { key: 1 }, Q = { class: "flex-1 relative bg-white w-full" }, ee = /* @__PURE__ */ N({
|
|
12
|
-
__name: "Workbook",
|
|
13
|
-
props: {
|
|
14
|
-
modelValue: { default: "" },
|
|
15
|
-
sheets: { default: () => [] },
|
|
16
|
-
editable: { type: Boolean, default: !0 },
|
|
17
|
-
addable: { type: Boolean, default: !0 },
|
|
18
|
-
draggable: { type: Boolean, default: !0 },
|
|
19
|
-
addButtonPosition: { default: "fixed-right" },
|
|
20
|
-
maxSheets: { default: 50 },
|
|
21
|
-
variant: { default: "chrome" },
|
|
22
|
-
class: {},
|
|
23
|
-
itemClass: { default: "" },
|
|
24
|
-
activeItemClass: { default: "" },
|
|
25
|
-
inactiveItemClass: { default: "" },
|
|
26
|
-
confirmDelete: { type: Boolean, default: !1 },
|
|
27
|
-
confirmDeleteTexts: {},
|
|
28
|
-
allowIconChange: { type: Boolean, default: !0 }
|
|
29
|
-
},
|
|
30
|
-
emits: ["update:modelValue", "update:sheets", "change", "add", "delete", "duplicate", "edit-start", "edit-end"],
|
|
31
|
-
setup(d, { emit: k }) {
|
|
32
|
-
const l = d, n = k, h = m(null), c = m(null), u = m([...l.sheets]);
|
|
33
|
-
b(
|
|
34
|
-
() => l.sheets,
|
|
35
|
-
(e) => {
|
|
36
|
-
JSON.stringify(e) !== JSON.stringify(u.value) && (u.value = [...e]);
|
|
37
|
-
},
|
|
38
|
-
{ deep: !0 }
|
|
39
|
-
);
|
|
40
|
-
const w = (e) => {
|
|
41
|
-
u.value = e, n("update:sheets", e);
|
|
42
|
-
}, y = (e) => {
|
|
43
|
-
n("update:modelValue", e), n("change", e);
|
|
44
|
-
}, x = () => {
|
|
45
|
-
l.sheets.length >= l.maxSheets || n("add");
|
|
46
|
-
}, C = (e, s) => {
|
|
47
|
-
const t = l.sheets.findIndex((a) => a.id === e);
|
|
48
|
-
if (t !== -1) {
|
|
49
|
-
const a = [...l.sheets];
|
|
50
|
-
a[t] = { ...a[t], title: s }, n("update:sheets", a);
|
|
51
|
-
}
|
|
52
|
-
}, S = (e, s) => {
|
|
53
|
-
const t = l.sheets.findIndex((a) => a.id === e);
|
|
54
|
-
if (t !== -1) {
|
|
55
|
-
const a = [...l.sheets];
|
|
56
|
-
a[t] = { ...a[t], icon: s }, n("update:sheets", a);
|
|
57
|
-
}
|
|
58
|
-
}, I = (e) => {
|
|
59
|
-
c.value = e, n("edit-start", e);
|
|
60
|
-
}, V = (e) => {
|
|
61
|
-
c.value = null, n("edit-end", e);
|
|
62
|
-
}, B = (e) => {
|
|
63
|
-
n("duplicate", e);
|
|
64
|
-
}, D = (e) => {
|
|
65
|
-
const s = l.sheets.findIndex((a) => a.id === e);
|
|
66
|
-
if (s === -1) return;
|
|
67
|
-
const t = [...l.sheets];
|
|
68
|
-
if (t.splice(s, 1), n("update:sheets", t), n("delete", e), l.modelValue === e) {
|
|
69
|
-
let a = "";
|
|
70
|
-
if (t.length > 0) {
|
|
71
|
-
const U = Math.min(s, t.length - 1);
|
|
72
|
-
a = t[U].id;
|
|
73
|
-
}
|
|
74
|
-
n("update:modelValue", a), n("change", a);
|
|
75
|
-
}
|
|
76
|
-
};
|
|
77
|
-
b(
|
|
78
|
-
() => l.sheets.length,
|
|
79
|
-
(e, s) => {
|
|
80
|
-
s !== void 0 && s > 0 && e === s + 1 && l.addable && T(() => {
|
|
81
|
-
const t = l.sheets[l.sheets.length - 1];
|
|
82
|
-
t.id === l.modelValue && (c.value = t.id);
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
);
|
|
86
|
-
const E = (e) => {
|
|
87
|
-
h.value && e.deltaY !== 0 && (h.value.scrollLeft += e.deltaY, e.preventDefault());
|
|
88
|
-
}, $ = P(() => l.sheets.length > 1);
|
|
89
|
-
return (e, s) => (i(), o("div", L, [
|
|
90
|
-
r("div", M, [
|
|
91
|
-
e.$slots["left-addons"] ? (i(), o("div", j, [
|
|
92
|
-
v(e.$slots, "left-addons")
|
|
93
|
-
])) : f("", !0),
|
|
94
|
-
r("div", {
|
|
95
|
-
ref_key: "scrollContainer",
|
|
96
|
-
ref: h,
|
|
97
|
-
class: "flex-1 flex items-end overflow-x-auto scrollbar-none overscroll-contain",
|
|
98
|
-
style: { "scrollbar-width": "none", "-ms-overflow-style": "none" },
|
|
99
|
-
onWheel: E
|
|
100
|
-
}, [
|
|
101
|
-
g(A(z), {
|
|
102
|
-
"model-value": u.value,
|
|
103
|
-
"onUpdate:modelValue": w,
|
|
104
|
-
disabled: !l.draggable || !!c.value,
|
|
105
|
-
animation: 150,
|
|
106
|
-
class: "flex items-end"
|
|
107
|
-
}, {
|
|
108
|
-
default: J(() => [
|
|
109
|
-
(i(!0), o(O, null, W(u.value, (t) => (i(), Y(F, {
|
|
110
|
-
key: t.id,
|
|
111
|
-
sheet: t,
|
|
112
|
-
"is-active": d.modelValue === t.id,
|
|
113
|
-
"is-editing": c.value === t.id,
|
|
114
|
-
"can-delete": $.value,
|
|
115
|
-
"confirm-delete": d.confirmDelete,
|
|
116
|
-
"confirm-delete-texts": d.confirmDeleteTexts,
|
|
117
|
-
"allow-icon-change": d.allowIconChange,
|
|
118
|
-
"item-class": d.itemClass,
|
|
119
|
-
"active-item-class": d.activeItemClass,
|
|
120
|
-
"inactive-item-class": d.inactiveItemClass,
|
|
121
|
-
onSelect: y,
|
|
122
|
-
"onUpdate:title": C,
|
|
123
|
-
"onUpdate:icon": S,
|
|
124
|
-
onEditStart: I,
|
|
125
|
-
onEditEnd: V,
|
|
126
|
-
onDuplicate: B,
|
|
127
|
-
onDelete: D
|
|
128
|
-
}, null, 8, ["sheet", "is-active", "is-editing", "can-delete", "confirm-delete", "confirm-delete-texts", "allow-icon-change", "item-class", "active-item-class", "inactive-item-class"]))), 128))
|
|
129
|
-
]),
|
|
130
|
-
_: 1
|
|
131
|
-
}, 8, ["model-value", "disabled"]),
|
|
132
|
-
d.addable && d.addButtonPosition === "attached" ? (i(), o("div", q, [
|
|
133
|
-
g(p, { onClick: x })
|
|
134
|
-
])) : f("", !0),
|
|
135
|
-
s[0] || (s[0] = r("div", { class: "w-1 shrink-0" }, null, -1))
|
|
136
|
-
], 544),
|
|
137
|
-
r("div", G, [
|
|
138
|
-
d.addable && d.addButtonPosition === "fixed-right" ? (i(), o("div", H, [
|
|
139
|
-
g(p, { onClick: x })
|
|
140
|
-
])) : f("", !0),
|
|
141
|
-
e.$slots["right-addons"] ? (i(), o("div", K, [
|
|
142
|
-
v(e.$slots, "right-addons")
|
|
143
|
-
])) : f("", !0)
|
|
144
|
-
])
|
|
145
|
-
]),
|
|
146
|
-
r("div", Q, [
|
|
147
|
-
v(e.$slots, "default")
|
|
148
|
-
])
|
|
149
|
-
]));
|
|
150
|
-
}
|
|
151
|
-
});
|
|
1
|
+
import o from "./Workbook.vue2.js";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import r from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const m = /* @__PURE__ */ r(o, [["__scopeId", "data-v-a5e9ca6f"]]);
|
|
152
5
|
export {
|
|
153
|
-
|
|
6
|
+
m as default
|
|
154
7
|
};
|
|
@@ -1,4 +1,168 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { defineComponent as N, ref as y, shallowRef as P, watch as A, computed as M, openBlock as o, createElementBlock as c, createElementVNode as r, renderSlot as v, createCommentVNode as m, createVNode as g, unref as W, withCtx as Y, Fragment as z, renderList as F, isMemoSame as R, createBlock as j } from "vue";
|
|
2
|
+
import { VueDraggable as q } from "vue-draggable-plus";
|
|
3
|
+
import G from "./Sheet.vue.js";
|
|
4
|
+
import p from "./WorkbookAddButton.vue.js";
|
|
5
|
+
const H = { class: "flex flex-col w-full font-sans" }, J = { class: "flex items-end w-full border-b px-1" }, K = {
|
|
6
|
+
key: 0,
|
|
7
|
+
class: "flex items-center"
|
|
8
|
+
}, O = {
|
|
9
|
+
key: 0,
|
|
10
|
+
class: "shrink-0 mb-1"
|
|
11
|
+
}, Q = { class: "flex items-center mb-0.5 z-20 sticky right-0 ml-auto box-decoration-clone" }, X = { key: 0 }, Z = { key: 1 }, _ = { class: "flex-1 relative bg-white w-full" }, ne = /* @__PURE__ */ N({
|
|
12
|
+
__name: "Workbook",
|
|
13
|
+
props: {
|
|
14
|
+
modelValue: { default: "" },
|
|
15
|
+
sheets: { default: () => [] },
|
|
16
|
+
editable: { type: Boolean, default: !0 },
|
|
17
|
+
addable: { type: Boolean, default: !0 },
|
|
18
|
+
draggable: { type: Boolean, default: !0 },
|
|
19
|
+
addButtonPosition: { default: "fixed-right" },
|
|
20
|
+
maxSheets: { default: 50 },
|
|
21
|
+
variant: { default: "chrome" },
|
|
22
|
+
class: {},
|
|
23
|
+
itemClass: { default: "" },
|
|
24
|
+
activeItemClass: { default: "" },
|
|
25
|
+
inactiveItemClass: { default: "" },
|
|
26
|
+
confirmDelete: { type: Boolean, default: !1 },
|
|
27
|
+
confirmDeleteTexts: {},
|
|
28
|
+
allowIconChange: { type: Boolean, default: !0 }
|
|
29
|
+
},
|
|
30
|
+
emits: ["update:modelValue", "update:sheets", "change", "add", "delete", "duplicate", "edit-start", "edit-end"],
|
|
31
|
+
setup(a, { emit: I }) {
|
|
32
|
+
const i = a, d = I, h = y(null), u = y(null), s = P([...i.sheets]);
|
|
33
|
+
A(
|
|
34
|
+
() => i.sheets,
|
|
35
|
+
(e) => {
|
|
36
|
+
let n = !1;
|
|
37
|
+
if (e.length !== s.value.length)
|
|
38
|
+
n = !0;
|
|
39
|
+
else
|
|
40
|
+
for (let t = 0; t < e.length; t++)
|
|
41
|
+
if (e[t] !== s.value[t] || e[t].id !== s.value[t].id) {
|
|
42
|
+
n = !0;
|
|
43
|
+
break;
|
|
44
|
+
}
|
|
45
|
+
n && (s.value = [...e]);
|
|
46
|
+
},
|
|
47
|
+
{ deep: !0 }
|
|
48
|
+
// Must be true so parent mutating the array via .push() correctly triggers the watcher
|
|
49
|
+
);
|
|
50
|
+
const D = (e) => {
|
|
51
|
+
s.value = e, d("update:sheets", e);
|
|
52
|
+
}, V = (e) => {
|
|
53
|
+
d("update:modelValue", e), d("change", e);
|
|
54
|
+
}, x = () => {
|
|
55
|
+
i.sheets.length >= i.maxSheets || d("add");
|
|
56
|
+
}, B = (e, n) => {
|
|
57
|
+
const t = i.sheets.findIndex((l) => l.id === e);
|
|
58
|
+
if (t !== -1) {
|
|
59
|
+
const l = [...i.sheets];
|
|
60
|
+
l[t] = { ...l[t], title: n }, d("update:sheets", l);
|
|
61
|
+
}
|
|
62
|
+
}, S = (e, n) => {
|
|
63
|
+
const t = i.sheets.findIndex((l) => l.id === e);
|
|
64
|
+
if (t !== -1) {
|
|
65
|
+
const l = [...i.sheets];
|
|
66
|
+
l[t] = { ...l[t], icon: n }, d("update:sheets", l);
|
|
67
|
+
}
|
|
68
|
+
}, E = (e) => {
|
|
69
|
+
u.value = e, d("edit-start", e);
|
|
70
|
+
}, U = (e) => {
|
|
71
|
+
u.value = null, d("edit-end", e);
|
|
72
|
+
}, $ = (e) => {
|
|
73
|
+
d("duplicate", e);
|
|
74
|
+
}, T = (e) => {
|
|
75
|
+
const n = i.sheets.findIndex((l) => l.id === e);
|
|
76
|
+
if (n === -1) return;
|
|
77
|
+
const t = [...i.sheets];
|
|
78
|
+
if (t.splice(n, 1), d("update:sheets", t), d("delete", e), i.modelValue === e) {
|
|
79
|
+
let l = "";
|
|
80
|
+
if (t.length > 0) {
|
|
81
|
+
const k = Math.min(n, t.length - 1);
|
|
82
|
+
l = t[k].id;
|
|
83
|
+
}
|
|
84
|
+
d("update:modelValue", l), d("change", l);
|
|
85
|
+
}
|
|
86
|
+
}, L = (e) => {
|
|
87
|
+
h.value && e.deltaY !== 0 && (h.value.scrollLeft += e.deltaY, e.preventDefault());
|
|
88
|
+
}, b = M(() => i.sheets.length > 1);
|
|
89
|
+
return (e, n) => (o(), c("div", H, [
|
|
90
|
+
r("div", J, [
|
|
91
|
+
e.$slots["left-addons"] ? (o(), c("div", K, [
|
|
92
|
+
v(e.$slots, "left-addons", {}, void 0, !0)
|
|
93
|
+
])) : m("", !0),
|
|
94
|
+
r("div", {
|
|
95
|
+
ref_key: "scrollContainer",
|
|
96
|
+
ref: h,
|
|
97
|
+
class: "flex-1 flex items-end overflow-x-auto scrollbar-none overscroll-contain sheet-container",
|
|
98
|
+
style: { "scrollbar-width": "none", "-ms-overflow-style": "none" },
|
|
99
|
+
onWheel: L
|
|
100
|
+
}, [
|
|
101
|
+
g(W(q), {
|
|
102
|
+
"model-value": s.value,
|
|
103
|
+
"onUpdate:modelValue": D,
|
|
104
|
+
disabled: !i.draggable || !!u.value,
|
|
105
|
+
animation: 150,
|
|
106
|
+
class: "flex items-end min-w-max"
|
|
107
|
+
}, {
|
|
108
|
+
default: Y(() => [
|
|
109
|
+
(o(!0), c(z, null, F(s.value, (t, l, k, f) => {
|
|
110
|
+
const w = [
|
|
111
|
+
t.id,
|
|
112
|
+
t.title,
|
|
113
|
+
t.icon,
|
|
114
|
+
a.modelValue === t.id,
|
|
115
|
+
u.value === t.id,
|
|
116
|
+
b.value,
|
|
117
|
+
a.confirmDelete,
|
|
118
|
+
a.allowIconChange
|
|
119
|
+
];
|
|
120
|
+
if (f && f.key === t.id && R(f, w)) return f;
|
|
121
|
+
const C = (o(), j(G, {
|
|
122
|
+
key: t.id,
|
|
123
|
+
sheet: t,
|
|
124
|
+
"is-active": a.modelValue === t.id,
|
|
125
|
+
"is-editing": u.value === t.id,
|
|
126
|
+
"can-delete": b.value,
|
|
127
|
+
"confirm-delete": a.confirmDelete,
|
|
128
|
+
"confirm-delete-texts": a.confirmDeleteTexts,
|
|
129
|
+
"allow-icon-change": a.allowIconChange,
|
|
130
|
+
"item-class": a.itemClass,
|
|
131
|
+
"active-item-class": a.activeItemClass,
|
|
132
|
+
"inactive-item-class": a.inactiveItemClass,
|
|
133
|
+
onSelect: V,
|
|
134
|
+
"onUpdate:title": B,
|
|
135
|
+
"onUpdate:icon": S,
|
|
136
|
+
onEditStart: E,
|
|
137
|
+
onEditEnd: U,
|
|
138
|
+
onDuplicate: $,
|
|
139
|
+
onDelete: T
|
|
140
|
+
}, null, 8, ["sheet", "is-active", "is-editing", "can-delete", "confirm-delete", "confirm-delete-texts", "allow-icon-change", "item-class", "active-item-class", "inactive-item-class"]));
|
|
141
|
+
return C.memo = w, C;
|
|
142
|
+
}, n, 0), 128))
|
|
143
|
+
]),
|
|
144
|
+
_: 1
|
|
145
|
+
}, 8, ["model-value", "disabled"]),
|
|
146
|
+
a.addable && a.addButtonPosition === "attached" ? (o(), c("div", O, [
|
|
147
|
+
g(p, { onClick: x })
|
|
148
|
+
])) : m("", !0),
|
|
149
|
+
n[2] || (n[2] = r("div", { class: "w-1 shrink-0" }, null, -1))
|
|
150
|
+
], 544),
|
|
151
|
+
r("div", Q, [
|
|
152
|
+
a.addable && a.addButtonPosition === "fixed-right" ? (o(), c("div", X, [
|
|
153
|
+
g(p, { onClick: x })
|
|
154
|
+
])) : m("", !0),
|
|
155
|
+
e.$slots["right-addons"] ? (o(), c("div", Z, [
|
|
156
|
+
v(e.$slots, "right-addons", {}, void 0, !0)
|
|
157
|
+
])) : m("", !0)
|
|
158
|
+
])
|
|
159
|
+
]),
|
|
160
|
+
r("div", _, [
|
|
161
|
+
v(e.$slots, "default", {}, void 0, !0)
|
|
162
|
+
])
|
|
163
|
+
]));
|
|
164
|
+
}
|
|
165
|
+
});
|
|
2
166
|
export {
|
|
3
|
-
|
|
167
|
+
ne as default
|
|
4
168
|
};
|