e-virt-table 1.2.13 → 1.2.14
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 +648 -636
- 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/Context.d.ts +1 -0
- package/dist/lib/Context.js +6 -0
- package/dist/lib/Context.js.map +1 -1
- package/dist/lib/Editor.js +2 -2
- package/dist/lib/Editor.js.map +1 -1
- package/dist/lib/EventBrowser.d.ts +2 -0
- package/dist/lib/EventBrowser.js +16 -0
- package/dist/lib/EventBrowser.js.map +1 -1
- package/dist/lib/Selector.js +14 -2
- package/dist/lib/Selector.js.map +1 -1
- 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 a = (
|
|
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,18 +35,18 @@ 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);
|
|
42
|
-
var
|
|
42
|
+
var h = Function.bind.apply(s, n), c = new h();
|
|
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(h) {
|
|
|
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(h) {
|
|
|
114
114
|
});
|
|
115
115
|
return o;
|
|
116
116
|
}
|
|
117
|
-
return
|
|
117
|
+
return l;
|
|
118
118
|
}
|
|
119
|
-
function
|
|
120
|
-
return
|
|
119
|
+
function Se(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 || Se(t) && typeof l == "string" && !l);
|
|
124
124
|
}
|
|
125
|
-
function
|
|
126
|
-
var i = [], s = 0, r =
|
|
125
|
+
function Le(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 Bt(
|
|
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
162
|
var r = new Promise(function(x, g) {
|
|
163
163
|
var p = function(m) {
|
|
164
164
|
return i(m), m.length ? g(new Ft(m, bt(m))) : x(s);
|
|
165
|
-
}, u = Te(
|
|
165
|
+
}, u = Te(l);
|
|
166
166
|
Bt(u, e, p);
|
|
167
167
|
});
|
|
168
168
|
return r.catch(function(x) {
|
|
169
169
|
return x;
|
|
170
170
|
}), r;
|
|
171
171
|
}
|
|
172
|
-
var o = t.firstFields === !0 ? Object.keys(
|
|
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
173
|
var p = function(w) {
|
|
174
|
-
if (d.push.apply(d, w), c++, c ===
|
|
174
|
+
if (d.push.apply(d, w), c++, c === h)
|
|
175
175
|
return i(d), d.length ? g(new Ft(d, bt(d))) : x(s);
|
|
176
176
|
};
|
|
177
177
|
n.length || (i(d), x(s)), n.forEach(function(u) {
|
|
178
|
-
var w =
|
|
179
|
-
o.indexOf(u) !== -1 ? Bt(w, e, p) :
|
|
178
|
+
var w = l[u];
|
|
179
|
+
o.indexOf(u) !== -1 ? Bt(w, e, p) : Le(w, e, p);
|
|
180
180
|
});
|
|
181
181
|
});
|
|
182
182
|
return f.catch(function(x) {
|
|
183
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 Nt(
|
|
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 b && b.includeBoundaries ? "(?:(?<=\\s|^)(?=" +
|
|
224
|
+
var l = "[a-fA-F\\d:]", t = function(b) {
|
|
225
|
+
return b && b.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,15 +234,15 @@ 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 + "$"),
|
|
237
|
+
`).replace(/\s*\/\/.*$/gm, "").replace(/\n/g, "").trim(), r = new RegExp("(?:^" + e + "$)|(?:^" + s + "$)"), o = new RegExp("^" + e + "$"), n = new RegExp("^" + s + "$"), h = function(b) {
|
|
238
238
|
return b && b.exact ? r : new RegExp("(?:" + t(b) + e + t(b) + ")|(?:" + t(b) + s + t(b) + ")", "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 =
|
|
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"]*)?', C = "(?:" + c + "|www\\.)" + d + "(?:localhost|" + f + "|" + x + "|" + g + p + u + ")" + w + m;
|
|
246
246
|
return ct = new RegExp("(?:^" + C + "$)", "i"), ct;
|
|
247
247
|
}, Kt = {
|
|
248
248
|
// http://emailregex.com/
|
|
@@ -300,10 +300,10 @@ 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",
|
|
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
304
|
if (x ? f = "number" : g ? f = "string" : p && (f = "array"), !f)
|
|
305
305
|
return !1;
|
|
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 && !
|
|
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
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) {
|
|
@@ -315,7 +315,7 @@ var Zt = function(t, e, i, s, r, o) {
|
|
|
315
315
|
o.test(e) || s.push(D(r.messages.pattern.mismatch, t.fullField, e, t.pattern));
|
|
316
316
|
}
|
|
317
317
|
}
|
|
318
|
-
},
|
|
318
|
+
}, S = {
|
|
319
319
|
required: Zt,
|
|
320
320
|
whitespace: De,
|
|
321
321
|
type: Be,
|
|
@@ -327,7 +327,7 @@ var Zt = function(t, e, i, s, r, o) {
|
|
|
327
327
|
if (n) {
|
|
328
328
|
if (H(e, "string") && !t.required)
|
|
329
329
|
return i();
|
|
330
|
-
|
|
330
|
+
S.required(t, e, s, o, r, "string"), H(e, "string") || (S.type(t, e, s, o, r), S.range(t, e, s, o, r), S.pattern(t, e, s, o, r), t.whitespace === !0 && S.whitespace(t, e, s, o, r));
|
|
331
331
|
}
|
|
332
332
|
i(o);
|
|
333
333
|
}, Ye = function(t, e, i, s, r) {
|
|
@@ -335,7 +335,7 @@ var Zt = function(t, e, i, s, r, o) {
|
|
|
335
335
|
if (n) {
|
|
336
336
|
if (H(e) && !t.required)
|
|
337
337
|
return i();
|
|
338
|
-
|
|
338
|
+
S.required(t, e, s, o, r), e !== void 0 && S.type(t, e, s, o, r);
|
|
339
339
|
}
|
|
340
340
|
i(o);
|
|
341
341
|
}, Ve = function(t, e, i, s, r) {
|
|
@@ -343,7 +343,7 @@ var Zt = function(t, e, i, s, r, o) {
|
|
|
343
343
|
if (n) {
|
|
344
344
|
if (e === "" && (e = void 0), H(e) && !t.required)
|
|
345
345
|
return i();
|
|
346
|
-
|
|
346
|
+
S.required(t, e, s, o, r), e !== void 0 && (S.type(t, e, s, o, r), S.range(t, e, s, o, r));
|
|
347
347
|
}
|
|
348
348
|
i(o);
|
|
349
349
|
}, We = function(t, e, i, s, r) {
|
|
@@ -351,7 +351,7 @@ var Zt = function(t, e, i, s, r, o) {
|
|
|
351
351
|
if (n) {
|
|
352
352
|
if (H(e) && !t.required)
|
|
353
353
|
return i();
|
|
354
|
-
|
|
354
|
+
S.required(t, e, s, o, r), e !== void 0 && S.type(t, e, s, o, r);
|
|
355
355
|
}
|
|
356
356
|
i(o);
|
|
357
357
|
}, Pe = function(t, e, i, s, r) {
|
|
@@ -359,7 +359,7 @@ var Zt = function(t, e, i, s, r, o) {
|
|
|
359
359
|
if (n) {
|
|
360
360
|
if (H(e) && !t.required)
|
|
361
361
|
return i();
|
|
362
|
-
|
|
362
|
+
S.required(t, e, s, o, r), H(e) || S.type(t, e, s, o, r);
|
|
363
363
|
}
|
|
364
364
|
i(o);
|
|
365
365
|
}, ze = function(t, e, i, s, r) {
|
|
@@ -367,7 +367,7 @@ var Zt = function(t, e, i, s, r, o) {
|
|
|
367
367
|
if (n) {
|
|
368
368
|
if (H(e) && !t.required)
|
|
369
369
|
return i();
|
|
370
|
-
|
|
370
|
+
S.required(t, e, s, o, r), e !== void 0 && (S.type(t, e, s, o, r), S.range(t, e, s, o, r));
|
|
371
371
|
}
|
|
372
372
|
i(o);
|
|
373
373
|
}, $e = function(t, e, i, s, r) {
|
|
@@ -375,7 +375,7 @@ var Zt = function(t, e, i, s, r, o) {
|
|
|
375
375
|
if (n) {
|
|
376
376
|
if (H(e) && !t.required)
|
|
377
377
|
return i();
|
|
378
|
-
|
|
378
|
+
S.required(t, e, s, o, r), e !== void 0 && (S.type(t, e, s, o, r), S.range(t, e, s, o, r));
|
|
379
379
|
}
|
|
380
380
|
i(o);
|
|
381
381
|
}, qe = function(t, e, i, s, r) {
|
|
@@ -383,7 +383,7 @@ var Zt = function(t, e, i, s, r, o) {
|
|
|
383
383
|
if (n) {
|
|
384
384
|
if (e == null && !t.required)
|
|
385
385
|
return i();
|
|
386
|
-
|
|
386
|
+
S.required(t, e, s, o, r, "array"), e != null && (S.type(t, e, s, o, r), S.range(t, e, s, o, r));
|
|
387
387
|
}
|
|
388
388
|
i(o);
|
|
389
389
|
}, Ge = function(t, e, i, s, r) {
|
|
@@ -391,7 +391,7 @@ var Zt = function(t, e, i, s, r, o) {
|
|
|
391
391
|
if (n) {
|
|
392
392
|
if (H(e) && !t.required)
|
|
393
393
|
return i();
|
|
394
|
-
|
|
394
|
+
S.required(t, e, s, o, r), e !== void 0 && S.type(t, e, s, o, r);
|
|
395
395
|
}
|
|
396
396
|
i(o);
|
|
397
397
|
}, je = "enum", Ue = function(t, e, i, s, r) {
|
|
@@ -399,7 +399,7 @@ var Zt = function(t, e, i, s, r, o) {
|
|
|
399
399
|
if (n) {
|
|
400
400
|
if (H(e) && !t.required)
|
|
401
401
|
return i();
|
|
402
|
-
|
|
402
|
+
S.required(t, e, s, o, r), e !== void 0 && S[je](t, e, s, o, r);
|
|
403
403
|
}
|
|
404
404
|
i(o);
|
|
405
405
|
}, Ze = function(t, e, i, s, r) {
|
|
@@ -407,7 +407,7 @@ var Zt = function(t, e, i, s, r, o) {
|
|
|
407
407
|
if (n) {
|
|
408
408
|
if (H(e, "string") && !t.required)
|
|
409
409
|
return i();
|
|
410
|
-
|
|
410
|
+
S.required(t, e, s, o, r), H(e, "string") || S.pattern(t, e, s, o, r);
|
|
411
411
|
}
|
|
412
412
|
i(o);
|
|
413
413
|
}, Je = function(t, e, i, s, r) {
|
|
@@ -415,21 +415,21 @@ var Zt = function(t, e, i, s, r, o) {
|
|
|
415
415
|
if (n) {
|
|
416
416
|
if (H(e, "date") && !t.required)
|
|
417
417
|
return i();
|
|
418
|
-
if (
|
|
419
|
-
var
|
|
420
|
-
e instanceof Date ?
|
|
418
|
+
if (S.required(t, e, s, o, r), !H(e, "date")) {
|
|
419
|
+
var h;
|
|
420
|
+
e instanceof Date ? h = e : h = new Date(e), S.type(t, h, s, o, r), h && S.range(t, h.getTime(), s, o, r);
|
|
421
421
|
}
|
|
422
422
|
}
|
|
423
423
|
i(o);
|
|
424
424
|
}, Qe = function(t, e, i, s, r) {
|
|
425
425
|
var o = [], n = Array.isArray(e) ? "array" : typeof e;
|
|
426
|
-
|
|
426
|
+
S.required(t, e, s, o, r, n), i(o);
|
|
427
427
|
}, mt = function(t, e, i, s, r) {
|
|
428
|
-
var o = t.type, n = [],
|
|
429
|
-
if (
|
|
428
|
+
var o = t.type, n = [], h = t.required || !t.required && s.hasOwnProperty(t.field);
|
|
429
|
+
if (h) {
|
|
430
430
|
if (H(e, o) && !t.required)
|
|
431
431
|
return i();
|
|
432
|
-
|
|
432
|
+
S.required(t, e, s, n, r, o), H(e, o) || S.type(t, e, s, n, r);
|
|
433
433
|
}
|
|
434
434
|
i(n);
|
|
435
435
|
}, ti = function(t, e, i, s, r) {
|
|
@@ -437,7 +437,7 @@ var Zt = function(t, e, i, s, r, o) {
|
|
|
437
437
|
if (n) {
|
|
438
438
|
if (H(e) && !t.required)
|
|
439
439
|
return i();
|
|
440
|
-
|
|
440
|
+
S.required(t, e, s, o, r);
|
|
441
441
|
}
|
|
442
442
|
i(o);
|
|
443
443
|
}, it = {
|
|
@@ -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)
|
|
@@ -533,8 +533,8 @@ var Rt = vt(), nt = /* @__PURE__ */ function() {
|
|
|
533
533
|
var o = this;
|
|
534
534
|
s === void 0 && (s = {}), r === void 0 && (r = function() {
|
|
535
535
|
});
|
|
536
|
-
var n = i,
|
|
537
|
-
if (typeof
|
|
536
|
+
var n = i, h = s, c = r;
|
|
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
539
|
function d(u) {
|
|
540
540
|
var w = [], m = {};
|
|
@@ -549,12 +549,12 @@ var Rt = vt(), nt = /* @__PURE__ */ function() {
|
|
|
549
549
|
C(u[y]);
|
|
550
550
|
w.length ? (m = bt(w), c(w, m)) : c(null, n);
|
|
551
551
|
}
|
|
552
|
-
if (
|
|
552
|
+
if (h.messages) {
|
|
553
553
|
var f = this.messages();
|
|
554
|
-
f === Rt && (f = vt()), kt(f,
|
|
554
|
+
f === Rt && (f = vt()), kt(f, h.messages), h.messages = f;
|
|
555
555
|
} else
|
|
556
|
-
|
|
557
|
-
var x = {}, g =
|
|
556
|
+
h.messages = this.messages();
|
|
557
|
+
var x = {}, g = h.keys || Object.keys(this.rules);
|
|
558
558
|
g.forEach(function(u) {
|
|
559
559
|
var w = o.rules[u], m = n[u];
|
|
560
560
|
w.forEach(function(C) {
|
|
@@ -570,7 +570,7 @@ var Rt = vt(), nt = /* @__PURE__ */ function() {
|
|
|
570
570
|
});
|
|
571
571
|
});
|
|
572
572
|
var p = {};
|
|
573
|
-
return Ae(x,
|
|
573
|
+
return Ae(x, h, function(u, w) {
|
|
574
574
|
var m = u.rule, C = (m.type === "object" || m.type === "array") && (typeof m.fields == "object" || typeof m.defaultField == "object");
|
|
575
575
|
C = C && (m.required || !m.required && u.value), m.field = u.field;
|
|
576
576
|
function y(R, O) {
|
|
@@ -582,15 +582,15 @@ var Rt = vt(), nt = /* @__PURE__ */ function() {
|
|
|
582
582
|
function b(R) {
|
|
583
583
|
R === void 0 && (R = []);
|
|
584
584
|
var O = Array.isArray(R) ? R : [R];
|
|
585
|
-
!
|
|
585
|
+
!h.suppressWarning && O.length && l.warning("async-validator:", O), O.length && m.message !== void 0 && (O = [].concat(m.message));
|
|
586
586
|
var I = O.map(Nt(m, n));
|
|
587
|
-
if (
|
|
587
|
+
if (h.first && I.length)
|
|
588
588
|
return p[m.field] = 1, w(I);
|
|
589
589
|
if (!C)
|
|
590
590
|
w(I);
|
|
591
591
|
else {
|
|
592
592
|
if (m.required && !u.value)
|
|
593
|
-
return m.message !== void 0 ? I = [].concat(m.message).map(Nt(m, n)) :
|
|
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
595
|
m.defaultField && Object.keys(u.value).map(function(T) {
|
|
596
596
|
_[T] = m.defaultField;
|
|
@@ -600,8 +600,8 @@ var Rt = vt(), nt = /* @__PURE__ */ function() {
|
|
|
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
|
|
604
|
-
|
|
603
|
+
var L = new l(v);
|
|
604
|
+
L.messages(h.messages), u.rule.options && (u.rule.options.messages = h.messages, u.rule.options.error = h.error), L.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
|
});
|
|
@@ -609,12 +609,12 @@ var Rt = vt(), nt = /* @__PURE__ */ function() {
|
|
|
609
609
|
}
|
|
610
610
|
var E;
|
|
611
611
|
if (m.asyncValidator)
|
|
612
|
-
E = m.asyncValidator(m, u.value, b, u.source,
|
|
612
|
+
E = m.asyncValidator(m, u.value, b, u.source, h);
|
|
613
613
|
else if (m.validator) {
|
|
614
614
|
try {
|
|
615
|
-
E = m.validator(m, u.value, b, u.source,
|
|
615
|
+
E = m.validator(m, u.value, b, u.source, h);
|
|
616
616
|
} catch (R) {
|
|
617
|
-
console.error == null || console.error(R),
|
|
617
|
+
console.error == null || console.error(R), h.suppressValidatorError || setTimeout(function() {
|
|
618
618
|
throw R;
|
|
619
619
|
}, 0), b(R.message);
|
|
620
620
|
}
|
|
@@ -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(h = []) {
|
|
|
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(h = [], 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
|
|
728
|
-
|
|
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
|
-
r = r.replace(/^"/, "").replace(/"$/, "").replace(/["]*/g, (
|
|
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],
|
|
758
|
-
n ===
|
|
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
|
+
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(h, 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,8 +797,8 @@ function ni(h, 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 {
|
|
@@ -848,8 +848,8 @@ class re {
|
|
|
848
848
|
}
|
|
849
849
|
}
|
|
850
850
|
class At extends re {
|
|
851
|
-
constructor(e, i, s, r, o, n,
|
|
852
|
-
super(e, r, o, n,
|
|
851
|
+
constructor(e, i, s, r, o, n, h, c, d, f = "body") {
|
|
852
|
+
super(e, r, o, n, h, f, c.fixed);
|
|
853
853
|
a(this, "formatter");
|
|
854
854
|
a(this, "formatterFooter");
|
|
855
855
|
a(this, "hoverIconName", "");
|
|
@@ -932,7 +932,7 @@ class At extends re {
|
|
|
932
932
|
rowspan: r = 1,
|
|
933
933
|
relationRowKeys: o,
|
|
934
934
|
relationColKeys: n,
|
|
935
|
-
mergeRow:
|
|
935
|
+
mergeRow: h = !1,
|
|
936
936
|
mergeCol: c = !1
|
|
937
937
|
} = i({
|
|
938
938
|
row: this.row,
|
|
@@ -946,7 +946,7 @@ class At extends re {
|
|
|
946
946
|
visibleLeafColumns: this.ctx.header.visibleLeafColumns,
|
|
947
947
|
rows: this.ctx.body.data
|
|
948
948
|
}) || {};
|
|
949
|
-
Array.isArray(o) && o.length > 0 ? this.relationRowKeys = o : this.relationRowKeys = [this.key], Array.isArray(n) && n.length > 0 ? this.relationColKeys = n : this.relationColKeys = [this.key], this.mergeCol = c, this.mergeRow =
|
|
949
|
+
Array.isArray(o) && o.length > 0 ? this.relationRowKeys = o : this.relationRowKeys = [this.key], Array.isArray(n) && n.length > 0 ? this.relationColKeys = n : this.relationColKeys = [this.key], this.mergeCol = c, this.mergeRow = h, this.colspan = s, this.rowspan = r, this.visibleWidth = this.getWidthByColIndexColSpan(this.colIndex, this.colspan), this.visibleHeight = this.ctx.database.getHeightByRowIndexRowSpan(this.rowIndex, this.rowspan);
|
|
950
950
|
}
|
|
951
951
|
}
|
|
952
952
|
updateSpanInfo() {
|
|
@@ -1019,7 +1019,7 @@ 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
|
|
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
1024
|
const u = this.ctx.icons.get("loading");
|
|
1025
1025
|
n = "loading", r = u, o = x * 8;
|
|
@@ -1044,7 +1044,7 @@ class At extends re {
|
|
|
1044
1044
|
FOOTER_CELL_STYLE_METHOD: r,
|
|
1045
1045
|
READONLY_TEXT_COLOR: o,
|
|
1046
1046
|
BODY_TEXT_COLOR: n,
|
|
1047
|
-
FOOTER_TEXT_COLOR:
|
|
1047
|
+
FOOTER_TEXT_COLOR: h,
|
|
1048
1048
|
FOOTER_BG_COLOR: c,
|
|
1049
1049
|
HIGHLIGHT_SELECTED_ROW: d,
|
|
1050
1050
|
HIGHLIGHT_SELECTED_ROW_COLOR: f,
|
|
@@ -1054,16 +1054,16 @@ class At extends re {
|
|
|
1054
1054
|
STRIPE_COLOR: u
|
|
1055
1055
|
} = this.ctx.config;
|
|
1056
1056
|
if (this.cellType === "footer") {
|
|
1057
|
-
let O = c, I =
|
|
1057
|
+
let O = c, I = h;
|
|
1058
1058
|
if (typeof r == "function") {
|
|
1059
|
-
const _ = r, { backgroundColor: v, color:
|
|
1059
|
+
const _ = r, { backgroundColor: v, color: L } = _({
|
|
1060
1060
|
row: this.row,
|
|
1061
1061
|
rowIndex: this.rowIndex,
|
|
1062
1062
|
colIndex: this.colIndex,
|
|
1063
1063
|
column: this.column,
|
|
1064
1064
|
value: this.getValue()
|
|
1065
1065
|
}) || {};
|
|
1066
|
-
v && (O = v),
|
|
1066
|
+
v && (O = v), L && (I = L);
|
|
1067
1067
|
}
|
|
1068
1068
|
this.drawCellSkyBgColor = "transparent", this.drawCellBgColor = O, this.drawTextColor = I;
|
|
1069
1069
|
return;
|
|
@@ -1091,11 +1091,11 @@ class At extends re {
|
|
|
1091
1091
|
this.drawCellBgColor = E, this.drawTextColor = R;
|
|
1092
1092
|
}
|
|
1093
1093
|
updateSelection() {
|
|
1094
|
-
const { visibleWidth: e, visibleHeight: i, rowspan: s, colspan: r, cellType: o, type: n, rowIndex:
|
|
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
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
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 ===
|
|
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() {
|
|
@@ -1114,16 +1114,16 @@ class At extends re {
|
|
|
1114
1114
|
}
|
|
1115
1115
|
const { hoverCell: n } = this.ctx;
|
|
1116
1116
|
if (this.hoverIconName && !this.ctx.editing && n) {
|
|
1117
|
-
let
|
|
1118
|
-
if (n.rowKey === this.rowKey && (
|
|
1117
|
+
let h = 0, c = 0;
|
|
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
1119
|
const f = this.getSpanInfo(), { yArr: x } = f, g = x[0], p = x[1];
|
|
1120
1120
|
if (n.rowIndex >= g && n.rowIndex <= p) {
|
|
1121
1121
|
const { width: u, height: w, offsetTop: m, offsetLeft: C } = f;
|
|
1122
|
-
|
|
1122
|
+
h = this.drawX - C + u - s - r, c = this.drawY - m + (w - s) / 2;
|
|
1123
1123
|
}
|
|
1124
1124
|
}
|
|
1125
1125
|
const d = this.ctx.icons.get(this.hoverIconName);
|
|
1126
|
-
this.drawImageX =
|
|
1126
|
+
this.drawImageX = h, this.drawImageY = c, this.drawImageWidth = s, this.drawImageHeight = s, this.drawImageName = this.hoverIconName, this.drawImageSource = d;
|
|
1127
1127
|
}
|
|
1128
1128
|
}
|
|
1129
1129
|
// 过去跨度配置
|
|
@@ -1218,8 +1218,8 @@ 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,
|
|
1222
|
-
if (d ===
|
|
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
|
+
if (d === h && f === c) {
|
|
1223
1223
|
const u = d === this.ctx.maxColIndex || f === this.ctx.maxRowIndex || d === this.ctx.lastCenterColIndex ? 6 : 4;
|
|
1224
1224
|
this.ctx.paint.drawRect(x + this.width - u, g + this.height - u, 6, 6, {
|
|
1225
1225
|
borderColor: r,
|
|
@@ -1254,8 +1254,8 @@ class At extends re {
|
|
|
1254
1254
|
const { ellipsis: o } = this.ctx.paint.handleEllipsis(this.displayText, r, e, i);
|
|
1255
1255
|
this.ellipsis = o;
|
|
1256
1256
|
const { placeholder: n } = this.column;
|
|
1257
|
-
let
|
|
1258
|
-
return !this.ctx.database.getReadonly(this.rowKey, this.key) && n && ["", null, void 0].includes(this.text) && this.cellType === "body" && !(this.rowspan === 0 || this.colspan === 0) && (
|
|
1257
|
+
let h = this.displayText, c = this.drawTextColor;
|
|
1258
|
+
return !this.ctx.database.getReadonly(this.rowKey, this.key) && n && ["", null, void 0].includes(this.text) && this.cellType === "body" && !(this.rowspan === 0 || this.colspan === 0) && (h = n, c = s), this.ctx.paint.drawText(h, this.drawTextX, this.drawTextY, r, this.visibleHeight, {
|
|
1259
1259
|
font: i,
|
|
1260
1260
|
padding: e,
|
|
1261
1261
|
align: this.align,
|
|
@@ -1317,8 +1317,8 @@ class At extends re {
|
|
|
1317
1317
|
fillColor: "transparent",
|
|
1318
1318
|
borderWidth: 1
|
|
1319
1319
|
});
|
|
1320
|
-
const [n,
|
|
1321
|
-
!(n ===
|
|
1320
|
+
const [n, h] = i, [c, d] = s;
|
|
1321
|
+
!(n === h && c === d) && this.colIndex >= n && this.colIndex <= h && this.rowIndex >= c && this.rowIndex <= d && this.ctx.paint.drawRect(this.drawX, this.drawY, this.width, this.height, {
|
|
1322
1322
|
borderColor: "transparent",
|
|
1323
1323
|
fillColor: this.ctx.config.SELECT_AREA_COLOR || "rgba(82,146,247,0.1)"
|
|
1324
1324
|
}), this.operation && this.rowIndex >= c && this.rowIndex <= d && this.ctx.paint.drawRect(this.drawX, this.drawY, this.visibleWidth, this.visibleHeight, {
|
|
@@ -1346,12 +1346,12 @@ class At extends re {
|
|
|
1346
1346
|
});
|
|
1347
1347
|
}
|
|
1348
1348
|
drawBorder(e) {
|
|
1349
|
-
const { drawX: i, drawY: s, rowIndex: r, colIndex: o, height: n, width:
|
|
1349
|
+
const { drawX: i, drawY: s, rowIndex: r, colIndex: o, height: n, width: h } = this;
|
|
1350
1350
|
let c = i, d = s;
|
|
1351
1351
|
const { xArr: f, yArr: x, lineDash: g = [], borderWidth: p = 1, borderColor: u, fillColor: w } = e, m = f[0], C = f[1], y = x[0], b = x[1];
|
|
1352
1352
|
if (o >= m && o <= C && r === y) {
|
|
1353
1353
|
const E = o === C ? 1 : 0, R = o === m ? 1 : 0;
|
|
1354
|
-
this.ctx.paint.drawLine([c + R, d + 1, c +
|
|
1354
|
+
this.ctx.paint.drawLine([c + R, d + 1, c + h - E, d + 1], {
|
|
1355
1355
|
borderColor: u,
|
|
1356
1356
|
fillColor: w,
|
|
1357
1357
|
borderWidth: p,
|
|
@@ -1362,7 +1362,7 @@ class At extends re {
|
|
|
1362
1362
|
}
|
|
1363
1363
|
if (o === C && r >= y && r <= b) {
|
|
1364
1364
|
const E = r === y ? 1 : 0, R = r === b ? 1 : 0;
|
|
1365
|
-
this.ctx.paint.drawLine([c +
|
|
1365
|
+
this.ctx.paint.drawLine([c + h - 1, d + E, c + h - 1, d + n - R], {
|
|
1366
1366
|
borderColor: u,
|
|
1367
1367
|
fillColor: w,
|
|
1368
1368
|
borderWidth: p,
|
|
@@ -1373,7 +1373,7 @@ class At extends re {
|
|
|
1373
1373
|
}
|
|
1374
1374
|
if (o >= m && o <= C && r === b) {
|
|
1375
1375
|
const E = o === C ? 1 : 0, R = o === m ? 1 : 0;
|
|
1376
|
-
this.ctx.paint.drawLine([c + R, d + n - 1, c +
|
|
1376
|
+
this.ctx.paint.drawLine([c + R, d + n - 1, c + h - E, d + n - 1], {
|
|
1377
1377
|
borderColor: u,
|
|
1378
1378
|
fillColor: w,
|
|
1379
1379
|
borderWidth: p,
|
|
@@ -1395,7 +1395,7 @@ class At extends re {
|
|
|
1395
1395
|
}
|
|
1396
1396
|
}
|
|
1397
1397
|
}
|
|
1398
|
-
class
|
|
1398
|
+
class li {
|
|
1399
1399
|
//虚拟滚动位置
|
|
1400
1400
|
constructor(t, e) {
|
|
1401
1401
|
a(this, "loading", !1);
|
|
@@ -1448,9 +1448,9 @@ class hi {
|
|
|
1448
1448
|
var m;
|
|
1449
1449
|
let r = !1;
|
|
1450
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:
|
|
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
1452
|
this.itemRowKeyMap.set(i, x);
|
|
1453
|
-
const g = i._height ||
|
|
1453
|
+
const g = i._height || h, p = i._readonly;
|
|
1454
1454
|
let u = !0;
|
|
1455
1455
|
if (typeof c == "function" && (u = c), d) {
|
|
1456
1456
|
const C = i[d];
|
|
@@ -1541,12 +1541,12 @@ class hi {
|
|
|
1541
1541
|
const i = (r) => {
|
|
1542
1542
|
r.forEach((o) => {
|
|
1543
1543
|
t.push(o);
|
|
1544
|
-
const n = this.itemRowKeyMap.get(o), { expand:
|
|
1544
|
+
const n = this.itemRowKeyMap.get(o), { expand: h, hasChildren: c, height: d } = this.rowKeyMap.get(n), f = this.sumHeight;
|
|
1545
1545
|
this.sumHeight += d, this.rowIndexRowKeyMap.set(e, n), this.rowKeyRowIndexMap.set(n, e), this.positions.push({
|
|
1546
1546
|
top: f,
|
|
1547
1547
|
height: d,
|
|
1548
1548
|
bottom: this.sumHeight
|
|
1549
|
-
}), e += 1,
|
|
1549
|
+
}), e += 1, h && c && i(o.children);
|
|
1550
1550
|
});
|
|
1551
1551
|
};
|
|
1552
1552
|
this.rowIndexRowKeyMap.clear(), this.rowKeyRowIndexMap.clear();
|
|
@@ -1720,14 +1720,14 @@ class hi {
|
|
|
1720
1720
|
newValue: f
|
|
1721
1721
|
});
|
|
1722
1722
|
});
|
|
1723
|
-
let
|
|
1723
|
+
let h = [];
|
|
1724
1724
|
s.forEach((d) => {
|
|
1725
|
-
|
|
1725
|
+
h.push(this.ctx.database.getRowDataItemForRowKey(d));
|
|
1726
1726
|
});
|
|
1727
1727
|
const c = o.map(({ rowKey: d, key: f }) => this.getValidator(d, f));
|
|
1728
1728
|
Promise.all(c).then(() => {
|
|
1729
1729
|
this.validationErrorMap.size === 0 && this.changedDataMap.size > 0 && this.ctx.emit("validateChangedData", this.getChangedData());
|
|
1730
|
-
}), this.ctx.emit("change", o,
|
|
1730
|
+
}), this.ctx.emit("change", o, h), e && this.ctx.history.pushState({
|
|
1731
1731
|
changeList: i,
|
|
1732
1732
|
scrollX: this.ctx.scrollX,
|
|
1733
1733
|
scrollY: this.ctx.scrollY,
|
|
@@ -1748,15 +1748,15 @@ class hi {
|
|
|
1748
1748
|
if (!this.rowKeyMap.has(t))
|
|
1749
1749
|
return {};
|
|
1750
1750
|
const { item: n } = this.rowKeyMap.get(t);
|
|
1751
|
-
let
|
|
1751
|
+
let h = n[e], c = i;
|
|
1752
1752
|
if (this.ctx.database.getReadonly(t, e))
|
|
1753
1753
|
return {
|
|
1754
|
-
oldValue:
|
|
1755
|
-
newValue:
|
|
1754
|
+
oldValue: h,
|
|
1755
|
+
newValue: h
|
|
1756
1756
|
};
|
|
1757
|
-
n[e] !== null && typeof n[e] == "object" && (
|
|
1757
|
+
n[e] !== null && typeof n[e] == "object" && (h = JSON.parse(JSON.stringify(n[e])));
|
|
1758
1758
|
const d = `${t}_${e}`;
|
|
1759
|
-
this.originalDataMap.has(d) || this.originalDataMap.set(d,
|
|
1759
|
+
this.originalDataMap.has(d) || this.originalDataMap.set(d, h);
|
|
1760
1760
|
const f = this.originalDataMap.get(d), x = this.getRowDataItemForRowKey(t);
|
|
1761
1761
|
if (o) {
|
|
1762
1762
|
const g = this.getVirtualBodyCellByKey(t, e);
|
|
@@ -1766,7 +1766,7 @@ class hi {
|
|
|
1766
1766
|
else if (/^-?\d+(\.\d+)?$/.test(`${i}`))
|
|
1767
1767
|
c = Number(i);
|
|
1768
1768
|
else {
|
|
1769
|
-
c =
|
|
1769
|
+
c = h;
|
|
1770
1770
|
const w = {
|
|
1771
1771
|
code: "ERR_SET_NUMBER_VALUE",
|
|
1772
1772
|
message: "Assignment failed, not a numeric type",
|
|
@@ -1775,17 +1775,17 @@ class hi {
|
|
|
1775
1775
|
rowKey: t,
|
|
1776
1776
|
key: e,
|
|
1777
1777
|
value: c,
|
|
1778
|
-
oldValue:
|
|
1778
|
+
oldValue: h,
|
|
1779
1779
|
row: x
|
|
1780
1780
|
}
|
|
1781
1781
|
]
|
|
1782
1782
|
};
|
|
1783
1783
|
this.ctx.emit("error", w);
|
|
1784
1784
|
}
|
|
1785
|
-
if (c ===
|
|
1785
|
+
if (c === h)
|
|
1786
1786
|
return {
|
|
1787
|
-
oldValue:
|
|
1788
|
-
newValue:
|
|
1787
|
+
oldValue: h,
|
|
1788
|
+
newValue: h
|
|
1789
1789
|
};
|
|
1790
1790
|
const { BEFORE_VALUE_CHANGE_METHOD: p } = this.ctx.config;
|
|
1791
1791
|
if (typeof p == "function") {
|
|
@@ -1804,7 +1804,7 @@ class hi {
|
|
|
1804
1804
|
const u = {
|
|
1805
1805
|
rowKey: t,
|
|
1806
1806
|
key: e,
|
|
1807
|
-
oldValue:
|
|
1807
|
+
oldValue: h,
|
|
1808
1808
|
value: c,
|
|
1809
1809
|
row: x
|
|
1810
1810
|
};
|
|
@@ -1813,7 +1813,7 @@ class hi {
|
|
|
1813
1813
|
}), this.ctx.emit("change", [u], [x]), this.ctx.emit("editChange", {
|
|
1814
1814
|
rowKey: t,
|
|
1815
1815
|
key: e,
|
|
1816
|
-
oldValue:
|
|
1816
|
+
oldValue: h,
|
|
1817
1817
|
value: c,
|
|
1818
1818
|
originalValue: f,
|
|
1819
1819
|
row: x
|
|
@@ -1823,7 +1823,7 @@ class hi {
|
|
|
1823
1823
|
return this.ctx.hasEvent("iterationChange") && this.ctx.emit("iterationChange", {
|
|
1824
1824
|
rowKey: t,
|
|
1825
1825
|
key: e,
|
|
1826
|
-
oldValue:
|
|
1826
|
+
oldValue: h,
|
|
1827
1827
|
value: c,
|
|
1828
1828
|
originalValue: this.originalDataMap.get(d),
|
|
1829
1829
|
row: x
|
|
@@ -1835,12 +1835,12 @@ class hi {
|
|
|
1835
1835
|
{
|
|
1836
1836
|
rowKey: t,
|
|
1837
1837
|
key: e,
|
|
1838
|
-
oldValue:
|
|
1838
|
+
oldValue: h,
|
|
1839
1839
|
newValue: c
|
|
1840
1840
|
}
|
|
1841
1841
|
]
|
|
1842
1842
|
}), r && this.ctx.emit("draw"), {
|
|
1843
|
-
oldValue:
|
|
1843
|
+
oldValue: h,
|
|
1844
1844
|
newValue: c
|
|
1845
1845
|
};
|
|
1846
1846
|
}
|
|
@@ -1867,8 +1867,8 @@ class hi {
|
|
|
1867
1867
|
return !1;
|
|
1868
1868
|
const { item: s } = this.rowKeyMap.get(t), r = s[i];
|
|
1869
1869
|
this.checkboxKeyMap.has(r) && (this.checkboxKeyMap.get(r) || []).forEach((n) => {
|
|
1870
|
-
const
|
|
1871
|
-
|
|
1870
|
+
const h = this.selectionMap.get(n);
|
|
1871
|
+
h && (h.check = e);
|
|
1872
1872
|
});
|
|
1873
1873
|
}
|
|
1874
1874
|
}
|
|
@@ -1969,7 +1969,7 @@ class hi {
|
|
|
1969
1969
|
rowIndex: x.rowIndex
|
|
1970
1970
|
})), p && (r += 1);
|
|
1971
1971
|
});
|
|
1972
|
-
const
|
|
1972
|
+
const h = o > i && s === 0 && n, c = r && r > s && s > 0 || h, d = r !== 0, f = !!r && r === s;
|
|
1973
1973
|
return this.bufferCheckState = {
|
|
1974
1974
|
buffer: !0,
|
|
1975
1975
|
check: f,
|
|
@@ -2068,9 +2068,9 @@ class hi {
|
|
|
2068
2068
|
const s = this.rowKeyMap.get(t), r = this.headerMap.get(e);
|
|
2069
2069
|
if (!s || !r)
|
|
2070
2070
|
return !0;
|
|
2071
|
-
const o = s.readonly, n = r.readonly, { BODY_CELL_READONLY_METHOD:
|
|
2072
|
-
if (typeof
|
|
2073
|
-
const d =
|
|
2071
|
+
const o = s.readonly, n = r.readonly, { BODY_CELL_READONLY_METHOD: h } = this.ctx.config;
|
|
2072
|
+
if (typeof h == "function" && r) {
|
|
2073
|
+
const d = h({
|
|
2074
2074
|
row: s.item,
|
|
2075
2075
|
rowIndex: s.rowIndex,
|
|
2076
2076
|
colIndex: r.colIndex,
|
|
@@ -2094,7 +2094,7 @@ class hi {
|
|
|
2094
2094
|
if (r === void 0)
|
|
2095
2095
|
return i([]);
|
|
2096
2096
|
const n = r.column;
|
|
2097
|
-
let
|
|
2097
|
+
let h = n.rules;
|
|
2098
2098
|
if (typeof o == "function") {
|
|
2099
2099
|
const d = o({
|
|
2100
2100
|
row: s.item,
|
|
@@ -2103,12 +2103,12 @@ class hi {
|
|
|
2103
2103
|
column: n,
|
|
2104
2104
|
value: this.getItemValue(t, e)
|
|
2105
2105
|
});
|
|
2106
|
-
d && (
|
|
2106
|
+
d && (h = d);
|
|
2107
2107
|
}
|
|
2108
|
-
if (
|
|
2108
|
+
if (h) {
|
|
2109
2109
|
let c = {}, d = {};
|
|
2110
|
-
if (d[e] = this.getItemValue(t, e), Array.isArray(
|
|
2111
|
-
const x =
|
|
2110
|
+
if (d[e] = this.getItemValue(t, e), Array.isArray(h)) {
|
|
2111
|
+
const x = h.map((g) => ({
|
|
2112
2112
|
...g,
|
|
2113
2113
|
row: s.item,
|
|
2114
2114
|
column: n,
|
|
@@ -2118,7 +2118,7 @@ class hi {
|
|
|
2118
2118
|
c[e] = x;
|
|
2119
2119
|
} else
|
|
2120
2120
|
c[e] = {
|
|
2121
|
-
...
|
|
2121
|
+
...h,
|
|
2122
2122
|
row: s.item,
|
|
2123
2123
|
column: n,
|
|
2124
2124
|
rowIndex: s.rowIndex,
|
|
@@ -2156,7 +2156,7 @@ class hi {
|
|
|
2156
2156
|
row: r,
|
|
2157
2157
|
value: o,
|
|
2158
2158
|
colIndex: n,
|
|
2159
|
-
relationRowKeys:
|
|
2159
|
+
relationRowKeys: h,
|
|
2160
2160
|
relationColKeys: c,
|
|
2161
2161
|
rowspan: d,
|
|
2162
2162
|
height: f,
|
|
@@ -2187,13 +2187,13 @@ class hi {
|
|
|
2187
2187
|
let w = e, m = e, C = n, y = n, b = [], E = 0, R = 0, O = 0, I = 0;
|
|
2188
2188
|
if (d !== 1 && p) {
|
|
2189
2189
|
I = x;
|
|
2190
|
-
const _ =
|
|
2191
|
-
const T = this.getItemValue(s,
|
|
2190
|
+
const _ = h.reduce((v, L) => {
|
|
2191
|
+
const T = this.getItemValue(s, L) ?? "";
|
|
2192
2192
|
return `${v}${T}`;
|
|
2193
2193
|
}, "");
|
|
2194
2194
|
for (let v = e - 1; v >= 0; v--) {
|
|
2195
|
-
const
|
|
2196
|
-
const N = this.getItemValue(
|
|
2195
|
+
const L = this.rowIndexRowKeyMap.get(v) || "", T = h.reduce((M, A) => {
|
|
2196
|
+
const N = this.getItemValue(L, A) ?? "";
|
|
2197
2197
|
return `${M}${N}`;
|
|
2198
2198
|
}, "");
|
|
2199
2199
|
if (_ === T)
|
|
@@ -2202,8 +2202,8 @@ class hi {
|
|
|
2202
2202
|
break;
|
|
2203
2203
|
}
|
|
2204
2204
|
for (let v = e; v <= this.ctx.maxRowIndex; v++) {
|
|
2205
|
-
const
|
|
2206
|
-
const N = this.getItemValue(
|
|
2205
|
+
const L = this.rowIndexRowKeyMap.get(v) || "", T = h.reduce((M, A) => {
|
|
2206
|
+
const N = this.getItemValue(L, A) ?? "";
|
|
2207
2207
|
return `${M}${N}`;
|
|
2208
2208
|
}, "");
|
|
2209
2209
|
if (_ === T)
|
|
@@ -2212,12 +2212,12 @@ class hi {
|
|
|
2212
2212
|
break;
|
|
2213
2213
|
}
|
|
2214
2214
|
for (let v = w; v < e; v++) {
|
|
2215
|
-
const { height:
|
|
2216
|
-
E +=
|
|
2215
|
+
const { height: L } = this.positions[v];
|
|
2216
|
+
E += L;
|
|
2217
2217
|
}
|
|
2218
2218
|
for (let v = w; v <= m; v++) {
|
|
2219
|
-
const { height:
|
|
2220
|
-
O +=
|
|
2219
|
+
const { height: L } = this.positions[v];
|
|
2220
|
+
O += L;
|
|
2221
2221
|
const T = this.rowIndexRowKeyMap.get(v) || "", { item: M } = this.rowKeyMap.get(T), A = this.getItemValue(T, i);
|
|
2222
2222
|
b.push({
|
|
2223
2223
|
rowKey: T,
|
|
@@ -2233,8 +2233,8 @@ class hi {
|
|
|
2233
2233
|
const v = this.getColumnByColIndex(_);
|
|
2234
2234
|
if (!v)
|
|
2235
2235
|
break;
|
|
2236
|
-
const
|
|
2237
|
-
if (
|
|
2236
|
+
const L = this.getItemValue(s, i), T = this.getItemValue(s, v.key);
|
|
2237
|
+
if (L === T && c.includes(v.key))
|
|
2238
2238
|
C = _;
|
|
2239
2239
|
else
|
|
2240
2240
|
break;
|
|
@@ -2243,8 +2243,8 @@ class hi {
|
|
|
2243
2243
|
const v = this.getColumnByColIndex(_);
|
|
2244
2244
|
if (!v)
|
|
2245
2245
|
break;
|
|
2246
|
-
const
|
|
2247
|
-
if (
|
|
2246
|
+
const L = this.getItemValue(s, i), T = this.getItemValue(s, v.key);
|
|
2247
|
+
if (L === T && c.includes(v.key))
|
|
2248
2248
|
y = _;
|
|
2249
2249
|
else
|
|
2250
2250
|
break;
|
|
@@ -2328,7 +2328,7 @@ class hi {
|
|
|
2328
2328
|
return i;
|
|
2329
2329
|
}
|
|
2330
2330
|
}
|
|
2331
|
-
class
|
|
2331
|
+
class hi {
|
|
2332
2332
|
constructor(t) {
|
|
2333
2333
|
a(this, "ctx");
|
|
2334
2334
|
a(this, "history", []);
|
|
@@ -2390,18 +2390,27 @@ class ci {
|
|
|
2390
2390
|
this.ctx = t, this.init();
|
|
2391
2391
|
}
|
|
2392
2392
|
init() {
|
|
2393
|
-
this.bind(window, "resize", this.handleResize.bind(this)), this.bind(window, "mouseup", this.handleMouseUp.bind(this)), this.bind(window, "mousemove", this.handleMousemove.bind(this)), this.bind(window, "blur", this.handleOutsideMousedown.bind(this)), this.bind(window, "mousedown", this.handleOutsideMousedown.bind(this)), this.bind(this.ctx.stageElement, "click", this.handleClick.bind(this)), this.bind(window, "keydown", this.handleKeydown.bind(this)), this.bind(this.ctx.stageElement, "wheel", this.handleWheel.bind(this), { passive: !1 }), this.bind(this.ctx.stageElement, "touchstart", this.handleTouchstart.bind(this), { passive: !1 }), this.bind(this.ctx.stageElement, "touchend", this.handleTouchend.bind(this)), this.bind(this.ctx.stageElement, "touchmove", this.handleTouchmove.bind(this), { passive: !1 }), this.bind(this.ctx.stageElement, "contextmenu", this.handleContextMenu.bind(this)), this.bind(this.ctx.stageElement, "mousedown", this.handleMouseDown.bind(this)), this.bind(this.ctx.stageElement, "dblclick", this.handleDblclick.bind(this)), this.bind(this.ctx.stageElement, "mouseover", this.handleMouseover.bind(this)), this.bind(this.ctx.stageElement, "mouseout", this.handleMouseout.bind(this));
|
|
2393
|
+
this.bind(window, "resize", this.handleResize.bind(this)), this.bind(window, "mouseup", this.handleMouseUp.bind(this)), this.bind(window, "mousemove", this.handleMousemove.bind(this)), this.bind(window, "blur", this.handleOutsideMousedown.bind(this)), this.bind(window, "mousedown", this.handleOutsideMousedown.bind(this)), this.bind(this.ctx.stageElement, "click", this.handleClick.bind(this)), this.bind(window, "keydown", this.handleKeydown.bind(this)), this.bind(this.ctx.stageElement, "wheel", this.handleWheel.bind(this), { passive: !1 }), this.bind(this.ctx.stageElement, "touchstart", this.handleTouchstart.bind(this), { passive: !1 }), this.bind(this.ctx.stageElement, "touchend", this.handleTouchend.bind(this)), this.bind(this.ctx.stageElement, "touchmove", this.handleTouchmove.bind(this), { passive: !1 }), this.bind(this.ctx.stageElement, "contextmenu", this.handleContextMenu.bind(this)), this.bind(this.ctx.stageElement, "mousedown", this.handleMouseDown.bind(this)), this.bind(this.ctx.stageElement, "dblclick", this.handleDblclick.bind(this)), this.bind(this.ctx.stageElement, "mouseover", this.handleMouseover.bind(this)), this.bind(this.ctx.stageElement, "mouseout", this.handleMouseout.bind(this)), document.addEventListener("selectionchange", this.selectionchange.bind(this));
|
|
2394
|
+
}
|
|
2395
|
+
selectionchange() {
|
|
2396
|
+
this.ctx.domSelectionStr = "";
|
|
2397
|
+
const t = window.getSelection();
|
|
2398
|
+
t && t.toString() && (this.ctx.domSelectionStr = t.toString());
|
|
2399
|
+
}
|
|
2400
|
+
clearDomSelection() {
|
|
2401
|
+
const t = window.getSelection();
|
|
2402
|
+
t && !t.isCollapsed && t.removeAllRanges();
|
|
2394
2403
|
}
|
|
2395
2404
|
destroy() {
|
|
2396
2405
|
this.eventTasks.forEach((t, e) => {
|
|
2397
2406
|
this.unbind(window, e, t);
|
|
2398
|
-
}), this.eventTasks.clear();
|
|
2407
|
+
}), document.removeEventListener("selectionchange", this.selectionchange.bind(this)), this.eventTasks.clear();
|
|
2399
2408
|
}
|
|
2400
2409
|
handleResize(t) {
|
|
2401
2410
|
this.ctx.emit("resetHeader", t), this.ctx.emit("resize", t);
|
|
2402
2411
|
}
|
|
2403
2412
|
handleMouseDown(t) {
|
|
2404
|
-
t.button === 0 && (this.ctx.mousedown = !0), this.ctx.containerElement.focus({ preventScroll: !0 }), this.ctx.emit("mousedown", t);
|
|
2413
|
+
this.clearDomSelection(), t.button === 0 && (this.ctx.mousedown = !0), this.ctx.containerElement.focus({ preventScroll: !0 }), this.ctx.emit("mousedown", t);
|
|
2405
2414
|
}
|
|
2406
2415
|
handleMousemove(t) {
|
|
2407
2416
|
this.ctx.emit("mousemove", t);
|
|
@@ -2524,21 +2533,21 @@ class fi {
|
|
|
2524
2533
|
* @param {string} color - 阴影的颜色
|
|
2525
2534
|
*/
|
|
2526
2535
|
drawShadow(t, e, i, s, r) {
|
|
2527
|
-
const { fillColor: o, side: n, shadowWidth:
|
|
2536
|
+
const { fillColor: o, side: n, shadowWidth: h, colorStart: c, colorEnd: d } = r;
|
|
2528
2537
|
this.ctx.save(), o && (this.ctx.fillStyle = o, this.ctx.fillRect(t, e, i, s));
|
|
2529
2538
|
let f;
|
|
2530
2539
|
switch (n) {
|
|
2531
2540
|
case "left":
|
|
2532
|
-
f = this.ctx.createLinearGradient(t -
|
|
2541
|
+
f = this.ctx.createLinearGradient(t - h, e, t, e), f.addColorStop(0, c), f.addColorStop(1, d), this.ctx.fillStyle = f, this.ctx.fillRect(t - h, e, h, s);
|
|
2533
2542
|
break;
|
|
2534
2543
|
case "right":
|
|
2535
|
-
f = this.ctx.createLinearGradient(t + i, e, t + i +
|
|
2544
|
+
f = this.ctx.createLinearGradient(t + i, e, t + i + h, e), f.addColorStop(0, c), f.addColorStop(1, d), this.ctx.fillStyle = f, this.ctx.fillRect(t + i, e, h, s);
|
|
2536
2545
|
break;
|
|
2537
2546
|
case "top":
|
|
2538
|
-
f = this.ctx.createLinearGradient(t, e -
|
|
2547
|
+
f = this.ctx.createLinearGradient(t, e - h, t, e), f.addColorStop(0, c), f.addColorStop(1, d), this.ctx.fillStyle = f, this.ctx.fillRect(t, e - h, i, h);
|
|
2539
2548
|
break;
|
|
2540
2549
|
case "bottom":
|
|
2541
|
-
f = this.ctx.createLinearGradient(t, e + s, t, e + s +
|
|
2550
|
+
f = this.ctx.createLinearGradient(t, e + s, t, e + s + h), f.addColorStop(0, c), f.addColorStop(1, d), this.ctx.fillStyle = f, this.ctx.fillRect(t, e + s, i, h);
|
|
2542
2551
|
break;
|
|
2543
2552
|
default:
|
|
2544
2553
|
console.error("Invalid side specified for shadow");
|
|
@@ -2559,11 +2568,11 @@ class fi {
|
|
|
2559
2568
|
drawImage(t, e, i, s, r) {
|
|
2560
2569
|
this.ctx.save(), this.ctx.drawImage(t, e, i, s, r), this.ctx.restore();
|
|
2561
2570
|
}
|
|
2562
|
-
drawRect(t, e, i, s, { borderWidth: r = 1, borderColor: o, fillColor: n, radius:
|
|
2563
|
-
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),
|
|
2571
|
+
drawRect(t, e, i, s, { borderWidth: r = 1, borderColor: o, fillColor: n, radius: h = 0 } = {}) {
|
|
2572
|
+
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)
|
|
2564
2573
|
this.ctx.rect(t - 0.5, e - 0.5, i, s);
|
|
2565
2574
|
else {
|
|
2566
|
-
const [c, d, f, x] = typeof
|
|
2575
|
+
const [c, d, f, x] = typeof h == "number" ? [h, h, h, h] : h;
|
|
2567
2576
|
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);
|
|
2568
2577
|
}
|
|
2569
2578
|
n !== void 0 && this.ctx.fill(), o !== void 0 && this.ctx.stroke(), this.ctx.restore();
|
|
@@ -2582,16 +2591,16 @@ class fi {
|
|
|
2582
2591
|
this.ctx.save();
|
|
2583
2592
|
const {
|
|
2584
2593
|
font: n = "12px Arial",
|
|
2585
|
-
align:
|
|
2594
|
+
align: h = "center",
|
|
2586
2595
|
color: c = "#495060",
|
|
2587
2596
|
padding: d = 0,
|
|
2588
2597
|
verticalAlign: f = "middle"
|
|
2589
2598
|
} = o;
|
|
2590
|
-
this.ctx.font = n, this.ctx.fillStyle = c, this.ctx.textBaseline = f, this.ctx.textAlign =
|
|
2599
|
+
this.ctx.font = n, this.ctx.fillStyle = c, this.ctx.textBaseline = f, this.ctx.textAlign = h;
|
|
2591
2600
|
let x = 0;
|
|
2592
2601
|
f === "top" ? x = i + d : f === "bottom" ? x = i + r - d : x = i + (r + 1) / 2;
|
|
2593
2602
|
let g = 0;
|
|
2594
|
-
|
|
2603
|
+
h === "left" ? g = e + d : h === "right" ? g = e + s - d : g = e + s / 2;
|
|
2595
2604
|
const { _text: p, ellipsis: u } = this.handleEllipsis(t, s, d, n);
|
|
2596
2605
|
return this.ctx.fillText(p, g, x), this.ctx.restore(), u;
|
|
2597
2606
|
}
|
|
@@ -2602,8 +2611,8 @@ class fi {
|
|
|
2602
2611
|
_text: "",
|
|
2603
2612
|
ellipsis: r
|
|
2604
2613
|
};
|
|
2605
|
-
const n = this.ctx.measureText("...").width,
|
|
2606
|
-
if (
|
|
2614
|
+
const n = this.ctx.measureText("...").width, h = this.ctx.measureText(t).width;
|
|
2615
|
+
if (h && h + n >= e - i * 2) {
|
|
2607
2616
|
r = !0;
|
|
2608
2617
|
let c = 0;
|
|
2609
2618
|
for (let d = 0; d < t.length; d++)
|
|
@@ -2897,15 +2906,15 @@ class xi {
|
|
|
2897
2906
|
c.setAttribute("fill", e);
|
|
2898
2907
|
});
|
|
2899
2908
|
const n = new Image();
|
|
2900
|
-
let
|
|
2909
|
+
let h = "";
|
|
2901
2910
|
if (i) {
|
|
2902
2911
|
const c = new Blob([new XMLSerializer().serializeToString(o)], {
|
|
2903
2912
|
type: "image/svg+xml"
|
|
2904
2913
|
});
|
|
2905
|
-
|
|
2914
|
+
h = URL.createObjectURL(c);
|
|
2906
2915
|
} else
|
|
2907
|
-
|
|
2908
|
-
return n.src =
|
|
2916
|
+
h = "data:image/svg+xml;charset=utf-8," + encodeURIComponent(new XMLSerializer().serializeToString(o));
|
|
2917
|
+
return n.src = h, new Promise((c, d) => {
|
|
2909
2918
|
n.onerror = () => d(new Error("Failed to load image")), n.onload = () => {
|
|
2910
2919
|
c(n);
|
|
2911
2920
|
};
|
|
@@ -2916,8 +2925,8 @@ class xi {
|
|
|
2916
2925
|
}
|
|
2917
2926
|
}
|
|
2918
2927
|
class oe extends re {
|
|
2919
|
-
constructor(e, i, s, r, o, n,
|
|
2920
|
-
super(e, s, r, o, n, "header",
|
|
2928
|
+
constructor(e, i, s, r, o, n, h) {
|
|
2929
|
+
super(e, s, r, o, n, "header", h.fixed);
|
|
2921
2930
|
a(this, "align");
|
|
2922
2931
|
a(this, "verticalAlign", "middle");
|
|
2923
2932
|
a(this, "fixed");
|
|
@@ -2954,7 +2963,7 @@ class oe extends re {
|
|
|
2954
2963
|
a(this, "drawImageHeight", 0);
|
|
2955
2964
|
a(this, "drawImageName", "");
|
|
2956
2965
|
a(this, "drawImageSource");
|
|
2957
|
-
this.ctx = e, this.x = s, this.y = r, this.width = o, this.height = n, this.colIndex = i, this.key =
|
|
2966
|
+
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;
|
|
2958
2967
|
}
|
|
2959
2968
|
/**
|
|
2960
2969
|
* 是否可见,覆盖基类方法,表头是跟y滚动条没有关系的所以不需要加滚动参数
|
|
@@ -2974,11 +2983,11 @@ class oe extends re {
|
|
|
2974
2983
|
const { HEADER_CELL_STYLE_METHOD: e, HEADER_BG_COLOR: i, HEADER_TEXT_COLOR: s } = this.ctx.config;
|
|
2975
2984
|
let r = i, o = s;
|
|
2976
2985
|
if (typeof e == "function") {
|
|
2977
|
-
const n = e, { backgroundColor:
|
|
2986
|
+
const n = e, { backgroundColor: h, color: c } = n({
|
|
2978
2987
|
colIndex: this.colIndex,
|
|
2979
2988
|
column: this.column
|
|
2980
2989
|
}) || {};
|
|
2981
|
-
|
|
2990
|
+
h && (r = h), c && (o = c);
|
|
2982
2991
|
}
|
|
2983
2992
|
this.drawCellBgColor = r, this.drawTextColor = o;
|
|
2984
2993
|
}
|
|
@@ -2989,11 +2998,11 @@ class oe extends re {
|
|
|
2989
2998
|
const {
|
|
2990
2999
|
paint: e,
|
|
2991
3000
|
config: { BORDER_COLOR: i, CELL_PADDING: s, HEADER_FONT: r, BORDER: o }
|
|
2992
|
-
} = this.ctx, { drawX: n, drawY:
|
|
2993
|
-
e.drawRect(n,
|
|
3001
|
+
} = this.ctx, { drawX: n, drawY: h, displayText: c } = this;
|
|
3002
|
+
e.drawRect(n, h, this.width, this.height, {
|
|
2994
3003
|
borderColor: o ? i : "transparent",
|
|
2995
3004
|
fillColor: this.drawCellBgColor
|
|
2996
|
-
}), e.drawText(c, n,
|
|
3005
|
+
}), e.drawText(c, n, h, this.width, this.height, {
|
|
2997
3006
|
font: r,
|
|
2998
3007
|
padding: s,
|
|
2999
3008
|
color: this.drawTextColor,
|
|
@@ -3014,9 +3023,9 @@ class oe extends re {
|
|
|
3014
3023
|
drawSelection() {
|
|
3015
3024
|
const { width: e, height: i, type: s } = this;
|
|
3016
3025
|
if (["index-selection", "selection"].includes(s)) {
|
|
3017
|
-
const { indeterminate: r, check: o, selectable: n } = this.ctx.database.getCheckedState(), { CHECKBOX_SIZE:
|
|
3026
|
+
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;
|
|
3018
3027
|
let f = this.ctx.icons.get("checkbox-uncheck"), x = "checkbox-uncheck";
|
|
3019
|
-
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 =
|
|
3028
|
+
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(
|
|
3020
3029
|
this.drawImageSource,
|
|
3021
3030
|
this.drawImageX,
|
|
3022
3031
|
this.drawImageY,
|
|
@@ -3153,10 +3162,10 @@ class ui {
|
|
|
3153
3162
|
colIndex: t.colIndex,
|
|
3154
3163
|
column: t.column,
|
|
3155
3164
|
value: t.getValue()
|
|
3156
|
-
}).then((
|
|
3157
|
-
this.ctx.database.setExpandChildren(t.rowKey,
|
|
3158
|
-
}).catch((
|
|
3159
|
-
this.ctx.database.expandLoading(t.rowKey, !1), console.error(
|
|
3165
|
+
}).then((h) => {
|
|
3166
|
+
this.ctx.database.setExpandChildren(t.rowKey, h), this.ctx.database.expandLoading(t.rowKey, !1), this.ctx.emit("expandChange", this.ctx.database.getExpandRowKeys());
|
|
3167
|
+
}).catch((h) => {
|
|
3168
|
+
this.ctx.database.expandLoading(t.rowKey, !1), console.error(h);
|
|
3160
3169
|
}));
|
|
3161
3170
|
else {
|
|
3162
3171
|
const n = this.ctx.database.getIsExpand(t.rowKey);
|
|
@@ -3188,15 +3197,15 @@ class ui {
|
|
|
3188
3197
|
if (this.isInsideBody(e))
|
|
3189
3198
|
for (const o of i) {
|
|
3190
3199
|
const n = o.fixedCells.concat(o.noFixedCells);
|
|
3191
|
-
for (const
|
|
3192
|
-
const c =
|
|
3200
|
+
for (const h of n) {
|
|
3201
|
+
const c = h.getDrawX(), d = h.getDrawY();
|
|
3193
3202
|
if (r) {
|
|
3194
|
-
if (t > c && t < c +
|
|
3195
|
-
s(
|
|
3203
|
+
if (t > c && t < c + h.visibleWidth && e > d && e < d + h.visibleHeight) {
|
|
3204
|
+
s(h);
|
|
3196
3205
|
return;
|
|
3197
3206
|
}
|
|
3198
|
-
} else if (t > c && t < c +
|
|
3199
|
-
s(
|
|
3207
|
+
} else if (t > c && t < c + h.width && e > d && e < d + h.height) {
|
|
3208
|
+
s(h);
|
|
3200
3209
|
return;
|
|
3201
3210
|
}
|
|
3202
3211
|
}
|
|
@@ -3234,6 +3243,7 @@ class gi {
|
|
|
3234
3243
|
a(this, "stageHeight", 0);
|
|
3235
3244
|
a(this, "paint");
|
|
3236
3245
|
a(this, "icons");
|
|
3246
|
+
a(this, "domSelectionStr", "");
|
|
3237
3247
|
a(this, "isMouseoverTargetContainer", !1);
|
|
3238
3248
|
a(this, "mousedown", !1);
|
|
3239
3249
|
a(this, "isPointer", !1);
|
|
@@ -3330,10 +3340,10 @@ class gi {
|
|
|
3330
3340
|
canvasElement: r,
|
|
3331
3341
|
overlayerElement: o,
|
|
3332
3342
|
editorElement: n,
|
|
3333
|
-
emptyElement:
|
|
3343
|
+
emptyElement: h,
|
|
3334
3344
|
contextMenuElement: c
|
|
3335
3345
|
} = t;
|
|
3336
|
-
this.containerElement = i, s.tabIndex = 0, this.stageElement = s, this.canvasElement = r, this.overlayerElement = o, this.editorElement = n, this.emptyElement =
|
|
3346
|
+
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);
|
|
3337
3347
|
}
|
|
3338
3348
|
setConfig(t) {
|
|
3339
3349
|
this.config = new Wt(t);
|
|
@@ -3342,8 +3352,8 @@ class gi {
|
|
|
3342
3352
|
if (this.config.ENABLE_MERGE_CELL_LINK) {
|
|
3343
3353
|
const o = this.database.getVirtualBodyCellByKey(t, e);
|
|
3344
3354
|
if (o && (o.mergeRow || o.mergeCol)) {
|
|
3345
|
-
const { dataList: n } = o.getSpanInfo(),
|
|
3346
|
-
this.database.batchSetItemValue(
|
|
3355
|
+
const { dataList: n } = o.getSpanInfo(), h = n.map((c) => ({ ...c, value: i }));
|
|
3356
|
+
this.database.batchSetItemValue(h, s);
|
|
3347
3357
|
return;
|
|
3348
3358
|
}
|
|
3349
3359
|
}
|
|
@@ -3357,7 +3367,7 @@ class gi {
|
|
|
3357
3367
|
if (r === void 0 || o === void 0) return;
|
|
3358
3368
|
const n = this.database.getVirtualBodyCell(r, o);
|
|
3359
3369
|
if (n) {
|
|
3360
|
-
const { dataList:
|
|
3370
|
+
const { dataList: h } = n.getSpanInfo(), c = h.map((d) => ({ ...d, value: s.value }));
|
|
3361
3371
|
i.push(...c);
|
|
3362
3372
|
}
|
|
3363
3373
|
}), this.database.batchSetItemValue(i, e);
|
|
@@ -3402,7 +3412,7 @@ class gi {
|
|
|
3402
3412
|
for (let r = 0; r <= e[1] - e[0]; r++) {
|
|
3403
3413
|
const o = [];
|
|
3404
3414
|
for (let n = 0; n <= i[1] - i[0]; n++) {
|
|
3405
|
-
const
|
|
3415
|
+
const h = r + e[0], c = n + i[0], d = this.database.getItemValueForRowIndexAndColIndex(h, c);
|
|
3406
3416
|
d && o.push(d.value);
|
|
3407
3417
|
}
|
|
3408
3418
|
s += `${o.join(" ")}\r`, t.push(o);
|
|
@@ -3523,8 +3533,8 @@ class zt {
|
|
|
3523
3533
|
if (this.isOnScrollbar(e, i) && t.target === this.ctx.canvasElement ? this.isFocus = !0 : this.isFocus = !1, o === 0 || s == this.clientX && r == this.clientY) return;
|
|
3524
3534
|
let n = 0;
|
|
3525
3535
|
if (this.type === "horizontal" ? n = s - this.clientX : n = r - this.clientY, this.isDragging && n !== 0) {
|
|
3526
|
-
let
|
|
3527
|
-
this.type === "vertical" ?
|
|
3536
|
+
let h = 0;
|
|
3537
|
+
this.type === "vertical" ? h = this.dragStart + n / (this.visibleDistance - this.barHeight) * this.distance : h = this.dragStart + n / (this.visibleDistance - this.barWidth) * this.distance, this.scroll = Math.max(0, Math.min(h, this.distance));
|
|
3528
3538
|
}
|
|
3529
3539
|
}
|
|
3530
3540
|
isPointInElement(t, e, i, s, r, o) {
|
|
@@ -3550,21 +3560,21 @@ class zt {
|
|
|
3550
3560
|
stageHeight: i,
|
|
3551
3561
|
stageWidth: s,
|
|
3552
3562
|
config: { SCROLLER_TRACK_SIZE: r = 0, SCROLLER_SIZE: o = 0, BORDER: n }
|
|
3553
|
-
} = this.ctx,
|
|
3563
|
+
} = this.ctx, h = s, c = i, d = e.height, f = e.width, x = t.height, g = this.ctx.footer.height;
|
|
3554
3564
|
if (this.type === "vertical") {
|
|
3555
|
-
this.visibleDistance = c - r - d, this.distance = x - this.visibleDistance + g, this.trackX =
|
|
3565
|
+
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;
|
|
3556
3566
|
const p = this.distance ? this.visibleDistance / (x + g) : 0;
|
|
3557
3567
|
let u = Math.floor(p * this.visibleDistance);
|
|
3558
3568
|
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));
|
|
3559
3569
|
} else {
|
|
3560
|
-
this.visibleDistance =
|
|
3561
|
-
|
|
3570
|
+
this.visibleDistance = h - r, this.distance = f - this.visibleDistance, this.splitPoints = [
|
|
3571
|
+
h - r,
|
|
3562
3572
|
c - r,
|
|
3563
|
-
|
|
3573
|
+
h - r,
|
|
3564
3574
|
c
|
|
3565
3575
|
];
|
|
3566
3576
|
const p = n ? 0 : 0.5;
|
|
3567
|
-
this.trackX = 0, this.trackY = c - r + p, this.trackWidth =
|
|
3577
|
+
this.trackX = 0, this.trackY = c - r + p, this.trackWidth = h, this.trackHeight = r;
|
|
3568
3578
|
const u = this.distance ? this.visibleDistance / f : 0;
|
|
3569
3579
|
let w = Math.floor(u * this.visibleDistance);
|
|
3570
3580
|
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));
|
|
@@ -3713,9 +3723,9 @@ class pi {
|
|
|
3713
3723
|
this.columnIndex = 0, this.resizeNum = 0, this.render(o, 0), this.ctx.database.updateColIndexKeyMap(this.leafCellHeaders);
|
|
3714
3724
|
const n = this.ctx.containerElement.getBoundingClientRect();
|
|
3715
3725
|
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;
|
|
3716
|
-
const
|
|
3717
|
-
if (this.resizeNum &&
|
|
3718
|
-
const f = Math.floor(
|
|
3726
|
+
const h = this.visibleWidth - this.width;
|
|
3727
|
+
if (this.resizeNum && h > 0) {
|
|
3728
|
+
const f = Math.floor(h / this.resizeNum * 100) / 100;
|
|
3719
3729
|
this.resizeAllColumn(f);
|
|
3720
3730
|
}
|
|
3721
3731
|
const c = this.fixedLeftCellHeaders.filter((f) => !f.hasChildren);
|
|
@@ -3740,8 +3750,8 @@ class pi {
|
|
|
3740
3750
|
} = this.ctx;
|
|
3741
3751
|
if (this.isResizing && this.resizeTarget) {
|
|
3742
3752
|
const r = this.resizeTarget.width, o = this.resizeTarget.minWidth, n = this.resizeTarget.maxWidth;
|
|
3743
|
-
let
|
|
3744
|
-
|
|
3753
|
+
let h = e.clientX - this.clientX;
|
|
3754
|
+
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");
|
|
3745
3755
|
} else {
|
|
3746
3756
|
if (this.resizeTarget = null, this.isMouseDown)
|
|
3747
3757
|
return;
|
|
@@ -3752,9 +3762,9 @@ class pi {
|
|
|
3752
3762
|
this.ctx.stageElement.style.cursor === "col-resize" && (this.ctx.stageElement.style.cursor = "default");
|
|
3753
3763
|
const r = [...this.renderFixedCellHeaders, ...this.renderCenterCellHeaders];
|
|
3754
3764
|
for (const o of r) {
|
|
3755
|
-
const { offsetX: n, offsetY:
|
|
3765
|
+
const { offsetX: n, offsetY: h } = this.ctx.getOffset(e), c = n, d = o.getDrawX();
|
|
3756
3766
|
c > d + o.width - 5 && c < d + o.width + 4 && c < i - 4 && // 视窗中最后一列不允许调整宽
|
|
3757
|
-
o.colspan <= 1 && this.ctx.isTarget(e) &&
|
|
3767
|
+
o.colspan <= 1 && this.ctx.isTarget(e) && h <= this.height && (this.ctx.stageElement.style.cursor = "col-resize", this.resizeTarget = o);
|
|
3758
3768
|
}
|
|
3759
3769
|
}
|
|
3760
3770
|
}));
|
|
@@ -3808,10 +3818,10 @@ class pi {
|
|
|
3808
3818
|
let s = e;
|
|
3809
3819
|
const { HEADER_HEIGHT: r = 0 } = this.ctx.config;
|
|
3810
3820
|
for (let o = 0; o < i; o++) {
|
|
3811
|
-
const n = t[o],
|
|
3821
|
+
const n = t[o], h = r * (n.rowspan || 0), c = r * (n.level || 0);
|
|
3812
3822
|
let { minWidth: d, maxWidth: f } = n, x = n.width || 100;
|
|
3813
3823
|
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));
|
|
3814
|
-
const g = new oe(this.ctx, this.columnIndex, s, c, x,
|
|
3824
|
+
const g = new oe(this.ctx, this.columnIndex, s, c, x, h, n);
|
|
3815
3825
|
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;
|
|
3816
3826
|
}
|
|
3817
3827
|
}
|
|
@@ -3843,8 +3853,8 @@ class pi {
|
|
|
3843
3853
|
colorStart: "rgba(0,0,0,0.1)",
|
|
3844
3854
|
colorEnd: "rgba(0,0,0,0)"
|
|
3845
3855
|
}), i < Math.floor(s.width - r - 1) && e !== n) {
|
|
3846
|
-
const
|
|
3847
|
-
this.ctx.paint.drawShadow(
|
|
3856
|
+
const h = s.width - (this.x + this.width) + r - e;
|
|
3857
|
+
this.ctx.paint.drawShadow(h, this.y, e, this.height, {
|
|
3848
3858
|
fillColor: o,
|
|
3849
3859
|
side: "left",
|
|
3850
3860
|
shadowWidth: 4,
|
|
@@ -3886,7 +3896,7 @@ class pi {
|
|
|
3886
3896
|
}
|
|
3887
3897
|
}
|
|
3888
3898
|
class ne {
|
|
3889
|
-
constructor(t, e, i = 0, s = 0, r = 0, o = 0, n,
|
|
3899
|
+
constructor(t, e, i = 0, s = 0, r = 0, o = 0, n, h = "body") {
|
|
3890
3900
|
a(this, "ctx");
|
|
3891
3901
|
a(this, "x", 0);
|
|
3892
3902
|
a(this, "y", 0);
|
|
@@ -3899,7 +3909,7 @@ class ne {
|
|
|
3899
3909
|
a(this, "rowKey", "");
|
|
3900
3910
|
a(this, "rowType", "body");
|
|
3901
3911
|
a(this, "data");
|
|
3902
|
-
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 =
|
|
3912
|
+
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();
|
|
3903
3913
|
}
|
|
3904
3914
|
update() {
|
|
3905
3915
|
const { header: t } = this.ctx, e = [], i = [], s = [];
|
|
@@ -3977,7 +3987,7 @@ class mi {
|
|
|
3977
3987
|
FOOTER_FIXED: r,
|
|
3978
3988
|
SCROLLER_TRACK_SIZE: o = 0,
|
|
3979
3989
|
HEIGHT: n,
|
|
3980
|
-
EMPTY_BODY_HEIGHT:
|
|
3990
|
+
EMPTY_BODY_HEIGHT: h = 0,
|
|
3981
3991
|
MAX_HEIGHT: c = 0,
|
|
3982
3992
|
ENABLE_OFFSET_HEIGHT: d = 0,
|
|
3983
3993
|
OFFSET_HEIGHT: f = 0,
|
|
@@ -3990,7 +4000,7 @@ class mi {
|
|
|
3990
4000
|
const { data: g, sumHeight: p } = s.getData();
|
|
3991
4001
|
this.height = p, this.data = g, this.width = e.width, this.visibleWidth = this.ctx.stageWidth - o;
|
|
3992
4002
|
const u = this.ctx.footer.height;
|
|
3993
|
-
!this.data.length && !n ? this.height =
|
|
4003
|
+
!this.data.length && !n ? this.height = h : !this.data.length && n && (this.height = n - e.height - u - o);
|
|
3994
4004
|
let w = this.height + e.height + o;
|
|
3995
4005
|
w += u;
|
|
3996
4006
|
let m = w;
|
|
@@ -4012,7 +4022,7 @@ class mi {
|
|
|
4012
4022
|
bodyHeight: this.height,
|
|
4013
4023
|
footerHeight: u,
|
|
4014
4024
|
width: this.width,
|
|
4015
|
-
height: this.data.length ? 0 :
|
|
4025
|
+
height: this.data.length ? 0 : h + u
|
|
4016
4026
|
});
|
|
4017
4027
|
const _ = Math.round(t.width / E * 1e4) / 1e4, v = Math.round(t.height / E * 1e4) / 1e4;
|
|
4018
4028
|
this.ctx.canvasElement.setAttribute("style", `height:${v}px;width:${_}px;`), this.ctx.paint.scale(E);
|
|
@@ -4035,7 +4045,7 @@ class mi {
|
|
|
4035
4045
|
}), this.ctx.on("mousemove", (e) => {
|
|
4036
4046
|
if (this.ctx.editing) return;
|
|
4037
4047
|
const { offsetY: i, offsetX: s } = this.ctx.getOffset(e), r = i, o = s, n = e.clientY, {
|
|
4038
|
-
stageHeight:
|
|
4048
|
+
stageHeight: h,
|
|
4039
4049
|
scrollY: c,
|
|
4040
4050
|
config: { RESIZE_ROW_MIN_HEIGHT: d = 0 }
|
|
4041
4051
|
} = this.ctx;
|
|
@@ -4055,7 +4065,7 @@ class mi {
|
|
|
4055
4065
|
this.ctx.stageElement.style.cursor === "row-resize" && (this.ctx.stageElement.style.cursor = "default");
|
|
4056
4066
|
for (let f = 0; f < this.renderRows.length; f++) {
|
|
4057
4067
|
const x = this.renderRows[f];
|
|
4058
|
-
if (r > x.y - c + x.height - 1.5 && r < x.y - c + x.height + 1.5 && r <
|
|
4068
|
+
if (r > x.y - c + x.height - 1.5 && r < x.y - c + x.height + 1.5 && r < h - 4)
|
|
4059
4069
|
for (let p = 0; p < x.cells.length; p++) {
|
|
4060
4070
|
const u = x.cells[p];
|
|
4061
4071
|
o > u.drawX + 10 && o < u.drawX + u.width - 10 && u.rowspan === 1 && (this.ctx.stageElement.style.cursor = "row-resize", this.resizeTarget = x);
|
|
@@ -4104,8 +4114,8 @@ class mi {
|
|
|
4104
4114
|
colorStart: "rgba(0,0,0,0.1)",
|
|
4105
4115
|
colorEnd: "rgba(0,0,0,0)"
|
|
4106
4116
|
}), i < Math.floor(s.width - r - 1) && e !== n) {
|
|
4107
|
-
const
|
|
4108
|
-
this.ctx.paint.drawShadow(
|
|
4117
|
+
const h = s.width - (this.x + this.width) + r - e;
|
|
4118
|
+
this.ctx.paint.drawShadow(h, this.y, e, this.height, {
|
|
4109
4119
|
fillColor: o,
|
|
4110
4120
|
side: "left",
|
|
4111
4121
|
shadowWidth: 4,
|
|
@@ -4133,12 +4143,12 @@ class mi {
|
|
|
4133
4143
|
config: { CELL_HEIGHT: s }
|
|
4134
4144
|
} = this.ctx, r = i, { data: o, positions: n } = e.getData();
|
|
4135
4145
|
this.ctx.maxRowIndex = o.length - 1;
|
|
4136
|
-
let
|
|
4137
|
-
if (c === -1 && (c = this.ctx.maxRowIndex),
|
|
4146
|
+
let h = this.binarySearch(n, r), c = this.binarySearch(n, r + this.visibleHeight);
|
|
4147
|
+
if (c === -1 && (c = this.ctx.maxRowIndex), h === -1 && c === this.ctx.maxRowIndex) {
|
|
4138
4148
|
const f = Math.floor(this.visibleHeight / s);
|
|
4139
|
-
|
|
4149
|
+
h = this.ctx.maxRowIndex - f;
|
|
4140
4150
|
}
|
|
4141
|
-
this.headIndex = Math.max(0,
|
|
4151
|
+
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;
|
|
4142
4152
|
const d = [];
|
|
4143
4153
|
for (let f = 0; f < this.visibleRows.length; f++) {
|
|
4144
4154
|
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);
|
|
@@ -4189,8 +4199,8 @@ class yi {
|
|
|
4189
4199
|
stageWidth: r,
|
|
4190
4200
|
config: { HEADER_BG_COLOR: o, SCROLLER_TRACK_SIZE: n }
|
|
4191
4201
|
} = this.ctx;
|
|
4192
|
-
let
|
|
4193
|
-
if (this.ctx.config.FOOTER_FIXED || (
|
|
4202
|
+
let h = this.y;
|
|
4203
|
+
if (this.ctx.config.FOOTER_FIXED || (h = this.y - this.ctx.scrollY), i > 0 && t !== 0 && this.ctx.paint.drawShadow(this.x, h, t, this.height, {
|
|
4194
4204
|
fillColor: o,
|
|
4195
4205
|
side: "right",
|
|
4196
4206
|
shadowWidth: 4,
|
|
@@ -4198,7 +4208,7 @@ class yi {
|
|
|
4198
4208
|
colorEnd: "rgba(0,0,0,0)"
|
|
4199
4209
|
}), i < Math.floor(s.width - r - 1) && e !== n) {
|
|
4200
4210
|
const c = s.width - (this.x + this.width) + r - e;
|
|
4201
|
-
this.ctx.paint.drawShadow(c,
|
|
4211
|
+
this.ctx.paint.drawShadow(c, h, e, this.height, {
|
|
4202
4212
|
fillColor: o,
|
|
4203
4213
|
side: "left",
|
|
4204
4214
|
shadowWidth: 4,
|
|
@@ -4271,13 +4281,13 @@ class Ei {
|
|
|
4271
4281
|
this.isMultipleRow || this.mouseenter();
|
|
4272
4282
|
}
|
|
4273
4283
|
}), this.ctx.on("cellMousedown", (t, e) => {
|
|
4274
|
-
if (this.ctx.isTarget(e)
|
|
4275
|
-
|
|
4276
|
-
|
|
4277
|
-
|
|
4278
|
-
|
|
4279
|
-
e.preventDefault(), this.isMultipleRow = !1, this.click(e.shiftKey), this.ctx.emit("selectorClick", t);
|
|
4284
|
+
if (!this.ctx.isTarget(e) || this.ctx.stageElement.style.cursor === "pointer" || this.ctx.isPointer || this.ctx.stageElement.style.cursor === "crosshair")
|
|
4285
|
+
return;
|
|
4286
|
+
if (t.operation) {
|
|
4287
|
+
this.isMultipleRow = !0, this.selectRows(t);
|
|
4288
|
+
return;
|
|
4280
4289
|
}
|
|
4290
|
+
window.getComputedStyle(e.target).userSelect !== "text" && e.preventDefault(), this.isMultipleRow = !1, this.click(e.shiftKey), this.ctx.emit("selectorClick", t);
|
|
4281
4291
|
}), this.ctx.on("mouseup", () => {
|
|
4282
4292
|
this.mousedownHeader = !1;
|
|
4283
4293
|
const t = setTimeout(() => {
|
|
@@ -4286,7 +4296,9 @@ class Ei {
|
|
|
4286
4296
|
}), this.ctx.on("cellHeaderHoverChange", (t) => {
|
|
4287
4297
|
this.ctx.mousedown && this.selectCols(t);
|
|
4288
4298
|
}), this.ctx.on("cellHeaderMousedown", (t, e) => {
|
|
4289
|
-
this.ctx.stageElement.style.cursor
|
|
4299
|
+
if (this.ctx.stageElement.style.cursor === "pointer" || this.ctx.isPointer)
|
|
4300
|
+
return;
|
|
4301
|
+
window.getComputedStyle(e.target).userSelect !== "text" && e.preventDefault(), this.mousedownHeader = !0, this.selectCols(t);
|
|
4290
4302
|
}), this.ctx.on("keydown", (t) => {
|
|
4291
4303
|
if (!this.ctx.editing) {
|
|
4292
4304
|
if (t.ctrlKey && t.code === "KeyV" || t.metaKey && t.code === "KeyV") {
|
|
@@ -4354,12 +4366,12 @@ class Ei {
|
|
|
4354
4366
|
this.ctx.mousedown && (this.ctx.selectorMove = !0), this.ctx.selector.enable = !0;
|
|
4355
4367
|
const {
|
|
4356
4368
|
SELECTOR_AREA_MIN_X: n,
|
|
4357
|
-
SELECTOR_AREA_MAX_X:
|
|
4369
|
+
SELECTOR_AREA_MAX_X: h,
|
|
4358
4370
|
SELECTOR_AREA_MIN_Y: c,
|
|
4359
4371
|
SELECTOR_AREA_MAX_Y: d,
|
|
4360
4372
|
SELECTOR_AREA_MAX_X_OFFSET: f,
|
|
4361
4373
|
SELECTOR_AREA_MAX_Y_OFFSET: x
|
|
4362
|
-
} = this.ctx.config, g = n, p =
|
|
4374
|
+
} = this.ctx.config, g = n, p = h || this.ctx.maxColIndex - f, u = c, w = d || this.ctx.maxRowIndex - x;
|
|
4363
4375
|
let [m, C] = r, [y, b] = o;
|
|
4364
4376
|
if (m < g || C > p || y < u || b > w)
|
|
4365
4377
|
return;
|
|
@@ -4385,11 +4397,11 @@ class Ei {
|
|
|
4385
4397
|
adjustMergeCells(t, e) {
|
|
4386
4398
|
var p;
|
|
4387
4399
|
const [i, s] = e, [r, o] = t;
|
|
4388
|
-
let n = [],
|
|
4400
|
+
let n = [], h = [];
|
|
4389
4401
|
for (let u = 0; u <= e[1] - e[0]; u++)
|
|
4390
4402
|
for (let w = 0; w <= t[1] - t[0]; w++) {
|
|
4391
4403
|
const m = u + e[0], C = w + t[0], y = this.ctx.database.getVirtualBodyCell(m, C);
|
|
4392
|
-
y && ((m === i || m === s) && n.push(y), (C === r || C === o) &&
|
|
4404
|
+
y && ((m === i || m === s) && n.push(y), (C === r || C === o) && h.push(y));
|
|
4393
4405
|
}
|
|
4394
4406
|
const c = n.reduce(
|
|
4395
4407
|
(u, w) => {
|
|
@@ -4400,7 +4412,7 @@ class Ei {
|
|
|
4400
4412
|
minY: i,
|
|
4401
4413
|
maxY: s
|
|
4402
4414
|
}
|
|
4403
|
-
), d =
|
|
4415
|
+
), d = h.reduce(
|
|
4404
4416
|
(u, w) => {
|
|
4405
4417
|
const { xArr: m } = w.getSpanInfo(), [C, y] = m;
|
|
4406
4418
|
return u.minX = Math.min(u.minX, C), u.maxX = Math.max(u.maxX, y), u;
|
|
@@ -4432,15 +4444,15 @@ class Ei {
|
|
|
4432
4444
|
if (this.ctx.mousedown && this.ctx.focusCellHeader) {
|
|
4433
4445
|
const { colIndex: n } = this.ctx.focusCellHeader;
|
|
4434
4446
|
if (this.ctx.clearSelector(), t.colIndex >= n) {
|
|
4435
|
-
const
|
|
4436
|
-
this.setSelector(
|
|
4447
|
+
const h = [n, t.colIndex + t.colspan - 1], c = [r, o];
|
|
4448
|
+
this.setSelector(h, c);
|
|
4437
4449
|
} else {
|
|
4438
|
-
const
|
|
4439
|
-
this.setSelector(
|
|
4450
|
+
const h = [t.colIndex, n], c = [r, o];
|
|
4451
|
+
this.setSelector(h, c);
|
|
4440
4452
|
}
|
|
4441
4453
|
} else {
|
|
4442
|
-
const n = [t.colIndex, t.colIndex + t.colspan - 1],
|
|
4443
|
-
this.setSelector(n,
|
|
4454
|
+
const n = [t.colIndex, t.colIndex + t.colspan - 1], h = [r, o];
|
|
4455
|
+
this.setSelector(n, h);
|
|
4444
4456
|
}
|
|
4445
4457
|
}
|
|
4446
4458
|
selectAll() {
|
|
@@ -4454,8 +4466,8 @@ class Ei {
|
|
|
4454
4466
|
SELECTOR_AREA_MIN_Y: r,
|
|
4455
4467
|
SELECTOR_AREA_MAX_Y: o,
|
|
4456
4468
|
SELECTOR_AREA_MAX_X_OFFSET: n,
|
|
4457
|
-
SELECTOR_AREA_MAX_Y_OFFSET:
|
|
4458
|
-
} = this.ctx.config, c = i, d = s || this.ctx.maxColIndex - n, f = r, x = o || this.ctx.maxRowIndex -
|
|
4469
|
+
SELECTOR_AREA_MAX_Y_OFFSET: h
|
|
4470
|
+
} = 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];
|
|
4459
4471
|
this.setSelector(g, p);
|
|
4460
4472
|
}
|
|
4461
4473
|
}
|
|
@@ -4465,16 +4477,16 @@ class Ei {
|
|
|
4465
4477
|
const { SELECTOR_AREA_MIN_X: i, SELECTOR_AREA_MAX_X: s, SELECTOR_AREA_MAX_X_OFFSET: r } = this.ctx.config, o = s || this.ctx.maxColIndex - r, n = i;
|
|
4466
4478
|
if (e) {
|
|
4467
4479
|
this.ctx.setFocusCell(t);
|
|
4468
|
-
const
|
|
4469
|
-
this.setSelector(
|
|
4480
|
+
const h = [n, o], c = [t.rowIndex, t.rowIndex];
|
|
4481
|
+
this.setSelector(h, c);
|
|
4470
4482
|
}
|
|
4471
4483
|
if (this.ctx.focusCell && this.ctx.mousedown) {
|
|
4472
|
-
const { rowIndex:
|
|
4473
|
-
if (t.rowIndex >=
|
|
4474
|
-
const c = [n, o], d = [
|
|
4484
|
+
const { rowIndex: h } = this.ctx.focusCell;
|
|
4485
|
+
if (t.rowIndex >= h) {
|
|
4486
|
+
const c = [n, o], d = [h, t.rowIndex];
|
|
4475
4487
|
this.setSelector(c, d);
|
|
4476
4488
|
} else {
|
|
4477
|
-
const c = [n, o], d = [t.rowIndex,
|
|
4489
|
+
const c = [n, o], d = [t.rowIndex, h];
|
|
4478
4490
|
this.setSelector(c, d);
|
|
4479
4491
|
}
|
|
4480
4492
|
}
|
|
@@ -4484,7 +4496,7 @@ class Ei {
|
|
|
4484
4496
|
return;
|
|
4485
4497
|
const { mousedown: t, focusCell: e, hoverCell: i } = this.ctx;
|
|
4486
4498
|
if (t && e && i) {
|
|
4487
|
-
const { rowIndex: s, colIndex: r } = e, o = Math.min(i.colIndex, r), n = Math.max(i.colIndex, r),
|
|
4499
|
+
const { rowIndex: s, colIndex: r } = e, o = Math.min(i.colIndex, r), n = Math.max(i.colIndex, r), h = Math.min(i.rowIndex, s), c = Math.max(i.rowIndex, s), d = [o, n], f = [h, c];
|
|
4488
4500
|
this.setSelector(d, f);
|
|
4489
4501
|
}
|
|
4490
4502
|
}
|
|
@@ -4494,7 +4506,7 @@ class Ei {
|
|
|
4494
4506
|
if (this.ctx.selector.enable = !0, i && t) {
|
|
4495
4507
|
if (this.ctx.config.ENABLE_SELECTOR_SINGLE)
|
|
4496
4508
|
return;
|
|
4497
|
-
const { colIndex: s, rowIndex: r } = i, { colIndex: o, rowIndex: n } = e,
|
|
4509
|
+
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];
|
|
4498
4510
|
this.setSelector(x, g);
|
|
4499
4511
|
} else {
|
|
4500
4512
|
this.ctx.emit("cellSelectedClick", e);
|
|
@@ -4520,7 +4532,7 @@ class Ei {
|
|
|
4520
4532
|
* @returns
|
|
4521
4533
|
*/
|
|
4522
4534
|
copy() {
|
|
4523
|
-
if (!this.ctx.config.ENABLE_COPY)
|
|
4535
|
+
if (!this.ctx.config.ENABLE_COPY || this.ctx.domSelectionStr)
|
|
4524
4536
|
return;
|
|
4525
4537
|
let { value: t, xArr: e, yArr: i } = this.ctx.getSelectedData();
|
|
4526
4538
|
if (this.ctx.config.ENABLE_MERGE_CELL_LINK && this.ctx.database.hasMergeCell(e, i))
|
|
@@ -4560,8 +4572,8 @@ class Ei {
|
|
|
4560
4572
|
let s = [];
|
|
4561
4573
|
const r = /* @__PURE__ */ new Set();
|
|
4562
4574
|
for (let n = 0; n <= e[1] - e[0]; n++)
|
|
4563
|
-
for (let
|
|
4564
|
-
const c = n + e[0], d =
|
|
4575
|
+
for (let h = 0; h <= t[1] - t[0]; h++) {
|
|
4576
|
+
const c = n + e[0], d = h + t[0], f = this.ctx.database.getItemValueForRowIndexAndColIndex(c, d);
|
|
4565
4577
|
if (f) {
|
|
4566
4578
|
const { rowKey: x, key: g } = f;
|
|
4567
4579
|
this.ctx.database.getReadonly(x, g) || (r.add(x), s.push({
|
|
@@ -4593,7 +4605,7 @@ class Ei {
|
|
|
4593
4605
|
const e = this.ctx.selector.yArr[0], i = this.ctx.selector.xArr[0], s = /* @__PURE__ */ new Set();
|
|
4594
4606
|
navigator.clipboard.readText().then(async (r) => {
|
|
4595
4607
|
let o = si(r);
|
|
4596
|
-
const n = [i, i + o[0].length - 1],
|
|
4608
|
+
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;
|
|
4597
4609
|
(g > 0 || p > 0) && this.ctx.emit("onPastedDataOverflow", {
|
|
4598
4610
|
maxY: d,
|
|
4599
4611
|
maxX: x,
|
|
@@ -4604,7 +4616,7 @@ class Ei {
|
|
|
4604
4616
|
textArr: o
|
|
4605
4617
|
});
|
|
4606
4618
|
const u = o.length === 1 && o[0].length === 1;
|
|
4607
|
-
if (this.ctx.config.ENABLE_MERGE_CELL_LINK && this.ctx.database.hasMergeCell(n,
|
|
4619
|
+
if (this.ctx.config.ENABLE_MERGE_CELL_LINK && this.ctx.database.hasMergeCell(n, h) && !u) {
|
|
4608
4620
|
const y = {
|
|
4609
4621
|
code: "ERR_MERGED_CELLS_PASTE",
|
|
4610
4622
|
message: "Merged cells cannot span paste data"
|
|
@@ -4621,10 +4633,10 @@ class Ei {
|
|
|
4621
4633
|
O
|
|
4622
4634
|
);
|
|
4623
4635
|
if (_) {
|
|
4624
|
-
const { rowKey: v, key:
|
|
4625
|
-
this.ctx.database.getReadonly(v,
|
|
4636
|
+
const { rowKey: v, key: L } = _;
|
|
4637
|
+
this.ctx.database.getReadonly(v, L) || (s.add(v), w.push({
|
|
4626
4638
|
rowKey: v,
|
|
4627
|
-
key:
|
|
4639
|
+
key: L,
|
|
4628
4640
|
value: I,
|
|
4629
4641
|
row: {}
|
|
4630
4642
|
//内部有设置
|
|
@@ -4654,7 +4666,7 @@ class Ei {
|
|
|
4654
4666
|
oldValue: this.ctx.database.getItemValue(E.rowKey, E.key),
|
|
4655
4667
|
row: this.ctx.database.getRowDataItemForRowKey(E.rowKey)
|
|
4656
4668
|
}));
|
|
4657
|
-
if (w = await y(b, n,
|
|
4669
|
+
if (w = await y(b, n, h, o), w && !w.length)
|
|
4658
4670
|
return;
|
|
4659
4671
|
}
|
|
4660
4672
|
this.clearCopyLine(), this.ctx.batchSetItemValueByEditor(w, !0);
|
|
@@ -4677,7 +4689,7 @@ class Ei {
|
|
|
4677
4689
|
if (!e)
|
|
4678
4690
|
return;
|
|
4679
4691
|
let { colIndex: i = 0, rowIndex: s = 0 } = e;
|
|
4680
|
-
const r = 0, o = 0, n = this.ctx.maxColIndex,
|
|
4692
|
+
const r = 0, o = 0, n = this.ctx.maxColIndex, h = this.ctx.maxRowIndex;
|
|
4681
4693
|
switch (t) {
|
|
4682
4694
|
case "LEFT":
|
|
4683
4695
|
i > r && i--;
|
|
@@ -4689,7 +4701,7 @@ class Ei {
|
|
|
4689
4701
|
i < n && i++;
|
|
4690
4702
|
break;
|
|
4691
4703
|
case "BOTTOM":
|
|
4692
|
-
s <
|
|
4704
|
+
s < h && s++;
|
|
4693
4705
|
break;
|
|
4694
4706
|
}
|
|
4695
4707
|
const c = [i, i], d = [s, s], f = this.getCell(s, i);
|
|
@@ -4706,8 +4718,8 @@ class Ei {
|
|
|
4706
4718
|
SELECTOR_AREA_MIN_Y: r,
|
|
4707
4719
|
SELECTOR_AREA_MAX_Y: o,
|
|
4708
4720
|
SELECTOR_AREA_MAX_X_OFFSET: n,
|
|
4709
|
-
SELECTOR_AREA_MAX_Y_OFFSET:
|
|
4710
|
-
} = this.ctx.config, c = i, d = s || this.ctx.maxColIndex - n, f = r, x = o || this.ctx.maxRowIndex -
|
|
4721
|
+
SELECTOR_AREA_MAX_Y_OFFSET: h
|
|
4722
|
+
} = this.ctx.config, c = i, d = s || this.ctx.maxColIndex - n, f = r, x = o || this.ctx.maxRowIndex - h;
|
|
4711
4723
|
return !(e < c || e > d || t < f || t > x);
|
|
4712
4724
|
}
|
|
4713
4725
|
/**
|
|
@@ -4721,7 +4733,7 @@ class Ei {
|
|
|
4721
4733
|
let n = 10 * (s === "left" ? -1 : 1);
|
|
4722
4734
|
this.timerX && (clearInterval(this.timerX), this.timerX = 0), this.timerX = setInterval(() => {
|
|
4723
4735
|
n *= 1.5;
|
|
4724
|
-
const { scrollX:
|
|
4736
|
+
const { scrollX: h } = this.ctx, c = h + n;
|
|
4725
4737
|
(c < 0 || c > this.ctx.body.width) && (clearInterval(this.timerX), this.timerX = 0), this.ctx.setScrollX(c);
|
|
4726
4738
|
}, 100);
|
|
4727
4739
|
}
|
|
@@ -4730,7 +4742,7 @@ class Ei {
|
|
|
4730
4742
|
let n = 10 * (r === "top" ? -1 : 1);
|
|
4731
4743
|
this.timerY && (clearInterval(this.timerY), this.timerY = 0), this.timerY = setInterval(() => {
|
|
4732
4744
|
n *= 1.5;
|
|
4733
|
-
const { scrollY:
|
|
4745
|
+
const { scrollY: h } = this.ctx, c = h + n;
|
|
4734
4746
|
(c < 0 || c > this.ctx.body.height) && (clearInterval(this.timerY), this.timerY = 0), this.ctx.setScrollY(c);
|
|
4735
4747
|
}, 100);
|
|
4736
4748
|
}
|
|
@@ -4747,7 +4759,7 @@ class Ei {
|
|
|
4747
4759
|
fixedLeftWidth: r,
|
|
4748
4760
|
header: o,
|
|
4749
4761
|
footer: n,
|
|
4750
|
-
body:
|
|
4762
|
+
body: h,
|
|
4751
4763
|
scrollX: c,
|
|
4752
4764
|
scrollY: d,
|
|
4753
4765
|
config: { SCROLLER_TRACK_SIZE: f, FOOTER_FIXED: x, FOOTER_POSITION: g, ENABLE_MERGE_CELL_LINK: p }
|
|
@@ -4757,12 +4769,12 @@ class Ei {
|
|
|
4757
4769
|
p && this.ctx.onlyMergeCell && i.updateSpanInfo();
|
|
4758
4770
|
const { drawX: u, drawY: w, width: m, height: C, fixed: y } = i, b = r - u + 1, E = i.drawX + m - (e - s) + 1;
|
|
4759
4771
|
let R = o.height - w, O = C;
|
|
4760
|
-
O >
|
|
4772
|
+
O > h.visibleHeight && (O = h.visibleHeight);
|
|
4761
4773
|
let I = 0;
|
|
4762
4774
|
x && (g === "top" ? R = o.height + n.height - w : I = n.visibleHeight);
|
|
4763
4775
|
const _ = w + O - (t - I - f);
|
|
4764
|
-
let v = c,
|
|
4765
|
-
E > 0 && !y ? v = Math.floor(c + E) : b > 0 && !y && (v = Math.floor(c - b)), R > 0 ?
|
|
4776
|
+
let v = c, L = d;
|
|
4777
|
+
E > 0 && !y ? v = Math.floor(c + E) : b > 0 && !y && (v = Math.floor(c - b)), R > 0 ? L = Math.floor(d - R) : _ > 0 && (L = Math.floor(d + _)), (Math.abs(c - v) > 2 || Math.abs(d - L) > 2) && (this.ctx.adjustPositioning = !0, this.ctx.setScroll(v, L), this.ctx.emit("adjustBoundaryPosition", i));
|
|
4766
4778
|
}
|
|
4767
4779
|
destroy() {
|
|
4768
4780
|
this.timerX && (clearTimeout(this.timerX), this.timerX = 0), this.timerY && (clearTimeout(this.timerY), this.timerY = 0);
|
|
@@ -4778,7 +4790,7 @@ class Ci {
|
|
|
4778
4790
|
this.ctx.on("mousemove", (t) => {
|
|
4779
4791
|
if (this.ctx.stageElement.style.cursor === "crosshair" && (this.ctx.stageElement.style.cursor = "default"), this.ctx.editing || !this.ctx.focusCell || !this.maxColRowCell)
|
|
4780
4792
|
return;
|
|
4781
|
-
const { offsetX: e, offsetY: i } = this.ctx.getOffset(t), { colIndex: s, rowIndex: r, drawX: o, drawY: n, width:
|
|
4793
|
+
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;
|
|
4782
4794
|
e > x && i > g && e < x + d && i < g + d && (this.ctx.stageElement.style.cursor = "crosshair");
|
|
4783
4795
|
}), this.ctx.on("cellMouseenter", (t) => {
|
|
4784
4796
|
const { xArr: e, yArr: i } = this.ctx.selector, s = e[1], r = i[1], { colIndex: o, rowIndex: n } = t;
|
|
@@ -4811,22 +4823,22 @@ class Ci {
|
|
|
4811
4823
|
return;
|
|
4812
4824
|
let o = t, n = e;
|
|
4813
4825
|
if (!r) {
|
|
4814
|
-
const [
|
|
4815
|
-
n = [
|
|
4826
|
+
const [h] = n;
|
|
4827
|
+
n = [h, h];
|
|
4816
4828
|
}
|
|
4817
4829
|
if (!s) {
|
|
4818
|
-
const [
|
|
4819
|
-
o = [
|
|
4830
|
+
const [h] = o;
|
|
4831
|
+
o = [h, h];
|
|
4820
4832
|
}
|
|
4821
4833
|
if (JSON.stringify(this.ctx.autofill.xArr) !== JSON.stringify(o) || JSON.stringify(this.ctx.autofill.yArr) !== JSON.stringify(n)) {
|
|
4822
4834
|
const {
|
|
4823
|
-
SELECTOR_AREA_MIN_X:
|
|
4835
|
+
SELECTOR_AREA_MIN_X: h,
|
|
4824
4836
|
SELECTOR_AREA_MAX_X: c,
|
|
4825
4837
|
SELECTOR_AREA_MIN_Y: d,
|
|
4826
4838
|
SELECTOR_AREA_MAX_Y: f,
|
|
4827
4839
|
SELECTOR_AREA_MAX_X_OFFSET: x,
|
|
4828
4840
|
SELECTOR_AREA_MAX_Y_OFFSET: g
|
|
4829
|
-
} = this.ctx.config, p =
|
|
4841
|
+
} = this.ctx.config, p = h, u = c || this.ctx.maxColIndex - x, w = d, m = f || this.ctx.maxRowIndex - g;
|
|
4830
4842
|
let [C, y] = o, [b, E] = n;
|
|
4831
4843
|
if (C < p || b < w)
|
|
4832
4844
|
return;
|
|
@@ -4855,8 +4867,8 @@ class Ci {
|
|
|
4855
4867
|
const u = g + e.yArr[0], w = p + e.xArr[0];
|
|
4856
4868
|
i.set(`${u}-${w}`, !0);
|
|
4857
4869
|
}
|
|
4858
|
-
const { value: s } = e, r = s[0].length, o = s.length, n = this.ctx.autofill.xArr,
|
|
4859
|
-
if (this.ctx.config.ENABLE_MERGE_CELL_LINK && this.ctx.database.hasMergeCell(n,
|
|
4870
|
+
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;
|
|
4871
|
+
if (this.ctx.config.ENABLE_MERGE_CELL_LINK && this.ctx.database.hasMergeCell(n, h) && !c) {
|
|
4860
4872
|
const g = {
|
|
4861
4873
|
code: "ERR_MERGED_CELLS_AUTOFILL",
|
|
4862
4874
|
message: "Merged cells cannot span autofill data"
|
|
@@ -4865,9 +4877,9 @@ class Ci {
|
|
|
4865
4877
|
return;
|
|
4866
4878
|
}
|
|
4867
4879
|
let d = [];
|
|
4868
|
-
for (let g = 0; g <=
|
|
4880
|
+
for (let g = 0; g <= h[1] - h[0]; g++)
|
|
4869
4881
|
for (let p = 0; p <= n[1] - n[0]; p++) {
|
|
4870
|
-
const u = p + n[0], w = g +
|
|
4882
|
+
const u = p + n[0], w = g + h[0], m = s[g % o][p % r], C = this.ctx.database.getItemValueForRowIndexAndColIndex(w, u), y = `${w}-${u}`;
|
|
4871
4883
|
if (C && !i.has(y)) {
|
|
4872
4884
|
const { rowKey: b, key: E } = C;
|
|
4873
4885
|
this.ctx.database.getReadonly(b, E) || (t.add(b), d.push({
|
|
@@ -4890,7 +4902,7 @@ class Ci {
|
|
|
4890
4902
|
oldValue: this.ctx.database.getItemValue(u.rowKey, u.key),
|
|
4891
4903
|
row: this.ctx.database.getRowDataItemForRowKey(u.rowKey)
|
|
4892
4904
|
}));
|
|
4893
|
-
if (d = await g(p, n,
|
|
4905
|
+
if (d = await g(p, n, h), d && !d.length)
|
|
4894
4906
|
return;
|
|
4895
4907
|
}
|
|
4896
4908
|
this.ctx.batchSetItemValueByEditor(d, !0);
|
|
@@ -4911,9 +4923,9 @@ class Ci {
|
|
|
4911
4923
|
destroy() {
|
|
4912
4924
|
}
|
|
4913
4925
|
}
|
|
4914
|
-
const rt = Math.min, U = Math.max, ft = Math.round, z = (
|
|
4915
|
-
x:
|
|
4916
|
-
y:
|
|
4926
|
+
const rt = Math.min, U = Math.max, ft = Math.round, z = (l) => ({
|
|
4927
|
+
x: l,
|
|
4928
|
+
y: l
|
|
4917
4929
|
}), bi = {
|
|
4918
4930
|
left: "right",
|
|
4919
4931
|
right: "left",
|
|
@@ -4923,46 +4935,46 @@ const rt = Math.min, U = Math.max, ft = Math.round, z = (h) => ({
|
|
|
4923
4935
|
start: "end",
|
|
4924
4936
|
end: "start"
|
|
4925
4937
|
};
|
|
4926
|
-
function It(
|
|
4927
|
-
return U(
|
|
4938
|
+
function It(l, t, e) {
|
|
4939
|
+
return U(l, rt(t, e));
|
|
4928
4940
|
}
|
|
4929
|
-
function at(
|
|
4930
|
-
return typeof
|
|
4941
|
+
function at(l, t) {
|
|
4942
|
+
return typeof l == "function" ? l(t) : l;
|
|
4931
4943
|
}
|
|
4932
|
-
function G(
|
|
4933
|
-
return
|
|
4944
|
+
function G(l) {
|
|
4945
|
+
return l.split("-")[0];
|
|
4934
4946
|
}
|
|
4935
|
-
function
|
|
4936
|
-
return
|
|
4947
|
+
function lt(l) {
|
|
4948
|
+
return l.split("-")[1];
|
|
4937
4949
|
}
|
|
4938
|
-
function ae(
|
|
4939
|
-
return
|
|
4950
|
+
function ae(l) {
|
|
4951
|
+
return l === "x" ? "y" : "x";
|
|
4940
4952
|
}
|
|
4941
|
-
function Mt(
|
|
4942
|
-
return
|
|
4953
|
+
function Mt(l) {
|
|
4954
|
+
return l === "y" ? "height" : "width";
|
|
4943
4955
|
}
|
|
4944
|
-
function J(
|
|
4945
|
-
return ["top", "bottom"].includes(G(
|
|
4956
|
+
function J(l) {
|
|
4957
|
+
return ["top", "bottom"].includes(G(l)) ? "y" : "x";
|
|
4946
4958
|
}
|
|
4947
|
-
function Ht(
|
|
4948
|
-
return ae(J(
|
|
4959
|
+
function Ht(l) {
|
|
4960
|
+
return ae(J(l));
|
|
4949
4961
|
}
|
|
4950
|
-
function Ri(
|
|
4962
|
+
function Ri(l, t, e) {
|
|
4951
4963
|
e === void 0 && (e = !1);
|
|
4952
|
-
const i =
|
|
4964
|
+
const i = lt(l), s = Ht(l), r = Mt(s);
|
|
4953
4965
|
let o = s === "x" ? i === (e ? "end" : "start") ? "right" : "left" : i === "start" ? "bottom" : "top";
|
|
4954
4966
|
return t.reference[r] > t.floating[r] && (o = xt(o)), [o, xt(o)];
|
|
4955
4967
|
}
|
|
4956
|
-
function _i(
|
|
4957
|
-
const t = xt(
|
|
4958
|
-
return [Ot(
|
|
4968
|
+
function _i(l) {
|
|
4969
|
+
const t = xt(l);
|
|
4970
|
+
return [Ot(l), t, Ot(t)];
|
|
4959
4971
|
}
|
|
4960
|
-
function Ot(
|
|
4961
|
-
return
|
|
4972
|
+
function Ot(l) {
|
|
4973
|
+
return l.replace(/start|end/g, (t) => vi[t]);
|
|
4962
4974
|
}
|
|
4963
|
-
function Ii(
|
|
4975
|
+
function Ii(l, t, e) {
|
|
4964
4976
|
const i = ["left", "right"], s = ["right", "left"], r = ["top", "bottom"], o = ["bottom", "top"];
|
|
4965
|
-
switch (
|
|
4977
|
+
switch (l) {
|
|
4966
4978
|
case "top":
|
|
4967
4979
|
case "bottom":
|
|
4968
4980
|
return e ? t ? s : i : t ? i : s;
|
|
@@ -4973,38 +4985,38 @@ function Ii(h, t, e) {
|
|
|
4973
4985
|
return [];
|
|
4974
4986
|
}
|
|
4975
4987
|
}
|
|
4976
|
-
function Oi(
|
|
4977
|
-
const s =
|
|
4978
|
-
let r = Ii(G(
|
|
4988
|
+
function Oi(l, t, e, i) {
|
|
4989
|
+
const s = lt(l);
|
|
4990
|
+
let r = Ii(G(l), e === "start", i);
|
|
4979
4991
|
return s && (r = r.map((o) => o + "-" + s), t && (r = r.concat(r.map(Ot)))), r;
|
|
4980
4992
|
}
|
|
4981
|
-
function xt(
|
|
4982
|
-
return
|
|
4993
|
+
function xt(l) {
|
|
4994
|
+
return l.replace(/left|right|bottom|top/g, (t) => bi[t]);
|
|
4983
4995
|
}
|
|
4984
|
-
function
|
|
4996
|
+
function Si(l) {
|
|
4985
4997
|
return {
|
|
4986
4998
|
top: 0,
|
|
4987
4999
|
right: 0,
|
|
4988
5000
|
bottom: 0,
|
|
4989
5001
|
left: 0,
|
|
4990
|
-
...
|
|
5002
|
+
...l
|
|
4991
5003
|
};
|
|
4992
5004
|
}
|
|
4993
|
-
function
|
|
4994
|
-
return typeof
|
|
4995
|
-
top:
|
|
4996
|
-
right:
|
|
4997
|
-
bottom:
|
|
4998
|
-
left:
|
|
5005
|
+
function le(l) {
|
|
5006
|
+
return typeof l != "number" ? Si(l) : {
|
|
5007
|
+
top: l,
|
|
5008
|
+
right: l,
|
|
5009
|
+
bottom: l,
|
|
5010
|
+
left: l
|
|
4999
5011
|
};
|
|
5000
5012
|
}
|
|
5001
|
-
function ut(
|
|
5013
|
+
function ut(l) {
|
|
5002
5014
|
const {
|
|
5003
5015
|
x: t,
|
|
5004
5016
|
y: e,
|
|
5005
5017
|
width: i,
|
|
5006
5018
|
height: s
|
|
5007
|
-
} =
|
|
5019
|
+
} = l;
|
|
5008
5020
|
return {
|
|
5009
5021
|
width: i,
|
|
5010
5022
|
height: s,
|
|
@@ -5016,14 +5028,14 @@ function ut(h) {
|
|
|
5016
5028
|
y: e
|
|
5017
5029
|
};
|
|
5018
5030
|
}
|
|
5019
|
-
function $t(
|
|
5031
|
+
function $t(l, t, e) {
|
|
5020
5032
|
let {
|
|
5021
5033
|
reference: i,
|
|
5022
5034
|
floating: s
|
|
5023
|
-
} =
|
|
5024
|
-
const r = J(t), o = Ht(t), n = Mt(o),
|
|
5035
|
+
} = l;
|
|
5036
|
+
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;
|
|
5025
5037
|
let g;
|
|
5026
|
-
switch (
|
|
5038
|
+
switch (h) {
|
|
5027
5039
|
case "top":
|
|
5028
5040
|
g = {
|
|
5029
5041
|
x: d,
|
|
@@ -5054,7 +5066,7 @@ function $t(h, t, e) {
|
|
|
5054
5066
|
y: i.y
|
|
5055
5067
|
};
|
|
5056
5068
|
}
|
|
5057
|
-
switch (
|
|
5069
|
+
switch (lt(t)) {
|
|
5058
5070
|
case "start":
|
|
5059
5071
|
g[o] -= x * (e && c ? -1 : 1);
|
|
5060
5072
|
break;
|
|
@@ -5064,21 +5076,21 @@ function $t(h, t, e) {
|
|
|
5064
5076
|
}
|
|
5065
5077
|
return g;
|
|
5066
5078
|
}
|
|
5067
|
-
const
|
|
5079
|
+
const Li = async (l, t, e) => {
|
|
5068
5080
|
const {
|
|
5069
5081
|
placement: i = "bottom",
|
|
5070
5082
|
strategy: s = "absolute",
|
|
5071
5083
|
middleware: r = [],
|
|
5072
5084
|
platform: o
|
|
5073
|
-
} = e, n = r.filter(Boolean),
|
|
5085
|
+
} = e, n = r.filter(Boolean), h = await (o.isRTL == null ? void 0 : o.isRTL(t));
|
|
5074
5086
|
let c = await o.getElementRects({
|
|
5075
|
-
reference:
|
|
5087
|
+
reference: l,
|
|
5076
5088
|
floating: t,
|
|
5077
5089
|
strategy: s
|
|
5078
5090
|
}), {
|
|
5079
5091
|
x: d,
|
|
5080
5092
|
y: f
|
|
5081
|
-
} = $t(c, i,
|
|
5093
|
+
} = $t(c, i, h), x = i, g = {}, p = 0;
|
|
5082
5094
|
for (let u = 0; u < n.length; u++) {
|
|
5083
5095
|
const {
|
|
5084
5096
|
name: w,
|
|
@@ -5098,7 +5110,7 @@ const Si = async (h, t, e) => {
|
|
|
5098
5110
|
rects: c,
|
|
5099
5111
|
platform: o,
|
|
5100
5112
|
elements: {
|
|
5101
|
-
reference:
|
|
5113
|
+
reference: l,
|
|
5102
5114
|
floating: t
|
|
5103
5115
|
}
|
|
5104
5116
|
});
|
|
@@ -5109,13 +5121,13 @@ const Si = async (h, t, e) => {
|
|
|
5109
5121
|
...b
|
|
5110
5122
|
}
|
|
5111
5123
|
}, E && p <= 50 && (p++, typeof E == "object" && (E.placement && (x = E.placement), E.rects && (c = E.rects === !0 ? await o.getElementRects({
|
|
5112
|
-
reference:
|
|
5124
|
+
reference: l,
|
|
5113
5125
|
floating: t,
|
|
5114
5126
|
strategy: s
|
|
5115
5127
|
}) : E.rects), {
|
|
5116
5128
|
x: d,
|
|
5117
5129
|
y: f
|
|
5118
|
-
} = $t(c, x,
|
|
5130
|
+
} = $t(c, x, h)), u = -1);
|
|
5119
5131
|
}
|
|
5120
5132
|
return {
|
|
5121
5133
|
x: d,
|
|
@@ -5125,7 +5137,7 @@ const Si = async (h, t, e) => {
|
|
|
5125
5137
|
middlewareData: g
|
|
5126
5138
|
};
|
|
5127
5139
|
};
|
|
5128
|
-
async function
|
|
5140
|
+
async function he(l, t) {
|
|
5129
5141
|
var e;
|
|
5130
5142
|
t === void 0 && (t = {});
|
|
5131
5143
|
const {
|
|
@@ -5134,18 +5146,18 @@ async function le(h, t) {
|
|
|
5134
5146
|
platform: r,
|
|
5135
5147
|
rects: o,
|
|
5136
5148
|
elements: n,
|
|
5137
|
-
strategy:
|
|
5138
|
-
} =
|
|
5149
|
+
strategy: h
|
|
5150
|
+
} = l, {
|
|
5139
5151
|
boundary: c = "clippingAncestors",
|
|
5140
5152
|
rootBoundary: d = "viewport",
|
|
5141
5153
|
elementContext: f = "floating",
|
|
5142
5154
|
altBoundary: x = !1,
|
|
5143
5155
|
padding: g = 0
|
|
5144
|
-
} = at(t,
|
|
5156
|
+
} = at(t, l), p = le(g), w = n[x ? f === "floating" ? "reference" : "floating" : f], m = ut(await r.getClippingRect({
|
|
5145
5157
|
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)),
|
|
5146
5158
|
boundary: c,
|
|
5147
5159
|
rootBoundary: d,
|
|
5148
|
-
strategy:
|
|
5160
|
+
strategy: h
|
|
5149
5161
|
})), C = f === "floating" ? {
|
|
5150
5162
|
x: i,
|
|
5151
5163
|
y: s,
|
|
@@ -5161,7 +5173,7 @@ async function le(h, t) {
|
|
|
5161
5173
|
elements: n,
|
|
5162
5174
|
rect: C,
|
|
5163
5175
|
offsetParent: y,
|
|
5164
|
-
strategy:
|
|
5176
|
+
strategy: h
|
|
5165
5177
|
}) : C);
|
|
5166
5178
|
return {
|
|
5167
5179
|
top: (m.top - E.top + p.top) / b.y,
|
|
@@ -5170,9 +5182,9 @@ async function le(h, t) {
|
|
|
5170
5182
|
right: (E.right - m.right + p.right) / b.x
|
|
5171
5183
|
};
|
|
5172
5184
|
}
|
|
5173
|
-
const Ti = (
|
|
5185
|
+
const Ti = (l) => ({
|
|
5174
5186
|
name: "arrow",
|
|
5175
|
-
options:
|
|
5187
|
+
options: l,
|
|
5176
5188
|
async fn(t) {
|
|
5177
5189
|
const {
|
|
5178
5190
|
x: e,
|
|
@@ -5181,20 +5193,20 @@ const Ti = (h) => ({
|
|
|
5181
5193
|
rects: r,
|
|
5182
5194
|
platform: o,
|
|
5183
5195
|
elements: n,
|
|
5184
|
-
middlewareData:
|
|
5196
|
+
middlewareData: h
|
|
5185
5197
|
} = t, {
|
|
5186
5198
|
element: c,
|
|
5187
5199
|
padding: d = 0
|
|
5188
|
-
} = at(
|
|
5200
|
+
} = at(l, t) || {};
|
|
5189
5201
|
if (c == null)
|
|
5190
5202
|
return {};
|
|
5191
|
-
const f =
|
|
5203
|
+
const f = le(d), x = {
|
|
5192
5204
|
x: e,
|
|
5193
5205
|
y: i
|
|
5194
5206
|
}, g = Ht(s), p = Mt(g), u = await o.getDimensions(c), w = g === "y", m = w ? "top" : "left", C = w ? "bottom" : "right", y = w ? "clientHeight" : "clientWidth", b = 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));
|
|
5195
5207
|
let O = R ? R[y] : 0;
|
|
5196
5208
|
(!O || !await (o.isElement == null ? void 0 : o.isElement(R))) && (O = n.floating[y] || r.floating[p]);
|
|
5197
|
-
const I = b / 2 - E / 2, _ = O / 2 - u[p] / 2 - 1, v = rt(f[m], _),
|
|
5209
|
+
const I = b / 2 - E / 2, _ = O / 2 - u[p] / 2 - 1, v = rt(f[m], _), L = rt(f[C], _), T = v, M = O - u[p] - L, 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 : L) - u[p] / 2 < 0, k = Y ? A < T ? A - T : A - M : 0;
|
|
5198
5210
|
return {
|
|
5199
5211
|
[g]: x[g] + k,
|
|
5200
5212
|
data: {
|
|
@@ -5207,10 +5219,10 @@ const Ti = (h) => ({
|
|
|
5207
5219
|
reset: Y
|
|
5208
5220
|
};
|
|
5209
5221
|
}
|
|
5210
|
-
}), Ai = function(
|
|
5211
|
-
return
|
|
5222
|
+
}), Ai = function(l) {
|
|
5223
|
+
return l === void 0 && (l = {}), {
|
|
5212
5224
|
name: "flip",
|
|
5213
|
-
options:
|
|
5225
|
+
options: l,
|
|
5214
5226
|
async fn(t) {
|
|
5215
5227
|
var e, i;
|
|
5216
5228
|
const {
|
|
@@ -5218,7 +5230,7 @@ const Ti = (h) => ({
|
|
|
5218
5230
|
middlewareData: r,
|
|
5219
5231
|
rects: o,
|
|
5220
5232
|
initialPlacement: n,
|
|
5221
|
-
platform:
|
|
5233
|
+
platform: h,
|
|
5222
5234
|
elements: c
|
|
5223
5235
|
} = t, {
|
|
5224
5236
|
mainAxis: d = !0,
|
|
@@ -5228,12 +5240,12 @@ const Ti = (h) => ({
|
|
|
5228
5240
|
fallbackAxisSideDirection: p = "none",
|
|
5229
5241
|
flipAlignment: u = !0,
|
|
5230
5242
|
...w
|
|
5231
|
-
} = at(
|
|
5243
|
+
} = at(l, t);
|
|
5232
5244
|
if ((e = r.arrow) != null && e.alignmentOffset)
|
|
5233
5245
|
return {};
|
|
5234
|
-
const m = G(s), C = J(n), y = G(n) === n, b = await (
|
|
5246
|
+
const m = G(s), C = J(n), y = G(n) === n, b = await (h.isRTL == null ? void 0 : h.isRTL(c.floating)), E = x || (y || !u ? [xt(n)] : _i(n)), R = p !== "none";
|
|
5235
5247
|
!x && R && E.push(...Oi(n, u, p, b));
|
|
5236
|
-
const O = [n, ...E], I = await
|
|
5248
|
+
const O = [n, ...E], I = await he(t, w), _ = [];
|
|
5237
5249
|
let v = ((i = r.flip) == null ? void 0 : i.overflows) || [];
|
|
5238
5250
|
if (d && _.push(I[m]), f) {
|
|
5239
5251
|
const A = Ri(s, o, b);
|
|
@@ -5243,8 +5255,8 @@ const Ti = (h) => ({
|
|
|
5243
5255
|
placement: s,
|
|
5244
5256
|
overflows: _
|
|
5245
5257
|
}], !_.every((A) => A <= 0)) {
|
|
5246
|
-
var
|
|
5247
|
-
const A = (((
|
|
5258
|
+
var L, T;
|
|
5259
|
+
const A = (((L = r.flip) == null ? void 0 : L.index) || 0) + 1, N = O[A];
|
|
5248
5260
|
if (N)
|
|
5249
5261
|
return {
|
|
5250
5262
|
data: {
|
|
@@ -5287,12 +5299,12 @@ const Ti = (h) => ({
|
|
|
5287
5299
|
}
|
|
5288
5300
|
};
|
|
5289
5301
|
};
|
|
5290
|
-
async function Mi(
|
|
5302
|
+
async function Mi(l, t) {
|
|
5291
5303
|
const {
|
|
5292
5304
|
placement: e,
|
|
5293
5305
|
platform: i,
|
|
5294
5306
|
elements: s
|
|
5295
|
-
} =
|
|
5307
|
+
} = 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);
|
|
5296
5308
|
let {
|
|
5297
5309
|
mainAxis: x,
|
|
5298
5310
|
crossAxis: g,
|
|
@@ -5306,7 +5318,7 @@ async function Mi(h, t) {
|
|
|
5306
5318
|
crossAxis: f.crossAxis || 0,
|
|
5307
5319
|
alignmentAxis: f.alignmentAxis
|
|
5308
5320
|
};
|
|
5309
|
-
return n && typeof p == "number" && (g = n === "end" ? p * -1 : p),
|
|
5321
|
+
return n && typeof p == "number" && (g = n === "end" ? p * -1 : p), h ? {
|
|
5310
5322
|
x: g * d,
|
|
5311
5323
|
y: x * c
|
|
5312
5324
|
} : {
|
|
@@ -5314,10 +5326,10 @@ async function Mi(h, t) {
|
|
|
5314
5326
|
y: g * d
|
|
5315
5327
|
};
|
|
5316
5328
|
}
|
|
5317
|
-
const Hi = function(
|
|
5318
|
-
return
|
|
5329
|
+
const Hi = function(l) {
|
|
5330
|
+
return l === void 0 && (l = 0), {
|
|
5319
5331
|
name: "offset",
|
|
5320
|
-
options:
|
|
5332
|
+
options: l,
|
|
5321
5333
|
async fn(t) {
|
|
5322
5334
|
var e, i;
|
|
5323
5335
|
const {
|
|
@@ -5325,21 +5337,21 @@ const Hi = function(h) {
|
|
|
5325
5337
|
y: r,
|
|
5326
5338
|
placement: o,
|
|
5327
5339
|
middlewareData: n
|
|
5328
|
-
} = t,
|
|
5340
|
+
} = t, h = await Mi(t, l);
|
|
5329
5341
|
return o === ((e = n.offset) == null ? void 0 : e.placement) && (i = n.arrow) != null && i.alignmentOffset ? {} : {
|
|
5330
|
-
x: s +
|
|
5331
|
-
y: r +
|
|
5342
|
+
x: s + h.x,
|
|
5343
|
+
y: r + h.y,
|
|
5332
5344
|
data: {
|
|
5333
|
-
...
|
|
5345
|
+
...h,
|
|
5334
5346
|
placement: o
|
|
5335
5347
|
}
|
|
5336
5348
|
};
|
|
5337
5349
|
}
|
|
5338
5350
|
};
|
|
5339
|
-
}, Di = function(
|
|
5340
|
-
return
|
|
5351
|
+
}, Di = function(l) {
|
|
5352
|
+
return l === void 0 && (l = {}), {
|
|
5341
5353
|
name: "shift",
|
|
5342
|
-
options:
|
|
5354
|
+
options: l,
|
|
5343
5355
|
async fn(t) {
|
|
5344
5356
|
const {
|
|
5345
5357
|
x: e,
|
|
@@ -5360,11 +5372,11 @@ const Hi = function(h) {
|
|
|
5360
5372
|
};
|
|
5361
5373
|
}
|
|
5362
5374
|
},
|
|
5363
|
-
...
|
|
5364
|
-
} = at(
|
|
5375
|
+
...h
|
|
5376
|
+
} = at(l, t), c = {
|
|
5365
5377
|
x: e,
|
|
5366
5378
|
y: i
|
|
5367
|
-
}, d = await
|
|
5379
|
+
}, d = await he(t, h), f = J(G(s)), x = ae(f);
|
|
5368
5380
|
let g = c[x], p = c[f];
|
|
5369
5381
|
if (r) {
|
|
5370
5382
|
const w = x === "y" ? "top" : "left", m = x === "y" ? "bottom" : "right", C = g + d[w], y = g - d[m];
|
|
@@ -5396,56 +5408,56 @@ const Hi = function(h) {
|
|
|
5396
5408
|
function gt() {
|
|
5397
5409
|
return typeof window < "u";
|
|
5398
5410
|
}
|
|
5399
|
-
function tt(
|
|
5400
|
-
return ce(
|
|
5411
|
+
function tt(l) {
|
|
5412
|
+
return ce(l) ? (l.nodeName || "").toLowerCase() : "#document";
|
|
5401
5413
|
}
|
|
5402
|
-
function X(
|
|
5414
|
+
function X(l) {
|
|
5403
5415
|
var t;
|
|
5404
|
-
return (
|
|
5416
|
+
return (l == null || (t = l.ownerDocument) == null ? void 0 : t.defaultView) || window;
|
|
5405
5417
|
}
|
|
5406
|
-
function V(
|
|
5418
|
+
function V(l) {
|
|
5407
5419
|
var t;
|
|
5408
|
-
return (t = (ce(
|
|
5420
|
+
return (t = (ce(l) ? l.ownerDocument : l.document) || window.document) == null ? void 0 : t.documentElement;
|
|
5409
5421
|
}
|
|
5410
|
-
function ce(
|
|
5411
|
-
return gt() ?
|
|
5422
|
+
function ce(l) {
|
|
5423
|
+
return gt() ? l instanceof Node || l instanceof X(l).Node : !1;
|
|
5412
5424
|
}
|
|
5413
|
-
function B(
|
|
5414
|
-
return gt() ?
|
|
5425
|
+
function B(l) {
|
|
5426
|
+
return gt() ? l instanceof Element || l instanceof X(l).Element : !1;
|
|
5415
5427
|
}
|
|
5416
|
-
function K(
|
|
5417
|
-
return gt() ?
|
|
5428
|
+
function K(l) {
|
|
5429
|
+
return gt() ? l instanceof HTMLElement || l instanceof X(l).HTMLElement : !1;
|
|
5418
5430
|
}
|
|
5419
|
-
function qt(
|
|
5420
|
-
return !gt() || typeof ShadowRoot > "u" ? !1 :
|
|
5431
|
+
function qt(l) {
|
|
5432
|
+
return !gt() || typeof ShadowRoot > "u" ? !1 : l instanceof ShadowRoot || l instanceof X(l).ShadowRoot;
|
|
5421
5433
|
}
|
|
5422
|
-
function
|
|
5434
|
+
function ht(l) {
|
|
5423
5435
|
const {
|
|
5424
5436
|
overflow: t,
|
|
5425
5437
|
overflowX: e,
|
|
5426
5438
|
overflowY: i,
|
|
5427
5439
|
display: s
|
|
5428
|
-
} = F(
|
|
5440
|
+
} = F(l);
|
|
5429
5441
|
return /auto|scroll|overlay|hidden|clip/.test(t + i + e) && !["inline", "contents"].includes(s);
|
|
5430
5442
|
}
|
|
5431
|
-
function Xi(
|
|
5432
|
-
return ["table", "td", "th"].includes(tt(
|
|
5443
|
+
function Xi(l) {
|
|
5444
|
+
return ["table", "td", "th"].includes(tt(l));
|
|
5433
5445
|
}
|
|
5434
|
-
function wt(
|
|
5446
|
+
function wt(l) {
|
|
5435
5447
|
return [":popover-open", ":modal"].some((t) => {
|
|
5436
5448
|
try {
|
|
5437
|
-
return
|
|
5449
|
+
return l.matches(t);
|
|
5438
5450
|
} catch {
|
|
5439
5451
|
return !1;
|
|
5440
5452
|
}
|
|
5441
5453
|
});
|
|
5442
5454
|
}
|
|
5443
|
-
function Dt(
|
|
5444
|
-
const t = Xt(), e = B(
|
|
5455
|
+
function Dt(l) {
|
|
5456
|
+
const t = Xt(), e = B(l) ? F(l) : l;
|
|
5445
5457
|
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));
|
|
5446
5458
|
}
|
|
5447
|
-
function Bi(
|
|
5448
|
-
let t = $(
|
|
5459
|
+
function Bi(l) {
|
|
5460
|
+
let t = $(l);
|
|
5449
5461
|
for (; K(t) && !Q(t); ) {
|
|
5450
5462
|
if (Dt(t))
|
|
5451
5463
|
return t;
|
|
@@ -5458,65 +5470,65 @@ function Bi(h) {
|
|
|
5458
5470
|
function Xt() {
|
|
5459
5471
|
return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
|
|
5460
5472
|
}
|
|
5461
|
-
function Q(
|
|
5462
|
-
return ["html", "body", "#document"].includes(tt(
|
|
5473
|
+
function Q(l) {
|
|
5474
|
+
return ["html", "body", "#document"].includes(tt(l));
|
|
5463
5475
|
}
|
|
5464
|
-
function F(
|
|
5465
|
-
return X(
|
|
5476
|
+
function F(l) {
|
|
5477
|
+
return X(l).getComputedStyle(l);
|
|
5466
5478
|
}
|
|
5467
|
-
function pt(
|
|
5468
|
-
return B(
|
|
5469
|
-
scrollLeft:
|
|
5470
|
-
scrollTop:
|
|
5479
|
+
function pt(l) {
|
|
5480
|
+
return B(l) ? {
|
|
5481
|
+
scrollLeft: l.scrollLeft,
|
|
5482
|
+
scrollTop: l.scrollTop
|
|
5471
5483
|
} : {
|
|
5472
|
-
scrollLeft:
|
|
5473
|
-
scrollTop:
|
|
5484
|
+
scrollLeft: l.scrollX,
|
|
5485
|
+
scrollTop: l.scrollY
|
|
5474
5486
|
};
|
|
5475
5487
|
}
|
|
5476
|
-
function $(
|
|
5477
|
-
if (tt(
|
|
5478
|
-
return
|
|
5488
|
+
function $(l) {
|
|
5489
|
+
if (tt(l) === "html")
|
|
5490
|
+
return l;
|
|
5479
5491
|
const t = (
|
|
5480
5492
|
// Step into the shadow DOM of the parent of a slotted node.
|
|
5481
|
-
|
|
5482
|
-
|
|
5483
|
-
qt(
|
|
5484
|
-
V(
|
|
5493
|
+
l.assignedSlot || // DOM Element detected.
|
|
5494
|
+
l.parentNode || // ShadowRoot detected.
|
|
5495
|
+
qt(l) && l.host || // Fallback.
|
|
5496
|
+
V(l)
|
|
5485
5497
|
);
|
|
5486
5498
|
return qt(t) ? t.host : t;
|
|
5487
5499
|
}
|
|
5488
|
-
function de(
|
|
5489
|
-
const t = $(
|
|
5490
|
-
return Q(t) ?
|
|
5500
|
+
function de(l) {
|
|
5501
|
+
const t = $(l);
|
|
5502
|
+
return Q(t) ? l.ownerDocument ? l.ownerDocument.body : l.body : K(t) && ht(t) ? t : de(t);
|
|
5491
5503
|
}
|
|
5492
|
-
function
|
|
5504
|
+
function St(l, t, e) {
|
|
5493
5505
|
var i;
|
|
5494
5506
|
t === void 0 && (t = []), e === void 0 && (e = !0);
|
|
5495
|
-
const s = de(
|
|
5507
|
+
const s = de(l), r = s === ((i = l.ownerDocument) == null ? void 0 : i.body), o = X(s);
|
|
5496
5508
|
if (r) {
|
|
5497
|
-
const n =
|
|
5498
|
-
return t.concat(o, o.visualViewport || [],
|
|
5509
|
+
const n = Lt(o);
|
|
5510
|
+
return t.concat(o, o.visualViewport || [], ht(s) ? s : [], n && e ? St(n) : []);
|
|
5499
5511
|
}
|
|
5500
|
-
return t.concat(s,
|
|
5512
|
+
return t.concat(s, St(s, [], e));
|
|
5501
5513
|
}
|
|
5502
|
-
function
|
|
5503
|
-
return
|
|
5514
|
+
function Lt(l) {
|
|
5515
|
+
return l.parent && Object.getPrototypeOf(l.parent) ? l.frameElement : null;
|
|
5504
5516
|
}
|
|
5505
|
-
function fe(
|
|
5506
|
-
const t = F(
|
|
5517
|
+
function fe(l) {
|
|
5518
|
+
const t = F(l);
|
|
5507
5519
|
let e = parseFloat(t.width) || 0, i = parseFloat(t.height) || 0;
|
|
5508
|
-
const s = K(
|
|
5520
|
+
const s = K(l), r = s ? l.offsetWidth : e, o = s ? l.offsetHeight : i, n = ft(e) !== r || ft(i) !== o;
|
|
5509
5521
|
return n && (e = r, i = o), {
|
|
5510
5522
|
width: e,
|
|
5511
5523
|
height: i,
|
|
5512
5524
|
$: n
|
|
5513
5525
|
};
|
|
5514
5526
|
}
|
|
5515
|
-
function xe(
|
|
5516
|
-
return B(
|
|
5527
|
+
function xe(l) {
|
|
5528
|
+
return B(l) ? l : l.contextElement;
|
|
5517
5529
|
}
|
|
5518
|
-
function Z(
|
|
5519
|
-
const t = xe(
|
|
5530
|
+
function Z(l) {
|
|
5531
|
+
const t = xe(l);
|
|
5520
5532
|
if (!K(t))
|
|
5521
5533
|
return z(1);
|
|
5522
5534
|
const e = t.getBoundingClientRect(), {
|
|
@@ -5531,74 +5543,74 @@ function Z(h) {
|
|
|
5531
5543
|
};
|
|
5532
5544
|
}
|
|
5533
5545
|
const Fi = /* @__PURE__ */ z(0);
|
|
5534
|
-
function ue(
|
|
5535
|
-
const t = X(
|
|
5546
|
+
function ue(l) {
|
|
5547
|
+
const t = X(l);
|
|
5536
5548
|
return !Xt() || !t.visualViewport ? Fi : {
|
|
5537
5549
|
x: t.visualViewport.offsetLeft,
|
|
5538
5550
|
y: t.visualViewport.offsetTop
|
|
5539
5551
|
};
|
|
5540
5552
|
}
|
|
5541
|
-
function Ni(
|
|
5542
|
-
return t === void 0 && (t = !1), !e || t && e !== X(
|
|
5553
|
+
function Ni(l, t, e) {
|
|
5554
|
+
return t === void 0 && (t = !1), !e || t && e !== X(l) ? !1 : t;
|
|
5543
5555
|
}
|
|
5544
|
-
function ot(
|
|
5556
|
+
function ot(l, t, e, i) {
|
|
5545
5557
|
t === void 0 && (t = !1), e === void 0 && (e = !1);
|
|
5546
|
-
const s =
|
|
5558
|
+
const s = l.getBoundingClientRect(), r = xe(l);
|
|
5547
5559
|
let o = z(1);
|
|
5548
|
-
t && (i ? B(i) && (o = Z(i)) : o = Z(
|
|
5560
|
+
t && (i ? B(i) && (o = Z(i)) : o = Z(l));
|
|
5549
5561
|
const n = Ni(r, e, i) ? ue(r) : z(0);
|
|
5550
|
-
let
|
|
5562
|
+
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;
|
|
5551
5563
|
if (r) {
|
|
5552
5564
|
const x = X(r), g = i && B(i) ? X(i) : i;
|
|
5553
|
-
let p = x, u =
|
|
5565
|
+
let p = x, u = Lt(p);
|
|
5554
5566
|
for (; u && i && g !== p; ) {
|
|
5555
5567
|
const w = Z(u), m = u.getBoundingClientRect(), C = F(u), y = m.left + (u.clientLeft + parseFloat(C.paddingLeft)) * w.x, b = m.top + (u.clientTop + parseFloat(C.paddingTop)) * w.y;
|
|
5556
|
-
|
|
5568
|
+
h *= w.x, c *= w.y, d *= w.x, f *= w.y, h += y, c += b, p = X(u), u = Lt(p);
|
|
5557
5569
|
}
|
|
5558
5570
|
}
|
|
5559
5571
|
return ut({
|
|
5560
5572
|
width: d,
|
|
5561
5573
|
height: f,
|
|
5562
|
-
x:
|
|
5574
|
+
x: h,
|
|
5563
5575
|
y: c
|
|
5564
5576
|
});
|
|
5565
5577
|
}
|
|
5566
|
-
function ki(
|
|
5578
|
+
function ki(l) {
|
|
5567
5579
|
let {
|
|
5568
5580
|
elements: t,
|
|
5569
5581
|
rect: e,
|
|
5570
5582
|
offsetParent: i,
|
|
5571
5583
|
strategy: s
|
|
5572
|
-
} =
|
|
5584
|
+
} = l;
|
|
5573
5585
|
const r = s === "fixed", o = V(i), n = t ? wt(t.floating) : !1;
|
|
5574
5586
|
if (i === o || n && r)
|
|
5575
5587
|
return e;
|
|
5576
|
-
let
|
|
5588
|
+
let h = {
|
|
5577
5589
|
scrollLeft: 0,
|
|
5578
5590
|
scrollTop: 0
|
|
5579
5591
|
}, c = z(1);
|
|
5580
5592
|
const d = z(0), f = K(i);
|
|
5581
|
-
if ((f || !f && !r) && ((tt(i) !== "body" ||
|
|
5593
|
+
if ((f || !f && !r) && ((tt(i) !== "body" || ht(o)) && (h = pt(i)), K(i))) {
|
|
5582
5594
|
const x = ot(i);
|
|
5583
5595
|
c = Z(i), d.x = x.x + i.clientLeft, d.y = x.y + i.clientTop;
|
|
5584
5596
|
}
|
|
5585
5597
|
return {
|
|
5586
5598
|
width: e.width * c.x,
|
|
5587
5599
|
height: e.height * c.y,
|
|
5588
|
-
x: e.x * c.x -
|
|
5589
|
-
y: e.y * c.y -
|
|
5600
|
+
x: e.x * c.x - h.scrollLeft * c.x + d.x,
|
|
5601
|
+
y: e.y * c.y - h.scrollTop * c.y + d.y
|
|
5590
5602
|
};
|
|
5591
5603
|
}
|
|
5592
|
-
function Ki(
|
|
5593
|
-
return Array.from(
|
|
5604
|
+
function Ki(l) {
|
|
5605
|
+
return Array.from(l.getClientRects());
|
|
5594
5606
|
}
|
|
5595
|
-
function Tt(
|
|
5596
|
-
const e = pt(
|
|
5597
|
-
return t ? t.left + e : ot(V(
|
|
5607
|
+
function Tt(l, t) {
|
|
5608
|
+
const e = pt(l).scrollLeft;
|
|
5609
|
+
return t ? t.left + e : ot(V(l)).left + e;
|
|
5598
5610
|
}
|
|
5599
|
-
function Yi(
|
|
5600
|
-
const t = V(
|
|
5601
|
-
let o = -e.scrollLeft + Tt(
|
|
5611
|
+
function Yi(l) {
|
|
5612
|
+
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);
|
|
5613
|
+
let o = -e.scrollLeft + Tt(l);
|
|
5602
5614
|
const n = -e.scrollTop;
|
|
5603
5615
|
return F(i).direction === "rtl" && (o += U(t.clientWidth, i.clientWidth) - s), {
|
|
5604
5616
|
width: s,
|
|
@@ -5607,40 +5619,40 @@ function Yi(h) {
|
|
|
5607
5619
|
y: n
|
|
5608
5620
|
};
|
|
5609
5621
|
}
|
|
5610
|
-
function Vi(
|
|
5611
|
-
const e = X(
|
|
5612
|
-
let r = i.clientWidth, o = i.clientHeight, n = 0,
|
|
5622
|
+
function Vi(l, t) {
|
|
5623
|
+
const e = X(l), i = V(l), s = e.visualViewport;
|
|
5624
|
+
let r = i.clientWidth, o = i.clientHeight, n = 0, h = 0;
|
|
5613
5625
|
if (s) {
|
|
5614
5626
|
r = s.width, o = s.height;
|
|
5615
5627
|
const c = Xt();
|
|
5616
|
-
(!c || c && t === "fixed") && (n = s.offsetLeft,
|
|
5628
|
+
(!c || c && t === "fixed") && (n = s.offsetLeft, h = s.offsetTop);
|
|
5617
5629
|
}
|
|
5618
5630
|
return {
|
|
5619
5631
|
width: r,
|
|
5620
5632
|
height: o,
|
|
5621
5633
|
x: n,
|
|
5622
|
-
y:
|
|
5634
|
+
y: h
|
|
5623
5635
|
};
|
|
5624
5636
|
}
|
|
5625
|
-
function Wi(
|
|
5626
|
-
const e = ot(
|
|
5637
|
+
function Wi(l, t) {
|
|
5638
|
+
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;
|
|
5627
5639
|
return {
|
|
5628
5640
|
width: o,
|
|
5629
5641
|
height: n,
|
|
5630
|
-
x:
|
|
5642
|
+
x: h,
|
|
5631
5643
|
y: c
|
|
5632
5644
|
};
|
|
5633
5645
|
}
|
|
5634
|
-
function Gt(
|
|
5646
|
+
function Gt(l, t, e) {
|
|
5635
5647
|
let i;
|
|
5636
5648
|
if (t === "viewport")
|
|
5637
|
-
i = Vi(
|
|
5649
|
+
i = Vi(l, e);
|
|
5638
5650
|
else if (t === "document")
|
|
5639
|
-
i = Yi(V(
|
|
5651
|
+
i = Yi(V(l));
|
|
5640
5652
|
else if (B(t))
|
|
5641
5653
|
i = Wi(t, e);
|
|
5642
5654
|
else {
|
|
5643
|
-
const s = ue(
|
|
5655
|
+
const s = ue(l);
|
|
5644
5656
|
i = {
|
|
5645
5657
|
...t,
|
|
5646
5658
|
x: t.x - s.x,
|
|
@@ -5649,70 +5661,70 @@ function Gt(h, t, e) {
|
|
|
5649
5661
|
}
|
|
5650
5662
|
return ut(i);
|
|
5651
5663
|
}
|
|
5652
|
-
function ge(
|
|
5653
|
-
const e = $(
|
|
5664
|
+
function ge(l, t) {
|
|
5665
|
+
const e = $(l);
|
|
5654
5666
|
return e === t || !B(e) || Q(e) ? !1 : F(e).position === "fixed" || ge(e, t);
|
|
5655
5667
|
}
|
|
5656
|
-
function Pi(
|
|
5657
|
-
const e = t.get(
|
|
5668
|
+
function Pi(l, t) {
|
|
5669
|
+
const e = t.get(l);
|
|
5658
5670
|
if (e)
|
|
5659
5671
|
return e;
|
|
5660
|
-
let i =
|
|
5661
|
-
const r = F(
|
|
5662
|
-
let o = r ? $(
|
|
5672
|
+
let i = St(l, [], !1).filter((n) => B(n) && tt(n) !== "body"), s = null;
|
|
5673
|
+
const r = F(l).position === "fixed";
|
|
5674
|
+
let o = r ? $(l) : l;
|
|
5663
5675
|
for (; B(o) && !Q(o); ) {
|
|
5664
|
-
const n = F(o),
|
|
5665
|
-
!
|
|
5676
|
+
const n = F(o), h = Dt(o);
|
|
5677
|
+
!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);
|
|
5666
5678
|
}
|
|
5667
|
-
return t.set(
|
|
5679
|
+
return t.set(l, i), i;
|
|
5668
5680
|
}
|
|
5669
|
-
function zi(
|
|
5681
|
+
function zi(l) {
|
|
5670
5682
|
let {
|
|
5671
5683
|
element: t,
|
|
5672
5684
|
boundary: e,
|
|
5673
5685
|
rootBoundary: i,
|
|
5674
5686
|
strategy: s
|
|
5675
|
-
} =
|
|
5676
|
-
const o = [...e === "clippingAncestors" ? wt(t) ? [] : Pi(t, this._c) : [].concat(e), i], n = o[0],
|
|
5687
|
+
} = l;
|
|
5688
|
+
const o = [...e === "clippingAncestors" ? wt(t) ? [] : Pi(t, this._c) : [].concat(e), i], n = o[0], h = o.reduce((c, d) => {
|
|
5677
5689
|
const f = Gt(t, d, s);
|
|
5678
5690
|
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;
|
|
5679
5691
|
}, Gt(t, n, s));
|
|
5680
5692
|
return {
|
|
5681
|
-
width:
|
|
5682
|
-
height:
|
|
5683
|
-
x:
|
|
5684
|
-
y:
|
|
5693
|
+
width: h.right - h.left,
|
|
5694
|
+
height: h.bottom - h.top,
|
|
5695
|
+
x: h.left,
|
|
5696
|
+
y: h.top
|
|
5685
5697
|
};
|
|
5686
5698
|
}
|
|
5687
|
-
function $i(
|
|
5699
|
+
function $i(l) {
|
|
5688
5700
|
const {
|
|
5689
5701
|
width: t,
|
|
5690
5702
|
height: e
|
|
5691
|
-
} = fe(
|
|
5703
|
+
} = fe(l);
|
|
5692
5704
|
return {
|
|
5693
5705
|
width: t,
|
|
5694
5706
|
height: e
|
|
5695
5707
|
};
|
|
5696
5708
|
}
|
|
5697
|
-
function qi(
|
|
5698
|
-
const i = K(t), s = V(t), r = e === "fixed", o = ot(
|
|
5709
|
+
function qi(l, t, e) {
|
|
5710
|
+
const i = K(t), s = V(t), r = e === "fixed", o = ot(l, !0, r, t);
|
|
5699
5711
|
let n = {
|
|
5700
5712
|
scrollLeft: 0,
|
|
5701
5713
|
scrollTop: 0
|
|
5702
5714
|
};
|
|
5703
|
-
const
|
|
5715
|
+
const h = z(0);
|
|
5704
5716
|
if (i || !i && !r)
|
|
5705
|
-
if ((tt(t) !== "body" ||
|
|
5717
|
+
if ((tt(t) !== "body" || ht(s)) && (n = pt(t)), i) {
|
|
5706
5718
|
const g = ot(t, !0, r, t);
|
|
5707
|
-
|
|
5708
|
-
} else s && (
|
|
5719
|
+
h.x = g.x + t.clientLeft, h.y = g.y + t.clientTop;
|
|
5720
|
+
} else s && (h.x = Tt(s));
|
|
5709
5721
|
let c = 0, d = 0;
|
|
5710
5722
|
if (s && !i && !r) {
|
|
5711
5723
|
const g = s.getBoundingClientRect();
|
|
5712
5724
|
d = g.top + n.scrollTop, c = g.left + n.scrollLeft - // RTL <body> scrollbar.
|
|
5713
5725
|
Tt(s, g);
|
|
5714
5726
|
}
|
|
5715
|
-
const f = o.left + n.scrollLeft -
|
|
5727
|
+
const f = o.left + n.scrollLeft - h.x - c, x = o.top + n.scrollTop - h.y - d;
|
|
5716
5728
|
return {
|
|
5717
5729
|
x: f,
|
|
5718
5730
|
y: x,
|
|
@@ -5720,23 +5732,23 @@ function qi(h, t, e) {
|
|
|
5720
5732
|
height: o.height
|
|
5721
5733
|
};
|
|
5722
5734
|
}
|
|
5723
|
-
function yt(
|
|
5724
|
-
return F(
|
|
5735
|
+
function yt(l) {
|
|
5736
|
+
return F(l).position === "static";
|
|
5725
5737
|
}
|
|
5726
|
-
function jt(
|
|
5727
|
-
if (!K(
|
|
5738
|
+
function jt(l, t) {
|
|
5739
|
+
if (!K(l) || F(l).position === "fixed")
|
|
5728
5740
|
return null;
|
|
5729
5741
|
if (t)
|
|
5730
|
-
return t(
|
|
5731
|
-
let e =
|
|
5732
|
-
return V(
|
|
5742
|
+
return t(l);
|
|
5743
|
+
let e = l.offsetParent;
|
|
5744
|
+
return V(l) === e && (e = e.ownerDocument.body), e;
|
|
5733
5745
|
}
|
|
5734
|
-
function we(
|
|
5735
|
-
const e = X(
|
|
5736
|
-
if (wt(
|
|
5746
|
+
function we(l, t) {
|
|
5747
|
+
const e = X(l);
|
|
5748
|
+
if (wt(l))
|
|
5737
5749
|
return e;
|
|
5738
|
-
if (!K(
|
|
5739
|
-
let s = $(
|
|
5750
|
+
if (!K(l)) {
|
|
5751
|
+
let s = $(l);
|
|
5740
5752
|
for (; s && !Q(s); ) {
|
|
5741
5753
|
if (B(s) && !yt(s))
|
|
5742
5754
|
return s;
|
|
@@ -5744,15 +5756,15 @@ function we(h, t) {
|
|
|
5744
5756
|
}
|
|
5745
5757
|
return e;
|
|
5746
5758
|
}
|
|
5747
|
-
let i = jt(
|
|
5759
|
+
let i = jt(l, t);
|
|
5748
5760
|
for (; i && Xi(i) && yt(i); )
|
|
5749
5761
|
i = jt(i, t);
|
|
5750
|
-
return i && Q(i) && yt(i) && !Dt(i) ? e : i || Bi(
|
|
5762
|
+
return i && Q(i) && yt(i) && !Dt(i) ? e : i || Bi(l) || e;
|
|
5751
5763
|
}
|
|
5752
|
-
const Gi = async function(
|
|
5753
|
-
const t = this.getOffsetParent || we, e = this.getDimensions, i = await e(
|
|
5764
|
+
const Gi = async function(l) {
|
|
5765
|
+
const t = this.getOffsetParent || we, e = this.getDimensions, i = await e(l.floating);
|
|
5754
5766
|
return {
|
|
5755
|
-
reference: qi(
|
|
5767
|
+
reference: qi(l.reference, await t(l.floating), l.strategy),
|
|
5756
5768
|
floating: {
|
|
5757
5769
|
x: 0,
|
|
5758
5770
|
y: 0,
|
|
@@ -5761,8 +5773,8 @@ const Gi = async function(h) {
|
|
|
5761
5773
|
}
|
|
5762
5774
|
};
|
|
5763
5775
|
};
|
|
5764
|
-
function ji(
|
|
5765
|
-
return F(
|
|
5776
|
+
function ji(l) {
|
|
5777
|
+
return F(l).direction === "rtl";
|
|
5766
5778
|
}
|
|
5767
5779
|
const Ui = {
|
|
5768
5780
|
convertOffsetParentRelativeRectToViewportRelativeRect: ki,
|
|
@@ -5775,7 +5787,7 @@ const Ui = {
|
|
|
5775
5787
|
getScale: Z,
|
|
5776
5788
|
isElement: B,
|
|
5777
5789
|
isRTL: ji
|
|
5778
|
-
}, pe = Hi, me = Di, ye = Ai, Zi = Ti, Ee = (
|
|
5790
|
+
}, pe = Hi, me = Di, ye = Ai, Zi = Ti, Ee = (l, t, e) => {
|
|
5779
5791
|
const i = /* @__PURE__ */ new Map(), s = {
|
|
5780
5792
|
platform: Ui,
|
|
5781
5793
|
...e
|
|
@@ -5783,7 +5795,7 @@ const Ui = {
|
|
|
5783
5795
|
...s.platform,
|
|
5784
5796
|
_c: i
|
|
5785
5797
|
};
|
|
5786
|
-
return
|
|
5798
|
+
return Li(l, t, {
|
|
5787
5799
|
...s,
|
|
5788
5800
|
platform: r
|
|
5789
5801
|
});
|
|
@@ -5809,7 +5821,7 @@ let Ji = class {
|
|
|
5809
5821
|
borderRadius: "4px",
|
|
5810
5822
|
fontSize: "12px",
|
|
5811
5823
|
...r
|
|
5812
|
-
},
|
|
5824
|
+
}, h = {
|
|
5813
5825
|
position: "absolute",
|
|
5814
5826
|
width: "10px",
|
|
5815
5827
|
height: "10px",
|
|
@@ -5818,7 +5830,7 @@ let Ji = class {
|
|
|
5818
5830
|
transform: "rotate(45deg)",
|
|
5819
5831
|
zIndex: n.zIndex
|
|
5820
5832
|
};
|
|
5821
|
-
Object.assign(this.arrowEl.style,
|
|
5833
|
+
Object.assign(this.arrowEl.style, h), Object.assign(this.floatingEl.style, n), this.floatingEl.appendChild(this.contentEl), this.floatingEl.appendChild(this.arrowEl), this.ctx.containerElement.appendChild(this.floatingEl), this.init();
|
|
5822
5834
|
}
|
|
5823
5835
|
init() {
|
|
5824
5836
|
this.ctx.on("mousemove", (t) => {
|
|
@@ -5862,10 +5874,10 @@ let Ji = class {
|
|
|
5862
5874
|
placement: t.overflowTooltipPlacement,
|
|
5863
5875
|
middleware: [me(), ye(), pe(6), Zi({ element: this.arrowEl })]
|
|
5864
5876
|
}).then((n) => {
|
|
5865
|
-
const { x:
|
|
5877
|
+
const { x: h, y: c, placement: d, middlewareData: f } = n;
|
|
5866
5878
|
if (Object.assign(this.floatingEl.style, {
|
|
5867
5879
|
top: `${c}px`,
|
|
5868
|
-
left: `${
|
|
5880
|
+
left: `${h}px`
|
|
5869
5881
|
}), f.arrow) {
|
|
5870
5882
|
const x = f.arrow;
|
|
5871
5883
|
["left", "left-start", "left-end"].includes(d) ? Object.assign(this.arrowEl.style, {
|
|
@@ -5930,15 +5942,15 @@ class Qi {
|
|
|
5930
5942
|
return;
|
|
5931
5943
|
if (t.code === "Escape" && this.ctx.editing) {
|
|
5932
5944
|
this.cancel = !0;
|
|
5933
|
-
const { focusCell:
|
|
5934
|
-
|
|
5945
|
+
const { focusCell: h } = this.ctx;
|
|
5946
|
+
h && (this.ctx.emit("setSelectorCell", h), this.cellTarget = h), this.doneEdit();
|
|
5935
5947
|
return;
|
|
5936
5948
|
}
|
|
5937
5949
|
if ((t.altKey || t.metaKey) && t.code === "Enter" && this.ctx.editing && this.inputEl) {
|
|
5938
5950
|
t.preventDefault();
|
|
5939
|
-
const
|
|
5951
|
+
const h = this.inputEl.selectionStart, c = this.inputEl.value.substring(0, h), d = this.inputEl.value.substring(h);
|
|
5940
5952
|
this.inputEl.value = c + `
|
|
5941
|
-
` + d, this.inputEl.selectionStart = this.inputEl.selectionEnd =
|
|
5953
|
+
` + d, this.inputEl.selectionStart = this.inputEl.selectionEnd = h + 1, this.autoSize();
|
|
5942
5954
|
return;
|
|
5943
5955
|
}
|
|
5944
5956
|
if (t.code === "Tab" && this.ctx.editing) {
|
|
@@ -6018,8 +6030,8 @@ class Qi {
|
|
|
6018
6030
|
});
|
|
6019
6031
|
}
|
|
6020
6032
|
isInSelectorRange(t, e) {
|
|
6021
|
-
const { xArr: i, yArr: s } = this.ctx.selector, [r, o] = i, [n,
|
|
6022
|
-
return !(e < r || e > o || t < n || t >
|
|
6033
|
+
const { xArr: i, yArr: s } = this.ctx.selector, [r, o] = i, [n, h] = s;
|
|
6034
|
+
return !(e < r || e > o || t < n || t > h);
|
|
6023
6035
|
}
|
|
6024
6036
|
initTextEditor() {
|
|
6025
6037
|
this.inputEl = document.createElement("textarea"), this.inputEl.setAttribute("rows", "1"), this.inputEl.addEventListener("input", this.autoSize.bind(this)), this.inputEl.addEventListener("blur", () => {
|
|
@@ -6041,8 +6053,8 @@ class Qi {
|
|
|
6041
6053
|
startEditByInput(t, e = !1) {
|
|
6042
6054
|
const i = e ? null : t.getValue(), { editorType: s } = t;
|
|
6043
6055
|
t.update(), this.ctx.config.ENABLE_MERGE_CELL_LINK && t.updateSpanInfo();
|
|
6044
|
-
let { height: r, width: o, drawY: n, drawX:
|
|
6045
|
-
this.drawX =
|
|
6056
|
+
let { height: r, width: o, drawY: n, drawX: h } = t;
|
|
6057
|
+
this.drawX = h, this.drawY = n;
|
|
6046
6058
|
const {
|
|
6047
6059
|
config: { CELL_PADDING: c },
|
|
6048
6060
|
header: d
|
|
@@ -6063,18 +6075,18 @@ class Qi {
|
|
|
6063
6075
|
}
|
|
6064
6076
|
}
|
|
6065
6077
|
startEdit(t = !1) {
|
|
6066
|
-
this.
|
|
6078
|
+
this.cancel = !1;
|
|
6067
6079
|
const { ENABLE_EDIT_CLICK_SELECTOR: e } = this.ctx.config;
|
|
6068
6080
|
if (!e)
|
|
6069
6081
|
return;
|
|
6070
6082
|
const i = this.ctx.focusCell;
|
|
6071
|
-
if (!i || ["index", "index-selection", "selection"].includes(i.type) || this.enable || !(i.isVerticalVisible() && i.isHorizontalVisible()))
|
|
6083
|
+
if (!i || ["index", "index-selection", "selection"].includes(i.type) || this.enable || (this.ctx.emit("drawView"), !(i.isVerticalVisible() && i.isHorizontalVisible())))
|
|
6072
6084
|
return;
|
|
6073
6085
|
const { rowKey: r, key: o, editorType: n } = i;
|
|
6074
6086
|
if (n === "none")
|
|
6075
6087
|
return;
|
|
6076
|
-
const
|
|
6077
|
-
i && !
|
|
6088
|
+
const h = this.ctx.database.getReadonly(r, o);
|
|
6089
|
+
i && !h && (this.enable = !0, this.ctx.editing = !0, this.cellTarget = i, this.startEditByInput(this.cellTarget, t), this.ctx.emit("startEdit", this.cellTarget));
|
|
6078
6090
|
}
|
|
6079
6091
|
editCell(t, e) {
|
|
6080
6092
|
const i = this.ctx.body.renderRows.find((c) => c.rowIndex === t);
|
|
@@ -6087,8 +6099,8 @@ class Qi {
|
|
|
6087
6099
|
const r = this.ctx.focusCell;
|
|
6088
6100
|
if (!r || ["index", "index-selection", "selection"].includes(r.type) || this.enable)
|
|
6089
6101
|
return;
|
|
6090
|
-
const { rowKey: o, key: n } = r,
|
|
6091
|
-
r && !
|
|
6102
|
+
const { rowKey: o, key: n } = r, h = this.ctx.database.getReadonly(o, n);
|
|
6103
|
+
r && !h && (this.enable = !0, this.ctx.editing = !0, this.cellTarget = r, this.startEditByInput(this.cellTarget), this.ctx.emit("startEdit", this.cellTarget));
|
|
6092
6104
|
}
|
|
6093
6105
|
doneEdit() {
|
|
6094
6106
|
this.enable && (this.doneEditByInput(), this.ctx.emit("doneEdit", this.cellTarget), this.enable = !1, this.ctx.editing = !1, this.ctx.containerElement.focus({ preventScroll: !0 }), this.editorEl.style.display = "none", this.ctx.emit("drawView"));
|
|
@@ -6108,13 +6120,13 @@ class ts {
|
|
|
6108
6120
|
this.ctx = t;
|
|
6109
6121
|
const { EMPTY_TEXT: e, EMPTY_CUSTOM_STYLE: i } = this.ctx.config;
|
|
6110
6122
|
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 }) => {
|
|
6111
|
-
const
|
|
6123
|
+
const h = r + (o + n) / 2, c = {
|
|
6112
6124
|
display: s === "empty" ? "block" : "none",
|
|
6113
6125
|
position: "absolute",
|
|
6114
6126
|
fontSize: "14px",
|
|
6115
6127
|
color: "#666",
|
|
6116
6128
|
left: "50%",
|
|
6117
|
-
top: `${
|
|
6129
|
+
top: `${h}px`,
|
|
6118
6130
|
transform: "translate(-50%, -50%)",
|
|
6119
6131
|
...i
|
|
6120
6132
|
};
|
|
@@ -6154,9 +6166,9 @@ class es {
|
|
|
6154
6166
|
fixedRightWidth: e,
|
|
6155
6167
|
config: { SCROLLER_TRACK_SIZE: i, CSS_PREFIX: s }
|
|
6156
6168
|
} = this.ctx, { visibleWidth: r, visibleHeight: o, renderCellHeaders: n } = this.ctx.header;
|
|
6157
|
-
let
|
|
6169
|
+
let h = [], c = [], d = [];
|
|
6158
6170
|
n.forEach((w) => {
|
|
6159
|
-
w.render && (w.fixed === "left" ? c.push(w) : w.fixed === "right" ? d.push(w) :
|
|
6171
|
+
w.render && (w.fixed === "left" ? c.push(w) : w.fixed === "right" ? d.push(w) : h.push(w));
|
|
6160
6172
|
});
|
|
6161
6173
|
const f = e - i, x = {
|
|
6162
6174
|
key: "left",
|
|
@@ -6179,7 +6191,7 @@ class es {
|
|
|
6179
6191
|
width: `${r - t - f + 1}px`,
|
|
6180
6192
|
height: `${o}px`
|
|
6181
6193
|
},
|
|
6182
|
-
cells:
|
|
6194
|
+
cells: h
|
|
6183
6195
|
}, p = {
|
|
6184
6196
|
key: "right",
|
|
6185
6197
|
style: {
|
|
@@ -6215,7 +6227,7 @@ class es {
|
|
|
6215
6227
|
const {
|
|
6216
6228
|
fixedLeftWidth: r,
|
|
6217
6229
|
fixedRightWidth: o,
|
|
6218
|
-
config: { SCROLLER_TRACK_SIZE: n, CSS_PREFIX:
|
|
6230
|
+
config: { SCROLLER_TRACK_SIZE: n, CSS_PREFIX: h }
|
|
6219
6231
|
} = this.ctx, { visibleWidth: c, visibleHeight: d } = this.ctx.body, f = o - n, x = {
|
|
6220
6232
|
key: "left",
|
|
6221
6233
|
style: {
|
|
@@ -6252,7 +6264,7 @@ class es {
|
|
|
6252
6264
|
};
|
|
6253
6265
|
return {
|
|
6254
6266
|
type: "body",
|
|
6255
|
-
class: `${
|
|
6267
|
+
class: `${h}-overlayer-body`,
|
|
6256
6268
|
style: {
|
|
6257
6269
|
position: "relative",
|
|
6258
6270
|
overflow: "hidden",
|
|
@@ -6273,7 +6285,7 @@ class es {
|
|
|
6273
6285
|
fixedLeftWidth: s,
|
|
6274
6286
|
fixedRightWidth: r,
|
|
6275
6287
|
config: { SCROLLER_TRACK_SIZE: o, CSS_PREFIX: n }
|
|
6276
|
-
} = this.ctx, { visibleWidth:
|
|
6288
|
+
} = this.ctx, { visibleWidth: h, visibleHeight: c } = this.ctx.footer, d = r - o, f = {
|
|
6277
6289
|
key: "left",
|
|
6278
6290
|
style: {
|
|
6279
6291
|
position: "absolute",
|
|
@@ -6291,7 +6303,7 @@ class es {
|
|
|
6291
6303
|
top: `${0.5}px`,
|
|
6292
6304
|
left: `${s - 0.5}px`,
|
|
6293
6305
|
overflow: "hidden",
|
|
6294
|
-
width: `${
|
|
6306
|
+
width: `${h - s - d}px`,
|
|
6295
6307
|
height: `${c}px`
|
|
6296
6308
|
},
|
|
6297
6309
|
cells: t
|
|
@@ -6313,7 +6325,7 @@ class es {
|
|
|
6313
6325
|
style: {
|
|
6314
6326
|
position: "relative",
|
|
6315
6327
|
overflow: "hidden",
|
|
6316
|
-
width: `${
|
|
6328
|
+
width: `${h}px`,
|
|
6317
6329
|
height: `${c}px`
|
|
6318
6330
|
},
|
|
6319
6331
|
views: [f, x, g]
|
|
@@ -6331,8 +6343,8 @@ class is {
|
|
|
6331
6343
|
this.ctx.on("cellContextMenuClick", (t, e) => {
|
|
6332
6344
|
if (!this.ctx.config.ENABLE_CONTEXT_MENU) return;
|
|
6333
6345
|
e.preventDefault();
|
|
6334
|
-
const { xArr: i, yArr: s } = this.ctx.selector, [r, o] = i, [n,
|
|
6335
|
-
c >= n && c <=
|
|
6346
|
+
const { xArr: i, yArr: s } = this.ctx.selector, [r, o] = i, [n, h] = s, { rowIndex: c, colIndex: d } = t;
|
|
6347
|
+
c >= n && c <= h && d >= r && d <= o || this.ctx.emit("setSelectorCell", t, e);
|
|
6336
6348
|
const x = {
|
|
6337
6349
|
getBoundingClientRect: () => ({
|
|
6338
6350
|
width: 0,
|
|
@@ -6437,16 +6449,16 @@ class os {
|
|
|
6437
6449
|
}
|
|
6438
6450
|
createContainer(t, e, i, s, r) {
|
|
6439
6451
|
t.className = "e-virt-table-container";
|
|
6440
|
-
const o = document.createElement("div"), n = document.createElement("canvas"),
|
|
6441
|
-
o.className = "e-virt-table-stage", t.tabIndex = 0, n.className = "e-virt-table-canvas",
|
|
6452
|
+
const o = document.createElement("div"), n = document.createElement("canvas"), h = e || document.createElement("div");
|
|
6453
|
+
o.className = "e-virt-table-stage", t.tabIndex = 0, n.className = "e-virt-table-canvas", h.className = "e-virt-table-overlayer";
|
|
6442
6454
|
const c = i || document.createElement("div");
|
|
6443
6455
|
c.className = "e-virt-table-editor";
|
|
6444
6456
|
const d = s, f = r;
|
|
6445
|
-
return o.appendChild(n), o.appendChild(
|
|
6457
|
+
return o.appendChild(n), o.appendChild(h), t.appendChild(o), {
|
|
6446
6458
|
containerElement: t,
|
|
6447
6459
|
stageElement: o,
|
|
6448
6460
|
canvasElement: n,
|
|
6449
|
-
overlayerElement:
|
|
6461
|
+
overlayerElement: h,
|
|
6450
6462
|
editorElement: c,
|
|
6451
6463
|
emptyElement: d,
|
|
6452
6464
|
contextMenuElement: f
|
|
@@ -6530,15 +6542,15 @@ class os {
|
|
|
6530
6542
|
return new Promise(async (i, s) => {
|
|
6531
6543
|
let r = [];
|
|
6532
6544
|
for (let o = 0; o < t.length; o++) {
|
|
6533
|
-
const { rowKey: n, key:
|
|
6545
|
+
const { rowKey: n, key: h } = t[o], c = await this.ctx.database.getValidator(n, h);
|
|
6534
6546
|
Array.isArray(c) && c.length && r.push(c);
|
|
6535
6547
|
}
|
|
6536
6548
|
if (r.length) {
|
|
6537
6549
|
if (s(r), e) {
|
|
6538
6550
|
const [o] = r;
|
|
6539
6551
|
if (Array.isArray(o) && o.length) {
|
|
6540
|
-
const [n] = o, { rowKey:
|
|
6541
|
-
this.scrollToRowkey(
|
|
6552
|
+
const [n] = o, { rowKey: h, key: c } = n;
|
|
6553
|
+
this.scrollToRowkey(h), this.scrollToColkey(c);
|
|
6542
6554
|
}
|
|
6543
6555
|
}
|
|
6544
6556
|
this.ctx.emit("draw");
|
|
@@ -6555,8 +6567,8 @@ class os {
|
|
|
6555
6567
|
if (t && Array.isArray(s) && s.length) {
|
|
6556
6568
|
const [r] = s;
|
|
6557
6569
|
if (Array.isArray(r) && r.length) {
|
|
6558
|
-
const [o] = r, { rowKey: n, key:
|
|
6559
|
-
this.scrollToRowkey(n), this.scrollToColkey(
|
|
6570
|
+
const [o] = r, { rowKey: n, key: h } = o;
|
|
6571
|
+
this.scrollToRowkey(n), this.scrollToColkey(h);
|
|
6560
6572
|
}
|
|
6561
6573
|
}
|
|
6562
6574
|
i(s);
|
|
@@ -6581,7 +6593,7 @@ class os {
|
|
|
6581
6593
|
let r = [];
|
|
6582
6594
|
for (let o = 0; o < i.length; o++)
|
|
6583
6595
|
for (let n = 0; n < s.length; n++) {
|
|
6584
|
-
const
|
|
6596
|
+
const h = this.ctx.database.getRowKeyByItem(i[o]), d = s[n].key, f = await this.ctx.database.getValidator(h, d);
|
|
6585
6597
|
Array.isArray(f) && f.length && r.push(f);
|
|
6586
6598
|
}
|
|
6587
6599
|
r.length ? (e(r), this.ctx.emit("draw")) : (t([]), this.ctx.emit("draw"));
|