e-virt-table 1.3.0 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +4 -4
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +122 -120
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +4 -4
- package/dist/index.umd.js.map +1 -1
- package/dist/lib/ContextMenu.js +5 -1
- package/dist/lib/ContextMenu.js.map +1 -1
- package/dist/lib/EVirtTable.d.ts +2 -0
- package/dist/lib/EVirtTable.js +20 -2
- package/dist/lib/EVirtTable.js.map +1 -1
- package/dist/lib/Header.js +5 -4
- package/dist/lib/Header.js.map +1 -1
- package/dist/lib/types.d.ts +3 -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 8px 8px 14px;--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}.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;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;
|
|
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 8px 8px 14px;--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}.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;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:14px}.e-virt-table-menu-item:last-child,.e-virt-table-submenu-item:last-child{border-bottom:none}.menu-item-content{display:flex;align-items:center;flex:1}.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}.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);
|
|
@@ -335,7 +335,7 @@ class qt {
|
|
|
335
335
|
getRightFixedX() {
|
|
336
336
|
}
|
|
337
337
|
}
|
|
338
|
-
class
|
|
338
|
+
class Rt extends qt {
|
|
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 It 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 I = this.ctx.icons.get("loading");
|
|
545
|
+
a = "loading", o = I;
|
|
546
546
|
} else if (d) {
|
|
547
|
-
const
|
|
548
|
-
o = c ? _ :
|
|
547
|
+
const I = this.ctx.icons.get("expand"), _ = this.ctx.icons.get("shrink");
|
|
548
|
+
o = c ? _ : I, 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");
|
|
@@ -615,14 +615,14 @@ class It extends qt {
|
|
|
615
615
|
if (this.cellType === "footer") {
|
|
616
616
|
let _ = c, T = l;
|
|
617
617
|
if (typeof o == "function") {
|
|
618
|
-
const v = o, { backgroundColor:
|
|
618
|
+
const v = o, { backgroundColor: R, color: S, font: O } = v({
|
|
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
|
-
|
|
625
|
+
R && (_ = R), S && (T = S), O && (this.drawTextFont = O);
|
|
626
626
|
}
|
|
627
627
|
this.drawCellSkyBgColor = "transparent", this.drawCellBgColor = _, this.drawTextColor = T;
|
|
628
628
|
return;
|
|
@@ -635,9 +635,9 @@ class It extends qt {
|
|
|
635
635
|
p = T[0], b = T[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: T, color: v, font:
|
|
638
|
+
let y = e, I = a;
|
|
639
|
+
if (this.ctx.database.getReadonly(this.rowKey, this.key) || (y = i, I = r), w && (this.rowIndex % 2 ? y = m : y = e), typeof s == "function") {
|
|
640
|
+
const _ = s, { backgroundColor: T, color: v, font: R } = _({
|
|
641
641
|
row: this.row,
|
|
642
642
|
rowIndex: this.rowIndex,
|
|
643
643
|
colIndex: this.colIndex,
|
|
@@ -645,9 +645,9 @@ class It extends qt {
|
|
|
645
645
|
isHasChanged: this.isHasChanged,
|
|
646
646
|
value: this.getValue()
|
|
647
647
|
}) || {};
|
|
648
|
-
T && (y = T), v && (
|
|
648
|
+
T && (y = T), v && (I = v), R && (this.drawTextFont = R);
|
|
649
649
|
}
|
|
650
|
-
this.drawCellBgColor = y, this.drawTextColor =
|
|
650
|
+
this.drawCellBgColor = y, this.drawTextColor = I;
|
|
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 It 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 || {}, I = y * C;
|
|
663
|
+
w = u + p + I;
|
|
664
664
|
}
|
|
665
665
|
}
|
|
666
666
|
let g = this.ctx.icons.get("checkbox-uncheck"), E = "checkbox-uncheck";
|
|
@@ -969,8 +969,8 @@ class It 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, I = r === E ? 1 : 0;
|
|
973
|
+
this.ctx.paint.drawLine([c + I, d + 1, c + l - y, d + 1], {
|
|
974
974
|
borderColor: m,
|
|
975
975
|
fillColor: g,
|
|
976
976
|
borderWidth: w,
|
|
@@ -980,8 +980,8 @@ class It 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, I = o === b ? 1 : 0;
|
|
984
|
+
this.ctx.paint.drawLine([c + l - 1, d + y, c + l - 1, d + a - I], {
|
|
985
985
|
borderColor: m,
|
|
986
986
|
fillColor: g,
|
|
987
987
|
borderWidth: w,
|
|
@@ -991,8 +991,8 @@ class It 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, I = r === E ? 1 : 0;
|
|
995
|
+
this.ctx.paint.drawLine([c + I, 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 It 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, I = o === p ? 1 : 0;
|
|
1006
|
+
this.ctx.paint.drawLine([c + 1, d + I, c + 1, d + a - y], {
|
|
1007
1007
|
borderColor: m,
|
|
1008
1008
|
fillColor: g,
|
|
1009
1009
|
borderWidth: w,
|
|
@@ -1987,41 +1987,41 @@ 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, I = 0, _ = 0, T = 0;
|
|
1991
1991
|
if (d !== 1 && w) {
|
|
1992
1992
|
T = x;
|
|
1993
|
-
const v = l.reduce((
|
|
1993
|
+
const v = l.reduce((R, S) => {
|
|
1994
1994
|
const O = this.getItemValue(s, S) ?? "";
|
|
1995
|
-
return `${
|
|
1995
|
+
return `${R}${O}`;
|
|
1996
1996
|
}, "");
|
|
1997
|
-
for (let
|
|
1998
|
-
const S = this.rowIndexRowKeyMap.get(
|
|
1997
|
+
for (let R = e - 1; R >= 0; R--) {
|
|
1998
|
+
const S = this.rowIndexRowKeyMap.get(R) || "", O = l.reduce((M, L) => {
|
|
1999
1999
|
const A = this.getItemValue(S, L) ?? "";
|
|
2000
2000
|
return `${M}${A}`;
|
|
2001
2001
|
}, "");
|
|
2002
2002
|
if (v === O)
|
|
2003
|
-
g =
|
|
2003
|
+
g = R;
|
|
2004
2004
|
else
|
|
2005
2005
|
break;
|
|
2006
2006
|
}
|
|
2007
|
-
for (let
|
|
2008
|
-
const S = this.rowIndexRowKeyMap.get(
|
|
2007
|
+
for (let R = e; R <= this.ctx.maxRowIndex; R++) {
|
|
2008
|
+
const S = this.rowIndexRowKeyMap.get(R) || "", O = l.reduce((M, L) => {
|
|
2009
2009
|
const A = this.getItemValue(S, L) ?? "";
|
|
2010
2010
|
return `${M}${A}`;
|
|
2011
2011
|
}, "");
|
|
2012
2012
|
if (v === O)
|
|
2013
|
-
E =
|
|
2013
|
+
E = R;
|
|
2014
2014
|
else
|
|
2015
2015
|
break;
|
|
2016
2016
|
}
|
|
2017
|
-
for (let
|
|
2018
|
-
const { height: S } = this.positions[
|
|
2017
|
+
for (let R = g; R < e; R++) {
|
|
2018
|
+
const { height: S } = this.positions[R];
|
|
2019
2019
|
y += S;
|
|
2020
2020
|
}
|
|
2021
|
-
for (let
|
|
2022
|
-
const { height: S } = this.positions[
|
|
2021
|
+
for (let R = g; R <= E; R++) {
|
|
2022
|
+
const { height: S } = this.positions[R];
|
|
2023
2023
|
_ += S;
|
|
2024
|
-
const O = this.rowIndexRowKeyMap.get(
|
|
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,
|
|
2027
2027
|
key: i,
|
|
@@ -2033,39 +2033,39 @@ class be {
|
|
|
2033
2033
|
if (u !== 1 && m) {
|
|
2034
2034
|
_ = f;
|
|
2035
2035
|
for (let v = a - 1; v >= 0; v--) {
|
|
2036
|
-
const
|
|
2037
|
-
if (!
|
|
2036
|
+
const R = this.getColumnByColIndex(v);
|
|
2037
|
+
if (!R)
|
|
2038
2038
|
break;
|
|
2039
|
-
const S = this.getItemValue(s, i), O = this.getItemValue(s,
|
|
2040
|
-
if (S === O && c.includes(
|
|
2039
|
+
const S = this.getItemValue(s, i), O = this.getItemValue(s, R.key);
|
|
2040
|
+
if (S === O && c.includes(R.key))
|
|
2041
2041
|
C = v;
|
|
2042
2042
|
else
|
|
2043
2043
|
break;
|
|
2044
2044
|
}
|
|
2045
2045
|
for (let v = a; v <= this.ctx.maxColIndex; v++) {
|
|
2046
|
-
const
|
|
2047
|
-
if (!
|
|
2046
|
+
const R = this.getColumnByColIndex(v);
|
|
2047
|
+
if (!R)
|
|
2048
2048
|
break;
|
|
2049
|
-
const S = this.getItemValue(s, i), O = this.getItemValue(s,
|
|
2050
|
-
if (S === O && c.includes(
|
|
2049
|
+
const S = this.getItemValue(s, i), O = this.getItemValue(s, R.key);
|
|
2050
|
+
if (S === O && c.includes(R.key))
|
|
2051
2051
|
p = v;
|
|
2052
2052
|
else
|
|
2053
2053
|
break;
|
|
2054
2054
|
}
|
|
2055
2055
|
for (let v = C; v < a; v++) {
|
|
2056
|
-
const
|
|
2057
|
-
if (!
|
|
2056
|
+
const R = this.getColumnByColIndex(v);
|
|
2057
|
+
if (!R)
|
|
2058
2058
|
break;
|
|
2059
|
-
|
|
2059
|
+
I += R.width || 100;
|
|
2060
2060
|
}
|
|
2061
2061
|
for (let v = C; v <= p; v++) {
|
|
2062
|
-
const
|
|
2063
|
-
if (!
|
|
2062
|
+
const R = this.getColumnByColIndex(v);
|
|
2063
|
+
if (!R)
|
|
2064
2064
|
break;
|
|
2065
|
-
T +=
|
|
2065
|
+
T += R.width || 100, b.push({
|
|
2066
2066
|
rowKey: s,
|
|
2067
|
-
key:
|
|
2068
|
-
value: this.getItemValue(s,
|
|
2067
|
+
key: R.key,
|
|
2068
|
+
value: this.getItemValue(s, R.key),
|
|
2069
2069
|
row: o
|
|
2070
2070
|
});
|
|
2071
2071
|
}
|
|
@@ -2078,7 +2078,7 @@ class be {
|
|
|
2078
2078
|
height: _,
|
|
2079
2079
|
width: T,
|
|
2080
2080
|
offsetTop: y,
|
|
2081
|
-
offsetLeft:
|
|
2081
|
+
offsetLeft: I,
|
|
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 Rt(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);
|
|
@@ -2218,7 +2218,7 @@ class be {
|
|
|
2218
2218
|
return e(t, i), i;
|
|
2219
2219
|
}
|
|
2220
2220
|
}
|
|
2221
|
-
class
|
|
2221
|
+
class Ie {
|
|
2222
2222
|
constructor(t) {
|
|
2223
2223
|
n(this, "ctx");
|
|
2224
2224
|
n(this, "history", []);
|
|
@@ -2273,7 +2273,7 @@ class Re {
|
|
|
2273
2273
|
this.history = [], this.historyIndex = -1;
|
|
2274
2274
|
}
|
|
2275
2275
|
}
|
|
2276
|
-
class
|
|
2276
|
+
class Re {
|
|
2277
2277
|
constructor(t) {
|
|
2278
2278
|
n(this, "eventTasks", /* @__PURE__ */ new Set());
|
|
2279
2279
|
n(this, "ctx");
|
|
@@ -2489,7 +2489,7 @@ class _e {
|
|
|
2489
2489
|
* @returns 是否溢出
|
|
2490
2490
|
*/
|
|
2491
2491
|
drawText(t = "", e, i, s, o, r = {}) {
|
|
2492
|
-
var
|
|
2492
|
+
var R;
|
|
2493
2493
|
this.ctx.save();
|
|
2494
2494
|
const {
|
|
2495
2495
|
font: a = "12px Arial",
|
|
@@ -2504,19 +2504,19 @@ class _e {
|
|
|
2504
2504
|
} = r;
|
|
2505
2505
|
if (this.ctx.font = a, this.ctx.fillStyle = c, this.ctx.textAlign = l, ["", null, void 0].includes(t))
|
|
2506
2506
|
return this.ctx.restore(), !1;
|
|
2507
|
-
const E = parseInt(((
|
|
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), I = Math.min(y.length, Math.max(b, 1));
|
|
2511
|
+
x === "auto" && u ? I = y.length : typeof x == "number" && x < I && x !== 1 ? I = x : (x === 1 && (y = [t], I = 1), x === "auto" && b === 1 && (y = [t], I = 1));
|
|
2512
2512
|
let _ = i + d;
|
|
2513
|
-
const T = Math.round(
|
|
2513
|
+
const T = Math.round(I * E);
|
|
2514
2514
|
f === "middle" ? _ = i + (o - T) / 2 : f === "bottom" && (_ = i + o - T - d);
|
|
2515
2515
|
let v = e + d + w;
|
|
2516
2516
|
l === "center" ? v = e + s / 2 : l === "right" && (v = e + s - d - m);
|
|
2517
2517
|
for (let S = 0; S < y.length; S++) {
|
|
2518
2518
|
const O = y[S], M = _ + S * E;
|
|
2519
|
-
if (this.ctx.textBaseline = "top", S ===
|
|
2519
|
+
if (this.ctx.textBaseline = "top", S === I - 1) {
|
|
2520
2520
|
const A = y.slice(S).join(""), { _text: D, ellipsis: H } = this.handleEllipsis(A, s, d, a);
|
|
2521
2521
|
this.ctx.fillText(D, v, M), p = H;
|
|
2522
2522
|
break;
|
|
@@ -3545,7 +3545,7 @@ class Le {
|
|
|
3545
3545
|
return;
|
|
3546
3546
|
}
|
|
3547
3547
|
}
|
|
3548
|
-
if (t instanceof
|
|
3548
|
+
if (t instanceof Rt) {
|
|
3549
3549
|
if (t.drawSelectionImageSource && this.isInsideElement(
|
|
3550
3550
|
r,
|
|
3551
3551
|
o,
|
|
@@ -3778,7 +3778,7 @@ class Me {
|
|
|
3778
3778
|
loadingElement: c,
|
|
3779
3779
|
contextMenuElement: d
|
|
3780
3780
|
} = t;
|
|
3781
|
-
this.containerElement = i, s.tabIndex = 0, this.stageElement = s, this.canvasElement = o, this.overlayerElement = r, this.editorElement = a, this.emptyElement = l, this.loadingElement = c, this.contextMenuElement = d, this.config = new Nt(e.config || {}), this.eventBus = new ve(), this.eventBrowser = new
|
|
3781
|
+
this.containerElement = i, s.tabIndex = 0, this.stageElement = s, this.canvasElement = o, this.overlayerElement = r, this.editorElement = a, this.emptyElement = l, this.loadingElement = c, this.contextMenuElement = d, this.config = new Nt(e.config || {}), this.eventBus = new ve(), this.eventBrowser = new Re(this), this.eventTable = new Le(this), this.paint = new _e(this.canvasElement), this.database = new be(this, e), this.history = new Ie(this), this.icons = new Oe(this);
|
|
3782
3782
|
}
|
|
3783
3783
|
setConfig(t) {
|
|
3784
3784
|
this.config = new Nt(t);
|
|
@@ -4299,7 +4299,7 @@ class De {
|
|
|
4299
4299
|
}
|
|
4300
4300
|
initDragColumn() {
|
|
4301
4301
|
this.ctx.on("cellHeaderMousedown", (t) => {
|
|
4302
|
-
this.ctx.config.ENABLE_DRAG_COLUMN && (t.column.
|
|
4302
|
+
this.ctx.config.ENABLE_DRAG_COLUMN && (t.column.dragDisabled || (this.dragTarget === t ? (this.ctx.dragHeaderIng = !0, this.dragCellDiff = this.ctx.mouseX - t.drawX, this.ctx.stageElement.style.cursor = "grabbing") : (this.dragTarget = t, this.ctx.dragHeaderIng = !1)));
|
|
4303
4303
|
}), this.ctx.on("cellMousedown", () => {
|
|
4304
4304
|
this.ctx.config.ENABLE_DRAG_COLUMN && (this.dragTarget = null, this.ctx.dragHeaderIng = !1);
|
|
4305
4305
|
}), this.ctx.on("mouseup", () => {
|
|
@@ -4328,9 +4328,9 @@ class De {
|
|
|
4328
4328
|
}), this.ctx.on("mousemove", (t) => {
|
|
4329
4329
|
this.ctx.config.ENABLE_DRAG_COLUMN && (!this.ctx.dragHeaderIng || !this.dragTarget || (this.dragTarget.fixed || this.ctx.startAdjustPosition(t), this.ctx.emit("draw")));
|
|
4330
4330
|
}), this.ctx.on("cellHoverChange", (t) => {
|
|
4331
|
-
this.ctx.config.ENABLE_DRAG_COLUMN && (t.column.
|
|
4331
|
+
this.ctx.config.ENABLE_DRAG_COLUMN && (t.column.dragDisabled || (this.dragingCell = this.getDragCellHeader(t.colIndex)));
|
|
4332
4332
|
}), this.ctx.on("cellHeaderHoverChange", (t) => {
|
|
4333
|
-
this.ctx.config.ENABLE_DRAG_COLUMN && (t.column.
|
|
4333
|
+
this.ctx.config.ENABLE_DRAG_COLUMN && (t.column.dragDisabled || (this.dragingCell = this.getDragCellHeader(t.colIndex)));
|
|
4334
4334
|
});
|
|
4335
4335
|
}
|
|
4336
4336
|
getDragCellHeader(t) {
|
|
@@ -4426,12 +4426,12 @@ class De {
|
|
|
4426
4426
|
this.ctx.paint.drawLine(l, {
|
|
4427
4427
|
borderColor: e
|
|
4428
4428
|
});
|
|
4429
|
-
const
|
|
4430
|
-
this.ctx.paint.drawRect(a +
|
|
4429
|
+
const d = `${Math.floor(r + this.resizeDiff)}px`, f = 45, x = 24;
|
|
4430
|
+
this.ctx.paint.drawRect(a + f / 2, this.ctx.mouseY - x / 2, f, x, {
|
|
4431
4431
|
fillColor: s,
|
|
4432
4432
|
borderWidth: 0,
|
|
4433
4433
|
borderColor: "transparent"
|
|
4434
|
-
}), this.ctx.paint.drawText(
|
|
4434
|
+
}), this.ctx.paint.drawText(d, a + f / 2, this.ctx.mouseY - x / 2, f, x + 2, {
|
|
4435
4435
|
padding: 0,
|
|
4436
4436
|
color: i,
|
|
4437
4437
|
align: "center",
|
|
@@ -4547,7 +4547,7 @@ class Jt {
|
|
|
4547
4547
|
update() {
|
|
4548
4548
|
const { header: t } = this.ctx, e = [], i = [], s = [], o = [];
|
|
4549
4549
|
t.renderLeafCellHeaders.forEach((r) => {
|
|
4550
|
-
const a = new
|
|
4550
|
+
const a = new Rt(
|
|
4551
4551
|
this.ctx,
|
|
4552
4552
|
this.rowIndex,
|
|
4553
4553
|
r.colIndex,
|
|
@@ -4649,8 +4649,8 @@ class Ne {
|
|
|
4649
4649
|
E > 0 && (this.ctx.stageHeight = Math.floor(E), this.ctx.stageElement.style.height = `${this.ctx.stageHeight}px`);
|
|
4650
4650
|
let b = this.ctx.stageHeight - e.height - r;
|
|
4651
4651
|
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(
|
|
4652
|
+
const y = window.devicePixelRatio || 1, I = this.ctx.stageWidth * y, _ = this.ctx.stageHeight * y;
|
|
4653
|
+
t.width = Math.round(I), t.height = Math.round(_);
|
|
4654
4654
|
const T = this.data.length ? "not-empty" : "empty";
|
|
4655
4655
|
this.ctx.emit("emptyChange", {
|
|
4656
4656
|
isEmpty: T,
|
|
@@ -4661,8 +4661,8 @@ class Ne {
|
|
|
4661
4661
|
width: this.width,
|
|
4662
4662
|
height: this.data.length ? 0 : l + m
|
|
4663
4663
|
});
|
|
4664
|
-
const v = Math.round(t.width / y * 1e4) / 1e4,
|
|
4665
|
-
this.ctx.canvasElement.setAttribute("style", `height:${
|
|
4664
|
+
const v = Math.round(t.width / y * 1e4) / 1e4, R = Math.round(t.height / y * 1e4) / 1e4;
|
|
4665
|
+
this.ctx.canvasElement.setAttribute("style", `height:${R}px;width:${v}px;`), this.ctx.paint.scale(y);
|
|
4666
4666
|
}
|
|
4667
4667
|
// 调整行的高度
|
|
4668
4668
|
initResizeRow() {
|
|
@@ -5021,8 +5021,8 @@ class Xe {
|
|
|
5021
5021
|
if (E < u || C > w || p < m || b > g)
|
|
5022
5022
|
return;
|
|
5023
5023
|
if (this.ctx.stageElement.focus({ preventScroll: !0 }), this.ctx.config.ENABLE_MERGE_CELL_LINK) {
|
|
5024
|
-
const
|
|
5025
|
-
p =
|
|
5024
|
+
const I = this.adjustMergeCells(o, r);
|
|
5025
|
+
p = I.yArr[0], b = I.yArr[1], E = I.xArr[0], C = I.xArr[1], this.ctx.onlyMergeCell = I.onlyMergeCell;
|
|
5026
5026
|
}
|
|
5027
5027
|
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
5028
|
const { BEFORE_SET_SELECTOR_METHOD: y } = this.ctx.config;
|
|
@@ -5272,14 +5272,14 @@ class Xe {
|
|
|
5272
5272
|
for (let p = 0; p <= r.length - 1; p++) {
|
|
5273
5273
|
const b = r[p].length;
|
|
5274
5274
|
for (let y = 0; y <= b - 1; y++) {
|
|
5275
|
-
const
|
|
5276
|
-
|
|
5275
|
+
const I = p + e, _ = y + i, T = r[p][y], v = this.ctx.database.getItemValueForRowIndexAndColIndex(
|
|
5276
|
+
I,
|
|
5277
5277
|
_
|
|
5278
5278
|
);
|
|
5279
5279
|
if (v) {
|
|
5280
|
-
const { rowKey:
|
|
5281
|
-
this.ctx.database.getReadonly(
|
|
5282
|
-
rowKey:
|
|
5280
|
+
const { rowKey: R, key: S } = v;
|
|
5281
|
+
this.ctx.database.getReadonly(R, S) || (s.add(R), g.push({
|
|
5282
|
+
rowKey: R,
|
|
5283
5283
|
key: S,
|
|
5284
5284
|
value: T,
|
|
5285
5285
|
row: {}
|
|
@@ -5384,13 +5384,13 @@ class Xe {
|
|
|
5384
5384
|
return;
|
|
5385
5385
|
w && this.ctx.onlyMergeCell && i.updateSpanInfo();
|
|
5386
5386
|
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
|
|
5387
|
+
let I = r.height - g, _ = C;
|
|
5388
5388
|
_ > l.visibleHeight && (_ = l.visibleHeight);
|
|
5389
5389
|
let T = 0;
|
|
5390
|
-
x && (u === "top" ?
|
|
5390
|
+
x && (u === "top" ? I = r.height + a.height - g : T = a.visibleHeight);
|
|
5391
5391
|
const v = g + _ - (t - T - f);
|
|
5392
|
-
let
|
|
5393
|
-
y > 0 && !p ?
|
|
5392
|
+
let R = c, S = d;
|
|
5393
|
+
y > 0 && !p ? R = Math.floor(c + y) : b > 0 && !p && (R = Math.floor(c - b)), I > 0 ? S = Math.floor(d - I) : v > 0 && (S = Math.floor(d + v)), (Math.abs(c - R) > 2 || Math.abs(d - S) > 2) && (this.ctx.adjustPositioning = !0, this.ctx.setScroll(R, S), this.ctx.emit("adjustBoundaryPosition", i));
|
|
5394
5394
|
}
|
|
5395
5395
|
destroy() {
|
|
5396
5396
|
}
|
|
@@ -5458,9 +5458,9 @@ class Be {
|
|
|
5458
5458
|
if (C < w || b < g)
|
|
5459
5459
|
return;
|
|
5460
5460
|
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 T =
|
|
5461
|
+
const { BEFORE_SET_AUTOFILL_METHOD: I } = this.ctx.config;
|
|
5462
|
+
if (typeof I == "function") {
|
|
5463
|
+
const T = I({
|
|
5464
5464
|
focusCell: this.ctx.focusCell,
|
|
5465
5465
|
xArr: r,
|
|
5466
5466
|
yArr: a
|
|
@@ -5819,10 +5819,10 @@ const qe = (h) => ({
|
|
|
5819
5819
|
const f = te(d), x = {
|
|
5820
5820
|
x: e,
|
|
5821
5821
|
y: i
|
|
5822
|
-
}, u = St(s), w = _t(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],
|
|
5823
|
-
let _ =
|
|
5824
|
-
(!_ || !await (r.isElement == null ? void 0 : r.isElement(
|
|
5825
|
-
const T = b / 2 - y / 2, v = _ / 2 - m[w] / 2 - 1,
|
|
5822
|
+
}, u = St(s), w = _t(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], I = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(c));
|
|
5823
|
+
let _ = I ? I[p] : 0;
|
|
5824
|
+
(!_ || !await (r.isElement == null ? void 0 : r.isElement(I))) && (_ = a.floating[p] || o.floating[w]);
|
|
5825
|
+
const T = b / 2 - y / 2, v = _ / 2 - m[w] / 2 - 1, R = q(f[E], v), S = q(f[C], v), O = R, M = _ - m[w] - S, L = _ / 2 - m[w] / 2 + T, A = Ct(O, L, M), D = !l.arrow && it(s) != null && L !== A && o.reference[w] / 2 - (L < O ? R : S) - m[w] / 2 < 0, H = D ? L < O ? L - O : L - M : 0;
|
|
5826
5826
|
return {
|
|
5827
5827
|
[u]: x[u] + H,
|
|
5828
5828
|
data: {
|
|
@@ -5859,15 +5859,15 @@ const qe = (h) => ({
|
|
|
5859
5859
|
} = et(h, t);
|
|
5860
5860
|
if ((e = o.arrow) != null && e.alignmentOffset)
|
|
5861
5861
|
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 ? [lt(a)] : Ve(a)),
|
|
5863
|
-
!x &&
|
|
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 ? [lt(a)] : Ve(a)), I = w !== "none";
|
|
5863
|
+
!x && I && y.push(...Ge(a, m, w, b));
|
|
5864
5864
|
const _ = [a, ...y], T = await ee(t, g), v = [];
|
|
5865
|
-
let
|
|
5865
|
+
let R = ((i = o.flip) == null ? void 0 : i.overflows) || [];
|
|
5866
5866
|
if (d && v.push(T[E]), f) {
|
|
5867
5867
|
const L = We(s, r, b);
|
|
5868
5868
|
v.push(T[L[0]], T[L[1]]);
|
|
5869
5869
|
}
|
|
5870
|
-
if (
|
|
5870
|
+
if (R = [...R, {
|
|
5871
5871
|
placement: s,
|
|
5872
5872
|
overflows: v
|
|
5873
5873
|
}], !v.every((L) => L <= 0)) {
|
|
@@ -5875,23 +5875,23 @@ const qe = (h) => ({
|
|
|
5875
5875
|
const L = (((S = o.flip) == null ? void 0 : S.index) || 0) + 1, A = _[L];
|
|
5876
5876
|
if (A && (!(f === "alignment" ? C !== V(A) : !1) || // We leave the current main axis only if every placement on that axis
|
|
5877
5877
|
// overflows the main axis.
|
|
5878
|
-
|
|
5878
|
+
R.every((k) => V(k.placement) === C ? k.overflows[0] > 0 : !0)))
|
|
5879
5879
|
return {
|
|
5880
5880
|
data: {
|
|
5881
5881
|
index: L,
|
|
5882
|
-
overflows:
|
|
5882
|
+
overflows: R
|
|
5883
5883
|
},
|
|
5884
5884
|
reset: {
|
|
5885
5885
|
placement: A
|
|
5886
5886
|
}
|
|
5887
5887
|
};
|
|
5888
|
-
let D = (O =
|
|
5888
|
+
let D = (O = R.filter((H) => H.overflows[0] <= 0).sort((H, k) => H.overflows[1] - k.overflows[1])[0]) == null ? void 0 : O.placement;
|
|
5889
5889
|
if (!D)
|
|
5890
5890
|
switch (u) {
|
|
5891
5891
|
case "bestFit": {
|
|
5892
5892
|
var M;
|
|
5893
|
-
const H = (M =
|
|
5894
|
-
if (
|
|
5893
|
+
const H = (M = R.filter((k) => {
|
|
5894
|
+
if (I) {
|
|
5895
5895
|
const W = V(k.placement);
|
|
5896
5896
|
return W === C || // Create a bias to the `y` side axis due to horizontal
|
|
5897
5897
|
// reading directions favoring greater width.
|
|
@@ -6396,7 +6396,7 @@ function le(h, t) {
|
|
|
6396
6396
|
i = Pt(i, t);
|
|
6397
6397
|
return i && Z(i) && mt(i) && !Tt(i) ? e : i || ci(h) || e;
|
|
6398
6398
|
}
|
|
6399
|
-
const
|
|
6399
|
+
const Ii = async function(h) {
|
|
6400
6400
|
const t = this.getOffsetParent || le, e = this.getDimensions, i = await e(h.floating);
|
|
6401
6401
|
return {
|
|
6402
6402
|
reference: bi(h.reference, await t(h.floating), h.strategy),
|
|
@@ -6408,7 +6408,7 @@ const Ri = async function(h) {
|
|
|
6408
6408
|
}
|
|
6409
6409
|
};
|
|
6410
6410
|
};
|
|
6411
|
-
function
|
|
6411
|
+
function Ri(h) {
|
|
6412
6412
|
return B(h).direction === "rtl";
|
|
6413
6413
|
}
|
|
6414
6414
|
const vi = {
|
|
@@ -6416,12 +6416,12 @@ const vi = {
|
|
|
6416
6416
|
getDocumentElement: F,
|
|
6417
6417
|
getClippingRect: Ci,
|
|
6418
6418
|
getOffsetParent: le,
|
|
6419
|
-
getElementRects:
|
|
6419
|
+
getElementRects: Ii,
|
|
6420
6420
|
getClientRects: xi,
|
|
6421
6421
|
getDimensions: yi,
|
|
6422
6422
|
getScale: U,
|
|
6423
6423
|
isElement: X,
|
|
6424
|
-
isRTL:
|
|
6424
|
+
isRTL: Ri
|
|
6425
6425
|
};
|
|
6426
6426
|
function ce(h, t) {
|
|
6427
6427
|
return h.x === t.x && h.y === t.y && h.width === t.width && h.height === t.height;
|
|
@@ -6448,8 +6448,8 @@ function _i(h, t) {
|
|
|
6448
6448
|
threshold: z(0, q(1, l)) || 1
|
|
6449
6449
|
};
|
|
6450
6450
|
let b = !0;
|
|
6451
|
-
function y(
|
|
6452
|
-
const _ =
|
|
6451
|
+
function y(I) {
|
|
6452
|
+
const _ = I[0].intersectionRatio;
|
|
6453
6453
|
if (_ !== l) {
|
|
6454
6454
|
if (!b)
|
|
6455
6455
|
return r();
|
|
@@ -6472,7 +6472,7 @@ function _i(h, t) {
|
|
|
6472
6472
|
}
|
|
6473
6473
|
return r(!0), o;
|
|
6474
6474
|
}
|
|
6475
|
-
function
|
|
6475
|
+
function It(h, t, e, i) {
|
|
6476
6476
|
i === void 0 && (i = {});
|
|
6477
6477
|
const {
|
|
6478
6478
|
ancestorScroll: s = !0,
|
|
@@ -7155,7 +7155,7 @@ class zt {
|
|
|
7155
7155
|
async showSubmenu(t, e) {
|
|
7156
7156
|
if (this.activeSubmenus.has(e)) return;
|
|
7157
7157
|
this.activeSubmenus.add(e), e.classList.add("show");
|
|
7158
|
-
const i =
|
|
7158
|
+
const i = It(t, e, async () => {
|
|
7159
7159
|
const { x: s, y: o } = await ut(t, e, {
|
|
7160
7160
|
placement: "right-start",
|
|
7161
7161
|
middleware: [ht(8), ft(), dt({ padding: 8 })]
|
|
@@ -7225,7 +7225,7 @@ class zt {
|
|
|
7225
7225
|
}),
|
|
7226
7226
|
contextElement: document.body
|
|
7227
7227
|
};
|
|
7228
|
-
|
|
7228
|
+
It(e, this.container, () => {
|
|
7229
7229
|
ut(e, this.container, {
|
|
7230
7230
|
placement: "right-start",
|
|
7231
7231
|
middleware: [ht(), dt(), ft()]
|
|
@@ -7323,19 +7323,19 @@ class Ai {
|
|
|
7323
7323
|
onClick: (g, E) => {
|
|
7324
7324
|
const { xArr: C } = this.ctx.selector, [p, b] = C;
|
|
7325
7325
|
if (E === "fixedLeft" || E === "fixedRight" || E === "fixedNone") {
|
|
7326
|
-
const y = this.ctx.header.allCellHeaders.filter((
|
|
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);
|
|
7327
7327
|
this.ctx.database.setCustomHeaderFixedData(
|
|
7328
7328
|
y,
|
|
7329
7329
|
E === "fixedLeft" ? "left" : E === "fixedRight" ? "right" : ""
|
|
7330
7330
|
), this.hide();
|
|
7331
7331
|
} else if (E === "hide") {
|
|
7332
|
-
const y = this.ctx.header.leafCellHeaders.filter((
|
|
7333
|
-
this.ctx.database.setCustomHeaderHideData(y, !0), this.hide();
|
|
7332
|
+
const y = this.ctx.header.leafCellHeaders.filter((I) => I.colIndex >= p && I.colIndex <= b).filter((I) => !I.children.length).filter((I) => !I.column.hideDisabled).map((I) => I.key);
|
|
7333
|
+
y.length > 0 && this.ctx.database.setCustomHeaderHideData(y, !0), this.hide();
|
|
7334
7334
|
} else if (E !== "visible") if (E.startsWith("visible_")) {
|
|
7335
7335
|
const y = E.replace("visible_", "");
|
|
7336
7336
|
this.ctx.database.setCustomHeaderHideData([y], !1), this.currentDOMTreeMenu && this.currentDOMTreeMenu.removeSubMenuItem(E);
|
|
7337
|
-
const
|
|
7338
|
-
j(
|
|
7337
|
+
const I = this.ctx.database.getColumns();
|
|
7338
|
+
j(I).filter((v) => v.hide).length === 0 && this.hide();
|
|
7339
7339
|
} else E === "resetHeader" && (this.ctx.database.resetCustomHeader(), this.hide());
|
|
7340
7340
|
}
|
|
7341
7341
|
}), this.positionMenu(e);
|
|
@@ -7357,7 +7357,7 @@ class Ai {
|
|
|
7357
7357
|
}),
|
|
7358
7358
|
contextElement: document.body
|
|
7359
7359
|
};
|
|
7360
|
-
|
|
7360
|
+
It(e, this.contextMenuEl, () => {
|
|
7361
7361
|
ut(e, this.contextMenuEl, {
|
|
7362
7362
|
placement: "right-start",
|
|
7363
7363
|
middleware: [ht(), dt(), ft()]
|
|
@@ -7422,6 +7422,8 @@ class Xi {
|
|
|
7422
7422
|
n(this, "overlayer");
|
|
7423
7423
|
n(this, "contextMenu");
|
|
7424
7424
|
n(this, "loading");
|
|
7425
|
+
n(this, "animationFrameId");
|
|
7426
|
+
n(this, "animationFrameId2");
|
|
7425
7427
|
n(this, "ctx");
|
|
7426
7428
|
this.options = e;
|
|
7427
7429
|
const { overlayerElement: i, editorElement: s, emptyElement: o, contextMenuElement: r } = this.options, a = this.createContainer(
|
|
@@ -7467,9 +7469,9 @@ class Xi {
|
|
|
7467
7469
|
};
|
|
7468
7470
|
}
|
|
7469
7471
|
draw(t = !1) {
|
|
7470
|
-
requestAnimationFrame(() => {
|
|
7472
|
+
this.animationFrameId && cancelAnimationFrame(this.animationFrameId), this.animationFrameId = requestAnimationFrame(() => {
|
|
7471
7473
|
const e = performance.now();
|
|
7472
|
-
this.header.update(), this.footer.update(), this.body.update(), this.ctx.paint.clear(), this.body.draw(), this.footer.draw(), this.header.draw(), this.scroller.draw(), t || this.overlayer.draw(), requestAnimationFrame(() => {
|
|
7474
|
+
this.header.update(), this.footer.update(), this.body.update(), this.ctx.paint.clear(), this.body.draw(), this.footer.draw(), this.header.draw(), this.scroller.draw(), t || this.overlayer.draw(), this.animationFrameId2 && cancelAnimationFrame(this.animationFrameId2), this.animationFrameId2 = requestAnimationFrame(() => {
|
|
7473
7475
|
this.body.updateAutoHeight();
|
|
7474
7476
|
});
|
|
7475
7477
|
const i = performance.now(), s = Math.round(i - e);
|