e-virt-table 1.3.1 → 1.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +5 -5
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +315 -261
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +5 -5
- package/dist/index.umd.js.map +1 -1
- package/dist/lib/Body.js +5 -2
- package/dist/lib/Body.js.map +1 -1
- package/dist/lib/Config.d.ts +0 -2
- package/dist/lib/Config.js +0 -7
- package/dist/lib/Config.js.map +1 -1
- package/dist/lib/Context.d.ts +1 -0
- package/dist/lib/Context.js +6 -0
- package/dist/lib/Context.js.map +1 -1
- package/dist/lib/ContextMenu.d.ts +1 -0
- package/dist/lib/ContextMenu.js +30 -6
- package/dist/lib/ContextMenu.js.map +1 -1
- package/dist/lib/DOMTreeMenu.d.ts +1 -0
- package/dist/lib/DOMTreeMenu.js +72 -2
- package/dist/lib/DOMTreeMenu.js.map +1 -1
- package/dist/lib/Editor.js +2 -2
- package/dist/lib/Editor.js.map +1 -1
- package/dist/lib/EventTable.js +0 -2
- package/dist/lib/EventTable.js.map +1 -1
- package/dist/lib/Header.js +16 -6
- package/dist/lib/Header.js.map +1 -1
- package/dist/lib/util.js +1 -1
- package/dist/lib/util.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(":root{--evt-header-font: 12px normal Arial;--evt-body-font: 12px normal Arial;--evt-color-white: #fff;--evt-color-black: #000000;--evt-color-primary: rgb(82, 146, 247);--evt-text-color-primary: #333;--evt-text-color-regular: #666;--evt-text-color-secondary: #999;--evt-box-shadow: 0 2px 12px 0 #0000001a;--evt-editor-bg-color: #fff;--evt-editor-text-color: #333;--evt-border-color: #e1e6eb;--evt-stripe-color: #fafafa;--evt-placeholder-color: #cdd0dc;--evt-header-bg-color: #f8faff;--evt-body-bg-color: #fff;--evt-header-text-color: #1d2129;--evt-body-text-color: #4e5969;--evt-footer-text-color: #4e5969;--evt-loading-icon-color: #4e5969;--evt-expand-icon-color: #4e5969;--evt-shrink-icon-color: #4e5969;--evt-error-tip-icon-color: red;--evt-required-color: #f56c6c;--evt-cell-hover-icon-bg-color: #fff;--evt-cell-hover-icon-border-color: #dde0ea;--evt-scroller-color: #dee0e3;--evt-scroller-track-color: #fff;--evt-scroller-focus-color: #bbbec4;--evt-select-border-color: var(--evt-color-primary);--evt-select-area-color: rgba(82, 146, 247, .1);--evt-select-row-col-bg-color: rgba(82, 146, 247, .1);--evt-autofill-point-border-color: #fff;--evt-edit-bg-color: #fcf6ed;--evt-checkbox-color: var(--evt-color-primary);--evt-checkbox-uncheck-color: #dde0ea;--evt-checkbox-disabled-color: #f1f2f4;--evt-checkbox-check-disabled-color: #dde0ea;--evt-icon-edit-color: #4e5969;--evt-icon-select-color: #4e5969;--evt-readonly-color: #fff;--evt-readonly-text-color: var(--evt-body-text-color);--evt-error-tip-color: #ed3f14;--evt-footer-bg-color: #fafafa;--evt-highlight-hover-row-color: rgba(186, 203, 231, .1);--evt-highlight-selected-row-color: rgba(82, 146, 247, .1);--evt-tooltip-bg-color: #303133;--evt-tooltip-text-color: #fff;--evt-resize-row-line-color: #e1e6eb;--evt-resize-column-text-color: #fff;--evt-resize-column-text-bg-color: var(--evt-color-primary);--evt-resize-column-line-color: #e1e6eb;--evt-tree-line-color: #e1e6eb;--evt-sort-icon-color: var(--evt-color-primary);--evt-drag-tip-bg-color: rgba(82, 146, 247, .1);--evt-drag-tip-line-color: var(--evt-color-primary);--evt-context-menu-min-width: 150px;--evt-context-menu-max-width: 220px;--evt-context-menu-item-padding: 8px
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(":root{--evt-header-font: 12px normal Arial;--evt-body-font: 12px normal Arial;--evt-color-white: #fff;--evt-color-black: #000000;--evt-color-primary: rgb(82, 146, 247);--evt-text-color-primary: #333;--evt-text-color-regular: #666;--evt-text-color-secondary: #999;--evt-box-shadow: 0 2px 12px 0 #0000001a;--evt-editor-bg-color: #fff;--evt-editor-text-color: #333;--evt-border-color: #e1e6eb;--evt-stripe-color: #fafafa;--evt-placeholder-color: #cdd0dc;--evt-header-bg-color: #f8faff;--evt-body-bg-color: #fff;--evt-header-text-color: #1d2129;--evt-body-text-color: #4e5969;--evt-footer-text-color: #4e5969;--evt-loading-icon-color: #4e5969;--evt-expand-icon-color: #4e5969;--evt-shrink-icon-color: #4e5969;--evt-error-tip-icon-color: red;--evt-required-color: #f56c6c;--evt-cell-hover-icon-bg-color: #fff;--evt-cell-hover-icon-border-color: #dde0ea;--evt-scroller-color: #dee0e3;--evt-scroller-track-color: #fff;--evt-scroller-focus-color: #bbbec4;--evt-select-border-color: var(--evt-color-primary);--evt-select-area-color: rgba(82, 146, 247, .1);--evt-select-row-col-bg-color: rgba(82, 146, 247, .1);--evt-autofill-point-border-color: #fff;--evt-edit-bg-color: #fcf6ed;--evt-checkbox-color: var(--evt-color-primary);--evt-checkbox-uncheck-color: #dde0ea;--evt-checkbox-disabled-color: #f1f2f4;--evt-checkbox-check-disabled-color: #dde0ea;--evt-icon-edit-color: #4e5969;--evt-icon-select-color: #4e5969;--evt-readonly-color: #fff;--evt-readonly-text-color: var(--evt-body-text-color);--evt-error-tip-color: #ed3f14;--evt-footer-bg-color: #fafafa;--evt-highlight-hover-row-color: rgba(186, 203, 231, .1);--evt-highlight-selected-row-color: rgba(82, 146, 247, .1);--evt-tooltip-bg-color: #303133;--evt-tooltip-text-color: #fff;--evt-resize-row-line-color: #e1e6eb;--evt-resize-column-text-color: #fff;--evt-resize-column-text-bg-color: var(--evt-color-primary);--evt-resize-column-line-color: #e1e6eb;--evt-tree-line-color: #e1e6eb;--evt-sort-icon-color: var(--evt-color-primary);--evt-drag-tip-bg-color: rgba(82, 146, 247, .1);--evt-drag-tip-line-color: var(--evt-color-primary);--evt-context-menu-min-width: 150px;--evt-context-menu-max-width: 220px;--evt-context-menu-item-padding: 8px 12px;--evt-context-menu-bg-color: #fff;--evt-context-menu-text-color: #333;--evt-context-menu-item-hover-text-color: var(--evt-color-primary);--evt-context-menu-item-hover-bg-color: #f5f5f5;--evt-context-menu-text-size: 13px}.dark{--evt-border-color: #363637;--evt-header-bg-color: #141414;--evt-body-bg-color: #141414;--evt-header-text-color: #a3a6ad;--evt-body-text-color: #cfd3dc;--evt-readonly-text-color: #cfd3dc;--evt-footer-text-color: #cfd3dc;--evt-scroller-color: #414243;--evt-scroller-track-color: #141414;--evt-scroller-focus-color: #a3a6ad;--evt-edit-bg-color: #141414;--evt-footer-bg-color: #262727;--evt-autofill-point-border-color: #fff;--evt-editor-bg-color: #434343;--evt-editor-text-color: #cfd3dc;--evt-context-menu-bg-color: #141414;--evt-context-menu-text-color: #cfd3dc;--evt-context-menu-item-hover-text-color: var(--evt-color-primary);--evt-context-menu-item-hover-bg-color: #414243}.e-virt-table-container{position:relative;outline:none}.e-virt-table-stage{position:relative;overflow:hidden;outline:none;box-sizing:border-box;z-index:10;border-radius:8px;border:1px solid var(--evt-border-color)}.e-virt-table-canvas{position:absolute;left:0;top:0;box-sizing:border-box;border:none;outline:none;z-index:10}.e-virt-table-editor{position:absolute;top:-10000px;left:-10000px;text-align:left;height:auto;line-height:0;z-index:100;overflow:hidden;background-color:var(--evt-editor-bg-color);border:2px solid var(--evt-color-primary);box-sizing:border-box;box-shadow:var(--evt-box-shadow);display:flex;align-items:center}.e-virt-table-overlayer{position:absolute;left:0;top:0;overflow:hidden;z-index:100;pointer-events:none}.e-virt-table-editor-textarea{width:100%;box-sizing:border-box;outline:none;font-weight:400;padding:8px;font-size:12px;color:inherit;white-space:pre-wrap;word-wrap:break-word;word-break:break-all;line-height:1.5;margin:0;border:none;vertical-align:middle;background:var(--evt-editor-bg-color);color:var(--evt-editor-text-color);overflow-y:auto;resize:none}.e-virt-table-context-menu{position:absolute;font-size:14px;color:var(--evt-text-color-regular);background-color:var(--evt-color-white);border-radius:4px;border:1px solid #e4e7ed;box-shadow:var(--evt-box-shadow);width:fit-content;padding:6px 0;z-index:9999;left:-99999px;top:-99999px}.e-virt-table-context-menu-item{cursor:pointer;padding:6px 24px;color:var(--evt-text-color-regular)}.e-virt-table-context-menu-item:hover{color:var(--evt-color-primary);background-color:#f5f7fa}.e-virt-table-loading{display:none;position:absolute;left:0;top:0;right:0;bottom:0;width:100%;height:100%;z-index:2000;background-color:#fff6;display:flex;align-items:center;justify-content:center}.e-virt-table-loading-spinner{opacity:1;display:flex;flex-direction:column;align-items:center;justify-content:center}.e-virt-table-loading-spinner svg{color:var(--evt-text-color-regular);animation:rotate 1s linear infinite}@keyframes rotate{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.e-virt-table-loading-text{margin:0;font-size:12px;color:var(--evt-text-color-regular)}.e-virt-table-main-menu,.e-virt-table-submenu{position:absolute;background:var(--evt-context-menu-bg-color);border-radius:4px;box-shadow:0 2px 8px #0000001a;min-width:var(--evt-context-menu-min-width);max-width:var(--evt-context-menu-max-width);color:var(--evt-text-color-primary)}.e-virt-table-main-menu{border:1px solid var(--evt-border-color);z-index:3000;left:-99999px;top:-99999px;display:none;position:fixed;background-color:var(--evt-body-bg-color)}.e-virt-table-submenu{border:1px solid var(--evt-border-color);z-index:1000;max-height:350px;overflow-y:auto;opacity:0;visibility:hidden;transform:translate(-10px);transition:opacity .2s,visibility .2s,transform .2s;-ms-overflow-style:none;scrollbar-width:none}.e-virt-table-submenu::-webkit-scrollbar{display:none}.e-virt-table-submenu.show{opacity:1;visibility:visible;transform:translate(0)}.e-virt-table-submenu:not(.show){transition:none}.e-virt-table-menu-item,.e-virt-table-submenu-item{position:relative;-webkit-user-select:none;user-select:none;padding:var(--evt-context-menu-item-padding);cursor:pointer;display:flex;justify-content:space-between;align-items:center;transition:background .2s,color .2s;color:var(--evt-context-menu-text-color);font-size:var(--evt-context-menu-text-size)}.e-virt-table-menu-item:last-child,.e-virt-table-submenu-item:last-child{border-bottom:none}.e-virt-table-menu-item:has(.menu-item-icon){padding-left:8px}.menu-item-content{display:flex;align-items:center;flex:1;min-width:0}.menu-item-icon{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;margin-right:8px;flex-shrink:0}.menu-item-icon svg{width:100%;height:100%;fill:currentColor}.menu-item-text{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.e-virt-table-menu-arrow{display:inline-flex;align-items:center;justify-content:center;color:var(--evt-text-color-regular);transition:color .2s}.e-virt-table-menu-arrow svg{width:20px;height:20px;fill:currentColor}.e-virt-table-submenu-item:hover,.e-virt-table-menu-item:hover,.e-virt-table-menu-item.active{background:var(--evt-context-menu-item-hover-bg-color);color:var(--evt-context-menu-item-hover-text-color)}.e-virt-table-menu-item.disabled,.e-virt-table-submenu-item.disabled{cursor:not-allowed}")),document.head.appendChild(e)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
|
|
2
2
|
var de = Object.defineProperty;
|
|
3
3
|
var fe = (h, t, e) => t in h ? de(h, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : h[t] = e;
|
|
4
4
|
var n = (h, t, e) => fe(h, typeof t != "symbol" ? t + "" : t, e);
|
|
@@ -66,7 +66,7 @@ function $t() {
|
|
|
66
66
|
return (h === "x" ? t : t & 3 | 8).toString(16);
|
|
67
67
|
});
|
|
68
68
|
}
|
|
69
|
-
function
|
|
69
|
+
function J(h, t) {
|
|
70
70
|
let e = 0, i;
|
|
71
71
|
return function(...s) {
|
|
72
72
|
const o = (/* @__PURE__ */ new Date()).getTime(), r = o - e, a = typeof t == "function" ? t() : t;
|
|
@@ -95,7 +95,7 @@ function nt(h = [], t = 1, e = 0, i = "") {
|
|
|
95
95
|
s.children.forEach((l) => {
|
|
96
96
|
l.fixed = r;
|
|
97
97
|
});
|
|
98
|
-
const a = nt(s.children, t - 1, e + 1,
|
|
98
|
+
const a = nt(s.children, t - 1, e + 1, s.key);
|
|
99
99
|
return a && a.forEach((l) => {
|
|
100
100
|
o += l.colspan ?? 0;
|
|
101
101
|
}), {
|
|
@@ -117,10 +117,10 @@ function nt(h = [], t = 1, e = 0, i = "") {
|
|
|
117
117
|
};
|
|
118
118
|
});
|
|
119
119
|
}
|
|
120
|
-
function
|
|
120
|
+
function Q(h = []) {
|
|
121
121
|
let t = [];
|
|
122
122
|
return h.forEach((e) => {
|
|
123
|
-
e.children ? t = t.concat(
|
|
123
|
+
e.children ? t = t.concat(Q(e.children)) : t.push(e);
|
|
124
124
|
}), t;
|
|
125
125
|
}
|
|
126
126
|
function Gt(h) {
|
|
@@ -181,7 +181,7 @@ function Ut(h, t, e = []) {
|
|
|
181
181
|
}
|
|
182
182
|
}), s;
|
|
183
183
|
}
|
|
184
|
-
function
|
|
184
|
+
function qt(h, t) {
|
|
185
185
|
let e = "", i = "";
|
|
186
186
|
const s = {};
|
|
187
187
|
return t.forEach((o, r) => {
|
|
@@ -205,7 +205,7 @@ function Ee(h, t, e = []) {
|
|
|
205
205
|
function pe(h, t = []) {
|
|
206
206
|
const { column: e, row: i, visibleLeafColumns: s } = h, o = s.filter((r) => t.includes(r.key));
|
|
207
207
|
if (t.includes(e.key)) {
|
|
208
|
-
const r =
|
|
208
|
+
const r = qt(i, o);
|
|
209
209
|
return r[e.key] === 0 ? {
|
|
210
210
|
rowspan: 0,
|
|
211
211
|
colspan: 0,
|
|
@@ -281,15 +281,15 @@ function ye(h, t) {
|
|
|
281
281
|
const e = Dt(h), i = Dt(t);
|
|
282
282
|
return isNaN(e.getTime()) && isNaN(i.getTime()) ? 0 : isNaN(e.getTime()) ? -1 : isNaN(i.getTime()) ? 1 : e.getTime() - i.getTime();
|
|
283
283
|
}
|
|
284
|
-
function
|
|
284
|
+
function at(h, t = /* @__PURE__ */ new WeakMap()) {
|
|
285
285
|
if (h === null || typeof h != "object") return h;
|
|
286
286
|
if (t.has(h)) return t.get(h);
|
|
287
287
|
const e = Array.isArray(h) ? [] : {};
|
|
288
288
|
return t.set(h, e), Reflect.ownKeys(h).forEach((i) => {
|
|
289
|
-
e[i] =
|
|
289
|
+
e[i] = at(h[i], t);
|
|
290
290
|
}), e;
|
|
291
291
|
}
|
|
292
|
-
class
|
|
292
|
+
class jt {
|
|
293
293
|
constructor(t, e, i, s, o, r, a) {
|
|
294
294
|
n(this, "ctx");
|
|
295
295
|
n(this, "x", 0);
|
|
@@ -335,7 +335,7 @@ class qt {
|
|
|
335
335
|
getRightFixedX() {
|
|
336
336
|
}
|
|
337
337
|
}
|
|
338
|
-
class
|
|
338
|
+
class It extends jt {
|
|
339
339
|
constructor(e, i, s, o, r, a, l, c, d, f = "body") {
|
|
340
340
|
super(e, o, r, a, l, f, c.fixed);
|
|
341
341
|
n(this, "formatter");
|
|
@@ -541,11 +541,11 @@ class Rt extends qt {
|
|
|
541
541
|
this.rowExpand = c, this.rowHasChildren = d;
|
|
542
542
|
const { TREE_INDENT: u = 16, CHECKBOX_SIZE: w, TREE_ICON_SIZE: m } = this.ctx.config;
|
|
543
543
|
if (r = x * u, f) {
|
|
544
|
-
const
|
|
545
|
-
a = "loading", o =
|
|
544
|
+
const v = this.ctx.icons.get("loading");
|
|
545
|
+
a = "loading", o = v;
|
|
546
546
|
} else if (d) {
|
|
547
|
-
const
|
|
548
|
-
o = c ? _ :
|
|
547
|
+
const v = this.ctx.icons.get("expand"), _ = this.ctx.icons.get("shrink");
|
|
548
|
+
o = c ? _ : v, a = c ? "shrink" : "expand";
|
|
549
549
|
}
|
|
550
550
|
let g = m, E = m, C = this.drawX;
|
|
551
551
|
(this.align === "center" || this.align === "right") && (C = this.drawX + (this.visibleWidth - g - 2 * e) / 2, this.align = "left");
|
|
@@ -613,31 +613,31 @@ class Rt extends qt {
|
|
|
613
613
|
STRIPE_COLOR: m
|
|
614
614
|
} = this.ctx.config;
|
|
615
615
|
if (this.cellType === "footer") {
|
|
616
|
-
let _ = c,
|
|
616
|
+
let _ = c, S = l;
|
|
617
617
|
if (typeof o == "function") {
|
|
618
|
-
const
|
|
618
|
+
const I = o, { backgroundColor: R, color: T, font: O } = I({
|
|
619
619
|
row: this.row,
|
|
620
620
|
rowIndex: this.rowIndex,
|
|
621
621
|
colIndex: this.colIndex,
|
|
622
622
|
column: this.column,
|
|
623
623
|
value: this.getValue()
|
|
624
624
|
}) || {};
|
|
625
|
-
R && (_ = R),
|
|
625
|
+
R && (_ = R), T && (S = T), O && (this.drawTextFont = O);
|
|
626
626
|
}
|
|
627
|
-
this.drawCellSkyBgColor = "transparent", this.drawCellBgColor = _, this.drawTextColor =
|
|
627
|
+
this.drawCellSkyBgColor = "transparent", this.drawCellBgColor = _, this.drawTextColor = S;
|
|
628
628
|
return;
|
|
629
629
|
}
|
|
630
630
|
let g = "transparent";
|
|
631
631
|
const E = this.ctx.hoverCell, C = this.ctx.currentCell;
|
|
632
632
|
let p = this.rowIndex, b = this.rowIndex;
|
|
633
633
|
if (this.rowspan !== 1 && (x || d)) {
|
|
634
|
-
const _ = this.getSpanInfo(), { yArr:
|
|
635
|
-
p =
|
|
634
|
+
const _ = this.getSpanInfo(), { yArr: S } = _;
|
|
635
|
+
p = S[0], b = S[1];
|
|
636
636
|
}
|
|
637
637
|
x && E && (E.rowKey === this.rowKey && (g = u), E.rowIndex >= p && E.rowIndex <= b && (g = u)), d && C && (C.rowKey === this.rowKey && (g = f), C.rowIndex >= p && C.rowIndex <= b && (g = f)), this.drawCellSkyBgColor = g;
|
|
638
|
-
let y = e,
|
|
639
|
-
if (this.ctx.database.getReadonly(this.rowKey, this.key) || (y = i,
|
|
640
|
-
const _ = s, { backgroundColor:
|
|
638
|
+
let y = e, v = a;
|
|
639
|
+
if (this.ctx.database.getReadonly(this.rowKey, this.key) || (y = i, v = r), w && (this.rowIndex % 2 ? y = m : y = e), typeof s == "function") {
|
|
640
|
+
const _ = s, { backgroundColor: S, color: I, font: R } = _({
|
|
641
641
|
row: this.row,
|
|
642
642
|
rowIndex: this.rowIndex,
|
|
643
643
|
colIndex: this.colIndex,
|
|
@@ -645,9 +645,9 @@ class Rt extends qt {
|
|
|
645
645
|
isHasChanged: this.isHasChanged,
|
|
646
646
|
value: this.getValue()
|
|
647
647
|
}) || {};
|
|
648
|
-
|
|
648
|
+
S && (y = S), I && (v = I), R && (this.drawTextFont = R);
|
|
649
649
|
}
|
|
650
|
-
this.drawCellBgColor = y, this.drawTextColor =
|
|
650
|
+
this.drawCellBgColor = y, this.drawTextColor = v;
|
|
651
651
|
}
|
|
652
652
|
updateSelection() {
|
|
653
653
|
const { visibleWidth: e, visibleHeight: i, rowspan: s, colspan: o, cellType: r, type: a, rowIndex: l, rowKey: c } = this;
|
|
@@ -659,8 +659,8 @@ class Rt extends qt {
|
|
|
659
659
|
let w = u, m = this.drawY + (i - f) / 2;
|
|
660
660
|
if (a !== "selection-tree") {
|
|
661
661
|
if (a === "tree-selection") {
|
|
662
|
-
const { TREE_INDENT: C = 16, TREE_ICON_SIZE: p } = this.ctx.config, b = this.ctx.database.getRowForRowKey(c), { level: y = 0 } = b || {},
|
|
663
|
-
w = u + p +
|
|
662
|
+
const { TREE_INDENT: C = 16, TREE_ICON_SIZE: p } = this.ctx.config, b = this.ctx.database.getRowForRowKey(c), { level: y = 0 } = b || {}, v = y * C;
|
|
663
|
+
w = u + p + v;
|
|
664
664
|
}
|
|
665
665
|
}
|
|
666
666
|
let g = this.ctx.icons.get("checkbox-uncheck"), E = "checkbox-uncheck";
|
|
@@ -969,8 +969,8 @@ class Rt extends qt {
|
|
|
969
969
|
let c = i, d = s;
|
|
970
970
|
const { xArr: f, yArr: x, lineDash: u = [], borderWidth: w = 1, borderColor: m, fillColor: g } = e, E = f[0], C = f[1], p = x[0], b = x[1];
|
|
971
971
|
if (r >= E && r <= C && o === p) {
|
|
972
|
-
const y = r === C ? 1 : 0,
|
|
973
|
-
this.ctx.paint.drawLine([c +
|
|
972
|
+
const y = r === C ? 1 : 0, v = r === E ? 1 : 0;
|
|
973
|
+
this.ctx.paint.drawLine([c + v, d + 1, c + l - y, d + 1], {
|
|
974
974
|
borderColor: m,
|
|
975
975
|
fillColor: g,
|
|
976
976
|
borderWidth: w,
|
|
@@ -980,8 +980,8 @@ class Rt extends qt {
|
|
|
980
980
|
});
|
|
981
981
|
}
|
|
982
982
|
if (r === C && o >= p && o <= b) {
|
|
983
|
-
const y = o === p ? 1 : 0,
|
|
984
|
-
this.ctx.paint.drawLine([c + l - 1, d + y, c + l - 1, d + a -
|
|
983
|
+
const y = o === p ? 1 : 0, v = o === b ? 1 : 0;
|
|
984
|
+
this.ctx.paint.drawLine([c + l - 1, d + y, c + l - 1, d + a - v], {
|
|
985
985
|
borderColor: m,
|
|
986
986
|
fillColor: g,
|
|
987
987
|
borderWidth: w,
|
|
@@ -991,8 +991,8 @@ class Rt extends qt {
|
|
|
991
991
|
});
|
|
992
992
|
}
|
|
993
993
|
if (r >= E && r <= C && o === b) {
|
|
994
|
-
const y = r === C ? 1 : 0,
|
|
995
|
-
this.ctx.paint.drawLine([c +
|
|
994
|
+
const y = r === C ? 1 : 0, v = r === E ? 1 : 0;
|
|
995
|
+
this.ctx.paint.drawLine([c + v, d + a - 1, c + l - y, d + a - 1], {
|
|
996
996
|
borderColor: m,
|
|
997
997
|
fillColor: g,
|
|
998
998
|
borderWidth: w,
|
|
@@ -1002,8 +1002,8 @@ class Rt extends qt {
|
|
|
1002
1002
|
});
|
|
1003
1003
|
}
|
|
1004
1004
|
if (r === E && o >= p && o <= b) {
|
|
1005
|
-
const y = o === b ? 1 : 0,
|
|
1006
|
-
this.ctx.paint.drawLine([c + 1, d +
|
|
1005
|
+
const y = o === b ? 1 : 0, v = o === p ? 1 : 0;
|
|
1006
|
+
this.ctx.paint.drawLine([c + 1, d + v, c + 1, d + a - y], {
|
|
1007
1007
|
borderColor: m,
|
|
1008
1008
|
fillColor: g,
|
|
1009
1009
|
borderWidth: w,
|
|
@@ -1054,12 +1054,12 @@ class be {
|
|
|
1054
1054
|
n(this, "sortState", /* @__PURE__ */ new Map());
|
|
1055
1055
|
this.ctx = t;
|
|
1056
1056
|
const { data: i = [], columns: s = [], footerData: o = [] } = e;
|
|
1057
|
-
this.data = i, this.footerData = o, this.columns = s, this.originalColumns =
|
|
1057
|
+
this.data = i, this.footerData = o, this.columns = s, this.originalColumns = at(s), this.init();
|
|
1058
1058
|
}
|
|
1059
1059
|
// 初始化默认不忽略清空改变值和校验map
|
|
1060
1060
|
init(t = !0) {
|
|
1061
1061
|
this.ctx.paint.clearTextCache(), this.clearBufferData(), this.rowKeyMap.clear(), this.checkboxKeyMap.clear(), this.colIndexKeyMap.clear(), this.rowIndexRowKeyMap.clear(), this.rowKeyRowIndexMap.clear();
|
|
1062
|
-
const e = this.getColumns(), i =
|
|
1062
|
+
const e = this.getColumns(), i = Q(e);
|
|
1063
1063
|
if (this.ctx.hasSelection = i.some((s) => s.type === "selection"), this.ctx.hasTree = i.some((s) => s.type === "tree"), t) {
|
|
1064
1064
|
this.originalDataMap.clear(), this.changedDataMap.clear(), this.validationErrorMap.clear();
|
|
1065
1065
|
const { ROW_KEY: s } = this.ctx.config;
|
|
@@ -1185,7 +1185,7 @@ class be {
|
|
|
1185
1185
|
return e(t);
|
|
1186
1186
|
}
|
|
1187
1187
|
getColumns() {
|
|
1188
|
-
const t =
|
|
1188
|
+
const t = at(this.columns);
|
|
1189
1189
|
return this.generateColumns(t);
|
|
1190
1190
|
}
|
|
1191
1191
|
setColumns(t) {
|
|
@@ -1987,40 +1987,40 @@ class be {
|
|
|
1987
1987
|
}
|
|
1988
1988
|
]
|
|
1989
1989
|
};
|
|
1990
|
-
let g = e, E = e, C = a, p = a, b = [], y = 0,
|
|
1990
|
+
let g = e, E = e, C = a, p = a, b = [], y = 0, v = 0, _ = 0, S = 0;
|
|
1991
1991
|
if (d !== 1 && w) {
|
|
1992
|
-
|
|
1993
|
-
const
|
|
1994
|
-
const O = this.getItemValue(s,
|
|
1992
|
+
S = x;
|
|
1993
|
+
const I = l.reduce((R, T) => {
|
|
1994
|
+
const O = this.getItemValue(s, T) ?? "";
|
|
1995
1995
|
return `${R}${O}`;
|
|
1996
1996
|
}, "");
|
|
1997
1997
|
for (let R = e - 1; R >= 0; R--) {
|
|
1998
|
-
const
|
|
1999
|
-
const A = this.getItemValue(
|
|
1998
|
+
const T = this.rowIndexRowKeyMap.get(R) || "", O = l.reduce((M, L) => {
|
|
1999
|
+
const A = this.getItemValue(T, L) ?? "";
|
|
2000
2000
|
return `${M}${A}`;
|
|
2001
2001
|
}, "");
|
|
2002
|
-
if (
|
|
2002
|
+
if (I === O)
|
|
2003
2003
|
g = R;
|
|
2004
2004
|
else
|
|
2005
2005
|
break;
|
|
2006
2006
|
}
|
|
2007
2007
|
for (let R = e; R <= this.ctx.maxRowIndex; R++) {
|
|
2008
|
-
const
|
|
2009
|
-
const A = this.getItemValue(
|
|
2008
|
+
const T = this.rowIndexRowKeyMap.get(R) || "", O = l.reduce((M, L) => {
|
|
2009
|
+
const A = this.getItemValue(T, L) ?? "";
|
|
2010
2010
|
return `${M}${A}`;
|
|
2011
2011
|
}, "");
|
|
2012
|
-
if (
|
|
2012
|
+
if (I === O)
|
|
2013
2013
|
E = R;
|
|
2014
2014
|
else
|
|
2015
2015
|
break;
|
|
2016
2016
|
}
|
|
2017
2017
|
for (let R = g; R < e; R++) {
|
|
2018
|
-
const { height:
|
|
2019
|
-
y +=
|
|
2018
|
+
const { height: T } = this.positions[R];
|
|
2019
|
+
y += T;
|
|
2020
2020
|
}
|
|
2021
2021
|
for (let R = g; R <= E; R++) {
|
|
2022
|
-
const { height:
|
|
2023
|
-
_ +=
|
|
2022
|
+
const { height: T } = this.positions[R];
|
|
2023
|
+
_ += T;
|
|
2024
2024
|
const O = this.rowIndexRowKeyMap.get(R) || "", { item: M } = this.rowKeyMap.get(O), L = this.getItemValue(O, i);
|
|
2025
2025
|
b.push({
|
|
2026
2026
|
rowKey: O,
|
|
@@ -2032,37 +2032,37 @@ class be {
|
|
|
2032
2032
|
}
|
|
2033
2033
|
if (u !== 1 && m) {
|
|
2034
2034
|
_ = f;
|
|
2035
|
-
for (let
|
|
2036
|
-
const R = this.getColumnByColIndex(
|
|
2035
|
+
for (let I = a - 1; I >= 0; I--) {
|
|
2036
|
+
const R = this.getColumnByColIndex(I);
|
|
2037
2037
|
if (!R)
|
|
2038
2038
|
break;
|
|
2039
|
-
const
|
|
2040
|
-
if (
|
|
2041
|
-
C =
|
|
2039
|
+
const T = this.getItemValue(s, i), O = this.getItemValue(s, R.key);
|
|
2040
|
+
if (T === O && c.includes(R.key))
|
|
2041
|
+
C = I;
|
|
2042
2042
|
else
|
|
2043
2043
|
break;
|
|
2044
2044
|
}
|
|
2045
|
-
for (let
|
|
2046
|
-
const R = this.getColumnByColIndex(
|
|
2045
|
+
for (let I = a; I <= this.ctx.maxColIndex; I++) {
|
|
2046
|
+
const R = this.getColumnByColIndex(I);
|
|
2047
2047
|
if (!R)
|
|
2048
2048
|
break;
|
|
2049
|
-
const
|
|
2050
|
-
if (
|
|
2051
|
-
p =
|
|
2049
|
+
const T = this.getItemValue(s, i), O = this.getItemValue(s, R.key);
|
|
2050
|
+
if (T === O && c.includes(R.key))
|
|
2051
|
+
p = I;
|
|
2052
2052
|
else
|
|
2053
2053
|
break;
|
|
2054
2054
|
}
|
|
2055
|
-
for (let
|
|
2056
|
-
const R = this.getColumnByColIndex(
|
|
2055
|
+
for (let I = C; I < a; I++) {
|
|
2056
|
+
const R = this.getColumnByColIndex(I);
|
|
2057
2057
|
if (!R)
|
|
2058
2058
|
break;
|
|
2059
|
-
|
|
2059
|
+
v += R.width || 100;
|
|
2060
2060
|
}
|
|
2061
|
-
for (let
|
|
2062
|
-
const R = this.getColumnByColIndex(
|
|
2061
|
+
for (let I = C; I <= p; I++) {
|
|
2062
|
+
const R = this.getColumnByColIndex(I);
|
|
2063
2063
|
if (!R)
|
|
2064
2064
|
break;
|
|
2065
|
-
|
|
2065
|
+
S += R.width || 100, b.push({
|
|
2066
2066
|
rowKey: s,
|
|
2067
2067
|
key: R.key,
|
|
2068
2068
|
value: this.getItemValue(s, R.key),
|
|
@@ -2076,9 +2076,9 @@ class be {
|
|
|
2076
2076
|
rowspan: d,
|
|
2077
2077
|
colspan: u,
|
|
2078
2078
|
height: _,
|
|
2079
|
-
width:
|
|
2079
|
+
width: S,
|
|
2080
2080
|
offsetTop: y,
|
|
2081
|
-
offsetLeft:
|
|
2081
|
+
offsetLeft: v,
|
|
2082
2082
|
dataList: b
|
|
2083
2083
|
};
|
|
2084
2084
|
}
|
|
@@ -2117,7 +2117,7 @@ class be {
|
|
|
2117
2117
|
// 获取虚拟单元格,只针对可见的
|
|
2118
2118
|
getVirtualBodyCell(t, e) {
|
|
2119
2119
|
const i = this.getColumnByColIndex(e), s = this.getRowForRowIndex(t);
|
|
2120
|
-
return !i || !s ? void 0 : new
|
|
2120
|
+
return !i || !s ? void 0 : new It(this.ctx, t, e, 0, 0, 0, 0, i, s.item, "body");
|
|
2121
2121
|
}
|
|
2122
2122
|
getVirtualBodyCellByKey(t, e) {
|
|
2123
2123
|
const i = this.getRowIndexForRowKey(t), s = this.getColIndexForKey(e);
|
|
@@ -2507,35 +2507,35 @@ class _e {
|
|
|
2507
2507
|
const E = parseInt(((R = a.match(/\d+/)) == null ? void 0 : R[0]) || "12") * (r.lineHeight || 1.2), C = s - d * 2 - w - m;
|
|
2508
2508
|
let p = !1;
|
|
2509
2509
|
const b = Math.round((o - 2 * d) / E);
|
|
2510
|
-
let y = this.wrapText(t, C, r.cacheTextKey),
|
|
2511
|
-
x === "auto" && u ?
|
|
2510
|
+
let y = this.wrapText(t, C, r.cacheTextKey), v = Math.min(y.length, Math.max(b, 1));
|
|
2511
|
+
x === "auto" && u ? v = y.length : typeof x == "number" && x < v && x !== 1 ? v = x : (x === 1 && (y = [t], v = 1), x === "auto" && b === 1 && (y = [t], v = 1));
|
|
2512
2512
|
let _ = i + d;
|
|
2513
|
-
const
|
|
2514
|
-
f === "middle" ? _ = i + (o -
|
|
2515
|
-
let
|
|
2516
|
-
l === "center" ?
|
|
2517
|
-
for (let
|
|
2518
|
-
const O = y[
|
|
2519
|
-
if (this.ctx.textBaseline = "top",
|
|
2520
|
-
const A = y.slice(
|
|
2521
|
-
this.ctx.fillText(D,
|
|
2513
|
+
const S = Math.round(v * E);
|
|
2514
|
+
f === "middle" ? _ = i + (o - S) / 2 : f === "bottom" && (_ = i + o - S - d);
|
|
2515
|
+
let I = e + d + w;
|
|
2516
|
+
l === "center" ? I = e + s / 2 : l === "right" && (I = e + s - d - m);
|
|
2517
|
+
for (let T = 0; T < y.length; T++) {
|
|
2518
|
+
const O = y[T], M = _ + T * E;
|
|
2519
|
+
if (this.ctx.textBaseline = "top", T === v - 1) {
|
|
2520
|
+
const A = y.slice(T).join(""), { _text: D, ellipsis: H } = this.handleEllipsis(A, s, d, a);
|
|
2521
|
+
this.ctx.fillText(D, I, M), p = H;
|
|
2522
2522
|
break;
|
|
2523
2523
|
}
|
|
2524
|
-
this.ctx.fillText(O,
|
|
2524
|
+
this.ctx.fillText(O, I, M);
|
|
2525
2525
|
}
|
|
2526
2526
|
if (r.textCallback && y.length) {
|
|
2527
|
-
const
|
|
2528
|
-
let M =
|
|
2529
|
-
l === "center" ? (M =
|
|
2527
|
+
const T = y.reduce((D, H) => Math.max(D, this.ctx.measureText(H).width), 0), O = Math.round(T);
|
|
2528
|
+
let M = I, L = I + O;
|
|
2529
|
+
l === "center" ? (M = I - O / 2, L = I + O / 2) : l === "right" && (M = I - O, L = I);
|
|
2530
2530
|
const A = {
|
|
2531
|
-
x:
|
|
2531
|
+
x: I,
|
|
2532
2532
|
y: _,
|
|
2533
2533
|
width: O,
|
|
2534
|
-
height:
|
|
2534
|
+
height: S,
|
|
2535
2535
|
left: M,
|
|
2536
2536
|
right: L,
|
|
2537
2537
|
top: _,
|
|
2538
|
-
bottom: _ +
|
|
2538
|
+
bottom: _ + S
|
|
2539
2539
|
};
|
|
2540
2540
|
r.textCallback(A);
|
|
2541
2541
|
}
|
|
@@ -2646,8 +2646,6 @@ class Nt {
|
|
|
2646
2646
|
n(this, "STRIPE_COLOR", "#fafafa");
|
|
2647
2647
|
/** 区域边框颜色 */
|
|
2648
2648
|
n(this, "BORDER_COLOR", "#e1e6eb");
|
|
2649
|
-
/** 宽度为 0 表示自适应100% */
|
|
2650
|
-
n(this, "WIDTH", 0);
|
|
2651
2649
|
/** 高度,为 0 表示自适应 */
|
|
2652
2650
|
n(this, "HEIGHT", 0);
|
|
2653
2651
|
/** 占位文本颜色 */
|
|
@@ -2974,7 +2972,7 @@ class Nt {
|
|
|
2974
2972
|
}), Object.assign(this, t, this._config);
|
|
2975
2973
|
}
|
|
2976
2974
|
}
|
|
2977
|
-
const Zt = '<svg t="1724122015492" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4237" width="32" height="32"><path d="M401.472 316.992l159.04 217.664L591.488 512l-30.976-22.656-159.04 217.728q-2.24 3.008-3.84 6.464-1.6 3.456-2.496 7.104-0.896 3.648-1.024 7.424-0.192 3.84 0.384 7.552 0.64 3.712 1.92 7.296 1.28 3.52 3.2 6.784 1.984 3.2 4.544 6.016 2.56 2.752 5.632 4.992 3.072 2.24 6.464 3.84 3.456 1.6 7.168 2.496 3.648 0.896 7.424 1.024 3.776 0.192 7.488-0.448 3.776-0.576 7.296-1.856 3.584-1.28 6.784-3.264 3.2-1.92 6.016-4.48 2.816-2.56 5.056-5.632l159.04-217.728q3.584-4.928 5.504-10.752 1.92-5.76 1.92-11.904 0-6.08-1.92-11.904-1.92-5.76-5.504-10.752L463.488 271.68q-2.24-3.072-5.056-5.632-2.752-2.56-6.016-4.48-3.2-1.984-6.784-3.328-3.52-1.28-7.296-1.856-3.712-0.576-7.488-0.448-3.84 0.192-7.424 1.088-3.712 0.896-7.168 2.496-3.392 1.6-6.4 3.84-3.136 2.176-5.696 4.992-2.56 2.752-4.48 6.016-1.984 3.2-3.264 6.784-1.28 3.52-1.92 7.296-0.576 3.712-0.384 7.488 0.128 3.84 1.024 7.488 0.896 3.648 2.496 7.04 1.6 3.456 3.84 6.528z m30.976-61.056q-3.776 0-7.488 0.704-3.712 0.768-7.168 2.24-3.52 1.408-6.656 3.52-3.2 2.112-5.824 4.8-2.688 2.624-4.8 5.76-2.112 3.2-3.52 6.656-1.472 3.52-2.176 7.232-0.768 3.712-0.768 7.488 0 3.776 0.768 7.488 0.704 3.712 2.176 7.232 1.408 3.456 3.52 6.592 2.112 3.2 4.8 5.824 2.688 2.688 5.76 4.8 3.2 2.112 6.72 3.52 3.456 1.472 7.168 2.176 3.712 0.768 7.488 0.768 3.84 0 7.488-0.768 3.712-0.704 7.232-2.176 3.456-1.408 6.592-3.52 3.2-2.112 5.824-4.8 2.688-2.688 4.8-5.76 2.112-3.2 3.52-6.656 1.472-3.52 2.24-7.232 0.704-3.712 0.704-7.488 0-3.84-0.704-7.488-0.768-3.712-2.24-7.232-1.408-3.456-3.52-6.592-2.112-3.2-4.8-5.824-2.624-2.688-5.76-4.8-3.2-2.112-6.656-3.52-3.52-1.472-7.232-2.24Q436.224 256 432.448 256z m0 435.392q-3.776 0-7.488 0.704-3.712 0.768-7.168 2.176-3.52 1.472-6.656 3.584-3.2 2.112-5.824 4.736-2.688 2.688-4.8 5.824-2.112 3.2-3.52 6.656-1.472 3.52-2.176 7.232-0.768 3.712-0.768 7.488 0 3.776 0.768 7.488 0.704 3.712 2.176 7.168 1.408 3.52 3.52 6.656 2.112 3.2 4.8 5.76 2.688 2.752 5.76 4.8 3.2 2.112 6.72 3.584 3.456 1.472 7.168 2.176 3.712 0.768 7.488 0.768 3.84 0 7.488-0.768 3.712-0.704 7.232-2.176 3.456-1.472 6.592-3.584 3.2-2.048 5.824-4.736 2.688-2.688 4.8-5.824 2.112-3.2 3.52-6.656 1.472-3.456 2.24-7.168 0.704-3.712 0.704-7.488 0-3.84-0.704-7.488-0.768-3.712-2.24-7.232-1.408-3.52-3.52-6.656-2.112-3.136-4.8-5.76-2.624-2.688-5.76-4.8-3.2-2.112-6.656-3.584-3.52-1.408-7.232-2.176-3.712-0.704-7.488-0.704z" p-id="4238"></path></svg>', kt = '<svg t="1722595535853" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4551" width="32" height="32"><path d="M640 128H384c-170.496 0-256 85.504-256 256v256c0 170.496 85.504 256 256 256h256c170.496 0 256-85.504 256-256V384c0-170.496-85.504-256-256-256z m67.584 302.592c-2.048 4.608-4.608 8.704-8.192 12.288L506.88 634.88c-3.584 3.584-7.68 6.144-12.288 8.192-4.608 2.048-9.728 3.072-14.848 3.072s-10.24-1.024-14.848-3.072c-4.608-2.048-8.704-4.608-12.288-8.192l-96.256-96.256c-3.584-3.584-6.144-7.68-8.192-12.288-2.048-4.608-3.072-9.728-3.072-14.848 0-2.56 0-5.12 1.024-7.68 0.512-2.56 1.024-5.12 2.048-7.168 1.024-2.56 2.048-4.608 3.584-6.656 1.536-2.048 3.072-4.096 4.608-5.632 1.536-2.048 3.584-3.584 5.632-4.608 2.048-1.536 4.096-2.56 6.656-3.584 2.56-1.024 4.608-1.536 7.168-2.048 2.56-0.512 5.12-0.512 7.68-0.512 5.12 0 10.24 1.024 14.848 3.072 4.608 2.048 8.704 4.608 12.288 8.192l69.12 68.608L645.12 389.12c3.584-3.584 7.68-6.144 12.288-8.192 4.608-2.048 9.728-3.072 14.848-3.072 2.56 0 5.12 0 7.68 0.512s5.12 1.024 7.168 2.048c2.56 1.024 4.608 2.048 6.656 3.584 2.048 1.536 4.096 3.072 5.632 4.608 1.536 1.536 3.584 3.584 4.608 5.632 1.536 2.048 2.56 4.096 3.584 6.656 1.024 2.56 1.536 4.608 2.048 7.168 0.512 2.56 1.024 5.12 1.024 7.68 0 5.12-1.024 10.24-3.072 14.848z" p-id="4552"></path></svg>', Xt = '<svg t="1724122044148" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4551" width="32" height="32"><path d="M707.648 401.28L489.28 560.704l22.656 30.976 22.656-30.976L316.16 401.216q-3.072-2.24-6.464-3.84-3.456-1.536-7.104-2.432-3.712-0.896-7.488-1.088-3.776-0.128-7.488 0.448-3.776 0.64-7.296 1.92-3.584 1.28-6.784 3.2-3.2 1.984-6.016 4.544-2.816 2.56-5.056 5.632-2.176 3.072-3.84 6.464-1.536 3.456-2.432 7.104-0.896 3.712-1.088 7.488-0.128 3.776 0.448 7.488 0.64 3.776 1.92 7.296 1.28 3.584 3.2 6.784 1.984 3.2 4.544 6.016 2.56 2.752 5.632 4.992l218.368 159.552q4.928 3.584 10.752 5.504 5.76 1.92 11.904 1.92 6.08 0 11.904-1.92 5.76-1.92 10.752-5.504l218.368-159.552q3.008-2.24 5.568-4.992 2.56-2.816 4.544-6.016 1.92-3.2 3.264-6.784 1.28-3.52 1.92-7.296 0.576-3.712 0.384-7.488-0.128-3.84-1.024-7.488-0.896-3.648-2.496-7.04-1.6-3.456-3.84-6.528-2.24-3.072-4.992-5.632-2.816-2.56-6.016-4.48-3.2-1.984-6.784-3.328-3.584-1.28-7.296-1.856-3.712-0.64-7.488-0.448-3.84 0.192-7.488 1.088-3.648 0.896-7.04 2.496-3.456 1.536-6.528 3.84z m61.056 30.976q0-3.84-0.768-7.488-0.704-3.712-2.176-7.232-1.472-3.456-3.52-6.656-2.112-3.136-4.8-5.76-2.688-2.688-5.76-4.8-3.2-2.112-6.72-3.584-3.456-1.408-7.168-2.176-3.712-0.704-7.488-0.704-3.84 0-7.488 0.704-3.712 0.768-7.232 2.176-3.456 1.472-6.656 3.584-3.136 2.112-5.76 4.8-2.688 2.624-4.8 5.76-2.112 3.2-3.584 6.656-1.408 3.52-2.176 7.232-0.704 3.712-0.704 7.488 0 3.776 0.704 7.488 0.768 3.712 2.176 7.168 1.472 3.52 3.584 6.656 2.112 3.2 4.8 5.824 2.624 2.688 5.76 4.8 3.2 2.112 6.656 3.52 3.52 1.472 7.232 2.176 3.712 0.768 7.488 0.768 3.776 0 7.488-0.768 3.712-0.704 7.168-2.176 3.52-1.408 6.656-3.52 3.2-2.112 5.824-4.8 2.688-2.688 4.8-5.76 2.048-3.2 3.52-6.72 1.472-3.456 2.176-7.168 0.768-3.712 0.768-7.488z m-436.736 0q0-3.84-0.768-7.488-0.704-3.712-2.176-7.232-1.408-3.456-3.52-6.656-2.112-3.136-4.8-5.76-2.688-2.688-5.76-4.8-3.2-2.112-6.656-3.584-3.52-1.408-7.232-2.176-3.712-0.704-7.488-0.704-3.84 0-7.488 0.704-3.712 0.768-7.232 2.176-3.456 1.472-6.592 3.584-3.2 2.112-5.824 4.8-2.688 2.624-4.8 5.76-2.112 3.2-3.52 6.656-1.472 3.52-2.24 7.232-0.704 3.712-0.704 7.488 0 3.776 0.704 7.488 0.768 3.712 2.24 7.168 1.408 3.52 3.52 6.656 2.112 3.2 4.8 5.824 2.624 2.688 5.76 4.8 3.2 2.112 6.656 3.52 3.52 1.472 7.232 2.176 3.712 0.768 7.488 0.768 3.776 0 7.488-0.768 3.712-0.704 7.232-2.176 3.456-1.408 6.592-3.52 3.2-2.112 5.824-4.8 2.688-2.688 4.8-5.76 2.112-3.2 3.52-6.72 1.472-3.456 2.176-7.168 0.768-3.712 0.768-7.488z" p-id="4552"></path></svg>',
|
|
2975
|
+
const Zt = '<svg t="1724122015492" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4237" width="32" height="32"><path d="M401.472 316.992l159.04 217.664L591.488 512l-30.976-22.656-159.04 217.728q-2.24 3.008-3.84 6.464-1.6 3.456-2.496 7.104-0.896 3.648-1.024 7.424-0.192 3.84 0.384 7.552 0.64 3.712 1.92 7.296 1.28 3.52 3.2 6.784 1.984 3.2 4.544 6.016 2.56 2.752 5.632 4.992 3.072 2.24 6.464 3.84 3.456 1.6 7.168 2.496 3.648 0.896 7.424 1.024 3.776 0.192 7.488-0.448 3.776-0.576 7.296-1.856 3.584-1.28 6.784-3.264 3.2-1.92 6.016-4.48 2.816-2.56 5.056-5.632l159.04-217.728q3.584-4.928 5.504-10.752 1.92-5.76 1.92-11.904 0-6.08-1.92-11.904-1.92-5.76-5.504-10.752L463.488 271.68q-2.24-3.072-5.056-5.632-2.752-2.56-6.016-4.48-3.2-1.984-6.784-3.328-3.52-1.28-7.296-1.856-3.712-0.576-7.488-0.448-3.84 0.192-7.424 1.088-3.712 0.896-7.168 2.496-3.392 1.6-6.4 3.84-3.136 2.176-5.696 4.992-2.56 2.752-4.48 6.016-1.984 3.2-3.264 6.784-1.28 3.52-1.92 7.296-0.576 3.712-0.384 7.488 0.128 3.84 1.024 7.488 0.896 3.648 2.496 7.04 1.6 3.456 3.84 6.528z m30.976-61.056q-3.776 0-7.488 0.704-3.712 0.768-7.168 2.24-3.52 1.408-6.656 3.52-3.2 2.112-5.824 4.8-2.688 2.624-4.8 5.76-2.112 3.2-3.52 6.656-1.472 3.52-2.176 7.232-0.768 3.712-0.768 7.488 0 3.776 0.768 7.488 0.704 3.712 2.176 7.232 1.408 3.456 3.52 6.592 2.112 3.2 4.8 5.824 2.688 2.688 5.76 4.8 3.2 2.112 6.72 3.52 3.456 1.472 7.168 2.176 3.712 0.768 7.488 0.768 3.84 0 7.488-0.768 3.712-0.704 7.232-2.176 3.456-1.408 6.592-3.52 3.2-2.112 5.824-4.8 2.688-2.688 4.8-5.76 2.112-3.2 3.52-6.656 1.472-3.52 2.24-7.232 0.704-3.712 0.704-7.488 0-3.84-0.704-7.488-0.768-3.712-2.24-7.232-1.408-3.456-3.52-6.592-2.112-3.2-4.8-5.824-2.624-2.688-5.76-4.8-3.2-2.112-6.656-3.52-3.52-1.472-7.232-2.24Q436.224 256 432.448 256z m0 435.392q-3.776 0-7.488 0.704-3.712 0.768-7.168 2.176-3.52 1.472-6.656 3.584-3.2 2.112-5.824 4.736-2.688 2.688-4.8 5.824-2.112 3.2-3.52 6.656-1.472 3.52-2.176 7.232-0.768 3.712-0.768 7.488 0 3.776 0.768 7.488 0.704 3.712 2.176 7.168 1.408 3.52 3.52 6.656 2.112 3.2 4.8 5.76 2.688 2.752 5.76 4.8 3.2 2.112 6.72 3.584 3.456 1.472 7.168 2.176 3.712 0.768 7.488 0.768 3.84 0 7.488-0.768 3.712-0.704 7.232-2.176 3.456-1.472 6.592-3.584 3.2-2.048 5.824-4.736 2.688-2.688 4.8-5.824 2.112-3.2 3.52-6.656 1.472-3.456 2.24-7.168 0.704-3.712 0.704-7.488 0-3.84-0.704-7.488-0.768-3.712-2.24-7.232-1.408-3.52-3.52-6.656-2.112-3.136-4.8-5.76-2.624-2.688-5.76-4.8-3.2-2.112-6.656-3.584-3.52-1.408-7.232-2.176-3.712-0.704-7.488-0.704z" p-id="4238"></path></svg>', kt = '<svg t="1722595535853" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4551" width="32" height="32"><path d="M640 128H384c-170.496 0-256 85.504-256 256v256c0 170.496 85.504 256 256 256h256c170.496 0 256-85.504 256-256V384c0-170.496-85.504-256-256-256z m67.584 302.592c-2.048 4.608-4.608 8.704-8.192 12.288L506.88 634.88c-3.584 3.584-7.68 6.144-12.288 8.192-4.608 2.048-9.728 3.072-14.848 3.072s-10.24-1.024-14.848-3.072c-4.608-2.048-8.704-4.608-12.288-8.192l-96.256-96.256c-3.584-3.584-6.144-7.68-8.192-12.288-2.048-4.608-3.072-9.728-3.072-14.848 0-2.56 0-5.12 1.024-7.68 0.512-2.56 1.024-5.12 2.048-7.168 1.024-2.56 2.048-4.608 3.584-6.656 1.536-2.048 3.072-4.096 4.608-5.632 1.536-2.048 3.584-3.584 5.632-4.608 2.048-1.536 4.096-2.56 6.656-3.584 2.56-1.024 4.608-1.536 7.168-2.048 2.56-0.512 5.12-0.512 7.68-0.512 5.12 0 10.24 1.024 14.848 3.072 4.608 2.048 8.704 4.608 12.288 8.192l69.12 68.608L645.12 389.12c3.584-3.584 7.68-6.144 12.288-8.192 4.608-2.048 9.728-3.072 14.848-3.072 2.56 0 5.12 0 7.68 0.512s5.12 1.024 7.168 2.048c2.56 1.024 4.608 2.048 6.656 3.584 2.048 1.536 4.096 3.072 5.632 4.608 1.536 1.536 3.584 3.584 4.608 5.632 1.536 2.048 2.56 4.096 3.584 6.656 1.024 2.56 1.536 4.608 2.048 7.168 0.512 2.56 1.024 5.12 1.024 7.68 0 5.12-1.024 10.24-3.072 14.848z" p-id="4552"></path></svg>', Xt = '<svg t="1724122044148" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4551" width="32" height="32"><path d="M707.648 401.28L489.28 560.704l22.656 30.976 22.656-30.976L316.16 401.216q-3.072-2.24-6.464-3.84-3.456-1.536-7.104-2.432-3.712-0.896-7.488-1.088-3.776-0.128-7.488 0.448-3.776 0.64-7.296 1.92-3.584 1.28-6.784 3.2-3.2 1.984-6.016 4.544-2.816 2.56-5.056 5.632-2.176 3.072-3.84 6.464-1.536 3.456-2.432 7.104-0.896 3.712-1.088 7.488-0.128 3.776 0.448 7.488 0.64 3.776 1.92 7.296 1.28 3.584 3.2 6.784 1.984 3.2 4.544 6.016 2.56 2.752 5.632 4.992l218.368 159.552q4.928 3.584 10.752 5.504 5.76 1.92 11.904 1.92 6.08 0 11.904-1.92 5.76-1.92 10.752-5.504l218.368-159.552q3.008-2.24 5.568-4.992 2.56-2.816 4.544-6.016 1.92-3.2 3.264-6.784 1.28-3.52 1.92-7.296 0.576-3.712 0.384-7.488-0.128-3.84-1.024-7.488-0.896-3.648-2.496-7.04-1.6-3.456-3.84-6.528-2.24-3.072-4.992-5.632-2.816-2.56-6.016-4.48-3.2-1.984-6.784-3.328-3.584-1.28-7.296-1.856-3.712-0.64-7.488-0.448-3.84 0.192-7.488 1.088-3.648 0.896-7.04 2.496-3.456 1.536-6.528 3.84z m61.056 30.976q0-3.84-0.768-7.488-0.704-3.712-2.176-7.232-1.472-3.456-3.52-6.656-2.112-3.136-4.8-5.76-2.688-2.688-5.76-4.8-3.2-2.112-6.72-3.584-3.456-1.408-7.168-2.176-3.712-0.704-7.488-0.704-3.84 0-7.488 0.704-3.712 0.768-7.232 2.176-3.456 1.472-6.656 3.584-3.136 2.112-5.76 4.8-2.688 2.624-4.8 5.76-2.112 3.2-3.584 6.656-1.408 3.52-2.176 7.232-0.704 3.712-0.704 7.488 0 3.776 0.704 7.488 0.768 3.712 2.176 7.168 1.472 3.52 3.584 6.656 2.112 3.2 4.8 5.824 2.624 2.688 5.76 4.8 3.2 2.112 6.656 3.52 3.52 1.472 7.232 2.176 3.712 0.768 7.488 0.768 3.776 0 7.488-0.768 3.712-0.704 7.168-2.176 3.52-1.408 6.656-3.52 3.2-2.112 5.824-4.8 2.688-2.688 4.8-5.76 2.048-3.2 3.52-6.72 1.472-3.456 2.176-7.168 0.768-3.712 0.768-7.488z m-436.736 0q0-3.84-0.768-7.488-0.704-3.712-2.176-7.232-1.408-3.456-3.52-6.656-2.112-3.136-4.8-5.76-2.688-2.688-5.76-4.8-3.2-2.112-6.656-3.584-3.52-1.408-7.232-2.176-3.712-0.704-7.488-0.704-3.84 0-7.488 0.704-3.712 0.768-7.232 2.176-3.456 1.472-6.592 3.584-3.2 2.112-5.824 4.8-2.688 2.624-4.8 5.76-2.112 3.2-3.52 6.656-1.472 3.52-2.24 7.232-0.704 3.712-0.704 7.488 0 3.776 0.704 7.488 0.768 3.712 2.24 7.168 1.408 3.52 3.52 6.656 2.112 3.2 4.8 5.824 2.624 2.688 5.76 4.8 3.2 2.112 6.656 3.52 3.52 1.472 7.232 2.176 3.712 0.768 7.488 0.768 3.776 0 7.488-0.768 3.712-0.704 7.232-2.176 3.456-1.408 6.592-3.52 3.2-2.112 5.824-4.8 2.688-2.688 4.8-5.76 2.112-3.2 3.52-6.72 1.472-3.456 2.176-7.168 0.768-3.712 0.768-7.488z" p-id="4552"></path></svg>', Rt = '<svg t="1755138507987" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5079" width="200" height="200"><path d="M512 938.688a42.688 42.688 0 0 1-35.072-18.432l-192-277.312A42.56 42.56 0 0 1 320 576h384a42.752 42.752 0 0 1 35.072 66.944l-192 277.312a42.688 42.688 0 0 1-35.072 18.432" fill="currentColor" p-id="2016"></path><path d="M704 448H320a42.752 42.752 0 0 1-35.072-66.944l192-277.312c16-23.04 54.208-23.04 70.144 0l192 277.312A42.56 42.56 0 0 1 704 448" fill="currentColor" p-id="2015"></path></svg>', Se = Rt.replace('fill="currentColor" p-id="2016"', 'fill="#bec4c7" p-id="2016"'), Te = Rt.replace('fill="currentColor" p-id="2015"', 'fill="#bec4c7" p-id="2015"');
|
|
2978
2976
|
class Oe {
|
|
2979
2977
|
constructor(t) {
|
|
2980
2978
|
n(this, "ctx");
|
|
@@ -3065,7 +3063,7 @@ class Oe {
|
|
|
3065
3063
|
{
|
|
3066
3064
|
name: "sort-default",
|
|
3067
3065
|
configName: "SORTABLE_ICON_SVG",
|
|
3068
|
-
svg:
|
|
3066
|
+
svg: Rt,
|
|
3069
3067
|
color: "#bec4c7"
|
|
3070
3068
|
}
|
|
3071
3069
|
]);
|
|
@@ -3128,7 +3126,7 @@ class Oe {
|
|
|
3128
3126
|
return this.list.find((e) => e.name === t);
|
|
3129
3127
|
}
|
|
3130
3128
|
}
|
|
3131
|
-
class
|
|
3129
|
+
class Et extends jt {
|
|
3132
3130
|
constructor(e, i, s, o, r, a, l) {
|
|
3133
3131
|
super(e, s, o, r, a, "header", l.fixed);
|
|
3134
3132
|
n(this, "align");
|
|
@@ -3358,9 +3356,9 @@ class Le {
|
|
|
3358
3356
|
return;
|
|
3359
3357
|
const { offsetY: e, offsetX: i } = this.ctx.getOffset(t), s = e, o = i;
|
|
3360
3358
|
this.handleHeaderEvent(o, s, this.ctx.header.renderCellHeaders, (r) => {
|
|
3361
|
-
this.ctx.focusCellHeader = r, this.ctx.focusCell = void 0, this.ctx.emit("cellHeaderMousedown", r, t)
|
|
3359
|
+
this.ctx.focusCellHeader = r, this.ctx.focusCell = void 0, this.ctx.emit("cellHeaderMousedown", r, t);
|
|
3362
3360
|
}), this.handleBodyEvent(o, s, this.ctx.body.renderRows, (r) => {
|
|
3363
|
-
this.ctx.setFocusCell(r), this.ctx.focusCellHeader = void 0, this.ctx.emit("cellMousedown", r, t)
|
|
3361
|
+
this.ctx.setFocusCell(r), this.ctx.focusCellHeader = void 0, this.ctx.emit("cellMousedown", r, t);
|
|
3364
3362
|
});
|
|
3365
3363
|
}), this.ctx.on("mouseup", (t) => {
|
|
3366
3364
|
if (t.button !== 0 || this.isBusy(t))
|
|
@@ -3456,7 +3454,7 @@ class Le {
|
|
|
3456
3454
|
t.drawSelectionImageWidth,
|
|
3457
3455
|
t.drawSelectionImageHeight
|
|
3458
3456
|
))
|
|
3459
|
-
if (t instanceof
|
|
3457
|
+
if (t instanceof Et)
|
|
3460
3458
|
t.drawSelectionImageName === "checkbox-uncheck" || t.drawSelectionImageName === "checkbox-indeterminate" ? this.ctx.database.toggleAllSelection() : t.drawSelectionImageName === "checkbox-check" && this.ctx.database.clearSelection(!0);
|
|
3461
3459
|
else {
|
|
3462
3460
|
if (!this.ctx.database.getRowSelectable(t.rowKey))
|
|
@@ -3521,7 +3519,7 @@ class Le {
|
|
|
3521
3519
|
*/
|
|
3522
3520
|
imageEnterAndLeave(t, e) {
|
|
3523
3521
|
const { offsetY: i, offsetX: s } = this.ctx.getOffset(e), o = i, r = s;
|
|
3524
|
-
if (t instanceof
|
|
3522
|
+
if (t instanceof Et) {
|
|
3525
3523
|
if (t.drawSelectionImageSource && this.isInsideElement(
|
|
3526
3524
|
r,
|
|
3527
3525
|
o,
|
|
@@ -3545,7 +3543,7 @@ class Le {
|
|
|
3545
3543
|
return;
|
|
3546
3544
|
}
|
|
3547
3545
|
}
|
|
3548
|
-
if (t instanceof
|
|
3546
|
+
if (t instanceof It) {
|
|
3549
3547
|
if (t.drawSelectionImageSource && this.isInsideElement(
|
|
3550
3548
|
r,
|
|
3551
3549
|
o,
|
|
@@ -3663,6 +3661,8 @@ class Me {
|
|
|
3663
3661
|
n(this, "isMouseoverTargetContainer", !1);
|
|
3664
3662
|
n(this, "mousedown", !1);
|
|
3665
3663
|
n(this, "isPointer", !1);
|
|
3664
|
+
n(this, "isEmpty", !1);
|
|
3665
|
+
// 是否空数据
|
|
3666
3666
|
n(this, "rowResizing", !1);
|
|
3667
3667
|
// 行调整大小中
|
|
3668
3668
|
n(this, "columnResizing", !1);
|
|
@@ -4235,7 +4235,7 @@ class De {
|
|
|
4235
4235
|
n(this, "renderFixedCellHeaders", []);
|
|
4236
4236
|
this.ctx = t, this.ctx.on(
|
|
4237
4237
|
"resetHeader",
|
|
4238
|
-
|
|
4238
|
+
J(() => {
|
|
4239
4239
|
this.init(), this.ctx.clearSelector(), this.ctx.emit("draw");
|
|
4240
4240
|
}, 100)
|
|
4241
4241
|
), this.init(), this.initResizeColumn(), this.initDragColumn();
|
|
@@ -4245,7 +4245,7 @@ class De {
|
|
|
4245
4245
|
config: { HEADER_HEIGHT: t, SCROLLER_TRACK_SIZE: e }
|
|
4246
4246
|
} = this.ctx, i = this.ctx.database.getColumns();
|
|
4247
4247
|
this.columns = i, this.allCellHeaders = [], this.leafCellHeaders = [], this.fixedLeftCellHeaders = [], this.fixedRightCellHeaders = [], this.centerCellHeaders = [], this.visibleHeight = this.height, this.visibleColumns = Gt(i);
|
|
4248
|
-
const s = rt(this.visibleColumns), o =
|
|
4248
|
+
const s = rt(this.visibleColumns), o = Q(this.visibleColumns);
|
|
4249
4249
|
this.height = t * s, this.width = o.reduce((f, x) => {
|
|
4250
4250
|
const u = x.width || 100, { maxWidth: w, minWidth: m } = x;
|
|
4251
4251
|
return w && u > w ? f + w : m && u < m ? f + m : f + u;
|
|
@@ -4253,7 +4253,10 @@ class De {
|
|
|
4253
4253
|
const r = xe(nt(this.visibleColumns, s));
|
|
4254
4254
|
this.render(r, 0), this.ctx.database.updateColIndexKeyMap(this.leafCellHeaders);
|
|
4255
4255
|
const a = this.ctx.containerElement.getBoundingClientRect();
|
|
4256
|
-
this.resizeNum > 0 ? this.ctx.stageWidth = Math.floor(a.width) : this.ctx.stageWidth = Math.
|
|
4256
|
+
this.resizeNum > 0 ? this.ctx.stageWidth = Math.floor(a.width) : this.ctx.stageWidth = Math.min(
|
|
4257
|
+
Math.floor(this.width + e),
|
|
4258
|
+
Math.floor(a.width)
|
|
4259
|
+
), this.ctx.stageElement.style.width = this.ctx.stageWidth + "px", this.visibleWidth = this.ctx.stageWidth - e;
|
|
4257
4260
|
const l = this.visibleWidth - this.width;
|
|
4258
4261
|
if (this.resizeNum && l > 0) {
|
|
4259
4262
|
const f = Math.floor(l / this.resizeNum * 100) / 100;
|
|
@@ -4290,9 +4293,14 @@ class De {
|
|
|
4290
4293
|
this.ctx.stageElement.style.cursor === "col-resize" && (this.ctx.stageElement.style.cursor = "default");
|
|
4291
4294
|
const s = [...this.renderFixedCellHeaders, ...this.renderCenterCellHeaders];
|
|
4292
4295
|
for (const o of s) {
|
|
4293
|
-
const { offsetX: r, offsetY: a } = this.ctx.getOffset(t), l = r, c = o.getDrawX();
|
|
4294
|
-
l >
|
|
4295
|
-
|
|
4296
|
+
const { offsetX: r, offsetY: a } = this.ctx.getOffset(t), l = r, c = a, d = o.getDrawX(), f = o.getDrawY();
|
|
4297
|
+
if (l > d + o.width - 5 && l < d + o.width + 4 && l < e - 4 && // 视窗中最后一列不允许调整宽
|
|
4298
|
+
c > f) {
|
|
4299
|
+
const x = o.colIndex + o.colspan - 1, u = this.leafCellHeaders.find((w) => w.colIndex === x);
|
|
4300
|
+
if (!u || !u.fixed && this.ctx.stageWidth - this.ctx.fixedRightWidth < d + o.width)
|
|
4301
|
+
return;
|
|
4302
|
+
this.ctx.isTarget(t) && a <= this.height && (this.ctx.stageElement.style.cursor = "col-resize", this.resizeTarget = u);
|
|
4303
|
+
}
|
|
4296
4304
|
}
|
|
4297
4305
|
}
|
|
4298
4306
|
});
|
|
@@ -4307,7 +4315,7 @@ class De {
|
|
|
4307
4315
|
if (this.dragingCell && this.dragTarget) {
|
|
4308
4316
|
const t = (c, d = {}) => (c.forEach((f, x) => {
|
|
4309
4317
|
f.children && t(f.children, d), d[f.key] = x;
|
|
4310
|
-
}), d), e = this.ctx.database.getColumns(), i = nt(e, rt(e)), s = new He(
|
|
4318
|
+
}), d), e = this.ctx.database.getColumns(), i = nt(e, rt(e)), s = new He(at(i), {
|
|
4311
4319
|
key: "key",
|
|
4312
4320
|
// 节点唯一标识字段(对应我们之前的field)
|
|
4313
4321
|
childrenKey: "children"
|
|
@@ -4412,8 +4420,8 @@ class De {
|
|
|
4412
4420
|
for (let r = 0; r < i; r++) {
|
|
4413
4421
|
const a = t[r], l = o * (a.rowspan || 0), c = o * (a.level || 0);
|
|
4414
4422
|
let { minWidth: d, maxWidth: f } = a, x = a.width || 100;
|
|
4415
|
-
d && x < d && (x = d), f && x > f && (x = f), a.children && (x =
|
|
4416
|
-
const u = new
|
|
4423
|
+
d && x < d && (x = d), f && x > f && (x = f), a.children && (x = Q(a.children).reduce((m, g) => m + ((g == null ? void 0 : g.width) || 100), 0));
|
|
4424
|
+
const u = new Et(this.ctx, this.columnIndex, s, c, x, l, a);
|
|
4417
4425
|
this.ctx.database.setHeader(a.key, u), this.allCellHeaders.push(u), a.children || (this.leafCellHeaders.push(u), u.column.widthFillDisable || this.resizeNum++), a.fixed === "left" ? this.fixedLeftCellHeaders.push(u) : a.fixed === "right" ? this.fixedRightCellHeaders.push(u) : this.centerCellHeaders.push(u), !a.children && this.columnIndex++, a.children && this.render(a.children, s), s += x;
|
|
4418
4426
|
}
|
|
4419
4427
|
}
|
|
@@ -4547,7 +4555,7 @@ class Jt {
|
|
|
4547
4555
|
update() {
|
|
4548
4556
|
const { header: t } = this.ctx, e = [], i = [], s = [], o = [];
|
|
4549
4557
|
t.renderLeafCellHeaders.forEach((r) => {
|
|
4550
|
-
const a = new
|
|
4558
|
+
const a = new It(
|
|
4551
4559
|
this.ctx,
|
|
4552
4560
|
this.rowIndex,
|
|
4553
4561
|
r.colIndex,
|
|
@@ -4637,7 +4645,7 @@ class Ne {
|
|
|
4637
4645
|
const { data: u, sumHeight: w } = s.getData();
|
|
4638
4646
|
this.height = w, this.data = u, this.width = e.width, this.visibleWidth = this.ctx.stageWidth - r;
|
|
4639
4647
|
const m = this.ctx.footer.height;
|
|
4640
|
-
!this.data.length && !a ? this.height = l : !this.data.length && a && (this.height = a - e.height - m - r);
|
|
4648
|
+
this.ctx.isEmpty = !this.data.length, !this.data.length && !a ? this.height = l : !this.data.length && a && (this.height = a - e.height - m - r);
|
|
4641
4649
|
let g = this.height + e.height + r;
|
|
4642
4650
|
g += m;
|
|
4643
4651
|
let E = g;
|
|
@@ -4649,20 +4657,20 @@ class Ne {
|
|
|
4649
4657
|
E > 0 && (this.ctx.stageHeight = Math.floor(E), this.ctx.stageElement.style.height = `${this.ctx.stageHeight}px`);
|
|
4650
4658
|
let b = this.ctx.stageHeight - e.height - r;
|
|
4651
4659
|
o ? this.visibleHeight = b - m : this.visibleHeight = b, this.data.length || (this.height = this.visibleHeight), this.ctx.body.x = this.x, this.ctx.body.y = this.y, this.ctx.body.width = this.width, this.ctx.body.height = this.height, this.ctx.body.visibleWidth = this.visibleWidth, this.ctx.body.visibleHeight = this.visibleHeight, this.ctx.body.data = u;
|
|
4652
|
-
const y = window.devicePixelRatio || 1,
|
|
4653
|
-
t.width = Math.round(
|
|
4654
|
-
const
|
|
4660
|
+
const y = window.devicePixelRatio || 1, v = this.ctx.stageWidth * y, _ = this.ctx.stageHeight * y;
|
|
4661
|
+
t.width = Math.round(v), t.height = Math.round(_);
|
|
4662
|
+
const S = this.data.length ? "not-empty" : "empty";
|
|
4655
4663
|
this.ctx.emit("emptyChange", {
|
|
4656
|
-
isEmpty:
|
|
4657
|
-
type:
|
|
4664
|
+
isEmpty: S,
|
|
4665
|
+
type: S,
|
|
4658
4666
|
headerHeight: e.height,
|
|
4659
4667
|
bodyHeight: this.height,
|
|
4660
4668
|
footerHeight: m,
|
|
4661
4669
|
width: this.width,
|
|
4662
4670
|
height: this.data.length ? 0 : l + m
|
|
4663
4671
|
});
|
|
4664
|
-
const
|
|
4665
|
-
this.ctx.canvasElement.setAttribute("style", `height:${R}px;width:${
|
|
4672
|
+
const I = Math.round(t.width / y * 1e4) / 1e4, R = Math.round(t.height / y * 1e4) / 1e4;
|
|
4673
|
+
this.ctx.canvasElement.setAttribute("style", `height:${R}px;width:${I}px;`), this.ctx.paint.scale(y);
|
|
4666
4674
|
}
|
|
4667
4675
|
// 调整行的高度
|
|
4668
4676
|
initResizeRow() {
|
|
@@ -4742,13 +4750,13 @@ class Ne {
|
|
|
4742
4750
|
stageWidth: o,
|
|
4743
4751
|
config: { HEADER_BG_COLOR: r, SCROLLER_TRACK_SIZE: a }
|
|
4744
4752
|
} = this.ctx;
|
|
4745
|
-
if (i > 0 && t !== 0 && this.ctx.paint.drawShadow(this.x, this.y, t, this.height, {
|
|
4753
|
+
if (i > 0 && t !== 0 && !this.ctx.isEmpty && this.ctx.paint.drawShadow(this.x, this.y, t, this.height, {
|
|
4746
4754
|
fillColor: r,
|
|
4747
4755
|
side: "right",
|
|
4748
4756
|
shadowWidth: 4,
|
|
4749
4757
|
colorStart: "rgba(0,0,0,0.1)",
|
|
4750
4758
|
colorEnd: "rgba(0,0,0,0)"
|
|
4751
|
-
}), i < Math.floor(s.width - o - 1) && e !== a) {
|
|
4759
|
+
}), i < Math.floor(s.width - o - 1) && e !== a && !this.ctx.isEmpty) {
|
|
4752
4760
|
const l = s.width - (this.x + this.width) + o - e;
|
|
4753
4761
|
this.ctx.paint.drawShadow(l, this.y, e, this.height, {
|
|
4754
4762
|
fillColor: r,
|
|
@@ -4909,7 +4917,7 @@ class Xe {
|
|
|
4909
4917
|
this.moveFocus(t);
|
|
4910
4918
|
}), this.ctx.on(
|
|
4911
4919
|
"mousemove",
|
|
4912
|
-
|
|
4920
|
+
J((t) => {
|
|
4913
4921
|
var e, i;
|
|
4914
4922
|
(e = this.ctx.focusCell) != null && e.fixed || (i = this.ctx.focusCellHeader) != null && i.fixed || !this.ctx.dragHeaderIng && this.ctx.selectorMove && this.ctx.startAdjustPosition(t);
|
|
4915
4923
|
}, 100)
|
|
@@ -5021,8 +5029,8 @@ class Xe {
|
|
|
5021
5029
|
if (E < u || C > w || p < m || b > g)
|
|
5022
5030
|
return;
|
|
5023
5031
|
if (this.ctx.stageElement.focus({ preventScroll: !0 }), this.ctx.config.ENABLE_MERGE_CELL_LINK) {
|
|
5024
|
-
const
|
|
5025
|
-
p =
|
|
5032
|
+
const v = this.adjustMergeCells(o, r);
|
|
5033
|
+
p = v.yArr[0], b = v.yArr[1], E = v.xArr[0], C = v.xArr[1], this.ctx.onlyMergeCell = v.onlyMergeCell;
|
|
5026
5034
|
}
|
|
5027
5035
|
E === C && p === b ? this.ctx.selectOnlyOne = !0 : this.ctx.selectOnlyOne = !1, o = [Math.max(u, E), Math.min(w, C)], r = [Math.max(m, p), Math.min(g, b)];
|
|
5028
5036
|
const { BEFORE_SET_SELECTOR_METHOD: y } = this.ctx.config;
|
|
@@ -5272,16 +5280,16 @@ class Xe {
|
|
|
5272
5280
|
for (let p = 0; p <= r.length - 1; p++) {
|
|
5273
5281
|
const b = r[p].length;
|
|
5274
5282
|
for (let y = 0; y <= b - 1; y++) {
|
|
5275
|
-
const
|
|
5276
|
-
|
|
5283
|
+
const v = p + e, _ = y + i, S = r[p][y], I = this.ctx.database.getItemValueForRowIndexAndColIndex(
|
|
5284
|
+
v,
|
|
5277
5285
|
_
|
|
5278
5286
|
);
|
|
5279
|
-
if (
|
|
5280
|
-
const { rowKey: R, key:
|
|
5281
|
-
this.ctx.database.getReadonly(R,
|
|
5287
|
+
if (I) {
|
|
5288
|
+
const { rowKey: R, key: T } = I;
|
|
5289
|
+
this.ctx.database.getReadonly(R, T) || (s.add(R), g.push({
|
|
5282
5290
|
rowKey: R,
|
|
5283
|
-
key:
|
|
5284
|
-
value:
|
|
5291
|
+
key: T,
|
|
5292
|
+
value: S,
|
|
5285
5293
|
row: {}
|
|
5286
5294
|
//内部有设置
|
|
5287
5295
|
}));
|
|
@@ -5384,13 +5392,13 @@ class Xe {
|
|
|
5384
5392
|
return;
|
|
5385
5393
|
w && this.ctx.onlyMergeCell && i.updateSpanInfo();
|
|
5386
5394
|
const { drawX: m, drawY: g, width: E, height: C, fixed: p } = i, b = o - m + 1, y = i.drawX + E - (e - s) + 1;
|
|
5387
|
-
let
|
|
5395
|
+
let v = r.height - g, _ = C;
|
|
5388
5396
|
_ > l.visibleHeight && (_ = l.visibleHeight);
|
|
5389
|
-
let
|
|
5390
|
-
x && (u === "top" ?
|
|
5391
|
-
const
|
|
5392
|
-
let R = c,
|
|
5393
|
-
y > 0 && !p ? R = Math.floor(c + y) : b > 0 && !p && (R = Math.floor(c - b)),
|
|
5397
|
+
let S = 0;
|
|
5398
|
+
x && (u === "top" ? v = r.height + a.height - g : S = a.visibleHeight);
|
|
5399
|
+
const I = g + _ - (t - S - f);
|
|
5400
|
+
let R = c, T = d;
|
|
5401
|
+
y > 0 && !p ? R = Math.floor(c + y) : b > 0 && !p && (R = Math.floor(c - b)), v > 0 ? T = Math.floor(d - v) : I > 0 && (T = Math.floor(d + I)), (Math.abs(c - R) > 2 || Math.abs(d - T) > 2) && (this.ctx.adjustPositioning = !0, this.ctx.setScroll(R, T), this.ctx.emit("adjustBoundaryPosition", i));
|
|
5394
5402
|
}
|
|
5395
5403
|
destroy() {
|
|
5396
5404
|
}
|
|
@@ -5458,16 +5466,16 @@ class Be {
|
|
|
5458
5466
|
if (C < w || b < g)
|
|
5459
5467
|
return;
|
|
5460
5468
|
r = [Math.max(w, C), Math.min(m, p)], a = [Math.max(g, b), Math.min(E, y)];
|
|
5461
|
-
const { BEFORE_SET_AUTOFILL_METHOD:
|
|
5462
|
-
if (typeof
|
|
5463
|
-
const
|
|
5469
|
+
const { BEFORE_SET_AUTOFILL_METHOD: v } = this.ctx.config;
|
|
5470
|
+
if (typeof v == "function") {
|
|
5471
|
+
const S = v({
|
|
5464
5472
|
focusCell: this.ctx.focusCell,
|
|
5465
5473
|
xArr: r,
|
|
5466
5474
|
yArr: a
|
|
5467
5475
|
});
|
|
5468
|
-
if (!
|
|
5476
|
+
if (!S)
|
|
5469
5477
|
return;
|
|
5470
|
-
r =
|
|
5478
|
+
r = S.xArr, a = S.yArr;
|
|
5471
5479
|
}
|
|
5472
5480
|
this.ctx.autofill.xArr = r, this.ctx.autofill.yArr = a, this.ctx.emit("setAutofill", this.ctx.autofill), this.ctx.emit("draw");
|
|
5473
5481
|
}
|
|
@@ -5538,7 +5546,7 @@ class Be {
|
|
|
5538
5546
|
destroy() {
|
|
5539
5547
|
}
|
|
5540
5548
|
}
|
|
5541
|
-
const q = Math.min, z = Math.max,
|
|
5549
|
+
const q = Math.min, z = Math.max, lt = Math.round, ot = Math.floor, Y = (h) => ({
|
|
5542
5550
|
x: h,
|
|
5543
5551
|
y: h
|
|
5544
5552
|
}), Ye = {
|
|
@@ -5550,7 +5558,7 @@ const q = Math.min, z = Math.max, at = Math.round, ot = Math.floor, Y = (h) => (
|
|
|
5550
5558
|
start: "end",
|
|
5551
5559
|
end: "start"
|
|
5552
5560
|
};
|
|
5553
|
-
function
|
|
5561
|
+
function pt(h, t, e) {
|
|
5554
5562
|
return z(h, q(t, e));
|
|
5555
5563
|
}
|
|
5556
5564
|
function et(h, t) {
|
|
@@ -5565,27 +5573,27 @@ function it(h) {
|
|
|
5565
5573
|
function Qt(h) {
|
|
5566
5574
|
return h === "x" ? "y" : "x";
|
|
5567
5575
|
}
|
|
5568
|
-
function
|
|
5576
|
+
function vt(h) {
|
|
5569
5577
|
return h === "y" ? "height" : "width";
|
|
5570
5578
|
}
|
|
5571
5579
|
const Fe = /* @__PURE__ */ new Set(["top", "bottom"]);
|
|
5572
5580
|
function V(h) {
|
|
5573
5581
|
return Fe.has($(h)) ? "y" : "x";
|
|
5574
5582
|
}
|
|
5575
|
-
function
|
|
5583
|
+
function _t(h) {
|
|
5576
5584
|
return Qt(V(h));
|
|
5577
5585
|
}
|
|
5578
5586
|
function We(h, t, e) {
|
|
5579
5587
|
e === void 0 && (e = !1);
|
|
5580
|
-
const i = it(h), s =
|
|
5588
|
+
const i = it(h), s = _t(h), o = vt(s);
|
|
5581
5589
|
let r = s === "x" ? i === (e ? "end" : "start") ? "right" : "left" : i === "start" ? "bottom" : "top";
|
|
5582
|
-
return t.reference[o] > t.floating[o] && (r =
|
|
5590
|
+
return t.reference[o] > t.floating[o] && (r = ct(r)), [r, ct(r)];
|
|
5583
5591
|
}
|
|
5584
5592
|
function Ve(h) {
|
|
5585
|
-
const t =
|
|
5586
|
-
return [
|
|
5593
|
+
const t = ct(h);
|
|
5594
|
+
return [Ct(h), t, Ct(t)];
|
|
5587
5595
|
}
|
|
5588
|
-
function
|
|
5596
|
+
function Ct(h) {
|
|
5589
5597
|
return h.replace(/start|end/g, (t) => Ke[t]);
|
|
5590
5598
|
}
|
|
5591
5599
|
const Yt = ["left", "right"], Kt = ["right", "left"], Pe = ["top", "bottom"], ze = ["bottom", "top"];
|
|
@@ -5604,9 +5612,9 @@ function $e(h, t, e) {
|
|
|
5604
5612
|
function Ge(h, t, e, i) {
|
|
5605
5613
|
const s = it(h);
|
|
5606
5614
|
let o = $e($(h), e === "start", i);
|
|
5607
|
-
return s && (o = o.map((r) => r + "-" + s), t && (o = o.concat(o.map(
|
|
5615
|
+
return s && (o = o.map((r) => r + "-" + s), t && (o = o.concat(o.map(Ct)))), o;
|
|
5608
5616
|
}
|
|
5609
|
-
function
|
|
5617
|
+
function ct(h) {
|
|
5610
5618
|
return h.replace(/left|right|bottom|top/g, (t) => Ye[t]);
|
|
5611
5619
|
}
|
|
5612
5620
|
function Ue(h) {
|
|
@@ -5626,7 +5634,7 @@ function te(h) {
|
|
|
5626
5634
|
left: h
|
|
5627
5635
|
};
|
|
5628
5636
|
}
|
|
5629
|
-
function
|
|
5637
|
+
function ht(h) {
|
|
5630
5638
|
const {
|
|
5631
5639
|
x: t,
|
|
5632
5640
|
y: e,
|
|
@@ -5649,7 +5657,7 @@ function Ft(h, t, e) {
|
|
|
5649
5657
|
reference: i,
|
|
5650
5658
|
floating: s
|
|
5651
5659
|
} = h;
|
|
5652
|
-
const o = V(t), r =
|
|
5660
|
+
const o = V(t), r = _t(t), a = vt(r), l = $(t), c = o === "y", d = i.x + i.width / 2 - s.width / 2, f = i.y + i.height / 2 - s.height / 2, x = i[a] / 2 - s[a] / 2;
|
|
5653
5661
|
let u;
|
|
5654
5662
|
switch (l) {
|
|
5655
5663
|
case "top":
|
|
@@ -5692,7 +5700,7 @@ function Ft(h, t, e) {
|
|
|
5692
5700
|
}
|
|
5693
5701
|
return u;
|
|
5694
5702
|
}
|
|
5695
|
-
const
|
|
5703
|
+
const qe = async (h, t, e) => {
|
|
5696
5704
|
const {
|
|
5697
5705
|
placement: i = "bottom",
|
|
5698
5706
|
strategy: s = "absolute",
|
|
@@ -5769,7 +5777,7 @@ async function ee(h, t) {
|
|
|
5769
5777
|
elementContext: f = "floating",
|
|
5770
5778
|
altBoundary: x = !1,
|
|
5771
5779
|
padding: u = 0
|
|
5772
|
-
} = et(t, h), w = te(u), g = a[x ? f === "floating" ? "reference" : "floating" : f], E =
|
|
5780
|
+
} = et(t, h), w = te(u), g = a[x ? f === "floating" ? "reference" : "floating" : f], E = ht(await o.getClippingRect({
|
|
5773
5781
|
element: (e = await (o.isElement == null ? void 0 : o.isElement(g))) == null || e ? g : g.contextElement || await (o.getDocumentElement == null ? void 0 : o.getDocumentElement(a.floating)),
|
|
5774
5782
|
boundary: c,
|
|
5775
5783
|
rootBoundary: d,
|
|
@@ -5785,7 +5793,7 @@ async function ee(h, t) {
|
|
|
5785
5793
|
} : {
|
|
5786
5794
|
x: 1,
|
|
5787
5795
|
y: 1
|
|
5788
|
-
}, y =
|
|
5796
|
+
}, y = ht(o.convertOffsetParentRelativeRectToViewportRelativeRect ? await o.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
5789
5797
|
elements: a,
|
|
5790
5798
|
rect: C,
|
|
5791
5799
|
offsetParent: p,
|
|
@@ -5798,7 +5806,7 @@ async function ee(h, t) {
|
|
|
5798
5806
|
right: (y.right - E.right + w.right) / b.x
|
|
5799
5807
|
};
|
|
5800
5808
|
}
|
|
5801
|
-
const
|
|
5809
|
+
const je = (h) => ({
|
|
5802
5810
|
name: "arrow",
|
|
5803
5811
|
options: h,
|
|
5804
5812
|
async fn(t) {
|
|
@@ -5819,10 +5827,10 @@ const qe = (h) => ({
|
|
|
5819
5827
|
const f = te(d), x = {
|
|
5820
5828
|
x: e,
|
|
5821
5829
|
y: i
|
|
5822
|
-
}, u =
|
|
5823
|
-
let _ =
|
|
5824
|
-
(!_ || !await (r.isElement == null ? void 0 : r.isElement(
|
|
5825
|
-
const
|
|
5830
|
+
}, u = _t(s), w = vt(u), m = await r.getDimensions(c), g = u === "y", E = g ? "top" : "left", C = g ? "bottom" : "right", p = g ? "clientHeight" : "clientWidth", b = o.reference[w] + o.reference[u] - x[u] - o.floating[w], y = x[u] - o.reference[u], v = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(c));
|
|
5831
|
+
let _ = v ? v[p] : 0;
|
|
5832
|
+
(!_ || !await (r.isElement == null ? void 0 : r.isElement(v))) && (_ = a.floating[p] || o.floating[w]);
|
|
5833
|
+
const S = b / 2 - y / 2, I = _ / 2 - m[w] / 2 - 1, R = q(f[E], I), T = q(f[C], I), O = R, M = _ - m[w] - T, L = _ / 2 - m[w] / 2 + S, A = pt(O, L, M), D = !l.arrow && it(s) != null && L !== A && o.reference[w] / 2 - (L < O ? R : T) - m[w] / 2 < 0, H = D ? L < O ? L - O : L - M : 0;
|
|
5826
5834
|
return {
|
|
5827
5835
|
[u]: x[u] + H,
|
|
5828
5836
|
data: {
|
|
@@ -5859,20 +5867,20 @@ const qe = (h) => ({
|
|
|
5859
5867
|
} = et(h, t);
|
|
5860
5868
|
if ((e = o.arrow) != null && e.alignmentOffset)
|
|
5861
5869
|
return {};
|
|
5862
|
-
const E = $(s), C = V(a), p = $(a) === a, b = await (l.isRTL == null ? void 0 : l.isRTL(c.floating)), y = x || (p || !m ? [
|
|
5863
|
-
!x &&
|
|
5864
|
-
const _ = [a, ...y],
|
|
5870
|
+
const E = $(s), C = V(a), p = $(a) === a, b = await (l.isRTL == null ? void 0 : l.isRTL(c.floating)), y = x || (p || !m ? [ct(a)] : Ve(a)), v = w !== "none";
|
|
5871
|
+
!x && v && y.push(...Ge(a, m, w, b));
|
|
5872
|
+
const _ = [a, ...y], S = await ee(t, g), I = [];
|
|
5865
5873
|
let R = ((i = o.flip) == null ? void 0 : i.overflows) || [];
|
|
5866
|
-
if (d &&
|
|
5874
|
+
if (d && I.push(S[E]), f) {
|
|
5867
5875
|
const L = We(s, r, b);
|
|
5868
|
-
|
|
5876
|
+
I.push(S[L[0]], S[L[1]]);
|
|
5869
5877
|
}
|
|
5870
5878
|
if (R = [...R, {
|
|
5871
5879
|
placement: s,
|
|
5872
|
-
overflows:
|
|
5873
|
-
}], !
|
|
5874
|
-
var
|
|
5875
|
-
const L = (((
|
|
5880
|
+
overflows: I
|
|
5881
|
+
}], !I.every((L) => L <= 0)) {
|
|
5882
|
+
var T, O;
|
|
5883
|
+
const L = (((T = o.flip) == null ? void 0 : T.index) || 0) + 1, A = _[L];
|
|
5876
5884
|
if (A && (!(f === "alignment" ? C !== V(A) : !1) || // We leave the current main axis only if every placement on that axis
|
|
5877
5885
|
// overflows the main axis.
|
|
5878
5886
|
R.every((k) => V(k.placement) === C ? k.overflows[0] > 0 : !0)))
|
|
@@ -5891,7 +5899,7 @@ const qe = (h) => ({
|
|
|
5891
5899
|
case "bestFit": {
|
|
5892
5900
|
var M;
|
|
5893
5901
|
const H = (M = R.filter((k) => {
|
|
5894
|
-
if (
|
|
5902
|
+
if (v) {
|
|
5895
5903
|
const W = V(k.placement);
|
|
5896
5904
|
return W === C || // Create a bias to the `y` side axis due to horizontal
|
|
5897
5905
|
// reading directions favoring greater width.
|
|
@@ -5998,11 +6006,11 @@ const ti = function(h) {
|
|
|
5998
6006
|
let u = c[x], w = c[f];
|
|
5999
6007
|
if (o) {
|
|
6000
6008
|
const g = x === "y" ? "top" : "left", E = x === "y" ? "bottom" : "right", C = u + d[g], p = u - d[E];
|
|
6001
|
-
u =
|
|
6009
|
+
u = pt(C, u, p);
|
|
6002
6010
|
}
|
|
6003
6011
|
if (r) {
|
|
6004
6012
|
const g = f === "y" ? "top" : "left", E = f === "y" ? "bottom" : "right", C = w + d[g], p = w - d[E];
|
|
6005
|
-
w =
|
|
6013
|
+
w = pt(C, w, p);
|
|
6006
6014
|
}
|
|
6007
6015
|
const m = a.fn({
|
|
6008
6016
|
...t,
|
|
@@ -6026,7 +6034,7 @@ const ti = function(h) {
|
|
|
6026
6034
|
function xt() {
|
|
6027
6035
|
return typeof window < "u";
|
|
6028
6036
|
}
|
|
6029
|
-
function
|
|
6037
|
+
function Z(h) {
|
|
6030
6038
|
return ie(h) ? (h.nodeName || "").toLowerCase() : "#document";
|
|
6031
6039
|
}
|
|
6032
6040
|
function N(h) {
|
|
@@ -6061,7 +6069,7 @@ function st(h) {
|
|
|
6061
6069
|
}
|
|
6062
6070
|
const si = /* @__PURE__ */ new Set(["table", "td", "th"]);
|
|
6063
6071
|
function oi(h) {
|
|
6064
|
-
return si.has(
|
|
6072
|
+
return si.has(Z(h));
|
|
6065
6073
|
}
|
|
6066
6074
|
const ri = [":popover-open", ":modal"];
|
|
6067
6075
|
function gt(h) {
|
|
@@ -6074,14 +6082,14 @@ function gt(h) {
|
|
|
6074
6082
|
});
|
|
6075
6083
|
}
|
|
6076
6084
|
const ni = ["transform", "translate", "scale", "rotate", "perspective"], ai = ["transform", "translate", "scale", "rotate", "perspective", "filter"], li = ["paint", "layout", "strict", "content"];
|
|
6077
|
-
function
|
|
6078
|
-
const t =
|
|
6085
|
+
function St(h) {
|
|
6086
|
+
const t = Tt(), e = X(h) ? B(h) : h;
|
|
6079
6087
|
return ni.some((i) => e[i] ? e[i] !== "none" : !1) || (e.containerType ? e.containerType !== "normal" : !1) || !t && (e.backdropFilter ? e.backdropFilter !== "none" : !1) || !t && (e.filter ? e.filter !== "none" : !1) || ai.some((i) => (e.willChange || "").includes(i)) || li.some((i) => (e.contain || "").includes(i));
|
|
6080
6088
|
}
|
|
6081
6089
|
function ci(h) {
|
|
6082
6090
|
let t = P(h);
|
|
6083
|
-
for (; K(t) && !
|
|
6084
|
-
if (
|
|
6091
|
+
for (; K(t) && !j(t); ) {
|
|
6092
|
+
if (St(t))
|
|
6085
6093
|
return t;
|
|
6086
6094
|
if (gt(t))
|
|
6087
6095
|
return null;
|
|
@@ -6089,12 +6097,12 @@ function ci(h) {
|
|
|
6089
6097
|
}
|
|
6090
6098
|
return null;
|
|
6091
6099
|
}
|
|
6092
|
-
function
|
|
6100
|
+
function Tt() {
|
|
6093
6101
|
return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
|
|
6094
6102
|
}
|
|
6095
6103
|
const hi = /* @__PURE__ */ new Set(["html", "body", "#document"]);
|
|
6096
|
-
function
|
|
6097
|
-
return hi.has(
|
|
6104
|
+
function j(h) {
|
|
6105
|
+
return hi.has(Z(h));
|
|
6098
6106
|
}
|
|
6099
6107
|
function B(h) {
|
|
6100
6108
|
return N(h).getComputedStyle(h);
|
|
@@ -6109,7 +6117,7 @@ function wt(h) {
|
|
|
6109
6117
|
};
|
|
6110
6118
|
}
|
|
6111
6119
|
function P(h) {
|
|
6112
|
-
if (
|
|
6120
|
+
if (Z(h) === "html")
|
|
6113
6121
|
return h;
|
|
6114
6122
|
const t = (
|
|
6115
6123
|
// Step into the shadow DOM of the parent of a slotted node.
|
|
@@ -6122,36 +6130,36 @@ function P(h) {
|
|
|
6122
6130
|
}
|
|
6123
6131
|
function se(h) {
|
|
6124
6132
|
const t = P(h);
|
|
6125
|
-
return
|
|
6133
|
+
return j(t) ? h.ownerDocument ? h.ownerDocument.body : h.body : K(t) && st(t) ? t : se(t);
|
|
6126
6134
|
}
|
|
6127
6135
|
function tt(h, t, e) {
|
|
6128
6136
|
var i;
|
|
6129
6137
|
t === void 0 && (t = []), e === void 0 && (e = !0);
|
|
6130
6138
|
const s = se(h), o = s === ((i = h.ownerDocument) == null ? void 0 : i.body), r = N(s);
|
|
6131
6139
|
if (o) {
|
|
6132
|
-
const a =
|
|
6140
|
+
const a = yt(r);
|
|
6133
6141
|
return t.concat(r, r.visualViewport || [], st(s) ? s : [], a && e ? tt(a) : []);
|
|
6134
6142
|
}
|
|
6135
6143
|
return t.concat(s, tt(s, [], e));
|
|
6136
6144
|
}
|
|
6137
|
-
function
|
|
6145
|
+
function yt(h) {
|
|
6138
6146
|
return h.parent && Object.getPrototypeOf(h.parent) ? h.frameElement : null;
|
|
6139
6147
|
}
|
|
6140
6148
|
function oe(h) {
|
|
6141
6149
|
const t = B(h);
|
|
6142
6150
|
let e = parseFloat(t.width) || 0, i = parseFloat(t.height) || 0;
|
|
6143
|
-
const s = K(h), o = s ? h.offsetWidth : e, r = s ? h.offsetHeight : i, a =
|
|
6151
|
+
const s = K(h), o = s ? h.offsetWidth : e, r = s ? h.offsetHeight : i, a = lt(e) !== o || lt(i) !== r;
|
|
6144
6152
|
return a && (e = o, i = r), {
|
|
6145
6153
|
width: e,
|
|
6146
6154
|
height: i,
|
|
6147
6155
|
$: a
|
|
6148
6156
|
};
|
|
6149
6157
|
}
|
|
6150
|
-
function
|
|
6158
|
+
function Ot(h) {
|
|
6151
6159
|
return X(h) ? h : h.contextElement;
|
|
6152
6160
|
}
|
|
6153
6161
|
function U(h) {
|
|
6154
|
-
const t =
|
|
6162
|
+
const t = Ot(h);
|
|
6155
6163
|
if (!K(t))
|
|
6156
6164
|
return Y(1);
|
|
6157
6165
|
const e = t.getBoundingClientRect(), {
|
|
@@ -6159,7 +6167,7 @@ function U(h) {
|
|
|
6159
6167
|
height: s,
|
|
6160
6168
|
$: o
|
|
6161
6169
|
} = oe(t);
|
|
6162
|
-
let r = (o ?
|
|
6170
|
+
let r = (o ? lt(e.width) : e.width) / i, a = (o ? lt(e.height) : e.height) / s;
|
|
6163
6171
|
return (!r || !Number.isFinite(r)) && (r = 1), (!a || !Number.isFinite(a)) && (a = 1), {
|
|
6164
6172
|
x: r,
|
|
6165
6173
|
y: a
|
|
@@ -6168,7 +6176,7 @@ function U(h) {
|
|
|
6168
6176
|
const di = /* @__PURE__ */ Y(0);
|
|
6169
6177
|
function re(h) {
|
|
6170
6178
|
const t = N(h);
|
|
6171
|
-
return !
|
|
6179
|
+
return !Tt() || !t.visualViewport ? di : {
|
|
6172
6180
|
x: t.visualViewport.offsetLeft,
|
|
6173
6181
|
y: t.visualViewport.offsetTop
|
|
6174
6182
|
};
|
|
@@ -6178,27 +6186,27 @@ function fi(h, t, e) {
|
|
|
6178
6186
|
}
|
|
6179
6187
|
function G(h, t, e, i) {
|
|
6180
6188
|
t === void 0 && (t = !1), e === void 0 && (e = !1);
|
|
6181
|
-
const s = h.getBoundingClientRect(), o =
|
|
6189
|
+
const s = h.getBoundingClientRect(), o = Ot(h);
|
|
6182
6190
|
let r = Y(1);
|
|
6183
6191
|
t && (i ? X(i) && (r = U(i)) : r = U(h));
|
|
6184
6192
|
const a = fi(o, e, i) ? re(o) : Y(0);
|
|
6185
6193
|
let l = (s.left + a.x) / r.x, c = (s.top + a.y) / r.y, d = s.width / r.x, f = s.height / r.y;
|
|
6186
6194
|
if (o) {
|
|
6187
6195
|
const x = N(o), u = i && X(i) ? N(i) : i;
|
|
6188
|
-
let w = x, m =
|
|
6196
|
+
let w = x, m = yt(w);
|
|
6189
6197
|
for (; m && i && u !== w; ) {
|
|
6190
6198
|
const g = U(m), E = m.getBoundingClientRect(), C = B(m), p = E.left + (m.clientLeft + parseFloat(C.paddingLeft)) * g.x, b = E.top + (m.clientTop + parseFloat(C.paddingTop)) * g.y;
|
|
6191
|
-
l *= g.x, c *= g.y, d *= g.x, f *= g.y, l += p, c += b, w = N(m), m =
|
|
6199
|
+
l *= g.x, c *= g.y, d *= g.x, f *= g.y, l += p, c += b, w = N(m), m = yt(w);
|
|
6192
6200
|
}
|
|
6193
6201
|
}
|
|
6194
|
-
return
|
|
6202
|
+
return ht({
|
|
6195
6203
|
width: d,
|
|
6196
6204
|
height: f,
|
|
6197
6205
|
x: l,
|
|
6198
6206
|
y: c
|
|
6199
6207
|
});
|
|
6200
6208
|
}
|
|
6201
|
-
function
|
|
6209
|
+
function Lt(h, t) {
|
|
6202
6210
|
const e = wt(h).scrollLeft;
|
|
6203
6211
|
return t ? t.left + e : G(F(h)).left + e;
|
|
6204
6212
|
}
|
|
@@ -6206,7 +6214,7 @@ function ne(h, t, e) {
|
|
|
6206
6214
|
e === void 0 && (e = !1);
|
|
6207
6215
|
const i = h.getBoundingClientRect(), s = i.left + t.scrollLeft - (e ? 0 : (
|
|
6208
6216
|
// RTL <body> scrollbar.
|
|
6209
|
-
|
|
6217
|
+
Lt(h, i)
|
|
6210
6218
|
)), o = i.top + t.scrollTop;
|
|
6211
6219
|
return {
|
|
6212
6220
|
x: s,
|
|
@@ -6228,7 +6236,7 @@ function ui(h) {
|
|
|
6228
6236
|
scrollTop: 0
|
|
6229
6237
|
}, c = Y(1);
|
|
6230
6238
|
const d = Y(0), f = K(i);
|
|
6231
|
-
if ((f || !f && !o) && ((
|
|
6239
|
+
if ((f || !f && !o) && ((Z(i) !== "body" || st(r)) && (l = wt(i)), K(i))) {
|
|
6232
6240
|
const u = G(i);
|
|
6233
6241
|
c = U(i), d.x = u.x + i.clientLeft, d.y = u.y + i.clientTop;
|
|
6234
6242
|
}
|
|
@@ -6245,7 +6253,7 @@ function xi(h) {
|
|
|
6245
6253
|
}
|
|
6246
6254
|
function gi(h) {
|
|
6247
6255
|
const t = F(h), e = wt(h), i = h.ownerDocument.body, s = z(t.scrollWidth, t.clientWidth, i.scrollWidth, i.clientWidth), o = z(t.scrollHeight, t.clientHeight, i.scrollHeight, i.clientHeight);
|
|
6248
|
-
let r = -e.scrollLeft +
|
|
6256
|
+
let r = -e.scrollLeft + Lt(h);
|
|
6249
6257
|
const a = -e.scrollTop;
|
|
6250
6258
|
return B(i).direction === "rtl" && (r += z(t.clientWidth, i.clientWidth) - s), {
|
|
6251
6259
|
width: s,
|
|
@@ -6259,7 +6267,7 @@ function wi(h, t) {
|
|
|
6259
6267
|
let o = i.clientWidth, r = i.clientHeight, a = 0, l = 0;
|
|
6260
6268
|
if (s) {
|
|
6261
6269
|
o = s.width, r = s.height;
|
|
6262
|
-
const c =
|
|
6270
|
+
const c = Tt();
|
|
6263
6271
|
(!c || c && t === "fixed") && (a = s.offsetLeft, l = s.offsetTop);
|
|
6264
6272
|
}
|
|
6265
6273
|
return {
|
|
@@ -6296,21 +6304,21 @@ function Vt(h, t, e) {
|
|
|
6296
6304
|
height: t.height
|
|
6297
6305
|
};
|
|
6298
6306
|
}
|
|
6299
|
-
return
|
|
6307
|
+
return ht(i);
|
|
6300
6308
|
}
|
|
6301
6309
|
function ae(h, t) {
|
|
6302
6310
|
const e = P(h);
|
|
6303
|
-
return e === t || !X(e) ||
|
|
6311
|
+
return e === t || !X(e) || j(e) ? !1 : B(e).position === "fixed" || ae(e, t);
|
|
6304
6312
|
}
|
|
6305
6313
|
function pi(h, t) {
|
|
6306
6314
|
const e = t.get(h);
|
|
6307
6315
|
if (e)
|
|
6308
6316
|
return e;
|
|
6309
|
-
let i = tt(h, [], !1).filter((a) => X(a) &&
|
|
6317
|
+
let i = tt(h, [], !1).filter((a) => X(a) && Z(a) !== "body"), s = null;
|
|
6310
6318
|
const o = B(h).position === "fixed";
|
|
6311
6319
|
let r = o ? P(h) : h;
|
|
6312
|
-
for (; X(r) && !
|
|
6313
|
-
const a = B(r), l =
|
|
6320
|
+
for (; X(r) && !j(r); ) {
|
|
6321
|
+
const a = B(r), l = St(r);
|
|
6314
6322
|
!l && a.position === "fixed" && (s = null), (o ? !l && !s : !l && a.position === "static" && !!s && mi.has(s.position) || st(r) && !l && ae(h, r)) ? i = i.filter((d) => d !== r) : s = a, r = P(r);
|
|
6315
6323
|
}
|
|
6316
6324
|
return t.set(h, i), i;
|
|
@@ -6351,10 +6359,10 @@ function bi(h, t, e) {
|
|
|
6351
6359
|
};
|
|
6352
6360
|
const l = Y(0);
|
|
6353
6361
|
function c() {
|
|
6354
|
-
l.x =
|
|
6362
|
+
l.x = Lt(s);
|
|
6355
6363
|
}
|
|
6356
6364
|
if (i || !i && !o)
|
|
6357
|
-
if ((
|
|
6365
|
+
if ((Z(t) !== "body" || st(s)) && (a = wt(t)), i) {
|
|
6358
6366
|
const u = G(t, !0, o, t);
|
|
6359
6367
|
l.x = u.x + t.clientLeft, l.y = u.y + t.clientTop;
|
|
6360
6368
|
} else s && c();
|
|
@@ -6384,7 +6392,7 @@ function le(h, t) {
|
|
|
6384
6392
|
return e;
|
|
6385
6393
|
if (!K(h)) {
|
|
6386
6394
|
let s = P(h);
|
|
6387
|
-
for (; s && !
|
|
6395
|
+
for (; s && !j(s); ) {
|
|
6388
6396
|
if (X(s) && !mt(s))
|
|
6389
6397
|
return s;
|
|
6390
6398
|
s = P(s);
|
|
@@ -6394,7 +6402,7 @@ function le(h, t) {
|
|
|
6394
6402
|
let i = Pt(h, t);
|
|
6395
6403
|
for (; i && oi(i) && mt(i); )
|
|
6396
6404
|
i = Pt(i, t);
|
|
6397
|
-
return i &&
|
|
6405
|
+
return i && j(i) && mt(i) && !St(i) ? e : i || ci(h) || e;
|
|
6398
6406
|
}
|
|
6399
6407
|
const Ii = async function(h) {
|
|
6400
6408
|
const t = this.getOffsetParent || le, e = this.getDimensions, i = await e(h.floating);
|
|
@@ -6448,8 +6456,8 @@ function _i(h, t) {
|
|
|
6448
6456
|
threshold: z(0, q(1, l)) || 1
|
|
6449
6457
|
};
|
|
6450
6458
|
let b = !0;
|
|
6451
|
-
function y(
|
|
6452
|
-
const _ =
|
|
6459
|
+
function y(v) {
|
|
6460
|
+
const _ = v[0].intersectionRatio;
|
|
6453
6461
|
if (_ !== l) {
|
|
6454
6462
|
if (!b)
|
|
6455
6463
|
return r();
|
|
@@ -6472,7 +6480,7 @@ function _i(h, t) {
|
|
|
6472
6480
|
}
|
|
6473
6481
|
return r(!0), o;
|
|
6474
6482
|
}
|
|
6475
|
-
function
|
|
6483
|
+
function bt(h, t, e, i) {
|
|
6476
6484
|
i === void 0 && (i = {});
|
|
6477
6485
|
const {
|
|
6478
6486
|
ancestorScroll: s = !0,
|
|
@@ -6480,7 +6488,7 @@ function It(h, t, e, i) {
|
|
|
6480
6488
|
elementResize: r = typeof ResizeObserver == "function",
|
|
6481
6489
|
layoutShift: a = typeof IntersectionObserver == "function",
|
|
6482
6490
|
animationFrame: l = !1
|
|
6483
|
-
} = i, c =
|
|
6491
|
+
} = i, c = Ot(h), d = s || o ? [...c ? tt(c) : [], ...tt(t)] : [];
|
|
6484
6492
|
d.forEach((E) => {
|
|
6485
6493
|
s && E.addEventListener("scroll", e, {
|
|
6486
6494
|
passive: !0
|
|
@@ -6508,7 +6516,7 @@ function It(h, t, e, i) {
|
|
|
6508
6516
|
}), f == null || f(), (E = u) == null || E.disconnect(), u = null, l && cancelAnimationFrame(w);
|
|
6509
6517
|
};
|
|
6510
6518
|
}
|
|
6511
|
-
const
|
|
6519
|
+
const dt = ti, ft = ei, Mt = Ze, Si = je, ut = (h, t, e) => {
|
|
6512
6520
|
const i = /* @__PURE__ */ new Map(), s = {
|
|
6513
6521
|
platform: vi,
|
|
6514
6522
|
...e
|
|
@@ -6516,7 +6524,7 @@ const ht = ti, dt = ei, ft = Ze, Si = qe, ut = (h, t, e) => {
|
|
|
6516
6524
|
...s.platform,
|
|
6517
6525
|
_c: i
|
|
6518
6526
|
};
|
|
6519
|
-
return
|
|
6527
|
+
return qe(h, t, {
|
|
6520
6528
|
...s,
|
|
6521
6529
|
platform: o
|
|
6522
6530
|
});
|
|
@@ -6602,7 +6610,7 @@ let Ti = class {
|
|
|
6602
6610
|
}
|
|
6603
6611
|
}, this.floatingEl, {
|
|
6604
6612
|
placement: t.overflowTooltipPlacement,
|
|
6605
|
-
middleware: [
|
|
6613
|
+
middleware: [ft(), Mt(), dt(6), Si({ element: this.arrowEl })]
|
|
6606
6614
|
}).then((a) => {
|
|
6607
6615
|
const { x: l, y: c, placement: d, middlewareData: f } = a;
|
|
6608
6616
|
if (Object.assign(this.floatingEl.style, {
|
|
@@ -6812,7 +6820,7 @@ class Oi {
|
|
|
6812
6820
|
if (a === "none")
|
|
6813
6821
|
return;
|
|
6814
6822
|
const l = this.ctx.database.getReadonly(o, r);
|
|
6815
|
-
i && !l && (this.enable = !0, this.ctx.editing = !0, this.cellTarget = i, this.startEditByInput(this.cellTarget, t), this.ctx.emit("startEdit", this.cellTarget));
|
|
6823
|
+
i && !l && (this.ctx.emit("drawView"), this.enable = !0, this.ctx.editing = !0, this.cellTarget = i, this.startEditByInput(this.cellTarget, t), this.ctx.emit("startEdit", this.cellTarget));
|
|
6816
6824
|
}
|
|
6817
6825
|
editCell(t, e) {
|
|
6818
6826
|
const i = this.ctx.body.renderRows.find((c) => c.rowIndex === t);
|
|
@@ -6868,7 +6876,7 @@ class Mi {
|
|
|
6868
6876
|
n(this, "ctx");
|
|
6869
6877
|
n(this, "observer");
|
|
6870
6878
|
this.ctx = t, this.observer = new MutationObserver(
|
|
6871
|
-
|
|
6879
|
+
J(() => {
|
|
6872
6880
|
const e = this.ctx.overlayerElement.querySelectorAll('[data-auto-height="true"]'), i = /* @__PURE__ */ new Map();
|
|
6873
6881
|
e.forEach((r) => {
|
|
6874
6882
|
const a = Number(r.getAttribute("data-row-index")), l = Number(r.getAttribute("data-col-index"));
|
|
@@ -7143,7 +7151,7 @@ class zt {
|
|
|
7143
7151
|
handleHover(t) {
|
|
7144
7152
|
t.classList.contains("e-virt-table-menu-item") && (this.container.querySelectorAll(".e-virt-table-menu-item").forEach((i) => i.classList.remove("active")), t.classList.contains("disabled") || t.classList.add("active"));
|
|
7145
7153
|
const e = t._submenu || t.querySelector(".e-virt-table-submenu");
|
|
7146
|
-
e && this.showSubmenu(t, e);
|
|
7154
|
+
e && (this.hideSiblingSubmenus(t), this.showSubmenu(t, e));
|
|
7147
7155
|
}
|
|
7148
7156
|
handleLeave(t) {
|
|
7149
7157
|
const e = t._submenu || t.querySelector(".e-virt-table-submenu");
|
|
@@ -7152,17 +7160,32 @@ class zt {
|
|
|
7152
7160
|
i && !i.matches(":hover") && !t.matches(":hover") && (this.hideSubmenu(i), t.classList.contains("e-virt-table-menu-item") && t.classList.remove("active"));
|
|
7153
7161
|
}, 150);
|
|
7154
7162
|
}
|
|
7163
|
+
hideSiblingSubmenus(t) {
|
|
7164
|
+
let e;
|
|
7165
|
+
if (t.classList.contains("e-virt-table-menu-item"))
|
|
7166
|
+
e = this.container.querySelectorAll(".e-virt-table-menu-item");
|
|
7167
|
+
else {
|
|
7168
|
+
const i = t.closest(".e-virt-table-submenu");
|
|
7169
|
+
if (i)
|
|
7170
|
+
e = i.querySelectorAll(".e-virt-table-submenu-item");
|
|
7171
|
+
else
|
|
7172
|
+
return;
|
|
7173
|
+
}
|
|
7174
|
+
e.forEach((i) => {
|
|
7175
|
+
i !== t && i._submenu && this.hideSubmenu(i._submenu);
|
|
7176
|
+
});
|
|
7177
|
+
}
|
|
7155
7178
|
async showSubmenu(t, e) {
|
|
7156
7179
|
if (this.activeSubmenus.has(e)) return;
|
|
7157
7180
|
this.activeSubmenus.add(e), e.classList.add("show");
|
|
7158
|
-
const i =
|
|
7159
|
-
const { x:
|
|
7160
|
-
placement:
|
|
7161
|
-
middleware: [
|
|
7181
|
+
const i = bt(t, e, async () => {
|
|
7182
|
+
const s = this.container.getBoundingClientRect(), o = window.innerWidth, r = e.offsetWidth || 200, a = o - s.right, l = s.left, c = a >= r || a >= l ? "right-start" : "left-start", { x: d, y: f } = await ut(t, e, {
|
|
7183
|
+
placement: c,
|
|
7184
|
+
middleware: [dt(8), ft({ padding: 8 })]
|
|
7162
7185
|
});
|
|
7163
7186
|
Object.assign(e.style, {
|
|
7164
|
-
left: `${
|
|
7165
|
-
top: `${
|
|
7187
|
+
left: `${d}px`,
|
|
7188
|
+
top: `${f}px`
|
|
7166
7189
|
});
|
|
7167
7190
|
});
|
|
7168
7191
|
e._cleanup = i;
|
|
@@ -7225,10 +7248,10 @@ class zt {
|
|
|
7225
7248
|
}),
|
|
7226
7249
|
contextElement: document.body
|
|
7227
7250
|
};
|
|
7228
|
-
|
|
7251
|
+
bt(e, this.container, () => {
|
|
7229
7252
|
ut(e, this.container, {
|
|
7230
7253
|
placement: "right-start",
|
|
7231
|
-
middleware: [
|
|
7254
|
+
middleware: [dt(), ft(), Mt()]
|
|
7232
7255
|
}).then(({ x: i, y: s }) => {
|
|
7233
7256
|
this.container && Object.assign(this.container.style, {
|
|
7234
7257
|
left: `${i}px`,
|
|
@@ -7262,7 +7285,24 @@ class zt {
|
|
|
7262
7285
|
*/
|
|
7263
7286
|
removeSubMenuItem(t) {
|
|
7264
7287
|
const e = this.container.querySelector(`[data-submenu="${t}"]`);
|
|
7265
|
-
|
|
7288
|
+
if (!e)
|
|
7289
|
+
return !1;
|
|
7290
|
+
const i = e.closest(".e-virt-table-submenu"), s = e._submenu;
|
|
7291
|
+
if (s && this.cleanupSubmenuRecursively(s), e.remove(), i && i.querySelectorAll(".e-virt-table-submenu-item").length === 0) {
|
|
7292
|
+
const r = this.container.querySelector("[data-menu]");
|
|
7293
|
+
if (r && r._submenu === i)
|
|
7294
|
+
this.removeMenuItem(r.getAttribute("data-menu") || "");
|
|
7295
|
+
else {
|
|
7296
|
+
const a = this.container.querySelectorAll("[data-menu], [data-submenu]");
|
|
7297
|
+
for (const l of a)
|
|
7298
|
+
if (l._submenu === i) {
|
|
7299
|
+
const c = l.getAttribute("data-menu") || l.getAttribute("data-submenu");
|
|
7300
|
+
c && (l.hasAttribute("data-menu") ? this.removeMenuItem(c) : this.removeSubMenuItem(c));
|
|
7301
|
+
break;
|
|
7302
|
+
}
|
|
7303
|
+
}
|
|
7304
|
+
}
|
|
7305
|
+
return !0;
|
|
7266
7306
|
}
|
|
7267
7307
|
cleanupAllSubmenus(t) {
|
|
7268
7308
|
t.querySelectorAll(".e-virt-table-menu-item").forEach((i) => {
|
|
@@ -7306,37 +7346,36 @@ class Ai {
|
|
|
7306
7346
|
this.contextMenuEl.style.display = "block", this.positionMenu(e);
|
|
7307
7347
|
return;
|
|
7308
7348
|
}
|
|
7309
|
-
const {
|
|
7310
|
-
if (
|
|
7349
|
+
const { SELECTOR_AREA_MIN_X: i, SELECTOR_AREA_MAX_X: s, SELECTOR_AREA_MAX_X_OFFSET: o } = this.ctx.config, r = i, a = s || this.ctx.maxColIndex - o;
|
|
7350
|
+
if (t.colIndex < r || t.colIndex > a)
|
|
7351
|
+
return;
|
|
7352
|
+
const { HEADER_CONTEXT_MENU: l, CUSTOM_HEADER_CONTEXT_MENU: c, ENABLE_HEADER_CONTEXT_MENU: d } = this.ctx.config, f = [...l, ...c];
|
|
7353
|
+
if (!d || f.length === 0) return;
|
|
7311
7354
|
e.preventDefault();
|
|
7312
|
-
const { xArr:
|
|
7313
|
-
|
|
7314
|
-
const
|
|
7315
|
-
...
|
|
7316
|
-
children:
|
|
7317
|
-
|
|
7318
|
-
|
|
7319
|
-
|
|
7320
|
-
|
|
7321
|
-
|
|
7322
|
-
|
|
7323
|
-
onClick: (g, E) => {
|
|
7324
|
-
const { xArr: C } = this.ctx.selector, [p, b] = C;
|
|
7325
|
-
if (E === "fixedLeft" || E === "fixedRight" || E === "fixedNone") {
|
|
7326
|
-
const y = this.ctx.header.allCellHeaders.filter((I) => I.colIndex >= p && I.colIndex <= b).filter((I) => I.level === 0).filter((I) => !I.column.fixedDisabled).map((I) => I.key);
|
|
7355
|
+
const { xArr: x } = this.ctx.selector, [u, w] = x, { colIndex: m } = t;
|
|
7356
|
+
m >= u && m <= w || (this.ctx.focusCellHeader = t, this.ctx.emit("selectCols", t)), this.currentDOMTreeMenu && this.currentDOMTreeMenu.destroy();
|
|
7357
|
+
const E = this.ctx.database.getColumns(), C = f.map((p) => p.value === "visible" ? {
|
|
7358
|
+
...p,
|
|
7359
|
+
children: this.filterColumns(E)
|
|
7360
|
+
} : p);
|
|
7361
|
+
this.ctx.contextMenuIng = !0, this.currentDOMTreeMenu = new zt(this.contextMenuEl, C, {
|
|
7362
|
+
onClick: (p, b) => {
|
|
7363
|
+
const { xArr: y } = this.ctx.selector, [v, _] = y;
|
|
7364
|
+
if (b === "fixedLeft" || b === "fixedRight" || b === "fixedNone") {
|
|
7365
|
+
const S = this.ctx.header.allCellHeaders.filter((I) => I.colIndex >= v && I.colIndex <= _).filter((I) => I.level === 0).filter((I) => !I.column.fixedDisabled).map((I) => I.key);
|
|
7327
7366
|
this.ctx.database.setCustomHeaderFixedData(
|
|
7328
|
-
|
|
7329
|
-
|
|
7367
|
+
S,
|
|
7368
|
+
b === "fixedLeft" ? "left" : b === "fixedRight" ? "right" : ""
|
|
7330
7369
|
), this.hide();
|
|
7331
|
-
} else if (
|
|
7332
|
-
const
|
|
7333
|
-
|
|
7334
|
-
} else if (
|
|
7335
|
-
const
|
|
7336
|
-
this.ctx.database.setCustomHeaderHideData([
|
|
7370
|
+
} else if (b === "hide") {
|
|
7371
|
+
const S = this.ctx.header.leafCellHeaders.filter((I) => I.colIndex >= v && I.colIndex <= _).filter((I) => !I.children.length).filter((I) => !I.column.hideDisabled).map((I) => I.key);
|
|
7372
|
+
S.length > 0 && this.ctx.database.setCustomHeaderHideData(S, !0), this.hide();
|
|
7373
|
+
} else if (b !== "visible") if (b.startsWith("visible_")) {
|
|
7374
|
+
const S = b.replace("visible_", "");
|
|
7375
|
+
this.ctx.database.setCustomHeaderHideData([S], !1), this.currentDOMTreeMenu && this.currentDOMTreeMenu.removeSubMenuItem(b);
|
|
7337
7376
|
const I = this.ctx.database.getColumns();
|
|
7338
|
-
|
|
7339
|
-
} else
|
|
7377
|
+
Q(I).filter((O) => O.hide).length === 0 && this.hide();
|
|
7378
|
+
} else b === "resetHeader" && (this.ctx.database.resetCustomHeader(), this.hide());
|
|
7340
7379
|
}
|
|
7341
7380
|
}), this.positionMenu(e);
|
|
7342
7381
|
}), this.ctx.on("click", () => {
|
|
@@ -7357,10 +7396,10 @@ class Ai {
|
|
|
7357
7396
|
}),
|
|
7358
7397
|
contextElement: document.body
|
|
7359
7398
|
};
|
|
7360
|
-
|
|
7399
|
+
bt(e, this.contextMenuEl, () => {
|
|
7361
7400
|
ut(e, this.contextMenuEl, {
|
|
7362
7401
|
placement: "right-start",
|
|
7363
|
-
middleware: [
|
|
7402
|
+
middleware: [dt(), ft(), Mt()]
|
|
7364
7403
|
}).then(({ x: i, y: s }) => {
|
|
7365
7404
|
this.contextMenuEl && Object.assign(this.contextMenuEl.style, {
|
|
7366
7405
|
left: `${i}px`,
|
|
@@ -7369,6 +7408,21 @@ class Ai {
|
|
|
7369
7408
|
});
|
|
7370
7409
|
});
|
|
7371
7410
|
}
|
|
7411
|
+
filterColumns(t) {
|
|
7412
|
+
const e = [];
|
|
7413
|
+
for (const i of t)
|
|
7414
|
+
if (i.children && i.children.length > 0) {
|
|
7415
|
+
const s = this.filterColumns(i.children);
|
|
7416
|
+
s.length > 0 && e.push({
|
|
7417
|
+
label: i.title,
|
|
7418
|
+
value: `visible_${i.key}`,
|
|
7419
|
+
disabled: !0,
|
|
7420
|
+
// 非末级,且有子项保留 → disabled
|
|
7421
|
+
children: s
|
|
7422
|
+
});
|
|
7423
|
+
} else i.hide && e.push({ label: i.title, value: `visible_${i.key}` });
|
|
7424
|
+
return e;
|
|
7425
|
+
}
|
|
7372
7426
|
hide() {
|
|
7373
7427
|
this.currentDOMTreeMenu && (this.currentDOMTreeMenu.destroy(), this.currentDOMTreeMenu = void 0), this.contextMenuEl.style.display = "none", this.ctx.contextMenuIng = !1;
|
|
7374
7428
|
}
|
|
@@ -7435,7 +7489,7 @@ class Xi {
|
|
|
7435
7489
|
);
|
|
7436
7490
|
this.ctx = new Me(a, this.options), this.header = new De(this.ctx), this.footer = new ke(this.ctx), this.body = new Ne(this.ctx), this.scroller = new Ae(this.ctx), this.selector = new Xe(this.ctx), this.autofill = new Be(this.ctx), this.tooltip = new Ti(this.ctx), this.empty = new Li(this.ctx), this.editor = new Oi(this.ctx), this.overlayer = new Mi(this.ctx), this.contextMenu = new Ai(this.ctx), this.loading = new Hi(this.ctx), this.ctx.on(
|
|
7437
7491
|
"draw",
|
|
7438
|
-
|
|
7492
|
+
J(
|
|
7439
7493
|
() => {
|
|
7440
7494
|
this.draw();
|
|
7441
7495
|
},
|
|
@@ -7443,7 +7497,7 @@ class Xi {
|
|
|
7443
7497
|
)
|
|
7444
7498
|
), this.ctx.on(
|
|
7445
7499
|
"drawView",
|
|
7446
|
-
|
|
7500
|
+
J(
|
|
7447
7501
|
() => {
|
|
7448
7502
|
this.draw(!0);
|
|
7449
7503
|
},
|
|
@@ -7702,7 +7756,7 @@ class Xi {
|
|
|
7702
7756
|
mergeColCell: pe,
|
|
7703
7757
|
mergeRowCell: Ee,
|
|
7704
7758
|
getSpanArrByRow: Ut,
|
|
7705
|
-
getSpanObjByColumn:
|
|
7759
|
+
getSpanObjByColumn: qt
|
|
7706
7760
|
};
|
|
7707
7761
|
}
|
|
7708
7762
|
getColumnByKey(t) {
|