vlite3 1.5.18 → 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.
@@ -23,7 +23,7 @@ import "iconify-icon-picker/style.css";
23
23
  import "../../icons/IconRegistry.js";
24
24
  /* empty css */
25
25
  /* empty css */
26
- /* empty css */
26
+ /* empty css */
27
27
  /* empty css */
28
28
  /* empty css */
29
29
  /* empty css */
@@ -6,6 +6,7 @@ interface Props {
6
6
  canRename?: boolean;
7
7
  canDuplicate?: boolean;
8
8
  canDelete?: boolean;
9
+ showContextMenu?: boolean;
9
10
  customOptions?: WorkbookCustomOption[];
10
11
  confirmDelete?: boolean;
11
12
  confirmDeleteTexts?: {
@@ -16,6 +17,8 @@ interface Props {
16
17
  };
17
18
  allowIconChange?: boolean;
18
19
  canChangeIcon?: boolean;
20
+ /** Width of the sheet context-menu dropdown. */
21
+ menuWidth?: string;
19
22
  itemClass?: string;
20
23
  activeItemClass?: string;
21
24
  inactiveItemClass?: string;
@@ -57,8 +60,10 @@ declare const __VLS_component: import('vue').DefineComponent<Props, {}, {}, {},
57
60
  canDuplicate: boolean;
58
61
  canDelete: boolean;
59
62
  canChangeIcon: boolean;
63
+ showContextMenu: boolean;
60
64
  customOptions: WorkbookCustomOption[];
61
65
  allowIconChange: boolean;
66
+ menuWidth: string;
62
67
  activeItemClass: string;
63
68
  inactiveItemClass: string;
64
69
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
@@ -1,7 +1,7 @@
1
- import { defineComponent as $, useSlots as R, ref as y, computed as d, openBlock as a, createElementBlock as c, normalizeClass as M, createElementVNode as v, withModifiers as r, createBlock as V, withCtx as h, createVNode as m, createCommentVNode as x, withDirectives as j, withKeys as w, vModelText as z, toDisplayString as A, unref as K, createSlots as N, renderSlot as P, nextTick as U } from "vue";
2
- import C from "../Icon.vue.js";
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
3
  import q from "../Dropdown/Dropdown.vue.js";
4
- import { $t as l } from "../../utils/i18n.js";
4
+ import { $t as s } from "../../utils/i18n.js";
5
5
  /* empty css */
6
6
  /* empty css */
7
7
  /* empty css */
@@ -9,14 +9,14 @@ import F from "../Button.vue.js";
9
9
  import G from "../IconPicker.vue.js";
10
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 mt-1"
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
13
  }, J = {
14
14
  key: 1,
15
15
  class: "flex items-center justify-center p-0.5"
16
- }, L = { class: "flex-1 min-w-0 pr-1" }, Q = ["onKeydown"], W = {
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
- }, le = /* @__PURE__ */ $({
19
+ }, se = /* @__PURE__ */ M({
20
20
  __name: "Sheet",
21
21
  props: {
22
22
  sheet: {},
@@ -25,46 +25,48 @@ const H = {
25
25
  canRename: { type: Boolean, default: !0 },
26
26
  canDuplicate: { type: Boolean, default: !0 },
27
27
  canDelete: { type: Boolean, default: !0 },
28
+ showContextMenu: { type: Boolean, default: !0 },
28
29
  customOptions: { default: () => [] },
29
30
  confirmDelete: { type: Boolean, default: !1 },
30
31
  confirmDeleteTexts: {},
31
32
  allowIconChange: { type: Boolean, default: !0 },
32
33
  canChangeIcon: { type: Boolean, default: !0 },
34
+ menuWidth: { default: "140px" },
33
35
  itemClass: { default: "" },
34
36
  activeItemClass: { default: "" },
35
37
  inactiveItemClass: { default: "" }
36
38
  },
37
39
  emits: ["select", "update:title", "update:icon", "edit-start", "edit-end", "duplicate", "delete"],
38
- setup(i, { emit: D }) {
39
- const e = i, n = D, B = R(), f = y(null), s = y(e.sheet.title), I = d(
40
- () => e.sheet.titleI18n ? l(e.sheet.titleI18n) : e.sheet.title
41
- ), k = () => {
42
- e.canRename && (s.value = e.sheet.title, n("edit-start", e.sheet.id), U(() => {
43
- f.value?.focus(), f.value?.select();
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();
44
46
  }));
45
47
  };
46
- let p = !1;
47
- const b = () => {
48
- if (!e.isEditing || p) return;
49
- p = !0;
50
- const o = s.value.trim();
51
- o ? n("update:title", e.sheet.id, o) : s.value = e.sheet.title, n("edit-end", e.sheet.id), setTimeout(() => {
52
- p = !1;
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;
53
55
  }, 100);
54
- }, T = () => {
55
- s.value = e.sheet.title, n("edit-end", e.sheet.id);
56
- }, g = d(() => {
56
+ }, O = () => {
57
+ a.value = e.sheet.title, i("edit-end", e.sheet.id);
58
+ }, x = d(() => {
57
59
  const o = [];
58
60
  e.canRename && o.push({
59
- label: l("vlite.workbook.rename") !== "vlite.workbook.rename" ? l("vlite.workbook.rename") : "Rename",
61
+ label: s("vlite.workbook.rename") !== "vlite.workbook.rename" ? s("vlite.workbook.rename") : "Rename",
60
62
  value: "rename",
61
63
  icon: "lucide:pencil"
62
64
  }), e.canDuplicate && o.push({
63
- label: l("vlite.workbook.duplicate") !== "vlite.workbook.duplicate" ? l("vlite.workbook.duplicate") : "Duplicate",
65
+ label: s("vlite.workbook.duplicate") !== "vlite.workbook.duplicate" ? s("vlite.workbook.duplicate") : "Duplicate",
64
66
  value: "duplicate",
65
67
  icon: "lucide:copy"
66
68
  }), e.canDelete && o.push({
67
- label: l("vlite.workbook.delete") !== "vlite.workbook.delete" ? l("vlite.workbook.delete") : "Delete",
69
+ label: s("vlite.workbook.delete") !== "vlite.workbook.delete" ? s("vlite.workbook.delete") : "Delete",
68
70
  value: "delete",
69
71
  icon: "lucide:trash-2",
70
72
  confirmation: e.confirmDelete ? {
@@ -85,89 +87,91 @@ const H = {
85
87
  });
86
88
  return o;
87
89
  }), E = d(
88
- () => g.value.length > 0 || !!B["sheet-actions"]
89
- ), O = (o) => {
90
+ () => e.showContextMenu && (x.value.length > 0 || !!I["sheet-actions"])
91
+ ), S = (o) => {
90
92
  const t = o.option?.data?.workbookCustomOption;
91
93
  if (t) {
92
94
  t.onClick(e.sheet);
93
95
  return;
94
96
  }
95
- if (o.value === "rename" && k(), o.value === "duplicate" && e.canDuplicate && n("duplicate", e.sheet.id), o.value === "delete") {
97
+ if (o.value === "rename" && g(), o.value === "duplicate" && e.canDuplicate && i("duplicate", e.sheet.id), o.value === "delete") {
96
98
  if (!e.canDelete) return;
97
- n("delete", e.sheet.id);
99
+ i("delete", e.sheet.id);
98
100
  }
99
- }, S = d(() => [
101
+ }, $ = d(() => [
100
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",
101
103
  e.itemClass,
102
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}`,
103
105
  e.isEditing ? "cursor-text" : ""
104
106
  ].filter(Boolean).join(" "));
105
- return (o, t) => (a(), c("div", {
106
- class: M(S.value),
107
- onClick: t[5] || (t[5] = (u) => n("select", i.sheet.id)),
108
- onDblclick: k
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
109
111
  }, [
110
- v("div", {
111
- onClick: t[1] || (t[1] = r(() => {
112
+ m("div", {
113
+ onClick: t[1] || (t[1] = u(() => {
112
114
  }, ["stop"])),
113
115
  class: "mr-2 flex items-center shrink-0"
114
116
  }, [
115
- (i.sheet.icon || i.isEditing) && i.allowIconChange && i.canChangeIcon ? (a(), V(G, {
117
+ (n.sheet.icon || n.isEditing) && n.allowIconChange && n.canChangeIcon ? (r(), j(G, {
116
118
  key: 0,
117
- value: i.sheet.icon || "lucide:file",
119
+ value: n.sheet.icon || "lucide:file",
118
120
  position: "bottom-start",
119
- onOnSelect: t[0] || (t[0] = (u) => i.canChangeIcon && n("update:icon", i.sheet.id, u))
121
+ onOnSelect: t[0] || (t[0] = (l) => n.canChangeIcon && i("update:icon", n.sheet.id, l))
120
122
  }, {
121
- default: h(() => [
122
- v("button", H, [
123
- m(C, {
124
- icon: i.sheet.icon || "lucide:file",
123
+ default: b(() => [
124
+ m("button", H, [
125
+ f(D, {
126
+ icon: n.sheet.icon || "lucide:file",
125
127
  class: "w-4 h-4 opacity-70 hover:opacity-100 transition-opacity"
126
128
  }, null, 8, ["icon"])
127
129
  ])
128
130
  ]),
129
131
  _: 1
130
- }, 8, ["value"])) : i.sheet.icon ? (a(), c("div", J, [
131
- m(C, {
132
- icon: i.sheet.icon,
132
+ }, 8, ["value"])) : n.sheet.icon ? (r(), c("div", J, [
133
+ f(D, {
134
+ icon: n.sheet.icon,
133
135
  class: "w-4 h-4 opacity-70"
134
136
  }, null, 8, ["icon"])
135
- ])) : x("", !0)
137
+ ])) : w("", !0)
136
138
  ]),
137
- v("div", L, [
138
- i.isEditing ? j((a(), c("input", {
139
+ m("div", L, [
140
+ n.isEditing ? z((r(), c("input", {
139
141
  key: 0,
140
142
  ref_key: "inputRef",
141
- ref: f,
142
- "onUpdate:modelValue": t[2] || (t[2] = (u) => s.value = u),
143
+ ref: p,
144
+ "onUpdate:modelValue": t[2] || (t[2] = (l) => a.value = l),
143
145
  type: "text",
144
146
  class: "w-full bg-transparent border-none outline-none p-0 text-sm font-medium text-foreground placeholder-muted-foreground focus:ring-0",
145
- onBlur: b,
147
+ onBlur: y,
146
148
  onKeydown: [
147
- w(r(b, ["prevent"]), ["enter"]),
148
- w(r(T, ["prevent"]), ["esc"])
149
+ C(u(y, ["prevent"]), ["enter"]),
150
+ C(u(O, ["prevent"]), ["esc"])
149
151
  ],
150
- onClick: t[3] || (t[3] = r(() => {
152
+ onClick: t[3] || (t[3] = u(() => {
151
153
  }, ["stop"]))
152
154
  }, null, 40, Q)), [
153
- [z, s.value]
154
- ]) : (a(), c("span", W, A(I.value), 1))
155
+ [A, a.value]
156
+ ]) : (r(), c("span", X, K(T.value), 1))
155
157
  ]),
156
- E.value ? (a(), c("div", {
158
+ E.value ? (r(), c("div", {
157
159
  key: 0,
158
160
  class: "opacity-0 group-hover:opacity-100 transition-opacity ml-auto pl-1 -mr-2 flex items-center",
159
- onClick: t[4] || (t[4] = r(() => {
161
+ onClick: t[6] || (t[6] = u(() => {
160
162
  }, ["stop"]))
161
163
  }, [
162
- m(K(q), {
163
- options: g.value,
164
+ f(N(q), {
165
+ "is-open": v.value,
166
+ "onUpdate:isOpen": t[5] || (t[5] = (l) => v.value = l),
167
+ options: x.value,
164
168
  position: "bottom-end",
165
- width: "140px",
169
+ width: n.menuWidth,
166
170
  teleport: !0,
167
- onOnSelect: O
168
- }, N({
169
- trigger: h(() => [
170
- m(F, {
171
+ onOnSelect: S
172
+ }, U({
173
+ trigger: b(() => [
174
+ f(F, {
171
175
  icon: "lucide:more-vertical",
172
176
  asIcon: "",
173
177
  size: "xs",
@@ -178,17 +182,22 @@ const H = {
178
182
  _: 2
179
183
  }, [
180
184
  o.$slots["sheet-actions"] ? {
181
- name: "menu",
182
- fn: h(() => [
183
- P(o.$slots, "sheet-actions", { sheet: i.sheet })
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)
184
193
  ]),
185
194
  key: "0"
186
195
  } : void 0
187
- ]), 1032, ["options"])
188
- ])) : x("", !0)
196
+ ]), 1032, ["is-open", "options", "width"])
197
+ ])) : w("", !0)
189
198
  ], 34));
190
199
  }
191
200
  });
192
201
  export {
193
- le as default
202
+ se as default
194
203
  };
@@ -46,6 +46,7 @@ declare const __VLS_component: import('vue').DefineComponent<WorkbookProps, {},
46
46
  canChangeIcon: boolean;
47
47
  customOptions: import('./types').WorkbookCustomOption[];
48
48
  allowIconChange: boolean;
49
+ menuWidth: string;
49
50
  activeItemClass: string;
50
51
  inactiveItemClass: string;
51
52
  sheets: WorkbookSheet[];
@@ -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 p = /* @__PURE__ */ r(o, [["__scopeId", "data-v-539da423"]]);
4
+ const _ = /* @__PURE__ */ r(o, [["__scopeId", "data-v-42c2d8b9"]]);
5
5
  export {
6
- p as default
6
+ _ as default
7
7
  };
@@ -1,12 +1,12 @@
1
- import { defineComponent as Y, ref as B, shallowRef as j, watch as F, openBlock as d, createElementBlock as c, createElementVNode as f, renderSlot as g, createCommentVNode as x, createVNode as b, unref as S, withCtx as V, Fragment as q, renderList as G, isMemoSame as H, createBlock as J, createSlots as K, normalizeClass as Q } from "vue";
2
- import { useScroll as X } from "@vueuse/core";
3
- import { VueDraggable as Z } from "vue-draggable-plus";
4
- import _ from "./Sheet.vue.js";
5
- import $ from "./WorkbookAddButton.vue.js";
6
- const ee = { class: "flex flex-col w-full font-sans" }, te = { class: "flex items-end w-full border-b px-1" }, le = {
1
+ import { defineComponent as j, ref as S, shallowRef as F, watch as q, openBlock as d, createElementBlock as c, createElementVNode as f, renderSlot as g, createCommentVNode as x, createVNode as b, unref as V, withCtx as $, Fragment as G, renderList as H, isMemoSame as J, createBlock as K, createSlots as Q, normalizeClass as X } from "vue";
2
+ import { useScroll as Z } from "@vueuse/core";
3
+ import { VueDraggable as _ } from "vue-draggable-plus";
4
+ import ee from "./Sheet.vue.js";
5
+ import E from "./WorkbookAddButton.vue.js";
6
+ const te = { class: "flex flex-col w-full font-sans" }, ne = { class: "flex items-end w-full border-b px-1" }, ae = {
7
7
  key: 0,
8
8
  class: "flex items-center"
9
- }, ae = { class: "flex items-center mb-0.5 z-20 sticky right-0 ml-auto box-decoration-clone" }, ne = { key: 0 }, oe = { key: 1 }, se = { class: "flex-1 relative bg-white w-full" }, fe = /* @__PURE__ */ Y({
9
+ }, le = { class: "flex items-center mb-0.5 z-20 sticky right-0 ml-auto box-decoration-clone" }, oe = { key: 0 }, se = { key: 1 }, ie = { class: "flex-1 relative bg-white w-full" }, me = /* @__PURE__ */ j({
10
10
  __name: "Workbook",
11
11
  props: {
12
12
  modelValue: { default: "" },
@@ -29,74 +29,75 @@ const ee = { class: "flex flex-col w-full font-sans" }, te = { class: "flex item
29
29
  inactiveItemClass: { default: "" },
30
30
  confirmDelete: { type: Boolean, default: !1 },
31
31
  confirmDeleteTexts: {},
32
+ menuWidth: { default: "140px" },
32
33
  allowIconChange: { type: Boolean, default: !0 }
33
34
  },
34
35
  emits: ["update:modelValue", "update:sheets", "change", "add", "delete", "duplicate", "edit-start", "edit-end"],
35
- setup(n, { emit: E }) {
36
- const a = n, s = E, m = B(null), u = B(null), { arrivedState: U } = X(m), i = j([...a.sheets]);
37
- F(
38
- () => [...a.sheets],
36
+ setup(a, { emit: U }) {
37
+ const l = a, s = U, m = S(null), u = S(null), { arrivedState: W } = Z(m), i = F([...l.sheets]);
38
+ q(
39
+ () => [...l.sheets],
39
40
  (e) => {
40
- let l = !1;
41
+ let n = !1;
41
42
  if (e.length !== i.value.length)
42
- l = !0;
43
+ n = !0;
43
44
  else
44
45
  for (let t = 0; t < e.length; t++)
45
46
  if (e[t] !== i.value[t] || e[t].id !== i.value[t].id) {
46
- l = !0;
47
+ n = !0;
47
48
  break;
48
49
  }
49
- l && (i.value = e);
50
+ n && (i.value = e);
50
51
  }
51
52
  );
52
53
  const A = (e) => {
53
54
  i.value = e, s("update:sheets", e);
54
- }, R = (e) => {
55
+ }, M = (e) => {
55
56
  s("update:modelValue", e), s("change", e);
56
57
  }, k = () => {
57
- a.sheets.length >= a.maxSheets || s("add");
58
- }, T = (e, l) => {
59
- const t = a.sheets.findIndex((o) => o.id === e);
60
- if (t !== -1 && v(a.sheets[t])) {
61
- const o = [...a.sheets];
62
- o[t] = { ...o[t], title: l }, s("update:sheets", o);
58
+ l.sheets.length >= l.maxSheets || s("add");
59
+ }, R = (e, n) => {
60
+ const t = l.sheets.findIndex((o) => o.id === e);
61
+ if (t !== -1 && v(l.sheets[t])) {
62
+ const o = [...l.sheets];
63
+ o[t] = { ...o[t], title: n }, s("update:sheets", o);
63
64
  }
64
- }, z = (e, l) => {
65
- const t = a.sheets.findIndex((o) => o.id === e);
66
- if (t !== -1 && C(a.sheets[t])) {
67
- const o = [...a.sheets];
68
- o[t] = { ...o[t], icon: l }, s("update:sheets", o);
65
+ }, T = (e, n) => {
66
+ const t = l.sheets.findIndex((o) => o.id === e);
67
+ if (t !== -1 && C(l.sheets[t])) {
68
+ const o = [...l.sheets];
69
+ o[t] = { ...o[t], icon: n }, s("update:sheets", o);
69
70
  }
71
+ }, z = (e) => {
72
+ const n = l.sheets.find((t) => t.id === e);
73
+ !n || !v(n) || (u.value = e, s("edit-start", e));
70
74
  }, L = (e) => {
71
- const l = a.sheets.find((t) => t.id === e);
72
- !l || !v(l) || (u.value = e, s("edit-start", e));
73
- }, N = (e) => {
74
75
  u.value = null, s("edit-end", e);
76
+ }, N = (e) => {
77
+ const n = l.sheets.find((t) => t.id === e);
78
+ !n || !w(n) || s("duplicate", e);
75
79
  }, O = (e) => {
76
- const l = a.sheets.find((t) => t.id === e);
77
- !l || !y(l) || s("duplicate", e);
78
- }, P = (e) => {
79
- const l = a.sheets.findIndex((o) => o.id === e);
80
- if (l === -1 || !p(a.sheets[l])) return;
81
- if (!a.autoDelete) {
80
+ const n = l.sheets.findIndex((o) => o.id === e);
81
+ if (n === -1 || !y(l.sheets[n])) return;
82
+ if (!l.autoDelete) {
82
83
  s("delete", e);
83
84
  return;
84
85
  }
85
- const t = [...a.sheets];
86
- if (t.splice(l, 1), s("update:sheets", t), s("delete", e), a.modelValue === e) {
86
+ const t = [...l.sheets];
87
+ if (t.splice(n, 1), s("update:sheets", t), s("delete", e), l.modelValue === e) {
87
88
  let o = "";
88
89
  if (t.length > 0) {
89
- const w = Math.min(l, t.length - 1);
90
- o = t[w].id;
90
+ const D = Math.min(n, t.length - 1);
91
+ o = t[D].id;
91
92
  }
92
93
  s("update:modelValue", o), s("change", o);
93
94
  }
94
- }, M = (e) => {
95
+ }, P = (e) => {
95
96
  m.value && e.deltaY !== 0 && (m.value.scrollLeft += e.deltaY, e.preventDefault());
96
- }, h = (e, l) => a.editable ? (e[l] ?? a[l] ?? !0) === !0 : !1, v = (e) => h(e, "canRename"), y = (e) => h(e, "canDuplicate"), C = (e) => h(e, "canChangeIcon") && a.allowIconChange, p = (e) => a.sheets.length > 1 && h(e, "canDelete");
97
- return (e, l) => (d(), c("div", ee, [
98
- f("div", te, [
99
- e.$slots["left-addons"] ? (d(), c("div", le, [
97
+ }, h = (e, n) => l.editable ? (e[n] ?? l[n] ?? !0) === !0 : !1, v = (e) => h(e, "canRename"), w = (e) => h(e, "canDuplicate"), C = (e) => h(e, "canChangeIcon") && l.allowIconChange, y = (e) => l.sheets.length > 1 && h(e, "canDelete"), p = (e) => e.showContextMenu !== !1;
98
+ return (e, n) => (d(), c("div", te, [
99
+ f("div", ne, [
100
+ e.$slots["left-addons"] ? (d(), c("div", ae, [
100
101
  g(e.$slots, "left-addons", {}, void 0, !0)
101
102
  ])) : x("", !0),
102
103
  f("div", {
@@ -104,98 +105,102 @@ const ee = { class: "flex flex-col w-full font-sans" }, te = { class: "flex item
104
105
  ref: m,
105
106
  class: "flex-1 flex items-end overflow-x-auto scrollbar-none overscroll-contain sheet-container",
106
107
  style: { "scrollbar-width": "none", "-ms-overflow-style": "none" },
107
- onWheel: M
108
+ onWheel: P
108
109
  }, [
109
- b(S(Z), {
110
+ b(V(_), {
110
111
  "model-value": i.value,
111
112
  "onUpdate:modelValue": A,
112
- disabled: !a.draggable || !!u.value,
113
+ disabled: !l.draggable || !!u.value,
113
114
  animation: 150,
114
115
  class: "flex items-end min-w-max"
115
116
  }, {
116
- default: V(() => [
117
- (d(!0), c(q, null, G(i.value, (t, o, w, r) => {
118
- const D = [
117
+ default: $(() => [
118
+ (d(!0), c(G, null, H(i.value, (t, o, D, r) => {
119
+ const I = [
119
120
  t.id,
120
121
  t.title,
121
122
  t.icon,
122
- n.modelValue === t.id,
123
+ a.modelValue === t.id,
123
124
  u.value === t.id,
124
125
  v(t),
126
+ w(t),
125
127
  y(t),
126
- p(t),
127
128
  C(t),
128
- n.customOptions,
129
+ p(t),
130
+ a.customOptions,
129
131
  e.$slots["sheet-actions"],
130
- n.confirmDelete,
131
- n.allowIconChange,
132
- n.itemClass,
133
- n.activeItemClass,
134
- n.inactiveItemClass
132
+ a.confirmDelete,
133
+ a.allowIconChange,
134
+ a.menuWidth,
135
+ a.itemClass,
136
+ a.activeItemClass,
137
+ a.inactiveItemClass
135
138
  ];
136
- if (r && r.el && r.key === t.id && H(r, D)) return r;
137
- const I = (d(), J(_, {
139
+ if (r && r.el && r.key === t.id && J(r, I)) return r;
140
+ const B = (d(), K(ee, {
138
141
  key: t.id,
139
142
  sheet: t,
140
- "is-active": n.modelValue === t.id,
143
+ "is-active": a.modelValue === t.id,
141
144
  "is-editing": u.value === t.id,
142
145
  "can-rename": v(t),
143
- "can-duplicate": y(t),
144
- "can-delete": p(t),
145
- "custom-options": n.customOptions,
146
- "confirm-delete": n.confirmDelete,
147
- "confirm-delete-texts": n.confirmDeleteTexts,
148
- "allow-icon-change": n.allowIconChange,
146
+ "can-duplicate": w(t),
147
+ "can-delete": y(t),
148
+ "show-context-menu": p(t),
149
+ "custom-options": a.customOptions,
150
+ "confirm-delete": a.confirmDelete,
151
+ "confirm-delete-texts": a.confirmDeleteTexts,
152
+ "allow-icon-change": a.allowIconChange,
149
153
  "can-change-icon": C(t),
150
- "item-class": n.itemClass,
151
- "active-item-class": n.activeItemClass,
152
- "inactive-item-class": n.inactiveItemClass,
153
- onSelect: R,
154
- "onUpdate:title": T,
155
- "onUpdate:icon": z,
156
- onEditStart: L,
157
- onEditEnd: N,
158
- onDuplicate: O,
159
- onDelete: P
160
- }, K({ _: 2 }, [
154
+ "menu-width": a.menuWidth,
155
+ "item-class": a.itemClass,
156
+ "active-item-class": a.activeItemClass,
157
+ "inactive-item-class": a.inactiveItemClass,
158
+ onSelect: M,
159
+ "onUpdate:title": R,
160
+ "onUpdate:icon": T,
161
+ onEditStart: z,
162
+ onEditEnd: L,
163
+ onDuplicate: N,
164
+ onDelete: O
165
+ }, Q({ _: 2 }, [
161
166
  e.$slots["sheet-actions"] ? {
162
167
  name: "sheet-actions",
163
- fn: V(({ sheet: W }) => [
164
- g(e.$slots, "sheet-actions", { sheet: W }, void 0, !0)
168
+ fn: $(({ sheet: Y }) => [
169
+ g(e.$slots, "sheet-actions", { sheet: Y }, void 0, !0)
165
170
  ]),
166
171
  key: "0"
167
172
  } : void 0
168
- ]), 1032, ["sheet", "is-active", "is-editing", "can-rename", "can-duplicate", "can-delete", "custom-options", "confirm-delete", "confirm-delete-texts", "allow-icon-change", "can-change-icon", "item-class", "active-item-class", "inactive-item-class"]));
169
- return I.memo = D, I;
170
- }, l, 0), 128))
173
+ ]), 1032, ["sheet", "is-active", "is-editing", "can-rename", "can-duplicate", "can-delete", "show-context-menu", "custom-options", "confirm-delete", "confirm-delete-texts", "allow-icon-change", "can-change-icon", "menu-width", "item-class", "active-item-class", "inactive-item-class"]));
174
+ return B.memo = I, B;
175
+ }, n, 0), 128))
171
176
  ]),
172
177
  _: 3
173
178
  }, 8, ["model-value", "disabled"]),
174
- n.addable && n.addButtonPosition === "attached" ? (d(), c("div", {
179
+ a.addable && a.addButtonPosition === "attached" ? (d(), c("div", {
175
180
  key: 0,
176
- class: Q(["shrink-0 sticky right-0 z-10 bg-body flex items-center justify-center h-full", {
177
- "shadow-[-18px_0_24px_-4px_#fff] dark:shadow-[-18px_0_24px_-4px_#000]": !S(U).right
181
+ class: X(["shrink-0 sticky right-0 z-10 bg-body flex items-center justify-center h-full", {
182
+ "shadow-[-18px_0_24px_-4px_#fff] dark:shadow-[-18px_0_24px_-4px_#000]": !V(W).right
178
183
  }])
179
184
  }, [
180
- b($, { onClick: k })
185
+ b(E, { onClick: k })
181
186
  ], 2)) : x("", !0),
182
- l[2] || (l[2] = f("div", { class: "w-1 shrink-0" }, null, -1))
187
+ n[2] || (n[2] = f("div", { class: "w-1 shrink-0" }, null, -1))
183
188
  ], 544),
184
- f("div", ae, [
185
- n.addable && n.addButtonPosition === "fixed-right" ? (d(), c("div", ne, [
186
- b($, { onClick: k })
189
+ f("div", le, [
190
+ a.addable && a.addButtonPosition === "fixed-right" ? (d(), c("div", oe, [
191
+ b(E, { onClick: k })
187
192
  ])) : x("", !0),
188
- e.$slots["right-addons"] ? (d(), c("div", oe, [
193
+ e.$slots["right-addons"] ? (d(), c("div", se, [
189
194
  g(e.$slots, "right-addons", {}, void 0, !0)
190
195
  ])) : x("", !0)
191
196
  ])
192
197
  ]),
193
- f("div", se, [
198
+ f("div", ie, [
194
199
  g(e.$slots, "default", {}, void 0, !0)
195
200
  ])
196
201
  ]));
197
202
  }
198
203
  });
199
204
  export {
200
- fe as default
205
+ me as default
201
206
  };
@@ -11,6 +11,8 @@ export interface WorkbookSheet {
11
11
  canDuplicate?: boolean;
12
12
  canDelete?: boolean;
13
13
  canChangeIcon?: boolean;
14
+ /** Explicitly show or hide this sheet's context-menu trigger. */
15
+ showContextMenu?: boolean;
14
16
  [key: string]: any;
15
17
  }
16
18
  /** A consumer-owned context-menu action rendered alongside Workbook's built-in sheet actions. */
@@ -54,6 +56,8 @@ export interface WorkbookProps {
54
56
  confirm?: string;
55
57
  cancel?: string;
56
58
  };
59
+ /** Width of each sheet's context-menu dropdown (passed to Dropdown `width`). */
60
+ menuWidth?: string;
57
61
  allowIconChange?: boolean;
58
62
  }
59
63
  export interface SheetEvent {