e-virt-table 1.4.0 → 1.4.2
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 +14 -14
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +1038 -865
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +14 -14
- package/dist/index.umd.js.map +1 -1
- package/dist/lib/Body.js +17 -17
- package/dist/lib/Body.js.map +1 -1
- package/dist/lib/Cell.js +1 -1
- package/dist/lib/Cell.js.map +1 -1
- package/dist/lib/CellHeader.js +3 -0
- package/dist/lib/CellHeader.js.map +1 -1
- package/dist/lib/Config.d.ts +6 -0
- package/dist/lib/Config.js +21 -0
- package/dist/lib/Config.js.map +1 -1
- package/dist/lib/Context.d.ts +11 -0
- package/dist/lib/Context.js +49 -3
- package/dist/lib/Context.js.map +1 -1
- package/dist/lib/EVirtTable.d.ts +6 -0
- package/dist/lib/EVirtTable.js +14 -3
- package/dist/lib/EVirtTable.js.map +1 -1
- package/dist/lib/Editor.js +21 -28
- package/dist/lib/Editor.js.map +1 -1
- package/dist/lib/Empty.js +1 -1
- package/dist/lib/Empty.js.map +1 -1
- package/dist/lib/EventBrowser.js +10 -2
- package/dist/lib/EventBrowser.js.map +1 -1
- package/dist/lib/Header.js +12 -10
- package/dist/lib/Header.js.map +1 -1
- package/dist/lib/Overlayer.js +4 -11
- package/dist/lib/Overlayer.js.map +1 -1
- package/dist/lib/Paint.d.ts +2 -1
- package/dist/lib/Paint.js +6 -2
- package/dist/lib/Paint.js.map +1 -1
- package/dist/lib/Scroller.js +12 -4
- package/dist/lib/Scroller.js.map +1 -1
- package/dist/lib/Selector.js +3 -0
- package/dist/lib/Selector.js.map +1 -1
- package/dist/lib/TextSelector.d.ts +14 -11
- package/dist/lib/TextSelector.js +176 -165
- package/dist/lib/TextSelector.js.map +1 -1
- package/dist/lib/Tooltip.js +7 -13
- package/dist/lib/Tooltip.js.map +1 -1
- package/dist/lib/ZoomScale.d.ts +55 -0
- package/dist/lib/ZoomScale.js +137 -0
- package/dist/lib/ZoomScale.js.map +1 -0
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
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-body-bg-color: #fff;--evt-stripe-color: #fafafa;--evt-placeholder-color: #cdd0dc;--evt-header-bg-color: #f8faff;--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;background-color:var(--evt-body-bg-color);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(.e-virt-table-menu-item-icon){padding-left:8px}.e-virt-table-menu-item-content{display:flex;align-items:center;flex:1;min-width:0}.e-virt-table-menu-item-icon{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;margin-right:8px;flex-shrink:0}.e-virt-table-menu-item-icon svg{width:100%;height:100%;fill:currentColor}.e-virt-table-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}.e-virt-table-finder-bar{position:absolute;top:8px;right:16px;display:none;z-index:10000;background:#fff;border:1px solid #dadce0;border-radius:12px;box-shadow:0 2px 6px #0003;padding:0 8px;height:48px;min-width:250px;align-items:center;font-size:12px}.e-virt-table-finder-bar.show{display:flex}.e-virt-table-finder-bar-input-wrapper{display:flex;align-items:center;flex:1;padding:0 8px;position:relative}.e-virt-table-finder-bar-input{border:none;outline:none;flex:1;font-size:12px;background:transparent;color:#333;min-width:150px;padding-left:0;position:relative}.e-virt-table-finder-bar-nav{display:flex;flex-direction:row;gap:8px;margin:0 8px;align-items:center}.e-virt-table-finder-bar-nav-btn{border:none;background:transparent;cursor:pointer;padding:0;color:#666;border-radius:50%;display:flex;align-items:center;justify-content:center}.e-virt-table-finder-bar-nav-btn svg{width:24px;height:24px}.e-virt-table-finder-bar-nav-btn.prev-btn{transform:rotate(-90deg)}.e-virt-table-finder-bar-nav-btn.next-btn{transform:rotate(90deg)}.e-virt-table-finder-bar-nav-btn.close-btn{font-size:24px;color:#666;line-height:1;width:24px;height:24px}.e-virt-table-finder-bar-nav-btn:hover{color:#666;background-color:#f0f0f0}.e-virt-table-finder-bar-count{color:#666;font-size:12px;margin:0 8px;white-space:nowrap;flex-shrink:0}.e-virt-table-finder-bar-count.no-results{color:#999}.e-virt-table-finder-bar-loading{display:none;position:absolute;left:8px;top:0;width:16px;height:16px;flex-shrink:0;pointer-events:none;z-index:0}.e-virt-table-finder-bar-loading.show{display:block}.e-virt-table-finder-bar-loading svg{width:100%;height:100%;color:#666;animation:rotate 1s linear infinite}.e-virt-table-empty{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);font-size:14px;color:#666;z-index:15}")),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var r = (h, t, e) =>
|
|
5
|
-
class
|
|
2
|
+
var Ee = Object.defineProperty;
|
|
3
|
+
var pe = (h, t, e) => t in h ? Ee(h, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : h[t] = e;
|
|
4
|
+
var r = (h, t, e) => pe(h, typeof t != "symbol" ? t + "" : t, e);
|
|
5
|
+
class ye {
|
|
6
6
|
constructor(t) {
|
|
7
7
|
r(this, "rules");
|
|
8
8
|
this.rules = t;
|
|
@@ -60,13 +60,13 @@ class Ee {
|
|
|
60
60
|
return e;
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
|
-
function
|
|
63
|
+
function Qt() {
|
|
64
64
|
return "xxxxxxxxxxxxxxxxxx".replace(/[x]/g, function(h) {
|
|
65
65
|
const t = Math.random() * 16 | 0;
|
|
66
66
|
return (h === "x" ? t : t & 3 | 8).toString(16);
|
|
67
67
|
});
|
|
68
68
|
}
|
|
69
|
-
function
|
|
69
|
+
function Lt(h, t) {
|
|
70
70
|
let e = 0, i;
|
|
71
71
|
return function(...s) {
|
|
72
72
|
const o = (/* @__PURE__ */ new Date()).getTime(), n = o - e, a = typeof t == "function" ? t() : t;
|
|
@@ -75,10 +75,10 @@ function St(h, t) {
|
|
|
75
75
|
}, a - n));
|
|
76
76
|
};
|
|
77
77
|
}
|
|
78
|
-
function
|
|
79
|
-
return h.length ? h.map((t) =>
|
|
78
|
+
function at(h = []) {
|
|
79
|
+
return h.length ? h.map((t) => at(t.children) + 1).sort((t, e) => e - t)[0] : 0;
|
|
80
80
|
}
|
|
81
|
-
function
|
|
81
|
+
function Ce(h = []) {
|
|
82
82
|
let t = [], e = [], i = [];
|
|
83
83
|
return h.forEach((s) => {
|
|
84
84
|
s.fixed === "left" ? t.push(s) : s.fixed === "right" ? i.push(s) : e.push(s);
|
|
@@ -88,14 +88,14 @@ function pe(h = []) {
|
|
|
88
88
|
...i.sort((s, o) => (s.sort ?? 0) - (o.sort ?? 0))
|
|
89
89
|
];
|
|
90
90
|
}
|
|
91
|
-
function
|
|
91
|
+
function lt(h = [], t = 1, e = 0, i = "") {
|
|
92
92
|
return h.sort((s, o) => (s.sort ?? 0) - (o.sort ?? 0)).map((s) => {
|
|
93
93
|
if (s.children) {
|
|
94
94
|
let o = 0, n = s.fixed;
|
|
95
95
|
s.children.forEach((l) => {
|
|
96
96
|
l.fixed = n;
|
|
97
97
|
});
|
|
98
|
-
const a =
|
|
98
|
+
const a = lt(s.children, t - 1, e + 1, s.key);
|
|
99
99
|
return a && a.forEach((l) => {
|
|
100
100
|
o += l.colspan ?? 0;
|
|
101
101
|
}), {
|
|
@@ -117,30 +117,30 @@ function at(h = [], t = 1, e = 0, i = "") {
|
|
|
117
117
|
};
|
|
118
118
|
});
|
|
119
119
|
}
|
|
120
|
-
function
|
|
120
|
+
function et(h = []) {
|
|
121
121
|
let t = [];
|
|
122
122
|
return h.forEach((e) => {
|
|
123
|
-
e.children ? t = t.concat(
|
|
123
|
+
e.children ? t = t.concat(et(e.children)) : t.push(e);
|
|
124
124
|
}), t;
|
|
125
125
|
}
|
|
126
|
-
function
|
|
126
|
+
function te(h) {
|
|
127
127
|
return h.filter((t) => !t.hide).map((t) => Array.isArray(t.children) && t.children.length > 0 ? {
|
|
128
128
|
...t,
|
|
129
|
-
children:
|
|
129
|
+
children: te(t.children)
|
|
130
130
|
// 递归处理
|
|
131
131
|
} : { ...t });
|
|
132
132
|
}
|
|
133
|
-
const
|
|
134
|
-
function
|
|
133
|
+
const Xt = /^(\r\n|\n\r|\r|\n)/, be = /^[^\t\r\n]+/, Kt = /^\t/;
|
|
134
|
+
function Re(h) {
|
|
135
135
|
let t = [[""]];
|
|
136
136
|
if (h.length === 0)
|
|
137
137
|
return t;
|
|
138
138
|
let e = 0, i = 0, s;
|
|
139
139
|
for (; h.length > 0 && s !== h.length; )
|
|
140
|
-
if (s = h.length, h.match(
|
|
141
|
-
h = h.replace(
|
|
142
|
-
else if (h.match(
|
|
143
|
-
h = h.replace(
|
|
140
|
+
if (s = h.length, h.match(Kt))
|
|
141
|
+
h = h.replace(Kt, ""), e += 1, t[i][e] = "";
|
|
142
|
+
else if (h.match(Xt))
|
|
143
|
+
h = h.replace(Xt, ""), e = 0, i += 1, t[i] = [""];
|
|
144
144
|
else {
|
|
145
145
|
let o = "";
|
|
146
146
|
if (h.startsWith('"')) {
|
|
@@ -151,14 +151,14 @@ function Ce(h) {
|
|
|
151
151
|
}
|
|
152
152
|
o = o.replace(/^"/, "").replace(/"$/, "").replace(/["]*/g, (l) => new Array(Math.floor(l.length / 2)).fill('"').join(""));
|
|
153
153
|
} else {
|
|
154
|
-
const n = h.match(
|
|
154
|
+
const n = h.match(be);
|
|
155
155
|
o = n ? n[0] : "", h = h.slice(o.length);
|
|
156
156
|
}
|
|
157
157
|
t[i][e] = o;
|
|
158
158
|
}
|
|
159
159
|
return Array.isArray(t) && t.length > 1 && t[t.length - 1].length === 1 && t[t.length - 1][0] === "" && (t = t.slice(0, t.length - 1)), t;
|
|
160
160
|
}
|
|
161
|
-
function
|
|
161
|
+
function ve(h) {
|
|
162
162
|
let t, e, i, s, o = "", n;
|
|
163
163
|
for (t = 0, e = h.length; t < e; t += 1) {
|
|
164
164
|
for (s = h[t].length, i = 0; i < s; i += 1)
|
|
@@ -169,7 +169,7 @@ function be(h) {
|
|
|
169
169
|
}
|
|
170
170
|
return o;
|
|
171
171
|
}
|
|
172
|
-
function
|
|
172
|
+
function ee(h, t, e = []) {
|
|
173
173
|
let i = 0;
|
|
174
174
|
const s = [];
|
|
175
175
|
return h.forEach((o, n) => {
|
|
@@ -181,15 +181,15 @@ function Qt(h, t, e = []) {
|
|
|
181
181
|
}
|
|
182
182
|
}), s;
|
|
183
183
|
}
|
|
184
|
-
function
|
|
184
|
+
function ie(h, t) {
|
|
185
185
|
let e = "", i = "";
|
|
186
186
|
const s = {};
|
|
187
187
|
return t.forEach((o, n) => {
|
|
188
188
|
n === 0 ? (e = o.key, i = o.key, s[o.key] = 1) : h[o.key] === h[e] ? (s[o.key] = 0, s[i] += 1) : (s[o.key] = 1, e = o.key, i = o.key);
|
|
189
189
|
}), s;
|
|
190
190
|
}
|
|
191
|
-
function
|
|
192
|
-
const { visibleRows: i, rowIndex: s, headIndex: o } = h, n =
|
|
191
|
+
function Ie(h, t, e = []) {
|
|
192
|
+
const { visibleRows: i, rowIndex: s, headIndex: o } = h, n = ee(i, t, e);
|
|
193
193
|
return n[s - o] === 0 ? {
|
|
194
194
|
rowspan: 0,
|
|
195
195
|
colspan: 0,
|
|
@@ -202,10 +202,10 @@ function Re(h, t, e = []) {
|
|
|
202
202
|
mergeRow: !0
|
|
203
203
|
};
|
|
204
204
|
}
|
|
205
|
-
function
|
|
205
|
+
function _e(h, t = []) {
|
|
206
206
|
const { column: e, row: i, visibleLeafColumns: s } = h, o = s.filter((n) => t.includes(n.key));
|
|
207
207
|
if (t.includes(e.key)) {
|
|
208
|
-
const n =
|
|
208
|
+
const n = ie(i, o);
|
|
209
209
|
return n[e.key] === 0 ? {
|
|
210
210
|
rowspan: 0,
|
|
211
211
|
colspan: 0,
|
|
@@ -219,11 +219,11 @@ function Ie(h, t = []) {
|
|
|
219
219
|
};
|
|
220
220
|
}
|
|
221
221
|
}
|
|
222
|
-
function
|
|
222
|
+
function Te(h, t = document.documentElement) {
|
|
223
223
|
const e = h.startsWith("--") ? h : `--${h}`;
|
|
224
224
|
return getComputedStyle(t).getPropertyValue(e).trim();
|
|
225
225
|
}
|
|
226
|
-
function
|
|
226
|
+
function Yt(h) {
|
|
227
227
|
if (!h) return /* @__PURE__ */ new Date(0);
|
|
228
228
|
if (typeof h == "number")
|
|
229
229
|
return new Date(h);
|
|
@@ -277,15 +277,15 @@ function Xt(h) {
|
|
|
277
277
|
}
|
|
278
278
|
return /* @__PURE__ */ new Date(NaN);
|
|
279
279
|
}
|
|
280
|
-
function
|
|
281
|
-
const e =
|
|
280
|
+
function Se(h, t) {
|
|
281
|
+
const e = Yt(h), i = Yt(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 Oe(h) {
|
|
285
285
|
const t = String(h).match(/\.(\d+)/);
|
|
286
286
|
return (t == null ? void 0 : t[1].length) ?? 0;
|
|
287
287
|
}
|
|
288
|
-
class
|
|
288
|
+
class se {
|
|
289
289
|
constructor(t, e, i, s, o, n, a) {
|
|
290
290
|
r(this, "ctx");
|
|
291
291
|
r(this, "x", 0);
|
|
@@ -355,7 +355,7 @@ class ee {
|
|
|
355
355
|
return o ? o.isInside(i, s) : !1;
|
|
356
356
|
}
|
|
357
357
|
}
|
|
358
|
-
class
|
|
358
|
+
class Z {
|
|
359
359
|
constructor(t, e, i, s, o, n) {
|
|
360
360
|
r(this, "source");
|
|
361
361
|
r(this, "name");
|
|
@@ -380,7 +380,7 @@ class j {
|
|
|
380
380
|
return this.visible ? !!(this.source && t > this.x && t < this.x + this.width && e > this.y && e < this.y + this.height) : !1;
|
|
381
381
|
}
|
|
382
382
|
}
|
|
383
|
-
class
|
|
383
|
+
class oe extends se {
|
|
384
384
|
constructor(e, i, s, o, n, a, l, c, d, f = "body", u = !0) {
|
|
385
385
|
super(e, o, n, a, l, f, c.fixed);
|
|
386
386
|
r(this, "parentRowKey", "");
|
|
@@ -587,19 +587,19 @@ class ie extends ee {
|
|
|
587
587
|
const _ = this.ctx.icons.get("expand"), R = this.ctx.icons.get("shrink");
|
|
588
588
|
o = c ? R : _, a = c ? "shrink" : "expand";
|
|
589
589
|
}
|
|
590
|
-
let
|
|
591
|
-
(this.align === "center" || this.align === "right") && (y = this.drawX + (this.visibleWidth -
|
|
592
|
-
let
|
|
593
|
-
const
|
|
594
|
-
if (this.type === "selection-tree" &&
|
|
595
|
-
const _ =
|
|
596
|
-
|
|
597
|
-
} else this.type === "tree-selection" ? (
|
|
598
|
-
this.drawTextX =
|
|
590
|
+
let m = E, w = E, y = this.drawX;
|
|
591
|
+
(this.align === "center" || this.align === "right") && (y = this.drawX + (this.visibleWidth - m - 2 * e) / 2, this.align = "left");
|
|
592
|
+
let C = y + n + e, p = this.drawY + (this.visibleHeight - w) / 2, b = n + this.drawX + m - 0.5;
|
|
593
|
+
const v = this.getImage("selection"), I = this.getImage("drag"), T = I ? I.width : 0;
|
|
594
|
+
if (this.type === "selection-tree" && v) {
|
|
595
|
+
const _ = v.x, R = v.width;
|
|
596
|
+
C = n + _ + R, b = C + m - e / 2;
|
|
597
|
+
} else this.type === "tree-selection" ? (C += T, b = C + g + m - e / 2) : (C += T, b = C + m - e / 2);
|
|
598
|
+
this.drawTextX = b, this.drawTextWidth = this.drawX + this.visibleWidth - b, !(C + m + e > this.drawX + this.visibleWidth) && (p + w + e > this.drawY + this.visibleHeight || this.setImage("tree", new Z(a, C, p, m, w, o)));
|
|
599
599
|
}
|
|
600
600
|
updateDragImage() {
|
|
601
601
|
if (this.cellType === "body" && this.column.dragRow) {
|
|
602
|
-
const { DRAG_ROW_ICON_SIZE: e, CELL_PADDING: i } = this.ctx.config, s = this.drawX + i / 2, o = this.drawY + (this.visibleHeight - e) / 2, n = new
|
|
602
|
+
const { DRAG_ROW_ICON_SIZE: e, CELL_PADDING: i } = this.ctx.config, s = this.drawX + i / 2, o = this.drawY + (this.visibleHeight - e) / 2, n = new Z("drag", s, o, e, e, this.ctx.icons.get("drag"));
|
|
603
603
|
this.rowspan === 0 && n.setVisible(!1), this.setImage("drag", n);
|
|
604
604
|
}
|
|
605
605
|
}
|
|
@@ -610,12 +610,12 @@ class ie extends ee {
|
|
|
610
610
|
if (!l) return;
|
|
611
611
|
const c = l.x, d = l.y, f = l.width, u = l.height, x = c + f / 2, g = d + u / 2;
|
|
612
612
|
let E = c - a * i;
|
|
613
|
-
const
|
|
613
|
+
const m = Array.isArray(n.parentRowKeys) ? n.parentRowKeys : [];
|
|
614
614
|
if (a > 0) {
|
|
615
|
-
for (let
|
|
616
|
-
const
|
|
617
|
-
if (!!(
|
|
618
|
-
const _ = Math.round(c - (a -
|
|
615
|
+
for (let b = 0; b < a - 1; b += 1) {
|
|
616
|
+
const v = m[b + 1];
|
|
617
|
+
if (!!(v ? this.ctx.database.getRowForRowKey(v) || {} : {}).isLastChild) continue;
|
|
618
|
+
const _ = Math.round(c - (a - b) * i + s / 2);
|
|
619
619
|
this.ctx.paint.drawLine([_, this.drawY, _, this.drawY + this.visibleHeight], {
|
|
620
620
|
borderColor: o,
|
|
621
621
|
borderWidth: 1,
|
|
@@ -623,8 +623,8 @@ class ie extends ee {
|
|
|
623
623
|
lineDashOffset: 0
|
|
624
624
|
});
|
|
625
625
|
}
|
|
626
|
-
const
|
|
627
|
-
this.ctx.paint.drawLine([
|
|
626
|
+
const w = Math.round(c - i + s / 2), C = !!n.isLastChild ? g : this.drawY + this.visibleHeight;
|
|
627
|
+
this.ctx.paint.drawLine([w, this.drawY, w, C], {
|
|
628
628
|
borderColor: o,
|
|
629
629
|
borderWidth: 1,
|
|
630
630
|
lineDash: [4, 4],
|
|
@@ -639,8 +639,8 @@ class ie extends ee {
|
|
|
639
639
|
});
|
|
640
640
|
}
|
|
641
641
|
if (n.hasChildren && n.expand) {
|
|
642
|
-
const
|
|
643
|
-
this.ctx.paint.drawLine([x,
|
|
642
|
+
const w = d + u, y = this.drawY + this.visibleHeight;
|
|
643
|
+
this.ctx.paint.drawLine([x, w, x, y], {
|
|
644
644
|
borderColor: o,
|
|
645
645
|
borderWidth: 1,
|
|
646
646
|
lineDash: [4, 4],
|
|
@@ -664,7 +664,7 @@ class ie extends ee {
|
|
|
664
664
|
HIGHLIGHT_HOVER_ROW_COLOR: x,
|
|
665
665
|
STRIPE: g,
|
|
666
666
|
STRIPE_COLOR: E,
|
|
667
|
-
FINDER_CELL_BG_COLOR:
|
|
667
|
+
FINDER_CELL_BG_COLOR: m
|
|
668
668
|
} = this.ctx.config;
|
|
669
669
|
if (this.cellType === "footer") {
|
|
670
670
|
let S = c, O = l;
|
|
@@ -681,16 +681,16 @@ class ie extends ee {
|
|
|
681
681
|
this.drawCellSkyBgColor = "transparent", this.drawCellBgColor = S, this.drawTextColor = O;
|
|
682
682
|
return;
|
|
683
683
|
}
|
|
684
|
-
let
|
|
685
|
-
const y = this.ctx.hoverCell,
|
|
686
|
-
let p = this.rowIndex,
|
|
684
|
+
let w = "transparent";
|
|
685
|
+
const y = this.ctx.hoverCell, C = this.ctx.currentCell;
|
|
686
|
+
let p = this.rowIndex, b = this.rowIndex;
|
|
687
687
|
if (this.rowspan !== 1 && (u || d)) {
|
|
688
688
|
const S = this.getSpanInfo(), { yArr: O } = S;
|
|
689
|
-
p = O[0],
|
|
689
|
+
p = O[0], b = O[1];
|
|
690
690
|
}
|
|
691
|
-
u && y && !this.ctx.dragRowIng && (y.rowKey === this.rowKey && (
|
|
692
|
-
let
|
|
693
|
-
if (this.ctx.database.getReadonly(this.rowKey, this.key) || (
|
|
691
|
+
u && y && !this.ctx.dragRowIng && (y.rowKey === this.rowKey && (w = x), y.rowIndex >= p && y.rowIndex <= b && (w = x)), d && C && !this.ctx.dragRowIng && (C.rowKey === this.rowKey && (w = f), C.rowIndex >= p && C.rowIndex <= b && (w = f)), this.drawCellSkyBgColor = w;
|
|
692
|
+
let v = e, I = a;
|
|
693
|
+
if (this.ctx.database.getReadonly(this.rowKey, this.key) || (v = i, I = n), g && (this.rowIndex % 2 ? v = E : v = e), typeof s == "function") {
|
|
694
694
|
const S = s, { backgroundColor: O, color: M, font: L } = S({
|
|
695
695
|
row: this.row,
|
|
696
696
|
rowIndex: this.rowIndex,
|
|
@@ -699,10 +699,10 @@ class ie extends ee {
|
|
|
699
699
|
isHasChanged: this.isHasChanged,
|
|
700
700
|
value: this.getValue()
|
|
701
701
|
}) || {};
|
|
702
|
-
O && (
|
|
702
|
+
O && (v = O), M && (I = M), L && (this.drawTextFont = L);
|
|
703
703
|
}
|
|
704
704
|
const { rowIndex: T, colIndex: _, type: R } = this.ctx.finderBar;
|
|
705
|
-
T === this.rowIndex && _ === this.colIndex && R === "body" && (
|
|
705
|
+
T === this.rowIndex && _ === this.colIndex && R === "body" && (v = m), this.drawCellBgColor = v, this.drawTextColor = I;
|
|
706
706
|
}
|
|
707
707
|
updateSelection() {
|
|
708
708
|
const { visibleWidth: e, visibleHeight: i, rowspan: s, colspan: o, cellType: n, type: a, rowIndex: l, rowKey: c } = this;
|
|
@@ -714,27 +714,27 @@ class ie extends ee {
|
|
|
714
714
|
let g = x, E = this.drawY + (i - f) / 2;
|
|
715
715
|
if (a !== "selection-tree") {
|
|
716
716
|
if (a === "tree-selection") {
|
|
717
|
-
const { TREE_INDENT:
|
|
718
|
-
g = x +
|
|
717
|
+
const { TREE_INDENT: b = 16, TREE_ICON_SIZE: v } = this.ctx.config, I = this.ctx.database.getRowForRowKey(c), { level: T = 0 } = I || {}, _ = T * b;
|
|
718
|
+
g = x + v + _;
|
|
719
719
|
}
|
|
720
720
|
}
|
|
721
|
-
let
|
|
721
|
+
let m = this.ctx.icons.get("checkbox-uncheck"), w = "checkbox-uncheck";
|
|
722
722
|
if (a === "selection-tree" || a === "tree-selection") {
|
|
723
|
-
const
|
|
724
|
-
|
|
723
|
+
const b = this.ctx.database.getTreeSelectionState(c);
|
|
724
|
+
b.indeterminate && d ? (m = this.ctx.icons.get("checkbox-indeterminate"), w = "checkbox-indeterminate") : b.checked && d ? (m = this.ctx.icons.get("checkbox-check"), w = "checkbox-check") : !b.checked && d ? (m = this.ctx.icons.get("checkbox-uncheck"), w = "checkbox-uncheck") : (m = this.ctx.icons.get("checkbox-disabled"), w = "checkbox-disabled");
|
|
725
725
|
} else {
|
|
726
|
-
const
|
|
727
|
-
|
|
726
|
+
const b = this.ctx.database.getRowSelection(c);
|
|
727
|
+
b && d ? (m = this.ctx.icons.get("checkbox-check"), w = "checkbox-check") : b && !d ? (m = this.ctx.icons.get("checkbox-check-disabled"), w = "checkbox-check-disabled") : !b && d ? (m = this.ctx.icons.get("checkbox-uncheck"), w = "checkbox-uncheck") : (m = this.ctx.icons.get("checkbox-disabled"), w = "checkbox-disabled");
|
|
728
728
|
}
|
|
729
|
-
const y = this.getImage("drag"),
|
|
730
|
-
if (g +=
|
|
729
|
+
const y = this.getImage("drag"), C = y ? y.width : 0;
|
|
730
|
+
if (g += C, g + f + u > this.drawX + this.visibleWidth || E + f + u > this.drawY + this.visibleHeight)
|
|
731
731
|
return;
|
|
732
|
-
const p = new
|
|
732
|
+
const p = new Z(w, g, E, f, f, m);
|
|
733
733
|
if (a === "index-selection") {
|
|
734
|
-
p.setVisible(!1), (this.ctx.hoverCell && this.ctx.hoverCell.rowIndex === l || ["checkbox-disabled", "checkbox-check"].includes(
|
|
735
|
-
let
|
|
736
|
-
const
|
|
737
|
-
|
|
734
|
+
p.setVisible(!1), (this.ctx.hoverCell && this.ctx.hoverCell.rowIndex === l || ["checkbox-disabled", "checkbox-check"].includes(w)) && p.setVisible(!0);
|
|
735
|
+
let b = this.rowIndex, v = this.rowIndex;
|
|
736
|
+
const I = this.ctx.hoverCell, T = this.getSpanInfo(), { yArr: _ } = T;
|
|
737
|
+
b = _[0], v = _[1], I && I.rowIndex >= b && I.rowIndex <= v && p.setVisible(!0);
|
|
738
738
|
}
|
|
739
739
|
this.setImage("selection", p);
|
|
740
740
|
}
|
|
@@ -758,11 +758,11 @@ class ie extends ee {
|
|
|
758
758
|
if (a.rowKey === this.rowKey && (l = this.drawX + this.width - s - o, c = this.drawY + (this.height - s) / 2), this.rowspan !== 1 && n) {
|
|
759
759
|
const u = this.getSpanInfo(), { yArr: x } = u, g = x[0], E = x[1];
|
|
760
760
|
if (a.rowIndex >= g && a.rowIndex <= E) {
|
|
761
|
-
const { width:
|
|
762
|
-
l = this.drawX -
|
|
761
|
+
const { width: m, height: w, offsetTop: y, offsetLeft: C } = u;
|
|
762
|
+
l = this.drawX - C + m - s - o, c = this.drawY - y + (w - s) / 2;
|
|
763
763
|
}
|
|
764
764
|
}
|
|
765
|
-
const d = this.ctx.icons.get(this.hoverIconName), f = new
|
|
765
|
+
const d = this.ctx.icons.get(this.hoverIconName), f = new Z(this.hoverIconName, l, c, s, s, d);
|
|
766
766
|
(this.rowspan === 0 || this.colspan === 0) && f.setVisible(!1), this.setImage("hover", f);
|
|
767
767
|
}
|
|
768
768
|
}
|
|
@@ -955,7 +955,11 @@ class ie extends ee {
|
|
|
955
955
|
maxLineClamp: this.maxLineClamp,
|
|
956
956
|
cacheTextKey: d,
|
|
957
957
|
layoutCallback: (f) => {
|
|
958
|
-
this.ctx.emit(
|
|
958
|
+
this.ctx.emit(
|
|
959
|
+
"registerTextLayout",
|
|
960
|
+
`${this.cellType}-${this.rowIndex}-${this.colIndex}`,
|
|
961
|
+
f
|
|
962
|
+
);
|
|
959
963
|
}
|
|
960
964
|
}
|
|
961
965
|
), this.ellipsis;
|
|
@@ -1039,45 +1043,45 @@ class ie extends ee {
|
|
|
1039
1043
|
drawBorder(e) {
|
|
1040
1044
|
const { drawX: i, drawY: s, rowIndex: o, colIndex: n, height: a, width: l } = this;
|
|
1041
1045
|
let c = i, d = s;
|
|
1042
|
-
const { xArr: f, yArr: u, lineDash: x = [], borderWidth: g = 1, borderColor: E, fillColor:
|
|
1043
|
-
if (n >=
|
|
1044
|
-
const
|
|
1045
|
-
this.ctx.paint.drawLine([c +
|
|
1046
|
+
const { xArr: f, yArr: u, lineDash: x = [], borderWidth: g = 1, borderColor: E, fillColor: m } = e, w = f[0], y = f[1], C = u[0], p = u[1];
|
|
1047
|
+
if (n >= w && n <= y && o === C) {
|
|
1048
|
+
const b = n === y ? 1 : 0, v = n === w ? 1 : 0;
|
|
1049
|
+
this.ctx.paint.drawLine([c + v, d + 1, c + l - b, d + 1], {
|
|
1046
1050
|
borderColor: E,
|
|
1047
|
-
fillColor:
|
|
1051
|
+
fillColor: m,
|
|
1048
1052
|
borderWidth: g,
|
|
1049
1053
|
lineCap: "round",
|
|
1050
1054
|
lineJoin: "round",
|
|
1051
1055
|
lineDash: x
|
|
1052
1056
|
});
|
|
1053
1057
|
}
|
|
1054
|
-
if (n === y && o >=
|
|
1055
|
-
const
|
|
1056
|
-
this.ctx.paint.drawLine([c + l - 1, d +
|
|
1058
|
+
if (n === y && o >= C && o <= p) {
|
|
1059
|
+
const b = o === C ? 1 : 0, v = o === p ? 1 : 0;
|
|
1060
|
+
this.ctx.paint.drawLine([c + l - 1, d + b, c + l - 1, d + a - v], {
|
|
1057
1061
|
borderColor: E,
|
|
1058
|
-
fillColor:
|
|
1062
|
+
fillColor: m,
|
|
1059
1063
|
borderWidth: g,
|
|
1060
1064
|
lineCap: "round",
|
|
1061
1065
|
lineJoin: "round",
|
|
1062
1066
|
lineDash: x
|
|
1063
1067
|
});
|
|
1064
1068
|
}
|
|
1065
|
-
if (n >=
|
|
1066
|
-
const
|
|
1067
|
-
this.ctx.paint.drawLine([c +
|
|
1069
|
+
if (n >= w && n <= y && o === p) {
|
|
1070
|
+
const b = n === y ? 1 : 0, v = n === w ? 1 : 0;
|
|
1071
|
+
this.ctx.paint.drawLine([c + v, d + a - 1, c + l - b, d + a - 1], {
|
|
1068
1072
|
borderColor: E,
|
|
1069
|
-
fillColor:
|
|
1073
|
+
fillColor: m,
|
|
1070
1074
|
borderWidth: g,
|
|
1071
1075
|
lineCap: "round",
|
|
1072
1076
|
lineJoin: "round",
|
|
1073
1077
|
lineDash: x
|
|
1074
1078
|
});
|
|
1075
1079
|
}
|
|
1076
|
-
if (n ===
|
|
1077
|
-
const
|
|
1078
|
-
this.ctx.paint.drawLine([c + 1, d +
|
|
1080
|
+
if (n === w && o >= C && o <= p) {
|
|
1081
|
+
const b = o === p ? 1 : 0, v = o === C ? 1 : 0;
|
|
1082
|
+
this.ctx.paint.drawLine([c + 1, d + v, c + 1, d + a - b], {
|
|
1079
1083
|
borderColor: E,
|
|
1080
|
-
fillColor:
|
|
1084
|
+
fillColor: m,
|
|
1081
1085
|
borderWidth: g,
|
|
1082
1086
|
lineCap: "round",
|
|
1083
1087
|
lineJoin: "round",
|
|
@@ -1086,7 +1090,7 @@ class ie extends ee {
|
|
|
1086
1090
|
}
|
|
1087
1091
|
}
|
|
1088
1092
|
}
|
|
1089
|
-
class
|
|
1093
|
+
class Le {
|
|
1090
1094
|
constructor(t, e) {
|
|
1091
1095
|
r(this, "ctx");
|
|
1092
1096
|
r(this, "data");
|
|
@@ -1132,7 +1136,7 @@ class Se {
|
|
|
1132
1136
|
// 初始化默认不忽略清空改变值和校验map
|
|
1133
1137
|
init(t = !0) {
|
|
1134
1138
|
this.ctx.paint.clearTextCache(), this.clearBufferData(), this.rowKeyMap.clear(), this.checkboxKeyMap.clear(), this.colIndexKeyMap.clear(), this.rowIndexRowKeyMap.clear(), this.rowKeyRowIndexMap.clear(), this.maxRowHeightCellMap.clear();
|
|
1135
|
-
const e = this.getColumns(), i =
|
|
1139
|
+
const e = this.getColumns(), i = et(e);
|
|
1136
1140
|
if (this.ctx.hasSelection = i.some((s) => s.type === "selection"), this.ctx.hasTree = i.some((s) => {
|
|
1137
1141
|
var o;
|
|
1138
1142
|
return (o = s.type) == null ? void 0 : o.includes("tree");
|
|
@@ -1164,35 +1168,35 @@ class Se {
|
|
|
1164
1168
|
TREE_CHILDREN_KEY: d
|
|
1165
1169
|
} = this.ctx.config;
|
|
1166
1170
|
t.forEach((f, u) => {
|
|
1167
|
-
var
|
|
1171
|
+
var C;
|
|
1168
1172
|
d !== "children" && (f.children = f[d]);
|
|
1169
|
-
const x = f[o], g = x ??
|
|
1173
|
+
const x = f[o], g = x ?? Qt();
|
|
1170
1174
|
this.itemRowKeyMap.set(f, g);
|
|
1171
|
-
const E = f._height || a,
|
|
1172
|
-
let
|
|
1173
|
-
if (typeof l == "function" && (
|
|
1175
|
+
const E = f._height || a, m = f._readonly;
|
|
1176
|
+
let w = !0;
|
|
1177
|
+
if (typeof l == "function" && (w = l), c) {
|
|
1174
1178
|
const p = f[c];
|
|
1175
1179
|
if (this.checkboxKeyMap.has(p)) {
|
|
1176
|
-
const
|
|
1177
|
-
|
|
1180
|
+
const b = this.checkboxKeyMap.get(p) || [];
|
|
1181
|
+
b.push(g), this.checkboxKeyMap.set(p, b);
|
|
1178
1182
|
} else
|
|
1179
1183
|
this.checkboxKeyMap.set(p, [g]);
|
|
1180
1184
|
}
|
|
1181
1185
|
this.selectionMap.set(g, {
|
|
1182
1186
|
key: c ? f[c] : g,
|
|
1183
1187
|
row: f,
|
|
1184
|
-
check: ((
|
|
1188
|
+
check: ((C = this.selectionMap.get(g)) == null ? void 0 : C.check) || !1
|
|
1185
1189
|
});
|
|
1186
1190
|
const y = n || this.expandMap.get(g) || f._expand || !1;
|
|
1187
1191
|
this.expandMap.set(g, y), this.rowKeyMap.set(g, {
|
|
1188
|
-
readonly:
|
|
1192
|
+
readonly: m,
|
|
1189
1193
|
index: u,
|
|
1190
1194
|
rowIndex: u,
|
|
1191
1195
|
level: e,
|
|
1192
1196
|
height: E,
|
|
1193
1197
|
calculatedHeight: -1,
|
|
1194
1198
|
check: !1,
|
|
1195
|
-
selectable:
|
|
1199
|
+
selectable: w,
|
|
1196
1200
|
expand: y,
|
|
1197
1201
|
expandLazy: !1,
|
|
1198
1202
|
hasChildren: f._hasChildren || (Array.isArray(f.children) ? f.children.length > 0 : !1),
|
|
@@ -1251,16 +1255,16 @@ class Se {
|
|
|
1251
1255
|
}
|
|
1252
1256
|
generateColumns(t) {
|
|
1253
1257
|
const e = (i) => i.map((s) => {
|
|
1254
|
-
var c, d, f, u, x, g, E,
|
|
1258
|
+
var c, d, f, u, x, g, E, m;
|
|
1255
1259
|
const o = s.children && Array.isArray(s.children) ? e(s.children) : void 0, n = {
|
|
1256
1260
|
hide: (d = (c = this.customHeader) == null ? void 0 : c.hideData) == null ? void 0 : d[s.key],
|
|
1257
1261
|
fixed: (u = (f = this.customHeader) == null ? void 0 : f.fixedData) == null ? void 0 : u[s.key],
|
|
1258
1262
|
sort: (g = (x = this.customHeader) == null ? void 0 : x.sortData) == null ? void 0 : g[s.key],
|
|
1259
|
-
width: (
|
|
1263
|
+
width: (m = (E = this.customHeader) == null ? void 0 : E.resizableData) == null ? void 0 : m[s.key]
|
|
1260
1264
|
}, a = {};
|
|
1261
|
-
for (const [
|
|
1262
|
-
y !== void 0 && (a[
|
|
1263
|
-
const l = o && o.every((
|
|
1265
|
+
for (const [w, y] of Object.entries(n))
|
|
1266
|
+
y !== void 0 && (a[w] = y);
|
|
1267
|
+
const l = o && o.every((w) => w.hide);
|
|
1264
1268
|
return {
|
|
1265
1269
|
...s,
|
|
1266
1270
|
children: o,
|
|
@@ -1391,7 +1395,7 @@ class Se {
|
|
|
1391
1395
|
} else if (s === "string") {
|
|
1392
1396
|
const d = String(a || ""), f = String(l || "");
|
|
1393
1397
|
c = d.localeCompare(f);
|
|
1394
|
-
} else s === "date" && (c =
|
|
1398
|
+
} else s === "date" && (c = Se(a, l));
|
|
1395
1399
|
return i === "asc" ? c : -c;
|
|
1396
1400
|
});
|
|
1397
1401
|
}
|
|
@@ -1506,67 +1510,67 @@ class Se {
|
|
|
1506
1510
|
const a = /* @__PURE__ */ new Map(), l = [];
|
|
1507
1511
|
let c = [];
|
|
1508
1512
|
for (const g of t) {
|
|
1509
|
-
const { rowKey: E, key:
|
|
1510
|
-
let
|
|
1511
|
-
const y = this.getRowDataItemForRowKey(E),
|
|
1513
|
+
const { rowKey: E, key: m } = g;
|
|
1514
|
+
let w = g.value;
|
|
1515
|
+
const y = this.getRowDataItemForRowKey(E), C = this.getItemValue(E, m), p = this.getVirtualBodyCellByKey(E, m), b = {
|
|
1512
1516
|
...g,
|
|
1513
|
-
oldValue:
|
|
1517
|
+
oldValue: C,
|
|
1514
1518
|
row: y
|
|
1515
1519
|
};
|
|
1516
1520
|
if ((p == null ? void 0 : p.type) === "number")
|
|
1517
|
-
if (["", void 0, null].includes(
|
|
1518
|
-
|
|
1519
|
-
else if (/^-?\d+(\.\d+)?$/.test(String(
|
|
1520
|
-
const
|
|
1521
|
-
if (typeof p.precision == "number" && p.precision >= 0 &&
|
|
1522
|
-
const
|
|
1523
|
-
|
|
1521
|
+
if (["", void 0, null].includes(w))
|
|
1522
|
+
w = null;
|
|
1523
|
+
else if (/^-?\d+(\.\d+)?$/.test(String(w))) {
|
|
1524
|
+
const v = Oe(w);
|
|
1525
|
+
if (typeof p.precision == "number" && p.precision >= 0 && v > p.precision) {
|
|
1526
|
+
const I = 10 ** p.precision;
|
|
1527
|
+
w = Math.round(Number(w) * I) / I;
|
|
1524
1528
|
const T = this.ctx.locale.getText("numberTruncated", { precision: p.precision });
|
|
1525
1529
|
l.push({
|
|
1526
|
-
...
|
|
1530
|
+
...b,
|
|
1527
1531
|
column: p == null ? void 0 : p.column,
|
|
1528
1532
|
code: "ERR_NUMBER_PRECISION",
|
|
1529
1533
|
message: T
|
|
1530
1534
|
});
|
|
1531
|
-
} else if (typeof p.min == "number" && Number(
|
|
1532
|
-
const
|
|
1533
|
-
|
|
1534
|
-
...
|
|
1535
|
+
} else if (typeof p.min == "number" && Number(w) < p.min) {
|
|
1536
|
+
const I = this.ctx.locale.getText("numberMin", { min: p.min });
|
|
1537
|
+
w = p.min, l.push({
|
|
1538
|
+
...b,
|
|
1535
1539
|
column: p == null ? void 0 : p.column,
|
|
1536
1540
|
code: "ERR_NUMBER_MIN",
|
|
1537
|
-
message:
|
|
1541
|
+
message: I
|
|
1538
1542
|
});
|
|
1539
|
-
} else if (typeof p.max == "number" && Number(
|
|
1540
|
-
const
|
|
1541
|
-
|
|
1542
|
-
...
|
|
1543
|
+
} else if (typeof p.max == "number" && Number(w) > p.max) {
|
|
1544
|
+
const I = this.ctx.locale.getText("numberMax", { max: p.max });
|
|
1545
|
+
w = p.max, l.push({
|
|
1546
|
+
...b,
|
|
1543
1547
|
column: p == null ? void 0 : p.column,
|
|
1544
1548
|
code: "ERR_NUMBER_MAX",
|
|
1545
|
-
message:
|
|
1549
|
+
message: I
|
|
1546
1550
|
});
|
|
1547
1551
|
} else
|
|
1548
|
-
|
|
1552
|
+
w = Number(w);
|
|
1549
1553
|
} else
|
|
1550
|
-
|
|
1551
|
-
...
|
|
1554
|
+
w = C, l.push({
|
|
1555
|
+
...b,
|
|
1552
1556
|
column: p == null ? void 0 : p.column,
|
|
1553
1557
|
code: "ERR_INVALID_NUMBER",
|
|
1554
1558
|
message: this.ctx.locale.getText("invalidNumber")
|
|
1555
1559
|
});
|
|
1556
|
-
else if ((p == null ? void 0 : p.editorType) === "text" && typeof p.maxlength == "number" && String(
|
|
1557
|
-
|
|
1558
|
-
const
|
|
1560
|
+
else if ((p == null ? void 0 : p.editorType) === "text" && typeof p.maxlength == "number" && String(w).length > p.maxlength) {
|
|
1561
|
+
w = String(w).slice(0, p.maxlength);
|
|
1562
|
+
const v = this.ctx.locale.getText("stringMaxlength", { maxlength: p.maxlength });
|
|
1559
1563
|
l.push({
|
|
1560
|
-
...
|
|
1564
|
+
...b,
|
|
1561
1565
|
column: p == null ? void 0 : p.column,
|
|
1562
1566
|
code: "ERR_STRING_MAXLENGTH",
|
|
1563
|
-
message:
|
|
1567
|
+
message: v
|
|
1564
1568
|
});
|
|
1565
1569
|
}
|
|
1566
|
-
|
|
1570
|
+
w !== C && c.push({
|
|
1567
1571
|
...g,
|
|
1568
|
-
value:
|
|
1569
|
-
oldValue:
|
|
1572
|
+
value: w,
|
|
1573
|
+
oldValue: C,
|
|
1570
1574
|
row: y
|
|
1571
1575
|
});
|
|
1572
1576
|
}
|
|
@@ -1585,11 +1589,11 @@ class Se {
|
|
|
1585
1589
|
const f = [];
|
|
1586
1590
|
c.forEach((g) => {
|
|
1587
1591
|
f.push(this.getValidator(g.rowKey, g.key));
|
|
1588
|
-
const { value: E, rowKey:
|
|
1589
|
-
a.set(
|
|
1590
|
-
rowKey:
|
|
1591
|
-
key:
|
|
1592
|
-
oldValue:
|
|
1592
|
+
const { value: E, rowKey: m, key: w, row: y } = g, C = this.getItemValue(m, w);
|
|
1593
|
+
a.set(m, y), this.setItemValue(m, w, E, !1, !1, !1, n), o.push({
|
|
1594
|
+
rowKey: m,
|
|
1595
|
+
key: w,
|
|
1596
|
+
oldValue: C,
|
|
1593
1597
|
newValue: E
|
|
1594
1598
|
});
|
|
1595
1599
|
});
|
|
@@ -1771,22 +1775,22 @@ class Se {
|
|
|
1771
1775
|
return { checked: s, indeterminate: !1 };
|
|
1772
1776
|
let n = !1, a = s;
|
|
1773
1777
|
if (this.ctx.config.TREE_SELECT_MODE === "auto") {
|
|
1774
|
-
const c = (
|
|
1775
|
-
const
|
|
1778
|
+
const c = (m) => {
|
|
1779
|
+
const w = this.getTreeChildren(m);
|
|
1776
1780
|
let y = [];
|
|
1777
|
-
for (const
|
|
1778
|
-
y.push(
|
|
1781
|
+
for (const C of w)
|
|
1782
|
+
y.push(C), y.push(...c(C));
|
|
1779
1783
|
return y;
|
|
1780
|
-
}, f = c(t).map((
|
|
1784
|
+
}, f = c(t).map((m) => this.selectionMap.get(m)), u = f.filter((m) => m == null ? void 0 : m.check).length, x = f.length, g = u > 0;
|
|
1781
1785
|
n = g && !(u === x), a = s || g, s && x > 0 && u === 0 && (a = !1, n = !1);
|
|
1782
1786
|
} else if (this.ctx.config.TREE_SELECT_MODE === "cautious") {
|
|
1783
|
-
const c = (
|
|
1784
|
-
const
|
|
1787
|
+
const c = (m) => {
|
|
1788
|
+
const w = this.getTreeChildren(m);
|
|
1785
1789
|
let y = [];
|
|
1786
|
-
for (const
|
|
1787
|
-
y.push(
|
|
1790
|
+
for (const C of w)
|
|
1791
|
+
y.push(C), y.push(...c(C));
|
|
1788
1792
|
return y;
|
|
1789
|
-
}, f = c(t).map((
|
|
1793
|
+
}, f = c(t).map((m) => this.selectionMap.get(m)), u = f.filter((m) => m == null ? void 0 : m.check).length, x = f.length, g = u > 0, E = u === x;
|
|
1790
1794
|
n = g && !E, a = s || E, s && x > 0 && u === 0 && (a = !1, n = !1);
|
|
1791
1795
|
} else this.ctx.config.TREE_SELECT_MODE === "strictly" && (n = !1, a = s);
|
|
1792
1796
|
return { checked: a, indeterminate: n };
|
|
@@ -2048,7 +2052,7 @@ class Se {
|
|
|
2048
2052
|
value: this.getItemValue(t, e),
|
|
2049
2053
|
field: e,
|
|
2050
2054
|
fieldValue: this.getItemValue(t, e)
|
|
2051
|
-
}, u = new
|
|
2055
|
+
}, u = new ye(c).validate(d);
|
|
2052
2056
|
this.setValidationError(t, e, u), s(u);
|
|
2053
2057
|
} else
|
|
2054
2058
|
this.clearValidationError(t, e), s([]);
|
|
@@ -2098,7 +2102,7 @@ class Se {
|
|
|
2098
2102
|
}
|
|
2099
2103
|
]
|
|
2100
2104
|
};
|
|
2101
|
-
let
|
|
2105
|
+
let m = e, w = e, y = a, C = a, p = [], b = 0, v = 0, I = 0, T = 0;
|
|
2102
2106
|
if (d !== 1 && g) {
|
|
2103
2107
|
T = u;
|
|
2104
2108
|
const _ = l.reduce((R, S) => {
|
|
@@ -2111,7 +2115,7 @@ class Se {
|
|
|
2111
2115
|
return `${M}${H}`;
|
|
2112
2116
|
}, "");
|
|
2113
2117
|
if (_ === O)
|
|
2114
|
-
|
|
2118
|
+
m = R;
|
|
2115
2119
|
else
|
|
2116
2120
|
break;
|
|
2117
2121
|
}
|
|
@@ -2121,17 +2125,17 @@ class Se {
|
|
|
2121
2125
|
return `${M}${H}`;
|
|
2122
2126
|
}, "");
|
|
2123
2127
|
if (_ === O)
|
|
2124
|
-
|
|
2128
|
+
w = R;
|
|
2125
2129
|
else
|
|
2126
2130
|
break;
|
|
2127
2131
|
}
|
|
2128
|
-
for (let R =
|
|
2132
|
+
for (let R = m; R < e; R++) {
|
|
2129
2133
|
const { height: S } = this.positions[R];
|
|
2130
|
-
|
|
2134
|
+
b += S;
|
|
2131
2135
|
}
|
|
2132
|
-
for (let R =
|
|
2136
|
+
for (let R = m; R <= w; R++) {
|
|
2133
2137
|
const { height: S } = this.positions[R];
|
|
2134
|
-
|
|
2138
|
+
I += S;
|
|
2135
2139
|
const O = this.rowIndexRowKeyMap.get(R) || "", { item: M } = this.rowKeyMap.get(O), L = this.getItemValue(O, i);
|
|
2136
2140
|
p.push({
|
|
2137
2141
|
rowKey: O,
|
|
@@ -2142,7 +2146,7 @@ class Se {
|
|
|
2142
2146
|
}
|
|
2143
2147
|
}
|
|
2144
2148
|
if (x !== 1 && E) {
|
|
2145
|
-
|
|
2149
|
+
I = f;
|
|
2146
2150
|
for (let _ = a - 1; _ >= 0; _--) {
|
|
2147
2151
|
const R = this.getColumnByColIndex(_);
|
|
2148
2152
|
if (!R)
|
|
@@ -2159,7 +2163,7 @@ class Se {
|
|
|
2159
2163
|
break;
|
|
2160
2164
|
const S = this.getItemValue(s, i), O = this.getItemValue(s, R.key);
|
|
2161
2165
|
if (S === O && c.includes(R.key))
|
|
2162
|
-
|
|
2166
|
+
C = _;
|
|
2163
2167
|
else
|
|
2164
2168
|
break;
|
|
2165
2169
|
}
|
|
@@ -2167,9 +2171,9 @@ class Se {
|
|
|
2167
2171
|
const R = this.getColumnByColIndex(_);
|
|
2168
2172
|
if (!R)
|
|
2169
2173
|
break;
|
|
2170
|
-
|
|
2174
|
+
v += R.width || 100;
|
|
2171
2175
|
}
|
|
2172
|
-
for (let _ = y; _ <=
|
|
2176
|
+
for (let _ = y; _ <= C; _++) {
|
|
2173
2177
|
const R = this.getColumnByColIndex(_);
|
|
2174
2178
|
if (!R)
|
|
2175
2179
|
break;
|
|
@@ -2182,14 +2186,14 @@ class Se {
|
|
|
2182
2186
|
}
|
|
2183
2187
|
}
|
|
2184
2188
|
return {
|
|
2185
|
-
xArr: [y,
|
|
2186
|
-
yArr: [
|
|
2189
|
+
xArr: [y, C],
|
|
2190
|
+
yArr: [m, w],
|
|
2187
2191
|
rowspan: d,
|
|
2188
2192
|
colspan: x,
|
|
2189
|
-
height:
|
|
2193
|
+
height: I,
|
|
2190
2194
|
width: T,
|
|
2191
|
-
offsetTop:
|
|
2192
|
-
offsetLeft:
|
|
2195
|
+
offsetTop: b,
|
|
2196
|
+
offsetLeft: v,
|
|
2193
2197
|
dataList: p
|
|
2194
2198
|
};
|
|
2195
2199
|
}
|
|
@@ -2228,7 +2232,7 @@ class Se {
|
|
|
2228
2232
|
// 获取虚拟单元格,只针对可见的
|
|
2229
2233
|
getVirtualBodyCell(t, e, i = !0) {
|
|
2230
2234
|
const s = this.getColumnByColIndex(e), o = this.getRowForRowIndex(t);
|
|
2231
|
-
return !s || !o ? void 0 : new
|
|
2235
|
+
return !s || !o ? void 0 : new oe(this.ctx, t, e, 0, 0, 0, 0, s, o.item, "body", i);
|
|
2232
2236
|
}
|
|
2233
2237
|
getVirtualBodyCellByKey(t, e) {
|
|
2234
2238
|
const i = this.getRowIndexForRowKey(t), s = this.getColIndexForKey(e);
|
|
@@ -2338,7 +2342,7 @@ class Se {
|
|
|
2338
2342
|
this.changedDataMap.clear();
|
|
2339
2343
|
}
|
|
2340
2344
|
}
|
|
2341
|
-
class
|
|
2345
|
+
class Me {
|
|
2342
2346
|
constructor(t) {
|
|
2343
2347
|
r(this, "ctx");
|
|
2344
2348
|
r(this, "history", []);
|
|
@@ -2393,7 +2397,7 @@ class Oe {
|
|
|
2393
2397
|
this.history = [], this.historyIndex = -1;
|
|
2394
2398
|
}
|
|
2395
2399
|
}
|
|
2396
|
-
class
|
|
2400
|
+
class Ae {
|
|
2397
2401
|
constructor(t) {
|
|
2398
2402
|
r(this, "eventTasks", /* @__PURE__ */ new Set());
|
|
2399
2403
|
r(this, "ctx");
|
|
@@ -2423,7 +2427,7 @@ class Le {
|
|
|
2423
2427
|
this.clearDomSelection(), t.button === 0 && (this.ctx.mousedown = !0), this.ctx.emit("mousedown", t);
|
|
2424
2428
|
}
|
|
2425
2429
|
handleMousemove(t) {
|
|
2426
|
-
const e = t, i = this.ctx.containerElement.getBoundingClientRect(), s = e.clientX - i.left, o = e.clientY - i.top;
|
|
2430
|
+
const e = t, i = this.ctx.containerElement.getBoundingClientRect(), s = this.ctx.zoomScale.toLogical(e.clientX - i.left), o = this.ctx.zoomScale.toLogical(e.clientY - i.top);
|
|
2427
2431
|
this.ctx.mouseX = s, this.ctx.mouseY = o, this.ctx.emit("mousemove", t);
|
|
2428
2432
|
}
|
|
2429
2433
|
handleMouseUp(t) {
|
|
@@ -2437,6 +2441,13 @@ class Le {
|
|
|
2437
2441
|
e && this.ctx.isTarget(t) && (this.ctx.dragHeaderIng || this.ctx.emit("keydown", t));
|
|
2438
2442
|
}
|
|
2439
2443
|
handleWheel(t) {
|
|
2444
|
+
const e = t, { ENABLE_ZOOM_WHEEL: i } = this.ctx.config;
|
|
2445
|
+
if (i && (e.ctrlKey || e.metaKey)) {
|
|
2446
|
+
t.preventDefault();
|
|
2447
|
+
const s = e.deltaY > 0 ? -0.1 : 0.1;
|
|
2448
|
+
this.ctx.setZoom(this.ctx.getZoom() + s);
|
|
2449
|
+
return;
|
|
2450
|
+
}
|
|
2440
2451
|
this.ctx.emit("wheel", t);
|
|
2441
2452
|
}
|
|
2442
2453
|
handleTouchstart(t) {
|
|
@@ -2475,7 +2486,7 @@ class Le {
|
|
|
2475
2486
|
}
|
|
2476
2487
|
}
|
|
2477
2488
|
}
|
|
2478
|
-
class
|
|
2489
|
+
class He {
|
|
2479
2490
|
constructor() {
|
|
2480
2491
|
r(this, "events", /* @__PURE__ */ new Map());
|
|
2481
2492
|
}
|
|
@@ -2513,7 +2524,7 @@ class Me {
|
|
|
2513
2524
|
this.events.clear();
|
|
2514
2525
|
}
|
|
2515
2526
|
}
|
|
2516
|
-
class
|
|
2527
|
+
class De {
|
|
2517
2528
|
constructor(t) {
|
|
2518
2529
|
r(this, "ctx");
|
|
2519
2530
|
r(this, "textCacheMap", /* @__PURE__ */ new Map());
|
|
@@ -2521,11 +2532,14 @@ class Ae {
|
|
|
2521
2532
|
if (!e) throw new Error("canvas context not found");
|
|
2522
2533
|
this.ctx = e;
|
|
2523
2534
|
}
|
|
2535
|
+
getCtx() {
|
|
2536
|
+
return this.ctx;
|
|
2537
|
+
}
|
|
2524
2538
|
clearTextCache() {
|
|
2525
2539
|
this.textCacheMap.clear();
|
|
2526
2540
|
}
|
|
2527
|
-
scale(t) {
|
|
2528
|
-
this.ctx.setTransform(1, 0, 0, 1, 0, 0), this.ctx.scale(t, t);
|
|
2541
|
+
scale(t, e = 1) {
|
|
2542
|
+
this.ctx.setTransform(1, 0, 0, 1, 0, 0), this.ctx.scale(t * e, t * e);
|
|
2529
2543
|
}
|
|
2530
2544
|
save() {
|
|
2531
2545
|
this.ctx.save();
|
|
@@ -2609,7 +2623,7 @@ class Ae {
|
|
|
2609
2623
|
* @returns 是否溢出
|
|
2610
2624
|
*/
|
|
2611
2625
|
drawText(t = "", e, i, s, o, n = {}) {
|
|
2612
|
-
var
|
|
2626
|
+
var C, p, b;
|
|
2613
2627
|
this.ctx.save();
|
|
2614
2628
|
const {
|
|
2615
2629
|
font: a = "12px Arial",
|
|
@@ -2624,7 +2638,7 @@ class Ae {
|
|
|
2624
2638
|
} = n;
|
|
2625
2639
|
if (this.ctx.font = a, this.ctx.fillStyle = c, ["", null, void 0].includes(t))
|
|
2626
2640
|
return this.ctx.restore(), !1;
|
|
2627
|
-
const
|
|
2641
|
+
const w = parseInt(((C = a.match(/\d+/)) == null ? void 0 : C[0]) || "12") * (n.lineHeight || 1.2), y = this.buildTextLayout(t, e, i, s, o, {
|
|
2628
2642
|
font: a,
|
|
2629
2643
|
color: c,
|
|
2630
2644
|
align: l,
|
|
@@ -2632,25 +2646,25 @@ class Ae {
|
|
|
2632
2646
|
verticalAlign: f,
|
|
2633
2647
|
maxLineClamp: u,
|
|
2634
2648
|
autoRowHeight: x,
|
|
2635
|
-
lineHeight:
|
|
2649
|
+
lineHeight: w,
|
|
2636
2650
|
offsetLeft: g,
|
|
2637
2651
|
offsetRight: E
|
|
2638
2652
|
});
|
|
2639
|
-
if (this.ctx.textBaseline = "top", this.ctx.textAlign = "left", y.lines.forEach((
|
|
2640
|
-
this.ctx.fillText(
|
|
2653
|
+
if (this.ctx.textBaseline = "top", this.ctx.textAlign = "left", y.lines.forEach((v) => {
|
|
2654
|
+
this.ctx.fillText(v.text, v.drawX, v.drawY);
|
|
2641
2655
|
}), n.textCallback && y.lines.length) {
|
|
2642
|
-
const
|
|
2643
|
-
let T = ((p = y.lines[0]) == null ? void 0 : p.drawX) ?? e + d + g, _ = T +
|
|
2644
|
-
l === "center" ? (T = e + s / 2 -
|
|
2656
|
+
const v = y.lines.reduce((S, O) => Math.max(S, O.width), 0), I = Math.round(v);
|
|
2657
|
+
let T = ((p = y.lines[0]) == null ? void 0 : p.drawX) ?? e + d + g, _ = T + I;
|
|
2658
|
+
l === "center" ? (T = e + s / 2 - I / 2, _ = e + s / 2 + I / 2) : l === "right" && (T = e + s - d - E - I, _ = e + s - d - E);
|
|
2645
2659
|
const R = {
|
|
2646
|
-
x: ((
|
|
2660
|
+
x: ((b = y.lines[0]) == null ? void 0 : b.drawX) ?? T,
|
|
2647
2661
|
y: y.contentY,
|
|
2648
|
-
width:
|
|
2649
|
-
height: y.lines.length *
|
|
2662
|
+
width: I,
|
|
2663
|
+
height: y.lines.length * w,
|
|
2650
2664
|
left: T,
|
|
2651
2665
|
right: _,
|
|
2652
2666
|
top: y.contentY,
|
|
2653
|
-
bottom: y.contentY + y.lines.length *
|
|
2667
|
+
bottom: y.contentY + y.lines.length * w
|
|
2654
2668
|
};
|
|
2655
2669
|
n.textCallback(R);
|
|
2656
2670
|
}
|
|
@@ -2667,22 +2681,22 @@ class Ae {
|
|
|
2667
2681
|
autoRowHeight: x,
|
|
2668
2682
|
lineHeight: g,
|
|
2669
2683
|
offsetLeft: E,
|
|
2670
|
-
offsetRight:
|
|
2684
|
+
offsetRight: m
|
|
2671
2685
|
} = n;
|
|
2672
2686
|
this.ctx.save(), this.ctx.font = a;
|
|
2673
|
-
const
|
|
2674
|
-
let
|
|
2675
|
-
const
|
|
2676
|
-
let
|
|
2677
|
-
u === "auto" && x ?
|
|
2687
|
+
const w = s - d * 2 - E - m, y = w, C = o - d * 2, p = Array.from(t);
|
|
2688
|
+
let b = this.wrapTextToLines(t, w);
|
|
2689
|
+
const v = Math.round(C / g);
|
|
2690
|
+
let I = Math.min(b.length, Math.max(v, 1));
|
|
2691
|
+
u === "auto" && x ? I = b.length : typeof u == "number" && u < I && u !== 1 ? I = u : (u === 1 && (b = [{ items: p.map((M, L) => ({ char: M, sourceIndex: L })), text: t, caretIndex: 0, lineIndex: 0, drawX: 0, drawY: 0, width: 0, segments: [] }], I = 1), u === "auto" && v === 1 && (b = [{ items: p.map((M, L) => ({ char: M, sourceIndex: L })), text: t, caretIndex: 0, lineIndex: 0, drawX: 0, drawY: 0, width: 0, segments: [] }], I = 1));
|
|
2678
2692
|
let T = !1;
|
|
2679
|
-
const _ =
|
|
2680
|
-
if (
|
|
2693
|
+
const _ = b.slice(0, I);
|
|
2694
|
+
if (b.length > I) {
|
|
2681
2695
|
T = !0;
|
|
2682
|
-
const M =
|
|
2683
|
-
L.lineIndex =
|
|
2684
|
-
} else if (
|
|
2685
|
-
const M =
|
|
2696
|
+
const M = b.slice(I - 1), L = this.buildEllipsisLine(M, s, d);
|
|
2697
|
+
L.lineIndex = I - 1, _[I - 1] = L;
|
|
2698
|
+
} else if (I > 0) {
|
|
2699
|
+
const M = I - 1, L = b.slice(M), H = L.map((A) => A.text).join(""), { ellipsis: D } = this.handleEllipsis(H, s, d, a);
|
|
2686
2700
|
if (D) {
|
|
2687
2701
|
T = !0;
|
|
2688
2702
|
const A = this.buildEllipsisLine(L, s, d);
|
|
@@ -2695,9 +2709,9 @@ class Ae {
|
|
|
2695
2709
|
const O = [];
|
|
2696
2710
|
return _.forEach((M, L) => {
|
|
2697
2711
|
M.lineIndex = L;
|
|
2698
|
-
const H = this.buildLineSegments(M), D = H.reduce((N,
|
|
2712
|
+
const H = this.buildLineSegments(M), D = H.reduce((N, Ct) => N + Ct.width, 0);
|
|
2699
2713
|
let A = e + d + E;
|
|
2700
|
-
c === "center" ? A = e + (s - D) / 2 : c === "right" && (A = e + s - d -
|
|
2714
|
+
c === "center" ? A = e + (s - D) / 2 : c === "right" && (A = e + s - d - m - D);
|
|
2701
2715
|
const k = S + L * g;
|
|
2702
2716
|
M.drawX = A, M.drawY = k, M.width = D, M.segments = H, H.forEach((N) => {
|
|
2703
2717
|
N.sourceIndex < 0 || O.push({
|
|
@@ -2716,7 +2730,7 @@ class Ae {
|
|
|
2716
2730
|
glyphs: O,
|
|
2717
2731
|
lines: _,
|
|
2718
2732
|
box: { x: e, y: i, width: s, height: o },
|
|
2719
|
-
contentBox: { x: e + d + E, y: i + d, width: y, height:
|
|
2733
|
+
contentBox: { x: e + d + E, y: i + d, width: y, height: C },
|
|
2720
2734
|
contentY: S,
|
|
2721
2735
|
lineHeight: g,
|
|
2722
2736
|
font: a,
|
|
@@ -2877,7 +2891,7 @@ class Ae {
|
|
|
2877
2891
|
};
|
|
2878
2892
|
}
|
|
2879
2893
|
}
|
|
2880
|
-
class
|
|
2894
|
+
class Ft {
|
|
2881
2895
|
constructor(t) {
|
|
2882
2896
|
r(this, "_config", {});
|
|
2883
2897
|
/** CSS 类名前缀 */
|
|
@@ -2972,6 +2986,12 @@ class Kt {
|
|
|
2972
2986
|
r(this, "CELL_HOVER_ICON_BG_COLOR", "#fff");
|
|
2973
2987
|
/** hover编辑图标边框颜色 */
|
|
2974
2988
|
r(this, "CELL_HOVER_ICON_BORDER_COLOR", "#DDE0EA");
|
|
2989
|
+
/** 内容缩放最小比例 */
|
|
2990
|
+
r(this, "MIN_ZOOM", 0.5);
|
|
2991
|
+
/** 内容缩放最大比例 */
|
|
2992
|
+
r(this, "MAX_ZOOM", 2);
|
|
2993
|
+
/** 启用 Ctrl + 滚轮内容缩放 */
|
|
2994
|
+
r(this, "ENABLE_ZOOM_WHEEL", !0);
|
|
2975
2995
|
/** 滚动条轨道尺寸 */
|
|
2976
2996
|
r(this, "SCROLLER_TRACK_SIZE", 14);
|
|
2977
2997
|
/** 滚动条滑块尺寸 */
|
|
@@ -3245,24 +3265,24 @@ class Kt {
|
|
|
3245
3265
|
let t = {};
|
|
3246
3266
|
Object.keys(this).forEach((e) => {
|
|
3247
3267
|
if (e.endsWith("_COLOR") || e.endsWith("_FONT")) {
|
|
3248
|
-
const i = `--evt-${e.toLocaleLowerCase().replace(/_/g, "-")}`, s =
|
|
3268
|
+
const i = `--evt-${e.toLocaleLowerCase().replace(/_/g, "-")}`, s = Te(i);
|
|
3249
3269
|
s && (t[e] = s);
|
|
3250
3270
|
}
|
|
3251
3271
|
}), Object.assign(this, t, this._config);
|
|
3252
3272
|
}
|
|
3253
3273
|
}
|
|
3254
|
-
const
|
|
3255
|
-
`,
|
|
3256
|
-
`,
|
|
3257
|
-
`,
|
|
3258
|
-
`,
|
|
3259
|
-
`,
|
|
3260
|
-
`,
|
|
3261
|
-
`,
|
|
3262
|
-
`,
|
|
3263
|
-
`,
|
|
3264
|
-
`,
|
|
3265
|
-
class
|
|
3274
|
+
const ct = `<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>\r
|
|
3275
|
+
`, Wt = `<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>
|
|
3276
|
+
`, Vt = `<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>
|
|
3277
|
+
`, Mt = `<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>
|
|
3278
|
+
`, ne = `<svg t="1724133395728" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2893" width="32" height="32"><path d="M512 226.8476541a19.82487759 19.82487759 0 0 1 14.66497778 5.70304692c3.80203107 3.82918865 5.70304692 8.71751457 5.70304693 14.66497779v122.20814825a19.82487759 19.82487759 0 0 1-5.70304693 14.66497778 19.82487759 19.82487759 0 0 1-14.66497778 5.70304691 19.82487759 19.82487759 0 0 1-14.66497778-5.70304691 19.82487759 19.82487759 0 0 1-5.70304693-14.66497778v-122.20814825a19.82487759 19.82487759 0 0 1 5.70304693-14.66497779 19.82487759 19.82487759 0 0 1 14.66497778-5.70304692z m0 407.36049415a19.82487759 19.82487759 0 0 1 14.66497778 5.70304691c3.80203107 3.82918865 5.70304692 8.71751457 5.70304693 14.66497778v122.20814827a19.82487759 19.82487759 0 0 1-5.70304693 14.66497776 19.82487759 19.82487759 0 0 1-14.66497778 5.70304693 19.82487759 19.82487759 0 0 1-14.66497778-5.70304693 19.82487759 19.82487759 0 0 1-5.70304693-14.66497776v-122.20814827a19.82487759 19.82487759 0 0 1 5.70304693-14.66497778 19.82487759 19.82487759 0 0 1 14.66497778-5.70304691zM797.1523459 512a19.82487759 19.82487759 0 0 1-5.70304692 14.66497778 19.82487759 19.82487759 0 0 1-14.66497779 5.70304693h-122.20814825a19.82487759 19.82487759 0 0 1-14.66497778-5.70304693 19.82487759 19.82487759 0 0 1-5.70304691-14.66497778 19.82487759 19.82487759 0 0 1 5.70304691-14.66497778 19.82487759 19.82487759 0 0 1 14.66497778-5.70304693h122.20814825a19.82487759 19.82487759 0 0 1 14.66497779 5.70304693c3.80203107 3.82918865 5.70304692 8.71751457 5.70304692 14.66497778z m-407.36049415 0a19.82487759 19.82487759 0 0 1-5.70304691 14.66497778 19.82487759 19.82487759 0 0 1-14.66497778 5.70304693h-122.20814827a19.82487759 19.82487759 0 0 1-14.66497776-5.70304693 19.82487759 19.82487759 0 0 1-5.70304693-14.66497778 19.82487759 19.82487759 0 0 1 5.70304693-14.66497778 19.82487759 19.82487759 0 0 1 14.66497776-5.70304693h122.20814827a19.82487759 19.82487759 0 0 1 14.66497778 5.70304693c3.80203107 3.82918865 5.70304692 8.71751457 5.70304691 14.66497778zM310.22076878 310.22076878a21.29137537 21.29137537 0 0 1 14.66497779-5.70304693c5.51294514 0 10.18401235 1.90101585 14.01320099 5.70304693l86.55052591 86.57768347a20.91117183 20.91117183 0 0 1 5.73020449 14.31193182 19.28172983 19.28172983 0 0 1-6.05609289 14.013201 19.11878565 19.11878565 0 0 1-14.013201 6.05609289 20.96548698 20.96548698 0 0 1-14.31193182-5.70304692L310.22076878 338.87178998a19.06447114 19.06447114 0 0 1-5.70304693-14.01320099c0-5.54010272 1.90101585-10.42842865 5.70304693-14.66497778z m288.32975775 288.32975775a19.79772001 19.79772001 0 0 1 14.3390894-6.35482371c5.29568642 0 10.04822572 2.11827457 14.31193182 6.38198066l86.57768347 86.55052651c3.80203107 3.80203107 5.70304692 8.47309828 5.70304691 14.01320102a19.55330372 19.55330372 0 0 1-6.05609225 14.31193182 19.66193339 19.66193339 0 0 1-14.31193245 6.05609288 19.01015661 19.01015661 0 0 1-14.01320099-5.70304692l-86.55052591-86.57768347a19.79772001 19.79772001 0 0 1-6.38198129-14.31193245c0-5.29568642 2.11827457-10.07538268 6.38198129-14.33908939zM713.77923122 310.22076878c3.80203107 4.26370672 5.70304692 9.15203265 5.70304693 14.66497779s-1.90101585 10.18401235-5.70304693 14.01320099l-86.57768347 86.55052591a20.91117183 20.91117183 0 0 1-14.31193182 5.73020449 19.28172983 19.28172983 0 0 1-14.013201-6.05609289 19.11878565 19.11878565 0 0 1-6.05609289-14.013201c0-5.29568642 1.90101585-10.07538268 5.70304692-14.31193182l86.57768348-86.57768347c3.80203107-3.80203107 8.50025585-5.70304692 14.01320099-5.70304693 5.54010272 0 10.40127108 1.90101585 14.66497779 5.70304693zM425.44947347 598.57768347a19.79772001 19.79772001 0 0 1 6.35482371 14.33908939c0 5.29568642-2.11827457 10.04822572-6.38198066 14.31193245L338.89894756 713.77923122a19.06447114 19.06447114 0 0 1-14.01320099 5.70304693 19.55330372 19.55330372 0 0 1-14.31193245-6.05609227 19.68909035 19.68909035 0 0 1-6.05609227-14.31193245 19.01015661 19.01015661 0 0 1 5.70304693-14.01320099l86.57768347-86.55052591a19.79772001 19.79772001 0 0 1 14.31193182-6.38198129c5.29568642 0 10.07538268 2.11827457 14.3390894 6.38198129z" fill="#000000" fill-opacity=".65" p-id="2894"></path></svg>
|
|
3279
|
+
`, Ne = `<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24"><path d="M11 18c0 1.1-.9 2-2 2s-2-.9-2-2s.9-2 2-2s2 .9 2 2zm-2-8c-1.1 0-2 .9-2 2s.9 2 2 2s2-.9 2-2s-.9-2-2-2zm0-6c-1.1 0-2 .9-2 2s.9 2 2 2s2-.9 2-2s-.9-2-2-2zm6 4c1.1 0 2-.9 2-2s-.9-2-2-2s-2 .9-2 2s.9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2s2-.9 2-2s-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2s2-.9 2-2s-.9-2-2-2z" fill="currentColor"></path></svg>
|
|
3280
|
+
`, ke = `<svg t="1722595639920" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4708" width="32" height="32"><path d="M128 640V384a256 256 0 0 1 256-256h256a256 256 0 0 1 256 256v256a256 256 0 0 1-256 256H384a256 256 0 0 1-256-256z m64 0q0 79.552 56.256 135.744Q304.448 832 384 832h256q79.552 0 135.744-56.256Q832 719.552 832 640V384q0-79.552-56.256-135.744Q719.552 192 640 192H384q-79.552 0-135.744 56.256Q192 304.448 192 384v256z" p-id="4709"></path></svg>
|
|
3281
|
+
`, Be = `<svg t="1722595280953" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4394" width="32" height="32"><path d="M128 384v256q0 12.608 1.28 25.088 1.216 12.544 3.648 24.832 2.432 12.352 6.08 24.384t8.448 23.68q4.864 11.584 10.752 22.72 5.952 11.072 12.928 21.504 7.04 10.496 14.976 20.224 8 9.728 16.896 18.56 8.896 8.96 18.56 16.896 9.728 8 20.224 14.976 10.432 7.04 21.504 12.928 11.136 5.888 22.72 10.688 11.648 4.864 23.68 8.512 12.032 3.648 24.32 6.08 12.352 2.432 24.896 3.712Q371.392 896 384 896h256q12.608 0 25.088-1.28 12.544-1.216 24.832-3.648 12.352-2.432 24.384-6.08t23.68-8.512q11.584-4.8 22.72-10.688 11.072-5.952 21.504-12.928 10.496-7.04 20.224-14.976 9.728-8 18.56-16.896 8.96-8.832 16.896-18.56 8-9.728 14.976-20.224 7.04-10.432 12.928-21.504 5.888-11.136 10.688-22.72 4.864-11.648 8.512-23.68 3.648-12.032 6.08-24.32 2.432-12.352 3.712-24.896Q896 652.608 896 640V384q0-12.608-1.28-25.088-1.216-12.544-3.648-24.832-2.432-12.352-6.08-24.384t-8.512-23.68q-4.8-11.584-10.688-22.72-5.952-11.072-12.928-21.504-7.04-10.496-14.976-20.224-8-9.664-16.896-18.56-8.832-8.96-18.56-16.896-9.728-8-20.224-14.976-10.432-7.04-21.504-12.928-11.136-5.888-22.72-10.752-11.648-4.8-23.68-8.448-12.032-3.648-24.32-6.08-12.352-2.432-24.896-3.712Q652.608 128 640 128H384q-12.608 0-25.088 1.28-12.544 1.216-24.832 3.648-12.352 2.432-24.384 6.08t-23.68 8.448q-11.584 4.864-22.72 10.752-11.072 5.952-21.504 12.928-10.496 7.04-20.224 14.976-9.664 8-18.56 16.896-8.96 8.896-16.896 18.56-8 9.728-14.976 20.224-7.04 10.432-12.928 21.504-5.888 11.136-10.752 22.72-4.8 11.648-8.448 23.68-3.648 12.032-6.08 24.32-2.432 12.352-3.712 24.896Q128 371.392 128 384z m566.016 166.336H330.112a38.4 38.4 0 0 1 0-76.8h363.904a38.4 38.4 0 0 1 0 76.8z" p-id="4395"></path></svg>
|
|
3282
|
+
`, Xe = `<svg t="1722595946663" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4865" width="32" height="32"><path d="M128 640V384a256 256 0 0 1 256-256h256a256 256 0 0 1 256 256v256a256 256 0 0 1-256 256H384a256 256 0 0 1-256-256z" p-id="4866"></path><path d="M128 640V384a256 256 0 0 1 256-256h256a256 256 0 0 1 256 256v256a256 256 0 0 1-256 256H384a256 256 0 0 1-256-256z m64 0q0 79.552 56.256 135.744Q304.448 832 384 832h256q79.552 0 135.744-56.256Q832 719.552 832 640V384q0-79.552-56.256-135.744Q719.552 192 640 192H384q-79.552 0-135.744 56.256Q192 304.448 192 384v256z" fill="#DDE0EA" p-id="4867"></path></svg>
|
|
3283
|
+
`, Ke = `<svg t="1744798692576" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6606" width="200" height="200"><path d="M855.296 894.528H168.768v-76.8h686.528v76.8z m38.4-38.4q0 3.84-0.768 7.488-0.704 3.712-2.176 7.232-1.472 3.52-3.52 6.656-2.112 3.136-4.8 5.76-2.688 2.688-5.824 4.8-3.2 2.112-6.656 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.52-1.472-6.656-3.584-3.136-2.112-5.76-4.736-2.688-2.688-4.8-5.824-2.112-3.2-3.584-6.656-1.408-3.52-2.176-7.232-0.704-3.648-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.136 4.736-5.76 2.688-2.752 5.824-4.8 3.2-2.112 6.656-3.584 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.472 6.656 3.584 3.2 2.048 5.76 4.736 2.752 2.688 4.864 5.824 2.048 3.2 3.52 6.656 1.472 3.456 2.176 7.168 0.768 3.712 0.768 7.488z m-686.528 0q0 3.84-0.768 7.488-0.704 3.712-2.176 7.232-1.472 3.52-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.736-2.688-2.688-4.8-5.824-2.112-3.2-3.584-6.656-1.408-3.52-2.176-7.232-0.704-3.648-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.136 4.736-5.76 2.688-2.752 5.824-4.8 3.2-2.112 6.656-3.584 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.472 6.656 3.584 3.2 2.048 5.824 4.736 2.688 2.688 4.8 5.824 2.048 3.2 3.52 6.656 1.472 3.456 2.176 7.168 0.768 3.712 0.768 7.488zM652.032 211.2l-369.92 370.368v89.344h90.048l369.664-369.856L652.032 211.2z m-54.4-54.272q22.528-22.528 54.4-22.528 31.808 0 54.336 22.528l89.792 89.856q22.464 22.464 22.464 54.272t-22.464 54.272l-369.664 369.856q-22.464 22.528-54.336 22.528H282.24q-31.808 0-54.336-22.528-22.464-22.464-22.464-54.272V581.568q0-31.808 22.4-54.272l369.92-370.368z" p-id="6607"></path></svg>
|
|
3284
|
+
`, Ye = Mt.replace('fill="currentColor" p-id="2016"', 'fill="#bec4c7" p-id="2016"'), Fe = Mt.replace('fill="currentColor" p-id="2015"', 'fill="#bec4c7" p-id="2015"');
|
|
3285
|
+
class We {
|
|
3266
3286
|
constructor(t) {
|
|
3267
3287
|
r(this, "ctx");
|
|
3268
3288
|
r(this, "list", [
|
|
@@ -3270,95 +3290,95 @@ class Ye {
|
|
|
3270
3290
|
name: "loading",
|
|
3271
3291
|
configName: "LOADING_ICON_SVG",
|
|
3272
3292
|
configColorName: "LOADING_ICON_COLOR",
|
|
3273
|
-
svg:
|
|
3293
|
+
svg: ne,
|
|
3274
3294
|
color: "#4E5969"
|
|
3275
3295
|
},
|
|
3276
3296
|
{
|
|
3277
3297
|
name: "expand",
|
|
3278
3298
|
configName: "EXPAND_ICON_SVG",
|
|
3279
3299
|
configColorName: "EXPAND_ICON_COLOR",
|
|
3280
|
-
svg:
|
|
3300
|
+
svg: ct,
|
|
3281
3301
|
color: "#4E5969"
|
|
3282
3302
|
},
|
|
3283
3303
|
{
|
|
3284
3304
|
name: "shrink",
|
|
3285
3305
|
configName: "SHRINK_ICON_SVG",
|
|
3286
3306
|
configColorName: "SHRINK_ICON_COLOR",
|
|
3287
|
-
svg:
|
|
3307
|
+
svg: Vt,
|
|
3288
3308
|
color: "#4E5969"
|
|
3289
3309
|
},
|
|
3290
3310
|
{
|
|
3291
3311
|
name: "checkbox-uncheck",
|
|
3292
3312
|
configName: "CHECKBOX_UNCHECK_SVG",
|
|
3293
3313
|
configColorName: "CHECKBOX_UNCHECK_COLOR",
|
|
3294
|
-
svg:
|
|
3314
|
+
svg: ke,
|
|
3295
3315
|
color: ""
|
|
3296
3316
|
},
|
|
3297
3317
|
{
|
|
3298
3318
|
name: "checkbox-check",
|
|
3299
3319
|
configName: "CHECKBOX_CHECK_SVG",
|
|
3300
3320
|
configColorName: "CHECKBOX_COLOR",
|
|
3301
|
-
svg:
|
|
3321
|
+
svg: Wt,
|
|
3302
3322
|
color: "rgb(82,146,247)"
|
|
3303
3323
|
},
|
|
3304
3324
|
{
|
|
3305
3325
|
name: "checkbox-indeterminate",
|
|
3306
3326
|
configName: "CHECKBOX_INDETERMINATE_SVG",
|
|
3307
3327
|
configColorName: "CHECKBOX_COLOR",
|
|
3308
|
-
svg:
|
|
3328
|
+
svg: Be,
|
|
3309
3329
|
color: "rgb(82,146,247)"
|
|
3310
3330
|
},
|
|
3311
3331
|
{
|
|
3312
3332
|
name: "checkbox-check-disabled",
|
|
3313
3333
|
configName: "CHECKBOX_CHECK_DISABLED_SVG",
|
|
3314
|
-
svg:
|
|
3334
|
+
svg: Wt,
|
|
3315
3335
|
color: "#DDE0EA"
|
|
3316
3336
|
},
|
|
3317
3337
|
{
|
|
3318
3338
|
name: "checkbox-disabled",
|
|
3319
3339
|
configName: "CHECKBOX_DISABLED_SVG",
|
|
3320
3340
|
configColorName: "CHECKBOX_DISABLED_COLOR",
|
|
3321
|
-
svg:
|
|
3341
|
+
svg: Xe,
|
|
3322
3342
|
color: "#F1F2F4"
|
|
3323
3343
|
},
|
|
3324
3344
|
{
|
|
3325
3345
|
name: "icon-edit",
|
|
3326
3346
|
configName: "ICON_EDIT_SVG",
|
|
3327
3347
|
configColorName: "ICON_EDIT_COLOR",
|
|
3328
|
-
svg:
|
|
3348
|
+
svg: Ke,
|
|
3329
3349
|
color: "#4E5969"
|
|
3330
3350
|
},
|
|
3331
3351
|
{
|
|
3332
3352
|
name: "icon-select",
|
|
3333
3353
|
configName: "ICON_SELECT_SVG",
|
|
3334
3354
|
configColorName: "ICON_SELECT_COLOR",
|
|
3335
|
-
svg:
|
|
3355
|
+
svg: Vt,
|
|
3336
3356
|
color: "#4E5969"
|
|
3337
3357
|
},
|
|
3338
3358
|
{
|
|
3339
3359
|
name: "sort-asc",
|
|
3340
3360
|
configName: "SORT_ASC_ICON_SVG",
|
|
3341
3361
|
configColorName: "SORT_ICON_COLOR",
|
|
3342
|
-
svg:
|
|
3362
|
+
svg: Ye,
|
|
3343
3363
|
color: "rgb(82,146,247)"
|
|
3344
3364
|
},
|
|
3345
3365
|
{
|
|
3346
3366
|
name: "sort-desc",
|
|
3347
3367
|
configName: "SORT_DESC_ICON_SVG",
|
|
3348
3368
|
configColorName: "SORT_ICON_COLOR",
|
|
3349
|
-
svg:
|
|
3369
|
+
svg: Fe,
|
|
3350
3370
|
color: "rgb(82,146,247)"
|
|
3351
3371
|
},
|
|
3352
3372
|
{
|
|
3353
3373
|
name: "sort-default",
|
|
3354
3374
|
configName: "SORTABLE_ICON_SVG",
|
|
3355
|
-
svg:
|
|
3375
|
+
svg: Mt,
|
|
3356
3376
|
color: "#bec4c7"
|
|
3357
3377
|
},
|
|
3358
3378
|
{
|
|
3359
3379
|
name: "drag",
|
|
3360
3380
|
configName: "DRAG_ROW_ICON_SVG",
|
|
3361
|
-
svg:
|
|
3381
|
+
svg: Ne,
|
|
3362
3382
|
color: "#4E5969"
|
|
3363
3383
|
}
|
|
3364
3384
|
]);
|
|
@@ -3421,7 +3441,7 @@ class Ye {
|
|
|
3421
3441
|
return this.list.find((e) => e.name === t);
|
|
3422
3442
|
}
|
|
3423
3443
|
}
|
|
3424
|
-
class
|
|
3444
|
+
class Ve {
|
|
3425
3445
|
constructor(t) {
|
|
3426
3446
|
r(this, "ctx");
|
|
3427
3447
|
r(this, "visibleHoverCell");
|
|
@@ -3578,7 +3598,7 @@ class Fe {
|
|
|
3578
3598
|
this.resizeObserver.unobserve(this.ctx.stageElement), this.mutationObserver.disconnect();
|
|
3579
3599
|
}
|
|
3580
3600
|
}
|
|
3581
|
-
const
|
|
3601
|
+
const Pe = {
|
|
3582
3602
|
numberErrorTip: "只允许输入数字",
|
|
3583
3603
|
emptyText: "暂无数据",
|
|
3584
3604
|
loadingText: "加载中...",
|
|
@@ -3602,7 +3622,7 @@ const We = {
|
|
|
3602
3622
|
numberMax: "输入值大于{max},已自动调整为{max}",
|
|
3603
3623
|
stringMaxlength: "输入值超过{maxlength}个字符,已自动截取"
|
|
3604
3624
|
};
|
|
3605
|
-
class
|
|
3625
|
+
class ze {
|
|
3606
3626
|
constructor() {
|
|
3607
3627
|
r(this, "langConfig");
|
|
3608
3628
|
}
|
|
@@ -3610,18 +3630,108 @@ class Ve {
|
|
|
3610
3630
|
this.langConfig = t;
|
|
3611
3631
|
}
|
|
3612
3632
|
getText(t, e) {
|
|
3613
|
-
const i = { ...
|
|
3614
|
-
Object.assign(i,
|
|
3633
|
+
const i = { ...Pe };
|
|
3634
|
+
Object.assign(i, Ot.locale, this.langConfig);
|
|
3615
3635
|
const s = i[t];
|
|
3616
3636
|
return s ? s.replace(/{(\w+)}/g, (o, n) => (e == null ? void 0 : e[n]) || o) : "";
|
|
3617
3637
|
}
|
|
3618
3638
|
}
|
|
3619
|
-
|
|
3639
|
+
const $e = /^-?\d*\.?\d+px$/;
|
|
3640
|
+
class Ge {
|
|
3641
|
+
constructor() {
|
|
3642
|
+
r(this, "value", 1);
|
|
3643
|
+
}
|
|
3644
|
+
get isDefault() {
|
|
3645
|
+
return this.value === 1;
|
|
3646
|
+
}
|
|
3647
|
+
clamp(t, e, i) {
|
|
3648
|
+
return Math.min(i, Math.max(e, t));
|
|
3649
|
+
}
|
|
3650
|
+
/** @returns 是否发生变化 */
|
|
3651
|
+
set(t, e, i) {
|
|
3652
|
+
const s = this.clamp(t, e, i);
|
|
3653
|
+
return Math.abs(s - this.value) < 1e-4 ? !1 : (this.value = s, !0);
|
|
3654
|
+
}
|
|
3655
|
+
/** 逻辑 -> 物理 */
|
|
3656
|
+
toVisual(t) {
|
|
3657
|
+
return t * this.value;
|
|
3658
|
+
}
|
|
3659
|
+
/** 物理 -> 逻辑 */
|
|
3660
|
+
toLogical(t) {
|
|
3661
|
+
return t / this.value;
|
|
3662
|
+
}
|
|
3663
|
+
toPx(t) {
|
|
3664
|
+
return `${this.toVisual(t)}px`;
|
|
3665
|
+
}
|
|
3666
|
+
/** DOM 测量高度 -> 逻辑高度 */
|
|
3667
|
+
domHeightToLogical(t) {
|
|
3668
|
+
return Math.round(t / this.value);
|
|
3669
|
+
}
|
|
3670
|
+
/** 逻辑内容尺寸 -> 物理尺寸 */
|
|
3671
|
+
contentToPhysical(t) {
|
|
3672
|
+
return t * this.value;
|
|
3673
|
+
}
|
|
3674
|
+
scaleStyle(t) {
|
|
3675
|
+
if (this.isDefault)
|
|
3676
|
+
return t;
|
|
3677
|
+
const e = { ...t };
|
|
3678
|
+
for (const i of Object.keys(e)) {
|
|
3679
|
+
const s = e[i];
|
|
3680
|
+
typeof s == "string" && $e.test(s) && (e[i] = `${parseFloat(s) * this.value}px`);
|
|
3681
|
+
}
|
|
3682
|
+
return e;
|
|
3683
|
+
}
|
|
3684
|
+
assignScaledStyle(t, e) {
|
|
3685
|
+
Object.assign(t.style, this.scaleStyle(e));
|
|
3686
|
+
}
|
|
3687
|
+
/** 容器物理宽度 -> 逻辑可视宽度 */
|
|
3688
|
+
containerWidth(t) {
|
|
3689
|
+
return Math.floor(t / this.value);
|
|
3690
|
+
}
|
|
3691
|
+
resolveStageWidth(t) {
|
|
3692
|
+
const e = this.containerWidth(t.containerPhysicalWidth), i = t.fillContainer ? e : Math.min(Math.floor(t.contentWidth + t.scrollerTrackSize), e), s = Math.min(
|
|
3693
|
+
Math.round(this.toVisual(i)),
|
|
3694
|
+
Math.floor(t.containerPhysicalWidth)
|
|
3695
|
+
);
|
|
3696
|
+
return { stageWidth: i, stagePhysicalWidth: s };
|
|
3697
|
+
}
|
|
3698
|
+
applyStageHeight(t, e) {
|
|
3699
|
+
const i = Math.floor(e), s = Math.floor(i / this.value);
|
|
3700
|
+
return t.style.height = `${i}px`, { stageHeight: s, stagePhysicalHeight: i };
|
|
3701
|
+
}
|
|
3702
|
+
/** floating-ui 锚点:逻辑单元格 -> 视口物理矩形 */
|
|
3703
|
+
getViewportRect(t, e) {
|
|
3704
|
+
const i = this.toVisual(t.x) + e.x, s = this.toVisual(t.y) + e.y, o = this.toVisual(t.width), n = this.toVisual(t.height);
|
|
3705
|
+
return {
|
|
3706
|
+
x: i,
|
|
3707
|
+
y: s,
|
|
3708
|
+
left: i,
|
|
3709
|
+
top: s,
|
|
3710
|
+
right: i + o,
|
|
3711
|
+
bottom: s + n,
|
|
3712
|
+
width: o,
|
|
3713
|
+
height: n
|
|
3714
|
+
};
|
|
3715
|
+
}
|
|
3716
|
+
/** overlayer 单元格:外层物理定位 + 内层 zoom 缩放自定义 render */
|
|
3717
|
+
createOverlayerCellElement(t, e) {
|
|
3718
|
+
const i = document.createElement("div");
|
|
3719
|
+
if (this.assignScaledStyle(i, t.style), Object.keys(t.domDataset || {}).forEach((l) => {
|
|
3720
|
+
i.setAttribute(l, t.domDataset[l]);
|
|
3721
|
+
}), typeof t.render != "function")
|
|
3722
|
+
return i;
|
|
3723
|
+
if (this.isDefault)
|
|
3724
|
+
return t.render(i, t), i;
|
|
3725
|
+
const s = "visibleWidth" in t ? t.visibleWidth : t.width, o = "visibleHeight" in t ? t.visibleHeight : t.height, n = "autoRowHeight" in t && t.autoRowHeight && "renderType" in t && t.renderType === "default", a = document.createElement("div");
|
|
3726
|
+
return a.className = `${e}-overlayer-cell-content`, a.style.width = `${s}px`, a.style.boxSizing = "border-box", n ? (a.style.height = "auto", a.style.minHeight = `${o}px`, i.style.height = "auto") : (a.style.height = `${o}px`, i.style.height = this.toPx(o)), a.style.zoom = String(this.value), i.style.width = this.toPx(s), i.appendChild(a), t.render(a, t), i;
|
|
3727
|
+
}
|
|
3728
|
+
}
|
|
3729
|
+
class Ue {
|
|
3620
3730
|
constructor(t, e) {
|
|
3621
3731
|
r(this, "eventBus");
|
|
3622
3732
|
r(this, "eventBrowser");
|
|
3623
3733
|
r(this, "eventTable");
|
|
3624
|
-
r(this, "locale", new
|
|
3734
|
+
r(this, "locale", new ze());
|
|
3625
3735
|
r(this, "containerElement");
|
|
3626
3736
|
r(this, "stageElement");
|
|
3627
3737
|
r(this, "canvasElement");
|
|
@@ -3631,7 +3741,12 @@ class Pe {
|
|
|
3631
3741
|
r(this, "contextMenuElement");
|
|
3632
3742
|
r(this, "loadingElement");
|
|
3633
3743
|
r(this, "stageWidth", 0);
|
|
3744
|
+
// 逻辑可视宽度(物理宽度/zoom)
|
|
3634
3745
|
r(this, "stageHeight", 0);
|
|
3746
|
+
// 逻辑可视高度(物理高度/zoom)
|
|
3747
|
+
r(this, "stagePhysicalWidth", 0);
|
|
3748
|
+
r(this, "stagePhysicalHeight", 0);
|
|
3749
|
+
r(this, "zoomScale");
|
|
3635
3750
|
r(this, "paint");
|
|
3636
3751
|
r(this, "icons");
|
|
3637
3752
|
r(this, "domSelectionStr", "");
|
|
@@ -3765,10 +3880,13 @@ class Pe {
|
|
|
3765
3880
|
loadingElement: c,
|
|
3766
3881
|
contextMenuElement: d
|
|
3767
3882
|
} = t;
|
|
3768
|
-
this.containerElement = i, s.tabIndex = 0, this.stageElement = s, this.canvasElement = o, this.overlayerElement = n, this.editorElement = a, this.emptyElement = l, this.loadingElement = c, this.contextMenuElement = d, this.config = new
|
|
3883
|
+
this.containerElement = i, s.tabIndex = 0, this.stageElement = s, this.canvasElement = o, this.overlayerElement = n, this.editorElement = a, this.emptyElement = l, this.loadingElement = c, this.contextMenuElement = d, this.config = new Ft(e.config || {}), this.eventBus = new He(), this.eventBrowser = new Ae(this), this.eventTable = new Ve(this), this.paint = new De(this.canvasElement), this.database = new Le(this, e), this.history = new Me(this), this.icons = new We(this), this.zoomScale = new Ge();
|
|
3884
|
+
}
|
|
3885
|
+
get zoom() {
|
|
3886
|
+
return this.zoomScale.value;
|
|
3769
3887
|
}
|
|
3770
3888
|
setConfig(t) {
|
|
3771
|
-
this.config = new
|
|
3889
|
+
this.config = new Ft(t);
|
|
3772
3890
|
}
|
|
3773
3891
|
setItemValueByEditor(t, e, i, s = !0, o = !0, n = !0) {
|
|
3774
3892
|
if (this.config.ENABLE_MERGE_CELL_LINK) {
|
|
@@ -3876,10 +3994,29 @@ class Pe {
|
|
|
3876
3994
|
getOffset(t) {
|
|
3877
3995
|
const { left: e, top: i } = this.containerElement.getBoundingClientRect();
|
|
3878
3996
|
return {
|
|
3879
|
-
offsetX: t.clientX - e,
|
|
3880
|
-
offsetY: t.clientY - i
|
|
3997
|
+
offsetX: this.zoomScale.toLogical(t.clientX - e),
|
|
3998
|
+
offsetY: this.zoomScale.toLogical(t.clientY - i)
|
|
3881
3999
|
};
|
|
3882
4000
|
}
|
|
4001
|
+
toVisual(t) {
|
|
4002
|
+
return this.zoomScale.toVisual(t);
|
|
4003
|
+
}
|
|
4004
|
+
toLogical(t) {
|
|
4005
|
+
return this.zoomScale.toLogical(t);
|
|
4006
|
+
}
|
|
4007
|
+
toVisualPx(t) {
|
|
4008
|
+
return this.zoomScale.toPx(t);
|
|
4009
|
+
}
|
|
4010
|
+
scaleStyle(t) {
|
|
4011
|
+
return this.zoomScale.scaleStyle(t);
|
|
4012
|
+
}
|
|
4013
|
+
setZoom(t) {
|
|
4014
|
+
const { MIN_ZOOM: e, MAX_ZOOM: i } = this.config;
|
|
4015
|
+
this.zoomScale.set(t, e, i) && (this.emit("zoomChange", this.zoomScale.value), this.emit("resetHeader"));
|
|
4016
|
+
}
|
|
4017
|
+
getZoom() {
|
|
4018
|
+
return this.zoomScale.value;
|
|
4019
|
+
}
|
|
3883
4020
|
hasEvent(t) {
|
|
3884
4021
|
return this.eventBus.has(t);
|
|
3885
4022
|
}
|
|
@@ -3899,7 +4036,7 @@ class Pe {
|
|
|
3899
4036
|
this.eventTable.destroy(), this.eventBrowser.destroy(), this.eventBus.destroy();
|
|
3900
4037
|
}
|
|
3901
4038
|
}
|
|
3902
|
-
class
|
|
4039
|
+
class Pt {
|
|
3903
4040
|
constructor(t, e) {
|
|
3904
4041
|
r(this, "ctx");
|
|
3905
4042
|
r(this, "type");
|
|
@@ -3930,7 +4067,7 @@ class Wt {
|
|
|
3930
4067
|
this.updateScroll(t);
|
|
3931
4068
|
}
|
|
3932
4069
|
onTouchmove(t) {
|
|
3933
|
-
const { clientY: e, clientX: i } = t.touches[0], s = e - this.clientY, o = i - this.clientX;
|
|
4070
|
+
const { clientY: e, clientX: i } = t.touches[0], s = this.ctx.zoomScale.toLogical(e - this.clientY), o = this.ctx.zoomScale.toLogical(i - this.clientX);
|
|
3934
4071
|
let n = 0;
|
|
3935
4072
|
this.type === "vertical" ? (n = Math.max(0, Math.min(this.dragStart - s, this.distance)), this.hasScrollbar() && !(n === 0 && s > 0 || n === this.distance && s < 0) && t.preventDefault()) : this.type === "horizontal" && (n = Math.max(0, Math.min(this.dragStart - o, this.distance))), this.scroll = n;
|
|
3936
4073
|
}
|
|
@@ -3943,13 +4080,13 @@ class Wt {
|
|
|
3943
4080
|
return;
|
|
3944
4081
|
if (this.ctx.stageElement.style.cursor === "row-resize" || this.ctx.stageElement.style.cursor === "col-resize")
|
|
3945
4082
|
return !0;
|
|
3946
|
-
const {
|
|
3947
|
-
if (!(
|
|
3948
|
-
if (this.isOnScrollbar(
|
|
3949
|
-
this.clientX =
|
|
3950
|
-
else if (this.isOnTrack(
|
|
4083
|
+
const { clientX: e, clientY: i } = t, s = this.ctx.zoomScale.toLogical(t.offsetX), o = this.ctx.zoomScale.toLogical(t.offsetY);
|
|
4084
|
+
if (!(e == this.clientX && i == this.clientY)) {
|
|
4085
|
+
if (this.isOnScrollbar(s, o))
|
|
4086
|
+
this.clientX = e, this.clientY = i, this.isDragging = !0, this.ctx.scrollerMove = !0, this.isFocus = !0, this.dragStart = this.scroll, t.preventDefault();
|
|
4087
|
+
else if (this.isOnTrack(s, o)) {
|
|
3951
4088
|
let n = 0;
|
|
3952
|
-
this.type === "vertical" ? n = (
|
|
4089
|
+
this.type === "vertical" ? n = (o - this.ctx.header.height - this.barHeight / 2) / (this.visibleDistance - this.barHeight) * this.distance : n = (s - this.barWidth / 2) / (this.visibleDistance - this.barWidth) * this.distance, this.scroll = Math.max(0, Math.min(n, this.distance));
|
|
3953
4090
|
}
|
|
3954
4091
|
}
|
|
3955
4092
|
}
|
|
@@ -3957,10 +4094,10 @@ class Wt {
|
|
|
3957
4094
|
this.isDragging = !1, this.isFocus = !1, this.clientX = 0, this.clientY = 0;
|
|
3958
4095
|
}
|
|
3959
4096
|
onMouseMove(t) {
|
|
3960
|
-
const {
|
|
3961
|
-
if (this.isOnScrollbar(
|
|
4097
|
+
const { clientX: e, clientY: i, buttons: s } = t, o = this.ctx.zoomScale.toLogical(t.offsetX), n = this.ctx.zoomScale.toLogical(t.offsetY);
|
|
4098
|
+
if (this.isOnScrollbar(o, n) && t.target === this.ctx.canvasElement ? this.isFocus = !0 : this.isFocus = !1, s === 0 || e == this.clientX && i == this.clientY) return;
|
|
3962
4099
|
let a = 0;
|
|
3963
|
-
if (this.type === "horizontal" ? a =
|
|
4100
|
+
if (this.type === "horizontal" ? a = e - this.clientX : a = i - this.clientY, a = this.ctx.zoomScale.toLogical(a), this.isDragging && a !== 0) {
|
|
3964
4101
|
let l = 0;
|
|
3965
4102
|
this.type === "vertical" ? l = this.dragStart + a / (this.visibleDistance - this.barHeight) * this.distance : l = this.dragStart + a / (this.visibleDistance - this.barWidth) * this.distance, this.scroll = Math.max(0, Math.min(l, this.distance));
|
|
3966
4103
|
}
|
|
@@ -4004,8 +4141,8 @@ class Wt {
|
|
|
4004
4141
|
const g = a ? 0 : 0.5;
|
|
4005
4142
|
this.trackX = 0, this.trackY = c - o + g, this.trackWidth = l, this.trackHeight = o;
|
|
4006
4143
|
const E = this.distance ? this.visibleDistance / f : 0;
|
|
4007
|
-
let
|
|
4008
|
-
this.barY = this.trackY - 1 + (o - n) / 2,
|
|
4144
|
+
let m = Math.floor(E * this.visibleDistance);
|
|
4145
|
+
this.barY = this.trackY - 1 + (o - n) / 2, m < 30 ? m = 30 : m >= this.visibleDistance && (m = 0), this.barWidth = m, this.barHeight = n, this.barX = this.scroll / this.distance * (this.visibleDistance - this.barWidth), this.scroll = Math.max(0, Math.min(this.scroll, this.distance));
|
|
4009
4146
|
}
|
|
4010
4147
|
}
|
|
4011
4148
|
draw() {
|
|
@@ -4026,7 +4163,7 @@ class Wt {
|
|
|
4026
4163
|
}), this.ctx.scrollerFocus = this.isFocus;
|
|
4027
4164
|
}
|
|
4028
4165
|
}
|
|
4029
|
-
class
|
|
4166
|
+
class Ze {
|
|
4030
4167
|
// 垂直滚动定时器
|
|
4031
4168
|
constructor(t) {
|
|
4032
4169
|
r(this, "ctx");
|
|
@@ -4039,7 +4176,7 @@ class ze {
|
|
|
4039
4176
|
r(this, "timerX", 0);
|
|
4040
4177
|
// 水平滚动定时器
|
|
4041
4178
|
r(this, "timerY", 0);
|
|
4042
|
-
this.ctx = t, this.verticalScrollbar = new
|
|
4179
|
+
this.ctx = t, this.verticalScrollbar = new Pt(t, "vertical"), this.horizontalScrollbar = new Pt(t, "horizontal"), this.ctx.on("wheel", (e) => this.onWheel(e)), this.ctx.on("mousedown", (e) => this.onMouseDown(e)), this.ctx.on("mousemove", (e) => this.onMouseMove(e)), this.ctx.on("mouseup", () => this.onMouseUp()), this.ctx.on("touchmove", (e) => this.onTouchmove(e)), this.ctx.on("touchstart", (e) => {
|
|
4043
4180
|
this.onTouchstart(e);
|
|
4044
4181
|
}), this.ctx.on("setScroll", (e, i) => {
|
|
4045
4182
|
this.setScroll(e, i);
|
|
@@ -4141,7 +4278,7 @@ class ze {
|
|
|
4141
4278
|
t && (this.adjustPositionX = "", this.timerX && (clearInterval(this.timerX), this.timerX = 0)), e && (this.adjustPositionY = "", this.timerY && (clearInterval(this.timerY), this.timerY = 0));
|
|
4142
4279
|
}
|
|
4143
4280
|
}
|
|
4144
|
-
class
|
|
4281
|
+
class je extends se {
|
|
4145
4282
|
constructor(e, i, s, o, n, a, l) {
|
|
4146
4283
|
super(e, s, o, n, a, "header", l.fixed);
|
|
4147
4284
|
r(this, "align");
|
|
@@ -4210,7 +4347,7 @@ class $e extends ee {
|
|
|
4210
4347
|
r(this, "drawSortImageName", "");
|
|
4211
4348
|
r(this, "drawSortImageSource");
|
|
4212
4349
|
r(this, "renderHeaderType", "default");
|
|
4213
|
-
this.ctx = e, this.x = s, this.y = o, this.width = n, this.height = a, this.visibleWidth = n, this.visibleHeight = a, this.colIndex = i, this.key = l.key, this.minWidth = l.minWidth, this.maxWidth = l.maxWidth, this.hide = (typeof l.hide == "function" ? l.hide(l) : l.hide) || !1, this.type = l.type || "", this.editorType = l.editorType || "text", this.hideHeaderSelection = l.hideHeaderSelection || !1, this.align = l.headerAlign || l.align || this.ctx.config.COLUMNS_ALIGN, this.verticalAlign = l.headerVerticalAlign || l.verticalAlign || this.ctx.config.COLUMNS_VERTICAL_ALIGN, this.fixed = l.fixed || "", this.level = l.level || 0, this.operation = l.operation || !1, this.text = l.title, this.column = l, this.colspan = l.colspan || 1, this.widthFillDisable = l.widthFillDisable || !1, this.rowspan = l.rowspan || 1, this.rules = l.rules, this.readonly = l.readonly || !1, this.required = l.required || !1, this.sortIconName = l.sortIconName || "sort-default", this.sortAscIconName = l.sortAscIconName || "sort-asc", this.sortDescIconName = l.sortDescIconName || "sort-desc", this.rowKey =
|
|
4350
|
+
this.ctx = e, this.x = s, this.y = o, this.width = n, this.height = a, this.visibleWidth = n, this.visibleHeight = a, this.colIndex = i, this.key = l.key, this.minWidth = l.minWidth, this.maxWidth = l.maxWidth, this.hide = (typeof l.hide == "function" ? l.hide(l) : l.hide) || !1, this.type = l.type || "", this.editorType = l.editorType || "text", this.hideHeaderSelection = l.hideHeaderSelection || !1, this.align = l.headerAlign || l.align || this.ctx.config.COLUMNS_ALIGN, this.verticalAlign = l.headerVerticalAlign || l.verticalAlign || this.ctx.config.COLUMNS_VERTICAL_ALIGN, this.fixed = l.fixed || "", this.level = l.level || 0, this.operation = l.operation || !1, this.text = l.title, this.column = l, this.colspan = l.colspan || 1, this.widthFillDisable = l.widthFillDisable || !1, this.rowspan = l.rowspan || 1, this.rules = l.rules, this.readonly = l.readonly || !1, this.required = l.required || !1, this.sortIconName = l.sortIconName || "sort-default", this.sortAscIconName = l.sortAscIconName || "sort-asc", this.sortDescIconName = l.sortDescIconName || "sort-desc", this.rowKey = Qt(), this.overflowTooltipShow = l.overflowTooltipHeaderShow !== !1, this.hasChildren = l.children && l.children.length > 0 || !1, this.render = l.renderHeader, this.maxLineClampHeader = l.maxLineClampHeader || "auto", this.renderHeaderType = l.renderHeaderType || "default";
|
|
4214
4351
|
}
|
|
4215
4352
|
/**
|
|
4216
4353
|
* 是否可见,覆盖基类方法,表头是跟y滚动条没有关系的所以不需要加滚动参数
|
|
@@ -4288,6 +4425,9 @@ class $e extends ee {
|
|
|
4288
4425
|
cacheTextKey: o,
|
|
4289
4426
|
textCallback: (n) => {
|
|
4290
4427
|
this.textInfo = n;
|
|
4428
|
+
},
|
|
4429
|
+
layoutCallback: (n) => {
|
|
4430
|
+
this.ctx.emit("registerTextLayout", `${this.cellType}-${this.colIndex}-${this.level}`, n);
|
|
4291
4431
|
}
|
|
4292
4432
|
}
|
|
4293
4433
|
);
|
|
@@ -4326,7 +4466,7 @@ class $e extends ee {
|
|
|
4326
4466
|
this.drawTextX = a + o - n / 2, this.drawTextWidth = this.drawX + this.visibleWidth - this.drawTextX, (this.align === "left" || this.align === "right") && (a = this.drawX + n, this.drawTextX = a + o - n / 2, this.drawTextWidth = this.drawX + this.visibleWidth - this.drawTextX), this.verticalAlign === "top" ? l = this.drawY + n / 2 : this.verticalAlign === "bottom" && (l = this.drawY + this.height - o - n / 2), this.column.dragRow && (a += this.ctx.config.DRAG_ROW_ICON_SIZE, this.drawTextX += this.ctx.config.DRAG_ROW_ICON_SIZE, this.drawTextWidth -= this.ctx.config.DRAG_ROW_ICON_SIZE);
|
|
4327
4467
|
let c = this.ctx.icons.get("checkbox-uncheck"), d = "checkbox-uncheck";
|
|
4328
4468
|
e ? (c = this.ctx.icons.get("checkbox-indeterminate"), d = "checkbox-indeterminate") : i && s ? (c = this.ctx.icons.get("checkbox-check"), d = "checkbox-check") : i && !s ? (c = this.ctx.icons.get("checkbox-check-disabled"), d = "checkbox-check-disabled") : !i && s ? (c = this.ctx.icons.get("checkbox-uncheck"), d = "checkbox-uncheck") : (c = this.ctx.icons.get("checkbox-disabled"), d = "checkbox-disabled");
|
|
4329
|
-
const f = new
|
|
4469
|
+
const f = new Z(d, a, l, o, o, c);
|
|
4330
4470
|
f.setVisible(!this.hideHeaderSelection), this.setImage("selection", f);
|
|
4331
4471
|
}
|
|
4332
4472
|
}
|
|
@@ -4337,7 +4477,7 @@ class $e extends ee {
|
|
|
4337
4477
|
let l = this.sortIconName;
|
|
4338
4478
|
const c = this.ctx.database.getSortState(this.key);
|
|
4339
4479
|
c.direction === "asc" ? l = this.sortAscIconName : c.direction === "desc" && (l = this.sortDescIconName);
|
|
4340
|
-
const d = this.ctx.icons.get(l), f = new
|
|
4480
|
+
const d = this.ctx.icons.get(l), f = new Z(l, o, n, a, a, d);
|
|
4341
4481
|
this.setImage("sort", f);
|
|
4342
4482
|
}
|
|
4343
4483
|
getText() {
|
|
@@ -4360,7 +4500,7 @@ class $e extends ee {
|
|
|
4360
4500
|
};
|
|
4361
4501
|
}
|
|
4362
4502
|
}
|
|
4363
|
-
class
|
|
4503
|
+
class re {
|
|
4364
4504
|
constructor(t, e) {
|
|
4365
4505
|
r(this, "root");
|
|
4366
4506
|
r(this, "key");
|
|
@@ -4409,7 +4549,7 @@ class oe {
|
|
|
4409
4549
|
return !1;
|
|
4410
4550
|
}
|
|
4411
4551
|
}
|
|
4412
|
-
class
|
|
4552
|
+
class qe {
|
|
4413
4553
|
constructor(t) {
|
|
4414
4554
|
r(this, "ctx");
|
|
4415
4555
|
// 上下文
|
|
@@ -4455,7 +4595,7 @@ class Ge {
|
|
|
4455
4595
|
r(this, "renderFixedCellHeaders", []);
|
|
4456
4596
|
this.ctx = t, this.ctx.on(
|
|
4457
4597
|
"resetHeader",
|
|
4458
|
-
|
|
4598
|
+
Lt(() => {
|
|
4459
4599
|
this.init(), this.ctx.clearSelector(), this.ctx.emit("draw");
|
|
4460
4600
|
}, 100)
|
|
4461
4601
|
), this.init(), this.initSelection(), this.initSort(), this.initResizeColumn(), this.initDragColumn();
|
|
@@ -4465,31 +4605,33 @@ class Ge {
|
|
|
4465
4605
|
config: { HEADER_HEIGHT: e, SCROLLER_TRACK_SIZE: i }
|
|
4466
4606
|
} = this.ctx;
|
|
4467
4607
|
if (!t) {
|
|
4468
|
-
const
|
|
4469
|
-
this.columns =
|
|
4470
|
-
}
|
|
4471
|
-
this.allCellHeaders = [], this.leafCellHeaders = [], this.fixedLeftCellHeaders = [], this.fixedRightCellHeaders = [], this.centerCellHeaders = [], this.visibleColumns =
|
|
4472
|
-
const s =
|
|
4473
|
-
this.height = e * s, this.visibleHeight = this.height, this.width = o.reduce((
|
|
4474
|
-
const
|
|
4475
|
-
return
|
|
4608
|
+
const x = this.ctx.database.getColumns();
|
|
4609
|
+
this.columns = x;
|
|
4610
|
+
}
|
|
4611
|
+
this.allCellHeaders = [], this.leafCellHeaders = [], this.fixedLeftCellHeaders = [], this.fixedRightCellHeaders = [], this.centerCellHeaders = [], this.visibleColumns = te(this.columns);
|
|
4612
|
+
const s = at(this.visibleColumns), o = et(this.visibleColumns);
|
|
4613
|
+
this.height = e * s, this.visibleHeight = this.height, this.width = o.reduce((x, g) => {
|
|
4614
|
+
const E = g.width || 100, { maxWidth: m, minWidth: w } = g;
|
|
4615
|
+
return m && E > m ? x + m : w && E < w ? x + w : x + E;
|
|
4476
4616
|
}, 0), this.columnIndex = 0, this.resizeNum = 0;
|
|
4477
|
-
const n =
|
|
4617
|
+
const n = Ce(lt(this.visibleColumns, s));
|
|
4478
4618
|
this.render(n, 0), this.ctx.database.updateColIndexKeyMap(this.leafCellHeaders);
|
|
4479
|
-
const a = this.ctx.containerElement.getBoundingClientRect()
|
|
4480
|
-
|
|
4481
|
-
|
|
4482
|
-
|
|
4483
|
-
|
|
4484
|
-
|
|
4485
|
-
|
|
4486
|
-
|
|
4487
|
-
|
|
4488
|
-
|
|
4489
|
-
|
|
4490
|
-
|
|
4491
|
-
const
|
|
4492
|
-
this.ctx.
|
|
4619
|
+
const a = this.ctx.containerElement.getBoundingClientRect(), { stageWidth: l, stagePhysicalWidth: c } = this.ctx.zoomScale.resolveStageWidth({
|
|
4620
|
+
containerPhysicalWidth: a.width,
|
|
4621
|
+
contentWidth: this.width,
|
|
4622
|
+
scrollerTrackSize: i,
|
|
4623
|
+
fillContainer: this.resizeNum > 0
|
|
4624
|
+
});
|
|
4625
|
+
this.ctx.stageWidth = l, this.ctx.stagePhysicalWidth = c, this.ctx.stageElement.style.width = `${c}px`, this.visibleWidth = this.ctx.stageWidth - i;
|
|
4626
|
+
const d = this.visibleWidth - this.width;
|
|
4627
|
+
if (this.resizeNum && d > 0) {
|
|
4628
|
+
const x = Math.floor(d / this.resizeNum * 100) / 100;
|
|
4629
|
+
this.resizeAllColumn(x);
|
|
4630
|
+
}
|
|
4631
|
+
const f = this.fixedLeftCellHeaders.filter((x) => !x.hasChildren);
|
|
4632
|
+
this.ctx.fixedLeftWidth = f.reduce((x, g) => x + g.width, 0);
|
|
4633
|
+
const u = this.fixedRightCellHeaders.filter((x) => !x.hasChildren);
|
|
4634
|
+
this.ctx.fixedRightWidth = u.reduce((x, g) => x + g.width, i), this.ctx.maxColIndex = this.leafCellHeaders.length - 1, this.ctx.header.x = this.x, this.ctx.header.y = this.y, this.ctx.header.width = this.width, this.ctx.header.height = this.height, this.ctx.header.allCellHeaders = this.allCellHeaders, this.ctx.header.visibleWidth = this.visibleWidth, this.ctx.header.visibleHeight = this.visibleHeight;
|
|
4493
4635
|
}
|
|
4494
4636
|
initSort() {
|
|
4495
4637
|
this.ctx.on("cellHeaderClick", (t, e) => {
|
|
@@ -4527,20 +4669,21 @@ class Ge {
|
|
|
4527
4669
|
} else {
|
|
4528
4670
|
if (this.resizeTarget = null, this.isMouseDown)
|
|
4529
4671
|
return;
|
|
4530
|
-
|
|
4672
|
+
const { offsetX: s } = this.ctx.getOffset(t);
|
|
4673
|
+
if (s < 0 || s > this.visibleWidth) {
|
|
4531
4674
|
this.ctx.stageElement.style.cursor === "col-resize" && (this.ctx.stageElement.style.cursor = "default");
|
|
4532
4675
|
return;
|
|
4533
4676
|
}
|
|
4534
4677
|
this.ctx.stageElement.style.cursor === "col-resize" && (this.ctx.stageElement.style.cursor = "default");
|
|
4535
|
-
const
|
|
4536
|
-
for (const
|
|
4537
|
-
const { offsetX:
|
|
4538
|
-
if (
|
|
4539
|
-
|
|
4540
|
-
const
|
|
4541
|
-
if (!
|
|
4678
|
+
const o = [...this.renderFixedCellHeaders, ...this.renderCenterCellHeaders];
|
|
4679
|
+
for (const n of o) {
|
|
4680
|
+
const { offsetX: a, offsetY: l } = this.ctx.getOffset(t), c = a, d = l, f = n.getDrawX(), u = n.getDrawY();
|
|
4681
|
+
if (c > f + n.width - 5 && c < f + n.width + 4 && c < e - 4 && // 视窗中最后一列不允许调整宽
|
|
4682
|
+
d > u) {
|
|
4683
|
+
const x = n.colIndex + n.colspan - 1, g = this.leafCellHeaders.find((E) => E.colIndex === x);
|
|
4684
|
+
if (!g || !g.fixed && this.ctx.stageWidth - this.ctx.fixedRightWidth < f + n.width)
|
|
4542
4685
|
return;
|
|
4543
|
-
this.ctx.isTarget(t) &&
|
|
4686
|
+
this.ctx.isTarget(t) && l <= this.height && (this.ctx.stageElement.style.cursor = "col-resize", this.resizeTarget = g);
|
|
4544
4687
|
}
|
|
4545
4688
|
}
|
|
4546
4689
|
}
|
|
@@ -4556,7 +4699,7 @@ class Ge {
|
|
|
4556
4699
|
if (this.dragingCell && this.dragTarget) {
|
|
4557
4700
|
const t = (c, d = {}) => (c.forEach((f, u) => {
|
|
4558
4701
|
f.children && t(f.children, d), d[f.key] = u;
|
|
4559
|
-
}), d), e = this.ctx.database.getColumns(), i =
|
|
4702
|
+
}), d), e = this.ctx.database.getColumns(), i = lt(e, at(e)), s = new re(i, {
|
|
4560
4703
|
key: "key",
|
|
4561
4704
|
// 节点唯一标识字段(对应我们之前的field)
|
|
4562
4705
|
childrenKey: "children"
|
|
@@ -4650,7 +4793,7 @@ class Ge {
|
|
|
4650
4793
|
columns: t,
|
|
4651
4794
|
customHeader: e
|
|
4652
4795
|
} : {
|
|
4653
|
-
columns:
|
|
4796
|
+
columns: lt(t, at(t)),
|
|
4654
4797
|
customHeader: e
|
|
4655
4798
|
};
|
|
4656
4799
|
}
|
|
@@ -4661,8 +4804,8 @@ class Ge {
|
|
|
4661
4804
|
for (let n = 0; n < i; n++) {
|
|
4662
4805
|
const a = t[n], l = o * (a.rowspan || 0), c = o * (a.level || 0);
|
|
4663
4806
|
let { minWidth: d, maxWidth: f } = a, u = a.width || 100;
|
|
4664
|
-
d && u < d && (u = d), f && u > f && (u = f), a.children && (u =
|
|
4665
|
-
const x = new
|
|
4807
|
+
d && u < d && (u = d), f && u > f && (u = f), a.children && (u = et(a.children).reduce((E, m) => E + ((m == null ? void 0 : m.width) || 100), 0));
|
|
4808
|
+
const x = new je(this.ctx, this.columnIndex, s, c, u, l, a);
|
|
4666
4809
|
this.ctx.database.setHeader(a.key, x), this.allCellHeaders.push(x), a.children || (this.leafCellHeaders.push(x), x.column.widthFillDisable || this.resizeNum++), a.fixed === "left" ? this.fixedLeftCellHeaders.push(x) : a.fixed === "right" ? this.fixedRightCellHeaders.push(x) : this.centerCellHeaders.push(x), !a.children && this.columnIndex++, a.children && this.render(a.children, s), s += u;
|
|
4667
4810
|
}
|
|
4668
4811
|
}
|
|
@@ -4781,7 +4924,7 @@ class Ge {
|
|
|
4781
4924
|
}), this.drawBottomLine(), this.drawTipLine(), this.drawDragTip();
|
|
4782
4925
|
}
|
|
4783
4926
|
}
|
|
4784
|
-
class
|
|
4927
|
+
class ae {
|
|
4785
4928
|
constructor(t, e, i = 0, s = 0, o = 0, n = 0, a, l = "body") {
|
|
4786
4929
|
r(this, "ctx");
|
|
4787
4930
|
r(this, "x", 0);
|
|
@@ -4802,7 +4945,7 @@ class ne {
|
|
|
4802
4945
|
update() {
|
|
4803
4946
|
const { header: t } = this.ctx, e = [], i = [], s = [], o = [];
|
|
4804
4947
|
t.renderLeafCellHeaders.forEach((n) => {
|
|
4805
|
-
const a = new
|
|
4948
|
+
const a = new oe(
|
|
4806
4949
|
this.ctx,
|
|
4807
4950
|
this.rowIndex,
|
|
4808
4951
|
n.colIndex,
|
|
@@ -4845,7 +4988,7 @@ class ne {
|
|
|
4845
4988
|
});
|
|
4846
4989
|
}
|
|
4847
4990
|
}
|
|
4848
|
-
class
|
|
4991
|
+
class Je {
|
|
4849
4992
|
constructor(t) {
|
|
4850
4993
|
r(this, "resizeTarget", null);
|
|
4851
4994
|
//调整行大小的目标
|
|
@@ -4904,31 +5047,38 @@ class Ue {
|
|
|
4904
5047
|
this.height = g, this.data = x, this.width = e.width, this.visibleWidth = this.ctx.stageWidth - n;
|
|
4905
5048
|
const E = this.ctx.footer.height;
|
|
4906
5049
|
this.ctx.isEmpty = !this.data.length, !this.data.length && !a ? this.height = l : !this.data.length && a && (this.height = a - e.height - E - n);
|
|
5050
|
+
const { zoomScale: m } = this.ctx;
|
|
4907
5051
|
let w = this.height + e.height + n;
|
|
4908
5052
|
w += E;
|
|
4909
|
-
let
|
|
4910
|
-
const
|
|
4911
|
-
if (
|
|
4912
|
-
const
|
|
4913
|
-
|
|
4914
|
-
} else this.data.length && a ?
|
|
4915
|
-
|
|
4916
|
-
|
|
4917
|
-
|
|
4918
|
-
|
|
4919
|
-
|
|
4920
|
-
|
|
5053
|
+
let y = m.contentToPhysical(w);
|
|
5054
|
+
const C = window.innerHeight, { top: p } = this.containerRect || this.ctx.containerElement.getBoundingClientRect();
|
|
5055
|
+
if (C > p && d && !a) {
|
|
5056
|
+
const M = C - p - f;
|
|
5057
|
+
M > m.contentToPhysical(e.height + n) ? y = M : m.contentToPhysical(w) > c && (y = c);
|
|
5058
|
+
} else this.data.length && a ? y = a : this.data.length && c && m.contentToPhysical(w) > c && (y = c);
|
|
5059
|
+
if (y > 0) {
|
|
5060
|
+
const { stageHeight: O, stagePhysicalHeight: M } = m.applyStageHeight(
|
|
5061
|
+
this.ctx.stageElement,
|
|
5062
|
+
y
|
|
5063
|
+
);
|
|
5064
|
+
this.ctx.stageHeight = O, this.ctx.stagePhysicalHeight = M;
|
|
5065
|
+
}
|
|
5066
|
+
let b = this.ctx.stageHeight - e.height - n;
|
|
5067
|
+
o ? this.visibleHeight = b - E : 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 = x;
|
|
5068
|
+
const v = window.devicePixelRatio || 1, I = this.ctx.stagePhysicalWidth * v, T = this.ctx.stagePhysicalHeight * v;
|
|
5069
|
+
t.width = Math.round(I), t.height = Math.round(T);
|
|
5070
|
+
const _ = this.data.length ? "not-empty" : "empty";
|
|
4921
5071
|
this.ctx.emit("emptyChange", {
|
|
4922
|
-
isEmpty:
|
|
4923
|
-
type:
|
|
5072
|
+
isEmpty: _,
|
|
5073
|
+
type: _,
|
|
4924
5074
|
headerHeight: e.height,
|
|
4925
5075
|
bodyHeight: this.height,
|
|
4926
5076
|
footerHeight: E,
|
|
4927
5077
|
width: this.width,
|
|
4928
5078
|
height: this.data.length ? 0 : l + E
|
|
4929
5079
|
});
|
|
4930
|
-
const
|
|
4931
|
-
this.ctx.canvasElement.setAttribute("style", `height:${
|
|
5080
|
+
const R = Math.round(t.width / v * 1e4) / 1e4, S = Math.round(t.height / v * 1e4) / 1e4;
|
|
5081
|
+
this.ctx.canvasElement.setAttribute("style", `height:${S}px;width:${R}px;`), this.ctx.paint.scale(v, this.ctx.zoomScale.value);
|
|
4932
5082
|
}
|
|
4933
5083
|
initTree() {
|
|
4934
5084
|
this.ctx.on("cellClick", (t, e) => {
|
|
@@ -5018,7 +5168,7 @@ class Ue {
|
|
|
5018
5168
|
let s = !0;
|
|
5019
5169
|
const { BEFORE_DRAG_ROW_METHOD: o } = this.ctx.config;
|
|
5020
5170
|
if (typeof o == "function" && (s = await o(i)), s && !this.ctx.config.ENABLE_DRAG_ROW_CUSTOM) {
|
|
5021
|
-
const n = this.ctx.database.getOriginalData(), { TREE_CHILDREN_KEY: a, ROW_KEY: l } = this.ctx.config, c = new
|
|
5171
|
+
const n = this.ctx.database.getOriginalData(), { TREE_CHILDREN_KEY: a, ROW_KEY: l } = this.ctx.config, c = new re(n, {
|
|
5022
5172
|
key: l,
|
|
5023
5173
|
childrenKey: a
|
|
5024
5174
|
});
|
|
@@ -5160,8 +5310,8 @@ class Ue {
|
|
|
5160
5310
|
this.headIndex = Math.max(0, l), this.tailIndex = Math.min(this.ctx.maxRowIndex, c + 1), this.visibleRows = n.slice(this.headIndex, this.tailIndex + 1), this.ctx.body.headIndex = this.headIndex, this.ctx.body.tailIndex = this.tailIndex, this.ctx.body.visibleRows = this.visibleRows;
|
|
5161
5311
|
const d = [];
|
|
5162
5312
|
for (let f = 0; f < this.visibleRows.length; f++) {
|
|
5163
|
-
const u = this.headIndex + f, x = this.visibleRows[f], { height: g, top: E } = this.ctx.database.getPositionForRowIndex(u),
|
|
5164
|
-
d.push(
|
|
5313
|
+
const u = this.headIndex + f, x = this.visibleRows[f], { height: g, top: E } = this.ctx.database.getPositionForRowIndex(u), m = new ae(this.ctx, u, 0, E + this.y, t.width, g, x);
|
|
5314
|
+
d.push(m);
|
|
5165
5315
|
}
|
|
5166
5316
|
this.renderRows = d, this.ctx.body.renderRows = d;
|
|
5167
5317
|
}
|
|
@@ -5190,7 +5340,7 @@ class Ue {
|
|
|
5190
5340
|
}), this.drawTipLine();
|
|
5191
5341
|
}
|
|
5192
5342
|
}
|
|
5193
|
-
class
|
|
5343
|
+
class Qe {
|
|
5194
5344
|
constructor(t) {
|
|
5195
5345
|
r(this, "ctx");
|
|
5196
5346
|
r(this, "renderRows", []);
|
|
@@ -5245,7 +5395,7 @@ class je {
|
|
|
5245
5395
|
let e = this.y;
|
|
5246
5396
|
const i = [];
|
|
5247
5397
|
this.data.forEach((s, o) => {
|
|
5248
|
-
const n = new
|
|
5398
|
+
const n = new ae(this.ctx, o, 0, e, this.width, t, s, "footer");
|
|
5249
5399
|
e += t, i.push(n);
|
|
5250
5400
|
}), this.renderRows = i, this.ctx.footer.renderRows = this.renderRows;
|
|
5251
5401
|
}
|
|
@@ -5271,7 +5421,7 @@ class je {
|
|
|
5271
5421
|
}), this.drawTopLine();
|
|
5272
5422
|
}
|
|
5273
5423
|
}
|
|
5274
|
-
class
|
|
5424
|
+
class ti {
|
|
5275
5425
|
constructor(t) {
|
|
5276
5426
|
r(this, "isCut", !1);
|
|
5277
5427
|
r(this, "isMultipleRow", !1);
|
|
@@ -5283,7 +5433,7 @@ class Ze {
|
|
|
5283
5433
|
this.moveFocus(t);
|
|
5284
5434
|
}), this.ctx.on(
|
|
5285
5435
|
"mousemove",
|
|
5286
|
-
|
|
5436
|
+
Lt((t) => {
|
|
5287
5437
|
var e;
|
|
5288
5438
|
(e = this.ctx.focusCellHeader) != null && e.fixed || !this.ctx.dragHeaderIng && this.ctx.selectorMove && this.ctx.startAdjustPosition(t);
|
|
5289
5439
|
}, 100)
|
|
@@ -5310,7 +5460,7 @@ class Ze {
|
|
|
5310
5460
|
this.ctx.disableHoverIconClick = !1;
|
|
5311
5461
|
}, 0);
|
|
5312
5462
|
}), this.ctx.on("cellHeaderHoverChange", (t) => {
|
|
5313
|
-
this.ctx.mousedown && this.selectCols(t);
|
|
5463
|
+
this.ctx.textSelecting || this.ctx.mousedown && this.selectCols(t);
|
|
5314
5464
|
}), this.ctx.on("cellHoverChange", (t) => {
|
|
5315
5465
|
this.ctx.textSelecting || this.ctx.mousedown && this.selectCols(t);
|
|
5316
5466
|
}), this.ctx.on("cellHeaderMousedown", (t, e) => {
|
|
@@ -5391,27 +5541,27 @@ class Ze {
|
|
|
5391
5541
|
SELECTOR_AREA_MAX_Y: d,
|
|
5392
5542
|
SELECTOR_AREA_MAX_X_OFFSET: f,
|
|
5393
5543
|
SELECTOR_AREA_MAX_Y_OFFSET: u
|
|
5394
|
-
} = this.ctx.config, x = a, g = l || this.ctx.maxColIndex - f, E = c,
|
|
5395
|
-
let [
|
|
5396
|
-
if (
|
|
5544
|
+
} = this.ctx.config, x = a, g = l || this.ctx.maxColIndex - f, E = c, m = d || this.ctx.maxRowIndex - u;
|
|
5545
|
+
let [w, y] = o, [C, p] = n;
|
|
5546
|
+
if (w < x || y > g || C < E || p > m)
|
|
5397
5547
|
return;
|
|
5398
5548
|
if (this.ctx.config.ENABLE_MERGE_CELL_LINK) {
|
|
5399
|
-
const
|
|
5400
|
-
|
|
5549
|
+
const v = this.adjustMergeCells(o, n);
|
|
5550
|
+
C = v.yArr[0], p = v.yArr[1], w = v.xArr[0], y = v.xArr[1], this.ctx.onlyMergeCell = v.onlyMergeCell;
|
|
5401
5551
|
}
|
|
5402
|
-
|
|
5403
|
-
const { BEFORE_SET_SELECTOR_METHOD:
|
|
5404
|
-
if (typeof
|
|
5405
|
-
const
|
|
5552
|
+
w === y && C === p ? this.ctx.selectOnlyOne = !0 : this.ctx.selectOnlyOne = !1, o = [Math.max(x, w), Math.min(g, y)], n = [Math.max(E, C), Math.min(m, p)];
|
|
5553
|
+
const { BEFORE_SET_SELECTOR_METHOD: b } = this.ctx.config;
|
|
5554
|
+
if (typeof b == "function") {
|
|
5555
|
+
const I = b({
|
|
5406
5556
|
focusCell: this.ctx.focusCell,
|
|
5407
5557
|
xArr: o,
|
|
5408
5558
|
yArr: n
|
|
5409
5559
|
});
|
|
5410
|
-
if (!
|
|
5560
|
+
if (!I)
|
|
5411
5561
|
return;
|
|
5412
|
-
o =
|
|
5562
|
+
o = I.xArr, n = I.yArr;
|
|
5413
5563
|
}
|
|
5414
|
-
this.ctx.selector.xArr = o, this.ctx.selector.yArr = n, p === this.ctx.maxRowIndex &&
|
|
5564
|
+
this.ctx.selector.xArr = o, this.ctx.selector.yArr = n, p === this.ctx.maxRowIndex && C === 0 ? this.ctx.selectColsIng = !0 : this.ctx.selectColsIng = !1, y === this.ctx.maxColIndex && w === 0 ? this.ctx.selectRowsIng = !0 : this.ctx.selectRowsIng = !1, this.ctx.emit("setSelector", this.ctx.selector), this.ctx.emit("drawView");
|
|
5415
5565
|
}
|
|
5416
5566
|
}
|
|
5417
5567
|
adjustMergeCells(t, e) {
|
|
@@ -5425,23 +5575,23 @@ class Ze {
|
|
|
5425
5575
|
};
|
|
5426
5576
|
let a = [], l = [];
|
|
5427
5577
|
for (let E = 0; E <= e[1] - e[0]; E++)
|
|
5428
|
-
for (let
|
|
5429
|
-
const
|
|
5430
|
-
|
|
5578
|
+
for (let m = 0; m <= t[1] - t[0]; m++) {
|
|
5579
|
+
const w = E + e[0], y = m + t[0], C = this.ctx.database.getVirtualBodyCell(w, y);
|
|
5580
|
+
C && ((w === i || w === s) && a.push(C), (y === o || y === n) && l.push(C));
|
|
5431
5581
|
}
|
|
5432
5582
|
const c = a.reduce(
|
|
5433
|
-
(E,
|
|
5434
|
-
const { yArr:
|
|
5435
|
-
return E.minY = Math.min(E.minY, y), E.maxY = Math.max(E.maxY,
|
|
5583
|
+
(E, m) => {
|
|
5584
|
+
const { yArr: w } = m.getSpanInfo(), [y, C] = w;
|
|
5585
|
+
return E.minY = Math.min(E.minY, y), E.maxY = Math.max(E.maxY, C), E;
|
|
5436
5586
|
},
|
|
5437
5587
|
{
|
|
5438
5588
|
minY: i,
|
|
5439
5589
|
maxY: s
|
|
5440
5590
|
}
|
|
5441
5591
|
), d = l.reduce(
|
|
5442
|
-
(E,
|
|
5443
|
-
const { xArr:
|
|
5444
|
-
return E.minX = Math.min(E.minX, y), E.maxX = Math.max(E.maxX,
|
|
5592
|
+
(E, m) => {
|
|
5593
|
+
const { xArr: w } = m.getSpanInfo(), [y, C] = w;
|
|
5594
|
+
return E.minX = Math.min(E.minX, y), E.maxX = Math.max(E.maxX, C), E;
|
|
5445
5595
|
},
|
|
5446
5596
|
{
|
|
5447
5597
|
minX: o,
|
|
@@ -5450,8 +5600,8 @@ class Ze {
|
|
|
5450
5600
|
), f = [d.minX, d.maxX], u = [c.minY, c.maxY];
|
|
5451
5601
|
let x = !1;
|
|
5452
5602
|
if (d.minX !== d.maxX || c.minY !== c.maxY) {
|
|
5453
|
-
const E = JSON.stringify(f) + JSON.stringify(u),
|
|
5454
|
-
x = (
|
|
5603
|
+
const E = JSON.stringify(f) + JSON.stringify(u), m = (g = this.ctx.focusCell) == null ? void 0 : g.getSpanInfo();
|
|
5604
|
+
x = (m && JSON.stringify(m.xArr) + JSON.stringify(m.yArr)) === E;
|
|
5455
5605
|
}
|
|
5456
5606
|
return {
|
|
5457
5607
|
xArr: f,
|
|
@@ -5578,7 +5728,7 @@ class Ze {
|
|
|
5578
5728
|
return;
|
|
5579
5729
|
t = a.data;
|
|
5580
5730
|
}
|
|
5581
|
-
const o =
|
|
5731
|
+
const o = ve(t);
|
|
5582
5732
|
navigator.clipboard ? navigator.clipboard.writeText(o).then(() => {
|
|
5583
5733
|
this.ctx.selector.xArrCopy = this.ctx.selector.xArr.slice(), this.ctx.selector.yArrCopy = this.ctx.selector.yArr.slice(), this.ctx.emit("copyChange", {
|
|
5584
5734
|
xArr: this.ctx.selector.xArrCopy,
|
|
@@ -5623,7 +5773,7 @@ class Ze {
|
|
|
5623
5773
|
if (this.ctx.selector.enable && t) {
|
|
5624
5774
|
const e = this.ctx.selector.yArr[0], i = this.ctx.selector.xArr[0], s = /* @__PURE__ */ new Set();
|
|
5625
5775
|
navigator.clipboard.readText().then(async (o) => {
|
|
5626
|
-
let n =
|
|
5776
|
+
let n = Re(o);
|
|
5627
5777
|
const a = [i, i + n[0].length - 1], l = [e, e + n.length - 1], [c, d] = l, [f, u] = a, x = d - this.ctx.maxRowIndex, g = u - this.ctx.maxColIndex;
|
|
5628
5778
|
(x > 0 || g > 0) && this.ctx.emit("onPastedDataOverflow", {
|
|
5629
5779
|
maxY: d,
|
|
@@ -5636,25 +5786,25 @@ class Ze {
|
|
|
5636
5786
|
});
|
|
5637
5787
|
const E = n.length === 1 && n[0].length === 1;
|
|
5638
5788
|
if (this.ctx.config.ENABLE_MERGE_CELL_LINK && this.ctx.database.hasMergeCell(a, l) && !E) {
|
|
5639
|
-
const
|
|
5789
|
+
const C = {
|
|
5640
5790
|
code: "ERR_MERGED_CELLS_PASTE",
|
|
5641
5791
|
message: this.ctx.locale.getText("mergeCellNoPaste"),
|
|
5642
5792
|
data: []
|
|
5643
5793
|
};
|
|
5644
|
-
this.ctx.hasEvent("error") ? this.ctx.emit("error",
|
|
5794
|
+
this.ctx.hasEvent("error") ? this.ctx.emit("error", C) : console.error(C.message);
|
|
5645
5795
|
return;
|
|
5646
5796
|
}
|
|
5647
|
-
let
|
|
5648
|
-
for (let
|
|
5649
|
-
const p = n[
|
|
5650
|
-
for (let
|
|
5651
|
-
const
|
|
5652
|
-
|
|
5653
|
-
|
|
5797
|
+
let m = [];
|
|
5798
|
+
for (let C = 0; C <= n.length - 1; C++) {
|
|
5799
|
+
const p = n[C].length;
|
|
5800
|
+
for (let b = 0; b <= p - 1; b++) {
|
|
5801
|
+
const v = C + e, I = b + i, T = n[C][b], _ = this.ctx.database.getItemValueForRowIndexAndColIndex(
|
|
5802
|
+
v,
|
|
5803
|
+
I
|
|
5654
5804
|
);
|
|
5655
5805
|
if (_) {
|
|
5656
5806
|
const { rowKey: R, key: S } = _;
|
|
5657
|
-
this.ctx.database.getReadonly(R, S) || (s.add(R),
|
|
5807
|
+
this.ctx.database.getReadonly(R, S) || (s.add(R), m.push({
|
|
5658
5808
|
rowKey: R,
|
|
5659
5809
|
key: S,
|
|
5660
5810
|
value: T,
|
|
@@ -5665,35 +5815,35 @@ class Ze {
|
|
|
5665
5815
|
}
|
|
5666
5816
|
}
|
|
5667
5817
|
if (this.isCut) {
|
|
5668
|
-
const
|
|
5818
|
+
const C = this.clearSelectedData(
|
|
5669
5819
|
this.ctx.selector.xArrCopy,
|
|
5670
5820
|
this.ctx.selector.yArrCopy,
|
|
5671
5821
|
!0
|
|
5672
5822
|
// 忽略设置,只返回数据,用于cut,实现历史回退需要返回两次问题
|
|
5673
|
-
), p =
|
|
5674
|
-
|
|
5675
|
-
p.includes(`${
|
|
5823
|
+
), p = m.map((b) => `${b.rowKey}-${b.key}`);
|
|
5824
|
+
C.forEach((b) => {
|
|
5825
|
+
p.includes(`${b.rowKey}-${b.key}`) || m.unshift(b);
|
|
5676
5826
|
}), this.isCut = !1;
|
|
5677
5827
|
}
|
|
5678
|
-
if (!
|
|
5828
|
+
if (!m.length)
|
|
5679
5829
|
return;
|
|
5680
|
-
const { BEFORE_PASTE_DATA_METHOD:
|
|
5681
|
-
if (typeof
|
|
5682
|
-
const
|
|
5683
|
-
rowKey:
|
|
5684
|
-
key:
|
|
5685
|
-
value:
|
|
5686
|
-
oldValue: this.ctx.database.getItemValue(
|
|
5687
|
-
row: this.ctx.database.getRowDataItemForRowKey(
|
|
5830
|
+
const { BEFORE_PASTE_DATA_METHOD: w } = this.ctx.config;
|
|
5831
|
+
if (typeof w == "function") {
|
|
5832
|
+
const C = w, p = m.map((b) => ({
|
|
5833
|
+
rowKey: b.rowKey,
|
|
5834
|
+
key: b.key,
|
|
5835
|
+
value: b.value,
|
|
5836
|
+
oldValue: this.ctx.database.getItemValue(b.rowKey, b.key),
|
|
5837
|
+
row: this.ctx.database.getRowDataItemForRowKey(b.rowKey)
|
|
5688
5838
|
}));
|
|
5689
|
-
if (
|
|
5839
|
+
if (m = await C(p, a, l, n), m && !m.length)
|
|
5690
5840
|
return;
|
|
5691
5841
|
}
|
|
5692
|
-
this.clearCopyLine(), this.ctx.batchSetItemValueByEditor(
|
|
5842
|
+
this.clearCopyLine(), this.ctx.batchSetItemValueByEditor(m, !0);
|
|
5693
5843
|
let y = [];
|
|
5694
|
-
s.forEach((
|
|
5695
|
-
y.push(this.ctx.database.getRowDataItemForRowKey(
|
|
5696
|
-
}), this.ctx.emit("pasteChange",
|
|
5844
|
+
s.forEach((C) => {
|
|
5845
|
+
y.push(this.ctx.database.getRowDataItemForRowKey(C));
|
|
5846
|
+
}), this.ctx.emit("pasteChange", m, y), this.ctx.emit("draw");
|
|
5697
5847
|
}).catch((o) => {
|
|
5698
5848
|
console.error("Failed to get the clipboard content:", o);
|
|
5699
5849
|
});
|
|
@@ -5759,19 +5909,19 @@ class Ze {
|
|
|
5759
5909
|
if (!i)
|
|
5760
5910
|
return;
|
|
5761
5911
|
g && this.ctx.onlyMergeCell && i.updateSpanInfo();
|
|
5762
|
-
const { drawX: E, drawY:
|
|
5763
|
-
let
|
|
5764
|
-
|
|
5912
|
+
const { drawX: E, drawY: m, width: w, height: y, fixed: C } = i, p = o - E + 1, b = i.drawX + w - (e - s) + 1;
|
|
5913
|
+
let v = n.height - m, I = y;
|
|
5914
|
+
I > l.visibleHeight && (I = l.visibleHeight);
|
|
5765
5915
|
let T = 0;
|
|
5766
|
-
u && (x === "top" ?
|
|
5767
|
-
const _ =
|
|
5916
|
+
u && (x === "top" ? v = n.height + a.height - m : T = a.visibleHeight);
|
|
5917
|
+
const _ = m + I - (t - T - f);
|
|
5768
5918
|
let R = c, S = d;
|
|
5769
|
-
|
|
5919
|
+
b > 0 && !C ? R = Math.floor(c + b) : p > 0 && !C && (R = Math.floor(c - p)), v > 0 ? S = Math.floor(d - v) : _ > 0 && (S = Math.floor(d + _)), (Math.abs(c - R) > 2.5 || Math.abs(d - S) > 2.5) && this.ctx.setScroll(R, S);
|
|
5770
5920
|
}
|
|
5771
5921
|
destroy() {
|
|
5772
5922
|
}
|
|
5773
5923
|
}
|
|
5774
|
-
class
|
|
5924
|
+
class ei {
|
|
5775
5925
|
constructor(t) {
|
|
5776
5926
|
r(this, "ctx");
|
|
5777
5927
|
r(this, "maxColRowCell");
|
|
@@ -5824,11 +5974,11 @@ class qe {
|
|
|
5824
5974
|
SELECTOR_AREA_MAX_Y: x,
|
|
5825
5975
|
SELECTOR_AREA_MAX_X_OFFSET: g,
|
|
5826
5976
|
SELECTOR_AREA_MAX_Y_OFFSET: E
|
|
5827
|
-
} = this.ctx.config,
|
|
5828
|
-
let [p,
|
|
5829
|
-
if (p <
|
|
5977
|
+
} = this.ctx.config, m = d, w = f || this.ctx.maxColIndex - g, y = u, C = x || this.ctx.maxRowIndex - E;
|
|
5978
|
+
let [p, b] = n, [v, I] = a;
|
|
5979
|
+
if (p < m || v < y)
|
|
5830
5980
|
return;
|
|
5831
|
-
n = [Math.max(
|
|
5981
|
+
n = [Math.max(m, p), Math.min(w, b)], a = [Math.max(y, v), Math.min(C, I)];
|
|
5832
5982
|
const { BEFORE_SET_AUTOFILL_METHOD: T } = this.ctx.config;
|
|
5833
5983
|
if (typeof T == "function") {
|
|
5834
5984
|
const R = T({
|
|
@@ -5850,8 +6000,8 @@ class qe {
|
|
|
5850
6000
|
const t = /* @__PURE__ */ new Set(), e = this.ctx.getSelectedData(), i = /* @__PURE__ */ new Map();
|
|
5851
6001
|
for (let x = 0; x <= e.yArr[1] - e.yArr[0]; x++)
|
|
5852
6002
|
for (let g = 0; g <= e.xArr[1] - e.xArr[0]; g++) {
|
|
5853
|
-
const E = x + e.yArr[0],
|
|
5854
|
-
i.set(`${E}-${
|
|
6003
|
+
const E = x + e.yArr[0], m = g + e.xArr[0];
|
|
6004
|
+
i.set(`${E}-${m}`, !0);
|
|
5855
6005
|
}
|
|
5856
6006
|
const { value: s } = e, o = s[0].length, n = s.length, a = this.ctx.autofill.xArr, l = this.ctx.autofill.yArr, c = o === 1 && n === 1;
|
|
5857
6007
|
if (this.ctx.config.ENABLE_MERGE_CELL_LINK && this.ctx.database.hasMergeCell(a, l) && !c) {
|
|
@@ -5866,13 +6016,13 @@ class qe {
|
|
|
5866
6016
|
let d = [];
|
|
5867
6017
|
for (let x = 0; x <= l[1] - l[0]; x++)
|
|
5868
6018
|
for (let g = 0; g <= a[1] - a[0]; g++) {
|
|
5869
|
-
const E = g + a[0],
|
|
5870
|
-
if (y && !i.has(
|
|
5871
|
-
const { rowKey: p, key:
|
|
5872
|
-
this.ctx.database.getReadonly(p,
|
|
6019
|
+
const E = g + a[0], m = x + l[0], w = s[x % n][g % o], y = this.ctx.database.getItemValueForRowIndexAndColIndex(m, E), C = `${m}-${E}`;
|
|
6020
|
+
if (y && !i.has(C)) {
|
|
6021
|
+
const { rowKey: p, key: b } = y;
|
|
6022
|
+
this.ctx.database.getReadonly(p, b) || (t.add(p), d.push({
|
|
5873
6023
|
rowKey: p,
|
|
5874
|
-
key:
|
|
5875
|
-
value:
|
|
6024
|
+
key: b,
|
|
6025
|
+
value: w,
|
|
5876
6026
|
row: {}
|
|
5877
6027
|
}));
|
|
5878
6028
|
}
|
|
@@ -5910,76 +6060,76 @@ class qe {
|
|
|
5910
6060
|
destroy() {
|
|
5911
6061
|
}
|
|
5912
6062
|
}
|
|
5913
|
-
const q = Math.min, $ = Math.max,
|
|
6063
|
+
const q = Math.min, $ = Math.max, ht = Math.round, rt = Math.floor, Y = (h) => ({
|
|
5914
6064
|
x: h,
|
|
5915
6065
|
y: h
|
|
5916
|
-
}),
|
|
6066
|
+
}), ii = {
|
|
5917
6067
|
left: "right",
|
|
5918
6068
|
right: "left",
|
|
5919
6069
|
bottom: "top",
|
|
5920
6070
|
top: "bottom"
|
|
5921
6071
|
};
|
|
5922
|
-
function
|
|
6072
|
+
function vt(h, t, e) {
|
|
5923
6073
|
return $(h, q(t, e));
|
|
5924
6074
|
}
|
|
5925
|
-
function
|
|
6075
|
+
function st(h, t) {
|
|
5926
6076
|
return typeof h == "function" ? h(t) : h;
|
|
5927
6077
|
}
|
|
5928
6078
|
function G(h) {
|
|
5929
6079
|
return h.split("-")[0];
|
|
5930
6080
|
}
|
|
5931
|
-
function
|
|
6081
|
+
function ot(h) {
|
|
5932
6082
|
return h.split("-")[1];
|
|
5933
6083
|
}
|
|
5934
|
-
function
|
|
6084
|
+
function le(h) {
|
|
5935
6085
|
return h === "x" ? "y" : "x";
|
|
5936
6086
|
}
|
|
5937
|
-
function
|
|
6087
|
+
function At(h) {
|
|
5938
6088
|
return h === "y" ? "height" : "width";
|
|
5939
6089
|
}
|
|
5940
6090
|
function V(h) {
|
|
5941
6091
|
const t = h[0];
|
|
5942
6092
|
return t === "t" || t === "b" ? "y" : "x";
|
|
5943
6093
|
}
|
|
5944
|
-
function
|
|
5945
|
-
return
|
|
6094
|
+
function Ht(h) {
|
|
6095
|
+
return le(V(h));
|
|
5946
6096
|
}
|
|
5947
|
-
function
|
|
6097
|
+
function si(h, t, e) {
|
|
5948
6098
|
e === void 0 && (e = !1);
|
|
5949
|
-
const i =
|
|
6099
|
+
const i = ot(h), s = Ht(h), o = At(s);
|
|
5950
6100
|
let n = s === "x" ? i === (e ? "end" : "start") ? "right" : "left" : i === "start" ? "bottom" : "top";
|
|
5951
|
-
return t.reference[o] > t.floating[o] && (n =
|
|
6101
|
+
return t.reference[o] > t.floating[o] && (n = dt(n)), [n, dt(n)];
|
|
5952
6102
|
}
|
|
5953
|
-
function
|
|
5954
|
-
const t =
|
|
6103
|
+
function oi(h) {
|
|
6104
|
+
const t = dt(h);
|
|
5955
6105
|
return [It(h), t, It(t)];
|
|
5956
6106
|
}
|
|
5957
6107
|
function It(h) {
|
|
5958
6108
|
return h.includes("start") ? h.replace("start", "end") : h.replace("end", "start");
|
|
5959
6109
|
}
|
|
5960
|
-
const
|
|
5961
|
-
function
|
|
6110
|
+
const zt = ["left", "right"], $t = ["right", "left"], ni = ["top", "bottom"], ri = ["bottom", "top"];
|
|
6111
|
+
function ai(h, t, e) {
|
|
5962
6112
|
switch (h) {
|
|
5963
6113
|
case "top":
|
|
5964
6114
|
case "bottom":
|
|
5965
|
-
return e ? t ?
|
|
6115
|
+
return e ? t ? $t : zt : t ? zt : $t;
|
|
5966
6116
|
case "left":
|
|
5967
6117
|
case "right":
|
|
5968
|
-
return t ?
|
|
6118
|
+
return t ? ni : ri;
|
|
5969
6119
|
default:
|
|
5970
6120
|
return [];
|
|
5971
6121
|
}
|
|
5972
6122
|
}
|
|
5973
|
-
function
|
|
5974
|
-
const s =
|
|
5975
|
-
let o =
|
|
6123
|
+
function li(h, t, e, i) {
|
|
6124
|
+
const s = ot(h);
|
|
6125
|
+
let o = ai(G(h), e === "start", i);
|
|
5976
6126
|
return s && (o = o.map((n) => n + "-" + s), t && (o = o.concat(o.map(It)))), o;
|
|
5977
6127
|
}
|
|
5978
|
-
function
|
|
6128
|
+
function dt(h) {
|
|
5979
6129
|
const t = G(h);
|
|
5980
|
-
return
|
|
6130
|
+
return ii[t] + h.slice(t.length);
|
|
5981
6131
|
}
|
|
5982
|
-
function
|
|
6132
|
+
function ci(h) {
|
|
5983
6133
|
return {
|
|
5984
6134
|
top: 0,
|
|
5985
6135
|
right: 0,
|
|
@@ -5988,15 +6138,15 @@ function ni(h) {
|
|
|
5988
6138
|
...h
|
|
5989
6139
|
};
|
|
5990
6140
|
}
|
|
5991
|
-
function
|
|
5992
|
-
return typeof h != "number" ?
|
|
6141
|
+
function ce(h) {
|
|
6142
|
+
return typeof h != "number" ? ci(h) : {
|
|
5993
6143
|
top: h,
|
|
5994
6144
|
right: h,
|
|
5995
6145
|
bottom: h,
|
|
5996
6146
|
left: h
|
|
5997
6147
|
};
|
|
5998
6148
|
}
|
|
5999
|
-
function
|
|
6149
|
+
function ft(h) {
|
|
6000
6150
|
const {
|
|
6001
6151
|
x: t,
|
|
6002
6152
|
y: e,
|
|
@@ -6014,12 +6164,12 @@ function dt(h) {
|
|
|
6014
6164
|
y: e
|
|
6015
6165
|
};
|
|
6016
6166
|
}
|
|
6017
|
-
function
|
|
6167
|
+
function Gt(h, t, e) {
|
|
6018
6168
|
let {
|
|
6019
6169
|
reference: i,
|
|
6020
6170
|
floating: s
|
|
6021
6171
|
} = h;
|
|
6022
|
-
const o = V(t), n =
|
|
6172
|
+
const o = V(t), n = Ht(t), a = At(n), l = G(t), c = o === "y", d = i.x + i.width / 2 - s.width / 2, f = i.y + i.height / 2 - s.height / 2, u = i[a] / 2 - s[a] / 2;
|
|
6023
6173
|
let x;
|
|
6024
6174
|
switch (l) {
|
|
6025
6175
|
case "top":
|
|
@@ -6052,7 +6202,7 @@ function zt(h, t, e) {
|
|
|
6052
6202
|
y: i.y
|
|
6053
6203
|
};
|
|
6054
6204
|
}
|
|
6055
|
-
switch (
|
|
6205
|
+
switch (ot(t)) {
|
|
6056
6206
|
case "start":
|
|
6057
6207
|
x[n] -= u * (e && c ? -1 : 1);
|
|
6058
6208
|
break;
|
|
@@ -6062,7 +6212,7 @@ function zt(h, t, e) {
|
|
|
6062
6212
|
}
|
|
6063
6213
|
return x;
|
|
6064
6214
|
}
|
|
6065
|
-
async function
|
|
6215
|
+
async function hi(h, t) {
|
|
6066
6216
|
var e;
|
|
6067
6217
|
t === void 0 && (t = {});
|
|
6068
6218
|
const {
|
|
@@ -6078,8 +6228,8 @@ async function ri(h, t) {
|
|
|
6078
6228
|
elementContext: f = "floating",
|
|
6079
6229
|
altBoundary: u = !1,
|
|
6080
6230
|
padding: x = 0
|
|
6081
|
-
} =
|
|
6082
|
-
element: (e = await (o.isElement == null ? void 0 : o.isElement(
|
|
6231
|
+
} = st(t, h), g = ce(x), m = a[u ? f === "floating" ? "reference" : "floating" : f], w = ft(await o.getClippingRect({
|
|
6232
|
+
element: (e = await (o.isElement == null ? void 0 : o.isElement(m))) == null || e ? m : m.contextElement || await (o.getDocumentElement == null ? void 0 : o.getDocumentElement(a.floating)),
|
|
6083
6233
|
boundary: c,
|
|
6084
6234
|
rootBoundary: d,
|
|
6085
6235
|
strategy: l
|
|
@@ -6088,26 +6238,26 @@ async function ri(h, t) {
|
|
|
6088
6238
|
y: s,
|
|
6089
6239
|
width: n.floating.width,
|
|
6090
6240
|
height: n.floating.height
|
|
6091
|
-
} : n.reference,
|
|
6241
|
+
} : n.reference, C = await (o.getOffsetParent == null ? void 0 : o.getOffsetParent(a.floating)), p = await (o.isElement == null ? void 0 : o.isElement(C)) ? await (o.getScale == null ? void 0 : o.getScale(C)) || {
|
|
6092
6242
|
x: 1,
|
|
6093
6243
|
y: 1
|
|
6094
6244
|
} : {
|
|
6095
6245
|
x: 1,
|
|
6096
6246
|
y: 1
|
|
6097
|
-
},
|
|
6247
|
+
}, b = ft(o.convertOffsetParentRelativeRectToViewportRelativeRect ? await o.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
6098
6248
|
elements: a,
|
|
6099
6249
|
rect: y,
|
|
6100
|
-
offsetParent:
|
|
6250
|
+
offsetParent: C,
|
|
6101
6251
|
strategy: l
|
|
6102
6252
|
}) : y);
|
|
6103
6253
|
return {
|
|
6104
|
-
top: (
|
|
6105
|
-
bottom: (
|
|
6106
|
-
left: (
|
|
6107
|
-
right: (
|
|
6254
|
+
top: (w.top - b.top + g.top) / p.y,
|
|
6255
|
+
bottom: (b.bottom - w.bottom + g.bottom) / p.y,
|
|
6256
|
+
left: (w.left - b.left + g.left) / p.x,
|
|
6257
|
+
right: (b.right - w.right + g.right) / p.x
|
|
6108
6258
|
};
|
|
6109
6259
|
}
|
|
6110
|
-
const
|
|
6260
|
+
const di = 50, fi = async (h, t, e) => {
|
|
6111
6261
|
const {
|
|
6112
6262
|
placement: i = "bottom",
|
|
6113
6263
|
strategy: s = "absolute",
|
|
@@ -6115,7 +6265,7 @@ const ai = 50, li = async (h, t, e) => {
|
|
|
6115
6265
|
platform: n
|
|
6116
6266
|
} = e, a = n.detectOverflow ? n : {
|
|
6117
6267
|
...n,
|
|
6118
|
-
detectOverflow:
|
|
6268
|
+
detectOverflow: hi
|
|
6119
6269
|
}, l = await (n.isRTL == null ? void 0 : n.isRTL(t));
|
|
6120
6270
|
let c = await n.getElementRects({
|
|
6121
6271
|
reference: h,
|
|
@@ -6124,20 +6274,20 @@ const ai = 50, li = async (h, t, e) => {
|
|
|
6124
6274
|
}), {
|
|
6125
6275
|
x: d,
|
|
6126
6276
|
y: f
|
|
6127
|
-
} =
|
|
6277
|
+
} = Gt(c, i, l), u = i, x = 0;
|
|
6128
6278
|
const g = {};
|
|
6129
6279
|
for (let E = 0; E < o.length; E++) {
|
|
6130
|
-
const
|
|
6131
|
-
if (!
|
|
6280
|
+
const m = o[E];
|
|
6281
|
+
if (!m)
|
|
6132
6282
|
continue;
|
|
6133
6283
|
const {
|
|
6134
|
-
name:
|
|
6284
|
+
name: w,
|
|
6135
6285
|
fn: y
|
|
6136
|
-
} =
|
|
6137
|
-
x:
|
|
6286
|
+
} = m, {
|
|
6287
|
+
x: C,
|
|
6138
6288
|
y: p,
|
|
6139
|
-
data:
|
|
6140
|
-
reset:
|
|
6289
|
+
data: b,
|
|
6290
|
+
reset: v
|
|
6141
6291
|
} = await y({
|
|
6142
6292
|
x: d,
|
|
6143
6293
|
y: f,
|
|
@@ -6152,17 +6302,17 @@ const ai = 50, li = async (h, t, e) => {
|
|
|
6152
6302
|
floating: t
|
|
6153
6303
|
}
|
|
6154
6304
|
});
|
|
6155
|
-
d =
|
|
6156
|
-
...g[
|
|
6157
|
-
...
|
|
6158
|
-
},
|
|
6305
|
+
d = C ?? d, f = p ?? f, g[w] = {
|
|
6306
|
+
...g[w],
|
|
6307
|
+
...b
|
|
6308
|
+
}, v && x < di && (x++, typeof v == "object" && (v.placement && (u = v.placement), v.rects && (c = v.rects === !0 ? await n.getElementRects({
|
|
6159
6309
|
reference: h,
|
|
6160
6310
|
floating: t,
|
|
6161
6311
|
strategy: s
|
|
6162
|
-
}) :
|
|
6312
|
+
}) : v.rects), {
|
|
6163
6313
|
x: d,
|
|
6164
6314
|
y: f
|
|
6165
|
-
} =
|
|
6315
|
+
} = Gt(c, u, l)), E = -1);
|
|
6166
6316
|
}
|
|
6167
6317
|
return {
|
|
6168
6318
|
x: d,
|
|
@@ -6171,7 +6321,7 @@ const ai = 50, li = async (h, t, e) => {
|
|
|
6171
6321
|
strategy: s,
|
|
6172
6322
|
middlewareData: g
|
|
6173
6323
|
};
|
|
6174
|
-
},
|
|
6324
|
+
}, ui = (h) => ({
|
|
6175
6325
|
name: "arrow",
|
|
6176
6326
|
options: h,
|
|
6177
6327
|
async fn(t) {
|
|
@@ -6186,16 +6336,16 @@ const ai = 50, li = async (h, t, e) => {
|
|
|
6186
6336
|
} = t, {
|
|
6187
6337
|
element: c,
|
|
6188
6338
|
padding: d = 0
|
|
6189
|
-
} =
|
|
6339
|
+
} = st(h, t) || {};
|
|
6190
6340
|
if (c == null)
|
|
6191
6341
|
return {};
|
|
6192
|
-
const f =
|
|
6342
|
+
const f = ce(d), u = {
|
|
6193
6343
|
x: e,
|
|
6194
6344
|
y: i
|
|
6195
|
-
}, x =
|
|
6196
|
-
let
|
|
6197
|
-
(!
|
|
6198
|
-
const T = p / 2 -
|
|
6345
|
+
}, x = Ht(s), g = At(x), E = await n.getDimensions(c), m = x === "y", w = m ? "top" : "left", y = m ? "bottom" : "right", C = m ? "clientHeight" : "clientWidth", p = o.reference[g] + o.reference[x] - u[x] - o.floating[g], b = u[x] - o.reference[x], v = await (n.getOffsetParent == null ? void 0 : n.getOffsetParent(c));
|
|
6346
|
+
let I = v ? v[C] : 0;
|
|
6347
|
+
(!I || !await (n.isElement == null ? void 0 : n.isElement(v))) && (I = a.floating[C] || o.floating[g]);
|
|
6348
|
+
const T = p / 2 - b / 2, _ = I / 2 - E[g] / 2 - 1, R = q(f[w], _), S = q(f[y], _), O = R, M = I - E[g] - S, L = I / 2 - E[g] / 2 + T, H = vt(O, L, M), D = !l.arrow && ot(s) != null && L !== H && o.reference[g] / 2 - (L < O ? R : S) - E[g] / 2 < 0, A = D ? L < O ? L - O : L - M : 0;
|
|
6199
6349
|
return {
|
|
6200
6350
|
[x]: u[x] + A,
|
|
6201
6351
|
data: {
|
|
@@ -6208,7 +6358,7 @@ const ai = 50, li = async (h, t, e) => {
|
|
|
6208
6358
|
reset: D
|
|
6209
6359
|
};
|
|
6210
6360
|
}
|
|
6211
|
-
}),
|
|
6361
|
+
}), xi = function(h) {
|
|
6212
6362
|
return h === void 0 && (h = {}), {
|
|
6213
6363
|
name: "flip",
|
|
6214
6364
|
options: h,
|
|
@@ -6228,16 +6378,16 @@ const ai = 50, li = async (h, t, e) => {
|
|
|
6228
6378
|
fallbackStrategy: x = "bestFit",
|
|
6229
6379
|
fallbackAxisSideDirection: g = "none",
|
|
6230
6380
|
flipAlignment: E = !0,
|
|
6231
|
-
...
|
|
6232
|
-
} =
|
|
6381
|
+
...m
|
|
6382
|
+
} = st(h, t);
|
|
6233
6383
|
if ((e = o.arrow) != null && e.alignmentOffset)
|
|
6234
6384
|
return {};
|
|
6235
|
-
const
|
|
6236
|
-
!u &&
|
|
6237
|
-
const
|
|
6385
|
+
const w = G(s), y = V(a), C = G(a) === a, p = await (l.isRTL == null ? void 0 : l.isRTL(c.floating)), b = u || (C || !E ? [dt(a)] : oi(a)), v = g !== "none";
|
|
6386
|
+
!u && v && b.push(...li(a, E, g, p));
|
|
6387
|
+
const I = [a, ...b], T = await l.detectOverflow(t, m), _ = [];
|
|
6238
6388
|
let R = ((i = o.flip) == null ? void 0 : i.overflows) || [];
|
|
6239
|
-
if (d && _.push(T[
|
|
6240
|
-
const L =
|
|
6389
|
+
if (d && _.push(T[w]), f) {
|
|
6390
|
+
const L = si(s, n, p);
|
|
6241
6391
|
_.push(T[L[0]], T[L[1]]);
|
|
6242
6392
|
}
|
|
6243
6393
|
if (R = [...R, {
|
|
@@ -6245,7 +6395,7 @@ const ai = 50, li = async (h, t, e) => {
|
|
|
6245
6395
|
overflows: _
|
|
6246
6396
|
}], !_.every((L) => L <= 0)) {
|
|
6247
6397
|
var S, O;
|
|
6248
|
-
const L = (((S = o.flip) == null ? void 0 : S.index) || 0) + 1, H =
|
|
6398
|
+
const L = (((S = o.flip) == null ? void 0 : S.index) || 0) + 1, H = I[L];
|
|
6249
6399
|
if (H && (!(f === "alignment" ? y !== V(H) : !1) || // We leave the current main axis only if every placement on that axis
|
|
6250
6400
|
// overflows the main axis.
|
|
6251
6401
|
R.every((k) => V(k.placement) === y ? k.overflows[0] > 0 : !0)))
|
|
@@ -6264,14 +6414,14 @@ const ai = 50, li = async (h, t, e) => {
|
|
|
6264
6414
|
case "bestFit": {
|
|
6265
6415
|
var M;
|
|
6266
6416
|
const A = (M = R.filter((k) => {
|
|
6267
|
-
if (
|
|
6417
|
+
if (v) {
|
|
6268
6418
|
const N = V(k.placement);
|
|
6269
6419
|
return N === y || // Create a bias to the `y` side axis due to horizontal
|
|
6270
6420
|
// reading directions favoring greater width.
|
|
6271
6421
|
N === "y";
|
|
6272
6422
|
}
|
|
6273
6423
|
return !0;
|
|
6274
|
-
}).map((k) => [k.placement, k.overflows.filter((N) => N > 0).reduce((N,
|
|
6424
|
+
}).map((k) => [k.placement, k.overflows.filter((N) => N > 0).reduce((N, Ct) => N + Ct, 0)]).sort((k, N) => k[1] - N[1])[0]) == null ? void 0 : M[0];
|
|
6275
6425
|
A && (D = A);
|
|
6276
6426
|
break;
|
|
6277
6427
|
}
|
|
@@ -6289,13 +6439,13 @@ const ai = 50, li = async (h, t, e) => {
|
|
|
6289
6439
|
return {};
|
|
6290
6440
|
}
|
|
6291
6441
|
};
|
|
6292
|
-
},
|
|
6293
|
-
async function
|
|
6442
|
+
}, gi = /* @__PURE__ */ new Set(["left", "top"]);
|
|
6443
|
+
async function mi(h, t) {
|
|
6294
6444
|
const {
|
|
6295
6445
|
placement: e,
|
|
6296
6446
|
platform: i,
|
|
6297
6447
|
elements: s
|
|
6298
|
-
} = h, o = await (i.isRTL == null ? void 0 : i.isRTL(s.floating)), n = G(e), a =
|
|
6448
|
+
} = h, o = await (i.isRTL == null ? void 0 : i.isRTL(s.floating)), n = G(e), a = ot(e), l = V(e) === "y", c = gi.has(n) ? -1 : 1, d = o && l ? -1 : 1, f = st(t, h);
|
|
6299
6449
|
let {
|
|
6300
6450
|
mainAxis: u,
|
|
6301
6451
|
crossAxis: x,
|
|
@@ -6317,7 +6467,7 @@ async function fi(h, t) {
|
|
|
6317
6467
|
y: x * d
|
|
6318
6468
|
};
|
|
6319
6469
|
}
|
|
6320
|
-
const
|
|
6470
|
+
const wi = function(h) {
|
|
6321
6471
|
return h === void 0 && (h = 0), {
|
|
6322
6472
|
name: "offset",
|
|
6323
6473
|
options: h,
|
|
@@ -6328,7 +6478,7 @@ const ui = function(h) {
|
|
|
6328
6478
|
y: o,
|
|
6329
6479
|
placement: n,
|
|
6330
6480
|
middlewareData: a
|
|
6331
|
-
} = t, l = await
|
|
6481
|
+
} = t, l = await mi(t, h);
|
|
6332
6482
|
return n === ((e = a.offset) == null ? void 0 : e.placement) && (i = a.arrow) != null && i.alignmentOffset ? {} : {
|
|
6333
6483
|
x: s + l.x,
|
|
6334
6484
|
y: o + l.y,
|
|
@@ -6339,7 +6489,7 @@ const ui = function(h) {
|
|
|
6339
6489
|
};
|
|
6340
6490
|
}
|
|
6341
6491
|
};
|
|
6342
|
-
},
|
|
6492
|
+
}, Ei = function(h) {
|
|
6343
6493
|
return h === void 0 && (h = {}), {
|
|
6344
6494
|
name: "shift",
|
|
6345
6495
|
options: h,
|
|
@@ -6353,41 +6503,41 @@ const ui = function(h) {
|
|
|
6353
6503
|
mainAxis: n = !0,
|
|
6354
6504
|
crossAxis: a = !1,
|
|
6355
6505
|
limiter: l = {
|
|
6356
|
-
fn: (
|
|
6506
|
+
fn: (w) => {
|
|
6357
6507
|
let {
|
|
6358
6508
|
x: y,
|
|
6359
|
-
y:
|
|
6360
|
-
} =
|
|
6509
|
+
y: C
|
|
6510
|
+
} = w;
|
|
6361
6511
|
return {
|
|
6362
6512
|
x: y,
|
|
6363
|
-
y:
|
|
6513
|
+
y: C
|
|
6364
6514
|
};
|
|
6365
6515
|
}
|
|
6366
6516
|
},
|
|
6367
6517
|
...c
|
|
6368
|
-
} =
|
|
6518
|
+
} = st(h, t), d = {
|
|
6369
6519
|
x: e,
|
|
6370
6520
|
y: i
|
|
6371
|
-
}, f = await o.detectOverflow(t, c), u = V(G(s)), x =
|
|
6521
|
+
}, f = await o.detectOverflow(t, c), u = V(G(s)), x = le(u);
|
|
6372
6522
|
let g = d[x], E = d[u];
|
|
6373
6523
|
if (n) {
|
|
6374
|
-
const
|
|
6375
|
-
g =
|
|
6524
|
+
const w = x === "y" ? "top" : "left", y = x === "y" ? "bottom" : "right", C = g + f[w], p = g - f[y];
|
|
6525
|
+
g = vt(C, g, p);
|
|
6376
6526
|
}
|
|
6377
6527
|
if (a) {
|
|
6378
|
-
const
|
|
6379
|
-
E =
|
|
6528
|
+
const w = u === "y" ? "top" : "left", y = u === "y" ? "bottom" : "right", C = E + f[w], p = E - f[y];
|
|
6529
|
+
E = vt(C, E, p);
|
|
6380
6530
|
}
|
|
6381
|
-
const
|
|
6531
|
+
const m = l.fn({
|
|
6382
6532
|
...t,
|
|
6383
6533
|
[x]: g,
|
|
6384
6534
|
[u]: E
|
|
6385
6535
|
});
|
|
6386
6536
|
return {
|
|
6387
|
-
...
|
|
6537
|
+
...m,
|
|
6388
6538
|
data: {
|
|
6389
|
-
x:
|
|
6390
|
-
y:
|
|
6539
|
+
x: m.x - e,
|
|
6540
|
+
y: m.y - i,
|
|
6391
6541
|
enabled: {
|
|
6392
6542
|
[x]: n,
|
|
6393
6543
|
[u]: a
|
|
@@ -6401,7 +6551,7 @@ function wt() {
|
|
|
6401
6551
|
return typeof window < "u";
|
|
6402
6552
|
}
|
|
6403
6553
|
function Q(h) {
|
|
6404
|
-
return
|
|
6554
|
+
return he(h) ? (h.nodeName || "").toLowerCase() : "#document";
|
|
6405
6555
|
}
|
|
6406
6556
|
function B(h) {
|
|
6407
6557
|
var t;
|
|
@@ -6409,9 +6559,9 @@ function B(h) {
|
|
|
6409
6559
|
}
|
|
6410
6560
|
function F(h) {
|
|
6411
6561
|
var t;
|
|
6412
|
-
return (t = (
|
|
6562
|
+
return (t = (he(h) ? h.ownerDocument : h.document) || window.document) == null ? void 0 : t.documentElement;
|
|
6413
6563
|
}
|
|
6414
|
-
function
|
|
6564
|
+
function he(h) {
|
|
6415
6565
|
return wt() ? h instanceof Node || h instanceof B(h).Node : !1;
|
|
6416
6566
|
}
|
|
6417
6567
|
function X(h) {
|
|
@@ -6420,10 +6570,10 @@ function X(h) {
|
|
|
6420
6570
|
function W(h) {
|
|
6421
6571
|
return wt() ? h instanceof HTMLElement || h instanceof B(h).HTMLElement : !1;
|
|
6422
6572
|
}
|
|
6423
|
-
function
|
|
6573
|
+
function Ut(h) {
|
|
6424
6574
|
return !wt() || typeof ShadowRoot > "u" ? !1 : h instanceof ShadowRoot || h instanceof B(h).ShadowRoot;
|
|
6425
6575
|
}
|
|
6426
|
-
function
|
|
6576
|
+
function nt(h) {
|
|
6427
6577
|
const {
|
|
6428
6578
|
overflow: t,
|
|
6429
6579
|
overflowX: e,
|
|
@@ -6432,10 +6582,10 @@ function ot(h) {
|
|
|
6432
6582
|
} = K(h);
|
|
6433
6583
|
return /auto|scroll|overlay|hidden|clip/.test(t + i + e) && s !== "inline" && s !== "contents";
|
|
6434
6584
|
}
|
|
6435
|
-
function
|
|
6585
|
+
function pi(h) {
|
|
6436
6586
|
return /^(table|td|th)$/.test(Q(h));
|
|
6437
6587
|
}
|
|
6438
|
-
function
|
|
6588
|
+
function Et(h) {
|
|
6439
6589
|
try {
|
|
6440
6590
|
if (h.matches(":popover-open"))
|
|
6441
6591
|
return !0;
|
|
@@ -6447,25 +6597,25 @@ function mt(h) {
|
|
|
6447
6597
|
return !1;
|
|
6448
6598
|
}
|
|
6449
6599
|
}
|
|
6450
|
-
const
|
|
6451
|
-
let
|
|
6452
|
-
function
|
|
6600
|
+
const yi = /transform|translate|scale|rotate|perspective|filter/, Ci = /paint|layout|strict|content/, z = (h) => !!h && h !== "none";
|
|
6601
|
+
let bt;
|
|
6602
|
+
function Dt(h) {
|
|
6453
6603
|
const t = X(h) ? K(h) : h;
|
|
6454
|
-
return z(t.transform) || z(t.translate) || z(t.scale) || z(t.rotate) || z(t.perspective) || !
|
|
6604
|
+
return z(t.transform) || z(t.translate) || z(t.scale) || z(t.rotate) || z(t.perspective) || !Nt() && (z(t.backdropFilter) || z(t.filter)) || yi.test(t.willChange || "") || Ci.test(t.contain || "");
|
|
6455
6605
|
}
|
|
6456
|
-
function
|
|
6606
|
+
function bi(h) {
|
|
6457
6607
|
let t = P(h);
|
|
6458
6608
|
for (; W(t) && !J(t); ) {
|
|
6459
|
-
if (
|
|
6609
|
+
if (Dt(t))
|
|
6460
6610
|
return t;
|
|
6461
|
-
if (
|
|
6611
|
+
if (Et(t))
|
|
6462
6612
|
return null;
|
|
6463
6613
|
t = P(t);
|
|
6464
6614
|
}
|
|
6465
6615
|
return null;
|
|
6466
6616
|
}
|
|
6467
|
-
function
|
|
6468
|
-
return
|
|
6617
|
+
function Nt() {
|
|
6618
|
+
return bt == null && (bt = typeof CSS < "u" && CSS.supports && CSS.supports("-webkit-backdrop-filter", "none")), bt;
|
|
6469
6619
|
}
|
|
6470
6620
|
function J(h) {
|
|
6471
6621
|
return /^(html|body|#document)$/.test(Q(h));
|
|
@@ -6473,7 +6623,7 @@ function J(h) {
|
|
|
6473
6623
|
function K(h) {
|
|
6474
6624
|
return B(h).getComputedStyle(h);
|
|
6475
6625
|
}
|
|
6476
|
-
function
|
|
6626
|
+
function pt(h) {
|
|
6477
6627
|
return X(h) ? {
|
|
6478
6628
|
scrollLeft: h.scrollLeft,
|
|
6479
6629
|
scrollTop: h.scrollTop
|
|
@@ -6489,108 +6639,108 @@ function P(h) {
|
|
|
6489
6639
|
// Step into the shadow DOM of the parent of a slotted node.
|
|
6490
6640
|
h.assignedSlot || // DOM Element detected.
|
|
6491
6641
|
h.parentNode || // ShadowRoot detected.
|
|
6492
|
-
|
|
6642
|
+
Ut(h) && h.host || // Fallback.
|
|
6493
6643
|
F(h)
|
|
6494
6644
|
);
|
|
6495
|
-
return
|
|
6645
|
+
return Ut(t) ? t.host : t;
|
|
6496
6646
|
}
|
|
6497
|
-
function
|
|
6647
|
+
function de(h) {
|
|
6498
6648
|
const t = P(h);
|
|
6499
|
-
return J(t) ? h.ownerDocument ? h.ownerDocument.body : h.body : W(t) &&
|
|
6649
|
+
return J(t) ? h.ownerDocument ? h.ownerDocument.body : h.body : W(t) && nt(t) ? t : de(t);
|
|
6500
6650
|
}
|
|
6501
|
-
function
|
|
6651
|
+
function it(h, t, e) {
|
|
6502
6652
|
var i;
|
|
6503
6653
|
t === void 0 && (t = []), e === void 0 && (e = !0);
|
|
6504
|
-
const s =
|
|
6654
|
+
const s = de(h), o = s === ((i = h.ownerDocument) == null ? void 0 : i.body), n = B(s);
|
|
6505
6655
|
if (o) {
|
|
6506
|
-
const a =
|
|
6507
|
-
return t.concat(n, n.visualViewport || [],
|
|
6656
|
+
const a = _t(n);
|
|
6657
|
+
return t.concat(n, n.visualViewport || [], nt(s) ? s : [], a && e ? it(a) : []);
|
|
6508
6658
|
} else
|
|
6509
|
-
return t.concat(s,
|
|
6659
|
+
return t.concat(s, it(s, [], e));
|
|
6510
6660
|
}
|
|
6511
|
-
function
|
|
6661
|
+
function _t(h) {
|
|
6512
6662
|
return h.parent && Object.getPrototypeOf(h.parent) ? h.frameElement : null;
|
|
6513
6663
|
}
|
|
6514
|
-
function
|
|
6664
|
+
function fe(h) {
|
|
6515
6665
|
const t = K(h);
|
|
6516
6666
|
let e = parseFloat(t.width) || 0, i = parseFloat(t.height) || 0;
|
|
6517
|
-
const s = W(h), o = s ? h.offsetWidth : e, n = s ? h.offsetHeight : i, a =
|
|
6667
|
+
const s = W(h), o = s ? h.offsetWidth : e, n = s ? h.offsetHeight : i, a = ht(e) !== o || ht(i) !== n;
|
|
6518
6668
|
return a && (e = o, i = n), {
|
|
6519
6669
|
width: e,
|
|
6520
6670
|
height: i,
|
|
6521
6671
|
$: a
|
|
6522
6672
|
};
|
|
6523
6673
|
}
|
|
6524
|
-
function
|
|
6674
|
+
function kt(h) {
|
|
6525
6675
|
return X(h) ? h : h.contextElement;
|
|
6526
6676
|
}
|
|
6527
|
-
function
|
|
6528
|
-
const t =
|
|
6677
|
+
function j(h) {
|
|
6678
|
+
const t = kt(h);
|
|
6529
6679
|
if (!W(t))
|
|
6530
6680
|
return Y(1);
|
|
6531
6681
|
const e = t.getBoundingClientRect(), {
|
|
6532
6682
|
width: i,
|
|
6533
6683
|
height: s,
|
|
6534
6684
|
$: o
|
|
6535
|
-
} =
|
|
6536
|
-
let n = (o ?
|
|
6685
|
+
} = fe(t);
|
|
6686
|
+
let n = (o ? ht(e.width) : e.width) / i, a = (o ? ht(e.height) : e.height) / s;
|
|
6537
6687
|
return (!n || !Number.isFinite(n)) && (n = 1), (!a || !Number.isFinite(a)) && (a = 1), {
|
|
6538
6688
|
x: n,
|
|
6539
6689
|
y: a
|
|
6540
6690
|
};
|
|
6541
6691
|
}
|
|
6542
|
-
const
|
|
6543
|
-
function
|
|
6692
|
+
const Ri = /* @__PURE__ */ Y(0);
|
|
6693
|
+
function ue(h) {
|
|
6544
6694
|
const t = B(h);
|
|
6545
|
-
return !
|
|
6695
|
+
return !Nt() || !t.visualViewport ? Ri : {
|
|
6546
6696
|
x: t.visualViewport.offsetLeft,
|
|
6547
6697
|
y: t.visualViewport.offsetTop
|
|
6548
6698
|
};
|
|
6549
6699
|
}
|
|
6550
|
-
function
|
|
6700
|
+
function vi(h, t, e) {
|
|
6551
6701
|
return t === void 0 && (t = !1), !e || t && e !== B(h) ? !1 : t;
|
|
6552
6702
|
}
|
|
6553
6703
|
function U(h, t, e, i) {
|
|
6554
6704
|
t === void 0 && (t = !1), e === void 0 && (e = !1);
|
|
6555
|
-
const s = h.getBoundingClientRect(), o =
|
|
6705
|
+
const s = h.getBoundingClientRect(), o = kt(h);
|
|
6556
6706
|
let n = Y(1);
|
|
6557
|
-
t && (i ? X(i) && (n =
|
|
6558
|
-
const a =
|
|
6707
|
+
t && (i ? X(i) && (n = j(i)) : n = j(h));
|
|
6708
|
+
const a = vi(o, e, i) ? ue(o) : Y(0);
|
|
6559
6709
|
let l = (s.left + a.x) / n.x, c = (s.top + a.y) / n.y, d = s.width / n.x, f = s.height / n.y;
|
|
6560
6710
|
if (o) {
|
|
6561
6711
|
const u = B(o), x = i && X(i) ? B(i) : i;
|
|
6562
|
-
let g = u, E =
|
|
6712
|
+
let g = u, E = _t(g);
|
|
6563
6713
|
for (; E && i && x !== g; ) {
|
|
6564
|
-
const
|
|
6565
|
-
l *=
|
|
6714
|
+
const m = j(E), w = E.getBoundingClientRect(), y = K(E), C = w.left + (E.clientLeft + parseFloat(y.paddingLeft)) * m.x, p = w.top + (E.clientTop + parseFloat(y.paddingTop)) * m.y;
|
|
6715
|
+
l *= m.x, c *= m.y, d *= m.x, f *= m.y, l += C, c += p, g = B(E), E = _t(g);
|
|
6566
6716
|
}
|
|
6567
6717
|
}
|
|
6568
|
-
return
|
|
6718
|
+
return ft({
|
|
6569
6719
|
width: d,
|
|
6570
6720
|
height: f,
|
|
6571
6721
|
x: l,
|
|
6572
6722
|
y: c
|
|
6573
6723
|
});
|
|
6574
6724
|
}
|
|
6575
|
-
function
|
|
6576
|
-
const e =
|
|
6725
|
+
function yt(h, t) {
|
|
6726
|
+
const e = pt(h).scrollLeft;
|
|
6577
6727
|
return t ? t.left + e : U(F(h)).left + e;
|
|
6578
6728
|
}
|
|
6579
|
-
function
|
|
6580
|
-
const e = h.getBoundingClientRect(), i = e.left + t.scrollLeft -
|
|
6729
|
+
function xe(h, t) {
|
|
6730
|
+
const e = h.getBoundingClientRect(), i = e.left + t.scrollLeft - yt(h, e), s = e.top + t.scrollTop;
|
|
6581
6731
|
return {
|
|
6582
6732
|
x: i,
|
|
6583
6733
|
y: s
|
|
6584
6734
|
};
|
|
6585
6735
|
}
|
|
6586
|
-
function
|
|
6736
|
+
function Ii(h) {
|
|
6587
6737
|
let {
|
|
6588
6738
|
elements: t,
|
|
6589
6739
|
rect: e,
|
|
6590
6740
|
offsetParent: i,
|
|
6591
6741
|
strategy: s
|
|
6592
6742
|
} = h;
|
|
6593
|
-
const o = s === "fixed", n = F(i), a = t ?
|
|
6743
|
+
const o = s === "fixed", n = F(i), a = t ? Et(t.floating) : !1;
|
|
6594
6744
|
if (i === n || a && o)
|
|
6595
6745
|
return e;
|
|
6596
6746
|
let l = {
|
|
@@ -6598,11 +6748,11 @@ function Ci(h) {
|
|
|
6598
6748
|
scrollTop: 0
|
|
6599
6749
|
}, c = Y(1);
|
|
6600
6750
|
const d = Y(0), f = W(i);
|
|
6601
|
-
if ((f || !f && !o) && ((Q(i) !== "body" ||
|
|
6751
|
+
if ((f || !f && !o) && ((Q(i) !== "body" || nt(n)) && (l = pt(i)), f)) {
|
|
6602
6752
|
const x = U(i);
|
|
6603
|
-
c =
|
|
6753
|
+
c = j(i), d.x = x.x + i.clientLeft, d.y = x.y + i.clientTop;
|
|
6604
6754
|
}
|
|
6605
|
-
const u = n && !f && !o ?
|
|
6755
|
+
const u = n && !f && !o ? xe(n, l) : Y(0);
|
|
6606
6756
|
return {
|
|
6607
6757
|
width: e.width * c.x,
|
|
6608
6758
|
height: e.height * c.y,
|
|
@@ -6610,12 +6760,12 @@ function Ci(h) {
|
|
|
6610
6760
|
y: e.y * c.y - l.scrollTop * c.y + d.y + u.y
|
|
6611
6761
|
};
|
|
6612
6762
|
}
|
|
6613
|
-
function
|
|
6763
|
+
function _i(h) {
|
|
6614
6764
|
return Array.from(h.getClientRects());
|
|
6615
6765
|
}
|
|
6616
|
-
function
|
|
6617
|
-
const t = F(h), e =
|
|
6618
|
-
let n = -e.scrollLeft +
|
|
6766
|
+
function Ti(h) {
|
|
6767
|
+
const t = F(h), e = pt(h), i = h.ownerDocument.body, s = $(t.scrollWidth, t.clientWidth, i.scrollWidth, i.clientWidth), o = $(t.scrollHeight, t.clientHeight, i.scrollHeight, i.clientHeight);
|
|
6768
|
+
let n = -e.scrollLeft + yt(h);
|
|
6619
6769
|
const a = -e.scrollTop;
|
|
6620
6770
|
return K(i).direction === "rtl" && (n += $(t.clientWidth, i.clientWidth) - s), {
|
|
6621
6771
|
width: s,
|
|
@@ -6624,20 +6774,20 @@ function Ri(h) {
|
|
|
6624
6774
|
y: a
|
|
6625
6775
|
};
|
|
6626
6776
|
}
|
|
6627
|
-
const
|
|
6628
|
-
function
|
|
6777
|
+
const Zt = 25;
|
|
6778
|
+
function Si(h, t) {
|
|
6629
6779
|
const e = B(h), i = F(h), s = e.visualViewport;
|
|
6630
6780
|
let o = i.clientWidth, n = i.clientHeight, a = 0, l = 0;
|
|
6631
6781
|
if (s) {
|
|
6632
6782
|
o = s.width, n = s.height;
|
|
6633
|
-
const d =
|
|
6783
|
+
const d = Nt();
|
|
6634
6784
|
(!d || d && t === "fixed") && (a = s.offsetLeft, l = s.offsetTop);
|
|
6635
6785
|
}
|
|
6636
|
-
const c =
|
|
6786
|
+
const c = yt(i);
|
|
6637
6787
|
if (c <= 0) {
|
|
6638
6788
|
const d = i.ownerDocument, f = d.body, u = getComputedStyle(f), x = d.compatMode === "CSS1Compat" && parseFloat(u.marginLeft) + parseFloat(u.marginRight) || 0, g = Math.abs(i.clientWidth - f.clientWidth - x);
|
|
6639
|
-
g <=
|
|
6640
|
-
} else c <=
|
|
6789
|
+
g <= Zt && (o -= g);
|
|
6790
|
+
} else c <= Zt && (o += c);
|
|
6641
6791
|
return {
|
|
6642
6792
|
width: o,
|
|
6643
6793
|
height: n,
|
|
@@ -6645,8 +6795,8 @@ function Ii(h, t) {
|
|
|
6645
6795
|
y: l
|
|
6646
6796
|
};
|
|
6647
6797
|
}
|
|
6648
|
-
function
|
|
6649
|
-
const e = U(h, !0, t === "fixed"), i = e.top + h.clientTop, s = e.left + h.clientLeft, o = W(h) ?
|
|
6798
|
+
function Oi(h, t) {
|
|
6799
|
+
const e = U(h, !0, t === "fixed"), i = e.top + h.clientTop, s = e.left + h.clientLeft, o = W(h) ? j(h) : Y(1), n = h.clientWidth * o.x, a = h.clientHeight * o.y, l = s * o.x, c = i * o.y;
|
|
6650
6800
|
return {
|
|
6651
6801
|
width: n,
|
|
6652
6802
|
height: a,
|
|
@@ -6654,16 +6804,16 @@ function vi(h, t) {
|
|
|
6654
6804
|
y: c
|
|
6655
6805
|
};
|
|
6656
6806
|
}
|
|
6657
|
-
function
|
|
6807
|
+
function jt(h, t, e) {
|
|
6658
6808
|
let i;
|
|
6659
6809
|
if (t === "viewport")
|
|
6660
|
-
i =
|
|
6810
|
+
i = Si(h, e);
|
|
6661
6811
|
else if (t === "document")
|
|
6662
|
-
i =
|
|
6812
|
+
i = Ti(F(h));
|
|
6663
6813
|
else if (X(t))
|
|
6664
|
-
i =
|
|
6814
|
+
i = Oi(t, e);
|
|
6665
6815
|
else {
|
|
6666
|
-
const s =
|
|
6816
|
+
const s = ue(h);
|
|
6667
6817
|
i = {
|
|
6668
6818
|
x: t.x - s.x,
|
|
6669
6819
|
y: t.y - s.y,
|
|
@@ -6671,36 +6821,36 @@ function Ut(h, t, e) {
|
|
|
6671
6821
|
height: t.height
|
|
6672
6822
|
};
|
|
6673
6823
|
}
|
|
6674
|
-
return
|
|
6824
|
+
return ft(i);
|
|
6675
6825
|
}
|
|
6676
|
-
function
|
|
6826
|
+
function ge(h, t) {
|
|
6677
6827
|
const e = P(h);
|
|
6678
|
-
return e === t || !X(e) || J(e) ? !1 : K(e).position === "fixed" ||
|
|
6828
|
+
return e === t || !X(e) || J(e) ? !1 : K(e).position === "fixed" || ge(e, t);
|
|
6679
6829
|
}
|
|
6680
|
-
function
|
|
6830
|
+
function Li(h, t) {
|
|
6681
6831
|
const e = t.get(h);
|
|
6682
6832
|
if (e)
|
|
6683
6833
|
return e;
|
|
6684
|
-
let i =
|
|
6834
|
+
let i = it(h, [], !1).filter((a) => X(a) && Q(a) !== "body"), s = null;
|
|
6685
6835
|
const o = K(h).position === "fixed";
|
|
6686
6836
|
let n = o ? P(h) : h;
|
|
6687
6837
|
for (; X(n) && !J(n); ) {
|
|
6688
|
-
const a = K(n), l =
|
|
6689
|
-
!l && a.position === "fixed" && (s = null), (o ? !l && !s : !l && a.position === "static" && !!s && (s.position === "absolute" || s.position === "fixed") ||
|
|
6838
|
+
const a = K(n), l = Dt(n);
|
|
6839
|
+
!l && a.position === "fixed" && (s = null), (o ? !l && !s : !l && a.position === "static" && !!s && (s.position === "absolute" || s.position === "fixed") || nt(n) && !l && ge(h, n)) ? i = i.filter((d) => d !== n) : s = a, n = P(n);
|
|
6690
6840
|
}
|
|
6691
6841
|
return t.set(h, i), i;
|
|
6692
6842
|
}
|
|
6693
|
-
function
|
|
6843
|
+
function Mi(h) {
|
|
6694
6844
|
let {
|
|
6695
6845
|
element: t,
|
|
6696
6846
|
boundary: e,
|
|
6697
6847
|
rootBoundary: i,
|
|
6698
6848
|
strategy: s
|
|
6699
6849
|
} = h;
|
|
6700
|
-
const n = [...e === "clippingAncestors" ?
|
|
6850
|
+
const n = [...e === "clippingAncestors" ? Et(t) ? [] : Li(t, this._c) : [].concat(e), i], a = jt(t, n[0], s);
|
|
6701
6851
|
let l = a.top, c = a.right, d = a.bottom, f = a.left;
|
|
6702
6852
|
for (let u = 1; u < n.length; u++) {
|
|
6703
|
-
const x =
|
|
6853
|
+
const x = jt(t, n[u], s);
|
|
6704
6854
|
l = $(x.top, l), c = q(x.right, c), d = q(x.bottom, d), f = $(x.left, f);
|
|
6705
6855
|
}
|
|
6706
6856
|
return {
|
|
@@ -6710,17 +6860,17 @@ function Ti(h) {
|
|
|
6710
6860
|
y: l
|
|
6711
6861
|
};
|
|
6712
6862
|
}
|
|
6713
|
-
function
|
|
6863
|
+
function Ai(h) {
|
|
6714
6864
|
const {
|
|
6715
6865
|
width: t,
|
|
6716
6866
|
height: e
|
|
6717
|
-
} =
|
|
6867
|
+
} = fe(h);
|
|
6718
6868
|
return {
|
|
6719
6869
|
width: t,
|
|
6720
6870
|
height: e
|
|
6721
6871
|
};
|
|
6722
6872
|
}
|
|
6723
|
-
function
|
|
6873
|
+
function Hi(h, t, e) {
|
|
6724
6874
|
const i = W(t), s = F(t), o = e === "fixed", n = U(h, !0, o, t);
|
|
6725
6875
|
let a = {
|
|
6726
6876
|
scrollLeft: 0,
|
|
@@ -6728,15 +6878,15 @@ function Oi(h, t, e) {
|
|
|
6728
6878
|
};
|
|
6729
6879
|
const l = Y(0);
|
|
6730
6880
|
function c() {
|
|
6731
|
-
l.x =
|
|
6881
|
+
l.x = yt(s);
|
|
6732
6882
|
}
|
|
6733
6883
|
if (i || !i && !o)
|
|
6734
|
-
if ((Q(t) !== "body" ||
|
|
6884
|
+
if ((Q(t) !== "body" || nt(s)) && (a = pt(t)), i) {
|
|
6735
6885
|
const x = U(t, !0, o, t);
|
|
6736
6886
|
l.x = x.x + t.clientLeft, l.y = x.y + t.clientTop;
|
|
6737
6887
|
} else s && c();
|
|
6738
6888
|
o && !i && s && c();
|
|
6739
|
-
const d = s && !i && !o ?
|
|
6889
|
+
const d = s && !i && !o ? xe(s, a) : Y(0), f = n.left + a.scrollLeft - l.x - d.x, u = n.top + a.scrollTop - l.y - d.y;
|
|
6740
6890
|
return {
|
|
6741
6891
|
x: f,
|
|
6742
6892
|
y: u,
|
|
@@ -6744,10 +6894,10 @@ function Oi(h, t, e) {
|
|
|
6744
6894
|
height: n.height
|
|
6745
6895
|
};
|
|
6746
6896
|
}
|
|
6747
|
-
function
|
|
6897
|
+
function Rt(h) {
|
|
6748
6898
|
return K(h).position === "static";
|
|
6749
6899
|
}
|
|
6750
|
-
function
|
|
6900
|
+
function qt(h, t) {
|
|
6751
6901
|
if (!W(h) || K(h).position === "fixed")
|
|
6752
6902
|
return null;
|
|
6753
6903
|
if (t)
|
|
@@ -6755,28 +6905,28 @@ function jt(h, t) {
|
|
|
6755
6905
|
let e = h.offsetParent;
|
|
6756
6906
|
return F(h) === e && (e = e.ownerDocument.body), e;
|
|
6757
6907
|
}
|
|
6758
|
-
function
|
|
6908
|
+
function me(h, t) {
|
|
6759
6909
|
const e = B(h);
|
|
6760
|
-
if (
|
|
6910
|
+
if (Et(h))
|
|
6761
6911
|
return e;
|
|
6762
6912
|
if (!W(h)) {
|
|
6763
6913
|
let s = P(h);
|
|
6764
6914
|
for (; s && !J(s); ) {
|
|
6765
|
-
if (X(s) && !
|
|
6915
|
+
if (X(s) && !Rt(s))
|
|
6766
6916
|
return s;
|
|
6767
6917
|
s = P(s);
|
|
6768
6918
|
}
|
|
6769
6919
|
return e;
|
|
6770
6920
|
}
|
|
6771
|
-
let i =
|
|
6772
|
-
for (; i &&
|
|
6773
|
-
i =
|
|
6774
|
-
return i && J(i) &&
|
|
6921
|
+
let i = qt(h, t);
|
|
6922
|
+
for (; i && pi(i) && Rt(i); )
|
|
6923
|
+
i = qt(i, t);
|
|
6924
|
+
return i && J(i) && Rt(i) && !Dt(i) ? e : i || bi(h) || e;
|
|
6775
6925
|
}
|
|
6776
|
-
const
|
|
6777
|
-
const t = this.getOffsetParent ||
|
|
6926
|
+
const Di = async function(h) {
|
|
6927
|
+
const t = this.getOffsetParent || me, e = this.getDimensions, i = await e(h.floating);
|
|
6778
6928
|
return {
|
|
6779
|
-
reference:
|
|
6929
|
+
reference: Hi(h.reference, await t(h.floating), h.strategy),
|
|
6780
6930
|
floating: {
|
|
6781
6931
|
x: 0,
|
|
6782
6932
|
y: 0,
|
|
@@ -6785,25 +6935,25 @@ const Li = async function(h) {
|
|
|
6785
6935
|
}
|
|
6786
6936
|
};
|
|
6787
6937
|
};
|
|
6788
|
-
function
|
|
6938
|
+
function Ni(h) {
|
|
6789
6939
|
return K(h).direction === "rtl";
|
|
6790
6940
|
}
|
|
6791
|
-
const
|
|
6792
|
-
convertOffsetParentRelativeRectToViewportRelativeRect:
|
|
6941
|
+
const ki = {
|
|
6942
|
+
convertOffsetParentRelativeRectToViewportRelativeRect: Ii,
|
|
6793
6943
|
getDocumentElement: F,
|
|
6794
|
-
getClippingRect:
|
|
6795
|
-
getOffsetParent:
|
|
6796
|
-
getElementRects:
|
|
6797
|
-
getClientRects:
|
|
6798
|
-
getDimensions:
|
|
6799
|
-
getScale:
|
|
6944
|
+
getClippingRect: Mi,
|
|
6945
|
+
getOffsetParent: me,
|
|
6946
|
+
getElementRects: Di,
|
|
6947
|
+
getClientRects: _i,
|
|
6948
|
+
getDimensions: Ai,
|
|
6949
|
+
getScale: j,
|
|
6800
6950
|
isElement: X,
|
|
6801
|
-
isRTL:
|
|
6951
|
+
isRTL: Ni
|
|
6802
6952
|
};
|
|
6803
|
-
function
|
|
6953
|
+
function we(h, t) {
|
|
6804
6954
|
return h.x === t.x && h.y === t.y && h.width === t.width && h.height === t.height;
|
|
6805
6955
|
}
|
|
6806
|
-
function
|
|
6956
|
+
function Bi(h, t) {
|
|
6807
6957
|
let e = null, i;
|
|
6808
6958
|
const s = F(h);
|
|
6809
6959
|
function o() {
|
|
@@ -6820,36 +6970,36 @@ function Hi(h, t) {
|
|
|
6820
6970
|
} = c;
|
|
6821
6971
|
if (a || t(), !u || !x)
|
|
6822
6972
|
return;
|
|
6823
|
-
const g =
|
|
6824
|
-
rootMargin: -g + "px " + -E + "px " + -
|
|
6973
|
+
const g = rt(f), E = rt(s.clientWidth - (d + u)), m = rt(s.clientHeight - (f + x)), w = rt(d), C = {
|
|
6974
|
+
rootMargin: -g + "px " + -E + "px " + -m + "px " + -w + "px",
|
|
6825
6975
|
threshold: $(0, q(1, l)) || 1
|
|
6826
6976
|
};
|
|
6827
6977
|
let p = !0;
|
|
6828
|
-
function
|
|
6829
|
-
const
|
|
6830
|
-
if (
|
|
6978
|
+
function b(v) {
|
|
6979
|
+
const I = v[0].intersectionRatio;
|
|
6980
|
+
if (I !== l) {
|
|
6831
6981
|
if (!p)
|
|
6832
6982
|
return n();
|
|
6833
|
-
|
|
6983
|
+
I ? n(!1, I) : i = setTimeout(() => {
|
|
6834
6984
|
n(!1, 1e-7);
|
|
6835
6985
|
}, 1e3);
|
|
6836
6986
|
}
|
|
6837
|
-
|
|
6987
|
+
I === 1 && !we(c, h.getBoundingClientRect()) && n(), p = !1;
|
|
6838
6988
|
}
|
|
6839
6989
|
try {
|
|
6840
|
-
e = new IntersectionObserver(
|
|
6841
|
-
...
|
|
6990
|
+
e = new IntersectionObserver(b, {
|
|
6991
|
+
...C,
|
|
6842
6992
|
// Handle <iframe>s
|
|
6843
6993
|
root: s.ownerDocument
|
|
6844
6994
|
});
|
|
6845
6995
|
} catch {
|
|
6846
|
-
e = new IntersectionObserver(
|
|
6996
|
+
e = new IntersectionObserver(b, C);
|
|
6847
6997
|
}
|
|
6848
6998
|
e.observe(h);
|
|
6849
6999
|
}
|
|
6850
7000
|
return n(!0), o;
|
|
6851
7001
|
}
|
|
6852
|
-
function
|
|
7002
|
+
function Tt(h, t, e, i) {
|
|
6853
7003
|
i === void 0 && (i = {});
|
|
6854
7004
|
const {
|
|
6855
7005
|
ancestorScroll: s = !0,
|
|
@@ -6857,48 +7007,48 @@ function _t(h, t, e, i) {
|
|
|
6857
7007
|
elementResize: n = typeof ResizeObserver == "function",
|
|
6858
7008
|
layoutShift: a = typeof IntersectionObserver == "function",
|
|
6859
7009
|
animationFrame: l = !1
|
|
6860
|
-
} = i, c =
|
|
6861
|
-
d.forEach((
|
|
6862
|
-
s &&
|
|
7010
|
+
} = i, c = kt(h), d = s || o ? [...c ? it(c) : [], ...t ? it(t) : []] : [];
|
|
7011
|
+
d.forEach((w) => {
|
|
7012
|
+
s && w.addEventListener("scroll", e, {
|
|
6863
7013
|
passive: !0
|
|
6864
|
-
}), o &&
|
|
7014
|
+
}), o && w.addEventListener("resize", e);
|
|
6865
7015
|
});
|
|
6866
|
-
const f = c && a ?
|
|
7016
|
+
const f = c && a ? Bi(c, e) : null;
|
|
6867
7017
|
let u = -1, x = null;
|
|
6868
|
-
n && (x = new ResizeObserver((
|
|
6869
|
-
let [y] =
|
|
7018
|
+
n && (x = new ResizeObserver((w) => {
|
|
7019
|
+
let [y] = w;
|
|
6870
7020
|
y && y.target === c && x && t && (x.unobserve(t), cancelAnimationFrame(u), u = requestAnimationFrame(() => {
|
|
6871
|
-
var
|
|
6872
|
-
(
|
|
7021
|
+
var C;
|
|
7022
|
+
(C = x) == null || C.observe(t);
|
|
6873
7023
|
})), e();
|
|
6874
7024
|
}), c && !l && x.observe(c), t && x.observe(t));
|
|
6875
7025
|
let g, E = l ? U(h) : null;
|
|
6876
|
-
l &&
|
|
6877
|
-
function
|
|
6878
|
-
const
|
|
6879
|
-
E && !
|
|
7026
|
+
l && m();
|
|
7027
|
+
function m() {
|
|
7028
|
+
const w = U(h);
|
|
7029
|
+
E && !we(E, w) && e(), E = w, g = requestAnimationFrame(m);
|
|
6880
7030
|
}
|
|
6881
7031
|
return e(), () => {
|
|
6882
|
-
var
|
|
7032
|
+
var w;
|
|
6883
7033
|
d.forEach((y) => {
|
|
6884
7034
|
s && y.removeEventListener("scroll", e), o && y.removeEventListener("resize", e);
|
|
6885
|
-
}), f == null || f(), (
|
|
7035
|
+
}), f == null || f(), (w = x) == null || w.disconnect(), x = null, l && cancelAnimationFrame(g);
|
|
6886
7036
|
};
|
|
6887
7037
|
}
|
|
6888
|
-
const
|
|
7038
|
+
const ut = wi, xt = Ei, Bt = xi, Xi = ui, gt = (h, t, e) => {
|
|
6889
7039
|
const i = /* @__PURE__ */ new Map(), s = {
|
|
6890
|
-
platform:
|
|
7040
|
+
platform: ki,
|
|
6891
7041
|
...e
|
|
6892
7042
|
}, o = {
|
|
6893
7043
|
...s.platform,
|
|
6894
7044
|
_c: i
|
|
6895
7045
|
};
|
|
6896
|
-
return
|
|
7046
|
+
return fi(h, t, {
|
|
6897
7047
|
...s,
|
|
6898
7048
|
platform: o
|
|
6899
7049
|
});
|
|
6900
7050
|
};
|
|
6901
|
-
let
|
|
7051
|
+
let Ki = class {
|
|
6902
7052
|
constructor(t) {
|
|
6903
7053
|
r(this, "ctx");
|
|
6904
7054
|
r(this, "enable", !1);
|
|
@@ -6967,49 +7117,48 @@ let Ni = class {
|
|
|
6967
7117
|
if (!s)
|
|
6968
7118
|
return;
|
|
6969
7119
|
this.enable = !0, this.contentEl.style.maxWidth = `${t.overflowTooltipMaxWidth || 500}px`, this.contentEl.style.minWidth = "100px", this.contentEl.style.width = "100%", this.contentEl.style.display = "inline-block", this.contentEl.style.wordBreak = "break-all", this.contentEl.style.lineHeight = "1.5", this.contentEl.innerText = i;
|
|
6970
|
-
const o =
|
|
6971
|
-
|
|
7120
|
+
const o = this.ctx.zoomScale.getViewportRect(
|
|
7121
|
+
{
|
|
7122
|
+
x: t.drawX,
|
|
7123
|
+
y: t.drawY,
|
|
7124
|
+
width: t.visibleWidth,
|
|
7125
|
+
height: t.visibleHeight
|
|
7126
|
+
},
|
|
7127
|
+
s
|
|
7128
|
+
);
|
|
7129
|
+
gt({
|
|
6972
7130
|
getBoundingClientRect() {
|
|
6973
|
-
return
|
|
6974
|
-
width: t.visibleWidth,
|
|
6975
|
-
height: t.visibleHeight,
|
|
6976
|
-
x: o,
|
|
6977
|
-
y: n,
|
|
6978
|
-
left: o,
|
|
6979
|
-
right: o + t.visibleWidth,
|
|
6980
|
-
top: n,
|
|
6981
|
-
bottom: n + t.visibleHeight
|
|
6982
|
-
};
|
|
7131
|
+
return o;
|
|
6983
7132
|
}
|
|
6984
7133
|
}, this.floatingEl, {
|
|
6985
7134
|
placement: t.overflowTooltipPlacement,
|
|
6986
|
-
middleware: [
|
|
6987
|
-
}).then((
|
|
6988
|
-
const { x:
|
|
7135
|
+
middleware: [xt(), Bt(), ut(6), Xi({ element: this.arrowEl })]
|
|
7136
|
+
}).then((a) => {
|
|
7137
|
+
const { x: l, y: c, placement: d, middlewareData: f } = a;
|
|
6989
7138
|
if (Object.assign(this.floatingEl.style, {
|
|
6990
|
-
top: `${
|
|
6991
|
-
left: `${
|
|
6992
|
-
}),
|
|
6993
|
-
const
|
|
6994
|
-
["left", "left-start", "left-end"].includes(
|
|
6995
|
-
top: `${
|
|
7139
|
+
top: `${c}px`,
|
|
7140
|
+
left: `${l}px`
|
|
7141
|
+
}), f.arrow) {
|
|
7142
|
+
const u = f.arrow;
|
|
7143
|
+
["left", "left-start", "left-end"].includes(d) ? Object.assign(this.arrowEl.style, {
|
|
7144
|
+
top: `${u.y}px`,
|
|
6996
7145
|
bottom: "",
|
|
6997
7146
|
left: "",
|
|
6998
7147
|
right: "-5px"
|
|
6999
|
-
}) : ["right", "right-start", "right-end"].includes(
|
|
7000
|
-
top: `${
|
|
7148
|
+
}) : ["right", "right-start", "right-end"].includes(d) ? Object.assign(this.arrowEl.style, {
|
|
7149
|
+
top: `${u.y}px`,
|
|
7001
7150
|
bottom: "",
|
|
7002
7151
|
left: "-5px",
|
|
7003
7152
|
right: ""
|
|
7004
|
-
}) : ["bottom", "bottom-start", "bottom-end"].includes(
|
|
7153
|
+
}) : ["bottom", "bottom-start", "bottom-end"].includes(d) ? Object.assign(this.arrowEl.style, {
|
|
7005
7154
|
top: "-5px",
|
|
7006
7155
|
bottom: "",
|
|
7007
|
-
left: `${
|
|
7156
|
+
left: `${u.x}px`,
|
|
7008
7157
|
right: ""
|
|
7009
|
-
}) : ["top", "top-start", "top-end"].includes(
|
|
7158
|
+
}) : ["top", "top-start", "top-end"].includes(d) && Object.assign(this.arrowEl.style, {
|
|
7010
7159
|
top: "",
|
|
7011
7160
|
bottom: "-5px",
|
|
7012
|
-
left: `${
|
|
7161
|
+
left: `${u.x}px`,
|
|
7013
7162
|
right: ""
|
|
7014
7163
|
});
|
|
7015
7164
|
}
|
|
@@ -7022,7 +7171,7 @@ let Ni = class {
|
|
|
7022
7171
|
this.contentEl.remove(), this.arrowEl.remove(), this.floatingEl.remove();
|
|
7023
7172
|
}
|
|
7024
7173
|
};
|
|
7025
|
-
class
|
|
7174
|
+
class Yi {
|
|
7026
7175
|
constructor(t) {
|
|
7027
7176
|
r(this, "editorEl");
|
|
7028
7177
|
r(this, "inputEl");
|
|
@@ -7080,8 +7229,6 @@ class ki {
|
|
|
7080
7229
|
return;
|
|
7081
7230
|
}
|
|
7082
7231
|
if (t.key === "Enter" && !this.ctx.editing) {
|
|
7083
|
-
if (this.isTextSelectionActive())
|
|
7084
|
-
return;
|
|
7085
7232
|
t.preventDefault(), this.startEdit();
|
|
7086
7233
|
return;
|
|
7087
7234
|
}
|
|
@@ -7120,9 +7267,9 @@ class ki {
|
|
|
7120
7267
|
t.preventDefault();
|
|
7121
7268
|
return;
|
|
7122
7269
|
}
|
|
7123
|
-
this.
|
|
7270
|
+
this.startEdit(!0);
|
|
7124
7271
|
}), this.ctx.on("cellClick", (t) => {
|
|
7125
|
-
if (this.ctx.stageElement.style.cursor === "pointer" ||
|
|
7272
|
+
if (this.ctx.stageElement.style.cursor === "pointer" || !this.isInSelectorRange(t.rowIndex, t.colIndex))
|
|
7126
7273
|
return;
|
|
7127
7274
|
const { xArr: e, yArr: i } = this.ctx.selector, s = JSON.stringify(e) + JSON.stringify(i);
|
|
7128
7275
|
if (this.focusInput(), this.selectorArrStr === s && this.cellTarget) {
|
|
@@ -7159,19 +7306,21 @@ class ki {
|
|
|
7159
7306
|
return;
|
|
7160
7307
|
const t = this.inputEl.value;
|
|
7161
7308
|
if (this.cellTarget && this.cellTarget.type === "number" && t !== "" && (this.ctx.emit("cellHideTooltip"), !/^-?\d+(\.\d+)?$/.test(t))) {
|
|
7162
|
-
const
|
|
7163
|
-
this.ctx.emit("cellShowTooltip", this.cellTarget,
|
|
7309
|
+
const d = this.ctx.locale.getText("numberErrorTip");
|
|
7310
|
+
this.ctx.emit("cellShowTooltip", this.cellTarget, d);
|
|
7164
7311
|
}
|
|
7165
7312
|
this.inputEl.style.height = "auto";
|
|
7166
|
-
let e = this.inputEl.scrollHeight
|
|
7167
|
-
|
|
7313
|
+
let e = this.inputEl.scrollHeight;
|
|
7314
|
+
const i = this.ctx.toLogical(e);
|
|
7315
|
+
let s = this.ctx.body.visibleHeight;
|
|
7316
|
+
i > s && (e = this.ctx.toVisual(s));
|
|
7168
7317
|
const {
|
|
7169
|
-
stageHeight:
|
|
7170
|
-
footer:
|
|
7171
|
-
header:
|
|
7172
|
-
config: { SCROLLER_TRACK_SIZE:
|
|
7173
|
-
} = this.ctx,
|
|
7174
|
-
this.editorEl.style.bottom = "auto", this.drawY <
|
|
7318
|
+
stageHeight: o,
|
|
7319
|
+
footer: n,
|
|
7320
|
+
header: a,
|
|
7321
|
+
config: { SCROLLER_TRACK_SIZE: l }
|
|
7322
|
+
} = this.ctx, c = o - n.height - l;
|
|
7323
|
+
this.editorEl.style.bottom = "auto", this.drawY < a.height && (this.editorEl.style.top = this.ctx.toVisualPx(a.height - 1)), this.drawY + this.ctx.toLogical(e) > c && (this.editorEl.style.left = this.ctx.toVisualPx(this.drawX - 1), this.editorEl.style.top = "auto", this.editorEl.style.bottom = this.ctx.toVisualPx(o - c)), this.inputEl.style.height = `${e}px`;
|
|
7175
7324
|
}
|
|
7176
7325
|
startEditByInput(t, e = !1) {
|
|
7177
7326
|
const i = e ? null : t.getValue(), { editorType: s } = t;
|
|
@@ -7185,7 +7334,9 @@ class ki {
|
|
|
7185
7334
|
header: d
|
|
7186
7335
|
} = this.ctx;
|
|
7187
7336
|
let f = this.ctx.body.visibleHeight;
|
|
7188
|
-
o > f && (o = f)
|
|
7337
|
+
o > f && (o = f);
|
|
7338
|
+
const u = this.ctx.toVisual(f);
|
|
7339
|
+
this.editorEl.style.zIndex = "100", this.editorEl.style.left = this.ctx.toVisualPx(this.drawX - 1), this.editorEl.style.top = this.ctx.toVisualPx(this.drawY), this.editorEl.style.bottom = "auto", this.editorEl.style.maxWidth = "none", this.editorEl.style.maxHeight = `${u}px`, ["text"].includes(s) ? (this.inputEl.style.opacity = "1", this.inputEl.style.position = "relative", this.inputEl.style.minWidth = this.ctx.toVisualPx(n - 1), this.inputEl.style.minHeight = this.ctx.toVisualPx(o - 1), this.inputEl.style.maxHeight = `${u}px`, this.inputEl.style.width = this.ctx.toVisualPx(n), this.inputEl.style.height = "auto", this.inputEl.style.padding = this.ctx.toVisualPx(c), this.inputEl.value = "", i !== null && (this.inputEl.value = i), (this.ctx.toLogical(this.inputEl.scrollHeight) > o || this.drawY < d.height) && this.autoSize()) : (this.inputEl.style.opacity = "0", this.inputEl.style.width = "1px", this.inputEl.style.height = "1px", this.inputEl.style.position = "absolute", this.inputEl.style.left = "0px", this.inputEl.style.top = "0px");
|
|
7189
7340
|
}
|
|
7190
7341
|
doneEditByInput() {
|
|
7191
7342
|
if (this.cellTarget && this.cellTarget.editorType === "text") {
|
|
@@ -7229,7 +7380,7 @@ class ki {
|
|
|
7229
7380
|
}
|
|
7230
7381
|
resetEditorStyle() {
|
|
7231
7382
|
const t = this.cellTarget;
|
|
7232
|
-
t && (this.editorEl.style.left =
|
|
7383
|
+
t && (this.editorEl.style.left = this.ctx.toVisualPx(t.drawX), this.editorEl.style.top = this.ctx.toVisualPx(t.drawY), this.editorEl.style.maxWidth = "1px", this.editorEl.style.maxHeight = "1px", this.editorEl.style.zIndex = "-1");
|
|
7233
7384
|
}
|
|
7234
7385
|
clearEditor() {
|
|
7235
7386
|
this.doneEdit(), this.cellTarget = null, this.selectorArrStr = "", this.ctx.clearSelector(), this.ctx.focusCell = void 0, this.inputEl.blur(), this.ctx.emit("draw");
|
|
@@ -7239,7 +7390,7 @@ class ki {
|
|
|
7239
7390
|
(t = this.editorEl) == null || t.remove();
|
|
7240
7391
|
}
|
|
7241
7392
|
}
|
|
7242
|
-
let
|
|
7393
|
+
let Fi = class {
|
|
7243
7394
|
constructor(t) {
|
|
7244
7395
|
r(this, "ctx");
|
|
7245
7396
|
r(this, "emptyEl");
|
|
@@ -7248,7 +7399,7 @@ let Bi = class {
|
|
|
7248
7399
|
this.ctx.emptyElement ? this.emptyEl = this.ctx.emptyElement : (this.emptyEl = document.createElement("div"), this.emptyEl.innerText = this.getText()), this.emptyEl.className = "e-virt-table-empty", this.emptyEl.style.display = "none", this.ctx.containerElement.appendChild(this.emptyEl), this.ctx.on("emptyChange", ({ type: i, headerHeight: s, bodyHeight: o, footerHeight: n }) => {
|
|
7249
7400
|
const a = s + (o + n) / 2, l = {
|
|
7250
7401
|
display: i === "empty" ? "block" : "none",
|
|
7251
|
-
top:
|
|
7402
|
+
top: this.ctx.toVisualPx(a),
|
|
7252
7403
|
...e
|
|
7253
7404
|
};
|
|
7254
7405
|
Object.assign(this.emptyEl.style, l);
|
|
@@ -7264,7 +7415,7 @@ let Bi = class {
|
|
|
7264
7415
|
this.emptyEl.remove();
|
|
7265
7416
|
}
|
|
7266
7417
|
};
|
|
7267
|
-
class
|
|
7418
|
+
class Wi {
|
|
7268
7419
|
constructor(t) {
|
|
7269
7420
|
r(this, "ctx");
|
|
7270
7421
|
r(this, "observer");
|
|
@@ -7278,14 +7429,14 @@ class Xi {
|
|
|
7278
7429
|
}
|
|
7279
7430
|
init() {
|
|
7280
7431
|
this.observer = new MutationObserver(
|
|
7281
|
-
|
|
7432
|
+
Lt(() => {
|
|
7282
7433
|
const t = this.ctx.overlayerElement.querySelectorAll('[data-auto-height="true"]'), e = /* @__PURE__ */ new Map();
|
|
7283
7434
|
t.forEach((o) => {
|
|
7284
7435
|
const n = Number(o.getAttribute("data-row-index")), a = Number(o.getAttribute("data-col-index"));
|
|
7285
7436
|
if (isNaN(n) || isNaN(a))
|
|
7286
7437
|
return;
|
|
7287
7438
|
const l = o.getBoundingClientRect(), c = `${n}_${a}`;
|
|
7288
|
-
e.set(c,
|
|
7439
|
+
e.set(c, this.ctx.zoomScale.domHeightToLogical(l.height));
|
|
7289
7440
|
});
|
|
7290
7441
|
const i = this.ctx.database.getOverlayerAutoHeightMap();
|
|
7291
7442
|
if (!this.arerMapsEqual(i, e)) {
|
|
@@ -7303,13 +7454,14 @@ class Xi {
|
|
|
7303
7454
|
const e = this.ctx.overlayerElement;
|
|
7304
7455
|
e.replaceChildren(), Object.assign(e.style, t.style), t.views.forEach((i) => {
|
|
7305
7456
|
const s = document.createElement("div");
|
|
7306
|
-
s.className = i.class,
|
|
7457
|
+
s.className = i.class, this.ctx.zoomScale.assignScaledStyle(s, i.style), i.views.forEach((o) => {
|
|
7307
7458
|
const n = document.createElement("div");
|
|
7308
|
-
|
|
7309
|
-
const l =
|
|
7310
|
-
|
|
7311
|
-
|
|
7312
|
-
|
|
7459
|
+
this.ctx.zoomScale.assignScaledStyle(n, o.style), o.cells.forEach((a) => {
|
|
7460
|
+
const l = this.ctx.zoomScale.createOverlayerCellElement(
|
|
7461
|
+
a,
|
|
7462
|
+
this.ctx.config.CSS_PREFIX
|
|
7463
|
+
);
|
|
7464
|
+
n.appendChild(l);
|
|
7313
7465
|
}), s.appendChild(n);
|
|
7314
7466
|
}), e.appendChild(s);
|
|
7315
7467
|
});
|
|
@@ -7340,8 +7492,8 @@ class Xi {
|
|
|
7340
7492
|
config: { SCROLLER_TRACK_SIZE: i, CSS_PREFIX: s }
|
|
7341
7493
|
} = this.ctx, { visibleWidth: o, visibleHeight: n, renderCellHeaders: a } = this.ctx.header;
|
|
7342
7494
|
let l = [], c = [], d = [];
|
|
7343
|
-
a.forEach((
|
|
7344
|
-
|
|
7495
|
+
a.forEach((m) => {
|
|
7496
|
+
m.render && (m.fixed === "left" ? c.push(m) : m.fixed === "right" ? d.push(m) : l.push(m));
|
|
7345
7497
|
});
|
|
7346
7498
|
const f = e - i, u = {
|
|
7347
7499
|
key: "left",
|
|
@@ -7392,9 +7544,9 @@ class Xi {
|
|
|
7392
7544
|
getBody() {
|
|
7393
7545
|
const t = [], e = [], i = [];
|
|
7394
7546
|
let s = this.ctx.body.renderRows;
|
|
7395
|
-
this.ctx.config.FOOTER_FIXED || (s = s.concat(this.ctx.footer.renderRows)), s.forEach((
|
|
7396
|
-
|
|
7397
|
-
|
|
7547
|
+
this.ctx.config.FOOTER_FIXED || (s = s.concat(this.ctx.footer.renderRows)), s.forEach((m) => {
|
|
7548
|
+
m.cells.forEach((w) => {
|
|
7549
|
+
w.cellType === "footer" && (w.render = w.renderFooter), w.render && (w.fixed === "left" ? e.push(w) : w.fixed === "right" ? i.push(w) : t.push(w));
|
|
7398
7550
|
});
|
|
7399
7551
|
});
|
|
7400
7552
|
const {
|
|
@@ -7450,8 +7602,8 @@ class Xi {
|
|
|
7450
7602
|
getFooter() {
|
|
7451
7603
|
const t = [], e = [], i = [];
|
|
7452
7604
|
this.ctx.footer.renderRows.forEach((E) => {
|
|
7453
|
-
E.cells.forEach((
|
|
7454
|
-
|
|
7605
|
+
E.cells.forEach((m) => {
|
|
7606
|
+
m.cellType === "footer" && m.renderFooter && (m.render = m.renderFooter, m.fixed === "left" ? e.push(m) : m.fixed === "right" ? i.push(m) : t.push(m));
|
|
7455
7607
|
});
|
|
7456
7608
|
});
|
|
7457
7609
|
const {
|
|
@@ -7505,7 +7657,7 @@ class Xi {
|
|
|
7505
7657
|
};
|
|
7506
7658
|
}
|
|
7507
7659
|
}
|
|
7508
|
-
class
|
|
7660
|
+
class Jt {
|
|
7509
7661
|
constructor(t, e = [], i = {}) {
|
|
7510
7662
|
r(this, "container");
|
|
7511
7663
|
r(this, "menuData");
|
|
@@ -7539,7 +7691,7 @@ class Zt {
|
|
|
7539
7691
|
const o = this.createElement("span", "e-virt-table-menu-item-text");
|
|
7540
7692
|
if (o.textContent = t.label || "", s.appendChild(o), i.appendChild(s), (n = t.children) != null && n.length) {
|
|
7541
7693
|
const a = this.createElement("span", "e-virt-table-menu-arrow");
|
|
7542
|
-
a.innerHTML =
|
|
7694
|
+
a.innerHTML = ct, i.appendChild(a);
|
|
7543
7695
|
const l = this.createSubmenu(t.children);
|
|
7544
7696
|
i._submenu = l, this.container.appendChild(l);
|
|
7545
7697
|
}
|
|
@@ -7593,10 +7745,10 @@ class Zt {
|
|
|
7593
7745
|
async showSubmenu(t, e) {
|
|
7594
7746
|
if (this.activeSubmenus.has(e)) return;
|
|
7595
7747
|
this.activeSubmenus.add(e), e.classList.add("show");
|
|
7596
|
-
const i =
|
|
7597
|
-
const s = this.container.getBoundingClientRect(), o = window.innerWidth, n = e.offsetWidth || 200, a = o - s.right, l = s.left, c = a >= n || a >= l ? "right-start" : "left-start", { x: d, y: f } = await
|
|
7748
|
+
const i = Tt(t, e, async () => {
|
|
7749
|
+
const s = this.container.getBoundingClientRect(), o = window.innerWidth, n = e.offsetWidth || 200, a = o - s.right, l = s.left, c = a >= n || a >= l ? "right-start" : "left-start", { x: d, y: f } = await gt(t, e, {
|
|
7598
7750
|
placement: c,
|
|
7599
|
-
middleware: [
|
|
7751
|
+
middleware: [ut(8), xt({ padding: 8 })]
|
|
7600
7752
|
});
|
|
7601
7753
|
Object.assign(e.style, {
|
|
7602
7754
|
left: `${d}px`,
|
|
@@ -7663,10 +7815,10 @@ class Zt {
|
|
|
7663
7815
|
}),
|
|
7664
7816
|
contextElement: document.body
|
|
7665
7817
|
};
|
|
7666
|
-
|
|
7667
|
-
|
|
7818
|
+
Tt(e, this.container, () => {
|
|
7819
|
+
gt(e, this.container, {
|
|
7668
7820
|
placement: "right-start",
|
|
7669
|
-
middleware: [
|
|
7821
|
+
middleware: [ut(), xt(), Bt()]
|
|
7670
7822
|
}).then(({ x: i, y: s }) => {
|
|
7671
7823
|
this.container && Object.assign(this.container.style, {
|
|
7672
7824
|
left: `${i}px`,
|
|
@@ -7728,7 +7880,7 @@ class Zt {
|
|
|
7728
7880
|
}), t.remove();
|
|
7729
7881
|
}
|
|
7730
7882
|
}
|
|
7731
|
-
class
|
|
7883
|
+
class Vi {
|
|
7732
7884
|
constructor(t) {
|
|
7733
7885
|
r(this, "ctx");
|
|
7734
7886
|
r(this, "contextMenuEl");
|
|
@@ -7745,16 +7897,16 @@ class Ki {
|
|
|
7745
7897
|
return;
|
|
7746
7898
|
}
|
|
7747
7899
|
const { ENABLE_CONTEXT_MENU: i, CUSTOM_BODY_CONTEXT_MENU: s, CONTEXT_MENU: o, BEFORE_BODY_CONTEXT_MENU_METHOD: n } = this.ctx.config;
|
|
7748
|
-
let a = o.map((
|
|
7749
|
-
...
|
|
7750
|
-
label:
|
|
7900
|
+
let a = o.map((w) => ({
|
|
7901
|
+
...w,
|
|
7902
|
+
label: w.label || this.ctx.locale.getText(w.value)
|
|
7751
7903
|
}));
|
|
7752
7904
|
if (a = [...a, ...s], n && (a = await n({ list: a, cell: t, hide: this.hide.bind(this) })), !i || a.length === 0) return;
|
|
7753
7905
|
e.preventDefault();
|
|
7754
7906
|
const { xArr: l, yArr: c } = this.ctx.selector, [d, f] = l, [u, x] = c, { rowIndex: g, colIndex: E } = t;
|
|
7755
|
-
g >= u && g <= x && E >= d && E <= f || this.ctx.emit("setSelectorCell", t, e), this.currentDOMTreeMenu && this.currentDOMTreeMenu.destroy(), this.ctx.contextMenuIng = !0, this.currentDOMTreeMenu = new
|
|
7756
|
-
onClick: (
|
|
7757
|
-
y === "copy" ? (this.ctx.emit("contextMenuCopy"), this.hide()) : y === "paste" ? (this.ctx.emit("contextMenuPaste"), this.hide()) : y === "cut" ? (this.ctx.emit("contextMenuCut"), this.hide()) : y === "clearSelected" ? (this.ctx.emit("contextMenuClearSelected"), this.hide()) :
|
|
7907
|
+
g >= u && g <= x && E >= d && E <= f || this.ctx.emit("setSelectorCell", t, e), this.currentDOMTreeMenu && this.currentDOMTreeMenu.destroy(), this.ctx.contextMenuIng = !0, this.currentDOMTreeMenu = new Jt(this.contextMenuEl, a, {
|
|
7908
|
+
onClick: (w, y) => {
|
|
7909
|
+
y === "copy" ? (this.ctx.emit("contextMenuCopy"), this.hide()) : y === "paste" ? (this.ctx.emit("contextMenuPaste"), this.hide()) : y === "cut" ? (this.ctx.emit("contextMenuCut"), this.hide()) : y === "clearSelected" ? (this.ctx.emit("contextMenuClearSelected"), this.hide()) : w.event && w.event(e, {
|
|
7758
7910
|
hide: this.hide.bind(this),
|
|
7759
7911
|
cell: t
|
|
7760
7912
|
});
|
|
@@ -7775,35 +7927,35 @@ class Ki {
|
|
|
7775
7927
|
}));
|
|
7776
7928
|
if (u = [...u, ...d], n && (u = await n({ list: u, cell: t, hide: this.hide.bind(this) })), !f || u.length === 0) return;
|
|
7777
7929
|
e.preventDefault();
|
|
7778
|
-
const { xArr: x } = this.ctx.selector, [g, E] = x, { colIndex:
|
|
7779
|
-
|
|
7780
|
-
const y = this.ctx.database.getColumns(),
|
|
7930
|
+
const { xArr: x } = this.ctx.selector, [g, E] = x, { colIndex: m } = t;
|
|
7931
|
+
m >= g && m <= E || (this.ctx.focusCellHeader = t, this.ctx.emit("selectCols", t)), this.currentDOMTreeMenu && this.currentDOMTreeMenu.destroy();
|
|
7932
|
+
const y = this.ctx.database.getColumns(), C = u.map((p) => p.value === "visible" ? {
|
|
7781
7933
|
...p,
|
|
7782
7934
|
children: this.filterColumns(y)
|
|
7783
7935
|
} : p);
|
|
7784
|
-
this.ctx.contextMenuIng = !0, this.currentDOMTreeMenu = new
|
|
7785
|
-
onClick: (p,
|
|
7786
|
-
const { xArr:
|
|
7787
|
-
if (
|
|
7788
|
-
const _ = this.ctx.header.allCellHeaders.filter((R) => R.colIndex >=
|
|
7936
|
+
this.ctx.contextMenuIng = !0, this.currentDOMTreeMenu = new Jt(this.contextMenuEl, C, {
|
|
7937
|
+
onClick: (p, b) => {
|
|
7938
|
+
const { xArr: v } = this.ctx.selector, [I, T] = v;
|
|
7939
|
+
if (b === "fixedLeft" || b === "fixedRight" || b === "fixedNone") {
|
|
7940
|
+
const _ = this.ctx.header.allCellHeaders.filter((R) => R.colIndex >= I && R.colIndex <= T).filter((R) => R.level === 0).filter((R) => !R.column.fixedDisabled).map((R) => R.key);
|
|
7789
7941
|
this.ctx.database.setCustomHeaderFixedData(
|
|
7790
7942
|
_,
|
|
7791
|
-
|
|
7943
|
+
b === "fixedLeft" ? "left" : b === "fixedRight" ? "right" : ""
|
|
7792
7944
|
), this.hide();
|
|
7793
|
-
} else if (
|
|
7794
|
-
const _ = this.ctx.header.leafCellHeaders.filter((R) => R.colIndex >=
|
|
7945
|
+
} else if (b === "hide") {
|
|
7946
|
+
const _ = this.ctx.header.leafCellHeaders.filter((R) => R.colIndex >= I && R.colIndex <= T).filter((R) => !R.children.length).filter((R) => !R.column.hideDisabled).map((R) => R.key);
|
|
7795
7947
|
_.length > 0 && this.ctx.database.setCustomHeaderHideData(_, !0), this.hide();
|
|
7796
|
-
} else if (
|
|
7948
|
+
} else if (b !== "visible") if (b.startsWith("visible_")) {
|
|
7797
7949
|
if (!p.key) return;
|
|
7798
7950
|
if (p.children) {
|
|
7799
7951
|
const O = this.getLeafKeys(p.children);
|
|
7800
7952
|
this.ctx.database.setCustomHeaderHideData(O, !1);
|
|
7801
7953
|
} else
|
|
7802
7954
|
this.ctx.database.setCustomHeaderHideData([p.key], !1);
|
|
7803
|
-
this.currentDOMTreeMenu && this.currentDOMTreeMenu.removeSubMenuItem(
|
|
7955
|
+
this.currentDOMTreeMenu && this.currentDOMTreeMenu.removeSubMenuItem(b);
|
|
7804
7956
|
const _ = this.ctx.database.getColumns();
|
|
7805
|
-
|
|
7806
|
-
} else
|
|
7957
|
+
et(_).filter((O) => O.hide).length === 0 && this.hide();
|
|
7958
|
+
} else b === "resetHeader" ? (this.ctx.database.resetCustomHeader(), this.hide()) : p.event && p.event(e, {
|
|
7807
7959
|
hide: this.hide.bind(this),
|
|
7808
7960
|
cell: t
|
|
7809
7961
|
});
|
|
@@ -7827,10 +7979,10 @@ class Ki {
|
|
|
7827
7979
|
}),
|
|
7828
7980
|
contextElement: document.body
|
|
7829
7981
|
};
|
|
7830
|
-
|
|
7831
|
-
|
|
7982
|
+
Tt(e, this.contextMenuEl, () => {
|
|
7983
|
+
gt(e, this.contextMenuEl, {
|
|
7832
7984
|
placement: "right-start",
|
|
7833
|
-
middleware: [
|
|
7985
|
+
middleware: [ut(), xt(), Bt()]
|
|
7834
7986
|
}).then(({ x: i, y: s }) => {
|
|
7835
7987
|
this.contextMenuEl && Object.assign(this.contextMenuEl.style, {
|
|
7836
7988
|
left: `${i}px`,
|
|
@@ -7866,7 +8018,7 @@ class Ki {
|
|
|
7866
8018
|
this.hide(), (t = this.contextMenuEl) == null || t.remove();
|
|
7867
8019
|
}
|
|
7868
8020
|
}
|
|
7869
|
-
class
|
|
8021
|
+
class Pi {
|
|
7870
8022
|
constructor(t) {
|
|
7871
8023
|
r(this, "ctx");
|
|
7872
8024
|
r(this, "loadingEl");
|
|
@@ -7902,7 +8054,7 @@ class Yi {
|
|
|
7902
8054
|
this.loadingEl.remove();
|
|
7903
8055
|
}
|
|
7904
8056
|
}
|
|
7905
|
-
class
|
|
8057
|
+
class zi {
|
|
7906
8058
|
constructor(t) {
|
|
7907
8059
|
r(this, "ctx");
|
|
7908
8060
|
r(this, "container");
|
|
@@ -7976,10 +8128,10 @@ class Fi {
|
|
|
7976
8128
|
t.className = "e-virt-table-finder-bar";
|
|
7977
8129
|
const e = document.createElement("div");
|
|
7978
8130
|
e.className = "e-virt-table-finder-bar-input-wrapper", this.input = document.createElement("input"), this.input.type = "text", this.input.className = "e-virt-table-finder-bar-input", this.input.placeholder = "", e.appendChild(this.input), this.loadingEl = document.createElement("div"), this.loadingEl.className = "e-virt-table-finder-bar-loading";
|
|
7979
|
-
const i =
|
|
8131
|
+
const i = ne;
|
|
7980
8132
|
this.loadingEl.innerHTML = i, e.appendChild(this.loadingEl), this.countEl = document.createElement("span"), this.countEl.className = "e-virt-table-finder-bar-count";
|
|
7981
8133
|
const s = document.createElement("div");
|
|
7982
|
-
return s.className = "e-virt-table-finder-bar-nav", this.prevBtn = document.createElement("button"), this.prevBtn.className = "e-virt-table-finder-bar-nav-btn prev-btn", this.prevBtn.innerHTML =
|
|
8134
|
+
return s.className = "e-virt-table-finder-bar-nav", this.prevBtn = document.createElement("button"), this.prevBtn.className = "e-virt-table-finder-bar-nav-btn prev-btn", this.prevBtn.innerHTML = ct, this.nextBtn = document.createElement("button"), this.nextBtn.className = "e-virt-table-finder-bar-nav-btn next-btn", this.nextBtn.innerHTML = ct, s.appendChild(this.prevBtn), s.appendChild(this.nextBtn), this.closeBtn = document.createElement("button"), this.closeBtn.className = "e-virt-table-finder-bar-nav-btn close-btn", this.closeBtn.innerHTML = "×", t.appendChild(e), t.appendChild(this.countEl), t.appendChild(s), t.appendChild(this.closeBtn), t;
|
|
7983
8135
|
}
|
|
7984
8136
|
bindEvents() {
|
|
7985
8137
|
this.input.addEventListener("input", () => {
|
|
@@ -8061,81 +8213,112 @@ class Fi {
|
|
|
8061
8213
|
this.hide(), this.container.remove();
|
|
8062
8214
|
}
|
|
8063
8215
|
}
|
|
8064
|
-
class
|
|
8216
|
+
const tt = class tt {
|
|
8065
8217
|
constructor(t) {
|
|
8066
8218
|
r(this, "ctx");
|
|
8067
8219
|
r(this, "layouts", /* @__PURE__ */ new Map());
|
|
8068
8220
|
r(this, "activeCellKey", "");
|
|
8069
8221
|
r(this, "selectionStart", null);
|
|
8070
8222
|
r(this, "selectionEnd", null);
|
|
8071
|
-
r(this, "
|
|
8072
|
-
this.ctx = t, this.
|
|
8073
|
-
}
|
|
8074
|
-
|
|
8075
|
-
this.ctx.
|
|
8076
|
-
|
|
8077
|
-
|
|
8078
|
-
|
|
8079
|
-
|
|
8080
|
-
|
|
8081
|
-
if (
|
|
8082
|
-
|
|
8083
|
-
|
|
8084
|
-
}
|
|
8085
|
-
const i = this.getCellLayout(e);
|
|
8086
|
-
if (!i) {
|
|
8087
|
-
this.clearSelection();
|
|
8088
|
-
return;
|
|
8089
|
-
}
|
|
8090
|
-
const { offsetX: s, offsetY: o } = this.ctx.getOffset(t), n = this.hitTestText(i, s, o);
|
|
8091
|
-
if (n === null) {
|
|
8092
|
-
this.clearSelection();
|
|
8093
|
-
return;
|
|
8094
|
-
}
|
|
8095
|
-
this.activeCellKey = this.getCellKey(e), this.selectionStart = n, this.selectionEnd = n, this.dragging = !0, this.ctx.textSelecting = !0, this.ctx.textSelectionStr = this.getSelectedText(), this.ctx.emit("drawView");
|
|
8096
|
-
}), this.ctx.on("mousemove", (t) => {
|
|
8097
|
-
if (!this.ctx.config.ENABLE_TEXT_SELECTION || !this.dragging)
|
|
8098
|
-
return;
|
|
8099
|
-
const e = this.ctx.focusCell;
|
|
8100
|
-
if (!e)
|
|
8101
|
-
return;
|
|
8102
|
-
const i = this.getCellLayout(e);
|
|
8103
|
-
if (!i)
|
|
8104
|
-
return;
|
|
8105
|
-
const { offsetX: s, offsetY: o } = this.ctx.getOffset(t), n = this.hitTestText(i, s, o);
|
|
8106
|
-
n !== null && (this.selectionEnd = n, this.ctx.textSelectionStr = this.getSelectedText(), this.ctx.emit("drawView"));
|
|
8107
|
-
}), this.ctx.on("mouseup", () => {
|
|
8108
|
-
this.dragging = !1, this.ctx.textSelecting = !1, this.ctx.textSelectionStr = this.getSelectedText(), this.ctx.textSelectionStr && this.ctx.emit("drawView");
|
|
8109
|
-
}), this.ctx.on("keydown", (t) => {
|
|
8110
|
-
if (this.ctx.config.ENABLE_TEXT_SELECTION && !(this.ctx.editing || this.ctx.finding) && (t.ctrlKey && t.code === "KeyC" || t.metaKey && t.code === "KeyC")) {
|
|
8111
|
-
const e = this.getSelectedText();
|
|
8112
|
-
if (!e)
|
|
8223
|
+
r(this, "pending", null);
|
|
8224
|
+
this.ctx = t, this.ctx.on("registerTextLayout", (e, i) => this.layouts.set(e, i)), this.ctx.on("mousedown", (e) => this.onMouseDown(e)), this.ctx.on("mousemove", (e) => this.onMouseMove(e)), this.ctx.on("mouseup", () => this.onMouseUp()), this.ctx.on("cellHeaderHoverChange", (e) => this.yieldToColumnDrag(e)), this.ctx.on("cellHoverChange", () => this.yieldToColumnDrag()), this.ctx.on("keydown", (e) => this.onCopyKeydown(e)), this.ctx.on("outsideMousedown", () => this.resetSelection());
|
|
8225
|
+
}
|
|
8226
|
+
get canSelect() {
|
|
8227
|
+
return this.ctx.config.ENABLE_TEXT_SELECTION && !this.ctx.editing && !this.ctx.finding;
|
|
8228
|
+
}
|
|
8229
|
+
/** 跨表头列或从表头拖入 body 时,让位给列/区域选择 */
|
|
8230
|
+
yieldToColumnDrag(t) {
|
|
8231
|
+
const e = this.ctx.focusCellHeader;
|
|
8232
|
+
if (!(!this.ctx.textSelecting || !e)) {
|
|
8233
|
+
if (t) {
|
|
8234
|
+
const i = e.colIndex, s = e.colIndex + e.colspan - 1, o = t.colIndex, n = t.colIndex + t.colspan - 1;
|
|
8235
|
+
if (o >= i && n <= s)
|
|
8113
8236
|
return;
|
|
8114
|
-
t.preventDefault(), navigator.clipboard && navigator.clipboard.writeText(e).catch((i) => console.error("Copy Failure:", i));
|
|
8115
8237
|
}
|
|
8116
|
-
|
|
8117
|
-
|
|
8118
|
-
|
|
8238
|
+
this.resetSelection();
|
|
8239
|
+
}
|
|
8240
|
+
}
|
|
8241
|
+
onMouseDown(t) {
|
|
8242
|
+
if (!this.canSelect || !this.ctx.isTarget(t))
|
|
8243
|
+
return;
|
|
8244
|
+
this.ctx.containerElement.contains(document.activeElement) || this.ctx.containerElement.focus({ preventScroll: !0 });
|
|
8245
|
+
const e = this.hitTest(t);
|
|
8246
|
+
if (!e) {
|
|
8247
|
+
this.resetSelection();
|
|
8248
|
+
return;
|
|
8249
|
+
}
|
|
8250
|
+
const { offsetX: i, offsetY: s } = this.ctx.getOffset(t);
|
|
8251
|
+
this.pending = { cellKey: e.cellKey, index: e.index, startX: i, startY: s };
|
|
8252
|
+
}
|
|
8253
|
+
onMouseMove(t) {
|
|
8254
|
+
if (!this.canSelect || (this.ctx.textSelecting || this.tryStartDrag(t), !this.ctx.textSelecting))
|
|
8255
|
+
return;
|
|
8256
|
+
const e = this.layouts.get(this.activeCellKey);
|
|
8257
|
+
if (!e)
|
|
8258
|
+
return;
|
|
8259
|
+
const { offsetX: i, offsetY: s } = this.ctx.getOffset(t), o = this.hitTestText(e, i, s);
|
|
8260
|
+
o !== null && (this.selectionEnd = o, this.updateSelection());
|
|
8261
|
+
}
|
|
8262
|
+
tryStartDrag(t) {
|
|
8263
|
+
if (!this.pending || !this.ctx.mousedown)
|
|
8264
|
+
return;
|
|
8265
|
+
const { offsetX: e, offsetY: i } = this.ctx.getOffset(t), s = Math.abs(e - this.pending.startX), o = Math.abs(i - this.pending.startY);
|
|
8266
|
+
if (s < tt.DRAG_THRESHOLD && o < tt.DRAG_THRESHOLD)
|
|
8267
|
+
return;
|
|
8268
|
+
const n = this.hitTest(t);
|
|
8269
|
+
if (!n || n.cellKey !== this.pending.cellKey) {
|
|
8270
|
+
this.pending = null;
|
|
8271
|
+
return;
|
|
8272
|
+
}
|
|
8273
|
+
this.activeCellKey = this.pending.cellKey, this.selectionStart = this.pending.index, this.selectionEnd = n.index, this.pending = null, this.ctx.textSelecting = !0, this.updateSelection();
|
|
8274
|
+
}
|
|
8275
|
+
onMouseUp() {
|
|
8276
|
+
this.pending = null, this.ctx.textSelecting = !1, this.ctx.textSelectionStr = this.getSelectedText(), this.ctx.textSelectionStr && this.ctx.emit("drawView");
|
|
8277
|
+
}
|
|
8278
|
+
onCopyKeydown(t) {
|
|
8279
|
+
var i;
|
|
8280
|
+
if (!this.canSelect || !((t.ctrlKey || t.metaKey) && t.code === "KeyC"))
|
|
8281
|
+
return;
|
|
8282
|
+
const e = this.getSelectedText();
|
|
8283
|
+
e && (t.preventDefault(), (i = navigator.clipboard) == null || i.writeText(e).catch((s) => console.error("Copy Failure:", s)));
|
|
8119
8284
|
}
|
|
8120
8285
|
/**
|
|
8121
|
-
*
|
|
8286
|
+
* 命中最顶层文字(固定列/表头后绘制会覆盖普通单元格,取最后一个命中)。
|
|
8122
8287
|
*/
|
|
8288
|
+
hitTest(t) {
|
|
8289
|
+
const { offsetX: e, offsetY: i } = this.ctx.getOffset(t);
|
|
8290
|
+
let s = null;
|
|
8291
|
+
for (const [o, n] of this.layouts) {
|
|
8292
|
+
const a = this.hitTestText(n, e, i);
|
|
8293
|
+
a !== null && (s = { cellKey: o, index: a });
|
|
8294
|
+
}
|
|
8295
|
+
return s;
|
|
8296
|
+
}
|
|
8297
|
+
updateSelection() {
|
|
8298
|
+
this.ctx.textSelectionStr = this.getSelectedText(), this.ctx.emit("drawView");
|
|
8299
|
+
}
|
|
8123
8300
|
hitTestText(t, e, i) {
|
|
8124
|
-
const {
|
|
8125
|
-
if (
|
|
8301
|
+
const { glyphs: s, contentY: o, lineHeight: n, lines: a } = t;
|
|
8302
|
+
if (!s.length)
|
|
8303
|
+
return null;
|
|
8304
|
+
const l = Math.floor((i - o) / n);
|
|
8305
|
+
if (l < 0 || l >= a.length)
|
|
8306
|
+
return null;
|
|
8307
|
+
const c = s.filter((g) => g.line === l);
|
|
8308
|
+
if (!c.length)
|
|
8309
|
+
return null;
|
|
8310
|
+
const d = 2, f = o + l * n;
|
|
8311
|
+
if (i < f - d || i >= f + n + d)
|
|
8312
|
+
return null;
|
|
8313
|
+
const u = c[0], x = c[c.length - 1];
|
|
8314
|
+
if (e < u.x - d || e > x.x + x.width + d)
|
|
8126
8315
|
return null;
|
|
8127
|
-
|
|
8128
|
-
|
|
8129
|
-
|
|
8130
|
-
|
|
8131
|
-
|
|
8132
|
-
|
|
8133
|
-
if (e < x.x + x.width / 2)
|
|
8134
|
-
return x.index;
|
|
8135
|
-
return u[u.length - 1].index + 1;
|
|
8136
|
-
}
|
|
8137
|
-
registerLayout(t, e) {
|
|
8138
|
-
this.layouts.set(t, e);
|
|
8316
|
+
if (e <= u.x)
|
|
8317
|
+
return u.index;
|
|
8318
|
+
for (const g of c)
|
|
8319
|
+
if (e < g.x + g.width / 2)
|
|
8320
|
+
return g.index;
|
|
8321
|
+
return x.index + 1;
|
|
8139
8322
|
}
|
|
8140
8323
|
clearLayouts() {
|
|
8141
8324
|
this.layouts.clear();
|
|
@@ -8143,48 +8326,29 @@ class Wi {
|
|
|
8143
8326
|
draw() {
|
|
8144
8327
|
if (!this.ctx.config.ENABLE_TEXT_SELECTION)
|
|
8145
8328
|
return;
|
|
8146
|
-
const t = this.getSelectionRange();
|
|
8147
|
-
if (!t)
|
|
8148
|
-
return;
|
|
8149
|
-
const e = this.layouts.get(this.activeCellKey);
|
|
8329
|
+
const t = this.getSelectionRange(), e = t && this.layouts.get(this.activeCellKey);
|
|
8150
8330
|
e && this.drawTextSelection(e, t);
|
|
8151
8331
|
}
|
|
8152
|
-
getCanvasCtx() {
|
|
8153
|
-
const t = this.ctx.canvasElement.getContext("2d");
|
|
8154
|
-
if (!t)
|
|
8155
|
-
throw new Error("canvas context not found");
|
|
8156
|
-
return t;
|
|
8157
|
-
}
|
|
8158
|
-
/**
|
|
8159
|
-
* 绘制文字选中高亮
|
|
8160
|
-
*/
|
|
8161
8332
|
drawTextSelection(t, e, i = "#fff", s = "#3b82f6") {
|
|
8162
8333
|
if (e.start >= e.end)
|
|
8163
8334
|
return;
|
|
8164
8335
|
const o = /* @__PURE__ */ new Map();
|
|
8165
|
-
t.glyphs
|
|
8166
|
-
|
|
8167
|
-
|
|
8168
|
-
|
|
8169
|
-
|
|
8336
|
+
for (const a of t.glyphs) {
|
|
8337
|
+
if (a.index < e.start || a.index >= e.end)
|
|
8338
|
+
continue;
|
|
8339
|
+
const l = o.get(a.line) ?? [];
|
|
8340
|
+
l.push(a), o.set(a.line, l);
|
|
8341
|
+
}
|
|
8342
|
+
if (!o.size)
|
|
8343
|
+
return;
|
|
8344
|
+
const n = this.ctx.paint.getCtx();
|
|
8345
|
+
n.save(), n.font = t.font, n.textBaseline = "top", n.textAlign = "left", o.forEach((a) => {
|
|
8170
8346
|
const l = a[0], c = a[a.length - 1];
|
|
8171
|
-
n.fillRect(l.x, l.y, c.x + c.width - l.x, l.height);
|
|
8172
|
-
|
|
8173
|
-
|
|
8174
|
-
(g) => g.sourceIndex >= 0 && g.sourceIndex >= e.start && g.sourceIndex < e.end
|
|
8175
|
-
);
|
|
8176
|
-
if (!l.length)
|
|
8177
|
-
return;
|
|
8178
|
-
const c = l[0], d = a.items.indexOf(c), f = l.map((g) => g.char).join(""), u = a.items.slice(0, d).map((g) => g.char).join(""), x = a.drawX + n.measureText(u).width;
|
|
8179
|
-
n.fillText(f, x, a.drawY);
|
|
8347
|
+
n.fillStyle = s, n.fillRect(l.x, l.y - 1, c.x + c.width - l.x, l.height), n.fillStyle = i;
|
|
8348
|
+
for (const d of a)
|
|
8349
|
+
n.fillText(d.char, d.x, d.y);
|
|
8180
8350
|
}), n.restore();
|
|
8181
8351
|
}
|
|
8182
|
-
getCellKey(t) {
|
|
8183
|
-
return `${t.rowIndex}-${t.colIndex}`;
|
|
8184
|
-
}
|
|
8185
|
-
getCellLayout(t) {
|
|
8186
|
-
return this.layouts.get(this.getCellKey(t));
|
|
8187
|
-
}
|
|
8188
8352
|
getSelectionRange() {
|
|
8189
8353
|
return this.selectionStart === null || this.selectionEnd === null ? null : {
|
|
8190
8354
|
start: Math.min(this.selectionStart, this.selectionEnd),
|
|
@@ -8192,20 +8356,19 @@ class Wi {
|
|
|
8192
8356
|
};
|
|
8193
8357
|
}
|
|
8194
8358
|
getSelectedText() {
|
|
8195
|
-
const t = this.getSelectionRange();
|
|
8196
|
-
|
|
8197
|
-
return "";
|
|
8198
|
-
const e = this.layouts.get(this.activeCellKey);
|
|
8199
|
-
return e ? e.chars.slice(t.start, t.end).join("") : "";
|
|
8359
|
+
const t = this.getSelectionRange(), e = t && this.layouts.get(this.activeCellKey);
|
|
8360
|
+
return !e || t.start >= t.end ? "" : e.chars.slice(t.start, t.end).join("");
|
|
8200
8361
|
}
|
|
8201
|
-
|
|
8202
|
-
this.activeCellKey = "", this.selectionStart = null, this.selectionEnd = null, this.
|
|
8362
|
+
resetSelection() {
|
|
8363
|
+
this.activeCellKey = "", this.selectionStart = null, this.selectionEnd = null, this.pending = null, this.ctx.textSelecting = !1, this.ctx.textSelectionStr = "", this.ctx.emit("drawView");
|
|
8203
8364
|
}
|
|
8204
8365
|
destroy() {
|
|
8205
|
-
this.layouts.clear(), this.
|
|
8366
|
+
this.layouts.clear(), this.resetSelection();
|
|
8206
8367
|
}
|
|
8207
|
-
}
|
|
8208
|
-
|
|
8368
|
+
};
|
|
8369
|
+
r(tt, "DRAG_THRESHOLD", 4);
|
|
8370
|
+
let St = tt;
|
|
8371
|
+
const mt = class mt {
|
|
8209
8372
|
constructor(t, e) {
|
|
8210
8373
|
r(this, "options");
|
|
8211
8374
|
r(this, "scroller");
|
|
@@ -8232,16 +8395,16 @@ const gt = class gt {
|
|
|
8232
8395
|
o,
|
|
8233
8396
|
n
|
|
8234
8397
|
);
|
|
8235
|
-
this.ctx = new
|
|
8398
|
+
this.ctx = new Ue(a, this.options), this.textSelector = new St(this.ctx), this.header = new qe(this.ctx), this.footer = new Qe(this.ctx), this.body = new Je(this.ctx), this.scroller = new Ze(this.ctx), this.selector = new ti(this.ctx), this.autofill = new ei(this.ctx), this.tooltip = new Ki(this.ctx), this.empty = new Fi(this.ctx), this.editor = new Yi(this.ctx), this.overlayer = new Wi(this.ctx), this.contextMenu = new Vi(this.ctx), this.loading = new Pi(this.ctx), this.finderBar = new zi(this.ctx), this.ctx.on("loadData", (l) => {
|
|
8236
8399
|
this.loadData(l);
|
|
8237
|
-
}), this.
|
|
8400
|
+
}), this.ctx.on("draw", () => {
|
|
8238
8401
|
this.draw();
|
|
8239
8402
|
}), this.ctx.on("drawView", () => {
|
|
8240
8403
|
this.draw(!0);
|
|
8241
8404
|
}), this.draw();
|
|
8242
8405
|
}
|
|
8243
8406
|
static useLocale(t) {
|
|
8244
|
-
|
|
8407
|
+
mt.locale = t;
|
|
8245
8408
|
}
|
|
8246
8409
|
createContainer(t, e, i, s, o) {
|
|
8247
8410
|
t.className = "e-virt-table-container";
|
|
@@ -8261,7 +8424,7 @@ const gt = class gt {
|
|
|
8261
8424
|
};
|
|
8262
8425
|
}
|
|
8263
8426
|
doDraw(t = !1) {
|
|
8264
|
-
this.header.update(), this.
|
|
8427
|
+
this.header.update(), this.body.update(), this.footer.update(), this.ctx.paint.clear(), this.textSelector.clearLayouts(), this.body.draw(), this.footer.draw(), this.header.draw(), this.textSelector.draw(), this.body.drawDragRowTip(), this.scroller.draw(), this.empty.draw(), this.loading.draw(), t || this.overlayer.draw();
|
|
8265
8428
|
}
|
|
8266
8429
|
draw(t = !1) {
|
|
8267
8430
|
this.animationFrameId && cancelAnimationFrame(this.animationFrameId), this.animationFrameId = requestAnimationFrame(() => {
|
|
@@ -8329,6 +8492,16 @@ const gt = class gt {
|
|
|
8329
8492
|
doLayout() {
|
|
8330
8493
|
this.ctx.emit("draw");
|
|
8331
8494
|
}
|
|
8495
|
+
/**
|
|
8496
|
+
* 设置内容缩放比例(容器大小不变,内容变大/变小,基于原生分辨率重绘不失清晰度)
|
|
8497
|
+
* @param zoom 缩放比例,范围 MIN_ZOOM ~ MAX_ZOOM
|
|
8498
|
+
*/
|
|
8499
|
+
setZoom(t) {
|
|
8500
|
+
this.ctx.setZoom(t);
|
|
8501
|
+
}
|
|
8502
|
+
getZoom() {
|
|
8503
|
+
return this.ctx.getZoom();
|
|
8504
|
+
}
|
|
8332
8505
|
getChangedData() {
|
|
8333
8506
|
return this.ctx.database.getChangedData();
|
|
8334
8507
|
}
|
|
@@ -8503,10 +8676,10 @@ const gt = class gt {
|
|
|
8503
8676
|
}
|
|
8504
8677
|
getUtils() {
|
|
8505
8678
|
return {
|
|
8506
|
-
mergeColCell:
|
|
8507
|
-
mergeRowCell:
|
|
8508
|
-
getSpanArrByRow:
|
|
8509
|
-
getSpanObjByColumn:
|
|
8679
|
+
mergeColCell: _e,
|
|
8680
|
+
mergeRowCell: Ie,
|
|
8681
|
+
getSpanArrByRow: ee,
|
|
8682
|
+
getSpanObjByColumn: ie
|
|
8510
8683
|
};
|
|
8511
8684
|
}
|
|
8512
8685
|
getColumnByKey(t) {
|
|
@@ -8529,9 +8702,9 @@ const gt = class gt {
|
|
|
8529
8702
|
this.overlayer.destroy(), this.empty.destroy(), this.editor.destroy(), this.tooltip.destroy(), this.selector.destroy(), this.autofill.destroy(), this.contextMenu.destroy(), this.loading.destroy(), this.finderBar.destroy(), this.textSelector.destroy(), this.ctx.destroy(), this.ctx.containerElement.remove();
|
|
8530
8703
|
}
|
|
8531
8704
|
};
|
|
8532
|
-
r(
|
|
8533
|
-
let
|
|
8705
|
+
r(mt, "locale");
|
|
8706
|
+
let Ot = mt;
|
|
8534
8707
|
export {
|
|
8535
|
-
|
|
8708
|
+
Ot as default
|
|
8536
8709
|
};
|
|
8537
8710
|
//# sourceMappingURL=index.es.js.map
|