vlite3 0.2.5 → 0.2.7
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.js +43 -34
- package/components/Carousel/Carousel.vue.d.ts +10 -42
- package/components/ChoiceBox/ChoiceBox.vue.js +19 -19
- package/components/ColorPicker/ColorIro.vue.d.ts +18 -1
- package/components/ColorPicker/ColorIro.vue.js +59 -61
- package/components/ColorPicker/ColorPicker.vue.d.ts +2 -0
- package/components/ColorPicker/ColorPicker.vue.js +81 -26
- package/components/Input.vue.js +1 -1
- package/components/Tabes/Tabes.vue.js +10 -10
- package/components/ThemeToggle.vue.d.ts +1 -1
- package/components/ThemeToggle.vue.js +10 -12
- package/components/Workbook/Sheet.vue.d.ts +6 -0
- package/components/Workbook/Sheet.vue.js +69 -54
- package/components/Workbook/Workbook.vue.d.ts +3 -0
- package/components/Workbook/Workbook.vue.js +2 -2
- package/components/Workbook/Workbook.vue2.js +69 -63
- package/components/Workbook/types.d.ts +3 -0
- package/package.json +2 -2
- package/style.css +4 -0
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { defineComponent as T, ref as
|
|
2
|
-
import { useDragAndDrop as
|
|
3
|
-
import { animations as
|
|
4
|
-
import
|
|
1
|
+
import { defineComponent as T, ref as g, watch as x, nextTick as U, computed as A, openBlock as d, createElementBlock as o, createElementVNode as c, renderSlot as m, createCommentVNode as u, Fragment as P, renderList as J, unref as O, createBlock as W, createVNode as p } from "vue";
|
|
2
|
+
import { useDragAndDrop as Y } from "@formkit/drag-and-drop/vue";
|
|
3
|
+
import { animations as z } from "@formkit/drag-and-drop";
|
|
4
|
+
import F from "./Sheet.vue.js";
|
|
5
5
|
import b from "./WorkbookAddButton.vue.js";
|
|
6
|
-
const
|
|
6
|
+
const L = { class: "flex flex-col w-full font-sans" }, M = { class: "flex items-end w-full border-b px-1" }, j = {
|
|
7
7
|
key: 0,
|
|
8
|
-
class: "flex items-center
|
|
9
|
-
},
|
|
8
|
+
class: "flex items-center"
|
|
9
|
+
}, q = {
|
|
10
10
|
key: 0,
|
|
11
11
|
class: "shrink-0 mb-1"
|
|
12
|
-
},
|
|
12
|
+
}, 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" }, te = /* @__PURE__ */ T({
|
|
13
13
|
__name: "Workbook",
|
|
14
14
|
props: {
|
|
15
15
|
modelValue: { default: "" },
|
|
@@ -21,20 +21,23 @@ const z = { class: "flex flex-col w-full font-sans" }, F = { class: "flex items-
|
|
|
21
21
|
maxSheets: { default: 50 },
|
|
22
22
|
variant: { default: "chrome" },
|
|
23
23
|
class: {},
|
|
24
|
+
itemClass: { default: "" },
|
|
25
|
+
activeItemClass: { default: "" },
|
|
26
|
+
inactiveItemClass: { default: "" },
|
|
24
27
|
confirmDelete: { type: Boolean, default: !1 },
|
|
25
28
|
confirmDeleteTexts: {},
|
|
26
29
|
allowIconChange: { type: Boolean, default: !0 }
|
|
27
30
|
},
|
|
28
31
|
emits: ["update:modelValue", "update:sheets", "change", "add", "delete", "duplicate", "edit-start", "edit-end"],
|
|
29
|
-
setup(
|
|
30
|
-
const l =
|
|
31
|
-
plugins: [
|
|
32
|
+
setup(i, { emit: k }) {
|
|
33
|
+
const l = i, a = k, f = g(null), r = g(null), [w, h] = Y(l.sheets, {
|
|
34
|
+
plugins: [z()],
|
|
32
35
|
draggable: (e) => l.draggable && !r.value,
|
|
33
36
|
onSort: (e) => {
|
|
34
|
-
|
|
37
|
+
a("update:sheets", e.values);
|
|
35
38
|
}
|
|
36
39
|
});
|
|
37
|
-
|
|
40
|
+
x(
|
|
38
41
|
() => l.sheets,
|
|
39
42
|
(e) => {
|
|
40
43
|
JSON.stringify(e) !== JSON.stringify(h.value) && (h.value = [...e]);
|
|
@@ -42,44 +45,44 @@ const z = { class: "flex flex-col w-full font-sans" }, F = { class: "flex items-
|
|
|
42
45
|
{ deep: !0 }
|
|
43
46
|
);
|
|
44
47
|
const y = (e) => {
|
|
45
|
-
|
|
46
|
-
},
|
|
47
|
-
l.sheets.length >= l.maxSheets ||
|
|
48
|
-
},
|
|
49
|
-
const t = l.sheets.findIndex((
|
|
48
|
+
a("update:modelValue", e), a("change", e);
|
|
49
|
+
}, v = () => {
|
|
50
|
+
l.sheets.length >= l.maxSheets || a("add");
|
|
51
|
+
}, C = (e, n) => {
|
|
52
|
+
const t = l.sheets.findIndex((s) => s.id === e);
|
|
50
53
|
if (t !== -1) {
|
|
51
|
-
const
|
|
52
|
-
|
|
54
|
+
const s = [...l.sheets];
|
|
55
|
+
s[t] = { ...s[t], title: n }, a("update:sheets", s);
|
|
53
56
|
}
|
|
54
|
-
},
|
|
55
|
-
const t = l.sheets.findIndex((
|
|
57
|
+
}, S = (e, n) => {
|
|
58
|
+
const t = l.sheets.findIndex((s) => s.id === e);
|
|
56
59
|
if (t !== -1) {
|
|
57
|
-
const
|
|
58
|
-
|
|
60
|
+
const s = [...l.sheets];
|
|
61
|
+
s[t] = { ...s[t], icon: n }, a("update:sheets", s);
|
|
59
62
|
}
|
|
63
|
+
}, I = (e) => {
|
|
64
|
+
r.value = e, a("edit-start", e);
|
|
65
|
+
}, D = (e) => {
|
|
66
|
+
r.value = null, a("edit-end", e);
|
|
60
67
|
}, B = (e) => {
|
|
61
|
-
|
|
68
|
+
a("duplicate", e);
|
|
62
69
|
}, V = (e) => {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
s("duplicate", e);
|
|
66
|
-
}, C = (e) => {
|
|
67
|
-
const o = l.sheets.findIndex((n) => n.id === e);
|
|
68
|
-
if (o === -1) return;
|
|
70
|
+
const n = l.sheets.findIndex((s) => s.id === e);
|
|
71
|
+
if (n === -1) return;
|
|
69
72
|
const t = [...l.sheets];
|
|
70
|
-
if (t.splice(
|
|
71
|
-
let
|
|
73
|
+
if (t.splice(n, 1), a("update:sheets", t), a("delete", e), l.modelValue === e) {
|
|
74
|
+
let s = "";
|
|
72
75
|
if (t.length > 0) {
|
|
73
|
-
const N = Math.min(
|
|
74
|
-
|
|
76
|
+
const N = Math.min(n, t.length - 1);
|
|
77
|
+
s = t[N].id;
|
|
75
78
|
}
|
|
76
|
-
|
|
79
|
+
a("update:modelValue", s), a("change", s);
|
|
77
80
|
}
|
|
78
81
|
};
|
|
79
|
-
|
|
82
|
+
x(
|
|
80
83
|
() => l.sheets.length,
|
|
81
|
-
(e,
|
|
82
|
-
|
|
84
|
+
(e, n) => {
|
|
85
|
+
n !== void 0 && n > 0 && e === n + 1 && l.addable && U(() => {
|
|
83
86
|
const t = l.sheets[l.sheets.length - 1];
|
|
84
87
|
t.id === l.modelValue && (r.value = t.id);
|
|
85
88
|
});
|
|
@@ -87,10 +90,10 @@ const z = { class: "flex flex-col w-full font-sans" }, F = { class: "flex items-
|
|
|
87
90
|
);
|
|
88
91
|
const E = (e) => {
|
|
89
92
|
f.value && e.deltaY !== 0 && (f.value.scrollLeft += e.deltaY, e.preventDefault());
|
|
90
|
-
}, $ =
|
|
91
|
-
return (e,
|
|
92
|
-
c("div",
|
|
93
|
-
e.$slots["left-addons"] ? (
|
|
93
|
+
}, $ = A(() => l.sheets.length > 1);
|
|
94
|
+
return (e, n) => (d(), o("div", L, [
|
|
95
|
+
c("div", M, [
|
|
96
|
+
e.$slots["left-addons"] ? (d(), o("div", j, [
|
|
94
97
|
m(e.$slots, "left-addons", {}, void 0, !0)
|
|
95
98
|
])) : u("", !0),
|
|
96
99
|
c("div", {
|
|
@@ -105,39 +108,42 @@ const z = { class: "flex flex-col w-full font-sans" }, F = { class: "flex items-
|
|
|
105
108
|
ref: w,
|
|
106
109
|
class: "flex items-end"
|
|
107
110
|
}, [
|
|
108
|
-
(
|
|
111
|
+
(d(!0), o(P, null, J(O(h), (t) => (d(), W(F, {
|
|
109
112
|
key: t.id,
|
|
110
113
|
sheet: t,
|
|
111
|
-
"is-active":
|
|
114
|
+
"is-active": i.modelValue === t.id,
|
|
112
115
|
"is-editing": r.value === t.id,
|
|
113
116
|
"can-delete": $.value,
|
|
114
|
-
"confirm-delete":
|
|
115
|
-
"confirm-delete-texts":
|
|
116
|
-
"allow-icon-change":
|
|
117
|
+
"confirm-delete": i.confirmDelete,
|
|
118
|
+
"confirm-delete-texts": i.confirmDeleteTexts,
|
|
119
|
+
"allow-icon-change": i.allowIconChange,
|
|
120
|
+
"item-class": i.itemClass,
|
|
121
|
+
"active-item-class": i.activeItemClass,
|
|
122
|
+
"inactive-item-class": i.inactiveItemClass,
|
|
117
123
|
onSelect: y,
|
|
118
|
-
"onUpdate:title":
|
|
119
|
-
"onUpdate:icon":
|
|
120
|
-
onEditStart:
|
|
121
|
-
onEditEnd:
|
|
122
|
-
onDuplicate:
|
|
123
|
-
onDelete:
|
|
124
|
-
}, null, 8, ["sheet", "is-active", "is-editing", "can-delete", "confirm-delete", "confirm-delete-texts", "allow-icon-change"]))), 128))
|
|
124
|
+
"onUpdate:title": C,
|
|
125
|
+
"onUpdate:icon": S,
|
|
126
|
+
onEditStart: I,
|
|
127
|
+
onEditEnd: D,
|
|
128
|
+
onDuplicate: B,
|
|
129
|
+
onDelete: V
|
|
130
|
+
}, 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))
|
|
125
131
|
], 512),
|
|
126
|
-
|
|
127
|
-
|
|
132
|
+
i.addable && i.addButtonPosition === "attached" ? (d(), o("div", q, [
|
|
133
|
+
p(b, { onClick: v })
|
|
128
134
|
])) : u("", !0),
|
|
129
|
-
|
|
135
|
+
n[0] || (n[0] = c("div", { class: "w-1 shrink-0" }, null, -1))
|
|
130
136
|
], 544),
|
|
131
|
-
c("div",
|
|
132
|
-
|
|
133
|
-
|
|
137
|
+
c("div", G, [
|
|
138
|
+
i.addable && i.addButtonPosition === "fixed-right" ? (d(), o("div", H, [
|
|
139
|
+
p(b, { onClick: v })
|
|
134
140
|
])) : u("", !0),
|
|
135
|
-
e.$slots["right-addons"] ? (
|
|
141
|
+
e.$slots["right-addons"] ? (d(), o("div", K, [
|
|
136
142
|
m(e.$slots, "right-addons", {}, void 0, !0)
|
|
137
143
|
])) : u("", !0)
|
|
138
144
|
])
|
|
139
145
|
]),
|
|
140
|
-
c("div",
|
|
146
|
+
c("div", Q, [
|
|
141
147
|
m(e.$slots, "default", {}, void 0, !0)
|
|
142
148
|
])
|
|
143
149
|
]));
|
|
@@ -19,6 +19,9 @@ export interface WorkbookProps {
|
|
|
19
19
|
maxSheets?: number;
|
|
20
20
|
variant?: 'chrome' | 'folder' | 'simple' | 'card';
|
|
21
21
|
class?: string;
|
|
22
|
+
itemClass?: string;
|
|
23
|
+
activeItemClass?: string;
|
|
24
|
+
inactiveItemClass?: string;
|
|
22
25
|
confirmDelete?: boolean;
|
|
23
26
|
confirmDeleteTexts?: {
|
|
24
27
|
title?: string;
|
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": "0.2.
|
|
6
|
+
"version": "0.2.7",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"main": "index.js",
|
|
9
9
|
"module": "index.js",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"tailwindcss": "^4.1.18",
|
|
43
43
|
"v-datepicker-lite": "^0.1.6",
|
|
44
44
|
"v-tooltip-lite": "^0.1.9",
|
|
45
|
-
"vue-carousel-lite": "^0.2.
|
|
45
|
+
"vue-carousel-lite": "^0.2.6",
|
|
46
46
|
"vue3-google-signin": "^2.1.1"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|