@nubisco/ui 5.56.0 → 5.57.0
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/dist/{Blueprint-BDPb5y1N.cjs → Blueprint-CQxC02e5.cjs} +1 -1
- package/dist/{Blueprint-DEboZ8ul.js → Blueprint-Dnliv-77.js} +1 -1
- package/dist/Spreadsheet-BDkXKuLU.cjs +4 -0
- package/dist/Spreadsheet-Du_JiJDw.js +869 -0
- package/dist/all.cjs +1 -1
- package/dist/all.mjs +184 -182
- package/dist/component-styles.json +4 -0
- package/dist/components/Blueprint.cjs +1 -1
- package/dist/components/Blueprint.mjs +1 -1
- package/dist/components/Spreadsheet.cjs +1 -0
- package/dist/components/{labs/Spreadsheet.d.ts → Spreadsheet.d.ts} +19 -5
- package/dist/components/Spreadsheet.mjs +2 -0
- package/dist/components/{labs/Spreadsheet.vue.d.ts → Spreadsheet.vue.d.ts} +7 -1
- package/dist/components/Spreadsheet.vue.d.ts.map +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/manifest.d.ts +1 -0
- package/dist/components/manifest.d.ts.map +1 -1
- package/dist/components/manifest.js +1 -0
- package/dist/global.d.ts +2 -0
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +156 -155
- package/dist/labs.d.ts.map +1 -1
- package/dist/main-BIq8MyYB.js +88 -0
- package/dist/main-T6vehYuf.cjs +1 -0
- package/dist/main.d.ts +2 -2
- package/dist/main.d.ts.map +1 -1
- package/dist/styles/Spreadsheet.css +1 -0
- package/dist/ui.css +1 -1
- package/package.json +1 -1
- package/dist/components/labs/Spreadsheet.vue.d.ts.map +0 -1
- package/dist/main-B-SiH7ks.js +0 -812
- package/dist/main-CH_BN_4v.cjs +0 -4
- package/dist/styles/main.css +0 -1
- /package/dist/{pixi-scene-ZtVQmHpg.cjs → pixi-scene-BGTSD1-G.cjs} +0 -0
- /package/dist/{pixi-scene-hlXJlAf5.js → pixi-scene-D1jzgzHL.js} +0 -0
package/dist/main-B-SiH7ks.js
DELETED
|
@@ -1,812 +0,0 @@
|
|
|
1
|
-
import { i as e, l as t, r as n, u as r } from "./Button-DmJ_J3UO.js";
|
|
2
|
-
import { TOUR_STEP_ATTRIBUTE as i } from "./utils/tourTarget.helper.mjs";
|
|
3
|
-
import { NB_COMMAND_PALETTE_KEY as a, createCommandPaletteState as o } from "./composables/useCommandPalette.composable.mjs";
|
|
4
|
-
import { NB_HYDRATION as s } from "./composables/useTeleportReady.composable.mjs";
|
|
5
|
-
import { t as c } from "./_plugin-vue_export-helper-C6QCLu9I.js";
|
|
6
|
-
import { usePhoneLayout as l } from "./composables/usePhoneLayout.composable.mjs";
|
|
7
|
-
import { Fragment as u, computed as d, createCommentVNode as f, createElementBlock as p, createElementVNode as m, defineComponent as h, nextTick as g, normalizeClass as _, normalizeStyle as v, onBeforeUnmount as ee, onMounted as te, openBlock as y, ref as b, renderList as x, renderSlot as ne, toDisplayString as S, useTemplateRef as re, vModelText as ie, watch as ae, withDirectives as oe, withModifiers as se } from "vue";
|
|
8
|
-
//#region src/directives/ContextMenu.directive.ts
|
|
9
|
-
var C = /* @__PURE__ */ r({ default: () => w });
|
|
10
|
-
function w(e) {
|
|
11
|
-
e.directive("nb-context-menu", {
|
|
12
|
-
mounted(e, t) {
|
|
13
|
-
let n = (e) => {
|
|
14
|
-
e.preventDefault(), typeof t.value == "function" && t.value({
|
|
15
|
-
x: e.clientX,
|
|
16
|
-
y: e.clientY
|
|
17
|
-
});
|
|
18
|
-
};
|
|
19
|
-
e.__nbContextMenuHandler__ = n, e.addEventListener("contextmenu", n);
|
|
20
|
-
},
|
|
21
|
-
updated(e, t) {
|
|
22
|
-
e.__nbContextMenuHandler__ && e.removeEventListener("contextmenu", e.__nbContextMenuHandler__);
|
|
23
|
-
let n = (e) => {
|
|
24
|
-
e.preventDefault(), typeof t.value == "function" && t.value({
|
|
25
|
-
x: e.clientX,
|
|
26
|
-
y: e.clientY
|
|
27
|
-
});
|
|
28
|
-
};
|
|
29
|
-
e.__nbContextMenuHandler__ = n, e.addEventListener("contextmenu", n);
|
|
30
|
-
},
|
|
31
|
-
unmounted(e) {
|
|
32
|
-
e.__nbContextMenuHandler__ && (e.removeEventListener("contextmenu", e.__nbContextMenuHandler__), delete e.__nbContextMenuHandler__);
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
//#endregion
|
|
37
|
-
//#region src/directives/TourStep.directive.ts
|
|
38
|
-
var T = /* @__PURE__ */ r({ default: () => D });
|
|
39
|
-
function E(e, t) {
|
|
40
|
-
let n = t.value;
|
|
41
|
-
if (n == null || n === "") {
|
|
42
|
-
e.removeAttribute(i);
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
e.setAttribute(i, String(n));
|
|
46
|
-
}
|
|
47
|
-
var D = (e) => {
|
|
48
|
-
e.directive("nb-tour-step", {
|
|
49
|
-
mounted: E,
|
|
50
|
-
updated: E,
|
|
51
|
-
unmounted(e) {
|
|
52
|
-
e.removeAttribute(i);
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
}, O = /* @__PURE__ */ Object.assign({
|
|
56
|
-
"./ContextMenu.directive.ts": C,
|
|
57
|
-
"./ToolTip.content.ts": t,
|
|
58
|
-
"./ToolTip.directive.ts": e,
|
|
59
|
-
"./TourStep.directive.ts": T
|
|
60
|
-
}), k = { install(e) {
|
|
61
|
-
Object.values(O).forEach((t) => {
|
|
62
|
-
typeof t.default == "function" && t.default(e);
|
|
63
|
-
});
|
|
64
|
-
} }, A = { install(e) {
|
|
65
|
-
let t = o();
|
|
66
|
-
e.provide(a, t);
|
|
67
|
-
} }, j = /* @__PURE__ */ function(e) {
|
|
68
|
-
return e.Object = "object", e.Array = "array", e.Primitive = "primitive", e;
|
|
69
|
-
}(j || {}), ce = {
|
|
70
|
-
key: 0,
|
|
71
|
-
class: "nb-spreadsheet__toolbar"
|
|
72
|
-
}, le = {
|
|
73
|
-
key: 0,
|
|
74
|
-
class: "nb-spreadsheet__corner",
|
|
75
|
-
style: {
|
|
76
|
-
gridRow: 1,
|
|
77
|
-
gridColumn: 1
|
|
78
|
-
}
|
|
79
|
-
}, ue = ["data-header-col", "onClick"], de = ["title"], fe = {
|
|
80
|
-
key: 0,
|
|
81
|
-
class: "nb-spreadsheet__sort",
|
|
82
|
-
"aria-hidden": "true"
|
|
83
|
-
}, pe = ["onMousedown"], me = [
|
|
84
|
-
"title",
|
|
85
|
-
"data-cell",
|
|
86
|
-
"data-row",
|
|
87
|
-
"data-col",
|
|
88
|
-
"onMousedown",
|
|
89
|
-
"onMouseenter",
|
|
90
|
-
"onDblclick"
|
|
91
|
-
], he = ["inputmode"], ge = 36, _e = 32, ve = 20, M = /* @__PURE__ */ h({
|
|
92
|
-
__name: "Spreadsheet",
|
|
93
|
-
props: {
|
|
94
|
-
columns: {},
|
|
95
|
-
rows: {},
|
|
96
|
-
cellAttrs: {},
|
|
97
|
-
computed: {},
|
|
98
|
-
resizable: {
|
|
99
|
-
type: Boolean,
|
|
100
|
-
default: !0
|
|
101
|
-
},
|
|
102
|
-
rowReorderable: {
|
|
103
|
-
type: Boolean,
|
|
104
|
-
default: !1
|
|
105
|
-
},
|
|
106
|
-
showGutter: {
|
|
107
|
-
type: Boolean,
|
|
108
|
-
default: !0
|
|
109
|
-
},
|
|
110
|
-
gutterWidth: { default: 44 },
|
|
111
|
-
windowRows: { default: 80 },
|
|
112
|
-
locale: { default: "pt-PT" },
|
|
113
|
-
fit: {
|
|
114
|
-
type: Boolean,
|
|
115
|
-
default: !1
|
|
116
|
-
}
|
|
117
|
-
},
|
|
118
|
-
emits: [
|
|
119
|
-
"commit",
|
|
120
|
-
"change",
|
|
121
|
-
"selection",
|
|
122
|
-
"focus",
|
|
123
|
-
"row-reorder"
|
|
124
|
-
],
|
|
125
|
-
setup(e, { expose: t, emit: n }) {
|
|
126
|
-
let r = e, i = n, a = re("scrollerRef"), o = re("editorRef"), s = b({}), c = b(null), h = b(null), C = b(null), w = b(!1), T = b(null), E = b(0), D = b(0), O = "", k = b([]), A = b([]), j = d(() => {
|
|
127
|
-
let e = r.columns.filter((e) => e.pinned === "left"), t = r.columns.filter((e) => e.pinned === "right"), n = r.columns.filter((e) => !e.pinned);
|
|
128
|
-
return [
|
|
129
|
-
...e,
|
|
130
|
-
...n,
|
|
131
|
-
...t
|
|
132
|
-
];
|
|
133
|
-
});
|
|
134
|
-
function M(e) {
|
|
135
|
-
return s.value[e.id] ?? e.width ?? 120;
|
|
136
|
-
}
|
|
137
|
-
let { phoneTouch: N } = l(), P = b(null), F = d(() => P.value ?? _e);
|
|
138
|
-
function I() {
|
|
139
|
-
let e = a.value;
|
|
140
|
-
if (!r.fit || N.value || !e || !r.rows.length) {
|
|
141
|
-
P.value = null;
|
|
142
|
-
return;
|
|
143
|
-
}
|
|
144
|
-
let t = X(".nb-spreadsheet__header") || ge, n = Math.floor((e.clientHeight - t) / r.rows.length);
|
|
145
|
-
P.value = Math.min(_e, Math.max(ve, n));
|
|
146
|
-
}
|
|
147
|
-
let L = null;
|
|
148
|
-
ae(() => [
|
|
149
|
-
r.fit,
|
|
150
|
-
r.rows.length,
|
|
151
|
-
N.value
|
|
152
|
-
], () => I());
|
|
153
|
-
let ye = d(() => P.value === null ? void 0 : { "--nbss-row-height": `${P.value}px` }), be = d(() => ({
|
|
154
|
-
gridTemplateColumns: (r.showGutter ? `${r.gutterWidth}px ` : "") + j.value.map((e) => r.fit && !e.pinned ? `minmax(${M(e)}px, 1fr)` : `${M(e)}px`).join(" "),
|
|
155
|
-
gridTemplateRows: "var(--nbss-header-height)"
|
|
156
|
-
})), R = b(/* @__PURE__ */ new Set()), xe = /* @__PURE__ */ new Map();
|
|
157
|
-
function z() {
|
|
158
|
-
let e = a.value;
|
|
159
|
-
if (!e) return;
|
|
160
|
-
let t = [], n = !1, i = !1;
|
|
161
|
-
for (let a of r.columns) {
|
|
162
|
-
if (!a.shortLabel) continue;
|
|
163
|
-
let r = e.querySelector(`[data-header-col="${Y(a.id)}"] .nb-spreadsheet__header-label`);
|
|
164
|
-
if (!r) continue;
|
|
165
|
-
let o = `${a.id}::${a.label}`;
|
|
166
|
-
R.value.has(a.id) || xe.set(o, r.scrollWidth);
|
|
167
|
-
let s = xe.get(o);
|
|
168
|
-
if (s === void 0) {
|
|
169
|
-
i = !0;
|
|
170
|
-
continue;
|
|
171
|
-
}
|
|
172
|
-
t.push(a.id), s > r.clientWidth && (n = !0);
|
|
173
|
-
}
|
|
174
|
-
R.value = new Set(n ? t : []), i && g(z);
|
|
175
|
-
}
|
|
176
|
-
ae(() => [r.columns, s.value], () => void g(z), { deep: !0 });
|
|
177
|
-
let B = d(() => {
|
|
178
|
-
let e = r.rows.filter((e) => !e.pinned);
|
|
179
|
-
if (!c.value) return e;
|
|
180
|
-
let t = r.columns.find((e) => e.id === c.value.columnId);
|
|
181
|
-
if (!t) return e;
|
|
182
|
-
let n = c.value.direction === "asc" ? 1 : -1, i = (e, t) => e == null && t == null ? 0 : e == null ? -1 : t == null ? 1 : typeof e == "number" && typeof t == "number" ? (e - t) * n : String(e).localeCompare(String(t)) * n;
|
|
183
|
-
return [...e].sort((e, n) => i(e.values[t.id], n.values[t.id]));
|
|
184
|
-
}), V = d(() => r.rows.filter((e) => e.pinned === "top")), H = d(() => r.rows.filter((e) => e.pinned === "bottom")), Se = d(() => {
|
|
185
|
-
let e = Math.max(1, Math.ceil((a.value?.clientHeight ?? 600) / F.value)), t = Math.max(10, Math.floor(r.windowRows / 4)), n = Math.floor(E.value / F.value) - V.value.length - t, i = Math.max(0, n), o = Math.min(B.value.length, i + e + t * 2), s = V.value.map((e, t) => ({
|
|
186
|
-
...e,
|
|
187
|
-
__virtualIndex: t,
|
|
188
|
-
gutterLabel: ""
|
|
189
|
-
})), c = B.value.slice(i, o).map((e, t) => ({
|
|
190
|
-
...e,
|
|
191
|
-
__virtualIndex: i + t + V.value.length
|
|
192
|
-
})), l = H.value.map((e, t) => ({
|
|
193
|
-
...e,
|
|
194
|
-
__virtualIndex: V.value.length + B.value.length + t,
|
|
195
|
-
gutterLabel: ""
|
|
196
|
-
}));
|
|
197
|
-
return [
|
|
198
|
-
...s,
|
|
199
|
-
...c,
|
|
200
|
-
...l
|
|
201
|
-
];
|
|
202
|
-
});
|
|
203
|
-
function Ce(e, t) {
|
|
204
|
-
if (t == null || t === "") return "";
|
|
205
|
-
if (e.type === "number") {
|
|
206
|
-
let e = typeof t == "number" ? t : Number(t);
|
|
207
|
-
return Number.isFinite(e) ? new Intl.NumberFormat(r.locale, { maximumFractionDigits: 4 }).format(e) : String(t);
|
|
208
|
-
}
|
|
209
|
-
if (e.type === "date") {
|
|
210
|
-
let e = t instanceof Date ? t : new Date(t);
|
|
211
|
-
return Number.isNaN(e.getTime()) ? String(t) : new Intl.DateTimeFormat(r.locale).format(e);
|
|
212
|
-
}
|
|
213
|
-
return String(t);
|
|
214
|
-
}
|
|
215
|
-
function we(e, t) {
|
|
216
|
-
if (t === "") return null;
|
|
217
|
-
if (e.type === "number") {
|
|
218
|
-
let e = t.replace(/\s/g, "").replace(",", "."), n = Number(e);
|
|
219
|
-
if (!Number.isFinite(n)) throw Error("Invalid number");
|
|
220
|
-
return n;
|
|
221
|
-
}
|
|
222
|
-
if (e.type === "date") {
|
|
223
|
-
let e = new Date(t);
|
|
224
|
-
if (Number.isNaN(e.getTime())) throw Error("Invalid date");
|
|
225
|
-
return e.toISOString().slice(0, 10);
|
|
226
|
-
}
|
|
227
|
-
return t;
|
|
228
|
-
}
|
|
229
|
-
function U(e, t) {
|
|
230
|
-
let n = r.rows.find((t) => t.id === e);
|
|
231
|
-
if (!n) return;
|
|
232
|
-
let i = n.values[t];
|
|
233
|
-
if (i !== void 0) return i;
|
|
234
|
-
if (r.computed) return r.computed(e, t, U);
|
|
235
|
-
}
|
|
236
|
-
function W(e, t) {
|
|
237
|
-
return r.cellAttrs ? r.cellAttrs(e.id, t.id, e, t) ?? {} : {};
|
|
238
|
-
}
|
|
239
|
-
function Te(e, t) {
|
|
240
|
-
let n = W(e, t);
|
|
241
|
-
if (n.display !== void 0) return n.display;
|
|
242
|
-
let r = U(e.id, t.id);
|
|
243
|
-
return t.format ? t.format(r, e) : Ce(t, r);
|
|
244
|
-
}
|
|
245
|
-
function Ee(e, t) {
|
|
246
|
-
let n = W(e, t), r = h.value?.rowId === e.id && h.value?.columnId === t.id, i = Ie(e.id, t.id);
|
|
247
|
-
return {
|
|
248
|
-
[`nb-spreadsheet__cell--${t.align ?? (t.type === "number" || t.type === "date" ? "right" : "left")}`]: !0,
|
|
249
|
-
"nb-spreadsheet__cell--focused": r,
|
|
250
|
-
"nb-spreadsheet__cell--selected": i,
|
|
251
|
-
"nb-spreadsheet__cell--readonly": G(e, t),
|
|
252
|
-
"nb-spreadsheet__cell--computed": !!n.computed || !!e.computed,
|
|
253
|
-
"nb-spreadsheet__cell--pinned-top": e.pinned === "top",
|
|
254
|
-
"nb-spreadsheet__cell--pinned-bottom": e.pinned === "bottom",
|
|
255
|
-
[n.className ?? ""]: !!n.className,
|
|
256
|
-
[e.className ?? ""]: !!e.className
|
|
257
|
-
};
|
|
258
|
-
}
|
|
259
|
-
function G(e, t) {
|
|
260
|
-
if (e.computed || t.readOnly) return !0;
|
|
261
|
-
let n = W(e, t);
|
|
262
|
-
return !!n.readOnly || !!n.computed;
|
|
263
|
-
}
|
|
264
|
-
function De(e, t) {
|
|
265
|
-
return W(e, t).tooltip ?? "";
|
|
266
|
-
}
|
|
267
|
-
function Oe(e) {
|
|
268
|
-
return {
|
|
269
|
-
"nb-spreadsheet__header--sortable": !!e.sortable,
|
|
270
|
-
"nb-spreadsheet__header--pinned-left": e.pinned === "left",
|
|
271
|
-
"nb-spreadsheet__header--pinned-right": e.pinned === "right",
|
|
272
|
-
"nb-spreadsheet__header--last": e.id === j.value[j.value.length - 1]?.id
|
|
273
|
-
};
|
|
274
|
-
}
|
|
275
|
-
function ke(e) {
|
|
276
|
-
if (e.pinned !== "left") return 0;
|
|
277
|
-
let t = r.showGutter ? r.gutterWidth : 0;
|
|
278
|
-
for (let n of j.value) {
|
|
279
|
-
if (n.id === e.id) break;
|
|
280
|
-
n.pinned === "left" && (t += M(n));
|
|
281
|
-
}
|
|
282
|
-
return t;
|
|
283
|
-
}
|
|
284
|
-
function Ae(e) {
|
|
285
|
-
if (e.pinned !== "right") return 0;
|
|
286
|
-
let t = 0, n = [...j.value].reverse();
|
|
287
|
-
for (let r of n) {
|
|
288
|
-
if (r.id === e.id) break;
|
|
289
|
-
r.pinned === "right" && (t += M(r));
|
|
290
|
-
}
|
|
291
|
-
return t;
|
|
292
|
-
}
|
|
293
|
-
function je(e, t) {
|
|
294
|
-
let n = (r.showGutter ? 2 : 1) + t, i = {};
|
|
295
|
-
return e.pinned === "left" ? (i.position = "sticky", i.left = `${ke(e)}px`, i.zIndex = "3") : e.pinned === "right" && (i.position = "sticky", i.right = `${Ae(e)}px`, i.zIndex = "3"), {
|
|
296
|
-
gridRow: 1,
|
|
297
|
-
gridColumn: n,
|
|
298
|
-
...i
|
|
299
|
-
};
|
|
300
|
-
}
|
|
301
|
-
function Me(e, t, n) {
|
|
302
|
-
let i = (r.showGutter ? 2 : 1) + n, a = e.__virtualIndex + 2, o = {};
|
|
303
|
-
return t.pinned === "left" ? (o.position = "sticky", o.left = `${ke(t)}px`, o.zIndex = "2") : t.pinned === "right" && (o.position = "sticky", o.right = `${Ae(t)}px`, o.zIndex = "2"), (e.pinned === "top" || e.pinned === "bottom") && (o.position = "sticky", o.zIndex = String(Math.max(Number(o.zIndex ?? 0), 2)), Object.assign(o, Ne(e))), {
|
|
304
|
-
gridRow: a,
|
|
305
|
-
gridColumn: i,
|
|
306
|
-
...o
|
|
307
|
-
};
|
|
308
|
-
}
|
|
309
|
-
function Ne(e) {
|
|
310
|
-
if (e.pinned === "top") {
|
|
311
|
-
let t = V.value.findIndex((t) => t.id === e.id);
|
|
312
|
-
return { top: `calc(var(--nbss-header-height) + var(--nbss-row-height) * ${Math.max(0, t)})` };
|
|
313
|
-
}
|
|
314
|
-
if (e.pinned === "bottom") {
|
|
315
|
-
let t = H.value, n = t.findIndex((t) => t.id === e.id);
|
|
316
|
-
return { bottom: `calc(var(--nbss-row-height) * ${Math.max(0, t.length - 1 - n)})` };
|
|
317
|
-
}
|
|
318
|
-
return {};
|
|
319
|
-
}
|
|
320
|
-
function Pe(e) {
|
|
321
|
-
return e.label === void 0 ? e.gutterLabel === void 0 ? String(e.__virtualIndex - V.value.length + 1) : e.gutterLabel : e.label;
|
|
322
|
-
}
|
|
323
|
-
function Fe(e) {
|
|
324
|
-
let t = {
|
|
325
|
-
position: "sticky",
|
|
326
|
-
left: "0",
|
|
327
|
-
zIndex: "2"
|
|
328
|
-
};
|
|
329
|
-
return e.pinned && (Object.assign(t, Ne(e)), t.zIndex = "4"), {
|
|
330
|
-
gridRow: e.__virtualIndex + 2,
|
|
331
|
-
gridColumn: 1,
|
|
332
|
-
...t
|
|
333
|
-
};
|
|
334
|
-
}
|
|
335
|
-
function Ie(e, t) {
|
|
336
|
-
if (!C.value) return !1;
|
|
337
|
-
let n = [
|
|
338
|
-
...V.value,
|
|
339
|
-
...B.value,
|
|
340
|
-
...H.value
|
|
341
|
-
].map((e) => e.id), r = j.value.map((e) => e.id), i = n.indexOf(C.value.startRowId), a = n.indexOf(C.value.endRowId), o = r.indexOf(C.value.startColumnId), s = r.indexOf(C.value.endColumnId), c = n.indexOf(e), l = r.indexOf(t);
|
|
342
|
-
return c >= Math.min(i, a) && c <= Math.max(i, a) && l >= Math.min(o, s) && l <= Math.max(o, s);
|
|
343
|
-
}
|
|
344
|
-
function K(e, t, n = !1) {
|
|
345
|
-
h.value = {
|
|
346
|
-
rowId: e,
|
|
347
|
-
columnId: t
|
|
348
|
-
}, n && C.value ? C.value = {
|
|
349
|
-
...C.value,
|
|
350
|
-
endRowId: e,
|
|
351
|
-
endColumnId: t
|
|
352
|
-
} : C.value = {
|
|
353
|
-
startRowId: e,
|
|
354
|
-
startColumnId: t,
|
|
355
|
-
endRowId: e,
|
|
356
|
-
endColumnId: t
|
|
357
|
-
}, i("focus", h.value), i("selection", C.value);
|
|
358
|
-
}
|
|
359
|
-
function Le(e) {
|
|
360
|
-
O = e.pointerType;
|
|
361
|
-
}
|
|
362
|
-
function Re(e, t, n) {
|
|
363
|
-
let r = O === "touch" && !e.shiftKey && h.value?.rowId === t.id && h.value?.columnId === n.id;
|
|
364
|
-
if (O = "", T.value && Q(), w.value = !0, K(t.id, n.id, e.shiftKey), q(), e.preventDefault(), document.addEventListener("mouseup", Be, { once: !0 }), r && !G(t, n)) {
|
|
365
|
-
let e = U(t.id, n.id);
|
|
366
|
-
Z(t, n, e == null ? "" : String(e), "edit");
|
|
367
|
-
}
|
|
368
|
-
}
|
|
369
|
-
function ze(e, t) {
|
|
370
|
-
!w.value || !C.value || (C.value = {
|
|
371
|
-
...C.value,
|
|
372
|
-
endRowId: e.id,
|
|
373
|
-
endColumnId: t.id
|
|
374
|
-
}, i("selection", C.value));
|
|
375
|
-
}
|
|
376
|
-
function Be() {
|
|
377
|
-
w.value = !1;
|
|
378
|
-
}
|
|
379
|
-
function Ve(e, t) {
|
|
380
|
-
if (G(e, t)) return;
|
|
381
|
-
let n = U(e.id, t.id);
|
|
382
|
-
Z(e, t, n == null ? "" : String(n), "edit");
|
|
383
|
-
}
|
|
384
|
-
function q() {
|
|
385
|
-
a.value?.focus({ preventScroll: !0 });
|
|
386
|
-
}
|
|
387
|
-
function J(e, t, n = !1) {
|
|
388
|
-
if (!h.value) {
|
|
389
|
-
let e = j.value[0], t = Se.value[0];
|
|
390
|
-
e && t && K(t.id, e.id);
|
|
391
|
-
return;
|
|
392
|
-
}
|
|
393
|
-
let r = [
|
|
394
|
-
...V.value,
|
|
395
|
-
...B.value,
|
|
396
|
-
...H.value
|
|
397
|
-
], i = r.findIndex((e) => e.id === h.value.rowId), a = j.value.findIndex((e) => e.id === h.value.columnId), o = Math.max(0, Math.min(r.length - 1, i + e)), s = Math.max(0, Math.min(j.value.length - 1, a + t)), c = r[o].id, l = j.value[s].id;
|
|
398
|
-
K(c, l, n), We(c, l);
|
|
399
|
-
}
|
|
400
|
-
function Y(e) {
|
|
401
|
-
return e.replace(/["\\]/g, "\\$&");
|
|
402
|
-
}
|
|
403
|
-
function X(e) {
|
|
404
|
-
let t = a.value?.querySelector(e);
|
|
405
|
-
return t ? t.offsetHeight : 0;
|
|
406
|
-
}
|
|
407
|
-
function He(e) {
|
|
408
|
-
let t = 0;
|
|
409
|
-
for (let n of e) t += X(`[data-row="${Y(n.id)}"]`);
|
|
410
|
-
return t;
|
|
411
|
-
}
|
|
412
|
-
function Ue(e) {
|
|
413
|
-
let t = e === "left" && r.showGutter ? r.gutterWidth : 0;
|
|
414
|
-
for (let n of j.value) n.pinned === e && (t += M(n));
|
|
415
|
-
return t;
|
|
416
|
-
}
|
|
417
|
-
function We(e, t) {
|
|
418
|
-
let n = a.value;
|
|
419
|
-
if (!n) return;
|
|
420
|
-
let i = B.value.findIndex((t) => t.id === e);
|
|
421
|
-
if (i >= 0) {
|
|
422
|
-
let e = X(".nb-spreadsheet__header") || ge, t = X(".nb-spreadsheet__cell") || F.value, r = e + (V.value.length + i) * t, a = e + He(V.value), o = He(H.value);
|
|
423
|
-
r - a < n.scrollTop ? n.scrollTop = r - a : r + t > n.scrollTop + n.clientHeight - o && (n.scrollTop = r + t - n.clientHeight + o);
|
|
424
|
-
}
|
|
425
|
-
let o = t ? j.value.find((e) => e.id === t) : void 0;
|
|
426
|
-
if (o && !o.pinned) {
|
|
427
|
-
let e = r.showGutter ? r.gutterWidth : 0;
|
|
428
|
-
for (let t of j.value) {
|
|
429
|
-
if (t.id === o.id) break;
|
|
430
|
-
e += M(t);
|
|
431
|
-
}
|
|
432
|
-
let t = M(o), i = Ue("left"), a = Ue("right");
|
|
433
|
-
e - i < n.scrollLeft ? n.scrollLeft = e - i : e + t > n.scrollLeft + n.clientWidth - a && (n.scrollLeft = e + t - n.clientWidth + a);
|
|
434
|
-
}
|
|
435
|
-
Ge();
|
|
436
|
-
}
|
|
437
|
-
function Ge() {
|
|
438
|
-
E.value = a.value?.scrollTop ?? 0, D.value = a.value?.scrollLeft ?? 0;
|
|
439
|
-
}
|
|
440
|
-
function Ke() {
|
|
441
|
-
if (!h.value) return null;
|
|
442
|
-
let e = r.rows.find((e) => e.id === h.value.rowId), t = r.columns.find((e) => e.id === h.value.columnId);
|
|
443
|
-
return e && t ? {
|
|
444
|
-
r: e,
|
|
445
|
-
c: t
|
|
446
|
-
} : null;
|
|
447
|
-
}
|
|
448
|
-
function qe(e) {
|
|
449
|
-
return !e.metaKey && !e.ctrlKey && !e.altKey && e.key.length === 1;
|
|
450
|
-
}
|
|
451
|
-
function Je(e) {
|
|
452
|
-
if (T.value) {
|
|
453
|
-
e.target !== o.value && (qe(e) ? (e.preventDefault(), T.value.draft += e.key) : Ze(e));
|
|
454
|
-
return;
|
|
455
|
-
}
|
|
456
|
-
if ((e.metaKey || e.ctrlKey) && e.key.toLowerCase() === "z") {
|
|
457
|
-
e.preventDefault(), e.shiftKey ? ot() : at();
|
|
458
|
-
return;
|
|
459
|
-
}
|
|
460
|
-
switch (e.key) {
|
|
461
|
-
case "ArrowDown":
|
|
462
|
-
e.preventDefault(), J(1, 0, e.shiftKey);
|
|
463
|
-
break;
|
|
464
|
-
case "ArrowUp":
|
|
465
|
-
e.preventDefault(), J(-1, 0, e.shiftKey);
|
|
466
|
-
break;
|
|
467
|
-
case "ArrowLeft":
|
|
468
|
-
e.preventDefault(), J(0, -1, e.shiftKey);
|
|
469
|
-
break;
|
|
470
|
-
case "ArrowRight":
|
|
471
|
-
e.preventDefault(), J(0, 1, e.shiftKey);
|
|
472
|
-
break;
|
|
473
|
-
case "Tab":
|
|
474
|
-
e.preventDefault(), J(0, e.shiftKey ? -1 : 1);
|
|
475
|
-
break;
|
|
476
|
-
case "Enter":
|
|
477
|
-
e.preventDefault(), J(e.shiftKey ? -1 : 1, 0);
|
|
478
|
-
break;
|
|
479
|
-
case "Escape":
|
|
480
|
-
C.value = null, i("selection", null);
|
|
481
|
-
break;
|
|
482
|
-
case "Delete":
|
|
483
|
-
case "Backspace":
|
|
484
|
-
e.preventDefault(), $e();
|
|
485
|
-
break;
|
|
486
|
-
case "F2": {
|
|
487
|
-
e.preventDefault();
|
|
488
|
-
let t = Ke();
|
|
489
|
-
if (t && !G(t.r, t.c)) {
|
|
490
|
-
let e = U(t.r.id, t.c.id);
|
|
491
|
-
Z(t.r, t.c, e == null ? "" : String(e), "edit");
|
|
492
|
-
}
|
|
493
|
-
break;
|
|
494
|
-
}
|
|
495
|
-
default: {
|
|
496
|
-
if (!qe(e)) break;
|
|
497
|
-
let t = Ke();
|
|
498
|
-
t && !G(t.r, t.c) && (e.preventDefault(), Z(t.r, t.c, e.key, "enter"));
|
|
499
|
-
}
|
|
500
|
-
}
|
|
501
|
-
}
|
|
502
|
-
function Z(e, t, n, r) {
|
|
503
|
-
We(e.id, t.id), T.value = {
|
|
504
|
-
rowId: e.id,
|
|
505
|
-
columnId: t.id,
|
|
506
|
-
draft: n,
|
|
507
|
-
mode: r
|
|
508
|
-
}, g(() => {
|
|
509
|
-
let e = o.value;
|
|
510
|
-
if (e) if (e.focus({ preventScroll: !0 }), r === "enter") {
|
|
511
|
-
let t = e.value.length;
|
|
512
|
-
e.setSelectionRange(t, t);
|
|
513
|
-
} else e.select();
|
|
514
|
-
});
|
|
515
|
-
}
|
|
516
|
-
let Ye = d(() => {
|
|
517
|
-
if (T.value) return r.columns.find((e) => e.id === T.value.columnId)?.type === "number" ? "decimal" : "text";
|
|
518
|
-
}), Xe = d(() => {
|
|
519
|
-
if (!T.value) return { display: "none" };
|
|
520
|
-
let e = a.value, t = e?.querySelector(`[data-cell="${Y(`${T.value.rowId}::${T.value.columnId}`)}"]`);
|
|
521
|
-
if (!e || !t) return { display: "none" };
|
|
522
|
-
let n = t.getBoundingClientRect(), r = e.getBoundingClientRect();
|
|
523
|
-
return {
|
|
524
|
-
top: `${n.top - r.top - e.clientTop + E.value}px`,
|
|
525
|
-
left: `${n.left - r.left - e.clientLeft + D.value}px`,
|
|
526
|
-
width: `${n.width}px`,
|
|
527
|
-
height: `${n.height}px`
|
|
528
|
-
};
|
|
529
|
-
});
|
|
530
|
-
function Ze(e) {
|
|
531
|
-
let t = T.value?.mode, n = null;
|
|
532
|
-
switch (e.key) {
|
|
533
|
-
case "Enter":
|
|
534
|
-
n = [e.shiftKey ? -1 : 1, 0];
|
|
535
|
-
break;
|
|
536
|
-
case "Tab":
|
|
537
|
-
n = [0, e.shiftKey ? -1 : 1];
|
|
538
|
-
break;
|
|
539
|
-
case "ArrowDown":
|
|
540
|
-
n = [1, 0];
|
|
541
|
-
break;
|
|
542
|
-
case "ArrowUp":
|
|
543
|
-
n = [-1, 0];
|
|
544
|
-
break;
|
|
545
|
-
case "ArrowLeft":
|
|
546
|
-
t === "enter" && (n = [0, -1]);
|
|
547
|
-
break;
|
|
548
|
-
case "ArrowRight":
|
|
549
|
-
t === "enter" && (n = [0, 1]);
|
|
550
|
-
break;
|
|
551
|
-
case "Escape":
|
|
552
|
-
e.preventDefault(), T.value = null, q();
|
|
553
|
-
return;
|
|
554
|
-
}
|
|
555
|
-
n && (e.preventDefault(), Q(), J(n[0], n[1]));
|
|
556
|
-
}
|
|
557
|
-
function Q(e = !0) {
|
|
558
|
-
if (!T.value) return;
|
|
559
|
-
let { rowId: t, columnId: n, draft: a } = T.value;
|
|
560
|
-
T.value = null;
|
|
561
|
-
let o = r.columns.find((e) => e.id === n);
|
|
562
|
-
if (!o) return;
|
|
563
|
-
let s;
|
|
564
|
-
try {
|
|
565
|
-
s = o.parse ? o.parse(a) : we(o, a);
|
|
566
|
-
} catch {
|
|
567
|
-
e && q();
|
|
568
|
-
return;
|
|
569
|
-
}
|
|
570
|
-
let c = U(t, n);
|
|
571
|
-
if (c !== s) {
|
|
572
|
-
let e = {
|
|
573
|
-
rowId: t,
|
|
574
|
-
columnId: n,
|
|
575
|
-
before: c,
|
|
576
|
-
after: s
|
|
577
|
-
};
|
|
578
|
-
$([e]), i("commit", e), i("change", [e]);
|
|
579
|
-
}
|
|
580
|
-
e && q();
|
|
581
|
-
}
|
|
582
|
-
function Qe() {
|
|
583
|
-
if (!C.value) return [];
|
|
584
|
-
let e = [
|
|
585
|
-
...V.value,
|
|
586
|
-
...B.value,
|
|
587
|
-
...H.value
|
|
588
|
-
].map((e) => e.id), t = j.value.map((e) => e.id), n = e.indexOf(C.value.startRowId), r = e.indexOf(C.value.endRowId), i = t.indexOf(C.value.startColumnId), a = t.indexOf(C.value.endColumnId), o = [];
|
|
589
|
-
for (let s = Math.min(n, r); s <= Math.max(n, r); s++) for (let n = Math.min(i, a); n <= Math.max(i, a); n++) o.push({
|
|
590
|
-
rowId: e[s],
|
|
591
|
-
columnId: t[n]
|
|
592
|
-
});
|
|
593
|
-
return o;
|
|
594
|
-
}
|
|
595
|
-
function $e() {
|
|
596
|
-
let e = Qe(), t = [];
|
|
597
|
-
for (let { rowId: n, columnId: i } of e) {
|
|
598
|
-
let e = r.rows.find((e) => e.id === n), a = r.columns.find((e) => e.id === i);
|
|
599
|
-
if (!e || !a || G(e, a)) continue;
|
|
600
|
-
let o = U(n, i);
|
|
601
|
-
o == null || o === "" || t.push({
|
|
602
|
-
rowId: n,
|
|
603
|
-
columnId: i,
|
|
604
|
-
before: o,
|
|
605
|
-
after: null
|
|
606
|
-
});
|
|
607
|
-
}
|
|
608
|
-
if (t.length !== 0) {
|
|
609
|
-
$(t);
|
|
610
|
-
for (let e of t) i("commit", e);
|
|
611
|
-
i("change", t);
|
|
612
|
-
}
|
|
613
|
-
}
|
|
614
|
-
function et(e) {
|
|
615
|
-
if (Qe().length === 0) return;
|
|
616
|
-
let t = [
|
|
617
|
-
...V.value,
|
|
618
|
-
...B.value,
|
|
619
|
-
...H.value
|
|
620
|
-
].map((e) => e.id), n = j.value.map((e) => e.id), r = Math.min(t.indexOf(C.value.startRowId), t.indexOf(C.value.endRowId)), i = Math.max(t.indexOf(C.value.startRowId), t.indexOf(C.value.endRowId)), a = Math.min(n.indexOf(C.value.startColumnId), n.indexOf(C.value.endColumnId)), o = Math.max(n.indexOf(C.value.startColumnId), n.indexOf(C.value.endColumnId)), s = [];
|
|
621
|
-
for (let e = r; e <= i; e++) {
|
|
622
|
-
let r = [];
|
|
623
|
-
for (let i = a; i <= o; i++) {
|
|
624
|
-
let a = U(t[e], n[i]);
|
|
625
|
-
r.push(a == null ? "" : String(a));
|
|
626
|
-
}
|
|
627
|
-
s.push(r.join(" "));
|
|
628
|
-
}
|
|
629
|
-
e.preventDefault(), e.clipboardData?.setData("text/plain", s.join("\n"));
|
|
630
|
-
}
|
|
631
|
-
function tt(e) {
|
|
632
|
-
et(e), $e();
|
|
633
|
-
}
|
|
634
|
-
function nt(e) {
|
|
635
|
-
if (!h.value) return;
|
|
636
|
-
let t = e.clipboardData?.getData("text/plain") ?? "";
|
|
637
|
-
if (!t) return;
|
|
638
|
-
e.preventDefault();
|
|
639
|
-
let n = t.replace(/\r\n?/g, "\n").split("\n").map((e) => e.split(" ")), a = [
|
|
640
|
-
...V.value,
|
|
641
|
-
...B.value,
|
|
642
|
-
...H.value
|
|
643
|
-
].map((e) => e.id), o = j.value.map((e) => e.id), s = a.indexOf(h.value.rowId), c = o.indexOf(h.value.columnId), l = [];
|
|
644
|
-
if (n.forEach((e, t) => {
|
|
645
|
-
e.forEach((e, n) => {
|
|
646
|
-
let i = a[s + t], u = o[c + n];
|
|
647
|
-
if (!i || !u) return;
|
|
648
|
-
let d = r.rows.find((e) => e.id === i), f = r.columns.find((e) => e.id === u);
|
|
649
|
-
if (!d || !f || G(d, f)) return;
|
|
650
|
-
let p;
|
|
651
|
-
try {
|
|
652
|
-
p = f.parse ? f.parse(e) : we(f, e);
|
|
653
|
-
} catch {
|
|
654
|
-
return;
|
|
655
|
-
}
|
|
656
|
-
let m = U(i, u);
|
|
657
|
-
m !== p && l.push({
|
|
658
|
-
rowId: i,
|
|
659
|
-
columnId: u,
|
|
660
|
-
before: m,
|
|
661
|
-
after: p
|
|
662
|
-
});
|
|
663
|
-
});
|
|
664
|
-
}), l.length !== 0) {
|
|
665
|
-
$(l);
|
|
666
|
-
for (let e of l) i("commit", e);
|
|
667
|
-
i("change", l);
|
|
668
|
-
}
|
|
669
|
-
}
|
|
670
|
-
function rt(e, t) {
|
|
671
|
-
let n = e.clientX, r = M(t), i = t.minWidth ?? 60, a = (e) => {
|
|
672
|
-
let a = Math.max(i, r + (e.clientX - n));
|
|
673
|
-
s.value = {
|
|
674
|
-
...s.value,
|
|
675
|
-
[t.id]: a
|
|
676
|
-
};
|
|
677
|
-
}, o = () => {
|
|
678
|
-
window.removeEventListener("mousemove", a), window.removeEventListener("mouseup", o);
|
|
679
|
-
};
|
|
680
|
-
window.addEventListener("mousemove", a), window.addEventListener("mouseup", o);
|
|
681
|
-
}
|
|
682
|
-
function it(e) {
|
|
683
|
-
e.sortable && (c.value?.columnId === e.id ? c.value = c.value.direction === "asc" ? {
|
|
684
|
-
columnId: e.id,
|
|
685
|
-
direction: "desc"
|
|
686
|
-
} : null : c.value = {
|
|
687
|
-
columnId: e.id,
|
|
688
|
-
direction: "asc"
|
|
689
|
-
});
|
|
690
|
-
}
|
|
691
|
-
function $(e) {
|
|
692
|
-
k.value.push(e), A.value = [];
|
|
693
|
-
}
|
|
694
|
-
function at() {
|
|
695
|
-
let e = k.value.pop();
|
|
696
|
-
if (!e) return;
|
|
697
|
-
let t = e.map((e) => ({
|
|
698
|
-
...e,
|
|
699
|
-
before: e.after,
|
|
700
|
-
after: e.before
|
|
701
|
-
}));
|
|
702
|
-
for (let e of t) i("commit", e);
|
|
703
|
-
i("change", t), A.value.push(e);
|
|
704
|
-
}
|
|
705
|
-
function ot() {
|
|
706
|
-
let e = A.value.pop();
|
|
707
|
-
if (e) {
|
|
708
|
-
for (let t of e) i("commit", t);
|
|
709
|
-
i("change", e), k.value.push(e);
|
|
710
|
-
}
|
|
711
|
-
}
|
|
712
|
-
return te(() => {
|
|
713
|
-
q(), I(), z(), typeof ResizeObserver < "u" && a.value && (L = new ResizeObserver(() => {
|
|
714
|
-
I(), z();
|
|
715
|
-
}), L.observe(a.value));
|
|
716
|
-
}), ee(() => L?.disconnect()), t({
|
|
717
|
-
focus: (e, t) => K(e, t),
|
|
718
|
-
undo: at,
|
|
719
|
-
redo: ot,
|
|
720
|
-
getSelection: () => C.value
|
|
721
|
-
}), (t, n) => (y(), p("div", {
|
|
722
|
-
class: _(["nb-spreadsheet", {
|
|
723
|
-
"nb-spreadsheet--editing": !!T.value,
|
|
724
|
-
"nb-spreadsheet--fit": e.fit
|
|
725
|
-
}]),
|
|
726
|
-
style: v(ye.value)
|
|
727
|
-
}, [t.$slots.toolbar ? (y(), p("div", ce, [ne(t.$slots, "toolbar", {}, void 0, !0)])) : f("", !0), m("div", {
|
|
728
|
-
ref_key: "scrollerRef",
|
|
729
|
-
ref: a,
|
|
730
|
-
class: "nb-spreadsheet__scroller",
|
|
731
|
-
tabindex: "0",
|
|
732
|
-
onKeydown: Je,
|
|
733
|
-
onCopy: et,
|
|
734
|
-
onCut: tt,
|
|
735
|
-
onPaste: nt,
|
|
736
|
-
onScroll: Ge
|
|
737
|
-
}, [m("div", {
|
|
738
|
-
class: "nb-spreadsheet__grid",
|
|
739
|
-
style: v(be.value)
|
|
740
|
-
}, [
|
|
741
|
-
e.showGutter ? (y(), p("div", le)) : f("", !0),
|
|
742
|
-
(y(!0), p(u, null, x(j.value, (t, n) => (y(), p("div", {
|
|
743
|
-
key: `h-${t.id}`,
|
|
744
|
-
class: _(["nb-spreadsheet__header", Oe(t)]),
|
|
745
|
-
"data-header-col": t.id,
|
|
746
|
-
style: v(je(t, n)),
|
|
747
|
-
onClick: (e) => it(t)
|
|
748
|
-
}, [
|
|
749
|
-
m("span", {
|
|
750
|
-
class: "nb-spreadsheet__header-label",
|
|
751
|
-
title: R.value.has(t.id) ? t.label : void 0
|
|
752
|
-
}, S(R.value.has(t.id) ? t.shortLabel : t.label), 9, de),
|
|
753
|
-
c.value && c.value.columnId === t.id ? (y(), p("span", fe, S(c.value.direction === "asc" ? "▲" : "▼"), 1)) : f("", !0),
|
|
754
|
-
e.resizable ? (y(), p("span", {
|
|
755
|
-
key: 1,
|
|
756
|
-
class: "nb-spreadsheet__resize-handle",
|
|
757
|
-
onMousedown: se((e) => rt(e, t), ["stop"])
|
|
758
|
-
}, null, 40, pe)) : f("", !0)
|
|
759
|
-
], 14, ue))), 128)),
|
|
760
|
-
(y(!0), p(u, null, x(Se.value, (t) => (y(), p(u, { key: `r-${t.id}` }, [e.showGutter ? (y(), p("div", {
|
|
761
|
-
key: 0,
|
|
762
|
-
class: _(["nb-spreadsheet__gutter", {
|
|
763
|
-
"nb-spreadsheet__gutter--pinned-top": t.pinned === "top",
|
|
764
|
-
"nb-spreadsheet__gutter--pinned-bottom": t.pinned === "bottom"
|
|
765
|
-
}]),
|
|
766
|
-
style: v(Fe(t))
|
|
767
|
-
}, S(Pe(t)), 7)) : f("", !0), (y(!0), p(u, null, x(j.value, (e, r) => (y(), p("div", {
|
|
768
|
-
key: `c-${t.id}-${e.id}`,
|
|
769
|
-
class: _(["nb-spreadsheet__cell", Ee(t, e)]),
|
|
770
|
-
style: v(Me(t, e, r)),
|
|
771
|
-
title: De(t, e),
|
|
772
|
-
"data-cell": `${t.id}::${e.id}`,
|
|
773
|
-
"data-row": t.id,
|
|
774
|
-
"data-col": e.id,
|
|
775
|
-
onPointerdown: n[0] ||= (e) => Le(e),
|
|
776
|
-
onMousedown: (n) => Re(n, t, e),
|
|
777
|
-
onMouseenter: (n) => ze(t, e),
|
|
778
|
-
onDblclick: (n) => Ve(t, e)
|
|
779
|
-
}, [m("span", null, S(Te(t, e)), 1)], 46, me))), 128))], 64))), 128))
|
|
780
|
-
], 4), T.value ? oe((y(), p("input", {
|
|
781
|
-
key: 0,
|
|
782
|
-
ref_key: "editorRef",
|
|
783
|
-
ref: o,
|
|
784
|
-
"onUpdate:modelValue": n[1] ||= (e) => T.value.draft = e,
|
|
785
|
-
class: "nb-spreadsheet__editor",
|
|
786
|
-
style: v(Xe.value),
|
|
787
|
-
inputmode: Ye.value,
|
|
788
|
-
enterkeyhint: "next",
|
|
789
|
-
onBlur: n[2] ||= (e) => Q(!1),
|
|
790
|
-
onKeydown: se(Ze, ["stop"])
|
|
791
|
-
}, null, 44, he)), [[ie, T.value.draft]]) : f("", !0)], 544)], 6));
|
|
792
|
-
}
|
|
793
|
-
}), N = /* @__PURE__ */ r({ default: () => P }), P = /* @__PURE__ */ c(M, [["__scopeId", "data-v-08b9812f"]]), F = /* @__PURE__ */ Object.assign({ "./components/labs/Spreadsheet.vue": N }), I = { install(e) {
|
|
794
|
-
Object.keys(F).forEach((t) => {
|
|
795
|
-
let n = `Nb${t.replace(/(.+\/)(\w+)(\.vue)$/, "$2")}`, r = F[t];
|
|
796
|
-
e.component(n, r.default);
|
|
797
|
-
});
|
|
798
|
-
} }, L = { install(e, t = {}) {
|
|
799
|
-
if (t.components) for (let [n, r] of Object.entries(t.components)) e.component(n, r);
|
|
800
|
-
if (e.provide(n, { ...t.button }), t.ssr) {
|
|
801
|
-
let t = b(!0);
|
|
802
|
-
e.provide(s, { pending: t });
|
|
803
|
-
let n = e.mount.bind(e);
|
|
804
|
-
e.mount = ((...e) => {
|
|
805
|
-
let r = n(...e);
|
|
806
|
-
return t.value = !1, r;
|
|
807
|
-
});
|
|
808
|
-
}
|
|
809
|
-
e.use(k), e.use(A);
|
|
810
|
-
} };
|
|
811
|
-
//#endregion
|
|
812
|
-
export { A as a, j as i, I as n, D as o, P as r, L as t };
|