vlite3 1.5.17 → 1.5.19
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/CategoryManager/CategoryManager2.vue.js +2 -2
- package/components/EditableTitle/EditableTitle.vue.d.ts +182 -2
- package/components/EditableTitle/EditableTitle.vue.js +2 -2
- package/components/EditableTitle/EditableTitle2.vue.js +226 -195
- package/components/RichTextEditor/RichTextEditor.vue.js +4 -4
- package/components/RichTextEditor/RichTextLinkPopover3.vue.js +2 -2
- package/components/RichTextEditor/RichTextToolbar3.vue.js +2 -2
- package/components/Screen/ScreenFilter.vue.js +2 -2
- package/components/Workbook/Sheet.vue.d.ts +34 -2
- package/components/Workbook/Sheet.vue.js +119 -86
- package/components/Workbook/Workbook.vue.d.ts +10 -0
- package/components/Workbook/Workbook.vue.js +2 -2
- package/components/Workbook/Workbook2.vue.js +133 -99
- package/components/Workbook/types.d.ts +28 -0
- package/docs/README.md +1 -0
- package/docs/component-index.md +5 -2
- package/docs/components/editable-title.md +52 -7
- package/docs/components/workbook.md +92 -0
- package/docs/design.md +220 -0
- package/docs-manifest.json +9 -6
- package/package.json +1 -1
- package/style.css +1 -1
- /package/components/RichTextEditor/{RichTextLinkPopover.vue.js → RichTextLinkPopover2.vue.js} +0 -0
- /package/components/RichTextEditor/{RichTextToolbar.vue.js → RichTextToolbar2.vue.js} +0 -0
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
import { WorkbookSheet } from './types';
|
|
1
|
+
import { WorkbookCustomOption, WorkbookSheet } from './types';
|
|
2
2
|
interface Props {
|
|
3
3
|
sheet: WorkbookSheet;
|
|
4
4
|
isActive: boolean;
|
|
5
5
|
isEditing?: boolean;
|
|
6
|
+
canRename?: boolean;
|
|
7
|
+
canDuplicate?: boolean;
|
|
6
8
|
canDelete?: boolean;
|
|
9
|
+
showContextMenu?: boolean;
|
|
10
|
+
customOptions?: WorkbookCustomOption[];
|
|
7
11
|
confirmDelete?: boolean;
|
|
8
12
|
confirmDeleteTexts?: {
|
|
9
13
|
title?: string;
|
|
@@ -12,11 +16,27 @@ interface Props {
|
|
|
12
16
|
cancel?: string;
|
|
13
17
|
};
|
|
14
18
|
allowIconChange?: boolean;
|
|
19
|
+
canChangeIcon?: boolean;
|
|
20
|
+
/** Width of the sheet context-menu dropdown. */
|
|
21
|
+
menuWidth?: string;
|
|
15
22
|
itemClass?: string;
|
|
16
23
|
activeItemClass?: string;
|
|
17
24
|
inactiveItemClass?: string;
|
|
18
25
|
}
|
|
19
|
-
declare
|
|
26
|
+
declare function __VLS_template(): {
|
|
27
|
+
attrs: Partial<{}>;
|
|
28
|
+
slots: {
|
|
29
|
+
'sheet-actions'?(_: {
|
|
30
|
+
sheet: WorkbookSheet;
|
|
31
|
+
}): any;
|
|
32
|
+
};
|
|
33
|
+
refs: {
|
|
34
|
+
inputRef: HTMLInputElement;
|
|
35
|
+
};
|
|
36
|
+
rootEl: HTMLDivElement;
|
|
37
|
+
};
|
|
38
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
39
|
+
declare const __VLS_component: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
20
40
|
select: (id: string) => any;
|
|
21
41
|
delete: (id: string) => any;
|
|
22
42
|
"update:title": (id: string, newTitle: string) => any;
|
|
@@ -36,11 +56,23 @@ declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, imp
|
|
|
36
56
|
itemClass: string;
|
|
37
57
|
isEditing: boolean;
|
|
38
58
|
confirmDelete: boolean;
|
|
59
|
+
canRename: boolean;
|
|
60
|
+
canDuplicate: boolean;
|
|
39
61
|
canDelete: boolean;
|
|
62
|
+
canChangeIcon: boolean;
|
|
63
|
+
showContextMenu: boolean;
|
|
64
|
+
customOptions: WorkbookCustomOption[];
|
|
40
65
|
allowIconChange: boolean;
|
|
66
|
+
menuWidth: string;
|
|
41
67
|
activeItemClass: string;
|
|
42
68
|
inactiveItemClass: string;
|
|
43
69
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
44
70
|
inputRef: HTMLInputElement;
|
|
45
71
|
}, HTMLDivElement>;
|
|
72
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
46
73
|
export default _default;
|
|
74
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
75
|
+
new (): {
|
|
76
|
+
$slots: S;
|
|
77
|
+
};
|
|
78
|
+
};
|
|
@@ -1,157 +1,177 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { $t as
|
|
1
|
+
import { defineComponent as M, useSlots as R, ref as k, computed as d, openBlock as r, createElementBlock as c, normalizeClass as V, createElementVNode as m, withModifiers as u, createBlock as j, withCtx as b, createVNode as f, createCommentVNode as w, withDirectives as z, withKeys as C, vModelText as A, toDisplayString as K, unref as N, createSlots as U, renderSlot as W, nextTick as P } from "vue";
|
|
2
|
+
import D from "../Icon.vue.js";
|
|
3
|
+
import q from "../Dropdown/Dropdown.vue.js";
|
|
4
|
+
import { $t as s } from "../../utils/i18n.js";
|
|
5
5
|
/* empty css */
|
|
6
6
|
/* empty css */
|
|
7
7
|
/* empty css */
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
const
|
|
8
|
+
import F from "../Button.vue.js";
|
|
9
|
+
import G from "../IconPicker.vue.js";
|
|
10
|
+
const H = {
|
|
11
11
|
type: "button",
|
|
12
|
-
class: "flex items-center justify-center rounded hover:bg-accent transition-colors p-0.5 outline-none focus-visible:ring-2 focus-visible:ring-primary/20
|
|
13
|
-
},
|
|
12
|
+
class: "flex items-center justify-center rounded hover:bg-accent transition-colors p-0.5 outline-none focus-visible:ring-2 focus-visible:ring-primary/20"
|
|
13
|
+
}, J = {
|
|
14
14
|
key: 1,
|
|
15
15
|
class: "flex items-center justify-center p-0.5"
|
|
16
|
-
},
|
|
16
|
+
}, L = { class: "flex-1 min-w-0 pr-1" }, Q = ["onKeydown"], X = {
|
|
17
17
|
key: 1,
|
|
18
18
|
class: "block truncate text-sm font-medium leading-normal"
|
|
19
|
-
},
|
|
19
|
+
}, se = /* @__PURE__ */ M({
|
|
20
20
|
__name: "Sheet",
|
|
21
21
|
props: {
|
|
22
22
|
sheet: {},
|
|
23
23
|
isActive: { type: Boolean },
|
|
24
24
|
isEditing: { type: Boolean, default: !1 },
|
|
25
|
+
canRename: { type: Boolean, default: !0 },
|
|
26
|
+
canDuplicate: { type: Boolean, default: !0 },
|
|
25
27
|
canDelete: { type: Boolean, default: !0 },
|
|
28
|
+
showContextMenu: { type: Boolean, default: !0 },
|
|
29
|
+
customOptions: { default: () => [] },
|
|
26
30
|
confirmDelete: { type: Boolean, default: !1 },
|
|
27
31
|
confirmDeleteTexts: {},
|
|
28
32
|
allowIconChange: { type: Boolean, default: !0 },
|
|
33
|
+
canChangeIcon: { type: Boolean, default: !0 },
|
|
34
|
+
menuWidth: { default: "140px" },
|
|
29
35
|
itemClass: { default: "" },
|
|
30
36
|
activeItemClass: { default: "" },
|
|
31
37
|
inactiveItemClass: { default: "" }
|
|
32
38
|
},
|
|
33
39
|
emits: ["select", "update:title", "update:icon", "edit-start", "edit-end", "duplicate", "delete"],
|
|
34
|
-
setup(
|
|
35
|
-
const e = i,
|
|
36
|
-
() => e.sheet.titleI18n ?
|
|
37
|
-
),
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
});
|
|
40
|
+
setup(n, { emit: B }) {
|
|
41
|
+
const e = n, i = B, I = R(), p = k(null), a = k(e.sheet.title), v = k(!1), T = d(
|
|
42
|
+
() => e.sheet.titleI18n ? s(e.sheet.titleI18n) : e.sheet.title
|
|
43
|
+
), g = () => {
|
|
44
|
+
e.canRename && (a.value = e.sheet.title, i("edit-start", e.sheet.id), P(() => {
|
|
45
|
+
p.value?.focus(), p.value?.select();
|
|
46
|
+
}));
|
|
41
47
|
};
|
|
42
|
-
let
|
|
43
|
-
const
|
|
44
|
-
if (!e.isEditing ||
|
|
45
|
-
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
|
|
48
|
+
let h = !1;
|
|
49
|
+
const y = () => {
|
|
50
|
+
if (!e.isEditing || h) return;
|
|
51
|
+
h = !0;
|
|
52
|
+
const o = a.value.trim();
|
|
53
|
+
o ? i("update:title", e.sheet.id, o) : a.value = e.sheet.title, i("edit-end", e.sheet.id), setTimeout(() => {
|
|
54
|
+
h = !1;
|
|
49
55
|
}, 100);
|
|
50
|
-
},
|
|
51
|
-
|
|
52
|
-
},
|
|
53
|
-
|
|
54
|
-
|
|
56
|
+
}, O = () => {
|
|
57
|
+
a.value = e.sheet.title, i("edit-end", e.sheet.id);
|
|
58
|
+
}, x = d(() => {
|
|
59
|
+
const o = [];
|
|
60
|
+
e.canRename && o.push({
|
|
61
|
+
label: s("vlite.workbook.rename") !== "vlite.workbook.rename" ? s("vlite.workbook.rename") : "Rename",
|
|
55
62
|
value: "rename",
|
|
56
63
|
icon: "lucide:pencil"
|
|
57
|
-
},
|
|
58
|
-
|
|
59
|
-
label: l("vlite.workbook.duplicate") !== "vlite.workbook.duplicate" ? l("vlite.workbook.duplicate") : "Duplicate",
|
|
64
|
+
}), e.canDuplicate && o.push({
|
|
65
|
+
label: s("vlite.workbook.duplicate") !== "vlite.workbook.duplicate" ? s("vlite.workbook.duplicate") : "Duplicate",
|
|
60
66
|
value: "duplicate",
|
|
61
67
|
icon: "lucide:copy"
|
|
62
|
-
},
|
|
63
|
-
|
|
64
|
-
label: l("vlite.workbook.delete") !== "vlite.workbook.delete" ? l("vlite.workbook.delete") : "Delete",
|
|
68
|
+
}), e.canDelete && o.push({
|
|
69
|
+
label: s("vlite.workbook.delete") !== "vlite.workbook.delete" ? s("vlite.workbook.delete") : "Delete",
|
|
65
70
|
value: "delete",
|
|
66
71
|
icon: "lucide:trash-2",
|
|
67
|
-
disabled: !e.canDelete,
|
|
68
72
|
confirmation: e.confirmDelete ? {
|
|
69
73
|
title: e.confirmDeleteTexts?.title,
|
|
70
74
|
description: e.confirmDeleteTexts?.description,
|
|
71
75
|
confirmText: e.confirmDeleteTexts?.confirm,
|
|
72
76
|
cancelText: e.confirmDeleteTexts?.cancel,
|
|
73
|
-
variant: "danger"
|
|
74
|
-
onConfirm: () => {
|
|
75
|
-
e.canDelete && o("delete", e.sheet.id);
|
|
76
|
-
}
|
|
77
|
+
variant: "danger"
|
|
77
78
|
} : void 0
|
|
79
|
+
});
|
|
80
|
+
for (const t of e.customOptions)
|
|
81
|
+
o.push({
|
|
82
|
+
label: t.label,
|
|
83
|
+
value: t.action,
|
|
84
|
+
icon: t.icon,
|
|
85
|
+
disabled: t.disabled,
|
|
86
|
+
data: { workbookCustomOption: t }
|
|
87
|
+
});
|
|
88
|
+
return o;
|
|
89
|
+
}), E = d(
|
|
90
|
+
() => e.showContextMenu && (x.value.length > 0 || !!I["sheet-actions"])
|
|
91
|
+
), S = (o) => {
|
|
92
|
+
const t = o.option?.data?.workbookCustomOption;
|
|
93
|
+
if (t) {
|
|
94
|
+
t.onClick(e.sheet);
|
|
95
|
+
return;
|
|
78
96
|
}
|
|
79
|
-
|
|
80
|
-
if (n.value === "rename" && h(), n.value === "duplicate" && o("duplicate", e.sheet.id), n.value === "delete") {
|
|
97
|
+
if (o.value === "rename" && g(), o.value === "duplicate" && e.canDuplicate && i("duplicate", e.sheet.id), o.value === "delete") {
|
|
81
98
|
if (!e.canDelete) return;
|
|
82
|
-
|
|
99
|
+
i("delete", e.sheet.id);
|
|
83
100
|
}
|
|
84
|
-
},
|
|
101
|
+
}, $ = d(() => [
|
|
85
102
|
"group relative flex items-center min-w-[120px] max-w-[240px] h-9 px-3 border-r border-border select-none cursor-pointer transition-all duration-200 ease-out",
|
|
86
103
|
e.itemClass,
|
|
87
104
|
e.isActive ? `bg-secondary text-foreground ring-1 ring-border ring-b-0 z-10 ${e.activeItemClass}` : `text-muted-foreground hover:bg-accent/50 ${e.inactiveItemClass}`,
|
|
88
105
|
e.isEditing ? "cursor-text" : ""
|
|
89
106
|
].filter(Boolean).join(" "));
|
|
90
|
-
return (
|
|
91
|
-
class:
|
|
92
|
-
onClick: t[
|
|
93
|
-
onDblclick:
|
|
107
|
+
return (o, t) => (r(), c("div", {
|
|
108
|
+
class: V($.value),
|
|
109
|
+
onClick: t[7] || (t[7] = (l) => i("select", n.sheet.id)),
|
|
110
|
+
onDblclick: g
|
|
94
111
|
}, [
|
|
95
|
-
|
|
96
|
-
onClick: t[1] || (t[1] =
|
|
112
|
+
m("div", {
|
|
113
|
+
onClick: t[1] || (t[1] = u(() => {
|
|
97
114
|
}, ["stop"])),
|
|
98
115
|
class: "mr-2 flex items-center shrink-0"
|
|
99
116
|
}, [
|
|
100
|
-
(
|
|
117
|
+
(n.sheet.icon || n.isEditing) && n.allowIconChange && n.canChangeIcon ? (r(), j(G, {
|
|
101
118
|
key: 0,
|
|
102
|
-
value:
|
|
119
|
+
value: n.sheet.icon || "lucide:file",
|
|
103
120
|
position: "bottom-start",
|
|
104
|
-
onOnSelect: t[0] || (t[0] = (
|
|
121
|
+
onOnSelect: t[0] || (t[0] = (l) => n.canChangeIcon && i("update:icon", n.sheet.id, l))
|
|
105
122
|
}, {
|
|
106
|
-
default:
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
icon:
|
|
123
|
+
default: b(() => [
|
|
124
|
+
m("button", H, [
|
|
125
|
+
f(D, {
|
|
126
|
+
icon: n.sheet.icon || "lucide:file",
|
|
110
127
|
class: "w-4 h-4 opacity-70 hover:opacity-100 transition-opacity"
|
|
111
128
|
}, null, 8, ["icon"])
|
|
112
129
|
])
|
|
113
130
|
]),
|
|
114
131
|
_: 1
|
|
115
|
-
}, 8, ["value"])) :
|
|
116
|
-
|
|
117
|
-
icon:
|
|
132
|
+
}, 8, ["value"])) : n.sheet.icon ? (r(), c("div", J, [
|
|
133
|
+
f(D, {
|
|
134
|
+
icon: n.sheet.icon,
|
|
118
135
|
class: "w-4 h-4 opacity-70"
|
|
119
136
|
}, null, 8, ["icon"])
|
|
120
|
-
])) :
|
|
137
|
+
])) : w("", !0)
|
|
121
138
|
]),
|
|
122
|
-
|
|
123
|
-
|
|
139
|
+
m("div", L, [
|
|
140
|
+
n.isEditing ? z((r(), c("input", {
|
|
124
141
|
key: 0,
|
|
125
142
|
ref_key: "inputRef",
|
|
126
|
-
ref:
|
|
127
|
-
"onUpdate:modelValue": t[2] || (t[2] = (
|
|
143
|
+
ref: p,
|
|
144
|
+
"onUpdate:modelValue": t[2] || (t[2] = (l) => a.value = l),
|
|
128
145
|
type: "text",
|
|
129
146
|
class: "w-full bg-transparent border-none outline-none p-0 text-sm font-medium text-foreground placeholder-muted-foreground focus:ring-0",
|
|
130
|
-
onBlur:
|
|
147
|
+
onBlur: y,
|
|
131
148
|
onKeydown: [
|
|
132
|
-
|
|
133
|
-
|
|
149
|
+
C(u(y, ["prevent"]), ["enter"]),
|
|
150
|
+
C(u(O, ["prevent"]), ["esc"])
|
|
134
151
|
],
|
|
135
|
-
onClick: t[3] || (t[3] =
|
|
152
|
+
onClick: t[3] || (t[3] = u(() => {
|
|
136
153
|
}, ["stop"]))
|
|
137
|
-
}, null, 40,
|
|
138
|
-
[
|
|
139
|
-
]) : (r(),
|
|
154
|
+
}, null, 40, Q)), [
|
|
155
|
+
[A, a.value]
|
|
156
|
+
]) : (r(), c("span", X, K(T.value), 1))
|
|
140
157
|
]),
|
|
141
|
-
|
|
158
|
+
E.value ? (r(), c("div", {
|
|
159
|
+
key: 0,
|
|
142
160
|
class: "opacity-0 group-hover:opacity-100 transition-opacity ml-auto pl-1 -mr-2 flex items-center",
|
|
143
|
-
onClick: t[
|
|
161
|
+
onClick: t[6] || (t[6] = u(() => {
|
|
144
162
|
}, ["stop"]))
|
|
145
163
|
}, [
|
|
146
|
-
|
|
147
|
-
|
|
164
|
+
f(N(q), {
|
|
165
|
+
"is-open": v.value,
|
|
166
|
+
"onUpdate:isOpen": t[5] || (t[5] = (l) => v.value = l),
|
|
167
|
+
options: x.value,
|
|
148
168
|
position: "bottom-end",
|
|
149
|
-
width:
|
|
169
|
+
width: n.menuWidth,
|
|
150
170
|
teleport: !0,
|
|
151
|
-
onOnSelect:
|
|
152
|
-
}, {
|
|
153
|
-
trigger:
|
|
154
|
-
|
|
171
|
+
onOnSelect: S
|
|
172
|
+
}, U({
|
|
173
|
+
trigger: b(() => [
|
|
174
|
+
f(F, {
|
|
155
175
|
icon: "lucide:more-vertical",
|
|
156
176
|
asIcon: "",
|
|
157
177
|
size: "xs",
|
|
@@ -159,12 +179,25 @@ const P = {
|
|
|
159
179
|
variant: "ghost"
|
|
160
180
|
})
|
|
161
181
|
]),
|
|
162
|
-
_:
|
|
163
|
-
},
|
|
164
|
-
|
|
182
|
+
_: 2
|
|
183
|
+
}, [
|
|
184
|
+
o.$slots["sheet-actions"] ? {
|
|
185
|
+
name: "footer",
|
|
186
|
+
fn: b(() => [
|
|
187
|
+
m("div", {
|
|
188
|
+
class: "border-t p-1 space-y-0.5",
|
|
189
|
+
onClickCapture: t[4] || (t[4] = (l) => v.value = !1)
|
|
190
|
+
}, [
|
|
191
|
+
W(o.$slots, "sheet-actions", { sheet: n.sheet })
|
|
192
|
+
], 32)
|
|
193
|
+
]),
|
|
194
|
+
key: "0"
|
|
195
|
+
} : void 0
|
|
196
|
+
]), 1032, ["is-open", "options", "width"])
|
|
197
|
+
])) : w("", !0)
|
|
165
198
|
], 34));
|
|
166
199
|
}
|
|
167
200
|
});
|
|
168
201
|
export {
|
|
169
|
-
|
|
202
|
+
se as default
|
|
170
203
|
};
|
|
@@ -3,6 +3,9 @@ declare function __VLS_template(): {
|
|
|
3
3
|
attrs: Partial<{}>;
|
|
4
4
|
slots: {
|
|
5
5
|
'left-addons'?(_: {}): any;
|
|
6
|
+
'sheet-actions'?(_: {
|
|
7
|
+
sheet: WorkbookSheet;
|
|
8
|
+
}): any;
|
|
6
9
|
'right-addons'?(_: {}): any;
|
|
7
10
|
default?(_: {}): any;
|
|
8
11
|
};
|
|
@@ -37,10 +40,17 @@ declare const __VLS_component: import('vue').DefineComponent<WorkbookProps, {},
|
|
|
37
40
|
modelValue: string;
|
|
38
41
|
editable: boolean;
|
|
39
42
|
confirmDelete: boolean;
|
|
43
|
+
canRename: boolean;
|
|
44
|
+
canDuplicate: boolean;
|
|
45
|
+
canDelete: boolean;
|
|
46
|
+
canChangeIcon: boolean;
|
|
47
|
+
customOptions: import('./types').WorkbookCustomOption[];
|
|
40
48
|
allowIconChange: boolean;
|
|
49
|
+
menuWidth: string;
|
|
41
50
|
activeItemClass: string;
|
|
42
51
|
inactiveItemClass: string;
|
|
43
52
|
sheets: WorkbookSheet[];
|
|
53
|
+
autoDelete: boolean;
|
|
44
54
|
addable: boolean;
|
|
45
55
|
addButtonPosition: AddButtonPosition;
|
|
46
56
|
maxSheets: number;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./Workbook2.vue.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import r from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const _ = /* @__PURE__ */ r(o, [["__scopeId", "data-v-42c2d8b9"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
_ as default
|
|
7
7
|
};
|