@nubisco/ui 5.55.0 → 5.56.1
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/all.cjs +1 -1
- package/dist/all.mjs +1 -1
- package/dist/components/labs/Spreadsheet.d.ts +14 -0
- package/dist/components/labs/Spreadsheet.vue.d.ts +1 -0
- package/dist/components/labs/Spreadsheet.vue.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/main-BDjSW3PC.js +814 -0
- package/dist/main-CjGCxppI.cjs +4 -0
- package/dist/styles/main.css +1 -1
- package/dist/ui.css +1 -1
- package/package.json +1 -1
- package/dist/main-BMIeIxGV.cjs +0 -4
- package/dist/main-BXz7vG2i.js +0 -754
|
@@ -0,0 +1,814 @@
|
|
|
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 C, vModelText as re, watch as ie, withDirectives as ae, withModifiers as oe } from "vue";
|
|
8
|
+
//#region src/directives/ContextMenu.directive.ts
|
|
9
|
+
var w = /* @__PURE__ */ r({ default: () => T });
|
|
10
|
+
function T(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 E = /* @__PURE__ */ r({ default: () => O });
|
|
39
|
+
function D(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 O = (e) => {
|
|
48
|
+
e.directive("nb-tour-step", {
|
|
49
|
+
mounted: D,
|
|
50
|
+
updated: D,
|
|
51
|
+
unmounted(e) {
|
|
52
|
+
e.removeAttribute(i);
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
}, k = /* @__PURE__ */ Object.assign({
|
|
56
|
+
"./ContextMenu.directive.ts": w,
|
|
57
|
+
"./ToolTip.content.ts": t,
|
|
58
|
+
"./ToolTip.directive.ts": e,
|
|
59
|
+
"./TourStep.directive.ts": E
|
|
60
|
+
}), A = { install(e) {
|
|
61
|
+
Object.values(k).forEach((t) => {
|
|
62
|
+
typeof t.default == "function" && t.default(e);
|
|
63
|
+
});
|
|
64
|
+
} }, j = { install(e) {
|
|
65
|
+
let t = o();
|
|
66
|
+
e.provide(a, t);
|
|
67
|
+
} }, M = /* @__PURE__ */ function(e) {
|
|
68
|
+
return e.Object = "object", e.Array = "array", e.Primitive = "primitive", e;
|
|
69
|
+
}(M || {}), se = {
|
|
70
|
+
key: 0,
|
|
71
|
+
class: "nb-spreadsheet__toolbar"
|
|
72
|
+
}, ce = {
|
|
73
|
+
key: 0,
|
|
74
|
+
class: "nb-spreadsheet__corner",
|
|
75
|
+
style: {
|
|
76
|
+
gridRow: 1,
|
|
77
|
+
gridColumn: 1
|
|
78
|
+
}
|
|
79
|
+
}, le = ["data-header-col", "onClick"], ue = ["title"], de = {
|
|
80
|
+
key: 0,
|
|
81
|
+
class: "nb-spreadsheet__sort",
|
|
82
|
+
"aria-hidden": "true"
|
|
83
|
+
}, fe = ["onMousedown"], pe = [
|
|
84
|
+
"title",
|
|
85
|
+
"data-cell",
|
|
86
|
+
"data-row",
|
|
87
|
+
"data-col",
|
|
88
|
+
"onMousedown",
|
|
89
|
+
"onMouseenter",
|
|
90
|
+
"onDblclick"
|
|
91
|
+
], me = ["inputmode"], he = 36, ge = 32, _e = 20, N = /* @__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 = C("rootRef"), o = C("scrollerRef"), s = C("editorRef"), c = b({}), h = b(null), w = b(null), T = b(null), E = b(!1), D = b(null), O = b(0), k = b(0), A = "", j = b([]), M = b([]), N = 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 P(e) {
|
|
135
|
+
return c.value[e.id] ?? e.width ?? 120;
|
|
136
|
+
}
|
|
137
|
+
let { phoneTouch: F } = l(), I = b(null), L = d(() => I.value ?? ge);
|
|
138
|
+
function R() {
|
|
139
|
+
let e = a.value, t = o.value;
|
|
140
|
+
if (!r.fit || F.value || !e || !t || !r.rows.length) {
|
|
141
|
+
I.value = null;
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
let n = e.querySelector(".nb-spreadsheet__toolbar"), i = t.offsetHeight - t.clientHeight, s = e.clientHeight - (n?.offsetHeight ?? 0) - i, c = Q(".nb-spreadsheet__header") || he, l = Math.floor((s - c) / r.rows.length);
|
|
145
|
+
I.value = Math.min(ge, Math.max(_e, l));
|
|
146
|
+
}
|
|
147
|
+
let z = null;
|
|
148
|
+
ie(() => [
|
|
149
|
+
r.fit,
|
|
150
|
+
r.rows.length,
|
|
151
|
+
F.value
|
|
152
|
+
], () => R());
|
|
153
|
+
let ve = d(() => I.value === null ? void 0 : { "--nbss-row-height": `${I.value}px` }), ye = d(() => ({
|
|
154
|
+
gridTemplateColumns: (r.showGutter ? `${r.gutterWidth}px ` : "") + N.value.map((e) => r.fit && !e.pinned ? `minmax(${P(e)}px, 1fr)` : `${P(e)}px`).join(" "),
|
|
155
|
+
gridTemplateRows: "var(--nbss-header-height)"
|
|
156
|
+
})), B = b(/* @__PURE__ */ new Set()), be = /* @__PURE__ */ new Map();
|
|
157
|
+
function V() {
|
|
158
|
+
let e = o.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="${Z(a.id)}"] .nb-spreadsheet__header-label`);
|
|
164
|
+
if (!r) continue;
|
|
165
|
+
let o = `${a.id}::${a.label}`;
|
|
166
|
+
B.value.has(a.id) || be.set(o, r.scrollWidth);
|
|
167
|
+
let s = be.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
|
+
B.value = new Set(n ? t : []), i && g(V);
|
|
175
|
+
}
|
|
176
|
+
ie(() => [r.columns, c.value], () => void g(V), { deep: !0 });
|
|
177
|
+
let H = d(() => {
|
|
178
|
+
let e = r.rows.filter((e) => !e.pinned);
|
|
179
|
+
if (!h.value) return e;
|
|
180
|
+
let t = r.columns.find((e) => e.id === h.value.columnId);
|
|
181
|
+
if (!t) return e;
|
|
182
|
+
let n = h.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
|
+
}), U = d(() => r.rows.filter((e) => e.pinned === "top")), W = d(() => r.rows.filter((e) => e.pinned === "bottom")), xe = d(() => {
|
|
185
|
+
let e = Math.max(1, Math.ceil((o.value?.clientHeight ?? 600) / L.value)), t = Math.max(10, Math.floor(r.windowRows / 4)), n = Math.floor(O.value / L.value) - U.value.length - t, i = Math.max(0, n), a = Math.min(H.value.length, i + e + t * 2), s = U.value.map((e, t) => ({
|
|
186
|
+
...e,
|
|
187
|
+
__virtualIndex: t,
|
|
188
|
+
gutterLabel: ""
|
|
189
|
+
})), c = H.value.slice(i, a).map((e, t) => ({
|
|
190
|
+
...e,
|
|
191
|
+
__virtualIndex: i + t + U.value.length
|
|
192
|
+
})), l = W.value.map((e, t) => ({
|
|
193
|
+
...e,
|
|
194
|
+
__virtualIndex: U.value.length + H.value.length + t,
|
|
195
|
+
gutterLabel: ""
|
|
196
|
+
}));
|
|
197
|
+
return [
|
|
198
|
+
...s,
|
|
199
|
+
...c,
|
|
200
|
+
...l
|
|
201
|
+
];
|
|
202
|
+
});
|
|
203
|
+
function Se(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 Ce(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 G(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, G);
|
|
235
|
+
}
|
|
236
|
+
function K(e, t) {
|
|
237
|
+
return r.cellAttrs ? r.cellAttrs(e.id, t.id, e, t) ?? {} : {};
|
|
238
|
+
}
|
|
239
|
+
function we(e, t) {
|
|
240
|
+
let n = K(e, t);
|
|
241
|
+
if (n.display !== void 0) return n.display;
|
|
242
|
+
let r = G(e.id, t.id);
|
|
243
|
+
return t.format ? t.format(r, e) : Se(t, r);
|
|
244
|
+
}
|
|
245
|
+
function Te(e, t) {
|
|
246
|
+
let n = K(e, t), r = w.value?.rowId === e.id && w.value?.columnId === t.id, i = Fe(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": q(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 q(e, t) {
|
|
260
|
+
if (e.computed || t.readOnly) return !0;
|
|
261
|
+
let n = K(e, t);
|
|
262
|
+
return !!n.readOnly || !!n.computed;
|
|
263
|
+
}
|
|
264
|
+
function Ee(e, t) {
|
|
265
|
+
return K(e, t).tooltip ?? "";
|
|
266
|
+
}
|
|
267
|
+
function De(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 === N.value[N.value.length - 1]?.id
|
|
273
|
+
};
|
|
274
|
+
}
|
|
275
|
+
function Oe(e) {
|
|
276
|
+
if (e.pinned !== "left") return 0;
|
|
277
|
+
let t = r.showGutter ? r.gutterWidth : 0;
|
|
278
|
+
for (let n of N.value) {
|
|
279
|
+
if (n.id === e.id) break;
|
|
280
|
+
n.pinned === "left" && (t += P(n));
|
|
281
|
+
}
|
|
282
|
+
return t;
|
|
283
|
+
}
|
|
284
|
+
function ke(e) {
|
|
285
|
+
if (e.pinned !== "right") return 0;
|
|
286
|
+
let t = 0, n = [...N.value].reverse();
|
|
287
|
+
for (let r of n) {
|
|
288
|
+
if (r.id === e.id) break;
|
|
289
|
+
r.pinned === "right" && (t += P(r));
|
|
290
|
+
}
|
|
291
|
+
return t;
|
|
292
|
+
}
|
|
293
|
+
function Ae(e, t) {
|
|
294
|
+
let n = (r.showGutter ? 2 : 1) + t, i = {};
|
|
295
|
+
return e.pinned === "left" ? (i.position = "sticky", i.left = `${Oe(e)}px`, i.zIndex = "3") : e.pinned === "right" && (i.position = "sticky", i.right = `${ke(e)}px`, i.zIndex = "3"), {
|
|
296
|
+
gridRow: 1,
|
|
297
|
+
gridColumn: n,
|
|
298
|
+
...i
|
|
299
|
+
};
|
|
300
|
+
}
|
|
301
|
+
function je(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 = `${Oe(t)}px`, o.zIndex = "2") : t.pinned === "right" && (o.position = "sticky", o.right = `${ke(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, Me(e))), {
|
|
304
|
+
gridRow: a,
|
|
305
|
+
gridColumn: i,
|
|
306
|
+
...o
|
|
307
|
+
};
|
|
308
|
+
}
|
|
309
|
+
function Me(e) {
|
|
310
|
+
if (e.pinned === "top") {
|
|
311
|
+
let t = U.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 = W.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 Ne(e) {
|
|
321
|
+
return e.label === void 0 ? e.gutterLabel === void 0 ? String(e.__virtualIndex - U.value.length + 1) : e.gutterLabel : e.label;
|
|
322
|
+
}
|
|
323
|
+
function Pe(e) {
|
|
324
|
+
let t = {
|
|
325
|
+
position: "sticky",
|
|
326
|
+
left: "0",
|
|
327
|
+
zIndex: "2"
|
|
328
|
+
};
|
|
329
|
+
return e.pinned && (Object.assign(t, Me(e)), t.zIndex = "4"), {
|
|
330
|
+
gridRow: e.__virtualIndex + 2,
|
|
331
|
+
gridColumn: 1,
|
|
332
|
+
...t
|
|
333
|
+
};
|
|
334
|
+
}
|
|
335
|
+
function Fe(e, t) {
|
|
336
|
+
if (!T.value) return !1;
|
|
337
|
+
let n = [
|
|
338
|
+
...U.value,
|
|
339
|
+
...H.value,
|
|
340
|
+
...W.value
|
|
341
|
+
].map((e) => e.id), r = N.value.map((e) => e.id), i = n.indexOf(T.value.startRowId), a = n.indexOf(T.value.endRowId), o = r.indexOf(T.value.startColumnId), s = r.indexOf(T.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 J(e, t, n = !1) {
|
|
345
|
+
w.value = {
|
|
346
|
+
rowId: e,
|
|
347
|
+
columnId: t
|
|
348
|
+
}, n && T.value ? T.value = {
|
|
349
|
+
...T.value,
|
|
350
|
+
endRowId: e,
|
|
351
|
+
endColumnId: t
|
|
352
|
+
} : T.value = {
|
|
353
|
+
startRowId: e,
|
|
354
|
+
startColumnId: t,
|
|
355
|
+
endRowId: e,
|
|
356
|
+
endColumnId: t
|
|
357
|
+
}, i("focus", w.value), i("selection", T.value);
|
|
358
|
+
}
|
|
359
|
+
function Ie(e) {
|
|
360
|
+
A = e.pointerType;
|
|
361
|
+
}
|
|
362
|
+
function Le(e, t, n) {
|
|
363
|
+
let r = A === "touch" && !e.shiftKey && w.value?.rowId === t.id && w.value?.columnId === n.id;
|
|
364
|
+
if (A = "", D.value && Ze(), E.value = !0, J(t.id, n.id, e.shiftKey), Y(), e.preventDefault(), document.addEventListener("mouseup", ze, { once: !0 }), r && !q(t, n)) {
|
|
365
|
+
let e = G(t.id, n.id);
|
|
366
|
+
$(t, n, e == null ? "" : String(e), "edit");
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
function Re(e, t) {
|
|
370
|
+
!E.value || !T.value || (T.value = {
|
|
371
|
+
...T.value,
|
|
372
|
+
endRowId: e.id,
|
|
373
|
+
endColumnId: t.id
|
|
374
|
+
}, i("selection", T.value));
|
|
375
|
+
}
|
|
376
|
+
function ze() {
|
|
377
|
+
E.value = !1;
|
|
378
|
+
}
|
|
379
|
+
function Be(e, t) {
|
|
380
|
+
if (q(e, t)) return;
|
|
381
|
+
let n = G(e.id, t.id);
|
|
382
|
+
$(e, t, n == null ? "" : String(n), "edit");
|
|
383
|
+
}
|
|
384
|
+
function Y() {
|
|
385
|
+
o.value?.focus({ preventScroll: !0 });
|
|
386
|
+
}
|
|
387
|
+
function X(e, t, n = !1) {
|
|
388
|
+
if (!w.value) {
|
|
389
|
+
let e = N.value[0], t = xe.value[0];
|
|
390
|
+
e && t && J(t.id, e.id);
|
|
391
|
+
return;
|
|
392
|
+
}
|
|
393
|
+
let r = [
|
|
394
|
+
...U.value,
|
|
395
|
+
...H.value,
|
|
396
|
+
...W.value
|
|
397
|
+
], i = r.findIndex((e) => e.id === w.value.rowId), a = N.value.findIndex((e) => e.id === w.value.columnId), o = Math.max(0, Math.min(r.length - 1, i + e)), s = Math.max(0, Math.min(N.value.length - 1, a + t)), c = r[o].id, l = N.value[s].id;
|
|
398
|
+
J(c, l, n), Ue(c, l);
|
|
399
|
+
}
|
|
400
|
+
function Z(e) {
|
|
401
|
+
return e.replace(/["\\]/g, "\\$&");
|
|
402
|
+
}
|
|
403
|
+
function Q(e) {
|
|
404
|
+
let t = o.value?.querySelector(e);
|
|
405
|
+
return t ? t.offsetHeight : 0;
|
|
406
|
+
}
|
|
407
|
+
function Ve(e) {
|
|
408
|
+
let t = 0;
|
|
409
|
+
for (let n of e) t += Q(`[data-row="${Z(n.id)}"]`);
|
|
410
|
+
return t;
|
|
411
|
+
}
|
|
412
|
+
function He(e) {
|
|
413
|
+
let t = e === "left" && r.showGutter ? r.gutterWidth : 0;
|
|
414
|
+
for (let n of N.value) n.pinned === e && (t += P(n));
|
|
415
|
+
return t;
|
|
416
|
+
}
|
|
417
|
+
function Ue(e, t) {
|
|
418
|
+
let n = o.value;
|
|
419
|
+
if (!n) return;
|
|
420
|
+
let i = H.value.findIndex((t) => t.id === e);
|
|
421
|
+
if (i >= 0) {
|
|
422
|
+
let e = Q(".nb-spreadsheet__header") || he, t = Q(".nb-spreadsheet__cell") || L.value, r = e + (U.value.length + i) * t, a = e + Ve(U.value), o = Ve(W.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 a = t ? N.value.find((e) => e.id === t) : void 0;
|
|
426
|
+
if (a && !a.pinned) {
|
|
427
|
+
let e = r.showGutter ? r.gutterWidth : 0;
|
|
428
|
+
for (let t of N.value) {
|
|
429
|
+
if (t.id === a.id) break;
|
|
430
|
+
e += P(t);
|
|
431
|
+
}
|
|
432
|
+
let t = P(a), i = He("left"), o = He("right");
|
|
433
|
+
e - i < n.scrollLeft ? n.scrollLeft = e - i : e + t > n.scrollLeft + n.clientWidth - o && (n.scrollLeft = e + t - n.clientWidth + o);
|
|
434
|
+
}
|
|
435
|
+
We();
|
|
436
|
+
}
|
|
437
|
+
function We() {
|
|
438
|
+
O.value = o.value?.scrollTop ?? 0, k.value = o.value?.scrollLeft ?? 0;
|
|
439
|
+
}
|
|
440
|
+
function Ge() {
|
|
441
|
+
if (!w.value) return null;
|
|
442
|
+
let e = r.rows.find((e) => e.id === w.value.rowId), t = r.columns.find((e) => e.id === w.value.columnId);
|
|
443
|
+
return e && t ? {
|
|
444
|
+
r: e,
|
|
445
|
+
c: t
|
|
446
|
+
} : null;
|
|
447
|
+
}
|
|
448
|
+
function Ke(e) {
|
|
449
|
+
return !e.metaKey && !e.ctrlKey && !e.altKey && e.key.length === 1;
|
|
450
|
+
}
|
|
451
|
+
function qe(e) {
|
|
452
|
+
if (D.value) {
|
|
453
|
+
e.target !== s.value && (Ke(e) ? (e.preventDefault(), D.value.draft += e.key) : Xe(e));
|
|
454
|
+
return;
|
|
455
|
+
}
|
|
456
|
+
if ((e.metaKey || e.ctrlKey) && e.key.toLowerCase() === "z") {
|
|
457
|
+
e.preventDefault(), e.shiftKey ? st() : ot();
|
|
458
|
+
return;
|
|
459
|
+
}
|
|
460
|
+
switch (e.key) {
|
|
461
|
+
case "ArrowDown":
|
|
462
|
+
e.preventDefault(), X(1, 0, e.shiftKey);
|
|
463
|
+
break;
|
|
464
|
+
case "ArrowUp":
|
|
465
|
+
e.preventDefault(), X(-1, 0, e.shiftKey);
|
|
466
|
+
break;
|
|
467
|
+
case "ArrowLeft":
|
|
468
|
+
e.preventDefault(), X(0, -1, e.shiftKey);
|
|
469
|
+
break;
|
|
470
|
+
case "ArrowRight":
|
|
471
|
+
e.preventDefault(), X(0, 1, e.shiftKey);
|
|
472
|
+
break;
|
|
473
|
+
case "Tab":
|
|
474
|
+
e.preventDefault(), X(0, e.shiftKey ? -1 : 1);
|
|
475
|
+
break;
|
|
476
|
+
case "Enter":
|
|
477
|
+
e.preventDefault(), X(e.shiftKey ? -1 : 1, 0);
|
|
478
|
+
break;
|
|
479
|
+
case "Escape":
|
|
480
|
+
T.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 = Ge();
|
|
489
|
+
if (t && !q(t.r, t.c)) {
|
|
490
|
+
let e = G(t.r.id, t.c.id);
|
|
491
|
+
$(t.r, t.c, e == null ? "" : String(e), "edit");
|
|
492
|
+
}
|
|
493
|
+
break;
|
|
494
|
+
}
|
|
495
|
+
default: {
|
|
496
|
+
if (!Ke(e)) break;
|
|
497
|
+
let t = Ge();
|
|
498
|
+
t && !q(t.r, t.c) && (e.preventDefault(), $(t.r, t.c, e.key, "enter"));
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
function $(e, t, n, r) {
|
|
503
|
+
Ue(e.id, t.id), D.value = {
|
|
504
|
+
rowId: e.id,
|
|
505
|
+
columnId: t.id,
|
|
506
|
+
draft: n,
|
|
507
|
+
mode: r
|
|
508
|
+
}, g(() => {
|
|
509
|
+
let e = s.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 Je = d(() => {
|
|
517
|
+
if (D.value) return r.columns.find((e) => e.id === D.value.columnId)?.type === "number" ? "decimal" : "text";
|
|
518
|
+
}), Ye = d(() => {
|
|
519
|
+
if (!D.value) return { display: "none" };
|
|
520
|
+
let e = o.value, t = e?.querySelector(`[data-cell="${Z(`${D.value.rowId}::${D.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 + O.value}px`,
|
|
525
|
+
left: `${n.left - r.left - e.clientLeft + k.value}px`,
|
|
526
|
+
width: `${n.width}px`,
|
|
527
|
+
height: `${n.height}px`
|
|
528
|
+
};
|
|
529
|
+
});
|
|
530
|
+
function Xe(e) {
|
|
531
|
+
let t = D.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(), D.value = null, Y();
|
|
553
|
+
return;
|
|
554
|
+
}
|
|
555
|
+
n && (e.preventDefault(), Ze(), X(n[0], n[1]));
|
|
556
|
+
}
|
|
557
|
+
function Ze(e = !0) {
|
|
558
|
+
if (!D.value) return;
|
|
559
|
+
let { rowId: t, columnId: n, draft: a } = D.value;
|
|
560
|
+
D.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) : Ce(o, a);
|
|
566
|
+
} catch {
|
|
567
|
+
e && Y();
|
|
568
|
+
return;
|
|
569
|
+
}
|
|
570
|
+
let c = G(t, n);
|
|
571
|
+
if (c !== s) {
|
|
572
|
+
let e = {
|
|
573
|
+
rowId: t,
|
|
574
|
+
columnId: n,
|
|
575
|
+
before: c,
|
|
576
|
+
after: s
|
|
577
|
+
};
|
|
578
|
+
at([e]), i("commit", e), i("change", [e]);
|
|
579
|
+
}
|
|
580
|
+
e && Y();
|
|
581
|
+
}
|
|
582
|
+
function Qe() {
|
|
583
|
+
if (!T.value) return [];
|
|
584
|
+
let e = [
|
|
585
|
+
...U.value,
|
|
586
|
+
...H.value,
|
|
587
|
+
...W.value
|
|
588
|
+
].map((e) => e.id), t = N.value.map((e) => e.id), n = e.indexOf(T.value.startRowId), r = e.indexOf(T.value.endRowId), i = t.indexOf(T.value.startColumnId), a = t.indexOf(T.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 || q(e, a)) continue;
|
|
600
|
+
let o = G(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
|
+
at(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
|
+
...U.value,
|
|
618
|
+
...H.value,
|
|
619
|
+
...W.value
|
|
620
|
+
].map((e) => e.id), n = N.value.map((e) => e.id), r = Math.min(t.indexOf(T.value.startRowId), t.indexOf(T.value.endRowId)), i = Math.max(t.indexOf(T.value.startRowId), t.indexOf(T.value.endRowId)), a = Math.min(n.indexOf(T.value.startColumnId), n.indexOf(T.value.endColumnId)), o = Math.max(n.indexOf(T.value.startColumnId), n.indexOf(T.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 = G(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 (!w.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
|
+
...U.value,
|
|
641
|
+
...H.value,
|
|
642
|
+
...W.value
|
|
643
|
+
].map((e) => e.id), o = N.value.map((e) => e.id), s = a.indexOf(w.value.rowId), c = o.indexOf(w.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 || q(d, f)) return;
|
|
650
|
+
let p;
|
|
651
|
+
try {
|
|
652
|
+
p = f.parse ? f.parse(e) : Ce(f, e);
|
|
653
|
+
} catch {
|
|
654
|
+
return;
|
|
655
|
+
}
|
|
656
|
+
let m = G(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
|
+
at(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 = P(t), i = t.minWidth ?? 60, a = (e) => {
|
|
672
|
+
let a = Math.max(i, r + (e.clientX - n));
|
|
673
|
+
c.value = {
|
|
674
|
+
...c.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 && (h.value?.columnId === e.id ? h.value = h.value.direction === "asc" ? {
|
|
684
|
+
columnId: e.id,
|
|
685
|
+
direction: "desc"
|
|
686
|
+
} : null : h.value = {
|
|
687
|
+
columnId: e.id,
|
|
688
|
+
direction: "asc"
|
|
689
|
+
});
|
|
690
|
+
}
|
|
691
|
+
function at(e) {
|
|
692
|
+
j.value.push(e), M.value = [];
|
|
693
|
+
}
|
|
694
|
+
function ot() {
|
|
695
|
+
let e = j.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), M.value.push(e);
|
|
704
|
+
}
|
|
705
|
+
function st() {
|
|
706
|
+
let e = M.value.pop();
|
|
707
|
+
if (e) {
|
|
708
|
+
for (let t of e) i("commit", t);
|
|
709
|
+
i("change", e), j.value.push(e);
|
|
710
|
+
}
|
|
711
|
+
}
|
|
712
|
+
return te(() => {
|
|
713
|
+
Y(), R(), V(), typeof ResizeObserver < "u" && o.value && (z = new ResizeObserver(() => {
|
|
714
|
+
R(), V();
|
|
715
|
+
}), z.observe(o.value), a.value && z.observe(a.value));
|
|
716
|
+
}), ee(() => z?.disconnect()), t({
|
|
717
|
+
focus: (e, t) => J(e, t),
|
|
718
|
+
undo: ot,
|
|
719
|
+
redo: st,
|
|
720
|
+
getSelection: () => T.value
|
|
721
|
+
}), (t, n) => (y(), p("div", {
|
|
722
|
+
ref_key: "rootRef",
|
|
723
|
+
ref: a,
|
|
724
|
+
class: _(["nb-spreadsheet", {
|
|
725
|
+
"nb-spreadsheet--editing": !!D.value,
|
|
726
|
+
"nb-spreadsheet--fit": e.fit
|
|
727
|
+
}]),
|
|
728
|
+
style: v(ve.value)
|
|
729
|
+
}, [t.$slots.toolbar ? (y(), p("div", se, [ne(t.$slots, "toolbar", {}, void 0, !0)])) : f("", !0), m("div", {
|
|
730
|
+
ref_key: "scrollerRef",
|
|
731
|
+
ref: o,
|
|
732
|
+
class: "nb-spreadsheet__scroller",
|
|
733
|
+
tabindex: "0",
|
|
734
|
+
onKeydown: qe,
|
|
735
|
+
onCopy: et,
|
|
736
|
+
onCut: tt,
|
|
737
|
+
onPaste: nt,
|
|
738
|
+
onScroll: We
|
|
739
|
+
}, [m("div", {
|
|
740
|
+
class: "nb-spreadsheet__grid",
|
|
741
|
+
style: v(ye.value)
|
|
742
|
+
}, [
|
|
743
|
+
e.showGutter ? (y(), p("div", ce)) : f("", !0),
|
|
744
|
+
(y(!0), p(u, null, x(N.value, (t, n) => (y(), p("div", {
|
|
745
|
+
key: `h-${t.id}`,
|
|
746
|
+
class: _(["nb-spreadsheet__header", De(t)]),
|
|
747
|
+
"data-header-col": t.id,
|
|
748
|
+
style: v(Ae(t, n)),
|
|
749
|
+
onClick: (e) => it(t)
|
|
750
|
+
}, [
|
|
751
|
+
m("span", {
|
|
752
|
+
class: "nb-spreadsheet__header-label",
|
|
753
|
+
title: B.value.has(t.id) ? t.label : void 0
|
|
754
|
+
}, S(B.value.has(t.id) ? t.shortLabel : t.label), 9, ue),
|
|
755
|
+
h.value && h.value.columnId === t.id ? (y(), p("span", de, S(h.value.direction === "asc" ? "▲" : "▼"), 1)) : f("", !0),
|
|
756
|
+
e.resizable ? (y(), p("span", {
|
|
757
|
+
key: 1,
|
|
758
|
+
class: "nb-spreadsheet__resize-handle",
|
|
759
|
+
onMousedown: oe((e) => rt(e, t), ["stop"])
|
|
760
|
+
}, null, 40, fe)) : f("", !0)
|
|
761
|
+
], 14, le))), 128)),
|
|
762
|
+
(y(!0), p(u, null, x(xe.value, (t) => (y(), p(u, { key: `r-${t.id}` }, [e.showGutter ? (y(), p("div", {
|
|
763
|
+
key: 0,
|
|
764
|
+
class: _(["nb-spreadsheet__gutter", {
|
|
765
|
+
"nb-spreadsheet__gutter--pinned-top": t.pinned === "top",
|
|
766
|
+
"nb-spreadsheet__gutter--pinned-bottom": t.pinned === "bottom"
|
|
767
|
+
}]),
|
|
768
|
+
style: v(Pe(t))
|
|
769
|
+
}, S(Ne(t)), 7)) : f("", !0), (y(!0), p(u, null, x(N.value, (e, r) => (y(), p("div", {
|
|
770
|
+
key: `c-${t.id}-${e.id}`,
|
|
771
|
+
class: _(["nb-spreadsheet__cell", Te(t, e)]),
|
|
772
|
+
style: v(je(t, e, r)),
|
|
773
|
+
title: Ee(t, e),
|
|
774
|
+
"data-cell": `${t.id}::${e.id}`,
|
|
775
|
+
"data-row": t.id,
|
|
776
|
+
"data-col": e.id,
|
|
777
|
+
onPointerdown: n[0] ||= (e) => Ie(e),
|
|
778
|
+
onMousedown: (n) => Le(n, t, e),
|
|
779
|
+
onMouseenter: (n) => Re(t, e),
|
|
780
|
+
onDblclick: (n) => Be(t, e)
|
|
781
|
+
}, [m("span", null, S(we(t, e)), 1)], 46, pe))), 128))], 64))), 128))
|
|
782
|
+
], 4), D.value ? ae((y(), p("input", {
|
|
783
|
+
key: 0,
|
|
784
|
+
ref_key: "editorRef",
|
|
785
|
+
ref: s,
|
|
786
|
+
"onUpdate:modelValue": n[1] ||= (e) => D.value.draft = e,
|
|
787
|
+
class: "nb-spreadsheet__editor",
|
|
788
|
+
style: v(Ye.value),
|
|
789
|
+
inputmode: Je.value,
|
|
790
|
+
enterkeyhint: "next",
|
|
791
|
+
onBlur: n[2] ||= (e) => Ze(!1),
|
|
792
|
+
onKeydown: oe(Xe, ["stop"])
|
|
793
|
+
}, null, 44, me)), [[re, D.value.draft]]) : f("", !0)], 544)], 6));
|
|
794
|
+
}
|
|
795
|
+
}), P = /* @__PURE__ */ r({ default: () => F }), F = /* @__PURE__ */ c(N, [["__scopeId", "data-v-d10d022d"]]), I = /* @__PURE__ */ Object.assign({ "./components/labs/Spreadsheet.vue": P }), L = { install(e) {
|
|
796
|
+
Object.keys(I).forEach((t) => {
|
|
797
|
+
let n = `Nb${t.replace(/(.+\/)(\w+)(\.vue)$/, "$2")}`, r = I[t];
|
|
798
|
+
e.component(n, r.default);
|
|
799
|
+
});
|
|
800
|
+
} }, R = { install(e, t = {}) {
|
|
801
|
+
if (t.components) for (let [n, r] of Object.entries(t.components)) e.component(n, r);
|
|
802
|
+
if (e.provide(n, { ...t.button }), t.ssr) {
|
|
803
|
+
let t = b(!0);
|
|
804
|
+
e.provide(s, { pending: t });
|
|
805
|
+
let n = e.mount.bind(e);
|
|
806
|
+
e.mount = ((...e) => {
|
|
807
|
+
let r = n(...e);
|
|
808
|
+
return t.value = !1, r;
|
|
809
|
+
});
|
|
810
|
+
}
|
|
811
|
+
e.use(A), e.use(j);
|
|
812
|
+
} };
|
|
813
|
+
//#endregion
|
|
814
|
+
export { j as a, M as i, L as n, O as o, F as r, R as t };
|