@synopackageland/ui 0.25.13 → 0.25.15
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 +18 -0
- package/README.md +24 -2
- package/dist/components/app/aside-panel/AsidePanel.vue.d.ts +9 -1
- package/dist/components/composite/data-grid/DataGrid.vue.d.ts +6 -0
- package/dist/components/composite/expand-all/ExpandAllButtons.vue.d.ts +30 -0
- package/dist/components/composite/expand-all/expandAll.d.ts +12 -0
- package/dist/components/composite/tag-picker/TagPicker.vue.d.ts +77 -0
- package/dist/components/composite/tag-picker/TagPickerList.vue.d.ts +56 -0
- package/dist/components/composite/tag-picker/tagPicker.d.ts +44 -0
- package/dist/grid.js +241 -160
- package/dist/i18n/text.d.ts +9 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +13145 -12454
- package/dist/json-preview/preview.js +292 -211
- package/dist/reka-runtime.json +1 -1
- package/dist/theme.css +1 -1
- package/dist/themes/dsm7-embedded-theme.css +1 -1
- package/dist/themes/dsm7-embedded.css +1 -1
- package/dist/themes/dsm7.css +1 -1
- package/docs/adaptive-layout.md +1 -0
- package/docs/component-defaults.md +2 -0
- package/docs/theme-hooks.md +4 -0
- package/package.json +1 -1
package/dist/grid.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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 to, getCurrentScope as
|
|
2
|
+
import { watch as ue, toValue as to, getCurrentScope as Xo, 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
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 || {}),
|
|
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 || {}), X = /* @__PURE__ */ ((e) => (e.Spacer = "Spacer", e.Drag = "Drag", e.Expand = "Expand", e.Checkbox = "Checkbox", e))(X || {}), 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
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 = {
|
|
@@ -102,32 +102,32 @@ const rt = "…", mn = new ct(1e3), gn = new ct(1e3), io = () => ({
|
|
|
102
102
|
let I = 0;
|
|
103
103
|
const k = (M, E) => {
|
|
104
104
|
C.push({ text: M, width: E, start: v });
|
|
105
|
-
}, P = (M, E,
|
|
106
|
-
p === "" && (v =
|
|
105
|
+
}, P = (M, E, N) => {
|
|
106
|
+
p === "" && (v = N), p += M, w += E;
|
|
107
107
|
}, A = (M, E = 0) => {
|
|
108
|
-
const
|
|
109
|
-
if (w >
|
|
110
|
-
const W = ro(e, p,
|
|
108
|
+
const N = a - S;
|
|
109
|
+
if (w > N) {
|
|
110
|
+
const W = ro(e, p, N);
|
|
111
111
|
p = W.text, w = W.width;
|
|
112
112
|
} else if (M) {
|
|
113
113
|
let W = E;
|
|
114
114
|
for (const { segment: K } of Ht.segment(M)) {
|
|
115
115
|
const G = e.measureText(K).width;
|
|
116
|
-
if (w + G >
|
|
116
|
+
if (w + G > N) break;
|
|
117
117
|
P(K, G, W), W += K.length;
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
120
|
k(p + rt, w + S), p = "", w = 0;
|
|
121
|
-
},
|
|
121
|
+
}, F = (M, E, N) => {
|
|
122
122
|
if (w + E <= a) {
|
|
123
|
-
P(M, E,
|
|
123
|
+
P(M, E, N);
|
|
124
124
|
return;
|
|
125
125
|
}
|
|
126
126
|
if (E <= a) {
|
|
127
|
-
C.length < s - 1 ? (k(p, w), p = "", w = 0, P(M, E,
|
|
127
|
+
C.length < s - 1 ? (k(p, w), p = "", w = 0, P(M, E, N)) : A(M, N);
|
|
128
128
|
return;
|
|
129
129
|
}
|
|
130
|
-
let W =
|
|
130
|
+
let W = N;
|
|
131
131
|
for (const { segment: K } of Ht.segment(M)) {
|
|
132
132
|
if (C.length >= s) break;
|
|
133
133
|
const G = e.measureText(K).width;
|
|
@@ -140,20 +140,20 @@ const rt = "…", mn = new ct(1e3), gn = new ct(1e3), io = () => ({
|
|
|
140
140
|
`)) {
|
|
141
141
|
const E = M.split(`
|
|
142
142
|
`);
|
|
143
|
-
for (let
|
|
144
|
-
if (
|
|
143
|
+
for (let N = 0; N < E.length && !(C.length >= s); N++) {
|
|
144
|
+
if (N > 0) {
|
|
145
145
|
if (I++, C.length + 1 === s && I < i.length) {
|
|
146
146
|
A();
|
|
147
147
|
break;
|
|
148
148
|
}
|
|
149
149
|
k(p, w), p = "", w = 0, v = I;
|
|
150
150
|
}
|
|
151
|
-
const W = E[
|
|
152
|
-
W.length > 0 && (I += W.length,
|
|
151
|
+
const W = E[N];
|
|
152
|
+
W.length > 0 && (I += W.length, F(W, e.measureText(W).width, I - W.length));
|
|
153
153
|
}
|
|
154
154
|
continue;
|
|
155
155
|
}
|
|
156
|
-
I += M.length,
|
|
156
|
+
I += M.length, F(M, e.measureText(M).width, I - M.length);
|
|
157
157
|
}
|
|
158
158
|
C.length < s && p !== "" && k(p, w), gn.set(y, C);
|
|
159
159
|
}
|
|
@@ -347,7 +347,7 @@ const lo = (e, t) => t ? Math.max(t - (e.iconSizeMD - e.iconSizeXS) / 2, 0) : 0,
|
|
|
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 === X.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);
|
|
@@ -356,16 +356,16 @@ const lo = (e, t) => t ? Math.max(t - (e.iconSizeMD - e.iconSizeXS) / 2, 0) : 0,
|
|
|
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
358
|
}, wi = {
|
|
359
|
-
[
|
|
360
|
-
[
|
|
361
|
-
[
|
|
359
|
+
[X.Drag]: x.RowHeaderDragHandler,
|
|
360
|
+
[X.Checkbox]: x.RowHeaderCheckbox,
|
|
361
|
+
[X.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: 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) ??
|
|
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) ?? Ni(e) ?? Fi(e) ?? Li(e) ?? Di(e) ?? Bi(e) ?? Oi(e) ?? ne, ki = (e, t, n) => {
|
|
369
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,
|
|
@@ -396,12 +396,12 @@ const lo = (e, t) => t ? Math.max(t - (e.iconSizeMD - e.iconSizeXS) / 2, 0) : 0,
|
|
|
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
|
+
}, Ni = (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 ===
|
|
401
|
+
if (!s || l !== -1 || u !== -1 || !o.some((v) => v.type === X.Checkbox)) return null;
|
|
402
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
|
+
}, Fi = (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) => {
|
|
@@ -427,8 +427,8 @@ const lo = (e, t) => t ? Math.max(t - (e.iconSizeMD - e.iconSizeXS) / 2, 0) : 0,
|
|
|
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),
|
|
431
|
-
return V(h,
|
|
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), F = S === w && p === v && a != null && s != null && a[0] === y && a[1] === R && s ? s.height : o.getRowHeight(I), M = o.getRowOffset(I) + F - i.scrollTop, E = bi / 2 + xi, N = k - E, W = M - E;
|
|
431
|
+
return V(h, N, N + E * 2) && V(m, W, W + E * 2) ? { type: x.FillHandler, x: N, 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 : {
|
|
@@ -449,8 +449,8 @@ const lo = (e, t) => t ? Math.max(t - (e.iconSizeMD - e.iconSizeXS) / 2, 0) : 0,
|
|
|
449
449
|
const P = k - m - fn / 2, A = (C - m) / 2;
|
|
450
450
|
if (p && V(c, P, P + m) && V(l, A, A + m))
|
|
451
451
|
return { type: x.ColumnDescription, x: P, y: A, width: m, height: m };
|
|
452
|
-
const
|
|
453
|
-
return S && V(c,
|
|
452
|
+
const F = R + m / 2, M = (C - m) / 2;
|
|
453
|
+
return S && V(c, F, F + m) && V(l, M, M + m) ? { type: x.ColumnPrimaryIcon, x: F, y: M, width: m, height: m } : s && (h !== 0 && V(c, R, R + pn / 2) || V(c, I - pn / 2, I)) ? { ...ne, type: x.ColumnResizeHandler } : { type: x.ColumnHeader, x: R, y: 0, width: y, height: C };
|
|
454
454
|
}, {
|
|
455
455
|
fillHandlerSize: ot,
|
|
456
456
|
cellTextLineHeight: Cn,
|
|
@@ -461,7 +461,7 @@ const lo = (e, t) => t ? Math.max(t - (e.iconSizeMD - e.iconSizeXS) / 2, 0) : 0,
|
|
|
461
461
|
columnAppendBtnWidth: Sn,
|
|
462
462
|
columnResizeHandlerWidth: yn,
|
|
463
463
|
columnResizeHandlerPaddingTop: bn,
|
|
464
|
-
cellVerticalPaddingMD:
|
|
464
|
+
cellVerticalPaddingMD: Nt,
|
|
465
465
|
columnFreezeHandlerWidth: xn,
|
|
466
466
|
columnFreezeHandlerHeight: Rn
|
|
467
467
|
} = B, kn = (e, t) => {
|
|
@@ -477,52 +477,52 @@ const lo = (e, t) => t ? Math.max(t - (e.iconSizeMD - e.iconSizeXS) / 2, 0) : 0,
|
|
|
477
477
|
getLinearRow: e.getLinearRow ?? Wt,
|
|
478
478
|
real2RowIndex: e.real2RowIndex ?? oo
|
|
479
479
|
}), In = (e, t) => {
|
|
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 = [],
|
|
481
|
-
if (!S) return { cellPropList: P, rowHeaderPropList: A, appendRowList:
|
|
482
|
-
const M = t === "freeze", E = M ? 0 : Math.max(m, o.startColumnIndex),
|
|
483
|
-
for (let z = E; z <=
|
|
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 = [], F = [];
|
|
481
|
+
if (!S) return { cellPropList: P, rowHeaderPropList: A, appendRowList: F };
|
|
482
|
+
const M = t === "freeze", E = M ? 0 : Math.max(m, o.startColumnIndex), N = M ? Math.max(m - 1, 0) : o.stopColumnIndex, W = M && m === 0, { cellBg: K, cellBgHovered: G, cellBgSelected: ke } = u;
|
|
483
|
+
for (let z = E; z <= N; z++) {
|
|
484
484
|
const L = n.getColumnRelativeOffset(z, v), ge = n.getColumnWidth(z), Ye = w && c.includes([z, z]), ie = z === 0;
|
|
485
485
|
for (let re = o.startRowIndex; re <= o.stopRowIndex; re++) {
|
|
486
|
-
const Te = h(re),
|
|
486
|
+
const Te = h(re), Ne = n.getRowHeight(re), Fe = n.getRowOffset(re) - y;
|
|
487
487
|
if (Te.type === se.Group) continue;
|
|
488
488
|
if (Te.type === se.Append) {
|
|
489
|
-
ie &&
|
|
489
|
+
ie && F.push({ x: 0.5, y: Fe + 0.5, width: C - v, height: Ne, isHover: I === x.AppendRow && R === re });
|
|
490
490
|
continue;
|
|
491
491
|
}
|
|
492
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
|
|
494
|
-
gt || ae || Ye ?
|
|
493
|
+
let q;
|
|
494
|
+
gt || ae || Ye ? q = ke : (Le || ve || le) && (q = G), ie && A.push({
|
|
495
495
|
x: 0.5,
|
|
496
|
-
y:
|
|
496
|
+
y: Fe + 0.5,
|
|
497
497
|
width: g + 0.5,
|
|
498
|
-
height:
|
|
498
|
+
height: Ne,
|
|
499
499
|
displayIndex: String(mt),
|
|
500
500
|
isHover: Le || ve || le,
|
|
501
501
|
isChecked: p && ae
|
|
502
502
|
}), !W && P.push({
|
|
503
503
|
x: L + 0.5,
|
|
504
|
-
y:
|
|
504
|
+
y: Fe + 0.5,
|
|
505
505
|
width: ge,
|
|
506
|
-
height:
|
|
506
|
+
height: Ne,
|
|
507
507
|
rowIndex: Ie,
|
|
508
508
|
columnIndex: z,
|
|
509
509
|
theme: u,
|
|
510
510
|
isActive: !1,
|
|
511
|
-
fill: Pe ? K :
|
|
511
|
+
fill: Pe ? K : q ?? K
|
|
512
512
|
});
|
|
513
513
|
}
|
|
514
514
|
}
|
|
515
|
-
return { cellPropList: P, rowHeaderPropList: A, appendRowList:
|
|
515
|
+
return { cellPropList: P, rowHeaderPropList: A, appendRowList: F };
|
|
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
|
-
for (let
|
|
522
|
-
const { type: M } = h[
|
|
523
|
-
if (M ===
|
|
524
|
-
const E = Gt(a, u, m, h.length,
|
|
525
|
-
if (M ===
|
|
521
|
+
for (let F = 0; F < h.length; F++) {
|
|
522
|
+
const { type: M } = h[F];
|
|
523
|
+
if (M === X.Spacer) continue;
|
|
524
|
+
const E = Gt(a, u, m, h.length, F);
|
|
525
|
+
if (M === X.Checkbox) {
|
|
526
526
|
Bt(e, {
|
|
527
527
|
x: o + E - A,
|
|
528
528
|
y: i + wn,
|
|
@@ -533,11 +533,11 @@ const lo = (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 === X.Expand || C?.(e, { kind: M === X.Drag ? "drag" : "expand", x: o + E - A, y: i + wn, size: R, theme: u });
|
|
537
537
|
}
|
|
538
538
|
return;
|
|
539
539
|
}
|
|
540
|
-
$e(e, { x: o + a / 2, y: i +
|
|
540
|
+
$e(e, { x: o + a / 2, y: i + Nt + 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();
|
|
@@ -562,21 +562,21 @@ const lo = (e, t) => t ? Math.max(t - (e.iconSizeMD - e.iconSizeXS) / 2, 0) : 0,
|
|
|
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
|
-
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 = (
|
|
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 = (F) => i.getRowOffset(l(F)) + i.getRowHeight(l(F)) - 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
|
+
}, qi = (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
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();
|
|
575
|
-
},
|
|
575
|
+
}, Xi = (e, t, n) => {
|
|
576
576
|
const { x: o, y: i, width: a, height: s, fill: r, column: c, hasMenu: l } = t, { theme: u, drawIcon: h } = n, { name: m, description: g, hasMenu: C, isPrimary: S, hasIcon: p } = c, { cellLineColor: w, columnHeaderBg: v, iconFgCommon: y, columnHeaderNameColor: R, fontSizeSM: I, iconSizeXS: k } = u;
|
|
577
577
|
let P = a - te * 2, A = te;
|
|
578
|
-
const
|
|
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),
|
|
578
|
+
const F = l && C, M = i + (vn - k) / 2;
|
|
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), F) {
|
|
580
580
|
P = P - Me - te;
|
|
581
581
|
const E = i + vn / 2;
|
|
582
582
|
si(e, {
|
|
@@ -589,11 +589,11 @@ const lo = (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:
|
|
592
|
+
g && (h?.(e, { kind: "description", x: F ? 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
|
-
y: i +
|
|
594
|
+
y: i + Nt,
|
|
595
595
|
text: m,
|
|
596
|
-
maxLines: Math.max(1, Math.floor((s -
|
|
596
|
+
maxLines: Math.max(1, Math.floor((s - Nt) / Cn)),
|
|
597
597
|
lineHeight: Cn,
|
|
598
598
|
fontSize: I,
|
|
599
599
|
maxWidth: P,
|
|
@@ -601,7 +601,7 @@ const lo = (e, t) => t ? Math.max(t - (e.iconSizeMD - e.iconSizeXS) / 2, 0) : 0,
|
|
|
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 ===
|
|
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 === X.Checkbox)) {
|
|
605
605
|
const y = co({ width: a, theme: c, rowControls: l, rowControlPaddingX: u });
|
|
606
606
|
Bt(e, {
|
|
607
607
|
x: o + y - v + 0.5,
|
|
@@ -613,18 +613,18 @@ const lo = (e, t) => t ? Math.max(t - (e.iconSizeMD - e.iconSizeXS) / 2, 0) : 0,
|
|
|
613
613
|
});
|
|
614
614
|
}
|
|
615
615
|
}, Pn = (e, t, n) => {
|
|
616
|
-
const { visibleRegion: o, coordInstance: i, columns: a, theme: s, mouseState: r, scrollState: c, selection: l, isInteracting: u, isColumnHeaderMenuVisible: h } = t, { containerWidth: m, freezeRegionWidth: g, rowInitSize: C, columnInitSize: S, freezeColumnCount: p, pureRowCount: w } = i, { isColumnSelection: v, isRowSelection: y, ranges: R } = l, { type: I, columnIndex: k } = r, P = n === "freeze", A = P ? 0 : Math.max(p, o.startColumnIndex),
|
|
616
|
+
const { visibleRegion: o, coordInstance: i, columns: a, theme: s, mouseState: r, scrollState: c, selection: l, isInteracting: u, isColumnHeaderMenuVisible: h } = t, { containerWidth: m, freezeRegionWidth: g, rowInitSize: C, columnInitSize: S, freezeColumnCount: p, pureRowCount: w } = i, { isColumnSelection: v, isRowSelection: y, ranges: R } = l, { type: I, columnIndex: k } = r, P = n === "freeze", A = P ? 0 : Math.max(p, o.startColumnIndex), F = P ? Math.max(p - 1, 0) : o.stopColumnIndex;
|
|
617
617
|
e.save(), e.beginPath(), e.rect(P ? 0 : g + 1, 0, P ? g + 1 : m - g, C + 1), e.clip(), e.font = `normal ${s.fontSizeSM}px ${s.fontFamily}`;
|
|
618
|
-
for (let E = A; E <=
|
|
619
|
-
const
|
|
620
|
-
if (
|
|
618
|
+
for (let E = A; E <= F; E++) {
|
|
619
|
+
const N = a[E];
|
|
620
|
+
if (N == null) continue;
|
|
621
621
|
const W = v && l.includes([E, E]), K = !u && (I === x.ColumnHeader || I === x.ColumnHeaderMenu) && k === E, G = W ? s.columnHeaderBgSelected : K ? s.columnHeaderBgHovered : void 0;
|
|
622
|
-
|
|
622
|
+
Xi(e, {
|
|
623
623
|
x: i.getColumnRelativeOffset(E, c.scrollLeft) + 0.5,
|
|
624
624
|
y: 0.5,
|
|
625
625
|
width: i.getColumnWidth(E),
|
|
626
626
|
height: C,
|
|
627
|
-
column:
|
|
627
|
+
column: N,
|
|
628
628
|
fill: G,
|
|
629
629
|
hasMenu: h
|
|
630
630
|
}, t);
|
|
@@ -697,7 +697,7 @@ const lo = (e, t) => t ? Math.max(t - (e.iconSizeMD - e.iconSizeXS) / 2, 0) : 0,
|
|
|
697
697
|
pixelRatio: i,
|
|
698
698
|
shouldRerender: m,
|
|
699
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),
|
|
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), qi(g, a), Qi(g, a), Ji(g, a), Zi(g, a), ea(g, a), g.restore());
|
|
701
701
|
}, uo = {
|
|
702
702
|
staticWhite: "#FFFFFF",
|
|
703
703
|
staticBlack: "#000000",
|
|
@@ -956,7 +956,7 @@ const fa = ({ isEditing: e, eventTarget: t, hiddenFocusEl: n }) => {
|
|
|
956
956
|
}
|
|
957
957
|
})) : Promise.reject(a);
|
|
958
958
|
}
|
|
959
|
-
}, Ia = (e) => e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">"), it = (e, t, n) => Math.min(n, Math.max(t, e)),
|
|
959
|
+
}, Ia = (e) => e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">"), it = (e, t, n) => Math.min(n, Math.max(t, e)), qe = (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 {
|
|
@@ -979,7 +979,7 @@ const fa = ({ isEditing: e, eventTarget: t, hiddenFocusEl: n }) => {
|
|
|
979
979
|
if (n <= 0 || o <= 0) return null;
|
|
980
980
|
switch (e.kind) {
|
|
981
981
|
case "cells": {
|
|
982
|
-
const i =
|
|
982
|
+
const i = qe(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": {
|
|
@@ -995,7 +995,7 @@ const fa = ({ isEditing: e, eventTarget: t, hiddenFocusEl: n }) => {
|
|
|
995
995
|
}
|
|
996
996
|
}, Pa = (e, t) => {
|
|
997
997
|
if (e.kind === "cells") {
|
|
998
|
-
const o =
|
|
998
|
+
const o = qe(e, t);
|
|
999
999
|
return o ? [o.startColumn, o.startRow] : null;
|
|
1000
1000
|
}
|
|
1001
1001
|
const n = po(e, t);
|
|
@@ -1007,7 +1007,7 @@ const fa = ({ isEditing: e, eventTarget: t, hiddenFocusEl: 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 = qe(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;
|
|
@@ -1092,10 +1092,10 @@ function Ea(e) {
|
|
|
1092
1092
|
return g;
|
|
1093
1093
|
}
|
|
1094
1094
|
const Co = "data-ui-ignore-outside", Pt = /* @__PURE__ */ new WeakMap(), Tn = /* @__PURE__ */ new WeakSet();
|
|
1095
|
-
function
|
|
1095
|
+
function Nn(e) {
|
|
1096
1096
|
return [...e.options.elements()].filter((t) => !!t);
|
|
1097
1097
|
}
|
|
1098
|
-
function
|
|
1098
|
+
function Fn(e, t) {
|
|
1099
1099
|
return e.some((n) => n instanceof Node && t.some((o) => o === n || o.contains(n)));
|
|
1100
1100
|
}
|
|
1101
1101
|
function Ha(e) {
|
|
@@ -1104,7 +1104,7 @@ function Ha(e) {
|
|
|
1104
1104
|
function Ta(e, t) {
|
|
1105
1105
|
return e.length > 0 && !e.includes(t);
|
|
1106
1106
|
}
|
|
1107
|
-
function
|
|
1107
|
+
function Na(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,7 +1113,7 @@ function Fa(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
|
|
1116
|
+
function Fa(e) {
|
|
1117
1117
|
const t = e.document, n = { layers: [], guard: fo(e), teardown: () => {
|
|
1118
1118
|
} }, o = (a) => {
|
|
1119
1119
|
if (Tn.has(a)) return;
|
|
@@ -1122,10 +1122,10 @@ function Na(e) {
|
|
|
1122
1122
|
if (!(Ha(s) || Ta(s, t)))
|
|
1123
1123
|
for (const r of [...n.layers].reverse()) {
|
|
1124
1124
|
if (r.disposed) continue;
|
|
1125
|
-
const c =
|
|
1126
|
-
if (
|
|
1125
|
+
const c = Nn(r);
|
|
1126
|
+
if (Fn(s, c) || Mn(s, c)) return;
|
|
1127
1127
|
if (r.options.onOutside?.(a) === "veto") {
|
|
1128
|
-
a.preventDefault(), a.stopImmediatePropagation(),
|
|
1128
|
+
a.preventDefault(), a.stopImmediatePropagation(), Na(e);
|
|
1129
1129
|
return;
|
|
1130
1130
|
}
|
|
1131
1131
|
}
|
|
@@ -1133,17 +1133,17 @@ function Na(e) {
|
|
|
1133
1133
|
if (a.key !== "Escape" || a.defaultPrevented || n.guard.ownsKey(a)) return;
|
|
1134
1134
|
const s = n.layers.at(-1);
|
|
1135
1135
|
if (!s?.options.onEscape) return;
|
|
1136
|
-
const r = a.composedPath(), c =
|
|
1136
|
+
const r = a.composedPath(), c = Nn(s);
|
|
1137
1137
|
if (Mn(r, c)) return;
|
|
1138
1138
|
const l = r.find((u) => u instanceof Element && u.hasAttribute(Co));
|
|
1139
|
-
l && !
|
|
1139
|
+
l && !Fn([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
1145
|
function La(e, t) {
|
|
1146
|
-
const n = Pt.get(e) ??
|
|
1146
|
+
const n = Pt.get(e) ?? Fa(e);
|
|
1147
1147
|
Pt.set(e, n);
|
|
1148
1148
|
const o = { options: t, disposed: !1 };
|
|
1149
1149
|
return n.layers.push(o), {
|
|
@@ -1169,7 +1169,7 @@ function Da(e, t, n) {
|
|
|
1169
1169
|
});
|
|
1170
1170
|
s(() => c.dispose());
|
|
1171
1171
|
}, { immediate: !0, flush: "sync" });
|
|
1172
|
-
return
|
|
1172
|
+
return Xo() && no(o), o;
|
|
1173
1173
|
}
|
|
1174
1174
|
const wo = 2, Wa = 4, zt = 20, Ba = 2, Oa = 5, lt = 16;
|
|
1175
1175
|
function Va(e, t, n) {
|
|
@@ -1281,8 +1281,8 @@ function $a(e) {
|
|
|
1281
1281
|
"pointer-events": "none"
|
|
1282
1282
|
};
|
|
1283
1283
|
}
|
|
1284
|
-
const
|
|
1285
|
-
class
|
|
1284
|
+
const qa = (e, t) => !!e && !!t && e[0] === t[0] && e[1] === t[1];
|
|
1285
|
+
class Xa {
|
|
1286
1286
|
session;
|
|
1287
1287
|
options;
|
|
1288
1288
|
mode = "edit";
|
|
@@ -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 && qa(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" };
|
|
@@ -1406,7 +1406,7 @@ class qa {
|
|
|
1406
1406
|
function Ya(e) {
|
|
1407
1407
|
const t = ce(1);
|
|
1408
1408
|
let n = null;
|
|
1409
|
-
const o = new
|
|
1409
|
+
const o = new Xa({
|
|
1410
1410
|
validate: (u, h) => {
|
|
1411
1411
|
const m = e.columnAt(u[0]);
|
|
1412
1412
|
return m && e.validate ? e.validate(u, m, h) : null;
|
|
@@ -2076,7 +2076,7 @@ class hs {
|
|
|
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, X.Checkbox, !R);
|
|
2080
2080
|
};
|
|
2081
2081
|
switch (r) {
|
|
2082
2082
|
case x.ColumnHeader: {
|
|
@@ -2166,9 +2166,9 @@ const ms = (e, t, n) => {
|
|
|
2166
2166
|
const o = 10 ** n;
|
|
2167
2167
|
return Math.round(e * o) / o;
|
|
2168
2168
|
}, On = 20, Mt = {
|
|
2169
|
-
drag:
|
|
2170
|
-
expand:
|
|
2171
|
-
checkbox:
|
|
2169
|
+
drag: X.Drag,
|
|
2170
|
+
expand: X.Expand,
|
|
2171
|
+
checkbox: X.Checkbox
|
|
2172
2172
|
}, Cs = {
|
|
2173
2173
|
none: $.None,
|
|
2174
2174
|
cell: $.Cell,
|
|
@@ -2242,7 +2242,7 @@ class Is {
|
|
|
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 === X.Expand && this.hooks.rowExpand(i);
|
|
2246
2246
|
}
|
|
2247
2247
|
}), this.resize = new as({
|
|
2248
2248
|
coordInstance: () => this.coord,
|
|
@@ -2479,7 +2479,7 @@ class Is {
|
|
|
2479
2479
|
/** Returns true when the press belongs to the grid (the host then claims focus). */
|
|
2480
2480
|
pointerDown(t) {
|
|
2481
2481
|
const n = { x: t.x, y: t.y }, o = this.hitTest(n);
|
|
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 =
|
|
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 = qe(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);
|
|
2483
2483
|
}
|
|
2484
2484
|
/** Hover and gestures. `fromAutoScroll` re-derives the head after an auto-scroll tick. */
|
|
2485
2485
|
pointerMove(t, n = !1) {
|
|
@@ -2793,7 +2793,7 @@ const Ps = () => {
|
|
|
2793
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 = {
|
|
2794
2794
|
role: "row",
|
|
2795
2795
|
"aria-rowindex": "1"
|
|
2796
|
-
},
|
|
2796
|
+
}, Ns = ["id", "aria-colindex"], Fs = { 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 = {
|
|
2797
2797
|
key: 1,
|
|
2798
2798
|
role: "status",
|
|
2799
2799
|
class: "sr-only"
|
|
@@ -2801,7 +2801,7 @@ const Ps = () => {
|
|
|
2801
2801
|
key: 2,
|
|
2802
2802
|
"data-ui-grid-overlay": "",
|
|
2803
2803
|
style: { position: "absolute", inset: "0", "pointer-events": "none", "z-index": "3" }
|
|
2804
|
-
}, Ks = 6, _s = 250, $s = 100,
|
|
2804
|
+
}, Ks = 6, _s = 250, $s = 100, qs = 800, Xs = 300, Ys = 300, Nr = /* @__PURE__ */ Yo({
|
|
2805
2805
|
__name: "GridHost",
|
|
2806
2806
|
props: {
|
|
2807
2807
|
columns: {},
|
|
@@ -2837,7 +2837,7 @@ const Ps = () => {
|
|
|
2837
2837
|
setup(e, { expose: t, emit: n }) {
|
|
2838
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);
|
|
2839
2839
|
let R = Ue.danger;
|
|
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)),
|
|
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)), F = _(() => !o.loading && o.rowCount === 0), M = () => {
|
|
2841
2841
|
const d = o.loading && o.rowCount === 0;
|
|
2842
2842
|
return {
|
|
2843
2843
|
columns: o.columns,
|
|
@@ -2854,7 +2854,7 @@ const Ps = () => {
|
|
|
2854
2854
|
touch: v.value
|
|
2855
2855
|
};
|
|
2856
2856
|
}, E = () => o.loading && o.rowCount === 0;
|
|
2857
|
-
let
|
|
2857
|
+
let N = 0, W, K = null, G = null;
|
|
2858
2858
|
const ke = () => o.editing || L.active, z = new Is(M(), {
|
|
2859
2859
|
render: () => ge(),
|
|
2860
2860
|
selectionChange: (d) => {
|
|
@@ -2925,10 +2925,10 @@ const Ps = () => {
|
|
|
2925
2925
|
}
|
|
2926
2926
|
});
|
|
2927
2927
|
function ge() {
|
|
2928
|
-
|
|
2928
|
+
N || typeof requestAnimationFrame > "u" || (N = requestAnimationFrame(Ye));
|
|
2929
2929
|
}
|
|
2930
2930
|
function Ye() {
|
|
2931
|
-
|
|
2931
|
+
N = 0;
|
|
2932
2932
|
const d = c.value;
|
|
2933
2933
|
if (!d || !K) return;
|
|
2934
2934
|
const f = {
|
|
@@ -2943,7 +2943,7 @@ const Ps = () => {
|
|
|
2943
2943
|
ia(d, K, f, W), W = f, re(d), l.value && (l.value.style.cursor = z.cursor), Le();
|
|
2944
2944
|
}
|
|
2945
2945
|
function ie() {
|
|
2946
|
-
|
|
2946
|
+
N && (cancelAnimationFrame(N), Ye());
|
|
2947
2947
|
}
|
|
2948
2948
|
function re(d) {
|
|
2949
2949
|
const f = Je;
|
|
@@ -2956,7 +2956,7 @@ const Ps = () => {
|
|
|
2956
2956
|
b.save(), b.setTransform(dn, 0, 0, dn, 0, 0), b.beginPath(), b.rect(Z, be, bt - Z, xt - be), b.clip(), b.setLineDash([4, 3]), b.lineWidth = 1, b.strokeStyle = g.value.interactionLineColorHighlight, b.strokeRect(T.x + 0.5, T.y + 0.5, U.x + U.width - T.x - 1, U.y + U.height - T.y - 1), b.restore();
|
|
2957
2957
|
}
|
|
2958
2958
|
const Te = (d) => Math.max(0, Math.min(d.width - 2 * B.cellHorizontalPadding, d.width * 0.6));
|
|
2959
|
-
function
|
|
2959
|
+
function Ne(d, f) {
|
|
2960
2960
|
D(d, {
|
|
2961
2961
|
x: f.x + B.cellHorizontalPadding,
|
|
2962
2962
|
y: f.y + (f.height - 8) / 2,
|
|
@@ -2966,7 +2966,7 @@ const Ps = () => {
|
|
|
2966
2966
|
fill: f.theme.cellBgLoading
|
|
2967
2967
|
});
|
|
2968
2968
|
}
|
|
2969
|
-
function
|
|
2969
|
+
function Fe(d, f, b) {
|
|
2970
2970
|
if (!b) return;
|
|
2971
2971
|
const { fontSizeSM: T, cellTextColor: U } = f.theme;
|
|
2972
2972
|
$e(d, {
|
|
@@ -2993,11 +2993,11 @@ const Ps = () => {
|
|
|
2993
2993
|
isLoading: T
|
|
2994
2994
|
};
|
|
2995
2995
|
if (T) {
|
|
2996
|
-
|
|
2996
|
+
Ne(d, U);
|
|
2997
2997
|
return;
|
|
2998
2998
|
}
|
|
2999
2999
|
const Z = o.cellRenderer?.(b, f.columnIndex);
|
|
3000
|
-
Z ? Z.draw(d, U) :
|
|
3000
|
+
Z ? Z.draw(d, U) : Fe(d, U, o.getCellText(U.cell));
|
|
3001
3001
|
}
|
|
3002
3002
|
function Ie(d, f) {
|
|
3003
3003
|
const b = f.column ? o.columns.find((T) => T.id === f.column?.id) : void 0;
|
|
@@ -3026,13 +3026,13 @@ const Ps = () => {
|
|
|
3026
3026
|
const f = l.value, b = G;
|
|
3027
3027
|
return d.clientX - b.left >= f.clientWidth || d.clientY - b.top >= f.clientHeight;
|
|
3028
3028
|
}
|
|
3029
|
-
let le = null,
|
|
3030
|
-
const Qe = () => typeof performance > "u" ? Date.now() : performance.now(), Qt = () =>
|
|
3029
|
+
let le = null, q = null, Yt = -1 / 0, jt = -1 / 0, je = !1;
|
|
3030
|
+
const Qe = () => typeof performance > "u" ? Date.now() : performance.now(), Qt = () => q != null || Qe() - Yt < qs;
|
|
3031
3031
|
function Ze() {
|
|
3032
|
-
|
|
3032
|
+
q && clearTimeout(q.timer), q = null, Yt = Qe();
|
|
3033
3033
|
}
|
|
3034
3034
|
function Io(d) {
|
|
3035
|
-
if (
|
|
3035
|
+
if (q) {
|
|
3036
3036
|
Ze();
|
|
3037
3037
|
return;
|
|
3038
3038
|
}
|
|
@@ -3043,20 +3043,20 @@ const Ps = () => {
|
|
|
3043
3043
|
flingStop: Qe() - jt < $s,
|
|
3044
3044
|
longPressed: !1,
|
|
3045
3045
|
timer: setTimeout(() => {
|
|
3046
|
-
|
|
3046
|
+
q !== f || f.flingStop || ke() || (f.longPressed = !0, z.longPress(ae(d)), ie());
|
|
3047
3047
|
}, _s)
|
|
3048
3048
|
};
|
|
3049
|
-
|
|
3049
|
+
q = f;
|
|
3050
3050
|
}
|
|
3051
3051
|
function Po(d) {
|
|
3052
|
-
const f =
|
|
3052
|
+
const f = q;
|
|
3053
3053
|
!f || f.id !== d.pointerId || Math.hypot(d.clientX - f.x, d.clientY - f.y) > Ks && Ze();
|
|
3054
3054
|
}
|
|
3055
3055
|
function zo(d) {
|
|
3056
|
-
const f =
|
|
3056
|
+
const f = q;
|
|
3057
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(() => {
|
|
3058
3058
|
le = null, z.clearTapFeedback();
|
|
3059
|
-
},
|
|
3059
|
+
}, Xs))));
|
|
3060
3060
|
}
|
|
3061
3061
|
function Mo(d) {
|
|
3062
3062
|
if (G = r.value.getBoundingClientRect(), d.pointerType === "touch") {
|
|
@@ -3100,7 +3100,7 @@ const Ps = () => {
|
|
|
3100
3100
|
}
|
|
3101
3101
|
function Zt(d) {
|
|
3102
3102
|
if (d.pointerType === "touch") {
|
|
3103
|
-
|
|
3103
|
+
q?.id === d.pointerId && Ze();
|
|
3104
3104
|
return;
|
|
3105
3105
|
}
|
|
3106
3106
|
z.cancelGesture(), ie();
|
|
@@ -3111,14 +3111,14 @@ const Ps = () => {
|
|
|
3111
3111
|
function To(d) {
|
|
3112
3112
|
ke() || Qt() || z.doubleClick(ae(d));
|
|
3113
3113
|
}
|
|
3114
|
-
function
|
|
3114
|
+
function No(d) {
|
|
3115
3115
|
if (Qt()) {
|
|
3116
3116
|
d.preventDefault();
|
|
3117
3117
|
return;
|
|
3118
3118
|
}
|
|
3119
3119
|
G = r.value.getBoundingClientRect(), z.contextMenu(ae(d)) && (d.preventDefault(), Pe());
|
|
3120
3120
|
}
|
|
3121
|
-
function
|
|
3121
|
+
function Fo() {
|
|
3122
3122
|
const d = l.value;
|
|
3123
3123
|
d && (G = null, jt = Qe(), z.setScroll(d.scrollLeft, d.scrollTop));
|
|
3124
3124
|
}
|
|
@@ -3161,7 +3161,7 @@ const Ps = () => {
|
|
|
3161
3161
|
fe && clearTimeout(fe), fe = null, h.value && !L.active && (h.value.value = "");
|
|
3162
3162
|
}
|
|
3163
3163
|
function pt(d, f, b, T) {
|
|
3164
|
-
T && (Je =
|
|
3164
|
+
T && (Je = qe(d, ft()), ge()), i("clipboard-copy", { block: f, cellCount: za(f), cut: b, ok: T }), T && b && !o.readonly && i("clear-request", d);
|
|
3165
3165
|
}
|
|
3166
3166
|
function en(d, f) {
|
|
3167
3167
|
const b = z.getSelection(), T = po(b, ft());
|
|
@@ -3249,7 +3249,7 @@ const Ps = () => {
|
|
|
3249
3249
|
}
|
|
3250
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();
|
|
3251
3251
|
}), Zo(() => {
|
|
3252
|
-
|
|
3252
|
+
N && cancelAnimationFrame(N), Se && clearTimeout(Se), wt?.disconnect(), vt?.disconnect(), St?.removeEventListener?.("change", ye), We?.removeEventListener?.("change", an), q && clearTimeout(q.timer), le && clearTimeout(le), z.dispose(), fe && clearTimeout(fe), on(), K = null;
|
|
3253
3253
|
});
|
|
3254
3254
|
const Y = _(() => S.value.activeCell), Uo = _(() => Y.value ? o.columns[Y.value[0]] : void 0), Ko = _(() => {
|
|
3255
3255
|
const d = Y.value;
|
|
@@ -3265,7 +3265,7 @@ const Ps = () => {
|
|
|
3265
3265
|
theme: g.value,
|
|
3266
3266
|
dangerColor: R,
|
|
3267
3267
|
textBox: I.value
|
|
3268
|
-
})),
|
|
3268
|
+
})), qo = _(() => Ka(et.value)), un = _(() => j.value.active ? vo(et.value) : k.value), tt = _(() => {
|
|
3269
3269
|
if (y.value, j.value.active) return j.value.error;
|
|
3270
3270
|
const d = S.value.activeCell, f = d && o.cellStatus ? o.cellStatus(d) : null;
|
|
3271
3271
|
return f?.state === "error" ? f.message : null;
|
|
@@ -3317,7 +3317,7 @@ const Ps = () => {
|
|
|
3317
3317
|
"data-ui-grid-scroller": "",
|
|
3318
3318
|
"aria-hidden": "true",
|
|
3319
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" },
|
|
3320
|
-
onScrollPassive:
|
|
3320
|
+
onScrollPassive: Fo,
|
|
3321
3321
|
onPointerdown: Mo,
|
|
3322
3322
|
onPointermove: Ao,
|
|
3323
3323
|
onPointerup: Eo,
|
|
@@ -3325,7 +3325,7 @@ const Ps = () => {
|
|
|
3325
3325
|
onLostpointercapture: Zt,
|
|
3326
3326
|
onPointerleave: Ho,
|
|
3327
3327
|
onDblclick: To,
|
|
3328
|
-
onContextmenu:
|
|
3328
|
+
onContextmenu: No
|
|
3329
3329
|
}, [
|
|
3330
3330
|
ee("div", {
|
|
3331
3331
|
style: Be({ width: `${p.value.width}px`, height: `${p.value.height}px` })
|
|
@@ -3339,10 +3339,10 @@ const Ps = () => {
|
|
|
3339
3339
|
role: "columnheader",
|
|
3340
3340
|
class: "sr-only",
|
|
3341
3341
|
"aria-colindex": T + 1
|
|
3342
|
-
}, we(b.name), 9,
|
|
3342
|
+
}, we(b.name), 9, Ns))), 128))
|
|
3343
3343
|
])
|
|
3344
3344
|
]),
|
|
3345
|
-
ee("div",
|
|
3345
|
+
ee("div", Fs, [
|
|
3346
3346
|
ee("div", {
|
|
3347
3347
|
role: "row",
|
|
3348
3348
|
"aria-rowindex": Y.value ? Y.value[1] + 2 : 2,
|
|
@@ -3380,7 +3380,7 @@ const Ps = () => {
|
|
|
3380
3380
|
autocapitalize: "off",
|
|
3381
3381
|
spellcheck: "false",
|
|
3382
3382
|
rows: "1",
|
|
3383
|
-
style: Be(
|
|
3383
|
+
style: Be(qo.value),
|
|
3384
3384
|
onKeydown: Lo,
|
|
3385
3385
|
onCompositionstart: Vo,
|
|
3386
3386
|
onCompositionend: Go,
|
|
@@ -3404,7 +3404,7 @@ const Ps = () => {
|
|
|
3404
3404
|
], 8, Ws)
|
|
3405
3405
|
], 8, Ls)
|
|
3406
3406
|
]),
|
|
3407
|
-
|
|
3407
|
+
F.value ? (pe(), Ce("div", {
|
|
3408
3408
|
key: 0,
|
|
3409
3409
|
"data-ui-grid-empty": "",
|
|
3410
3410
|
style: Be([{ top: `${P.value}px` }, { position: "absolute", left: "0", right: "0", bottom: "0", display: "flex", "align-items": "center", "justify-content": "center", overflow: "hidden", color: "var(--ui-text-muted)", "font-size": "var(--ui-font-size)", "pointer-events": "none", "z-index": "1" }])
|
|
@@ -3542,7 +3542,7 @@ const _e = 4, Re = 6, er = 4, Ae = 4, he = (e, t, n, o = "") => {
|
|
|
3542
3542
|
const a = o;
|
|
3543
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();
|
|
3544
3544
|
};
|
|
3545
|
-
class
|
|
3545
|
+
class qt {
|
|
3546
3546
|
cache = new ct(200);
|
|
3547
3547
|
set(t, n) {
|
|
3548
3548
|
this.cache.set(t, n);
|
|
@@ -3554,7 +3554,7 @@ class Xt {
|
|
|
3554
3554
|
this.cache.clear();
|
|
3555
3555
|
}
|
|
3556
3556
|
}
|
|
3557
|
-
const
|
|
3557
|
+
const Xe = (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) => {
|
|
3558
3558
|
if (!Number.isFinite(e) || Math.abs(e) <= Number.MAX_SAFE_INTEGER) return e.toFixed(t);
|
|
3559
3559
|
const n = String(e), o = n.includes("e") ? "" : "0".repeat(t);
|
|
3560
3560
|
return o ? `${n}.${o}` : n;
|
|
@@ -3566,7 +3566,7 @@ const qe = (e, t) => e.x >= t.x && e.x < t.x + t.width && e.y >= t.y && e.y < t.
|
|
|
3566
3566
|
return s + a + r;
|
|
3567
3567
|
}
|
|
3568
3568
|
return t.type === "percent" ? `${$n(o * 100, i)}%` : $n(o, i);
|
|
3569
|
-
},
|
|
3569
|
+
}, Fr = (e, t) => {
|
|
3570
3570
|
if (e == null || e === "") return null;
|
|
3571
3571
|
const n = String(e), o = t?.type === "percent" || n.includes("%"), i = n.replace(/[^\d.+-]/g, "").replace(/([+\-.])+/g, "$1"), a = Number.parseFloat(i);
|
|
3572
3572
|
return Number.isNaN(a) ? null : o ? a / 100 : a;
|
|
@@ -3593,24 +3593,24 @@ const qe = (e, t) => e.x >= t.x && e.x < t.x + t.width && e.y >= t.y && e.y < t.
|
|
|
3593
3593
|
me(e, t, n.text, { color: t.cellTheme.textMuted, align: n.align === "end" ? "right" : "left" });
|
|
3594
3594
|
},
|
|
3595
3595
|
describe: (e) => e.text
|
|
3596
|
-
},
|
|
3596
|
+
}, qn = (e, t) => e.text ?? ar(e.value, e.format, t), dr = {
|
|
3597
3597
|
draw: (e, t, n) => {
|
|
3598
|
-
me(e, t,
|
|
3598
|
+
me(e, t, qn(n, t.locale), { align: "right" });
|
|
3599
3599
|
},
|
|
3600
|
-
describe: (e, t) =>
|
|
3601
|
-
},
|
|
3600
|
+
describe: (e, t) => qn(e, t.locale)
|
|
3601
|
+
}, Xn = (e, t, n) => {
|
|
3602
3602
|
const o = n.icon;
|
|
3603
3603
|
return { x: e - n.padding - o, y: (t - o) / 2, width: o, height: o };
|
|
3604
3604
|
}, hr = {
|
|
3605
3605
|
draw: (e, t, n) => {
|
|
3606
|
-
const { metrics: o, cellTheme: i } = t, a =
|
|
3606
|
+
const { metrics: o, cellTheme: i } = t, a = Xn(t.width, t.height, o);
|
|
3607
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));
|
|
3608
3608
|
},
|
|
3609
3609
|
describe: (e) => e.text,
|
|
3610
3610
|
hitTest: (e, { point: t, size: n, metrics: o }) => {
|
|
3611
3611
|
if (!e.text || !e.href) return null;
|
|
3612
|
-
const i =
|
|
3613
|
-
return
|
|
3612
|
+
const i = Xn(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) };
|
|
3613
|
+
return Xe(t, a) ? { action: { type: "open-url", href: e.href }, area: a } : null;
|
|
3614
3614
|
}
|
|
3615
3615
|
}, Yn = (e, t, n) => {
|
|
3616
3616
|
const o = n.icon;
|
|
@@ -3633,7 +3633,7 @@ const qe = (e, t) => e.x >= t.x && e.x < t.x + t.width && e.y >= t.y && e.y < t.
|
|
|
3633
3633
|
hitTest: (e, { point: t, size: n, metrics: o }) => {
|
|
3634
3634
|
if (e.readonly) return null;
|
|
3635
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
|
|
3636
|
+
return Xe(t, a) ? { action: jn(e), area: a } : null;
|
|
3637
3637
|
},
|
|
3638
3638
|
keyAction: (e, t) => !e.readonly && (t === "Enter" || t === " ") ? jn(e) : null
|
|
3639
3639
|
}, At = 2, st = (e) => Math.max(1, Math.min(10, Math.round(e.max ?? 5))), gr = {
|
|
@@ -3648,7 +3648,7 @@ const qe = (e, t) => e.x >= t.x && e.x < t.x + t.width && e.y >= t.y && e.y < t.
|
|
|
3648
3648
|
hitTest: (e, { point: t, size: n, metrics: o }) => {
|
|
3649
3649
|
if (e.readonly) return null;
|
|
3650
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) };
|
|
3651
|
-
if (!
|
|
3651
|
+
if (!Xe(t, s)) return null;
|
|
3652
3652
|
const r = Math.min(a, Math.max(1, Math.ceil((t.x - o.padding) / i)));
|
|
3653
3653
|
return { action: { type: "update", value: r !== e.value ? r : null }, area: s };
|
|
3654
3654
|
},
|
|
@@ -3660,7 +3660,7 @@ const qe = (e, t) => e.x >= t.x && e.x < t.x + t.width && e.y >= t.y && e.y < t.
|
|
|
3660
3660
|
const n = Math.min(st(e), Number(t));
|
|
3661
3661
|
return { type: "update", value: n === 0 || n === e.value ? null : n };
|
|
3662
3662
|
}
|
|
3663
|
-
}, He = (e, t, n) => `${e}|${t.width}|${t.metrics.rowHeight}|${n.join("\0")}`,
|
|
3663
|
+
}, He = (e, t, n) => `${e}|${t.width}|${t.metrics.rowHeight}|${n.join("\0")}`, Ft = new qt(), Ro = (e, t, n) => {
|
|
3664
3664
|
const { metrics: o, theme: i } = t;
|
|
3665
3665
|
if (!n.length) return [];
|
|
3666
3666
|
he(e, o.chipFontSize, i.fontFamily);
|
|
@@ -3679,13 +3679,13 @@ const qe = (e, t) => e.x >= t.x && e.x < t.x + t.width && e.y >= t.y && e.y < t.
|
|
|
3679
3679
|
}, pr = {
|
|
3680
3680
|
draw: (e, t, n) => {
|
|
3681
3681
|
const o = { fill: t.cellTheme.badgeFill, color: t.cellTheme.text }, i = Ro(e, t, n.records.map((a) => ({ label: a.label, colors: o })));
|
|
3682
|
-
|
|
3682
|
+
Ft.set(He("link", t, n.records.map((a) => a.id)), i);
|
|
3683
3683
|
},
|
|
3684
3684
|
describe: (e) => dt(e.records.map((t) => t.label)),
|
|
3685
|
-
hitTest: (e, t) => ko(
|
|
3686
|
-
},
|
|
3685
|
+
hitTest: (e, t) => ko(Ft.get(He("link", Xt(t), e.records.map((n) => n.id))), t, (n) => ({ type: "open-record", id: e.records[n].id }))
|
|
3686
|
+
}, Xt = (e) => ({ width: e.size.width, metrics: e.metrics }), ko = (e, t, n, o = !1) => {
|
|
3687
3687
|
if (!t.wasActive && !o || !e) return null;
|
|
3688
|
-
const i = e.findIndex((a) =>
|
|
3688
|
+
const i = e.findIndex((a) => Xe(t.point, a));
|
|
3689
3689
|
return i < 0 ? null : { action: n(i), area: e[i] };
|
|
3690
3690
|
}, Cr = (e, t, n, o, i, a, s) => {
|
|
3691
3691
|
const { cellTheme: r, theme: c } = t, l = s ? t.images.get(s) : void 0;
|
|
@@ -3717,7 +3717,7 @@ const qe = (e, t) => e.x >= t.x && e.x < t.x + t.width && e.y >= t.y && e.y < t.
|
|
|
3717
3717
|
}, Qn = (e) => {
|
|
3718
3718
|
const t = /\.([\p{L}\p{N}]{1,5})$/u.exec(e);
|
|
3719
3719
|
return t ? t[1].toUpperCase() : "";
|
|
3720
|
-
}, Lt = new
|
|
3720
|
+
}, Lt = new qt(), vr = {
|
|
3721
3721
|
draw: (e, t, n) => {
|
|
3722
3722
|
const { metrics: o, cellTheme: i, theme: a } = t;
|
|
3723
3723
|
if (!n.files.length) return;
|
|
@@ -3732,7 +3732,7 @@ const qe = (e, t) => e.x >= t.x && e.x < t.x + t.width && e.y >= t.y && e.y < t.
|
|
|
3732
3732
|
}), l.more > 0 && $t(e, t, h, l.more, l.badgeWidth), Lt.set(He("attachment", t, n.files.map((g) => g.id)), m);
|
|
3733
3733
|
},
|
|
3734
3734
|
describe: (e) => dt(e.files.map((t) => t.name)),
|
|
3735
|
-
hitTest: (e, t) => ko(Lt.get(He("attachment",
|
|
3735
|
+
hitTest: (e, t) => ko(Lt.get(He("attachment", Xt(t), e.files.map((n) => n.id))), t, (n) => ({ type: "open-attachment", id: e.files[n].id }), !0)
|
|
3736
3736
|
}, Zn = (e) => `${Math.round(Math.max(0, Math.min(1, e)) * 100)}%`, Sr = {
|
|
3737
3737
|
draw: (e, t, n) => {
|
|
3738
3738
|
if (n.value == null) return;
|
|
@@ -3740,7 +3740,7 @@ const qe = (e, t) => e.x >= t.x && e.x < t.x + t.width && e.y >= t.y && e.y < t.
|
|
|
3740
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 });
|
|
3741
3741
|
},
|
|
3742
3742
|
describe: (e) => e.value == null ? "" : Zn(e.value)
|
|
3743
|
-
}, Et = 10, Dt = new
|
|
3743
|
+
}, Et = 10, Dt = new qt(), yr = {
|
|
3744
3744
|
draw: (e, t, n) => {
|
|
3745
3745
|
const { metrics: o, cellTheme: i, theme: a } = t;
|
|
3746
3746
|
if (!n.label) return;
|
|
@@ -3751,8 +3751,8 @@ const qe = (e, t) => e.x >= t.x && e.x < t.x + t.width && e.y >= t.y && e.y < t.
|
|
|
3751
3751
|
describe: (e) => e.label,
|
|
3752
3752
|
hitTest: (e, t) => {
|
|
3753
3753
|
if (e.disabled || !e.label) return null;
|
|
3754
|
-
const n = Dt.get(He("button",
|
|
3755
|
-
return n &&
|
|
3754
|
+
const n = Dt.get(He("button", Xt(t), [e.label]))?.[0];
|
|
3755
|
+
return n && Xe(t.point, n) ? { action: { type: "press" }, area: n } : null;
|
|
3756
3756
|
},
|
|
3757
3757
|
keyAction: (e, t) => !e.disabled && (t === "Enter" || t === " ") ? { type: "press" } : null
|
|
3758
3758
|
}, Jn = 4, br = {
|
|
@@ -3771,7 +3771,7 @@ const qe = (e, t) => e.x >= t.x && e.x < t.x + t.width && e.y >= t.y && e.y < t.
|
|
|
3771
3771
|
button: yr,
|
|
3772
3772
|
derived: ur
|
|
3773
3773
|
}, Lr = () => {
|
|
3774
|
-
|
|
3774
|
+
Ft.clear(), Lt.clear(), Dt.clear();
|
|
3775
3775
|
}, xr = 6, Rr = (e, t, n, o) => {
|
|
3776
3776
|
if (e.save(), n === "pending") {
|
|
3777
3777
|
const i = xr / 2, a = t.x + t.width - 3 - i, s = t.y + 3 + i;
|
|
@@ -3830,7 +3830,7 @@ const qe = (e, t) => e.x >= t.x && e.x < t.x + t.width && e.y >= t.y && e.y < t.
|
|
|
3830
3830
|
if (!k || I.kind !== "cells" || !eo(I.ranges[0], I.ranges[1])) return;
|
|
3831
3831
|
const P = y.currentTarget?.querySelector("[data-ui-grid]"), A = R.getCellRect(k);
|
|
3832
3832
|
if (!P || !A) return;
|
|
3833
|
-
const
|
|
3833
|
+
const F = P.getBoundingClientRect(), M = { x: y.clientX - F.left - A.x, y: y.clientY - F.top - A.y };
|
|
3834
3834
|
if (M.x < 0 || M.y < 0 || M.x >= A.width || M.y >= A.height) return;
|
|
3835
3835
|
const E = g(k, M, A, eo(v, k));
|
|
3836
3836
|
E && w(E.action, k);
|
|
@@ -4107,7 +4107,16 @@ const qe = (e, t) => e.x >= t.x && e.x < t.x + t.width && e.y >= t.y && e.y < t.
|
|
|
4107
4107
|
"Not checked": "Not checked",
|
|
4108
4108
|
"Rating {value} of {max}": "Rating {value} of {max}",
|
|
4109
4109
|
Saving: "Saving",
|
|
4110
|
-
"Not saved": "Not saved"
|
|
4110
|
+
"Not saved": "Not saved",
|
|
4111
|
+
"Choose tags": "Choose tags",
|
|
4112
|
+
"Choose a tag": "Choose a tag",
|
|
4113
|
+
"Search tags": "Search tags",
|
|
4114
|
+
'Create "{name}"': 'Create "{name}"',
|
|
4115
|
+
"No matching tags": "No matching tags",
|
|
4116
|
+
"Loading tags": "Loading tags",
|
|
4117
|
+
"At most {max} tags": "At most {max} tags",
|
|
4118
|
+
"Expand all": "Expand all",
|
|
4119
|
+
"Collapse all": "Collapse all"
|
|
4111
4120
|
}, Pr = {
|
|
4112
4121
|
en: Ir,
|
|
4113
4122
|
"zh-TW": {
|
|
@@ -4372,7 +4381,16 @@ const qe = (e, t) => e.x >= t.x && e.x < t.x + t.width && e.y >= t.y && e.y < t.
|
|
|
4372
4381
|
"Not checked": "未勾選",
|
|
4373
4382
|
"Rating {value} of {max}": "評分 {value}/{max}",
|
|
4374
4383
|
Saving: "儲存中",
|
|
4375
|
-
"Not saved": "未儲存"
|
|
4384
|
+
"Not saved": "未儲存",
|
|
4385
|
+
"Choose tags": "選擇標籤",
|
|
4386
|
+
"Choose a tag": "選擇一個標籤",
|
|
4387
|
+
"Search tags": "搜尋標籤",
|
|
4388
|
+
'Create "{name}"': "建立「{name}」",
|
|
4389
|
+
"No matching tags": "沒有符合的標籤",
|
|
4390
|
+
"Loading tags": "正在讀取標籤",
|
|
4391
|
+
"At most {max} tags": "最多 {max} 個標籤",
|
|
4392
|
+
"Expand all": "全部展開",
|
|
4393
|
+
"Collapse all": "全部收合"
|
|
4376
4394
|
},
|
|
4377
4395
|
"zh-CN": {
|
|
4378
4396
|
"{count} failed": "{count} 个失败",
|
|
@@ -4636,7 +4654,16 @@ const qe = (e, t) => e.x >= t.x && e.x < t.x + t.width && e.y >= t.y && e.y < t.
|
|
|
4636
4654
|
"Not checked": "未勾选",
|
|
4637
4655
|
"Rating {value} of {max}": "评分 {value}/{max}",
|
|
4638
4656
|
Saving: "保存中",
|
|
4639
|
-
"Not saved": "未保存"
|
|
4657
|
+
"Not saved": "未保存",
|
|
4658
|
+
"Choose tags": "选择标签",
|
|
4659
|
+
"Choose a tag": "选择一个标签",
|
|
4660
|
+
"Search tags": "搜索标签",
|
|
4661
|
+
'Create "{name}"': "创建“{name}”",
|
|
4662
|
+
"No matching tags": "没有匹配的标签",
|
|
4663
|
+
"Loading tags": "正在读取标签",
|
|
4664
|
+
"At most {max} tags": "最多 {max} 个标签",
|
|
4665
|
+
"Expand all": "全部展开",
|
|
4666
|
+
"Collapse all": "全部折叠"
|
|
4640
4667
|
},
|
|
4641
4668
|
ja: {
|
|
4642
4669
|
"{count} failed": "{count} 件失敗",
|
|
@@ -4900,7 +4927,16 @@ const qe = (e, t) => e.x >= t.x && e.x < t.x + t.width && e.y >= t.y && e.y < t.
|
|
|
4900
4927
|
"Not checked": "チェックなし",
|
|
4901
4928
|
"Rating {value} of {max}": "評価 {value}/{max}",
|
|
4902
4929
|
Saving: "保存中",
|
|
4903
|
-
"Not saved": "保存されていません"
|
|
4930
|
+
"Not saved": "保存されていません",
|
|
4931
|
+
"Choose tags": "タグを選択",
|
|
4932
|
+
"Choose a tag": "タグを 1 つ選択",
|
|
4933
|
+
"Search tags": "タグを検索",
|
|
4934
|
+
'Create "{name}"': "「{name}」を作成",
|
|
4935
|
+
"No matching tags": "一致するタグはありません",
|
|
4936
|
+
"Loading tags": "タグを読み込んでいます",
|
|
4937
|
+
"At most {max} tags": "タグは最大 {max} 個です",
|
|
4938
|
+
"Expand all": "すべて展開",
|
|
4939
|
+
"Collapse all": "すべて折りたたむ"
|
|
4904
4940
|
},
|
|
4905
4941
|
ko: {
|
|
4906
4942
|
"{count} failed": "{count}개 실패",
|
|
@@ -5164,7 +5200,16 @@ const qe = (e, t) => e.x >= t.x && e.x < t.x + t.width && e.y >= t.y && e.y < t.
|
|
|
5164
5200
|
"Not checked": "선택 안 됨",
|
|
5165
5201
|
"Rating {value} of {max}": "평점 {value}/{max}",
|
|
5166
5202
|
Saving: "저장 중",
|
|
5167
|
-
"Not saved": "저장되지 않음"
|
|
5203
|
+
"Not saved": "저장되지 않음",
|
|
5204
|
+
"Choose tags": "태그 선택",
|
|
5205
|
+
"Choose a tag": "태그 하나 선택",
|
|
5206
|
+
"Search tags": "태그 검색",
|
|
5207
|
+
'Create "{name}"': '"{name}" 만들기',
|
|
5208
|
+
"No matching tags": "일치하는 태그가 없습니다",
|
|
5209
|
+
"Loading tags": "태그를 읽는 중",
|
|
5210
|
+
"At most {max} tags": "태그는 최대 {max}개입니다",
|
|
5211
|
+
"Expand all": "모두 펼치기",
|
|
5212
|
+
"Collapse all": "모두 접기"
|
|
5168
5213
|
},
|
|
5169
5214
|
de: {
|
|
5170
5215
|
"{count} failed": "{count} fehlgeschlagen",
|
|
@@ -5428,7 +5473,16 @@ const qe = (e, t) => e.x >= t.x && e.x < t.x + t.width && e.y >= t.y && e.y < t.
|
|
|
5428
5473
|
"Not checked": "Nicht aktiviert",
|
|
5429
5474
|
"Rating {value} of {max}": "Bewertung {value} von {max}",
|
|
5430
5475
|
Saving: "Wird gespeichert",
|
|
5431
|
-
"Not saved": "Nicht gespeichert"
|
|
5476
|
+
"Not saved": "Nicht gespeichert",
|
|
5477
|
+
"Choose tags": "Tags auswählen",
|
|
5478
|
+
"Choose a tag": "Tag auswählen",
|
|
5479
|
+
"Search tags": "Tags suchen",
|
|
5480
|
+
'Create "{name}"': "„{name}“ erstellen",
|
|
5481
|
+
"No matching tags": "Keine passenden Tags",
|
|
5482
|
+
"Loading tags": "Tags werden gelesen",
|
|
5483
|
+
"At most {max} tags": "Höchstens {max} Tags",
|
|
5484
|
+
"Expand all": "Alle aufklappen",
|
|
5485
|
+
"Collapse all": "Alle zuklappen"
|
|
5432
5486
|
},
|
|
5433
5487
|
fr: {
|
|
5434
5488
|
"{count} failed": "{count} en échec",
|
|
@@ -5692,7 +5746,16 @@ const qe = (e, t) => e.x >= t.x && e.x < t.x + t.width && e.y >= t.y && e.y < t.
|
|
|
5692
5746
|
"Not checked": "Non coché",
|
|
5693
5747
|
"Rating {value} of {max}": "Note {value} sur {max}",
|
|
5694
5748
|
Saving: "Enregistrement",
|
|
5695
|
-
"Not saved": "Non enregistré"
|
|
5749
|
+
"Not saved": "Non enregistré",
|
|
5750
|
+
"Choose tags": "Choisir des étiquettes",
|
|
5751
|
+
"Choose a tag": "Choisir une étiquette",
|
|
5752
|
+
"Search tags": "Rechercher des étiquettes",
|
|
5753
|
+
'Create "{name}"': "Créer « {name} »",
|
|
5754
|
+
"No matching tags": "Aucune étiquette correspondante",
|
|
5755
|
+
"Loading tags": "Lecture des étiquettes",
|
|
5756
|
+
"At most {max} tags": "Au plus {max} étiquettes",
|
|
5757
|
+
"Expand all": "Tout développer",
|
|
5758
|
+
"Collapse all": "Tout réduire"
|
|
5696
5759
|
},
|
|
5697
5760
|
es: {
|
|
5698
5761
|
"{count} failed": "{count} con error",
|
|
@@ -5956,7 +6019,16 @@ const qe = (e, t) => e.x >= t.x && e.x < t.x + t.width && e.y >= t.y && e.y < t.
|
|
|
5956
6019
|
"Not checked": "Sin marcar",
|
|
5957
6020
|
"Rating {value} of {max}": "Valoración {value} de {max}",
|
|
5958
6021
|
Saving: "Guardando",
|
|
5959
|
-
"Not saved": "No guardado"
|
|
6022
|
+
"Not saved": "No guardado",
|
|
6023
|
+
"Choose tags": "Elegir etiquetas",
|
|
6024
|
+
"Choose a tag": "Elegir una etiqueta",
|
|
6025
|
+
"Search tags": "Buscar etiquetas",
|
|
6026
|
+
'Create "{name}"': "Crear «{name}»",
|
|
6027
|
+
"No matching tags": "No hay etiquetas que coincidan",
|
|
6028
|
+
"Loading tags": "Cargando etiquetas",
|
|
6029
|
+
"At most {max} tags": "Como máximo {max} etiquetas",
|
|
6030
|
+
"Expand all": "Expandir todo",
|
|
6031
|
+
"Collapse all": "Contraer todo"
|
|
5960
6032
|
},
|
|
5961
6033
|
it: {
|
|
5962
6034
|
"{count} failed": "{count} non riusciti",
|
|
@@ -6220,7 +6292,16 @@ const qe = (e, t) => e.x >= t.x && e.x < t.x + t.width && e.y >= t.y && e.y < t.
|
|
|
6220
6292
|
"Not checked": "Non selezionato",
|
|
6221
6293
|
"Rating {value} of {max}": "Valutazione {value} su {max}",
|
|
6222
6294
|
Saving: "Salvataggio",
|
|
6223
|
-
"Not saved": "Non salvato"
|
|
6295
|
+
"Not saved": "Non salvato",
|
|
6296
|
+
"Choose tags": "Scegli i tag",
|
|
6297
|
+
"Choose a tag": "Scegli un tag",
|
|
6298
|
+
"Search tags": "Cerca tag",
|
|
6299
|
+
'Create "{name}"': "Crea «{name}»",
|
|
6300
|
+
"No matching tags": "Nessun tag corrispondente",
|
|
6301
|
+
"Loading tags": "Caricamento dei tag",
|
|
6302
|
+
"At most {max} tags": "Al massimo {max} tag",
|
|
6303
|
+
"Expand all": "Espandi tutto",
|
|
6304
|
+
"Collapse all": "Comprimi tutto"
|
|
6224
6305
|
}
|
|
6225
6306
|
};
|
|
6226
6307
|
function zr(e, t, n = {}) {
|
|
@@ -6286,11 +6367,11 @@ function Br(e) {
|
|
|
6286
6367
|
export {
|
|
6287
6368
|
ja as GRID_CELL_TOKENS,
|
|
6288
6369
|
Qa as GRID_CHIP_TOKENS,
|
|
6289
|
-
|
|
6370
|
+
Nr as GridHost,
|
|
6290
6371
|
Ar as SAVING_MARK_DELAY_MS,
|
|
6291
6372
|
za as blockCellCount,
|
|
6292
6373
|
Ma as buildPasteProposal,
|
|
6293
|
-
|
|
6374
|
+
qe as cellRange,
|
|
6294
6375
|
Br as cellStatusMark,
|
|
6295
6376
|
Lr as clearGridCellRegions,
|
|
6296
6377
|
Wr as createCellStatusStore,
|
|
@@ -6304,7 +6385,7 @@ export {
|
|
|
6304
6385
|
gs as filledRange,
|
|
6305
6386
|
ar as formatGridNumber,
|
|
6306
6387
|
Dn as gridCellMetrics,
|
|
6307
|
-
|
|
6388
|
+
Fr as parseGridNumber,
|
|
6308
6389
|
va as parseTsv,
|
|
6309
6390
|
ms as planFill,
|
|
6310
6391
|
So as readGridCellTheme,
|