@synopackageland/ui 0.25.5 → 0.25.7
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/CHANGELOG.md +13 -0
- package/dist/cli.js +0 -0
- package/dist/components/composite/data-grid/DataGridSelectBox.vue.d.ts +15 -0
- package/dist/grid/host/controller.d.ts +13 -1
- package/dist/grid.js +490 -482
- package/dist/index.js +5501 -5484
- package/dist/reka-runtime.json +1 -1
- package/package.json +68 -61
package/dist/grid.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/*! @synopackageland/ui/grid: MIT, Copyright (c) 2023-2025 Teable, Inc. and Copyright (c) 2019-present Baserow B.V. in parts; see LICENSES/source-notices.md */
|
|
2
|
-
import { watch as ue, toValue as
|
|
3
|
-
import { useUiText as
|
|
4
|
-
var H = /* @__PURE__ */ ((e) => (e.Rows = "Rows", e.Columns = "Columns", e.Cells = "Cells", e.None = "None", e))(H || {}), x = /* @__PURE__ */ ((e) => (e.Cell = "Cell", e.ActiveCell = "ActiveCell", e.AppendRow = "AppendRow", e.AppendColumn = "AppendColumn", e.ColumnHeader = "ColumnHeader", e.ColumnHeaderMenu = "ColumnHeaderMenu", e.ColumnPrimaryIcon = "ColumnPrimaryIcon", e.ColumnDescription = "ColumnDescription", e.ColumnResizeHandler = "ColumnResizeHandler", e.ColumnFreezeHandler = "ColumnFreezeHandler", e.RowHeaderDragHandler = "RowHeaderDragHandler", e.RowHeaderExpandHandler = "RowHeaderExpandHandler", e.RowHeaderCheckbox = "RowHeaderCheckbox", e.RowGroupControl = "RowGroupControl", e.RowGroupHeader = "RowGroupHeader", e.RowHeader = "RowHeader", e.AllCheckbox = "AllCheckbox", e.FillHandler = "FillHandler", e.Blank = "Blank", e.None = "None", e))(x || {}), O = /* @__PURE__ */ ((e) => (e.Rows = "Rows", e.Columns = "Columns", e.None = "None", e))(O || {}),
|
|
5
|
-
const Wt = (e) => ({ type: 1, displayIndex: e + 1, realIndex: e }),
|
|
2
|
+
import { watch as ue, toValue as to, getCurrentScope as qo, onScopeDispose as no, shallowRef as ce, defineComponent as Yo, useId as jo, ref as xe, computed as _, onMounted as Qo, onBeforeUnmount as Zo, openBlock as pe, createElementBlock as Ce, unref as J, createElementVNode as ee, toDisplayString as we, normalizeStyle as Be, Fragment as Jo, renderList as ei, createCommentVNode as Oe, renderSlot as hn, createTextVNode as ti, inject as ni } from "vue";
|
|
3
|
+
import { useUiText as oi } from "./index.js";
|
|
4
|
+
var H = /* @__PURE__ */ ((e) => (e.Rows = "Rows", e.Columns = "Columns", e.Cells = "Cells", e.None = "None", e))(H || {}), x = /* @__PURE__ */ ((e) => (e.Cell = "Cell", e.ActiveCell = "ActiveCell", e.AppendRow = "AppendRow", e.AppendColumn = "AppendColumn", e.ColumnHeader = "ColumnHeader", e.ColumnHeaderMenu = "ColumnHeaderMenu", e.ColumnPrimaryIcon = "ColumnPrimaryIcon", e.ColumnDescription = "ColumnDescription", e.ColumnResizeHandler = "ColumnResizeHandler", e.ColumnFreezeHandler = "ColumnFreezeHandler", e.RowHeaderDragHandler = "RowHeaderDragHandler", e.RowHeaderExpandHandler = "RowHeaderExpandHandler", e.RowHeaderCheckbox = "RowHeaderCheckbox", e.RowGroupControl = "RowGroupControl", e.RowGroupHeader = "RowGroupHeader", e.RowHeader = "RowHeader", e.AllCheckbox = "AllCheckbox", e.FillHandler = "FillHandler", e.Blank = "Blank", e.None = "None", e))(x || {}), O = /* @__PURE__ */ ((e) => (e.Rows = "Rows", e.Columns = "Columns", e.None = "None", e))(O || {}), q = /* @__PURE__ */ ((e) => (e.Spacer = "Spacer", e.Drag = "Drag", e.Expand = "Expand", e.Checkbox = "Checkbox", e))(q || {}), de = /* @__PURE__ */ ((e) => (e.All = "all", e.None = "none", e.Column = "column", e.Row = "row", e))(de || {}), $ = /* @__PURE__ */ ((e) => (e.All = "all", e.None = "none", e.Column = "column", e.Row = "row", e.Cell = "cell", e))($ || {}), se = /* @__PURE__ */ ((e) => (e[e.Group = 0] = "Group", e[e.Row = 1] = "Row", e[e.Append = 2] = "Append", e))(se || {});
|
|
5
|
+
const Wt = (e) => ({ type: 1, displayIndex: e + 1, realIndex: e }), oo = (e) => e;
|
|
6
6
|
var Q = /* @__PURE__ */ ((e) => (e.Row = "Row", e.Column = "Column", e))(Q || {});
|
|
7
7
|
const B = {
|
|
8
8
|
rowHeight: 32,
|
|
@@ -44,7 +44,7 @@ const B = {
|
|
|
44
44
|
ranges: [],
|
|
45
45
|
delta: 0,
|
|
46
46
|
isDragging: !1
|
|
47
|
-
},
|
|
47
|
+
}, ii = /* @__PURE__ */ new Set([
|
|
48
48
|
x.Cell,
|
|
49
49
|
x.RowHeader,
|
|
50
50
|
x.RowHeaderCheckbox,
|
|
@@ -73,11 +73,11 @@ class ct {
|
|
|
73
73
|
this.map.clear();
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
|
-
const rt = "…", mn = new ct(1e3), gn = new ct(1e3),
|
|
76
|
+
const rt = "…", mn = new ct(1e3), gn = new ct(1e3), io = () => ({
|
|
77
77
|
segment: (e) => Array.from(e, (t) => ({ segment: t }))
|
|
78
|
-
}),
|
|
78
|
+
}), ao = typeof Intl < "u" && typeof Intl.Segmenter == "function", so = ao ? new Intl.Segmenter(void 0, { granularity: "word" }) : io(), Ht = ao ? new Intl.Segmenter(void 0, { granularity: "grapheme" }) : io(), ro = (e, t, n) => {
|
|
79
79
|
let o = "", i = 0;
|
|
80
|
-
for (const { segment: a } of
|
|
80
|
+
for (const { segment: a } of so.segment(t)) {
|
|
81
81
|
const s = e.measureText(a).width;
|
|
82
82
|
if (i + s > n) {
|
|
83
83
|
for (const { segment: r } of Ht.segment(a)) {
|
|
@@ -90,7 +90,7 @@ const rt = "…", mn = new ct(1e3), gn = new ct(1e3), oo = () => ({
|
|
|
90
90
|
o += a, i += s;
|
|
91
91
|
}
|
|
92
92
|
return { text: o, width: i };
|
|
93
|
-
},
|
|
93
|
+
}, ai = (e, t) => {
|
|
94
94
|
const { x: n = 0, y: o = 0, text: i, maxWidth: a, maxLines: s, isUnderline: r, fontSize: c = 13, lineHeight: l = 22, fill: u = "black", textAlign: h = "left", verticalAlign: m = "middle", needRender: g = !0 } = t;
|
|
95
95
|
let C = [];
|
|
96
96
|
const S = e.measureText(rt).width;
|
|
@@ -107,7 +107,7 @@ const rt = "…", mn = new ct(1e3), gn = new ct(1e3), oo = () => ({
|
|
|
107
107
|
}, A = (M, E = 0) => {
|
|
108
108
|
const F = a - S;
|
|
109
109
|
if (w > F) {
|
|
110
|
-
const W =
|
|
110
|
+
const W = ro(e, p, F);
|
|
111
111
|
p = W.text, w = W.width;
|
|
112
112
|
} else if (M) {
|
|
113
113
|
let W = E;
|
|
@@ -134,7 +134,7 @@ const rt = "…", mn = new ct(1e3), gn = new ct(1e3), oo = () => ({
|
|
|
134
134
|
w + G > a ? C.length < s - 1 ? (k(p, w), p = "", w = 0, P(K, G, W)) : A() : P(K, G, W), W += K.length;
|
|
135
135
|
}
|
|
136
136
|
};
|
|
137
|
-
for (const { segment: M } of
|
|
137
|
+
for (const { segment: M } of so.segment(i)) {
|
|
138
138
|
if (C.length >= s) break;
|
|
139
139
|
if (M.includes(`
|
|
140
140
|
`)) {
|
|
@@ -180,7 +180,7 @@ const rt = "…", mn = new ct(1e3), gn = new ct(1e3), oo = () => ({
|
|
|
180
180
|
if (p <= l)
|
|
181
181
|
g = i, m = p;
|
|
182
182
|
else {
|
|
183
|
-
const w = e.measureText(rt).width, v =
|
|
183
|
+
const w = e.measureText(rt).width, v = ro(e, i, l - w);
|
|
184
184
|
g = v.text + rt, m = v.width + w;
|
|
185
185
|
}
|
|
186
186
|
mn.set(C, { text: g, width: m });
|
|
@@ -209,7 +209,7 @@ const rt = "…", mn = new ct(1e3), gn = new ct(1e3), oo = () => ({
|
|
|
209
209
|
e.moveTo(n + u.tl, o), e.arcTo(n + i, o, n + i, o + u.tr, u.tr), e.arcTo(n + i, o + a, n + i - u.br, o + a, u.br), e.arcTo(n, o + a, n, o + a - u.bl, u.bl), e.arcTo(n, o, n + u.tl, o, u.tl);
|
|
210
210
|
}
|
|
211
211
|
e.closePath(), s && e.fill(), r && e.stroke(), l && (e.globalAlpha = 1);
|
|
212
|
-
},
|
|
212
|
+
}, si = (e, t) => {
|
|
213
213
|
const { points: n, radiusAll: o, fill: i, stroke: a } = t, s = (l, u) => {
|
|
214
214
|
const h = u.x - l.x, m = u.y - l.y, g = Math.sqrt(h * h + m * m), C = h / g, S = m / g;
|
|
215
215
|
return { x: h, y: m, len: g, nx: C, ny: S, ang: Math.atan2(S, C) };
|
|
@@ -233,17 +233,17 @@ const rt = "…", mn = new ct(1e3), gn = new ct(1e3), oo = () => ({
|
|
|
233
233
|
}, nt = (e, t, n) => {
|
|
234
234
|
const { x: o, y: i, width: a, height: s } = t;
|
|
235
235
|
e.save(), e.beginPath(), e.rect(o, i, a, s), e.clip(), n(e), e.restore();
|
|
236
|
-
}, V = (e, t, n) => t > n ? e >= n && e <= t : e >= t && e <= n,
|
|
236
|
+
}, V = (e, t, n) => t > n ? e >= n && e <= t : e >= t && e <= n, ri = (e, t) => {
|
|
237
237
|
const [n, o] = e;
|
|
238
238
|
for (const [i, a] of t)
|
|
239
239
|
if (i <= n && a >= o) return !0;
|
|
240
240
|
return !1;
|
|
241
|
-
},
|
|
241
|
+
}, li = (e) => {
|
|
242
242
|
const t = [];
|
|
243
243
|
for (const n of e)
|
|
244
244
|
for (let o = n[0]; o <= n[1]; o++) t.push(o);
|
|
245
245
|
return t;
|
|
246
|
-
},
|
|
246
|
+
}, ci = (e, t, n) => {
|
|
247
247
|
const [o, i] = e, [a, s] = t, [r, c] = n;
|
|
248
248
|
return o >= Math.min(a, r) && o <= Math.max(a, r) && i >= Math.min(s, c) && i <= Math.max(s, c);
|
|
249
249
|
}, Tt = (e) => {
|
|
@@ -255,24 +255,24 @@ const rt = "…", mn = new ct(1e3), gn = new ct(1e3), oo = () => ({
|
|
|
255
255
|
a[0] <= o[1] + 1 ? o = [o[0], Math.max(o[1], a[1])] : (n.push(o), o = [...a]);
|
|
256
256
|
}
|
|
257
257
|
return n.push(o), n;
|
|
258
|
-
},
|
|
258
|
+
}, ui = (e, t) => {
|
|
259
259
|
const n = [];
|
|
260
260
|
let o = !1;
|
|
261
261
|
for (const i of e)
|
|
262
262
|
!o && i[0] === t[0] && t[1] === i[1] ? o = !0 : !o && t[0] > i[0] && t[1] < i[1] ? (n.push([i[0], t[0] - 1], [t[1] + 1, i[1]]), o = !0) : !o && t[0] <= i[1] && t[1] >= i[0] ? (t[0] > i[0] && n.push([i[0], t[0] - 1]), t[1] < i[1] && n.push([t[1] + 1, i[1]]), o = !0) : n.push([...i]);
|
|
263
263
|
return o || n.push(t), Tt(n);
|
|
264
|
-
},
|
|
264
|
+
}, di = (e) => {
|
|
265
265
|
if (!e.isCellSelection) return null;
|
|
266
266
|
const [t, n] = e.ranges[0], [o, i] = e.ranges[1];
|
|
267
267
|
return [Math.max(t, o), Math.max(n, i)];
|
|
268
|
-
},
|
|
268
|
+
}, hi = (e, t, n) => {
|
|
269
269
|
if (e == null) return { isRowActive: !1, isCellActive: !1 };
|
|
270
270
|
const [o, i] = e;
|
|
271
271
|
return {
|
|
272
272
|
isRowActive: i === t,
|
|
273
273
|
isCellActive: i === t && o === n
|
|
274
274
|
};
|
|
275
|
-
},
|
|
275
|
+
}, mi = (e, t, n) => e.isRowSelection && e.includes([t, t]) ? { isRowSelected: !0, isCellSelected: !0 } : e.isCellSelection && e.includes([n, t]) ? { isRowSelected: !1, isCellSelected: !0 } : { isRowSelected: !1, isCellSelected: !1 }, Ot = (e, t) => {
|
|
276
276
|
if (e.length !== t.length) return !1;
|
|
277
277
|
for (let n = 0; n < e.length; n++) {
|
|
278
278
|
const o = e[n], i = t[n];
|
|
@@ -291,7 +291,7 @@ const rt = "…", mn = new ct(1e3), gn = new ct(1e3), oo = () => ({
|
|
|
291
291
|
}
|
|
292
292
|
return -1 / 0;
|
|
293
293
|
};
|
|
294
|
-
class
|
|
294
|
+
class gi {
|
|
295
295
|
state = kt;
|
|
296
296
|
startPosition = 0;
|
|
297
297
|
options;
|
|
@@ -342,36 +342,36 @@ class mi {
|
|
|
342
342
|
this.setState(kt);
|
|
343
343
|
}
|
|
344
344
|
}
|
|
345
|
-
const
|
|
346
|
-
const a =
|
|
345
|
+
const lo = (e, t) => t ? Math.max(t - (e.iconSizeMD - e.iconSizeXS) / 2, 0) : 0, fi = (e, t, n) => Math.max(e - lo(t, n) * 2, 0), Gt = (e, t, n, o, i) => {
|
|
346
|
+
const a = lo(t, n), s = fi(e, t, n);
|
|
347
347
|
return a + s / (o || 1) * (i + 0.5);
|
|
348
|
-
},
|
|
348
|
+
}, co = ({ width: e, theme: t, rowControls: n, rowControlPaddingX: o }) => {
|
|
349
349
|
if (!o) return e / 2;
|
|
350
|
-
const i = n.findIndex((a) => a.type ===
|
|
350
|
+
const i = n.findIndex((a) => a.type === q.Checkbox);
|
|
351
351
|
return i < 0 ? e / 2 : Gt(e, t, o, n.length, i);
|
|
352
|
-
},
|
|
352
|
+
}, pi = (e, t, n) => {
|
|
353
353
|
const { x: o, y: i } = n, { scrollLeft: a, scrollTop: s } = t, { freezeRegionWidth: r, totalWidth: c, rowInitSize: l, columnInitSize: u, columnCount: h } = e, { columnAppendBtnWidth: m } = B, g = i < 0 ? -1 / 0 : i <= l ? -1 : e.getRowStartIndex(s + i), C = o < 0 ? -1 / 0 : a + o > c && a + o < c + m ? -2 : o <= r ? o <= u ? -1 : e.getColumnStartIndex(o) : e.getColumnStartIndex(a + o);
|
|
354
354
|
return { x: o, y: i, rowIndex: g, columnIndex: Math.min(C, h - 1) };
|
|
355
|
-
},
|
|
355
|
+
}, Ci = (e, t, n, o = e.containerHeight) => {
|
|
356
356
|
const { x: i, y: a } = n, { totalHeight: s, totalWidth: r, containerHeight: c } = e;
|
|
357
357
|
return t.scrollLeft + i > r + B.columnAppendBtnWidth || t.scrollTop + a > s && !V(a, c, o);
|
|
358
|
-
},
|
|
359
|
-
[
|
|
360
|
-
[
|
|
361
|
-
[
|
|
358
|
+
}, wi = {
|
|
359
|
+
[q.Drag]: x.RowHeaderDragHandler,
|
|
360
|
+
[q.Checkbox]: x.RowHeaderCheckbox,
|
|
361
|
+
[q.Expand]: x.RowHeaderExpandHandler
|
|
362
362
|
}, ne = {
|
|
363
363
|
type: x.Blank,
|
|
364
364
|
x: 1 / 0,
|
|
365
365
|
y: 1 / 0,
|
|
366
366
|
width: 0,
|
|
367
367
|
height: 0
|
|
368
|
-
}, { groupHeaderHeight:
|
|
369
|
-
const o =
|
|
368
|
+
}, { groupHeaderHeight: vi, columnHeadPadding: fn, columnResizeHandlerWidth: pn, rowHeadIconPaddingTop: Si, columnFreezeHandlerWidth: yi, fillHandlerSize: bi, fillHandlerPadding: xi } = B, Ri = (e) => Ii(e) ?? Wi(e) ?? Pi(e) ?? zi(e) ?? Mi(e) ?? Ai(e) ?? Ei(e) ?? Hi(e) ?? Ti(e) ?? Fi(e) ?? Ni(e) ?? Li(e) ?? Di(e) ?? Bi(e) ?? Oi(e) ?? ne, ki = (e, t, n) => {
|
|
369
|
+
const o = pi(e.coordInstance, e.scrollState, t), i = Ci(e.coordInstance, e.scrollState, t, n), a = Ri({
|
|
370
370
|
...e,
|
|
371
371
|
position: o,
|
|
372
372
|
isOutOfBounds: i,
|
|
373
373
|
getLinearRow: e.getLinearRow ?? Wt,
|
|
374
|
-
real2RowIndex: e.real2RowIndex ??
|
|
374
|
+
real2RowIndex: e.real2RowIndex ?? oo
|
|
375
375
|
});
|
|
376
376
|
return {
|
|
377
377
|
...o,
|
|
@@ -381,30 +381,30 @@ const ro = (e, t) => t ? Math.max(t - (e.iconSizeMD - e.iconSizeXS) / 2, 0) : 0,
|
|
|
381
381
|
columnIndex: a.columnIndex ?? o.columnIndex,
|
|
382
382
|
region: a
|
|
383
383
|
};
|
|
384
|
-
},
|
|
384
|
+
}, Ii = (e) => e.isFreezing ? { ...ne, type: x.ColumnFreezeHandler } : null, Pi = (e) => {
|
|
385
385
|
const { coordInstance: t, scrollState: n, position: o, activeCell: i, activeCellBound: a, real2RowIndex: s } = e;
|
|
386
386
|
if (i == null || a == null) return null;
|
|
387
387
|
const { x: r, y: c } = o, { scrollTop: l, scrollLeft: u } = n, [h, m] = i, g = s(m);
|
|
388
388
|
if (g == null) return null;
|
|
389
389
|
const C = t.getRowOffset(g) - l, S = t.getColumnRelativeOffset(h, u), { width: p, height: w } = a;
|
|
390
390
|
return V(r, S, S + p) && V(c, C, C + w) ? { type: x.ActiveCell, x: S, y: C, width: p, height: w, rowIndex: g, columnIndex: h, isOutOfBounds: !1 } : null;
|
|
391
|
-
},
|
|
391
|
+
}, zi = (e) => e.isOutOfBounds ? ne : null, Mi = (e) => !e.isSelecting || !e.selection.isCellSelection ? null : { ...ne, type: x.Cell }, Ai = (e) => e.columnResizeState.columnIndex <= -1 ? null : { ...ne, type: x.ColumnResizeHandler }, Ei = (e) => e.dragState.isDragging ? { ...ne, type: x.ColumnHeader } : null, Hi = (e) => {
|
|
392
392
|
const { position: t, scrollState: n, coordInstance: o, isColumnFreezable: i } = e;
|
|
393
393
|
if (!i) return null;
|
|
394
|
-
const { x: a, y: s } = t, { freezeRegionWidth: r, rowInitSize: c, rowCount: l, containerHeight: u } = o, h = o.getRowOffset(l) - n.scrollTop, m = Math.min(h, u), g =
|
|
394
|
+
const { x: a, y: s } = t, { freezeRegionWidth: r, rowInitSize: c, rowCount: l, containerHeight: u } = o, h = o.getRowOffset(l) - n.scrollTop, m = Math.min(h, u), g = yi / 2;
|
|
395
395
|
return V(a, r - g, r + g) && V(s, c, m) ? { ...ne, type: x.ColumnFreezeHandler } : null;
|
|
396
|
-
},
|
|
396
|
+
}, Ti = (e) => {
|
|
397
397
|
const { rowIndex: t, columnIndex: n } = e.position;
|
|
398
398
|
return e.isColumnAppendEnable && t >= -1 && n === -2 ? { ...ne, type: x.AppendColumn } : null;
|
|
399
|
-
},
|
|
399
|
+
}, Fi = (e) => {
|
|
400
400
|
const { position: t, theme: n, rowControls: o, rowControlPaddingX: i, coordInstance: a, isMultiSelectionEnable: s } = e, { x: r, y: c, rowIndex: l, columnIndex: u } = t;
|
|
401
|
-
if (!s || l !== -1 || u !== -1 || !o.some((v) => v.type ===
|
|
402
|
-
const { iconSizeXS: h } = n, m = h / 2, { rowInitSize: g, columnInitSize: C } = a, p =
|
|
401
|
+
if (!s || l !== -1 || u !== -1 || !o.some((v) => v.type === q.Checkbox)) return null;
|
|
402
|
+
const { iconSizeXS: h } = n, m = h / 2, { rowInitSize: g, columnInitSize: C } = a, p = co({ width: C, theme: n, rowControls: o, rowControlPaddingX: i }) - m, w = g / 2 - m;
|
|
403
403
|
return V(r, p, p + h) && V(c, w, w + h) ? { type: x.AllCheckbox, x: p, y: w, width: h, height: h } : null;
|
|
404
|
-
},
|
|
404
|
+
}, Ni = (e) => {
|
|
405
405
|
const { rowIndex: t, columnIndex: n } = e.position;
|
|
406
406
|
return n >= -1 && t > -1 ? e.getLinearRow(t).type !== se.Append ? null : { ...ne, type: x.AppendRow } : null;
|
|
407
|
-
},
|
|
407
|
+
}, Li = (e) => {
|
|
408
408
|
const { position: t, theme: n, rowControls: o, rowControlPaddingX: i, scrollState: a, coordInstance: s } = e, { x: r, y: c, rowIndex: l, columnIndex: u } = t;
|
|
409
409
|
if (l <= -1 || u !== -1) return null;
|
|
410
410
|
const h = e.getLinearRow(l);
|
|
@@ -412,24 +412,24 @@ const ro = (e, t) => t ? Math.max(t - (e.iconSizeMD - e.iconSizeXS) / 2, 0) : 0,
|
|
|
412
412
|
if (h.type !== se.Row) return null;
|
|
413
413
|
const { iconSizeXS: m } = n, g = m / 2, C = s.getRowOffset(l) - a.scrollTop;
|
|
414
414
|
for (let S = 0; S < o.length; S++) {
|
|
415
|
-
const p =
|
|
415
|
+
const p = wi[o[S].type], v = Gt(s.columnInitSize, n, i, o.length, S) - g, y = C + Si;
|
|
416
416
|
if (p && V(r, v, v + m) && V(c, y, y + m))
|
|
417
417
|
return { type: p, x: v, y, width: m, height: m };
|
|
418
418
|
}
|
|
419
419
|
return { ...ne, type: x.RowHeader };
|
|
420
|
-
},
|
|
420
|
+
}, Di = (e) => {
|
|
421
421
|
const { position: t, scrollState: n, coordInstance: o, getLinearRow: i } = e, { x: a, y: s, rowIndex: r, columnIndex: c } = t;
|
|
422
422
|
if (r <= -1 || c !== 0 || i(r).type !== se.Group) return null;
|
|
423
423
|
const l = o.getColumnWidth(c), u = o.getColumnRelativeOffset(c, n.scrollLeft);
|
|
424
|
-
return V(a, u, u + l) ? { type: x.RowGroupHeader, x: u, y: s, width: l, height:
|
|
425
|
-
},
|
|
424
|
+
return V(a, u, u + l) ? { type: x.RowGroupHeader, x: u, y: s, width: l, height: vi } : null;
|
|
425
|
+
}, Wi = (e) => {
|
|
426
426
|
const { position: t, selection: n, coordInstance: o, scrollState: i, activeCell: a, activeCellBound: s, isFillEnabled: r, real2RowIndex: c } = e;
|
|
427
427
|
if (!r) return null;
|
|
428
428
|
const { isCellSelection: l, ranges: u } = n, { x: h, y: m, rowIndex: g, columnIndex: C } = t;
|
|
429
429
|
if (!l || g < 0 || C < 0) return null;
|
|
430
|
-
const [S, p] = u[0], [w, v] = u[1], y = Math.max(S, w), R = Math.max(p, v), I = c(R), k = o.getColumnRelativeOffset(y, i.scrollLeft) + o.getColumnWidth(y), N = S === w && p === v && a != null && s != null && a[0] === y && a[1] === R && s ? s.height : o.getRowHeight(I), M = o.getRowOffset(I) + N - i.scrollTop, E =
|
|
430
|
+
const [S, p] = u[0], [w, v] = u[1], y = Math.max(S, w), R = Math.max(p, v), I = c(R), k = o.getColumnRelativeOffset(y, i.scrollLeft) + o.getColumnWidth(y), N = S === w && p === v && a != null && s != null && a[0] === y && a[1] === R && s ? s.height : o.getRowHeight(I), M = o.getRowOffset(I) + N - i.scrollTop, E = bi / 2 + xi, F = k - E, W = M - E;
|
|
431
431
|
return V(h, F, F + E * 2) && V(m, W, W + E * 2) ? { type: x.FillHandler, x: F, y: W, width: E * 2, height: E * 2 } : null;
|
|
432
|
-
},
|
|
432
|
+
}, Bi = (e) => {
|
|
433
433
|
const { coordInstance: t, position: n, scrollState: o, getLinearRow: i } = e, { rowIndex: a, columnIndex: s } = n;
|
|
434
434
|
return a > -1 && s > -1 ? i(a).type !== se.Row ? null : {
|
|
435
435
|
type: x.Cell,
|
|
@@ -438,7 +438,7 @@ const ro = (e, t) => t ? Math.max(t - (e.iconSizeMD - e.iconSizeXS) / 2, 0) : 0,
|
|
|
438
438
|
width: t.getColumnWidth(s),
|
|
439
439
|
height: t.getRowHeight(a)
|
|
440
440
|
} : null;
|
|
441
|
-
},
|
|
441
|
+
}, Oi = (e) => {
|
|
442
442
|
const { position: t, scrollState: n, coordInstance: o, columns: i, theme: a, isColumnResizable: s, isColumnHeaderMenuVisible: r } = e, { x: c, y: l, rowIndex: u, columnIndex: h } = t, { iconSizeXS: m } = a;
|
|
443
443
|
if (u !== -1 || h <= -1) return null;
|
|
444
444
|
const g = i[h];
|
|
@@ -472,10 +472,10 @@ const ro = (e, t) => t ? Math.max(t - (e.iconSizeMD - e.iconSizeXS) / 2, 0) : 0,
|
|
|
472
472
|
startColumnIndex: Math.max(0, s),
|
|
473
473
|
stopColumnIndex: Math.max(0, Math.min(o - 1, r))
|
|
474
474
|
};
|
|
475
|
-
},
|
|
475
|
+
}, Vi = (e) => ({
|
|
476
476
|
...e,
|
|
477
477
|
getLinearRow: e.getLinearRow ?? Wt,
|
|
478
|
-
real2RowIndex: e.real2RowIndex ??
|
|
478
|
+
real2RowIndex: e.real2RowIndex ?? oo
|
|
479
479
|
}), In = (e, t) => {
|
|
480
480
|
const { coordInstance: n, visibleRegion: o, activeCell: i, highlightedRowIndex: a, mouseState: s, scrollState: r, selection: c, isSelecting: l, theme: u, getLinearRow: h } = e, { freezeColumnCount: m, columnInitSize: g, totalWidth: C, rowCount: S } = n, { isRowSelection: p, isColumnSelection: w } = c, { scrollLeft: v, scrollTop: y } = r, { rowIndex: R, type: I, isOutOfBounds: k } = s, P = [], A = [], N = [];
|
|
481
481
|
if (!S) return { cellPropList: P, rowHeaderPropList: A, appendRowList: N };
|
|
@@ -489,9 +489,9 @@ const ro = (e, t) => t ? Math.max(t - (e.iconSizeMD - e.iconSizeXS) / 2, 0) : 0,
|
|
|
489
489
|
ie && N.push({ x: 0.5, y: Ne + 0.5, width: C - v, height: Fe, isHover: I === x.AppendRow && R === re });
|
|
490
490
|
continue;
|
|
491
491
|
}
|
|
492
|
-
const { displayIndex: mt, realIndex: Ie } = Te, Le = !k && !l &&
|
|
493
|
-
let
|
|
494
|
-
gt || ae || Ye ?
|
|
492
|
+
const { displayIndex: mt, realIndex: Ie } = Te, Le = !k && !l && ii.has(I) && re === R, { isCellActive: Pe, isRowActive: ve } = hi(i, Ie, z), { isRowSelected: ae, isCellSelected: gt } = mi(c, Ie, z), le = a === Ie;
|
|
493
|
+
let X;
|
|
494
|
+
gt || ae || Ye ? X = ke : (Le || ve || le) && (X = G), ie && A.push({
|
|
495
495
|
x: 0.5,
|
|
496
496
|
y: Ne + 0.5,
|
|
497
497
|
width: g + 0.5,
|
|
@@ -508,21 +508,21 @@ const ro = (e, t) => t ? Math.max(t - (e.iconSizeMD - e.iconSizeXS) / 2, 0) : 0,
|
|
|
508
508
|
columnIndex: z,
|
|
509
509
|
theme: u,
|
|
510
510
|
isActive: !1,
|
|
511
|
-
fill: Pe ? K :
|
|
511
|
+
fill: Pe ? K : X ?? K
|
|
512
512
|
});
|
|
513
513
|
}
|
|
514
514
|
}
|
|
515
515
|
return { cellPropList: P, rowHeaderPropList: A, appendRowList: N };
|
|
516
|
-
},
|
|
516
|
+
}, Gi = (e, t, n) => {
|
|
517
517
|
const { x: o, y: i, width: a, height: s, displayIndex: r, isHover: c, isChecked: l } = t, { theme: u, rowControls: h, rowControlPaddingX: m, rowIndexVisible: g = !0, drawIcon: C } = n, { cellBg: S, cellBgHovered: p, cellBgSelected: w, cellLineColor: v, rowHeaderTextColor: y, iconSizeXS: R, staticWhite: I, iconBgSelected: k } = u;
|
|
518
518
|
D(e, { x: o, y: i, width: a, height: s, fill: l ? w : c ? p : S }), Ke(e, { x: o, y: i, points: [0, 0, a, 0], stroke: v }), Ke(e, { x: o, y: i, points: [0, s, a, s], stroke: v });
|
|
519
519
|
const A = R / 2;
|
|
520
520
|
if (e.font = `${u.fontSizeXXS}px ${u.fontFamily}`, (l || c || !g) && h.length > 0) {
|
|
521
521
|
for (let N = 0; N < h.length; N++) {
|
|
522
522
|
const { type: M } = h[N];
|
|
523
|
-
if (M ===
|
|
523
|
+
if (M === q.Spacer) continue;
|
|
524
524
|
const E = Gt(a, u, m, h.length, N);
|
|
525
|
-
if (M ===
|
|
525
|
+
if (M === q.Checkbox) {
|
|
526
526
|
Bt(e, {
|
|
527
527
|
x: o + E - A,
|
|
528
528
|
y: i + wn,
|
|
@@ -533,18 +533,18 @@ const ro = (e, t) => t ? Math.max(t - (e.iconSizeMD - e.iconSizeXS) / 2, 0) : 0,
|
|
|
533
533
|
});
|
|
534
534
|
continue;
|
|
535
535
|
}
|
|
536
|
-
l && !c && g && M ===
|
|
536
|
+
l && !c && g && M === q.Expand || C?.(e, { kind: M === q.Drag ? "drag" : "expand", x: o + E - A, y: i + wn, size: R, theme: u });
|
|
537
537
|
}
|
|
538
538
|
return;
|
|
539
539
|
}
|
|
540
540
|
$e(e, { x: o + a / 2, y: i + Ft + 1, text: r, textAlign: "center", fill: y, fontSize: u.fontSizeXXS });
|
|
541
|
-
},
|
|
541
|
+
}, Ui = (e, t, n) => {
|
|
542
542
|
const { x: o, y: i, width: a, height: s, isHover: r } = t, { theme: c, coordInstance: l, drawIcon: u } = n, { appendRowBgHovered: h, iconSizeSM: m, cellBg: g, cellLineColor: C } = c, S = m / 2;
|
|
543
543
|
e.save(), e.beginPath(), D(e, { x: o + 0.5, y: i + 0.5, width: a, height: s, fill: r ? h : g }), D(e, { x: o, y: i + s, width: a, height: 1, fill: C }), u?.(e, { kind: "add", x: o + l.columnInitSize / 2 - S + 0.5, y: i + s / 2 - S + 0.5, size: m, theme: c }), e.restore();
|
|
544
|
-
},
|
|
544
|
+
}, Ki = (e, t, n) => {
|
|
545
545
|
const { coordInstance: o, theme: i, shouldRerender: a, drawCell: s } = n, { fontFamily: r, fontSizeSM: c, cellLineColor: l } = i, { rowInitSize: u, freezeRegionWidth: h, containerWidth: m, containerHeight: g } = o, C = In(n, "other"), S = In(n, "freeze"), p = { x: 0, y: u + 1, width: h + 1, height: g - u - 1 }, w = { x: h + 1, y: u + 1, width: m - h, height: g - u - 1 };
|
|
546
|
-
S.appendRowList.forEach((v) =>
|
|
547
|
-
S.cellPropList.forEach(({ x: y, y: R, width: I, height: k, fill: P }) => D(v, { x: y, y: R, width: I, height: k, fill: P, stroke: l })), S.rowHeaderPropList.forEach((y) =>
|
|
546
|
+
S.appendRowList.forEach((v) => Ui(e, v, n)), nt(e, p, (v) => {
|
|
547
|
+
S.cellPropList.forEach(({ x: y, y: R, width: I, height: k, fill: P }) => D(v, { x: y, y: R, width: I, height: k, fill: P, stroke: l })), S.rowHeaderPropList.forEach((y) => Gi(v, y, n));
|
|
548
548
|
}), nt(e, w, (v) => {
|
|
549
549
|
C.cellPropList.forEach(({ x: y, y: R, width: I, height: k, fill: P }) => D(v, { x: y, y: R, width: I, height: k, fill: P, stroke: l }));
|
|
550
550
|
}), a && (nt(t, p, (v) => {
|
|
@@ -552,23 +552,23 @@ const ro = (e, t) => t ? Math.max(t - (e.iconSizeMD - e.iconSizeXS) / 2, 0) : 0,
|
|
|
552
552
|
}), nt(t, w, (v) => {
|
|
553
553
|
v.font = `${c}px ${r}`, C.cellPropList.forEach((y) => s(v, y));
|
|
554
554
|
}));
|
|
555
|
-
},
|
|
555
|
+
}, _i = (e, t) => {
|
|
556
556
|
const { theme: n, scrollState: o, coordInstance: i, activeCellBound: a, real2RowIndex: s, getLinearRow: r, drawCell: c } = t;
|
|
557
557
|
if (a == null) return;
|
|
558
558
|
const { width: l, height: u, columnIndex: h, rowIndex: m } = a, { freezeColumnCount: g, freezeRegionWidth: C, containerWidth: S, containerHeight: p, columnCount: w, rowInitSize: v } = i, y = s(m);
|
|
559
559
|
if (h >= w || r(y)?.type !== se.Row) return;
|
|
560
560
|
const R = h < g, I = i.getColumnRelativeOffset(h, o.scrollLeft), k = i.getRowOffset(y) - o.scrollTop;
|
|
561
561
|
e.save(), e.beginPath(), e.rect(R ? 0 : C, v, R ? C + 1 : S - C, p - v), e.clip(), e.font = `${n.fontSizeSM}px ${n.fontFamily}`, D(e, { x: I + 0.5, y: k + 0.5, width: l, height: u, fill: n.cellBg, stroke: n.cellLineColorActived, radius: 2 }), c(e, { x: I + 0.5, y: k + 0.5, width: l, height: u, rowIndex: m, columnIndex: h, theme: n, isActive: !0 }), e.restore();
|
|
562
|
-
},
|
|
562
|
+
}, $i = (e, t) => {
|
|
563
563
|
const { selection: n, mouseState: o, coordInstance: i, scrollState: a, theme: s, isFilling: r, isFillEnabled: c, real2RowIndex: l, getLinearRow: u } = t;
|
|
564
564
|
if (!r || !c || !n.isCellSelection) return;
|
|
565
565
|
const [h, m] = n.ranges, g = Math.min(h[0], m[0]), C = Math.max(h[0], m[0]), S = Math.min(h[1], m[1]), p = Math.max(h[1], m[1]), w = u(o.rowIndex).realIndex, { scrollLeft: v, scrollTop: y } = a, R = i.getColumnRelativeOffset(g, v), I = i.getColumnRelativeOffset(C, v) + i.getColumnWidth(C), k = (N) => i.getRowOffset(l(N)) + i.getRowHeight(l(N)) - y;
|
|
566
566
|
let P = null, A = null;
|
|
567
567
|
Number.isFinite(w) && w > p ? (P = i.getRowOffset(l(p + 1)) - y, A = k(w)) : Number.isFinite(w) && w < S && (P = i.getRowOffset(l(w)) - y, A = k(S - 1)), !(P == null || A == null) && (e.save(), e.globalAlpha = 0.12, D(e, { x: R + 0.5, y: P + 0.5, width: I - R, height: A - P, fill: s.interactionLineColorHighlight }), e.restore(), D(e, { x: R + 0.5, y: P + 0.5, width: I - R, height: A - P, stroke: s.interactionLineColorHighlight }));
|
|
568
|
-
},
|
|
568
|
+
}, Xi = (e, t) => {
|
|
569
569
|
const { coordInstance: n, scrollState: o, selection: i, isSelecting: a, isEditing: s, theme: r, activeCellBound: c, isFillEnabled: l, real2RowIndex: u, getLinearRow: h } = t;
|
|
570
570
|
if (!l || s || a) return;
|
|
571
|
-
const m =
|
|
571
|
+
const m = di(i);
|
|
572
572
|
if (m == null) return;
|
|
573
573
|
const { freezeColumnCount: g, freezeRegionWidth: C, rowInitSize: S, containerWidth: p, containerHeight: w } = n, [v, y] = m, R = n.getColumnRelativeOffset(v, o.scrollLeft), I = u(y), k = n.getRowOffset(I) - o.scrollTop, P = n.getColumnWidth(v), M = Ot([i.ranges[0]], [i.ranges[1]]) && c != null && c.columnIndex === v && c.rowIndex === y && h(I).type === se.Row ? c.height : n.getRowHeight(I);
|
|
574
574
|
e.save(), e.beginPath(), v >= g && (e.rect(C, S, p - C, w - S), e.clip()), D(e, { x: R + P - ot / 2 - 0.5, y: k + M - ot / 2 - 0.5, width: ot, height: ot, stroke: r.cellLineColorActived, fill: r.cellBg }), e.restore();
|
|
@@ -579,7 +579,7 @@ const ro = (e, t) => t ? Math.max(t - (e.iconSizeMD - e.iconSizeXS) / 2, 0) : 0,
|
|
|
579
579
|
if (D(e, { x: o + 0.5, y: i, width: a - 0.5, height: s, fill: r ?? v }), Ke(e, { x: o, y: i, points: [0, s, a, s, a, 0], stroke: w }), S && (P = P - k - te, h?.(e, { kind: "primary", x: o + A, y: M, size: k, theme: u, column: c }), A += k + te / 2), p && (P = P - k, h?.(e, { kind: "column", x: o + A, y: M, size: k, theme: u, column: c }), A += k + te / 2), N) {
|
|
580
580
|
P = P - Me - te;
|
|
581
581
|
const E = i + vn / 2;
|
|
582
|
-
|
|
582
|
+
si(e, {
|
|
583
583
|
points: [
|
|
584
584
|
{ x: o + a - te - Me, y: E - Me / 4 },
|
|
585
585
|
{ x: o + a - te, y: E - Me / 4 },
|
|
@@ -589,7 +589,7 @@ const ro = (e, t) => t ? Math.max(t - (e.iconSizeMD - e.iconSizeXS) / 2, 0) : 0,
|
|
|
589
589
|
fill: y
|
|
590
590
|
});
|
|
591
591
|
}
|
|
592
|
-
g && (h?.(e, { kind: "description", x: N ? o + a - 2 * k - te : o + a - k - te, y: M, size: k, theme: u, column: c }), P = P - k - te),
|
|
592
|
+
g && (h?.(e, { kind: "description", x: N ? o + a - 2 * k - te : o + a - k - te, y: M, size: k, theme: u, column: c }), P = P - k - te), ai(e, {
|
|
593
593
|
x: o + A,
|
|
594
594
|
y: i + Ft,
|
|
595
595
|
text: m,
|
|
@@ -599,10 +599,10 @@ const ro = (e, t) => t ? Math.max(t - (e.iconSizeMD - e.iconSizeXS) / 2, 0) : 0,
|
|
|
599
599
|
maxWidth: P,
|
|
600
600
|
fill: R
|
|
601
601
|
});
|
|
602
|
-
},
|
|
602
|
+
}, Yi = (e, t, n) => {
|
|
603
603
|
const { x: o, y: i, width: a, height: s, isChecked: r } = t, { theme: c, rowControls: l, rowControlPaddingX: u, isMultiSelectionEnable: h } = n, { iconSizeXS: m, staticWhite: g, columnHeaderBg: C, cellLineColor: S, rowHeaderTextColor: p, iconBgSelected: w } = c, v = m / 2;
|
|
604
|
-
if (D(e, { x: o, y: i, width: a, height: s, fill: C }), Ke(e, { x: o, y: i, points: [0, s, a, s], stroke: S }), h && l.some((y) => y.type ===
|
|
605
|
-
const y =
|
|
604
|
+
if (D(e, { x: o, y: i, width: a, height: s, fill: C }), Ke(e, { x: o, y: i, points: [0, s, a, s], stroke: S }), h && l.some((y) => y.type === q.Checkbox)) {
|
|
605
|
+
const y = co({ width: a, theme: c, rowControls: l, rowControlPaddingX: u });
|
|
606
606
|
Bt(e, {
|
|
607
607
|
x: o + y - v + 0.5,
|
|
608
608
|
y: i + s / 2 - v,
|
|
@@ -630,15 +630,15 @@ const ro = (e, t) => t ? Math.max(t - (e.iconSizeMD - e.iconSizeXS) / 2, 0) : 0,
|
|
|
630
630
|
}, t);
|
|
631
631
|
}
|
|
632
632
|
const M = y && R.length > 0 && Ot([R[0]], [[0, w - 1]]);
|
|
633
|
-
|
|
634
|
-
},
|
|
633
|
+
Yi(e, { x: 0, y: 0.5, width: S + 1.5, height: C, isChecked: M }, t), e.restore();
|
|
634
|
+
}, ji = (e, t) => {
|
|
635
635
|
const { coordInstance: n, theme: o, mouseState: i, scrollState: a, isColumnAppendEnable: s, drawIcon: r } = t;
|
|
636
636
|
if (!s) return;
|
|
637
637
|
const { totalWidth: c, totalHeight: l, rowInitSize: u } = n, { iconSizeSM: h, columnHeaderBg: m, cellLineColor: g, columnHeaderBgHovered: C } = o, S = c - a.scrollLeft;
|
|
638
638
|
D(e, { x: S + 1, y: 0.5, width: Sn, height: l - a.scrollTop, fill: i.type === x.AppendColumn ? C : m }), Ke(e, { x: S + 0.5, y: u + 0.5, points: [0, 0, 0, l - a.scrollTop - u], stroke: g });
|
|
639
639
|
const p = h / 2;
|
|
640
640
|
r?.(e, { kind: "add", x: S + Sn / 2 - p + 0.5, y: u / 2 - p + 0.5, size: h, theme: o });
|
|
641
|
-
},
|
|
641
|
+
}, Qi = (e, t) => {
|
|
642
642
|
const { theme: n, scrollState: o, coordInstance: i, isColumnResizable: a, columnResizeState: s, hoveredColumnResizeIndex: r } = t, c = s.columnIndex, l = !!a && r > -1, u = c > -1;
|
|
643
643
|
if (!l && !u) return;
|
|
644
644
|
const h = u ? c : r, m = i.getColumnRelativeOffset(h, o.scrollLeft) + i.getColumnWidth(h);
|
|
@@ -650,21 +650,21 @@ const ro = (e, t) => t ? Math.max(t - (e.iconSizeMD - e.iconSizeXS) / 2, 0) : 0,
|
|
|
650
650
|
fill: n.columnResizeHandlerBg,
|
|
651
651
|
radius: 3
|
|
652
652
|
});
|
|
653
|
-
},
|
|
653
|
+
}, Zi = (e, t) => {
|
|
654
654
|
const { theme: n, mouseState: o, scrollState: i, dragState: a, coordInstance: s } = t, { type: r, isDragging: c, ranges: l, delta: u } = a;
|
|
655
655
|
if (!c || r !== O.Columns) return;
|
|
656
656
|
const h = l[0][0];
|
|
657
657
|
D(e, { x: o.x - u, y: 0.5, width: s.getColumnWidth(h), height: s.containerHeight, fill: n.columnDraggingPlaceholderBg });
|
|
658
658
|
const m = Vt(s, o, i, r), g = s.getColumnRelativeOffset(m, i.scrollLeft);
|
|
659
659
|
D(e, { x: g - 0.5, y: 0.5, width: 2, height: s.containerHeight, fill: n.interactionLineColorHighlight });
|
|
660
|
-
},
|
|
660
|
+
}, Ji = (e, t) => {
|
|
661
661
|
const { theme: n, mouseState: o, scrollState: i, dragState: a, coordInstance: s } = t, { type: r, isDragging: c, ranges: l, delta: u } = a;
|
|
662
662
|
if (!c || r !== O.Rows) return;
|
|
663
663
|
const h = l[0][0];
|
|
664
664
|
D(e, { x: 0.5, y: o.y - u, width: s.containerWidth, height: s.getRowHeight(h), fill: n.columnDraggingPlaceholderBg });
|
|
665
665
|
const m = Vt(s, o, i, r), g = s.getRowOffset(m) - i.scrollTop;
|
|
666
666
|
D(e, { x: 0.5, y: g - 0.5, width: s.containerWidth, height: 2, fill: n.interactionLineColorHighlight });
|
|
667
|
-
},
|
|
667
|
+
}, ea = (e, t) => {
|
|
668
668
|
const { coordInstance: n, mouseState: o, scrollState: i, columnFreezeState: a, theme: s } = t, { isFreezing: r, targetIndex: c } = a;
|
|
669
669
|
if (o.type !== x.ColumnFreezeHandler && !r) return;
|
|
670
670
|
const { containerHeight: l, freezeRegionWidth: u } = n, h = s.interactionLineColorHighlight, m = r ? o.x : u;
|
|
@@ -673,32 +673,32 @@ const ro = (e, t) => t ? Math.max(t - (e.iconSizeMD - e.iconSizeXS) / 2, 0) : 0,
|
|
|
673
673
|
D(e, { x: g - 1, y: 0, width: 2, height: l, fill: h });
|
|
674
674
|
}
|
|
675
675
|
D(e, { x: m - xn / 2, y: o.y - Rn / 2, width: xn, height: Rn, fill: h, radius: 4 }), D(e, { x: m - 1, y: 0, width: 2, height: l, fill: h });
|
|
676
|
-
},
|
|
676
|
+
}, ta = (e, t) => {
|
|
677
677
|
const { theme: n, coordInstance: o, scrollState: i } = t, { freezeRegionWidth: a, containerHeight: s } = o, r = n.interactionLineColorCommon;
|
|
678
678
|
if (i.scrollLeft === 0) {
|
|
679
679
|
D(e, { x: a, y: 0.5, width: 1, height: s, fill: r });
|
|
680
680
|
return;
|
|
681
681
|
}
|
|
682
682
|
e.save(), e.beginPath(), e.shadowColor = r, e.shadowBlur = 5, e.shadowOffsetX = 3, e.strokeStyle = r, e.moveTo(a + 0.5, 0), e.lineTo(a + 0.5, s), e.stroke(), e.restore();
|
|
683
|
-
},
|
|
683
|
+
}, na = (e, t) => t == null ? !0 : !(e.scrollState.scrollLeft === t.scrollState.scrollLeft && e.scrollState.scrollTop === t.scrollState.scrollTop && e.theme === t.theme && e.columns === t.columns && e.getLinearRow === t.getLinearRow && e.real2RowIndex === t.real2RowIndex && e.drawCell === t.drawCell && e.coordInstance === t.coordInstance && e.visibleRegion === t.visibleRegion && e.forceRenderFlag === t.forceRenderFlag), oa = (e, t) => {
|
|
684
684
|
const { containerWidth: n, containerHeight: o, pixelRatio: i, shouldRerender: a, draw: s } = t, r = Math.ceil(n * i), c = Math.ceil(o * i);
|
|
685
685
|
(e.width !== r || e.height !== c) && (e.width = r, e.height = c);
|
|
686
686
|
const l = e.getContext("2d");
|
|
687
687
|
l != null && (a && (l.clearRect(0, 0, r, c), l.save(), i !== 1 && l.scale(i, i), l.beginPath(), l.rect(0, 0, n, o), l.clip()), s(l), a && l.restore());
|
|
688
|
-
},
|
|
689
|
-
const a =
|
|
688
|
+
}, ia = (e, t, n, o, i = Math.ceil(globalThis.devicePixelRatio ?? 1)) => {
|
|
689
|
+
const a = Vi(n), { coordInstance: s, scrollState: r, height: c } = a, { containerWidth: l } = s;
|
|
690
690
|
if (l === 0 || c === 0) return;
|
|
691
|
-
const u = Math.ceil(l * i), h = Math.ceil(c * i), m = r.isScrolling ||
|
|
691
|
+
const u = Math.ceil(l * i), h = Math.ceil(c * i), m = r.isScrolling || na(n, o);
|
|
692
692
|
(e.width !== u || e.height !== h) && (e.width = u, e.height = h, e.style.width = `${l}px`, e.style.height = `${c}px`);
|
|
693
693
|
const g = e.getContext("2d");
|
|
694
|
-
g != null && (g.clearRect(0, 0, u, h), g.save(), i !== 1 && g.scale(i, i), g.beginPath(), g.rect(0, 0, l, c), g.clip(),
|
|
694
|
+
g != null && (g.clearRect(0, 0, u, h), g.save(), i !== 1 && g.scale(i, i), g.beginPath(), g.rect(0, 0, l, c), g.clip(), oa(t, {
|
|
695
695
|
containerWidth: l,
|
|
696
696
|
containerHeight: c,
|
|
697
697
|
pixelRatio: i,
|
|
698
698
|
shouldRerender: m,
|
|
699
|
-
draw: (C) =>
|
|
700
|
-
}), g.save(), g.setTransform(1, 0, 0, 1, 0, 0), g.drawImage(t, 0, 0, u, h), g.restore(), s.rowInitSize > 0 && (Pn(g, a, "freeze"), Pn(g, a, "other"),
|
|
701
|
-
},
|
|
699
|
+
draw: (C) => Ki(g, C, { ...a, shouldRerender: m })
|
|
700
|
+
}), g.save(), g.setTransform(1, 0, 0, 1, 0, 0), g.drawImage(t, 0, 0, u, h), g.restore(), s.rowInitSize > 0 && (Pn(g, a, "freeze"), Pn(g, a, "other"), ji(g, a)), ta(g, a), _i(g, a), $i(g, a), Xi(g, a), Qi(g, a), Ji(g, a), Zi(g, a), ea(g, a), g.restore());
|
|
701
|
+
}, uo = {
|
|
702
702
|
staticWhite: "#FFFFFF",
|
|
703
703
|
staticBlack: "#000000",
|
|
704
704
|
iconFgCommon: "#6b7280",
|
|
@@ -743,7 +743,7 @@ const ro = (e, t) => t ? Math.max(t - (e.iconSizeMD - e.iconSizeXS) / 2, 0) : 0,
|
|
|
743
743
|
interactionLineColorCommon: "#d4d4d8",
|
|
744
744
|
interactionLineColorHighlight: "#3b82f6",
|
|
745
745
|
themeKey: "light"
|
|
746
|
-
},
|
|
746
|
+
}, ho = {
|
|
747
747
|
staticWhite: "--ui-accent-contrast",
|
|
748
748
|
staticBlack: "--ui-text",
|
|
749
749
|
iconFgCommon: "--ui-icon-tertiary",
|
|
@@ -782,57 +782,57 @@ const ro = (e, t) => t ? Math.max(t - (e.iconSizeMD - e.iconSizeXS) / 2, 0) : 0,
|
|
|
782
782
|
/** Cell text: the grid's own size (14px on a phone), else the body size. */
|
|
783
783
|
fontSizeSM: "--ui-grid-font-size",
|
|
784
784
|
fontSizeXS: "--ui-font-size-sm"
|
|
785
|
-
},
|
|
786
|
-
const n = { ...
|
|
787
|
-
for (const [i, a] of Object.entries(
|
|
785
|
+
}, aa = { fontSizeSM: "--ui-font-size" }, sa = (e, t = {}) => {
|
|
786
|
+
const n = { ...uo };
|
|
787
|
+
for (const [i, a] of Object.entries(ho)) {
|
|
788
788
|
const s = e(a)?.trim();
|
|
789
789
|
s && (n[i] = s);
|
|
790
790
|
}
|
|
791
791
|
const o = e(zn.fontFamily)?.trim();
|
|
792
792
|
o && (n.fontFamily = o);
|
|
793
793
|
for (const i of ["fontSizeSM", "fontSizeXS"]) {
|
|
794
|
-
const a =
|
|
794
|
+
const a = aa[i];
|
|
795
795
|
let s = Number.parseFloat(e(zn[i]) ?? "");
|
|
796
796
|
!(s > 0) && a && (s = Number.parseFloat(e(a) ?? "")), Number.isFinite(s) && s > 0 && (n[i] = s);
|
|
797
797
|
}
|
|
798
798
|
return { ...n, ...t };
|
|
799
|
-
},
|
|
799
|
+
}, ra = (e) => {
|
|
800
800
|
const t = getComputedStyle(e), n = e.ownerDocument.createElement("span");
|
|
801
801
|
n.setAttribute("aria-hidden", "true"), n.style.cssText = "position:absolute;width:0;height:0;overflow:hidden;visibility:hidden;pointer-events:none", e.appendChild(n);
|
|
802
|
-
const o = new Set(Object.values(
|
|
802
|
+
const o = new Set(Object.values(ho));
|
|
803
803
|
return Object.assign((a) => {
|
|
804
804
|
const s = t.getPropertyValue(a).trim();
|
|
805
805
|
return !s || !o.has(a) ? s : (n.style.color = "", n.style.color = `var(${a})`, getComputedStyle(n).color || s);
|
|
806
806
|
}, { dispose: () => n.remove() });
|
|
807
|
-
},
|
|
808
|
-
const n =
|
|
807
|
+
}, la = (e, t = {}) => {
|
|
808
|
+
const n = ra(e);
|
|
809
809
|
try {
|
|
810
810
|
const o = e.closest('[data-ui-color-scheme="dark"]') != null;
|
|
811
|
-
return
|
|
811
|
+
return sa(n, { themeKey: o ? "dark" : "light", ...t });
|
|
812
812
|
} finally {
|
|
813
813
|
n.dispose();
|
|
814
814
|
}
|
|
815
|
-
},
|
|
816
|
-
function
|
|
817
|
-
return (e instanceof Element ? e : e?.parentElement)?.closest(
|
|
815
|
+
}, mo = '[role="dialog"],[role="alertdialog"],[aria-modal="true"]';
|
|
816
|
+
function ca(e) {
|
|
817
|
+
return (e instanceof Element ? e : e?.parentElement)?.closest(mo) ?? null;
|
|
818
818
|
}
|
|
819
|
-
function
|
|
820
|
-
const n =
|
|
819
|
+
function ua(e, t) {
|
|
820
|
+
const n = ca(e);
|
|
821
821
|
return !!n && !n.contains(t);
|
|
822
822
|
}
|
|
823
823
|
function Mn(e, t) {
|
|
824
|
-
return e.some((n) => n instanceof Element && n.matches(
|
|
824
|
+
return e.some((n) => n instanceof Element && n.matches(mo) && !t.some((o) => n.contains(o) || o.contains(n)));
|
|
825
825
|
}
|
|
826
|
-
function
|
|
826
|
+
function da(e, t = e ?? null) {
|
|
827
827
|
if (!e?.isConnected) return !1;
|
|
828
828
|
const n = e.ownerDocument, o = n.activeElement;
|
|
829
|
-
return o === e ? !0 : o && o !== n.body &&
|
|
829
|
+
return o === e ? !0 : o && o !== n.body && ua(o, t ?? e) ? !1 : (e.focus({ preventScroll: !0 }), n.activeElement === e);
|
|
830
830
|
}
|
|
831
|
-
const
|
|
832
|
-
function
|
|
831
|
+
const ha = /* @__PURE__ */ new Set(["Enter", "Escape", "Tab"]), ma = 50;
|
|
832
|
+
function go(e) {
|
|
833
833
|
return e.isComposing || e.keyCode === 229;
|
|
834
834
|
}
|
|
835
|
-
function
|
|
835
|
+
function ga(e) {
|
|
836
836
|
const { keyCode: t, metaKey: n, ctrlKey: o } = e;
|
|
837
837
|
return n || o || t === 32 ? !1 : t >= 65 && t <= 90 || // A-Z
|
|
838
838
|
t >= 48 && t <= 57 || // 0-9 (ClosedParen..OpenParen)
|
|
@@ -842,7 +842,7 @@ function ma(e) {
|
|
|
842
842
|
t >= 106 && t <= 111 || // Multiply..Divide
|
|
843
843
|
t === 61 || t === 173 || (t === 229 || t === 0) && e.key !== "Shift";
|
|
844
844
|
}
|
|
845
|
-
function
|
|
845
|
+
function fo(e, t = {}) {
|
|
846
846
|
let n = !1, o = -1 / 0, i = !1;
|
|
847
847
|
const a = /* @__PURE__ */ new WeakMap(), s = (c) => {
|
|
848
848
|
n = !0, t.onStart?.(c);
|
|
@@ -854,11 +854,11 @@ function go(e, t = {}) {
|
|
|
854
854
|
return n;
|
|
855
855
|
},
|
|
856
856
|
ownsKey(c) {
|
|
857
|
-
if (n ||
|
|
858
|
-
if (!
|
|
857
|
+
if (n || go(c)) return !0;
|
|
858
|
+
if (!ha.has(c.key)) return !1;
|
|
859
859
|
const l = a.get(c);
|
|
860
860
|
if (l !== void 0) return l;
|
|
861
|
-
const u = c.timeStamp - o <=
|
|
861
|
+
const u = c.timeStamp - o <= ma;
|
|
862
862
|
return o = -1 / 0, a.set(c, u), u;
|
|
863
863
|
},
|
|
864
864
|
dispose() {
|
|
@@ -866,12 +866,12 @@ function go(e, t = {}) {
|
|
|
866
866
|
}
|
|
867
867
|
};
|
|
868
868
|
}
|
|
869
|
-
const
|
|
869
|
+
const fa = ({ isEditing: e, eventTarget: t, hiddenFocusEl: n }) => {
|
|
870
870
|
if (!e || t == null || t === n || !(t instanceof HTMLElement)) return !0;
|
|
871
871
|
const o = t.isContentEditable || t.contentEditable === "true";
|
|
872
872
|
return t.tagName !== "INPUT" && t.tagName !== "TEXTAREA" && !o;
|
|
873
|
-
},
|
|
874
|
-
`),
|
|
873
|
+
}, pa = /[\t\n\r"]/, Ca = (e) => pa.test(e) ? `"${e.replace(/"/g, '""')}"` : e, wa = (e) => e.map((t) => t.map(Ca).join(" ")).join(`\r
|
|
874
|
+
`), va = (e) => {
|
|
875
875
|
if (!e) return [];
|
|
876
876
|
const t = [];
|
|
877
877
|
let n = [], o = "", i = 0, a = !0;
|
|
@@ -883,7 +883,7 @@ const ga = ({ isEditing: e, eventTarget: t, hiddenFocusEl: n }) => {
|
|
|
883
883
|
for (; i < s; ) {
|
|
884
884
|
const l = e[i];
|
|
885
885
|
if (a && l === '"') {
|
|
886
|
-
const u =
|
|
886
|
+
const u = Sa(e, i + 1);
|
|
887
887
|
if (u === -1) {
|
|
888
888
|
o += l, a = !1, i++;
|
|
889
889
|
continue;
|
|
@@ -901,7 +901,7 @@ const ga = ({ isEditing: e, eventTarget: t, hiddenFocusEl: n }) => {
|
|
|
901
901
|
o += l, i++;
|
|
902
902
|
}
|
|
903
903
|
return c(), An(t);
|
|
904
|
-
},
|
|
904
|
+
}, Sa = (e, t) => {
|
|
905
905
|
let n = t;
|
|
906
906
|
for (; n < e.length; ) {
|
|
907
907
|
const o = e.indexOf('"', n);
|
|
@@ -919,7 +919,7 @@ const ga = ({ isEditing: e, eventTarget: t, hiddenFocusEl: n }) => {
|
|
|
919
919
|
const t = Math.max(0, ...e.map((n) => n.length));
|
|
920
920
|
for (const n of e) for (; n.length < t; ) n.push("");
|
|
921
921
|
return e;
|
|
922
|
-
},
|
|
922
|
+
}, ya = (e) => e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """), ba = (e) => e.length === 0 || e.length === 1 && e[0].length <= 1 ? void 0 : `<table><tbody>${e.map((n) => `<tr>${n.map((o) => `<td>${ya(o).replace(/\r?\n/g, "<br>")}</td>`).join("")}</tr>`).join("")}</tbody></table>`, xa = (e, t) => {
|
|
923
923
|
const n = e.clipboardData;
|
|
924
924
|
if (!n) return !1;
|
|
925
925
|
try {
|
|
@@ -928,18 +928,18 @@ const ga = ({ isEditing: e, eventTarget: t, hiddenFocusEl: n }) => {
|
|
|
928
928
|
return !1;
|
|
929
929
|
}
|
|
930
930
|
return e.preventDefault(), !0;
|
|
931
|
-
},
|
|
931
|
+
}, Ra = () => ({
|
|
932
932
|
clipboard: typeof navigator < "u" ? navigator.clipboard : void 0,
|
|
933
933
|
ClipboardItem: typeof ClipboardItem < "u" ? ClipboardItem : void 0,
|
|
934
934
|
hasFocus: () => typeof document < "u" ? document.hasFocus() : !0,
|
|
935
935
|
onFocus: (e) => window.addEventListener("focus", e, { once: !0 })
|
|
936
|
-
}),
|
|
936
|
+
}), ka = (e, t = Ra()) => {
|
|
937
937
|
const { clipboard: n, ClipboardItem: o } = t, i = () => {
|
|
938
938
|
if (o && n?.write) {
|
|
939
939
|
const a = new o({
|
|
940
940
|
"text/plain": e.then(({ text: s }) => new Blob([s], { type: "text/plain" })),
|
|
941
941
|
// Null means no HTML; an empty table keeps the blob type valid in every browser.
|
|
942
|
-
"text/html": e.then(({ text: s, html: r }) => new Blob([r ??
|
|
942
|
+
"text/html": e.then(({ text: s, html: r }) => new Blob([r ?? Ia(s)], { type: "text/html" }))
|
|
943
943
|
});
|
|
944
944
|
return n.write([a]);
|
|
945
945
|
}
|
|
@@ -956,7 +956,7 @@ const ga = ({ isEditing: e, eventTarget: t, hiddenFocusEl: n }) => {
|
|
|
956
956
|
}
|
|
957
957
|
})) : Promise.reject(a);
|
|
958
958
|
}
|
|
959
|
-
},
|
|
959
|
+
}, Ia = (e) => e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">"), it = (e, t, n) => Math.min(n, Math.max(t, e)), Xe = (e, t) => {
|
|
960
960
|
if (e.kind !== "cells" || e.ranges.length < 2 || t.rowCount <= 0 || t.columnCount <= 0) return null;
|
|
961
961
|
const [n, o] = e.ranges, i = t.columnCount - 1, a = t.rowCount - 1;
|
|
962
962
|
return {
|
|
@@ -974,12 +974,12 @@ const ga = ({ isEditing: e, eventTarget: t, hiddenFocusEl: n }) => {
|
|
|
974
974
|
for (const [i, a] of o)
|
|
975
975
|
for (let s = Math.max(0, i); s <= Math.min(t - 1, a); s++) n.add(s);
|
|
976
976
|
return [...n].sort((i, a) => i - a);
|
|
977
|
-
},
|
|
977
|
+
}, po = (e, t) => {
|
|
978
978
|
const { rowCount: n, columnCount: o } = t;
|
|
979
979
|
if (n <= 0 || o <= 0) return null;
|
|
980
980
|
switch (e.kind) {
|
|
981
981
|
case "cells": {
|
|
982
|
-
const i =
|
|
982
|
+
const i = Xe(e, t);
|
|
983
983
|
return i ? { rows: at(i.startRow, i.endRow), columns: at(i.startColumn, i.endColumn) } : null;
|
|
984
984
|
}
|
|
985
985
|
case "rows": {
|
|
@@ -993,21 +993,21 @@ const ga = ({ isEditing: e, eventTarget: t, hiddenFocusEl: n }) => {
|
|
|
993
993
|
default:
|
|
994
994
|
return null;
|
|
995
995
|
}
|
|
996
|
-
},
|
|
996
|
+
}, Pa = (e, t) => {
|
|
997
997
|
if (e.kind === "cells") {
|
|
998
|
-
const o =
|
|
998
|
+
const o = Xe(e, t);
|
|
999
999
|
return o ? [o.startColumn, o.startRow] : null;
|
|
1000
1000
|
}
|
|
1001
|
-
const n =
|
|
1001
|
+
const n = po(e, t);
|
|
1002
1002
|
return n ? [n.columns[0], n.rows[0]] : null;
|
|
1003
|
-
},
|
|
1004
|
-
const o =
|
|
1003
|
+
}, za = (e) => e.rows.length * e.columns.length, Ma = (e, t, n) => {
|
|
1004
|
+
const o = va(e);
|
|
1005
1005
|
if (o.length === 0) return null;
|
|
1006
|
-
const i =
|
|
1006
|
+
const i = Pa(t, n);
|
|
1007
1007
|
if (!i) return null;
|
|
1008
1008
|
const { rowCount: a, columnCount: s } = n;
|
|
1009
1009
|
let r = o, c = !1;
|
|
1010
|
-
const l =
|
|
1010
|
+
const l = Xe(t, n);
|
|
1011
1011
|
if (o.length === 1 && o[0].length === 1 && l && (l.endRow > l.startRow || l.endColumn > l.startColumn)) {
|
|
1012
1012
|
const w = o[0][0];
|
|
1013
1013
|
r = Array.from({ length: l.endRow - l.startRow + 1 }, () => Array.from({ length: l.endColumn - l.startColumn + 1 }, () => w)), c = !0;
|
|
@@ -1027,8 +1027,8 @@ const ga = ({ isEditing: e, eventTarget: t, hiddenFocusEl: n }) => {
|
|
|
1027
1027
|
readonlyColumns: p,
|
|
1028
1028
|
repeated: c
|
|
1029
1029
|
};
|
|
1030
|
-
}, Hn = (e, t) => e.rows.map((n) => e.columns.map((o) => t([o, n]))), It = (e) => ({ text:
|
|
1031
|
-
function
|
|
1030
|
+
}, Hn = (e, t) => e.rows.map((n) => e.columns.map((o) => t([o, n]))), It = (e) => ({ text: wa(e), html: ba(e) }), Aa = (e, t) => !t || e.rows.every((n) => t(n));
|
|
1031
|
+
function Ea(e) {
|
|
1032
1032
|
const t = e.equals ?? Object.is;
|
|
1033
1033
|
let n = !1, o = null, i, a, s = !1, r = null, c = 0, l = !1;
|
|
1034
1034
|
const u = {
|
|
@@ -1091,20 +1091,20 @@ function Aa(e) {
|
|
|
1091
1091
|
};
|
|
1092
1092
|
return g;
|
|
1093
1093
|
}
|
|
1094
|
-
const
|
|
1094
|
+
const Co = "data-ui-ignore-outside", Pt = /* @__PURE__ */ new WeakMap(), Tn = /* @__PURE__ */ new WeakSet();
|
|
1095
1095
|
function Fn(e) {
|
|
1096
1096
|
return [...e.options.elements()].filter((t) => !!t);
|
|
1097
1097
|
}
|
|
1098
1098
|
function Nn(e, t) {
|
|
1099
1099
|
return e.some((n) => n instanceof Node && t.some((o) => o === n || o.contains(n)));
|
|
1100
1100
|
}
|
|
1101
|
-
function
|
|
1102
|
-
return e.some((t) => t instanceof Element && t.hasAttribute(
|
|
1101
|
+
function Ha(e) {
|
|
1102
|
+
return e.some((t) => t instanceof Element && t.hasAttribute(Co));
|
|
1103
1103
|
}
|
|
1104
|
-
function
|
|
1104
|
+
function Ta(e, t) {
|
|
1105
1105
|
return e.length > 0 && !e.includes(t);
|
|
1106
1106
|
}
|
|
1107
|
-
function
|
|
1107
|
+
function Fa(e, t = 400) {
|
|
1108
1108
|
let n = 0;
|
|
1109
1109
|
const o = () => {
|
|
1110
1110
|
e.clearTimeout(n), e.removeEventListener("click", i, !0), e.removeEventListener("pointerdown", o, !0), e.removeEventListener("keydown", o, !0);
|
|
@@ -1113,19 +1113,19 @@ function Ta(e, t = 400) {
|
|
|
1113
1113
|
};
|
|
1114
1114
|
return e.addEventListener("click", i, !0), e.addEventListener("pointerdown", o, !0), e.addEventListener("keydown", o, !0), n = e.setTimeout(o, t), o;
|
|
1115
1115
|
}
|
|
1116
|
-
function
|
|
1117
|
-
const t = e.document, n = { layers: [], guard:
|
|
1116
|
+
function Na(e) {
|
|
1117
|
+
const t = e.document, n = { layers: [], guard: fo(e), teardown: () => {
|
|
1118
1118
|
} }, o = (a) => {
|
|
1119
1119
|
if (Tn.has(a)) return;
|
|
1120
1120
|
Tn.add(a);
|
|
1121
1121
|
const s = a.composedPath();
|
|
1122
|
-
if (!(
|
|
1122
|
+
if (!(Ha(s) || Ta(s, t)))
|
|
1123
1123
|
for (const r of [...n.layers].reverse()) {
|
|
1124
1124
|
if (r.disposed) continue;
|
|
1125
1125
|
const c = Fn(r);
|
|
1126
1126
|
if (Nn(s, c) || Mn(s, c)) return;
|
|
1127
1127
|
if (r.options.onOutside?.(a) === "veto") {
|
|
1128
|
-
a.preventDefault(), a.stopImmediatePropagation(),
|
|
1128
|
+
a.preventDefault(), a.stopImmediatePropagation(), Fa(e);
|
|
1129
1129
|
return;
|
|
1130
1130
|
}
|
|
1131
1131
|
}
|
|
@@ -1135,15 +1135,15 @@ function Fa(e) {
|
|
|
1135
1135
|
if (!s?.options.onEscape) return;
|
|
1136
1136
|
const r = a.composedPath(), c = Fn(s);
|
|
1137
1137
|
if (Mn(r, c)) return;
|
|
1138
|
-
const l = r.find((u) => u instanceof Element && u.hasAttribute(
|
|
1138
|
+
const l = r.find((u) => u instanceof Element && u.hasAttribute(Co));
|
|
1139
1139
|
l && !Nn([l], c) || s.options.onEscape(a) && (a.preventDefault(), a.stopPropagation());
|
|
1140
1140
|
};
|
|
1141
1141
|
return e.addEventListener("pointerdown", o, !0), e.addEventListener("keydown", i, !0), n.teardown = () => {
|
|
1142
1142
|
e.removeEventListener("pointerdown", o, !0), e.removeEventListener("keydown", i, !0), n.guard.dispose();
|
|
1143
1143
|
}, n;
|
|
1144
1144
|
}
|
|
1145
|
-
function
|
|
1146
|
-
const n = Pt.get(e) ??
|
|
1145
|
+
function La(e, t) {
|
|
1146
|
+
const n = Pt.get(e) ?? Na(e);
|
|
1147
1147
|
Pt.set(e, n);
|
|
1148
1148
|
const o = { options: t, disposed: !1 };
|
|
1149
1149
|
return n.layers.push(o), {
|
|
@@ -1156,23 +1156,23 @@ function Na(e, t) {
|
|
|
1156
1156
|
};
|
|
1157
1157
|
}
|
|
1158
1158
|
function Ln(e) {
|
|
1159
|
-
const t =
|
|
1159
|
+
const t = to(e);
|
|
1160
1160
|
return Array.isArray(t) ? [...t] : [t];
|
|
1161
1161
|
}
|
|
1162
|
-
function
|
|
1163
|
-
const o = ue(() =>
|
|
1162
|
+
function Da(e, t, n) {
|
|
1163
|
+
const o = ue(() => to(t), (i, a, s) => {
|
|
1164
1164
|
if (!i || typeof window > "u") return;
|
|
1165
|
-
const r = Ln(e).find(Boolean)?.ownerDocument?.defaultView ?? window, c =
|
|
1165
|
+
const r = Ln(e).find(Boolean)?.ownerDocument?.defaultView ?? window, c = La(r, {
|
|
1166
1166
|
elements: () => Ln(e),
|
|
1167
1167
|
onOutside: (l) => n.onOutside?.(l),
|
|
1168
1168
|
onEscape: (l) => n.onEscape?.(l)
|
|
1169
1169
|
});
|
|
1170
1170
|
s(() => c.dispose());
|
|
1171
1171
|
}, { immediate: !0, flush: "sync" });
|
|
1172
|
-
return qo() &&
|
|
1172
|
+
return qo() && no(o), o;
|
|
1173
1173
|
}
|
|
1174
|
-
const
|
|
1175
|
-
function
|
|
1174
|
+
const wo = 2, Wa = 4, zt = 20, Ba = 2, Oa = 5, lt = 16;
|
|
1175
|
+
function Va(e, t, n) {
|
|
1176
1176
|
const o = e.createElement("canvas").getContext("2d");
|
|
1177
1177
|
if (!o) return null;
|
|
1178
1178
|
o.font = `${t}px ${n}`, o.textBaseline = "alphabetic";
|
|
@@ -1192,16 +1192,16 @@ function ut(e) {
|
|
|
1192
1192
|
const o = Math.max(0, (n - zt) / 2), i = t ? Math.round(n / 2 + t.drop - t.ascent) - Math.floor((zt - Math.ceil(t.ascent + t.descent)) / 2) : o;
|
|
1193
1193
|
return { top: Math.max(0, i), bottom: e.hint ? lt : o, lineHeight: zt };
|
|
1194
1194
|
}
|
|
1195
|
-
function
|
|
1195
|
+
function vo(e) {
|
|
1196
1196
|
if (!Ut(e)) return e.rowHeight;
|
|
1197
|
-
const { top: t, bottom: n, lineHeight: o } = ut(e), i = e.view ? 1 :
|
|
1197
|
+
const { top: t, bottom: n, lineHeight: o } = ut(e), i = e.view ? 1 : Ba, a = Math.min(Oa, Math.max(i, Math.ceil(e.lines)));
|
|
1198
1198
|
return Math.max(e.rowHeight, t + n + a * o);
|
|
1199
1199
|
}
|
|
1200
|
-
function
|
|
1200
|
+
function Ga(e, t) {
|
|
1201
1201
|
const { top: n, bottom: o, lineHeight: i } = ut(t);
|
|
1202
1202
|
return Math.max(1, Math.round((e - n - o) / i));
|
|
1203
1203
|
}
|
|
1204
|
-
const
|
|
1204
|
+
const Ua = {
|
|
1205
1205
|
display: "block",
|
|
1206
1206
|
width: "100%",
|
|
1207
1207
|
height: "100%",
|
|
@@ -1217,14 +1217,14 @@ const Ga = {
|
|
|
1217
1217
|
color: "transparent",
|
|
1218
1218
|
font: "inherit"
|
|
1219
1219
|
};
|
|
1220
|
-
function
|
|
1221
|
-
if (!e.open) return
|
|
1220
|
+
function Ka(e) {
|
|
1221
|
+
if (!e.open) return Ua;
|
|
1222
1222
|
const { top: t, bottom: n, lineHeight: o } = ut(e), i = B.cellHorizontalPadding, a = Ut(e), s = e.invalid ? e.dangerColor : e.theme.cellLineColorActived;
|
|
1223
1223
|
return {
|
|
1224
1224
|
display: "block",
|
|
1225
1225
|
"box-sizing": "border-box",
|
|
1226
1226
|
width: "100%",
|
|
1227
|
-
height: `${
|
|
1227
|
+
height: `${vo(e)}px`,
|
|
1228
1228
|
margin: "0",
|
|
1229
1229
|
padding: `${t}px ${i}px ${n}px`,
|
|
1230
1230
|
border: "0",
|
|
@@ -1240,12 +1240,12 @@ function Ua(e) {
|
|
|
1240
1240
|
"caret-color": e.theme.cellTextColor,
|
|
1241
1241
|
font: `${e.theme.fontSizeSM}px/${o}px ${e.theme.fontFamily}`,
|
|
1242
1242
|
"text-align": e.kind === "number" && !e.view ? "right" : "left",
|
|
1243
|
-
"border-radius": `${
|
|
1244
|
-
"box-shadow": `0 0 0 ${
|
|
1243
|
+
"border-radius": `${Wa}px`,
|
|
1244
|
+
"box-shadow": `0 0 0 ${wo}px ${s}`,
|
|
1245
1245
|
transition: "none"
|
|
1246
1246
|
};
|
|
1247
1247
|
}
|
|
1248
|
-
function
|
|
1248
|
+
function _a(e) {
|
|
1249
1249
|
return {
|
|
1250
1250
|
position: "absolute",
|
|
1251
1251
|
left: `${B.cellHorizontalPadding}px`,
|
|
@@ -1262,10 +1262,10 @@ function Ka(e) {
|
|
|
1262
1262
|
"pointer-events": "none"
|
|
1263
1263
|
};
|
|
1264
1264
|
}
|
|
1265
|
-
function
|
|
1265
|
+
function $a(e) {
|
|
1266
1266
|
return {
|
|
1267
1267
|
position: "absolute",
|
|
1268
|
-
left: `-${
|
|
1268
|
+
left: `-${wo}px`,
|
|
1269
1269
|
"max-width": "320px",
|
|
1270
1270
|
"min-width": "120px",
|
|
1271
1271
|
"box-sizing": "border-box",
|
|
@@ -1281,7 +1281,7 @@ function _a(e) {
|
|
|
1281
1281
|
"pointer-events": "none"
|
|
1282
1282
|
};
|
|
1283
1283
|
}
|
|
1284
|
-
const
|
|
1284
|
+
const Xa = (e, t) => !!e && !!t && e[0] === t[0] && e[1] === t[1];
|
|
1285
1285
|
class qa {
|
|
1286
1286
|
session;
|
|
1287
1287
|
options;
|
|
@@ -1322,7 +1322,7 @@ class qa {
|
|
|
1322
1322
|
get version() {
|
|
1323
1323
|
return n().version;
|
|
1324
1324
|
}
|
|
1325
|
-
}, this.session =
|
|
1325
|
+
}, this.session = Ea({
|
|
1326
1326
|
validate: (i, a) => this.mode === "edit" ? this.options.validate?.(a, i ?? "") : null,
|
|
1327
1327
|
onCommit: (i, a, s) => {
|
|
1328
1328
|
const { move: r, reason: c } = this.pending;
|
|
@@ -1337,7 +1337,7 @@ class qa {
|
|
|
1337
1337
|
* edited (the IME keydown, then its `compositionstart`) changes nothing.
|
|
1338
1338
|
*/
|
|
1339
1339
|
begin(t) {
|
|
1340
|
-
if (this.state.active &&
|
|
1340
|
+
if (this.state.active && Xa(this.state.cell, t.cell)) return null;
|
|
1341
1341
|
this.state.active && this.commit("selection", "none");
|
|
1342
1342
|
const n = t.mode === "edit" && (t.trigger === "key" || t.trigger === "composition");
|
|
1343
1343
|
this.mode = t.mode, this.kind = t.kind, this.pending = { move: "none", reason: "blur" };
|
|
@@ -1403,7 +1403,7 @@ class qa {
|
|
|
1403
1403
|
return this.pending.reason;
|
|
1404
1404
|
}
|
|
1405
1405
|
}
|
|
1406
|
-
function
|
|
1406
|
+
function Ya(e) {
|
|
1407
1407
|
const t = ce(1);
|
|
1408
1408
|
let n = null;
|
|
1409
1409
|
const o = new qa({
|
|
@@ -1443,7 +1443,7 @@ function Xa(e) {
|
|
|
1443
1443
|
if (!u || !g || h !== "long-text" && m !== "view") return;
|
|
1444
1444
|
const C = { kind: h, view: m === "view", hint: h === "long-text" && m === "edit" && e.hasHint(), rowHeight: e.rowHeight(), textBox: e.textBox() }, { top: S, bottom: p } = ut(C), { height: w, padding: v, whiteSpace: y } = u.style;
|
|
1445
1445
|
u.style.height = "0px", u.style.padding = `${S}px 8px ${p}px`, u.style.whiteSpace = "pre-wrap";
|
|
1446
|
-
const R =
|
|
1446
|
+
const R = Ga(u.scrollHeight, C);
|
|
1447
1447
|
u.style.height = w, u.style.padding = v, u.style.whiteSpace = y, R !== t.value && (t.value = R);
|
|
1448
1448
|
}, l = {
|
|
1449
1449
|
state: a,
|
|
@@ -1494,10 +1494,10 @@ function Xa(e) {
|
|
|
1494
1494
|
}
|
|
1495
1495
|
};
|
|
1496
1496
|
return ue(e.owner, (u, h, m) => {
|
|
1497
|
-
u && (n =
|
|
1497
|
+
u && (n = fo(u), m(() => {
|
|
1498
1498
|
n?.dispose(), n = null;
|
|
1499
1499
|
}));
|
|
1500
|
-
}, { immediate: !0, flush: "sync" }),
|
|
1500
|
+
}, { immediate: !0, flush: "sync" }), Da(
|
|
1501
1501
|
() => e.root() ?? null,
|
|
1502
1502
|
() => a.value.active || e.hasSelection(),
|
|
1503
1503
|
{
|
|
@@ -1509,9 +1509,9 @@ function Xa(e) {
|
|
|
1509
1509
|
if (o.commit("outside", "none") === "invalid") return "veto";
|
|
1510
1510
|
}
|
|
1511
1511
|
}
|
|
1512
|
-
),
|
|
1512
|
+
), no(() => o.cancel()), l;
|
|
1513
1513
|
}
|
|
1514
|
-
const
|
|
1514
|
+
const ja = {
|
|
1515
1515
|
text: "--ui-text",
|
|
1516
1516
|
textMuted: "--ui-text-secondary",
|
|
1517
1517
|
link: "--ui-accent-11",
|
|
@@ -1532,7 +1532,7 @@ const Ya = {
|
|
|
1532
1532
|
avatarText: "--ui-text",
|
|
1533
1533
|
badgeFill: "--ui-neutral-soft",
|
|
1534
1534
|
badgeText: "--ui-neutral-text"
|
|
1535
|
-
},
|
|
1535
|
+
}, Qa = {
|
|
1536
1536
|
neutral: { fill: "--ui-neutral-soft", color: "--ui-neutral-text" },
|
|
1537
1537
|
info: { fill: "--ui-info-soft", color: "--ui-info-text" },
|
|
1538
1538
|
success: { fill: "--ui-success-soft", color: "--ui-success-text" },
|
|
@@ -1577,15 +1577,15 @@ const Ya = {
|
|
|
1577
1577
|
gray: { fill: "rgba(198, 212, 224, 0.4)", color: "#636b74" }
|
|
1578
1578
|
},
|
|
1579
1579
|
themeKey: "light"
|
|
1580
|
-
},
|
|
1580
|
+
}, Za = (e, t = {}) => {
|
|
1581
1581
|
const n = (i, a) => e(i)?.trim() || a, o = { ...Ue, chips: { ...Ue.chips } };
|
|
1582
|
-
for (const [i, a] of Object.entries(
|
|
1583
|
-
for (const [i, a] of Object.entries(
|
|
1582
|
+
for (const [i, a] of Object.entries(ja)) o[i] = n(a, o[i]);
|
|
1583
|
+
for (const [i, a] of Object.entries(Qa)) {
|
|
1584
1584
|
const s = Ue.chips[i];
|
|
1585
1585
|
o.chips[i] = { fill: n(a.fill, s.fill), color: n(a.color, s.color) };
|
|
1586
1586
|
}
|
|
1587
1587
|
return { ...o, ...t };
|
|
1588
|
-
},
|
|
1588
|
+
}, So = (e, t = {}) => {
|
|
1589
1589
|
const n = getComputedStyle(e), o = e.ownerDocument.createElement("span");
|
|
1590
1590
|
o.setAttribute("aria-hidden", "true"), o.style.cssText = "position:absolute;width:0;height:0;overflow:hidden;visibility:hidden;pointer-events:none", e.appendChild(o);
|
|
1591
1591
|
try {
|
|
@@ -1593,7 +1593,7 @@ const Ya = {
|
|
|
1593
1593
|
if (n.getPropertyValue(s).trim())
|
|
1594
1594
|
return o.style.color = "", o.style.color = `var(${s})`, getComputedStyle(o).color || void 0;
|
|
1595
1595
|
}, a = e.closest('[data-ui-color-scheme="dark"]') != null;
|
|
1596
|
-
return
|
|
1596
|
+
return Za(i, { themeKey: a ? "dark" : "light", ...t });
|
|
1597
1597
|
} finally {
|
|
1598
1598
|
o.remove();
|
|
1599
1599
|
}
|
|
@@ -1604,7 +1604,7 @@ const Ya = {
|
|
|
1604
1604
|
icon: Math.max(12, Math.min(16, e - 8)),
|
|
1605
1605
|
fontSize: t,
|
|
1606
1606
|
chipFontSize: Math.min(n, Math.max(10, e - 12))
|
|
1607
|
-
}),
|
|
1607
|
+
}), Ja = 30, es = 2, ts = 1200, ns = (e, t, n, o = Ja) => {
|
|
1608
1608
|
const { x: i, y: a } = e, { containerWidth: s, containerHeight: r, freezeRegionWidth: c, columnInitSize: l, rowInitSize: u } = t;
|
|
1609
1609
|
let h = 0, m = 0;
|
|
1610
1610
|
if (!n || n === O.None || n === O.Columns) {
|
|
@@ -1612,11 +1612,11 @@ const Ya = {
|
|
|
1612
1612
|
s - i < o ? h = 1 : i < c + o && !g && (h = -1);
|
|
1613
1613
|
}
|
|
1614
1614
|
return (!n || n === O.None || n === O.Rows) && (r - a < o ? m = 1 : a < u + o && (m = -1)), [h, m];
|
|
1615
|
-
},
|
|
1616
|
-
const o = Math.min(1, e + t /
|
|
1615
|
+
}, os = (e, t, n) => {
|
|
1616
|
+
const o = Math.min(1, e + t / ts), i = o * t * es + (n ?? 0), a = Math.floor(i);
|
|
1617
1617
|
return { speed: o, motion: a, carry: n == null ? 0 : i - a };
|
|
1618
1618
|
};
|
|
1619
|
-
class
|
|
1619
|
+
class is {
|
|
1620
1620
|
direction = [0, 0];
|
|
1621
1621
|
speed = 0;
|
|
1622
1622
|
carry = 0;
|
|
@@ -1630,7 +1630,7 @@ class os {
|
|
|
1630
1630
|
return this.frameId != null;
|
|
1631
1631
|
}
|
|
1632
1632
|
update(t, n) {
|
|
1633
|
-
const [o, i] =
|
|
1633
|
+
const [o, i] = ns(t, this.options.getBounds(), n);
|
|
1634
1634
|
if (!(o === this.direction[0] && i === this.direction[1])) {
|
|
1635
1635
|
if (this.direction = [o, i], this.cancel(), o === 0 && i === 0) {
|
|
1636
1636
|
this.speed = 0, this.carry = 0;
|
|
@@ -1644,7 +1644,7 @@ class os {
|
|
|
1644
1644
|
}
|
|
1645
1645
|
processFrame = (t) => {
|
|
1646
1646
|
if (this.lastTime !== 0) {
|
|
1647
|
-
const n =
|
|
1647
|
+
const n = os(this.speed, t - this.lastTime, this.options.carryFraction === !1 ? void 0 : this.carry);
|
|
1648
1648
|
this.speed = n.speed, this.carry = n.carry;
|
|
1649
1649
|
const [o, i] = this.direction, a = o * n.motion, s = i * n.motion;
|
|
1650
1650
|
(a !== 0 || s !== 0) && this.options.scrollBy(a, s), this.options.onTick?.(a, s);
|
|
@@ -1662,7 +1662,7 @@ const Wn = (e, t, n, o) => {
|
|
|
1662
1662
|
const i = e.getColumnRelativeOffset(o, t);
|
|
1663
1663
|
return V(n, i, i + B.columnResizeHandlerWidth / 2) ? o - 1 : o;
|
|
1664
1664
|
};
|
|
1665
|
-
class
|
|
1665
|
+
class as {
|
|
1666
1666
|
state = Rt;
|
|
1667
1667
|
hoveredIndex = -1;
|
|
1668
1668
|
pressed = null;
|
|
@@ -1714,7 +1714,7 @@ class is {
|
|
|
1714
1714
|
this.pressed = null, this.state = Rt, this.emit(), this.options.onResize?.(n, t);
|
|
1715
1715
|
}
|
|
1716
1716
|
}
|
|
1717
|
-
class
|
|
1717
|
+
class ss {
|
|
1718
1718
|
defaultRowHeight;
|
|
1719
1719
|
defaultColumnWidth;
|
|
1720
1720
|
pureRowCount;
|
|
@@ -1869,12 +1869,12 @@ class as {
|
|
|
1869
1869
|
this.rowCount = t, this.pureRowCount = n, this.rowInitSize = o, this.rowHeightMap = i, a != null && (this.defaultRowHeight = a), this.lastRowIndex = -1, this.rowMetaDataMap = {};
|
|
1870
1870
|
}
|
|
1871
1871
|
}
|
|
1872
|
-
const
|
|
1872
|
+
const rs = 240, ls = ({
|
|
1873
1873
|
containerWidth: e,
|
|
1874
1874
|
columnInitSize: t,
|
|
1875
1875
|
columnCount: n,
|
|
1876
1876
|
getColumnWidth: o,
|
|
1877
|
-
minScrollableWidth: i =
|
|
1877
|
+
minScrollableWidth: i = rs
|
|
1878
1878
|
}) => {
|
|
1879
1879
|
const a = e - i;
|
|
1880
1880
|
if (a <= t) return 0;
|
|
@@ -1882,7 +1882,7 @@ const ss = 240, rs = ({
|
|
|
1882
1882
|
for (let r = 0; r < n; r++)
|
|
1883
1883
|
if (s += o(r) ?? 0, s > a) return r;
|
|
1884
1884
|
return n;
|
|
1885
|
-
},
|
|
1885
|
+
}, cs = (e, t, n, o) => {
|
|
1886
1886
|
const { pureRowCount: i, columnCount: a } = o, s = !!n.expand;
|
|
1887
1887
|
let [r, c] = e.ranges[s ? 1 : 0];
|
|
1888
1888
|
n.jump ? t === "up" ? c = 0 : t === "down" ? c = i - 1 : t === "left" ? r = 0 : r = a - 1 : t === "up" ? c = Math.max(c - 1, 0) : t === "down" ? c = Math.min(c + 1, i - 1) : t === "left" ? r = Math.max(r - 1, 0) : r = Math.min(r + 1, a - 1);
|
|
@@ -1895,7 +1895,7 @@ const ss = 240, rs = ({
|
|
|
1895
1895
|
}, Bn = (e, t, n) => {
|
|
1896
1896
|
const [o, i] = e.ranges[0], s = [t ? Math.max(o - 1, 0) : Math.min(o + 1, n.columnCount - 1), i];
|
|
1897
1897
|
return { selection: e.setRanges([s, s]), activeCell: s, scrollTo: s };
|
|
1898
|
-
},
|
|
1898
|
+
}, us = (e, t) => e.setRanges([[0, 0], [t.columnCount - 1, t.pureRowCount - 1]]), ds = (e, t, n = !1) => {
|
|
1899
1899
|
let o = e.ranges[0];
|
|
1900
1900
|
e.isColumnSelection && (o = [o[0], 0]);
|
|
1901
1901
|
const [i, a] = o, s = n ? a : Math.min(a + 1, t.pureRowCount - 1), r = [i, s];
|
|
@@ -1954,7 +1954,7 @@ class oe {
|
|
|
1954
1954
|
switch (this.type) {
|
|
1955
1955
|
case H.Rows:
|
|
1956
1956
|
case H.Columns: {
|
|
1957
|
-
const n =
|
|
1957
|
+
const n = ui(this.ranges, t);
|
|
1958
1958
|
return n.length ? new oe(this.type, n) : Ge;
|
|
1959
1959
|
}
|
|
1960
1960
|
case H.Cells:
|
|
@@ -1965,7 +1965,7 @@ class oe {
|
|
|
1965
1965
|
}
|
|
1966
1966
|
flatten() {
|
|
1967
1967
|
const [t, n] = this.ranges;
|
|
1968
|
-
return this.isCellSelection ? [...t, ...n] :
|
|
1968
|
+
return this.isCellSelection ? [...t, ...n] : li(this.ranges);
|
|
1969
1969
|
}
|
|
1970
1970
|
/** Runs merged and sorted, or the cell rectangle as `[topLeft, bottomRight]`. */
|
|
1971
1971
|
serialize() {
|
|
@@ -1990,9 +1990,9 @@ class oe {
|
|
|
1990
1990
|
switch (this.type) {
|
|
1991
1991
|
case H.Rows:
|
|
1992
1992
|
case H.Columns:
|
|
1993
|
-
return
|
|
1993
|
+
return ri(t, this.ranges);
|
|
1994
1994
|
case H.Cells:
|
|
1995
|
-
return
|
|
1995
|
+
return ci(t, this.ranges[0], this.ranges[1]);
|
|
1996
1996
|
default:
|
|
1997
1997
|
return !1;
|
|
1998
1998
|
}
|
|
@@ -2002,7 +2002,7 @@ class oe {
|
|
|
2002
2002
|
}
|
|
2003
2003
|
}
|
|
2004
2004
|
const Ge = new oe(H.None, []);
|
|
2005
|
-
class
|
|
2005
|
+
class hs {
|
|
2006
2006
|
selection = new oe();
|
|
2007
2007
|
activeCell = null;
|
|
2008
2008
|
isSelecting = !1;
|
|
@@ -2076,7 +2076,7 @@ class ds {
|
|
|
2076
2076
|
return;
|
|
2077
2077
|
}
|
|
2078
2078
|
const R = u.includes(y);
|
|
2079
|
-
p(v, H.Rows), this.options.onRowControlClick?.(v,
|
|
2079
|
+
p(v, H.Rows), this.options.onRowControlClick?.(v, q.Checkbox, !R);
|
|
2080
2080
|
};
|
|
2081
2081
|
switch (r) {
|
|
2082
2082
|
case x.ColumnHeader: {
|
|
@@ -2140,57 +2140,57 @@ class ds {
|
|
|
2140
2140
|
}
|
|
2141
2141
|
}
|
|
2142
2142
|
}
|
|
2143
|
-
const
|
|
2143
|
+
const ms = (e, t, n) => {
|
|
2144
2144
|
if (!Number.isFinite(t) || n <= 0) return null;
|
|
2145
2145
|
const o = Math.min(n - 1, Math.max(0, Math.trunc(t))), i = { startColumn: e.startColumn, endColumn: e.endColumn };
|
|
2146
2146
|
return o > e.endRow ? { source: e, target: { ...i, startRow: e.endRow + 1, endRow: o }, direction: "down" } : o < e.startRow ? { source: e, target: { ...i, startRow: o, endRow: e.startRow - 1 }, direction: "up" } : null;
|
|
2147
|
-
},
|
|
2147
|
+
}, gs = (e) => ({
|
|
2148
2148
|
startColumn: e.source.startColumn,
|
|
2149
2149
|
endColumn: e.source.endColumn,
|
|
2150
2150
|
startRow: Math.min(e.source.startRow, e.target.startRow),
|
|
2151
2151
|
endRow: Math.max(e.source.endRow, e.target.endRow)
|
|
2152
|
-
}),
|
|
2152
|
+
}), fs = (e) => typeof e == "number" && Number.isFinite(e), Tr = (e, t, n = "down") => {
|
|
2153
2153
|
if (t <= 0 || e.length === 0) return [];
|
|
2154
|
-
const o = n === "down" ? e : [...e].reverse(), i = o.length >= 2 && o.every(
|
|
2154
|
+
const o = n === "down" ? e : [...e].reverse(), i = o.length >= 2 && o.every(fs) && o.some((s) => s !== o[0]), a = [];
|
|
2155
2155
|
if (i) {
|
|
2156
2156
|
const s = o.slice(1).map((c, l) => c - o[l]);
|
|
2157
2157
|
let r = o[o.length - 1];
|
|
2158
2158
|
for (let c = 0; c < t; c++)
|
|
2159
|
-
r += s[c % s.length], a.push(
|
|
2159
|
+
r += s[c % s.length], a.push(ps(r, o));
|
|
2160
2160
|
} else
|
|
2161
2161
|
for (let s = 0; s < t; s++) a.push(o[s % o.length]);
|
|
2162
2162
|
return n === "down" ? a : a.reverse();
|
|
2163
|
-
},
|
|
2163
|
+
}, ps = (e, t) => {
|
|
2164
2164
|
const n = Math.max(...t.map((i) => (String(i).split(".")[1] ?? "").length));
|
|
2165
2165
|
if (n > 12) return e;
|
|
2166
2166
|
const o = 10 ** n;
|
|
2167
2167
|
return Math.round(e * o) / o;
|
|
2168
|
-
}, Mt = {
|
|
2169
|
-
drag:
|
|
2170
|
-
expand:
|
|
2171
|
-
checkbox:
|
|
2172
|
-
},
|
|
2168
|
+
}, On = 20, Mt = {
|
|
2169
|
+
drag: q.Drag,
|
|
2170
|
+
expand: q.Expand,
|
|
2171
|
+
checkbox: q.Checkbox
|
|
2172
|
+
}, Cs = {
|
|
2173
2173
|
none: $.None,
|
|
2174
2174
|
cell: $.Cell,
|
|
2175
2175
|
row: $.Row,
|
|
2176
2176
|
column: $.Column,
|
|
2177
2177
|
all: $.All
|
|
2178
|
-
},
|
|
2178
|
+
}, ws = {
|
|
2179
2179
|
none: de.None,
|
|
2180
2180
|
column: de.Column,
|
|
2181
2181
|
row: de.Row,
|
|
2182
2182
|
all: de.All
|
|
2183
|
-
},
|
|
2183
|
+
}, vs = {
|
|
2184
2184
|
[H.None]: "none",
|
|
2185
2185
|
[H.Cells]: "cells",
|
|
2186
2186
|
[H.Rows]: "rows",
|
|
2187
2187
|
[H.Columns]: "columns"
|
|
2188
|
-
},
|
|
2188
|
+
}, Ss = {
|
|
2189
2189
|
none: H.None,
|
|
2190
2190
|
cells: H.Cells,
|
|
2191
2191
|
rows: H.Rows,
|
|
2192
2192
|
columns: H.Columns
|
|
2193
|
-
},
|
|
2193
|
+
}, Vn = { ArrowUp: "up", ArrowDown: "down", ArrowLeft: "left", ArrowRight: "right" }, ys = (e) => Math.max(B.rowHeadWidth, 46 + e.length * 24), bs = 640, xs = 50, Rs = (e, t) => ({
|
|
2194
2194
|
id: e.id,
|
|
2195
2195
|
name: e.name,
|
|
2196
2196
|
width: t,
|
|
@@ -2199,8 +2199,8 @@ const hs = (e, t, n) => {
|
|
|
2199
2199
|
isPrimary: e.isPrimary,
|
|
2200
2200
|
description: e.description,
|
|
2201
2201
|
hasIcon: e.hasIcon
|
|
2202
|
-
}),
|
|
2203
|
-
class
|
|
2202
|
+
}), yo = (e, t) => e === t || !!e && !!t && e[0] === t[0] && e[1] === t[1], ks = (e, t) => e.kind === t.kind && yo(e.activeCell, t.activeCell) && e.ranges.length === t.ranges.length && e.ranges.every((n, o) => n[0] === t.ranges[o][0] && n[1] === t.ranges[o][1]);
|
|
2203
|
+
class Is {
|
|
2204
2204
|
coord;
|
|
2205
2205
|
scroll = { scrollTop: 0, scrollLeft: 0, isScrolling: !1 };
|
|
2206
2206
|
mouseState = Ve;
|
|
@@ -2232,19 +2232,19 @@ class ks {
|
|
|
2232
2232
|
constructor(t, n) {
|
|
2233
2233
|
this.config = t, this.hooks = n, this.coord = this.createCoordinate();
|
|
2234
2234
|
const o = () => this.config;
|
|
2235
|
-
this.selection = new
|
|
2235
|
+
this.selection = new hs({
|
|
2236
2236
|
getPureRowCount: () => this.config.rowCount,
|
|
2237
2237
|
get selectable() {
|
|
2238
|
-
return
|
|
2238
|
+
return Cs[o().selectable];
|
|
2239
2239
|
},
|
|
2240
2240
|
onChange: () => {
|
|
2241
2241
|
const i = this.getSelection();
|
|
2242
|
-
|
|
2242
|
+
ks(i, this.lastSelection) || (this.lastSelection = i, this.hooks.selectionChange(i), this.hooks.render());
|
|
2243
2243
|
},
|
|
2244
2244
|
onRowControlClick: (i, a) => {
|
|
2245
|
-
a ===
|
|
2245
|
+
a === q.Expand && this.hooks.rowExpand(i);
|
|
2246
2246
|
}
|
|
2247
|
-
}), this.resize = new
|
|
2247
|
+
}), this.resize = new as({
|
|
2248
2248
|
coordInstance: () => this.coord,
|
|
2249
2249
|
scrollState: () => this.scroll,
|
|
2250
2250
|
minWidth: (i) => this.config.columns[i]?.minWidth ?? B.columnMinWidth,
|
|
@@ -2254,17 +2254,17 @@ class ks {
|
|
|
2254
2254
|
onChange: (i) => {
|
|
2255
2255
|
this.resizeState = i, this.hooks.render();
|
|
2256
2256
|
}
|
|
2257
|
-
}), this.resizeState = this.resize.state, this.drag = new
|
|
2257
|
+
}), this.resizeState = this.resize.state, this.drag = new gi({
|
|
2258
2258
|
coordInstance: () => this.coord,
|
|
2259
2259
|
scrollState: () => this.scroll,
|
|
2260
2260
|
selection: () => this.selection.selection,
|
|
2261
2261
|
get draggable() {
|
|
2262
|
-
return
|
|
2262
|
+
return ws[o().draggable];
|
|
2263
2263
|
},
|
|
2264
2264
|
onChange: (i) => {
|
|
2265
2265
|
this.dragState = i, this.hooks.render();
|
|
2266
2266
|
}
|
|
2267
|
-
}), this.dragState = this.drag.state, this.autoScroller = new
|
|
2267
|
+
}), this.dragState = this.drag.state, this.autoScroller = new is({
|
|
2268
2268
|
getBounds: () => ({
|
|
2269
2269
|
containerWidth: this.coord.containerWidth,
|
|
2270
2270
|
containerHeight: this.coord.containerHeight,
|
|
@@ -2284,18 +2284,18 @@ class ks {
|
|
|
2284
2284
|
* numbers only and no column is frozen.
|
|
2285
2285
|
*/
|
|
2286
2286
|
get isPhone() {
|
|
2287
|
-
return !!this.config.touch && this.width > 0 && this.width <=
|
|
2287
|
+
return !!this.config.touch && this.width > 0 && this.width <= bs;
|
|
2288
2288
|
}
|
|
2289
2289
|
visibleRowControls() {
|
|
2290
2290
|
return this.isPhone ? [] : this.config.rowControls;
|
|
2291
2291
|
}
|
|
2292
2292
|
gutterWidth() {
|
|
2293
|
-
return this.isPhone ?
|
|
2293
|
+
return this.isPhone ? xs : ys(this.config.rowControls);
|
|
2294
2294
|
}
|
|
2295
2295
|
// ---- configuration ----------------------------------------------------
|
|
2296
2296
|
createCoordinate() {
|
|
2297
2297
|
const { rowCount: t, rowHeight: n, headerHeight: o, columns: i, freezeColumnCount: a } = this.config;
|
|
2298
|
-
return new
|
|
2298
|
+
return new ss({
|
|
2299
2299
|
rowHeight: n,
|
|
2300
2300
|
columnWidth: B.columnWidth,
|
|
2301
2301
|
rowCount: t,
|
|
@@ -2312,7 +2312,7 @@ class ks {
|
|
|
2312
2312
|
const { columns: t } = this.config, n = {};
|
|
2313
2313
|
this.gridColumns = t.map((o, i) => {
|
|
2314
2314
|
const a = this.widthOverrides.get(i) ?? o.width ?? B.columnWidth;
|
|
2315
|
-
return n[i] = a,
|
|
2315
|
+
return n[i] = a, Rs(o, a);
|
|
2316
2316
|
}), this.coord.refreshColumnDimensions({ columnCount: t.length, columnInitSize: this.gutterWidth(), columnWidthMap: n }), this.coord.freezeColumnCount = this.freezeCount(this.config.freezeColumnCount), this.invalidate();
|
|
2317
2317
|
}
|
|
2318
2318
|
/**
|
|
@@ -2321,7 +2321,7 @@ class ks {
|
|
|
2321
2321
|
*/
|
|
2322
2322
|
freezeCount(t) {
|
|
2323
2323
|
const { columns: n } = this.config, o = Math.min(t, n.length);
|
|
2324
|
-
return this.width <= 0 ? o : this.isPhone ? 0 : Math.min(o,
|
|
2324
|
+
return this.width <= 0 ? o : this.isPhone ? 0 : Math.min(o, ls({
|
|
2325
2325
|
containerWidth: this.width,
|
|
2326
2326
|
columnInitSize: this.gutterWidth(),
|
|
2327
2327
|
columnCount: n.length,
|
|
@@ -2348,14 +2348,22 @@ class ks {
|
|
|
2348
2348
|
get viewport() {
|
|
2349
2349
|
return { width: this.width, height: this.height };
|
|
2350
2350
|
}
|
|
2351
|
-
/**
|
|
2351
|
+
/**
|
|
2352
|
+
* Scrollable content size for the scroller's spacer. An axis that scrolls ends
|
|
2353
|
+
* `SCROLL_END_GAP` past its last row or column, so an overlay scrollbar (macOS)
|
|
2354
|
+
* lies over blank space at the end instead of over the last row or column.
|
|
2355
|
+
* Rows that end under the horizontal bar get the gap too. Columns that fit get
|
|
2356
|
+
* none, so a grid sized to its width never scrolls sideways for it; its host
|
|
2357
|
+
* keeps room for a vertical overlay bar beside them.
|
|
2358
|
+
*/
|
|
2352
2359
|
get contentSize() {
|
|
2353
|
-
|
|
2360
|
+
const { totalWidth: t, totalHeight: n } = this.coord, o = t > this.width ? On : 0, i = n > this.height - o ? On : 0;
|
|
2361
|
+
return { width: t + o, height: n + i };
|
|
2354
2362
|
}
|
|
2355
2363
|
/** The scroller moved (native scroll or our own `scrollTo`). */
|
|
2356
2364
|
setScroll(t, n) {
|
|
2357
|
-
const o = Math.max(0,
|
|
2358
|
-
|
|
2365
|
+
const o = this.contentSize, i = Math.max(0, o.width - this.width), a = Math.max(0, o.height - this.height), s = Math.min(Math.max(0, t), i), r = Math.min(Math.max(0, n), a);
|
|
2366
|
+
s === this.scroll.scrollLeft && r === this.scroll.scrollTop || (this.scroll = { scrollLeft: s, scrollTop: r, isScrolling: !1 }, this.updateVisible(), this.hooks.render());
|
|
2359
2367
|
}
|
|
2360
2368
|
scrollTo(t, n) {
|
|
2361
2369
|
const o = this.scroll;
|
|
@@ -2380,10 +2388,10 @@ class ks {
|
|
|
2380
2388
|
// ---- selection --------------------------------------------------------
|
|
2381
2389
|
getSelection() {
|
|
2382
2390
|
const { selection: t, activeCell: n } = this.selection;
|
|
2383
|
-
return { kind:
|
|
2391
|
+
return { kind: vs[t.type], ranges: t.ranges.map((o) => [o[0], o[1]]), activeCell: n ? [n[0], n[1]] : null };
|
|
2384
2392
|
}
|
|
2385
2393
|
setSelection(t) {
|
|
2386
|
-
const n = t.ranges.map((a) => [a[0], a[1]]), o = t.kind === "none" ? Ge : new oe(
|
|
2394
|
+
const n = t.ranges.map((a) => [a[0], a[1]]), o = t.kind === "none" ? Ge : new oe(Ss[t.kind], n), i = t.activeCell !== void 0 ? t.activeCell ? [t.activeCell[0], t.activeCell[1]] : null : t.kind === "cells" && n[0] ? [n[0][0], n[0][1]] : null;
|
|
2387
2395
|
this.selection.update({ selection: o, activeCell: i });
|
|
2388
2396
|
}
|
|
2389
2397
|
selectCell(t, n) {
|
|
@@ -2465,13 +2473,13 @@ class ks {
|
|
|
2465
2473
|
return !t || t[0] >= this.coord.columnCount || t[1] >= this.coord.pureRowCount ? null : { columnIndex: t[0], rowIndex: t[1], width: this.coord.getColumnWidth(t[0]), height: this.coord.getRowHeight(t[1]) };
|
|
2466
2474
|
}
|
|
2467
2475
|
hitTest(t) {
|
|
2468
|
-
return
|
|
2476
|
+
return ki(this.regionContext(), t);
|
|
2469
2477
|
}
|
|
2470
2478
|
// ---- pointer ----------------------------------------------------------
|
|
2471
2479
|
/** Returns true when the press belongs to the grid (the host then claims focus). */
|
|
2472
2480
|
pointerDown(t) {
|
|
2473
2481
|
const n = { x: t.x, y: t.y }, o = this.hitTest(n);
|
|
2474
|
-
return this.mouseState = o, this.down = { state: o, point: n }, this.lastPoint = n, this.lastModifiers = { shiftKey: t.shiftKey, commandKey: t.commandKey }, o.type === x.Blank || o.type === x.None ? (this.hooks.render(), !1) : o.type === x.FillHandler && (this.fillSource =
|
|
2482
|
+
return this.mouseState = o, this.down = { state: o, point: n }, this.lastPoint = n, this.lastModifiers = { shiftKey: t.shiftKey, commandKey: t.commandKey }, o.type === x.Blank || o.type === x.None ? (this.hooks.render(), !1) : o.type === x.FillHandler && (this.fillSource = Xe(this.getSelection(), { rowCount: this.config.rowCount, columnCount: this.config.columns.length }), this.fillSource) ? (this.hooks.render(), !0) : (this.isResizeEnabled && this.resize.start(o) || (this.drag.start(o), this.selection.onSelectionStart({ shiftKey: t.shiftKey, metaKey: t.commandKey }, o), this.hooks.render()), !0);
|
|
2475
2483
|
}
|
|
2476
2484
|
/** Hover and gestures. `fromAutoScroll` re-derives the head after an auto-scroll tick. */
|
|
2477
2485
|
pointerMove(t, n = !1) {
|
|
@@ -2534,12 +2542,12 @@ class ks {
|
|
|
2534
2542
|
endFill(t) {
|
|
2535
2543
|
const n = this.fillSource;
|
|
2536
2544
|
this.fillSource = null;
|
|
2537
|
-
const o =
|
|
2545
|
+
const o = ms(n, this.fillTargetRow(t), this.config.rowCount);
|
|
2538
2546
|
if (!o) {
|
|
2539
2547
|
this.hooks.render();
|
|
2540
2548
|
return;
|
|
2541
2549
|
}
|
|
2542
|
-
const i =
|
|
2550
|
+
const i = gs(o), a = this.selection.activeCell;
|
|
2543
2551
|
this.selection.update({
|
|
2544
2552
|
selection: this.selection.selection.set(H.Cells, [[i.startColumn, i.startRow], [i.endColumn, i.endRow]]),
|
|
2545
2553
|
...a ? {} : { activeCell: [n.startColumn, n.startRow] }
|
|
@@ -2572,7 +2580,7 @@ class ks {
|
|
|
2572
2580
|
/** True when `cell` is the active cell and the whole selection. */
|
|
2573
2581
|
isSoleActiveCell(t) {
|
|
2574
2582
|
const { selection: n, activeCell: o } = this.selection;
|
|
2575
|
-
if (!n.isCellSelection || !
|
|
2583
|
+
if (!n.isCellSelection || !yo(o, t)) return !1;
|
|
2576
2584
|
const [i, a] = n.ranges;
|
|
2577
2585
|
return !!i && !!a && i[0] === a[0] && i[1] === a[1];
|
|
2578
2586
|
}
|
|
@@ -2655,7 +2663,7 @@ class ks {
|
|
|
2655
2663
|
moveAfterEdit(t, n) {
|
|
2656
2664
|
const { rowCount: o, columns: i } = this.config;
|
|
2657
2665
|
if (!o || !i.length) return;
|
|
2658
|
-
const a = { pureRowCount: o, columnCount: i.length }, s = new oe(H.Cells, [[t[0], t[1]], [t[0], t[1]]]), r = n === "down" ?
|
|
2666
|
+
const a = { pureRowCount: o, columnCount: i.length }, s = new oe(H.Cells, [[t[0], t[1]], [t[0], t[1]]]), r = n === "down" ? ds(s, a) : Bn(s, n === "left", a);
|
|
2659
2667
|
this.selection.update({ selection: r.selection, activeCell: r.activeCell }), this.scrollToCell(r.scrollTo);
|
|
2660
2668
|
}
|
|
2661
2669
|
/** An input method started composing on the selected cell. */
|
|
@@ -2670,17 +2678,17 @@ class ks {
|
|
|
2670
2678
|
keyDown(t) {
|
|
2671
2679
|
if (t.key === "Escape" && this.down)
|
|
2672
2680
|
return this.cancelGesture(), "prevent";
|
|
2673
|
-
if (
|
|
2681
|
+
if (go(t))
|
|
2674
2682
|
return this.compositionStart(), "pass";
|
|
2675
2683
|
const { rowCount: n, columns: o } = this.config;
|
|
2676
2684
|
if (!n || !o.length) return "ignore";
|
|
2677
2685
|
const i = { pureRowCount: n, columnCount: o.length }, a = this.selection.selection, s = this.selection.activeCell;
|
|
2678
2686
|
if (!a.isCellSelection || !s)
|
|
2679
|
-
return
|
|
2680
|
-
const r =
|
|
2687
|
+
return Vn[t.key] || t.key === "Tab" || t.key === "Home" ? t.key === "Tab" && !s ? "ignore" : (this.selectCell(s ?? [0, 0], !1), "prevent") : "ignore";
|
|
2688
|
+
const r = Vn[t.key];
|
|
2681
2689
|
if (r) {
|
|
2682
2690
|
if (t.altKey) return "ignore";
|
|
2683
|
-
const c =
|
|
2691
|
+
const c = cs(a, r, { expand: t.shiftKey, jump: t.commandKey }, i);
|
|
2684
2692
|
return this.selection.update({ selection: c.selection, ...c.activeCell ? { activeCell: c.activeCell } : {} }), this.scrollToCell(c.scrollTo), "prevent";
|
|
2685
2693
|
}
|
|
2686
2694
|
switch (t.key) {
|
|
@@ -2701,7 +2709,7 @@ class ks {
|
|
|
2701
2709
|
case "a":
|
|
2702
2710
|
case "A":
|
|
2703
2711
|
if (!t.commandKey || t.shiftKey || t.altKey) break;
|
|
2704
|
-
return this.selection.update({ selection:
|
|
2712
|
+
return this.selection.update({ selection: us(a, i) }), "prevent";
|
|
2705
2713
|
case "Enter":
|
|
2706
2714
|
return t.shiftKey || t.altKey || t.commandKey ? "ignore" : (this.requestEdit(s, "enter", !1), "prevent");
|
|
2707
2715
|
case "F2":
|
|
@@ -2715,7 +2723,7 @@ class ks {
|
|
|
2715
2723
|
case "Escape":
|
|
2716
2724
|
return "ignore";
|
|
2717
2725
|
}
|
|
2718
|
-
return
|
|
2726
|
+
return ga(t) ? this.requestEdit(s, "key", !0) ? "pass" : "prevent" : "ignore";
|
|
2719
2727
|
}
|
|
2720
2728
|
// ---- drawing ----------------------------------------------------------
|
|
2721
2729
|
/** Everything `drawGrid` needs except the theme and the cell/icon painters. */
|
|
@@ -2769,31 +2777,31 @@ class ks {
|
|
|
2769
2777
|
this.autoScroller.stop();
|
|
2770
2778
|
}
|
|
2771
2779
|
}
|
|
2772
|
-
const
|
|
2780
|
+
const Ps = () => {
|
|
2773
2781
|
if (typeof navigator > "u") return !1;
|
|
2774
2782
|
const e = navigator.userAgentData?.platform ?? navigator.platform ?? "";
|
|
2775
2783
|
return /mac|iphone|ipad|ipod/i.test(e);
|
|
2776
|
-
},
|
|
2784
|
+
}, Gn = (e, t) => {
|
|
2777
2785
|
const n = Number.parseFloat(e.getPropertyValue(t));
|
|
2778
2786
|
return Number.isFinite(n) && n > 0 ? n : void 0;
|
|
2779
|
-
},
|
|
2787
|
+
}, zs = (e, t = { rowHeight: B.rowHeight, headerHeight: B.columnHeadHeight }) => {
|
|
2780
2788
|
const n = getComputedStyle(e);
|
|
2781
2789
|
return {
|
|
2782
|
-
rowHeight:
|
|
2783
|
-
headerHeight:
|
|
2790
|
+
rowHeight: Gn(n, "--ui-grid-row-height") ?? t.rowHeight,
|
|
2791
|
+
headerHeight: Gn(n, "--ui-grid-header-height") ?? t.headerHeight
|
|
2784
2792
|
};
|
|
2785
|
-
},
|
|
2793
|
+
}, Ms = (e, t, n) => n > 0 ? Math.max(0, Math.floor((e - t) / n)) : 0, As = ["aria-labelledby", "aria-rowcount", "aria-colcount", "aria-readonly", "aria-busy", "data-ui-grid-skeleton"], Es = ["id"], Hs = { role: "rowgroup" }, Ts = {
|
|
2786
2794
|
role: "row",
|
|
2787
2795
|
"aria-rowindex": "1"
|
|
2788
|
-
},
|
|
2796
|
+
}, Fs = ["id", "aria-colindex"], Ns = { role: "rowgroup" }, Ls = ["aria-rowindex", "aria-hidden"], Ds = ["id"], Ws = ["aria-colindex", "aria-selected", "aria-readonly"], Bs = ["id"], Os = ["data-ui-grid-editing", "aria-labelledby", "aria-invalid", "aria-describedby", "readonly"], Vs = ["id"], Gs = {
|
|
2789
2797
|
key: 1,
|
|
2790
2798
|
role: "status",
|
|
2791
2799
|
class: "sr-only"
|
|
2792
|
-
},
|
|
2800
|
+
}, Us = {
|
|
2793
2801
|
key: 2,
|
|
2794
2802
|
"data-ui-grid-overlay": "",
|
|
2795
2803
|
style: { position: "absolute", inset: "0", "pointer-events": "none", "z-index": "3" }
|
|
2796
|
-
},
|
|
2804
|
+
}, Ks = 6, _s = 250, $s = 100, Xs = 800, qs = 300, Ys = 300, Fr = /* @__PURE__ */ Yo({
|
|
2797
2805
|
__name: "GridHost",
|
|
2798
2806
|
props: {
|
|
2799
2807
|
columns: {},
|
|
@@ -2827,9 +2835,9 @@ const Is = () => {
|
|
|
2827
2835
|
},
|
|
2828
2836
|
emits: ["selection-change", "edit-request", "cell-commit", "edit-end", "clear-request", "row-expand", "header-menu", "column-resize", "column-resize-end", "column-width-save", "fill-request", "clipboard-copy", "paste-request", "column-reorder", "row-reorder", "context-menu", "visible-range-change"],
|
|
2829
2837
|
setup(e, { expose: t, emit: n }) {
|
|
2830
|
-
const o = e, i = n, a =
|
|
2838
|
+
const o = e, i = n, a = oi(), s = jo(), r = xe(), c = xe(), l = xe(), u = xe(), h = xe(), m = ce({ rowHeight: B.rowHeight, headerHeight: B.columnHeadHeight }), g = ce({ ...uo, ...o.themeOverrides }), C = ce({ width: 0, height: 0 }), S = ce({ kind: "none", ranges: [], activeCell: null }), p = ce({ width: 0, height: 0 }), w = xe(!1), v = xe(!1), y = ce(0);
|
|
2831
2839
|
let R = Ue.danger;
|
|
2832
|
-
const I = ce(null), k = _(() => o.rowHeight ?? m.value.rowHeight), P = _(() => o.headerHeight ?? m.value.headerHeight), A = _(() =>
|
|
2840
|
+
const I = ce(null), k = _(() => o.rowHeight ?? m.value.rowHeight), P = _(() => o.headerHeight ?? m.value.headerHeight), A = _(() => Ms(C.value.height, P.value, k.value)), N = _(() => !o.loading && o.rowCount === 0), M = () => {
|
|
2833
2841
|
const d = o.loading && o.rowCount === 0;
|
|
2834
2842
|
return {
|
|
2835
2843
|
columns: o.columns,
|
|
@@ -2847,7 +2855,7 @@ const Is = () => {
|
|
|
2847
2855
|
};
|
|
2848
2856
|
}, E = () => o.loading && o.rowCount === 0;
|
|
2849
2857
|
let F = 0, W, K = null, G = null;
|
|
2850
|
-
const ke = () => o.editing || L.active, z = new
|
|
2858
|
+
const ke = () => o.editing || L.active, z = new Is(M(), {
|
|
2851
2859
|
render: () => ge(),
|
|
2852
2860
|
selectionChange: (d) => {
|
|
2853
2861
|
const f = L.state.value.cell;
|
|
@@ -2873,7 +2881,7 @@ const Is = () => {
|
|
|
2873
2881
|
rowExpand: (d, f) => f === void 0 ? i("row-expand", d) : i("row-expand", d, f),
|
|
2874
2882
|
headerMenu: (d, f) => i("header-menu", d, f),
|
|
2875
2883
|
columnResize: (d, f, b) => {
|
|
2876
|
-
p.value = z.contentSize, b ? (i("column-resize-end", d, f),
|
|
2884
|
+
p.value = z.contentSize, b ? (i("column-resize-end", d, f), Oo(d, f)) : i("column-resize", d, f);
|
|
2877
2885
|
},
|
|
2878
2886
|
fill: (d) => {
|
|
2879
2887
|
De(), i("fill-request", d);
|
|
@@ -2886,7 +2894,7 @@ const Is = () => {
|
|
|
2886
2894
|
visibleRangeChange: (d) => {
|
|
2887
2895
|
E() || i("visible-range-change", d);
|
|
2888
2896
|
}
|
|
2889
|
-
}), L =
|
|
2897
|
+
}), L = Ya({
|
|
2890
2898
|
owner: () => h.value,
|
|
2891
2899
|
root: () => r.value,
|
|
2892
2900
|
enabled: () => !!o.getEditText,
|
|
@@ -2932,7 +2940,7 @@ const Is = () => {
|
|
|
2932
2940
|
drawCell: mt,
|
|
2933
2941
|
drawIcon: o.drawIcon ? Ie : void 0
|
|
2934
2942
|
};
|
|
2935
|
-
|
|
2943
|
+
ia(d, K, f, W), W = f, re(d), l.value && (l.value.style.cursor = z.cursor), Le();
|
|
2936
2944
|
}
|
|
2937
2945
|
function ie() {
|
|
2938
2946
|
F && (cancelAnimationFrame(F), Ye());
|
|
@@ -3007,9 +3015,9 @@ const Is = () => {
|
|
|
3007
3015
|
d.style.transform = `translate(${bt}px, ${xt}px)`, d.style.width = `${b.width}px`, d.style.height = `${b.height}px`;
|
|
3008
3016
|
}
|
|
3009
3017
|
function Pe() {
|
|
3010
|
-
return
|
|
3018
|
+
return da(h.value, r.value ?? null);
|
|
3011
3019
|
}
|
|
3012
|
-
const ve = (d) =>
|
|
3020
|
+
const ve = (d) => Ps() ? d.metaKey : d.ctrlKey;
|
|
3013
3021
|
function ae(d) {
|
|
3014
3022
|
const f = G ?? (G = r.value.getBoundingClientRect());
|
|
3015
3023
|
return { x: d.clientX - f.left, y: d.clientY - f.top, shiftKey: d.shiftKey, commandKey: ve(d) };
|
|
@@ -3018,13 +3026,13 @@ const Is = () => {
|
|
|
3018
3026
|
const f = l.value, b = G;
|
|
3019
3027
|
return d.clientX - b.left >= f.clientWidth || d.clientY - b.top >= f.clientHeight;
|
|
3020
3028
|
}
|
|
3021
|
-
let le = null,
|
|
3022
|
-
const Qe = () => typeof performance > "u" ? Date.now() : performance.now(), Qt = () =>
|
|
3029
|
+
let le = null, X = null, Yt = -1 / 0, jt = -1 / 0, je = !1;
|
|
3030
|
+
const Qe = () => typeof performance > "u" ? Date.now() : performance.now(), Qt = () => X != null || Qe() - Yt < Xs;
|
|
3023
3031
|
function Ze() {
|
|
3024
|
-
|
|
3032
|
+
X && clearTimeout(X.timer), X = null, Yt = Qe();
|
|
3025
3033
|
}
|
|
3026
|
-
function
|
|
3027
|
-
if (
|
|
3034
|
+
function Io(d) {
|
|
3035
|
+
if (X) {
|
|
3028
3036
|
Ze();
|
|
3029
3037
|
return;
|
|
3030
3038
|
}
|
|
@@ -3032,27 +3040,27 @@ const Is = () => {
|
|
|
3032
3040
|
id: d.pointerId,
|
|
3033
3041
|
x: d.clientX,
|
|
3034
3042
|
y: d.clientY,
|
|
3035
|
-
flingStop: Qe() - jt <
|
|
3043
|
+
flingStop: Qe() - jt < $s,
|
|
3036
3044
|
longPressed: !1,
|
|
3037
3045
|
timer: setTimeout(() => {
|
|
3038
|
-
|
|
3039
|
-
},
|
|
3046
|
+
X !== f || f.flingStop || ke() || (f.longPressed = !0, z.longPress(ae(d)), ie());
|
|
3047
|
+
}, _s)
|
|
3040
3048
|
};
|
|
3041
|
-
|
|
3042
|
-
}
|
|
3043
|
-
function Io(d) {
|
|
3044
|
-
const f = q;
|
|
3045
|
-
!f || f.id !== d.pointerId || Math.hypot(d.clientX - f.x, d.clientY - f.y) > Us && Ze();
|
|
3049
|
+
X = f;
|
|
3046
3050
|
}
|
|
3047
3051
|
function Po(d) {
|
|
3048
|
-
const f =
|
|
3052
|
+
const f = X;
|
|
3053
|
+
!f || f.id !== d.pointerId || Math.hypot(d.clientX - f.x, d.clientY - f.y) > Ks && Ze();
|
|
3054
|
+
}
|
|
3055
|
+
function zo(d) {
|
|
3056
|
+
const f = X;
|
|
3049
3057
|
!f || f.id !== d.pointerId || (Ze(), !(f.longPressed || f.flingStop) && (L.active && !L.commit("pointer") || o.editing || (z.tap(ae(d)), ie(), le && clearTimeout(le), le = setTimeout(() => {
|
|
3050
3058
|
le = null, z.clearTapFeedback();
|
|
3051
3059
|
}, qs))));
|
|
3052
3060
|
}
|
|
3053
|
-
function
|
|
3061
|
+
function Mo(d) {
|
|
3054
3062
|
if (G = r.value.getBoundingClientRect(), d.pointerType === "touch") {
|
|
3055
|
-
|
|
3063
|
+
Io(d);
|
|
3056
3064
|
return;
|
|
3057
3065
|
}
|
|
3058
3066
|
if (d.button !== 0 || gt(d)) return;
|
|
@@ -3070,16 +3078,16 @@ const Is = () => {
|
|
|
3070
3078
|
Pe();
|
|
3071
3079
|
}
|
|
3072
3080
|
}
|
|
3073
|
-
function
|
|
3081
|
+
function Ao(d) {
|
|
3074
3082
|
if (d.pointerType === "touch") {
|
|
3075
|
-
|
|
3083
|
+
Po(d);
|
|
3076
3084
|
return;
|
|
3077
3085
|
}
|
|
3078
3086
|
G || (G = r.value.getBoundingClientRect()), z.pointerMove(ae(d)), ie(), l.value && (l.value.style.cursor = z.cursor);
|
|
3079
3087
|
}
|
|
3080
|
-
function
|
|
3088
|
+
function Eo(d) {
|
|
3081
3089
|
if (d.pointerType === "touch") {
|
|
3082
|
-
|
|
3090
|
+
zo(d);
|
|
3083
3091
|
return;
|
|
3084
3092
|
}
|
|
3085
3093
|
if (z.isGestureActive) {
|
|
@@ -3092,36 +3100,36 @@ const Is = () => {
|
|
|
3092
3100
|
}
|
|
3093
3101
|
function Zt(d) {
|
|
3094
3102
|
if (d.pointerType === "touch") {
|
|
3095
|
-
|
|
3103
|
+
X?.id === d.pointerId && Ze();
|
|
3096
3104
|
return;
|
|
3097
3105
|
}
|
|
3098
3106
|
z.cancelGesture(), ie();
|
|
3099
3107
|
}
|
|
3100
|
-
function
|
|
3108
|
+
function Ho() {
|
|
3101
3109
|
z.pointerLeave();
|
|
3102
3110
|
}
|
|
3103
|
-
function
|
|
3111
|
+
function To(d) {
|
|
3104
3112
|
ke() || Qt() || z.doubleClick(ae(d));
|
|
3105
3113
|
}
|
|
3106
|
-
function
|
|
3114
|
+
function Fo(d) {
|
|
3107
3115
|
if (Qt()) {
|
|
3108
3116
|
d.preventDefault();
|
|
3109
3117
|
return;
|
|
3110
3118
|
}
|
|
3111
3119
|
G = r.value.getBoundingClientRect(), z.contextMenu(ae(d)) && (d.preventDefault(), Pe());
|
|
3112
3120
|
}
|
|
3113
|
-
function
|
|
3121
|
+
function No() {
|
|
3114
3122
|
const d = l.value;
|
|
3115
3123
|
d && (G = null, jt = Qe(), z.setScroll(d.scrollLeft, d.scrollTop));
|
|
3116
3124
|
}
|
|
3117
|
-
function
|
|
3125
|
+
function Lo(d) {
|
|
3118
3126
|
if (L.active) {
|
|
3119
3127
|
L.keyDown(d, ve(d)) && d.stopPropagation();
|
|
3120
3128
|
return;
|
|
3121
3129
|
}
|
|
3122
3130
|
if (o.editing) return;
|
|
3123
|
-
if (d.key === "Escape" && De(),
|
|
3124
|
-
|
|
3131
|
+
if (d.key === "Escape" && De(), Do(d)) {
|
|
3132
|
+
Wo();
|
|
3125
3133
|
return;
|
|
3126
3134
|
}
|
|
3127
3135
|
z.keyDown({
|
|
@@ -3140,12 +3148,12 @@ const Is = () => {
|
|
|
3140
3148
|
Je && (Je = null, ge());
|
|
3141
3149
|
}
|
|
3142
3150
|
const ft = () => ({ rowCount: o.loading && o.rowCount === 0 ? 0 : o.rowCount, columnCount: o.columns.length });
|
|
3143
|
-
function
|
|
3151
|
+
function Do(d) {
|
|
3144
3152
|
if (!ve(d) || d.altKey || d.shiftKey) return !1;
|
|
3145
3153
|
const f = d.key.toLowerCase();
|
|
3146
3154
|
return f === "c" || f === "x" || d.code === "KeyC" || d.code === "KeyX";
|
|
3147
3155
|
}
|
|
3148
|
-
function
|
|
3156
|
+
function Wo() {
|
|
3149
3157
|
const d = h.value;
|
|
3150
3158
|
!d || d.value || (d.value = " ", d.select(), fe && clearTimeout(fe), fe = setTimeout(Jt, 0));
|
|
3151
3159
|
}
|
|
@@ -3153,20 +3161,20 @@ const Is = () => {
|
|
|
3153
3161
|
fe && clearTimeout(fe), fe = null, h.value && !L.active && (h.value.value = "");
|
|
3154
3162
|
}
|
|
3155
3163
|
function pt(d, f, b, T) {
|
|
3156
|
-
T && (Je =
|
|
3164
|
+
T && (Je = Xe(d, ft()), ge()), i("clipboard-copy", { block: f, cellCount: za(f), cut: b, ok: T }), T && b && !o.readonly && i("clear-request", d);
|
|
3157
3165
|
}
|
|
3158
3166
|
function en(d, f) {
|
|
3159
|
-
const b = z.getSelection(), T =
|
|
3167
|
+
const b = z.getSelection(), T = po(b, ft());
|
|
3160
3168
|
if (!T) return Promise.resolve(!1);
|
|
3161
|
-
const U =
|
|
3169
|
+
const U = Aa(T, o.isRowLoaded);
|
|
3162
3170
|
if (f && U) {
|
|
3163
|
-
const be =
|
|
3171
|
+
const be = xa(f, It(Hn(T, o.getCopyText ?? o.getCellText)));
|
|
3164
3172
|
return pt(b, T, d, be), Promise.resolve(be);
|
|
3165
3173
|
}
|
|
3166
3174
|
f?.preventDefault();
|
|
3167
3175
|
let Z;
|
|
3168
3176
|
return U ? Z = Promise.resolve(It(Hn(T, o.getCopyText ?? o.getCellText))) : o.resolveCopy ? Z = o.resolveCopy(T).then(It) : Z = Promise.reject(new Error("Rows are not loaded")), Z.catch(() => {
|
|
3169
|
-
}),
|
|
3177
|
+
}), ka(Z).then(
|
|
3170
3178
|
() => (pt(b, T, d, !0), !0),
|
|
3171
3179
|
() => (pt(b, T, d, !1), !1)
|
|
3172
3180
|
);
|
|
@@ -3176,14 +3184,14 @@ const Is = () => {
|
|
|
3176
3184
|
}
|
|
3177
3185
|
function nn(d) {
|
|
3178
3186
|
if (o.readonly) return null;
|
|
3179
|
-
const f =
|
|
3187
|
+
const f = Ma(d, z.getSelection(), {
|
|
3180
3188
|
...ft(),
|
|
3181
3189
|
isReadonlyColumn: (b) => !!o.columns[b]?.readonly
|
|
3182
3190
|
});
|
|
3183
3191
|
return f ? (De(), i("paste-request", f), f) : null;
|
|
3184
3192
|
}
|
|
3185
|
-
function
|
|
3186
|
-
L.active ||
|
|
3193
|
+
function Bo(d) {
|
|
3194
|
+
L.active || fa({ isEditing: o.editing, eventTarget: d.target, hiddenFocusEl: h.value ?? null }) && (d.preventDefault(), S.value.kind !== "none" && nn(d.clipboardData?.getData("text/plain") ?? ""));
|
|
3187
3195
|
}
|
|
3188
3196
|
const Ct = /* @__PURE__ */ new Map();
|
|
3189
3197
|
let ze = null;
|
|
@@ -3193,13 +3201,13 @@ const Is = () => {
|
|
|
3193
3201
|
Ct.clear();
|
|
3194
3202
|
for (const [f, b] of d) i("column-width-save", f, b);
|
|
3195
3203
|
}
|
|
3196
|
-
function
|
|
3197
|
-
Ct.set(d, f), ze && clearTimeout(ze), ze = setTimeout(on,
|
|
3204
|
+
function Oo(d, f) {
|
|
3205
|
+
Ct.set(d, f), ze && clearTimeout(ze), ze = setTimeout(on, Ys);
|
|
3198
3206
|
}
|
|
3199
|
-
function
|
|
3207
|
+
function Vo() {
|
|
3200
3208
|
o.editing || (L.active || z.compositionStart(), L.active && L.compositionStart());
|
|
3201
3209
|
}
|
|
3202
|
-
function
|
|
3210
|
+
function Go() {
|
|
3203
3211
|
L.compositionEnd();
|
|
3204
3212
|
}
|
|
3205
3213
|
let wt = null, vt = null, St = null, We = null;
|
|
@@ -3216,7 +3224,7 @@ const Is = () => {
|
|
|
3216
3224
|
}
|
|
3217
3225
|
function ye() {
|
|
3218
3226
|
const d = r.value;
|
|
3219
|
-
d && (m.value =
|
|
3227
|
+
d && (m.value = zs(d, m.value), g.value = la(d, o.themeOverrides), R = So(d).danger, I.value = Va(d.ownerDocument, g.value.fontSizeSM, g.value.fontFamily), z.theme = g.value, yt(), z.invalidate());
|
|
3220
3228
|
}
|
|
3221
3229
|
function yt() {
|
|
3222
3230
|
z.configure(M()), p.value = z.contentSize;
|
|
@@ -3232,7 +3240,7 @@ const Is = () => {
|
|
|
3232
3240
|
}, { immediate: !0 }), ue(
|
|
3233
3241
|
() => [o.columns, o.rowCount, o.freezeColumnCount, o.rowControls, o.selectable, o.draggable, o.columnResizable, o.readonly, v.value, k.value, P.value, w.value, A.value],
|
|
3234
3242
|
yt
|
|
3235
|
-
), ue(() => [o.getCellText, o.cellRenderer, o.isRowLoaded, o.drawIcon], () => z.invalidate()), ue(() => o.themeOverrides, ye), ue(() => o.editing, () => ge()), ue(() => o.highlightedRow, () => z.invalidate()),
|
|
3243
|
+
), ue(() => [o.getCellText, o.cellRenderer, o.isRowLoaded, o.drawIcon], () => z.invalidate()), ue(() => o.themeOverrides, ye), ue(() => o.editing, () => ge()), ue(() => o.highlightedRow, () => z.invalidate()), Qo(() => {
|
|
3236
3244
|
if (K = document.createElement("canvas"), ye(), sn(), typeof ResizeObserver < "u" && (wt = new ResizeObserver(() => sn()), wt.observe(r.value)), typeof MutationObserver < "u") {
|
|
3237
3245
|
vt = new MutationObserver(() => ye());
|
|
3238
3246
|
const d = r.value.closest("[data-ui-app]");
|
|
@@ -3240,13 +3248,13 @@ const Is = () => {
|
|
|
3240
3248
|
f && vt.observe(f, { attributes: !0, attributeFilter: ["data-ui-color-scheme", "data-ui-density", "style", "class"] });
|
|
3241
3249
|
}
|
|
3242
3250
|
St = typeof matchMedia == "function" ? matchMedia("(prefers-color-scheme: dark)") : null, St?.addEventListener?.("change", ye), We = typeof matchMedia == "function" ? matchMedia("(pointer: coarse)") : null, v.value = !!We?.matches, We?.addEventListener?.("change", an), ge();
|
|
3243
|
-
}),
|
|
3244
|
-
F && cancelAnimationFrame(F), Se && clearTimeout(Se), wt?.disconnect(), vt?.disconnect(), St?.removeEventListener?.("change", ye), We?.removeEventListener?.("change", an),
|
|
3251
|
+
}), Zo(() => {
|
|
3252
|
+
F && cancelAnimationFrame(F), Se && clearTimeout(Se), wt?.disconnect(), vt?.disconnect(), St?.removeEventListener?.("change", ye), We?.removeEventListener?.("change", an), X && clearTimeout(X.timer), le && clearTimeout(le), z.dispose(), fe && clearTimeout(fe), on(), K = null;
|
|
3245
3253
|
});
|
|
3246
|
-
const Y = _(() => S.value.activeCell),
|
|
3254
|
+
const Y = _(() => S.value.activeCell), Uo = _(() => Y.value ? o.columns[Y.value[0]] : void 0), Ko = _(() => {
|
|
3247
3255
|
const d = Y.value;
|
|
3248
3256
|
return d ? o.getRowLabel?.(d[1]) ?? String(d[1] + 1) : "";
|
|
3249
|
-
}),
|
|
3257
|
+
}), _o = _(() => Y.value && o.rowCount > 0 ? o.getCellText(Y.value) : ""), rn = (d) => `${s}-col-${d}`, $o = _(() => Y.value ? `${rn(Y.value[0])} ${s}-rowheader ${s}-cell` : `${s}-label`), ln = (d) => z.getCellRect(d), j = _(() => L.state.value), cn = _(() => j.value.active && j.value.mode === "edit" && j.value.kind === "long-text" && !!o.editHint), et = _(() => ({
|
|
3250
3258
|
open: j.value.active,
|
|
3251
3259
|
kind: j.value.kind,
|
|
3252
3260
|
view: j.value.mode === "view",
|
|
@@ -3257,7 +3265,7 @@ const Is = () => {
|
|
|
3257
3265
|
theme: g.value,
|
|
3258
3266
|
dangerColor: R,
|
|
3259
3267
|
textBox: I.value
|
|
3260
|
-
})),
|
|
3268
|
+
})), Xo = _(() => Ka(et.value)), un = _(() => j.value.active ? vo(et.value) : k.value), tt = _(() => {
|
|
3261
3269
|
if (y.value, j.value.active) return j.value.error;
|
|
3262
3270
|
const d = S.value.activeCell, f = d && o.cellStatus ? o.cellStatus(d) : null;
|
|
3263
3271
|
return f?.state === "error" ? f.message : null;
|
|
@@ -3291,12 +3299,12 @@ const Is = () => {
|
|
|
3291
3299
|
"data-ui-grid-skeleton": w.value && e.loading && e.rowCount === 0 ? "" : void 0,
|
|
3292
3300
|
"aria-multiselectable": "true",
|
|
3293
3301
|
style: { position: "relative", overflow: "hidden", width: "100%", height: "100%", "min-height": "0", background: "var(--ui-surface)", contain: "strict", isolation: "isolate" },
|
|
3294
|
-
onPaste:
|
|
3302
|
+
onPaste: Bo
|
|
3295
3303
|
}, [
|
|
3296
3304
|
ee("span", {
|
|
3297
3305
|
id: `${J(s)}-label`,
|
|
3298
3306
|
class: "sr-only"
|
|
3299
|
-
}, we(e.label), 9,
|
|
3307
|
+
}, we(e.label), 9, Es),
|
|
3300
3308
|
ee("canvas", {
|
|
3301
3309
|
ref_key: "canvas",
|
|
3302
3310
|
ref: c,
|
|
@@ -3309,32 +3317,32 @@ const Is = () => {
|
|
|
3309
3317
|
"data-ui-grid-scroller": "",
|
|
3310
3318
|
"aria-hidden": "true",
|
|
3311
3319
|
style: { position: "absolute", inset: "0", overflow: "auto", "overscroll-behavior": "contain", "z-index": "1", "touch-action": "pan-x pan-y", "-webkit-overflow-scrolling": "touch", "-webkit-touch-callout": "none", "-webkit-user-select": "none", "user-select": "none", "-webkit-tap-highlight-color": "transparent" },
|
|
3312
|
-
onScrollPassive:
|
|
3313
|
-
onPointerdown:
|
|
3314
|
-
onPointermove:
|
|
3315
|
-
onPointerup:
|
|
3320
|
+
onScrollPassive: No,
|
|
3321
|
+
onPointerdown: Mo,
|
|
3322
|
+
onPointermove: Ao,
|
|
3323
|
+
onPointerup: Eo,
|
|
3316
3324
|
onPointercancel: Zt,
|
|
3317
3325
|
onLostpointercapture: Zt,
|
|
3318
|
-
onPointerleave:
|
|
3319
|
-
onDblclick:
|
|
3320
|
-
onContextmenu:
|
|
3326
|
+
onPointerleave: Ho,
|
|
3327
|
+
onDblclick: To,
|
|
3328
|
+
onContextmenu: Fo
|
|
3321
3329
|
}, [
|
|
3322
3330
|
ee("div", {
|
|
3323
3331
|
style: Be({ width: `${p.value.width}px`, height: `${p.value.height}px` })
|
|
3324
3332
|
}, null, 4)
|
|
3325
3333
|
], 544),
|
|
3326
|
-
ee("div",
|
|
3327
|
-
ee("div",
|
|
3328
|
-
(pe(!0), Ce(
|
|
3334
|
+
ee("div", Hs, [
|
|
3335
|
+
ee("div", Ts, [
|
|
3336
|
+
(pe(!0), Ce(Jo, null, ei(e.columns, (b, T) => (pe(), Ce("span", {
|
|
3329
3337
|
id: rn(T),
|
|
3330
3338
|
key: b.id,
|
|
3331
3339
|
role: "columnheader",
|
|
3332
3340
|
class: "sr-only",
|
|
3333
3341
|
"aria-colindex": T + 1
|
|
3334
|
-
}, we(b.name), 9,
|
|
3342
|
+
}, we(b.name), 9, Fs))), 128))
|
|
3335
3343
|
])
|
|
3336
3344
|
]),
|
|
3337
|
-
ee("div",
|
|
3345
|
+
ee("div", Ns, [
|
|
3338
3346
|
ee("div", {
|
|
3339
3347
|
role: "row",
|
|
3340
3348
|
"aria-rowindex": Y.value ? Y.value[1] + 2 : 2,
|
|
@@ -3344,27 +3352,27 @@ const Is = () => {
|
|
|
3344
3352
|
id: `${J(s)}-rowheader`,
|
|
3345
3353
|
role: "rowheader",
|
|
3346
3354
|
class: "sr-only"
|
|
3347
|
-
}, we(
|
|
3355
|
+
}, we(Ko.value), 9, Ds),
|
|
3348
3356
|
ee("div", {
|
|
3349
3357
|
ref_key: "focusCell",
|
|
3350
3358
|
ref: u,
|
|
3351
3359
|
role: "gridcell",
|
|
3352
3360
|
"aria-colindex": Y.value ? Y.value[0] + 1 : 1,
|
|
3353
3361
|
"aria-selected": Y.value ? "true" : void 0,
|
|
3354
|
-
"aria-readonly": e.readonly ||
|
|
3362
|
+
"aria-readonly": e.readonly || Uo.value?.readonly ? "true" : void 0,
|
|
3355
3363
|
"data-ui-grid-focus-cell": "",
|
|
3356
3364
|
style: { position: "absolute", top: "0", left: "0", width: "0", height: "0", transform: "translate(-10000px, 0)", "z-index": "2", "pointer-events": "none" }
|
|
3357
3365
|
}, [
|
|
3358
3366
|
ee("span", {
|
|
3359
3367
|
id: `${J(s)}-cell`,
|
|
3360
3368
|
class: "sr-only"
|
|
3361
|
-
}, we(
|
|
3369
|
+
}, we(_o.value), 9, Bs),
|
|
3362
3370
|
ee("textarea", {
|
|
3363
3371
|
ref_key: "focusOwner",
|
|
3364
3372
|
ref: h,
|
|
3365
3373
|
"data-ui-grid-focus-owner": "",
|
|
3366
3374
|
"data-ui-grid-editing": j.value.active ? j.value.mode : void 0,
|
|
3367
|
-
"aria-labelledby":
|
|
3375
|
+
"aria-labelledby": $o.value,
|
|
3368
3376
|
"aria-invalid": tt.value ? "true" : void 0,
|
|
3369
3377
|
"aria-describedby": tt.value ? `${J(s)}-message` : void 0,
|
|
3370
3378
|
readonly: j.value.active && j.value.mode === "view" ? !0 : void 0,
|
|
@@ -3372,29 +3380,29 @@ const Is = () => {
|
|
|
3372
3380
|
autocapitalize: "off",
|
|
3373
3381
|
spellcheck: "false",
|
|
3374
3382
|
rows: "1",
|
|
3375
|
-
style: Be(
|
|
3376
|
-
onKeydown:
|
|
3377
|
-
onCompositionstart:
|
|
3378
|
-
onCompositionend:
|
|
3383
|
+
style: Be(Xo.value),
|
|
3384
|
+
onKeydown: Lo,
|
|
3385
|
+
onCompositionstart: Vo,
|
|
3386
|
+
onCompositionend: Go,
|
|
3379
3387
|
onInput: f[0] || (f[0] = (b) => J(L).input()),
|
|
3380
3388
|
onBlur: f[1] || (f[1] = (b) => J(L).blur()),
|
|
3381
3389
|
onCopy: f[2] || (f[2] = (b) => tn(b, !1)),
|
|
3382
3390
|
onCut: f[3] || (f[3] = (b) => tn(b, !0))
|
|
3383
|
-
}, null, 44,
|
|
3391
|
+
}, null, 44, Os),
|
|
3384
3392
|
cn.value ? (pe(), Ce("span", {
|
|
3385
3393
|
key: 0,
|
|
3386
3394
|
"data-ui-grid-edit-hint": "",
|
|
3387
3395
|
"aria-hidden": "true",
|
|
3388
|
-
style: Be({ ...J(
|
|
3396
|
+
style: Be({ ...J(_a)(et.value), top: `${un.value - J(lt)}px` })
|
|
3389
3397
|
}, we(e.editHint), 5)) : Oe("", !0),
|
|
3390
3398
|
tt.value ? (pe(), Ce("div", {
|
|
3391
3399
|
key: 1,
|
|
3392
3400
|
id: `${J(s)}-message`,
|
|
3393
3401
|
"data-ui-grid-edit-message": "",
|
|
3394
|
-
style: Be({ ...J(
|
|
3395
|
-
}, we(tt.value), 13,
|
|
3396
|
-
], 8,
|
|
3397
|
-
], 8,
|
|
3402
|
+
style: Be({ ...J($a)(et.value), top: `${un.value + 4}px` })
|
|
3403
|
+
}, we(tt.value), 13, Vs)) : Oe("", !0)
|
|
3404
|
+
], 8, Ws)
|
|
3405
|
+
], 8, Ls)
|
|
3398
3406
|
]),
|
|
3399
3407
|
N.value ? (pe(), Ce("div", {
|
|
3400
3408
|
key: 0,
|
|
@@ -3402,19 +3410,19 @@ const Is = () => {
|
|
|
3402
3410
|
style: Be([{ top: `${P.value}px` }, { position: "absolute", left: "0", right: "0", bottom: "0", display: "flex", "align-items": "center", "justify-content": "center", color: "var(--ui-text-muted)", "font-size": "var(--ui-font-size)", "pointer-events": "none", "z-index": "1" }])
|
|
3403
3411
|
}, [
|
|
3404
3412
|
hn(d.$slots, "empty", {}, () => [
|
|
3405
|
-
|
|
3413
|
+
ti(we(J(a)("No data")), 1)
|
|
3406
3414
|
])
|
|
3407
3415
|
], 4)) : Oe("", !0),
|
|
3408
|
-
e.loading ? (pe(), Ce("span",
|
|
3409
|
-
d.$slots.overlay ? (pe(), Ce("div",
|
|
3416
|
+
e.loading ? (pe(), Ce("span", Gs, we(J(a)("Loading")), 1)) : Oe("", !0),
|
|
3417
|
+
d.$slots.overlay ? (pe(), Ce("div", Us, [
|
|
3410
3418
|
hn(d.$slots, "overlay", {
|
|
3411
3419
|
activeCell: Y.value,
|
|
3412
3420
|
getCellRect: ln
|
|
3413
3421
|
})
|
|
3414
3422
|
])) : Oe("", !0)
|
|
3415
|
-
], 40,
|
|
3423
|
+
], 40, As));
|
|
3416
3424
|
}
|
|
3417
|
-
}),
|
|
3425
|
+
}), js = (e, t = 500) => {
|
|
3418
3426
|
const n = new ct(t);
|
|
3419
3427
|
let o = !1;
|
|
3420
3428
|
const i = () => {
|
|
@@ -3437,13 +3445,13 @@ const Is = () => {
|
|
|
3437
3445
|
},
|
|
3438
3446
|
clear: () => n.clear()
|
|
3439
3447
|
};
|
|
3440
|
-
},
|
|
3441
|
-
function
|
|
3448
|
+
}, Un = ["en", "zh-TW", "zh-CN", "ja", "ko", "de", "fr", "es", "it"], Qs = /* @__PURE__ */ Symbol("syno-pkg-land-ui:locale"), Kn = { enu: "en", cht: "zh-TW", chs: "zh-CN", jpn: "ja", krn: "ko", ger: "de", fre: "fr", spn: "es", ita: "it" };
|
|
3449
|
+
function _n(e) {
|
|
3442
3450
|
if (!e) return;
|
|
3443
3451
|
const n = e.trim().replaceAll("_", "-").toLowerCase();
|
|
3444
|
-
return
|
|
3452
|
+
return Kn[n] ? Kn[n] : n.startsWith("zh") ? /-(hant|tw|hk|mo)\b/.test(n) ? "zh-TW" : "zh-CN" : Un.find((i) => i.toLowerCase() === n) ?? Un.find((i) => i === n.split("-")[0]);
|
|
3445
3453
|
}
|
|
3446
|
-
function
|
|
3454
|
+
function Zs() {
|
|
3447
3455
|
if (typeof window > "u") return "en";
|
|
3448
3456
|
const e = window;
|
|
3449
3457
|
let t;
|
|
@@ -3452,27 +3460,27 @@ function Qs() {
|
|
|
3452
3460
|
} catch {
|
|
3453
3461
|
t = void 0;
|
|
3454
3462
|
}
|
|
3455
|
-
const n = typeof t == "string" ?
|
|
3463
|
+
const n = typeof t == "string" ? _n(t) : void 0;
|
|
3456
3464
|
if (n) return n;
|
|
3457
3465
|
const o = typeof navigator > "u" ? [] : navigator.languages?.length ? navigator.languages : [navigator.language];
|
|
3458
3466
|
for (const i of o) {
|
|
3459
|
-
const a =
|
|
3467
|
+
const a = _n(i);
|
|
3460
3468
|
if (a) return a;
|
|
3461
3469
|
}
|
|
3462
3470
|
return "en";
|
|
3463
3471
|
}
|
|
3464
|
-
function
|
|
3465
|
-
const t =
|
|
3472
|
+
function Js(e) {
|
|
3473
|
+
const t = ni(Qs, null);
|
|
3466
3474
|
let n;
|
|
3467
|
-
return _(() => e() ?? t?.value ?? (n ??=
|
|
3475
|
+
return _(() => e() ?? t?.value ?? (n ??= Zs()));
|
|
3468
3476
|
}
|
|
3469
|
-
function
|
|
3477
|
+
function bo(e, t) {
|
|
3470
3478
|
return e.replace(/\{(\w+)\}/g, (n, o) => String(t[o] ?? n));
|
|
3471
3479
|
}
|
|
3472
|
-
const _e = 4, Re = 6,
|
|
3480
|
+
const _e = 4, Re = 6, er = 4, Ae = 4, he = (e, t, n, o = "") => {
|
|
3473
3481
|
const i = `${o ? `${o} ` : ""}${t}px ${n}`;
|
|
3474
3482
|
e.font !== i && (e.font = i);
|
|
3475
|
-
}, Ee = (e, t, n) => $e(e, { text: t, fontSize: n, needRender: !1 }).width,
|
|
3483
|
+
}, Ee = (e, t, n) => $e(e, { text: t, fontSize: n, needRender: !1 }).width, tr = (e) => {
|
|
3476
3484
|
const t = e.trim();
|
|
3477
3485
|
if (!t) return "";
|
|
3478
3486
|
if (typeof Intl < "u" && typeof Intl.Segmenter == "function")
|
|
@@ -3492,9 +3500,9 @@ const _e = 4, Re = 6, Js = 4, Ae = 4, he = (e, t, n, o = "") => {
|
|
|
3492
3500
|
fontSize: s,
|
|
3493
3501
|
textAlign: o.align ?? "left"
|
|
3494
3502
|
}).width;
|
|
3495
|
-
},
|
|
3503
|
+
}, xo = (e, t, n, o, i) => {
|
|
3496
3504
|
const { metrics: a, theme: s } = t;
|
|
3497
|
-
D(e, { ...n, radius:
|
|
3505
|
+
D(e, { ...n, radius: er, fill: i.fill }), he(e, a.chipFontSize, s.fontFamily), $e(e, {
|
|
3498
3506
|
text: o,
|
|
3499
3507
|
x: n.x + Re,
|
|
3500
3508
|
y: n.y + (n.height - a.chipFontSize) / 2,
|
|
@@ -3521,8 +3529,8 @@ const _e = 4, Re = 6, Js = 4, Ae = 4, he = (e, t, n, o = "") => {
|
|
|
3521
3529
|
return { widths: i, more: 0, badgeWidth: 0 };
|
|
3522
3530
|
}, _t = (e, t, n) => (he(e, t.metrics.chipFontSize, t.theme.fontFamily), Ee(e, `+${n}`, t.metrics.chipFontSize) + 2 * Re), $t = (e, t, n, o, i) => {
|
|
3523
3531
|
const { metrics: a, cellTheme: s } = t, r = t.y + (t.height - a.chip) / 2;
|
|
3524
|
-
|
|
3525
|
-
},
|
|
3532
|
+
xo(e, t, { x: n, y: r, width: i, height: a.chip }, `+${o}`, { fill: s.badgeFill, color: s.badgeText });
|
|
3533
|
+
}, nr = (e, t, n, o, i) => {
|
|
3526
3534
|
const a = t + o / 2, s = n + o / 2 + o * 0.04, r = o / 2, c = r * 0.45;
|
|
3527
3535
|
e.beginPath();
|
|
3528
3536
|
for (let l = 0; l < 10; l++) {
|
|
@@ -3530,11 +3538,11 @@ const _e = 4, Re = 6, Js = 4, Ae = 4, he = (e, t, n, o = "") => {
|
|
|
3530
3538
|
l === 0 ? e.moveTo(m, g) : e.lineTo(m, g);
|
|
3531
3539
|
}
|
|
3532
3540
|
e.closePath(), e.fillStyle = i, e.fill();
|
|
3533
|
-
},
|
|
3541
|
+
}, or = (e, t, n, o, i) => {
|
|
3534
3542
|
const a = o;
|
|
3535
3543
|
e.save(), e.strokeStyle = i, e.lineWidth = Math.max(1.25, a / 11), e.lineCap = "round", e.lineJoin = "round", e.beginPath(), e.moveTo(t + a * 0.45, n + a * 0.2), e.lineTo(t + a * 0.2, n + a * 0.2), e.lineTo(t + a * 0.2, n + a * 0.8), e.lineTo(t + a * 0.8, n + a * 0.8), e.lineTo(t + a * 0.8, n + a * 0.55), e.moveTo(t + a * 0.55, n + a * 0.2), e.lineTo(t + a * 0.8, n + a * 0.2), e.lineTo(t + a * 0.8, n + a * 0.45), e.moveTo(t + a * 0.8, n + a * 0.2), e.lineTo(t + a * 0.48, n + a * 0.52), e.stroke(), e.restore();
|
|
3536
3544
|
};
|
|
3537
|
-
class
|
|
3545
|
+
class Xt {
|
|
3538
3546
|
cache = new ct(200);
|
|
3539
3547
|
set(t, n) {
|
|
3540
3548
|
this.cache.set(t, n);
|
|
@@ -3546,70 +3554,70 @@ class qt {
|
|
|
3546
3554
|
this.cache.clear();
|
|
3547
3555
|
}
|
|
3548
3556
|
}
|
|
3549
|
-
const
|
|
3557
|
+
const qe = (e, t) => e.x >= t.x && e.x < t.x + t.width && e.y >= t.y && e.y < t.y + t.height, ir = { type: "decimal", precision: 2 }, $n = (e, t) => {
|
|
3550
3558
|
if (!Number.isFinite(e) || Math.abs(e) <= Number.MAX_SAFE_INTEGER) return e.toFixed(t);
|
|
3551
3559
|
const n = String(e), o = n.includes("e") ? "" : "0".repeat(t);
|
|
3552
3560
|
return o ? `${n}.${o}` : n;
|
|
3553
|
-
},
|
|
3561
|
+
}, ar = (e, t = ir, n = "en-US") => {
|
|
3554
3562
|
if (e == null) return "";
|
|
3555
3563
|
const o = Number(e), i = t.precision ?? 2;
|
|
3556
3564
|
if (t.type === "currency") {
|
|
3557
3565
|
const a = t.symbol ?? "$", s = o < 0 ? "-" : "", r = Math.abs(o).toLocaleString(n, { minimumFractionDigits: i, maximumFractionDigits: i });
|
|
3558
3566
|
return s + a + r;
|
|
3559
3567
|
}
|
|
3560
|
-
return t.type === "percent" ? `${
|
|
3561
|
-
},
|
|
3568
|
+
return t.type === "percent" ? `${$n(o * 100, i)}%` : $n(o, i);
|
|
3569
|
+
}, Nr = (e, t) => {
|
|
3562
3570
|
if (e == null || e === "") return null;
|
|
3563
3571
|
const n = String(e), o = t?.type === "percent" || n.includes("%"), i = n.replace(/[^\d.+-]/g, "").replace(/([+\-.])+/g, "$1"), a = Number.parseFloat(i);
|
|
3564
3572
|
return Number.isNaN(a) ? null : o ? a / 100 : a;
|
|
3565
|
-
}, dt = (e) => e.map(String).filter(Boolean).join(", "),
|
|
3573
|
+
}, dt = (e) => e.map(String).filter(Boolean).join(", "), sr = (e, t) => {
|
|
3566
3574
|
const n = t.chips[e.tone ?? "neutral"] ?? t.chips.neutral;
|
|
3567
3575
|
return { fill: e.fill ?? n.fill, color: e.color ?? n.color };
|
|
3568
|
-
}, ht = (e) => Math.max(0, e.width - 2 * e.metrics.padding),
|
|
3576
|
+
}, ht = (e) => Math.max(0, e.width - 2 * e.metrics.padding), rr = {
|
|
3569
3577
|
draw: (e, t, n) => {
|
|
3570
3578
|
me(e, t, n.text);
|
|
3571
3579
|
},
|
|
3572
3580
|
describe: (e) => e.text
|
|
3573
|
-
},
|
|
3581
|
+
}, lr = {
|
|
3574
3582
|
draw: (e, t, n) => {
|
|
3575
3583
|
me(e, t, n.text.replace(/\s*\n\s*/g, " "));
|
|
3576
3584
|
},
|
|
3577
3585
|
describe: (e) => e.text
|
|
3578
|
-
},
|
|
3586
|
+
}, cr = {
|
|
3579
3587
|
draw: (e, t, n) => {
|
|
3580
3588
|
me(e, t, n.text);
|
|
3581
3589
|
},
|
|
3582
3590
|
describe: (e) => e.text
|
|
3583
|
-
},
|
|
3591
|
+
}, ur = {
|
|
3584
3592
|
draw: (e, t, n) => {
|
|
3585
3593
|
me(e, t, n.text, { color: t.cellTheme.textMuted, align: n.align === "end" ? "right" : "left" });
|
|
3586
3594
|
},
|
|
3587
3595
|
describe: (e) => e.text
|
|
3588
|
-
},
|
|
3596
|
+
}, Xn = (e, t) => e.text ?? ar(e.value, e.format, t), dr = {
|
|
3589
3597
|
draw: (e, t, n) => {
|
|
3590
|
-
me(e, t,
|
|
3598
|
+
me(e, t, Xn(n, t.locale), { align: "right" });
|
|
3591
3599
|
},
|
|
3592
|
-
describe: (e, t) =>
|
|
3600
|
+
describe: (e, t) => Xn(e, t.locale)
|
|
3593
3601
|
}, qn = (e, t, n) => {
|
|
3594
3602
|
const o = n.icon;
|
|
3595
3603
|
return { x: e - n.padding - o, y: (t - o) / 2, width: o, height: o };
|
|
3596
|
-
},
|
|
3604
|
+
}, hr = {
|
|
3597
3605
|
draw: (e, t, n) => {
|
|
3598
3606
|
const { metrics: o, cellTheme: i } = t, a = qn(t.width, t.height, o);
|
|
3599
|
-
n.text && (me(e, t, n.text, { color: i.link, maxWidth: Math.max(0, a.x - Ae - o.padding) }),
|
|
3607
|
+
n.text && (me(e, t, n.text, { color: i.link, maxWidth: Math.max(0, a.x - Ae - o.padding) }), or(e, t.x + a.x, t.y + a.y, a.width, i.link));
|
|
3600
3608
|
},
|
|
3601
3609
|
describe: (e) => e.text,
|
|
3602
3610
|
hitTest: (e, { point: t, size: n, metrics: o }) => {
|
|
3603
3611
|
if (!e.text || !e.href) return null;
|
|
3604
3612
|
const i = qn(n.width, n.height, o), a = { x: i.x - 4, y: Math.max(0, i.y - 4), width: i.width + 8, height: Math.min(n.height, i.height + 8) };
|
|
3605
|
-
return
|
|
3613
|
+
return qe(t, a) ? { action: { type: "open-url", href: e.href }, area: a } : null;
|
|
3606
3614
|
}
|
|
3607
|
-
},
|
|
3615
|
+
}, Yn = (e, t, n) => {
|
|
3608
3616
|
const o = n.icon;
|
|
3609
3617
|
return { x: e / 2 - o / 2, y: t / 2 - o / 2, width: o, height: o };
|
|
3610
|
-
},
|
|
3618
|
+
}, jn = (e) => ({ type: "update", value: !e.value }), mr = {
|
|
3611
3619
|
draw: (e, t, n) => {
|
|
3612
|
-
const { cellTheme: o, metrics: i } = t, a =
|
|
3620
|
+
const { cellTheme: o, metrics: i } = t, a = Yn(t.width, t.height, i);
|
|
3613
3621
|
Bt(e, {
|
|
3614
3622
|
x: t.x + a.x,
|
|
3615
3623
|
y: t.y + a.y,
|
|
@@ -3624,23 +3632,23 @@ const Xe = (e, t) => e.x >= t.x && e.x < t.x + t.width && e.y >= t.y && e.y < t.
|
|
|
3624
3632
|
// The icon box is hit exactly, plus 4 px around it (a 24 px target at 16 px).
|
|
3625
3633
|
hitTest: (e, { point: t, size: n, metrics: o }) => {
|
|
3626
3634
|
if (e.readonly) return null;
|
|
3627
|
-
const i =
|
|
3628
|
-
return
|
|
3635
|
+
const i = Yn(n.width, n.height, o), a = { x: i.x - 4, y: Math.max(0, i.y - 4), width: i.width + 8, height: Math.min(n.height, i.height + 8) };
|
|
3636
|
+
return qe(t, a) ? { action: jn(e), area: a } : null;
|
|
3629
3637
|
},
|
|
3630
|
-
keyAction: (e, t) => !e.readonly && (t === "Enter" || t === " ") ?
|
|
3631
|
-
}, At = 2, st = (e) => Math.max(1, Math.min(10, Math.round(e.max ?? 5))),
|
|
3638
|
+
keyAction: (e, t) => !e.readonly && (t === "Enter" || t === " ") ? jn(e) : null
|
|
3639
|
+
}, At = 2, st = (e) => Math.max(1, Math.min(10, Math.round(e.max ?? 5))), gr = {
|
|
3632
3640
|
draw: (e, t, n) => {
|
|
3633
3641
|
const { metrics: o, cellTheme: i } = t, a = o.icon, s = t.y + (t.height - a) / 2, r = st(n);
|
|
3634
3642
|
let c = t.x + o.padding;
|
|
3635
3643
|
for (let l = 0; l < r && c + a <= t.x + t.width - o.padding + At; l++)
|
|
3636
|
-
|
|
3644
|
+
nr(e, c, s, a, n.value > l ? i.ratingOn : i.ratingOff), c += a + At;
|
|
3637
3645
|
},
|
|
3638
|
-
describe: (e, { labels: t }) => e.value > 0 ?
|
|
3646
|
+
describe: (e, { labels: t }) => e.value > 0 ? bo(t.rating, { value: e.value, max: st(e) }) : "",
|
|
3639
3647
|
// Click the n-th star: value n; click the current value again: clear.
|
|
3640
3648
|
hitTest: (e, { point: t, size: n, metrics: o }) => {
|
|
3641
3649
|
if (e.readonly) return null;
|
|
3642
3650
|
const i = o.icon + At, a = st(e), s = { x: o.padding, y: Math.max(0, n.height / 2 - o.icon), width: a * i, height: Math.min(n.height, 2 * o.icon) };
|
|
3643
|
-
if (!
|
|
3651
|
+
if (!qe(t, s)) return null;
|
|
3644
3652
|
const r = Math.min(a, Math.max(1, Math.ceil((t.x - o.padding) / i)));
|
|
3645
3653
|
return { action: { type: "update", value: r !== e.value ? r : null }, area: s };
|
|
3646
3654
|
},
|
|
@@ -3652,7 +3660,7 @@ const Xe = (e, t) => e.x >= t.x && e.x < t.x + t.width && e.y >= t.y && e.y < t.
|
|
|
3652
3660
|
const n = Math.min(st(e), Number(t));
|
|
3653
3661
|
return { type: "update", value: n === 0 || n === e.value ? null : n };
|
|
3654
3662
|
}
|
|
3655
|
-
}, He = (e, t, n) => `${e}|${t.width}|${t.metrics.rowHeight}|${n.join("\0")}`, Nt = new
|
|
3663
|
+
}, He = (e, t, n) => `${e}|${t.width}|${t.metrics.rowHeight}|${n.join("\0")}`, Nt = new Xt(), Ro = (e, t, n) => {
|
|
3656
3664
|
const { metrics: o, theme: i } = t;
|
|
3657
3665
|
if (!n.length) return [];
|
|
3658
3666
|
he(e, o.chipFontSize, i.fontFamily);
|
|
@@ -3661,38 +3669,38 @@ const Xe = (e, t) => e.x >= t.x && e.x < t.x + t.width && e.y >= t.y && e.y < t.
|
|
|
3661
3669
|
const u = [];
|
|
3662
3670
|
return r.widths.forEach((h, m) => {
|
|
3663
3671
|
const g = { x: l, y: c, width: h, height: o.chip };
|
|
3664
|
-
|
|
3672
|
+
xo(e, t, g, n[m].label, n[m].colors), u.push({ x: l - t.x, y: c - t.y, width: h, height: o.chip }), l += h + _e;
|
|
3665
3673
|
}), r.more > 0 && $t(e, t, l, r.more, r.badgeWidth), u;
|
|
3666
|
-
},
|
|
3674
|
+
}, fr = {
|
|
3667
3675
|
draw: (e, t, n) => {
|
|
3668
|
-
|
|
3676
|
+
Ro(e, t, n.options.map((o) => ({ label: o.label, colors: sr(o, t.cellTheme) })));
|
|
3669
3677
|
},
|
|
3670
3678
|
describe: (e) => dt(e.options.map((t) => t.label))
|
|
3671
|
-
},
|
|
3679
|
+
}, pr = {
|
|
3672
3680
|
draw: (e, t, n) => {
|
|
3673
|
-
const o = { fill: t.cellTheme.badgeFill, color: t.cellTheme.text }, i =
|
|
3681
|
+
const o = { fill: t.cellTheme.badgeFill, color: t.cellTheme.text }, i = Ro(e, t, n.records.map((a) => ({ label: a.label, colors: o })));
|
|
3674
3682
|
Nt.set(He("link", t, n.records.map((a) => a.id)), i);
|
|
3675
3683
|
},
|
|
3676
3684
|
describe: (e) => dt(e.records.map((t) => t.label)),
|
|
3677
|
-
hitTest: (e, t) =>
|
|
3678
|
-
},
|
|
3685
|
+
hitTest: (e, t) => ko(Nt.get(He("link", qt(t), e.records.map((n) => n.id))), t, (n) => ({ type: "open-record", id: e.records[n].id }))
|
|
3686
|
+
}, qt = (e) => ({ width: e.size.width, metrics: e.metrics }), ko = (e, t, n, o = !1) => {
|
|
3679
3687
|
if (!t.wasActive && !o || !e) return null;
|
|
3680
|
-
const i = e.findIndex((a) =>
|
|
3688
|
+
const i = e.findIndex((a) => qe(t.point, a));
|
|
3681
3689
|
return i < 0 ? null : { action: n(i), area: e[i] };
|
|
3682
|
-
},
|
|
3690
|
+
}, Cr = (e, t, n, o, i, a, s) => {
|
|
3683
3691
|
const { cellTheme: r, theme: c } = t, l = s ? t.images.get(s) : void 0;
|
|
3684
3692
|
if (e.save(), e.beginPath(), e.arc(n + i / 2, o + i / 2, i / 2, 0, Math.PI * 2), e.closePath(), l)
|
|
3685
3693
|
e.clip(), e.drawImage(l, n, o, i, i);
|
|
3686
3694
|
else {
|
|
3687
3695
|
e.fillStyle = r.avatarFill, e.fill();
|
|
3688
|
-
const u =
|
|
3696
|
+
const u = tr(a);
|
|
3689
3697
|
if (u) {
|
|
3690
3698
|
const h = Math.round(i * 0.55);
|
|
3691
3699
|
he(e, h, c.fontFamily), e.fillStyle = r.avatarText, e.textAlign = "center", e.textBaseline = "middle", e.fillText(u, n + i / 2, o + i / 2 + 0.5);
|
|
3692
3700
|
}
|
|
3693
3701
|
}
|
|
3694
3702
|
e.restore();
|
|
3695
|
-
},
|
|
3703
|
+
}, wr = {
|
|
3696
3704
|
draw: (e, t, n) => {
|
|
3697
3705
|
const { metrics: o, theme: i } = t;
|
|
3698
3706
|
if (!n.people.length) return;
|
|
@@ -3702,83 +3710,83 @@ const Xe = (e, t) => e.x >= t.x && e.x < t.x + t.width && e.y >= t.y && e.y < t.
|
|
|
3702
3710
|
let l = t.x + o.padding;
|
|
3703
3711
|
r.widths.forEach((u, h) => {
|
|
3704
3712
|
const m = n.people[h];
|
|
3705
|
-
|
|
3713
|
+
Cr(e, t, l, c, a, m.name, m.avatarUrl), u > a + Ae && me(e, t, m.name, { x: l + a + Ae, maxWidth: u - a - Ae - (h < r.widths.length - 1 || r.more ? Re : 0) }), l += u + _e;
|
|
3706
3714
|
}), r.more > 0 && $t(e, t, l, r.more, r.badgeWidth);
|
|
3707
3715
|
},
|
|
3708
3716
|
describe: (e) => dt(e.people.map((t) => t.name))
|
|
3709
|
-
},
|
|
3717
|
+
}, Qn = (e) => {
|
|
3710
3718
|
const t = /\.([\p{L}\p{N}]{1,5})$/u.exec(e);
|
|
3711
3719
|
return t ? t[1].toUpperCase() : "";
|
|
3712
|
-
}, Lt = new
|
|
3720
|
+
}, Lt = new Xt(), vr = {
|
|
3713
3721
|
draw: (e, t, n) => {
|
|
3714
3722
|
const { metrics: o, cellTheme: i, theme: a } = t;
|
|
3715
3723
|
if (!n.files.length) return;
|
|
3716
3724
|
const s = o.chip, r = Math.max(8, Math.round(s * 0.42));
|
|
3717
3725
|
he(e, r, a.fontFamily, "600");
|
|
3718
|
-
const c = n.files.map((g) => (g.thumbnailUrl ? t.images.get(g.thumbnailUrl) : void 0) ? s : Math.max(s, Ee(e,
|
|
3726
|
+
const c = n.files.map((g) => (g.thumbnailUrl ? t.images.get(g.thumbnailUrl) : void 0) ? s : Math.max(s, Ee(e, Qn(g.name) || "?", r) + 6)), l = Kt(c, ht(t), (g) => _t(e, t, g), s), u = t.y + (t.height - s) / 2;
|
|
3719
3727
|
let h = t.x + o.padding;
|
|
3720
3728
|
const m = [];
|
|
3721
3729
|
l.widths.forEach((g, C) => {
|
|
3722
3730
|
const S = n.files[C], p = S.thumbnailUrl ? t.images.get(S.thumbnailUrl) : void 0;
|
|
3723
|
-
p ? (e.save(), D(e, { x: h, y: u, width: g, height: s, radius: 3 }), e.clip(), e.drawImage(p, h, u, g, s), e.restore(), D(e, { x: h + 0.5, y: u + 0.5, width: g - 1, height: s - 1, radius: 3, stroke: a.cellLineColor })) : (D(e, { x: h, y: u, width: g, height: s, radius: 3, fill: i.badgeFill }), he(e, r, a.fontFamily, "600"), e.fillStyle = i.badgeText, e.textAlign = "center", e.textBaseline = "middle", e.fillText(
|
|
3731
|
+
p ? (e.save(), D(e, { x: h, y: u, width: g, height: s, radius: 3 }), e.clip(), e.drawImage(p, h, u, g, s), e.restore(), D(e, { x: h + 0.5, y: u + 0.5, width: g - 1, height: s - 1, radius: 3, stroke: a.cellLineColor })) : (D(e, { x: h, y: u, width: g, height: s, radius: 3, fill: i.badgeFill }), he(e, r, a.fontFamily, "600"), e.fillStyle = i.badgeText, e.textAlign = "center", e.textBaseline = "middle", e.fillText(Qn(S.name) || "?", h + g / 2, u + s / 2 + 0.5, g - 4)), m.push({ x: h - t.x, y: u - t.y, width: g, height: s }), h += g + _e;
|
|
3724
3732
|
}), l.more > 0 && $t(e, t, h, l.more, l.badgeWidth), Lt.set(He("attachment", t, n.files.map((g) => g.id)), m);
|
|
3725
3733
|
},
|
|
3726
3734
|
describe: (e) => dt(e.files.map((t) => t.name)),
|
|
3727
|
-
hitTest: (e, t) =>
|
|
3728
|
-
},
|
|
3735
|
+
hitTest: (e, t) => ko(Lt.get(He("attachment", qt(t), e.files.map((n) => n.id))), t, (n) => ({ type: "open-attachment", id: e.files[n].id }), !0)
|
|
3736
|
+
}, Zn = (e) => `${Math.round(Math.max(0, Math.min(1, e)) * 100)}%`, Sr = {
|
|
3729
3737
|
draw: (e, t, n) => {
|
|
3730
3738
|
if (n.value == null) return;
|
|
3731
3739
|
const { metrics: o, cellTheme: i } = t, a = o.icon, s = Math.max(0, Math.min(1, n.value)), r = t.x + o.padding + a / 2, c = t.y + t.height / 2, l = a / 2 - 1.25;
|
|
3732
|
-
e.save(), e.lineWidth = 2.5, e.beginPath(), e.arc(r, c, l, 0, Math.PI * 2), e.strokeStyle = i.progressTrack, e.stroke(), s > 0 && (e.beginPath(), e.arc(r, c, l, -Math.PI / 2, -Math.PI / 2 + s * Math.PI * 2), e.strokeStyle = i.progressFill, e.lineCap = s < 1 ? "round" : "butt", e.stroke()), e.restore(), me(e, t,
|
|
3740
|
+
e.save(), e.lineWidth = 2.5, e.beginPath(), e.arc(r, c, l, 0, Math.PI * 2), e.strokeStyle = i.progressTrack, e.stroke(), s > 0 && (e.beginPath(), e.arc(r, c, l, -Math.PI / 2, -Math.PI / 2 + s * Math.PI * 2), e.strokeStyle = i.progressFill, e.lineCap = s < 1 ? "round" : "butt", e.stroke()), e.restore(), me(e, t, Zn(s), { x: t.x + o.padding + a + Ae + 2 });
|
|
3733
3741
|
},
|
|
3734
|
-
describe: (e) => e.value == null ? "" :
|
|
3735
|
-
}, Et = 10, Dt = new
|
|
3742
|
+
describe: (e) => e.value == null ? "" : Zn(e.value)
|
|
3743
|
+
}, Et = 10, Dt = new Xt(), yr = {
|
|
3736
3744
|
draw: (e, t, n) => {
|
|
3737
3745
|
const { metrics: o, cellTheme: i, theme: a } = t;
|
|
3738
3746
|
if (!n.label) return;
|
|
3739
3747
|
he(e, o.chipFontSize, a.fontFamily);
|
|
3740
3748
|
const s = Math.min(ht(t), Ee(e, n.label, o.chipFontSize) + 2 * Et), r = { x: t.x + o.padding, y: t.y + (t.height - o.chip) / 2, width: s, height: o.chip };
|
|
3741
|
-
D(e, { ...r, radius:
|
|
3749
|
+
D(e, { ...r, radius: Jn, fill: i.buttonFill }), D(e, { x: r.x + 0.5, y: r.y + 0.5, width: r.width - 1, height: r.height - 1, radius: Jn, stroke: i.buttonBorder }), n.disabled && (e.globalAlpha = 0.5), me(e, t, n.label, { x: r.x + Et, maxWidth: s - 2 * Et, color: i.buttonText, fontSize: o.chipFontSize }), e.globalAlpha = 1, Dt.set(He("button", t, [n.label]), [{ x: r.x - t.x, y: r.y - t.y, width: s, height: o.chip }]);
|
|
3742
3750
|
},
|
|
3743
3751
|
describe: (e) => e.label,
|
|
3744
3752
|
hitTest: (e, t) => {
|
|
3745
3753
|
if (e.disabled || !e.label) return null;
|
|
3746
|
-
const n = Dt.get(He("button",
|
|
3747
|
-
return n &&
|
|
3754
|
+
const n = Dt.get(He("button", qt(t), [e.label]))?.[0];
|
|
3755
|
+
return n && qe(t.point, n) ? { action: { type: "press" }, area: n } : null;
|
|
3748
3756
|
},
|
|
3749
3757
|
keyAction: (e, t) => !e.disabled && (t === "Enter" || t === " ") ? { type: "press" } : null
|
|
3750
|
-
},
|
|
3751
|
-
text:
|
|
3752
|
-
longText:
|
|
3753
|
-
number:
|
|
3754
|
-
select:
|
|
3755
|
-
person:
|
|
3756
|
-
date:
|
|
3757
|
-
boolean:
|
|
3758
|
-
rating:
|
|
3759
|
-
url:
|
|
3760
|
-
link:
|
|
3761
|
-
attachment:
|
|
3762
|
-
progress:
|
|
3763
|
-
button:
|
|
3764
|
-
derived:
|
|
3765
|
-
},
|
|
3758
|
+
}, Jn = 4, br = {
|
|
3759
|
+
text: rr,
|
|
3760
|
+
longText: lr,
|
|
3761
|
+
number: dr,
|
|
3762
|
+
select: fr,
|
|
3763
|
+
person: wr,
|
|
3764
|
+
date: cr,
|
|
3765
|
+
boolean: mr,
|
|
3766
|
+
rating: gr,
|
|
3767
|
+
url: hr,
|
|
3768
|
+
link: pr,
|
|
3769
|
+
attachment: vr,
|
|
3770
|
+
progress: Sr,
|
|
3771
|
+
button: yr,
|
|
3772
|
+
derived: ur
|
|
3773
|
+
}, Lr = () => {
|
|
3766
3774
|
Nt.clear(), Lt.clear(), Dt.clear();
|
|
3767
|
-
},
|
|
3775
|
+
}, xr = 6, Rr = (e, t, n, o) => {
|
|
3768
3776
|
if (e.save(), n === "pending") {
|
|
3769
|
-
const i =
|
|
3777
|
+
const i = xr / 2, a = t.x + t.width - 3 - i, s = t.y + 3 + i;
|
|
3770
3778
|
e.beginPath(), e.arc(a, s, i + 1, 0, Math.PI * 2), e.fillStyle = o.surface, e.fill(), e.beginPath(), e.arc(a, s, i, 0, Math.PI * 2), e.fillStyle = o.pending, e.fill();
|
|
3771
3779
|
} else
|
|
3772
3780
|
e.lineWidth = 2, e.strokeStyle = o.danger, e.strokeRect(t.x + 1, t.y + 1, t.width - 2, t.height - 2);
|
|
3773
3781
|
e.restore();
|
|
3774
|
-
},
|
|
3775
|
-
const t = { ...
|
|
3782
|
+
}, eo = (e, t) => !!e && !!t && e[0] === t[0] && e[1] === t[1], kr = (e) => {
|
|
3783
|
+
const t = { ...br, ...e.renderers }, n = e.locale ?? "en-US";
|
|
3776
3784
|
let o = e.labels, i = e.theme ?? Ue, a = null, s = null;
|
|
3777
|
-
const r =
|
|
3785
|
+
const r = js(() => e.onImageLoad?.()), c = (p) => ((!s || s.rowHeight !== p.height || s.fontSize !== p.theme.fontSizeSM || s.chipFontSize > p.theme.fontSizeXS) && (s = Dn(p.height, p.theme.fontSizeSM, p.theme.fontSizeXS)), s), l = (p) => {
|
|
3778
3786
|
if (e.theme || a === p.theme) return;
|
|
3779
3787
|
a = p.theme;
|
|
3780
3788
|
const w = e.themeRoot?.();
|
|
3781
|
-
w && (i =
|
|
3789
|
+
w && (i = So(w));
|
|
3782
3790
|
}, u = {
|
|
3783
3791
|
draw: (p, w) => {
|
|
3784
3792
|
const v = e.getValue(w.cell);
|
|
@@ -3787,7 +3795,7 @@ const Xe = (e, t) => e.x >= t.x && e.x < t.x + t.width && e.y >= t.y && e.y < t.
|
|
|
3787
3795
|
R && (p.save(), p.beginPath(), p.rect(w.x, w.y, w.width, w.height), p.clip(), R.draw(p, { ...w, cellTheme: i, metrics: c(w), images: r, labels: o, locale: n }, v), p.restore());
|
|
3788
3796
|
}
|
|
3789
3797
|
const y = e.getStatus?.(w.cell);
|
|
3790
|
-
y &&
|
|
3798
|
+
y && Rr(p, w, y, i);
|
|
3791
3799
|
}
|
|
3792
3800
|
}, h = (p, w) => w?.type === "update" && e.isReadonly?.(p) ? null : w, m = (p) => {
|
|
3793
3801
|
const w = e.getValue(p), v = w ? t[w.kind]?.describe(w, { labels: o, locale: n }) ?? "" : "", y = e.getStatus?.(p);
|
|
@@ -3819,12 +3827,12 @@ const Xe = (e, t) => e.x >= t.x && e.x < t.x + t.width && e.y >= t.y && e.y < t.
|
|
|
3819
3827
|
const R = p();
|
|
3820
3828
|
if (!R || y.button !== 0 || y.shiftKey || y.metaKey || y.ctrlKey) return;
|
|
3821
3829
|
const I = R.getSelection(), k = I.activeCell;
|
|
3822
|
-
if (!k || I.kind !== "cells" || !
|
|
3830
|
+
if (!k || I.kind !== "cells" || !eo(I.ranges[0], I.ranges[1])) return;
|
|
3823
3831
|
const P = y.currentTarget?.querySelector("[data-ui-grid]"), A = R.getCellRect(k);
|
|
3824
3832
|
if (!P || !A) return;
|
|
3825
3833
|
const N = P.getBoundingClientRect(), M = { x: y.clientX - N.left - A.x, y: y.clientY - N.top - A.y };
|
|
3826
3834
|
if (M.x < 0 || M.y < 0 || M.x >= A.width || M.y >= A.height) return;
|
|
3827
|
-
const E = g(k, M, A,
|
|
3835
|
+
const E = g(k, M, A, eo(v, k));
|
|
3828
3836
|
E && w(E.action, k);
|
|
3829
3837
|
}
|
|
3830
3838
|
};
|
|
@@ -3837,7 +3845,7 @@ const Xe = (e, t) => e.x >= t.x && e.x < t.x + t.width && e.y >= t.y && e.y < t.
|
|
|
3837
3845
|
},
|
|
3838
3846
|
clearImages: () => r.clear()
|
|
3839
3847
|
};
|
|
3840
|
-
},
|
|
3848
|
+
}, Ir = {
|
|
3841
3849
|
"{count} failed": "{count} failed",
|
|
3842
3850
|
"{name} is not a JPEG, PNG, WebP or GIF image": "{name} is not a JPEG, PNG, WebP or GIF image",
|
|
3843
3851
|
"{name}: {kind} images are not supported; on an iPhone, set Settings > Camera > Formats to Most Compatible": "{name}: {kind} images are not supported; on an iPhone, set Settings > Camera > Formats to Most Compatible",
|
|
@@ -4098,8 +4106,8 @@ const Xe = (e, t) => e.x >= t.x && e.x < t.x + t.width && e.y >= t.y && e.y < t.
|
|
|
4098
4106
|
"Rating {value} of {max}": "Rating {value} of {max}",
|
|
4099
4107
|
Saving: "Saving",
|
|
4100
4108
|
"Not saved": "Not saved"
|
|
4101
|
-
},
|
|
4102
|
-
en:
|
|
4109
|
+
}, Pr = {
|
|
4110
|
+
en: Ir,
|
|
4103
4111
|
"zh-TW": {
|
|
4104
4112
|
"{count} failed": "{count} 個失敗",
|
|
4105
4113
|
"{name} is not a JPEG, PNG, WebP or GIF image": "{name} 不是 JPEG、PNG、WebP 或 GIF 圖片",
|
|
@@ -6197,27 +6205,27 @@ const Xe = (e, t) => e.x >= t.x && e.x < t.x + t.width && e.y >= t.y && e.y < t.
|
|
|
6197
6205
|
"Not saved": "Non salvato"
|
|
6198
6206
|
}
|
|
6199
6207
|
};
|
|
6200
|
-
function
|
|
6201
|
-
return
|
|
6208
|
+
function zr(e, t, n = {}) {
|
|
6209
|
+
return bo(Pr[e][t], n);
|
|
6202
6210
|
}
|
|
6203
|
-
function
|
|
6204
|
-
const e =
|
|
6211
|
+
function Mr() {
|
|
6212
|
+
const e = Js(() => {
|
|
6205
6213
|
});
|
|
6206
|
-
return (t, n) =>
|
|
6214
|
+
return (t, n) => zr(e.value, t, n);
|
|
6207
6215
|
}
|
|
6208
|
-
const
|
|
6209
|
-
const t =
|
|
6216
|
+
const Dr = (e) => {
|
|
6217
|
+
const t = Mr(), n = _(() => ({
|
|
6210
6218
|
checked: t("Checked"),
|
|
6211
6219
|
unchecked: t("Not checked"),
|
|
6212
6220
|
rating: t("Rating {value} of {max}", { value: "{value}", max: "{max}" }),
|
|
6213
6221
|
saving: t("Saving"),
|
|
6214
6222
|
failed: t("Not saved"),
|
|
6215
6223
|
...e.labels
|
|
6216
|
-
})), o =
|
|
6224
|
+
})), o = kr({ ...e, labels: n.value });
|
|
6217
6225
|
return ue(n, (i) => o.setLabels(i)), o;
|
|
6218
|
-
},
|
|
6219
|
-
function
|
|
6220
|
-
const t = e.delayMs ??
|
|
6226
|
+
}, Ar = 300;
|
|
6227
|
+
function Wr(e) {
|
|
6228
|
+
const t = e.delayMs ?? Ar, n = e.setTimer ?? ((l, u) => setTimeout(l, u)), o = e.clearTimer ?? ((l) => clearTimeout(l)), i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map();
|
|
6221
6229
|
let s = 0;
|
|
6222
6230
|
const r = (l, u) => {
|
|
6223
6231
|
const h = i.get(l);
|
|
@@ -6254,39 +6262,39 @@ function Dr(e) {
|
|
|
6254
6262
|
}
|
|
6255
6263
|
};
|
|
6256
6264
|
}
|
|
6257
|
-
function
|
|
6265
|
+
function Br(e) {
|
|
6258
6266
|
return e ? e.state === "saving" ? "pending" : "error" : null;
|
|
6259
6267
|
}
|
|
6260
6268
|
export {
|
|
6261
|
-
|
|
6262
|
-
|
|
6263
|
-
|
|
6264
|
-
|
|
6265
|
-
|
|
6266
|
-
|
|
6267
|
-
|
|
6268
|
-
|
|
6269
|
-
|
|
6270
|
-
|
|
6271
|
-
|
|
6272
|
-
|
|
6273
|
-
|
|
6274
|
-
|
|
6269
|
+
ja as GRID_CELL_TOKENS,
|
|
6270
|
+
Qa as GRID_CHIP_TOKENS,
|
|
6271
|
+
Fr as GridHost,
|
|
6272
|
+
Ar as SAVING_MARK_DELAY_MS,
|
|
6273
|
+
za as blockCellCount,
|
|
6274
|
+
Ma as buildPasteProposal,
|
|
6275
|
+
Xe as cellRange,
|
|
6276
|
+
Br as cellStatusMark,
|
|
6277
|
+
Lr as clearGridCellRegions,
|
|
6278
|
+
Wr as createCellStatusStore,
|
|
6279
|
+
Za as createGridCellTheme,
|
|
6280
|
+
kr as createGridCells,
|
|
6281
|
+
js as createGridImageCache,
|
|
6282
|
+
br as defaultGridCellRenderers,
|
|
6275
6283
|
Ue as defaultGridCellTheme,
|
|
6276
|
-
|
|
6277
|
-
|
|
6278
|
-
|
|
6279
|
-
|
|
6284
|
+
Rr as drawGridCellStatus,
|
|
6285
|
+
Tr as fillSeries,
|
|
6286
|
+
gs as filledRange,
|
|
6287
|
+
ar as formatGridNumber,
|
|
6280
6288
|
Dn as gridCellMetrics,
|
|
6281
|
-
|
|
6282
|
-
|
|
6283
|
-
|
|
6284
|
-
|
|
6285
|
-
|
|
6286
|
-
|
|
6287
|
-
|
|
6288
|
-
|
|
6289
|
-
|
|
6290
|
-
|
|
6291
|
-
|
|
6289
|
+
Nr as parseGridNumber,
|
|
6290
|
+
va as parseTsv,
|
|
6291
|
+
ms as planFill,
|
|
6292
|
+
So as readGridCellTheme,
|
|
6293
|
+
po as selectionBlock,
|
|
6294
|
+
Pa as selectionStart,
|
|
6295
|
+
ba as toHtmlTable,
|
|
6296
|
+
wa as toTsv,
|
|
6297
|
+
Dr as useGridCells,
|
|
6298
|
+
ka as writeClipboardAsync,
|
|
6299
|
+
xa as writeClipboardEvent
|
|
6292
6300
|
};
|