e-virt-table 1.2.10 → 1.2.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +4 -4
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +1227 -1174
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +4 -4
- package/dist/index.umd.js.map +1 -1
- package/dist/lib/Body.js +1 -1
- package/dist/lib/Body.js.map +1 -1
- package/dist/lib/Cell.js +4 -4
- package/dist/lib/Cell.js.map +1 -1
- package/dist/lib/CellHeader.d.ts +2 -0
- package/dist/lib/CellHeader.js +14 -0
- package/dist/lib/CellHeader.js.map +1 -1
- package/dist/lib/Config.d.ts +0 -1
- package/dist/lib/Config.js +0 -6
- package/dist/lib/Config.js.map +1 -1
- package/dist/lib/Context.d.ts +1 -0
- package/dist/lib/Context.js +13 -1
- package/dist/lib/Context.js.map +1 -1
- package/dist/lib/ContextMenu.js +3 -0
- package/dist/lib/ContextMenu.js.map +1 -1
- package/dist/lib/Database.d.ts +1 -0
- package/dist/lib/Database.js +40 -10
- package/dist/lib/Database.js.map +1 -1
- package/dist/lib/EVirtTable.d.ts +5 -1
- package/dist/lib/EVirtTable.js +27 -0
- package/dist/lib/EVirtTable.js.map +1 -1
- package/dist/lib/EventBrowser.js +1 -0
- package/dist/lib/EventBrowser.js.map +1 -1
- package/dist/lib/Header.js +28 -2
- package/dist/lib/Header.js.map +1 -1
- package/dist/lib/types.d.ts +12 -0
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
(function(){"use strict";try{if(typeof document<"u"){var o=document.createElement("style");o.appendChild(document.createTextNode(":root{--evt-header-font: 12px normal Arial;--evt-body-font: 12px normal Arial;--evt-color-white: #fff;--evt-color-black: #000000;--evt-color-primary: rgb(82, 146, 247);--evt-text-color-primary: #333;--evt-text-color-regular: #666;--evt-text-color-secondary: #999;--evt-box-shadow: 0 2px 12px 0 #0000001a;--evt-editor-bg-color: #fff;--evt-editor-text-color: #333;--evt-border-color: #e1e6eb;--evt-stripe-color: #fafafa;--evt-placeholder-color: #cdd0dc;--evt-header-bg-color: #f8faff;--evt-body-bg-color: #fff;--evt-header-text-color: #1d2129;--evt-body-text-color: #4e5969;--evt-footer-text-color: #4e5969;--evt-loading-icon-color: #4e5969;--evt-expand-icon-color: #4e5969;--evt-shrink-icon-color: #4e5969;--evt-error-tip-icon-color: red;--evt-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: transparent;--evt-autofill-point-border-color: #fff;--evt-edit-bg-color: #fcf6ed;--evt-checkbox-color: var(--evt-color-primary);--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-line-color: #e1e6eb}.dark{--evt-border-color: #363637;--evt-header-bg-color: #141414;--evt-body-bg-color: #141414;--evt-header-text-color: #a3a6ad;--evt-scroller-color: #414243;--evt-scroller-track-color: #141414;--evt-scroller-focus-color: #a3a6ad;--evt-edit-bg-color: #141414;--evt-readonly-text-color: #cfd3dc;--evt-footer-bg-color: #262727;--evt-autofill-point-border-color: #fff;--evt-editor-bg-color: #434343;--evt-editor-text-color: #cfd3dc}.e-virt-table-container{position:relative;outline:none}.e-virt-table-stage{position:relative;overflow:hidden;outline:none;box-sizing:border-box;z-index:10;border-radius:8px;border:1px solid var(--evt-border-color)}.e-virt-table-canvas{position:absolute;left:0;top:0;box-sizing:border-box;border:none;outline:none;z-index:10}.e-virt-table-editor{position:absolute;top:-10000px;left:-10000px;text-align:left;height:auto;line-height:0;z-index:100;overflow:hidden;background-color:var(--evt-editor-bg-color);border:2px solid var(--evt-color-primary);box-sizing:border-box;box-shadow:var(--evt-box-shadow);display:flex;align-items:center}.e-virt-table-overlayer{position:absolute;left:0;top:0;overflow:hidden;z-index:100;pointer-events:none}.e-virt-table-editor-textarea{width:100%;box-sizing:border-box;outline:none;font-weight:400;padding:8px;font-size:12px;color:inherit;white-space:pre-wrap;word-wrap:break-word;word-break:break-all;line-height:1.5;margin:0;border:none;vertical-align:middle;background:var(--evt-editor-bg-color);color:var(--evt-editor-text-color);overflow-y:auto;resize:none}.e-virt-table-context-menu{position:absolute;font-size:14px;color:var(--evt-text-color-regular);background-color:var(--evt-color-white);border-radius:4px;border:1px solid #e4e7ed;box-shadow:var(--evt-box-shadow);width:fit-content;padding:6px 0;z-index:9999;left:-99999px;top:-99999px}.e-virt-table-context-menu-item{cursor:pointer;padding:8px 24px;color:var(--evt-text-color-regular)}.e-virt-table-context-menu-item:hover{color:var(--evt-color-primary);background-color:#f5f7fa}")),document.head.appendChild(o)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
|
|
2
2
|
var be = Object.defineProperty;
|
|
3
|
-
var ve = (
|
|
4
|
-
var
|
|
3
|
+
var ve = (l, t, e) => t in l ? be(l, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : l[t] = e;
|
|
4
|
+
var a = (l, t, e) => ve(l, typeof t != "symbol" ? t + "" : t, e);
|
|
5
5
|
function q() {
|
|
6
|
-
return q = Object.assign ? Object.assign.bind() : function(
|
|
6
|
+
return q = Object.assign ? Object.assign.bind() : function(l) {
|
|
7
7
|
for (var t = 1; t < arguments.length; t++) {
|
|
8
8
|
var e = arguments[t];
|
|
9
9
|
for (var i in e)
|
|
10
|
-
Object.prototype.hasOwnProperty.call(e, i) && (
|
|
10
|
+
Object.prototype.hasOwnProperty.call(e, i) && (l[i] = e[i]);
|
|
11
11
|
}
|
|
12
|
-
return
|
|
12
|
+
return l;
|
|
13
13
|
}, q.apply(this, arguments);
|
|
14
14
|
}
|
|
15
|
-
function Re(
|
|
16
|
-
|
|
15
|
+
function Re(l, t) {
|
|
16
|
+
l.prototype = Object.create(t.prototype), l.prototype.constructor = l, st(l, t);
|
|
17
17
|
}
|
|
18
|
-
function Et(
|
|
18
|
+
function Et(l) {
|
|
19
19
|
return Et = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(e) {
|
|
20
20
|
return e.__proto__ || Object.getPrototypeOf(e);
|
|
21
|
-
}, Et(
|
|
21
|
+
}, Et(l);
|
|
22
22
|
}
|
|
23
|
-
function st(
|
|
23
|
+
function st(l, t) {
|
|
24
24
|
return st = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(i, s) {
|
|
25
25
|
return i.__proto__ = s, i;
|
|
26
|
-
}, st(
|
|
26
|
+
}, st(l, t);
|
|
27
27
|
}
|
|
28
28
|
function _e() {
|
|
29
29
|
if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham) return !1;
|
|
@@ -35,7 +35,7 @@ function _e() {
|
|
|
35
35
|
return !1;
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
-
function dt(
|
|
38
|
+
function dt(l, t, e) {
|
|
39
39
|
return _e() ? dt = Reflect.construct.bind() : dt = function(s, r, o) {
|
|
40
40
|
var n = [null];
|
|
41
41
|
n.push.apply(n, r);
|
|
@@ -43,10 +43,10 @@ function dt(a, t, e) {
|
|
|
43
43
|
return o && st(c, o.prototype), c;
|
|
44
44
|
}, dt.apply(null, arguments);
|
|
45
45
|
}
|
|
46
|
-
function Ie(
|
|
47
|
-
return Function.toString.call(
|
|
46
|
+
function Ie(l) {
|
|
47
|
+
return Function.toString.call(l).indexOf("[native code]") !== -1;
|
|
48
48
|
}
|
|
49
|
-
function Ct(
|
|
49
|
+
function Ct(l) {
|
|
50
50
|
var t = typeof Map == "function" ? /* @__PURE__ */ new Map() : void 0;
|
|
51
51
|
return Ct = function(i) {
|
|
52
52
|
if (i === null || !Ie(i)) return i;
|
|
@@ -67,7 +67,7 @@ function Ct(a) {
|
|
|
67
67
|
configurable: !0
|
|
68
68
|
}
|
|
69
69
|
}), st(s, i);
|
|
70
|
-
}, Ct(
|
|
70
|
+
}, Ct(l);
|
|
71
71
|
}
|
|
72
72
|
var Oe = /%[sdj%]/g, Ut = function() {
|
|
73
73
|
};
|
|
@@ -76,22 +76,22 @@ typeof process < "u" && process.env && process.env.NODE_ENV !== "production" &&
|
|
|
76
76
|
return typeof i == "string";
|
|
77
77
|
}) && console.warn(t, e);
|
|
78
78
|
});
|
|
79
|
-
function bt(
|
|
80
|
-
if (!
|
|
79
|
+
function bt(l) {
|
|
80
|
+
if (!l || !l.length) return null;
|
|
81
81
|
var t = {};
|
|
82
|
-
return
|
|
82
|
+
return l.forEach(function(e) {
|
|
83
83
|
var i = e.field;
|
|
84
84
|
t[i] = t[i] || [], t[i].push(e);
|
|
85
85
|
}), t;
|
|
86
86
|
}
|
|
87
|
-
function D(
|
|
87
|
+
function D(l) {
|
|
88
88
|
for (var t = arguments.length, e = new Array(t > 1 ? t - 1 : 0), i = 1; i < t; i++)
|
|
89
89
|
e[i - 1] = arguments[i];
|
|
90
90
|
var s = 0, r = e.length;
|
|
91
|
-
if (typeof
|
|
92
|
-
return
|
|
93
|
-
if (typeof
|
|
94
|
-
var o =
|
|
91
|
+
if (typeof l == "function")
|
|
92
|
+
return l.apply(null, e);
|
|
93
|
+
if (typeof l == "string") {
|
|
94
|
+
var o = l.replace(Oe, function(n) {
|
|
95
95
|
if (n === "%%")
|
|
96
96
|
return "%";
|
|
97
97
|
if (s >= r)
|
|
@@ -114,105 +114,105 @@ function D(a) {
|
|
|
114
114
|
});
|
|
115
115
|
return o;
|
|
116
116
|
}
|
|
117
|
-
return
|
|
117
|
+
return l;
|
|
118
118
|
}
|
|
119
|
-
function Le(
|
|
120
|
-
return
|
|
119
|
+
function Le(l) {
|
|
120
|
+
return l === "string" || l === "url" || l === "hex" || l === "email" || l === "date" || l === "pattern";
|
|
121
121
|
}
|
|
122
|
-
function H(
|
|
123
|
-
return !!(
|
|
122
|
+
function H(l, t) {
|
|
123
|
+
return !!(l == null || t === "array" && Array.isArray(l) && !l.length || Le(t) && typeof l == "string" && !l);
|
|
124
124
|
}
|
|
125
|
-
function Se(
|
|
126
|
-
var i = [], s = 0, r =
|
|
125
|
+
function Se(l, t, e) {
|
|
126
|
+
var i = [], s = 0, r = l.length;
|
|
127
127
|
function o(n) {
|
|
128
128
|
i.push.apply(i, n || []), s++, s === r && e(i);
|
|
129
129
|
}
|
|
130
|
-
|
|
130
|
+
l.forEach(function(n) {
|
|
131
131
|
t(n, o);
|
|
132
132
|
});
|
|
133
133
|
}
|
|
134
|
-
function
|
|
135
|
-
var i = 0, s =
|
|
134
|
+
function Bt(l, t, e) {
|
|
135
|
+
var i = 0, s = l.length;
|
|
136
136
|
function r(o) {
|
|
137
137
|
if (o && o.length) {
|
|
138
138
|
e(o);
|
|
139
139
|
return;
|
|
140
140
|
}
|
|
141
141
|
var n = i;
|
|
142
|
-
i = i + 1, n < s ? t(
|
|
142
|
+
i = i + 1, n < s ? t(l[n], r) : e([]);
|
|
143
143
|
}
|
|
144
144
|
r([]);
|
|
145
145
|
}
|
|
146
|
-
function Te(
|
|
146
|
+
function Te(l) {
|
|
147
147
|
var t = [];
|
|
148
|
-
return Object.keys(
|
|
149
|
-
t.push.apply(t,
|
|
148
|
+
return Object.keys(l).forEach(function(e) {
|
|
149
|
+
t.push.apply(t, l[e] || []);
|
|
150
150
|
}), t;
|
|
151
151
|
}
|
|
152
|
-
var Ft = /* @__PURE__ */ function(
|
|
153
|
-
Re(t,
|
|
152
|
+
var Ft = /* @__PURE__ */ function(l) {
|
|
153
|
+
Re(t, l);
|
|
154
154
|
function t(e, i) {
|
|
155
155
|
var s;
|
|
156
|
-
return s =
|
|
156
|
+
return s = l.call(this, "Async Validation Error") || this, s.errors = e, s.fields = i, s;
|
|
157
157
|
}
|
|
158
158
|
return t;
|
|
159
159
|
}(/* @__PURE__ */ Ct(Error));
|
|
160
|
-
function Ae(
|
|
160
|
+
function Ae(l, t, e, i, s) {
|
|
161
161
|
if (t.first) {
|
|
162
|
-
var r = new Promise(function(
|
|
163
|
-
var
|
|
164
|
-
return i(
|
|
165
|
-
},
|
|
166
|
-
|
|
162
|
+
var r = new Promise(function(x, g) {
|
|
163
|
+
var p = function(m) {
|
|
164
|
+
return i(m), m.length ? g(new Ft(m, bt(m))) : x(s);
|
|
165
|
+
}, u = Te(l);
|
|
166
|
+
Bt(u, e, p);
|
|
167
167
|
});
|
|
168
|
-
return r.catch(function(
|
|
169
|
-
return
|
|
168
|
+
return r.catch(function(x) {
|
|
169
|
+
return x;
|
|
170
170
|
}), r;
|
|
171
171
|
}
|
|
172
|
-
var o = t.firstFields === !0 ? Object.keys(
|
|
173
|
-
var
|
|
172
|
+
var o = t.firstFields === !0 ? Object.keys(l) : t.firstFields || [], n = Object.keys(l), h = n.length, c = 0, d = [], f = new Promise(function(x, g) {
|
|
173
|
+
var p = function(w) {
|
|
174
174
|
if (d.push.apply(d, w), c++, c === h)
|
|
175
|
-
return i(d), d.length ? g(new Ft(d, bt(d))) :
|
|
175
|
+
return i(d), d.length ? g(new Ft(d, bt(d))) : x(s);
|
|
176
176
|
};
|
|
177
|
-
n.length || (i(d),
|
|
178
|
-
var w =
|
|
179
|
-
o.indexOf(
|
|
177
|
+
n.length || (i(d), x(s)), n.forEach(function(u) {
|
|
178
|
+
var w = l[u];
|
|
179
|
+
o.indexOf(u) !== -1 ? Bt(w, e, p) : Se(w, e, p);
|
|
180
180
|
});
|
|
181
181
|
});
|
|
182
|
-
return f.catch(function(
|
|
183
|
-
return
|
|
182
|
+
return f.catch(function(x) {
|
|
183
|
+
return x;
|
|
184
184
|
}), f;
|
|
185
185
|
}
|
|
186
|
-
function Me(
|
|
187
|
-
return !!(
|
|
186
|
+
function Me(l) {
|
|
187
|
+
return !!(l && l.message !== void 0);
|
|
188
188
|
}
|
|
189
|
-
function He(
|
|
190
|
-
for (var e =
|
|
189
|
+
function He(l, t) {
|
|
190
|
+
for (var e = l, i = 0; i < t.length; i++) {
|
|
191
191
|
if (e == null)
|
|
192
192
|
return e;
|
|
193
193
|
e = e[t[i]];
|
|
194
194
|
}
|
|
195
195
|
return e;
|
|
196
196
|
}
|
|
197
|
-
function
|
|
197
|
+
function Nt(l, t) {
|
|
198
198
|
return function(e) {
|
|
199
199
|
var i;
|
|
200
|
-
return
|
|
200
|
+
return l.fullFields ? i = He(t, l.fullFields) : i = t[e.field || l.fullField], Me(e) ? (e.field = e.field || l.fullField, e.fieldValue = i, e) : {
|
|
201
201
|
message: typeof e == "function" ? e() : e,
|
|
202
202
|
fieldValue: i,
|
|
203
|
-
field: e.field ||
|
|
203
|
+
field: e.field || l.fullField
|
|
204
204
|
};
|
|
205
205
|
};
|
|
206
206
|
}
|
|
207
|
-
function kt(
|
|
207
|
+
function kt(l, t) {
|
|
208
208
|
if (t) {
|
|
209
209
|
for (var e in t)
|
|
210
210
|
if (t.hasOwnProperty(e)) {
|
|
211
211
|
var i = t[e];
|
|
212
|
-
typeof i == "object" && typeof
|
|
212
|
+
typeof i == "object" && typeof l[e] == "object" ? l[e] = q({}, l[e], i) : l[e] = i;
|
|
213
213
|
}
|
|
214
214
|
}
|
|
215
|
-
return
|
|
215
|
+
return l;
|
|
216
216
|
}
|
|
217
217
|
var Zt = function(t, e, i, s, r, o) {
|
|
218
218
|
t.required && (!i.hasOwnProperty(t.field) || H(e, o || t.type)) && s.push(D(r.messages.required, t.fullField));
|
|
@@ -221,8 +221,8 @@ var Zt = function(t, e, i, s, r, o) {
|
|
|
221
221
|
}, ct, Xe = function() {
|
|
222
222
|
if (ct)
|
|
223
223
|
return ct;
|
|
224
|
-
var
|
|
225
|
-
return
|
|
224
|
+
var l = "[a-fA-F\\d:]", t = function(C) {
|
|
225
|
+
return C && C.includeBoundaries ? "(?:(?<=\\s|^)(?=" + l + ")|(?<=" + l + ")(?=\\s|$))" : "";
|
|
226
226
|
}, e = "(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}", i = "[a-fA-F\\d]{1,4}", s = (`
|
|
227
227
|
(?:
|
|
228
228
|
(?:` + i + ":){7}(?:" + i + `|:)| // 1:2:3:4:5:6:7:: 1:2:3:4:5:6:7:8
|
|
@@ -234,16 +234,16 @@ var Zt = function(t, e, i, s, r, o) {
|
|
|
234
234
|
(?:` + i + ":){1}(?:(?::" + i + "){0,4}:" + e + "|(?::" + i + `){1,6}|:)| // 1:: 1::3:4:5:6:7:8 1::8 1::3:4:5:6:7:1.2.3.4
|
|
235
235
|
(?::(?:(?::` + i + "){0,5}:" + e + "|(?::" + i + `){1,7}|:)) // ::2:3:4:5:6:7:8 ::2:3:4:5:6:7:8 ::8 ::1.2.3.4
|
|
236
236
|
)(?:%[0-9a-zA-Z]{1,})? // %eth0 %1
|
|
237
|
-
`).replace(/\s*\/\/.*$/gm, "").replace(/\n/g, "").trim(), r = new RegExp("(?:^" + e + "$)|(?:^" + s + "$)"), o = new RegExp("^" + e + "$"), n = new RegExp("^" + s + "$"), h = function(
|
|
238
|
-
return
|
|
237
|
+
`).replace(/\s*\/\/.*$/gm, "").replace(/\n/g, "").trim(), r = new RegExp("(?:^" + e + "$)|(?:^" + s + "$)"), o = new RegExp("^" + e + "$"), n = new RegExp("^" + s + "$"), h = function(C) {
|
|
238
|
+
return C && C.exact ? r : new RegExp("(?:" + t(C) + e + t(C) + ")|(?:" + t(C) + s + t(C) + ")", "g");
|
|
239
239
|
};
|
|
240
240
|
h.v4 = function(y) {
|
|
241
241
|
return y && y.exact ? o : new RegExp("" + t(y) + e + t(y), "g");
|
|
242
242
|
}, h.v6 = function(y) {
|
|
243
243
|
return y && y.exact ? n : new RegExp("" + t(y) + s + t(y), "g");
|
|
244
244
|
};
|
|
245
|
-
var c = "(?:(?:[a-z]+:)?//)", d = "(?:\\S+(?::\\S*)?@)?", f = h.v4().source,
|
|
246
|
-
return ct = new RegExp("(?:^" +
|
|
245
|
+
var c = "(?:(?:[a-z]+:)?//)", d = "(?:\\S+(?::\\S*)?@)?", f = h.v4().source, x = h.v6().source, g = "(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)", p = "(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*", u = "(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))", w = "(?::\\d{2,5})?", m = '(?:[/?#][^\\s"]*)?', b = "(?:" + c + "|www\\.)" + d + "(?:localhost|" + f + "|" + x + "|" + g + p + u + ")" + w + m;
|
|
246
|
+
return ct = new RegExp("(?:^" + b + "$)", "i"), ct;
|
|
247
247
|
}, Kt = {
|
|
248
248
|
// http://emailregex.com/
|
|
249
249
|
email: /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,
|
|
@@ -292,7 +292,7 @@ var Zt = function(t, e, i, s, r, o) {
|
|
|
292
292
|
hex: function(t) {
|
|
293
293
|
return typeof t == "string" && !!t.match(Kt.hex);
|
|
294
294
|
}
|
|
295
|
-
},
|
|
295
|
+
}, Be = function(t, e, i, s, r) {
|
|
296
296
|
if (t.required && e === void 0) {
|
|
297
297
|
Zt(t, e, i, s, r);
|
|
298
298
|
return;
|
|
@@ -300,11 +300,11 @@ var Zt = function(t, e, i, s, r, o) {
|
|
|
300
300
|
var o = ["integer", "float", "array", "regexp", "object", "method", "email", "number", "date", "url", "hex"], n = t.type;
|
|
301
301
|
o.indexOf(n) > -1 ? et[n](e) || s.push(D(r.messages.types[n], t.fullField, t.type)) : n && typeof e !== t.type && s.push(D(r.messages.types[n], t.fullField, t.type));
|
|
302
302
|
}, Fe = function(t, e, i, s, r) {
|
|
303
|
-
var o = typeof t.len == "number", n = typeof t.min == "number", h = typeof t.max == "number", c = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g, d = e, f = null,
|
|
304
|
-
if (
|
|
303
|
+
var o = typeof t.len == "number", n = typeof t.min == "number", h = typeof t.max == "number", c = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g, d = e, f = null, x = typeof e == "number", g = typeof e == "string", p = Array.isArray(e);
|
|
304
|
+
if (x ? f = "number" : g ? f = "string" : p && (f = "array"), !f)
|
|
305
305
|
return !1;
|
|
306
|
-
|
|
307
|
-
}, j = "enum",
|
|
306
|
+
p && (d = e.length), g && (d = e.replace(c, "_").length), o ? d !== t.len && s.push(D(r.messages[f].len, t.fullField, t.len)) : n && !h && d < t.min ? s.push(D(r.messages[f].min, t.fullField, t.min)) : h && !n && d > t.max ? s.push(D(r.messages[f].max, t.fullField, t.max)) : n && h && (d < t.min || d > t.max) && s.push(D(r.messages[f].range, t.fullField, t.min, t.max));
|
|
307
|
+
}, j = "enum", Ne = function(t, e, i, s, r) {
|
|
308
308
|
t[j] = Array.isArray(t[j]) ? t[j] : [], t[j].indexOf(e) === -1 && s.push(D(r.messages[j], t.fullField, t[j].join(", ")));
|
|
309
309
|
}, ke = function(t, e, i, s, r) {
|
|
310
310
|
if (t.pattern) {
|
|
@@ -318,9 +318,9 @@ var Zt = function(t, e, i, s, r, o) {
|
|
|
318
318
|
}, L = {
|
|
319
319
|
required: Zt,
|
|
320
320
|
whitespace: De,
|
|
321
|
-
type:
|
|
321
|
+
type: Be,
|
|
322
322
|
range: Fe,
|
|
323
|
-
enum:
|
|
323
|
+
enum: Ne,
|
|
324
324
|
pattern: ke
|
|
325
325
|
}, Ke = function(t, e, i, s, r) {
|
|
326
326
|
var o = [], n = t.required || !t.required && s.hasOwnProperty(t.field);
|
|
@@ -513,10 +513,10 @@ function vt() {
|
|
|
513
513
|
};
|
|
514
514
|
}
|
|
515
515
|
var Rt = vt(), nt = /* @__PURE__ */ function() {
|
|
516
|
-
function
|
|
516
|
+
function l(e) {
|
|
517
517
|
this.rules = null, this._messages = Rt, this.define(e);
|
|
518
518
|
}
|
|
519
|
-
var t =
|
|
519
|
+
var t = l.prototype;
|
|
520
520
|
return t.define = function(i) {
|
|
521
521
|
var s = this;
|
|
522
522
|
if (!i)
|
|
@@ -536,97 +536,97 @@ var Rt = vt(), nt = /* @__PURE__ */ function() {
|
|
|
536
536
|
var n = i, h = s, c = r;
|
|
537
537
|
if (typeof h == "function" && (c = h, h = {}), !this.rules || Object.keys(this.rules).length === 0)
|
|
538
538
|
return c && c(null, n), Promise.resolve(n);
|
|
539
|
-
function d(
|
|
540
|
-
var w = [],
|
|
541
|
-
function C
|
|
542
|
-
if (Array.isArray(
|
|
539
|
+
function d(u) {
|
|
540
|
+
var w = [], m = {};
|
|
541
|
+
function b(C) {
|
|
542
|
+
if (Array.isArray(C)) {
|
|
543
543
|
var E;
|
|
544
|
-
w = (E = w).concat.apply(E,
|
|
544
|
+
w = (E = w).concat.apply(E, C);
|
|
545
545
|
} else
|
|
546
|
-
w.push(
|
|
546
|
+
w.push(C);
|
|
547
547
|
}
|
|
548
|
-
for (var y = 0; y <
|
|
549
|
-
|
|
550
|
-
w.length ? (
|
|
548
|
+
for (var y = 0; y < u.length; y++)
|
|
549
|
+
b(u[y]);
|
|
550
|
+
w.length ? (m = bt(w), c(w, m)) : c(null, n);
|
|
551
551
|
}
|
|
552
552
|
if (h.messages) {
|
|
553
553
|
var f = this.messages();
|
|
554
554
|
f === Rt && (f = vt()), kt(f, h.messages), h.messages = f;
|
|
555
555
|
} else
|
|
556
556
|
h.messages = this.messages();
|
|
557
|
-
var
|
|
558
|
-
g.forEach(function(
|
|
559
|
-
var w = o.rules[
|
|
560
|
-
w.forEach(function(
|
|
561
|
-
var y =
|
|
562
|
-
typeof y.transform == "function" && (n === i && (n = q({}, n)),
|
|
557
|
+
var x = {}, g = h.keys || Object.keys(this.rules);
|
|
558
|
+
g.forEach(function(u) {
|
|
559
|
+
var w = o.rules[u], m = n[u];
|
|
560
|
+
w.forEach(function(b) {
|
|
561
|
+
var y = b;
|
|
562
|
+
typeof y.transform == "function" && (n === i && (n = q({}, n)), m = n[u] = y.transform(m)), typeof y == "function" ? y = {
|
|
563
563
|
validator: y
|
|
564
|
-
} : y = q({}, y), y.validator = o.getValidationMethod(y), y.validator && (y.field =
|
|
564
|
+
} : y = q({}, y), y.validator = o.getValidationMethod(y), y.validator && (y.field = u, y.fullField = y.fullField || u, y.type = o.getType(y), x[u] = x[u] || [], x[u].push({
|
|
565
565
|
rule: y,
|
|
566
|
-
value:
|
|
566
|
+
value: m,
|
|
567
567
|
source: n,
|
|
568
|
-
field:
|
|
568
|
+
field: u
|
|
569
569
|
}));
|
|
570
570
|
});
|
|
571
571
|
});
|
|
572
|
-
var
|
|
573
|
-
return Ae(
|
|
574
|
-
var
|
|
575
|
-
|
|
572
|
+
var p = {};
|
|
573
|
+
return Ae(x, h, function(u, w) {
|
|
574
|
+
var m = u.rule, b = (m.type === "object" || m.type === "array") && (typeof m.fields == "object" || typeof m.defaultField == "object");
|
|
575
|
+
b = b && (m.required || !m.required && u.value), m.field = u.field;
|
|
576
576
|
function y(R, O) {
|
|
577
577
|
return q({}, O, {
|
|
578
|
-
fullField:
|
|
579
|
-
fullFields:
|
|
578
|
+
fullField: m.fullField + "." + R,
|
|
579
|
+
fullFields: m.fullFields ? [].concat(m.fullFields, [R]) : [R]
|
|
580
580
|
});
|
|
581
581
|
}
|
|
582
|
-
function
|
|
582
|
+
function C(R) {
|
|
583
583
|
R === void 0 && (R = []);
|
|
584
584
|
var O = Array.isArray(R) ? R : [R];
|
|
585
|
-
!h.suppressWarning && O.length &&
|
|
586
|
-
var I = O.map(
|
|
585
|
+
!h.suppressWarning && O.length && l.warning("async-validator:", O), O.length && m.message !== void 0 && (O = [].concat(m.message));
|
|
586
|
+
var I = O.map(Nt(m, n));
|
|
587
587
|
if (h.first && I.length)
|
|
588
|
-
return m
|
|
589
|
-
if (!
|
|
588
|
+
return p[m.field] = 1, w(I);
|
|
589
|
+
if (!b)
|
|
590
590
|
w(I);
|
|
591
591
|
else {
|
|
592
|
-
if (
|
|
593
|
-
return
|
|
592
|
+
if (m.required && !u.value)
|
|
593
|
+
return m.message !== void 0 ? I = [].concat(m.message).map(Nt(m, n)) : h.error && (I = [h.error(m, D(h.messages.required, m.field))]), w(I);
|
|
594
594
|
var _ = {};
|
|
595
|
-
|
|
596
|
-
_[T] =
|
|
597
|
-
}), _ = q({}, _,
|
|
595
|
+
m.defaultField && Object.keys(u.value).map(function(T) {
|
|
596
|
+
_[T] = m.defaultField;
|
|
597
|
+
}), _ = q({}, _, u.rule.fields);
|
|
598
598
|
var v = {};
|
|
599
599
|
Object.keys(_).forEach(function(T) {
|
|
600
600
|
var M = _[T], A = Array.isArray(M) ? M : [M];
|
|
601
601
|
v[T] = A.map(y.bind(null, T));
|
|
602
602
|
});
|
|
603
|
-
var S = new
|
|
604
|
-
S.messages(h.messages),
|
|
603
|
+
var S = new l(v);
|
|
604
|
+
S.messages(h.messages), u.rule.options && (u.rule.options.messages = h.messages, u.rule.options.error = h.error), S.validate(u.value, u.rule.options || h, function(T) {
|
|
605
605
|
var M = [];
|
|
606
606
|
I && I.length && M.push.apply(M, I), T && T.length && M.push.apply(M, T), w(M.length ? M : null);
|
|
607
607
|
});
|
|
608
608
|
}
|
|
609
609
|
}
|
|
610
610
|
var E;
|
|
611
|
-
if (
|
|
612
|
-
E =
|
|
613
|
-
else if (
|
|
611
|
+
if (m.asyncValidator)
|
|
612
|
+
E = m.asyncValidator(m, u.value, C, u.source, h);
|
|
613
|
+
else if (m.validator) {
|
|
614
614
|
try {
|
|
615
|
-
E =
|
|
615
|
+
E = m.validator(m, u.value, C, u.source, h);
|
|
616
616
|
} catch (R) {
|
|
617
617
|
console.error == null || console.error(R), h.suppressValidatorError || setTimeout(function() {
|
|
618
618
|
throw R;
|
|
619
|
-
}, 0),
|
|
619
|
+
}, 0), C(R.message);
|
|
620
620
|
}
|
|
621
|
-
E === !0 ?
|
|
621
|
+
E === !0 ? C() : E === !1 ? C(typeof m.message == "function" ? m.message(m.fullField || m.field) : m.message || (m.fullField || m.field) + " fails") : E instanceof Array ? C(E) : E instanceof Error && C(E.message);
|
|
622
622
|
}
|
|
623
623
|
E && E.then && E.then(function() {
|
|
624
|
-
return
|
|
624
|
+
return C();
|
|
625
625
|
}, function(R) {
|
|
626
|
-
return
|
|
626
|
+
return C(R);
|
|
627
627
|
});
|
|
628
|
-
}, function(
|
|
629
|
-
d(
|
|
628
|
+
}, function(u) {
|
|
629
|
+
d(u);
|
|
630
630
|
}, n);
|
|
631
631
|
}, t.getType = function(i) {
|
|
632
632
|
if (i.type === void 0 && i.pattern instanceof RegExp && (i.type = "pattern"), typeof i.validator != "function" && i.type && !it.hasOwnProperty(i.type))
|
|
@@ -637,7 +637,7 @@ var Rt = vt(), nt = /* @__PURE__ */ function() {
|
|
|
637
637
|
return i.validator;
|
|
638
638
|
var s = Object.keys(i), r = s.indexOf("message");
|
|
639
639
|
return r !== -1 && s.splice(r, 1), s.length === 1 && s[0] === "required" ? it.required : it[this.getType(i)] || void 0;
|
|
640
|
-
},
|
|
640
|
+
}, l;
|
|
641
641
|
}();
|
|
642
642
|
nt.register = function(t, e) {
|
|
643
643
|
if (typeof e != "function")
|
|
@@ -648,26 +648,26 @@ nt.warning = Ut;
|
|
|
648
648
|
nt.messages = Rt;
|
|
649
649
|
nt.validators = it;
|
|
650
650
|
function Jt() {
|
|
651
|
-
return "xxxxxxxxxxxxxxxxxx".replace(/[x]/g, function(
|
|
651
|
+
return "xxxxxxxxxxxxxxxxxx".replace(/[x]/g, function(l) {
|
|
652
652
|
const t = Math.random() * 16 | 0;
|
|
653
|
-
return (
|
|
653
|
+
return (l === "x" ? t : t & 3 | 8).toString(16);
|
|
654
654
|
});
|
|
655
655
|
}
|
|
656
|
-
function Qt(
|
|
656
|
+
function Qt(l, t) {
|
|
657
657
|
let e = 0, i;
|
|
658
658
|
return function(...s) {
|
|
659
659
|
const r = (/* @__PURE__ */ new Date()).getTime(), o = r - e;
|
|
660
|
-
!e || o >= t ? (
|
|
661
|
-
|
|
660
|
+
!e || o >= t ? (l.apply(this, s), e = r) : i || (i = setTimeout(() => {
|
|
661
|
+
l.apply(this, s), e = (/* @__PURE__ */ new Date()).getTime(), i = void 0;
|
|
662
662
|
}, t - o));
|
|
663
663
|
};
|
|
664
664
|
}
|
|
665
|
-
function te(
|
|
666
|
-
return
|
|
665
|
+
function te(l = []) {
|
|
666
|
+
return l.length ? l.map((t) => te(t.children) + 1).sort((t, e) => e - t)[0] : 0;
|
|
667
667
|
}
|
|
668
|
-
function ei(
|
|
668
|
+
function ei(l = []) {
|
|
669
669
|
let t = [], e = [], i = [];
|
|
670
|
-
return
|
|
670
|
+
return l.forEach((s) => {
|
|
671
671
|
s.fixed === "left" ? t.push(s) : s.fixed === "right" ? i.push(s) : e.push(s);
|
|
672
672
|
}), [
|
|
673
673
|
...t.sort((s, r) => (s.sort ?? 0) - (r.sort ?? 0)),
|
|
@@ -675,8 +675,8 @@ function ei(a = []) {
|
|
|
675
675
|
...i.sort((s, r) => (s.sort ?? 0) - (r.sort ?? 0))
|
|
676
676
|
];
|
|
677
677
|
}
|
|
678
|
-
function ee(
|
|
679
|
-
return
|
|
678
|
+
function ee(l = [], t = 1, e = 0) {
|
|
679
|
+
return l.map((i) => {
|
|
680
680
|
if (i.children) {
|
|
681
681
|
let s = 0, r = i.fixed;
|
|
682
682
|
i.children.forEach((n) => {
|
|
@@ -702,72 +702,72 @@ function ee(a = [], t = 1, e = 0) {
|
|
|
702
702
|
};
|
|
703
703
|
});
|
|
704
704
|
}
|
|
705
|
-
function _t(
|
|
705
|
+
function _t(l = []) {
|
|
706
706
|
let t = [];
|
|
707
|
-
return
|
|
707
|
+
return l.forEach((e) => {
|
|
708
708
|
e.children ? t = t.concat(_t(e.children)) : t.push(e);
|
|
709
709
|
}), t;
|
|
710
710
|
}
|
|
711
711
|
const Yt = /^(\r\n|\n\r|\r|\n)/, ii = /^[^\t\r\n]+/, Vt = /^\t/;
|
|
712
|
-
function si(
|
|
712
|
+
function si(l) {
|
|
713
713
|
let t = [[""]];
|
|
714
|
-
if (
|
|
714
|
+
if (l.length === 0)
|
|
715
715
|
return t;
|
|
716
716
|
let e = 0, i = 0, s;
|
|
717
|
-
for (;
|
|
718
|
-
if (s =
|
|
719
|
-
|
|
720
|
-
else if (
|
|
721
|
-
|
|
717
|
+
for (; l.length > 0 && s !== l.length; )
|
|
718
|
+
if (s = l.length, l.match(Vt))
|
|
719
|
+
l = l.replace(Vt, ""), e += 1, t[i][e] = "";
|
|
720
|
+
else if (l.match(Yt))
|
|
721
|
+
l = l.replace(Yt, ""), e = 0, i += 1, t[i] = [""];
|
|
722
722
|
else {
|
|
723
723
|
let r = "";
|
|
724
|
-
if (
|
|
724
|
+
if (l.startsWith('"')) {
|
|
725
725
|
let o = 0, n = !0;
|
|
726
726
|
for (; n; ) {
|
|
727
|
-
const h =
|
|
728
|
-
h === '"' && (o += 1), r += h,
|
|
727
|
+
const h = l.slice(0, 1);
|
|
728
|
+
h === '"' && (o += 1), r += h, l = l.slice(1), (l.length === 0 || l.match(/^[\t\r\n]/) && o % 2 === 0) && (n = !1);
|
|
729
729
|
}
|
|
730
730
|
r = r.replace(/^"/, "").replace(/"$/, "").replace(/["]*/g, (h) => new Array(Math.floor(h.length / 2)).fill('"').join(""));
|
|
731
731
|
} else {
|
|
732
|
-
const o =
|
|
733
|
-
r = o ? o[0] : "",
|
|
732
|
+
const o = l.match(ii);
|
|
733
|
+
r = o ? o[0] : "", l = l.slice(r.length);
|
|
734
734
|
}
|
|
735
735
|
t[i][e] = r;
|
|
736
736
|
}
|
|
737
737
|
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;
|
|
738
738
|
}
|
|
739
|
-
function ri(
|
|
739
|
+
function ri(l) {
|
|
740
740
|
let t, e, i, s, r = "", o;
|
|
741
|
-
for (t = 0, e =
|
|
742
|
-
for (s =
|
|
743
|
-
i > 0 && (r += " "), o =
|
|
741
|
+
for (t = 0, e = l.length; t < e; t += 1) {
|
|
742
|
+
for (s = l[t].length, i = 0; i < s; i += 1)
|
|
743
|
+
i > 0 && (r += " "), o = l[t][i], typeof o == "string" ? o.indexOf(`
|
|
744
744
|
`) > -1 ? r += `"${o.replace(/"/g, '""')}"` : r += o : o == null ? r += "" : r += o;
|
|
745
745
|
t !== e - 1 && (r += `
|
|
746
746
|
`);
|
|
747
747
|
}
|
|
748
748
|
return r;
|
|
749
749
|
}
|
|
750
|
-
function ie(
|
|
750
|
+
function ie(l, t, e = []) {
|
|
751
751
|
let i = 0;
|
|
752
752
|
const s = [];
|
|
753
|
-
return
|
|
753
|
+
return l.forEach((r, o) => {
|
|
754
754
|
if (o === 0)
|
|
755
755
|
s.push(1);
|
|
756
756
|
else {
|
|
757
|
-
const n = e.reduce((c, d) => `${c}${r[d] ?? ""}`, "") || r[t], h = e.reduce((c, d) => `${c}${
|
|
757
|
+
const n = e.reduce((c, d) => `${c}${r[d] ?? ""}`, "") || r[t], h = e.reduce((c, d) => `${c}${l[o - 1][d] ?? ""}`, "") || l[o - 1][t];
|
|
758
758
|
n === h ? (s[i] += 1, s.push(0)) : (s.push(1), i = o);
|
|
759
759
|
}
|
|
760
760
|
}), s;
|
|
761
761
|
}
|
|
762
|
-
function se(
|
|
762
|
+
function se(l, t) {
|
|
763
763
|
let e = "", i = "";
|
|
764
764
|
const s = {};
|
|
765
765
|
return t.forEach((r, o) => {
|
|
766
|
-
o === 0 ? (e = r.key, i = r.key, s[r.key] = 1) :
|
|
766
|
+
o === 0 ? (e = r.key, i = r.key, s[r.key] = 1) : l[r.key] === l[e] ? (s[r.key] = 0, s[i] += 1) : (s[r.key] = 1, e = r.key, i = r.key);
|
|
767
767
|
}), s;
|
|
768
768
|
}
|
|
769
|
-
function oi(
|
|
770
|
-
const { visibleRows: i, rowIndex: s, headIndex: r } =
|
|
769
|
+
function oi(l, t, e = []) {
|
|
770
|
+
const { visibleRows: i, rowIndex: s, headIndex: r } = l, o = ie(i, t, e);
|
|
771
771
|
return o[s - r] === 0 ? {
|
|
772
772
|
rowspan: 0,
|
|
773
773
|
colspan: 0,
|
|
@@ -780,8 +780,8 @@ function oi(a, t, e = []) {
|
|
|
780
780
|
mergeRow: !0
|
|
781
781
|
};
|
|
782
782
|
}
|
|
783
|
-
function ni(
|
|
784
|
-
const { column: e, row: i, visibleLeafColumns: s } =
|
|
783
|
+
function ni(l, t = []) {
|
|
784
|
+
const { column: e, row: i, visibleLeafColumns: s } = l, r = s.filter((o) => t.includes(o.key));
|
|
785
785
|
if (t.includes(e.key)) {
|
|
786
786
|
const o = se(i, r);
|
|
787
787
|
return o[e.key] === 0 ? {
|
|
@@ -797,19 +797,19 @@ function ni(a, t = []) {
|
|
|
797
797
|
};
|
|
798
798
|
}
|
|
799
799
|
}
|
|
800
|
-
function ai(
|
|
801
|
-
const e =
|
|
800
|
+
function ai(l, t = document.documentElement) {
|
|
801
|
+
const e = l.startsWith("--") ? l : `--${l}`;
|
|
802
802
|
return getComputedStyle(t).getPropertyValue(e).trim();
|
|
803
803
|
}
|
|
804
804
|
class re {
|
|
805
805
|
constructor(t, e, i, s, r, o, n) {
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
806
|
+
a(this, "ctx");
|
|
807
|
+
a(this, "x", 0);
|
|
808
|
+
a(this, "y", 0);
|
|
809
|
+
a(this, "width", 0);
|
|
810
|
+
a(this, "height", 0);
|
|
811
|
+
a(this, "fixed");
|
|
812
|
+
a(this, "cellType");
|
|
813
813
|
this.ctx = t, this.x = e, this.y = i, this.width = s, this.height = r, this.fixed = n, this.cellType = o;
|
|
814
814
|
}
|
|
815
815
|
isHorizontalVisible() {
|
|
@@ -850,62 +850,62 @@ class re {
|
|
|
850
850
|
class At extends re {
|
|
851
851
|
constructor(e, i, s, r, o, n, h, c, d, f = "body") {
|
|
852
852
|
super(e, r, o, n, h, f, c.fixed);
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
853
|
+
a(this, "formatter");
|
|
854
|
+
a(this, "formatterFooter");
|
|
855
|
+
a(this, "hoverIconName", "");
|
|
856
|
+
a(this, "operation", !1);
|
|
857
|
+
a(this, "align");
|
|
858
|
+
a(this, "verticalAlign");
|
|
859
|
+
a(this, "fixed");
|
|
860
|
+
a(this, "type");
|
|
861
|
+
a(this, "editorType");
|
|
862
|
+
a(this, "editorProps");
|
|
863
|
+
a(this, "cellType");
|
|
864
|
+
a(this, "level");
|
|
865
|
+
a(this, "colspan", 1);
|
|
866
|
+
a(this, "rowspan", 1);
|
|
867
|
+
a(this, "mergeRow", !1);
|
|
868
|
+
a(this, "mergeCol", !1);
|
|
869
|
+
a(this, "relationRowKeys", []);
|
|
870
870
|
// 合并单元格关联key
|
|
871
|
-
|
|
871
|
+
a(this, "relationColKeys", []);
|
|
872
872
|
// 合并单元格关联key
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
873
|
+
a(this, "key");
|
|
874
|
+
a(this, "column");
|
|
875
|
+
a(this, "rowIndex");
|
|
876
|
+
a(this, "colIndex");
|
|
877
|
+
a(this, "rowKey");
|
|
878
|
+
a(this, "row");
|
|
879
|
+
a(this, "value");
|
|
880
|
+
a(this, "render");
|
|
881
|
+
a(this, "renderFooter");
|
|
882
|
+
a(this, "style", {});
|
|
883
|
+
a(this, "rules", []);
|
|
884
|
+
a(this, "message", "");
|
|
885
|
+
a(this, "text", "");
|
|
886
|
+
a(this, "displayText", "");
|
|
887
|
+
a(this, "visibleWidth", 0);
|
|
888
|
+
a(this, "visibleHeight", 0);
|
|
889
|
+
a(this, "isHasChanged", !1);
|
|
890
|
+
a(this, "drawX", 0);
|
|
891
|
+
a(this, "drawY", 0);
|
|
892
|
+
a(this, "drawCellBgColor", "");
|
|
893
|
+
a(this, "drawCellSkyBgColor", "");
|
|
894
|
+
a(this, "drawTextColor", "");
|
|
895
|
+
a(this, "drawTextX", 0);
|
|
896
|
+
a(this, "drawTextY", 0);
|
|
897
|
+
a(this, "drawImageX", 0);
|
|
898
|
+
a(this, "drawImageY", 0);
|
|
899
|
+
a(this, "drawImageWidth", 0);
|
|
900
|
+
a(this, "drawImageHeight", 0);
|
|
901
|
+
a(this, "drawImageName", "");
|
|
902
|
+
a(this, "drawImageSource");
|
|
903
|
+
a(this, "ellipsis", !1);
|
|
904
|
+
a(this, "rowExpand", !1);
|
|
905
|
+
a(this, "rowHasChildren", !1);
|
|
906
|
+
a(this, "overflowTooltipShow", !0);
|
|
907
|
+
a(this, "overflowTooltipMaxWidth", 500);
|
|
908
|
+
a(this, "overflowTooltipPlacement", "top");
|
|
909
909
|
this.visibleWidth = this.width, this.visibleHeight = this.height, this.colIndex = s, this.rowIndex = i, this.key = c.key, this.type = c.type || "", this.editorType = c.editorType || "text", this.editorProps = c.editorProps || {}, this.cellType = f, this.align = c.align || "center", this.verticalAlign = c.verticalAlign || "middle", this.fixed = c.fixed, this.level = c.level || 0, this.operation = c.operation || !1, this.column = c, this.rules = c.rules || [], this.row = d, this.rowKey = this.cellType === "body" ? this.ctx.database.getRowKeyForRowIndex(i) : `${this.cellType}_${this.rowIndex}`, this.value = this.getValue(), this.render = c.render, this.overflowTooltipShow = c.overflowTooltipShow !== !1, this.overflowTooltipMaxWidth = c.overflowTooltipMaxWidth || 500, this.overflowTooltipPlacement = c.overflowTooltipPlacement || "top", this.renderFooter = c.renderFooter, this.hoverIconName = c.hoverIconName, this.formatter = c.formatter, this.formatterFooter = c.formatterFooter, this.update();
|
|
910
910
|
}
|
|
911
911
|
setWidthHeight(e, i) {
|
|
@@ -1019,19 +1019,19 @@ class At extends re {
|
|
|
1019
1019
|
const { CELL_PADDING: e = 0 } = this.ctx.config, { rowKey: i, cellType: s } = this;
|
|
1020
1020
|
let r, o = 0, n = "";
|
|
1021
1021
|
if (this.type === "tree" && s === "body") {
|
|
1022
|
-
const h = this.ctx.database.getRowForRowKey(i), { expand: c = !1, hasChildren: d = !1, expandLoading: f = !1, level:
|
|
1022
|
+
const h = this.ctx.database.getRowForRowKey(i), { expand: c = !1, hasChildren: d = !1, expandLoading: f = !1, level: x = 0 } = h || {};
|
|
1023
1023
|
if (this.rowExpand = c, this.rowHasChildren = d, f) {
|
|
1024
|
-
const
|
|
1025
|
-
n = "loading", r =
|
|
1024
|
+
const u = this.ctx.icons.get("loading");
|
|
1025
|
+
n = "loading", r = u, o = x * 8;
|
|
1026
1026
|
} else if (d) {
|
|
1027
|
-
const
|
|
1028
|
-
r = c ? w :
|
|
1027
|
+
const u = this.ctx.icons.get("expand"), w = this.ctx.icons.get("shrink");
|
|
1028
|
+
r = c ? w : u, n = c ? "shrink" : "expand", o = x * 8;
|
|
1029
1029
|
} else
|
|
1030
|
-
o =
|
|
1031
|
-
let g = 20,
|
|
1030
|
+
o = x * 8;
|
|
1031
|
+
let g = 20, p = 20;
|
|
1032
1032
|
if (r) {
|
|
1033
|
-
let
|
|
1034
|
-
this.ctx.paint.drawImage(r,
|
|
1033
|
+
let u = this.drawX + o + e, w = this.drawY + (this.visibleHeight - p) / 2;
|
|
1034
|
+
this.ctx.paint.drawImage(r, u, w, g, p), this.drawImageX = u, this.drawImageY = w, this.drawImageWidth = g, this.drawImageHeight = p, this.drawImageName = n, this.drawImageSource = r;
|
|
1035
1035
|
}
|
|
1036
1036
|
this.align = "left", this.drawTextX = o + this.drawX + g - 0.5;
|
|
1037
1037
|
}
|
|
@@ -1048,10 +1048,10 @@ class At extends re {
|
|
|
1048
1048
|
FOOTER_BG_COLOR: c,
|
|
1049
1049
|
HIGHLIGHT_SELECTED_ROW: d,
|
|
1050
1050
|
HIGHLIGHT_SELECTED_ROW_COLOR: f,
|
|
1051
|
-
HIGHLIGHT_HOVER_ROW:
|
|
1051
|
+
HIGHLIGHT_HOVER_ROW: x,
|
|
1052
1052
|
HIGHLIGHT_HOVER_ROW_COLOR: g,
|
|
1053
|
-
STRIPE:
|
|
1054
|
-
STRIPE_COLOR:
|
|
1053
|
+
STRIPE: p,
|
|
1054
|
+
STRIPE_COLOR: u
|
|
1055
1055
|
} = this.ctx.config;
|
|
1056
1056
|
if (this.cellType === "footer") {
|
|
1057
1057
|
let O = c, I = h;
|
|
@@ -1069,15 +1069,15 @@ class At extends re {
|
|
|
1069
1069
|
return;
|
|
1070
1070
|
}
|
|
1071
1071
|
let w = "transparent";
|
|
1072
|
-
const
|
|
1073
|
-
let y = this.rowIndex,
|
|
1074
|
-
if (this.rowspan !== 1 && (
|
|
1072
|
+
const m = this.ctx.hoverCell, b = this.ctx.currentCell;
|
|
1073
|
+
let y = this.rowIndex, C = this.rowIndex;
|
|
1074
|
+
if (this.rowspan !== 1 && (x || d)) {
|
|
1075
1075
|
const O = this.getSpanInfo(), { yArr: I } = O;
|
|
1076
|
-
y = I[0],
|
|
1076
|
+
y = I[0], C = I[1];
|
|
1077
1077
|
}
|
|
1078
|
-
|
|
1078
|
+
x && m && (m.rowKey === this.rowKey && (w = g), m.rowIndex >= y && m.rowIndex <= C && (w = g)), d && b && (b.rowKey === this.rowKey && (w = f), b.rowIndex >= y && b.rowIndex <= C && (w = f)), this.drawCellSkyBgColor = w;
|
|
1079
1079
|
let E = e, R = n;
|
|
1080
|
-
if (this.ctx.database.getReadonly(this.rowKey, this.key) || (E = i, R = o),
|
|
1080
|
+
if (this.ctx.database.getReadonly(this.rowKey, this.key) || (E = i, R = o), p && (this.rowIndex % 2 ? E = u : E = e), typeof s == "function") {
|
|
1081
1081
|
const O = s, { backgroundColor: I, color: _ } = O({
|
|
1082
1082
|
row: this.row,
|
|
1083
1083
|
rowIndex: this.rowIndex,
|
|
@@ -1093,9 +1093,9 @@ class At extends re {
|
|
|
1093
1093
|
updateSelection() {
|
|
1094
1094
|
const { visibleWidth: e, visibleHeight: i, rowspan: s, colspan: r, cellType: o, type: n, rowIndex: h, rowKey: c } = this;
|
|
1095
1095
|
if (!(s === 0 || r === 0) && o !== "footer" && ["index-selection", "selection"].includes(n)) {
|
|
1096
|
-
const d = this.ctx.database.getRowSelection(c), f = this.ctx.database.getRowSelectable(c), { CHECKBOX_SIZE:
|
|
1097
|
-
let
|
|
1098
|
-
d && f ? (
|
|
1096
|
+
const d = this.ctx.database.getRowSelection(c), f = this.ctx.database.getRowSelectable(c), { CHECKBOX_SIZE: x = 0 } = this.ctx.config, g = this.drawX + (e - x) / 2, p = this.drawY + (i - x) / 2;
|
|
1097
|
+
let u = this.ctx.icons.get("checkbox-uncheck"), w = "checkbox-uncheck";
|
|
1098
|
+
d && f ? (u = this.ctx.icons.get("checkbox-check"), w = "checkbox-check") : d && f ? (u = this.ctx.icons.get("checkbox-check-disabled"), w = "checkbox-check-disabled") : !d && f ? (u = this.ctx.icons.get("checkbox-uncheck"), w = "checkbox-uncheck") : (u = this.ctx.icons.get("checkbox-disabled"), w = "checkbox-disabled"), u && n == "index-selection" ? (this.ctx.hoverCell && this.ctx.hoverCell.rowIndex === h || ["checkbox-disabled", "checkbox-check"].includes(w)) && (this.drawImageX = g, this.drawImageY = p, this.drawImageWidth = x, this.drawImageHeight = x, this.drawImageName = w, this.drawImageSource = u) : u && n === "selection" && (this.drawImageX = g, this.drawImageY = p, this.drawImageWidth = x, this.drawImageHeight = x, this.drawImageName = w, this.drawImageSource = u);
|
|
1099
1099
|
}
|
|
1100
1100
|
}
|
|
1101
1101
|
updateHoverIcon() {
|
|
@@ -1116,10 +1116,10 @@ class At extends re {
|
|
|
1116
1116
|
if (this.hoverIconName && !this.ctx.editing && n) {
|
|
1117
1117
|
let h = 0, c = 0;
|
|
1118
1118
|
if (n.rowKey === this.rowKey && (h = this.drawX + this.width - s - r, c = this.drawY + (this.height - s) / 2), this.rowspan !== 1 && o) {
|
|
1119
|
-
const f = this.getSpanInfo(), { yArr:
|
|
1120
|
-
if (n.rowIndex >= g && n.rowIndex <=
|
|
1121
|
-
const { width:
|
|
1122
|
-
h = this.drawX -
|
|
1119
|
+
const f = this.getSpanInfo(), { yArr: x } = f, g = x[0], p = x[1];
|
|
1120
|
+
if (n.rowIndex >= g && n.rowIndex <= p) {
|
|
1121
|
+
const { width: u, height: w, offsetTop: m, offsetLeft: b } = f;
|
|
1122
|
+
h = this.drawX - b + u - s - r, c = this.drawY - m + (w - s) / 2;
|
|
1123
1123
|
}
|
|
1124
1124
|
}
|
|
1125
1125
|
const d = this.ctx.icons.get(this.hoverIconName);
|
|
@@ -1218,10 +1218,10 @@ class At extends re {
|
|
|
1218
1218
|
const { SELECT_BORDER_COLOR: e, ENABLE_AUTOFILL: i, ENABLE_SELECTOR: s, AUTOFILL_POINT_BORDER_COLOR: r } = this.ctx.config;
|
|
1219
1219
|
if (!s || !i || this.ctx.editing)
|
|
1220
1220
|
return;
|
|
1221
|
-
const { xArr: o, yArr: n } = this.ctx.selector, h = o[1], c = n[1], { colIndex: d, rowIndex: f, drawX:
|
|
1221
|
+
const { xArr: o, yArr: n } = this.ctx.selector, h = o[1], c = n[1], { colIndex: d, rowIndex: f, drawX: x, drawY: g } = this;
|
|
1222
1222
|
if (d === h && f === c) {
|
|
1223
|
-
const
|
|
1224
|
-
this.ctx.paint.drawRect(
|
|
1223
|
+
const u = d === this.ctx.maxColIndex || f === this.ctx.maxRowIndex || d === this.ctx.lastCenterColIndex ? 6 : 4;
|
|
1224
|
+
this.ctx.paint.drawRect(x + this.width - u, g + this.height - u, 6, 6, {
|
|
1225
1225
|
borderColor: r,
|
|
1226
1226
|
fillColor: e
|
|
1227
1227
|
});
|
|
@@ -1348,46 +1348,46 @@ class At extends re {
|
|
|
1348
1348
|
drawBorder(e) {
|
|
1349
1349
|
const { drawX: i, drawY: s, rowIndex: r, colIndex: o, height: n, width: h } = this;
|
|
1350
1350
|
let c = i, d = s;
|
|
1351
|
-
const { xArr: f, yArr:
|
|
1352
|
-
if (o >=
|
|
1353
|
-
const E = o ===
|
|
1351
|
+
const { xArr: f, yArr: x, lineDash: g = [], borderWidth: p = 1, borderColor: u, fillColor: w } = e, m = f[0], b = f[1], y = x[0], C = x[1];
|
|
1352
|
+
if (o >= m && o <= b && r === y) {
|
|
1353
|
+
const E = o === b ? 1 : 0, R = o === m ? 1 : 0;
|
|
1354
1354
|
this.ctx.paint.drawLine([c + R, d + 1, c + h - E, d + 1], {
|
|
1355
|
-
borderColor:
|
|
1355
|
+
borderColor: u,
|
|
1356
1356
|
fillColor: w,
|
|
1357
|
-
borderWidth:
|
|
1357
|
+
borderWidth: p,
|
|
1358
1358
|
lineCap: "round",
|
|
1359
1359
|
lineJoin: "round",
|
|
1360
1360
|
lineDash: g
|
|
1361
1361
|
});
|
|
1362
1362
|
}
|
|
1363
|
-
if (o ===
|
|
1364
|
-
const E = r === y ? 1 : 0, R = r ===
|
|
1363
|
+
if (o === b && r >= y && r <= C) {
|
|
1364
|
+
const E = r === y ? 1 : 0, R = r === C ? 1 : 0;
|
|
1365
1365
|
this.ctx.paint.drawLine([c + h - 1, d + E, c + h - 1, d + n - R], {
|
|
1366
|
-
borderColor:
|
|
1366
|
+
borderColor: u,
|
|
1367
1367
|
fillColor: w,
|
|
1368
|
-
borderWidth:
|
|
1368
|
+
borderWidth: p,
|
|
1369
1369
|
lineCap: "round",
|
|
1370
1370
|
lineJoin: "round",
|
|
1371
1371
|
lineDash: g
|
|
1372
1372
|
});
|
|
1373
1373
|
}
|
|
1374
|
-
if (o >=
|
|
1375
|
-
const E = o ===
|
|
1374
|
+
if (o >= m && o <= b && r === C) {
|
|
1375
|
+
const E = o === b ? 1 : 0, R = o === m ? 1 : 0;
|
|
1376
1376
|
this.ctx.paint.drawLine([c + R, d + n - 1, c + h - E, d + n - 1], {
|
|
1377
|
-
borderColor:
|
|
1377
|
+
borderColor: u,
|
|
1378
1378
|
fillColor: w,
|
|
1379
|
-
borderWidth:
|
|
1379
|
+
borderWidth: p,
|
|
1380
1380
|
lineCap: "round",
|
|
1381
1381
|
lineJoin: "round",
|
|
1382
1382
|
lineDash: g
|
|
1383
1383
|
});
|
|
1384
1384
|
}
|
|
1385
|
-
if (o ===
|
|
1386
|
-
const E = r ===
|
|
1385
|
+
if (o === m && r >= y && r <= C) {
|
|
1386
|
+
const E = r === C ? 1 : 0, R = r === y ? 1 : 0;
|
|
1387
1387
|
this.ctx.paint.drawLine([c + 1, d + R, c + 1, d + n - E], {
|
|
1388
|
-
borderColor:
|
|
1388
|
+
borderColor: u,
|
|
1389
1389
|
fillColor: w,
|
|
1390
|
-
borderWidth:
|
|
1390
|
+
borderWidth: p,
|
|
1391
1391
|
lineCap: "round",
|
|
1392
1392
|
lineJoin: "round",
|
|
1393
1393
|
lineDash: g
|
|
@@ -1398,40 +1398,39 @@ class At extends re {
|
|
|
1398
1398
|
class li {
|
|
1399
1399
|
//虚拟滚动位置
|
|
1400
1400
|
constructor(t, e) {
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1401
|
+
a(this, "loading", !1);
|
|
1402
|
+
a(this, "ctx");
|
|
1403
|
+
a(this, "data");
|
|
1404
|
+
a(this, "columns");
|
|
1405
|
+
a(this, "footerData", []);
|
|
1406
|
+
a(this, "rowKeyMap", /* @__PURE__ */ new Map());
|
|
1407
|
+
a(this, "colIndexKeyMap", /* @__PURE__ */ new Map());
|
|
1408
|
+
a(this, "headerMap", /* @__PURE__ */ new Map());
|
|
1409
|
+
a(this, "rowIndexRowKeyMap", /* @__PURE__ */ new Map());
|
|
1410
|
+
a(this, "rowKeyRowIndexMap", /* @__PURE__ */ new Map());
|
|
1411
|
+
a(this, "checkboxKeyMap", /* @__PURE__ */ new Map());
|
|
1412
|
+
a(this, "selectionMap", /* @__PURE__ */ new Map());
|
|
1413
|
+
a(this, "expandMap", /* @__PURE__ */ new Map());
|
|
1414
|
+
a(this, "originalDataMap", /* @__PURE__ */ new Map());
|
|
1415
|
+
a(this, "changedDataMap", /* @__PURE__ */ new Map());
|
|
1416
|
+
a(this, "validationErrorMap", /* @__PURE__ */ new Map());
|
|
1417
|
+
a(this, "itemRowKeyMap", /* @__PURE__ */ new WeakMap());
|
|
1418
|
+
a(this, "bufferData", []);
|
|
1419
|
+
a(this, "bufferCheckState", {
|
|
1419
1420
|
buffer: !1,
|
|
1420
1421
|
check: !1,
|
|
1421
1422
|
indeterminate: !1,
|
|
1422
1423
|
selectable: !0
|
|
1423
1424
|
});
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1425
|
+
a(this, "sumHeight", 0);
|
|
1426
|
+
a(this, "filterMethod");
|
|
1427
|
+
a(this, "positions", []);
|
|
1427
1428
|
this.ctx = t;
|
|
1428
1429
|
const { data: i = [], columns: s = [], footerData: r = [] } = e;
|
|
1429
1430
|
this.data = i, this.footerData = r, this.columns = s, this.setLoading(!0), this.init();
|
|
1430
1431
|
}
|
|
1431
1432
|
init() {
|
|
1432
|
-
this.clearBufferData(), this.rowKeyMap.clear(), this.checkboxKeyMap.clear(), this.colIndexKeyMap.clear(), this.rowIndexRowKeyMap.clear(), this.rowKeyRowIndexMap.clear(), this.originalDataMap.clear(), this.changedDataMap.clear(), this.validationErrorMap.clear(), this.itemRowKeyMap = /* @__PURE__ */ new WeakMap();
|
|
1433
|
-
const { ROW_KEY: t, ENABLE_RESERVE_SELECTION: e } = this.ctx.config;
|
|
1434
|
-
e && t || this.selectionMap.clear(), this.initData(this.data), this.getData(), this.bufferCheckState.buffer = !1;
|
|
1433
|
+
this.clearBufferData(), this.rowKeyMap.clear(), this.checkboxKeyMap.clear(), this.colIndexKeyMap.clear(), this.rowIndexRowKeyMap.clear(), this.rowKeyRowIndexMap.clear(), this.originalDataMap.clear(), this.changedDataMap.clear(), this.validationErrorMap.clear(), this.itemRowKeyMap = /* @__PURE__ */ new WeakMap(), this.initData(this.data), this.getData(), this.bufferCheckState.buffer = !1;
|
|
1435
1434
|
}
|
|
1436
1435
|
/**
|
|
1437
1436
|
* 清除缓存数据
|
|
@@ -1446,34 +1445,40 @@ class li {
|
|
|
1446
1445
|
*/
|
|
1447
1446
|
initData(t, e = 0) {
|
|
1448
1447
|
t.forEach((i, s) => {
|
|
1449
|
-
var
|
|
1450
|
-
let r =
|
|
1451
|
-
Array.isArray(i.children) && i.children.length && (r = !0, this.initData(i.children, e + 1));
|
|
1452
|
-
const { ROW_KEY: o = "", DEFAULT_EXPAND_ALL: n, CELL_HEIGHT: h, SELECTABLE_METHOD: c, CHECKBOX_KEY: d } = this.ctx.config, f = i[o],
|
|
1453
|
-
this.itemRowKeyMap.set(i,
|
|
1454
|
-
const g = i._height || h,
|
|
1455
|
-
let
|
|
1456
|
-
if (typeof c == "function" && (
|
|
1457
|
-
const
|
|
1458
|
-
if (this.checkboxKeyMap.has(
|
|
1459
|
-
const C = this.checkboxKeyMap.get(
|
|
1460
|
-
C.push(
|
|
1448
|
+
var m, b;
|
|
1449
|
+
let r = !1;
|
|
1450
|
+
Array.isArray(i.children) && (r = i._hasChildren, i.children.length && (r = !0, this.initData(i.children, e + 1)));
|
|
1451
|
+
const { ROW_KEY: o = "", DEFAULT_EXPAND_ALL: n, CELL_HEIGHT: h, SELECTABLE_METHOD: c, CHECKBOX_KEY: d } = this.ctx.config, f = i[o], x = f != null ? `${f}` : Jt();
|
|
1452
|
+
this.itemRowKeyMap.set(i, x);
|
|
1453
|
+
const g = i._height || h, p = i._readonly;
|
|
1454
|
+
let u = !0;
|
|
1455
|
+
if (typeof c == "function" && (u = c), d) {
|
|
1456
|
+
const y = i[d];
|
|
1457
|
+
if (this.checkboxKeyMap.has(y)) {
|
|
1458
|
+
const C = this.checkboxKeyMap.get(y) || [];
|
|
1459
|
+
C.push(x), this.checkboxKeyMap.set(y, C);
|
|
1461
1460
|
} else
|
|
1462
|
-
this.checkboxKeyMap.set(
|
|
1461
|
+
this.checkboxKeyMap.set(y, [x]);
|
|
1463
1462
|
}
|
|
1464
|
-
this.selectionMap.set(
|
|
1465
|
-
key: d ? i[d] :
|
|
1463
|
+
this.selectionMap.set(x, {
|
|
1464
|
+
key: d ? i[d] : x,
|
|
1466
1465
|
row: i,
|
|
1467
|
-
check: ((
|
|
1468
|
-
})
|
|
1469
|
-
|
|
1466
|
+
check: ((m = this.selectionMap.get(x)) == null ? void 0 : m.check) || !1
|
|
1467
|
+
});
|
|
1468
|
+
const w = n || ((b = this.expandMap.get(x)) == null ? void 0 : b.expand) || i._expand || !1;
|
|
1469
|
+
this.expandMap.set(x, {
|
|
1470
|
+
key: x,
|
|
1471
|
+
row: i,
|
|
1472
|
+
expand: w
|
|
1473
|
+
}), this.rowKeyMap.set(x, {
|
|
1474
|
+
readonly: p,
|
|
1470
1475
|
index: s,
|
|
1471
1476
|
rowIndex: s,
|
|
1472
1477
|
level: e,
|
|
1473
1478
|
height: g,
|
|
1474
1479
|
check: !1,
|
|
1475
|
-
selectable:
|
|
1476
|
-
expand:
|
|
1480
|
+
selectable: u,
|
|
1481
|
+
expand: w,
|
|
1477
1482
|
expandLazy: !1,
|
|
1478
1483
|
hasChildren: r,
|
|
1479
1484
|
expandLoading: !1,
|
|
@@ -1581,12 +1586,20 @@ class li {
|
|
|
1581
1586
|
*/
|
|
1582
1587
|
expandItem(t, e = !1) {
|
|
1583
1588
|
const i = this.rowKeyMap.get(t);
|
|
1584
|
-
i.expand = e, this.
|
|
1589
|
+
i.expand = e, this.expandMap.set(t, {
|
|
1590
|
+
key: t,
|
|
1591
|
+
row: i.item,
|
|
1592
|
+
expand: e
|
|
1593
|
+
}), this.clearBufferData(), this.ctx.emit("draw");
|
|
1585
1594
|
}
|
|
1586
1595
|
setExpandRowKeys(t, e = !0) {
|
|
1587
1596
|
t.forEach((i) => {
|
|
1588
1597
|
const s = this.rowKeyMap.get(i);
|
|
1589
|
-
|
|
1598
|
+
this.expandMap.set(i, {
|
|
1599
|
+
key: i,
|
|
1600
|
+
row: s.item,
|
|
1601
|
+
expand: e
|
|
1602
|
+
}), s.expand = e;
|
|
1590
1603
|
}), this.clearBufferData(), this.ctx.emit("draw");
|
|
1591
1604
|
}
|
|
1592
1605
|
getExpandRowKeys() {
|
|
@@ -1597,7 +1610,11 @@ class li {
|
|
|
1597
1610
|
}
|
|
1598
1611
|
expandAll(t) {
|
|
1599
1612
|
this.rowKeyMap.forEach((e) => {
|
|
1600
|
-
e.expand = t
|
|
1613
|
+
e.expand = t, this.expandMap.set(e.key, {
|
|
1614
|
+
key: e.key,
|
|
1615
|
+
row: e.item,
|
|
1616
|
+
expand: t
|
|
1617
|
+
});
|
|
1601
1618
|
}), this.clearBufferData(), this.ctx.emit("draw");
|
|
1602
1619
|
}
|
|
1603
1620
|
expandLoading(t, e = !1) {
|
|
@@ -1606,7 +1623,11 @@ class li {
|
|
|
1606
1623
|
}
|
|
1607
1624
|
setExpandChildren(t, e) {
|
|
1608
1625
|
const i = this.rowKeyMap.get(t);
|
|
1609
|
-
i.expand = !0,
|
|
1626
|
+
i.expand = !0, this.expandMap.set(t, {
|
|
1627
|
+
key: t,
|
|
1628
|
+
row: i.item,
|
|
1629
|
+
expand: !0
|
|
1630
|
+
}), i.expandLazy = !0, i.item.children = e, this.initData(i.item.children, i.level + 1), this.clearBufferData();
|
|
1610
1631
|
}
|
|
1611
1632
|
getIsExpandLoading(t) {
|
|
1612
1633
|
return this.rowKeyMap.get(t).expandLoading;
|
|
@@ -1684,19 +1705,19 @@ class li {
|
|
|
1684
1705
|
let i = [];
|
|
1685
1706
|
const s = /* @__PURE__ */ new Set();
|
|
1686
1707
|
let r = [], o = t.map((d) => {
|
|
1687
|
-
const { rowKey: f, key:
|
|
1688
|
-
let g = d.value,
|
|
1689
|
-
const
|
|
1690
|
-
return (
|
|
1708
|
+
const { rowKey: f, key: x } = d;
|
|
1709
|
+
let g = d.value, p = g;
|
|
1710
|
+
const u = this.getRowDataItemForRowKey(f), w = this.getItemValue(f, x), m = this.getVirtualBodyCellByKey(f, x);
|
|
1711
|
+
return (m == null ? void 0 : m.type) === "number" && (["", void 0, null].includes(g) ? p = null : /^-?\d+(\.\d+)?$/.test(`${g}`) ? p = Number(g) : (p = w, r.push({
|
|
1691
1712
|
...d,
|
|
1692
|
-
value:
|
|
1713
|
+
value: p,
|
|
1693
1714
|
oldValue: w,
|
|
1694
|
-
row:
|
|
1715
|
+
row: u
|
|
1695
1716
|
}))), {
|
|
1696
1717
|
...d,
|
|
1697
|
-
value:
|
|
1718
|
+
value: p,
|
|
1698
1719
|
oldValue: w,
|
|
1699
|
-
row:
|
|
1720
|
+
row: u
|
|
1700
1721
|
};
|
|
1701
1722
|
});
|
|
1702
1723
|
if (o = o.filter((d) => !r.some((f) => d.rowKey === f.rowKey && d.key === f.key)), r.length) {
|
|
@@ -1711,11 +1732,11 @@ class li {
|
|
|
1711
1732
|
return;
|
|
1712
1733
|
const { BEFORE_VALUE_CHANGE_METHOD: n } = this.ctx.config;
|
|
1713
1734
|
typeof n == "function" && (o = await n(o)), o.forEach((d) => {
|
|
1714
|
-
const { value: f, rowKey:
|
|
1715
|
-
s.add(
|
|
1716
|
-
rowKey:
|
|
1735
|
+
const { value: f, rowKey: x, key: g, oldValue: p } = d;
|
|
1736
|
+
s.add(x), this.setItemValue(x, g, f), i.push({
|
|
1737
|
+
rowKey: x,
|
|
1717
1738
|
key: g,
|
|
1718
|
-
oldValue:
|
|
1739
|
+
oldValue: p,
|
|
1719
1740
|
newValue: f
|
|
1720
1741
|
});
|
|
1721
1742
|
});
|
|
@@ -1756,7 +1777,7 @@ class li {
|
|
|
1756
1777
|
n[e] !== null && typeof n[e] == "object" && (h = JSON.parse(JSON.stringify(n[e])));
|
|
1757
1778
|
const d = `${t}_${e}`;
|
|
1758
1779
|
this.originalDataMap.has(d) || this.originalDataMap.set(d, h);
|
|
1759
|
-
const f = this.originalDataMap.get(d),
|
|
1780
|
+
const f = this.originalDataMap.get(d), x = this.getRowDataItemForRowKey(t);
|
|
1760
1781
|
if (o) {
|
|
1761
1782
|
const g = this.getVirtualBodyCellByKey(t, e);
|
|
1762
1783
|
if ((g == null ? void 0 : g.type) === "number")
|
|
@@ -1775,7 +1796,7 @@ class li {
|
|
|
1775
1796
|
key: e,
|
|
1776
1797
|
value: c,
|
|
1777
1798
|
oldValue: h,
|
|
1778
|
-
row:
|
|
1799
|
+
row: x
|
|
1779
1800
|
}
|
|
1780
1801
|
]
|
|
1781
1802
|
};
|
|
@@ -1786,36 +1807,36 @@ class li {
|
|
|
1786
1807
|
oldValue: h,
|
|
1787
1808
|
newValue: h
|
|
1788
1809
|
};
|
|
1789
|
-
const { BEFORE_VALUE_CHANGE_METHOD:
|
|
1790
|
-
if (typeof
|
|
1791
|
-
const
|
|
1810
|
+
const { BEFORE_VALUE_CHANGE_METHOD: p } = this.ctx.config;
|
|
1811
|
+
if (typeof p == "function") {
|
|
1812
|
+
const m = await p([
|
|
1792
1813
|
{
|
|
1793
1814
|
rowKey: t,
|
|
1794
1815
|
key: e,
|
|
1795
1816
|
value: c,
|
|
1796
1817
|
oldValue: n[e],
|
|
1797
|
-
row:
|
|
1818
|
+
row: x
|
|
1798
1819
|
}
|
|
1799
1820
|
]);
|
|
1800
|
-
|
|
1821
|
+
m && m.length && (c = m[0].value);
|
|
1801
1822
|
}
|
|
1802
1823
|
this.changedDataMap.set(d, c), n[e] = c;
|
|
1803
|
-
const
|
|
1824
|
+
const u = {
|
|
1804
1825
|
rowKey: t,
|
|
1805
1826
|
key: e,
|
|
1806
1827
|
oldValue: h,
|
|
1807
1828
|
value: c,
|
|
1808
|
-
row:
|
|
1829
|
+
row: x
|
|
1809
1830
|
};
|
|
1810
1831
|
this.getValidator(t, e).then(() => {
|
|
1811
1832
|
this.validationErrorMap.size === 0 && this.changedDataMap.size > 0 && this.ctx.emit("validateChangedData", this.getChangedData());
|
|
1812
|
-
}), this.ctx.emit("change", [
|
|
1833
|
+
}), this.ctx.emit("change", [u], [x]), this.ctx.emit("editChange", {
|
|
1813
1834
|
rowKey: t,
|
|
1814
1835
|
key: e,
|
|
1815
1836
|
oldValue: h,
|
|
1816
1837
|
value: c,
|
|
1817
1838
|
originalValue: f,
|
|
1818
|
-
row:
|
|
1839
|
+
row: x
|
|
1819
1840
|
});
|
|
1820
1841
|
} else
|
|
1821
1842
|
this.changedDataMap.set(d, c), n[e] = c;
|
|
@@ -1825,7 +1846,7 @@ class li {
|
|
|
1825
1846
|
oldValue: h,
|
|
1826
1847
|
value: c,
|
|
1827
1848
|
originalValue: this.originalDataMap.get(d),
|
|
1828
|
-
row:
|
|
1849
|
+
row: x
|
|
1829
1850
|
}), s && this.ctx.history.pushState({
|
|
1830
1851
|
type: "single",
|
|
1831
1852
|
scrollX: this.ctx.scrollX,
|
|
@@ -1954,15 +1975,15 @@ class li {
|
|
|
1954
1975
|
return e;
|
|
1955
1976
|
const i = this.rowKeyMap.size;
|
|
1956
1977
|
let s = 0, r = 0;
|
|
1957
|
-
const o = this.selectionMap.size, n = Array.from(this.selectionMap.values()).some((
|
|
1958
|
-
this.rowKeyMap.forEach((
|
|
1959
|
-
var
|
|
1960
|
-
(
|
|
1961
|
-
let
|
|
1962
|
-
typeof
|
|
1963
|
-
row:
|
|
1964
|
-
rowIndex:
|
|
1965
|
-
})),
|
|
1978
|
+
const o = this.selectionMap.size, n = Array.from(this.selectionMap.values()).some((x) => x.check);
|
|
1979
|
+
this.rowKeyMap.forEach((x, g) => {
|
|
1980
|
+
var u;
|
|
1981
|
+
(u = this.selectionMap.get(g)) != null && u.check && (s += 1);
|
|
1982
|
+
let p = x.selectable;
|
|
1983
|
+
typeof p == "function" && (p = p({
|
|
1984
|
+
row: x.item,
|
|
1985
|
+
rowIndex: x.rowIndex
|
|
1986
|
+
})), p && (r += 1);
|
|
1966
1987
|
});
|
|
1967
1988
|
const h = o > i && s === 0 && n, c = r && r > s && s > 0 || h, d = r !== 0, f = !!r && r === s;
|
|
1968
1989
|
return this.bufferCheckState = {
|
|
@@ -2103,14 +2124,14 @@ class li {
|
|
|
2103
2124
|
if (h) {
|
|
2104
2125
|
let c = {}, d = {};
|
|
2105
2126
|
if (d[e] = this.getItemValue(t, e), Array.isArray(h)) {
|
|
2106
|
-
const
|
|
2127
|
+
const x = h.map((g) => ({
|
|
2107
2128
|
...g,
|
|
2108
2129
|
row: s.item,
|
|
2109
2130
|
column: n,
|
|
2110
2131
|
rowIndex: s.rowIndex,
|
|
2111
2132
|
colIndex: r.colIndex
|
|
2112
2133
|
}));
|
|
2113
|
-
c[e] =
|
|
2134
|
+
c[e] = x;
|
|
2114
2135
|
} else
|
|
2115
2136
|
c[e] = {
|
|
2116
2137
|
...h,
|
|
@@ -2121,9 +2142,9 @@ class li {
|
|
|
2121
2142
|
};
|
|
2122
2143
|
new nt(c).validate(d).then(() => {
|
|
2123
2144
|
this.clearValidationError(t, e), i([]);
|
|
2124
|
-
}).catch(({ errors:
|
|
2125
|
-
const g =
|
|
2126
|
-
...
|
|
2145
|
+
}).catch(({ errors: x }) => {
|
|
2146
|
+
const g = x.map((p) => ({
|
|
2147
|
+
...p,
|
|
2127
2148
|
column: n,
|
|
2128
2149
|
key: e,
|
|
2129
2150
|
row: s.item,
|
|
@@ -2155,10 +2176,10 @@ class li {
|
|
|
2155
2176
|
relationColKeys: c,
|
|
2156
2177
|
rowspan: d,
|
|
2157
2178
|
height: f,
|
|
2158
|
-
width:
|
|
2179
|
+
width: x,
|
|
2159
2180
|
colspan: g,
|
|
2160
|
-
mergeRow:
|
|
2161
|
-
mergeCol:
|
|
2181
|
+
mergeRow: p,
|
|
2182
|
+
mergeCol: u
|
|
2162
2183
|
} = t;
|
|
2163
2184
|
if (d === 1 && g === 1)
|
|
2164
2185
|
return {
|
|
@@ -2167,7 +2188,7 @@ class li {
|
|
|
2167
2188
|
rowspan: d,
|
|
2168
2189
|
colspan: g,
|
|
2169
2190
|
height: f,
|
|
2170
|
-
width:
|
|
2191
|
+
width: x,
|
|
2171
2192
|
offsetTop: 0,
|
|
2172
2193
|
offsetLeft: 0,
|
|
2173
2194
|
dataList: [
|
|
@@ -2179,17 +2200,17 @@ class li {
|
|
|
2179
2200
|
}
|
|
2180
2201
|
]
|
|
2181
2202
|
};
|
|
2182
|
-
let w = e,
|
|
2183
|
-
if (d !== 1 &&
|
|
2184
|
-
I =
|
|
2203
|
+
let w = e, m = e, b = n, y = n, C = [], E = 0, R = 0, O = 0, I = 0;
|
|
2204
|
+
if (d !== 1 && p) {
|
|
2205
|
+
I = x;
|
|
2185
2206
|
const _ = h.reduce((v, S) => {
|
|
2186
2207
|
const T = this.getItemValue(s, S) ?? "";
|
|
2187
2208
|
return `${v}${T}`;
|
|
2188
2209
|
}, "");
|
|
2189
2210
|
for (let v = e - 1; v >= 0; v--) {
|
|
2190
2211
|
const S = this.rowIndexRowKeyMap.get(v) || "", T = h.reduce((M, A) => {
|
|
2191
|
-
const
|
|
2192
|
-
return `${M}${
|
|
2212
|
+
const N = this.getItemValue(S, A) ?? "";
|
|
2213
|
+
return `${M}${N}`;
|
|
2193
2214
|
}, "");
|
|
2194
2215
|
if (_ === T)
|
|
2195
2216
|
w = v;
|
|
@@ -2198,11 +2219,11 @@ class li {
|
|
|
2198
2219
|
}
|
|
2199
2220
|
for (let v = e; v <= this.ctx.maxRowIndex; v++) {
|
|
2200
2221
|
const S = this.rowIndexRowKeyMap.get(v) || "", T = h.reduce((M, A) => {
|
|
2201
|
-
const
|
|
2202
|
-
return `${M}${
|
|
2222
|
+
const N = this.getItemValue(S, A) ?? "";
|
|
2223
|
+
return `${M}${N}`;
|
|
2203
2224
|
}, "");
|
|
2204
2225
|
if (_ === T)
|
|
2205
|
-
|
|
2226
|
+
m = v;
|
|
2206
2227
|
else
|
|
2207
2228
|
break;
|
|
2208
2229
|
}
|
|
@@ -2210,11 +2231,11 @@ class li {
|
|
|
2210
2231
|
const { height: S } = this.positions[v];
|
|
2211
2232
|
E += S;
|
|
2212
2233
|
}
|
|
2213
|
-
for (let v = w; v <=
|
|
2234
|
+
for (let v = w; v <= m; v++) {
|
|
2214
2235
|
const { height: S } = this.positions[v];
|
|
2215
2236
|
O += S;
|
|
2216
2237
|
const T = this.rowIndexRowKeyMap.get(v) || "", { item: M } = this.rowKeyMap.get(T), A = this.getItemValue(T, i);
|
|
2217
|
-
|
|
2238
|
+
C.push({
|
|
2218
2239
|
rowKey: T,
|
|
2219
2240
|
key: i,
|
|
2220
2241
|
value: A,
|
|
@@ -2222,7 +2243,7 @@ class li {
|
|
|
2222
2243
|
});
|
|
2223
2244
|
}
|
|
2224
2245
|
}
|
|
2225
|
-
if (g !== 1 &&
|
|
2246
|
+
if (g !== 1 && u) {
|
|
2226
2247
|
O = f;
|
|
2227
2248
|
for (let _ = n - 1; _ >= 0; _--) {
|
|
2228
2249
|
const v = this.getColumnByColIndex(_);
|
|
@@ -2230,7 +2251,7 @@ class li {
|
|
|
2230
2251
|
break;
|
|
2231
2252
|
const S = this.getItemValue(s, i), T = this.getItemValue(s, v.key);
|
|
2232
2253
|
if (S === T && c.includes(v.key))
|
|
2233
|
-
|
|
2254
|
+
b = _;
|
|
2234
2255
|
else
|
|
2235
2256
|
break;
|
|
2236
2257
|
}
|
|
@@ -2244,17 +2265,17 @@ class li {
|
|
|
2244
2265
|
else
|
|
2245
2266
|
break;
|
|
2246
2267
|
}
|
|
2247
|
-
for (let _ =
|
|
2268
|
+
for (let _ = b; _ < n; _++) {
|
|
2248
2269
|
const v = this.getColumnByColIndex(_);
|
|
2249
2270
|
if (!v)
|
|
2250
2271
|
break;
|
|
2251
2272
|
R += v.width || 100;
|
|
2252
2273
|
}
|
|
2253
|
-
for (let _ =
|
|
2274
|
+
for (let _ = b; _ <= y; _++) {
|
|
2254
2275
|
const v = this.getColumnByColIndex(_);
|
|
2255
2276
|
if (!v)
|
|
2256
2277
|
break;
|
|
2257
|
-
I += v.width || 100,
|
|
2278
|
+
I += v.width || 100, C.push({
|
|
2258
2279
|
rowKey: s,
|
|
2259
2280
|
key: v.key,
|
|
2260
2281
|
value: this.getItemValue(s, v.key),
|
|
@@ -2263,15 +2284,15 @@ class li {
|
|
|
2263
2284
|
}
|
|
2264
2285
|
}
|
|
2265
2286
|
return {
|
|
2266
|
-
xArr: [
|
|
2267
|
-
yArr: [w,
|
|
2287
|
+
xArr: [b, y],
|
|
2288
|
+
yArr: [w, m],
|
|
2268
2289
|
rowspan: d,
|
|
2269
2290
|
colspan: g,
|
|
2270
2291
|
height: O,
|
|
2271
2292
|
width: I,
|
|
2272
2293
|
offsetTop: E,
|
|
2273
2294
|
offsetLeft: R,
|
|
2274
|
-
dataList:
|
|
2295
|
+
dataList: C
|
|
2275
2296
|
};
|
|
2276
2297
|
}
|
|
2277
2298
|
setLoading(t) {
|
|
@@ -2325,9 +2346,9 @@ class li {
|
|
|
2325
2346
|
}
|
|
2326
2347
|
class hi {
|
|
2327
2348
|
constructor(t) {
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2349
|
+
a(this, "ctx");
|
|
2350
|
+
a(this, "history", []);
|
|
2351
|
+
a(this, "historyIndex", -1);
|
|
2331
2352
|
this.ctx = t, this.init();
|
|
2332
2353
|
}
|
|
2333
2354
|
init() {
|
|
@@ -2380,8 +2401,8 @@ class hi {
|
|
|
2380
2401
|
}
|
|
2381
2402
|
class ci {
|
|
2382
2403
|
constructor(t) {
|
|
2383
|
-
|
|
2384
|
-
|
|
2404
|
+
a(this, "eventTasks", /* @__PURE__ */ new Map());
|
|
2405
|
+
a(this, "ctx");
|
|
2385
2406
|
this.ctx = t, this.init();
|
|
2386
2407
|
}
|
|
2387
2408
|
init() {
|
|
@@ -2424,7 +2445,7 @@ class ci {
|
|
|
2424
2445
|
this.ctx.emit("touchmove", t);
|
|
2425
2446
|
}
|
|
2426
2447
|
handleContextMenu(t) {
|
|
2427
|
-
this.ctx.emit("contextMenu", t);
|
|
2448
|
+
t.preventDefault(), this.ctx.emit("contextMenu", t);
|
|
2428
2449
|
}
|
|
2429
2450
|
handleMouseover(t) {
|
|
2430
2451
|
this.ctx.isMouseoverTargetContainer = !0, this.ctx.emit("mouseover", t);
|
|
@@ -2447,7 +2468,7 @@ class ci {
|
|
|
2447
2468
|
}
|
|
2448
2469
|
class di {
|
|
2449
2470
|
constructor() {
|
|
2450
|
-
|
|
2471
|
+
a(this, "events", /* @__PURE__ */ new Map());
|
|
2451
2472
|
}
|
|
2452
2473
|
has(t) {
|
|
2453
2474
|
return this.events.has(t);
|
|
@@ -2485,7 +2506,7 @@ class di {
|
|
|
2485
2506
|
}
|
|
2486
2507
|
class fi {
|
|
2487
2508
|
constructor(t) {
|
|
2488
|
-
|
|
2509
|
+
a(this, "ctx");
|
|
2489
2510
|
const e = t.getContext("2d");
|
|
2490
2511
|
if (!e) throw new Error("canvas context not found");
|
|
2491
2512
|
this.ctx = e;
|
|
@@ -2558,8 +2579,8 @@ class fi {
|
|
|
2558
2579
|
if (this.ctx.save(), this.ctx.beginPath(), n !== void 0 && (this.ctx.fillStyle = n), o !== void 0 && (this.ctx.lineWidth = r, this.ctx.strokeStyle = o), h === 0)
|
|
2559
2580
|
this.ctx.rect(t - 0.5, e - 0.5, i, s);
|
|
2560
2581
|
else {
|
|
2561
|
-
const [c, d, f,
|
|
2562
|
-
this.ctx.moveTo(t + c, e), this.ctx.arcTo(t + i, e, t + i, e + d, d), this.ctx.arcTo(t + i, e + s, t + i - f, e + s, f), this.ctx.arcTo(t, e + s, t, e + s -
|
|
2582
|
+
const [c, d, f, x] = typeof h == "number" ? [h, h, h, h] : h;
|
|
2583
|
+
this.ctx.moveTo(t + c, e), this.ctx.arcTo(t + i, e, t + i, e + d, d), this.ctx.arcTo(t + i, e + s, t + i - f, e + s, f), this.ctx.arcTo(t, e + s, t, e + s - x, x), this.ctx.arcTo(t, e, t + c, e, c);
|
|
2563
2584
|
}
|
|
2564
2585
|
n !== void 0 && this.ctx.fill(), o !== void 0 && this.ctx.stroke(), this.ctx.restore();
|
|
2565
2586
|
}
|
|
@@ -2583,12 +2604,12 @@ class fi {
|
|
|
2583
2604
|
verticalAlign: f = "middle"
|
|
2584
2605
|
} = o;
|
|
2585
2606
|
this.ctx.font = n, this.ctx.fillStyle = c, this.ctx.textBaseline = f, this.ctx.textAlign = h;
|
|
2586
|
-
let
|
|
2587
|
-
f === "top" ?
|
|
2607
|
+
let x = 0;
|
|
2608
|
+
f === "top" ? x = i + d : f === "bottom" ? x = i + r - d : x = i + (r + 1) / 2;
|
|
2588
2609
|
let g = 0;
|
|
2589
2610
|
h === "left" ? g = e + d : h === "right" ? g = e + s - d : g = e + s / 2;
|
|
2590
|
-
const { _text:
|
|
2591
|
-
return this.ctx.fillText(
|
|
2611
|
+
const { _text: p, ellipsis: u } = this.handleEllipsis(t, s, d, n);
|
|
2612
|
+
return this.ctx.fillText(p, g, x), this.ctx.restore(), u;
|
|
2592
2613
|
}
|
|
2593
2614
|
handleEllipsis(t, e, i = 0, s = "12px Arial") {
|
|
2594
2615
|
let r = !1, o = t;
|
|
@@ -2615,153 +2636,151 @@ class fi {
|
|
|
2615
2636
|
}
|
|
2616
2637
|
class Wt {
|
|
2617
2638
|
constructor(t) {
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2639
|
+
a(this, "_config", {});
|
|
2640
|
+
a(this, "CSS_PREFIX", "e-virt-table");
|
|
2641
|
+
a(this, "ICONS", []);
|
|
2642
|
+
a(this, "ROW_KEY", "");
|
|
2643
|
+
a(this, "DISABLED", !1);
|
|
2623
2644
|
//禁用编辑,优先等级最高
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2645
|
+
a(this, "HEADER_FONT", "12px normal Arial");
|
|
2646
|
+
a(this, "BODY_FONT", "12px normal Arial");
|
|
2647
|
+
a(this, "BORDER", !0);
|
|
2648
|
+
a(this, "STRIPE", !1);
|
|
2628
2649
|
//斑马纹
|
|
2629
|
-
|
|
2650
|
+
a(this, "STRIPE_COLOR", "#fafafa");
|
|
2630
2651
|
//斑马纹颜色
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
// 启用保留选中行
|
|
2646
|
-
l(this, "ENABLE_HEADER_STICKY", !1);
|
|
2652
|
+
a(this, "BORDER_COLOR", "#e1e6eb");
|
|
2653
|
+
a(this, "WIDTH", 0);
|
|
2654
|
+
a(this, "RESIZE_MIN_WIDTH", 40);
|
|
2655
|
+
a(this, "HEIGHT", 0);
|
|
2656
|
+
a(this, "PLACEHOLDER_COLOR", "#CDD0DC");
|
|
2657
|
+
a(this, "EMPTY_BODY_HEIGHT", 120);
|
|
2658
|
+
a(this, "EMPTY_CUSTOM_STYLE", {});
|
|
2659
|
+
a(this, "EMPTY_TEXT", "暂无数据");
|
|
2660
|
+
a(this, "MAX_HEIGHT", 1e3);
|
|
2661
|
+
a(this, "BORDER_RADIUS", 8);
|
|
2662
|
+
a(this, "ENABLE_OFFSET_HEIGHT", !1);
|
|
2663
|
+
a(this, "OFFSET_HEIGHT", 0);
|
|
2664
|
+
a(this, "HEADER_HEIGHT", 36);
|
|
2665
|
+
a(this, "ENABLE_HEADER_STICKY", !1);
|
|
2647
2666
|
// 启用头部固定,需要外面实现覆盖层,或者所有表头都要是元素
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
|
|
2659
|
-
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
|
|
2665
|
-
|
|
2666
|
-
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
|
|
2667
|
+
a(this, "HEADER_BG_COLOR", "#F8FAFF");
|
|
2668
|
+
a(this, "BODY_BG_COLOR", "#FFF");
|
|
2669
|
+
a(this, "HEADER_TEXT_COLOR", "#1D2129");
|
|
2670
|
+
a(this, "BODY_TEXT_COLOR", "#4E5969");
|
|
2671
|
+
a(this, "FOOTER_TEXT_COLOR", "#4E5969");
|
|
2672
|
+
a(this, "LOADING_ICON_SVG", "");
|
|
2673
|
+
a(this, "LOADING_ICON_COLOR", "#4E5969");
|
|
2674
|
+
a(this, "EXPAND_ICON_SVG", "");
|
|
2675
|
+
a(this, "SHRINK_ICON_SVG", "");
|
|
2676
|
+
a(this, "EXPAND_ICON_COLOR", "#4E5969");
|
|
2677
|
+
a(this, "SHRINK_ICON_COLOR", "#4E5969");
|
|
2678
|
+
a(this, "ERROR_TIP_ICON_COLOR", "red");
|
|
2679
|
+
a(this, "ERROR_TIP_ICON_SIZE", 6);
|
|
2680
|
+
a(this, "EXPAND_LAZY", !0);
|
|
2681
|
+
a(this, "DEFAULT_EXPAND_ALL", !1);
|
|
2682
|
+
a(this, "CELL_WIDTH", 100);
|
|
2683
|
+
a(this, "CELL_HEIGHT", 36);
|
|
2684
|
+
a(this, "CELL_PADDING", 8);
|
|
2685
|
+
a(this, "CELL_HOVER_ICON_SIZE", 14);
|
|
2686
|
+
a(this, "CELL_HOVER_ICON_BG_COLOR", "#fff");
|
|
2687
|
+
a(this, "CELL_HOVER_ICON_BORDER_COLOR", "#DDE0EA");
|
|
2688
|
+
a(this, "SCROLLER_TRACK_SIZE", 14);
|
|
2689
|
+
a(this, "SCROLLER_SIZE", 8);
|
|
2690
|
+
a(this, "SCROLLER_COLOR", "#dee0e3");
|
|
2691
|
+
a(this, "SCROLLER_TRACK_COLOR", "#fff");
|
|
2692
|
+
a(this, "SCROLLER_FOCUS_COLOR", "#bbbec4");
|
|
2693
|
+
a(this, "SELECT_BORDER_COLOR", "rgb(82,146,247)");
|
|
2694
|
+
a(this, "SELECT_AREA_COLOR", "rgba(82,146,247,0.1)");
|
|
2695
|
+
a(this, "SELECT_ROW_COL_BG_COLOR", "transparent");
|
|
2696
|
+
a(this, "AUTOFILL_POINT_BORDER_COLOR", "#fff");
|
|
2697
|
+
a(this, "EDIT_BG_COLOR", "#fcf6ed");
|
|
2698
|
+
a(this, "CHECKBOX_KEY", "");
|
|
2699
|
+
a(this, "CHECKBOX_COLOR", "rgb(82,146,247)");
|
|
2700
|
+
a(this, "CHECKBOX_SIZE", 20);
|
|
2701
|
+
a(this, "CHECKBOX_DISABLED_SVG", "");
|
|
2702
|
+
a(this, "CHECKBOX_CHECK_SVG", "");
|
|
2703
|
+
a(this, "CHECKBOX_UNCHECK_SVG", "");
|
|
2704
|
+
a(this, "CHECKBOX_INDETERMINATE_SVG", "");
|
|
2705
|
+
a(this, "READONLY_COLOR", "#fff");
|
|
2706
|
+
a(this, "READONLY_TEXT_COLOR", "#4E5969");
|
|
2707
|
+
a(this, "ERROR_TIP_COLOR", "#ED3F14");
|
|
2708
|
+
a(this, "FOOTER_BG_COLOR", "#fafafa");
|
|
2709
|
+
a(this, "FOOTER_FIXED", !0);
|
|
2710
|
+
a(this, "FOOTER_POSITION", "bottom");
|
|
2711
|
+
a(this, "CELL_FOOTER_HEIGHT", 36);
|
|
2712
|
+
a(this, "ENABLE_SELECTOR", !0);
|
|
2713
|
+
a(this, "ENABLE_EDIT_SINGLE_CLICK", !1);
|
|
2695
2714
|
// 启用单点击立马编辑
|
|
2696
|
-
|
|
2715
|
+
a(this, "ENABLE_EDIT_CLICK_SELECTOR", !0);
|
|
2697
2716
|
// 启用点击选择器编辑
|
|
2698
|
-
|
|
2717
|
+
a(this, "SELECTOR_AREA_MIN_X", 0);
|
|
2699
2718
|
// 选择器X最小范围
|
|
2700
|
-
|
|
2719
|
+
a(this, "SELECTOR_AREA_MAX_X_OFFSET", 0);
|
|
2701
2720
|
// 选择器X最大范围colMax - offset
|
|
2702
|
-
|
|
2721
|
+
a(this, "SELECTOR_AREA_MAX_X", 0);
|
|
2703
2722
|
// 选择器X最大范围,0默认最大colMax
|
|
2704
|
-
|
|
2723
|
+
a(this, "SELECTOR_AREA_MIN_Y", 0);
|
|
2705
2724
|
// 选择器Y最小范围
|
|
2706
|
-
|
|
2725
|
+
a(this, "SELECTOR_AREA_MAX_Y", 0);
|
|
2707
2726
|
// 选择器Y最大范围,0默认rowMax
|
|
2708
|
-
|
|
2727
|
+
a(this, "SELECTOR_AREA_MAX_Y_OFFSET", 0);
|
|
2709
2728
|
// 选择器Y最大范围,0默认rowMax
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2729
|
+
a(this, "ENABLE_AUTO_THEME", !0);
|
|
2730
|
+
a(this, "ENABLE_SELECTOR_SINGLE", !1);
|
|
2731
|
+
a(this, "ENABLE_SELECTOR_SPAN_COL", !0);
|
|
2732
|
+
a(this, "ENABLE_SELECTOR_SPAN_ROW", !0);
|
|
2733
|
+
a(this, "ENABLE_SELECTOR_ALL_ROWS", !0);
|
|
2734
|
+
a(this, "ENABLE_SELECTOR_ALL_COLS", !0);
|
|
2735
|
+
a(this, "ENABLE_MERGE_CELL_LINK", !1);
|
|
2717
2736
|
// 启用合并选择器关联
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2737
|
+
a(this, "ENABLE_AUTOFILL", !1);
|
|
2738
|
+
a(this, "ENABLE_CONTEXT_MENU", !1);
|
|
2739
|
+
a(this, "ENABLE_COPY", !0);
|
|
2740
|
+
a(this, "ENABLE_PASTER", !0);
|
|
2741
|
+
a(this, "ENABLE_RESIZE_ROW", !0);
|
|
2742
|
+
a(this, "ENABLE_RESIZE_COLUMN", !0);
|
|
2743
|
+
a(this, "RESIZE_ROW_LINE_COLOR", "#e1e6eb");
|
|
2744
|
+
a(this, "RESIZE_COLUMN_LINE_COLOR", "#e1e6eb");
|
|
2745
|
+
a(this, "RESIZE_ROW_MIN_HEIGHT", 36);
|
|
2746
|
+
a(this, "RESIZE_COLUMN_MIN_WIDTH", 40);
|
|
2747
|
+
a(this, "ENABLE_KEYBOARD", !0);
|
|
2748
|
+
a(this, "ENABLE_HISTORY", !1);
|
|
2749
|
+
a(this, "ENABLE_VALIDATOR_IMMEDIATE", !0);
|
|
2750
|
+
a(this, "HISTORY_NUM", 50);
|
|
2751
|
+
a(this, "HIGHLIGHT_HOVER_ROW", !1);
|
|
2752
|
+
a(this, "HIGHLIGHT_HOVER_ROW_COLOR", "rgba(186,203,231,0.1)");
|
|
2753
|
+
a(this, "HIGHLIGHT_SELECTED_ROW", !1);
|
|
2754
|
+
a(this, "HIGHLIGHT_SELECTED_ROW_COLOR", "rgba(82,146,247,0.1)");
|
|
2755
|
+
a(this, "TOOLTIP_BG_COLOR", "#303133");
|
|
2756
|
+
a(this, "TOOLTIP_TEXT_COLOR", "#fff");
|
|
2757
|
+
a(this, "TOOLTIP_ZINDEX", 3e3);
|
|
2758
|
+
a(this, "TOOLTIP_CUSTOM_STYLE", {});
|
|
2759
|
+
a(this, "CONTEXT_MENU", [
|
|
2741
2760
|
{ label: "复制", value: "copy" },
|
|
2742
2761
|
{ label: "剪切", value: "cut" },
|
|
2743
2762
|
{ label: "粘贴", value: "paste" },
|
|
2744
2763
|
{ label: "清空选中内容", value: "clearSelected" }
|
|
2745
2764
|
]);
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
+
a(this, "HEADER_CELL_STYLE_METHOD");
|
|
2766
|
+
a(this, "BODY_CELL_STYLE_METHOD");
|
|
2767
|
+
a(this, "FOOTER_CELL_STYLE_METHOD");
|
|
2768
|
+
a(this, "BODY_CELL_READONLY_METHOD");
|
|
2769
|
+
a(this, "BODY_CELL_FORMATTER_METHOD");
|
|
2770
|
+
a(this, "BODY_CELL_RULES_METHOD");
|
|
2771
|
+
a(this, "BODY_CELL_TYPE_METHOD");
|
|
2772
|
+
a(this, "BODY_CELL_EDITOR_METHOD");
|
|
2773
|
+
a(this, "BODY_CELL_RENDER_METHOD");
|
|
2774
|
+
a(this, "BODY_CELL_HOVER_ICON_METHOD");
|
|
2775
|
+
a(this, "SPAN_METHOD");
|
|
2776
|
+
a(this, "SELECTABLE_METHOD");
|
|
2777
|
+
a(this, "EXPAND_LAZY_METHOD");
|
|
2778
|
+
a(this, "BEFORE_VALUE_CHANGE_METHOD");
|
|
2779
|
+
a(this, "BEFORE_PASTE_DATA_METHOD");
|
|
2780
|
+
a(this, "BEFORE_AUTOFILL_DATA_METHOD");
|
|
2781
|
+
a(this, "BEFORE_SET_SELECTOR_METHOD");
|
|
2782
|
+
a(this, "BEFORE_SET_AUTOFILL_METHOD");
|
|
2783
|
+
a(this, "BEFORE_COPY_METHOD");
|
|
2765
2784
|
this._config = t, this.updateCssVar();
|
|
2766
2785
|
}
|
|
2767
2786
|
init(t) {
|
|
@@ -2779,10 +2798,10 @@ class Wt {
|
|
|
2779
2798
|
}
|
|
2780
2799
|
}
|
|
2781
2800
|
const Pt = '<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>';
|
|
2782
|
-
class
|
|
2801
|
+
class xi {
|
|
2783
2802
|
constructor(t) {
|
|
2784
|
-
|
|
2785
|
-
|
|
2803
|
+
a(this, "ctx");
|
|
2804
|
+
a(this, "list", [
|
|
2786
2805
|
{
|
|
2787
2806
|
name: "loading",
|
|
2788
2807
|
configName: "LOADING_ICON_SVG",
|
|
@@ -2857,7 +2876,7 @@ class ui {
|
|
|
2857
2876
|
color: "#4E5969"
|
|
2858
2877
|
}
|
|
2859
2878
|
]);
|
|
2860
|
-
|
|
2879
|
+
a(this, "icons", /* @__PURE__ */ new Map());
|
|
2861
2880
|
this.ctx = t, this.init();
|
|
2862
2881
|
}
|
|
2863
2882
|
async init() {
|
|
@@ -2915,41 +2934,43 @@ class ui {
|
|
|
2915
2934
|
class oe extends re {
|
|
2916
2935
|
constructor(e, i, s, r, o, n, h) {
|
|
2917
2936
|
super(e, s, r, o, n, "header", h.fixed);
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
|
|
2947
|
-
|
|
2948
|
-
|
|
2949
|
-
|
|
2950
|
-
|
|
2951
|
-
|
|
2952
|
-
this
|
|
2937
|
+
a(this, "align");
|
|
2938
|
+
a(this, "verticalAlign", "middle");
|
|
2939
|
+
a(this, "fixed");
|
|
2940
|
+
a(this, "minWidth");
|
|
2941
|
+
a(this, "maxWidth");
|
|
2942
|
+
a(this, "widthFillDisable");
|
|
2943
|
+
a(this, "type");
|
|
2944
|
+
a(this, "operation", !1);
|
|
2945
|
+
a(this, "editorType");
|
|
2946
|
+
a(this, "level");
|
|
2947
|
+
a(this, "text");
|
|
2948
|
+
a(this, "displayText", "");
|
|
2949
|
+
a(this, "colspan");
|
|
2950
|
+
a(this, "rowspan");
|
|
2951
|
+
a(this, "row");
|
|
2952
|
+
a(this, "key");
|
|
2953
|
+
a(this, "required", !1);
|
|
2954
|
+
a(this, "readonly", !1);
|
|
2955
|
+
a(this, "children", []);
|
|
2956
|
+
a(this, "column");
|
|
2957
|
+
a(this, "colIndex");
|
|
2958
|
+
a(this, "rowKey");
|
|
2959
|
+
a(this, "rules");
|
|
2960
|
+
a(this, "hasChildren");
|
|
2961
|
+
a(this, "render");
|
|
2962
|
+
a(this, "style", {});
|
|
2963
|
+
a(this, "drawX", 0);
|
|
2964
|
+
a(this, "drawY", 0);
|
|
2965
|
+
a(this, "drawCellBgColor", "");
|
|
2966
|
+
a(this, "drawTextColor", "");
|
|
2967
|
+
a(this, "drawImageX", 0);
|
|
2968
|
+
a(this, "drawImageY", 0);
|
|
2969
|
+
a(this, "drawImageWidth", 0);
|
|
2970
|
+
a(this, "drawImageHeight", 0);
|
|
2971
|
+
a(this, "drawImageName", "");
|
|
2972
|
+
a(this, "drawImageSource");
|
|
2973
|
+
this.ctx = e, this.x = s, this.y = r, this.width = o, this.height = n, this.colIndex = i, this.key = h.key, this.minWidth = h.minWidth, this.maxWidth = h.maxWidth, this.type = h.type || "", this.editorType = h.editorType || "text", this.align = h.align || "center", this.verticalAlign = h.verticalAlign || "middle", this.fixed = h.fixed, this.level = h.level || 0, this.operation = h.operation || !1, this.text = h.title, this.column = h, this.colspan = h.colspan || 1, this.widthFillDisable = h.widthFillDisable || !1, this.rowspan = h.rowspan || 1, this.rules = h.rules, this.readonly = h.readonly || !1, this.required = h.required || !1, this.rowKey = Jt(), this.hasChildren = h.children && h.children.length > 0 || !1, this.render = h.renderHeader;
|
|
2953
2974
|
}
|
|
2954
2975
|
/**
|
|
2955
2976
|
* 是否可见,覆盖基类方法,表头是跟y滚动条没有关系的所以不需要加滚动参数
|
|
@@ -3010,8 +3031,8 @@ class oe extends re {
|
|
|
3010
3031
|
const { width: e, height: i, type: s } = this;
|
|
3011
3032
|
if (["index-selection", "selection"].includes(s)) {
|
|
3012
3033
|
const { indeterminate: r, check: o, selectable: n } = this.ctx.database.getCheckedState(), { CHECKBOX_SIZE: h = 0 } = this.ctx.config, c = this.drawX + (e - h) / 2, d = this.drawY + (i - h) / 2;
|
|
3013
|
-
let f = this.ctx.icons.get("checkbox-uncheck"),
|
|
3014
|
-
r ? (f = this.ctx.icons.get("checkbox-indeterminate"),
|
|
3034
|
+
let f = this.ctx.icons.get("checkbox-uncheck"), x = "checkbox-uncheck";
|
|
3035
|
+
r ? (f = this.ctx.icons.get("checkbox-indeterminate"), x = "checkbox-indeterminate") : o && n ? (f = this.ctx.icons.get("checkbox-check"), x = "checkbox-check") : o && n ? (f = this.ctx.icons.get("checkbox-check-disabled"), x = "checkbox-check-disabled") : !o && n ? (f = this.ctx.icons.get("checkbox-uncheck"), x = "checkbox-uncheck") : (f = this.ctx.icons.get("checkbox-disabled"), x = "checkbox-disabled"), f && (this.drawImageX = c, this.drawImageY = d, this.drawImageWidth = h, this.drawImageHeight = h, this.drawImageName = x, this.drawImageSource = f, this.ctx.paint.drawImage(
|
|
3015
3036
|
this.drawImageSource,
|
|
3016
3037
|
this.drawImageX,
|
|
3017
3038
|
this.drawImageY,
|
|
@@ -3040,12 +3061,12 @@ class oe extends re {
|
|
|
3040
3061
|
};
|
|
3041
3062
|
}
|
|
3042
3063
|
}
|
|
3043
|
-
class
|
|
3064
|
+
class ui {
|
|
3044
3065
|
constructor(t) {
|
|
3045
|
-
|
|
3046
|
-
|
|
3047
|
-
|
|
3048
|
-
|
|
3066
|
+
a(this, "ctx");
|
|
3067
|
+
a(this, "visibleHoverCell");
|
|
3068
|
+
a(this, "resizeObserver");
|
|
3069
|
+
a(this, "mutationObserver");
|
|
3049
3070
|
this.ctx = t, this.init();
|
|
3050
3071
|
}
|
|
3051
3072
|
init() {
|
|
@@ -3215,58 +3236,59 @@ class xi {
|
|
|
3215
3236
|
}
|
|
3216
3237
|
class gi {
|
|
3217
3238
|
constructor(t, e) {
|
|
3218
|
-
|
|
3219
|
-
|
|
3220
|
-
|
|
3221
|
-
|
|
3222
|
-
|
|
3223
|
-
|
|
3224
|
-
|
|
3225
|
-
|
|
3226
|
-
|
|
3227
|
-
|
|
3228
|
-
|
|
3229
|
-
|
|
3230
|
-
|
|
3231
|
-
|
|
3232
|
-
|
|
3233
|
-
|
|
3234
|
-
|
|
3235
|
-
|
|
3239
|
+
a(this, "eventBus");
|
|
3240
|
+
a(this, "eventBrowser");
|
|
3241
|
+
a(this, "eventTable");
|
|
3242
|
+
a(this, "containerElement");
|
|
3243
|
+
a(this, "stageElement");
|
|
3244
|
+
a(this, "canvasElement");
|
|
3245
|
+
a(this, "overlayerElement");
|
|
3246
|
+
a(this, "editorElement");
|
|
3247
|
+
a(this, "emptyElement");
|
|
3248
|
+
a(this, "contextMenuElement");
|
|
3249
|
+
a(this, "stageWidth", 0);
|
|
3250
|
+
a(this, "stageHeight", 0);
|
|
3251
|
+
a(this, "paint");
|
|
3252
|
+
a(this, "icons");
|
|
3253
|
+
a(this, "isMouseoverTargetContainer", !1);
|
|
3254
|
+
a(this, "mousedown", !1);
|
|
3255
|
+
a(this, "isPointer", !1);
|
|
3256
|
+
a(this, "rowResizing", !1);
|
|
3236
3257
|
// 行调整大小中
|
|
3237
|
-
|
|
3258
|
+
a(this, "columnResizing", !1);
|
|
3238
3259
|
// 列调整大小中
|
|
3239
|
-
|
|
3260
|
+
a(this, "scrollerMove", !1);
|
|
3240
3261
|
// 滚动条移动中
|
|
3241
|
-
|
|
3262
|
+
a(this, "scrollerFocus", !1);
|
|
3242
3263
|
// 滚动条focus中
|
|
3243
|
-
|
|
3264
|
+
a(this, "autofillMove", !1);
|
|
3244
3265
|
// 自动填充移动中
|
|
3245
|
-
|
|
3266
|
+
a(this, "selectorMove", !1);
|
|
3246
3267
|
// 选择器移动中
|
|
3247
|
-
|
|
3268
|
+
a(this, "adjustPositioning", !1);
|
|
3248
3269
|
// 调整位置中
|
|
3249
|
-
|
|
3270
|
+
a(this, "editing", !1);
|
|
3250
3271
|
// 编辑中
|
|
3251
|
-
|
|
3272
|
+
a(this, "onlyMergeCell", !1);
|
|
3252
3273
|
// 只有合并单元格
|
|
3253
|
-
|
|
3274
|
+
a(this, "selectOnlyOne", !1);
|
|
3254
3275
|
// 只选择一个
|
|
3255
|
-
|
|
3256
|
-
|
|
3257
|
-
|
|
3258
|
-
|
|
3259
|
-
|
|
3260
|
-
|
|
3261
|
-
|
|
3262
|
-
|
|
3263
|
-
|
|
3264
|
-
|
|
3265
|
-
|
|
3266
|
-
|
|
3267
|
-
|
|
3268
|
-
|
|
3269
|
-
|
|
3276
|
+
a(this, "scrollY", 0);
|
|
3277
|
+
a(this, "scrollX", 0);
|
|
3278
|
+
a(this, "fixedLeftWidth", 0);
|
|
3279
|
+
a(this, "fixedRightWidth", 0);
|
|
3280
|
+
a(this, "lastCenterColIndex", 0);
|
|
3281
|
+
a(this, "maxColIndex", 0);
|
|
3282
|
+
a(this, "maxRowIndex", 0);
|
|
3283
|
+
a(this, "hoverRow");
|
|
3284
|
+
a(this, "clickCell");
|
|
3285
|
+
a(this, "focusCell");
|
|
3286
|
+
a(this, "currentCell");
|
|
3287
|
+
a(this, "hoverCell");
|
|
3288
|
+
a(this, "clickCellHeader");
|
|
3289
|
+
a(this, "focusCellHeader");
|
|
3290
|
+
a(this, "hoverCellHeader");
|
|
3291
|
+
a(this, "body", {
|
|
3270
3292
|
x: 0,
|
|
3271
3293
|
y: 0,
|
|
3272
3294
|
width: 0,
|
|
@@ -3279,7 +3301,7 @@ class gi {
|
|
|
3279
3301
|
renderRows: [],
|
|
3280
3302
|
data: []
|
|
3281
3303
|
});
|
|
3282
|
-
|
|
3304
|
+
a(this, "footer", {
|
|
3283
3305
|
x: 0,
|
|
3284
3306
|
y: 0,
|
|
3285
3307
|
width: 0,
|
|
@@ -3288,7 +3310,7 @@ class gi {
|
|
|
3288
3310
|
visibleWidth: 0,
|
|
3289
3311
|
renderRows: []
|
|
3290
3312
|
});
|
|
3291
|
-
|
|
3313
|
+
a(this, "header", {
|
|
3292
3314
|
x: 0,
|
|
3293
3315
|
y: 0,
|
|
3294
3316
|
width: 0,
|
|
@@ -3303,21 +3325,21 @@ class gi {
|
|
|
3303
3325
|
fixedRightCellHeaders: [],
|
|
3304
3326
|
renderCenterCellHeaders: []
|
|
3305
3327
|
});
|
|
3306
|
-
|
|
3328
|
+
a(this, "selector", {
|
|
3307
3329
|
enable: !1,
|
|
3308
3330
|
xArr: [-1, -1],
|
|
3309
3331
|
yArr: [-1, -1],
|
|
3310
3332
|
xArrCopy: [-1, -1],
|
|
3311
3333
|
yArrCopy: [-1, -1]
|
|
3312
3334
|
});
|
|
3313
|
-
|
|
3335
|
+
a(this, "autofill", {
|
|
3314
3336
|
enable: !1,
|
|
3315
3337
|
xArr: [-1, -1],
|
|
3316
3338
|
yArr: [-1, -1]
|
|
3317
3339
|
});
|
|
3318
|
-
|
|
3319
|
-
|
|
3320
|
-
|
|
3340
|
+
a(this, "database");
|
|
3341
|
+
a(this, "history");
|
|
3342
|
+
a(this, "config");
|
|
3321
3343
|
const {
|
|
3322
3344
|
containerElement: i,
|
|
3323
3345
|
stageElement: s,
|
|
@@ -3327,7 +3349,7 @@ class gi {
|
|
|
3327
3349
|
emptyElement: h,
|
|
3328
3350
|
contextMenuElement: c
|
|
3329
3351
|
} = t;
|
|
3330
|
-
this.containerElement = i, s.tabIndex = 0, this.stageElement = s, this.canvasElement = r, this.overlayerElement = o, this.editorElement = n, this.emptyElement = h, this.contextMenuElement = c, this.config = new Wt(e.config || {}), this.eventBus = new di(), this.eventBrowser = new ci(this), this.eventTable = new
|
|
3352
|
+
this.containerElement = i, s.tabIndex = 0, this.stageElement = s, this.canvasElement = r, this.overlayerElement = o, this.editorElement = n, this.emptyElement = h, this.contextMenuElement = c, this.config = new Wt(e.config || {}), this.eventBus = new di(), this.eventBrowser = new ci(this), this.eventTable = new ui(this), this.paint = new fi(this.canvasElement), this.database = new li(this, e), this.history = new hi(this), this.icons = new xi(this);
|
|
3331
3353
|
}
|
|
3332
3354
|
setConfig(t) {
|
|
3333
3355
|
this.config = new Wt(t);
|
|
@@ -3360,7 +3382,18 @@ class gi {
|
|
|
3360
3382
|
}
|
|
3361
3383
|
setFocusCell(t) {
|
|
3362
3384
|
var e;
|
|
3363
|
-
|
|
3385
|
+
if (this.focusCell !== t) {
|
|
3386
|
+
if (((e = this.focusCell) == null ? void 0 : e.rowKey) !== t.rowKey) {
|
|
3387
|
+
this.currentCell = t, this.emit("rowFocusChange", t);
|
|
3388
|
+
const i = {
|
|
3389
|
+
rowIndex: t.rowIndex,
|
|
3390
|
+
rowKey: t.rowKey,
|
|
3391
|
+
row: t.row
|
|
3392
|
+
};
|
|
3393
|
+
this.emit("currentRowChange", i);
|
|
3394
|
+
}
|
|
3395
|
+
this.focusCell = t, this.emit("cellFocusChange", t);
|
|
3396
|
+
}
|
|
3364
3397
|
}
|
|
3365
3398
|
clearSelector() {
|
|
3366
3399
|
this.selector.enable = !1, this.selector.xArr = [-1, -1], this.selector.yArr = [-1, -1], this.emit("clearSelector");
|
|
@@ -3446,29 +3479,29 @@ class gi {
|
|
|
3446
3479
|
}
|
|
3447
3480
|
class zt {
|
|
3448
3481
|
constructor(t, e) {
|
|
3449
|
-
|
|
3450
|
-
|
|
3451
|
-
|
|
3452
|
-
|
|
3453
|
-
|
|
3454
|
-
|
|
3455
|
-
|
|
3456
|
-
|
|
3482
|
+
a(this, "ctx");
|
|
3483
|
+
a(this, "type");
|
|
3484
|
+
a(this, "isFocus", !1);
|
|
3485
|
+
a(this, "trackX", 0);
|
|
3486
|
+
a(this, "trackY", 0);
|
|
3487
|
+
a(this, "trackWidth", 0);
|
|
3488
|
+
a(this, "trackHeight", 0);
|
|
3489
|
+
a(this, "splitPoints", []);
|
|
3457
3490
|
//分割线
|
|
3458
|
-
|
|
3459
|
-
|
|
3460
|
-
|
|
3461
|
-
|
|
3462
|
-
|
|
3491
|
+
a(this, "barX", 0);
|
|
3492
|
+
a(this, "barY", 0);
|
|
3493
|
+
a(this, "barWidth", 0);
|
|
3494
|
+
a(this, "barHeight", 0);
|
|
3495
|
+
a(this, "distance", 0);
|
|
3463
3496
|
// 滚动条的长度
|
|
3464
|
-
|
|
3497
|
+
a(this, "visibleDistance", 0);
|
|
3465
3498
|
//可见区域的长度
|
|
3466
|
-
|
|
3467
|
-
|
|
3468
|
-
|
|
3499
|
+
a(this, "clientX", 0);
|
|
3500
|
+
a(this, "clientY", 0);
|
|
3501
|
+
a(this, "dragStart", 0);
|
|
3469
3502
|
// 拖拽开始的位置
|
|
3470
|
-
|
|
3471
|
-
|
|
3503
|
+
a(this, "isDragging", !1);
|
|
3504
|
+
a(this, "scroll", 0);
|
|
3472
3505
|
this.ctx = t, this.type = e, this.type === "vertical" ? this.scroll = this.ctx.scrollY : this.scroll = this.ctx.scrollX;
|
|
3473
3506
|
}
|
|
3474
3507
|
onWheel(t) {
|
|
@@ -3533,12 +3566,12 @@ class zt {
|
|
|
3533
3566
|
stageHeight: i,
|
|
3534
3567
|
stageWidth: s,
|
|
3535
3568
|
config: { SCROLLER_TRACK_SIZE: r = 0, SCROLLER_SIZE: o = 0, BORDER: n }
|
|
3536
|
-
} = this.ctx, h = s, c = i, d = e.height, f = e.width,
|
|
3569
|
+
} = this.ctx, h = s, c = i, d = e.height, f = e.width, x = t.height, g = this.ctx.footer.height;
|
|
3537
3570
|
if (this.type === "vertical") {
|
|
3538
|
-
this.visibleDistance = c - r - d, this.distance =
|
|
3539
|
-
const
|
|
3540
|
-
let
|
|
3541
|
-
|
|
3571
|
+
this.visibleDistance = c - r - d, this.distance = x - this.visibleDistance + g, this.trackX = h - r, this.trackY = 0, this.splitPoints = [this.trackX, d, this.trackX + r, d], this.trackWidth = r, this.trackHeight = c, this.barX = this.trackX - 1 + (r - o) / 2, this.barWidth = o;
|
|
3572
|
+
const p = this.distance ? this.visibleDistance / (x + g) : 0;
|
|
3573
|
+
let u = Math.floor(p * this.visibleDistance);
|
|
3574
|
+
u < 30 ? u = 30 : u > this.visibleDistance && (u = 0), this.barHeight = u, this.barY = d + this.scroll / this.distance * (this.visibleDistance - this.barHeight), this.scroll = Math.max(0, Math.min(this.scroll, this.distance));
|
|
3542
3575
|
} else {
|
|
3543
3576
|
this.visibleDistance = h - r, this.distance = f - this.visibleDistance, this.splitPoints = [
|
|
3544
3577
|
h - r,
|
|
@@ -3546,10 +3579,10 @@ class zt {
|
|
|
3546
3579
|
h - r,
|
|
3547
3580
|
c
|
|
3548
3581
|
];
|
|
3549
|
-
const
|
|
3550
|
-
this.trackX = 0, this.trackY = c - r +
|
|
3551
|
-
const
|
|
3552
|
-
let w = Math.floor(
|
|
3582
|
+
const p = n ? 0 : 0.5;
|
|
3583
|
+
this.trackX = 0, this.trackY = c - r + p, this.trackWidth = h, this.trackHeight = r;
|
|
3584
|
+
const u = this.distance ? this.visibleDistance / f : 0;
|
|
3585
|
+
let w = Math.floor(u * this.visibleDistance);
|
|
3553
3586
|
this.barY = this.trackY - 1 + (r - o) / 2, w < 30 ? w = 30 : w >= this.visibleDistance && (w = 0), this.barWidth = w, this.barHeight = o, this.barX = this.scroll / this.distance * (this.visibleDistance - this.barWidth), this.scroll = Math.max(0, Math.min(this.scroll, this.distance));
|
|
3554
3587
|
}
|
|
3555
3588
|
}
|
|
@@ -3573,9 +3606,9 @@ class zt {
|
|
|
3573
3606
|
}
|
|
3574
3607
|
class wi {
|
|
3575
3608
|
constructor(t) {
|
|
3576
|
-
|
|
3577
|
-
|
|
3578
|
-
|
|
3609
|
+
a(this, "ctx");
|
|
3610
|
+
a(this, "verticalScrollbar");
|
|
3611
|
+
a(this, "horizontalScrollbar");
|
|
3579
3612
|
this.ctx = t, this.verticalScrollbar = new zt(t, "vertical"), this.horizontalScrollbar = new zt(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) => {
|
|
3580
3613
|
this.onTouchstart(e);
|
|
3581
3614
|
}), this.ctx.on("setScroll", (e, i) => {
|
|
@@ -3640,41 +3673,41 @@ class wi {
|
|
|
3640
3673
|
}
|
|
3641
3674
|
class pi {
|
|
3642
3675
|
constructor(t) {
|
|
3643
|
-
|
|
3676
|
+
a(this, "ctx");
|
|
3644
3677
|
// 上下文
|
|
3645
|
-
|
|
3678
|
+
a(this, "x", 0);
|
|
3646
3679
|
// x坐标
|
|
3647
|
-
|
|
3680
|
+
a(this, "y", 0);
|
|
3648
3681
|
// y坐标
|
|
3649
|
-
|
|
3682
|
+
a(this, "width", 0);
|
|
3650
3683
|
// 宽度
|
|
3651
|
-
|
|
3684
|
+
a(this, "height", 0);
|
|
3652
3685
|
// 高度
|
|
3653
|
-
|
|
3686
|
+
a(this, "resizeTarget", null);
|
|
3654
3687
|
//调整表头
|
|
3655
|
-
|
|
3688
|
+
a(this, "resizeNum", 0);
|
|
3656
3689
|
// 调整列的数量
|
|
3657
|
-
|
|
3690
|
+
a(this, "isResizing", !1);
|
|
3658
3691
|
// 是否移动中
|
|
3659
|
-
|
|
3692
|
+
a(this, "clientX", 0);
|
|
3660
3693
|
// 鼠标按下时的x轴位置
|
|
3661
|
-
|
|
3694
|
+
a(this, "resizeDiff", 0);
|
|
3662
3695
|
// 是否移动中
|
|
3663
|
-
|
|
3664
|
-
|
|
3696
|
+
a(this, "columnIndex", 0);
|
|
3697
|
+
a(this, "isMouseDown", !1);
|
|
3665
3698
|
// 是否按下
|
|
3666
|
-
|
|
3667
|
-
|
|
3668
|
-
|
|
3669
|
-
|
|
3670
|
-
|
|
3671
|
-
|
|
3672
|
-
|
|
3673
|
-
|
|
3674
|
-
|
|
3675
|
-
|
|
3676
|
-
|
|
3677
|
-
|
|
3699
|
+
a(this, "columns");
|
|
3700
|
+
a(this, "visibleLeafColumns", []);
|
|
3701
|
+
a(this, "visibleHeight", 0);
|
|
3702
|
+
a(this, "visibleWidth", 0);
|
|
3703
|
+
a(this, "allCellHeaders", []);
|
|
3704
|
+
a(this, "leafCellHeaders", []);
|
|
3705
|
+
a(this, "renderLeafCellHeaders", []);
|
|
3706
|
+
a(this, "fixedLeftCellHeaders", []);
|
|
3707
|
+
a(this, "centerCellHeaders", []);
|
|
3708
|
+
a(this, "fixedRightCellHeaders", []);
|
|
3709
|
+
a(this, "renderCenterCellHeaders", []);
|
|
3710
|
+
a(this, "renderFixedCellHeaders", []);
|
|
3678
3711
|
this.ctx = t, this.ctx.on(
|
|
3679
3712
|
"resetHeader",
|
|
3680
3713
|
Qt(() => {
|
|
@@ -3688,20 +3721,23 @@ class pi {
|
|
|
3688
3721
|
} = this.ctx, i = this.ctx.database.getColumns();
|
|
3689
3722
|
this.columns = i, this.allCellHeaders = [], this.leafCellHeaders = [], this.fixedLeftCellHeaders = [], this.fixedRightCellHeaders = [], this.centerCellHeaders = [];
|
|
3690
3723
|
const s = te(i), r = _t(i);
|
|
3691
|
-
this.height = t * s, this.width = r.reduce((f,
|
|
3724
|
+
this.height = t * s, this.width = r.reduce((f, x) => {
|
|
3725
|
+
const { width: g = 100, maxWidth: p, minWidth: u } = x;
|
|
3726
|
+
return p && g > p ? f + p : u && g < u ? f + u : f + g;
|
|
3727
|
+
}, 0), this.visibleHeight = this.height;
|
|
3692
3728
|
const o = ei(ee(i, s));
|
|
3693
3729
|
this.columnIndex = 0, this.resizeNum = 0, this.render(o, 0), this.ctx.database.updateColIndexKeyMap(this.leafCellHeaders);
|
|
3694
3730
|
const n = this.ctx.containerElement.getBoundingClientRect();
|
|
3695
|
-
this.resizeNum > 0 ? this.ctx.stageWidth = Math.floor(n.width) : this.ctx.stageWidth = Math.floor(this.width + e), this.ctx.stageElement.style.width = this.ctx.stageWidth
|
|
3731
|
+
this.resizeNum > 0 ? this.ctx.stageWidth = Math.floor(n.width) : this.ctx.stageWidth = Math.floor(this.width + e), this.ctx.stageElement.style.width = this.ctx.stageWidth + "px", this.visibleWidth = this.ctx.stageWidth - e;
|
|
3696
3732
|
const h = this.visibleWidth - this.width;
|
|
3697
3733
|
if (this.resizeNum && h > 0) {
|
|
3698
3734
|
const f = Math.floor(h / this.resizeNum * 100) / 100;
|
|
3699
3735
|
this.resizeAllColumn(f);
|
|
3700
3736
|
}
|
|
3701
3737
|
const c = this.fixedLeftCellHeaders.filter((f) => !f.hasChildren);
|
|
3702
|
-
this.ctx.fixedLeftWidth = c.reduce((f,
|
|
3738
|
+
this.ctx.fixedLeftWidth = c.reduce((f, x) => f + x.width, 0);
|
|
3703
3739
|
const d = this.fixedRightCellHeaders.filter((f) => !f.hasChildren);
|
|
3704
|
-
this.ctx.fixedRightWidth = d.reduce((f,
|
|
3740
|
+
this.ctx.fixedRightWidth = d.reduce((f, x) => f + x.width, e), 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.visibleWidth = this.visibleWidth, this.ctx.header.visibleHeight = this.visibleHeight;
|
|
3705
3741
|
}
|
|
3706
3742
|
// 调整表头的宽度
|
|
3707
3743
|
initResizeColumn() {
|
|
@@ -3711,7 +3747,7 @@ class pi {
|
|
|
3711
3747
|
t && (this.ctx.on("mousedown", (e) => {
|
|
3712
3748
|
this.ctx.isTarget(e) && (this.clientX = e.clientX, this.resizeTarget ? (this.isResizing = !0, this.ctx.columnResizing = !0) : this.isResizing = !1, this.isMouseDown = !0);
|
|
3713
3749
|
}), this.ctx.on("mouseup", () => {
|
|
3714
|
-
this.isMouseDown = !1, this.resizeDiff !== 0 && this.resizeTarget && this.resizeColumn(this.resizeTarget, this.resizeDiff), this.resizeTarget = null, this.isResizing = !1, this.ctx.columnResizing = !1, this.clientX = 0;
|
|
3750
|
+
this.isMouseDown = !1, this.resizeDiff !== 0 && this.resizeTarget && this.resizeColumn(this.resizeTarget, this.resizeDiff), this.resizeTarget = null, this.isResizing = !1, this.isMouseDown = !1, this.ctx.columnResizing = !1, this.clientX = 0, this.resizeDiff = 0;
|
|
3715
3751
|
}), this.ctx.on("mousemove", (e) => {
|
|
3716
3752
|
if (this.ctx.editing) return;
|
|
3717
3753
|
const {
|
|
@@ -3719,9 +3755,9 @@ class pi {
|
|
|
3719
3755
|
config: { RESIZE_COLUMN_MIN_WIDTH: s }
|
|
3720
3756
|
} = this.ctx;
|
|
3721
3757
|
if (this.isResizing && this.resizeTarget) {
|
|
3722
|
-
const r = this.resizeTarget.width;
|
|
3723
|
-
let
|
|
3724
|
-
|
|
3758
|
+
const r = this.resizeTarget.width, o = this.resizeTarget.minWidth, n = this.resizeTarget.maxWidth;
|
|
3759
|
+
let h = e.clientX - this.clientX;
|
|
3760
|
+
h + r < s && (h = -(r - s)), o && h + r < o && (h = -(r - o)), n && h + r > n && (h = n - r), this.resizeDiff = h, this.ctx.emit("draw");
|
|
3725
3761
|
} else {
|
|
3726
3762
|
if (this.resizeTarget = null, this.isMouseDown)
|
|
3727
3763
|
return;
|
|
@@ -3789,10 +3825,10 @@ class pi {
|
|
|
3789
3825
|
const { HEADER_HEIGHT: r = 0 } = this.ctx.config;
|
|
3790
3826
|
for (let o = 0; o < i; o++) {
|
|
3791
3827
|
const n = t[o], h = r * (n.rowspan || 0), c = r * (n.level || 0);
|
|
3792
|
-
let d = n.width || 100;
|
|
3793
|
-
n.children && (
|
|
3794
|
-
const
|
|
3795
|
-
this.ctx.database.setHeader(n.key,
|
|
3828
|
+
let { minWidth: d, maxWidth: f } = n, x = n.width || 100;
|
|
3829
|
+
d && x < d && (x = d), f && x > f && (x = f), n.children && (x = _t(n.children).reduce((u, w) => u + ((w == null ? void 0 : w.width) || 100), 0));
|
|
3830
|
+
const g = new oe(this.ctx, this.columnIndex, s, c, x, h, n);
|
|
3831
|
+
this.ctx.database.setHeader(n.key, g), this.allCellHeaders.push(g), n.children || (this.leafCellHeaders.push(g), g.column.widthFillDisable || this.resizeNum++), n.fixed === "left" ? this.fixedLeftCellHeaders.push(g) : n.fixed === "right" ? this.fixedRightCellHeaders.push(g) : this.centerCellHeaders.push(g), !n.children && this.columnIndex++, n.children && this.render(n.children, s), s += x;
|
|
3796
3832
|
}
|
|
3797
3833
|
}
|
|
3798
3834
|
drawTipLine() {
|
|
@@ -3867,18 +3903,18 @@ class pi {
|
|
|
3867
3903
|
}
|
|
3868
3904
|
class ne {
|
|
3869
3905
|
constructor(t, e, i = 0, s = 0, r = 0, o = 0, n, h = "body") {
|
|
3870
|
-
|
|
3871
|
-
|
|
3872
|
-
|
|
3873
|
-
|
|
3874
|
-
|
|
3875
|
-
|
|
3876
|
-
|
|
3877
|
-
|
|
3878
|
-
|
|
3879
|
-
|
|
3880
|
-
|
|
3881
|
-
|
|
3906
|
+
a(this, "ctx");
|
|
3907
|
+
a(this, "x", 0);
|
|
3908
|
+
a(this, "y", 0);
|
|
3909
|
+
a(this, "width", 0);
|
|
3910
|
+
a(this, "height");
|
|
3911
|
+
a(this, "cells", []);
|
|
3912
|
+
a(this, "fixedCells", []);
|
|
3913
|
+
a(this, "noFixedCells", []);
|
|
3914
|
+
a(this, "rowIndex", 0);
|
|
3915
|
+
a(this, "rowKey", "");
|
|
3916
|
+
a(this, "rowType", "body");
|
|
3917
|
+
a(this, "data");
|
|
3882
3918
|
this.ctx = t, this.x = i, this.y = s, this.width = r, this.height = o, this.rowIndex = e, this.rowKey = t.database.getRowKeyForRowIndex(e) || "", this.rowType = h, this.data = n, this.update();
|
|
3883
3919
|
}
|
|
3884
3920
|
update() {
|
|
@@ -3922,29 +3958,29 @@ class ne {
|
|
|
3922
3958
|
}
|
|
3923
3959
|
class mi {
|
|
3924
3960
|
constructor(t) {
|
|
3925
|
-
|
|
3961
|
+
a(this, "resizeTarget", null);
|
|
3926
3962
|
//调整行大小的目标
|
|
3927
|
-
|
|
3963
|
+
a(this, "isMouseDown", !1);
|
|
3928
3964
|
// 是否按下
|
|
3929
|
-
|
|
3965
|
+
a(this, "resizeDiff", 0);
|
|
3930
3966
|
// 是否移动中
|
|
3931
|
-
|
|
3967
|
+
a(this, "clientY", 0);
|
|
3932
3968
|
// 鼠标按下时的y轴位置
|
|
3933
|
-
|
|
3934
|
-
|
|
3935
|
-
|
|
3936
|
-
|
|
3937
|
-
|
|
3938
|
-
|
|
3939
|
-
|
|
3940
|
-
|
|
3969
|
+
a(this, "ctx");
|
|
3970
|
+
a(this, "x", 0);
|
|
3971
|
+
a(this, "y", 0);
|
|
3972
|
+
a(this, "width", 0);
|
|
3973
|
+
a(this, "height", 0);
|
|
3974
|
+
a(this, "headIndex", 0);
|
|
3975
|
+
a(this, "tailIndex", 0);
|
|
3976
|
+
a(this, "isResizing", !1);
|
|
3941
3977
|
//是否正在调整大小
|
|
3942
|
-
|
|
3943
|
-
|
|
3944
|
-
|
|
3945
|
-
|
|
3946
|
-
|
|
3947
|
-
|
|
3978
|
+
a(this, "renderRows", []);
|
|
3979
|
+
a(this, "visibleRows", []);
|
|
3980
|
+
a(this, "visibleHeight", 0);
|
|
3981
|
+
a(this, "visibleWidth", 0);
|
|
3982
|
+
a(this, "containerRect");
|
|
3983
|
+
a(this, "data", []);
|
|
3948
3984
|
this.ctx = t, this.init(), this.initResizeRow();
|
|
3949
3985
|
}
|
|
3950
3986
|
init() {
|
|
@@ -3961,27 +3997,27 @@ class mi {
|
|
|
3961
3997
|
MAX_HEIGHT: c = 0,
|
|
3962
3998
|
ENABLE_OFFSET_HEIGHT: d = 0,
|
|
3963
3999
|
OFFSET_HEIGHT: f = 0,
|
|
3964
|
-
FOOTER_POSITION:
|
|
4000
|
+
FOOTER_POSITION: x
|
|
3965
4001
|
}
|
|
3966
4002
|
} = this.ctx;
|
|
3967
4003
|
if (!e.width)
|
|
3968
4004
|
return;
|
|
3969
|
-
this.x = 0,
|
|
3970
|
-
const { data: g, sumHeight:
|
|
3971
|
-
this.height =
|
|
3972
|
-
const
|
|
3973
|
-
!this.data.length && !n ? this.height = h : !this.data.length && n && (this.height = n - e.height -
|
|
4005
|
+
this.x = 0, x === "top" && r ? this.y = e.height + i.height : this.y = e.height;
|
|
4006
|
+
const { data: g, sumHeight: p } = s.getData();
|
|
4007
|
+
this.height = p, this.data = g, this.width = e.width, this.visibleWidth = this.ctx.stageWidth - o;
|
|
4008
|
+
const u = this.ctx.footer.height;
|
|
4009
|
+
!this.data.length && !n ? this.height = h : !this.data.length && n && (this.height = n - e.height - u - o);
|
|
3974
4010
|
let w = this.height + e.height + o;
|
|
3975
|
-
w +=
|
|
3976
|
-
let
|
|
3977
|
-
const
|
|
3978
|
-
if (
|
|
3979
|
-
const T =
|
|
3980
|
-
T > e.height + o ?
|
|
3981
|
-
} else this.data.length && n ?
|
|
3982
|
-
|
|
3983
|
-
let
|
|
3984
|
-
r ? this.visibleHeight =
|
|
4011
|
+
w += u;
|
|
4012
|
+
let m = w;
|
|
4013
|
+
const b = window.innerHeight, { top: y } = this.containerRect || this.ctx.containerElement.getBoundingClientRect();
|
|
4014
|
+
if (b > y && d && !n) {
|
|
4015
|
+
const T = b - y - f;
|
|
4016
|
+
T > e.height + o ? m = T : w > c && (m = c);
|
|
4017
|
+
} else this.data.length && n ? m = n : this.data.length && c && w > c && (m = c);
|
|
4018
|
+
m > 0 && (this.ctx.stageHeight = Math.floor(m), this.ctx.stageElement.style.height = `${this.ctx.stageHeight}px`);
|
|
4019
|
+
let C = this.ctx.stageHeight - e.height - o;
|
|
4020
|
+
r ? this.visibleHeight = C - u : this.visibleHeight = C, 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 = g;
|
|
3985
4021
|
const E = window.devicePixelRatio || 1, R = this.ctx.stageWidth * E, O = this.ctx.stageHeight * E;
|
|
3986
4022
|
t.width = Math.round(R), t.height = Math.round(O);
|
|
3987
4023
|
const I = this.data.length ? "not-empty" : "empty";
|
|
@@ -3990,15 +4026,12 @@ class mi {
|
|
|
3990
4026
|
type: I,
|
|
3991
4027
|
headerHeight: e.height,
|
|
3992
4028
|
bodyHeight: this.height,
|
|
3993
|
-
footerHeight:
|
|
4029
|
+
footerHeight: u,
|
|
3994
4030
|
width: this.width,
|
|
3995
|
-
height: this.data.length ? 0 : h +
|
|
4031
|
+
height: this.data.length ? 0 : h + u
|
|
3996
4032
|
});
|
|
3997
4033
|
const _ = Math.round(t.width / E * 1e4) / 1e4, v = Math.round(t.height / E * 1e4) / 1e4;
|
|
3998
|
-
this.ctx.canvasElement.setAttribute(
|
|
3999
|
-
"style",
|
|
4000
|
-
`height:${v}px;width:${_}px;`
|
|
4001
|
-
), this.ctx.paint.scale(E);
|
|
4034
|
+
this.ctx.canvasElement.setAttribute("style", `height:${v}px;width:${_}px;`), this.ctx.paint.scale(E);
|
|
4002
4035
|
}
|
|
4003
4036
|
// 调整行的高度
|
|
4004
4037
|
initResizeRow() {
|
|
@@ -4024,8 +4057,8 @@ class mi {
|
|
|
4024
4057
|
} = this.ctx;
|
|
4025
4058
|
if (this.isResizing && this.resizeTarget) {
|
|
4026
4059
|
const f = this.resizeTarget.height;
|
|
4027
|
-
let
|
|
4028
|
-
|
|
4060
|
+
let x = n - this.clientY;
|
|
4061
|
+
x + f < d && (x = -(f - d)), this.resizeDiff = x, this.ctx.emit("draw");
|
|
4029
4062
|
} else {
|
|
4030
4063
|
if (this.resizeTarget = null, this.isMouseDown)
|
|
4031
4064
|
return;
|
|
@@ -4037,11 +4070,11 @@ class mi {
|
|
|
4037
4070
|
return;
|
|
4038
4071
|
this.ctx.stageElement.style.cursor === "row-resize" && (this.ctx.stageElement.style.cursor = "default");
|
|
4039
4072
|
for (let f = 0; f < this.renderRows.length; f++) {
|
|
4040
|
-
const
|
|
4041
|
-
if (r >
|
|
4042
|
-
for (let
|
|
4043
|
-
const
|
|
4044
|
-
o >
|
|
4073
|
+
const x = this.renderRows[f];
|
|
4074
|
+
if (r > x.y - c + x.height - 1.5 && r < x.y - c + x.height + 1.5 && r < h - 4)
|
|
4075
|
+
for (let p = 0; p < x.cells.length; p++) {
|
|
4076
|
+
const u = x.cells[p];
|
|
4077
|
+
o > u.drawX + 10 && o < u.drawX + u.width - 10 && u.rowspan === 1 && (this.ctx.stageElement.style.cursor = "row-resize", this.resizeTarget = x);
|
|
4045
4078
|
}
|
|
4046
4079
|
}
|
|
4047
4080
|
}
|
|
@@ -4124,7 +4157,7 @@ class mi {
|
|
|
4124
4157
|
this.headIndex = Math.max(0, h), this.tailIndex = Math.min(this.ctx.maxRowIndex, c + 1), this.visibleRows = o.slice(this.headIndex, this.tailIndex + 1), this.ctx.body.headIndex = this.headIndex, this.ctx.body.tailIndex = this.tailIndex, this.ctx.body.visibleRows = this.visibleRows;
|
|
4125
4158
|
const d = [];
|
|
4126
4159
|
for (let f = 0; f < this.visibleRows.length; f++) {
|
|
4127
|
-
const
|
|
4160
|
+
const x = this.headIndex + f, g = this.visibleRows[f], { height: p, top: u } = this.ctx.database.getPositionForRowIndex(x), w = new ne(this.ctx, x, 0, u + this.y, t.width, p, g);
|
|
4128
4161
|
d.push(w);
|
|
4129
4162
|
}
|
|
4130
4163
|
this.renderRows = d, this.ctx.body.renderRows = d;
|
|
@@ -4143,15 +4176,15 @@ class mi {
|
|
|
4143
4176
|
}
|
|
4144
4177
|
class yi {
|
|
4145
4178
|
constructor(t) {
|
|
4146
|
-
|
|
4147
|
-
|
|
4148
|
-
|
|
4149
|
-
|
|
4150
|
-
|
|
4151
|
-
|
|
4152
|
-
|
|
4153
|
-
|
|
4154
|
-
|
|
4179
|
+
a(this, "ctx");
|
|
4180
|
+
a(this, "renderRows", []);
|
|
4181
|
+
a(this, "data", []);
|
|
4182
|
+
a(this, "x", 0);
|
|
4183
|
+
a(this, "y", 0);
|
|
4184
|
+
a(this, "width", 0);
|
|
4185
|
+
a(this, "height", 0);
|
|
4186
|
+
a(this, "visibleWidth", 0);
|
|
4187
|
+
a(this, "visibleHeight", 0);
|
|
4155
4188
|
this.ctx = t, this.init();
|
|
4156
4189
|
}
|
|
4157
4190
|
init() {
|
|
@@ -4225,15 +4258,15 @@ class yi {
|
|
|
4225
4258
|
class Ei {
|
|
4226
4259
|
// 垂直滚动定时器
|
|
4227
4260
|
constructor(t) {
|
|
4228
|
-
|
|
4229
|
-
|
|
4230
|
-
|
|
4231
|
-
|
|
4232
|
-
|
|
4233
|
-
|
|
4234
|
-
|
|
4261
|
+
a(this, "isCut", !1);
|
|
4262
|
+
a(this, "isMultipleRow", !1);
|
|
4263
|
+
a(this, "mousedownHeader", !1);
|
|
4264
|
+
a(this, "ctx");
|
|
4265
|
+
a(this, "adjustPositionX", "");
|
|
4266
|
+
a(this, "adjustPositionY", "");
|
|
4267
|
+
a(this, "timerX", 0);
|
|
4235
4268
|
// 水平滚动定时器
|
|
4236
|
-
|
|
4269
|
+
a(this, "timerY", 0);
|
|
4237
4270
|
this.ctx = t, this.init();
|
|
4238
4271
|
}
|
|
4239
4272
|
init() {
|
|
@@ -4341,16 +4374,16 @@ class Ei {
|
|
|
4341
4374
|
SELECTOR_AREA_MIN_Y: c,
|
|
4342
4375
|
SELECTOR_AREA_MAX_Y: d,
|
|
4343
4376
|
SELECTOR_AREA_MAX_X_OFFSET: f,
|
|
4344
|
-
SELECTOR_AREA_MAX_Y_OFFSET:
|
|
4345
|
-
} = this.ctx.config, g = n,
|
|
4346
|
-
let [
|
|
4347
|
-
if (
|
|
4377
|
+
SELECTOR_AREA_MAX_Y_OFFSET: x
|
|
4378
|
+
} = this.ctx.config, g = n, p = h || this.ctx.maxColIndex - f, u = c, w = d || this.ctx.maxRowIndex - x;
|
|
4379
|
+
let [m, b] = r, [y, C] = o;
|
|
4380
|
+
if (m < g || b > p || y < u || C > w)
|
|
4348
4381
|
return;
|
|
4349
4382
|
if (this.ctx.stageElement.focus({ preventScroll: !0 }), this.ctx.config.ENABLE_MERGE_CELL_LINK) {
|
|
4350
4383
|
const R = this.adjustMergeCells(r, o);
|
|
4351
|
-
y = R.yArr[0],
|
|
4384
|
+
y = R.yArr[0], C = R.yArr[1], m = R.xArr[0], b = R.xArr[1], this.ctx.onlyMergeCell = R.onlyMergeCell;
|
|
4352
4385
|
}
|
|
4353
|
-
|
|
4386
|
+
m === b && y === C ? this.ctx.selectOnlyOne = !0 : this.ctx.selectOnlyOne = !1, r = [Math.max(g, m), Math.min(p, b)], o = [Math.max(u, y), Math.min(w, C)];
|
|
4354
4387
|
const { BEFORE_SET_SELECTOR_METHOD: E } = this.ctx.config;
|
|
4355
4388
|
if (typeof E == "function") {
|
|
4356
4389
|
const O = E({
|
|
@@ -4366,41 +4399,41 @@ class Ei {
|
|
|
4366
4399
|
}
|
|
4367
4400
|
}
|
|
4368
4401
|
adjustMergeCells(t, e) {
|
|
4369
|
-
var
|
|
4402
|
+
var p;
|
|
4370
4403
|
const [i, s] = e, [r, o] = t;
|
|
4371
4404
|
let n = [], h = [];
|
|
4372
|
-
for (let
|
|
4405
|
+
for (let u = 0; u <= e[1] - e[0]; u++)
|
|
4373
4406
|
for (let w = 0; w <= t[1] - t[0]; w++) {
|
|
4374
|
-
const
|
|
4375
|
-
y && ((
|
|
4407
|
+
const m = u + e[0], b = w + t[0], y = this.ctx.database.getVirtualBodyCell(m, b);
|
|
4408
|
+
y && ((m === i || m === s) && n.push(y), (b === r || b === o) && h.push(y));
|
|
4376
4409
|
}
|
|
4377
4410
|
const c = n.reduce(
|
|
4378
|
-
(
|
|
4379
|
-
const { yArr:
|
|
4380
|
-
return
|
|
4411
|
+
(u, w) => {
|
|
4412
|
+
const { yArr: m } = w.getSpanInfo(), [b, y] = m;
|
|
4413
|
+
return u.minY = Math.min(u.minY, b), u.maxY = Math.max(u.maxY, y), u;
|
|
4381
4414
|
},
|
|
4382
4415
|
{
|
|
4383
4416
|
minY: i,
|
|
4384
4417
|
maxY: s
|
|
4385
4418
|
}
|
|
4386
4419
|
), d = h.reduce(
|
|
4387
|
-
(
|
|
4388
|
-
const { xArr:
|
|
4389
|
-
return
|
|
4420
|
+
(u, w) => {
|
|
4421
|
+
const { xArr: m } = w.getSpanInfo(), [b, y] = m;
|
|
4422
|
+
return u.minX = Math.min(u.minX, b), u.maxX = Math.max(u.maxX, y), u;
|
|
4390
4423
|
},
|
|
4391
4424
|
{
|
|
4392
4425
|
minX: r,
|
|
4393
4426
|
maxX: o
|
|
4394
4427
|
}
|
|
4395
|
-
), f = [d.minX, d.maxX],
|
|
4428
|
+
), f = [d.minX, d.maxX], x = [c.minY, c.maxY];
|
|
4396
4429
|
let g = !1;
|
|
4397
4430
|
if (d.minX !== d.maxX || c.minY !== c.maxY) {
|
|
4398
|
-
const
|
|
4399
|
-
g = (w && JSON.stringify(w.xArr) + JSON.stringify(w.yArr)) ===
|
|
4431
|
+
const u = JSON.stringify(f) + JSON.stringify(x), w = (p = this.ctx.focusCell) == null ? void 0 : p.getSpanInfo();
|
|
4432
|
+
g = (w && JSON.stringify(w.xArr) + JSON.stringify(w.yArr)) === u;
|
|
4400
4433
|
}
|
|
4401
4434
|
return {
|
|
4402
4435
|
xArr: f,
|
|
4403
|
-
yArr:
|
|
4436
|
+
yArr: x,
|
|
4404
4437
|
onlyMergeCell: g
|
|
4405
4438
|
};
|
|
4406
4439
|
}
|
|
@@ -4438,8 +4471,8 @@ class Ei {
|
|
|
4438
4471
|
SELECTOR_AREA_MAX_Y: o,
|
|
4439
4472
|
SELECTOR_AREA_MAX_X_OFFSET: n,
|
|
4440
4473
|
SELECTOR_AREA_MAX_Y_OFFSET: h
|
|
4441
|
-
} = this.ctx.config, c = i, d = s || this.ctx.maxColIndex - n, f = r,
|
|
4442
|
-
this.setSelector(g,
|
|
4474
|
+
} = this.ctx.config, c = i, d = s || this.ctx.maxColIndex - n, f = r, x = o || this.ctx.maxRowIndex - h, g = [c, d], p = [f, x];
|
|
4475
|
+
this.setSelector(g, p);
|
|
4443
4476
|
}
|
|
4444
4477
|
}
|
|
4445
4478
|
selectRows(t, e = !0) {
|
|
@@ -4477,8 +4510,8 @@ class Ei {
|
|
|
4477
4510
|
if (this.ctx.selector.enable = !0, i && t) {
|
|
4478
4511
|
if (this.ctx.config.ENABLE_SELECTOR_SINGLE)
|
|
4479
4512
|
return;
|
|
4480
|
-
const { colIndex: s, rowIndex: r } = i, { colIndex: o, rowIndex: n } = e, h = Math.min(o, s), c = Math.max(o, s), d = Math.min(n, r), f = Math.max(n, r),
|
|
4481
|
-
this.setSelector(
|
|
4513
|
+
const { colIndex: s, rowIndex: r } = i, { colIndex: o, rowIndex: n } = e, h = Math.min(o, s), c = Math.max(o, s), d = Math.min(n, r), f = Math.max(n, r), x = [h, c], g = [d, f];
|
|
4514
|
+
this.setSelector(x, g);
|
|
4482
4515
|
} else {
|
|
4483
4516
|
this.ctx.emit("cellSelectedClick", e);
|
|
4484
4517
|
const s = [e.colIndex, e.colIndex], r = [e.rowIndex, e.rowIndex];
|
|
@@ -4546,9 +4579,9 @@ class Ei {
|
|
|
4546
4579
|
for (let h = 0; h <= t[1] - t[0]; h++) {
|
|
4547
4580
|
const c = n + e[0], d = h + t[0], f = this.ctx.database.getItemValueForRowIndexAndColIndex(c, d);
|
|
4548
4581
|
if (f) {
|
|
4549
|
-
const { rowKey:
|
|
4550
|
-
this.ctx.database.getReadonly(
|
|
4551
|
-
rowKey:
|
|
4582
|
+
const { rowKey: x, key: g } = f;
|
|
4583
|
+
this.ctx.database.getReadonly(x, g) || (r.add(x), s.push({
|
|
4584
|
+
rowKey: x,
|
|
4552
4585
|
key: g,
|
|
4553
4586
|
value: null,
|
|
4554
4587
|
row: {}
|
|
@@ -4576,18 +4609,18 @@ class Ei {
|
|
|
4576
4609
|
const e = this.ctx.selector.yArr[0], i = this.ctx.selector.xArr[0], s = /* @__PURE__ */ new Set();
|
|
4577
4610
|
navigator.clipboard.readText().then(async (r) => {
|
|
4578
4611
|
let o = si(r);
|
|
4579
|
-
const n = [i, i + o[0].length - 1], h = [e, e + o.length - 1], [c, d] = h, [f,
|
|
4580
|
-
(g > 0 ||
|
|
4612
|
+
const n = [i, i + o[0].length - 1], h = [e, e + o.length - 1], [c, d] = h, [f, x] = n, g = d - this.ctx.maxRowIndex, p = x - this.ctx.maxColIndex;
|
|
4613
|
+
(g > 0 || p > 0) && this.ctx.emit("onPastedDataOverflow", {
|
|
4581
4614
|
maxY: d,
|
|
4582
|
-
maxX:
|
|
4615
|
+
maxX: x,
|
|
4583
4616
|
minY: c,
|
|
4584
4617
|
minX: f,
|
|
4585
4618
|
overflowRowCount: g,
|
|
4586
|
-
overflowColCount:
|
|
4619
|
+
overflowColCount: p,
|
|
4587
4620
|
textArr: o
|
|
4588
4621
|
});
|
|
4589
|
-
const
|
|
4590
|
-
if (this.ctx.config.ENABLE_MERGE_CELL_LINK && this.ctx.database.hasMergeCell(n, h) && !
|
|
4622
|
+
const u = o.length === 1 && o[0].length === 1;
|
|
4623
|
+
if (this.ctx.config.ENABLE_MERGE_CELL_LINK && this.ctx.database.hasMergeCell(n, h) && !u) {
|
|
4591
4624
|
const y = {
|
|
4592
4625
|
code: "ERR_MERGED_CELLS_PASTE",
|
|
4593
4626
|
message: "Merged cells cannot span paste data"
|
|
@@ -4597,8 +4630,8 @@ class Ei {
|
|
|
4597
4630
|
}
|
|
4598
4631
|
let w = [];
|
|
4599
4632
|
for (let y = 0; y <= o.length - 1; y++) {
|
|
4600
|
-
const
|
|
4601
|
-
for (let E = 0; E <=
|
|
4633
|
+
const C = o[y].length;
|
|
4634
|
+
for (let E = 0; E <= C - 1; E++) {
|
|
4602
4635
|
const R = y + e, O = E + i, I = o[y][E], _ = this.ctx.database.getItemValueForRowIndexAndColIndex(
|
|
4603
4636
|
R,
|
|
4604
4637
|
O
|
|
@@ -4621,30 +4654,30 @@ class Ei {
|
|
|
4621
4654
|
this.ctx.selector.yArrCopy,
|
|
4622
4655
|
!0
|
|
4623
4656
|
// 忽略设置,只返回数据,用于cut,实现历史回退需要返回两次问题
|
|
4624
|
-
),
|
|
4657
|
+
), C = w.map((E) => `${E.rowKey}-${E.key}`);
|
|
4625
4658
|
y.forEach((E) => {
|
|
4626
|
-
|
|
4659
|
+
C.includes(`${E.rowKey}-${E.key}`) || w.unshift(E);
|
|
4627
4660
|
}), this.isCut = !1;
|
|
4628
4661
|
}
|
|
4629
4662
|
if (!w.length)
|
|
4630
4663
|
return;
|
|
4631
|
-
const { BEFORE_PASTE_DATA_METHOD:
|
|
4632
|
-
if (typeof
|
|
4633
|
-
const y =
|
|
4664
|
+
const { BEFORE_PASTE_DATA_METHOD: m } = this.ctx.config;
|
|
4665
|
+
if (typeof m == "function") {
|
|
4666
|
+
const y = m, C = w.map((E) => ({
|
|
4634
4667
|
rowKey: E.rowKey,
|
|
4635
4668
|
key: E.key,
|
|
4636
4669
|
value: E.value,
|
|
4637
4670
|
oldValue: this.ctx.database.getItemValue(E.rowKey, E.key),
|
|
4638
4671
|
row: this.ctx.database.getRowDataItemForRowKey(E.rowKey)
|
|
4639
4672
|
}));
|
|
4640
|
-
if (w = await y(
|
|
4673
|
+
if (w = await y(C, n, h, o), w && !w.length)
|
|
4641
4674
|
return;
|
|
4642
4675
|
}
|
|
4643
4676
|
this.clearCopyLine(), this.ctx.batchSetItemValueByEditor(w, !0);
|
|
4644
|
-
let
|
|
4677
|
+
let b = [];
|
|
4645
4678
|
s.forEach((y) => {
|
|
4646
|
-
|
|
4647
|
-
}), this.ctx.emit("pasteChange", w,
|
|
4679
|
+
b.push(this.ctx.database.getRowDataItemForRowKey(y));
|
|
4680
|
+
}), this.ctx.emit("pasteChange", w, b);
|
|
4648
4681
|
}).catch((r) => {
|
|
4649
4682
|
console.error("Failed to get the clipboard content:", r);
|
|
4650
4683
|
});
|
|
@@ -4690,8 +4723,8 @@ class Ei {
|
|
|
4690
4723
|
SELECTOR_AREA_MAX_Y: o,
|
|
4691
4724
|
SELECTOR_AREA_MAX_X_OFFSET: n,
|
|
4692
4725
|
SELECTOR_AREA_MAX_Y_OFFSET: h
|
|
4693
|
-
} = this.ctx.config, c = i, d = s || this.ctx.maxColIndex - n, f = r,
|
|
4694
|
-
return !(e < c || e > d || t < f || t >
|
|
4726
|
+
} = this.ctx.config, c = i, d = s || this.ctx.maxColIndex - n, f = r, x = o || this.ctx.maxRowIndex - h;
|
|
4727
|
+
return !(e < c || e > d || t < f || t > x);
|
|
4695
4728
|
}
|
|
4696
4729
|
/**
|
|
4697
4730
|
* 调整滚动条位置,让到达边界时自动滚动
|
|
@@ -4733,19 +4766,19 @@ class Ei {
|
|
|
4733
4766
|
body: h,
|
|
4734
4767
|
scrollX: c,
|
|
4735
4768
|
scrollY: d,
|
|
4736
|
-
config: { SCROLLER_TRACK_SIZE: f, FOOTER_FIXED:
|
|
4769
|
+
config: { SCROLLER_TRACK_SIZE: f, FOOTER_FIXED: x, FOOTER_POSITION: g, ENABLE_MERGE_CELL_LINK: p }
|
|
4737
4770
|
} = this.ctx;
|
|
4738
4771
|
if (!i)
|
|
4739
4772
|
return;
|
|
4740
|
-
|
|
4741
|
-
const { drawX:
|
|
4742
|
-
let R = o.height - w, O =
|
|
4773
|
+
p && this.ctx.onlyMergeCell && i.updateSpanInfo();
|
|
4774
|
+
const { drawX: u, drawY: w, width: m, height: b, fixed: y } = i, C = r - u + 1, E = i.drawX + m - (e - s) + 1;
|
|
4775
|
+
let R = o.height - w, O = b;
|
|
4743
4776
|
O > h.visibleHeight && (O = h.visibleHeight);
|
|
4744
4777
|
let I = 0;
|
|
4745
|
-
|
|
4778
|
+
x && (g === "top" ? R = o.height + n.height - w : I = n.visibleHeight);
|
|
4746
4779
|
const _ = w + O - (t - I - f);
|
|
4747
4780
|
let v = c, S = d;
|
|
4748
|
-
E > 0 && !y ? v = Math.floor(c + E) :
|
|
4781
|
+
E > 0 && !y ? v = Math.floor(c + E) : C > 0 && !y && (v = Math.floor(c - C)), R > 0 ? S = Math.floor(d - R) : _ > 0 && (S = Math.floor(d + _)), (Math.abs(c - v) > 2 || Math.abs(d - S) > 2) && (this.ctx.adjustPositioning = !0, this.ctx.setScroll(v, S), this.ctx.emit("adjustBoundaryPosition", i));
|
|
4749
4782
|
}
|
|
4750
4783
|
destroy() {
|
|
4751
4784
|
this.timerX && (clearTimeout(this.timerX), this.timerX = 0), this.timerY && (clearTimeout(this.timerY), this.timerY = 0);
|
|
@@ -4753,16 +4786,16 @@ class Ei {
|
|
|
4753
4786
|
}
|
|
4754
4787
|
class Ci {
|
|
4755
4788
|
constructor(t) {
|
|
4756
|
-
|
|
4757
|
-
|
|
4789
|
+
a(this, "ctx");
|
|
4790
|
+
a(this, "maxColRowCell");
|
|
4758
4791
|
this.ctx = t, this.init();
|
|
4759
4792
|
}
|
|
4760
4793
|
init() {
|
|
4761
4794
|
this.ctx.on("mousemove", (t) => {
|
|
4762
4795
|
if (this.ctx.stageElement.style.cursor === "crosshair" && (this.ctx.stageElement.style.cursor = "default"), this.ctx.editing || !this.ctx.focusCell || !this.maxColRowCell)
|
|
4763
4796
|
return;
|
|
4764
|
-
const { offsetX: e, offsetY: i } = this.ctx.getOffset(t), { colIndex: s, rowIndex: r, drawX: o, drawY: n, width: h, height: c } = this.maxColRowCell, d = 6, f = s === this.ctx.maxColIndex || r === this.ctx.maxRowIndex ? 0 : 2,
|
|
4765
|
-
e >
|
|
4797
|
+
const { offsetX: e, offsetY: i } = this.ctx.getOffset(t), { colIndex: s, rowIndex: r, drawX: o, drawY: n, width: h, height: c } = this.maxColRowCell, d = 6, f = s === this.ctx.maxColIndex || r === this.ctx.maxRowIndex ? 0 : 2, x = o + h - d + f, g = n + c - d + f;
|
|
4798
|
+
e > x && i > g && e < x + d && i < g + d && (this.ctx.stageElement.style.cursor = "crosshair");
|
|
4766
4799
|
}), this.ctx.on("cellMouseenter", (t) => {
|
|
4767
4800
|
const { xArr: e, yArr: i } = this.ctx.selector, s = e[1], r = i[1], { colIndex: o, rowIndex: n } = t;
|
|
4768
4801
|
this.ctx.config.ENABLE_AUTOFILL && o === s && n === r && (this.maxColRowCell = t), this.mouseenter(t);
|
|
@@ -4807,13 +4840,13 @@ class Ci {
|
|
|
4807
4840
|
SELECTOR_AREA_MAX_X: c,
|
|
4808
4841
|
SELECTOR_AREA_MIN_Y: d,
|
|
4809
4842
|
SELECTOR_AREA_MAX_Y: f,
|
|
4810
|
-
SELECTOR_AREA_MAX_X_OFFSET:
|
|
4843
|
+
SELECTOR_AREA_MAX_X_OFFSET: x,
|
|
4811
4844
|
SELECTOR_AREA_MAX_Y_OFFSET: g
|
|
4812
|
-
} = this.ctx.config,
|
|
4813
|
-
let [
|
|
4814
|
-
if (
|
|
4845
|
+
} = this.ctx.config, p = h, u = c || this.ctx.maxColIndex - x, w = d, m = f || this.ctx.maxRowIndex - g;
|
|
4846
|
+
let [b, y] = o, [C, E] = n;
|
|
4847
|
+
if (b < p || C < w)
|
|
4815
4848
|
return;
|
|
4816
|
-
o = [Math.max(
|
|
4849
|
+
o = [Math.max(p, b), Math.min(u, y)], n = [Math.max(w, C), Math.min(m, E)];
|
|
4817
4850
|
const { BEFORE_SET_AUTOFILL_METHOD: R } = this.ctx.config;
|
|
4818
4851
|
if (typeof R == "function") {
|
|
4819
4852
|
const I = R({
|
|
@@ -4834,9 +4867,9 @@ class Ci {
|
|
|
4834
4867
|
async autofillData() {
|
|
4835
4868
|
const t = /* @__PURE__ */ new Set(), e = this.ctx.getSelectedData(), i = /* @__PURE__ */ new Map();
|
|
4836
4869
|
for (let g = 0; g <= e.yArr[1] - e.yArr[0]; g++)
|
|
4837
|
-
for (let
|
|
4838
|
-
const
|
|
4839
|
-
i.set(`${
|
|
4870
|
+
for (let p = 0; p <= e.xArr[1] - e.xArr[0]; p++) {
|
|
4871
|
+
const u = g + e.yArr[0], w = p + e.xArr[0];
|
|
4872
|
+
i.set(`${u}-${w}`, !0);
|
|
4840
4873
|
}
|
|
4841
4874
|
const { value: s } = e, r = s[0].length, o = s.length, n = this.ctx.autofill.xArr, h = this.ctx.autofill.yArr, c = r === 1 && o === 1;
|
|
4842
4875
|
if (this.ctx.config.ENABLE_MERGE_CELL_LINK && this.ctx.database.hasMergeCell(n, h) && !c) {
|
|
@@ -4849,14 +4882,14 @@ class Ci {
|
|
|
4849
4882
|
}
|
|
4850
4883
|
let d = [];
|
|
4851
4884
|
for (let g = 0; g <= h[1] - h[0]; g++)
|
|
4852
|
-
for (let
|
|
4853
|
-
const
|
|
4854
|
-
if (
|
|
4855
|
-
const { rowKey:
|
|
4856
|
-
this.ctx.database.getReadonly(
|
|
4857
|
-
rowKey:
|
|
4885
|
+
for (let p = 0; p <= n[1] - n[0]; p++) {
|
|
4886
|
+
const u = p + n[0], w = g + h[0], m = s[g % o][p % r], b = this.ctx.database.getItemValueForRowIndexAndColIndex(w, u), y = `${w}-${u}`;
|
|
4887
|
+
if (b && !i.has(y)) {
|
|
4888
|
+
const { rowKey: C, key: E } = b;
|
|
4889
|
+
this.ctx.database.getReadonly(C, E) || (t.add(C), d.push({
|
|
4890
|
+
rowKey: C,
|
|
4858
4891
|
key: E,
|
|
4859
|
-
value:
|
|
4892
|
+
value: m,
|
|
4860
4893
|
row: {}
|
|
4861
4894
|
}));
|
|
4862
4895
|
}
|
|
@@ -4866,21 +4899,21 @@ class Ci {
|
|
|
4866
4899
|
this.ctx.selector.xArr = this.ctx.autofill.xArr, this.ctx.selector.yArr = this.ctx.autofill.yArr;
|
|
4867
4900
|
const { BEFORE_AUTOFILL_DATA_METHOD: f } = this.ctx.config;
|
|
4868
4901
|
if (typeof f == "function") {
|
|
4869
|
-
const g = f,
|
|
4870
|
-
rowKey:
|
|
4871
|
-
key:
|
|
4872
|
-
value:
|
|
4873
|
-
oldValue: this.ctx.database.getItemValue(
|
|
4874
|
-
row: this.ctx.database.getRowDataItemForRowKey(
|
|
4902
|
+
const g = f, p = d.map((u) => ({
|
|
4903
|
+
rowKey: u.rowKey,
|
|
4904
|
+
key: u.key,
|
|
4905
|
+
value: u.value,
|
|
4906
|
+
oldValue: this.ctx.database.getItemValue(u.rowKey, u.key),
|
|
4907
|
+
row: this.ctx.database.getRowDataItemForRowKey(u.rowKey)
|
|
4875
4908
|
}));
|
|
4876
|
-
if (d = await g(
|
|
4909
|
+
if (d = await g(p, n, h), d && !d.length)
|
|
4877
4910
|
return;
|
|
4878
4911
|
}
|
|
4879
4912
|
this.ctx.batchSetItemValueByEditor(d, !0);
|
|
4880
|
-
let
|
|
4913
|
+
let x = [];
|
|
4881
4914
|
t.forEach((g) => {
|
|
4882
|
-
|
|
4883
|
-
}), this.ctx.emit("autofillChange", d,
|
|
4915
|
+
x.push(this.ctx.database.getRowDataItemForRowKey(g));
|
|
4916
|
+
}), this.ctx.emit("autofillChange", d, x);
|
|
4884
4917
|
}
|
|
4885
4918
|
mouseenter(t) {
|
|
4886
4919
|
if (["index", "selection", "index-selection"].includes(t.type))
|
|
@@ -4894,9 +4927,9 @@ class Ci {
|
|
|
4894
4927
|
destroy() {
|
|
4895
4928
|
}
|
|
4896
4929
|
}
|
|
4897
|
-
const rt = Math.min, U = Math.max, ft = Math.round, z = (
|
|
4898
|
-
x:
|
|
4899
|
-
y:
|
|
4930
|
+
const rt = Math.min, U = Math.max, ft = Math.round, z = (l) => ({
|
|
4931
|
+
x: l,
|
|
4932
|
+
y: l
|
|
4900
4933
|
}), bi = {
|
|
4901
4934
|
left: "right",
|
|
4902
4935
|
right: "left",
|
|
@@ -4906,46 +4939,46 @@ const rt = Math.min, U = Math.max, ft = Math.round, z = (a) => ({
|
|
|
4906
4939
|
start: "end",
|
|
4907
4940
|
end: "start"
|
|
4908
4941
|
};
|
|
4909
|
-
function It(
|
|
4910
|
-
return U(
|
|
4942
|
+
function It(l, t, e) {
|
|
4943
|
+
return U(l, rt(t, e));
|
|
4911
4944
|
}
|
|
4912
|
-
function at(
|
|
4913
|
-
return typeof
|
|
4945
|
+
function at(l, t) {
|
|
4946
|
+
return typeof l == "function" ? l(t) : l;
|
|
4914
4947
|
}
|
|
4915
|
-
function G(
|
|
4916
|
-
return
|
|
4948
|
+
function G(l) {
|
|
4949
|
+
return l.split("-")[0];
|
|
4917
4950
|
}
|
|
4918
|
-
function lt(
|
|
4919
|
-
return
|
|
4951
|
+
function lt(l) {
|
|
4952
|
+
return l.split("-")[1];
|
|
4920
4953
|
}
|
|
4921
|
-
function ae(
|
|
4922
|
-
return
|
|
4954
|
+
function ae(l) {
|
|
4955
|
+
return l === "x" ? "y" : "x";
|
|
4923
4956
|
}
|
|
4924
|
-
function Mt(
|
|
4925
|
-
return
|
|
4957
|
+
function Mt(l) {
|
|
4958
|
+
return l === "y" ? "height" : "width";
|
|
4926
4959
|
}
|
|
4927
|
-
function J(
|
|
4928
|
-
return ["top", "bottom"].includes(G(
|
|
4960
|
+
function J(l) {
|
|
4961
|
+
return ["top", "bottom"].includes(G(l)) ? "y" : "x";
|
|
4929
4962
|
}
|
|
4930
|
-
function Ht(
|
|
4931
|
-
return ae(J(
|
|
4963
|
+
function Ht(l) {
|
|
4964
|
+
return ae(J(l));
|
|
4932
4965
|
}
|
|
4933
|
-
function Ri(
|
|
4966
|
+
function Ri(l, t, e) {
|
|
4934
4967
|
e === void 0 && (e = !1);
|
|
4935
|
-
const i = lt(
|
|
4968
|
+
const i = lt(l), s = Ht(l), r = Mt(s);
|
|
4936
4969
|
let o = s === "x" ? i === (e ? "end" : "start") ? "right" : "left" : i === "start" ? "bottom" : "top";
|
|
4937
|
-
return t.reference[r] > t.floating[r] && (o =
|
|
4970
|
+
return t.reference[r] > t.floating[r] && (o = xt(o)), [o, xt(o)];
|
|
4938
4971
|
}
|
|
4939
|
-
function _i(
|
|
4940
|
-
const t =
|
|
4941
|
-
return [Ot(
|
|
4972
|
+
function _i(l) {
|
|
4973
|
+
const t = xt(l);
|
|
4974
|
+
return [Ot(l), t, Ot(t)];
|
|
4942
4975
|
}
|
|
4943
|
-
function Ot(
|
|
4944
|
-
return
|
|
4976
|
+
function Ot(l) {
|
|
4977
|
+
return l.replace(/start|end/g, (t) => vi[t]);
|
|
4945
4978
|
}
|
|
4946
|
-
function Ii(
|
|
4979
|
+
function Ii(l, t, e) {
|
|
4947
4980
|
const i = ["left", "right"], s = ["right", "left"], r = ["top", "bottom"], o = ["bottom", "top"];
|
|
4948
|
-
switch (
|
|
4981
|
+
switch (l) {
|
|
4949
4982
|
case "top":
|
|
4950
4983
|
case "bottom":
|
|
4951
4984
|
return e ? t ? s : i : t ? i : s;
|
|
@@ -4956,38 +4989,38 @@ function Ii(a, t, e) {
|
|
|
4956
4989
|
return [];
|
|
4957
4990
|
}
|
|
4958
4991
|
}
|
|
4959
|
-
function Oi(
|
|
4960
|
-
const s = lt(
|
|
4961
|
-
let r = Ii(G(
|
|
4992
|
+
function Oi(l, t, e, i) {
|
|
4993
|
+
const s = lt(l);
|
|
4994
|
+
let r = Ii(G(l), e === "start", i);
|
|
4962
4995
|
return s && (r = r.map((o) => o + "-" + s), t && (r = r.concat(r.map(Ot)))), r;
|
|
4963
4996
|
}
|
|
4964
|
-
function
|
|
4965
|
-
return
|
|
4997
|
+
function xt(l) {
|
|
4998
|
+
return l.replace(/left|right|bottom|top/g, (t) => bi[t]);
|
|
4966
4999
|
}
|
|
4967
|
-
function Li(
|
|
5000
|
+
function Li(l) {
|
|
4968
5001
|
return {
|
|
4969
5002
|
top: 0,
|
|
4970
5003
|
right: 0,
|
|
4971
5004
|
bottom: 0,
|
|
4972
5005
|
left: 0,
|
|
4973
|
-
...
|
|
5006
|
+
...l
|
|
4974
5007
|
};
|
|
4975
5008
|
}
|
|
4976
|
-
function le(
|
|
4977
|
-
return typeof
|
|
4978
|
-
top:
|
|
4979
|
-
right:
|
|
4980
|
-
bottom:
|
|
4981
|
-
left:
|
|
5009
|
+
function le(l) {
|
|
5010
|
+
return typeof l != "number" ? Li(l) : {
|
|
5011
|
+
top: l,
|
|
5012
|
+
right: l,
|
|
5013
|
+
bottom: l,
|
|
5014
|
+
left: l
|
|
4982
5015
|
};
|
|
4983
5016
|
}
|
|
4984
|
-
function
|
|
5017
|
+
function ut(l) {
|
|
4985
5018
|
const {
|
|
4986
5019
|
x: t,
|
|
4987
5020
|
y: e,
|
|
4988
5021
|
width: i,
|
|
4989
5022
|
height: s
|
|
4990
|
-
} =
|
|
5023
|
+
} = l;
|
|
4991
5024
|
return {
|
|
4992
5025
|
width: i,
|
|
4993
5026
|
height: s,
|
|
@@ -4999,12 +5032,12 @@ function xt(a) {
|
|
|
4999
5032
|
y: e
|
|
5000
5033
|
};
|
|
5001
5034
|
}
|
|
5002
|
-
function $t(
|
|
5035
|
+
function $t(l, t, e) {
|
|
5003
5036
|
let {
|
|
5004
5037
|
reference: i,
|
|
5005
5038
|
floating: s
|
|
5006
|
-
} =
|
|
5007
|
-
const r = J(t), o = Ht(t), n = Mt(o), h = G(t), c = r === "y", d = i.x + i.width / 2 - s.width / 2, f = i.y + i.height / 2 - s.height / 2,
|
|
5039
|
+
} = l;
|
|
5040
|
+
const r = J(t), o = Ht(t), n = Mt(o), h = G(t), c = r === "y", d = i.x + i.width / 2 - s.width / 2, f = i.y + i.height / 2 - s.height / 2, x = i[n] / 2 - s[n] / 2;
|
|
5008
5041
|
let g;
|
|
5009
5042
|
switch (h) {
|
|
5010
5043
|
case "top":
|
|
@@ -5039,15 +5072,15 @@ function $t(a, t, e) {
|
|
|
5039
5072
|
}
|
|
5040
5073
|
switch (lt(t)) {
|
|
5041
5074
|
case "start":
|
|
5042
|
-
g[o] -=
|
|
5075
|
+
g[o] -= x * (e && c ? -1 : 1);
|
|
5043
5076
|
break;
|
|
5044
5077
|
case "end":
|
|
5045
|
-
g[o] +=
|
|
5078
|
+
g[o] += x * (e && c ? -1 : 1);
|
|
5046
5079
|
break;
|
|
5047
5080
|
}
|
|
5048
5081
|
return g;
|
|
5049
5082
|
}
|
|
5050
|
-
const Si = async (
|
|
5083
|
+
const Si = async (l, t, e) => {
|
|
5051
5084
|
const {
|
|
5052
5085
|
placement: i = "bottom",
|
|
5053
5086
|
strategy: s = "absolute",
|
|
@@ -5055,60 +5088,60 @@ const Si = async (a, t, e) => {
|
|
|
5055
5088
|
platform: o
|
|
5056
5089
|
} = e, n = r.filter(Boolean), h = await (o.isRTL == null ? void 0 : o.isRTL(t));
|
|
5057
5090
|
let c = await o.getElementRects({
|
|
5058
|
-
reference:
|
|
5091
|
+
reference: l,
|
|
5059
5092
|
floating: t,
|
|
5060
5093
|
strategy: s
|
|
5061
5094
|
}), {
|
|
5062
5095
|
x: d,
|
|
5063
5096
|
y: f
|
|
5064
|
-
} = $t(c, i, h),
|
|
5065
|
-
for (let
|
|
5097
|
+
} = $t(c, i, h), x = i, g = {}, p = 0;
|
|
5098
|
+
for (let u = 0; u < n.length; u++) {
|
|
5066
5099
|
const {
|
|
5067
5100
|
name: w,
|
|
5068
|
-
fn:
|
|
5069
|
-
} = n[
|
|
5070
|
-
x:
|
|
5101
|
+
fn: m
|
|
5102
|
+
} = n[u], {
|
|
5103
|
+
x: b,
|
|
5071
5104
|
y,
|
|
5072
|
-
data:
|
|
5105
|
+
data: C,
|
|
5073
5106
|
reset: E
|
|
5074
|
-
} = await
|
|
5107
|
+
} = await m({
|
|
5075
5108
|
x: d,
|
|
5076
5109
|
y: f,
|
|
5077
5110
|
initialPlacement: i,
|
|
5078
|
-
placement:
|
|
5111
|
+
placement: x,
|
|
5079
5112
|
strategy: s,
|
|
5080
5113
|
middlewareData: g,
|
|
5081
5114
|
rects: c,
|
|
5082
5115
|
platform: o,
|
|
5083
5116
|
elements: {
|
|
5084
|
-
reference:
|
|
5117
|
+
reference: l,
|
|
5085
5118
|
floating: t
|
|
5086
5119
|
}
|
|
5087
5120
|
});
|
|
5088
|
-
d =
|
|
5121
|
+
d = b ?? d, f = y ?? f, g = {
|
|
5089
5122
|
...g,
|
|
5090
5123
|
[w]: {
|
|
5091
5124
|
...g[w],
|
|
5092
|
-
...
|
|
5125
|
+
...C
|
|
5093
5126
|
}
|
|
5094
|
-
}, E &&
|
|
5095
|
-
reference:
|
|
5127
|
+
}, E && p <= 50 && (p++, typeof E == "object" && (E.placement && (x = E.placement), E.rects && (c = E.rects === !0 ? await o.getElementRects({
|
|
5128
|
+
reference: l,
|
|
5096
5129
|
floating: t,
|
|
5097
5130
|
strategy: s
|
|
5098
5131
|
}) : E.rects), {
|
|
5099
5132
|
x: d,
|
|
5100
5133
|
y: f
|
|
5101
|
-
} = $t(c,
|
|
5134
|
+
} = $t(c, x, h)), u = -1);
|
|
5102
5135
|
}
|
|
5103
5136
|
return {
|
|
5104
5137
|
x: d,
|
|
5105
5138
|
y: f,
|
|
5106
|
-
placement:
|
|
5139
|
+
placement: x,
|
|
5107
5140
|
strategy: s,
|
|
5108
5141
|
middlewareData: g
|
|
5109
5142
|
};
|
|
5110
5143
|
};
|
|
5111
|
-
async function he(
|
|
5144
|
+
async function he(l, t) {
|
|
5112
5145
|
var e;
|
|
5113
5146
|
t === void 0 && (t = {});
|
|
5114
5147
|
const {
|
|
@@ -5118,44 +5151,44 @@ async function he(a, t) {
|
|
|
5118
5151
|
rects: o,
|
|
5119
5152
|
elements: n,
|
|
5120
5153
|
strategy: h
|
|
5121
|
-
} =
|
|
5154
|
+
} = l, {
|
|
5122
5155
|
boundary: c = "clippingAncestors",
|
|
5123
5156
|
rootBoundary: d = "viewport",
|
|
5124
5157
|
elementContext: f = "floating",
|
|
5125
|
-
altBoundary:
|
|
5158
|
+
altBoundary: x = !1,
|
|
5126
5159
|
padding: g = 0
|
|
5127
|
-
} = at(t,
|
|
5160
|
+
} = at(t, l), p = le(g), w = n[x ? f === "floating" ? "reference" : "floating" : f], m = ut(await r.getClippingRect({
|
|
5128
5161
|
element: (e = await (r.isElement == null ? void 0 : r.isElement(w))) == null || e ? w : w.contextElement || await (r.getDocumentElement == null ? void 0 : r.getDocumentElement(n.floating)),
|
|
5129
5162
|
boundary: c,
|
|
5130
5163
|
rootBoundary: d,
|
|
5131
5164
|
strategy: h
|
|
5132
|
-
})),
|
|
5165
|
+
})), b = f === "floating" ? {
|
|
5133
5166
|
x: i,
|
|
5134
5167
|
y: s,
|
|
5135
5168
|
width: o.floating.width,
|
|
5136
5169
|
height: o.floating.height
|
|
5137
|
-
} : o.reference, y = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(n.floating)),
|
|
5170
|
+
} : o.reference, y = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(n.floating)), C = await (r.isElement == null ? void 0 : r.isElement(y)) ? await (r.getScale == null ? void 0 : r.getScale(y)) || {
|
|
5138
5171
|
x: 1,
|
|
5139
5172
|
y: 1
|
|
5140
5173
|
} : {
|
|
5141
5174
|
x: 1,
|
|
5142
5175
|
y: 1
|
|
5143
|
-
}, E =
|
|
5176
|
+
}, E = ut(r.convertOffsetParentRelativeRectToViewportRelativeRect ? await r.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
5144
5177
|
elements: n,
|
|
5145
|
-
rect:
|
|
5178
|
+
rect: b,
|
|
5146
5179
|
offsetParent: y,
|
|
5147
5180
|
strategy: h
|
|
5148
|
-
}) :
|
|
5181
|
+
}) : b);
|
|
5149
5182
|
return {
|
|
5150
|
-
top: (
|
|
5151
|
-
bottom: (E.bottom -
|
|
5152
|
-
left: (
|
|
5153
|
-
right: (E.right -
|
|
5183
|
+
top: (m.top - E.top + p.top) / C.y,
|
|
5184
|
+
bottom: (E.bottom - m.bottom + p.bottom) / C.y,
|
|
5185
|
+
left: (m.left - E.left + p.left) / C.x,
|
|
5186
|
+
right: (E.right - m.right + p.right) / C.x
|
|
5154
5187
|
};
|
|
5155
5188
|
}
|
|
5156
|
-
const Ti = (
|
|
5189
|
+
const Ti = (l) => ({
|
|
5157
5190
|
name: "arrow",
|
|
5158
|
-
options:
|
|
5191
|
+
options: l,
|
|
5159
5192
|
async fn(t) {
|
|
5160
5193
|
const {
|
|
5161
5194
|
x: e,
|
|
@@ -5168,21 +5201,21 @@ const Ti = (a) => ({
|
|
|
5168
5201
|
} = t, {
|
|
5169
5202
|
element: c,
|
|
5170
5203
|
padding: d = 0
|
|
5171
|
-
} = at(
|
|
5204
|
+
} = at(l, t) || {};
|
|
5172
5205
|
if (c == null)
|
|
5173
5206
|
return {};
|
|
5174
|
-
const f = le(d),
|
|
5207
|
+
const f = le(d), x = {
|
|
5175
5208
|
x: e,
|
|
5176
5209
|
y: i
|
|
5177
|
-
}, g = Ht(s),
|
|
5210
|
+
}, g = Ht(s), p = Mt(g), u = await o.getDimensions(c), w = g === "y", m = w ? "top" : "left", b = w ? "bottom" : "right", y = w ? "clientHeight" : "clientWidth", C = r.reference[p] + r.reference[g] - x[g] - r.floating[p], E = x[g] - r.reference[g], R = await (o.getOffsetParent == null ? void 0 : o.getOffsetParent(c));
|
|
5178
5211
|
let O = R ? R[y] : 0;
|
|
5179
|
-
(!O || !await (o.isElement == null ? void 0 : o.isElement(R))) && (O = n.floating[y] || r.floating[
|
|
5180
|
-
const I =
|
|
5212
|
+
(!O || !await (o.isElement == null ? void 0 : o.isElement(R))) && (O = n.floating[y] || r.floating[p]);
|
|
5213
|
+
const I = C / 2 - E / 2, _ = O / 2 - u[p] / 2 - 1, v = rt(f[m], _), S = rt(f[b], _), T = v, M = O - u[p] - S, A = O / 2 - u[p] / 2 + I, N = It(T, A, M), Y = !h.arrow && lt(s) != null && A !== N && r.reference[p] / 2 - (A < T ? v : S) - u[p] / 2 < 0, k = Y ? A < T ? A - T : A - M : 0;
|
|
5181
5214
|
return {
|
|
5182
|
-
[g]:
|
|
5215
|
+
[g]: x[g] + k,
|
|
5183
5216
|
data: {
|
|
5184
|
-
[g]:
|
|
5185
|
-
centerOffset: A -
|
|
5217
|
+
[g]: N,
|
|
5218
|
+
centerOffset: A - N - k,
|
|
5186
5219
|
...Y && {
|
|
5187
5220
|
alignmentOffset: k
|
|
5188
5221
|
}
|
|
@@ -5190,10 +5223,10 @@ const Ti = (a) => ({
|
|
|
5190
5223
|
reset: Y
|
|
5191
5224
|
};
|
|
5192
5225
|
}
|
|
5193
|
-
}), Ai = function(
|
|
5194
|
-
return
|
|
5226
|
+
}), Ai = function(l) {
|
|
5227
|
+
return l === void 0 && (l = {}), {
|
|
5195
5228
|
name: "flip",
|
|
5196
|
-
options:
|
|
5229
|
+
options: l,
|
|
5197
5230
|
async fn(t) {
|
|
5198
5231
|
var e, i;
|
|
5199
5232
|
const {
|
|
@@ -5206,20 +5239,20 @@ const Ti = (a) => ({
|
|
|
5206
5239
|
} = t, {
|
|
5207
5240
|
mainAxis: d = !0,
|
|
5208
5241
|
crossAxis: f = !0,
|
|
5209
|
-
fallbackPlacements:
|
|
5242
|
+
fallbackPlacements: x,
|
|
5210
5243
|
fallbackStrategy: g = "bestFit",
|
|
5211
|
-
fallbackAxisSideDirection:
|
|
5212
|
-
flipAlignment:
|
|
5244
|
+
fallbackAxisSideDirection: p = "none",
|
|
5245
|
+
flipAlignment: u = !0,
|
|
5213
5246
|
...w
|
|
5214
|
-
} = at(
|
|
5247
|
+
} = at(l, t);
|
|
5215
5248
|
if ((e = r.arrow) != null && e.alignmentOffset)
|
|
5216
5249
|
return {};
|
|
5217
|
-
const
|
|
5218
|
-
!
|
|
5250
|
+
const m = G(s), b = J(n), y = G(n) === n, C = await (h.isRTL == null ? void 0 : h.isRTL(c.floating)), E = x || (y || !u ? [xt(n)] : _i(n)), R = p !== "none";
|
|
5251
|
+
!x && R && E.push(...Oi(n, u, p, C));
|
|
5219
5252
|
const O = [n, ...E], I = await he(t, w), _ = [];
|
|
5220
5253
|
let v = ((i = r.flip) == null ? void 0 : i.overflows) || [];
|
|
5221
|
-
if (d && _.push(I[
|
|
5222
|
-
const A = Ri(s, o,
|
|
5254
|
+
if (d && _.push(I[m]), f) {
|
|
5255
|
+
const A = Ri(s, o, C);
|
|
5223
5256
|
_.push(I[A[0]], I[A[1]]);
|
|
5224
5257
|
}
|
|
5225
5258
|
if (v = [...v, {
|
|
@@ -5227,15 +5260,15 @@ const Ti = (a) => ({
|
|
|
5227
5260
|
overflows: _
|
|
5228
5261
|
}], !_.every((A) => A <= 0)) {
|
|
5229
5262
|
var S, T;
|
|
5230
|
-
const A = (((S = r.flip) == null ? void 0 : S.index) || 0) + 1,
|
|
5231
|
-
if (
|
|
5263
|
+
const A = (((S = r.flip) == null ? void 0 : S.index) || 0) + 1, N = O[A];
|
|
5264
|
+
if (N)
|
|
5232
5265
|
return {
|
|
5233
5266
|
data: {
|
|
5234
5267
|
index: A,
|
|
5235
5268
|
overflows: v
|
|
5236
5269
|
},
|
|
5237
5270
|
reset: {
|
|
5238
|
-
placement:
|
|
5271
|
+
placement: N
|
|
5239
5272
|
}
|
|
5240
5273
|
};
|
|
5241
5274
|
let Y = (T = v.filter((k) => k.overflows[0] <= 0).sort((k, W) => k.overflows[1] - W.overflows[1])[0]) == null ? void 0 : T.placement;
|
|
@@ -5246,7 +5279,7 @@ const Ti = (a) => ({
|
|
|
5246
5279
|
const k = (M = v.filter((W) => {
|
|
5247
5280
|
if (R) {
|
|
5248
5281
|
const P = J(W.placement);
|
|
5249
|
-
return P ===
|
|
5282
|
+
return P === b || // Create a bias to the `y` side axis due to horizontal
|
|
5250
5283
|
// reading directions favoring greater width.
|
|
5251
5284
|
P === "y";
|
|
5252
5285
|
}
|
|
@@ -5270,16 +5303,16 @@ const Ti = (a) => ({
|
|
|
5270
5303
|
}
|
|
5271
5304
|
};
|
|
5272
5305
|
};
|
|
5273
|
-
async function Mi(
|
|
5306
|
+
async function Mi(l, t) {
|
|
5274
5307
|
const {
|
|
5275
5308
|
placement: e,
|
|
5276
5309
|
platform: i,
|
|
5277
5310
|
elements: s
|
|
5278
|
-
} =
|
|
5311
|
+
} = l, r = await (i.isRTL == null ? void 0 : i.isRTL(s.floating)), o = G(e), n = lt(e), h = J(e) === "y", c = ["left", "top"].includes(o) ? -1 : 1, d = r && h ? -1 : 1, f = at(t, l);
|
|
5279
5312
|
let {
|
|
5280
|
-
mainAxis:
|
|
5313
|
+
mainAxis: x,
|
|
5281
5314
|
crossAxis: g,
|
|
5282
|
-
alignmentAxis:
|
|
5315
|
+
alignmentAxis: p
|
|
5283
5316
|
} = typeof f == "number" ? {
|
|
5284
5317
|
mainAxis: f,
|
|
5285
5318
|
crossAxis: 0,
|
|
@@ -5289,18 +5322,18 @@ async function Mi(a, t) {
|
|
|
5289
5322
|
crossAxis: f.crossAxis || 0,
|
|
5290
5323
|
alignmentAxis: f.alignmentAxis
|
|
5291
5324
|
};
|
|
5292
|
-
return n && typeof
|
|
5325
|
+
return n && typeof p == "number" && (g = n === "end" ? p * -1 : p), h ? {
|
|
5293
5326
|
x: g * d,
|
|
5294
|
-
y:
|
|
5327
|
+
y: x * c
|
|
5295
5328
|
} : {
|
|
5296
|
-
x:
|
|
5329
|
+
x: x * c,
|
|
5297
5330
|
y: g * d
|
|
5298
5331
|
};
|
|
5299
5332
|
}
|
|
5300
|
-
const Hi = function(
|
|
5301
|
-
return
|
|
5333
|
+
const Hi = function(l) {
|
|
5334
|
+
return l === void 0 && (l = 0), {
|
|
5302
5335
|
name: "offset",
|
|
5303
|
-
options:
|
|
5336
|
+
options: l,
|
|
5304
5337
|
async fn(t) {
|
|
5305
5338
|
var e, i;
|
|
5306
5339
|
const {
|
|
@@ -5308,7 +5341,7 @@ const Hi = function(a) {
|
|
|
5308
5341
|
y: r,
|
|
5309
5342
|
placement: o,
|
|
5310
5343
|
middlewareData: n
|
|
5311
|
-
} = t, h = await Mi(t,
|
|
5344
|
+
} = t, h = await Mi(t, l);
|
|
5312
5345
|
return o === ((e = n.offset) == null ? void 0 : e.placement) && (i = n.arrow) != null && i.alignmentOffset ? {} : {
|
|
5313
5346
|
x: s + h.x,
|
|
5314
5347
|
y: r + h.y,
|
|
@@ -5319,10 +5352,10 @@ const Hi = function(a) {
|
|
|
5319
5352
|
};
|
|
5320
5353
|
}
|
|
5321
5354
|
};
|
|
5322
|
-
}, Di = function(
|
|
5323
|
-
return
|
|
5355
|
+
}, Di = function(l) {
|
|
5356
|
+
return l === void 0 && (l = {}), {
|
|
5324
5357
|
name: "shift",
|
|
5325
|
-
options:
|
|
5358
|
+
options: l,
|
|
5326
5359
|
async fn(t) {
|
|
5327
5360
|
const {
|
|
5328
5361
|
x: e,
|
|
@@ -5334,41 +5367,41 @@ const Hi = function(a) {
|
|
|
5334
5367
|
limiter: n = {
|
|
5335
5368
|
fn: (w) => {
|
|
5336
5369
|
let {
|
|
5337
|
-
x:
|
|
5338
|
-
y:
|
|
5370
|
+
x: m,
|
|
5371
|
+
y: b
|
|
5339
5372
|
} = w;
|
|
5340
5373
|
return {
|
|
5341
|
-
x:
|
|
5342
|
-
y:
|
|
5374
|
+
x: m,
|
|
5375
|
+
y: b
|
|
5343
5376
|
};
|
|
5344
5377
|
}
|
|
5345
5378
|
},
|
|
5346
5379
|
...h
|
|
5347
|
-
} = at(
|
|
5380
|
+
} = at(l, t), c = {
|
|
5348
5381
|
x: e,
|
|
5349
5382
|
y: i
|
|
5350
|
-
}, d = await he(t, h), f = J(G(s)),
|
|
5351
|
-
let g = c[
|
|
5383
|
+
}, d = await he(t, h), f = J(G(s)), x = ae(f);
|
|
5384
|
+
let g = c[x], p = c[f];
|
|
5352
5385
|
if (r) {
|
|
5353
|
-
const w =
|
|
5354
|
-
g = It(
|
|
5386
|
+
const w = x === "y" ? "top" : "left", m = x === "y" ? "bottom" : "right", b = g + d[w], y = g - d[m];
|
|
5387
|
+
g = It(b, g, y);
|
|
5355
5388
|
}
|
|
5356
5389
|
if (o) {
|
|
5357
|
-
const w = f === "y" ? "top" : "left",
|
|
5358
|
-
|
|
5390
|
+
const w = f === "y" ? "top" : "left", m = f === "y" ? "bottom" : "right", b = p + d[w], y = p - d[m];
|
|
5391
|
+
p = It(b, p, y);
|
|
5359
5392
|
}
|
|
5360
|
-
const
|
|
5393
|
+
const u = n.fn({
|
|
5361
5394
|
...t,
|
|
5362
|
-
[
|
|
5363
|
-
[f]:
|
|
5395
|
+
[x]: g,
|
|
5396
|
+
[f]: p
|
|
5364
5397
|
});
|
|
5365
5398
|
return {
|
|
5366
|
-
...
|
|
5399
|
+
...u,
|
|
5367
5400
|
data: {
|
|
5368
|
-
x:
|
|
5369
|
-
y:
|
|
5401
|
+
x: u.x - e,
|
|
5402
|
+
y: u.y - i,
|
|
5370
5403
|
enabled: {
|
|
5371
|
-
[
|
|
5404
|
+
[x]: r,
|
|
5372
5405
|
[f]: o
|
|
5373
5406
|
}
|
|
5374
5407
|
}
|
|
@@ -5379,56 +5412,56 @@ const Hi = function(a) {
|
|
|
5379
5412
|
function gt() {
|
|
5380
5413
|
return typeof window < "u";
|
|
5381
5414
|
}
|
|
5382
|
-
function tt(
|
|
5383
|
-
return ce(
|
|
5415
|
+
function tt(l) {
|
|
5416
|
+
return ce(l) ? (l.nodeName || "").toLowerCase() : "#document";
|
|
5384
5417
|
}
|
|
5385
|
-
function X(
|
|
5418
|
+
function X(l) {
|
|
5386
5419
|
var t;
|
|
5387
|
-
return (
|
|
5420
|
+
return (l == null || (t = l.ownerDocument) == null ? void 0 : t.defaultView) || window;
|
|
5388
5421
|
}
|
|
5389
|
-
function V(
|
|
5422
|
+
function V(l) {
|
|
5390
5423
|
var t;
|
|
5391
|
-
return (t = (ce(
|
|
5424
|
+
return (t = (ce(l) ? l.ownerDocument : l.document) || window.document) == null ? void 0 : t.documentElement;
|
|
5392
5425
|
}
|
|
5393
|
-
function ce(
|
|
5394
|
-
return gt() ?
|
|
5426
|
+
function ce(l) {
|
|
5427
|
+
return gt() ? l instanceof Node || l instanceof X(l).Node : !1;
|
|
5395
5428
|
}
|
|
5396
|
-
function
|
|
5397
|
-
return gt() ?
|
|
5429
|
+
function B(l) {
|
|
5430
|
+
return gt() ? l instanceof Element || l instanceof X(l).Element : !1;
|
|
5398
5431
|
}
|
|
5399
|
-
function K(
|
|
5400
|
-
return gt() ?
|
|
5432
|
+
function K(l) {
|
|
5433
|
+
return gt() ? l instanceof HTMLElement || l instanceof X(l).HTMLElement : !1;
|
|
5401
5434
|
}
|
|
5402
|
-
function qt(
|
|
5403
|
-
return !gt() || typeof ShadowRoot > "u" ? !1 :
|
|
5435
|
+
function qt(l) {
|
|
5436
|
+
return !gt() || typeof ShadowRoot > "u" ? !1 : l instanceof ShadowRoot || l instanceof X(l).ShadowRoot;
|
|
5404
5437
|
}
|
|
5405
|
-
function ht(
|
|
5438
|
+
function ht(l) {
|
|
5406
5439
|
const {
|
|
5407
5440
|
overflow: t,
|
|
5408
5441
|
overflowX: e,
|
|
5409
5442
|
overflowY: i,
|
|
5410
5443
|
display: s
|
|
5411
|
-
} = F(
|
|
5444
|
+
} = F(l);
|
|
5412
5445
|
return /auto|scroll|overlay|hidden|clip/.test(t + i + e) && !["inline", "contents"].includes(s);
|
|
5413
5446
|
}
|
|
5414
|
-
function Xi(
|
|
5415
|
-
return ["table", "td", "th"].includes(tt(
|
|
5447
|
+
function Xi(l) {
|
|
5448
|
+
return ["table", "td", "th"].includes(tt(l));
|
|
5416
5449
|
}
|
|
5417
|
-
function wt(
|
|
5450
|
+
function wt(l) {
|
|
5418
5451
|
return [":popover-open", ":modal"].some((t) => {
|
|
5419
5452
|
try {
|
|
5420
|
-
return
|
|
5453
|
+
return l.matches(t);
|
|
5421
5454
|
} catch {
|
|
5422
5455
|
return !1;
|
|
5423
5456
|
}
|
|
5424
5457
|
});
|
|
5425
5458
|
}
|
|
5426
|
-
function Dt(
|
|
5427
|
-
const t = Xt(), e =
|
|
5459
|
+
function Dt(l) {
|
|
5460
|
+
const t = Xt(), e = B(l) ? F(l) : l;
|
|
5428
5461
|
return e.transform !== "none" || e.perspective !== "none" || (e.containerType ? e.containerType !== "normal" : !1) || !t && (e.backdropFilter ? e.backdropFilter !== "none" : !1) || !t && (e.filter ? e.filter !== "none" : !1) || ["transform", "perspective", "filter"].some((i) => (e.willChange || "").includes(i)) || ["paint", "layout", "strict", "content"].some((i) => (e.contain || "").includes(i));
|
|
5429
5462
|
}
|
|
5430
|
-
function
|
|
5431
|
-
let t = $(
|
|
5463
|
+
function Bi(l) {
|
|
5464
|
+
let t = $(l);
|
|
5432
5465
|
for (; K(t) && !Q(t); ) {
|
|
5433
5466
|
if (Dt(t))
|
|
5434
5467
|
return t;
|
|
@@ -5441,65 +5474,65 @@ function Ni(a) {
|
|
|
5441
5474
|
function Xt() {
|
|
5442
5475
|
return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
|
|
5443
5476
|
}
|
|
5444
|
-
function Q(
|
|
5445
|
-
return ["html", "body", "#document"].includes(tt(
|
|
5477
|
+
function Q(l) {
|
|
5478
|
+
return ["html", "body", "#document"].includes(tt(l));
|
|
5446
5479
|
}
|
|
5447
|
-
function F(
|
|
5448
|
-
return X(
|
|
5480
|
+
function F(l) {
|
|
5481
|
+
return X(l).getComputedStyle(l);
|
|
5449
5482
|
}
|
|
5450
|
-
function pt(
|
|
5451
|
-
return
|
|
5452
|
-
scrollLeft:
|
|
5453
|
-
scrollTop:
|
|
5483
|
+
function pt(l) {
|
|
5484
|
+
return B(l) ? {
|
|
5485
|
+
scrollLeft: l.scrollLeft,
|
|
5486
|
+
scrollTop: l.scrollTop
|
|
5454
5487
|
} : {
|
|
5455
|
-
scrollLeft:
|
|
5456
|
-
scrollTop:
|
|
5488
|
+
scrollLeft: l.scrollX,
|
|
5489
|
+
scrollTop: l.scrollY
|
|
5457
5490
|
};
|
|
5458
5491
|
}
|
|
5459
|
-
function $(
|
|
5460
|
-
if (tt(
|
|
5461
|
-
return
|
|
5492
|
+
function $(l) {
|
|
5493
|
+
if (tt(l) === "html")
|
|
5494
|
+
return l;
|
|
5462
5495
|
const t = (
|
|
5463
5496
|
// Step into the shadow DOM of the parent of a slotted node.
|
|
5464
|
-
|
|
5465
|
-
|
|
5466
|
-
qt(
|
|
5467
|
-
V(
|
|
5497
|
+
l.assignedSlot || // DOM Element detected.
|
|
5498
|
+
l.parentNode || // ShadowRoot detected.
|
|
5499
|
+
qt(l) && l.host || // Fallback.
|
|
5500
|
+
V(l)
|
|
5468
5501
|
);
|
|
5469
5502
|
return qt(t) ? t.host : t;
|
|
5470
5503
|
}
|
|
5471
|
-
function de(
|
|
5472
|
-
const t = $(
|
|
5473
|
-
return Q(t) ?
|
|
5504
|
+
function de(l) {
|
|
5505
|
+
const t = $(l);
|
|
5506
|
+
return Q(t) ? l.ownerDocument ? l.ownerDocument.body : l.body : K(t) && ht(t) ? t : de(t);
|
|
5474
5507
|
}
|
|
5475
|
-
function Lt(
|
|
5508
|
+
function Lt(l, t, e) {
|
|
5476
5509
|
var i;
|
|
5477
5510
|
t === void 0 && (t = []), e === void 0 && (e = !0);
|
|
5478
|
-
const s = de(
|
|
5511
|
+
const s = de(l), r = s === ((i = l.ownerDocument) == null ? void 0 : i.body), o = X(s);
|
|
5479
5512
|
if (r) {
|
|
5480
5513
|
const n = St(o);
|
|
5481
5514
|
return t.concat(o, o.visualViewport || [], ht(s) ? s : [], n && e ? Lt(n) : []);
|
|
5482
5515
|
}
|
|
5483
5516
|
return t.concat(s, Lt(s, [], e));
|
|
5484
5517
|
}
|
|
5485
|
-
function St(
|
|
5486
|
-
return
|
|
5518
|
+
function St(l) {
|
|
5519
|
+
return l.parent && Object.getPrototypeOf(l.parent) ? l.frameElement : null;
|
|
5487
5520
|
}
|
|
5488
|
-
function fe(
|
|
5489
|
-
const t = F(
|
|
5521
|
+
function fe(l) {
|
|
5522
|
+
const t = F(l);
|
|
5490
5523
|
let e = parseFloat(t.width) || 0, i = parseFloat(t.height) || 0;
|
|
5491
|
-
const s = K(
|
|
5524
|
+
const s = K(l), r = s ? l.offsetWidth : e, o = s ? l.offsetHeight : i, n = ft(e) !== r || ft(i) !== o;
|
|
5492
5525
|
return n && (e = r, i = o), {
|
|
5493
5526
|
width: e,
|
|
5494
5527
|
height: i,
|
|
5495
5528
|
$: n
|
|
5496
5529
|
};
|
|
5497
5530
|
}
|
|
5498
|
-
function
|
|
5499
|
-
return
|
|
5531
|
+
function xe(l) {
|
|
5532
|
+
return B(l) ? l : l.contextElement;
|
|
5500
5533
|
}
|
|
5501
|
-
function Z(
|
|
5502
|
-
const t =
|
|
5534
|
+
function Z(l) {
|
|
5535
|
+
const t = xe(l);
|
|
5503
5536
|
if (!K(t))
|
|
5504
5537
|
return z(1);
|
|
5505
5538
|
const e = t.getBoundingClientRect(), {
|
|
@@ -5514,45 +5547,45 @@ function Z(a) {
|
|
|
5514
5547
|
};
|
|
5515
5548
|
}
|
|
5516
5549
|
const Fi = /* @__PURE__ */ z(0);
|
|
5517
|
-
function
|
|
5518
|
-
const t = X(
|
|
5550
|
+
function ue(l) {
|
|
5551
|
+
const t = X(l);
|
|
5519
5552
|
return !Xt() || !t.visualViewport ? Fi : {
|
|
5520
5553
|
x: t.visualViewport.offsetLeft,
|
|
5521
5554
|
y: t.visualViewport.offsetTop
|
|
5522
5555
|
};
|
|
5523
5556
|
}
|
|
5524
|
-
function
|
|
5525
|
-
return t === void 0 && (t = !1), !e || t && e !== X(
|
|
5557
|
+
function Ni(l, t, e) {
|
|
5558
|
+
return t === void 0 && (t = !1), !e || t && e !== X(l) ? !1 : t;
|
|
5526
5559
|
}
|
|
5527
|
-
function ot(
|
|
5560
|
+
function ot(l, t, e, i) {
|
|
5528
5561
|
t === void 0 && (t = !1), e === void 0 && (e = !1);
|
|
5529
|
-
const s =
|
|
5562
|
+
const s = l.getBoundingClientRect(), r = xe(l);
|
|
5530
5563
|
let o = z(1);
|
|
5531
|
-
t && (i ?
|
|
5532
|
-
const n =
|
|
5564
|
+
t && (i ? B(i) && (o = Z(i)) : o = Z(l));
|
|
5565
|
+
const n = Ni(r, e, i) ? ue(r) : z(0);
|
|
5533
5566
|
let h = (s.left + n.x) / o.x, c = (s.top + n.y) / o.y, d = s.width / o.x, f = s.height / o.y;
|
|
5534
5567
|
if (r) {
|
|
5535
|
-
const
|
|
5536
|
-
let
|
|
5537
|
-
for (;
|
|
5538
|
-
const w = Z(
|
|
5539
|
-
h *= w.x, c *= w.y, d *= w.x, f *= w.y, h += y, c +=
|
|
5568
|
+
const x = X(r), g = i && B(i) ? X(i) : i;
|
|
5569
|
+
let p = x, u = St(p);
|
|
5570
|
+
for (; u && i && g !== p; ) {
|
|
5571
|
+
const w = Z(u), m = u.getBoundingClientRect(), b = F(u), y = m.left + (u.clientLeft + parseFloat(b.paddingLeft)) * w.x, C = m.top + (u.clientTop + parseFloat(b.paddingTop)) * w.y;
|
|
5572
|
+
h *= w.x, c *= w.y, d *= w.x, f *= w.y, h += y, c += C, p = X(u), u = St(p);
|
|
5540
5573
|
}
|
|
5541
5574
|
}
|
|
5542
|
-
return
|
|
5575
|
+
return ut({
|
|
5543
5576
|
width: d,
|
|
5544
5577
|
height: f,
|
|
5545
5578
|
x: h,
|
|
5546
5579
|
y: c
|
|
5547
5580
|
});
|
|
5548
5581
|
}
|
|
5549
|
-
function ki(
|
|
5582
|
+
function ki(l) {
|
|
5550
5583
|
let {
|
|
5551
5584
|
elements: t,
|
|
5552
5585
|
rect: e,
|
|
5553
5586
|
offsetParent: i,
|
|
5554
5587
|
strategy: s
|
|
5555
|
-
} =
|
|
5588
|
+
} = l;
|
|
5556
5589
|
const r = s === "fixed", o = V(i), n = t ? wt(t.floating) : !1;
|
|
5557
5590
|
if (i === o || n && r)
|
|
5558
5591
|
return e;
|
|
@@ -5562,8 +5595,8 @@ function ki(a) {
|
|
|
5562
5595
|
}, c = z(1);
|
|
5563
5596
|
const d = z(0), f = K(i);
|
|
5564
5597
|
if ((f || !f && !r) && ((tt(i) !== "body" || ht(o)) && (h = pt(i)), K(i))) {
|
|
5565
|
-
const
|
|
5566
|
-
c = Z(i), d.x =
|
|
5598
|
+
const x = ot(i);
|
|
5599
|
+
c = Z(i), d.x = x.x + i.clientLeft, d.y = x.y + i.clientTop;
|
|
5567
5600
|
}
|
|
5568
5601
|
return {
|
|
5569
5602
|
width: e.width * c.x,
|
|
@@ -5572,16 +5605,16 @@ function ki(a) {
|
|
|
5572
5605
|
y: e.y * c.y - h.scrollTop * c.y + d.y
|
|
5573
5606
|
};
|
|
5574
5607
|
}
|
|
5575
|
-
function Ki(
|
|
5576
|
-
return Array.from(
|
|
5608
|
+
function Ki(l) {
|
|
5609
|
+
return Array.from(l.getClientRects());
|
|
5577
5610
|
}
|
|
5578
|
-
function Tt(
|
|
5579
|
-
const e = pt(
|
|
5580
|
-
return t ? t.left + e : ot(V(
|
|
5611
|
+
function Tt(l, t) {
|
|
5612
|
+
const e = pt(l).scrollLeft;
|
|
5613
|
+
return t ? t.left + e : ot(V(l)).left + e;
|
|
5581
5614
|
}
|
|
5582
|
-
function Yi(
|
|
5583
|
-
const t = V(
|
|
5584
|
-
let o = -e.scrollLeft + Tt(
|
|
5615
|
+
function Yi(l) {
|
|
5616
|
+
const t = V(l), e = pt(l), i = l.ownerDocument.body, s = U(t.scrollWidth, t.clientWidth, i.scrollWidth, i.clientWidth), r = U(t.scrollHeight, t.clientHeight, i.scrollHeight, i.clientHeight);
|
|
5617
|
+
let o = -e.scrollLeft + Tt(l);
|
|
5585
5618
|
const n = -e.scrollTop;
|
|
5586
5619
|
return F(i).direction === "rtl" && (o += U(t.clientWidth, i.clientWidth) - s), {
|
|
5587
5620
|
width: s,
|
|
@@ -5590,8 +5623,8 @@ function Yi(a) {
|
|
|
5590
5623
|
y: n
|
|
5591
5624
|
};
|
|
5592
5625
|
}
|
|
5593
|
-
function Vi(
|
|
5594
|
-
const e = X(
|
|
5626
|
+
function Vi(l, t) {
|
|
5627
|
+
const e = X(l), i = V(l), s = e.visualViewport;
|
|
5595
5628
|
let r = i.clientWidth, o = i.clientHeight, n = 0, h = 0;
|
|
5596
5629
|
if (s) {
|
|
5597
5630
|
r = s.width, o = s.height;
|
|
@@ -5605,8 +5638,8 @@ function Vi(a, t) {
|
|
|
5605
5638
|
y: h
|
|
5606
5639
|
};
|
|
5607
5640
|
}
|
|
5608
|
-
function Wi(
|
|
5609
|
-
const e = ot(
|
|
5641
|
+
function Wi(l, t) {
|
|
5642
|
+
const e = ot(l, !0, t === "fixed"), i = e.top + l.clientTop, s = e.left + l.clientLeft, r = K(l) ? Z(l) : z(1), o = l.clientWidth * r.x, n = l.clientHeight * r.y, h = s * r.x, c = i * r.y;
|
|
5610
5643
|
return {
|
|
5611
5644
|
width: o,
|
|
5612
5645
|
height: n,
|
|
@@ -5614,48 +5647,48 @@ function Wi(a, t) {
|
|
|
5614
5647
|
y: c
|
|
5615
5648
|
};
|
|
5616
5649
|
}
|
|
5617
|
-
function Gt(
|
|
5650
|
+
function Gt(l, t, e) {
|
|
5618
5651
|
let i;
|
|
5619
5652
|
if (t === "viewport")
|
|
5620
|
-
i = Vi(
|
|
5653
|
+
i = Vi(l, e);
|
|
5621
5654
|
else if (t === "document")
|
|
5622
|
-
i = Yi(V(
|
|
5623
|
-
else if (
|
|
5655
|
+
i = Yi(V(l));
|
|
5656
|
+
else if (B(t))
|
|
5624
5657
|
i = Wi(t, e);
|
|
5625
5658
|
else {
|
|
5626
|
-
const s =
|
|
5659
|
+
const s = ue(l);
|
|
5627
5660
|
i = {
|
|
5628
5661
|
...t,
|
|
5629
5662
|
x: t.x - s.x,
|
|
5630
5663
|
y: t.y - s.y
|
|
5631
5664
|
};
|
|
5632
5665
|
}
|
|
5633
|
-
return
|
|
5666
|
+
return ut(i);
|
|
5634
5667
|
}
|
|
5635
|
-
function ge(
|
|
5636
|
-
const e = $(
|
|
5637
|
-
return e === t || !
|
|
5668
|
+
function ge(l, t) {
|
|
5669
|
+
const e = $(l);
|
|
5670
|
+
return e === t || !B(e) || Q(e) ? !1 : F(e).position === "fixed" || ge(e, t);
|
|
5638
5671
|
}
|
|
5639
|
-
function Pi(
|
|
5640
|
-
const e = t.get(
|
|
5672
|
+
function Pi(l, t) {
|
|
5673
|
+
const e = t.get(l);
|
|
5641
5674
|
if (e)
|
|
5642
5675
|
return e;
|
|
5643
|
-
let i = Lt(
|
|
5644
|
-
const r = F(
|
|
5645
|
-
let o = r ? $(
|
|
5646
|
-
for (;
|
|
5676
|
+
let i = Lt(l, [], !1).filter((n) => B(n) && tt(n) !== "body"), s = null;
|
|
5677
|
+
const r = F(l).position === "fixed";
|
|
5678
|
+
let o = r ? $(l) : l;
|
|
5679
|
+
for (; B(o) && !Q(o); ) {
|
|
5647
5680
|
const n = F(o), h = Dt(o);
|
|
5648
|
-
!h && n.position === "fixed" && (s = null), (r ? !h && !s : !h && n.position === "static" && !!s && ["absolute", "fixed"].includes(s.position) || ht(o) && !h && ge(
|
|
5681
|
+
!h && n.position === "fixed" && (s = null), (r ? !h && !s : !h && n.position === "static" && !!s && ["absolute", "fixed"].includes(s.position) || ht(o) && !h && ge(l, o)) ? i = i.filter((d) => d !== o) : s = n, o = $(o);
|
|
5649
5682
|
}
|
|
5650
|
-
return t.set(
|
|
5683
|
+
return t.set(l, i), i;
|
|
5651
5684
|
}
|
|
5652
|
-
function zi(
|
|
5685
|
+
function zi(l) {
|
|
5653
5686
|
let {
|
|
5654
5687
|
element: t,
|
|
5655
5688
|
boundary: e,
|
|
5656
5689
|
rootBoundary: i,
|
|
5657
5690
|
strategy: s
|
|
5658
|
-
} =
|
|
5691
|
+
} = l;
|
|
5659
5692
|
const o = [...e === "clippingAncestors" ? wt(t) ? [] : Pi(t, this._c) : [].concat(e), i], n = o[0], h = o.reduce((c, d) => {
|
|
5660
5693
|
const f = Gt(t, d, s);
|
|
5661
5694
|
return c.top = U(f.top, c.top), c.right = rt(f.right, c.right), c.bottom = rt(f.bottom, c.bottom), c.left = U(f.left, c.left), c;
|
|
@@ -5667,18 +5700,18 @@ function zi(a) {
|
|
|
5667
5700
|
y: h.top
|
|
5668
5701
|
};
|
|
5669
5702
|
}
|
|
5670
|
-
function $i(
|
|
5703
|
+
function $i(l) {
|
|
5671
5704
|
const {
|
|
5672
5705
|
width: t,
|
|
5673
5706
|
height: e
|
|
5674
|
-
} = fe(
|
|
5707
|
+
} = fe(l);
|
|
5675
5708
|
return {
|
|
5676
5709
|
width: t,
|
|
5677
5710
|
height: e
|
|
5678
5711
|
};
|
|
5679
5712
|
}
|
|
5680
|
-
function qi(
|
|
5681
|
-
const i = K(t), s = V(t), r = e === "fixed", o = ot(
|
|
5713
|
+
function qi(l, t, e) {
|
|
5714
|
+
const i = K(t), s = V(t), r = e === "fixed", o = ot(l, !0, r, t);
|
|
5682
5715
|
let n = {
|
|
5683
5716
|
scrollLeft: 0,
|
|
5684
5717
|
scrollTop: 0
|
|
@@ -5695,47 +5728,47 @@ function qi(a, t, e) {
|
|
|
5695
5728
|
d = g.top + n.scrollTop, c = g.left + n.scrollLeft - // RTL <body> scrollbar.
|
|
5696
5729
|
Tt(s, g);
|
|
5697
5730
|
}
|
|
5698
|
-
const f = o.left + n.scrollLeft - h.x - c,
|
|
5731
|
+
const f = o.left + n.scrollLeft - h.x - c, x = o.top + n.scrollTop - h.y - d;
|
|
5699
5732
|
return {
|
|
5700
5733
|
x: f,
|
|
5701
|
-
y:
|
|
5734
|
+
y: x,
|
|
5702
5735
|
width: o.width,
|
|
5703
5736
|
height: o.height
|
|
5704
5737
|
};
|
|
5705
5738
|
}
|
|
5706
|
-
function yt(
|
|
5707
|
-
return F(
|
|
5739
|
+
function yt(l) {
|
|
5740
|
+
return F(l).position === "static";
|
|
5708
5741
|
}
|
|
5709
|
-
function jt(
|
|
5710
|
-
if (!K(
|
|
5742
|
+
function jt(l, t) {
|
|
5743
|
+
if (!K(l) || F(l).position === "fixed")
|
|
5711
5744
|
return null;
|
|
5712
5745
|
if (t)
|
|
5713
|
-
return t(
|
|
5714
|
-
let e =
|
|
5715
|
-
return V(
|
|
5746
|
+
return t(l);
|
|
5747
|
+
let e = l.offsetParent;
|
|
5748
|
+
return V(l) === e && (e = e.ownerDocument.body), e;
|
|
5716
5749
|
}
|
|
5717
|
-
function we(
|
|
5718
|
-
const e = X(
|
|
5719
|
-
if (wt(
|
|
5750
|
+
function we(l, t) {
|
|
5751
|
+
const e = X(l);
|
|
5752
|
+
if (wt(l))
|
|
5720
5753
|
return e;
|
|
5721
|
-
if (!K(
|
|
5722
|
-
let s = $(
|
|
5754
|
+
if (!K(l)) {
|
|
5755
|
+
let s = $(l);
|
|
5723
5756
|
for (; s && !Q(s); ) {
|
|
5724
|
-
if (
|
|
5757
|
+
if (B(s) && !yt(s))
|
|
5725
5758
|
return s;
|
|
5726
5759
|
s = $(s);
|
|
5727
5760
|
}
|
|
5728
5761
|
return e;
|
|
5729
5762
|
}
|
|
5730
|
-
let i = jt(
|
|
5763
|
+
let i = jt(l, t);
|
|
5731
5764
|
for (; i && Xi(i) && yt(i); )
|
|
5732
5765
|
i = jt(i, t);
|
|
5733
|
-
return i && Q(i) && yt(i) && !Dt(i) ? e : i ||
|
|
5766
|
+
return i && Q(i) && yt(i) && !Dt(i) ? e : i || Bi(l) || e;
|
|
5734
5767
|
}
|
|
5735
|
-
const Gi = async function(
|
|
5736
|
-
const t = this.getOffsetParent || we, e = this.getDimensions, i = await e(
|
|
5768
|
+
const Gi = async function(l) {
|
|
5769
|
+
const t = this.getOffsetParent || we, e = this.getDimensions, i = await e(l.floating);
|
|
5737
5770
|
return {
|
|
5738
|
-
reference: qi(
|
|
5771
|
+
reference: qi(l.reference, await t(l.floating), l.strategy),
|
|
5739
5772
|
floating: {
|
|
5740
5773
|
x: 0,
|
|
5741
5774
|
y: 0,
|
|
@@ -5744,8 +5777,8 @@ const Gi = async function(a) {
|
|
|
5744
5777
|
}
|
|
5745
5778
|
};
|
|
5746
5779
|
};
|
|
5747
|
-
function ji(
|
|
5748
|
-
return F(
|
|
5780
|
+
function ji(l) {
|
|
5781
|
+
return F(l).direction === "rtl";
|
|
5749
5782
|
}
|
|
5750
5783
|
const Ui = {
|
|
5751
5784
|
convertOffsetParentRelativeRectToViewportRelativeRect: ki,
|
|
@@ -5756,9 +5789,9 @@ const Ui = {
|
|
|
5756
5789
|
getClientRects: Ki,
|
|
5757
5790
|
getDimensions: $i,
|
|
5758
5791
|
getScale: Z,
|
|
5759
|
-
isElement:
|
|
5792
|
+
isElement: B,
|
|
5760
5793
|
isRTL: ji
|
|
5761
|
-
}, pe = Hi, me = Di, ye = Ai, Zi = Ti, Ee = (
|
|
5794
|
+
}, pe = Hi, me = Di, ye = Ai, Zi = Ti, Ee = (l, t, e) => {
|
|
5762
5795
|
const i = /* @__PURE__ */ new Map(), s = {
|
|
5763
5796
|
platform: Ui,
|
|
5764
5797
|
...e
|
|
@@ -5766,18 +5799,18 @@ const Ui = {
|
|
|
5766
5799
|
...s.platform,
|
|
5767
5800
|
_c: i
|
|
5768
5801
|
};
|
|
5769
|
-
return Si(
|
|
5802
|
+
return Si(l, t, {
|
|
5770
5803
|
...s,
|
|
5771
5804
|
platform: r
|
|
5772
5805
|
});
|
|
5773
5806
|
};
|
|
5774
5807
|
let Ji = class {
|
|
5775
5808
|
constructor(t) {
|
|
5776
|
-
|
|
5777
|
-
|
|
5778
|
-
|
|
5779
|
-
|
|
5780
|
-
|
|
5809
|
+
a(this, "ctx");
|
|
5810
|
+
a(this, "enable", !1);
|
|
5811
|
+
a(this, "contentEl");
|
|
5812
|
+
a(this, "floatingEl");
|
|
5813
|
+
a(this, "arrowEl");
|
|
5781
5814
|
this.ctx = t;
|
|
5782
5815
|
const { TOOLTIP_BG_COLOR: e, TOOLTIP_TEXT_COLOR: i, TOOLTIP_ZINDEX: s, TOOLTIP_CUSTOM_STYLE: r, CSS_PREFIX: o } = this.ctx.config;
|
|
5783
5816
|
this.contentEl = document.createElement("div"), this.arrowEl = document.createElement("div"), this.floatingEl = document.createElement("div"), this.floatingEl.className = `${o}-tooltip`, this.contentEl.className = `${o}-tooltip-content`, this.arrowEl.className = `${o}-tooltip-arrow`;
|
|
@@ -5850,26 +5883,26 @@ let Ji = class {
|
|
|
5850
5883
|
top: `${c}px`,
|
|
5851
5884
|
left: `${h}px`
|
|
5852
5885
|
}), f.arrow) {
|
|
5853
|
-
const
|
|
5886
|
+
const x = f.arrow;
|
|
5854
5887
|
["left", "left-start", "left-end"].includes(d) ? Object.assign(this.arrowEl.style, {
|
|
5855
|
-
top: `${
|
|
5888
|
+
top: `${x.y}px`,
|
|
5856
5889
|
bottom: "",
|
|
5857
5890
|
left: "",
|
|
5858
5891
|
right: "-5px"
|
|
5859
5892
|
}) : ["right", "right-start", "right-end"].includes(d) ? Object.assign(this.arrowEl.style, {
|
|
5860
|
-
top: `${
|
|
5893
|
+
top: `${x.y}px`,
|
|
5861
5894
|
bottom: "",
|
|
5862
5895
|
left: "-5px",
|
|
5863
5896
|
right: ""
|
|
5864
5897
|
}) : ["bottom", "bottom-start", "bottom-end"].includes(d) ? Object.assign(this.arrowEl.style, {
|
|
5865
5898
|
top: "-5px",
|
|
5866
5899
|
bottom: "",
|
|
5867
|
-
left: `${
|
|
5900
|
+
left: `${x.x}px`,
|
|
5868
5901
|
right: ""
|
|
5869
5902
|
}) : ["top", "top-start", "top-end"].includes(d) && Object.assign(this.arrowEl.style, {
|
|
5870
5903
|
top: "",
|
|
5871
5904
|
bottom: "-5px",
|
|
5872
|
-
left: `${
|
|
5905
|
+
left: `${x.x}px`,
|
|
5873
5906
|
right: ""
|
|
5874
5907
|
});
|
|
5875
5908
|
}
|
|
@@ -5884,15 +5917,15 @@ let Ji = class {
|
|
|
5884
5917
|
};
|
|
5885
5918
|
class Qi {
|
|
5886
5919
|
constructor(t) {
|
|
5887
|
-
|
|
5888
|
-
|
|
5889
|
-
|
|
5890
|
-
|
|
5891
|
-
|
|
5892
|
-
|
|
5893
|
-
|
|
5894
|
-
|
|
5895
|
-
|
|
5920
|
+
a(this, "editorEl");
|
|
5921
|
+
a(this, "inputEl");
|
|
5922
|
+
a(this, "enable", !1);
|
|
5923
|
+
a(this, "cellTarget", null);
|
|
5924
|
+
a(this, "selectorArrStr", "");
|
|
5925
|
+
a(this, "ctx");
|
|
5926
|
+
a(this, "drawY", 0);
|
|
5927
|
+
a(this, "drawX", 0);
|
|
5928
|
+
a(this, "cancel", !1);
|
|
5896
5929
|
this.ctx = t, this.initTextEditor(), this.init();
|
|
5897
5930
|
}
|
|
5898
5931
|
init() {
|
|
@@ -6033,8 +6066,8 @@ class Qi {
|
|
|
6033
6066
|
let f = this.ctx.body.visibleHeight;
|
|
6034
6067
|
if (r > f && (r = f), this.editorEl.style.display = "inline-block", this.editorEl.style.left = `${this.drawX - 1}px`, this.editorEl.style.top = `${this.drawY - 1}px`, this.editorEl.style.bottom = "auto", this.editorEl.style.maxHeight = `${f}px`, s === "text") {
|
|
6035
6068
|
this.inputEl.style.display = "block", this.inputEl.style.minWidth = `${o - 1}px`, this.inputEl.style.minHeight = `${r - 1}px`, this.inputEl.style.maxHeight = `${f}px`, this.inputEl.style.width = `${o - 1}px`, this.inputEl.style.height = "auto", this.inputEl.style.padding = `${c}px`, i !== null && (this.inputEl.value = i), this.inputEl.focus({ preventScroll: !0 });
|
|
6036
|
-
const
|
|
6037
|
-
this.inputEl.setSelectionRange(
|
|
6069
|
+
const x = this.inputEl.value.length;
|
|
6070
|
+
this.inputEl.setSelectionRange(x, x);
|
|
6038
6071
|
} else
|
|
6039
6072
|
this.inputEl.style.display = "none";
|
|
6040
6073
|
(this.inputEl.scrollHeight > r || this.drawY < d.height) && this.autoSize();
|
|
@@ -6086,8 +6119,8 @@ class Qi {
|
|
|
6086
6119
|
}
|
|
6087
6120
|
class ts {
|
|
6088
6121
|
constructor(t) {
|
|
6089
|
-
|
|
6090
|
-
|
|
6122
|
+
a(this, "ctx");
|
|
6123
|
+
a(this, "emptyEl");
|
|
6091
6124
|
this.ctx = t;
|
|
6092
6125
|
const { EMPTY_TEXT: e, EMPTY_CUSTOM_STYLE: i } = this.ctx.config;
|
|
6093
6126
|
this.ctx.emptyElement ? this.emptyEl = this.ctx.emptyElement : (this.emptyEl = document.createElement("div"), this.emptyEl.innerText = e), this.emptyEl.className = "e-virt-table-empty", this.emptyEl.style.display = "none", this.ctx.containerElement.appendChild(this.emptyEl), this.ctx.on("emptyChange", ({ type: s, headerHeight: r, bodyHeight: o, footerHeight: n }) => {
|
|
@@ -6110,7 +6143,7 @@ class ts {
|
|
|
6110
6143
|
}
|
|
6111
6144
|
class es {
|
|
6112
6145
|
constructor(t) {
|
|
6113
|
-
|
|
6146
|
+
a(this, "ctx");
|
|
6114
6147
|
this.ctx = t;
|
|
6115
6148
|
}
|
|
6116
6149
|
draw() {
|
|
@@ -6141,7 +6174,7 @@ class es {
|
|
|
6141
6174
|
n.forEach((w) => {
|
|
6142
6175
|
w.render && (w.fixed === "left" ? c.push(w) : w.fixed === "right" ? d.push(w) : h.push(w));
|
|
6143
6176
|
});
|
|
6144
|
-
const f = e - i,
|
|
6177
|
+
const f = e - i, x = {
|
|
6145
6178
|
key: "left",
|
|
6146
6179
|
style: {
|
|
6147
6180
|
position: "absolute",
|
|
@@ -6163,7 +6196,7 @@ class es {
|
|
|
6163
6196
|
height: `${o}px`
|
|
6164
6197
|
},
|
|
6165
6198
|
cells: h
|
|
6166
|
-
},
|
|
6199
|
+
}, p = {
|
|
6167
6200
|
key: "right",
|
|
6168
6201
|
style: {
|
|
6169
6202
|
position: "absolute",
|
|
@@ -6184,22 +6217,22 @@ class es {
|
|
|
6184
6217
|
width: `${r}px`,
|
|
6185
6218
|
height: `${o}px`
|
|
6186
6219
|
},
|
|
6187
|
-
views: [
|
|
6220
|
+
views: [x, g, p]
|
|
6188
6221
|
};
|
|
6189
6222
|
}
|
|
6190
6223
|
getBody() {
|
|
6191
6224
|
const t = [], e = [], i = [];
|
|
6192
6225
|
let s = this.ctx.body.renderRows;
|
|
6193
6226
|
this.ctx.config.FOOTER_FIXED || (s = s.concat(this.ctx.footer.renderRows)), s.forEach((w) => {
|
|
6194
|
-
w.cells.forEach((
|
|
6195
|
-
|
|
6227
|
+
w.cells.forEach((m) => {
|
|
6228
|
+
m.cellType === "footer" && (m.render = m.renderFooter), m.render && (m.fixed === "left" ? e.push(m) : m.fixed === "right" ? i.push(m) : t.push(m));
|
|
6196
6229
|
});
|
|
6197
6230
|
});
|
|
6198
6231
|
const {
|
|
6199
6232
|
fixedLeftWidth: r,
|
|
6200
6233
|
fixedRightWidth: o,
|
|
6201
6234
|
config: { SCROLLER_TRACK_SIZE: n, CSS_PREFIX: h }
|
|
6202
|
-
} = this.ctx, { visibleWidth: c, visibleHeight: d } = this.ctx.body, f = o - n,
|
|
6235
|
+
} = this.ctx, { visibleWidth: c, visibleHeight: d } = this.ctx.body, f = o - n, x = {
|
|
6203
6236
|
key: "left",
|
|
6204
6237
|
style: {
|
|
6205
6238
|
position: "absolute",
|
|
@@ -6221,7 +6254,7 @@ class es {
|
|
|
6221
6254
|
height: `${d}px`
|
|
6222
6255
|
},
|
|
6223
6256
|
cells: t
|
|
6224
|
-
},
|
|
6257
|
+
}, p = {
|
|
6225
6258
|
key: "right",
|
|
6226
6259
|
style: {
|
|
6227
6260
|
position: "absolute",
|
|
@@ -6242,13 +6275,13 @@ class es {
|
|
|
6242
6275
|
width: `${c}px`,
|
|
6243
6276
|
height: `${d}px`
|
|
6244
6277
|
},
|
|
6245
|
-
views: [
|
|
6278
|
+
views: [x, g, p]
|
|
6246
6279
|
};
|
|
6247
6280
|
}
|
|
6248
6281
|
getFooter() {
|
|
6249
6282
|
const t = [], e = [], i = [];
|
|
6250
|
-
this.ctx.footer.renderRows.forEach((
|
|
6251
|
-
|
|
6283
|
+
this.ctx.footer.renderRows.forEach((u) => {
|
|
6284
|
+
u.cells.forEach((w) => {
|
|
6252
6285
|
w.cellType === "footer" && w.renderFooter && (w.render = w.renderFooter, w.fixed === "left" ? e.push(w) : w.fixed === "right" ? i.push(w) : t.push(w));
|
|
6253
6286
|
});
|
|
6254
6287
|
});
|
|
@@ -6267,7 +6300,7 @@ class es {
|
|
|
6267
6300
|
height: `${c}px`
|
|
6268
6301
|
},
|
|
6269
6302
|
cells: e
|
|
6270
|
-
},
|
|
6303
|
+
}, x = {
|
|
6271
6304
|
key: "center",
|
|
6272
6305
|
style: {
|
|
6273
6306
|
position: "absolute",
|
|
@@ -6299,15 +6332,15 @@ class es {
|
|
|
6299
6332
|
width: `${h}px`,
|
|
6300
6333
|
height: `${c}px`
|
|
6301
6334
|
},
|
|
6302
|
-
views: [f,
|
|
6335
|
+
views: [f, x, g]
|
|
6303
6336
|
};
|
|
6304
6337
|
}
|
|
6305
6338
|
}
|
|
6306
6339
|
class is {
|
|
6307
6340
|
constructor(t) {
|
|
6308
|
-
|
|
6309
|
-
|
|
6310
|
-
|
|
6341
|
+
a(this, "ctx");
|
|
6342
|
+
a(this, "contextMenuEl");
|
|
6343
|
+
a(this, "custom", !1);
|
|
6311
6344
|
this.ctx = t, this.ctx.contextMenuElement ? (this.custom = !0, this.contextMenuEl = this.ctx.contextMenuElement) : (this.custom = !1, this.contextMenuEl = document.createElement("div")), this.createContextMenu(), this.init();
|
|
6312
6345
|
}
|
|
6313
6346
|
init() {
|
|
@@ -6316,7 +6349,7 @@ class is {
|
|
|
6316
6349
|
e.preventDefault();
|
|
6317
6350
|
const { xArr: i, yArr: s } = this.ctx.selector, [r, o] = i, [n, h] = s, { rowIndex: c, colIndex: d } = t;
|
|
6318
6351
|
c >= n && c <= h && d >= r && d <= o || this.ctx.emit("setSelectorCell", t, e);
|
|
6319
|
-
const
|
|
6352
|
+
const x = {
|
|
6320
6353
|
getBoundingClientRect: () => ({
|
|
6321
6354
|
width: 0,
|
|
6322
6355
|
height: 0,
|
|
@@ -6329,17 +6362,19 @@ class is {
|
|
|
6329
6362
|
}),
|
|
6330
6363
|
contextElement: document.body
|
|
6331
6364
|
};
|
|
6332
|
-
Ee(
|
|
6365
|
+
Ee(x, this.contextMenuEl, {
|
|
6333
6366
|
placement: "right-start",
|
|
6334
6367
|
middleware: [pe(), me(), ye()]
|
|
6335
|
-
}).then(({ x: g, y:
|
|
6336
|
-
this.show(g,
|
|
6368
|
+
}).then(({ x: g, y: p }) => {
|
|
6369
|
+
this.show(g, p);
|
|
6337
6370
|
});
|
|
6338
6371
|
}), this.ctx.on("click", this.hide.bind(this)), this.ctx.on("onScroll", this.hide.bind(this)), this.ctx.on("resize", this.hide.bind(this));
|
|
6339
6372
|
}
|
|
6340
6373
|
//创建右键菜单,绑定子项点击事件
|
|
6341
6374
|
createContextMenu() {
|
|
6342
|
-
if (this.contextMenuEl.className = "e-virt-table-context-menu", this.
|
|
6375
|
+
if (this.contextMenuEl.className = "e-virt-table-context-menu", this.contextMenuEl.addEventListener("contextmenu", function(e) {
|
|
6376
|
+
e.preventDefault();
|
|
6377
|
+
}), this.ctx.containerElement.appendChild(this.contextMenuEl), this.custom) return;
|
|
6343
6378
|
const { CONTEXT_MENU: t } = this.ctx.config;
|
|
6344
6379
|
this.createContextMenuItems(t, (e) => {
|
|
6345
6380
|
switch (e.value) {
|
|
@@ -6389,19 +6424,19 @@ class is {
|
|
|
6389
6424
|
}
|
|
6390
6425
|
class os {
|
|
6391
6426
|
constructor(t, e) {
|
|
6392
|
-
|
|
6393
|
-
|
|
6394
|
-
|
|
6395
|
-
|
|
6396
|
-
|
|
6397
|
-
|
|
6398
|
-
|
|
6399
|
-
|
|
6400
|
-
|
|
6401
|
-
|
|
6402
|
-
|
|
6403
|
-
|
|
6404
|
-
|
|
6427
|
+
a(this, "options");
|
|
6428
|
+
a(this, "scroller");
|
|
6429
|
+
a(this, "header");
|
|
6430
|
+
a(this, "body");
|
|
6431
|
+
a(this, "footer");
|
|
6432
|
+
a(this, "selector");
|
|
6433
|
+
a(this, "autofill");
|
|
6434
|
+
a(this, "tooltip");
|
|
6435
|
+
a(this, "editor");
|
|
6436
|
+
a(this, "empty");
|
|
6437
|
+
a(this, "overlayer");
|
|
6438
|
+
a(this, "contextMenu");
|
|
6439
|
+
a(this, "ctx");
|
|
6405
6440
|
this.options = e;
|
|
6406
6441
|
const { overlayerElement: i, editorElement: s, emptyElement: r, contextMenuElement: o } = e, n = this.createContainer(
|
|
6407
6442
|
t,
|
|
@@ -6489,6 +6524,21 @@ class os {
|
|
|
6489
6524
|
getChangedRows() {
|
|
6490
6525
|
return this.ctx.database.getChangedRows();
|
|
6491
6526
|
}
|
|
6527
|
+
setCurrentRowByRowIndex(t) {
|
|
6528
|
+
this.ctx.currentCell = this.ctx.database.getVirtualBodyCell(t, 0), this.ctx.emit("draw");
|
|
6529
|
+
}
|
|
6530
|
+
setCurrentRow(t) {
|
|
6531
|
+
const e = this.ctx.database.getColumnByColIndex(0);
|
|
6532
|
+
e && (this.ctx.currentCell = this.ctx.database.getVirtualBodyCellByKey(t, e.key), this.ctx.emit("draw"));
|
|
6533
|
+
}
|
|
6534
|
+
getCurrentRow() {
|
|
6535
|
+
const t = this.ctx.currentCell;
|
|
6536
|
+
return t ? {
|
|
6537
|
+
row: t.row,
|
|
6538
|
+
rowIndex: t.rowIndex,
|
|
6539
|
+
rowKey: t.rowKey
|
|
6540
|
+
} : void 0;
|
|
6541
|
+
}
|
|
6492
6542
|
clearValidate() {
|
|
6493
6543
|
this.ctx.database.clearValidate(), this.ctx.emit("draw");
|
|
6494
6544
|
}
|
|
@@ -6580,6 +6630,9 @@ class os {
|
|
|
6580
6630
|
setExpandRowKeys(t, e = !0) {
|
|
6581
6631
|
this.ctx.database.setExpandRowKeys(t, e);
|
|
6582
6632
|
}
|
|
6633
|
+
getExpandRowKeys() {
|
|
6634
|
+
return this.ctx.database.getExpandRowKeys();
|
|
6635
|
+
}
|
|
6583
6636
|
clearSelection() {
|
|
6584
6637
|
this.ctx.database.clearSelection(), this.ctx.emit("draw");
|
|
6585
6638
|
}
|