e-virt-table 1.4.1 → 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 +1003 -833
- 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/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 +12 -2
- package/dist/lib/EVirtTable.js.map +1 -1
- package/dist/lib/Editor.js +21 -18
- 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 +1 -1
- package/dist/lib/Paint.js +3 -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/TextSelector.d.ts +13 -16
- package/dist/lib/TextSelector.js +150 -119
- 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
|
}
|
|
@@ -1043,45 +1043,45 @@ class ie extends ee {
|
|
|
1043
1043
|
drawBorder(e) {
|
|
1044
1044
|
const { drawX: i, drawY: s, rowIndex: o, colIndex: n, height: a, width: l } = this;
|
|
1045
1045
|
let c = i, d = s;
|
|
1046
|
-
const { xArr: f, yArr: u, lineDash: x = [], borderWidth: g = 1, borderColor: E, fillColor:
|
|
1047
|
-
if (n >=
|
|
1048
|
-
const
|
|
1049
|
-
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], {
|
|
1050
1050
|
borderColor: E,
|
|
1051
|
-
fillColor:
|
|
1051
|
+
fillColor: m,
|
|
1052
1052
|
borderWidth: g,
|
|
1053
1053
|
lineCap: "round",
|
|
1054
1054
|
lineJoin: "round",
|
|
1055
1055
|
lineDash: x
|
|
1056
1056
|
});
|
|
1057
1057
|
}
|
|
1058
|
-
if (n === y && o >=
|
|
1059
|
-
const
|
|
1060
|
-
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], {
|
|
1061
1061
|
borderColor: E,
|
|
1062
|
-
fillColor:
|
|
1062
|
+
fillColor: m,
|
|
1063
1063
|
borderWidth: g,
|
|
1064
1064
|
lineCap: "round",
|
|
1065
1065
|
lineJoin: "round",
|
|
1066
1066
|
lineDash: x
|
|
1067
1067
|
});
|
|
1068
1068
|
}
|
|
1069
|
-
if (n >=
|
|
1070
|
-
const
|
|
1071
|
-
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], {
|
|
1072
1072
|
borderColor: E,
|
|
1073
|
-
fillColor:
|
|
1073
|
+
fillColor: m,
|
|
1074
1074
|
borderWidth: g,
|
|
1075
1075
|
lineCap: "round",
|
|
1076
1076
|
lineJoin: "round",
|
|
1077
1077
|
lineDash: x
|
|
1078
1078
|
});
|
|
1079
1079
|
}
|
|
1080
|
-
if (n ===
|
|
1081
|
-
const
|
|
1082
|
-
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], {
|
|
1083
1083
|
borderColor: E,
|
|
1084
|
-
fillColor:
|
|
1084
|
+
fillColor: m,
|
|
1085
1085
|
borderWidth: g,
|
|
1086
1086
|
lineCap: "round",
|
|
1087
1087
|
lineJoin: "round",
|
|
@@ -1090,7 +1090,7 @@ class ie extends ee {
|
|
|
1090
1090
|
}
|
|
1091
1091
|
}
|
|
1092
1092
|
}
|
|
1093
|
-
class
|
|
1093
|
+
class Le {
|
|
1094
1094
|
constructor(t, e) {
|
|
1095
1095
|
r(this, "ctx");
|
|
1096
1096
|
r(this, "data");
|
|
@@ -1136,7 +1136,7 @@ class Se {
|
|
|
1136
1136
|
// 初始化默认不忽略清空改变值和校验map
|
|
1137
1137
|
init(t = !0) {
|
|
1138
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();
|
|
1139
|
-
const e = this.getColumns(), i =
|
|
1139
|
+
const e = this.getColumns(), i = et(e);
|
|
1140
1140
|
if (this.ctx.hasSelection = i.some((s) => s.type === "selection"), this.ctx.hasTree = i.some((s) => {
|
|
1141
1141
|
var o;
|
|
1142
1142
|
return (o = s.type) == null ? void 0 : o.includes("tree");
|
|
@@ -1168,35 +1168,35 @@ class Se {
|
|
|
1168
1168
|
TREE_CHILDREN_KEY: d
|
|
1169
1169
|
} = this.ctx.config;
|
|
1170
1170
|
t.forEach((f, u) => {
|
|
1171
|
-
var
|
|
1171
|
+
var C;
|
|
1172
1172
|
d !== "children" && (f.children = f[d]);
|
|
1173
|
-
const x = f[o], g = x ??
|
|
1173
|
+
const x = f[o], g = x ?? Qt();
|
|
1174
1174
|
this.itemRowKeyMap.set(f, g);
|
|
1175
|
-
const E = f._height || a,
|
|
1176
|
-
let
|
|
1177
|
-
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) {
|
|
1178
1178
|
const p = f[c];
|
|
1179
1179
|
if (this.checkboxKeyMap.has(p)) {
|
|
1180
|
-
const
|
|
1181
|
-
|
|
1180
|
+
const b = this.checkboxKeyMap.get(p) || [];
|
|
1181
|
+
b.push(g), this.checkboxKeyMap.set(p, b);
|
|
1182
1182
|
} else
|
|
1183
1183
|
this.checkboxKeyMap.set(p, [g]);
|
|
1184
1184
|
}
|
|
1185
1185
|
this.selectionMap.set(g, {
|
|
1186
1186
|
key: c ? f[c] : g,
|
|
1187
1187
|
row: f,
|
|
1188
|
-
check: ((
|
|
1188
|
+
check: ((C = this.selectionMap.get(g)) == null ? void 0 : C.check) || !1
|
|
1189
1189
|
});
|
|
1190
1190
|
const y = n || this.expandMap.get(g) || f._expand || !1;
|
|
1191
1191
|
this.expandMap.set(g, y), this.rowKeyMap.set(g, {
|
|
1192
|
-
readonly:
|
|
1192
|
+
readonly: m,
|
|
1193
1193
|
index: u,
|
|
1194
1194
|
rowIndex: u,
|
|
1195
1195
|
level: e,
|
|
1196
1196
|
height: E,
|
|
1197
1197
|
calculatedHeight: -1,
|
|
1198
1198
|
check: !1,
|
|
1199
|
-
selectable:
|
|
1199
|
+
selectable: w,
|
|
1200
1200
|
expand: y,
|
|
1201
1201
|
expandLazy: !1,
|
|
1202
1202
|
hasChildren: f._hasChildren || (Array.isArray(f.children) ? f.children.length > 0 : !1),
|
|
@@ -1255,16 +1255,16 @@ class Se {
|
|
|
1255
1255
|
}
|
|
1256
1256
|
generateColumns(t) {
|
|
1257
1257
|
const e = (i) => i.map((s) => {
|
|
1258
|
-
var c, d, f, u, x, g, E,
|
|
1258
|
+
var c, d, f, u, x, g, E, m;
|
|
1259
1259
|
const o = s.children && Array.isArray(s.children) ? e(s.children) : void 0, n = {
|
|
1260
1260
|
hide: (d = (c = this.customHeader) == null ? void 0 : c.hideData) == null ? void 0 : d[s.key],
|
|
1261
1261
|
fixed: (u = (f = this.customHeader) == null ? void 0 : f.fixedData) == null ? void 0 : u[s.key],
|
|
1262
1262
|
sort: (g = (x = this.customHeader) == null ? void 0 : x.sortData) == null ? void 0 : g[s.key],
|
|
1263
|
-
width: (
|
|
1263
|
+
width: (m = (E = this.customHeader) == null ? void 0 : E.resizableData) == null ? void 0 : m[s.key]
|
|
1264
1264
|
}, a = {};
|
|
1265
|
-
for (const [
|
|
1266
|
-
y !== void 0 && (a[
|
|
1267
|
-
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);
|
|
1268
1268
|
return {
|
|
1269
1269
|
...s,
|
|
1270
1270
|
children: o,
|
|
@@ -1395,7 +1395,7 @@ class Se {
|
|
|
1395
1395
|
} else if (s === "string") {
|
|
1396
1396
|
const d = String(a || ""), f = String(l || "");
|
|
1397
1397
|
c = d.localeCompare(f);
|
|
1398
|
-
} else s === "date" && (c =
|
|
1398
|
+
} else s === "date" && (c = Se(a, l));
|
|
1399
1399
|
return i === "asc" ? c : -c;
|
|
1400
1400
|
});
|
|
1401
1401
|
}
|
|
@@ -1510,67 +1510,67 @@ class Se {
|
|
|
1510
1510
|
const a = /* @__PURE__ */ new Map(), l = [];
|
|
1511
1511
|
let c = [];
|
|
1512
1512
|
for (const g of t) {
|
|
1513
|
-
const { rowKey: E, key:
|
|
1514
|
-
let
|
|
1515
|
-
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 = {
|
|
1516
1516
|
...g,
|
|
1517
|
-
oldValue:
|
|
1517
|
+
oldValue: C,
|
|
1518
1518
|
row: y
|
|
1519
1519
|
};
|
|
1520
1520
|
if ((p == null ? void 0 : p.type) === "number")
|
|
1521
|
-
if (["", void 0, null].includes(
|
|
1522
|
-
|
|
1523
|
-
else if (/^-?\d+(\.\d+)?$/.test(String(
|
|
1524
|
-
const
|
|
1525
|
-
if (typeof p.precision == "number" && p.precision >= 0 &&
|
|
1526
|
-
const
|
|
1527
|
-
|
|
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;
|
|
1528
1528
|
const T = this.ctx.locale.getText("numberTruncated", { precision: p.precision });
|
|
1529
1529
|
l.push({
|
|
1530
|
-
...
|
|
1530
|
+
...b,
|
|
1531
1531
|
column: p == null ? void 0 : p.column,
|
|
1532
1532
|
code: "ERR_NUMBER_PRECISION",
|
|
1533
1533
|
message: T
|
|
1534
1534
|
});
|
|
1535
|
-
} else if (typeof p.min == "number" && Number(
|
|
1536
|
-
const
|
|
1537
|
-
|
|
1538
|
-
...
|
|
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,
|
|
1539
1539
|
column: p == null ? void 0 : p.column,
|
|
1540
1540
|
code: "ERR_NUMBER_MIN",
|
|
1541
|
-
message:
|
|
1541
|
+
message: I
|
|
1542
1542
|
});
|
|
1543
|
-
} else if (typeof p.max == "number" && Number(
|
|
1544
|
-
const
|
|
1545
|
-
|
|
1546
|
-
...
|
|
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,
|
|
1547
1547
|
column: p == null ? void 0 : p.column,
|
|
1548
1548
|
code: "ERR_NUMBER_MAX",
|
|
1549
|
-
message:
|
|
1549
|
+
message: I
|
|
1550
1550
|
});
|
|
1551
1551
|
} else
|
|
1552
|
-
|
|
1552
|
+
w = Number(w);
|
|
1553
1553
|
} else
|
|
1554
|
-
|
|
1555
|
-
...
|
|
1554
|
+
w = C, l.push({
|
|
1555
|
+
...b,
|
|
1556
1556
|
column: p == null ? void 0 : p.column,
|
|
1557
1557
|
code: "ERR_INVALID_NUMBER",
|
|
1558
1558
|
message: this.ctx.locale.getText("invalidNumber")
|
|
1559
1559
|
});
|
|
1560
|
-
else if ((p == null ? void 0 : p.editorType) === "text" && typeof p.maxlength == "number" && String(
|
|
1561
|
-
|
|
1562
|
-
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 });
|
|
1563
1563
|
l.push({
|
|
1564
|
-
...
|
|
1564
|
+
...b,
|
|
1565
1565
|
column: p == null ? void 0 : p.column,
|
|
1566
1566
|
code: "ERR_STRING_MAXLENGTH",
|
|
1567
|
-
message:
|
|
1567
|
+
message: v
|
|
1568
1568
|
});
|
|
1569
1569
|
}
|
|
1570
|
-
|
|
1570
|
+
w !== C && c.push({
|
|
1571
1571
|
...g,
|
|
1572
|
-
value:
|
|
1573
|
-
oldValue:
|
|
1572
|
+
value: w,
|
|
1573
|
+
oldValue: C,
|
|
1574
1574
|
row: y
|
|
1575
1575
|
});
|
|
1576
1576
|
}
|
|
@@ -1589,11 +1589,11 @@ class Se {
|
|
|
1589
1589
|
const f = [];
|
|
1590
1590
|
c.forEach((g) => {
|
|
1591
1591
|
f.push(this.getValidator(g.rowKey, g.key));
|
|
1592
|
-
const { value: E, rowKey:
|
|
1593
|
-
a.set(
|
|
1594
|
-
rowKey:
|
|
1595
|
-
key:
|
|
1596
|
-
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,
|
|
1597
1597
|
newValue: E
|
|
1598
1598
|
});
|
|
1599
1599
|
});
|
|
@@ -1775,22 +1775,22 @@ class Se {
|
|
|
1775
1775
|
return { checked: s, indeterminate: !1 };
|
|
1776
1776
|
let n = !1, a = s;
|
|
1777
1777
|
if (this.ctx.config.TREE_SELECT_MODE === "auto") {
|
|
1778
|
-
const c = (
|
|
1779
|
-
const
|
|
1778
|
+
const c = (m) => {
|
|
1779
|
+
const w = this.getTreeChildren(m);
|
|
1780
1780
|
let y = [];
|
|
1781
|
-
for (const
|
|
1782
|
-
y.push(
|
|
1781
|
+
for (const C of w)
|
|
1782
|
+
y.push(C), y.push(...c(C));
|
|
1783
1783
|
return y;
|
|
1784
|
-
}, 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;
|
|
1785
1785
|
n = g && !(u === x), a = s || g, s && x > 0 && u === 0 && (a = !1, n = !1);
|
|
1786
1786
|
} else if (this.ctx.config.TREE_SELECT_MODE === "cautious") {
|
|
1787
|
-
const c = (
|
|
1788
|
-
const
|
|
1787
|
+
const c = (m) => {
|
|
1788
|
+
const w = this.getTreeChildren(m);
|
|
1789
1789
|
let y = [];
|
|
1790
|
-
for (const
|
|
1791
|
-
y.push(
|
|
1790
|
+
for (const C of w)
|
|
1791
|
+
y.push(C), y.push(...c(C));
|
|
1792
1792
|
return y;
|
|
1793
|
-
}, 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;
|
|
1794
1794
|
n = g && !E, a = s || E, s && x > 0 && u === 0 && (a = !1, n = !1);
|
|
1795
1795
|
} else this.ctx.config.TREE_SELECT_MODE === "strictly" && (n = !1, a = s);
|
|
1796
1796
|
return { checked: a, indeterminate: n };
|
|
@@ -2052,7 +2052,7 @@ class Se {
|
|
|
2052
2052
|
value: this.getItemValue(t, e),
|
|
2053
2053
|
field: e,
|
|
2054
2054
|
fieldValue: this.getItemValue(t, e)
|
|
2055
|
-
}, u = new
|
|
2055
|
+
}, u = new ye(c).validate(d);
|
|
2056
2056
|
this.setValidationError(t, e, u), s(u);
|
|
2057
2057
|
} else
|
|
2058
2058
|
this.clearValidationError(t, e), s([]);
|
|
@@ -2102,7 +2102,7 @@ class Se {
|
|
|
2102
2102
|
}
|
|
2103
2103
|
]
|
|
2104
2104
|
};
|
|
2105
|
-
let
|
|
2105
|
+
let m = e, w = e, y = a, C = a, p = [], b = 0, v = 0, I = 0, T = 0;
|
|
2106
2106
|
if (d !== 1 && g) {
|
|
2107
2107
|
T = u;
|
|
2108
2108
|
const _ = l.reduce((R, S) => {
|
|
@@ -2115,7 +2115,7 @@ class Se {
|
|
|
2115
2115
|
return `${M}${H}`;
|
|
2116
2116
|
}, "");
|
|
2117
2117
|
if (_ === O)
|
|
2118
|
-
|
|
2118
|
+
m = R;
|
|
2119
2119
|
else
|
|
2120
2120
|
break;
|
|
2121
2121
|
}
|
|
@@ -2125,17 +2125,17 @@ class Se {
|
|
|
2125
2125
|
return `${M}${H}`;
|
|
2126
2126
|
}, "");
|
|
2127
2127
|
if (_ === O)
|
|
2128
|
-
|
|
2128
|
+
w = R;
|
|
2129
2129
|
else
|
|
2130
2130
|
break;
|
|
2131
2131
|
}
|
|
2132
|
-
for (let R =
|
|
2132
|
+
for (let R = m; R < e; R++) {
|
|
2133
2133
|
const { height: S } = this.positions[R];
|
|
2134
|
-
|
|
2134
|
+
b += S;
|
|
2135
2135
|
}
|
|
2136
|
-
for (let R =
|
|
2136
|
+
for (let R = m; R <= w; R++) {
|
|
2137
2137
|
const { height: S } = this.positions[R];
|
|
2138
|
-
|
|
2138
|
+
I += S;
|
|
2139
2139
|
const O = this.rowIndexRowKeyMap.get(R) || "", { item: M } = this.rowKeyMap.get(O), L = this.getItemValue(O, i);
|
|
2140
2140
|
p.push({
|
|
2141
2141
|
rowKey: O,
|
|
@@ -2146,7 +2146,7 @@ class Se {
|
|
|
2146
2146
|
}
|
|
2147
2147
|
}
|
|
2148
2148
|
if (x !== 1 && E) {
|
|
2149
|
-
|
|
2149
|
+
I = f;
|
|
2150
2150
|
for (let _ = a - 1; _ >= 0; _--) {
|
|
2151
2151
|
const R = this.getColumnByColIndex(_);
|
|
2152
2152
|
if (!R)
|
|
@@ -2163,7 +2163,7 @@ class Se {
|
|
|
2163
2163
|
break;
|
|
2164
2164
|
const S = this.getItemValue(s, i), O = this.getItemValue(s, R.key);
|
|
2165
2165
|
if (S === O && c.includes(R.key))
|
|
2166
|
-
|
|
2166
|
+
C = _;
|
|
2167
2167
|
else
|
|
2168
2168
|
break;
|
|
2169
2169
|
}
|
|
@@ -2171,9 +2171,9 @@ class Se {
|
|
|
2171
2171
|
const R = this.getColumnByColIndex(_);
|
|
2172
2172
|
if (!R)
|
|
2173
2173
|
break;
|
|
2174
|
-
|
|
2174
|
+
v += R.width || 100;
|
|
2175
2175
|
}
|
|
2176
|
-
for (let _ = y; _ <=
|
|
2176
|
+
for (let _ = y; _ <= C; _++) {
|
|
2177
2177
|
const R = this.getColumnByColIndex(_);
|
|
2178
2178
|
if (!R)
|
|
2179
2179
|
break;
|
|
@@ -2186,14 +2186,14 @@ class Se {
|
|
|
2186
2186
|
}
|
|
2187
2187
|
}
|
|
2188
2188
|
return {
|
|
2189
|
-
xArr: [y,
|
|
2190
|
-
yArr: [
|
|
2189
|
+
xArr: [y, C],
|
|
2190
|
+
yArr: [m, w],
|
|
2191
2191
|
rowspan: d,
|
|
2192
2192
|
colspan: x,
|
|
2193
|
-
height:
|
|
2193
|
+
height: I,
|
|
2194
2194
|
width: T,
|
|
2195
|
-
offsetTop:
|
|
2196
|
-
offsetLeft:
|
|
2195
|
+
offsetTop: b,
|
|
2196
|
+
offsetLeft: v,
|
|
2197
2197
|
dataList: p
|
|
2198
2198
|
};
|
|
2199
2199
|
}
|
|
@@ -2232,7 +2232,7 @@ class Se {
|
|
|
2232
2232
|
// 获取虚拟单元格,只针对可见的
|
|
2233
2233
|
getVirtualBodyCell(t, e, i = !0) {
|
|
2234
2234
|
const s = this.getColumnByColIndex(e), o = this.getRowForRowIndex(t);
|
|
2235
|
-
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);
|
|
2236
2236
|
}
|
|
2237
2237
|
getVirtualBodyCellByKey(t, e) {
|
|
2238
2238
|
const i = this.getRowIndexForRowKey(t), s = this.getColIndexForKey(e);
|
|
@@ -2342,7 +2342,7 @@ class Se {
|
|
|
2342
2342
|
this.changedDataMap.clear();
|
|
2343
2343
|
}
|
|
2344
2344
|
}
|
|
2345
|
-
class
|
|
2345
|
+
class Me {
|
|
2346
2346
|
constructor(t) {
|
|
2347
2347
|
r(this, "ctx");
|
|
2348
2348
|
r(this, "history", []);
|
|
@@ -2397,7 +2397,7 @@ class Oe {
|
|
|
2397
2397
|
this.history = [], this.historyIndex = -1;
|
|
2398
2398
|
}
|
|
2399
2399
|
}
|
|
2400
|
-
class
|
|
2400
|
+
class Ae {
|
|
2401
2401
|
constructor(t) {
|
|
2402
2402
|
r(this, "eventTasks", /* @__PURE__ */ new Set());
|
|
2403
2403
|
r(this, "ctx");
|
|
@@ -2427,7 +2427,7 @@ class Le {
|
|
|
2427
2427
|
this.clearDomSelection(), t.button === 0 && (this.ctx.mousedown = !0), this.ctx.emit("mousedown", t);
|
|
2428
2428
|
}
|
|
2429
2429
|
handleMousemove(t) {
|
|
2430
|
-
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);
|
|
2431
2431
|
this.ctx.mouseX = s, this.ctx.mouseY = o, this.ctx.emit("mousemove", t);
|
|
2432
2432
|
}
|
|
2433
2433
|
handleMouseUp(t) {
|
|
@@ -2441,6 +2441,13 @@ class Le {
|
|
|
2441
2441
|
e && this.ctx.isTarget(t) && (this.ctx.dragHeaderIng || this.ctx.emit("keydown", t));
|
|
2442
2442
|
}
|
|
2443
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
|
+
}
|
|
2444
2451
|
this.ctx.emit("wheel", t);
|
|
2445
2452
|
}
|
|
2446
2453
|
handleTouchstart(t) {
|
|
@@ -2479,7 +2486,7 @@ class Le {
|
|
|
2479
2486
|
}
|
|
2480
2487
|
}
|
|
2481
2488
|
}
|
|
2482
|
-
class
|
|
2489
|
+
class He {
|
|
2483
2490
|
constructor() {
|
|
2484
2491
|
r(this, "events", /* @__PURE__ */ new Map());
|
|
2485
2492
|
}
|
|
@@ -2517,7 +2524,7 @@ class Me {
|
|
|
2517
2524
|
this.events.clear();
|
|
2518
2525
|
}
|
|
2519
2526
|
}
|
|
2520
|
-
class
|
|
2527
|
+
class De {
|
|
2521
2528
|
constructor(t) {
|
|
2522
2529
|
r(this, "ctx");
|
|
2523
2530
|
r(this, "textCacheMap", /* @__PURE__ */ new Map());
|
|
@@ -2531,8 +2538,8 @@ class Ae {
|
|
|
2531
2538
|
clearTextCache() {
|
|
2532
2539
|
this.textCacheMap.clear();
|
|
2533
2540
|
}
|
|
2534
|
-
scale(t) {
|
|
2535
|
-
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);
|
|
2536
2543
|
}
|
|
2537
2544
|
save() {
|
|
2538
2545
|
this.ctx.save();
|
|
@@ -2616,7 +2623,7 @@ class Ae {
|
|
|
2616
2623
|
* @returns 是否溢出
|
|
2617
2624
|
*/
|
|
2618
2625
|
drawText(t = "", e, i, s, o, n = {}) {
|
|
2619
|
-
var
|
|
2626
|
+
var C, p, b;
|
|
2620
2627
|
this.ctx.save();
|
|
2621
2628
|
const {
|
|
2622
2629
|
font: a = "12px Arial",
|
|
@@ -2631,7 +2638,7 @@ class Ae {
|
|
|
2631
2638
|
} = n;
|
|
2632
2639
|
if (this.ctx.font = a, this.ctx.fillStyle = c, ["", null, void 0].includes(t))
|
|
2633
2640
|
return this.ctx.restore(), !1;
|
|
2634
|
-
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, {
|
|
2635
2642
|
font: a,
|
|
2636
2643
|
color: c,
|
|
2637
2644
|
align: l,
|
|
@@ -2639,25 +2646,25 @@ class Ae {
|
|
|
2639
2646
|
verticalAlign: f,
|
|
2640
2647
|
maxLineClamp: u,
|
|
2641
2648
|
autoRowHeight: x,
|
|
2642
|
-
lineHeight:
|
|
2649
|
+
lineHeight: w,
|
|
2643
2650
|
offsetLeft: g,
|
|
2644
2651
|
offsetRight: E
|
|
2645
2652
|
});
|
|
2646
|
-
if (this.ctx.textBaseline = "top", this.ctx.textAlign = "left", y.lines.forEach((
|
|
2647
|
-
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);
|
|
2648
2655
|
}), n.textCallback && y.lines.length) {
|
|
2649
|
-
const
|
|
2650
|
-
let T = ((p = y.lines[0]) == null ? void 0 : p.drawX) ?? e + d + g, _ = T +
|
|
2651
|
-
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);
|
|
2652
2659
|
const R = {
|
|
2653
|
-
x: ((
|
|
2660
|
+
x: ((b = y.lines[0]) == null ? void 0 : b.drawX) ?? T,
|
|
2654
2661
|
y: y.contentY,
|
|
2655
|
-
width:
|
|
2656
|
-
height: y.lines.length *
|
|
2662
|
+
width: I,
|
|
2663
|
+
height: y.lines.length * w,
|
|
2657
2664
|
left: T,
|
|
2658
2665
|
right: _,
|
|
2659
2666
|
top: y.contentY,
|
|
2660
|
-
bottom: y.contentY + y.lines.length *
|
|
2667
|
+
bottom: y.contentY + y.lines.length * w
|
|
2661
2668
|
};
|
|
2662
2669
|
n.textCallback(R);
|
|
2663
2670
|
}
|
|
@@ -2674,22 +2681,22 @@ class Ae {
|
|
|
2674
2681
|
autoRowHeight: x,
|
|
2675
2682
|
lineHeight: g,
|
|
2676
2683
|
offsetLeft: E,
|
|
2677
|
-
offsetRight:
|
|
2684
|
+
offsetRight: m
|
|
2678
2685
|
} = n;
|
|
2679
2686
|
this.ctx.save(), this.ctx.font = a;
|
|
2680
|
-
const
|
|
2681
|
-
let
|
|
2682
|
-
const
|
|
2683
|
-
let
|
|
2684
|
-
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));
|
|
2685
2692
|
let T = !1;
|
|
2686
|
-
const _ =
|
|
2687
|
-
if (
|
|
2693
|
+
const _ = b.slice(0, I);
|
|
2694
|
+
if (b.length > I) {
|
|
2688
2695
|
T = !0;
|
|
2689
|
-
const M =
|
|
2690
|
-
L.lineIndex =
|
|
2691
|
-
} else if (
|
|
2692
|
-
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);
|
|
2693
2700
|
if (D) {
|
|
2694
2701
|
T = !0;
|
|
2695
2702
|
const A = this.buildEllipsisLine(L, s, d);
|
|
@@ -2702,9 +2709,9 @@ class Ae {
|
|
|
2702
2709
|
const O = [];
|
|
2703
2710
|
return _.forEach((M, L) => {
|
|
2704
2711
|
M.lineIndex = L;
|
|
2705
|
-
const H = this.buildLineSegments(M), D = H.reduce((N,
|
|
2712
|
+
const H = this.buildLineSegments(M), D = H.reduce((N, Ct) => N + Ct.width, 0);
|
|
2706
2713
|
let A = e + d + E;
|
|
2707
|
-
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);
|
|
2708
2715
|
const k = S + L * g;
|
|
2709
2716
|
M.drawX = A, M.drawY = k, M.width = D, M.segments = H, H.forEach((N) => {
|
|
2710
2717
|
N.sourceIndex < 0 || O.push({
|
|
@@ -2723,7 +2730,7 @@ class Ae {
|
|
|
2723
2730
|
glyphs: O,
|
|
2724
2731
|
lines: _,
|
|
2725
2732
|
box: { x: e, y: i, width: s, height: o },
|
|
2726
|
-
contentBox: { x: e + d + E, y: i + d, width: y, height:
|
|
2733
|
+
contentBox: { x: e + d + E, y: i + d, width: y, height: C },
|
|
2727
2734
|
contentY: S,
|
|
2728
2735
|
lineHeight: g,
|
|
2729
2736
|
font: a,
|
|
@@ -2884,7 +2891,7 @@ class Ae {
|
|
|
2884
2891
|
};
|
|
2885
2892
|
}
|
|
2886
2893
|
}
|
|
2887
|
-
class
|
|
2894
|
+
class Ft {
|
|
2888
2895
|
constructor(t) {
|
|
2889
2896
|
r(this, "_config", {});
|
|
2890
2897
|
/** CSS 类名前缀 */
|
|
@@ -2979,6 +2986,12 @@ class Kt {
|
|
|
2979
2986
|
r(this, "CELL_HOVER_ICON_BG_COLOR", "#fff");
|
|
2980
2987
|
/** hover编辑图标边框颜色 */
|
|
2981
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);
|
|
2982
2995
|
/** 滚动条轨道尺寸 */
|
|
2983
2996
|
r(this, "SCROLLER_TRACK_SIZE", 14);
|
|
2984
2997
|
/** 滚动条滑块尺寸 */
|
|
@@ -3252,24 +3265,24 @@ class Kt {
|
|
|
3252
3265
|
let t = {};
|
|
3253
3266
|
Object.keys(this).forEach((e) => {
|
|
3254
3267
|
if (e.endsWith("_COLOR") || e.endsWith("_FONT")) {
|
|
3255
|
-
const i = `--evt-${e.toLocaleLowerCase().replace(/_/g, "-")}`, s =
|
|
3268
|
+
const i = `--evt-${e.toLocaleLowerCase().replace(/_/g, "-")}`, s = Te(i);
|
|
3256
3269
|
s && (t[e] = s);
|
|
3257
3270
|
}
|
|
3258
3271
|
}), Object.assign(this, t, this._config);
|
|
3259
3272
|
}
|
|
3260
3273
|
}
|
|
3261
|
-
const
|
|
3262
|
-
`,
|
|
3263
|
-
`,
|
|
3264
|
-
`,
|
|
3265
|
-
`,
|
|
3266
|
-
`,
|
|
3267
|
-
`,
|
|
3268
|
-
`,
|
|
3269
|
-
`,
|
|
3270
|
-
`,
|
|
3271
|
-
`,
|
|
3272
|
-
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 {
|
|
3273
3286
|
constructor(t) {
|
|
3274
3287
|
r(this, "ctx");
|
|
3275
3288
|
r(this, "list", [
|
|
@@ -3277,95 +3290,95 @@ class Ye {
|
|
|
3277
3290
|
name: "loading",
|
|
3278
3291
|
configName: "LOADING_ICON_SVG",
|
|
3279
3292
|
configColorName: "LOADING_ICON_COLOR",
|
|
3280
|
-
svg:
|
|
3293
|
+
svg: ne,
|
|
3281
3294
|
color: "#4E5969"
|
|
3282
3295
|
},
|
|
3283
3296
|
{
|
|
3284
3297
|
name: "expand",
|
|
3285
3298
|
configName: "EXPAND_ICON_SVG",
|
|
3286
3299
|
configColorName: "EXPAND_ICON_COLOR",
|
|
3287
|
-
svg:
|
|
3300
|
+
svg: ct,
|
|
3288
3301
|
color: "#4E5969"
|
|
3289
3302
|
},
|
|
3290
3303
|
{
|
|
3291
3304
|
name: "shrink",
|
|
3292
3305
|
configName: "SHRINK_ICON_SVG",
|
|
3293
3306
|
configColorName: "SHRINK_ICON_COLOR",
|
|
3294
|
-
svg:
|
|
3307
|
+
svg: Vt,
|
|
3295
3308
|
color: "#4E5969"
|
|
3296
3309
|
},
|
|
3297
3310
|
{
|
|
3298
3311
|
name: "checkbox-uncheck",
|
|
3299
3312
|
configName: "CHECKBOX_UNCHECK_SVG",
|
|
3300
3313
|
configColorName: "CHECKBOX_UNCHECK_COLOR",
|
|
3301
|
-
svg:
|
|
3314
|
+
svg: ke,
|
|
3302
3315
|
color: ""
|
|
3303
3316
|
},
|
|
3304
3317
|
{
|
|
3305
3318
|
name: "checkbox-check",
|
|
3306
3319
|
configName: "CHECKBOX_CHECK_SVG",
|
|
3307
3320
|
configColorName: "CHECKBOX_COLOR",
|
|
3308
|
-
svg:
|
|
3321
|
+
svg: Wt,
|
|
3309
3322
|
color: "rgb(82,146,247)"
|
|
3310
3323
|
},
|
|
3311
3324
|
{
|
|
3312
3325
|
name: "checkbox-indeterminate",
|
|
3313
3326
|
configName: "CHECKBOX_INDETERMINATE_SVG",
|
|
3314
3327
|
configColorName: "CHECKBOX_COLOR",
|
|
3315
|
-
svg:
|
|
3328
|
+
svg: Be,
|
|
3316
3329
|
color: "rgb(82,146,247)"
|
|
3317
3330
|
},
|
|
3318
3331
|
{
|
|
3319
3332
|
name: "checkbox-check-disabled",
|
|
3320
3333
|
configName: "CHECKBOX_CHECK_DISABLED_SVG",
|
|
3321
|
-
svg:
|
|
3334
|
+
svg: Wt,
|
|
3322
3335
|
color: "#DDE0EA"
|
|
3323
3336
|
},
|
|
3324
3337
|
{
|
|
3325
3338
|
name: "checkbox-disabled",
|
|
3326
3339
|
configName: "CHECKBOX_DISABLED_SVG",
|
|
3327
3340
|
configColorName: "CHECKBOX_DISABLED_COLOR",
|
|
3328
|
-
svg:
|
|
3341
|
+
svg: Xe,
|
|
3329
3342
|
color: "#F1F2F4"
|
|
3330
3343
|
},
|
|
3331
3344
|
{
|
|
3332
3345
|
name: "icon-edit",
|
|
3333
3346
|
configName: "ICON_EDIT_SVG",
|
|
3334
3347
|
configColorName: "ICON_EDIT_COLOR",
|
|
3335
|
-
svg:
|
|
3348
|
+
svg: Ke,
|
|
3336
3349
|
color: "#4E5969"
|
|
3337
3350
|
},
|
|
3338
3351
|
{
|
|
3339
3352
|
name: "icon-select",
|
|
3340
3353
|
configName: "ICON_SELECT_SVG",
|
|
3341
3354
|
configColorName: "ICON_SELECT_COLOR",
|
|
3342
|
-
svg:
|
|
3355
|
+
svg: Vt,
|
|
3343
3356
|
color: "#4E5969"
|
|
3344
3357
|
},
|
|
3345
3358
|
{
|
|
3346
3359
|
name: "sort-asc",
|
|
3347
3360
|
configName: "SORT_ASC_ICON_SVG",
|
|
3348
3361
|
configColorName: "SORT_ICON_COLOR",
|
|
3349
|
-
svg:
|
|
3362
|
+
svg: Ye,
|
|
3350
3363
|
color: "rgb(82,146,247)"
|
|
3351
3364
|
},
|
|
3352
3365
|
{
|
|
3353
3366
|
name: "sort-desc",
|
|
3354
3367
|
configName: "SORT_DESC_ICON_SVG",
|
|
3355
3368
|
configColorName: "SORT_ICON_COLOR",
|
|
3356
|
-
svg:
|
|
3369
|
+
svg: Fe,
|
|
3357
3370
|
color: "rgb(82,146,247)"
|
|
3358
3371
|
},
|
|
3359
3372
|
{
|
|
3360
3373
|
name: "sort-default",
|
|
3361
3374
|
configName: "SORTABLE_ICON_SVG",
|
|
3362
|
-
svg:
|
|
3375
|
+
svg: Mt,
|
|
3363
3376
|
color: "#bec4c7"
|
|
3364
3377
|
},
|
|
3365
3378
|
{
|
|
3366
3379
|
name: "drag",
|
|
3367
3380
|
configName: "DRAG_ROW_ICON_SVG",
|
|
3368
|
-
svg:
|
|
3381
|
+
svg: Ne,
|
|
3369
3382
|
color: "#4E5969"
|
|
3370
3383
|
}
|
|
3371
3384
|
]);
|
|
@@ -3428,7 +3441,7 @@ class Ye {
|
|
|
3428
3441
|
return this.list.find((e) => e.name === t);
|
|
3429
3442
|
}
|
|
3430
3443
|
}
|
|
3431
|
-
class
|
|
3444
|
+
class Ve {
|
|
3432
3445
|
constructor(t) {
|
|
3433
3446
|
r(this, "ctx");
|
|
3434
3447
|
r(this, "visibleHoverCell");
|
|
@@ -3585,7 +3598,7 @@ class Fe {
|
|
|
3585
3598
|
this.resizeObserver.unobserve(this.ctx.stageElement), this.mutationObserver.disconnect();
|
|
3586
3599
|
}
|
|
3587
3600
|
}
|
|
3588
|
-
const
|
|
3601
|
+
const Pe = {
|
|
3589
3602
|
numberErrorTip: "只允许输入数字",
|
|
3590
3603
|
emptyText: "暂无数据",
|
|
3591
3604
|
loadingText: "加载中...",
|
|
@@ -3609,7 +3622,7 @@ const We = {
|
|
|
3609
3622
|
numberMax: "输入值大于{max},已自动调整为{max}",
|
|
3610
3623
|
stringMaxlength: "输入值超过{maxlength}个字符,已自动截取"
|
|
3611
3624
|
};
|
|
3612
|
-
class
|
|
3625
|
+
class ze {
|
|
3613
3626
|
constructor() {
|
|
3614
3627
|
r(this, "langConfig");
|
|
3615
3628
|
}
|
|
@@ -3617,18 +3630,108 @@ class Ve {
|
|
|
3617
3630
|
this.langConfig = t;
|
|
3618
3631
|
}
|
|
3619
3632
|
getText(t, e) {
|
|
3620
|
-
const i = { ...
|
|
3621
|
-
Object.assign(i,
|
|
3633
|
+
const i = { ...Pe };
|
|
3634
|
+
Object.assign(i, Ot.locale, this.langConfig);
|
|
3622
3635
|
const s = i[t];
|
|
3623
3636
|
return s ? s.replace(/{(\w+)}/g, (o, n) => (e == null ? void 0 : e[n]) || o) : "";
|
|
3624
3637
|
}
|
|
3625
3638
|
}
|
|
3626
|
-
|
|
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 {
|
|
3627
3730
|
constructor(t, e) {
|
|
3628
3731
|
r(this, "eventBus");
|
|
3629
3732
|
r(this, "eventBrowser");
|
|
3630
3733
|
r(this, "eventTable");
|
|
3631
|
-
r(this, "locale", new
|
|
3734
|
+
r(this, "locale", new ze());
|
|
3632
3735
|
r(this, "containerElement");
|
|
3633
3736
|
r(this, "stageElement");
|
|
3634
3737
|
r(this, "canvasElement");
|
|
@@ -3638,7 +3741,12 @@ class Pe {
|
|
|
3638
3741
|
r(this, "contextMenuElement");
|
|
3639
3742
|
r(this, "loadingElement");
|
|
3640
3743
|
r(this, "stageWidth", 0);
|
|
3744
|
+
// 逻辑可视宽度(物理宽度/zoom)
|
|
3641
3745
|
r(this, "stageHeight", 0);
|
|
3746
|
+
// 逻辑可视高度(物理高度/zoom)
|
|
3747
|
+
r(this, "stagePhysicalWidth", 0);
|
|
3748
|
+
r(this, "stagePhysicalHeight", 0);
|
|
3749
|
+
r(this, "zoomScale");
|
|
3642
3750
|
r(this, "paint");
|
|
3643
3751
|
r(this, "icons");
|
|
3644
3752
|
r(this, "domSelectionStr", "");
|
|
@@ -3772,10 +3880,13 @@ class Pe {
|
|
|
3772
3880
|
loadingElement: c,
|
|
3773
3881
|
contextMenuElement: d
|
|
3774
3882
|
} = t;
|
|
3775
|
-
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;
|
|
3776
3887
|
}
|
|
3777
3888
|
setConfig(t) {
|
|
3778
|
-
this.config = new
|
|
3889
|
+
this.config = new Ft(t);
|
|
3779
3890
|
}
|
|
3780
3891
|
setItemValueByEditor(t, e, i, s = !0, o = !0, n = !0) {
|
|
3781
3892
|
if (this.config.ENABLE_MERGE_CELL_LINK) {
|
|
@@ -3883,10 +3994,29 @@ class Pe {
|
|
|
3883
3994
|
getOffset(t) {
|
|
3884
3995
|
const { left: e, top: i } = this.containerElement.getBoundingClientRect();
|
|
3885
3996
|
return {
|
|
3886
|
-
offsetX: t.clientX - e,
|
|
3887
|
-
offsetY: t.clientY - i
|
|
3997
|
+
offsetX: this.zoomScale.toLogical(t.clientX - e),
|
|
3998
|
+
offsetY: this.zoomScale.toLogical(t.clientY - i)
|
|
3888
3999
|
};
|
|
3889
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
|
+
}
|
|
3890
4020
|
hasEvent(t) {
|
|
3891
4021
|
return this.eventBus.has(t);
|
|
3892
4022
|
}
|
|
@@ -3906,7 +4036,7 @@ class Pe {
|
|
|
3906
4036
|
this.eventTable.destroy(), this.eventBrowser.destroy(), this.eventBus.destroy();
|
|
3907
4037
|
}
|
|
3908
4038
|
}
|
|
3909
|
-
class
|
|
4039
|
+
class Pt {
|
|
3910
4040
|
constructor(t, e) {
|
|
3911
4041
|
r(this, "ctx");
|
|
3912
4042
|
r(this, "type");
|
|
@@ -3937,7 +4067,7 @@ class Wt {
|
|
|
3937
4067
|
this.updateScroll(t);
|
|
3938
4068
|
}
|
|
3939
4069
|
onTouchmove(t) {
|
|
3940
|
-
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);
|
|
3941
4071
|
let n = 0;
|
|
3942
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;
|
|
3943
4073
|
}
|
|
@@ -3950,13 +4080,13 @@ class Wt {
|
|
|
3950
4080
|
return;
|
|
3951
4081
|
if (this.ctx.stageElement.style.cursor === "row-resize" || this.ctx.stageElement.style.cursor === "col-resize")
|
|
3952
4082
|
return !0;
|
|
3953
|
-
const {
|
|
3954
|
-
if (!(
|
|
3955
|
-
if (this.isOnScrollbar(
|
|
3956
|
-
this.clientX =
|
|
3957
|
-
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)) {
|
|
3958
4088
|
let n = 0;
|
|
3959
|
-
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));
|
|
3960
4090
|
}
|
|
3961
4091
|
}
|
|
3962
4092
|
}
|
|
@@ -3964,10 +4094,10 @@ class Wt {
|
|
|
3964
4094
|
this.isDragging = !1, this.isFocus = !1, this.clientX = 0, this.clientY = 0;
|
|
3965
4095
|
}
|
|
3966
4096
|
onMouseMove(t) {
|
|
3967
|
-
const {
|
|
3968
|
-
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;
|
|
3969
4099
|
let a = 0;
|
|
3970
|
-
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) {
|
|
3971
4101
|
let l = 0;
|
|
3972
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));
|
|
3973
4103
|
}
|
|
@@ -4011,8 +4141,8 @@ class Wt {
|
|
|
4011
4141
|
const g = a ? 0 : 0.5;
|
|
4012
4142
|
this.trackX = 0, this.trackY = c - o + g, this.trackWidth = l, this.trackHeight = o;
|
|
4013
4143
|
const E = this.distance ? this.visibleDistance / f : 0;
|
|
4014
|
-
let
|
|
4015
|
-
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));
|
|
4016
4146
|
}
|
|
4017
4147
|
}
|
|
4018
4148
|
draw() {
|
|
@@ -4033,7 +4163,7 @@ class Wt {
|
|
|
4033
4163
|
}), this.ctx.scrollerFocus = this.isFocus;
|
|
4034
4164
|
}
|
|
4035
4165
|
}
|
|
4036
|
-
class
|
|
4166
|
+
class Ze {
|
|
4037
4167
|
// 垂直滚动定时器
|
|
4038
4168
|
constructor(t) {
|
|
4039
4169
|
r(this, "ctx");
|
|
@@ -4046,7 +4176,7 @@ class ze {
|
|
|
4046
4176
|
r(this, "timerX", 0);
|
|
4047
4177
|
// 水平滚动定时器
|
|
4048
4178
|
r(this, "timerY", 0);
|
|
4049
|
-
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) => {
|
|
4050
4180
|
this.onTouchstart(e);
|
|
4051
4181
|
}), this.ctx.on("setScroll", (e, i) => {
|
|
4052
4182
|
this.setScroll(e, i);
|
|
@@ -4148,7 +4278,7 @@ class ze {
|
|
|
4148
4278
|
t && (this.adjustPositionX = "", this.timerX && (clearInterval(this.timerX), this.timerX = 0)), e && (this.adjustPositionY = "", this.timerY && (clearInterval(this.timerY), this.timerY = 0));
|
|
4149
4279
|
}
|
|
4150
4280
|
}
|
|
4151
|
-
class
|
|
4281
|
+
class je extends se {
|
|
4152
4282
|
constructor(e, i, s, o, n, a, l) {
|
|
4153
4283
|
super(e, s, o, n, a, "header", l.fixed);
|
|
4154
4284
|
r(this, "align");
|
|
@@ -4217,7 +4347,7 @@ class $e extends ee {
|
|
|
4217
4347
|
r(this, "drawSortImageName", "");
|
|
4218
4348
|
r(this, "drawSortImageSource");
|
|
4219
4349
|
r(this, "renderHeaderType", "default");
|
|
4220
|
-
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";
|
|
4221
4351
|
}
|
|
4222
4352
|
/**
|
|
4223
4353
|
* 是否可见,覆盖基类方法,表头是跟y滚动条没有关系的所以不需要加滚动参数
|
|
@@ -4336,7 +4466,7 @@ class $e extends ee {
|
|
|
4336
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);
|
|
4337
4467
|
let c = this.ctx.icons.get("checkbox-uncheck"), d = "checkbox-uncheck";
|
|
4338
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");
|
|
4339
|
-
const f = new
|
|
4469
|
+
const f = new Z(d, a, l, o, o, c);
|
|
4340
4470
|
f.setVisible(!this.hideHeaderSelection), this.setImage("selection", f);
|
|
4341
4471
|
}
|
|
4342
4472
|
}
|
|
@@ -4347,7 +4477,7 @@ class $e extends ee {
|
|
|
4347
4477
|
let l = this.sortIconName;
|
|
4348
4478
|
const c = this.ctx.database.getSortState(this.key);
|
|
4349
4479
|
c.direction === "asc" ? l = this.sortAscIconName : c.direction === "desc" && (l = this.sortDescIconName);
|
|
4350
|
-
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);
|
|
4351
4481
|
this.setImage("sort", f);
|
|
4352
4482
|
}
|
|
4353
4483
|
getText() {
|
|
@@ -4370,7 +4500,7 @@ class $e extends ee {
|
|
|
4370
4500
|
};
|
|
4371
4501
|
}
|
|
4372
4502
|
}
|
|
4373
|
-
class
|
|
4503
|
+
class re {
|
|
4374
4504
|
constructor(t, e) {
|
|
4375
4505
|
r(this, "root");
|
|
4376
4506
|
r(this, "key");
|
|
@@ -4419,7 +4549,7 @@ class oe {
|
|
|
4419
4549
|
return !1;
|
|
4420
4550
|
}
|
|
4421
4551
|
}
|
|
4422
|
-
class
|
|
4552
|
+
class qe {
|
|
4423
4553
|
constructor(t) {
|
|
4424
4554
|
r(this, "ctx");
|
|
4425
4555
|
// 上下文
|
|
@@ -4465,7 +4595,7 @@ class Ge {
|
|
|
4465
4595
|
r(this, "renderFixedCellHeaders", []);
|
|
4466
4596
|
this.ctx = t, this.ctx.on(
|
|
4467
4597
|
"resetHeader",
|
|
4468
|
-
|
|
4598
|
+
Lt(() => {
|
|
4469
4599
|
this.init(), this.ctx.clearSelector(), this.ctx.emit("draw");
|
|
4470
4600
|
}, 100)
|
|
4471
4601
|
), this.init(), this.initSelection(), this.initSort(), this.initResizeColumn(), this.initDragColumn();
|
|
@@ -4475,31 +4605,33 @@ class Ge {
|
|
|
4475
4605
|
config: { HEADER_HEIGHT: e, SCROLLER_TRACK_SIZE: i }
|
|
4476
4606
|
} = this.ctx;
|
|
4477
4607
|
if (!t) {
|
|
4478
|
-
const
|
|
4479
|
-
this.columns =
|
|
4480
|
-
}
|
|
4481
|
-
this.allCellHeaders = [], this.leafCellHeaders = [], this.fixedLeftCellHeaders = [], this.fixedRightCellHeaders = [], this.centerCellHeaders = [], this.visibleColumns =
|
|
4482
|
-
const s =
|
|
4483
|
-
this.height = e * s, this.visibleHeight = this.height, this.width = o.reduce((
|
|
4484
|
-
const
|
|
4485
|
-
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;
|
|
4486
4616
|
}, 0), this.columnIndex = 0, this.resizeNum = 0;
|
|
4487
|
-
const n =
|
|
4617
|
+
const n = Ce(lt(this.visibleColumns, s));
|
|
4488
4618
|
this.render(n, 0), this.ctx.database.updateColIndexKeyMap(this.leafCellHeaders);
|
|
4489
|
-
const a = this.ctx.containerElement.getBoundingClientRect()
|
|
4490
|
-
|
|
4491
|
-
|
|
4492
|
-
|
|
4493
|
-
|
|
4494
|
-
|
|
4495
|
-
|
|
4496
|
-
|
|
4497
|
-
|
|
4498
|
-
|
|
4499
|
-
|
|
4500
|
-
|
|
4501
|
-
const
|
|
4502
|
-
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;
|
|
4503
4635
|
}
|
|
4504
4636
|
initSort() {
|
|
4505
4637
|
this.ctx.on("cellHeaderClick", (t, e) => {
|
|
@@ -4537,20 +4669,21 @@ class Ge {
|
|
|
4537
4669
|
} else {
|
|
4538
4670
|
if (this.resizeTarget = null, this.isMouseDown)
|
|
4539
4671
|
return;
|
|
4540
|
-
|
|
4672
|
+
const { offsetX: s } = this.ctx.getOffset(t);
|
|
4673
|
+
if (s < 0 || s > this.visibleWidth) {
|
|
4541
4674
|
this.ctx.stageElement.style.cursor === "col-resize" && (this.ctx.stageElement.style.cursor = "default");
|
|
4542
4675
|
return;
|
|
4543
4676
|
}
|
|
4544
4677
|
this.ctx.stageElement.style.cursor === "col-resize" && (this.ctx.stageElement.style.cursor = "default");
|
|
4545
|
-
const
|
|
4546
|
-
for (const
|
|
4547
|
-
const { offsetX:
|
|
4548
|
-
if (
|
|
4549
|
-
|
|
4550
|
-
const
|
|
4551
|
-
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)
|
|
4552
4685
|
return;
|
|
4553
|
-
this.ctx.isTarget(t) &&
|
|
4686
|
+
this.ctx.isTarget(t) && l <= this.height && (this.ctx.stageElement.style.cursor = "col-resize", this.resizeTarget = g);
|
|
4554
4687
|
}
|
|
4555
4688
|
}
|
|
4556
4689
|
}
|
|
@@ -4566,7 +4699,7 @@ class Ge {
|
|
|
4566
4699
|
if (this.dragingCell && this.dragTarget) {
|
|
4567
4700
|
const t = (c, d = {}) => (c.forEach((f, u) => {
|
|
4568
4701
|
f.children && t(f.children, d), d[f.key] = u;
|
|
4569
|
-
}), d), e = this.ctx.database.getColumns(), i =
|
|
4702
|
+
}), d), e = this.ctx.database.getColumns(), i = lt(e, at(e)), s = new re(i, {
|
|
4570
4703
|
key: "key",
|
|
4571
4704
|
// 节点唯一标识字段(对应我们之前的field)
|
|
4572
4705
|
childrenKey: "children"
|
|
@@ -4660,7 +4793,7 @@ class Ge {
|
|
|
4660
4793
|
columns: t,
|
|
4661
4794
|
customHeader: e
|
|
4662
4795
|
} : {
|
|
4663
|
-
columns:
|
|
4796
|
+
columns: lt(t, at(t)),
|
|
4664
4797
|
customHeader: e
|
|
4665
4798
|
};
|
|
4666
4799
|
}
|
|
@@ -4671,8 +4804,8 @@ class Ge {
|
|
|
4671
4804
|
for (let n = 0; n < i; n++) {
|
|
4672
4805
|
const a = t[n], l = o * (a.rowspan || 0), c = o * (a.level || 0);
|
|
4673
4806
|
let { minWidth: d, maxWidth: f } = a, u = a.width || 100;
|
|
4674
|
-
d && u < d && (u = d), f && u > f && (u = f), a.children && (u =
|
|
4675
|
-
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);
|
|
4676
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;
|
|
4677
4810
|
}
|
|
4678
4811
|
}
|
|
@@ -4791,7 +4924,7 @@ class Ge {
|
|
|
4791
4924
|
}), this.drawBottomLine(), this.drawTipLine(), this.drawDragTip();
|
|
4792
4925
|
}
|
|
4793
4926
|
}
|
|
4794
|
-
class
|
|
4927
|
+
class ae {
|
|
4795
4928
|
constructor(t, e, i = 0, s = 0, o = 0, n = 0, a, l = "body") {
|
|
4796
4929
|
r(this, "ctx");
|
|
4797
4930
|
r(this, "x", 0);
|
|
@@ -4812,7 +4945,7 @@ class ne {
|
|
|
4812
4945
|
update() {
|
|
4813
4946
|
const { header: t } = this.ctx, e = [], i = [], s = [], o = [];
|
|
4814
4947
|
t.renderLeafCellHeaders.forEach((n) => {
|
|
4815
|
-
const a = new
|
|
4948
|
+
const a = new oe(
|
|
4816
4949
|
this.ctx,
|
|
4817
4950
|
this.rowIndex,
|
|
4818
4951
|
n.colIndex,
|
|
@@ -4855,7 +4988,7 @@ class ne {
|
|
|
4855
4988
|
});
|
|
4856
4989
|
}
|
|
4857
4990
|
}
|
|
4858
|
-
class
|
|
4991
|
+
class Je {
|
|
4859
4992
|
constructor(t) {
|
|
4860
4993
|
r(this, "resizeTarget", null);
|
|
4861
4994
|
//调整行大小的目标
|
|
@@ -4914,31 +5047,38 @@ class Ue {
|
|
|
4914
5047
|
this.height = g, this.data = x, this.width = e.width, this.visibleWidth = this.ctx.stageWidth - n;
|
|
4915
5048
|
const E = this.ctx.footer.height;
|
|
4916
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;
|
|
4917
5051
|
let w = this.height + e.height + n;
|
|
4918
5052
|
w += E;
|
|
4919
|
-
let
|
|
4920
|
-
const
|
|
4921
|
-
if (
|
|
4922
|
-
const
|
|
4923
|
-
|
|
4924
|
-
} else this.data.length && a ?
|
|
4925
|
-
|
|
4926
|
-
|
|
4927
|
-
|
|
4928
|
-
|
|
4929
|
-
|
|
4930
|
-
|
|
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";
|
|
4931
5071
|
this.ctx.emit("emptyChange", {
|
|
4932
|
-
isEmpty:
|
|
4933
|
-
type:
|
|
5072
|
+
isEmpty: _,
|
|
5073
|
+
type: _,
|
|
4934
5074
|
headerHeight: e.height,
|
|
4935
5075
|
bodyHeight: this.height,
|
|
4936
5076
|
footerHeight: E,
|
|
4937
5077
|
width: this.width,
|
|
4938
5078
|
height: this.data.length ? 0 : l + E
|
|
4939
5079
|
});
|
|
4940
|
-
const
|
|
4941
|
-
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);
|
|
4942
5082
|
}
|
|
4943
5083
|
initTree() {
|
|
4944
5084
|
this.ctx.on("cellClick", (t, e) => {
|
|
@@ -5028,7 +5168,7 @@ class Ue {
|
|
|
5028
5168
|
let s = !0;
|
|
5029
5169
|
const { BEFORE_DRAG_ROW_METHOD: o } = this.ctx.config;
|
|
5030
5170
|
if (typeof o == "function" && (s = await o(i)), s && !this.ctx.config.ENABLE_DRAG_ROW_CUSTOM) {
|
|
5031
|
-
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, {
|
|
5032
5172
|
key: l,
|
|
5033
5173
|
childrenKey: a
|
|
5034
5174
|
});
|
|
@@ -5170,8 +5310,8 @@ class Ue {
|
|
|
5170
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;
|
|
5171
5311
|
const d = [];
|
|
5172
5312
|
for (let f = 0; f < this.visibleRows.length; f++) {
|
|
5173
|
-
const u = this.headIndex + f, x = this.visibleRows[f], { height: g, top: E } = this.ctx.database.getPositionForRowIndex(u),
|
|
5174
|
-
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);
|
|
5175
5315
|
}
|
|
5176
5316
|
this.renderRows = d, this.ctx.body.renderRows = d;
|
|
5177
5317
|
}
|
|
@@ -5200,7 +5340,7 @@ class Ue {
|
|
|
5200
5340
|
}), this.drawTipLine();
|
|
5201
5341
|
}
|
|
5202
5342
|
}
|
|
5203
|
-
class
|
|
5343
|
+
class Qe {
|
|
5204
5344
|
constructor(t) {
|
|
5205
5345
|
r(this, "ctx");
|
|
5206
5346
|
r(this, "renderRows", []);
|
|
@@ -5255,7 +5395,7 @@ class je {
|
|
|
5255
5395
|
let e = this.y;
|
|
5256
5396
|
const i = [];
|
|
5257
5397
|
this.data.forEach((s, o) => {
|
|
5258
|
-
const n = new
|
|
5398
|
+
const n = new ae(this.ctx, o, 0, e, this.width, t, s, "footer");
|
|
5259
5399
|
e += t, i.push(n);
|
|
5260
5400
|
}), this.renderRows = i, this.ctx.footer.renderRows = this.renderRows;
|
|
5261
5401
|
}
|
|
@@ -5281,7 +5421,7 @@ class je {
|
|
|
5281
5421
|
}), this.drawTopLine();
|
|
5282
5422
|
}
|
|
5283
5423
|
}
|
|
5284
|
-
class
|
|
5424
|
+
class ti {
|
|
5285
5425
|
constructor(t) {
|
|
5286
5426
|
r(this, "isCut", !1);
|
|
5287
5427
|
r(this, "isMultipleRow", !1);
|
|
@@ -5293,7 +5433,7 @@ class Ze {
|
|
|
5293
5433
|
this.moveFocus(t);
|
|
5294
5434
|
}), this.ctx.on(
|
|
5295
5435
|
"mousemove",
|
|
5296
|
-
|
|
5436
|
+
Lt((t) => {
|
|
5297
5437
|
var e;
|
|
5298
5438
|
(e = this.ctx.focusCellHeader) != null && e.fixed || !this.ctx.dragHeaderIng && this.ctx.selectorMove && this.ctx.startAdjustPosition(t);
|
|
5299
5439
|
}, 100)
|
|
@@ -5401,27 +5541,27 @@ class Ze {
|
|
|
5401
5541
|
SELECTOR_AREA_MAX_Y: d,
|
|
5402
5542
|
SELECTOR_AREA_MAX_X_OFFSET: f,
|
|
5403
5543
|
SELECTOR_AREA_MAX_Y_OFFSET: u
|
|
5404
|
-
} = this.ctx.config, x = a, g = l || this.ctx.maxColIndex - f, E = c,
|
|
5405
|
-
let [
|
|
5406
|
-
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)
|
|
5407
5547
|
return;
|
|
5408
5548
|
if (this.ctx.config.ENABLE_MERGE_CELL_LINK) {
|
|
5409
|
-
const
|
|
5410
|
-
|
|
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;
|
|
5411
5551
|
}
|
|
5412
|
-
|
|
5413
|
-
const { BEFORE_SET_SELECTOR_METHOD:
|
|
5414
|
-
if (typeof
|
|
5415
|
-
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({
|
|
5416
5556
|
focusCell: this.ctx.focusCell,
|
|
5417
5557
|
xArr: o,
|
|
5418
5558
|
yArr: n
|
|
5419
5559
|
});
|
|
5420
|
-
if (!
|
|
5560
|
+
if (!I)
|
|
5421
5561
|
return;
|
|
5422
|
-
o =
|
|
5562
|
+
o = I.xArr, n = I.yArr;
|
|
5423
5563
|
}
|
|
5424
|
-
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");
|
|
5425
5565
|
}
|
|
5426
5566
|
}
|
|
5427
5567
|
adjustMergeCells(t, e) {
|
|
@@ -5435,23 +5575,23 @@ class Ze {
|
|
|
5435
5575
|
};
|
|
5436
5576
|
let a = [], l = [];
|
|
5437
5577
|
for (let E = 0; E <= e[1] - e[0]; E++)
|
|
5438
|
-
for (let
|
|
5439
|
-
const
|
|
5440
|
-
|
|
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));
|
|
5441
5581
|
}
|
|
5442
5582
|
const c = a.reduce(
|
|
5443
|
-
(E,
|
|
5444
|
-
const { yArr:
|
|
5445
|
-
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;
|
|
5446
5586
|
},
|
|
5447
5587
|
{
|
|
5448
5588
|
minY: i,
|
|
5449
5589
|
maxY: s
|
|
5450
5590
|
}
|
|
5451
5591
|
), d = l.reduce(
|
|
5452
|
-
(E,
|
|
5453
|
-
const { xArr:
|
|
5454
|
-
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;
|
|
5455
5595
|
},
|
|
5456
5596
|
{
|
|
5457
5597
|
minX: o,
|
|
@@ -5460,8 +5600,8 @@ class Ze {
|
|
|
5460
5600
|
), f = [d.minX, d.maxX], u = [c.minY, c.maxY];
|
|
5461
5601
|
let x = !1;
|
|
5462
5602
|
if (d.minX !== d.maxX || c.minY !== c.maxY) {
|
|
5463
|
-
const E = JSON.stringify(f) + JSON.stringify(u),
|
|
5464
|
-
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;
|
|
5465
5605
|
}
|
|
5466
5606
|
return {
|
|
5467
5607
|
xArr: f,
|
|
@@ -5588,7 +5728,7 @@ class Ze {
|
|
|
5588
5728
|
return;
|
|
5589
5729
|
t = a.data;
|
|
5590
5730
|
}
|
|
5591
|
-
const o =
|
|
5731
|
+
const o = ve(t);
|
|
5592
5732
|
navigator.clipboard ? navigator.clipboard.writeText(o).then(() => {
|
|
5593
5733
|
this.ctx.selector.xArrCopy = this.ctx.selector.xArr.slice(), this.ctx.selector.yArrCopy = this.ctx.selector.yArr.slice(), this.ctx.emit("copyChange", {
|
|
5594
5734
|
xArr: this.ctx.selector.xArrCopy,
|
|
@@ -5633,7 +5773,7 @@ class Ze {
|
|
|
5633
5773
|
if (this.ctx.selector.enable && t) {
|
|
5634
5774
|
const e = this.ctx.selector.yArr[0], i = this.ctx.selector.xArr[0], s = /* @__PURE__ */ new Set();
|
|
5635
5775
|
navigator.clipboard.readText().then(async (o) => {
|
|
5636
|
-
let n =
|
|
5776
|
+
let n = Re(o);
|
|
5637
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;
|
|
5638
5778
|
(x > 0 || g > 0) && this.ctx.emit("onPastedDataOverflow", {
|
|
5639
5779
|
maxY: d,
|
|
@@ -5646,25 +5786,25 @@ class Ze {
|
|
|
5646
5786
|
});
|
|
5647
5787
|
const E = n.length === 1 && n[0].length === 1;
|
|
5648
5788
|
if (this.ctx.config.ENABLE_MERGE_CELL_LINK && this.ctx.database.hasMergeCell(a, l) && !E) {
|
|
5649
|
-
const
|
|
5789
|
+
const C = {
|
|
5650
5790
|
code: "ERR_MERGED_CELLS_PASTE",
|
|
5651
5791
|
message: this.ctx.locale.getText("mergeCellNoPaste"),
|
|
5652
5792
|
data: []
|
|
5653
5793
|
};
|
|
5654
|
-
this.ctx.hasEvent("error") ? this.ctx.emit("error",
|
|
5794
|
+
this.ctx.hasEvent("error") ? this.ctx.emit("error", C) : console.error(C.message);
|
|
5655
5795
|
return;
|
|
5656
5796
|
}
|
|
5657
|
-
let
|
|
5658
|
-
for (let
|
|
5659
|
-
const p = n[
|
|
5660
|
-
for (let
|
|
5661
|
-
const
|
|
5662
|
-
|
|
5663
|
-
|
|
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
|
|
5664
5804
|
);
|
|
5665
5805
|
if (_) {
|
|
5666
5806
|
const { rowKey: R, key: S } = _;
|
|
5667
|
-
this.ctx.database.getReadonly(R, S) || (s.add(R),
|
|
5807
|
+
this.ctx.database.getReadonly(R, S) || (s.add(R), m.push({
|
|
5668
5808
|
rowKey: R,
|
|
5669
5809
|
key: S,
|
|
5670
5810
|
value: T,
|
|
@@ -5675,35 +5815,35 @@ class Ze {
|
|
|
5675
5815
|
}
|
|
5676
5816
|
}
|
|
5677
5817
|
if (this.isCut) {
|
|
5678
|
-
const
|
|
5818
|
+
const C = this.clearSelectedData(
|
|
5679
5819
|
this.ctx.selector.xArrCopy,
|
|
5680
5820
|
this.ctx.selector.yArrCopy,
|
|
5681
5821
|
!0
|
|
5682
5822
|
// 忽略设置,只返回数据,用于cut,实现历史回退需要返回两次问题
|
|
5683
|
-
), p =
|
|
5684
|
-
|
|
5685
|
-
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);
|
|
5686
5826
|
}), this.isCut = !1;
|
|
5687
5827
|
}
|
|
5688
|
-
if (!
|
|
5828
|
+
if (!m.length)
|
|
5689
5829
|
return;
|
|
5690
|
-
const { BEFORE_PASTE_DATA_METHOD:
|
|
5691
|
-
if (typeof
|
|
5692
|
-
const
|
|
5693
|
-
rowKey:
|
|
5694
|
-
key:
|
|
5695
|
-
value:
|
|
5696
|
-
oldValue: this.ctx.database.getItemValue(
|
|
5697
|
-
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)
|
|
5698
5838
|
}));
|
|
5699
|
-
if (
|
|
5839
|
+
if (m = await C(p, a, l, n), m && !m.length)
|
|
5700
5840
|
return;
|
|
5701
5841
|
}
|
|
5702
|
-
this.clearCopyLine(), this.ctx.batchSetItemValueByEditor(
|
|
5842
|
+
this.clearCopyLine(), this.ctx.batchSetItemValueByEditor(m, !0);
|
|
5703
5843
|
let y = [];
|
|
5704
|
-
s.forEach((
|
|
5705
|
-
y.push(this.ctx.database.getRowDataItemForRowKey(
|
|
5706
|
-
}), 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");
|
|
5707
5847
|
}).catch((o) => {
|
|
5708
5848
|
console.error("Failed to get the clipboard content:", o);
|
|
5709
5849
|
});
|
|
@@ -5769,19 +5909,19 @@ class Ze {
|
|
|
5769
5909
|
if (!i)
|
|
5770
5910
|
return;
|
|
5771
5911
|
g && this.ctx.onlyMergeCell && i.updateSpanInfo();
|
|
5772
|
-
const { drawX: E, drawY:
|
|
5773
|
-
let
|
|
5774
|
-
|
|
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);
|
|
5775
5915
|
let T = 0;
|
|
5776
|
-
u && (x === "top" ?
|
|
5777
|
-
const _ =
|
|
5916
|
+
u && (x === "top" ? v = n.height + a.height - m : T = a.visibleHeight);
|
|
5917
|
+
const _ = m + I - (t - T - f);
|
|
5778
5918
|
let R = c, S = d;
|
|
5779
|
-
|
|
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);
|
|
5780
5920
|
}
|
|
5781
5921
|
destroy() {
|
|
5782
5922
|
}
|
|
5783
5923
|
}
|
|
5784
|
-
class
|
|
5924
|
+
class ei {
|
|
5785
5925
|
constructor(t) {
|
|
5786
5926
|
r(this, "ctx");
|
|
5787
5927
|
r(this, "maxColRowCell");
|
|
@@ -5834,11 +5974,11 @@ class qe {
|
|
|
5834
5974
|
SELECTOR_AREA_MAX_Y: x,
|
|
5835
5975
|
SELECTOR_AREA_MAX_X_OFFSET: g,
|
|
5836
5976
|
SELECTOR_AREA_MAX_Y_OFFSET: E
|
|
5837
|
-
} = this.ctx.config,
|
|
5838
|
-
let [p,
|
|
5839
|
-
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)
|
|
5840
5980
|
return;
|
|
5841
|
-
n = [Math.max(
|
|
5981
|
+
n = [Math.max(m, p), Math.min(w, b)], a = [Math.max(y, v), Math.min(C, I)];
|
|
5842
5982
|
const { BEFORE_SET_AUTOFILL_METHOD: T } = this.ctx.config;
|
|
5843
5983
|
if (typeof T == "function") {
|
|
5844
5984
|
const R = T({
|
|
@@ -5860,8 +6000,8 @@ class qe {
|
|
|
5860
6000
|
const t = /* @__PURE__ */ new Set(), e = this.ctx.getSelectedData(), i = /* @__PURE__ */ new Map();
|
|
5861
6001
|
for (let x = 0; x <= e.yArr[1] - e.yArr[0]; x++)
|
|
5862
6002
|
for (let g = 0; g <= e.xArr[1] - e.xArr[0]; g++) {
|
|
5863
|
-
const E = x + e.yArr[0],
|
|
5864
|
-
i.set(`${E}-${
|
|
6003
|
+
const E = x + e.yArr[0], m = g + e.xArr[0];
|
|
6004
|
+
i.set(`${E}-${m}`, !0);
|
|
5865
6005
|
}
|
|
5866
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;
|
|
5867
6007
|
if (this.ctx.config.ENABLE_MERGE_CELL_LINK && this.ctx.database.hasMergeCell(a, l) && !c) {
|
|
@@ -5876,13 +6016,13 @@ class qe {
|
|
|
5876
6016
|
let d = [];
|
|
5877
6017
|
for (let x = 0; x <= l[1] - l[0]; x++)
|
|
5878
6018
|
for (let g = 0; g <= a[1] - a[0]; g++) {
|
|
5879
|
-
const E = g + a[0],
|
|
5880
|
-
if (y && !i.has(
|
|
5881
|
-
const { rowKey: p, key:
|
|
5882
|
-
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({
|
|
5883
6023
|
rowKey: p,
|
|
5884
|
-
key:
|
|
5885
|
-
value:
|
|
6024
|
+
key: b,
|
|
6025
|
+
value: w,
|
|
5886
6026
|
row: {}
|
|
5887
6027
|
}));
|
|
5888
6028
|
}
|
|
@@ -5920,76 +6060,76 @@ class qe {
|
|
|
5920
6060
|
destroy() {
|
|
5921
6061
|
}
|
|
5922
6062
|
}
|
|
5923
|
-
const q = Math.min, $ = Math.max,
|
|
6063
|
+
const q = Math.min, $ = Math.max, ht = Math.round, rt = Math.floor, Y = (h) => ({
|
|
5924
6064
|
x: h,
|
|
5925
6065
|
y: h
|
|
5926
|
-
}),
|
|
6066
|
+
}), ii = {
|
|
5927
6067
|
left: "right",
|
|
5928
6068
|
right: "left",
|
|
5929
6069
|
bottom: "top",
|
|
5930
6070
|
top: "bottom"
|
|
5931
6071
|
};
|
|
5932
|
-
function
|
|
6072
|
+
function vt(h, t, e) {
|
|
5933
6073
|
return $(h, q(t, e));
|
|
5934
6074
|
}
|
|
5935
|
-
function
|
|
6075
|
+
function st(h, t) {
|
|
5936
6076
|
return typeof h == "function" ? h(t) : h;
|
|
5937
6077
|
}
|
|
5938
6078
|
function G(h) {
|
|
5939
6079
|
return h.split("-")[0];
|
|
5940
6080
|
}
|
|
5941
|
-
function
|
|
6081
|
+
function ot(h) {
|
|
5942
6082
|
return h.split("-")[1];
|
|
5943
6083
|
}
|
|
5944
|
-
function
|
|
6084
|
+
function le(h) {
|
|
5945
6085
|
return h === "x" ? "y" : "x";
|
|
5946
6086
|
}
|
|
5947
|
-
function
|
|
6087
|
+
function At(h) {
|
|
5948
6088
|
return h === "y" ? "height" : "width";
|
|
5949
6089
|
}
|
|
5950
6090
|
function V(h) {
|
|
5951
6091
|
const t = h[0];
|
|
5952
6092
|
return t === "t" || t === "b" ? "y" : "x";
|
|
5953
6093
|
}
|
|
5954
|
-
function
|
|
5955
|
-
return
|
|
6094
|
+
function Ht(h) {
|
|
6095
|
+
return le(V(h));
|
|
5956
6096
|
}
|
|
5957
|
-
function
|
|
6097
|
+
function si(h, t, e) {
|
|
5958
6098
|
e === void 0 && (e = !1);
|
|
5959
|
-
const i =
|
|
6099
|
+
const i = ot(h), s = Ht(h), o = At(s);
|
|
5960
6100
|
let n = s === "x" ? i === (e ? "end" : "start") ? "right" : "left" : i === "start" ? "bottom" : "top";
|
|
5961
|
-
return t.reference[o] > t.floating[o] && (n =
|
|
6101
|
+
return t.reference[o] > t.floating[o] && (n = dt(n)), [n, dt(n)];
|
|
5962
6102
|
}
|
|
5963
|
-
function
|
|
5964
|
-
const t =
|
|
6103
|
+
function oi(h) {
|
|
6104
|
+
const t = dt(h);
|
|
5965
6105
|
return [It(h), t, It(t)];
|
|
5966
6106
|
}
|
|
5967
6107
|
function It(h) {
|
|
5968
6108
|
return h.includes("start") ? h.replace("start", "end") : h.replace("end", "start");
|
|
5969
6109
|
}
|
|
5970
|
-
const
|
|
5971
|
-
function
|
|
6110
|
+
const zt = ["left", "right"], $t = ["right", "left"], ni = ["top", "bottom"], ri = ["bottom", "top"];
|
|
6111
|
+
function ai(h, t, e) {
|
|
5972
6112
|
switch (h) {
|
|
5973
6113
|
case "top":
|
|
5974
6114
|
case "bottom":
|
|
5975
|
-
return e ? t ?
|
|
6115
|
+
return e ? t ? $t : zt : t ? zt : $t;
|
|
5976
6116
|
case "left":
|
|
5977
6117
|
case "right":
|
|
5978
|
-
return t ?
|
|
6118
|
+
return t ? ni : ri;
|
|
5979
6119
|
default:
|
|
5980
6120
|
return [];
|
|
5981
6121
|
}
|
|
5982
6122
|
}
|
|
5983
|
-
function
|
|
5984
|
-
const s =
|
|
5985
|
-
let o =
|
|
6123
|
+
function li(h, t, e, i) {
|
|
6124
|
+
const s = ot(h);
|
|
6125
|
+
let o = ai(G(h), e === "start", i);
|
|
5986
6126
|
return s && (o = o.map((n) => n + "-" + s), t && (o = o.concat(o.map(It)))), o;
|
|
5987
6127
|
}
|
|
5988
|
-
function
|
|
6128
|
+
function dt(h) {
|
|
5989
6129
|
const t = G(h);
|
|
5990
|
-
return
|
|
6130
|
+
return ii[t] + h.slice(t.length);
|
|
5991
6131
|
}
|
|
5992
|
-
function
|
|
6132
|
+
function ci(h) {
|
|
5993
6133
|
return {
|
|
5994
6134
|
top: 0,
|
|
5995
6135
|
right: 0,
|
|
@@ -5998,15 +6138,15 @@ function ni(h) {
|
|
|
5998
6138
|
...h
|
|
5999
6139
|
};
|
|
6000
6140
|
}
|
|
6001
|
-
function
|
|
6002
|
-
return typeof h != "number" ?
|
|
6141
|
+
function ce(h) {
|
|
6142
|
+
return typeof h != "number" ? ci(h) : {
|
|
6003
6143
|
top: h,
|
|
6004
6144
|
right: h,
|
|
6005
6145
|
bottom: h,
|
|
6006
6146
|
left: h
|
|
6007
6147
|
};
|
|
6008
6148
|
}
|
|
6009
|
-
function
|
|
6149
|
+
function ft(h) {
|
|
6010
6150
|
const {
|
|
6011
6151
|
x: t,
|
|
6012
6152
|
y: e,
|
|
@@ -6024,12 +6164,12 @@ function dt(h) {
|
|
|
6024
6164
|
y: e
|
|
6025
6165
|
};
|
|
6026
6166
|
}
|
|
6027
|
-
function
|
|
6167
|
+
function Gt(h, t, e) {
|
|
6028
6168
|
let {
|
|
6029
6169
|
reference: i,
|
|
6030
6170
|
floating: s
|
|
6031
6171
|
} = h;
|
|
6032
|
-
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;
|
|
6033
6173
|
let x;
|
|
6034
6174
|
switch (l) {
|
|
6035
6175
|
case "top":
|
|
@@ -6062,7 +6202,7 @@ function zt(h, t, e) {
|
|
|
6062
6202
|
y: i.y
|
|
6063
6203
|
};
|
|
6064
6204
|
}
|
|
6065
|
-
switch (
|
|
6205
|
+
switch (ot(t)) {
|
|
6066
6206
|
case "start":
|
|
6067
6207
|
x[n] -= u * (e && c ? -1 : 1);
|
|
6068
6208
|
break;
|
|
@@ -6072,7 +6212,7 @@ function zt(h, t, e) {
|
|
|
6072
6212
|
}
|
|
6073
6213
|
return x;
|
|
6074
6214
|
}
|
|
6075
|
-
async function
|
|
6215
|
+
async function hi(h, t) {
|
|
6076
6216
|
var e;
|
|
6077
6217
|
t === void 0 && (t = {});
|
|
6078
6218
|
const {
|
|
@@ -6088,8 +6228,8 @@ async function ri(h, t) {
|
|
|
6088
6228
|
elementContext: f = "floating",
|
|
6089
6229
|
altBoundary: u = !1,
|
|
6090
6230
|
padding: x = 0
|
|
6091
|
-
} =
|
|
6092
|
-
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)),
|
|
6093
6233
|
boundary: c,
|
|
6094
6234
|
rootBoundary: d,
|
|
6095
6235
|
strategy: l
|
|
@@ -6098,26 +6238,26 @@ async function ri(h, t) {
|
|
|
6098
6238
|
y: s,
|
|
6099
6239
|
width: n.floating.width,
|
|
6100
6240
|
height: n.floating.height
|
|
6101
|
-
} : 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)) || {
|
|
6102
6242
|
x: 1,
|
|
6103
6243
|
y: 1
|
|
6104
6244
|
} : {
|
|
6105
6245
|
x: 1,
|
|
6106
6246
|
y: 1
|
|
6107
|
-
},
|
|
6247
|
+
}, b = ft(o.convertOffsetParentRelativeRectToViewportRelativeRect ? await o.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
6108
6248
|
elements: a,
|
|
6109
6249
|
rect: y,
|
|
6110
|
-
offsetParent:
|
|
6250
|
+
offsetParent: C,
|
|
6111
6251
|
strategy: l
|
|
6112
6252
|
}) : y);
|
|
6113
6253
|
return {
|
|
6114
|
-
top: (
|
|
6115
|
-
bottom: (
|
|
6116
|
-
left: (
|
|
6117
|
-
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
|
|
6118
6258
|
};
|
|
6119
6259
|
}
|
|
6120
|
-
const
|
|
6260
|
+
const di = 50, fi = async (h, t, e) => {
|
|
6121
6261
|
const {
|
|
6122
6262
|
placement: i = "bottom",
|
|
6123
6263
|
strategy: s = "absolute",
|
|
@@ -6125,7 +6265,7 @@ const ai = 50, li = async (h, t, e) => {
|
|
|
6125
6265
|
platform: n
|
|
6126
6266
|
} = e, a = n.detectOverflow ? n : {
|
|
6127
6267
|
...n,
|
|
6128
|
-
detectOverflow:
|
|
6268
|
+
detectOverflow: hi
|
|
6129
6269
|
}, l = await (n.isRTL == null ? void 0 : n.isRTL(t));
|
|
6130
6270
|
let c = await n.getElementRects({
|
|
6131
6271
|
reference: h,
|
|
@@ -6134,20 +6274,20 @@ const ai = 50, li = async (h, t, e) => {
|
|
|
6134
6274
|
}), {
|
|
6135
6275
|
x: d,
|
|
6136
6276
|
y: f
|
|
6137
|
-
} =
|
|
6277
|
+
} = Gt(c, i, l), u = i, x = 0;
|
|
6138
6278
|
const g = {};
|
|
6139
6279
|
for (let E = 0; E < o.length; E++) {
|
|
6140
|
-
const
|
|
6141
|
-
if (!
|
|
6280
|
+
const m = o[E];
|
|
6281
|
+
if (!m)
|
|
6142
6282
|
continue;
|
|
6143
6283
|
const {
|
|
6144
|
-
name:
|
|
6284
|
+
name: w,
|
|
6145
6285
|
fn: y
|
|
6146
|
-
} =
|
|
6147
|
-
x:
|
|
6286
|
+
} = m, {
|
|
6287
|
+
x: C,
|
|
6148
6288
|
y: p,
|
|
6149
|
-
data:
|
|
6150
|
-
reset:
|
|
6289
|
+
data: b,
|
|
6290
|
+
reset: v
|
|
6151
6291
|
} = await y({
|
|
6152
6292
|
x: d,
|
|
6153
6293
|
y: f,
|
|
@@ -6162,17 +6302,17 @@ const ai = 50, li = async (h, t, e) => {
|
|
|
6162
6302
|
floating: t
|
|
6163
6303
|
}
|
|
6164
6304
|
});
|
|
6165
|
-
d =
|
|
6166
|
-
...g[
|
|
6167
|
-
...
|
|
6168
|
-
},
|
|
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({
|
|
6169
6309
|
reference: h,
|
|
6170
6310
|
floating: t,
|
|
6171
6311
|
strategy: s
|
|
6172
|
-
}) :
|
|
6312
|
+
}) : v.rects), {
|
|
6173
6313
|
x: d,
|
|
6174
6314
|
y: f
|
|
6175
|
-
} =
|
|
6315
|
+
} = Gt(c, u, l)), E = -1);
|
|
6176
6316
|
}
|
|
6177
6317
|
return {
|
|
6178
6318
|
x: d,
|
|
@@ -6181,7 +6321,7 @@ const ai = 50, li = async (h, t, e) => {
|
|
|
6181
6321
|
strategy: s,
|
|
6182
6322
|
middlewareData: g
|
|
6183
6323
|
};
|
|
6184
|
-
},
|
|
6324
|
+
}, ui = (h) => ({
|
|
6185
6325
|
name: "arrow",
|
|
6186
6326
|
options: h,
|
|
6187
6327
|
async fn(t) {
|
|
@@ -6196,16 +6336,16 @@ const ai = 50, li = async (h, t, e) => {
|
|
|
6196
6336
|
} = t, {
|
|
6197
6337
|
element: c,
|
|
6198
6338
|
padding: d = 0
|
|
6199
|
-
} =
|
|
6339
|
+
} = st(h, t) || {};
|
|
6200
6340
|
if (c == null)
|
|
6201
6341
|
return {};
|
|
6202
|
-
const f =
|
|
6342
|
+
const f = ce(d), u = {
|
|
6203
6343
|
x: e,
|
|
6204
6344
|
y: i
|
|
6205
|
-
}, x =
|
|
6206
|
-
let
|
|
6207
|
-
(!
|
|
6208
|
-
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;
|
|
6209
6349
|
return {
|
|
6210
6350
|
[x]: u[x] + A,
|
|
6211
6351
|
data: {
|
|
@@ -6218,7 +6358,7 @@ const ai = 50, li = async (h, t, e) => {
|
|
|
6218
6358
|
reset: D
|
|
6219
6359
|
};
|
|
6220
6360
|
}
|
|
6221
|
-
}),
|
|
6361
|
+
}), xi = function(h) {
|
|
6222
6362
|
return h === void 0 && (h = {}), {
|
|
6223
6363
|
name: "flip",
|
|
6224
6364
|
options: h,
|
|
@@ -6238,16 +6378,16 @@ const ai = 50, li = async (h, t, e) => {
|
|
|
6238
6378
|
fallbackStrategy: x = "bestFit",
|
|
6239
6379
|
fallbackAxisSideDirection: g = "none",
|
|
6240
6380
|
flipAlignment: E = !0,
|
|
6241
|
-
...
|
|
6242
|
-
} =
|
|
6381
|
+
...m
|
|
6382
|
+
} = st(h, t);
|
|
6243
6383
|
if ((e = o.arrow) != null && e.alignmentOffset)
|
|
6244
6384
|
return {};
|
|
6245
|
-
const
|
|
6246
|
-
!u &&
|
|
6247
|
-
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), _ = [];
|
|
6248
6388
|
let R = ((i = o.flip) == null ? void 0 : i.overflows) || [];
|
|
6249
|
-
if (d && _.push(T[
|
|
6250
|
-
const L =
|
|
6389
|
+
if (d && _.push(T[w]), f) {
|
|
6390
|
+
const L = si(s, n, p);
|
|
6251
6391
|
_.push(T[L[0]], T[L[1]]);
|
|
6252
6392
|
}
|
|
6253
6393
|
if (R = [...R, {
|
|
@@ -6255,7 +6395,7 @@ const ai = 50, li = async (h, t, e) => {
|
|
|
6255
6395
|
overflows: _
|
|
6256
6396
|
}], !_.every((L) => L <= 0)) {
|
|
6257
6397
|
var S, O;
|
|
6258
|
-
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];
|
|
6259
6399
|
if (H && (!(f === "alignment" ? y !== V(H) : !1) || // We leave the current main axis only if every placement on that axis
|
|
6260
6400
|
// overflows the main axis.
|
|
6261
6401
|
R.every((k) => V(k.placement) === y ? k.overflows[0] > 0 : !0)))
|
|
@@ -6274,14 +6414,14 @@ const ai = 50, li = async (h, t, e) => {
|
|
|
6274
6414
|
case "bestFit": {
|
|
6275
6415
|
var M;
|
|
6276
6416
|
const A = (M = R.filter((k) => {
|
|
6277
|
-
if (
|
|
6417
|
+
if (v) {
|
|
6278
6418
|
const N = V(k.placement);
|
|
6279
6419
|
return N === y || // Create a bias to the `y` side axis due to horizontal
|
|
6280
6420
|
// reading directions favoring greater width.
|
|
6281
6421
|
N === "y";
|
|
6282
6422
|
}
|
|
6283
6423
|
return !0;
|
|
6284
|
-
}).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];
|
|
6285
6425
|
A && (D = A);
|
|
6286
6426
|
break;
|
|
6287
6427
|
}
|
|
@@ -6299,13 +6439,13 @@ const ai = 50, li = async (h, t, e) => {
|
|
|
6299
6439
|
return {};
|
|
6300
6440
|
}
|
|
6301
6441
|
};
|
|
6302
|
-
},
|
|
6303
|
-
async function
|
|
6442
|
+
}, gi = /* @__PURE__ */ new Set(["left", "top"]);
|
|
6443
|
+
async function mi(h, t) {
|
|
6304
6444
|
const {
|
|
6305
6445
|
placement: e,
|
|
6306
6446
|
platform: i,
|
|
6307
6447
|
elements: s
|
|
6308
|
-
} = 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);
|
|
6309
6449
|
let {
|
|
6310
6450
|
mainAxis: u,
|
|
6311
6451
|
crossAxis: x,
|
|
@@ -6327,7 +6467,7 @@ async function fi(h, t) {
|
|
|
6327
6467
|
y: x * d
|
|
6328
6468
|
};
|
|
6329
6469
|
}
|
|
6330
|
-
const
|
|
6470
|
+
const wi = function(h) {
|
|
6331
6471
|
return h === void 0 && (h = 0), {
|
|
6332
6472
|
name: "offset",
|
|
6333
6473
|
options: h,
|
|
@@ -6338,7 +6478,7 @@ const ui = function(h) {
|
|
|
6338
6478
|
y: o,
|
|
6339
6479
|
placement: n,
|
|
6340
6480
|
middlewareData: a
|
|
6341
|
-
} = t, l = await
|
|
6481
|
+
} = t, l = await mi(t, h);
|
|
6342
6482
|
return n === ((e = a.offset) == null ? void 0 : e.placement) && (i = a.arrow) != null && i.alignmentOffset ? {} : {
|
|
6343
6483
|
x: s + l.x,
|
|
6344
6484
|
y: o + l.y,
|
|
@@ -6349,7 +6489,7 @@ const ui = function(h) {
|
|
|
6349
6489
|
};
|
|
6350
6490
|
}
|
|
6351
6491
|
};
|
|
6352
|
-
},
|
|
6492
|
+
}, Ei = function(h) {
|
|
6353
6493
|
return h === void 0 && (h = {}), {
|
|
6354
6494
|
name: "shift",
|
|
6355
6495
|
options: h,
|
|
@@ -6363,41 +6503,41 @@ const ui = function(h) {
|
|
|
6363
6503
|
mainAxis: n = !0,
|
|
6364
6504
|
crossAxis: a = !1,
|
|
6365
6505
|
limiter: l = {
|
|
6366
|
-
fn: (
|
|
6506
|
+
fn: (w) => {
|
|
6367
6507
|
let {
|
|
6368
6508
|
x: y,
|
|
6369
|
-
y:
|
|
6370
|
-
} =
|
|
6509
|
+
y: C
|
|
6510
|
+
} = w;
|
|
6371
6511
|
return {
|
|
6372
6512
|
x: y,
|
|
6373
|
-
y:
|
|
6513
|
+
y: C
|
|
6374
6514
|
};
|
|
6375
6515
|
}
|
|
6376
6516
|
},
|
|
6377
6517
|
...c
|
|
6378
|
-
} =
|
|
6518
|
+
} = st(h, t), d = {
|
|
6379
6519
|
x: e,
|
|
6380
6520
|
y: i
|
|
6381
|
-
}, 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);
|
|
6382
6522
|
let g = d[x], E = d[u];
|
|
6383
6523
|
if (n) {
|
|
6384
|
-
const
|
|
6385
|
-
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);
|
|
6386
6526
|
}
|
|
6387
6527
|
if (a) {
|
|
6388
|
-
const
|
|
6389
|
-
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);
|
|
6390
6530
|
}
|
|
6391
|
-
const
|
|
6531
|
+
const m = l.fn({
|
|
6392
6532
|
...t,
|
|
6393
6533
|
[x]: g,
|
|
6394
6534
|
[u]: E
|
|
6395
6535
|
});
|
|
6396
6536
|
return {
|
|
6397
|
-
...
|
|
6537
|
+
...m,
|
|
6398
6538
|
data: {
|
|
6399
|
-
x:
|
|
6400
|
-
y:
|
|
6539
|
+
x: m.x - e,
|
|
6540
|
+
y: m.y - i,
|
|
6401
6541
|
enabled: {
|
|
6402
6542
|
[x]: n,
|
|
6403
6543
|
[u]: a
|
|
@@ -6411,7 +6551,7 @@ function wt() {
|
|
|
6411
6551
|
return typeof window < "u";
|
|
6412
6552
|
}
|
|
6413
6553
|
function Q(h) {
|
|
6414
|
-
return
|
|
6554
|
+
return he(h) ? (h.nodeName || "").toLowerCase() : "#document";
|
|
6415
6555
|
}
|
|
6416
6556
|
function B(h) {
|
|
6417
6557
|
var t;
|
|
@@ -6419,9 +6559,9 @@ function B(h) {
|
|
|
6419
6559
|
}
|
|
6420
6560
|
function F(h) {
|
|
6421
6561
|
var t;
|
|
6422
|
-
return (t = (
|
|
6562
|
+
return (t = (he(h) ? h.ownerDocument : h.document) || window.document) == null ? void 0 : t.documentElement;
|
|
6423
6563
|
}
|
|
6424
|
-
function
|
|
6564
|
+
function he(h) {
|
|
6425
6565
|
return wt() ? h instanceof Node || h instanceof B(h).Node : !1;
|
|
6426
6566
|
}
|
|
6427
6567
|
function X(h) {
|
|
@@ -6430,10 +6570,10 @@ function X(h) {
|
|
|
6430
6570
|
function W(h) {
|
|
6431
6571
|
return wt() ? h instanceof HTMLElement || h instanceof B(h).HTMLElement : !1;
|
|
6432
6572
|
}
|
|
6433
|
-
function
|
|
6573
|
+
function Ut(h) {
|
|
6434
6574
|
return !wt() || typeof ShadowRoot > "u" ? !1 : h instanceof ShadowRoot || h instanceof B(h).ShadowRoot;
|
|
6435
6575
|
}
|
|
6436
|
-
function
|
|
6576
|
+
function nt(h) {
|
|
6437
6577
|
const {
|
|
6438
6578
|
overflow: t,
|
|
6439
6579
|
overflowX: e,
|
|
@@ -6442,10 +6582,10 @@ function ot(h) {
|
|
|
6442
6582
|
} = K(h);
|
|
6443
6583
|
return /auto|scroll|overlay|hidden|clip/.test(t + i + e) && s !== "inline" && s !== "contents";
|
|
6444
6584
|
}
|
|
6445
|
-
function
|
|
6585
|
+
function pi(h) {
|
|
6446
6586
|
return /^(table|td|th)$/.test(Q(h));
|
|
6447
6587
|
}
|
|
6448
|
-
function
|
|
6588
|
+
function Et(h) {
|
|
6449
6589
|
try {
|
|
6450
6590
|
if (h.matches(":popover-open"))
|
|
6451
6591
|
return !0;
|
|
@@ -6457,25 +6597,25 @@ function mt(h) {
|
|
|
6457
6597
|
return !1;
|
|
6458
6598
|
}
|
|
6459
6599
|
}
|
|
6460
|
-
const
|
|
6461
|
-
let
|
|
6462
|
-
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) {
|
|
6463
6603
|
const t = X(h) ? K(h) : h;
|
|
6464
|
-
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 || "");
|
|
6465
6605
|
}
|
|
6466
|
-
function
|
|
6606
|
+
function bi(h) {
|
|
6467
6607
|
let t = P(h);
|
|
6468
6608
|
for (; W(t) && !J(t); ) {
|
|
6469
|
-
if (
|
|
6609
|
+
if (Dt(t))
|
|
6470
6610
|
return t;
|
|
6471
|
-
if (
|
|
6611
|
+
if (Et(t))
|
|
6472
6612
|
return null;
|
|
6473
6613
|
t = P(t);
|
|
6474
6614
|
}
|
|
6475
6615
|
return null;
|
|
6476
6616
|
}
|
|
6477
|
-
function
|
|
6478
|
-
return
|
|
6617
|
+
function Nt() {
|
|
6618
|
+
return bt == null && (bt = typeof CSS < "u" && CSS.supports && CSS.supports("-webkit-backdrop-filter", "none")), bt;
|
|
6479
6619
|
}
|
|
6480
6620
|
function J(h) {
|
|
6481
6621
|
return /^(html|body|#document)$/.test(Q(h));
|
|
@@ -6483,7 +6623,7 @@ function J(h) {
|
|
|
6483
6623
|
function K(h) {
|
|
6484
6624
|
return B(h).getComputedStyle(h);
|
|
6485
6625
|
}
|
|
6486
|
-
function
|
|
6626
|
+
function pt(h) {
|
|
6487
6627
|
return X(h) ? {
|
|
6488
6628
|
scrollLeft: h.scrollLeft,
|
|
6489
6629
|
scrollTop: h.scrollTop
|
|
@@ -6499,108 +6639,108 @@ function P(h) {
|
|
|
6499
6639
|
// Step into the shadow DOM of the parent of a slotted node.
|
|
6500
6640
|
h.assignedSlot || // DOM Element detected.
|
|
6501
6641
|
h.parentNode || // ShadowRoot detected.
|
|
6502
|
-
|
|
6642
|
+
Ut(h) && h.host || // Fallback.
|
|
6503
6643
|
F(h)
|
|
6504
6644
|
);
|
|
6505
|
-
return
|
|
6645
|
+
return Ut(t) ? t.host : t;
|
|
6506
6646
|
}
|
|
6507
|
-
function
|
|
6647
|
+
function de(h) {
|
|
6508
6648
|
const t = P(h);
|
|
6509
|
-
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);
|
|
6510
6650
|
}
|
|
6511
|
-
function
|
|
6651
|
+
function it(h, t, e) {
|
|
6512
6652
|
var i;
|
|
6513
6653
|
t === void 0 && (t = []), e === void 0 && (e = !0);
|
|
6514
|
-
const s =
|
|
6654
|
+
const s = de(h), o = s === ((i = h.ownerDocument) == null ? void 0 : i.body), n = B(s);
|
|
6515
6655
|
if (o) {
|
|
6516
|
-
const a =
|
|
6517
|
-
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) : []);
|
|
6518
6658
|
} else
|
|
6519
|
-
return t.concat(s,
|
|
6659
|
+
return t.concat(s, it(s, [], e));
|
|
6520
6660
|
}
|
|
6521
|
-
function
|
|
6661
|
+
function _t(h) {
|
|
6522
6662
|
return h.parent && Object.getPrototypeOf(h.parent) ? h.frameElement : null;
|
|
6523
6663
|
}
|
|
6524
|
-
function
|
|
6664
|
+
function fe(h) {
|
|
6525
6665
|
const t = K(h);
|
|
6526
6666
|
let e = parseFloat(t.width) || 0, i = parseFloat(t.height) || 0;
|
|
6527
|
-
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;
|
|
6528
6668
|
return a && (e = o, i = n), {
|
|
6529
6669
|
width: e,
|
|
6530
6670
|
height: i,
|
|
6531
6671
|
$: a
|
|
6532
6672
|
};
|
|
6533
6673
|
}
|
|
6534
|
-
function
|
|
6674
|
+
function kt(h) {
|
|
6535
6675
|
return X(h) ? h : h.contextElement;
|
|
6536
6676
|
}
|
|
6537
|
-
function
|
|
6538
|
-
const t =
|
|
6677
|
+
function j(h) {
|
|
6678
|
+
const t = kt(h);
|
|
6539
6679
|
if (!W(t))
|
|
6540
6680
|
return Y(1);
|
|
6541
6681
|
const e = t.getBoundingClientRect(), {
|
|
6542
6682
|
width: i,
|
|
6543
6683
|
height: s,
|
|
6544
6684
|
$: o
|
|
6545
|
-
} =
|
|
6546
|
-
let n = (o ?
|
|
6685
|
+
} = fe(t);
|
|
6686
|
+
let n = (o ? ht(e.width) : e.width) / i, a = (o ? ht(e.height) : e.height) / s;
|
|
6547
6687
|
return (!n || !Number.isFinite(n)) && (n = 1), (!a || !Number.isFinite(a)) && (a = 1), {
|
|
6548
6688
|
x: n,
|
|
6549
6689
|
y: a
|
|
6550
6690
|
};
|
|
6551
6691
|
}
|
|
6552
|
-
const
|
|
6553
|
-
function
|
|
6692
|
+
const Ri = /* @__PURE__ */ Y(0);
|
|
6693
|
+
function ue(h) {
|
|
6554
6694
|
const t = B(h);
|
|
6555
|
-
return !
|
|
6695
|
+
return !Nt() || !t.visualViewport ? Ri : {
|
|
6556
6696
|
x: t.visualViewport.offsetLeft,
|
|
6557
6697
|
y: t.visualViewport.offsetTop
|
|
6558
6698
|
};
|
|
6559
6699
|
}
|
|
6560
|
-
function
|
|
6700
|
+
function vi(h, t, e) {
|
|
6561
6701
|
return t === void 0 && (t = !1), !e || t && e !== B(h) ? !1 : t;
|
|
6562
6702
|
}
|
|
6563
6703
|
function U(h, t, e, i) {
|
|
6564
6704
|
t === void 0 && (t = !1), e === void 0 && (e = !1);
|
|
6565
|
-
const s = h.getBoundingClientRect(), o =
|
|
6705
|
+
const s = h.getBoundingClientRect(), o = kt(h);
|
|
6566
6706
|
let n = Y(1);
|
|
6567
|
-
t && (i ? X(i) && (n =
|
|
6568
|
-
const a =
|
|
6707
|
+
t && (i ? X(i) && (n = j(i)) : n = j(h));
|
|
6708
|
+
const a = vi(o, e, i) ? ue(o) : Y(0);
|
|
6569
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;
|
|
6570
6710
|
if (o) {
|
|
6571
6711
|
const u = B(o), x = i && X(i) ? B(i) : i;
|
|
6572
|
-
let g = u, E =
|
|
6712
|
+
let g = u, E = _t(g);
|
|
6573
6713
|
for (; E && i && x !== g; ) {
|
|
6574
|
-
const
|
|
6575
|
-
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);
|
|
6576
6716
|
}
|
|
6577
6717
|
}
|
|
6578
|
-
return
|
|
6718
|
+
return ft({
|
|
6579
6719
|
width: d,
|
|
6580
6720
|
height: f,
|
|
6581
6721
|
x: l,
|
|
6582
6722
|
y: c
|
|
6583
6723
|
});
|
|
6584
6724
|
}
|
|
6585
|
-
function
|
|
6586
|
-
const e =
|
|
6725
|
+
function yt(h, t) {
|
|
6726
|
+
const e = pt(h).scrollLeft;
|
|
6587
6727
|
return t ? t.left + e : U(F(h)).left + e;
|
|
6588
6728
|
}
|
|
6589
|
-
function
|
|
6590
|
-
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;
|
|
6591
6731
|
return {
|
|
6592
6732
|
x: i,
|
|
6593
6733
|
y: s
|
|
6594
6734
|
};
|
|
6595
6735
|
}
|
|
6596
|
-
function
|
|
6736
|
+
function Ii(h) {
|
|
6597
6737
|
let {
|
|
6598
6738
|
elements: t,
|
|
6599
6739
|
rect: e,
|
|
6600
6740
|
offsetParent: i,
|
|
6601
6741
|
strategy: s
|
|
6602
6742
|
} = h;
|
|
6603
|
-
const o = s === "fixed", n = F(i), a = t ?
|
|
6743
|
+
const o = s === "fixed", n = F(i), a = t ? Et(t.floating) : !1;
|
|
6604
6744
|
if (i === n || a && o)
|
|
6605
6745
|
return e;
|
|
6606
6746
|
let l = {
|
|
@@ -6608,11 +6748,11 @@ function Ci(h) {
|
|
|
6608
6748
|
scrollTop: 0
|
|
6609
6749
|
}, c = Y(1);
|
|
6610
6750
|
const d = Y(0), f = W(i);
|
|
6611
|
-
if ((f || !f && !o) && ((Q(i) !== "body" ||
|
|
6751
|
+
if ((f || !f && !o) && ((Q(i) !== "body" || nt(n)) && (l = pt(i)), f)) {
|
|
6612
6752
|
const x = U(i);
|
|
6613
|
-
c =
|
|
6753
|
+
c = j(i), d.x = x.x + i.clientLeft, d.y = x.y + i.clientTop;
|
|
6614
6754
|
}
|
|
6615
|
-
const u = n && !f && !o ?
|
|
6755
|
+
const u = n && !f && !o ? xe(n, l) : Y(0);
|
|
6616
6756
|
return {
|
|
6617
6757
|
width: e.width * c.x,
|
|
6618
6758
|
height: e.height * c.y,
|
|
@@ -6620,12 +6760,12 @@ function Ci(h) {
|
|
|
6620
6760
|
y: e.y * c.y - l.scrollTop * c.y + d.y + u.y
|
|
6621
6761
|
};
|
|
6622
6762
|
}
|
|
6623
|
-
function
|
|
6763
|
+
function _i(h) {
|
|
6624
6764
|
return Array.from(h.getClientRects());
|
|
6625
6765
|
}
|
|
6626
|
-
function
|
|
6627
|
-
const t = F(h), e =
|
|
6628
|
-
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);
|
|
6629
6769
|
const a = -e.scrollTop;
|
|
6630
6770
|
return K(i).direction === "rtl" && (n += $(t.clientWidth, i.clientWidth) - s), {
|
|
6631
6771
|
width: s,
|
|
@@ -6634,20 +6774,20 @@ function Ri(h) {
|
|
|
6634
6774
|
y: a
|
|
6635
6775
|
};
|
|
6636
6776
|
}
|
|
6637
|
-
const
|
|
6638
|
-
function
|
|
6777
|
+
const Zt = 25;
|
|
6778
|
+
function Si(h, t) {
|
|
6639
6779
|
const e = B(h), i = F(h), s = e.visualViewport;
|
|
6640
6780
|
let o = i.clientWidth, n = i.clientHeight, a = 0, l = 0;
|
|
6641
6781
|
if (s) {
|
|
6642
6782
|
o = s.width, n = s.height;
|
|
6643
|
-
const d =
|
|
6783
|
+
const d = Nt();
|
|
6644
6784
|
(!d || d && t === "fixed") && (a = s.offsetLeft, l = s.offsetTop);
|
|
6645
6785
|
}
|
|
6646
|
-
const c =
|
|
6786
|
+
const c = yt(i);
|
|
6647
6787
|
if (c <= 0) {
|
|
6648
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);
|
|
6649
|
-
g <=
|
|
6650
|
-
} else c <=
|
|
6789
|
+
g <= Zt && (o -= g);
|
|
6790
|
+
} else c <= Zt && (o += c);
|
|
6651
6791
|
return {
|
|
6652
6792
|
width: o,
|
|
6653
6793
|
height: n,
|
|
@@ -6655,8 +6795,8 @@ function Ii(h, t) {
|
|
|
6655
6795
|
y: l
|
|
6656
6796
|
};
|
|
6657
6797
|
}
|
|
6658
|
-
function
|
|
6659
|
-
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;
|
|
6660
6800
|
return {
|
|
6661
6801
|
width: n,
|
|
6662
6802
|
height: a,
|
|
@@ -6664,16 +6804,16 @@ function vi(h, t) {
|
|
|
6664
6804
|
y: c
|
|
6665
6805
|
};
|
|
6666
6806
|
}
|
|
6667
|
-
function
|
|
6807
|
+
function jt(h, t, e) {
|
|
6668
6808
|
let i;
|
|
6669
6809
|
if (t === "viewport")
|
|
6670
|
-
i =
|
|
6810
|
+
i = Si(h, e);
|
|
6671
6811
|
else if (t === "document")
|
|
6672
|
-
i =
|
|
6812
|
+
i = Ti(F(h));
|
|
6673
6813
|
else if (X(t))
|
|
6674
|
-
i =
|
|
6814
|
+
i = Oi(t, e);
|
|
6675
6815
|
else {
|
|
6676
|
-
const s =
|
|
6816
|
+
const s = ue(h);
|
|
6677
6817
|
i = {
|
|
6678
6818
|
x: t.x - s.x,
|
|
6679
6819
|
y: t.y - s.y,
|
|
@@ -6681,36 +6821,36 @@ function Ut(h, t, e) {
|
|
|
6681
6821
|
height: t.height
|
|
6682
6822
|
};
|
|
6683
6823
|
}
|
|
6684
|
-
return
|
|
6824
|
+
return ft(i);
|
|
6685
6825
|
}
|
|
6686
|
-
function
|
|
6826
|
+
function ge(h, t) {
|
|
6687
6827
|
const e = P(h);
|
|
6688
|
-
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);
|
|
6689
6829
|
}
|
|
6690
|
-
function
|
|
6830
|
+
function Li(h, t) {
|
|
6691
6831
|
const e = t.get(h);
|
|
6692
6832
|
if (e)
|
|
6693
6833
|
return e;
|
|
6694
|
-
let i =
|
|
6834
|
+
let i = it(h, [], !1).filter((a) => X(a) && Q(a) !== "body"), s = null;
|
|
6695
6835
|
const o = K(h).position === "fixed";
|
|
6696
6836
|
let n = o ? P(h) : h;
|
|
6697
6837
|
for (; X(n) && !J(n); ) {
|
|
6698
|
-
const a = K(n), l =
|
|
6699
|
-
!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);
|
|
6700
6840
|
}
|
|
6701
6841
|
return t.set(h, i), i;
|
|
6702
6842
|
}
|
|
6703
|
-
function
|
|
6843
|
+
function Mi(h) {
|
|
6704
6844
|
let {
|
|
6705
6845
|
element: t,
|
|
6706
6846
|
boundary: e,
|
|
6707
6847
|
rootBoundary: i,
|
|
6708
6848
|
strategy: s
|
|
6709
6849
|
} = h;
|
|
6710
|
-
const n = [...e === "clippingAncestors" ?
|
|
6850
|
+
const n = [...e === "clippingAncestors" ? Et(t) ? [] : Li(t, this._c) : [].concat(e), i], a = jt(t, n[0], s);
|
|
6711
6851
|
let l = a.top, c = a.right, d = a.bottom, f = a.left;
|
|
6712
6852
|
for (let u = 1; u < n.length; u++) {
|
|
6713
|
-
const x =
|
|
6853
|
+
const x = jt(t, n[u], s);
|
|
6714
6854
|
l = $(x.top, l), c = q(x.right, c), d = q(x.bottom, d), f = $(x.left, f);
|
|
6715
6855
|
}
|
|
6716
6856
|
return {
|
|
@@ -6720,17 +6860,17 @@ function Ti(h) {
|
|
|
6720
6860
|
y: l
|
|
6721
6861
|
};
|
|
6722
6862
|
}
|
|
6723
|
-
function
|
|
6863
|
+
function Ai(h) {
|
|
6724
6864
|
const {
|
|
6725
6865
|
width: t,
|
|
6726
6866
|
height: e
|
|
6727
|
-
} =
|
|
6867
|
+
} = fe(h);
|
|
6728
6868
|
return {
|
|
6729
6869
|
width: t,
|
|
6730
6870
|
height: e
|
|
6731
6871
|
};
|
|
6732
6872
|
}
|
|
6733
|
-
function
|
|
6873
|
+
function Hi(h, t, e) {
|
|
6734
6874
|
const i = W(t), s = F(t), o = e === "fixed", n = U(h, !0, o, t);
|
|
6735
6875
|
let a = {
|
|
6736
6876
|
scrollLeft: 0,
|
|
@@ -6738,15 +6878,15 @@ function Oi(h, t, e) {
|
|
|
6738
6878
|
};
|
|
6739
6879
|
const l = Y(0);
|
|
6740
6880
|
function c() {
|
|
6741
|
-
l.x =
|
|
6881
|
+
l.x = yt(s);
|
|
6742
6882
|
}
|
|
6743
6883
|
if (i || !i && !o)
|
|
6744
|
-
if ((Q(t) !== "body" ||
|
|
6884
|
+
if ((Q(t) !== "body" || nt(s)) && (a = pt(t)), i) {
|
|
6745
6885
|
const x = U(t, !0, o, t);
|
|
6746
6886
|
l.x = x.x + t.clientLeft, l.y = x.y + t.clientTop;
|
|
6747
6887
|
} else s && c();
|
|
6748
6888
|
o && !i && s && c();
|
|
6749
|
-
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;
|
|
6750
6890
|
return {
|
|
6751
6891
|
x: f,
|
|
6752
6892
|
y: u,
|
|
@@ -6754,10 +6894,10 @@ function Oi(h, t, e) {
|
|
|
6754
6894
|
height: n.height
|
|
6755
6895
|
};
|
|
6756
6896
|
}
|
|
6757
|
-
function
|
|
6897
|
+
function Rt(h) {
|
|
6758
6898
|
return K(h).position === "static";
|
|
6759
6899
|
}
|
|
6760
|
-
function
|
|
6900
|
+
function qt(h, t) {
|
|
6761
6901
|
if (!W(h) || K(h).position === "fixed")
|
|
6762
6902
|
return null;
|
|
6763
6903
|
if (t)
|
|
@@ -6765,28 +6905,28 @@ function jt(h, t) {
|
|
|
6765
6905
|
let e = h.offsetParent;
|
|
6766
6906
|
return F(h) === e && (e = e.ownerDocument.body), e;
|
|
6767
6907
|
}
|
|
6768
|
-
function
|
|
6908
|
+
function me(h, t) {
|
|
6769
6909
|
const e = B(h);
|
|
6770
|
-
if (
|
|
6910
|
+
if (Et(h))
|
|
6771
6911
|
return e;
|
|
6772
6912
|
if (!W(h)) {
|
|
6773
6913
|
let s = P(h);
|
|
6774
6914
|
for (; s && !J(s); ) {
|
|
6775
|
-
if (X(s) && !
|
|
6915
|
+
if (X(s) && !Rt(s))
|
|
6776
6916
|
return s;
|
|
6777
6917
|
s = P(s);
|
|
6778
6918
|
}
|
|
6779
6919
|
return e;
|
|
6780
6920
|
}
|
|
6781
|
-
let i =
|
|
6782
|
-
for (; i &&
|
|
6783
|
-
i =
|
|
6784
|
-
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;
|
|
6785
6925
|
}
|
|
6786
|
-
const
|
|
6787
|
-
const t = this.getOffsetParent ||
|
|
6926
|
+
const Di = async function(h) {
|
|
6927
|
+
const t = this.getOffsetParent || me, e = this.getDimensions, i = await e(h.floating);
|
|
6788
6928
|
return {
|
|
6789
|
-
reference:
|
|
6929
|
+
reference: Hi(h.reference, await t(h.floating), h.strategy),
|
|
6790
6930
|
floating: {
|
|
6791
6931
|
x: 0,
|
|
6792
6932
|
y: 0,
|
|
@@ -6795,25 +6935,25 @@ const Li = async function(h) {
|
|
|
6795
6935
|
}
|
|
6796
6936
|
};
|
|
6797
6937
|
};
|
|
6798
|
-
function
|
|
6938
|
+
function Ni(h) {
|
|
6799
6939
|
return K(h).direction === "rtl";
|
|
6800
6940
|
}
|
|
6801
|
-
const
|
|
6802
|
-
convertOffsetParentRelativeRectToViewportRelativeRect:
|
|
6941
|
+
const ki = {
|
|
6942
|
+
convertOffsetParentRelativeRectToViewportRelativeRect: Ii,
|
|
6803
6943
|
getDocumentElement: F,
|
|
6804
|
-
getClippingRect:
|
|
6805
|
-
getOffsetParent:
|
|
6806
|
-
getElementRects:
|
|
6807
|
-
getClientRects:
|
|
6808
|
-
getDimensions:
|
|
6809
|
-
getScale:
|
|
6944
|
+
getClippingRect: Mi,
|
|
6945
|
+
getOffsetParent: me,
|
|
6946
|
+
getElementRects: Di,
|
|
6947
|
+
getClientRects: _i,
|
|
6948
|
+
getDimensions: Ai,
|
|
6949
|
+
getScale: j,
|
|
6810
6950
|
isElement: X,
|
|
6811
|
-
isRTL:
|
|
6951
|
+
isRTL: Ni
|
|
6812
6952
|
};
|
|
6813
|
-
function
|
|
6953
|
+
function we(h, t) {
|
|
6814
6954
|
return h.x === t.x && h.y === t.y && h.width === t.width && h.height === t.height;
|
|
6815
6955
|
}
|
|
6816
|
-
function
|
|
6956
|
+
function Bi(h, t) {
|
|
6817
6957
|
let e = null, i;
|
|
6818
6958
|
const s = F(h);
|
|
6819
6959
|
function o() {
|
|
@@ -6830,36 +6970,36 @@ function Hi(h, t) {
|
|
|
6830
6970
|
} = c;
|
|
6831
6971
|
if (a || t(), !u || !x)
|
|
6832
6972
|
return;
|
|
6833
|
-
const g =
|
|
6834
|
-
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",
|
|
6835
6975
|
threshold: $(0, q(1, l)) || 1
|
|
6836
6976
|
};
|
|
6837
6977
|
let p = !0;
|
|
6838
|
-
function
|
|
6839
|
-
const
|
|
6840
|
-
if (
|
|
6978
|
+
function b(v) {
|
|
6979
|
+
const I = v[0].intersectionRatio;
|
|
6980
|
+
if (I !== l) {
|
|
6841
6981
|
if (!p)
|
|
6842
6982
|
return n();
|
|
6843
|
-
|
|
6983
|
+
I ? n(!1, I) : i = setTimeout(() => {
|
|
6844
6984
|
n(!1, 1e-7);
|
|
6845
6985
|
}, 1e3);
|
|
6846
6986
|
}
|
|
6847
|
-
|
|
6987
|
+
I === 1 && !we(c, h.getBoundingClientRect()) && n(), p = !1;
|
|
6848
6988
|
}
|
|
6849
6989
|
try {
|
|
6850
|
-
e = new IntersectionObserver(
|
|
6851
|
-
...
|
|
6990
|
+
e = new IntersectionObserver(b, {
|
|
6991
|
+
...C,
|
|
6852
6992
|
// Handle <iframe>s
|
|
6853
6993
|
root: s.ownerDocument
|
|
6854
6994
|
});
|
|
6855
6995
|
} catch {
|
|
6856
|
-
e = new IntersectionObserver(
|
|
6996
|
+
e = new IntersectionObserver(b, C);
|
|
6857
6997
|
}
|
|
6858
6998
|
e.observe(h);
|
|
6859
6999
|
}
|
|
6860
7000
|
return n(!0), o;
|
|
6861
7001
|
}
|
|
6862
|
-
function
|
|
7002
|
+
function Tt(h, t, e, i) {
|
|
6863
7003
|
i === void 0 && (i = {});
|
|
6864
7004
|
const {
|
|
6865
7005
|
ancestorScroll: s = !0,
|
|
@@ -6867,48 +7007,48 @@ function _t(h, t, e, i) {
|
|
|
6867
7007
|
elementResize: n = typeof ResizeObserver == "function",
|
|
6868
7008
|
layoutShift: a = typeof IntersectionObserver == "function",
|
|
6869
7009
|
animationFrame: l = !1
|
|
6870
|
-
} = i, c =
|
|
6871
|
-
d.forEach((
|
|
6872
|
-
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, {
|
|
6873
7013
|
passive: !0
|
|
6874
|
-
}), o &&
|
|
7014
|
+
}), o && w.addEventListener("resize", e);
|
|
6875
7015
|
});
|
|
6876
|
-
const f = c && a ?
|
|
7016
|
+
const f = c && a ? Bi(c, e) : null;
|
|
6877
7017
|
let u = -1, x = null;
|
|
6878
|
-
n && (x = new ResizeObserver((
|
|
6879
|
-
let [y] =
|
|
7018
|
+
n && (x = new ResizeObserver((w) => {
|
|
7019
|
+
let [y] = w;
|
|
6880
7020
|
y && y.target === c && x && t && (x.unobserve(t), cancelAnimationFrame(u), u = requestAnimationFrame(() => {
|
|
6881
|
-
var
|
|
6882
|
-
(
|
|
7021
|
+
var C;
|
|
7022
|
+
(C = x) == null || C.observe(t);
|
|
6883
7023
|
})), e();
|
|
6884
7024
|
}), c && !l && x.observe(c), t && x.observe(t));
|
|
6885
7025
|
let g, E = l ? U(h) : null;
|
|
6886
|
-
l &&
|
|
6887
|
-
function
|
|
6888
|
-
const
|
|
6889
|
-
E && !
|
|
7026
|
+
l && m();
|
|
7027
|
+
function m() {
|
|
7028
|
+
const w = U(h);
|
|
7029
|
+
E && !we(E, w) && e(), E = w, g = requestAnimationFrame(m);
|
|
6890
7030
|
}
|
|
6891
7031
|
return e(), () => {
|
|
6892
|
-
var
|
|
7032
|
+
var w;
|
|
6893
7033
|
d.forEach((y) => {
|
|
6894
7034
|
s && y.removeEventListener("scroll", e), o && y.removeEventListener("resize", e);
|
|
6895
|
-
}), f == null || f(), (
|
|
7035
|
+
}), f == null || f(), (w = x) == null || w.disconnect(), x = null, l && cancelAnimationFrame(g);
|
|
6896
7036
|
};
|
|
6897
7037
|
}
|
|
6898
|
-
const
|
|
7038
|
+
const ut = wi, xt = Ei, Bt = xi, Xi = ui, gt = (h, t, e) => {
|
|
6899
7039
|
const i = /* @__PURE__ */ new Map(), s = {
|
|
6900
|
-
platform:
|
|
7040
|
+
platform: ki,
|
|
6901
7041
|
...e
|
|
6902
7042
|
}, o = {
|
|
6903
7043
|
...s.platform,
|
|
6904
7044
|
_c: i
|
|
6905
7045
|
};
|
|
6906
|
-
return
|
|
7046
|
+
return fi(h, t, {
|
|
6907
7047
|
...s,
|
|
6908
7048
|
platform: o
|
|
6909
7049
|
});
|
|
6910
7050
|
};
|
|
6911
|
-
let
|
|
7051
|
+
let Ki = class {
|
|
6912
7052
|
constructor(t) {
|
|
6913
7053
|
r(this, "ctx");
|
|
6914
7054
|
r(this, "enable", !1);
|
|
@@ -6977,49 +7117,48 @@ let Ni = class {
|
|
|
6977
7117
|
if (!s)
|
|
6978
7118
|
return;
|
|
6979
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;
|
|
6980
|
-
const o =
|
|
6981
|
-
|
|
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({
|
|
6982
7130
|
getBoundingClientRect() {
|
|
6983
|
-
return
|
|
6984
|
-
width: t.visibleWidth,
|
|
6985
|
-
height: t.visibleHeight,
|
|
6986
|
-
x: o,
|
|
6987
|
-
y: n,
|
|
6988
|
-
left: o,
|
|
6989
|
-
right: o + t.visibleWidth,
|
|
6990
|
-
top: n,
|
|
6991
|
-
bottom: n + t.visibleHeight
|
|
6992
|
-
};
|
|
7131
|
+
return o;
|
|
6993
7132
|
}
|
|
6994
7133
|
}, this.floatingEl, {
|
|
6995
7134
|
placement: t.overflowTooltipPlacement,
|
|
6996
|
-
middleware: [
|
|
6997
|
-
}).then((
|
|
6998
|
-
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;
|
|
6999
7138
|
if (Object.assign(this.floatingEl.style, {
|
|
7000
|
-
top: `${
|
|
7001
|
-
left: `${
|
|
7002
|
-
}),
|
|
7003
|
-
const
|
|
7004
|
-
["left", "left-start", "left-end"].includes(
|
|
7005
|
-
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`,
|
|
7006
7145
|
bottom: "",
|
|
7007
7146
|
left: "",
|
|
7008
7147
|
right: "-5px"
|
|
7009
|
-
}) : ["right", "right-start", "right-end"].includes(
|
|
7010
|
-
top: `${
|
|
7148
|
+
}) : ["right", "right-start", "right-end"].includes(d) ? Object.assign(this.arrowEl.style, {
|
|
7149
|
+
top: `${u.y}px`,
|
|
7011
7150
|
bottom: "",
|
|
7012
7151
|
left: "-5px",
|
|
7013
7152
|
right: ""
|
|
7014
|
-
}) : ["bottom", "bottom-start", "bottom-end"].includes(
|
|
7153
|
+
}) : ["bottom", "bottom-start", "bottom-end"].includes(d) ? Object.assign(this.arrowEl.style, {
|
|
7015
7154
|
top: "-5px",
|
|
7016
7155
|
bottom: "",
|
|
7017
|
-
left: `${
|
|
7156
|
+
left: `${u.x}px`,
|
|
7018
7157
|
right: ""
|
|
7019
|
-
}) : ["top", "top-start", "top-end"].includes(
|
|
7158
|
+
}) : ["top", "top-start", "top-end"].includes(d) && Object.assign(this.arrowEl.style, {
|
|
7020
7159
|
top: "",
|
|
7021
7160
|
bottom: "-5px",
|
|
7022
|
-
left: `${
|
|
7161
|
+
left: `${u.x}px`,
|
|
7023
7162
|
right: ""
|
|
7024
7163
|
});
|
|
7025
7164
|
}
|
|
@@ -7032,7 +7171,7 @@ let Ni = class {
|
|
|
7032
7171
|
this.contentEl.remove(), this.arrowEl.remove(), this.floatingEl.remove();
|
|
7033
7172
|
}
|
|
7034
7173
|
};
|
|
7035
|
-
class
|
|
7174
|
+
class Yi {
|
|
7036
7175
|
constructor(t) {
|
|
7037
7176
|
r(this, "editorEl");
|
|
7038
7177
|
r(this, "inputEl");
|
|
@@ -7167,19 +7306,21 @@ class ki {
|
|
|
7167
7306
|
return;
|
|
7168
7307
|
const t = this.inputEl.value;
|
|
7169
7308
|
if (this.cellTarget && this.cellTarget.type === "number" && t !== "" && (this.ctx.emit("cellHideTooltip"), !/^-?\d+(\.\d+)?$/.test(t))) {
|
|
7170
|
-
const
|
|
7171
|
-
this.ctx.emit("cellShowTooltip", this.cellTarget,
|
|
7309
|
+
const d = this.ctx.locale.getText("numberErrorTip");
|
|
7310
|
+
this.ctx.emit("cellShowTooltip", this.cellTarget, d);
|
|
7172
7311
|
}
|
|
7173
7312
|
this.inputEl.style.height = "auto";
|
|
7174
|
-
let e = this.inputEl.scrollHeight
|
|
7175
|
-
|
|
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));
|
|
7176
7317
|
const {
|
|
7177
|
-
stageHeight:
|
|
7178
|
-
footer:
|
|
7179
|
-
header:
|
|
7180
|
-
config: { SCROLLER_TRACK_SIZE:
|
|
7181
|
-
} = this.ctx,
|
|
7182
|
-
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`;
|
|
7183
7324
|
}
|
|
7184
7325
|
startEditByInput(t, e = !1) {
|
|
7185
7326
|
const i = e ? null : t.getValue(), { editorType: s } = t;
|
|
@@ -7193,7 +7334,9 @@ class ki {
|
|
|
7193
7334
|
header: d
|
|
7194
7335
|
} = this.ctx;
|
|
7195
7336
|
let f = this.ctx.body.visibleHeight;
|
|
7196
|
-
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");
|
|
7197
7340
|
}
|
|
7198
7341
|
doneEditByInput() {
|
|
7199
7342
|
if (this.cellTarget && this.cellTarget.editorType === "text") {
|
|
@@ -7237,7 +7380,7 @@ class ki {
|
|
|
7237
7380
|
}
|
|
7238
7381
|
resetEditorStyle() {
|
|
7239
7382
|
const t = this.cellTarget;
|
|
7240
|
-
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");
|
|
7241
7384
|
}
|
|
7242
7385
|
clearEditor() {
|
|
7243
7386
|
this.doneEdit(), this.cellTarget = null, this.selectorArrStr = "", this.ctx.clearSelector(), this.ctx.focusCell = void 0, this.inputEl.blur(), this.ctx.emit("draw");
|
|
@@ -7247,7 +7390,7 @@ class ki {
|
|
|
7247
7390
|
(t = this.editorEl) == null || t.remove();
|
|
7248
7391
|
}
|
|
7249
7392
|
}
|
|
7250
|
-
let
|
|
7393
|
+
let Fi = class {
|
|
7251
7394
|
constructor(t) {
|
|
7252
7395
|
r(this, "ctx");
|
|
7253
7396
|
r(this, "emptyEl");
|
|
@@ -7256,7 +7399,7 @@ let Bi = class {
|
|
|
7256
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 }) => {
|
|
7257
7400
|
const a = s + (o + n) / 2, l = {
|
|
7258
7401
|
display: i === "empty" ? "block" : "none",
|
|
7259
|
-
top:
|
|
7402
|
+
top: this.ctx.toVisualPx(a),
|
|
7260
7403
|
...e
|
|
7261
7404
|
};
|
|
7262
7405
|
Object.assign(this.emptyEl.style, l);
|
|
@@ -7272,7 +7415,7 @@ let Bi = class {
|
|
|
7272
7415
|
this.emptyEl.remove();
|
|
7273
7416
|
}
|
|
7274
7417
|
};
|
|
7275
|
-
class
|
|
7418
|
+
class Wi {
|
|
7276
7419
|
constructor(t) {
|
|
7277
7420
|
r(this, "ctx");
|
|
7278
7421
|
r(this, "observer");
|
|
@@ -7286,14 +7429,14 @@ class Xi {
|
|
|
7286
7429
|
}
|
|
7287
7430
|
init() {
|
|
7288
7431
|
this.observer = new MutationObserver(
|
|
7289
|
-
|
|
7432
|
+
Lt(() => {
|
|
7290
7433
|
const t = this.ctx.overlayerElement.querySelectorAll('[data-auto-height="true"]'), e = /* @__PURE__ */ new Map();
|
|
7291
7434
|
t.forEach((o) => {
|
|
7292
7435
|
const n = Number(o.getAttribute("data-row-index")), a = Number(o.getAttribute("data-col-index"));
|
|
7293
7436
|
if (isNaN(n) || isNaN(a))
|
|
7294
7437
|
return;
|
|
7295
7438
|
const l = o.getBoundingClientRect(), c = `${n}_${a}`;
|
|
7296
|
-
e.set(c,
|
|
7439
|
+
e.set(c, this.ctx.zoomScale.domHeightToLogical(l.height));
|
|
7297
7440
|
});
|
|
7298
7441
|
const i = this.ctx.database.getOverlayerAutoHeightMap();
|
|
7299
7442
|
if (!this.arerMapsEqual(i, e)) {
|
|
@@ -7311,13 +7454,14 @@ class Xi {
|
|
|
7311
7454
|
const e = this.ctx.overlayerElement;
|
|
7312
7455
|
e.replaceChildren(), Object.assign(e.style, t.style), t.views.forEach((i) => {
|
|
7313
7456
|
const s = document.createElement("div");
|
|
7314
|
-
s.className = i.class,
|
|
7457
|
+
s.className = i.class, this.ctx.zoomScale.assignScaledStyle(s, i.style), i.views.forEach((o) => {
|
|
7315
7458
|
const n = document.createElement("div");
|
|
7316
|
-
|
|
7317
|
-
const l =
|
|
7318
|
-
|
|
7319
|
-
|
|
7320
|
-
|
|
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);
|
|
7321
7465
|
}), s.appendChild(n);
|
|
7322
7466
|
}), e.appendChild(s);
|
|
7323
7467
|
});
|
|
@@ -7348,8 +7492,8 @@ class Xi {
|
|
|
7348
7492
|
config: { SCROLLER_TRACK_SIZE: i, CSS_PREFIX: s }
|
|
7349
7493
|
} = this.ctx, { visibleWidth: o, visibleHeight: n, renderCellHeaders: a } = this.ctx.header;
|
|
7350
7494
|
let l = [], c = [], d = [];
|
|
7351
|
-
a.forEach((
|
|
7352
|
-
|
|
7495
|
+
a.forEach((m) => {
|
|
7496
|
+
m.render && (m.fixed === "left" ? c.push(m) : m.fixed === "right" ? d.push(m) : l.push(m));
|
|
7353
7497
|
});
|
|
7354
7498
|
const f = e - i, u = {
|
|
7355
7499
|
key: "left",
|
|
@@ -7400,9 +7544,9 @@ class Xi {
|
|
|
7400
7544
|
getBody() {
|
|
7401
7545
|
const t = [], e = [], i = [];
|
|
7402
7546
|
let s = this.ctx.body.renderRows;
|
|
7403
|
-
this.ctx.config.FOOTER_FIXED || (s = s.concat(this.ctx.footer.renderRows)), s.forEach((
|
|
7404
|
-
|
|
7405
|
-
|
|
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));
|
|
7406
7550
|
});
|
|
7407
7551
|
});
|
|
7408
7552
|
const {
|
|
@@ -7458,8 +7602,8 @@ class Xi {
|
|
|
7458
7602
|
getFooter() {
|
|
7459
7603
|
const t = [], e = [], i = [];
|
|
7460
7604
|
this.ctx.footer.renderRows.forEach((E) => {
|
|
7461
|
-
E.cells.forEach((
|
|
7462
|
-
|
|
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));
|
|
7463
7607
|
});
|
|
7464
7608
|
});
|
|
7465
7609
|
const {
|
|
@@ -7513,7 +7657,7 @@ class Xi {
|
|
|
7513
7657
|
};
|
|
7514
7658
|
}
|
|
7515
7659
|
}
|
|
7516
|
-
class
|
|
7660
|
+
class Jt {
|
|
7517
7661
|
constructor(t, e = [], i = {}) {
|
|
7518
7662
|
r(this, "container");
|
|
7519
7663
|
r(this, "menuData");
|
|
@@ -7547,7 +7691,7 @@ class Zt {
|
|
|
7547
7691
|
const o = this.createElement("span", "e-virt-table-menu-item-text");
|
|
7548
7692
|
if (o.textContent = t.label || "", s.appendChild(o), i.appendChild(s), (n = t.children) != null && n.length) {
|
|
7549
7693
|
const a = this.createElement("span", "e-virt-table-menu-arrow");
|
|
7550
|
-
a.innerHTML =
|
|
7694
|
+
a.innerHTML = ct, i.appendChild(a);
|
|
7551
7695
|
const l = this.createSubmenu(t.children);
|
|
7552
7696
|
i._submenu = l, this.container.appendChild(l);
|
|
7553
7697
|
}
|
|
@@ -7601,10 +7745,10 @@ class Zt {
|
|
|
7601
7745
|
async showSubmenu(t, e) {
|
|
7602
7746
|
if (this.activeSubmenus.has(e)) return;
|
|
7603
7747
|
this.activeSubmenus.add(e), e.classList.add("show");
|
|
7604
|
-
const i =
|
|
7605
|
-
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, {
|
|
7606
7750
|
placement: c,
|
|
7607
|
-
middleware: [
|
|
7751
|
+
middleware: [ut(8), xt({ padding: 8 })]
|
|
7608
7752
|
});
|
|
7609
7753
|
Object.assign(e.style, {
|
|
7610
7754
|
left: `${d}px`,
|
|
@@ -7671,10 +7815,10 @@ class Zt {
|
|
|
7671
7815
|
}),
|
|
7672
7816
|
contextElement: document.body
|
|
7673
7817
|
};
|
|
7674
|
-
|
|
7675
|
-
|
|
7818
|
+
Tt(e, this.container, () => {
|
|
7819
|
+
gt(e, this.container, {
|
|
7676
7820
|
placement: "right-start",
|
|
7677
|
-
middleware: [
|
|
7821
|
+
middleware: [ut(), xt(), Bt()]
|
|
7678
7822
|
}).then(({ x: i, y: s }) => {
|
|
7679
7823
|
this.container && Object.assign(this.container.style, {
|
|
7680
7824
|
left: `${i}px`,
|
|
@@ -7736,7 +7880,7 @@ class Zt {
|
|
|
7736
7880
|
}), t.remove();
|
|
7737
7881
|
}
|
|
7738
7882
|
}
|
|
7739
|
-
class
|
|
7883
|
+
class Vi {
|
|
7740
7884
|
constructor(t) {
|
|
7741
7885
|
r(this, "ctx");
|
|
7742
7886
|
r(this, "contextMenuEl");
|
|
@@ -7753,16 +7897,16 @@ class Ki {
|
|
|
7753
7897
|
return;
|
|
7754
7898
|
}
|
|
7755
7899
|
const { ENABLE_CONTEXT_MENU: i, CUSTOM_BODY_CONTEXT_MENU: s, CONTEXT_MENU: o, BEFORE_BODY_CONTEXT_MENU_METHOD: n } = this.ctx.config;
|
|
7756
|
-
let a = o.map((
|
|
7757
|
-
...
|
|
7758
|
-
label:
|
|
7900
|
+
let a = o.map((w) => ({
|
|
7901
|
+
...w,
|
|
7902
|
+
label: w.label || this.ctx.locale.getText(w.value)
|
|
7759
7903
|
}));
|
|
7760
7904
|
if (a = [...a, ...s], n && (a = await n({ list: a, cell: t, hide: this.hide.bind(this) })), !i || a.length === 0) return;
|
|
7761
7905
|
e.preventDefault();
|
|
7762
7906
|
const { xArr: l, yArr: c } = this.ctx.selector, [d, f] = l, [u, x] = c, { rowIndex: g, colIndex: E } = t;
|
|
7763
|
-
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
|
|
7764
|
-
onClick: (
|
|
7765
|
-
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, {
|
|
7766
7910
|
hide: this.hide.bind(this),
|
|
7767
7911
|
cell: t
|
|
7768
7912
|
});
|
|
@@ -7783,35 +7927,35 @@ class Ki {
|
|
|
7783
7927
|
}));
|
|
7784
7928
|
if (u = [...u, ...d], n && (u = await n({ list: u, cell: t, hide: this.hide.bind(this) })), !f || u.length === 0) return;
|
|
7785
7929
|
e.preventDefault();
|
|
7786
|
-
const { xArr: x } = this.ctx.selector, [g, E] = x, { colIndex:
|
|
7787
|
-
|
|
7788
|
-
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" ? {
|
|
7789
7933
|
...p,
|
|
7790
7934
|
children: this.filterColumns(y)
|
|
7791
7935
|
} : p);
|
|
7792
|
-
this.ctx.contextMenuIng = !0, this.currentDOMTreeMenu = new
|
|
7793
|
-
onClick: (p,
|
|
7794
|
-
const { xArr:
|
|
7795
|
-
if (
|
|
7796
|
-
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);
|
|
7797
7941
|
this.ctx.database.setCustomHeaderFixedData(
|
|
7798
7942
|
_,
|
|
7799
|
-
|
|
7943
|
+
b === "fixedLeft" ? "left" : b === "fixedRight" ? "right" : ""
|
|
7800
7944
|
), this.hide();
|
|
7801
|
-
} else if (
|
|
7802
|
-
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);
|
|
7803
7947
|
_.length > 0 && this.ctx.database.setCustomHeaderHideData(_, !0), this.hide();
|
|
7804
|
-
} else if (
|
|
7948
|
+
} else if (b !== "visible") if (b.startsWith("visible_")) {
|
|
7805
7949
|
if (!p.key) return;
|
|
7806
7950
|
if (p.children) {
|
|
7807
7951
|
const O = this.getLeafKeys(p.children);
|
|
7808
7952
|
this.ctx.database.setCustomHeaderHideData(O, !1);
|
|
7809
7953
|
} else
|
|
7810
7954
|
this.ctx.database.setCustomHeaderHideData([p.key], !1);
|
|
7811
|
-
this.currentDOMTreeMenu && this.currentDOMTreeMenu.removeSubMenuItem(
|
|
7955
|
+
this.currentDOMTreeMenu && this.currentDOMTreeMenu.removeSubMenuItem(b);
|
|
7812
7956
|
const _ = this.ctx.database.getColumns();
|
|
7813
|
-
|
|
7814
|
-
} 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, {
|
|
7815
7959
|
hide: this.hide.bind(this),
|
|
7816
7960
|
cell: t
|
|
7817
7961
|
});
|
|
@@ -7835,10 +7979,10 @@ class Ki {
|
|
|
7835
7979
|
}),
|
|
7836
7980
|
contextElement: document.body
|
|
7837
7981
|
};
|
|
7838
|
-
|
|
7839
|
-
|
|
7982
|
+
Tt(e, this.contextMenuEl, () => {
|
|
7983
|
+
gt(e, this.contextMenuEl, {
|
|
7840
7984
|
placement: "right-start",
|
|
7841
|
-
middleware: [
|
|
7985
|
+
middleware: [ut(), xt(), Bt()]
|
|
7842
7986
|
}).then(({ x: i, y: s }) => {
|
|
7843
7987
|
this.contextMenuEl && Object.assign(this.contextMenuEl.style, {
|
|
7844
7988
|
left: `${i}px`,
|
|
@@ -7874,7 +8018,7 @@ class Ki {
|
|
|
7874
8018
|
this.hide(), (t = this.contextMenuEl) == null || t.remove();
|
|
7875
8019
|
}
|
|
7876
8020
|
}
|
|
7877
|
-
class
|
|
8021
|
+
class Pi {
|
|
7878
8022
|
constructor(t) {
|
|
7879
8023
|
r(this, "ctx");
|
|
7880
8024
|
r(this, "loadingEl");
|
|
@@ -7910,7 +8054,7 @@ class Yi {
|
|
|
7910
8054
|
this.loadingEl.remove();
|
|
7911
8055
|
}
|
|
7912
8056
|
}
|
|
7913
|
-
class
|
|
8057
|
+
class zi {
|
|
7914
8058
|
constructor(t) {
|
|
7915
8059
|
r(this, "ctx");
|
|
7916
8060
|
r(this, "container");
|
|
@@ -7984,10 +8128,10 @@ class Fi {
|
|
|
7984
8128
|
t.className = "e-virt-table-finder-bar";
|
|
7985
8129
|
const e = document.createElement("div");
|
|
7986
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";
|
|
7987
|
-
const i =
|
|
8131
|
+
const i = ne;
|
|
7988
8132
|
this.loadingEl.innerHTML = i, e.appendChild(this.loadingEl), this.countEl = document.createElement("span"), this.countEl.className = "e-virt-table-finder-bar-count";
|
|
7989
8133
|
const s = document.createElement("div");
|
|
7990
|
-
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;
|
|
7991
8135
|
}
|
|
7992
8136
|
bindEvents() {
|
|
7993
8137
|
this.input.addEventListener("input", () => {
|
|
@@ -8069,25 +8213,79 @@ class Fi {
|
|
|
8069
8213
|
this.hide(), this.container.remove();
|
|
8070
8214
|
}
|
|
8071
8215
|
}
|
|
8072
|
-
class
|
|
8216
|
+
const tt = class tt {
|
|
8073
8217
|
constructor(t) {
|
|
8074
8218
|
r(this, "ctx");
|
|
8075
8219
|
r(this, "layouts", /* @__PURE__ */ new Map());
|
|
8076
8220
|
r(this, "activeCellKey", "");
|
|
8077
8221
|
r(this, "selectionStart", null);
|
|
8078
8222
|
r(this, "selectionEnd", null);
|
|
8079
|
-
r(this, "
|
|
8080
|
-
this.ctx = t, this.
|
|
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());
|
|
8081
8225
|
}
|
|
8082
|
-
/** 是否允许进行文字选择(开启配置且不在编辑/查找状态) */
|
|
8083
8226
|
get canSelect() {
|
|
8084
8227
|
return this.ctx.config.ENABLE_TEXT_SELECTION && !this.ctx.editing && !this.ctx.finding;
|
|
8085
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)
|
|
8236
|
+
return;
|
|
8237
|
+
}
|
|
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)));
|
|
8284
|
+
}
|
|
8086
8285
|
/**
|
|
8087
|
-
*
|
|
8088
|
-
* 由于固定列/表头会后绘制并覆盖普通单元格,这里取最后一个命中的 layout 作为最顶层结果。
|
|
8286
|
+
* 命中最顶层文字(固定列/表头后绘制会覆盖普通单元格,取最后一个命中)。
|
|
8089
8287
|
*/
|
|
8090
|
-
|
|
8288
|
+
hitTest(t) {
|
|
8091
8289
|
const { offsetX: e, offsetY: i } = this.ctx.getOffset(t);
|
|
8092
8290
|
let s = null;
|
|
8093
8291
|
for (const [o, n] of this.layouts) {
|
|
@@ -8096,62 +8294,31 @@ class Wi {
|
|
|
8096
8294
|
}
|
|
8097
8295
|
return s;
|
|
8098
8296
|
}
|
|
8099
|
-
|
|
8100
|
-
syncSelection() {
|
|
8297
|
+
updateSelection() {
|
|
8101
8298
|
this.ctx.textSelectionStr = this.getSelectedText(), this.ctx.emit("drawView");
|
|
8102
8299
|
}
|
|
8103
|
-
init() {
|
|
8104
|
-
this.ctx.on("registerTextLayout", (t, e) => {
|
|
8105
|
-
this.registerLayout(t, e);
|
|
8106
|
-
}), this.ctx.on("mousedown", (t) => {
|
|
8107
|
-
if (!this.canSelect || !this.ctx.isTarget(t))
|
|
8108
|
-
return;
|
|
8109
|
-
this.ctx.containerElement.contains(document.activeElement) || this.ctx.containerElement.focus({ preventScroll: !0 });
|
|
8110
|
-
const e = this.hitTestLayouts(t);
|
|
8111
|
-
if (!e) {
|
|
8112
|
-
this.clearSelection();
|
|
8113
|
-
return;
|
|
8114
|
-
}
|
|
8115
|
-
this.activeCellKey = e.cellKey, this.selectionStart = e.index, this.selectionEnd = e.index, this.dragging = !0, this.ctx.textSelecting = !0, this.syncSelection();
|
|
8116
|
-
}), this.ctx.on("mousemove", (t) => {
|
|
8117
|
-
if (!this.canSelect || !this.dragging)
|
|
8118
|
-
return;
|
|
8119
|
-
const e = this.layouts.get(this.activeCellKey);
|
|
8120
|
-
if (!e)
|
|
8121
|
-
return;
|
|
8122
|
-
const { offsetX: i, offsetY: s } = this.ctx.getOffset(t), o = this.hitTestText(e, i, s);
|
|
8123
|
-
o !== null && (this.selectionEnd = o, this.syncSelection());
|
|
8124
|
-
}), this.ctx.on("mouseup", () => {
|
|
8125
|
-
this.dragging = !1, this.ctx.textSelecting = !1, this.ctx.textSelectionStr = this.getSelectedText(), this.ctx.textSelectionStr && this.ctx.emit("drawView");
|
|
8126
|
-
}), this.ctx.on("keydown", (t) => {
|
|
8127
|
-
var i;
|
|
8128
|
-
if (console.log("keydown"), !this.canSelect || !((t.ctrlKey || t.metaKey) && t.code === "KeyC"))
|
|
8129
|
-
return;
|
|
8130
|
-
const e = this.getSelectedText();
|
|
8131
|
-
e && (t.preventDefault(), (i = navigator.clipboard) == null || i.writeText(e).catch((s) => console.error("Copy Failure:", s)));
|
|
8132
|
-
}), this.ctx.on("outsideMousedown", () => {
|
|
8133
|
-
this.clearSelection();
|
|
8134
|
-
});
|
|
8135
|
-
}
|
|
8136
|
-
/**
|
|
8137
|
-
* 命中测试,返回字符索引
|
|
8138
|
-
*/
|
|
8139
8300
|
hitTestText(t, e, i) {
|
|
8140
|
-
const {
|
|
8141
|
-
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)
|
|
8142
8306
|
return null;
|
|
8143
|
-
const c =
|
|
8144
|
-
if (!
|
|
8145
|
-
return
|
|
8146
|
-
|
|
8147
|
-
|
|
8148
|
-
|
|
8149
|
-
|
|
8150
|
-
|
|
8151
|
-
|
|
8152
|
-
|
|
8153
|
-
|
|
8154
|
-
|
|
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)
|
|
8315
|
+
return null;
|
|
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;
|
|
8155
8322
|
}
|
|
8156
8323
|
clearLayouts() {
|
|
8157
8324
|
this.layouts.clear();
|
|
@@ -8159,15 +8326,9 @@ class Wi {
|
|
|
8159
8326
|
draw() {
|
|
8160
8327
|
if (!this.ctx.config.ENABLE_TEXT_SELECTION)
|
|
8161
8328
|
return;
|
|
8162
|
-
const t = this.getSelectionRange();
|
|
8163
|
-
if (!t)
|
|
8164
|
-
return;
|
|
8165
|
-
const e = this.layouts.get(this.activeCellKey);
|
|
8329
|
+
const t = this.getSelectionRange(), e = t && this.layouts.get(this.activeCellKey);
|
|
8166
8330
|
e && this.drawTextSelection(e, t);
|
|
8167
8331
|
}
|
|
8168
|
-
/**
|
|
8169
|
-
* 绘制文字选中高亮
|
|
8170
|
-
*/
|
|
8171
8332
|
drawTextSelection(t, e, i = "#fff", s = "#3b82f6") {
|
|
8172
8333
|
if (e.start >= e.end)
|
|
8173
8334
|
return;
|
|
@@ -8175,15 +8336,15 @@ class Wi {
|
|
|
8175
8336
|
for (const a of t.glyphs) {
|
|
8176
8337
|
if (a.index < e.start || a.index >= e.end)
|
|
8177
8338
|
continue;
|
|
8178
|
-
const l = o.get(a.line);
|
|
8179
|
-
l
|
|
8339
|
+
const l = o.get(a.line) ?? [];
|
|
8340
|
+
l.push(a), o.set(a.line, l);
|
|
8180
8341
|
}
|
|
8181
8342
|
if (!o.size)
|
|
8182
8343
|
return;
|
|
8183
8344
|
const n = this.ctx.paint.getCtx();
|
|
8184
8345
|
n.save(), n.font = t.font, n.textBaseline = "top", n.textAlign = "left", o.forEach((a) => {
|
|
8185
8346
|
const l = a[0], c = a[a.length - 1];
|
|
8186
|
-
n.fillStyle = s, n.fillRect(l.x, l.y, c.x + c.width - l.x, l.height), n.fillStyle = i;
|
|
8347
|
+
n.fillStyle = s, n.fillRect(l.x, l.y - 1, c.x + c.width - l.x, l.height), n.fillStyle = i;
|
|
8187
8348
|
for (const d of a)
|
|
8188
8349
|
n.fillText(d.char, d.x, d.y);
|
|
8189
8350
|
}), n.restore();
|
|
@@ -8195,20 +8356,19 @@ class Wi {
|
|
|
8195
8356
|
};
|
|
8196
8357
|
}
|
|
8197
8358
|
getSelectedText() {
|
|
8198
|
-
const t = this.getSelectionRange();
|
|
8199
|
-
|
|
8200
|
-
return "";
|
|
8201
|
-
const e = this.layouts.get(this.activeCellKey);
|
|
8202
|
-
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("");
|
|
8203
8361
|
}
|
|
8204
|
-
|
|
8205
|
-
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");
|
|
8206
8364
|
}
|
|
8207
8365
|
destroy() {
|
|
8208
|
-
this.layouts.clear(), this.
|
|
8366
|
+
this.layouts.clear(), this.resetSelection();
|
|
8209
8367
|
}
|
|
8210
|
-
}
|
|
8211
|
-
|
|
8368
|
+
};
|
|
8369
|
+
r(tt, "DRAG_THRESHOLD", 4);
|
|
8370
|
+
let St = tt;
|
|
8371
|
+
const mt = class mt {
|
|
8212
8372
|
constructor(t, e) {
|
|
8213
8373
|
r(this, "options");
|
|
8214
8374
|
r(this, "scroller");
|
|
@@ -8235,16 +8395,16 @@ const gt = class gt {
|
|
|
8235
8395
|
o,
|
|
8236
8396
|
n
|
|
8237
8397
|
);
|
|
8238
|
-
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) => {
|
|
8239
8399
|
this.loadData(l);
|
|
8240
|
-
}), this.
|
|
8400
|
+
}), this.ctx.on("draw", () => {
|
|
8241
8401
|
this.draw();
|
|
8242
8402
|
}), this.ctx.on("drawView", () => {
|
|
8243
8403
|
this.draw(!0);
|
|
8244
8404
|
}), this.draw();
|
|
8245
8405
|
}
|
|
8246
8406
|
static useLocale(t) {
|
|
8247
|
-
|
|
8407
|
+
mt.locale = t;
|
|
8248
8408
|
}
|
|
8249
8409
|
createContainer(t, e, i, s, o) {
|
|
8250
8410
|
t.className = "e-virt-table-container";
|
|
@@ -8264,7 +8424,7 @@ const gt = class gt {
|
|
|
8264
8424
|
};
|
|
8265
8425
|
}
|
|
8266
8426
|
doDraw(t = !1) {
|
|
8267
|
-
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();
|
|
8268
8428
|
}
|
|
8269
8429
|
draw(t = !1) {
|
|
8270
8430
|
this.animationFrameId && cancelAnimationFrame(this.animationFrameId), this.animationFrameId = requestAnimationFrame(() => {
|
|
@@ -8332,6 +8492,16 @@ const gt = class gt {
|
|
|
8332
8492
|
doLayout() {
|
|
8333
8493
|
this.ctx.emit("draw");
|
|
8334
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
|
+
}
|
|
8335
8505
|
getChangedData() {
|
|
8336
8506
|
return this.ctx.database.getChangedData();
|
|
8337
8507
|
}
|
|
@@ -8506,10 +8676,10 @@ const gt = class gt {
|
|
|
8506
8676
|
}
|
|
8507
8677
|
getUtils() {
|
|
8508
8678
|
return {
|
|
8509
|
-
mergeColCell:
|
|
8510
|
-
mergeRowCell:
|
|
8511
|
-
getSpanArrByRow:
|
|
8512
|
-
getSpanObjByColumn:
|
|
8679
|
+
mergeColCell: _e,
|
|
8680
|
+
mergeRowCell: Ie,
|
|
8681
|
+
getSpanArrByRow: ee,
|
|
8682
|
+
getSpanObjByColumn: ie
|
|
8513
8683
|
};
|
|
8514
8684
|
}
|
|
8515
8685
|
getColumnByKey(t) {
|
|
@@ -8532,9 +8702,9 @@ const gt = class gt {
|
|
|
8532
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();
|
|
8533
8703
|
}
|
|
8534
8704
|
};
|
|
8535
|
-
r(
|
|
8536
|
-
let
|
|
8705
|
+
r(mt, "locale");
|
|
8706
|
+
let Ot = mt;
|
|
8537
8707
|
export {
|
|
8538
|
-
|
|
8708
|
+
Ot as default
|
|
8539
8709
|
};
|
|
8540
8710
|
//# sourceMappingURL=index.es.js.map
|