vlite3 1.2.13 → 1.2.14
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/Avatar.vue.js +14 -14
- package/components/Button.vue.js +3 -3
- package/components/CategoryManager/CategoryManager.vue.js +325 -203
- package/components/CategoryManager/CategoryNode.vue.js +91 -91
- package/components/CategoryManager/types.d.ts +41 -0
- package/components/Chat/ChatBubble.vue.js +1 -1
- package/components/Clipboard.vue.d.ts +1 -18
- package/components/Clipboard.vue.js +15 -23
- package/components/DataTable/DataTable.vue.js +2 -5
- package/components/Dropdown/DropdownItem.vue.js +1 -1
- package/components/Label.vue.js +4 -4
- package/components/MultiSelect/MultiSelect.vue.js +29 -27
- package/components/PermissionMatrix/PermissionEditorMatrix.vue.js +2 -2
- package/components/PermissionMatrix/PermissionEditorMatrix.vue2.js +17 -17
- package/components/Screen/ScreenFilter.vue.js +1 -1
- package/components/Workbook/Sheet.vue.js +63 -76
- package/package.json +1 -1
- package/style.css +25 -25
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as F, ref as V, computed as s, watch as E, openBlock as r, createBlock as f, unref as y, withCtx as d, createSlots as U, renderSlot as b, normalizeProps as q, guardReactiveProps as G, createCommentVNode as v, createElementVNode as p, withKeys as I, withModifiers as
|
|
1
|
+
import { defineComponent as F, ref as V, computed as s, watch as E, openBlock as r, createBlock as f, unref as y, withCtx as d, createSlots as U, renderSlot as b, normalizeProps as q, guardReactiveProps as G, createCommentVNode as v, createElementVNode as p, withKeys as I, withModifiers as x, normalizeClass as c, createElementBlock as h, toDisplayString as S, Fragment as T, renderList as J, createVNode as N, createTextVNode as Q } from "vue";
|
|
2
2
|
import M from "../Icon.vue.js";
|
|
3
3
|
import W from "../Dropdown/Dropdown.vue.js";
|
|
4
4
|
import X from "../Dropdown/DropdownMenu.vue.js";
|
|
@@ -43,9 +43,9 @@ const Z = ["tabindex", "data-testid"], _ = {
|
|
|
43
43
|
if (a.placeholder) return a.placeholder;
|
|
44
44
|
const e = C("vlite.multiSelect.placeholder");
|
|
45
45
|
return e !== "vlite.multiSelect.placeholder" ? e : "Select items...";
|
|
46
|
-
}),
|
|
46
|
+
}), w = s(() => a.options ? a.options.map((e) => typeof e == "string" || typeof e == "number" ? { label: String(e), value: String(e) } : e) : []), B = V(!1), $ = V(!1);
|
|
47
47
|
E(
|
|
48
|
-
|
|
48
|
+
w,
|
|
49
49
|
(e) => {
|
|
50
50
|
!B.value && e.length > 0 && (B.value = !0, setTimeout(() => {
|
|
51
51
|
$.value = !0, u.hydrateSelected(a.modelValue || []);
|
|
@@ -54,9 +54,9 @@ const Z = ["tabindex", "data-testid"], _ = {
|
|
|
54
54
|
{ immediate: !0 }
|
|
55
55
|
);
|
|
56
56
|
const k = s(() => {
|
|
57
|
-
const e = [...
|
|
58
|
-
return u.selectedBuffer.value.forEach((n,
|
|
59
|
-
l.has(
|
|
57
|
+
const e = [...w.value], l = new Set(e.map((n) => n.value ?? n.label));
|
|
58
|
+
return u.selectedBuffer.value.forEach((n, m) => {
|
|
59
|
+
l.has(m) || (e.unshift(n), l.add(m));
|
|
60
60
|
}), e;
|
|
61
61
|
}), u = Y({
|
|
62
62
|
fetchSelected: a.fetchSelected,
|
|
@@ -71,15 +71,15 @@ const Z = ["tabindex", "data-testid"], _ = {
|
|
|
71
71
|
},
|
|
72
72
|
{ deep: !0 }
|
|
73
73
|
);
|
|
74
|
-
const
|
|
74
|
+
const g = s(() => k.value.filter((e) => {
|
|
75
75
|
const l = e.value ?? e.label;
|
|
76
76
|
return a.modelValue.includes(l);
|
|
77
|
-
})), P = s(() =>
|
|
77
|
+
})), P = s(() => g.value.slice(0, a.maxVisible)), O = s(() => g.value.length - a.maxVisible), H = (e) => {
|
|
78
78
|
if (a.disabled || a.readonly) return;
|
|
79
79
|
const l = e.value ?? e.label;
|
|
80
80
|
u.selectedBuffer.value.has(l) || u.selectedBuffer.value.set(l, e);
|
|
81
|
-
const n = [...a.modelValue],
|
|
82
|
-
|
|
81
|
+
const n = [...a.modelValue], m = n.indexOf(l);
|
|
82
|
+
m === -1 ? n.push(l) : n.splice(m, 1), i("update:modelValue", n), i("change", n);
|
|
83
83
|
}, K = (e) => {
|
|
84
84
|
if (a.disabled || a.readonly) return;
|
|
85
85
|
const l = a.modelValue.filter((n) => n !== e);
|
|
@@ -102,39 +102,41 @@ const Z = ["tabindex", "data-testid"], _ = {
|
|
|
102
102
|
selectable: !0,
|
|
103
103
|
searchable: !1,
|
|
104
104
|
remote: !1,
|
|
105
|
+
"class-name": "max-h-full! px-0! py-0!",
|
|
106
|
+
"max-height": "100%",
|
|
105
107
|
disabled: t.disabled || t.readonly
|
|
106
108
|
}, {
|
|
107
109
|
trigger: d(() => [
|
|
108
110
|
p("div", {
|
|
109
|
-
class:
|
|
111
|
+
class: c(A.value),
|
|
110
112
|
tabindex: t.disabled || t.readonly ? -1 : 0,
|
|
111
113
|
onKeydown: [
|
|
112
|
-
l[0] || (l[0] = I(
|
|
113
|
-
l[1] || (l[1] = I(
|
|
114
|
+
l[0] || (l[0] = I(x((n) => !(t.disabled || t.readonly) && (o.value = !o.value), ["prevent"]), ["enter"])),
|
|
115
|
+
l[1] || (l[1] = I(x((n) => !(t.disabled || t.readonly) && (o.value = !o.value), ["prevent"]), ["space"]))
|
|
114
116
|
],
|
|
115
117
|
"data-testid": e.$attrs["data-testid"] || (e.$attrs.name ? `multiselect-${e.$attrs.name}` : "multiselect")
|
|
116
118
|
}, [
|
|
117
119
|
p("div", {
|
|
118
|
-
class:
|
|
120
|
+
class: c(["flex gap-1.5 items-center flex-1 min-w-0", [t.wrap ? "flex-wrap py-0.5" : "flex-nowrap overflow-hidden py-1"]])
|
|
119
121
|
}, [
|
|
120
|
-
|
|
121
|
-
(r(!0),
|
|
122
|
+
g.value.length === 0 ? (r(), h("span", _, S(D.value), 1)) : (r(), h(T, { key: 1 }, [
|
|
123
|
+
(r(!0), h(T, null, J(P.value, (n) => (r(), f(L, {
|
|
122
124
|
key: n.value,
|
|
123
125
|
variant: t.variant === "transparent" ? "outline" : "secondary",
|
|
124
126
|
size: z.value,
|
|
125
127
|
rounded: t.rounded === "none" ? "sm" : "full",
|
|
126
|
-
class:
|
|
128
|
+
class: c(["gap-1 pr-1 truncate min-w-0 shrink", [
|
|
127
129
|
t.wrap ? "max-w-[150px]" : "",
|
|
128
130
|
t.variant === "transparent" ? "border-transparent bg-muted/50 text-foreground font-medium shadow-none" : ""
|
|
129
131
|
]])
|
|
130
132
|
}, {
|
|
131
133
|
default: d(() => [
|
|
132
134
|
p("span", ee, S(n.labelI18n ? y(C)(n.labelI18n) : n.label), 1),
|
|
133
|
-
t.disabled || t.readonly ? v("", !0) : (r(),
|
|
135
|
+
t.disabled || t.readonly ? v("", !0) : (r(), h("button", {
|
|
134
136
|
key: 0,
|
|
135
137
|
type: "button",
|
|
136
|
-
onClick:
|
|
137
|
-
class:
|
|
138
|
+
onClick: x((m) => K(n.value), ["stop"]),
|
|
139
|
+
class: c([
|
|
138
140
|
"rounded transition-colors shrink-0 flex items-center justify-center p-px",
|
|
139
141
|
t.variant === "transparent" ? "text-muted-foreground hover:bg-black/10 hover:text-foreground" : "hover:bg-destructive/10 hover:text-destructive p-0.5 rounded-full"
|
|
140
142
|
])
|
|
@@ -152,7 +154,7 @@ const Z = ["tabindex", "data-testid"], _ = {
|
|
|
152
154
|
variant: t.variant === "transparent" ? "outline" : "secondary",
|
|
153
155
|
size: z.value,
|
|
154
156
|
rounded: t.rounded === "none" ? "sm" : "full",
|
|
155
|
-
class:
|
|
157
|
+
class: c([
|
|
156
158
|
"shrink-0",
|
|
157
159
|
t.variant === "transparent" ? "border-transparent bg-muted/50 text-muted-foreground font-medium shadow-none" : ""
|
|
158
160
|
])
|
|
@@ -164,17 +166,17 @@ const Z = ["tabindex", "data-testid"], _ = {
|
|
|
164
166
|
}, 8, ["variant", "size", "rounded", "class"])) : v("", !0)
|
|
165
167
|
], 64))
|
|
166
168
|
], 2),
|
|
167
|
-
t.showControls && !(t.disabled || t.readonly) ? (r(),
|
|
168
|
-
|
|
169
|
+
t.showControls && !(t.disabled || t.readonly) ? (r(), h("div", ae, [
|
|
170
|
+
g.value.length > 0 && !(t.disabled || t.readonly) ? (r(), f(M, {
|
|
169
171
|
key: 0,
|
|
170
172
|
icon: "lucide:x",
|
|
171
173
|
class: "w-4 h-4 hover:text-foreground transition-colors",
|
|
172
|
-
onClick:
|
|
174
|
+
onClick: x(R, ["stop"])
|
|
173
175
|
})) : v("", !0),
|
|
174
176
|
l[6] || (l[6] = p("div", { class: "w-px h-4 bg-border mx-0.5" }, null, -1)),
|
|
175
177
|
N(M, {
|
|
176
178
|
icon: "lucide:chevron-down",
|
|
177
|
-
class:
|
|
179
|
+
class: c(["w-4 h-4 transition-transform duration-200", { "rotate-180": o.value }])
|
|
178
180
|
}, null, 8, ["class"])
|
|
179
181
|
])) : v("", !0)
|
|
180
182
|
], 42, Z)
|
|
@@ -182,12 +184,12 @@ const Z = ["tabindex", "data-testid"], _ = {
|
|
|
182
184
|
default: d(() => [
|
|
183
185
|
t.disabled || t.readonly ? v("", !0) : (r(), f(y(X), {
|
|
184
186
|
key: 0,
|
|
185
|
-
options:
|
|
187
|
+
options: w.value,
|
|
186
188
|
cachedOptions: k.value,
|
|
187
189
|
selected: t.modelValue,
|
|
188
190
|
emptyMessage: t.emptyMessage,
|
|
189
191
|
searchEmptyMessage: t.searchEmptyMessage,
|
|
190
|
-
class: "min-w-[
|
|
192
|
+
class: "min-w-[250px] -mx-0.5 px-2 mt-0.5",
|
|
191
193
|
loading: t.loading || y(u).isHydrating.value,
|
|
192
194
|
hasMore: t.hasMore,
|
|
193
195
|
searchable: t.searchable,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./PermissionEditorMatrix.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import r from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const s = /* @__PURE__ */ r(o, [["__scopeId", "data-v-e8bfdc18"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
s as default
|
|
7
7
|
};
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as w, computed as C, openBlock as s, createElementBlock as a, createVNode as N, createElementVNode as n, normalizeClass as d, normalizeStyle as I, Fragment as f, renderList as h, toDisplayString as G, withMemo as J, unref as y, createBlock as m, createCommentVNode as b, withModifiers as O, isMemoSame as Q, withCtx as R } from "vue";
|
|
2
2
|
import j from "../CheckBox.vue.js";
|
|
3
3
|
import A from "../Switch.vue.js";
|
|
4
4
|
import g from "../Icon.vue.js";
|
|
5
|
-
import
|
|
5
|
+
import U from "../Tooltip.vue.js";
|
|
6
6
|
import { isActionEnabled as M, getMatrixPermKey as H } from "./utils.js";
|
|
7
|
-
import { usePermissionState as
|
|
8
|
-
const
|
|
7
|
+
import { usePermissionState as W } from "./usePermissionState.js";
|
|
8
|
+
const X = {
|
|
9
9
|
key: 0,
|
|
10
10
|
class: "text-center py-12 text-muted-foreground"
|
|
11
|
-
},
|
|
11
|
+
}, Y = { class: "custom-table" }, Z = ["colspan"], K = { class: "flex items-center justify-between" }, _ = { class: "flex items-center gap-2" }, ee = ["onClick"], te = { class: "custom-td" }, le = { class: "flex items-center gap-2 pl-6" }, se = ["onClick"], oe = {
|
|
12
12
|
key: 0,
|
|
13
13
|
class: "flex items-center justify-center"
|
|
14
14
|
}, ne = {
|
|
15
15
|
key: 1,
|
|
16
16
|
class: "flex items-center justify-center pointer-events-none"
|
|
17
|
-
}, ke = /* @__PURE__ */
|
|
17
|
+
}, ke = /* @__PURE__ */ w({
|
|
18
18
|
__name: "PermissionEditorMatrix",
|
|
19
19
|
props: {
|
|
20
20
|
matrixGroups: {},
|
|
@@ -28,7 +28,7 @@ const Y = {
|
|
|
28
28
|
},
|
|
29
29
|
emits: ["update:modelValue", "toggleCollapse"],
|
|
30
30
|
setup(t, { emit: D }) {
|
|
31
|
-
const r = t, V = D, { hasPerm: S, getMatrixGroupState: v, toggleMatrixGroup: F } =
|
|
31
|
+
const r = t, V = D, { hasPerm: S, getMatrixGroupState: v, toggleMatrixGroup: F } = W(
|
|
32
32
|
() => r.modelValue
|
|
33
33
|
), k = C(() => r.size === "sm" ? "text-xs" : "text-sm"), L = C(() => ({
|
|
34
34
|
"--cell-py": r.size === "sm" ? "0.5rem" : "0.625rem",
|
|
@@ -54,7 +54,7 @@ const Y = {
|
|
|
54
54
|
function q(i) {
|
|
55
55
|
r.readonly || V("update:modelValue", F(i));
|
|
56
56
|
}
|
|
57
|
-
return (i, o) => t.matrixGroups.length === 0 ? (s(), a("div",
|
|
57
|
+
return (i, o) => t.matrixGroups.length === 0 ? (s(), a("div", X, [
|
|
58
58
|
N(g, {
|
|
59
59
|
icon: "lucide:search-x",
|
|
60
60
|
class: "w-8 h-8 mx-auto mb-3 opacity-50"
|
|
@@ -64,10 +64,10 @@ const Y = {
|
|
|
64
64
|
}, "No permissions match your filters.", 2)
|
|
65
65
|
])) : (s(), a("div", {
|
|
66
66
|
key: 1,
|
|
67
|
-
class: "permission-matrix-wrapper",
|
|
68
|
-
style:
|
|
67
|
+
class: "permission-matrix-wrapper scrollbar-thin always-scroll",
|
|
68
|
+
style: I(L.value)
|
|
69
69
|
}, [
|
|
70
|
-
n("table",
|
|
70
|
+
n("table", Y, [
|
|
71
71
|
n("thead", {
|
|
72
72
|
class: d(t.stickyHeader ? "custom-sticky-header" : "")
|
|
73
73
|
}, [
|
|
@@ -85,7 +85,7 @@ const Y = {
|
|
|
85
85
|
(s(!0), a(f, null, h(t.matrixGroups, (e) => (s(), a(f, {
|
|
86
86
|
key: e.key
|
|
87
87
|
}, [
|
|
88
|
-
|
|
88
|
+
J([
|
|
89
89
|
t.collapsedGroups.has(e.key),
|
|
90
90
|
y(v)(e),
|
|
91
91
|
t.readonly,
|
|
@@ -124,7 +124,7 @@ const Y = {
|
|
|
124
124
|
]),
|
|
125
125
|
n("div", {
|
|
126
126
|
class: "flex items-center",
|
|
127
|
-
onClick:
|
|
127
|
+
onClick: O((l) => q(e), ["stop"])
|
|
128
128
|
}, [
|
|
129
129
|
t.toggleMode === "checkbox" ? (s(), m(j, {
|
|
130
130
|
key: 0,
|
|
@@ -141,7 +141,7 @@ const Y = {
|
|
|
141
141
|
}, null, 8, ["model-value", "disabled"]))
|
|
142
142
|
], 8, ee)
|
|
143
143
|
])
|
|
144
|
-
], 8,
|
|
144
|
+
], 8, Z)
|
|
145
145
|
], 8, ["onClick"])), o, 0),
|
|
146
146
|
t.collapsedGroups.has(e.key) ? b("", !0) : (s(!0), a(f, { key: 0 }, h(e.rows, (l, p, P, x) => {
|
|
147
147
|
const B = [
|
|
@@ -153,7 +153,7 @@ const Y = {
|
|
|
153
153
|
l.description,
|
|
154
154
|
u.value.length
|
|
155
155
|
];
|
|
156
|
-
if (x && x.key === e.key + "-" + l.key &&
|
|
156
|
+
if (x && x.key === e.key + "-" + l.key && Q(x, B)) return x;
|
|
157
157
|
const E = (s(), a("tr", {
|
|
158
158
|
key: e.key + "-" + l.key,
|
|
159
159
|
class: "custom-entity-row"
|
|
@@ -164,12 +164,12 @@ const Y = {
|
|
|
164
164
|
class: d([k.value]),
|
|
165
165
|
style: { color: "var(--color-foreground)" }
|
|
166
166
|
}, G(l.label), 3),
|
|
167
|
-
l.description ? (s(), m(
|
|
167
|
+
l.description ? (s(), m(U, {
|
|
168
168
|
key: 0,
|
|
169
169
|
content: l.description,
|
|
170
170
|
placement: "top"
|
|
171
171
|
}, {
|
|
172
|
-
default:
|
|
172
|
+
default: R(() => [
|
|
173
173
|
N(g, {
|
|
174
174
|
icon: "lucide:info",
|
|
175
175
|
class: "w-3 h-3 cursor-auto shrink-0",
|
|
@@ -127,7 +127,7 @@ const N = { class: "text-gray-800! h-4! w-4! flex items-center justify-center" }
|
|
|
127
127
|
"onUpdate:isOpen": t[4] || (t[4] = (c) => s.value = c),
|
|
128
128
|
"close-on-select": !1,
|
|
129
129
|
position: "bottom-end",
|
|
130
|
-
maxHeight: "
|
|
130
|
+
maxHeight: "400px",
|
|
131
131
|
"class-name": "pb-0! always-scroll",
|
|
132
132
|
class: "w-auto"
|
|
133
133
|
}, {
|
|
@@ -1,23 +1,21 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { $t as
|
|
1
|
+
import { defineComponent as I, ref as b, computed as v, openBlock as a, createElementBlock as d, normalizeClass as $, createElementVNode as u, withModifiers as r, createBlock as S, withCtx as x, createVNode as m, createCommentVNode as V, withDirectives as j, withKeys as g, vModelText as z, toDisplayString as K, unref as M, nextTick as N } from "vue";
|
|
2
|
+
import y from "../Icon.vue.js";
|
|
3
|
+
import O from "../Dropdown/Dropdown.vue.js";
|
|
4
|
+
import { $t as l } from "../../utils/i18n.js";
|
|
5
5
|
/* empty css */
|
|
6
6
|
/* empty css */
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
const
|
|
7
|
+
import R from "../Button.vue.js";
|
|
8
|
+
import A from "../IconPicker.vue.js";
|
|
9
|
+
const U = {
|
|
10
10
|
type: "button",
|
|
11
11
|
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 mt-1"
|
|
12
|
-
},
|
|
12
|
+
}, q = {
|
|
13
13
|
key: 1,
|
|
14
14
|
class: "flex items-center justify-center p-0.5"
|
|
15
|
-
},
|
|
15
|
+
}, F = { class: "flex-1 min-w-0 pr-1" }, G = ["onKeydown"], H = {
|
|
16
16
|
key: 1,
|
|
17
17
|
class: "block truncate text-sm font-medium leading-normal"
|
|
18
|
-
},
|
|
19
|
-
class: /* @__PURE__ */ T(["flex items-center"])
|
|
20
|
-
}, te = /* @__PURE__ */ N({
|
|
18
|
+
}, _ = /* @__PURE__ */ I({
|
|
21
19
|
__name: "Sheet",
|
|
22
20
|
props: {
|
|
23
21
|
sheet: {},
|
|
@@ -32,40 +30,39 @@ const q = {
|
|
|
32
30
|
inactiveItemClass: { default: "" }
|
|
33
31
|
},
|
|
34
32
|
emits: ["select", "update:title", "update:icon", "edit-start", "edit-end", "duplicate", "delete"],
|
|
35
|
-
setup(i, { emit:
|
|
36
|
-
const e = i, o =
|
|
37
|
-
() => e.sheet.titleI18n ?
|
|
38
|
-
),
|
|
39
|
-
|
|
33
|
+
setup(i, { emit: w }) {
|
|
34
|
+
const e = i, o = w, f = b(null), s = b(e.sheet.title), C = v(
|
|
35
|
+
() => e.sheet.titleI18n ? l(e.sheet.titleI18n) : e.sheet.title
|
|
36
|
+
), h = () => {
|
|
37
|
+
s.value = e.sheet.title, o("edit-start", e.sheet.id), N(() => {
|
|
40
38
|
f.value?.focus(), f.value?.select();
|
|
41
39
|
});
|
|
42
40
|
};
|
|
43
|
-
let
|
|
44
|
-
const
|
|
45
|
-
if (!e.isEditing ||
|
|
46
|
-
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
|
|
41
|
+
let p = !1;
|
|
42
|
+
const k = () => {
|
|
43
|
+
if (!e.isEditing || p) return;
|
|
44
|
+
p = !0;
|
|
45
|
+
const n = s.value.trim();
|
|
46
|
+
n ? o("update:title", e.sheet.id, n) : s.value = e.sheet.title, o("edit-end", e.sheet.id), setTimeout(() => {
|
|
47
|
+
p = !1;
|
|
50
48
|
}, 100);
|
|
51
|
-
},
|
|
52
|
-
|
|
53
|
-
},
|
|
49
|
+
}, D = () => {
|
|
50
|
+
s.value = e.sheet.title, o("edit-end", e.sheet.id);
|
|
51
|
+
}, T = v(() => [
|
|
54
52
|
{
|
|
55
|
-
label:
|
|
53
|
+
label: l("vlite.workbook.rename") !== "vlite.workbook.rename" ? l("vlite.workbook.rename") : "Rename",
|
|
56
54
|
value: "rename",
|
|
57
55
|
icon: "lucide:pencil"
|
|
58
56
|
},
|
|
59
57
|
{
|
|
60
|
-
label:
|
|
58
|
+
label: l("vlite.workbook.duplicate") !== "vlite.workbook.duplicate" ? l("vlite.workbook.duplicate") : "Duplicate",
|
|
61
59
|
value: "duplicate",
|
|
62
60
|
icon: "lucide:copy"
|
|
63
61
|
},
|
|
64
62
|
{
|
|
65
|
-
label:
|
|
63
|
+
label: l("vlite.workbook.delete") !== "vlite.workbook.delete" ? l("vlite.workbook.delete") : "Delete",
|
|
66
64
|
value: "delete",
|
|
67
65
|
icon: "lucide:trash-2",
|
|
68
|
-
class: "text-danger",
|
|
69
66
|
disabled: !e.canDelete,
|
|
70
67
|
confirmation: e.confirmDelete ? {
|
|
71
68
|
title: e.confirmDeleteTexts?.title,
|
|
@@ -78,82 +75,82 @@ const q = {
|
|
|
78
75
|
}
|
|
79
76
|
} : void 0
|
|
80
77
|
}
|
|
81
|
-
]),
|
|
82
|
-
if (
|
|
78
|
+
]), B = (n) => {
|
|
79
|
+
if (n.value === "rename" && h(), n.value === "duplicate" && o("duplicate", e.sheet.id), n.value === "delete") {
|
|
83
80
|
if (!e.canDelete) return;
|
|
84
81
|
o("delete", e.sheet.id);
|
|
85
82
|
}
|
|
86
|
-
},
|
|
83
|
+
}, E = v(() => [
|
|
87
84
|
"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",
|
|
88
85
|
e.itemClass,
|
|
89
86
|
e.isActive ? `bg-muted text-foreground ring-1 ring-border ring-b-0 z-10 ${e.activeItemClass}` : `text-muted-foreground hover:bg-accent/50 ${e.inactiveItemClass}`,
|
|
90
87
|
e.isEditing ? "cursor-text" : ""
|
|
91
88
|
].filter(Boolean).join(" "));
|
|
92
|
-
return (
|
|
93
|
-
class:
|
|
94
|
-
onClick: t[5] || (t[5] = (
|
|
95
|
-
onDblclick:
|
|
89
|
+
return (n, t) => (a(), d("div", {
|
|
90
|
+
class: $(E.value),
|
|
91
|
+
onClick: t[5] || (t[5] = (c) => o("select", i.sheet.id)),
|
|
92
|
+
onDblclick: h
|
|
96
93
|
}, [
|
|
97
|
-
|
|
98
|
-
onClick: t[1] || (t[1] =
|
|
94
|
+
u("div", {
|
|
95
|
+
onClick: t[1] || (t[1] = r(() => {
|
|
99
96
|
}, ["stop"])),
|
|
100
97
|
class: "mr-2 flex items-center shrink-0"
|
|
101
98
|
}, [
|
|
102
|
-
(i.sheet.icon || i.isEditing) && i.allowIconChange ? (
|
|
99
|
+
(i.sheet.icon || i.isEditing) && i.allowIconChange ? (a(), S(A, {
|
|
103
100
|
key: 0,
|
|
104
101
|
value: i.sheet.icon || "lucide:file",
|
|
105
102
|
position: "bottom-start",
|
|
106
|
-
onOnSelect: t[0] || (t[0] = (
|
|
103
|
+
onOnSelect: t[0] || (t[0] = (c) => o("update:icon", i.sheet.id, c))
|
|
107
104
|
}, {
|
|
108
|
-
default:
|
|
109
|
-
|
|
110
|
-
m(
|
|
105
|
+
default: x(() => [
|
|
106
|
+
u("button", U, [
|
|
107
|
+
m(y, {
|
|
111
108
|
icon: i.sheet.icon || "lucide:file",
|
|
112
109
|
class: "w-4 h-4 opacity-70 hover:opacity-100 transition-opacity"
|
|
113
110
|
}, null, 8, ["icon"])
|
|
114
111
|
])
|
|
115
112
|
]),
|
|
116
113
|
_: 1
|
|
117
|
-
}, 8, ["value"])) : i.sheet.icon ? (
|
|
118
|
-
m(
|
|
114
|
+
}, 8, ["value"])) : i.sheet.icon ? (a(), d("div", q, [
|
|
115
|
+
m(y, {
|
|
119
116
|
icon: i.sheet.icon,
|
|
120
117
|
class: "w-4 h-4 opacity-70"
|
|
121
118
|
}, null, 8, ["icon"])
|
|
122
|
-
])) :
|
|
119
|
+
])) : V("", !0)
|
|
123
120
|
]),
|
|
124
|
-
|
|
125
|
-
i.isEditing ? j((
|
|
121
|
+
u("div", F, [
|
|
122
|
+
i.isEditing ? j((a(), d("input", {
|
|
126
123
|
key: 0,
|
|
127
124
|
ref_key: "inputRef",
|
|
128
125
|
ref: f,
|
|
129
|
-
"onUpdate:modelValue": t[2] || (t[2] = (
|
|
126
|
+
"onUpdate:modelValue": t[2] || (t[2] = (c) => s.value = c),
|
|
130
127
|
type: "text",
|
|
131
128
|
class: "w-full bg-transparent border-none outline-none p-0 text-sm font-medium text-foreground placeholder-muted-foreground focus:ring-0",
|
|
132
|
-
onBlur:
|
|
129
|
+
onBlur: k,
|
|
133
130
|
onKeydown: [
|
|
134
|
-
|
|
135
|
-
|
|
131
|
+
g(r(k, ["prevent"]), ["enter"]),
|
|
132
|
+
g(r(D, ["prevent"]), ["esc"])
|
|
136
133
|
],
|
|
137
|
-
onClick: t[3] || (t[3] =
|
|
134
|
+
onClick: t[3] || (t[3] = r(() => {
|
|
138
135
|
}, ["stop"]))
|
|
139
|
-
}, null, 40,
|
|
140
|
-
[z,
|
|
141
|
-
]) : (
|
|
136
|
+
}, null, 40, G)), [
|
|
137
|
+
[z, s.value]
|
|
138
|
+
]) : (a(), d("span", H, K(C.value), 1))
|
|
142
139
|
]),
|
|
143
|
-
|
|
140
|
+
u("div", {
|
|
144
141
|
class: "opacity-0 group-hover:opacity-100 transition-opacity ml-auto pl-1 -mr-2 flex items-center",
|
|
145
|
-
onClick: t[4] || (t[4] =
|
|
142
|
+
onClick: t[4] || (t[4] = r(() => {
|
|
146
143
|
}, ["stop"]))
|
|
147
144
|
}, [
|
|
148
|
-
m(
|
|
149
|
-
options:
|
|
145
|
+
m(M(O), {
|
|
146
|
+
options: T.value,
|
|
150
147
|
position: "bottom-end",
|
|
151
148
|
width: "140px",
|
|
152
149
|
teleport: !0,
|
|
153
|
-
onOnSelect:
|
|
150
|
+
onOnSelect: B
|
|
154
151
|
}, {
|
|
155
|
-
trigger:
|
|
156
|
-
m(
|
|
152
|
+
trigger: x(() => [
|
|
153
|
+
m(R, {
|
|
157
154
|
icon: "lucide:more-vertical",
|
|
158
155
|
asIcon: "",
|
|
159
156
|
size: "xs",
|
|
@@ -161,16 +158,6 @@ const q = {
|
|
|
161
158
|
variant: "ghost"
|
|
162
159
|
})
|
|
163
160
|
]),
|
|
164
|
-
item: h(({ option: n }) => [
|
|
165
|
-
c("div", L, [
|
|
166
|
-
n?.icon ? (r(), y(k, {
|
|
167
|
-
key: 0,
|
|
168
|
-
icon: n?.icon,
|
|
169
|
-
class: "w-3.5 h-3.5 mr-2 opacity-70"
|
|
170
|
-
}, null, 8, ["icon"])) : w("", !0),
|
|
171
|
-
M(" " + D(n?.label), 1)
|
|
172
|
-
])
|
|
173
|
-
]),
|
|
174
161
|
_: 1
|
|
175
162
|
}, 8, ["options"])
|
|
176
163
|
])
|
|
@@ -178,5 +165,5 @@ const q = {
|
|
|
178
165
|
}
|
|
179
166
|
});
|
|
180
167
|
export {
|
|
181
|
-
|
|
168
|
+
_ as default
|
|
182
169
|
};
|