vlite3 1.2.9 → 1.2.12
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/Button.vue.d.ts +5 -1
- package/components/Button.vue.js +164 -72
- package/components/CategoryManager/CategoryManager.vue.js +1 -1
- package/components/ColorPicker/ColorIro.vue3.js +2 -2
- package/components/ColorPicker/ColorPicker.vue.js +2 -2
- package/components/Dropdown/Dropdown.vue.d.ts +3 -1
- package/components/Dropdown/Dropdown.vue.js +17 -15
- package/components/Dropdown/DropdownMenu.vue.d.ts +1 -1
- package/components/Form/Form.vue.d.ts +1 -0
- package/components/Form/Form.vue.js +1 -1
- package/components/Form/Form.vue2.js +29 -28
- package/components/Form/FormFields.vue.js +2 -2
- package/components/Form/FormFields.vue2.js +29 -25
- package/components/ImportData/ImportStep2.vue.js +6 -6
- package/components/Input.vue.js +6 -5
- 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 +17 -17
- package/components/Label.vue.d.ts +5 -2
- package/components/Label.vue.js +18 -11
- package/components/Modal.vue.js +1 -1
- package/components/Modal.vue2.js +1 -1
- package/components/MultiSelect/MultiSelect.vue.d.ts +1 -1
- package/components/PermissionMatrix/PermissionEditorMatrix.vue.js +1 -1
- package/components/PermissionMatrix/PermissionMatrix.vue.js +1 -1
- package/components/PermissionMatrix/PermissionMatrix.vue2.js +1 -1
- package/components/Screen/ScreenFilter.vue.js +34 -31
- package/components/SidePanel.vue.js +1 -1
- package/components/Splitter/Splitter.vue.d.ts +1 -1
- package/components/Tabes/Tabes.vue.js +2 -2
- package/components/Tabes/Tabes.vue2.js +53 -51
- package/components/Workbook/Sheet.vue.js +76 -70
- package/components/Workbook/Workbook.vue.js +2 -2
- package/components/Workbook/Workbook.vue2.js +88 -84
- package/components/Workbook/WorkbookAddButton.vue.js +9 -8
- package/directives/vRipple.d.ts +3 -1
- package/directives/vRipple.js +11 -11
- package/package.json +13 -1
- package/style.css +83 -72
- package/test/VliteScreen.d.ts +120 -0
- package/test/VliteScreen.js +328 -0
- package/test/createDataFactory.d.ts +24 -0
- package/test/createDataFactory.js +59 -0
- package/test/extractSchemaFields.d.ts +14 -0
- package/test/extractSchemaFields.js +11 -0
- package/test/index.d.ts +39 -0
- package/test/index.js +10 -0
- package/test/renderVlite.d.ts +30 -0
- package/test/renderVlite.js +12 -0
- package/test/types.d.ts +39 -0
- package/types/button.d.ts +2 -0
- /package/components/ColorPicker/{ColorIro.vue.js → ColorIro.vue2.js} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./Workbook.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import r from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const p = /* @__PURE__ */ r(o, [["__scopeId", "data-v-e674bcbc"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
p as default
|
|
7
7
|
};
|
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
1
|
+
import { defineComponent as P, ref as y, shallowRef as A, watch as M, computed as W, openBlock as o, createElementBlock as c, createElementVNode as r, renderSlot as v, createCommentVNode as h, createVNode as g, unref as I, withCtx as Y, Fragment as j, renderList as F, isMemoSame as R, createBlock as q, normalizeClass as G } from "vue";
|
|
2
|
+
import { useScroll as H } from "@vueuse/core";
|
|
3
|
+
import { VueDraggable as J } from "vue-draggable-plus";
|
|
4
|
+
import K from "./Sheet.vue.js";
|
|
4
5
|
import p from "./WorkbookAddButton.vue.js";
|
|
5
|
-
const
|
|
6
|
+
const O = { class: "flex flex-col w-full font-sans" }, Q = { class: "flex items-end w-full border-b px-1" }, X = {
|
|
6
7
|
key: 0,
|
|
7
8
|
class: "flex items-center"
|
|
8
|
-
},
|
|
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({
|
|
9
|
+
}, Z = { class: "flex items-center mb-0.5 z-20 sticky right-0 ml-auto box-decoration-clone" }, _ = { key: 0 }, ee = { key: 1 }, te = { class: "flex-1 relative bg-white w-full" }, de = /* @__PURE__ */ P({
|
|
12
10
|
__name: "Workbook",
|
|
13
11
|
props: {
|
|
14
12
|
modelValue: { default: "" },
|
|
@@ -28,141 +26,147 @@ const H = { class: "flex flex-col w-full font-sans" }, J = { class: "flex items-
|
|
|
28
26
|
allowIconChange: { type: Boolean, default: !0 }
|
|
29
27
|
},
|
|
30
28
|
emits: ["update:modelValue", "update:sheets", "change", "add", "delete", "duplicate", "edit-start", "edit-end"],
|
|
31
|
-
setup(
|
|
32
|
-
const i =
|
|
33
|
-
|
|
34
|
-
() => i.sheets,
|
|
29
|
+
setup(l, { emit: D }) {
|
|
30
|
+
const i = l, s = D, f = y(null), u = y(null), { arrivedState: V } = H(f), d = A([...i.sheets]);
|
|
31
|
+
M(
|
|
32
|
+
() => [...i.sheets],
|
|
35
33
|
(e) => {
|
|
36
34
|
let n = !1;
|
|
37
|
-
if (e.length !==
|
|
35
|
+
if (e.length !== d.value.length)
|
|
38
36
|
n = !0;
|
|
39
37
|
else
|
|
40
38
|
for (let t = 0; t < e.length; t++)
|
|
41
|
-
if (e[t] !==
|
|
39
|
+
if (e[t] !== d.value[t] || e[t].id !== d.value[t].id) {
|
|
42
40
|
n = !0;
|
|
43
41
|
break;
|
|
44
42
|
}
|
|
45
|
-
n && (
|
|
46
|
-
}
|
|
47
|
-
{ deep: !0 }
|
|
48
|
-
// Must be true so parent mutating the array via .push() correctly triggers the watcher
|
|
43
|
+
n && (d.value = e);
|
|
44
|
+
}
|
|
49
45
|
);
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
},
|
|
53
|
-
|
|
46
|
+
const B = (e) => {
|
|
47
|
+
d.value = e, s("update:sheets", e);
|
|
48
|
+
}, S = (e) => {
|
|
49
|
+
s("update:modelValue", e), s("change", e);
|
|
54
50
|
}, x = () => {
|
|
55
|
-
i.sheets.length >= i.maxSheets ||
|
|
56
|
-
},
|
|
57
|
-
const t = i.sheets.findIndex((
|
|
51
|
+
i.sheets.length >= i.maxSheets || s("add");
|
|
52
|
+
}, E = (e, n) => {
|
|
53
|
+
const t = i.sheets.findIndex((a) => a.id === e);
|
|
58
54
|
if (t !== -1) {
|
|
59
|
-
const
|
|
60
|
-
|
|
55
|
+
const a = [...i.sheets];
|
|
56
|
+
a[t] = { ...a[t], title: n }, s("update:sheets", a);
|
|
61
57
|
}
|
|
62
|
-
},
|
|
63
|
-
const t = i.sheets.findIndex((
|
|
58
|
+
}, U = (e, n) => {
|
|
59
|
+
const t = i.sheets.findIndex((a) => a.id === e);
|
|
64
60
|
if (t !== -1) {
|
|
65
|
-
const
|
|
66
|
-
|
|
61
|
+
const a = [...i.sheets];
|
|
62
|
+
a[t] = { ...a[t], icon: n }, s("update:sheets", a);
|
|
67
63
|
}
|
|
68
|
-
}, E = (e) => {
|
|
69
|
-
u.value = e, d("edit-start", e);
|
|
70
|
-
}, U = (e) => {
|
|
71
|
-
u.value = null, d("edit-end", e);
|
|
72
64
|
}, $ = (e) => {
|
|
73
|
-
|
|
65
|
+
u.value = e, s("edit-start", e);
|
|
74
66
|
}, T = (e) => {
|
|
75
|
-
|
|
67
|
+
u.value = null, s("edit-end", e);
|
|
68
|
+
}, z = (e) => {
|
|
69
|
+
s("duplicate", e);
|
|
70
|
+
}, L = (e) => {
|
|
71
|
+
const n = i.sheets.findIndex((a) => a.id === e);
|
|
76
72
|
if (n === -1) return;
|
|
77
73
|
const t = [...i.sheets];
|
|
78
|
-
if (t.splice(n, 1),
|
|
79
|
-
let
|
|
74
|
+
if (t.splice(n, 1), s("update:sheets", t), s("delete", e), i.modelValue === e) {
|
|
75
|
+
let a = "";
|
|
80
76
|
if (t.length > 0) {
|
|
81
77
|
const k = Math.min(n, t.length - 1);
|
|
82
|
-
|
|
78
|
+
a = t[k].id;
|
|
83
79
|
}
|
|
84
|
-
|
|
80
|
+
s("update:modelValue", a), s("change", a);
|
|
85
81
|
}
|
|
86
|
-
},
|
|
87
|
-
|
|
88
|
-
}, b =
|
|
89
|
-
return (e, n) => (o(), c("div",
|
|
90
|
-
r("div",
|
|
91
|
-
e.$slots["left-addons"] ? (o(), c("div",
|
|
82
|
+
}, N = (e) => {
|
|
83
|
+
f.value && e.deltaY !== 0 && (f.value.scrollLeft += e.deltaY, e.preventDefault());
|
|
84
|
+
}, b = W(() => i.sheets.length > 1);
|
|
85
|
+
return (e, n) => (o(), c("div", O, [
|
|
86
|
+
r("div", Q, [
|
|
87
|
+
e.$slots["left-addons"] ? (o(), c("div", X, [
|
|
92
88
|
v(e.$slots, "left-addons", {}, void 0, !0)
|
|
93
|
-
])) :
|
|
89
|
+
])) : h("", !0),
|
|
94
90
|
r("div", {
|
|
95
91
|
ref_key: "scrollContainer",
|
|
96
|
-
ref:
|
|
92
|
+
ref: f,
|
|
97
93
|
class: "flex-1 flex items-end overflow-x-auto scrollbar-none overscroll-contain sheet-container",
|
|
98
94
|
style: { "scrollbar-width": "none", "-ms-overflow-style": "none" },
|
|
99
|
-
onWheel:
|
|
95
|
+
onWheel: N
|
|
100
96
|
}, [
|
|
101
|
-
g(
|
|
102
|
-
"model-value":
|
|
103
|
-
"onUpdate:modelValue":
|
|
97
|
+
g(I(J), {
|
|
98
|
+
"model-value": d.value,
|
|
99
|
+
"onUpdate:modelValue": B,
|
|
104
100
|
disabled: !i.draggable || !!u.value,
|
|
105
101
|
animation: 150,
|
|
106
102
|
class: "flex items-end min-w-max"
|
|
107
103
|
}, {
|
|
108
104
|
default: Y(() => [
|
|
109
|
-
(o(!0), c(
|
|
110
|
-
const
|
|
105
|
+
(o(!0), c(j, null, F(d.value, (t, a, k, m) => {
|
|
106
|
+
const C = [
|
|
111
107
|
t.id,
|
|
112
108
|
t.title,
|
|
113
109
|
t.icon,
|
|
114
|
-
|
|
110
|
+
l.modelValue === t.id,
|
|
115
111
|
u.value === t.id,
|
|
116
112
|
b.value,
|
|
117
|
-
|
|
118
|
-
|
|
113
|
+
l.confirmDelete,
|
|
114
|
+
l.allowIconChange,
|
|
115
|
+
l.itemClass,
|
|
116
|
+
l.activeItemClass,
|
|
117
|
+
l.inactiveItemClass
|
|
119
118
|
];
|
|
120
|
-
if (
|
|
121
|
-
const
|
|
119
|
+
if (m && m.key === t.id && R(m, C)) return m;
|
|
120
|
+
const w = (o(), q(K, {
|
|
122
121
|
key: t.id,
|
|
123
122
|
sheet: t,
|
|
124
|
-
"is-active":
|
|
123
|
+
"is-active": l.modelValue === t.id,
|
|
125
124
|
"is-editing": u.value === t.id,
|
|
126
125
|
"can-delete": b.value,
|
|
127
|
-
"confirm-delete":
|
|
128
|
-
"confirm-delete-texts":
|
|
129
|
-
"allow-icon-change":
|
|
130
|
-
"item-class":
|
|
131
|
-
"active-item-class":
|
|
132
|
-
"inactive-item-class":
|
|
133
|
-
onSelect:
|
|
134
|
-
"onUpdate:title":
|
|
135
|
-
"onUpdate:icon":
|
|
136
|
-
onEditStart:
|
|
137
|
-
onEditEnd:
|
|
138
|
-
onDuplicate:
|
|
139
|
-
onDelete:
|
|
126
|
+
"confirm-delete": l.confirmDelete,
|
|
127
|
+
"confirm-delete-texts": l.confirmDeleteTexts,
|
|
128
|
+
"allow-icon-change": l.allowIconChange,
|
|
129
|
+
"item-class": l.itemClass,
|
|
130
|
+
"active-item-class": l.activeItemClass,
|
|
131
|
+
"inactive-item-class": l.inactiveItemClass,
|
|
132
|
+
onSelect: S,
|
|
133
|
+
"onUpdate:title": E,
|
|
134
|
+
"onUpdate:icon": U,
|
|
135
|
+
onEditStart: $,
|
|
136
|
+
onEditEnd: T,
|
|
137
|
+
onDuplicate: z,
|
|
138
|
+
onDelete: L
|
|
140
139
|
}, 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
|
|
140
|
+
return w.memo = C, w;
|
|
142
141
|
}, n, 0), 128))
|
|
143
142
|
]),
|
|
144
143
|
_: 1
|
|
145
144
|
}, 8, ["model-value", "disabled"]),
|
|
146
|
-
|
|
145
|
+
l.addable && l.addButtonPosition === "attached" ? (o(), c("div", {
|
|
146
|
+
key: 0,
|
|
147
|
+
class: G(["shrink-0 sticky right-0 z-10 bg-body flex items-center justify-center h-full", {
|
|
148
|
+
"shadow-[-18px_0_24px_-4px_#fff] dark:shadow-[-18px_0_24px_-4px_#000]": !I(V).right
|
|
149
|
+
}])
|
|
150
|
+
}, [
|
|
147
151
|
g(p, { onClick: x })
|
|
148
|
-
])) :
|
|
152
|
+
], 2)) : h("", !0),
|
|
149
153
|
n[2] || (n[2] = r("div", { class: "w-1 shrink-0" }, null, -1))
|
|
150
154
|
], 544),
|
|
151
|
-
r("div",
|
|
152
|
-
|
|
155
|
+
r("div", Z, [
|
|
156
|
+
l.addable && l.addButtonPosition === "fixed-right" ? (o(), c("div", _, [
|
|
153
157
|
g(p, { onClick: x })
|
|
154
|
-
])) :
|
|
155
|
-
e.$slots["right-addons"] ? (o(), c("div",
|
|
158
|
+
])) : h("", !0),
|
|
159
|
+
e.$slots["right-addons"] ? (o(), c("div", ee, [
|
|
156
160
|
v(e.$slots, "right-addons", {}, void 0, !0)
|
|
157
|
-
])) :
|
|
161
|
+
])) : h("", !0)
|
|
158
162
|
])
|
|
159
163
|
]),
|
|
160
|
-
r("div",
|
|
164
|
+
r("div", te, [
|
|
161
165
|
v(e.$slots, "default", {}, void 0, !0)
|
|
162
166
|
])
|
|
163
167
|
]));
|
|
164
168
|
}
|
|
165
169
|
});
|
|
166
170
|
export {
|
|
167
|
-
|
|
171
|
+
de as default
|
|
168
172
|
};
|
|
@@ -1,24 +1,25 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
1
|
+
import { defineComponent as l, computed as c, openBlock as s, createBlock as d } from "vue";
|
|
2
|
+
import m from "../Button.vue.js";
|
|
3
3
|
import { $t as u } from "../../utils/i18n.js";
|
|
4
|
-
const
|
|
4
|
+
const _ = /* @__PURE__ */ l({
|
|
5
5
|
__name: "WorkbookAddButton",
|
|
6
6
|
emits: ["click"],
|
|
7
|
-
setup(
|
|
8
|
-
const n = o, i =
|
|
7
|
+
setup(a, { emit: o }) {
|
|
8
|
+
const n = o, i = c(() => {
|
|
9
9
|
const t = u("vlite.workbook.addSheet");
|
|
10
10
|
return t !== "vlite.workbook.addSheet" ? t : "Add New Sheet";
|
|
11
11
|
});
|
|
12
|
-
return (t, e) => (
|
|
12
|
+
return (t, e) => (s(), d(m, {
|
|
13
13
|
variant: "ghost",
|
|
14
|
-
size: "
|
|
14
|
+
size: "md",
|
|
15
15
|
icon: "lucide:plus",
|
|
16
16
|
title: i.value,
|
|
17
17
|
rounded: "none",
|
|
18
|
+
class: "h-full!",
|
|
18
19
|
onClick: e[0] || (e[0] = (r) => n("click", r))
|
|
19
20
|
}, null, 8, ["title"]));
|
|
20
21
|
}
|
|
21
22
|
});
|
|
22
23
|
export {
|
|
23
|
-
|
|
24
|
+
_ as default
|
|
24
25
|
};
|
package/directives/vRipple.d.ts
CHANGED
|
@@ -2,7 +2,9 @@ interface RippleElement extends HTMLElement {
|
|
|
2
2
|
_rippleHandler?: (ev: MouseEvent) => void;
|
|
3
3
|
}
|
|
4
4
|
export declare const vRipple: {
|
|
5
|
-
mounted(el: RippleElement
|
|
5
|
+
mounted(el: RippleElement, binding: {
|
|
6
|
+
value?: boolean;
|
|
7
|
+
}): void;
|
|
6
8
|
unmounted(el: RippleElement): void;
|
|
7
9
|
};
|
|
8
10
|
export {};
|
package/directives/vRipple.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
const
|
|
2
|
-
const
|
|
1
|
+
const f = (e, t) => {
|
|
2
|
+
const o = t.getBoundingClientRect(), p = e.clientX - o.left, d = e.clientY - o.top, s = Math.max(o.width, o.height), c = s / 2;
|
|
3
3
|
t.querySelectorAll(".ripple").forEach((r) => r.remove());
|
|
4
|
-
const
|
|
5
|
-
|
|
4
|
+
const n = document.createElement("span");
|
|
5
|
+
n.style.cssText = `
|
|
6
6
|
width: ${s}px;
|
|
7
7
|
height: ${s}px;
|
|
8
8
|
left: ${p - c}px;
|
|
@@ -14,22 +14,22 @@ const y = (e, t) => {
|
|
|
14
14
|
opacity: 0;
|
|
15
15
|
will-change: transform, opacity;
|
|
16
16
|
background-color: rgba(255, 255, 255, 1);
|
|
17
|
-
`,
|
|
17
|
+
`, n.classList.add("ripple"), t.appendChild(n);
|
|
18
18
|
let a = null;
|
|
19
19
|
const m = 400, l = (r) => {
|
|
20
20
|
a || (a = r);
|
|
21
|
-
const
|
|
22
|
-
|
|
21
|
+
const i = Math.min((r - a) / m, 1), u = (1 - Math.pow(1 - i, 3)) * 2.5, h = i < 0.4 ? i * 0.2 : 0.08 * (1 - (i - 0.4) / 0.6);
|
|
22
|
+
n.style.transform = `scale(${u})`, n.style.opacity = `${h}`, i < 1 ? requestAnimationFrame(l) : n.remove();
|
|
23
23
|
};
|
|
24
24
|
requestAnimationFrame(l);
|
|
25
|
-
},
|
|
26
|
-
mounted(e) {
|
|
27
|
-
window.getComputedStyle(e).position === "static" && (e.style.position = "relative"), e.style.overflow = "hidden", e._rippleHandler = (
|
|
25
|
+
}, v = {
|
|
26
|
+
mounted(e, t) {
|
|
27
|
+
t.value !== !1 && (window.getComputedStyle(e).position === "static" && (e.style.position = "relative"), e.style.overflow = "hidden", e._rippleHandler = (o) => f(o, e), e.addEventListener("click", e._rippleHandler));
|
|
28
28
|
},
|
|
29
29
|
unmounted(e) {
|
|
30
30
|
e._rippleHandler && e.removeEventListener("click", e._rippleHandler), e.querySelectorAll(".ripple").forEach((t) => t.remove());
|
|
31
31
|
}
|
|
32
32
|
};
|
|
33
33
|
export {
|
|
34
|
-
|
|
34
|
+
v as vRipple
|
|
35
35
|
};
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"private": false,
|
|
4
4
|
"description": "A Vue 3 UI component library built with Tailwind CSS.",
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"version": "1.2.
|
|
6
|
+
"version": "1.2.12",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"main": "index.js",
|
|
9
9
|
"module": "index.js",
|
|
@@ -28,6 +28,11 @@
|
|
|
28
28
|
"import": "./index.js",
|
|
29
29
|
"require": "./index.js"
|
|
30
30
|
},
|
|
31
|
+
"./test": {
|
|
32
|
+
"types": "./test/index.d.ts",
|
|
33
|
+
"import": "./test/index.js",
|
|
34
|
+
"require": "./test/index.js"
|
|
35
|
+
},
|
|
31
36
|
"./style.css": "./style.css"
|
|
32
37
|
},
|
|
33
38
|
"dependencies": {
|
|
@@ -57,15 +62,22 @@
|
|
|
57
62
|
"xlsx": "^0.18.5"
|
|
58
63
|
},
|
|
59
64
|
"peerDependencies": {
|
|
65
|
+
"@vue/test-utils": "^2.4.0",
|
|
60
66
|
"vue": "^3.5.24",
|
|
61
67
|
"vue-router": "4"
|
|
62
68
|
},
|
|
69
|
+
"peerDependenciesMeta": {
|
|
70
|
+
"@vue/test-utils": {
|
|
71
|
+
"optional": true
|
|
72
|
+
}
|
|
73
|
+
},
|
|
63
74
|
"devDependencies": {
|
|
64
75
|
"@types/jsbarcode": "^3.11.4",
|
|
65
76
|
"@types/node": "^25.0.10",
|
|
66
77
|
"@types/qrcode": "^1.5.6",
|
|
67
78
|
"@vitejs/plugin-vue": "^6.0.1",
|
|
68
79
|
"@vitejs/plugin-vue-jsx": "^4.1.1",
|
|
80
|
+
"@vue/test-utils": "^2.4.8",
|
|
69
81
|
"@vue/tsconfig": "^0.8.1",
|
|
70
82
|
"typescript": "~5.9.3",
|
|
71
83
|
"vite": "^7.2.4",
|