e-virt-table 1.2.10 → 1.2.12
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 +1158 -1121
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +4 -4
- package/dist/index.umd.js.map +1 -1
- package/dist/lib/Body.js +1 -1
- package/dist/lib/Body.js.map +1 -1
- package/dist/lib/Cell.js +4 -4
- package/dist/lib/Cell.js.map +1 -1
- package/dist/lib/CellHeader.d.ts +2 -0
- package/dist/lib/CellHeader.js +14 -0
- package/dist/lib/CellHeader.js.map +1 -1
- package/dist/lib/Config.d.ts +0 -1
- package/dist/lib/Config.js +0 -6
- package/dist/lib/Config.js.map +1 -1
- package/dist/lib/Context.d.ts +1 -0
- package/dist/lib/Context.js +13 -1
- package/dist/lib/Context.js.map +1 -1
- package/dist/lib/ContextMenu.js +3 -0
- package/dist/lib/ContextMenu.js.map +1 -1
- package/dist/lib/Database.d.ts +1 -0
- package/dist/lib/Database.js +29 -12
- package/dist/lib/Database.js.map +1 -1
- package/dist/lib/EVirtTable.d.ts +5 -1
- package/dist/lib/EVirtTable.js +27 -0
- package/dist/lib/EVirtTable.js.map +1 -1
- package/dist/lib/EventBrowser.js +1 -0
- package/dist/lib/EventBrowser.js.map +1 -1
- package/dist/lib/Header.js +28 -2
- package/dist/lib/Header.js.map +1 -1
- package/dist/lib/types.d.ts +7 -0
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
(function(){"use strict";try{if(typeof document<"u"){var o=document.createElement("style");o.appendChild(document.createTextNode(":root{--evt-header-font: 12px normal Arial;--evt-body-font: 12px normal Arial;--evt-color-white: #fff;--evt-color-black: #000000;--evt-color-primary: rgb(82, 146, 247);--evt-text-color-primary: #333;--evt-text-color-regular: #666;--evt-text-color-secondary: #999;--evt-box-shadow: 0 2px 12px 0 #0000001a;--evt-editor-bg-color: #fff;--evt-editor-text-color: #333;--evt-border-color: #e1e6eb;--evt-stripe-color: #fafafa;--evt-placeholder-color: #cdd0dc;--evt-header-bg-color: #f8faff;--evt-body-bg-color: #fff;--evt-header-text-color: #1d2129;--evt-body-text-color: #4e5969;--evt-footer-text-color: #4e5969;--evt-loading-icon-color: #4e5969;--evt-expand-icon-color: #4e5969;--evt-shrink-icon-color: #4e5969;--evt-error-tip-icon-color: red;--evt-cell-hover-icon-bg-color: #fff;--evt-cell-hover-icon-border-color: #dde0ea;--evt-scroller-color: #dee0e3;--evt-scroller-track-color: #fff;--evt-scroller-focus-color: #bbbec4;--evt-select-border-color: var(--evt-color-primary);--evt-select-area-color: rgba(82, 146, 247, .1);--evt-select-row-col-bg-color: transparent;--evt-autofill-point-border-color: #fff;--evt-edit-bg-color: #fcf6ed;--evt-checkbox-color: var(--evt-color-primary);--evt-readonly-color: #fff;--evt-readonly-text-color: var(--evt-body-text-color);--evt-error-tip-color: #ed3f14;--evt-footer-bg-color: #fafafa;--evt-highlight-hover-row-color: rgba(186, 203, 231, .1);--evt-highlight-selected-row-color: rgba(82, 146, 247, .1);--evt-tooltip-bg-color: #303133;--evt-tooltip-text-color: #fff;--evt-resize-row-line-color: #e1e6eb;--evt-resize-column-line-color: #e1e6eb}.dark{--evt-border-color: #363637;--evt-header-bg-color: #141414;--evt-body-bg-color: #141414;--evt-header-text-color: #a3a6ad;--evt-scroller-color: #414243;--evt-scroller-track-color: #141414;--evt-scroller-focus-color: #a3a6ad;--evt-edit-bg-color: #141414;--evt-readonly-text-color: #cfd3dc;--evt-footer-bg-color: #262727;--evt-autofill-point-border-color: #fff;--evt-editor-bg-color: #434343;--evt-editor-text-color: #cfd3dc}.e-virt-table-container{position:relative;outline:none}.e-virt-table-stage{position:relative;overflow:hidden;outline:none;box-sizing:border-box;z-index:10;border-radius:8px;border:1px solid var(--evt-border-color)}.e-virt-table-canvas{position:absolute;left:0;top:0;box-sizing:border-box;border:none;outline:none;z-index:10}.e-virt-table-editor{position:absolute;top:-10000px;left:-10000px;text-align:left;height:auto;line-height:0;z-index:100;overflow:hidden;background-color:var(--evt-editor-bg-color);border:2px solid var(--evt-color-primary);box-sizing:border-box;box-shadow:var(--evt-box-shadow);display:flex;align-items:center}.e-virt-table-overlayer{position:absolute;left:0;top:0;overflow:hidden;z-index:100;pointer-events:none}.e-virt-table-editor-textarea{width:100%;box-sizing:border-box;outline:none;font-weight:400;padding:8px;font-size:12px;color:inherit;white-space:pre-wrap;word-wrap:break-word;word-break:break-all;line-height:1.5;margin:0;border:none;vertical-align:middle;background:var(--evt-editor-bg-color);color:var(--evt-editor-text-color);overflow-y:auto;resize:none}.e-virt-table-context-menu{position:absolute;font-size:14px;color:var(--evt-text-color-regular);background-color:var(--evt-color-white);border-radius:4px;border:1px solid #e4e7ed;box-shadow:var(--evt-box-shadow);width:fit-content;padding:6px 0;z-index:9999;left:-99999px;top:-99999px}.e-virt-table-context-menu-item{cursor:pointer;padding:8px 24px;color:var(--evt-text-color-regular)}.e-virt-table-context-menu-item:hover{color:var(--evt-color-primary);background-color:#f5f7fa}")),document.head.appendChild(o)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
|
|
2
2
|
var be = Object.defineProperty;
|
|
3
|
-
var ve = (
|
|
4
|
-
var
|
|
3
|
+
var ve = (l, t, e) => t in l ? be(l, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : l[t] = e;
|
|
4
|
+
var a = (l, t, e) => ve(l, typeof t != "symbol" ? t + "" : t, e);
|
|
5
5
|
function q() {
|
|
6
|
-
return q = Object.assign ? Object.assign.bind() : function(
|
|
6
|
+
return q = Object.assign ? Object.assign.bind() : function(l) {
|
|
7
7
|
for (var t = 1; t < arguments.length; t++) {
|
|
8
8
|
var e = arguments[t];
|
|
9
9
|
for (var i in e)
|
|
10
|
-
Object.prototype.hasOwnProperty.call(e, i) && (
|
|
10
|
+
Object.prototype.hasOwnProperty.call(e, i) && (l[i] = e[i]);
|
|
11
11
|
}
|
|
12
|
-
return
|
|
12
|
+
return l;
|
|
13
13
|
}, q.apply(this, arguments);
|
|
14
14
|
}
|
|
15
|
-
function Re(
|
|
16
|
-
|
|
15
|
+
function Re(l, t) {
|
|
16
|
+
l.prototype = Object.create(t.prototype), l.prototype.constructor = l, st(l, t);
|
|
17
17
|
}
|
|
18
|
-
function Et(
|
|
18
|
+
function Et(l) {
|
|
19
19
|
return Et = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(e) {
|
|
20
20
|
return e.__proto__ || Object.getPrototypeOf(e);
|
|
21
|
-
}, Et(
|
|
21
|
+
}, Et(l);
|
|
22
22
|
}
|
|
23
|
-
function st(
|
|
23
|
+
function st(l, t) {
|
|
24
24
|
return st = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(i, s) {
|
|
25
25
|
return i.__proto__ = s, i;
|
|
26
|
-
}, st(
|
|
26
|
+
}, st(l, t);
|
|
27
27
|
}
|
|
28
28
|
function _e() {
|
|
29
29
|
if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham) return !1;
|
|
@@ -35,7 +35,7 @@ function _e() {
|
|
|
35
35
|
return !1;
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
-
function dt(
|
|
38
|
+
function dt(l, t, e) {
|
|
39
39
|
return _e() ? dt = Reflect.construct.bind() : dt = function(s, r, o) {
|
|
40
40
|
var n = [null];
|
|
41
41
|
n.push.apply(n, r);
|
|
@@ -43,10 +43,10 @@ function dt(a, t, e) {
|
|
|
43
43
|
return o && st(c, o.prototype), c;
|
|
44
44
|
}, dt.apply(null, arguments);
|
|
45
45
|
}
|
|
46
|
-
function Ie(
|
|
47
|
-
return Function.toString.call(
|
|
46
|
+
function Ie(l) {
|
|
47
|
+
return Function.toString.call(l).indexOf("[native code]") !== -1;
|
|
48
48
|
}
|
|
49
|
-
function Ct(
|
|
49
|
+
function Ct(l) {
|
|
50
50
|
var t = typeof Map == "function" ? /* @__PURE__ */ new Map() : void 0;
|
|
51
51
|
return Ct = function(i) {
|
|
52
52
|
if (i === null || !Ie(i)) return i;
|
|
@@ -67,7 +67,7 @@ function Ct(a) {
|
|
|
67
67
|
configurable: !0
|
|
68
68
|
}
|
|
69
69
|
}), st(s, i);
|
|
70
|
-
}, Ct(
|
|
70
|
+
}, Ct(l);
|
|
71
71
|
}
|
|
72
72
|
var Oe = /%[sdj%]/g, Ut = function() {
|
|
73
73
|
};
|
|
@@ -76,22 +76,22 @@ typeof process < "u" && process.env && process.env.NODE_ENV !== "production" &&
|
|
|
76
76
|
return typeof i == "string";
|
|
77
77
|
}) && console.warn(t, e);
|
|
78
78
|
});
|
|
79
|
-
function bt(
|
|
80
|
-
if (!
|
|
79
|
+
function bt(l) {
|
|
80
|
+
if (!l || !l.length) return null;
|
|
81
81
|
var t = {};
|
|
82
|
-
return
|
|
82
|
+
return l.forEach(function(e) {
|
|
83
83
|
var i = e.field;
|
|
84
84
|
t[i] = t[i] || [], t[i].push(e);
|
|
85
85
|
}), t;
|
|
86
86
|
}
|
|
87
|
-
function D(
|
|
87
|
+
function D(l) {
|
|
88
88
|
for (var t = arguments.length, e = new Array(t > 1 ? t - 1 : 0), i = 1; i < t; i++)
|
|
89
89
|
e[i - 1] = arguments[i];
|
|
90
90
|
var s = 0, r = e.length;
|
|
91
|
-
if (typeof
|
|
92
|
-
return
|
|
93
|
-
if (typeof
|
|
94
|
-
var o =
|
|
91
|
+
if (typeof l == "function")
|
|
92
|
+
return l.apply(null, e);
|
|
93
|
+
if (typeof l == "string") {
|
|
94
|
+
var o = l.replace(Oe, function(n) {
|
|
95
95
|
if (n === "%%")
|
|
96
96
|
return "%";
|
|
97
97
|
if (s >= r)
|
|
@@ -114,105 +114,105 @@ function D(a) {
|
|
|
114
114
|
});
|
|
115
115
|
return o;
|
|
116
116
|
}
|
|
117
|
-
return
|
|
117
|
+
return l;
|
|
118
118
|
}
|
|
119
|
-
function Le(
|
|
120
|
-
return
|
|
119
|
+
function Le(l) {
|
|
120
|
+
return l === "string" || l === "url" || l === "hex" || l === "email" || l === "date" || l === "pattern";
|
|
121
121
|
}
|
|
122
|
-
function H(
|
|
123
|
-
return !!(
|
|
122
|
+
function H(l, t) {
|
|
123
|
+
return !!(l == null || t === "array" && Array.isArray(l) && !l.length || Le(t) && typeof l == "string" && !l);
|
|
124
124
|
}
|
|
125
|
-
function Se(
|
|
126
|
-
var i = [], s = 0, r =
|
|
125
|
+
function Se(l, t, e) {
|
|
126
|
+
var i = [], s = 0, r = l.length;
|
|
127
127
|
function o(n) {
|
|
128
128
|
i.push.apply(i, n || []), s++, s === r && e(i);
|
|
129
129
|
}
|
|
130
|
-
|
|
130
|
+
l.forEach(function(n) {
|
|
131
131
|
t(n, o);
|
|
132
132
|
});
|
|
133
133
|
}
|
|
134
|
-
function
|
|
135
|
-
var i = 0, s =
|
|
134
|
+
function Bt(l, t, e) {
|
|
135
|
+
var i = 0, s = l.length;
|
|
136
136
|
function r(o) {
|
|
137
137
|
if (o && o.length) {
|
|
138
138
|
e(o);
|
|
139
139
|
return;
|
|
140
140
|
}
|
|
141
141
|
var n = i;
|
|
142
|
-
i = i + 1, n < s ? t(
|
|
142
|
+
i = i + 1, n < s ? t(l[n], r) : e([]);
|
|
143
143
|
}
|
|
144
144
|
r([]);
|
|
145
145
|
}
|
|
146
|
-
function Te(
|
|
146
|
+
function Te(l) {
|
|
147
147
|
var t = [];
|
|
148
|
-
return Object.keys(
|
|
149
|
-
t.push.apply(t,
|
|
148
|
+
return Object.keys(l).forEach(function(e) {
|
|
149
|
+
t.push.apply(t, l[e] || []);
|
|
150
150
|
}), t;
|
|
151
151
|
}
|
|
152
|
-
var Ft = /* @__PURE__ */ function(
|
|
153
|
-
Re(t,
|
|
152
|
+
var Ft = /* @__PURE__ */ function(l) {
|
|
153
|
+
Re(t, l);
|
|
154
154
|
function t(e, i) {
|
|
155
155
|
var s;
|
|
156
|
-
return s =
|
|
156
|
+
return s = l.call(this, "Async Validation Error") || this, s.errors = e, s.fields = i, s;
|
|
157
157
|
}
|
|
158
158
|
return t;
|
|
159
159
|
}(/* @__PURE__ */ Ct(Error));
|
|
160
|
-
function Ae(
|
|
160
|
+
function Ae(l, t, e, i, s) {
|
|
161
161
|
if (t.first) {
|
|
162
|
-
var r = new Promise(function(
|
|
163
|
-
var
|
|
164
|
-
return i(
|
|
165
|
-
},
|
|
166
|
-
|
|
162
|
+
var r = new Promise(function(x, g) {
|
|
163
|
+
var p = function(m) {
|
|
164
|
+
return i(m), m.length ? g(new Ft(m, bt(m))) : x(s);
|
|
165
|
+
}, u = Te(l);
|
|
166
|
+
Bt(u, e, p);
|
|
167
167
|
});
|
|
168
|
-
return r.catch(function(
|
|
169
|
-
return
|
|
168
|
+
return r.catch(function(x) {
|
|
169
|
+
return x;
|
|
170
170
|
}), r;
|
|
171
171
|
}
|
|
172
|
-
var o = t.firstFields === !0 ? Object.keys(
|
|
173
|
-
var
|
|
172
|
+
var o = t.firstFields === !0 ? Object.keys(l) : t.firstFields || [], n = Object.keys(l), h = n.length, c = 0, d = [], f = new Promise(function(x, g) {
|
|
173
|
+
var p = function(w) {
|
|
174
174
|
if (d.push.apply(d, w), c++, c === h)
|
|
175
|
-
return i(d), d.length ? g(new Ft(d, bt(d))) :
|
|
175
|
+
return i(d), d.length ? g(new Ft(d, bt(d))) : x(s);
|
|
176
176
|
};
|
|
177
|
-
n.length || (i(d),
|
|
178
|
-
var w =
|
|
179
|
-
o.indexOf(
|
|
177
|
+
n.length || (i(d), x(s)), n.forEach(function(u) {
|
|
178
|
+
var w = l[u];
|
|
179
|
+
o.indexOf(u) !== -1 ? Bt(w, e, p) : Se(w, e, p);
|
|
180
180
|
});
|
|
181
181
|
});
|
|
182
|
-
return f.catch(function(
|
|
183
|
-
return
|
|
182
|
+
return f.catch(function(x) {
|
|
183
|
+
return x;
|
|
184
184
|
}), f;
|
|
185
185
|
}
|
|
186
|
-
function Me(
|
|
187
|
-
return !!(
|
|
186
|
+
function Me(l) {
|
|
187
|
+
return !!(l && l.message !== void 0);
|
|
188
188
|
}
|
|
189
|
-
function He(
|
|
190
|
-
for (var e =
|
|
189
|
+
function He(l, t) {
|
|
190
|
+
for (var e = l, i = 0; i < t.length; i++) {
|
|
191
191
|
if (e == null)
|
|
192
192
|
return e;
|
|
193
193
|
e = e[t[i]];
|
|
194
194
|
}
|
|
195
195
|
return e;
|
|
196
196
|
}
|
|
197
|
-
function
|
|
197
|
+
function Nt(l, t) {
|
|
198
198
|
return function(e) {
|
|
199
199
|
var i;
|
|
200
|
-
return
|
|
200
|
+
return l.fullFields ? i = He(t, l.fullFields) : i = t[e.field || l.fullField], Me(e) ? (e.field = e.field || l.fullField, e.fieldValue = i, e) : {
|
|
201
201
|
message: typeof e == "function" ? e() : e,
|
|
202
202
|
fieldValue: i,
|
|
203
|
-
field: e.field ||
|
|
203
|
+
field: e.field || l.fullField
|
|
204
204
|
};
|
|
205
205
|
};
|
|
206
206
|
}
|
|
207
|
-
function kt(
|
|
207
|
+
function kt(l, t) {
|
|
208
208
|
if (t) {
|
|
209
209
|
for (var e in t)
|
|
210
210
|
if (t.hasOwnProperty(e)) {
|
|
211
211
|
var i = t[e];
|
|
212
|
-
typeof i == "object" && typeof
|
|
212
|
+
typeof i == "object" && typeof l[e] == "object" ? l[e] = q({}, l[e], i) : l[e] = i;
|
|
213
213
|
}
|
|
214
214
|
}
|
|
215
|
-
return
|
|
215
|
+
return l;
|
|
216
216
|
}
|
|
217
217
|
var Zt = function(t, e, i, s, r, o) {
|
|
218
218
|
t.required && (!i.hasOwnProperty(t.field) || H(e, o || t.type)) && s.push(D(r.messages.required, t.fullField));
|
|
@@ -221,8 +221,8 @@ var Zt = function(t, e, i, s, r, o) {
|
|
|
221
221
|
}, ct, Xe = function() {
|
|
222
222
|
if (ct)
|
|
223
223
|
return ct;
|
|
224
|
-
var
|
|
225
|
-
return 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
|
|
@@ -242,7 +242,7 @@ var Zt = function(t, e, i, s, r, o) {
|
|
|
242
242
|
}, h.v6 = function(y) {
|
|
243
243
|
return y && y.exact ? n : new RegExp("" + t(y) + s + t(y), "g");
|
|
244
244
|
};
|
|
245
|
-
var c = "(?:(?:[a-z]+:)?//)", d = "(?:\\S+(?::\\S*)?@)?", f = h.v4().source,
|
|
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/
|
|
@@ -292,7 +292,7 @@ var Zt = function(t, e, i, s, r, o) {
|
|
|
292
292
|
hex: function(t) {
|
|
293
293
|
return typeof t == "string" && !!t.match(Kt.hex);
|
|
294
294
|
}
|
|
295
|
-
},
|
|
295
|
+
}, Be = function(t, e, i, s, r) {
|
|
296
296
|
if (t.required && e === void 0) {
|
|
297
297
|
Zt(t, e, i, s, r);
|
|
298
298
|
return;
|
|
@@ -300,11 +300,11 @@ var Zt = function(t, e, i, s, r, o) {
|
|
|
300
300
|
var o = ["integer", "float", "array", "regexp", "object", "method", "email", "number", "date", "url", "hex"], n = t.type;
|
|
301
301
|
o.indexOf(n) > -1 ? et[n](e) || s.push(D(r.messages.types[n], t.fullField, t.type)) : n && typeof e !== t.type && s.push(D(r.messages.types[n], t.fullField, t.type));
|
|
302
302
|
}, Fe = function(t, e, i, s, r) {
|
|
303
|
-
var o = typeof t.len == "number", n = typeof t.min == "number", h = typeof t.max == "number", c = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g, d = e, f = null,
|
|
304
|
-
if (
|
|
303
|
+
var o = typeof t.len == "number", n = typeof t.min == "number", h = typeof t.max == "number", c = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g, d = e, f = null, x = typeof e == "number", g = typeof e == "string", p = Array.isArray(e);
|
|
304
|
+
if (x ? f = "number" : g ? f = "string" : p && (f = "array"), !f)
|
|
305
305
|
return !1;
|
|
306
|
-
|
|
307
|
-
}, j = "enum",
|
|
306
|
+
p && (d = e.length), g && (d = e.replace(c, "_").length), o ? d !== t.len && s.push(D(r.messages[f].len, t.fullField, t.len)) : n && !h && d < t.min ? s.push(D(r.messages[f].min, t.fullField, t.min)) : h && !n && d > t.max ? s.push(D(r.messages[f].max, t.fullField, t.max)) : n && h && (d < t.min || d > t.max) && s.push(D(r.messages[f].range, t.fullField, t.min, t.max));
|
|
307
|
+
}, j = "enum", Ne = function(t, e, i, s, r) {
|
|
308
308
|
t[j] = Array.isArray(t[j]) ? t[j] : [], t[j].indexOf(e) === -1 && s.push(D(r.messages[j], t.fullField, t[j].join(", ")));
|
|
309
309
|
}, ke = function(t, e, i, s, r) {
|
|
310
310
|
if (t.pattern) {
|
|
@@ -318,9 +318,9 @@ var Zt = function(t, e, i, s, r, o) {
|
|
|
318
318
|
}, L = {
|
|
319
319
|
required: Zt,
|
|
320
320
|
whitespace: De,
|
|
321
|
-
type:
|
|
321
|
+
type: Be,
|
|
322
322
|
range: Fe,
|
|
323
|
-
enum:
|
|
323
|
+
enum: Ne,
|
|
324
324
|
pattern: ke
|
|
325
325
|
}, Ke = function(t, e, i, s, r) {
|
|
326
326
|
var o = [], n = t.required || !t.required && s.hasOwnProperty(t.field);
|
|
@@ -513,10 +513,10 @@ function vt() {
|
|
|
513
513
|
};
|
|
514
514
|
}
|
|
515
515
|
var Rt = vt(), nt = /* @__PURE__ */ function() {
|
|
516
|
-
function
|
|
516
|
+
function l(e) {
|
|
517
517
|
this.rules = null, this._messages = Rt, this.define(e);
|
|
518
518
|
}
|
|
519
|
-
var t =
|
|
519
|
+
var t = l.prototype;
|
|
520
520
|
return t.define = function(i) {
|
|
521
521
|
var s = this;
|
|
522
522
|
if (!i)
|
|
@@ -536,8 +536,8 @@ var Rt = vt(), nt = /* @__PURE__ */ function() {
|
|
|
536
536
|
var n = i, h = s, c = r;
|
|
537
537
|
if (typeof h == "function" && (c = h, h = {}), !this.rules || Object.keys(this.rules).length === 0)
|
|
538
538
|
return c && c(null, n), Promise.resolve(n);
|
|
539
|
-
function d(
|
|
540
|
-
var w = [],
|
|
539
|
+
function d(u) {
|
|
540
|
+
var w = [], m = {};
|
|
541
541
|
function C(b) {
|
|
542
542
|
if (Array.isArray(b)) {
|
|
543
543
|
var E;
|
|
@@ -545,88 +545,88 @@ var Rt = vt(), nt = /* @__PURE__ */ function() {
|
|
|
545
545
|
} else
|
|
546
546
|
w.push(b);
|
|
547
547
|
}
|
|
548
|
-
for (var y = 0; y <
|
|
549
|
-
C(
|
|
550
|
-
w.length ? (
|
|
548
|
+
for (var y = 0; y < u.length; y++)
|
|
549
|
+
C(u[y]);
|
|
550
|
+
w.length ? (m = bt(w), c(w, m)) : c(null, n);
|
|
551
551
|
}
|
|
552
552
|
if (h.messages) {
|
|
553
553
|
var f = this.messages();
|
|
554
554
|
f === Rt && (f = vt()), kt(f, h.messages), h.messages = f;
|
|
555
555
|
} else
|
|
556
556
|
h.messages = this.messages();
|
|
557
|
-
var
|
|
558
|
-
g.forEach(function(
|
|
559
|
-
var w = o.rules[
|
|
557
|
+
var x = {}, g = h.keys || Object.keys(this.rules);
|
|
558
|
+
g.forEach(function(u) {
|
|
559
|
+
var w = o.rules[u], m = n[u];
|
|
560
560
|
w.forEach(function(C) {
|
|
561
561
|
var y = C;
|
|
562
|
-
typeof y.transform == "function" && (n === i && (n = q({}, n)),
|
|
562
|
+
typeof y.transform == "function" && (n === i && (n = q({}, n)), m = n[u] = y.transform(m)), typeof y == "function" ? y = {
|
|
563
563
|
validator: y
|
|
564
|
-
} : y = q({}, y), y.validator = o.getValidationMethod(y), y.validator && (y.field =
|
|
564
|
+
} : y = q({}, y), y.validator = o.getValidationMethod(y), y.validator && (y.field = u, y.fullField = y.fullField || u, y.type = o.getType(y), x[u] = x[u] || [], x[u].push({
|
|
565
565
|
rule: y,
|
|
566
|
-
value:
|
|
566
|
+
value: m,
|
|
567
567
|
source: n,
|
|
568
|
-
field:
|
|
568
|
+
field: u
|
|
569
569
|
}));
|
|
570
570
|
});
|
|
571
571
|
});
|
|
572
|
-
var
|
|
573
|
-
return Ae(
|
|
574
|
-
var
|
|
575
|
-
C = C && (
|
|
572
|
+
var p = {};
|
|
573
|
+
return Ae(x, h, function(u, w) {
|
|
574
|
+
var m = u.rule, C = (m.type === "object" || m.type === "array") && (typeof m.fields == "object" || typeof m.defaultField == "object");
|
|
575
|
+
C = C && (m.required || !m.required && u.value), m.field = u.field;
|
|
576
576
|
function y(R, O) {
|
|
577
577
|
return q({}, O, {
|
|
578
|
-
fullField:
|
|
579
|
-
fullFields:
|
|
578
|
+
fullField: m.fullField + "." + R,
|
|
579
|
+
fullFields: m.fullFields ? [].concat(m.fullFields, [R]) : [R]
|
|
580
580
|
});
|
|
581
581
|
}
|
|
582
582
|
function b(R) {
|
|
583
583
|
R === void 0 && (R = []);
|
|
584
584
|
var O = Array.isArray(R) ? R : [R];
|
|
585
|
-
!h.suppressWarning && O.length &&
|
|
586
|
-
var I = O.map(
|
|
585
|
+
!h.suppressWarning && O.length && l.warning("async-validator:", O), O.length && m.message !== void 0 && (O = [].concat(m.message));
|
|
586
|
+
var I = O.map(Nt(m, n));
|
|
587
587
|
if (h.first && I.length)
|
|
588
|
-
return m
|
|
588
|
+
return p[m.field] = 1, w(I);
|
|
589
589
|
if (!C)
|
|
590
590
|
w(I);
|
|
591
591
|
else {
|
|
592
|
-
if (
|
|
593
|
-
return
|
|
592
|
+
if (m.required && !u.value)
|
|
593
|
+
return m.message !== void 0 ? I = [].concat(m.message).map(Nt(m, n)) : h.error && (I = [h.error(m, D(h.messages.required, m.field))]), w(I);
|
|
594
594
|
var _ = {};
|
|
595
|
-
|
|
596
|
-
_[T] =
|
|
597
|
-
}), _ = q({}, _,
|
|
595
|
+
m.defaultField && Object.keys(u.value).map(function(T) {
|
|
596
|
+
_[T] = m.defaultField;
|
|
597
|
+
}), _ = q({}, _, u.rule.fields);
|
|
598
598
|
var v = {};
|
|
599
599
|
Object.keys(_).forEach(function(T) {
|
|
600
600
|
var M = _[T], A = Array.isArray(M) ? M : [M];
|
|
601
601
|
v[T] = A.map(y.bind(null, T));
|
|
602
602
|
});
|
|
603
|
-
var S = new
|
|
604
|
-
S.messages(h.messages),
|
|
603
|
+
var S = new l(v);
|
|
604
|
+
S.messages(h.messages), u.rule.options && (u.rule.options.messages = h.messages, u.rule.options.error = h.error), S.validate(u.value, u.rule.options || h, function(T) {
|
|
605
605
|
var M = [];
|
|
606
606
|
I && I.length && M.push.apply(M, I), T && T.length && M.push.apply(M, T), w(M.length ? M : null);
|
|
607
607
|
});
|
|
608
608
|
}
|
|
609
609
|
}
|
|
610
610
|
var E;
|
|
611
|
-
if (
|
|
612
|
-
E =
|
|
613
|
-
else if (
|
|
611
|
+
if (m.asyncValidator)
|
|
612
|
+
E = m.asyncValidator(m, u.value, b, u.source, h);
|
|
613
|
+
else if (m.validator) {
|
|
614
614
|
try {
|
|
615
|
-
E =
|
|
615
|
+
E = m.validator(m, u.value, b, u.source, h);
|
|
616
616
|
} catch (R) {
|
|
617
617
|
console.error == null || console.error(R), h.suppressValidatorError || setTimeout(function() {
|
|
618
618
|
throw R;
|
|
619
619
|
}, 0), b(R.message);
|
|
620
620
|
}
|
|
621
|
-
E === !0 ? b() : E === !1 ? b(typeof
|
|
621
|
+
E === !0 ? b() : E === !1 ? b(typeof m.message == "function" ? m.message(m.fullField || m.field) : m.message || (m.fullField || m.field) + " fails") : E instanceof Array ? b(E) : E instanceof Error && b(E.message);
|
|
622
622
|
}
|
|
623
623
|
E && E.then && E.then(function() {
|
|
624
624
|
return b();
|
|
625
625
|
}, function(R) {
|
|
626
626
|
return b(R);
|
|
627
627
|
});
|
|
628
|
-
}, function(
|
|
629
|
-
d(
|
|
628
|
+
}, function(u) {
|
|
629
|
+
d(u);
|
|
630
630
|
}, n);
|
|
631
631
|
}, t.getType = function(i) {
|
|
632
632
|
if (i.type === void 0 && i.pattern instanceof RegExp && (i.type = "pattern"), typeof i.validator != "function" && i.type && !it.hasOwnProperty(i.type))
|
|
@@ -637,7 +637,7 @@ var Rt = vt(), nt = /* @__PURE__ */ function() {
|
|
|
637
637
|
return i.validator;
|
|
638
638
|
var s = Object.keys(i), r = s.indexOf("message");
|
|
639
639
|
return r !== -1 && s.splice(r, 1), s.length === 1 && s[0] === "required" ? it.required : it[this.getType(i)] || void 0;
|
|
640
|
-
},
|
|
640
|
+
}, l;
|
|
641
641
|
}();
|
|
642
642
|
nt.register = function(t, e) {
|
|
643
643
|
if (typeof e != "function")
|
|
@@ -648,26 +648,26 @@ nt.warning = Ut;
|
|
|
648
648
|
nt.messages = Rt;
|
|
649
649
|
nt.validators = it;
|
|
650
650
|
function Jt() {
|
|
651
|
-
return "xxxxxxxxxxxxxxxxxx".replace(/[x]/g, function(
|
|
651
|
+
return "xxxxxxxxxxxxxxxxxx".replace(/[x]/g, function(l) {
|
|
652
652
|
const t = Math.random() * 16 | 0;
|
|
653
|
-
return (
|
|
653
|
+
return (l === "x" ? t : t & 3 | 8).toString(16);
|
|
654
654
|
});
|
|
655
655
|
}
|
|
656
|
-
function Qt(
|
|
656
|
+
function Qt(l, t) {
|
|
657
657
|
let e = 0, i;
|
|
658
658
|
return function(...s) {
|
|
659
659
|
const r = (/* @__PURE__ */ new Date()).getTime(), o = r - e;
|
|
660
|
-
!e || o >= t ? (
|
|
661
|
-
|
|
660
|
+
!e || o >= t ? (l.apply(this, s), e = r) : i || (i = setTimeout(() => {
|
|
661
|
+
l.apply(this, s), e = (/* @__PURE__ */ new Date()).getTime(), i = void 0;
|
|
662
662
|
}, t - o));
|
|
663
663
|
};
|
|
664
664
|
}
|
|
665
|
-
function te(
|
|
666
|
-
return
|
|
665
|
+
function te(l = []) {
|
|
666
|
+
return l.length ? l.map((t) => te(t.children) + 1).sort((t, e) => e - t)[0] : 0;
|
|
667
667
|
}
|
|
668
|
-
function ei(
|
|
668
|
+
function ei(l = []) {
|
|
669
669
|
let t = [], e = [], i = [];
|
|
670
|
-
return
|
|
670
|
+
return l.forEach((s) => {
|
|
671
671
|
s.fixed === "left" ? t.push(s) : s.fixed === "right" ? i.push(s) : e.push(s);
|
|
672
672
|
}), [
|
|
673
673
|
...t.sort((s, r) => (s.sort ?? 0) - (r.sort ?? 0)),
|
|
@@ -675,8 +675,8 @@ function ei(a = []) {
|
|
|
675
675
|
...i.sort((s, r) => (s.sort ?? 0) - (r.sort ?? 0))
|
|
676
676
|
];
|
|
677
677
|
}
|
|
678
|
-
function ee(
|
|
679
|
-
return
|
|
678
|
+
function ee(l = [], t = 1, e = 0) {
|
|
679
|
+
return l.map((i) => {
|
|
680
680
|
if (i.children) {
|
|
681
681
|
let s = 0, r = i.fixed;
|
|
682
682
|
i.children.forEach((n) => {
|
|
@@ -702,72 +702,72 @@ function ee(a = [], t = 1, e = 0) {
|
|
|
702
702
|
};
|
|
703
703
|
});
|
|
704
704
|
}
|
|
705
|
-
function _t(
|
|
705
|
+
function _t(l = []) {
|
|
706
706
|
let t = [];
|
|
707
|
-
return
|
|
707
|
+
return l.forEach((e) => {
|
|
708
708
|
e.children ? t = t.concat(_t(e.children)) : t.push(e);
|
|
709
709
|
}), t;
|
|
710
710
|
}
|
|
711
711
|
const Yt = /^(\r\n|\n\r|\r|\n)/, ii = /^[^\t\r\n]+/, Vt = /^\t/;
|
|
712
|
-
function si(
|
|
712
|
+
function si(l) {
|
|
713
713
|
let t = [[""]];
|
|
714
|
-
if (
|
|
714
|
+
if (l.length === 0)
|
|
715
715
|
return t;
|
|
716
716
|
let e = 0, i = 0, s;
|
|
717
|
-
for (;
|
|
718
|
-
if (s =
|
|
719
|
-
|
|
720
|
-
else if (
|
|
721
|
-
|
|
717
|
+
for (; l.length > 0 && s !== l.length; )
|
|
718
|
+
if (s = l.length, l.match(Vt))
|
|
719
|
+
l = l.replace(Vt, ""), e += 1, t[i][e] = "";
|
|
720
|
+
else if (l.match(Yt))
|
|
721
|
+
l = l.replace(Yt, ""), e = 0, i += 1, t[i] = [""];
|
|
722
722
|
else {
|
|
723
723
|
let r = "";
|
|
724
|
-
if (
|
|
724
|
+
if (l.startsWith('"')) {
|
|
725
725
|
let o = 0, n = !0;
|
|
726
726
|
for (; n; ) {
|
|
727
|
-
const h =
|
|
728
|
-
h === '"' && (o += 1), r += h,
|
|
727
|
+
const h = l.slice(0, 1);
|
|
728
|
+
h === '"' && (o += 1), r += h, l = l.slice(1), (l.length === 0 || l.match(/^[\t\r\n]/) && o % 2 === 0) && (n = !1);
|
|
729
729
|
}
|
|
730
730
|
r = r.replace(/^"/, "").replace(/"$/, "").replace(/["]*/g, (h) => new Array(Math.floor(h.length / 2)).fill('"').join(""));
|
|
731
731
|
} else {
|
|
732
|
-
const o =
|
|
733
|
-
r = o ? o[0] : "",
|
|
732
|
+
const o = l.match(ii);
|
|
733
|
+
r = o ? o[0] : "", l = l.slice(r.length);
|
|
734
734
|
}
|
|
735
735
|
t[i][e] = r;
|
|
736
736
|
}
|
|
737
737
|
return Array.isArray(t) && t.length > 1 && t[t.length - 1].length === 1 && t[t.length - 1][0] === "" && (t = t.slice(0, t.length - 1)), t;
|
|
738
738
|
}
|
|
739
|
-
function ri(
|
|
739
|
+
function ri(l) {
|
|
740
740
|
let t, e, i, s, r = "", o;
|
|
741
|
-
for (t = 0, e =
|
|
742
|
-
for (s =
|
|
743
|
-
i > 0 && (r += " "), o =
|
|
741
|
+
for (t = 0, e = l.length; t < e; t += 1) {
|
|
742
|
+
for (s = l[t].length, i = 0; i < s; i += 1)
|
|
743
|
+
i > 0 && (r += " "), o = l[t][i], typeof o == "string" ? o.indexOf(`
|
|
744
744
|
`) > -1 ? r += `"${o.replace(/"/g, '""')}"` : r += o : o == null ? r += "" : r += o;
|
|
745
745
|
t !== e - 1 && (r += `
|
|
746
746
|
`);
|
|
747
747
|
}
|
|
748
748
|
return r;
|
|
749
749
|
}
|
|
750
|
-
function ie(
|
|
750
|
+
function ie(l, t, e = []) {
|
|
751
751
|
let i = 0;
|
|
752
752
|
const s = [];
|
|
753
|
-
return
|
|
753
|
+
return l.forEach((r, o) => {
|
|
754
754
|
if (o === 0)
|
|
755
755
|
s.push(1);
|
|
756
756
|
else {
|
|
757
|
-
const n = e.reduce((c, d) => `${c}${r[d] ?? ""}`, "") || r[t], h = e.reduce((c, d) => `${c}${
|
|
757
|
+
const n = e.reduce((c, d) => `${c}${r[d] ?? ""}`, "") || r[t], h = e.reduce((c, d) => `${c}${l[o - 1][d] ?? ""}`, "") || l[o - 1][t];
|
|
758
758
|
n === h ? (s[i] += 1, s.push(0)) : (s.push(1), i = o);
|
|
759
759
|
}
|
|
760
760
|
}), s;
|
|
761
761
|
}
|
|
762
|
-
function se(
|
|
762
|
+
function se(l, t) {
|
|
763
763
|
let e = "", i = "";
|
|
764
764
|
const s = {};
|
|
765
765
|
return t.forEach((r, o) => {
|
|
766
|
-
o === 0 ? (e = r.key, i = r.key, s[r.key] = 1) :
|
|
766
|
+
o === 0 ? (e = r.key, i = r.key, s[r.key] = 1) : l[r.key] === l[e] ? (s[r.key] = 0, s[i] += 1) : (s[r.key] = 1, e = r.key, i = r.key);
|
|
767
767
|
}), s;
|
|
768
768
|
}
|
|
769
|
-
function oi(
|
|
770
|
-
const { visibleRows: i, rowIndex: s, headIndex: r } =
|
|
769
|
+
function oi(l, t, e = []) {
|
|
770
|
+
const { visibleRows: i, rowIndex: s, headIndex: r } = l, o = ie(i, t, e);
|
|
771
771
|
return o[s - r] === 0 ? {
|
|
772
772
|
rowspan: 0,
|
|
773
773
|
colspan: 0,
|
|
@@ -780,8 +780,8 @@ function oi(a, t, e = []) {
|
|
|
780
780
|
mergeRow: !0
|
|
781
781
|
};
|
|
782
782
|
}
|
|
783
|
-
function ni(
|
|
784
|
-
const { column: e, row: i, visibleLeafColumns: s } =
|
|
783
|
+
function ni(l, t = []) {
|
|
784
|
+
const { column: e, row: i, visibleLeafColumns: s } = l, r = s.filter((o) => t.includes(o.key));
|
|
785
785
|
if (t.includes(e.key)) {
|
|
786
786
|
const o = se(i, r);
|
|
787
787
|
return o[e.key] === 0 ? {
|
|
@@ -797,19 +797,19 @@ function ni(a, t = []) {
|
|
|
797
797
|
};
|
|
798
798
|
}
|
|
799
799
|
}
|
|
800
|
-
function ai(
|
|
801
|
-
const e =
|
|
800
|
+
function ai(l, t = document.documentElement) {
|
|
801
|
+
const e = l.startsWith("--") ? l : `--${l}`;
|
|
802
802
|
return getComputedStyle(t).getPropertyValue(e).trim();
|
|
803
803
|
}
|
|
804
804
|
class re {
|
|
805
805
|
constructor(t, e, i, s, r, o, n) {
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
806
|
+
a(this, "ctx");
|
|
807
|
+
a(this, "x", 0);
|
|
808
|
+
a(this, "y", 0);
|
|
809
|
+
a(this, "width", 0);
|
|
810
|
+
a(this, "height", 0);
|
|
811
|
+
a(this, "fixed");
|
|
812
|
+
a(this, "cellType");
|
|
813
813
|
this.ctx = t, this.x = e, this.y = i, this.width = s, this.height = r, this.fixed = n, this.cellType = o;
|
|
814
814
|
}
|
|
815
815
|
isHorizontalVisible() {
|
|
@@ -850,62 +850,62 @@ class re {
|
|
|
850
850
|
class At extends re {
|
|
851
851
|
constructor(e, i, s, r, o, n, h, c, d, f = "body") {
|
|
852
852
|
super(e, r, o, n, h, f, c.fixed);
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
853
|
+
a(this, "formatter");
|
|
854
|
+
a(this, "formatterFooter");
|
|
855
|
+
a(this, "hoverIconName", "");
|
|
856
|
+
a(this, "operation", !1);
|
|
857
|
+
a(this, "align");
|
|
858
|
+
a(this, "verticalAlign");
|
|
859
|
+
a(this, "fixed");
|
|
860
|
+
a(this, "type");
|
|
861
|
+
a(this, "editorType");
|
|
862
|
+
a(this, "editorProps");
|
|
863
|
+
a(this, "cellType");
|
|
864
|
+
a(this, "level");
|
|
865
|
+
a(this, "colspan", 1);
|
|
866
|
+
a(this, "rowspan", 1);
|
|
867
|
+
a(this, "mergeRow", !1);
|
|
868
|
+
a(this, "mergeCol", !1);
|
|
869
|
+
a(this, "relationRowKeys", []);
|
|
870
870
|
// 合并单元格关联key
|
|
871
|
-
|
|
871
|
+
a(this, "relationColKeys", []);
|
|
872
872
|
// 合并单元格关联key
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
873
|
+
a(this, "key");
|
|
874
|
+
a(this, "column");
|
|
875
|
+
a(this, "rowIndex");
|
|
876
|
+
a(this, "colIndex");
|
|
877
|
+
a(this, "rowKey");
|
|
878
|
+
a(this, "row");
|
|
879
|
+
a(this, "value");
|
|
880
|
+
a(this, "render");
|
|
881
|
+
a(this, "renderFooter");
|
|
882
|
+
a(this, "style", {});
|
|
883
|
+
a(this, "rules", []);
|
|
884
|
+
a(this, "message", "");
|
|
885
|
+
a(this, "text", "");
|
|
886
|
+
a(this, "displayText", "");
|
|
887
|
+
a(this, "visibleWidth", 0);
|
|
888
|
+
a(this, "visibleHeight", 0);
|
|
889
|
+
a(this, "isHasChanged", !1);
|
|
890
|
+
a(this, "drawX", 0);
|
|
891
|
+
a(this, "drawY", 0);
|
|
892
|
+
a(this, "drawCellBgColor", "");
|
|
893
|
+
a(this, "drawCellSkyBgColor", "");
|
|
894
|
+
a(this, "drawTextColor", "");
|
|
895
|
+
a(this, "drawTextX", 0);
|
|
896
|
+
a(this, "drawTextY", 0);
|
|
897
|
+
a(this, "drawImageX", 0);
|
|
898
|
+
a(this, "drawImageY", 0);
|
|
899
|
+
a(this, "drawImageWidth", 0);
|
|
900
|
+
a(this, "drawImageHeight", 0);
|
|
901
|
+
a(this, "drawImageName", "");
|
|
902
|
+
a(this, "drawImageSource");
|
|
903
|
+
a(this, "ellipsis", !1);
|
|
904
|
+
a(this, "rowExpand", !1);
|
|
905
|
+
a(this, "rowHasChildren", !1);
|
|
906
|
+
a(this, "overflowTooltipShow", !0);
|
|
907
|
+
a(this, "overflowTooltipMaxWidth", 500);
|
|
908
|
+
a(this, "overflowTooltipPlacement", "top");
|
|
909
909
|
this.visibleWidth = this.width, this.visibleHeight = this.height, this.colIndex = s, this.rowIndex = i, this.key = c.key, this.type = c.type || "", this.editorType = c.editorType || "text", this.editorProps = c.editorProps || {}, this.cellType = f, this.align = c.align || "center", this.verticalAlign = c.verticalAlign || "middle", this.fixed = c.fixed, this.level = c.level || 0, this.operation = c.operation || !1, this.column = c, this.rules = c.rules || [], this.row = d, this.rowKey = this.cellType === "body" ? this.ctx.database.getRowKeyForRowIndex(i) : `${this.cellType}_${this.rowIndex}`, this.value = this.getValue(), this.render = c.render, this.overflowTooltipShow = c.overflowTooltipShow !== !1, this.overflowTooltipMaxWidth = c.overflowTooltipMaxWidth || 500, this.overflowTooltipPlacement = c.overflowTooltipPlacement || "top", this.renderFooter = c.renderFooter, this.hoverIconName = c.hoverIconName, this.formatter = c.formatter, this.formatterFooter = c.formatterFooter, this.update();
|
|
910
910
|
}
|
|
911
911
|
setWidthHeight(e, i) {
|
|
@@ -1019,19 +1019,19 @@ class At extends re {
|
|
|
1019
1019
|
const { CELL_PADDING: e = 0 } = this.ctx.config, { rowKey: i, cellType: s } = this;
|
|
1020
1020
|
let r, o = 0, n = "";
|
|
1021
1021
|
if (this.type === "tree" && s === "body") {
|
|
1022
|
-
const h = this.ctx.database.getRowForRowKey(i), { expand: c = !1, hasChildren: d = !1, expandLoading: f = !1, level:
|
|
1022
|
+
const h = this.ctx.database.getRowForRowKey(i), { expand: c = !1, hasChildren: d = !1, expandLoading: f = !1, level: x = 0 } = h || {};
|
|
1023
1023
|
if (this.rowExpand = c, this.rowHasChildren = d, f) {
|
|
1024
|
-
const
|
|
1025
|
-
n = "loading", r =
|
|
1024
|
+
const u = this.ctx.icons.get("loading");
|
|
1025
|
+
n = "loading", r = u, o = x * 8;
|
|
1026
1026
|
} else if (d) {
|
|
1027
|
-
const
|
|
1028
|
-
r = c ? w :
|
|
1027
|
+
const u = this.ctx.icons.get("expand"), w = this.ctx.icons.get("shrink");
|
|
1028
|
+
r = c ? w : u, n = c ? "shrink" : "expand", o = x * 8;
|
|
1029
1029
|
} else
|
|
1030
|
-
o =
|
|
1031
|
-
let g = 20,
|
|
1030
|
+
o = x * 8;
|
|
1031
|
+
let g = 20, p = 20;
|
|
1032
1032
|
if (r) {
|
|
1033
|
-
let
|
|
1034
|
-
this.ctx.paint.drawImage(r,
|
|
1033
|
+
let u = this.drawX + o + e, w = this.drawY + (this.visibleHeight - p) / 2;
|
|
1034
|
+
this.ctx.paint.drawImage(r, u, w, g, p), this.drawImageX = u, this.drawImageY = w, this.drawImageWidth = g, this.drawImageHeight = p, this.drawImageName = n, this.drawImageSource = r;
|
|
1035
1035
|
}
|
|
1036
1036
|
this.align = "left", this.drawTextX = o + this.drawX + g - 0.5;
|
|
1037
1037
|
}
|
|
@@ -1048,10 +1048,10 @@ class At extends re {
|
|
|
1048
1048
|
FOOTER_BG_COLOR: c,
|
|
1049
1049
|
HIGHLIGHT_SELECTED_ROW: d,
|
|
1050
1050
|
HIGHLIGHT_SELECTED_ROW_COLOR: f,
|
|
1051
|
-
HIGHLIGHT_HOVER_ROW:
|
|
1051
|
+
HIGHLIGHT_HOVER_ROW: x,
|
|
1052
1052
|
HIGHLIGHT_HOVER_ROW_COLOR: g,
|
|
1053
|
-
STRIPE:
|
|
1054
|
-
STRIPE_COLOR:
|
|
1053
|
+
STRIPE: p,
|
|
1054
|
+
STRIPE_COLOR: u
|
|
1055
1055
|
} = this.ctx.config;
|
|
1056
1056
|
if (this.cellType === "footer") {
|
|
1057
1057
|
let O = c, I = h;
|
|
@@ -1069,15 +1069,15 @@ class At extends re {
|
|
|
1069
1069
|
return;
|
|
1070
1070
|
}
|
|
1071
1071
|
let w = "transparent";
|
|
1072
|
-
const
|
|
1072
|
+
const m = this.ctx.hoverCell, C = this.ctx.currentCell;
|
|
1073
1073
|
let y = this.rowIndex, b = this.rowIndex;
|
|
1074
|
-
if (this.rowspan !== 1 && (
|
|
1074
|
+
if (this.rowspan !== 1 && (x || d)) {
|
|
1075
1075
|
const O = this.getSpanInfo(), { yArr: I } = O;
|
|
1076
1076
|
y = I[0], b = I[1];
|
|
1077
1077
|
}
|
|
1078
|
-
|
|
1078
|
+
x && m && (m.rowKey === this.rowKey && (w = g), m.rowIndex >= y && m.rowIndex <= b && (w = g)), d && C && (C.rowKey === this.rowKey && (w = f), C.rowIndex >= y && C.rowIndex <= b && (w = f)), this.drawCellSkyBgColor = w;
|
|
1079
1079
|
let E = e, R = n;
|
|
1080
|
-
if (this.ctx.database.getReadonly(this.rowKey, this.key) || (E = i, R = o),
|
|
1080
|
+
if (this.ctx.database.getReadonly(this.rowKey, this.key) || (E = i, R = o), p && (this.rowIndex % 2 ? E = u : E = e), typeof s == "function") {
|
|
1081
1081
|
const O = s, { backgroundColor: I, color: _ } = O({
|
|
1082
1082
|
row: this.row,
|
|
1083
1083
|
rowIndex: this.rowIndex,
|
|
@@ -1093,9 +1093,9 @@ class At extends re {
|
|
|
1093
1093
|
updateSelection() {
|
|
1094
1094
|
const { visibleWidth: e, visibleHeight: i, rowspan: s, colspan: r, cellType: o, type: n, rowIndex: h, rowKey: c } = this;
|
|
1095
1095
|
if (!(s === 0 || r === 0) && o !== "footer" && ["index-selection", "selection"].includes(n)) {
|
|
1096
|
-
const d = this.ctx.database.getRowSelection(c), f = this.ctx.database.getRowSelectable(c), { CHECKBOX_SIZE:
|
|
1097
|
-
let
|
|
1098
|
-
d && f ? (
|
|
1096
|
+
const d = this.ctx.database.getRowSelection(c), f = this.ctx.database.getRowSelectable(c), { CHECKBOX_SIZE: x = 0 } = this.ctx.config, g = this.drawX + (e - x) / 2, p = this.drawY + (i - x) / 2;
|
|
1097
|
+
let u = this.ctx.icons.get("checkbox-uncheck"), w = "checkbox-uncheck";
|
|
1098
|
+
d && f ? (u = this.ctx.icons.get("checkbox-check"), w = "checkbox-check") : d && f ? (u = this.ctx.icons.get("checkbox-check-disabled"), w = "checkbox-check-disabled") : !d && f ? (u = this.ctx.icons.get("checkbox-uncheck"), w = "checkbox-uncheck") : (u = this.ctx.icons.get("checkbox-disabled"), w = "checkbox-disabled"), u && n == "index-selection" ? (this.ctx.hoverCell && this.ctx.hoverCell.rowIndex === h || ["checkbox-disabled", "checkbox-check"].includes(w)) && (this.drawImageX = g, this.drawImageY = p, this.drawImageWidth = x, this.drawImageHeight = x, this.drawImageName = w, this.drawImageSource = u) : u && n === "selection" && (this.drawImageX = g, this.drawImageY = p, this.drawImageWidth = x, this.drawImageHeight = x, this.drawImageName = w, this.drawImageSource = u);
|
|
1099
1099
|
}
|
|
1100
1100
|
}
|
|
1101
1101
|
updateHoverIcon() {
|
|
@@ -1116,10 +1116,10 @@ class At extends re {
|
|
|
1116
1116
|
if (this.hoverIconName && !this.ctx.editing && n) {
|
|
1117
1117
|
let h = 0, c = 0;
|
|
1118
1118
|
if (n.rowKey === this.rowKey && (h = this.drawX + this.width - s - r, c = this.drawY + (this.height - s) / 2), this.rowspan !== 1 && o) {
|
|
1119
|
-
const f = this.getSpanInfo(), { yArr:
|
|
1120
|
-
if (n.rowIndex >= g && n.rowIndex <=
|
|
1121
|
-
const { width:
|
|
1122
|
-
h = this.drawX - C +
|
|
1119
|
+
const f = this.getSpanInfo(), { yArr: x } = f, g = x[0], p = x[1];
|
|
1120
|
+
if (n.rowIndex >= g && n.rowIndex <= p) {
|
|
1121
|
+
const { width: u, height: w, offsetTop: m, offsetLeft: C } = f;
|
|
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);
|
|
@@ -1218,10 +1218,10 @@ class At extends re {
|
|
|
1218
1218
|
const { SELECT_BORDER_COLOR: e, ENABLE_AUTOFILL: i, ENABLE_SELECTOR: s, AUTOFILL_POINT_BORDER_COLOR: r } = this.ctx.config;
|
|
1219
1219
|
if (!s || !i || this.ctx.editing)
|
|
1220
1220
|
return;
|
|
1221
|
-
const { xArr: o, yArr: n } = this.ctx.selector, h = o[1], c = n[1], { colIndex: d, rowIndex: f, drawX:
|
|
1221
|
+
const { xArr: o, yArr: n } = this.ctx.selector, h = o[1], c = n[1], { colIndex: d, rowIndex: f, drawX: x, drawY: g } = this;
|
|
1222
1222
|
if (d === h && f === c) {
|
|
1223
|
-
const
|
|
1224
|
-
this.ctx.paint.drawRect(
|
|
1223
|
+
const u = d === this.ctx.maxColIndex || f === this.ctx.maxRowIndex || d === this.ctx.lastCenterColIndex ? 6 : 4;
|
|
1224
|
+
this.ctx.paint.drawRect(x + this.width - u, g + this.height - u, 6, 6, {
|
|
1225
1225
|
borderColor: r,
|
|
1226
1226
|
fillColor: e
|
|
1227
1227
|
});
|
|
@@ -1348,13 +1348,13 @@ class At extends re {
|
|
|
1348
1348
|
drawBorder(e) {
|
|
1349
1349
|
const { drawX: i, drawY: s, rowIndex: r, colIndex: o, height: n, width: h } = this;
|
|
1350
1350
|
let c = i, d = s;
|
|
1351
|
-
const { xArr: f, yArr:
|
|
1352
|
-
if (o >=
|
|
1353
|
-
const E = o === C ? 1 : 0, R = o ===
|
|
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
|
+
if (o >= m && o <= C && r === y) {
|
|
1353
|
+
const E = o === C ? 1 : 0, R = o === m ? 1 : 0;
|
|
1354
1354
|
this.ctx.paint.drawLine([c + R, d + 1, c + h - E, d + 1], {
|
|
1355
|
-
borderColor:
|
|
1355
|
+
borderColor: u,
|
|
1356
1356
|
fillColor: w,
|
|
1357
|
-
borderWidth:
|
|
1357
|
+
borderWidth: p,
|
|
1358
1358
|
lineCap: "round",
|
|
1359
1359
|
lineJoin: "round",
|
|
1360
1360
|
lineDash: g
|
|
@@ -1363,31 +1363,31 @@ class At extends re {
|
|
|
1363
1363
|
if (o === C && r >= y && r <= b) {
|
|
1364
1364
|
const E = r === y ? 1 : 0, R = r === b ? 1 : 0;
|
|
1365
1365
|
this.ctx.paint.drawLine([c + h - 1, d + E, c + h - 1, d + n - R], {
|
|
1366
|
-
borderColor:
|
|
1366
|
+
borderColor: u,
|
|
1367
1367
|
fillColor: w,
|
|
1368
|
-
borderWidth:
|
|
1368
|
+
borderWidth: p,
|
|
1369
1369
|
lineCap: "round",
|
|
1370
1370
|
lineJoin: "round",
|
|
1371
1371
|
lineDash: g
|
|
1372
1372
|
});
|
|
1373
1373
|
}
|
|
1374
|
-
if (o >=
|
|
1375
|
-
const E = o === C ? 1 : 0, R = o ===
|
|
1374
|
+
if (o >= m && o <= C && r === b) {
|
|
1375
|
+
const E = o === C ? 1 : 0, R = o === m ? 1 : 0;
|
|
1376
1376
|
this.ctx.paint.drawLine([c + R, d + n - 1, c + h - E, d + n - 1], {
|
|
1377
|
-
borderColor:
|
|
1377
|
+
borderColor: u,
|
|
1378
1378
|
fillColor: w,
|
|
1379
|
-
borderWidth:
|
|
1379
|
+
borderWidth: p,
|
|
1380
1380
|
lineCap: "round",
|
|
1381
1381
|
lineJoin: "round",
|
|
1382
1382
|
lineDash: g
|
|
1383
1383
|
});
|
|
1384
1384
|
}
|
|
1385
|
-
if (o ===
|
|
1385
|
+
if (o === m && r >= y && r <= b) {
|
|
1386
1386
|
const E = r === b ? 1 : 0, R = r === y ? 1 : 0;
|
|
1387
1387
|
this.ctx.paint.drawLine([c + 1, d + R, c + 1, d + n - E], {
|
|
1388
|
-
borderColor:
|
|
1388
|
+
borderColor: u,
|
|
1389
1389
|
fillColor: w,
|
|
1390
|
-
borderWidth:
|
|
1390
|
+
borderWidth: p,
|
|
1391
1391
|
lineCap: "round",
|
|
1392
1392
|
lineJoin: "round",
|
|
1393
1393
|
lineDash: g
|
|
@@ -1398,40 +1398,39 @@ class At extends re {
|
|
|
1398
1398
|
class li {
|
|
1399
1399
|
//虚拟滚动位置
|
|
1400
1400
|
constructor(t, e) {
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1401
|
+
a(this, "loading", !1);
|
|
1402
|
+
a(this, "ctx");
|
|
1403
|
+
a(this, "data");
|
|
1404
|
+
a(this, "columns");
|
|
1405
|
+
a(this, "footerData", []);
|
|
1406
|
+
a(this, "rowKeyMap", /* @__PURE__ */ new Map());
|
|
1407
|
+
a(this, "colIndexKeyMap", /* @__PURE__ */ new Map());
|
|
1408
|
+
a(this, "headerMap", /* @__PURE__ */ new Map());
|
|
1409
|
+
a(this, "rowIndexRowKeyMap", /* @__PURE__ */ new Map());
|
|
1410
|
+
a(this, "rowKeyRowIndexMap", /* @__PURE__ */ new Map());
|
|
1411
|
+
a(this, "checkboxKeyMap", /* @__PURE__ */ new Map());
|
|
1412
|
+
a(this, "selectionMap", /* @__PURE__ */ new Map());
|
|
1413
|
+
a(this, "expandMap", /* @__PURE__ */ new Map());
|
|
1414
|
+
a(this, "originalDataMap", /* @__PURE__ */ new Map());
|
|
1415
|
+
a(this, "changedDataMap", /* @__PURE__ */ new Map());
|
|
1416
|
+
a(this, "validationErrorMap", /* @__PURE__ */ new Map());
|
|
1417
|
+
a(this, "itemRowKeyMap", /* @__PURE__ */ new WeakMap());
|
|
1418
|
+
a(this, "bufferData", []);
|
|
1419
|
+
a(this, "bufferCheckState", {
|
|
1419
1420
|
buffer: !1,
|
|
1420
1421
|
check: !1,
|
|
1421
1422
|
indeterminate: !1,
|
|
1422
1423
|
selectable: !0
|
|
1423
1424
|
});
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1425
|
+
a(this, "sumHeight", 0);
|
|
1426
|
+
a(this, "filterMethod");
|
|
1427
|
+
a(this, "positions", []);
|
|
1427
1428
|
this.ctx = t;
|
|
1428
1429
|
const { data: i = [], columns: s = [], footerData: r = [] } = e;
|
|
1429
1430
|
this.data = i, this.footerData = r, this.columns = s, this.setLoading(!0), this.init();
|
|
1430
1431
|
}
|
|
1431
1432
|
init() {
|
|
1432
|
-
this.clearBufferData(), this.rowKeyMap.clear(), this.checkboxKeyMap.clear(), this.colIndexKeyMap.clear(), this.rowIndexRowKeyMap.clear(), this.rowKeyRowIndexMap.clear(), this.originalDataMap.clear(), this.changedDataMap.clear(), this.validationErrorMap.clear(), this.itemRowKeyMap = /* @__PURE__ */ new WeakMap();
|
|
1433
|
-
const { ROW_KEY: t, ENABLE_RESERVE_SELECTION: e } = this.ctx.config;
|
|
1434
|
-
e && t || this.selectionMap.clear(), this.initData(this.data), this.getData(), this.bufferCheckState.buffer = !1;
|
|
1433
|
+
this.clearBufferData(), this.rowKeyMap.clear(), this.checkboxKeyMap.clear(), this.colIndexKeyMap.clear(), this.rowIndexRowKeyMap.clear(), this.rowKeyRowIndexMap.clear(), this.originalDataMap.clear(), this.changedDataMap.clear(), this.validationErrorMap.clear(), this.itemRowKeyMap = /* @__PURE__ */ new WeakMap(), this.initData(this.data), this.getData(), this.bufferCheckState.buffer = !1;
|
|
1435
1434
|
}
|
|
1436
1435
|
/**
|
|
1437
1436
|
* 清除缓存数据
|
|
@@ -1446,34 +1445,36 @@ class li {
|
|
|
1446
1445
|
*/
|
|
1447
1446
|
initData(t, e = 0) {
|
|
1448
1447
|
t.forEach((i, s) => {
|
|
1449
|
-
var
|
|
1450
|
-
let r =
|
|
1451
|
-
Array.isArray(i.children) && i.children.length && (r = !0, this.initData(i.children, e + 1));
|
|
1452
|
-
const { ROW_KEY: o = "", DEFAULT_EXPAND_ALL: n, CELL_HEIGHT: h, SELECTABLE_METHOD: c, CHECKBOX_KEY: d } = this.ctx.config, f = i[o],
|
|
1453
|
-
this.itemRowKeyMap.set(i,
|
|
1454
|
-
const g = i._height || h,
|
|
1455
|
-
let
|
|
1456
|
-
if (typeof c == "function" && (
|
|
1457
|
-
const
|
|
1458
|
-
if (this.checkboxKeyMap.has(
|
|
1459
|
-
const
|
|
1460
|
-
|
|
1448
|
+
var m;
|
|
1449
|
+
let r = !1;
|
|
1450
|
+
Array.isArray(i.children) && (r = i._hasChildren, i.children.length && (r = !0, this.initData(i.children, e + 1)));
|
|
1451
|
+
const { ROW_KEY: o = "", DEFAULT_EXPAND_ALL: n, CELL_HEIGHT: h, SELECTABLE_METHOD: c, CHECKBOX_KEY: d } = this.ctx.config, f = i[o], x = f != null ? `${f}` : Jt();
|
|
1452
|
+
this.itemRowKeyMap.set(i, x);
|
|
1453
|
+
const g = i._height || h, p = i._readonly;
|
|
1454
|
+
let u = !0;
|
|
1455
|
+
if (typeof c == "function" && (u = c), d) {
|
|
1456
|
+
const C = i[d];
|
|
1457
|
+
if (this.checkboxKeyMap.has(C)) {
|
|
1458
|
+
const y = this.checkboxKeyMap.get(C) || [];
|
|
1459
|
+
y.push(x), this.checkboxKeyMap.set(C, y);
|
|
1461
1460
|
} else
|
|
1462
|
-
this.checkboxKeyMap.set(
|
|
1461
|
+
this.checkboxKeyMap.set(C, [x]);
|
|
1463
1462
|
}
|
|
1464
|
-
this.selectionMap.set(
|
|
1465
|
-
key: d ? i[d] :
|
|
1463
|
+
this.selectionMap.set(x, {
|
|
1464
|
+
key: d ? i[d] : x,
|
|
1466
1465
|
row: i,
|
|
1467
|
-
check: ((
|
|
1468
|
-
})
|
|
1469
|
-
|
|
1466
|
+
check: ((m = this.selectionMap.get(x)) == null ? void 0 : m.check) || !1
|
|
1467
|
+
});
|
|
1468
|
+
const w = n || this.expandMap.get(x) || i._expand || !1;
|
|
1469
|
+
this.expandMap.set(x, w), this.rowKeyMap.set(x, {
|
|
1470
|
+
readonly: p,
|
|
1470
1471
|
index: s,
|
|
1471
1472
|
rowIndex: s,
|
|
1472
1473
|
level: e,
|
|
1473
1474
|
height: g,
|
|
1474
1475
|
check: !1,
|
|
1475
|
-
selectable:
|
|
1476
|
-
expand:
|
|
1476
|
+
selectable: u,
|
|
1477
|
+
expand: w,
|
|
1477
1478
|
expandLazy: !1,
|
|
1478
1479
|
hasChildren: r,
|
|
1479
1480
|
expandLoading: !1,
|
|
@@ -1581,12 +1582,12 @@ class li {
|
|
|
1581
1582
|
*/
|
|
1582
1583
|
expandItem(t, e = !1) {
|
|
1583
1584
|
const i = this.rowKeyMap.get(t);
|
|
1584
|
-
i.expand = e, this.clearBufferData(), this.ctx.emit("draw");
|
|
1585
|
+
i.expand = e, this.expandMap.set(t, e), this.clearBufferData(), this.ctx.emit("draw");
|
|
1585
1586
|
}
|
|
1586
1587
|
setExpandRowKeys(t, e = !0) {
|
|
1587
|
-
t.forEach((i) => {
|
|
1588
|
+
this.expandMap.clear(), t.forEach((i) => {
|
|
1588
1589
|
const s = this.rowKeyMap.get(i);
|
|
1589
|
-
s.expand = e;
|
|
1590
|
+
this.expandMap.set(i, e), s.expand = e;
|
|
1590
1591
|
}), this.clearBufferData(), this.ctx.emit("draw");
|
|
1591
1592
|
}
|
|
1592
1593
|
getExpandRowKeys() {
|
|
@@ -1596,8 +1597,8 @@ class li {
|
|
|
1596
1597
|
}), t;
|
|
1597
1598
|
}
|
|
1598
1599
|
expandAll(t) {
|
|
1599
|
-
this.rowKeyMap.forEach((e) => {
|
|
1600
|
-
e.expand = t;
|
|
1600
|
+
this.expandMap.clear(), this.rowKeyMap.forEach((e) => {
|
|
1601
|
+
e.expand = t, this.expandMap.set(e.key, t);
|
|
1601
1602
|
}), this.clearBufferData(), this.ctx.emit("draw");
|
|
1602
1603
|
}
|
|
1603
1604
|
expandLoading(t, e = !1) {
|
|
@@ -1606,7 +1607,7 @@ class li {
|
|
|
1606
1607
|
}
|
|
1607
1608
|
setExpandChildren(t, e) {
|
|
1608
1609
|
const i = this.rowKeyMap.get(t);
|
|
1609
|
-
i.expand = !0, i.expandLazy = !0, i.item.children = e, this.initData(i.item.children, i.level + 1), this.clearBufferData();
|
|
1610
|
+
i.expand = !0, this.expandMap.set(t, !0), i.expandLazy = !0, i.item.children = e, this.initData(i.item.children, i.level + 1), this.clearBufferData();
|
|
1610
1611
|
}
|
|
1611
1612
|
getIsExpandLoading(t) {
|
|
1612
1613
|
return this.rowKeyMap.get(t).expandLoading;
|
|
@@ -1684,19 +1685,19 @@ class li {
|
|
|
1684
1685
|
let i = [];
|
|
1685
1686
|
const s = /* @__PURE__ */ new Set();
|
|
1686
1687
|
let r = [], o = t.map((d) => {
|
|
1687
|
-
const { rowKey: f, key:
|
|
1688
|
-
let g = d.value,
|
|
1689
|
-
const
|
|
1690
|
-
return (
|
|
1688
|
+
const { rowKey: f, key: x } = d;
|
|
1689
|
+
let g = d.value, p = g;
|
|
1690
|
+
const u = this.getRowDataItemForRowKey(f), w = this.getItemValue(f, x), m = this.getVirtualBodyCellByKey(f, x);
|
|
1691
|
+
return (m == null ? void 0 : m.type) === "number" && (["", void 0, null].includes(g) ? p = null : /^-?\d+(\.\d+)?$/.test(`${g}`) ? p = Number(g) : (p = w, r.push({
|
|
1691
1692
|
...d,
|
|
1692
|
-
value:
|
|
1693
|
+
value: p,
|
|
1693
1694
|
oldValue: w,
|
|
1694
|
-
row:
|
|
1695
|
+
row: u
|
|
1695
1696
|
}))), {
|
|
1696
1697
|
...d,
|
|
1697
|
-
value:
|
|
1698
|
+
value: p,
|
|
1698
1699
|
oldValue: w,
|
|
1699
|
-
row:
|
|
1700
|
+
row: u
|
|
1700
1701
|
};
|
|
1701
1702
|
});
|
|
1702
1703
|
if (o = o.filter((d) => !r.some((f) => d.rowKey === f.rowKey && d.key === f.key)), r.length) {
|
|
@@ -1711,11 +1712,11 @@ class li {
|
|
|
1711
1712
|
return;
|
|
1712
1713
|
const { BEFORE_VALUE_CHANGE_METHOD: n } = this.ctx.config;
|
|
1713
1714
|
typeof n == "function" && (o = await n(o)), o.forEach((d) => {
|
|
1714
|
-
const { value: f, rowKey:
|
|
1715
|
-
s.add(
|
|
1716
|
-
rowKey:
|
|
1715
|
+
const { value: f, rowKey: x, key: g, oldValue: p } = d;
|
|
1716
|
+
s.add(x), this.setItemValue(x, g, f), i.push({
|
|
1717
|
+
rowKey: x,
|
|
1717
1718
|
key: g,
|
|
1718
|
-
oldValue:
|
|
1719
|
+
oldValue: p,
|
|
1719
1720
|
newValue: f
|
|
1720
1721
|
});
|
|
1721
1722
|
});
|
|
@@ -1756,7 +1757,7 @@ class li {
|
|
|
1756
1757
|
n[e] !== null && typeof n[e] == "object" && (h = JSON.parse(JSON.stringify(n[e])));
|
|
1757
1758
|
const d = `${t}_${e}`;
|
|
1758
1759
|
this.originalDataMap.has(d) || this.originalDataMap.set(d, h);
|
|
1759
|
-
const f = this.originalDataMap.get(d),
|
|
1760
|
+
const f = this.originalDataMap.get(d), x = this.getRowDataItemForRowKey(t);
|
|
1760
1761
|
if (o) {
|
|
1761
1762
|
const g = this.getVirtualBodyCellByKey(t, e);
|
|
1762
1763
|
if ((g == null ? void 0 : g.type) === "number")
|
|
@@ -1775,7 +1776,7 @@ class li {
|
|
|
1775
1776
|
key: e,
|
|
1776
1777
|
value: c,
|
|
1777
1778
|
oldValue: h,
|
|
1778
|
-
row:
|
|
1779
|
+
row: x
|
|
1779
1780
|
}
|
|
1780
1781
|
]
|
|
1781
1782
|
};
|
|
@@ -1786,36 +1787,36 @@ class li {
|
|
|
1786
1787
|
oldValue: h,
|
|
1787
1788
|
newValue: h
|
|
1788
1789
|
};
|
|
1789
|
-
const { BEFORE_VALUE_CHANGE_METHOD:
|
|
1790
|
-
if (typeof
|
|
1791
|
-
const
|
|
1790
|
+
const { BEFORE_VALUE_CHANGE_METHOD: p } = this.ctx.config;
|
|
1791
|
+
if (typeof p == "function") {
|
|
1792
|
+
const m = await p([
|
|
1792
1793
|
{
|
|
1793
1794
|
rowKey: t,
|
|
1794
1795
|
key: e,
|
|
1795
1796
|
value: c,
|
|
1796
1797
|
oldValue: n[e],
|
|
1797
|
-
row:
|
|
1798
|
+
row: x
|
|
1798
1799
|
}
|
|
1799
1800
|
]);
|
|
1800
|
-
|
|
1801
|
+
m && m.length && (c = m[0].value);
|
|
1801
1802
|
}
|
|
1802
1803
|
this.changedDataMap.set(d, c), n[e] = c;
|
|
1803
|
-
const
|
|
1804
|
+
const u = {
|
|
1804
1805
|
rowKey: t,
|
|
1805
1806
|
key: e,
|
|
1806
1807
|
oldValue: h,
|
|
1807
1808
|
value: c,
|
|
1808
|
-
row:
|
|
1809
|
+
row: x
|
|
1809
1810
|
};
|
|
1810
1811
|
this.getValidator(t, e).then(() => {
|
|
1811
1812
|
this.validationErrorMap.size === 0 && this.changedDataMap.size > 0 && this.ctx.emit("validateChangedData", this.getChangedData());
|
|
1812
|
-
}), this.ctx.emit("change", [
|
|
1813
|
+
}), this.ctx.emit("change", [u], [x]), this.ctx.emit("editChange", {
|
|
1813
1814
|
rowKey: t,
|
|
1814
1815
|
key: e,
|
|
1815
1816
|
oldValue: h,
|
|
1816
1817
|
value: c,
|
|
1817
1818
|
originalValue: f,
|
|
1818
|
-
row:
|
|
1819
|
+
row: x
|
|
1819
1820
|
});
|
|
1820
1821
|
} else
|
|
1821
1822
|
this.changedDataMap.set(d, c), n[e] = c;
|
|
@@ -1825,7 +1826,7 @@ class li {
|
|
|
1825
1826
|
oldValue: h,
|
|
1826
1827
|
value: c,
|
|
1827
1828
|
originalValue: this.originalDataMap.get(d),
|
|
1828
|
-
row:
|
|
1829
|
+
row: x
|
|
1829
1830
|
}), s && this.ctx.history.pushState({
|
|
1830
1831
|
type: "single",
|
|
1831
1832
|
scrollX: this.ctx.scrollX,
|
|
@@ -1938,9 +1939,13 @@ class li {
|
|
|
1938
1939
|
clearSelection(t = !1) {
|
|
1939
1940
|
t ? this.rowKeyMap.forEach((i, s) => {
|
|
1940
1941
|
this.setRowSelection(s, !1, !1);
|
|
1941
|
-
}) : this.selectionMap.forEach((i, s) => {
|
|
1942
|
-
this.
|
|
1943
|
-
|
|
1942
|
+
}) : (this.selectionMap.clear(), this.rowKeyMap.forEach((i, s) => {
|
|
1943
|
+
this.selectionMap.set(s, {
|
|
1944
|
+
check: !1,
|
|
1945
|
+
row: i.item,
|
|
1946
|
+
key: s
|
|
1947
|
+
});
|
|
1948
|
+
}));
|
|
1944
1949
|
const e = this.getSelectionRows();
|
|
1945
1950
|
this.ctx.emit("clearSelection"), this.ctx.emit("selectionChange", e), this.bufferCheckState.buffer = !1, this.ctx.emit("draw");
|
|
1946
1951
|
}
|
|
@@ -1954,15 +1959,15 @@ class li {
|
|
|
1954
1959
|
return e;
|
|
1955
1960
|
const i = this.rowKeyMap.size;
|
|
1956
1961
|
let s = 0, r = 0;
|
|
1957
|
-
const o = this.selectionMap.size, n = Array.from(this.selectionMap.values()).some((
|
|
1958
|
-
this.rowKeyMap.forEach((
|
|
1959
|
-
var
|
|
1960
|
-
(
|
|
1961
|
-
let
|
|
1962
|
-
typeof
|
|
1963
|
-
row:
|
|
1964
|
-
rowIndex:
|
|
1965
|
-
})),
|
|
1962
|
+
const o = this.selectionMap.size, n = Array.from(this.selectionMap.values()).some((x) => x.check);
|
|
1963
|
+
this.rowKeyMap.forEach((x, g) => {
|
|
1964
|
+
var u;
|
|
1965
|
+
(u = this.selectionMap.get(g)) != null && u.check && (s += 1);
|
|
1966
|
+
let p = x.selectable;
|
|
1967
|
+
typeof p == "function" && (p = p({
|
|
1968
|
+
row: x.item,
|
|
1969
|
+
rowIndex: x.rowIndex
|
|
1970
|
+
})), p && (r += 1);
|
|
1966
1971
|
});
|
|
1967
1972
|
const h = o > i && s === 0 && n, c = r && r > s && s > 0 || h, d = r !== 0, f = !!r && r === s;
|
|
1968
1973
|
return this.bufferCheckState = {
|
|
@@ -2103,14 +2108,14 @@ class li {
|
|
|
2103
2108
|
if (h) {
|
|
2104
2109
|
let c = {}, d = {};
|
|
2105
2110
|
if (d[e] = this.getItemValue(t, e), Array.isArray(h)) {
|
|
2106
|
-
const
|
|
2111
|
+
const x = h.map((g) => ({
|
|
2107
2112
|
...g,
|
|
2108
2113
|
row: s.item,
|
|
2109
2114
|
column: n,
|
|
2110
2115
|
rowIndex: s.rowIndex,
|
|
2111
2116
|
colIndex: r.colIndex
|
|
2112
2117
|
}));
|
|
2113
|
-
c[e] =
|
|
2118
|
+
c[e] = x;
|
|
2114
2119
|
} else
|
|
2115
2120
|
c[e] = {
|
|
2116
2121
|
...h,
|
|
@@ -2121,9 +2126,9 @@ class li {
|
|
|
2121
2126
|
};
|
|
2122
2127
|
new nt(c).validate(d).then(() => {
|
|
2123
2128
|
this.clearValidationError(t, e), i([]);
|
|
2124
|
-
}).catch(({ errors:
|
|
2125
|
-
const g =
|
|
2126
|
-
...
|
|
2129
|
+
}).catch(({ errors: x }) => {
|
|
2130
|
+
const g = x.map((p) => ({
|
|
2131
|
+
...p,
|
|
2127
2132
|
column: n,
|
|
2128
2133
|
key: e,
|
|
2129
2134
|
row: s.item,
|
|
@@ -2155,10 +2160,10 @@ class li {
|
|
|
2155
2160
|
relationColKeys: c,
|
|
2156
2161
|
rowspan: d,
|
|
2157
2162
|
height: f,
|
|
2158
|
-
width:
|
|
2163
|
+
width: x,
|
|
2159
2164
|
colspan: g,
|
|
2160
|
-
mergeRow:
|
|
2161
|
-
mergeCol:
|
|
2165
|
+
mergeRow: p,
|
|
2166
|
+
mergeCol: u
|
|
2162
2167
|
} = t;
|
|
2163
2168
|
if (d === 1 && g === 1)
|
|
2164
2169
|
return {
|
|
@@ -2167,7 +2172,7 @@ class li {
|
|
|
2167
2172
|
rowspan: d,
|
|
2168
2173
|
colspan: g,
|
|
2169
2174
|
height: f,
|
|
2170
|
-
width:
|
|
2175
|
+
width: x,
|
|
2171
2176
|
offsetTop: 0,
|
|
2172
2177
|
offsetLeft: 0,
|
|
2173
2178
|
dataList: [
|
|
@@ -2179,17 +2184,17 @@ class li {
|
|
|
2179
2184
|
}
|
|
2180
2185
|
]
|
|
2181
2186
|
};
|
|
2182
|
-
let w = e,
|
|
2183
|
-
if (d !== 1 &&
|
|
2184
|
-
I =
|
|
2187
|
+
let w = e, m = e, C = n, y = n, b = [], E = 0, R = 0, O = 0, I = 0;
|
|
2188
|
+
if (d !== 1 && p) {
|
|
2189
|
+
I = x;
|
|
2185
2190
|
const _ = h.reduce((v, S) => {
|
|
2186
2191
|
const T = this.getItemValue(s, S) ?? "";
|
|
2187
2192
|
return `${v}${T}`;
|
|
2188
2193
|
}, "");
|
|
2189
2194
|
for (let v = e - 1; v >= 0; v--) {
|
|
2190
2195
|
const S = this.rowIndexRowKeyMap.get(v) || "", T = h.reduce((M, A) => {
|
|
2191
|
-
const
|
|
2192
|
-
return `${M}${
|
|
2196
|
+
const N = this.getItemValue(S, A) ?? "";
|
|
2197
|
+
return `${M}${N}`;
|
|
2193
2198
|
}, "");
|
|
2194
2199
|
if (_ === T)
|
|
2195
2200
|
w = v;
|
|
@@ -2198,11 +2203,11 @@ class li {
|
|
|
2198
2203
|
}
|
|
2199
2204
|
for (let v = e; v <= this.ctx.maxRowIndex; v++) {
|
|
2200
2205
|
const S = this.rowIndexRowKeyMap.get(v) || "", T = h.reduce((M, A) => {
|
|
2201
|
-
const
|
|
2202
|
-
return `${M}${
|
|
2206
|
+
const N = this.getItemValue(S, A) ?? "";
|
|
2207
|
+
return `${M}${N}`;
|
|
2203
2208
|
}, "");
|
|
2204
2209
|
if (_ === T)
|
|
2205
|
-
|
|
2210
|
+
m = v;
|
|
2206
2211
|
else
|
|
2207
2212
|
break;
|
|
2208
2213
|
}
|
|
@@ -2210,7 +2215,7 @@ class li {
|
|
|
2210
2215
|
const { height: S } = this.positions[v];
|
|
2211
2216
|
E += S;
|
|
2212
2217
|
}
|
|
2213
|
-
for (let v = w; v <=
|
|
2218
|
+
for (let v = w; v <= m; v++) {
|
|
2214
2219
|
const { height: S } = this.positions[v];
|
|
2215
2220
|
O += S;
|
|
2216
2221
|
const T = this.rowIndexRowKeyMap.get(v) || "", { item: M } = this.rowKeyMap.get(T), A = this.getItemValue(T, i);
|
|
@@ -2222,7 +2227,7 @@ class li {
|
|
|
2222
2227
|
});
|
|
2223
2228
|
}
|
|
2224
2229
|
}
|
|
2225
|
-
if (g !== 1 &&
|
|
2230
|
+
if (g !== 1 && u) {
|
|
2226
2231
|
O = f;
|
|
2227
2232
|
for (let _ = n - 1; _ >= 0; _--) {
|
|
2228
2233
|
const v = this.getColumnByColIndex(_);
|
|
@@ -2264,7 +2269,7 @@ class li {
|
|
|
2264
2269
|
}
|
|
2265
2270
|
return {
|
|
2266
2271
|
xArr: [C, y],
|
|
2267
|
-
yArr: [w,
|
|
2272
|
+
yArr: [w, m],
|
|
2268
2273
|
rowspan: d,
|
|
2269
2274
|
colspan: g,
|
|
2270
2275
|
height: O,
|
|
@@ -2325,9 +2330,9 @@ class li {
|
|
|
2325
2330
|
}
|
|
2326
2331
|
class hi {
|
|
2327
2332
|
constructor(t) {
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2333
|
+
a(this, "ctx");
|
|
2334
|
+
a(this, "history", []);
|
|
2335
|
+
a(this, "historyIndex", -1);
|
|
2331
2336
|
this.ctx = t, this.init();
|
|
2332
2337
|
}
|
|
2333
2338
|
init() {
|
|
@@ -2380,8 +2385,8 @@ class hi {
|
|
|
2380
2385
|
}
|
|
2381
2386
|
class ci {
|
|
2382
2387
|
constructor(t) {
|
|
2383
|
-
|
|
2384
|
-
|
|
2388
|
+
a(this, "eventTasks", /* @__PURE__ */ new Map());
|
|
2389
|
+
a(this, "ctx");
|
|
2385
2390
|
this.ctx = t, this.init();
|
|
2386
2391
|
}
|
|
2387
2392
|
init() {
|
|
@@ -2424,7 +2429,7 @@ class ci {
|
|
|
2424
2429
|
this.ctx.emit("touchmove", t);
|
|
2425
2430
|
}
|
|
2426
2431
|
handleContextMenu(t) {
|
|
2427
|
-
this.ctx.emit("contextMenu", t);
|
|
2432
|
+
t.preventDefault(), this.ctx.emit("contextMenu", t);
|
|
2428
2433
|
}
|
|
2429
2434
|
handleMouseover(t) {
|
|
2430
2435
|
this.ctx.isMouseoverTargetContainer = !0, this.ctx.emit("mouseover", t);
|
|
@@ -2447,7 +2452,7 @@ class ci {
|
|
|
2447
2452
|
}
|
|
2448
2453
|
class di {
|
|
2449
2454
|
constructor() {
|
|
2450
|
-
|
|
2455
|
+
a(this, "events", /* @__PURE__ */ new Map());
|
|
2451
2456
|
}
|
|
2452
2457
|
has(t) {
|
|
2453
2458
|
return this.events.has(t);
|
|
@@ -2485,7 +2490,7 @@ class di {
|
|
|
2485
2490
|
}
|
|
2486
2491
|
class fi {
|
|
2487
2492
|
constructor(t) {
|
|
2488
|
-
|
|
2493
|
+
a(this, "ctx");
|
|
2489
2494
|
const e = t.getContext("2d");
|
|
2490
2495
|
if (!e) throw new Error("canvas context not found");
|
|
2491
2496
|
this.ctx = e;
|
|
@@ -2558,8 +2563,8 @@ class fi {
|
|
|
2558
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), h === 0)
|
|
2559
2564
|
this.ctx.rect(t - 0.5, e - 0.5, i, s);
|
|
2560
2565
|
else {
|
|
2561
|
-
const [c, d, f,
|
|
2562
|
-
this.ctx.moveTo(t + c, e), this.ctx.arcTo(t + i, e, t + i, e + d, d), this.ctx.arcTo(t + i, e + s, t + i - f, e + s, f), this.ctx.arcTo(t, e + s, t, e + s -
|
|
2566
|
+
const [c, d, f, x] = typeof h == "number" ? [h, h, h, h] : h;
|
|
2567
|
+
this.ctx.moveTo(t + c, e), this.ctx.arcTo(t + i, e, t + i, e + d, d), this.ctx.arcTo(t + i, e + s, t + i - f, e + s, f), this.ctx.arcTo(t, e + s, t, e + s - x, x), this.ctx.arcTo(t, e, t + c, e, c);
|
|
2563
2568
|
}
|
|
2564
2569
|
n !== void 0 && this.ctx.fill(), o !== void 0 && this.ctx.stroke(), this.ctx.restore();
|
|
2565
2570
|
}
|
|
@@ -2583,12 +2588,12 @@ class fi {
|
|
|
2583
2588
|
verticalAlign: f = "middle"
|
|
2584
2589
|
} = o;
|
|
2585
2590
|
this.ctx.font = n, this.ctx.fillStyle = c, this.ctx.textBaseline = f, this.ctx.textAlign = h;
|
|
2586
|
-
let
|
|
2587
|
-
f === "top" ?
|
|
2591
|
+
let x = 0;
|
|
2592
|
+
f === "top" ? x = i + d : f === "bottom" ? x = i + r - d : x = i + (r + 1) / 2;
|
|
2588
2593
|
let g = 0;
|
|
2589
2594
|
h === "left" ? g = e + d : h === "right" ? g = e + s - d : g = e + s / 2;
|
|
2590
|
-
const { _text:
|
|
2591
|
-
return this.ctx.fillText(
|
|
2595
|
+
const { _text: p, ellipsis: u } = this.handleEllipsis(t, s, d, n);
|
|
2596
|
+
return this.ctx.fillText(p, g, x), this.ctx.restore(), u;
|
|
2592
2597
|
}
|
|
2593
2598
|
handleEllipsis(t, e, i = 0, s = "12px Arial") {
|
|
2594
2599
|
let r = !1, o = t;
|
|
@@ -2615,153 +2620,151 @@ class fi {
|
|
|
2615
2620
|
}
|
|
2616
2621
|
class Wt {
|
|
2617
2622
|
constructor(t) {
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
+
a(this, "_config", {});
|
|
2624
|
+
a(this, "CSS_PREFIX", "e-virt-table");
|
|
2625
|
+
a(this, "ICONS", []);
|
|
2626
|
+
a(this, "ROW_KEY", "");
|
|
2627
|
+
a(this, "DISABLED", !1);
|
|
2623
2628
|
//禁用编辑,优先等级最高
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2629
|
+
a(this, "HEADER_FONT", "12px normal Arial");
|
|
2630
|
+
a(this, "BODY_FONT", "12px normal Arial");
|
|
2631
|
+
a(this, "BORDER", !0);
|
|
2632
|
+
a(this, "STRIPE", !1);
|
|
2628
2633
|
//斑马纹
|
|
2629
|
-
|
|
2634
|
+
a(this, "STRIPE_COLOR", "#fafafa");
|
|
2630
2635
|
//斑马纹颜色
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
// 启用保留选中行
|
|
2646
|
-
l(this, "ENABLE_HEADER_STICKY", !1);
|
|
2636
|
+
a(this, "BORDER_COLOR", "#e1e6eb");
|
|
2637
|
+
a(this, "WIDTH", 0);
|
|
2638
|
+
a(this, "RESIZE_MIN_WIDTH", 40);
|
|
2639
|
+
a(this, "HEIGHT", 0);
|
|
2640
|
+
a(this, "PLACEHOLDER_COLOR", "#CDD0DC");
|
|
2641
|
+
a(this, "EMPTY_BODY_HEIGHT", 120);
|
|
2642
|
+
a(this, "EMPTY_CUSTOM_STYLE", {});
|
|
2643
|
+
a(this, "EMPTY_TEXT", "暂无数据");
|
|
2644
|
+
a(this, "MAX_HEIGHT", 1e3);
|
|
2645
|
+
a(this, "BORDER_RADIUS", 8);
|
|
2646
|
+
a(this, "ENABLE_OFFSET_HEIGHT", !1);
|
|
2647
|
+
a(this, "OFFSET_HEIGHT", 0);
|
|
2648
|
+
a(this, "HEADER_HEIGHT", 36);
|
|
2649
|
+
a(this, "ENABLE_HEADER_STICKY", !1);
|
|
2647
2650
|
// 启用头部固定,需要外面实现覆盖层,或者所有表头都要是元素
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
|
|
2659
|
-
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
|
|
2665
|
-
|
|
2666
|
-
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
|
|
2651
|
+
a(this, "HEADER_BG_COLOR", "#F8FAFF");
|
|
2652
|
+
a(this, "BODY_BG_COLOR", "#FFF");
|
|
2653
|
+
a(this, "HEADER_TEXT_COLOR", "#1D2129");
|
|
2654
|
+
a(this, "BODY_TEXT_COLOR", "#4E5969");
|
|
2655
|
+
a(this, "FOOTER_TEXT_COLOR", "#4E5969");
|
|
2656
|
+
a(this, "LOADING_ICON_SVG", "");
|
|
2657
|
+
a(this, "LOADING_ICON_COLOR", "#4E5969");
|
|
2658
|
+
a(this, "EXPAND_ICON_SVG", "");
|
|
2659
|
+
a(this, "SHRINK_ICON_SVG", "");
|
|
2660
|
+
a(this, "EXPAND_ICON_COLOR", "#4E5969");
|
|
2661
|
+
a(this, "SHRINK_ICON_COLOR", "#4E5969");
|
|
2662
|
+
a(this, "ERROR_TIP_ICON_COLOR", "red");
|
|
2663
|
+
a(this, "ERROR_TIP_ICON_SIZE", 6);
|
|
2664
|
+
a(this, "EXPAND_LAZY", !0);
|
|
2665
|
+
a(this, "DEFAULT_EXPAND_ALL", !1);
|
|
2666
|
+
a(this, "CELL_WIDTH", 100);
|
|
2667
|
+
a(this, "CELL_HEIGHT", 36);
|
|
2668
|
+
a(this, "CELL_PADDING", 8);
|
|
2669
|
+
a(this, "CELL_HOVER_ICON_SIZE", 14);
|
|
2670
|
+
a(this, "CELL_HOVER_ICON_BG_COLOR", "#fff");
|
|
2671
|
+
a(this, "CELL_HOVER_ICON_BORDER_COLOR", "#DDE0EA");
|
|
2672
|
+
a(this, "SCROLLER_TRACK_SIZE", 14);
|
|
2673
|
+
a(this, "SCROLLER_SIZE", 8);
|
|
2674
|
+
a(this, "SCROLLER_COLOR", "#dee0e3");
|
|
2675
|
+
a(this, "SCROLLER_TRACK_COLOR", "#fff");
|
|
2676
|
+
a(this, "SCROLLER_FOCUS_COLOR", "#bbbec4");
|
|
2677
|
+
a(this, "SELECT_BORDER_COLOR", "rgb(82,146,247)");
|
|
2678
|
+
a(this, "SELECT_AREA_COLOR", "rgba(82,146,247,0.1)");
|
|
2679
|
+
a(this, "SELECT_ROW_COL_BG_COLOR", "transparent");
|
|
2680
|
+
a(this, "AUTOFILL_POINT_BORDER_COLOR", "#fff");
|
|
2681
|
+
a(this, "EDIT_BG_COLOR", "#fcf6ed");
|
|
2682
|
+
a(this, "CHECKBOX_KEY", "");
|
|
2683
|
+
a(this, "CHECKBOX_COLOR", "rgb(82,146,247)");
|
|
2684
|
+
a(this, "CHECKBOX_SIZE", 20);
|
|
2685
|
+
a(this, "CHECKBOX_DISABLED_SVG", "");
|
|
2686
|
+
a(this, "CHECKBOX_CHECK_SVG", "");
|
|
2687
|
+
a(this, "CHECKBOX_UNCHECK_SVG", "");
|
|
2688
|
+
a(this, "CHECKBOX_INDETERMINATE_SVG", "");
|
|
2689
|
+
a(this, "READONLY_COLOR", "#fff");
|
|
2690
|
+
a(this, "READONLY_TEXT_COLOR", "#4E5969");
|
|
2691
|
+
a(this, "ERROR_TIP_COLOR", "#ED3F14");
|
|
2692
|
+
a(this, "FOOTER_BG_COLOR", "#fafafa");
|
|
2693
|
+
a(this, "FOOTER_FIXED", !0);
|
|
2694
|
+
a(this, "FOOTER_POSITION", "bottom");
|
|
2695
|
+
a(this, "CELL_FOOTER_HEIGHT", 36);
|
|
2696
|
+
a(this, "ENABLE_SELECTOR", !0);
|
|
2697
|
+
a(this, "ENABLE_EDIT_SINGLE_CLICK", !1);
|
|
2695
2698
|
// 启用单点击立马编辑
|
|
2696
|
-
|
|
2699
|
+
a(this, "ENABLE_EDIT_CLICK_SELECTOR", !0);
|
|
2697
2700
|
// 启用点击选择器编辑
|
|
2698
|
-
|
|
2701
|
+
a(this, "SELECTOR_AREA_MIN_X", 0);
|
|
2699
2702
|
// 选择器X最小范围
|
|
2700
|
-
|
|
2703
|
+
a(this, "SELECTOR_AREA_MAX_X_OFFSET", 0);
|
|
2701
2704
|
// 选择器X最大范围colMax - offset
|
|
2702
|
-
|
|
2705
|
+
a(this, "SELECTOR_AREA_MAX_X", 0);
|
|
2703
2706
|
// 选择器X最大范围,0默认最大colMax
|
|
2704
|
-
|
|
2707
|
+
a(this, "SELECTOR_AREA_MIN_Y", 0);
|
|
2705
2708
|
// 选择器Y最小范围
|
|
2706
|
-
|
|
2709
|
+
a(this, "SELECTOR_AREA_MAX_Y", 0);
|
|
2707
2710
|
// 选择器Y最大范围,0默认rowMax
|
|
2708
|
-
|
|
2711
|
+
a(this, "SELECTOR_AREA_MAX_Y_OFFSET", 0);
|
|
2709
2712
|
// 选择器Y最大范围,0默认rowMax
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2713
|
+
a(this, "ENABLE_AUTO_THEME", !0);
|
|
2714
|
+
a(this, "ENABLE_SELECTOR_SINGLE", !1);
|
|
2715
|
+
a(this, "ENABLE_SELECTOR_SPAN_COL", !0);
|
|
2716
|
+
a(this, "ENABLE_SELECTOR_SPAN_ROW", !0);
|
|
2717
|
+
a(this, "ENABLE_SELECTOR_ALL_ROWS", !0);
|
|
2718
|
+
a(this, "ENABLE_SELECTOR_ALL_COLS", !0);
|
|
2719
|
+
a(this, "ENABLE_MERGE_CELL_LINK", !1);
|
|
2717
2720
|
// 启用合并选择器关联
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2721
|
+
a(this, "ENABLE_AUTOFILL", !1);
|
|
2722
|
+
a(this, "ENABLE_CONTEXT_MENU", !1);
|
|
2723
|
+
a(this, "ENABLE_COPY", !0);
|
|
2724
|
+
a(this, "ENABLE_PASTER", !0);
|
|
2725
|
+
a(this, "ENABLE_RESIZE_ROW", !0);
|
|
2726
|
+
a(this, "ENABLE_RESIZE_COLUMN", !0);
|
|
2727
|
+
a(this, "RESIZE_ROW_LINE_COLOR", "#e1e6eb");
|
|
2728
|
+
a(this, "RESIZE_COLUMN_LINE_COLOR", "#e1e6eb");
|
|
2729
|
+
a(this, "RESIZE_ROW_MIN_HEIGHT", 36);
|
|
2730
|
+
a(this, "RESIZE_COLUMN_MIN_WIDTH", 40);
|
|
2731
|
+
a(this, "ENABLE_KEYBOARD", !0);
|
|
2732
|
+
a(this, "ENABLE_HISTORY", !1);
|
|
2733
|
+
a(this, "ENABLE_VALIDATOR_IMMEDIATE", !0);
|
|
2734
|
+
a(this, "HISTORY_NUM", 50);
|
|
2735
|
+
a(this, "HIGHLIGHT_HOVER_ROW", !1);
|
|
2736
|
+
a(this, "HIGHLIGHT_HOVER_ROW_COLOR", "rgba(186,203,231,0.1)");
|
|
2737
|
+
a(this, "HIGHLIGHT_SELECTED_ROW", !1);
|
|
2738
|
+
a(this, "HIGHLIGHT_SELECTED_ROW_COLOR", "rgba(82,146,247,0.1)");
|
|
2739
|
+
a(this, "TOOLTIP_BG_COLOR", "#303133");
|
|
2740
|
+
a(this, "TOOLTIP_TEXT_COLOR", "#fff");
|
|
2741
|
+
a(this, "TOOLTIP_ZINDEX", 3e3);
|
|
2742
|
+
a(this, "TOOLTIP_CUSTOM_STYLE", {});
|
|
2743
|
+
a(this, "CONTEXT_MENU", [
|
|
2741
2744
|
{ label: "复制", value: "copy" },
|
|
2742
2745
|
{ label: "剪切", value: "cut" },
|
|
2743
2746
|
{ label: "粘贴", value: "paste" },
|
|
2744
2747
|
{ label: "清空选中内容", value: "clearSelected" }
|
|
2745
2748
|
]);
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
|
|
2749
|
+
a(this, "HEADER_CELL_STYLE_METHOD");
|
|
2750
|
+
a(this, "BODY_CELL_STYLE_METHOD");
|
|
2751
|
+
a(this, "FOOTER_CELL_STYLE_METHOD");
|
|
2752
|
+
a(this, "BODY_CELL_READONLY_METHOD");
|
|
2753
|
+
a(this, "BODY_CELL_FORMATTER_METHOD");
|
|
2754
|
+
a(this, "BODY_CELL_RULES_METHOD");
|
|
2755
|
+
a(this, "BODY_CELL_TYPE_METHOD");
|
|
2756
|
+
a(this, "BODY_CELL_EDITOR_METHOD");
|
|
2757
|
+
a(this, "BODY_CELL_RENDER_METHOD");
|
|
2758
|
+
a(this, "BODY_CELL_HOVER_ICON_METHOD");
|
|
2759
|
+
a(this, "SPAN_METHOD");
|
|
2760
|
+
a(this, "SELECTABLE_METHOD");
|
|
2761
|
+
a(this, "EXPAND_LAZY_METHOD");
|
|
2762
|
+
a(this, "BEFORE_VALUE_CHANGE_METHOD");
|
|
2763
|
+
a(this, "BEFORE_PASTE_DATA_METHOD");
|
|
2764
|
+
a(this, "BEFORE_AUTOFILL_DATA_METHOD");
|
|
2765
|
+
a(this, "BEFORE_SET_SELECTOR_METHOD");
|
|
2766
|
+
a(this, "BEFORE_SET_AUTOFILL_METHOD");
|
|
2767
|
+
a(this, "BEFORE_COPY_METHOD");
|
|
2765
2768
|
this._config = t, this.updateCssVar();
|
|
2766
2769
|
}
|
|
2767
2770
|
init(t) {
|
|
@@ -2779,10 +2782,10 @@ class Wt {
|
|
|
2779
2782
|
}
|
|
2780
2783
|
}
|
|
2781
2784
|
const Pt = '<svg t="1724122044148" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4551" width="32" height="32"><path d="M707.648 401.28L489.28 560.704l22.656 30.976 22.656-30.976L316.16 401.216q-3.072-2.24-6.464-3.84-3.456-1.536-7.104-2.432-3.712-0.896-7.488-1.088-3.776-0.128-7.488 0.448-3.776 0.64-7.296 1.92-3.584 1.28-6.784 3.2-3.2 1.984-6.016 4.544-2.816 2.56-5.056 5.632-2.176 3.072-3.84 6.464-1.536 3.456-2.432 7.104-0.896 3.712-1.088 7.488-0.128 3.776 0.448 7.488 0.64 3.776 1.92 7.296 1.28 3.584 3.2 6.784 1.984 3.2 4.544 6.016 2.56 2.752 5.632 4.992l218.368 159.552q4.928 3.584 10.752 5.504 5.76 1.92 11.904 1.92 6.08 0 11.904-1.92 5.76-1.92 10.752-5.504l218.368-159.552q3.008-2.24 5.568-4.992 2.56-2.816 4.544-6.016 1.92-3.2 3.264-6.784 1.28-3.52 1.92-7.296 0.576-3.712 0.384-7.488-0.128-3.84-1.024-7.488-0.896-3.648-2.496-7.04-1.6-3.456-3.84-6.528-2.24-3.072-4.992-5.632-2.816-2.56-6.016-4.48-3.2-1.984-6.784-3.328-3.584-1.28-7.296-1.856-3.712-0.64-7.488-0.448-3.84 0.192-7.488 1.088-3.648 0.896-7.04 2.496-3.456 1.536-6.528 3.84z m61.056 30.976q0-3.84-0.768-7.488-0.704-3.712-2.176-7.232-1.472-3.456-3.52-6.656-2.112-3.136-4.8-5.76-2.688-2.688-5.76-4.8-3.2-2.112-6.72-3.584-3.456-1.408-7.168-2.176-3.712-0.704-7.488-0.704-3.84 0-7.488 0.704-3.712 0.768-7.232 2.176-3.456 1.472-6.656 3.584-3.136 2.112-5.76 4.8-2.688 2.624-4.8 5.76-2.112 3.2-3.584 6.656-1.408 3.52-2.176 7.232-0.704 3.712-0.704 7.488 0 3.776 0.704 7.488 0.768 3.712 2.176 7.168 1.472 3.52 3.584 6.656 2.112 3.2 4.8 5.824 2.624 2.688 5.76 4.8 3.2 2.112 6.656 3.52 3.52 1.472 7.232 2.176 3.712 0.768 7.488 0.768 3.776 0 7.488-0.768 3.712-0.704 7.168-2.176 3.52-1.408 6.656-3.52 3.2-2.112 5.824-4.8 2.688-2.688 4.8-5.76 2.048-3.2 3.52-6.72 1.472-3.456 2.176-7.168 0.768-3.712 0.768-7.488z m-436.736 0q0-3.84-0.768-7.488-0.704-3.712-2.176-7.232-1.408-3.456-3.52-6.656-2.112-3.136-4.8-5.76-2.688-2.688-5.76-4.8-3.2-2.112-6.656-3.584-3.52-1.408-7.232-2.176-3.712-0.704-7.488-0.704-3.84 0-7.488 0.704-3.712 0.768-7.232 2.176-3.456 1.472-6.592 3.584-3.2 2.112-5.824 4.8-2.688 2.624-4.8 5.76-2.112 3.2-3.52 6.656-1.472 3.52-2.24 7.232-0.704 3.712-0.704 7.488 0 3.776 0.704 7.488 0.768 3.712 2.24 7.168 1.408 3.52 3.52 6.656 2.112 3.2 4.8 5.824 2.624 2.688 5.76 4.8 3.2 2.112 6.656 3.52 3.52 1.472 7.232 2.176 3.712 0.768 7.488 0.768 3.776 0 7.488-0.768 3.712-0.704 7.232-2.176 3.456-1.408 6.592-3.52 3.2-2.112 5.824-4.8 2.688-2.688 4.8-5.76 2.112-3.2 3.52-6.72 1.472-3.456 2.176-7.168 0.768-3.712 0.768-7.488z" p-id="4552"></path></svg>';
|
|
2782
|
-
class
|
|
2785
|
+
class xi {
|
|
2783
2786
|
constructor(t) {
|
|
2784
|
-
|
|
2785
|
-
|
|
2787
|
+
a(this, "ctx");
|
|
2788
|
+
a(this, "list", [
|
|
2786
2789
|
{
|
|
2787
2790
|
name: "loading",
|
|
2788
2791
|
configName: "LOADING_ICON_SVG",
|
|
@@ -2857,7 +2860,7 @@ class ui {
|
|
|
2857
2860
|
color: "#4E5969"
|
|
2858
2861
|
}
|
|
2859
2862
|
]);
|
|
2860
|
-
|
|
2863
|
+
a(this, "icons", /* @__PURE__ */ new Map());
|
|
2861
2864
|
this.ctx = t, this.init();
|
|
2862
2865
|
}
|
|
2863
2866
|
async init() {
|
|
@@ -2915,41 +2918,43 @@ class ui {
|
|
|
2915
2918
|
class oe extends re {
|
|
2916
2919
|
constructor(e, i, s, r, o, n, h) {
|
|
2917
2920
|
super(e, s, r, o, n, "header", h.fixed);
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
|
|
2947
|
-
|
|
2948
|
-
|
|
2949
|
-
|
|
2950
|
-
|
|
2951
|
-
|
|
2952
|
-
this
|
|
2921
|
+
a(this, "align");
|
|
2922
|
+
a(this, "verticalAlign", "middle");
|
|
2923
|
+
a(this, "fixed");
|
|
2924
|
+
a(this, "minWidth");
|
|
2925
|
+
a(this, "maxWidth");
|
|
2926
|
+
a(this, "widthFillDisable");
|
|
2927
|
+
a(this, "type");
|
|
2928
|
+
a(this, "operation", !1);
|
|
2929
|
+
a(this, "editorType");
|
|
2930
|
+
a(this, "level");
|
|
2931
|
+
a(this, "text");
|
|
2932
|
+
a(this, "displayText", "");
|
|
2933
|
+
a(this, "colspan");
|
|
2934
|
+
a(this, "rowspan");
|
|
2935
|
+
a(this, "row");
|
|
2936
|
+
a(this, "key");
|
|
2937
|
+
a(this, "required", !1);
|
|
2938
|
+
a(this, "readonly", !1);
|
|
2939
|
+
a(this, "children", []);
|
|
2940
|
+
a(this, "column");
|
|
2941
|
+
a(this, "colIndex");
|
|
2942
|
+
a(this, "rowKey");
|
|
2943
|
+
a(this, "rules");
|
|
2944
|
+
a(this, "hasChildren");
|
|
2945
|
+
a(this, "render");
|
|
2946
|
+
a(this, "style", {});
|
|
2947
|
+
a(this, "drawX", 0);
|
|
2948
|
+
a(this, "drawY", 0);
|
|
2949
|
+
a(this, "drawCellBgColor", "");
|
|
2950
|
+
a(this, "drawTextColor", "");
|
|
2951
|
+
a(this, "drawImageX", 0);
|
|
2952
|
+
a(this, "drawImageY", 0);
|
|
2953
|
+
a(this, "drawImageWidth", 0);
|
|
2954
|
+
a(this, "drawImageHeight", 0);
|
|
2955
|
+
a(this, "drawImageName", "");
|
|
2956
|
+
a(this, "drawImageSource");
|
|
2957
|
+
this.ctx = e, this.x = s, this.y = r, this.width = o, this.height = n, this.colIndex = i, this.key = h.key, this.minWidth = h.minWidth, this.maxWidth = h.maxWidth, this.type = h.type || "", this.editorType = h.editorType || "text", this.align = h.align || "center", this.verticalAlign = h.verticalAlign || "middle", this.fixed = h.fixed, this.level = h.level || 0, this.operation = h.operation || !1, this.text = h.title, this.column = h, this.colspan = h.colspan || 1, this.widthFillDisable = h.widthFillDisable || !1, this.rowspan = h.rowspan || 1, this.rules = h.rules, this.readonly = h.readonly || !1, this.required = h.required || !1, this.rowKey = Jt(), this.hasChildren = h.children && h.children.length > 0 || !1, this.render = h.renderHeader;
|
|
2953
2958
|
}
|
|
2954
2959
|
/**
|
|
2955
2960
|
* 是否可见,覆盖基类方法,表头是跟y滚动条没有关系的所以不需要加滚动参数
|
|
@@ -3010,8 +3015,8 @@ class oe extends re {
|
|
|
3010
3015
|
const { width: e, height: i, type: s } = this;
|
|
3011
3016
|
if (["index-selection", "selection"].includes(s)) {
|
|
3012
3017
|
const { indeterminate: r, check: o, selectable: n } = this.ctx.database.getCheckedState(), { CHECKBOX_SIZE: h = 0 } = this.ctx.config, c = this.drawX + (e - h) / 2, d = this.drawY + (i - h) / 2;
|
|
3013
|
-
let f = this.ctx.icons.get("checkbox-uncheck"),
|
|
3014
|
-
r ? (f = this.ctx.icons.get("checkbox-indeterminate"),
|
|
3018
|
+
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 = h, this.drawImageHeight = h, this.drawImageName = x, this.drawImageSource = f, this.ctx.paint.drawImage(
|
|
3015
3020
|
this.drawImageSource,
|
|
3016
3021
|
this.drawImageX,
|
|
3017
3022
|
this.drawImageY,
|
|
@@ -3040,12 +3045,12 @@ class oe extends re {
|
|
|
3040
3045
|
};
|
|
3041
3046
|
}
|
|
3042
3047
|
}
|
|
3043
|
-
class
|
|
3048
|
+
class ui {
|
|
3044
3049
|
constructor(t) {
|
|
3045
|
-
|
|
3046
|
-
|
|
3047
|
-
|
|
3048
|
-
|
|
3050
|
+
a(this, "ctx");
|
|
3051
|
+
a(this, "visibleHoverCell");
|
|
3052
|
+
a(this, "resizeObserver");
|
|
3053
|
+
a(this, "mutationObserver");
|
|
3049
3054
|
this.ctx = t, this.init();
|
|
3050
3055
|
}
|
|
3051
3056
|
init() {
|
|
@@ -3215,58 +3220,59 @@ class xi {
|
|
|
3215
3220
|
}
|
|
3216
3221
|
class gi {
|
|
3217
3222
|
constructor(t, e) {
|
|
3218
|
-
|
|
3219
|
-
|
|
3220
|
-
|
|
3221
|
-
|
|
3222
|
-
|
|
3223
|
-
|
|
3224
|
-
|
|
3225
|
-
|
|
3226
|
-
|
|
3227
|
-
|
|
3228
|
-
|
|
3229
|
-
|
|
3230
|
-
|
|
3231
|
-
|
|
3232
|
-
|
|
3233
|
-
|
|
3234
|
-
|
|
3235
|
-
|
|
3223
|
+
a(this, "eventBus");
|
|
3224
|
+
a(this, "eventBrowser");
|
|
3225
|
+
a(this, "eventTable");
|
|
3226
|
+
a(this, "containerElement");
|
|
3227
|
+
a(this, "stageElement");
|
|
3228
|
+
a(this, "canvasElement");
|
|
3229
|
+
a(this, "overlayerElement");
|
|
3230
|
+
a(this, "editorElement");
|
|
3231
|
+
a(this, "emptyElement");
|
|
3232
|
+
a(this, "contextMenuElement");
|
|
3233
|
+
a(this, "stageWidth", 0);
|
|
3234
|
+
a(this, "stageHeight", 0);
|
|
3235
|
+
a(this, "paint");
|
|
3236
|
+
a(this, "icons");
|
|
3237
|
+
a(this, "isMouseoverTargetContainer", !1);
|
|
3238
|
+
a(this, "mousedown", !1);
|
|
3239
|
+
a(this, "isPointer", !1);
|
|
3240
|
+
a(this, "rowResizing", !1);
|
|
3236
3241
|
// 行调整大小中
|
|
3237
|
-
|
|
3242
|
+
a(this, "columnResizing", !1);
|
|
3238
3243
|
// 列调整大小中
|
|
3239
|
-
|
|
3244
|
+
a(this, "scrollerMove", !1);
|
|
3240
3245
|
// 滚动条移动中
|
|
3241
|
-
|
|
3246
|
+
a(this, "scrollerFocus", !1);
|
|
3242
3247
|
// 滚动条focus中
|
|
3243
|
-
|
|
3248
|
+
a(this, "autofillMove", !1);
|
|
3244
3249
|
// 自动填充移动中
|
|
3245
|
-
|
|
3250
|
+
a(this, "selectorMove", !1);
|
|
3246
3251
|
// 选择器移动中
|
|
3247
|
-
|
|
3252
|
+
a(this, "adjustPositioning", !1);
|
|
3248
3253
|
// 调整位置中
|
|
3249
|
-
|
|
3254
|
+
a(this, "editing", !1);
|
|
3250
3255
|
// 编辑中
|
|
3251
|
-
|
|
3256
|
+
a(this, "onlyMergeCell", !1);
|
|
3252
3257
|
// 只有合并单元格
|
|
3253
|
-
|
|
3258
|
+
a(this, "selectOnlyOne", !1);
|
|
3254
3259
|
// 只选择一个
|
|
3255
|
-
|
|
3256
|
-
|
|
3257
|
-
|
|
3258
|
-
|
|
3259
|
-
|
|
3260
|
-
|
|
3261
|
-
|
|
3262
|
-
|
|
3263
|
-
|
|
3264
|
-
|
|
3265
|
-
|
|
3266
|
-
|
|
3267
|
-
|
|
3268
|
-
|
|
3269
|
-
|
|
3260
|
+
a(this, "scrollY", 0);
|
|
3261
|
+
a(this, "scrollX", 0);
|
|
3262
|
+
a(this, "fixedLeftWidth", 0);
|
|
3263
|
+
a(this, "fixedRightWidth", 0);
|
|
3264
|
+
a(this, "lastCenterColIndex", 0);
|
|
3265
|
+
a(this, "maxColIndex", 0);
|
|
3266
|
+
a(this, "maxRowIndex", 0);
|
|
3267
|
+
a(this, "hoverRow");
|
|
3268
|
+
a(this, "clickCell");
|
|
3269
|
+
a(this, "focusCell");
|
|
3270
|
+
a(this, "currentCell");
|
|
3271
|
+
a(this, "hoverCell");
|
|
3272
|
+
a(this, "clickCellHeader");
|
|
3273
|
+
a(this, "focusCellHeader");
|
|
3274
|
+
a(this, "hoverCellHeader");
|
|
3275
|
+
a(this, "body", {
|
|
3270
3276
|
x: 0,
|
|
3271
3277
|
y: 0,
|
|
3272
3278
|
width: 0,
|
|
@@ -3279,7 +3285,7 @@ class gi {
|
|
|
3279
3285
|
renderRows: [],
|
|
3280
3286
|
data: []
|
|
3281
3287
|
});
|
|
3282
|
-
|
|
3288
|
+
a(this, "footer", {
|
|
3283
3289
|
x: 0,
|
|
3284
3290
|
y: 0,
|
|
3285
3291
|
width: 0,
|
|
@@ -3288,7 +3294,7 @@ class gi {
|
|
|
3288
3294
|
visibleWidth: 0,
|
|
3289
3295
|
renderRows: []
|
|
3290
3296
|
});
|
|
3291
|
-
|
|
3297
|
+
a(this, "header", {
|
|
3292
3298
|
x: 0,
|
|
3293
3299
|
y: 0,
|
|
3294
3300
|
width: 0,
|
|
@@ -3303,21 +3309,21 @@ class gi {
|
|
|
3303
3309
|
fixedRightCellHeaders: [],
|
|
3304
3310
|
renderCenterCellHeaders: []
|
|
3305
3311
|
});
|
|
3306
|
-
|
|
3312
|
+
a(this, "selector", {
|
|
3307
3313
|
enable: !1,
|
|
3308
3314
|
xArr: [-1, -1],
|
|
3309
3315
|
yArr: [-1, -1],
|
|
3310
3316
|
xArrCopy: [-1, -1],
|
|
3311
3317
|
yArrCopy: [-1, -1]
|
|
3312
3318
|
});
|
|
3313
|
-
|
|
3319
|
+
a(this, "autofill", {
|
|
3314
3320
|
enable: !1,
|
|
3315
3321
|
xArr: [-1, -1],
|
|
3316
3322
|
yArr: [-1, -1]
|
|
3317
3323
|
});
|
|
3318
|
-
|
|
3319
|
-
|
|
3320
|
-
|
|
3324
|
+
a(this, "database");
|
|
3325
|
+
a(this, "history");
|
|
3326
|
+
a(this, "config");
|
|
3321
3327
|
const {
|
|
3322
3328
|
containerElement: i,
|
|
3323
3329
|
stageElement: s,
|
|
@@ -3327,7 +3333,7 @@ class gi {
|
|
|
3327
3333
|
emptyElement: h,
|
|
3328
3334
|
contextMenuElement: c
|
|
3329
3335
|
} = t;
|
|
3330
|
-
this.containerElement = i, s.tabIndex = 0, this.stageElement = s, this.canvasElement = r, this.overlayerElement = o, this.editorElement = n, this.emptyElement = h, this.contextMenuElement = c, this.config = new Wt(e.config || {}), this.eventBus = new di(), this.eventBrowser = new ci(this), this.eventTable = new
|
|
3336
|
+
this.containerElement = i, s.tabIndex = 0, this.stageElement = s, this.canvasElement = r, this.overlayerElement = o, this.editorElement = n, this.emptyElement = h, this.contextMenuElement = c, this.config = new Wt(e.config || {}), this.eventBus = new di(), this.eventBrowser = new ci(this), this.eventTable = new ui(this), this.paint = new fi(this.canvasElement), this.database = new li(this, e), this.history = new hi(this), this.icons = new xi(this);
|
|
3331
3337
|
}
|
|
3332
3338
|
setConfig(t) {
|
|
3333
3339
|
this.config = new Wt(t);
|
|
@@ -3360,7 +3366,18 @@ class gi {
|
|
|
3360
3366
|
}
|
|
3361
3367
|
setFocusCell(t) {
|
|
3362
3368
|
var e;
|
|
3363
|
-
|
|
3369
|
+
if (this.focusCell !== t) {
|
|
3370
|
+
if (((e = this.focusCell) == null ? void 0 : e.rowKey) !== t.rowKey) {
|
|
3371
|
+
this.currentCell = t, this.emit("rowFocusChange", t);
|
|
3372
|
+
const i = {
|
|
3373
|
+
rowIndex: t.rowIndex,
|
|
3374
|
+
rowKey: t.rowKey,
|
|
3375
|
+
row: t.row
|
|
3376
|
+
};
|
|
3377
|
+
this.emit("currentRowChange", i);
|
|
3378
|
+
}
|
|
3379
|
+
this.focusCell = t, this.emit("cellFocusChange", t);
|
|
3380
|
+
}
|
|
3364
3381
|
}
|
|
3365
3382
|
clearSelector() {
|
|
3366
3383
|
this.selector.enable = !1, this.selector.xArr = [-1, -1], this.selector.yArr = [-1, -1], this.emit("clearSelector");
|
|
@@ -3446,29 +3463,29 @@ class gi {
|
|
|
3446
3463
|
}
|
|
3447
3464
|
class zt {
|
|
3448
3465
|
constructor(t, e) {
|
|
3449
|
-
|
|
3450
|
-
|
|
3451
|
-
|
|
3452
|
-
|
|
3453
|
-
|
|
3454
|
-
|
|
3455
|
-
|
|
3456
|
-
|
|
3466
|
+
a(this, "ctx");
|
|
3467
|
+
a(this, "type");
|
|
3468
|
+
a(this, "isFocus", !1);
|
|
3469
|
+
a(this, "trackX", 0);
|
|
3470
|
+
a(this, "trackY", 0);
|
|
3471
|
+
a(this, "trackWidth", 0);
|
|
3472
|
+
a(this, "trackHeight", 0);
|
|
3473
|
+
a(this, "splitPoints", []);
|
|
3457
3474
|
//分割线
|
|
3458
|
-
|
|
3459
|
-
|
|
3460
|
-
|
|
3461
|
-
|
|
3462
|
-
|
|
3475
|
+
a(this, "barX", 0);
|
|
3476
|
+
a(this, "barY", 0);
|
|
3477
|
+
a(this, "barWidth", 0);
|
|
3478
|
+
a(this, "barHeight", 0);
|
|
3479
|
+
a(this, "distance", 0);
|
|
3463
3480
|
// 滚动条的长度
|
|
3464
|
-
|
|
3481
|
+
a(this, "visibleDistance", 0);
|
|
3465
3482
|
//可见区域的长度
|
|
3466
|
-
|
|
3467
|
-
|
|
3468
|
-
|
|
3483
|
+
a(this, "clientX", 0);
|
|
3484
|
+
a(this, "clientY", 0);
|
|
3485
|
+
a(this, "dragStart", 0);
|
|
3469
3486
|
// 拖拽开始的位置
|
|
3470
|
-
|
|
3471
|
-
|
|
3487
|
+
a(this, "isDragging", !1);
|
|
3488
|
+
a(this, "scroll", 0);
|
|
3472
3489
|
this.ctx = t, this.type = e, this.type === "vertical" ? this.scroll = this.ctx.scrollY : this.scroll = this.ctx.scrollX;
|
|
3473
3490
|
}
|
|
3474
3491
|
onWheel(t) {
|
|
@@ -3533,12 +3550,12 @@ class zt {
|
|
|
3533
3550
|
stageHeight: i,
|
|
3534
3551
|
stageWidth: s,
|
|
3535
3552
|
config: { SCROLLER_TRACK_SIZE: r = 0, SCROLLER_SIZE: o = 0, BORDER: n }
|
|
3536
|
-
} = this.ctx, h = s, c = i, d = e.height, f = e.width,
|
|
3553
|
+
} = this.ctx, h = s, c = i, d = e.height, f = e.width, x = t.height, g = this.ctx.footer.height;
|
|
3537
3554
|
if (this.type === "vertical") {
|
|
3538
|
-
this.visibleDistance = c - r - d, this.distance =
|
|
3539
|
-
const
|
|
3540
|
-
let
|
|
3541
|
-
|
|
3555
|
+
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
|
+
const p = this.distance ? this.visibleDistance / (x + g) : 0;
|
|
3557
|
+
let u = Math.floor(p * this.visibleDistance);
|
|
3558
|
+
u < 30 ? u = 30 : u > this.visibleDistance && (u = 0), this.barHeight = u, this.barY = d + this.scroll / this.distance * (this.visibleDistance - this.barHeight), this.scroll = Math.max(0, Math.min(this.scroll, this.distance));
|
|
3542
3559
|
} else {
|
|
3543
3560
|
this.visibleDistance = h - r, this.distance = f - this.visibleDistance, this.splitPoints = [
|
|
3544
3561
|
h - r,
|
|
@@ -3546,10 +3563,10 @@ class zt {
|
|
|
3546
3563
|
h - r,
|
|
3547
3564
|
c
|
|
3548
3565
|
];
|
|
3549
|
-
const
|
|
3550
|
-
this.trackX = 0, this.trackY = c - r +
|
|
3551
|
-
const
|
|
3552
|
-
let w = Math.floor(
|
|
3566
|
+
const p = n ? 0 : 0.5;
|
|
3567
|
+
this.trackX = 0, this.trackY = c - r + p, this.trackWidth = h, this.trackHeight = r;
|
|
3568
|
+
const u = this.distance ? this.visibleDistance / f : 0;
|
|
3569
|
+
let w = Math.floor(u * this.visibleDistance);
|
|
3553
3570
|
this.barY = this.trackY - 1 + (r - o) / 2, w < 30 ? w = 30 : w >= this.visibleDistance && (w = 0), this.barWidth = w, this.barHeight = o, this.barX = this.scroll / this.distance * (this.visibleDistance - this.barWidth), this.scroll = Math.max(0, Math.min(this.scroll, this.distance));
|
|
3554
3571
|
}
|
|
3555
3572
|
}
|
|
@@ -3573,9 +3590,9 @@ class zt {
|
|
|
3573
3590
|
}
|
|
3574
3591
|
class wi {
|
|
3575
3592
|
constructor(t) {
|
|
3576
|
-
|
|
3577
|
-
|
|
3578
|
-
|
|
3593
|
+
a(this, "ctx");
|
|
3594
|
+
a(this, "verticalScrollbar");
|
|
3595
|
+
a(this, "horizontalScrollbar");
|
|
3579
3596
|
this.ctx = t, this.verticalScrollbar = new zt(t, "vertical"), this.horizontalScrollbar = new zt(t, "horizontal"), this.ctx.on("wheel", (e) => this.onWheel(e)), this.ctx.on("mousedown", (e) => this.onMouseDown(e)), this.ctx.on("mousemove", (e) => this.onMouseMove(e)), this.ctx.on("mouseup", () => this.onMouseUp()), this.ctx.on("touchmove", (e) => this.onTouchmove(e)), this.ctx.on("touchstart", (e) => {
|
|
3580
3597
|
this.onTouchstart(e);
|
|
3581
3598
|
}), this.ctx.on("setScroll", (e, i) => {
|
|
@@ -3640,41 +3657,41 @@ class wi {
|
|
|
3640
3657
|
}
|
|
3641
3658
|
class pi {
|
|
3642
3659
|
constructor(t) {
|
|
3643
|
-
|
|
3660
|
+
a(this, "ctx");
|
|
3644
3661
|
// 上下文
|
|
3645
|
-
|
|
3662
|
+
a(this, "x", 0);
|
|
3646
3663
|
// x坐标
|
|
3647
|
-
|
|
3664
|
+
a(this, "y", 0);
|
|
3648
3665
|
// y坐标
|
|
3649
|
-
|
|
3666
|
+
a(this, "width", 0);
|
|
3650
3667
|
// 宽度
|
|
3651
|
-
|
|
3668
|
+
a(this, "height", 0);
|
|
3652
3669
|
// 高度
|
|
3653
|
-
|
|
3670
|
+
a(this, "resizeTarget", null);
|
|
3654
3671
|
//调整表头
|
|
3655
|
-
|
|
3672
|
+
a(this, "resizeNum", 0);
|
|
3656
3673
|
// 调整列的数量
|
|
3657
|
-
|
|
3674
|
+
a(this, "isResizing", !1);
|
|
3658
3675
|
// 是否移动中
|
|
3659
|
-
|
|
3676
|
+
a(this, "clientX", 0);
|
|
3660
3677
|
// 鼠标按下时的x轴位置
|
|
3661
|
-
|
|
3678
|
+
a(this, "resizeDiff", 0);
|
|
3662
3679
|
// 是否移动中
|
|
3663
|
-
|
|
3664
|
-
|
|
3680
|
+
a(this, "columnIndex", 0);
|
|
3681
|
+
a(this, "isMouseDown", !1);
|
|
3665
3682
|
// 是否按下
|
|
3666
|
-
|
|
3667
|
-
|
|
3668
|
-
|
|
3669
|
-
|
|
3670
|
-
|
|
3671
|
-
|
|
3672
|
-
|
|
3673
|
-
|
|
3674
|
-
|
|
3675
|
-
|
|
3676
|
-
|
|
3677
|
-
|
|
3683
|
+
a(this, "columns");
|
|
3684
|
+
a(this, "visibleLeafColumns", []);
|
|
3685
|
+
a(this, "visibleHeight", 0);
|
|
3686
|
+
a(this, "visibleWidth", 0);
|
|
3687
|
+
a(this, "allCellHeaders", []);
|
|
3688
|
+
a(this, "leafCellHeaders", []);
|
|
3689
|
+
a(this, "renderLeafCellHeaders", []);
|
|
3690
|
+
a(this, "fixedLeftCellHeaders", []);
|
|
3691
|
+
a(this, "centerCellHeaders", []);
|
|
3692
|
+
a(this, "fixedRightCellHeaders", []);
|
|
3693
|
+
a(this, "renderCenterCellHeaders", []);
|
|
3694
|
+
a(this, "renderFixedCellHeaders", []);
|
|
3678
3695
|
this.ctx = t, this.ctx.on(
|
|
3679
3696
|
"resetHeader",
|
|
3680
3697
|
Qt(() => {
|
|
@@ -3688,20 +3705,23 @@ class pi {
|
|
|
3688
3705
|
} = this.ctx, i = this.ctx.database.getColumns();
|
|
3689
3706
|
this.columns = i, this.allCellHeaders = [], this.leafCellHeaders = [], this.fixedLeftCellHeaders = [], this.fixedRightCellHeaders = [], this.centerCellHeaders = [];
|
|
3690
3707
|
const s = te(i), r = _t(i);
|
|
3691
|
-
this.height = t * s, this.width = r.reduce((f,
|
|
3708
|
+
this.height = t * s, this.width = r.reduce((f, x) => {
|
|
3709
|
+
const { width: g = 100, maxWidth: p, minWidth: u } = x;
|
|
3710
|
+
return p && g > p ? f + p : u && g < u ? f + u : f + g;
|
|
3711
|
+
}, 0), this.visibleHeight = this.height;
|
|
3692
3712
|
const o = ei(ee(i, s));
|
|
3693
3713
|
this.columnIndex = 0, this.resizeNum = 0, this.render(o, 0), this.ctx.database.updateColIndexKeyMap(this.leafCellHeaders);
|
|
3694
3714
|
const n = this.ctx.containerElement.getBoundingClientRect();
|
|
3695
|
-
this.resizeNum > 0 ? this.ctx.stageWidth = Math.floor(n.width) : this.ctx.stageWidth = Math.floor(this.width + e), this.ctx.stageElement.style.width = this.ctx.stageWidth
|
|
3715
|
+
this.resizeNum > 0 ? this.ctx.stageWidth = Math.floor(n.width) : this.ctx.stageWidth = Math.floor(this.width + e), this.ctx.stageElement.style.width = this.ctx.stageWidth + "px", this.visibleWidth = this.ctx.stageWidth - e;
|
|
3696
3716
|
const h = this.visibleWidth - this.width;
|
|
3697
3717
|
if (this.resizeNum && h > 0) {
|
|
3698
3718
|
const f = Math.floor(h / this.resizeNum * 100) / 100;
|
|
3699
3719
|
this.resizeAllColumn(f);
|
|
3700
3720
|
}
|
|
3701
3721
|
const c = this.fixedLeftCellHeaders.filter((f) => !f.hasChildren);
|
|
3702
|
-
this.ctx.fixedLeftWidth = c.reduce((f,
|
|
3722
|
+
this.ctx.fixedLeftWidth = c.reduce((f, x) => f + x.width, 0);
|
|
3703
3723
|
const d = this.fixedRightCellHeaders.filter((f) => !f.hasChildren);
|
|
3704
|
-
this.ctx.fixedRightWidth = d.reduce((f,
|
|
3724
|
+
this.ctx.fixedRightWidth = d.reduce((f, x) => f + x.width, e), this.ctx.maxColIndex = this.leafCellHeaders.length - 1, this.ctx.header.x = this.x, this.ctx.header.y = this.y, this.ctx.header.width = this.width, this.ctx.header.height = this.height, this.ctx.header.visibleWidth = this.visibleWidth, this.ctx.header.visibleHeight = this.visibleHeight;
|
|
3705
3725
|
}
|
|
3706
3726
|
// 调整表头的宽度
|
|
3707
3727
|
initResizeColumn() {
|
|
@@ -3711,7 +3731,7 @@ class pi {
|
|
|
3711
3731
|
t && (this.ctx.on("mousedown", (e) => {
|
|
3712
3732
|
this.ctx.isTarget(e) && (this.clientX = e.clientX, this.resizeTarget ? (this.isResizing = !0, this.ctx.columnResizing = !0) : this.isResizing = !1, this.isMouseDown = !0);
|
|
3713
3733
|
}), this.ctx.on("mouseup", () => {
|
|
3714
|
-
this.isMouseDown = !1, this.resizeDiff !== 0 && this.resizeTarget && this.resizeColumn(this.resizeTarget, this.resizeDiff), this.resizeTarget = null, this.isResizing = !1, this.ctx.columnResizing = !1, this.clientX = 0;
|
|
3734
|
+
this.isMouseDown = !1, this.resizeDiff !== 0 && this.resizeTarget && this.resizeColumn(this.resizeTarget, this.resizeDiff), this.resizeTarget = null, this.isResizing = !1, this.isMouseDown = !1, this.ctx.columnResizing = !1, this.clientX = 0, this.resizeDiff = 0;
|
|
3715
3735
|
}), this.ctx.on("mousemove", (e) => {
|
|
3716
3736
|
if (this.ctx.editing) return;
|
|
3717
3737
|
const {
|
|
@@ -3719,9 +3739,9 @@ class pi {
|
|
|
3719
3739
|
config: { RESIZE_COLUMN_MIN_WIDTH: s }
|
|
3720
3740
|
} = this.ctx;
|
|
3721
3741
|
if (this.isResizing && this.resizeTarget) {
|
|
3722
|
-
const r = this.resizeTarget.width;
|
|
3723
|
-
let
|
|
3724
|
-
|
|
3742
|
+
const r = this.resizeTarget.width, o = this.resizeTarget.minWidth, n = this.resizeTarget.maxWidth;
|
|
3743
|
+
let h = e.clientX - this.clientX;
|
|
3744
|
+
h + r < s && (h = -(r - s)), o && h + r < o && (h = -(r - o)), n && h + r > n && (h = n - r), this.resizeDiff = h, this.ctx.emit("draw");
|
|
3725
3745
|
} else {
|
|
3726
3746
|
if (this.resizeTarget = null, this.isMouseDown)
|
|
3727
3747
|
return;
|
|
@@ -3789,10 +3809,10 @@ class pi {
|
|
|
3789
3809
|
const { HEADER_HEIGHT: r = 0 } = this.ctx.config;
|
|
3790
3810
|
for (let o = 0; o < i; o++) {
|
|
3791
3811
|
const n = t[o], h = r * (n.rowspan || 0), c = r * (n.level || 0);
|
|
3792
|
-
let d = n.width || 100;
|
|
3793
|
-
n.children && (
|
|
3794
|
-
const
|
|
3795
|
-
this.ctx.database.setHeader(n.key,
|
|
3812
|
+
let { minWidth: d, maxWidth: f } = n, x = n.width || 100;
|
|
3813
|
+
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, h, n);
|
|
3815
|
+
this.ctx.database.setHeader(n.key, g), this.allCellHeaders.push(g), n.children || (this.leafCellHeaders.push(g), g.column.widthFillDisable || this.resizeNum++), n.fixed === "left" ? this.fixedLeftCellHeaders.push(g) : n.fixed === "right" ? this.fixedRightCellHeaders.push(g) : this.centerCellHeaders.push(g), !n.children && this.columnIndex++, n.children && this.render(n.children, s), s += x;
|
|
3796
3816
|
}
|
|
3797
3817
|
}
|
|
3798
3818
|
drawTipLine() {
|
|
@@ -3867,18 +3887,18 @@ class pi {
|
|
|
3867
3887
|
}
|
|
3868
3888
|
class ne {
|
|
3869
3889
|
constructor(t, e, i = 0, s = 0, r = 0, o = 0, n, h = "body") {
|
|
3870
|
-
|
|
3871
|
-
|
|
3872
|
-
|
|
3873
|
-
|
|
3874
|
-
|
|
3875
|
-
|
|
3876
|
-
|
|
3877
|
-
|
|
3878
|
-
|
|
3879
|
-
|
|
3880
|
-
|
|
3881
|
-
|
|
3890
|
+
a(this, "ctx");
|
|
3891
|
+
a(this, "x", 0);
|
|
3892
|
+
a(this, "y", 0);
|
|
3893
|
+
a(this, "width", 0);
|
|
3894
|
+
a(this, "height");
|
|
3895
|
+
a(this, "cells", []);
|
|
3896
|
+
a(this, "fixedCells", []);
|
|
3897
|
+
a(this, "noFixedCells", []);
|
|
3898
|
+
a(this, "rowIndex", 0);
|
|
3899
|
+
a(this, "rowKey", "");
|
|
3900
|
+
a(this, "rowType", "body");
|
|
3901
|
+
a(this, "data");
|
|
3882
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 = h, this.data = n, this.update();
|
|
3883
3903
|
}
|
|
3884
3904
|
update() {
|
|
@@ -3922,29 +3942,29 @@ class ne {
|
|
|
3922
3942
|
}
|
|
3923
3943
|
class mi {
|
|
3924
3944
|
constructor(t) {
|
|
3925
|
-
|
|
3945
|
+
a(this, "resizeTarget", null);
|
|
3926
3946
|
//调整行大小的目标
|
|
3927
|
-
|
|
3947
|
+
a(this, "isMouseDown", !1);
|
|
3928
3948
|
// 是否按下
|
|
3929
|
-
|
|
3949
|
+
a(this, "resizeDiff", 0);
|
|
3930
3950
|
// 是否移动中
|
|
3931
|
-
|
|
3951
|
+
a(this, "clientY", 0);
|
|
3932
3952
|
// 鼠标按下时的y轴位置
|
|
3933
|
-
|
|
3934
|
-
|
|
3935
|
-
|
|
3936
|
-
|
|
3937
|
-
|
|
3938
|
-
|
|
3939
|
-
|
|
3940
|
-
|
|
3953
|
+
a(this, "ctx");
|
|
3954
|
+
a(this, "x", 0);
|
|
3955
|
+
a(this, "y", 0);
|
|
3956
|
+
a(this, "width", 0);
|
|
3957
|
+
a(this, "height", 0);
|
|
3958
|
+
a(this, "headIndex", 0);
|
|
3959
|
+
a(this, "tailIndex", 0);
|
|
3960
|
+
a(this, "isResizing", !1);
|
|
3941
3961
|
//是否正在调整大小
|
|
3942
|
-
|
|
3943
|
-
|
|
3944
|
-
|
|
3945
|
-
|
|
3946
|
-
|
|
3947
|
-
|
|
3962
|
+
a(this, "renderRows", []);
|
|
3963
|
+
a(this, "visibleRows", []);
|
|
3964
|
+
a(this, "visibleHeight", 0);
|
|
3965
|
+
a(this, "visibleWidth", 0);
|
|
3966
|
+
a(this, "containerRect");
|
|
3967
|
+
a(this, "data", []);
|
|
3948
3968
|
this.ctx = t, this.init(), this.initResizeRow();
|
|
3949
3969
|
}
|
|
3950
3970
|
init() {
|
|
@@ -3961,27 +3981,27 @@ class mi {
|
|
|
3961
3981
|
MAX_HEIGHT: c = 0,
|
|
3962
3982
|
ENABLE_OFFSET_HEIGHT: d = 0,
|
|
3963
3983
|
OFFSET_HEIGHT: f = 0,
|
|
3964
|
-
FOOTER_POSITION:
|
|
3984
|
+
FOOTER_POSITION: x
|
|
3965
3985
|
}
|
|
3966
3986
|
} = this.ctx;
|
|
3967
3987
|
if (!e.width)
|
|
3968
3988
|
return;
|
|
3969
|
-
this.x = 0,
|
|
3970
|
-
const { data: g, sumHeight:
|
|
3971
|
-
this.height =
|
|
3972
|
-
const
|
|
3973
|
-
!this.data.length && !n ? this.height = h : !this.data.length && n && (this.height = n - e.height -
|
|
3989
|
+
this.x = 0, x === "top" && r ? this.y = e.height + i.height : this.y = e.height;
|
|
3990
|
+
const { data: g, sumHeight: p } = s.getData();
|
|
3991
|
+
this.height = p, this.data = g, this.width = e.width, this.visibleWidth = this.ctx.stageWidth - o;
|
|
3992
|
+
const u = this.ctx.footer.height;
|
|
3993
|
+
!this.data.length && !n ? this.height = h : !this.data.length && n && (this.height = n - e.height - u - o);
|
|
3974
3994
|
let w = this.height + e.height + o;
|
|
3975
|
-
w +=
|
|
3976
|
-
let
|
|
3995
|
+
w += u;
|
|
3996
|
+
let m = w;
|
|
3977
3997
|
const C = window.innerHeight, { top: y } = this.containerRect || this.ctx.containerElement.getBoundingClientRect();
|
|
3978
3998
|
if (C > y && d && !n) {
|
|
3979
3999
|
const T = C - y - f;
|
|
3980
|
-
T > e.height + o ?
|
|
3981
|
-
} else this.data.length && n ?
|
|
3982
|
-
|
|
4000
|
+
T > e.height + o ? m = T : w > c && (m = c);
|
|
4001
|
+
} else this.data.length && n ? m = n : this.data.length && c && w > c && (m = c);
|
|
4002
|
+
m > 0 && (this.ctx.stageHeight = Math.floor(m), this.ctx.stageElement.style.height = `${this.ctx.stageHeight}px`);
|
|
3983
4003
|
let b = this.ctx.stageHeight - e.height - o;
|
|
3984
|
-
r ? this.visibleHeight = b -
|
|
4004
|
+
r ? this.visibleHeight = b - u : this.visibleHeight = b, this.data.length || (this.height = this.visibleHeight), this.ctx.body.x = this.x, this.ctx.body.y = this.y, this.ctx.body.width = this.width, this.ctx.body.height = this.height, this.ctx.body.visibleWidth = this.visibleWidth, this.ctx.body.visibleHeight = this.visibleHeight, this.ctx.body.data = g;
|
|
3985
4005
|
const E = window.devicePixelRatio || 1, R = this.ctx.stageWidth * E, O = this.ctx.stageHeight * E;
|
|
3986
4006
|
t.width = Math.round(R), t.height = Math.round(O);
|
|
3987
4007
|
const I = this.data.length ? "not-empty" : "empty";
|
|
@@ -3990,15 +4010,12 @@ class mi {
|
|
|
3990
4010
|
type: I,
|
|
3991
4011
|
headerHeight: e.height,
|
|
3992
4012
|
bodyHeight: this.height,
|
|
3993
|
-
footerHeight:
|
|
4013
|
+
footerHeight: u,
|
|
3994
4014
|
width: this.width,
|
|
3995
|
-
height: this.data.length ? 0 : h +
|
|
4015
|
+
height: this.data.length ? 0 : h + u
|
|
3996
4016
|
});
|
|
3997
4017
|
const _ = Math.round(t.width / E * 1e4) / 1e4, v = Math.round(t.height / E * 1e4) / 1e4;
|
|
3998
|
-
this.ctx.canvasElement.setAttribute(
|
|
3999
|
-
"style",
|
|
4000
|
-
`height:${v}px;width:${_}px;`
|
|
4001
|
-
), this.ctx.paint.scale(E);
|
|
4018
|
+
this.ctx.canvasElement.setAttribute("style", `height:${v}px;width:${_}px;`), this.ctx.paint.scale(E);
|
|
4002
4019
|
}
|
|
4003
4020
|
// 调整行的高度
|
|
4004
4021
|
initResizeRow() {
|
|
@@ -4024,8 +4041,8 @@ class mi {
|
|
|
4024
4041
|
} = this.ctx;
|
|
4025
4042
|
if (this.isResizing && this.resizeTarget) {
|
|
4026
4043
|
const f = this.resizeTarget.height;
|
|
4027
|
-
let
|
|
4028
|
-
|
|
4044
|
+
let x = n - this.clientY;
|
|
4045
|
+
x + f < d && (x = -(f - d)), this.resizeDiff = x, this.ctx.emit("draw");
|
|
4029
4046
|
} else {
|
|
4030
4047
|
if (this.resizeTarget = null, this.isMouseDown)
|
|
4031
4048
|
return;
|
|
@@ -4037,11 +4054,11 @@ class mi {
|
|
|
4037
4054
|
return;
|
|
4038
4055
|
this.ctx.stageElement.style.cursor === "row-resize" && (this.ctx.stageElement.style.cursor = "default");
|
|
4039
4056
|
for (let f = 0; f < this.renderRows.length; f++) {
|
|
4040
|
-
const
|
|
4041
|
-
if (r >
|
|
4042
|
-
for (let
|
|
4043
|
-
const
|
|
4044
|
-
o >
|
|
4057
|
+
const x = this.renderRows[f];
|
|
4058
|
+
if (r > x.y - c + x.height - 1.5 && r < x.y - c + x.height + 1.5 && r < h - 4)
|
|
4059
|
+
for (let p = 0; p < x.cells.length; p++) {
|
|
4060
|
+
const u = x.cells[p];
|
|
4061
|
+
o > u.drawX + 10 && o < u.drawX + u.width - 10 && u.rowspan === 1 && (this.ctx.stageElement.style.cursor = "row-resize", this.resizeTarget = x);
|
|
4045
4062
|
}
|
|
4046
4063
|
}
|
|
4047
4064
|
}
|
|
@@ -4124,7 +4141,7 @@ class mi {
|
|
|
4124
4141
|
this.headIndex = Math.max(0, h), this.tailIndex = Math.min(this.ctx.maxRowIndex, c + 1), this.visibleRows = o.slice(this.headIndex, this.tailIndex + 1), this.ctx.body.headIndex = this.headIndex, this.ctx.body.tailIndex = this.tailIndex, this.ctx.body.visibleRows = this.visibleRows;
|
|
4125
4142
|
const d = [];
|
|
4126
4143
|
for (let f = 0; f < this.visibleRows.length; f++) {
|
|
4127
|
-
const
|
|
4144
|
+
const x = this.headIndex + f, g = this.visibleRows[f], { height: p, top: u } = this.ctx.database.getPositionForRowIndex(x), w = new ne(this.ctx, x, 0, u + this.y, t.width, p, g);
|
|
4128
4145
|
d.push(w);
|
|
4129
4146
|
}
|
|
4130
4147
|
this.renderRows = d, this.ctx.body.renderRows = d;
|
|
@@ -4143,15 +4160,15 @@ class mi {
|
|
|
4143
4160
|
}
|
|
4144
4161
|
class yi {
|
|
4145
4162
|
constructor(t) {
|
|
4146
|
-
|
|
4147
|
-
|
|
4148
|
-
|
|
4149
|
-
|
|
4150
|
-
|
|
4151
|
-
|
|
4152
|
-
|
|
4153
|
-
|
|
4154
|
-
|
|
4163
|
+
a(this, "ctx");
|
|
4164
|
+
a(this, "renderRows", []);
|
|
4165
|
+
a(this, "data", []);
|
|
4166
|
+
a(this, "x", 0);
|
|
4167
|
+
a(this, "y", 0);
|
|
4168
|
+
a(this, "width", 0);
|
|
4169
|
+
a(this, "height", 0);
|
|
4170
|
+
a(this, "visibleWidth", 0);
|
|
4171
|
+
a(this, "visibleHeight", 0);
|
|
4155
4172
|
this.ctx = t, this.init();
|
|
4156
4173
|
}
|
|
4157
4174
|
init() {
|
|
@@ -4225,15 +4242,15 @@ class yi {
|
|
|
4225
4242
|
class Ei {
|
|
4226
4243
|
// 垂直滚动定时器
|
|
4227
4244
|
constructor(t) {
|
|
4228
|
-
|
|
4229
|
-
|
|
4230
|
-
|
|
4231
|
-
|
|
4232
|
-
|
|
4233
|
-
|
|
4234
|
-
|
|
4245
|
+
a(this, "isCut", !1);
|
|
4246
|
+
a(this, "isMultipleRow", !1);
|
|
4247
|
+
a(this, "mousedownHeader", !1);
|
|
4248
|
+
a(this, "ctx");
|
|
4249
|
+
a(this, "adjustPositionX", "");
|
|
4250
|
+
a(this, "adjustPositionY", "");
|
|
4251
|
+
a(this, "timerX", 0);
|
|
4235
4252
|
// 水平滚动定时器
|
|
4236
|
-
|
|
4253
|
+
a(this, "timerY", 0);
|
|
4237
4254
|
this.ctx = t, this.init();
|
|
4238
4255
|
}
|
|
4239
4256
|
init() {
|
|
@@ -4341,16 +4358,16 @@ class Ei {
|
|
|
4341
4358
|
SELECTOR_AREA_MIN_Y: c,
|
|
4342
4359
|
SELECTOR_AREA_MAX_Y: d,
|
|
4343
4360
|
SELECTOR_AREA_MAX_X_OFFSET: f,
|
|
4344
|
-
SELECTOR_AREA_MAX_Y_OFFSET:
|
|
4345
|
-
} = this.ctx.config, g = n,
|
|
4346
|
-
let [
|
|
4347
|
-
if (
|
|
4361
|
+
SELECTOR_AREA_MAX_Y_OFFSET: x
|
|
4362
|
+
} = this.ctx.config, g = n, p = h || this.ctx.maxColIndex - f, u = c, w = d || this.ctx.maxRowIndex - x;
|
|
4363
|
+
let [m, C] = r, [y, b] = o;
|
|
4364
|
+
if (m < g || C > p || y < u || b > w)
|
|
4348
4365
|
return;
|
|
4349
4366
|
if (this.ctx.stageElement.focus({ preventScroll: !0 }), this.ctx.config.ENABLE_MERGE_CELL_LINK) {
|
|
4350
4367
|
const R = this.adjustMergeCells(r, o);
|
|
4351
|
-
y = R.yArr[0], b = R.yArr[1],
|
|
4368
|
+
y = R.yArr[0], b = R.yArr[1], m = R.xArr[0], C = R.xArr[1], this.ctx.onlyMergeCell = R.onlyMergeCell;
|
|
4352
4369
|
}
|
|
4353
|
-
|
|
4370
|
+
m === C && y === b ? this.ctx.selectOnlyOne = !0 : this.ctx.selectOnlyOne = !1, r = [Math.max(g, m), Math.min(p, C)], o = [Math.max(u, y), Math.min(w, b)];
|
|
4354
4371
|
const { BEFORE_SET_SELECTOR_METHOD: E } = this.ctx.config;
|
|
4355
4372
|
if (typeof E == "function") {
|
|
4356
4373
|
const O = E({
|
|
@@ -4366,41 +4383,41 @@ class Ei {
|
|
|
4366
4383
|
}
|
|
4367
4384
|
}
|
|
4368
4385
|
adjustMergeCells(t, e) {
|
|
4369
|
-
var
|
|
4386
|
+
var p;
|
|
4370
4387
|
const [i, s] = e, [r, o] = t;
|
|
4371
4388
|
let n = [], h = [];
|
|
4372
|
-
for (let
|
|
4389
|
+
for (let u = 0; u <= e[1] - e[0]; u++)
|
|
4373
4390
|
for (let w = 0; w <= t[1] - t[0]; w++) {
|
|
4374
|
-
const
|
|
4375
|
-
y && ((
|
|
4391
|
+
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) && h.push(y));
|
|
4376
4393
|
}
|
|
4377
4394
|
const c = n.reduce(
|
|
4378
|
-
(
|
|
4379
|
-
const { yArr:
|
|
4380
|
-
return
|
|
4395
|
+
(u, w) => {
|
|
4396
|
+
const { yArr: m } = w.getSpanInfo(), [C, y] = m;
|
|
4397
|
+
return u.minY = Math.min(u.minY, C), u.maxY = Math.max(u.maxY, y), u;
|
|
4381
4398
|
},
|
|
4382
4399
|
{
|
|
4383
4400
|
minY: i,
|
|
4384
4401
|
maxY: s
|
|
4385
4402
|
}
|
|
4386
4403
|
), d = h.reduce(
|
|
4387
|
-
(
|
|
4388
|
-
const { xArr:
|
|
4389
|
-
return
|
|
4404
|
+
(u, w) => {
|
|
4405
|
+
const { xArr: m } = w.getSpanInfo(), [C, y] = m;
|
|
4406
|
+
return u.minX = Math.min(u.minX, C), u.maxX = Math.max(u.maxX, y), u;
|
|
4390
4407
|
},
|
|
4391
4408
|
{
|
|
4392
4409
|
minX: r,
|
|
4393
4410
|
maxX: o
|
|
4394
4411
|
}
|
|
4395
|
-
), f = [d.minX, d.maxX],
|
|
4412
|
+
), f = [d.minX, d.maxX], x = [c.minY, c.maxY];
|
|
4396
4413
|
let g = !1;
|
|
4397
4414
|
if (d.minX !== d.maxX || c.minY !== c.maxY) {
|
|
4398
|
-
const
|
|
4399
|
-
g = (w && JSON.stringify(w.xArr) + JSON.stringify(w.yArr)) ===
|
|
4415
|
+
const u = JSON.stringify(f) + JSON.stringify(x), w = (p = this.ctx.focusCell) == null ? void 0 : p.getSpanInfo();
|
|
4416
|
+
g = (w && JSON.stringify(w.xArr) + JSON.stringify(w.yArr)) === u;
|
|
4400
4417
|
}
|
|
4401
4418
|
return {
|
|
4402
4419
|
xArr: f,
|
|
4403
|
-
yArr:
|
|
4420
|
+
yArr: x,
|
|
4404
4421
|
onlyMergeCell: g
|
|
4405
4422
|
};
|
|
4406
4423
|
}
|
|
@@ -4438,8 +4455,8 @@ class Ei {
|
|
|
4438
4455
|
SELECTOR_AREA_MAX_Y: o,
|
|
4439
4456
|
SELECTOR_AREA_MAX_X_OFFSET: n,
|
|
4440
4457
|
SELECTOR_AREA_MAX_Y_OFFSET: h
|
|
4441
|
-
} = this.ctx.config, c = i, d = s || this.ctx.maxColIndex - n, f = r,
|
|
4442
|
-
this.setSelector(g,
|
|
4458
|
+
} = 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
|
+
this.setSelector(g, p);
|
|
4443
4460
|
}
|
|
4444
4461
|
}
|
|
4445
4462
|
selectRows(t, e = !0) {
|
|
@@ -4477,8 +4494,8 @@ class Ei {
|
|
|
4477
4494
|
if (this.ctx.selector.enable = !0, i && t) {
|
|
4478
4495
|
if (this.ctx.config.ENABLE_SELECTOR_SINGLE)
|
|
4479
4496
|
return;
|
|
4480
|
-
const { colIndex: s, rowIndex: r } = i, { colIndex: o, rowIndex: n } = e, h = Math.min(o, s), c = Math.max(o, s), d = Math.min(n, r), f = Math.max(n, r),
|
|
4481
|
-
this.setSelector(
|
|
4497
|
+
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
|
+
this.setSelector(x, g);
|
|
4482
4499
|
} else {
|
|
4483
4500
|
this.ctx.emit("cellSelectedClick", e);
|
|
4484
4501
|
const s = [e.colIndex, e.colIndex], r = [e.rowIndex, e.rowIndex];
|
|
@@ -4546,9 +4563,9 @@ class Ei {
|
|
|
4546
4563
|
for (let h = 0; h <= t[1] - t[0]; h++) {
|
|
4547
4564
|
const c = n + e[0], d = h + t[0], f = this.ctx.database.getItemValueForRowIndexAndColIndex(c, d);
|
|
4548
4565
|
if (f) {
|
|
4549
|
-
const { rowKey:
|
|
4550
|
-
this.ctx.database.getReadonly(
|
|
4551
|
-
rowKey:
|
|
4566
|
+
const { rowKey: x, key: g } = f;
|
|
4567
|
+
this.ctx.database.getReadonly(x, g) || (r.add(x), s.push({
|
|
4568
|
+
rowKey: x,
|
|
4552
4569
|
key: g,
|
|
4553
4570
|
value: null,
|
|
4554
4571
|
row: {}
|
|
@@ -4576,18 +4593,18 @@ class Ei {
|
|
|
4576
4593
|
const e = this.ctx.selector.yArr[0], i = this.ctx.selector.xArr[0], s = /* @__PURE__ */ new Set();
|
|
4577
4594
|
navigator.clipboard.readText().then(async (r) => {
|
|
4578
4595
|
let o = si(r);
|
|
4579
|
-
const n = [i, i + o[0].length - 1], h = [e, e + o.length - 1], [c, d] = h, [f,
|
|
4580
|
-
(g > 0 ||
|
|
4596
|
+
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
|
+
(g > 0 || p > 0) && this.ctx.emit("onPastedDataOverflow", {
|
|
4581
4598
|
maxY: d,
|
|
4582
|
-
maxX:
|
|
4599
|
+
maxX: x,
|
|
4583
4600
|
minY: c,
|
|
4584
4601
|
minX: f,
|
|
4585
4602
|
overflowRowCount: g,
|
|
4586
|
-
overflowColCount:
|
|
4603
|
+
overflowColCount: p,
|
|
4587
4604
|
textArr: o
|
|
4588
4605
|
});
|
|
4589
|
-
const
|
|
4590
|
-
if (this.ctx.config.ENABLE_MERGE_CELL_LINK && this.ctx.database.hasMergeCell(n, h) && !
|
|
4606
|
+
const u = o.length === 1 && o[0].length === 1;
|
|
4607
|
+
if (this.ctx.config.ENABLE_MERGE_CELL_LINK && this.ctx.database.hasMergeCell(n, h) && !u) {
|
|
4591
4608
|
const y = {
|
|
4592
4609
|
code: "ERR_MERGED_CELLS_PASTE",
|
|
4593
4610
|
message: "Merged cells cannot span paste data"
|
|
@@ -4628,9 +4645,9 @@ class Ei {
|
|
|
4628
4645
|
}
|
|
4629
4646
|
if (!w.length)
|
|
4630
4647
|
return;
|
|
4631
|
-
const { BEFORE_PASTE_DATA_METHOD:
|
|
4632
|
-
if (typeof
|
|
4633
|
-
const y =
|
|
4648
|
+
const { BEFORE_PASTE_DATA_METHOD: m } = this.ctx.config;
|
|
4649
|
+
if (typeof m == "function") {
|
|
4650
|
+
const y = m, b = w.map((E) => ({
|
|
4634
4651
|
rowKey: E.rowKey,
|
|
4635
4652
|
key: E.key,
|
|
4636
4653
|
value: E.value,
|
|
@@ -4690,8 +4707,8 @@ class Ei {
|
|
|
4690
4707
|
SELECTOR_AREA_MAX_Y: o,
|
|
4691
4708
|
SELECTOR_AREA_MAX_X_OFFSET: n,
|
|
4692
4709
|
SELECTOR_AREA_MAX_Y_OFFSET: h
|
|
4693
|
-
} = this.ctx.config, c = i, d = s || this.ctx.maxColIndex - n, f = r,
|
|
4694
|
-
return !(e < c || e > d || t < f || t >
|
|
4710
|
+
} = this.ctx.config, c = i, d = s || this.ctx.maxColIndex - n, f = r, x = o || this.ctx.maxRowIndex - h;
|
|
4711
|
+
return !(e < c || e > d || t < f || t > x);
|
|
4695
4712
|
}
|
|
4696
4713
|
/**
|
|
4697
4714
|
* 调整滚动条位置,让到达边界时自动滚动
|
|
@@ -4733,16 +4750,16 @@ class Ei {
|
|
|
4733
4750
|
body: h,
|
|
4734
4751
|
scrollX: c,
|
|
4735
4752
|
scrollY: d,
|
|
4736
|
-
config: { SCROLLER_TRACK_SIZE: f, FOOTER_FIXED:
|
|
4753
|
+
config: { SCROLLER_TRACK_SIZE: f, FOOTER_FIXED: x, FOOTER_POSITION: g, ENABLE_MERGE_CELL_LINK: p }
|
|
4737
4754
|
} = this.ctx;
|
|
4738
4755
|
if (!i)
|
|
4739
4756
|
return;
|
|
4740
|
-
|
|
4741
|
-
const { drawX:
|
|
4757
|
+
p && this.ctx.onlyMergeCell && i.updateSpanInfo();
|
|
4758
|
+
const { drawX: u, drawY: w, width: m, height: C, fixed: y } = i, b = r - u + 1, E = i.drawX + m - (e - s) + 1;
|
|
4742
4759
|
let R = o.height - w, O = C;
|
|
4743
4760
|
O > h.visibleHeight && (O = h.visibleHeight);
|
|
4744
4761
|
let I = 0;
|
|
4745
|
-
|
|
4762
|
+
x && (g === "top" ? R = o.height + n.height - w : I = n.visibleHeight);
|
|
4746
4763
|
const _ = w + O - (t - I - f);
|
|
4747
4764
|
let v = c, S = d;
|
|
4748
4765
|
E > 0 && !y ? v = Math.floor(c + E) : b > 0 && !y && (v = Math.floor(c - b)), R > 0 ? S = Math.floor(d - R) : _ > 0 && (S = Math.floor(d + _)), (Math.abs(c - v) > 2 || Math.abs(d - S) > 2) && (this.ctx.adjustPositioning = !0, this.ctx.setScroll(v, S), this.ctx.emit("adjustBoundaryPosition", i));
|
|
@@ -4753,16 +4770,16 @@ class Ei {
|
|
|
4753
4770
|
}
|
|
4754
4771
|
class Ci {
|
|
4755
4772
|
constructor(t) {
|
|
4756
|
-
|
|
4757
|
-
|
|
4773
|
+
a(this, "ctx");
|
|
4774
|
+
a(this, "maxColRowCell");
|
|
4758
4775
|
this.ctx = t, this.init();
|
|
4759
4776
|
}
|
|
4760
4777
|
init() {
|
|
4761
4778
|
this.ctx.on("mousemove", (t) => {
|
|
4762
4779
|
if (this.ctx.stageElement.style.cursor === "crosshair" && (this.ctx.stageElement.style.cursor = "default"), this.ctx.editing || !this.ctx.focusCell || !this.maxColRowCell)
|
|
4763
4780
|
return;
|
|
4764
|
-
const { offsetX: e, offsetY: i } = this.ctx.getOffset(t), { colIndex: s, rowIndex: r, drawX: o, drawY: n, width: h, height: c } = this.maxColRowCell, d = 6, f = s === this.ctx.maxColIndex || r === this.ctx.maxRowIndex ? 0 : 2,
|
|
4765
|
-
e >
|
|
4781
|
+
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
|
+
e > x && i > g && e < x + d && i < g + d && (this.ctx.stageElement.style.cursor = "crosshair");
|
|
4766
4783
|
}), this.ctx.on("cellMouseenter", (t) => {
|
|
4767
4784
|
const { xArr: e, yArr: i } = this.ctx.selector, s = e[1], r = i[1], { colIndex: o, rowIndex: n } = t;
|
|
4768
4785
|
this.ctx.config.ENABLE_AUTOFILL && o === s && n === r && (this.maxColRowCell = t), this.mouseenter(t);
|
|
@@ -4807,13 +4824,13 @@ class Ci {
|
|
|
4807
4824
|
SELECTOR_AREA_MAX_X: c,
|
|
4808
4825
|
SELECTOR_AREA_MIN_Y: d,
|
|
4809
4826
|
SELECTOR_AREA_MAX_Y: f,
|
|
4810
|
-
SELECTOR_AREA_MAX_X_OFFSET:
|
|
4827
|
+
SELECTOR_AREA_MAX_X_OFFSET: x,
|
|
4811
4828
|
SELECTOR_AREA_MAX_Y_OFFSET: g
|
|
4812
|
-
} = this.ctx.config,
|
|
4829
|
+
} = this.ctx.config, p = h, u = c || this.ctx.maxColIndex - x, w = d, m = f || this.ctx.maxRowIndex - g;
|
|
4813
4830
|
let [C, y] = o, [b, E] = n;
|
|
4814
|
-
if (C <
|
|
4831
|
+
if (C < p || b < w)
|
|
4815
4832
|
return;
|
|
4816
|
-
o = [Math.max(
|
|
4833
|
+
o = [Math.max(p, C), Math.min(u, y)], n = [Math.max(w, b), Math.min(m, E)];
|
|
4817
4834
|
const { BEFORE_SET_AUTOFILL_METHOD: R } = this.ctx.config;
|
|
4818
4835
|
if (typeof R == "function") {
|
|
4819
4836
|
const I = R({
|
|
@@ -4834,9 +4851,9 @@ class Ci {
|
|
|
4834
4851
|
async autofillData() {
|
|
4835
4852
|
const t = /* @__PURE__ */ new Set(), e = this.ctx.getSelectedData(), i = /* @__PURE__ */ new Map();
|
|
4836
4853
|
for (let g = 0; g <= e.yArr[1] - e.yArr[0]; g++)
|
|
4837
|
-
for (let
|
|
4838
|
-
const
|
|
4839
|
-
i.set(`${
|
|
4854
|
+
for (let p = 0; p <= e.xArr[1] - e.xArr[0]; p++) {
|
|
4855
|
+
const u = g + e.yArr[0], w = p + e.xArr[0];
|
|
4856
|
+
i.set(`${u}-${w}`, !0);
|
|
4840
4857
|
}
|
|
4841
4858
|
const { value: s } = e, r = s[0].length, o = s.length, n = this.ctx.autofill.xArr, h = this.ctx.autofill.yArr, c = r === 1 && o === 1;
|
|
4842
4859
|
if (this.ctx.config.ENABLE_MERGE_CELL_LINK && this.ctx.database.hasMergeCell(n, h) && !c) {
|
|
@@ -4849,14 +4866,14 @@ class Ci {
|
|
|
4849
4866
|
}
|
|
4850
4867
|
let d = [];
|
|
4851
4868
|
for (let g = 0; g <= h[1] - h[0]; g++)
|
|
4852
|
-
for (let
|
|
4853
|
-
const
|
|
4869
|
+
for (let p = 0; p <= n[1] - n[0]; p++) {
|
|
4870
|
+
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}`;
|
|
4854
4871
|
if (C && !i.has(y)) {
|
|
4855
4872
|
const { rowKey: b, key: E } = C;
|
|
4856
4873
|
this.ctx.database.getReadonly(b, E) || (t.add(b), d.push({
|
|
4857
4874
|
rowKey: b,
|
|
4858
4875
|
key: E,
|
|
4859
|
-
value:
|
|
4876
|
+
value: m,
|
|
4860
4877
|
row: {}
|
|
4861
4878
|
}));
|
|
4862
4879
|
}
|
|
@@ -4866,21 +4883,21 @@ class Ci {
|
|
|
4866
4883
|
this.ctx.selector.xArr = this.ctx.autofill.xArr, this.ctx.selector.yArr = this.ctx.autofill.yArr;
|
|
4867
4884
|
const { BEFORE_AUTOFILL_DATA_METHOD: f } = this.ctx.config;
|
|
4868
4885
|
if (typeof f == "function") {
|
|
4869
|
-
const g = f,
|
|
4870
|
-
rowKey:
|
|
4871
|
-
key:
|
|
4872
|
-
value:
|
|
4873
|
-
oldValue: this.ctx.database.getItemValue(
|
|
4874
|
-
row: this.ctx.database.getRowDataItemForRowKey(
|
|
4886
|
+
const g = f, p = d.map((u) => ({
|
|
4887
|
+
rowKey: u.rowKey,
|
|
4888
|
+
key: u.key,
|
|
4889
|
+
value: u.value,
|
|
4890
|
+
oldValue: this.ctx.database.getItemValue(u.rowKey, u.key),
|
|
4891
|
+
row: this.ctx.database.getRowDataItemForRowKey(u.rowKey)
|
|
4875
4892
|
}));
|
|
4876
|
-
if (d = await g(
|
|
4893
|
+
if (d = await g(p, n, h), d && !d.length)
|
|
4877
4894
|
return;
|
|
4878
4895
|
}
|
|
4879
4896
|
this.ctx.batchSetItemValueByEditor(d, !0);
|
|
4880
|
-
let
|
|
4897
|
+
let x = [];
|
|
4881
4898
|
t.forEach((g) => {
|
|
4882
|
-
|
|
4883
|
-
}), this.ctx.emit("autofillChange", d,
|
|
4899
|
+
x.push(this.ctx.database.getRowDataItemForRowKey(g));
|
|
4900
|
+
}), this.ctx.emit("autofillChange", d, x);
|
|
4884
4901
|
}
|
|
4885
4902
|
mouseenter(t) {
|
|
4886
4903
|
if (["index", "selection", "index-selection"].includes(t.type))
|
|
@@ -4894,9 +4911,9 @@ class Ci {
|
|
|
4894
4911
|
destroy() {
|
|
4895
4912
|
}
|
|
4896
4913
|
}
|
|
4897
|
-
const rt = Math.min, U = Math.max, ft = Math.round, z = (
|
|
4898
|
-
x:
|
|
4899
|
-
y:
|
|
4914
|
+
const rt = Math.min, U = Math.max, ft = Math.round, z = (l) => ({
|
|
4915
|
+
x: l,
|
|
4916
|
+
y: l
|
|
4900
4917
|
}), bi = {
|
|
4901
4918
|
left: "right",
|
|
4902
4919
|
right: "left",
|
|
@@ -4906,46 +4923,46 @@ const rt = Math.min, U = Math.max, ft = Math.round, z = (a) => ({
|
|
|
4906
4923
|
start: "end",
|
|
4907
4924
|
end: "start"
|
|
4908
4925
|
};
|
|
4909
|
-
function It(
|
|
4910
|
-
return U(
|
|
4926
|
+
function It(l, t, e) {
|
|
4927
|
+
return U(l, rt(t, e));
|
|
4911
4928
|
}
|
|
4912
|
-
function at(
|
|
4913
|
-
return typeof
|
|
4929
|
+
function at(l, t) {
|
|
4930
|
+
return typeof l == "function" ? l(t) : l;
|
|
4914
4931
|
}
|
|
4915
|
-
function G(
|
|
4916
|
-
return
|
|
4932
|
+
function G(l) {
|
|
4933
|
+
return l.split("-")[0];
|
|
4917
4934
|
}
|
|
4918
|
-
function lt(
|
|
4919
|
-
return
|
|
4935
|
+
function lt(l) {
|
|
4936
|
+
return l.split("-")[1];
|
|
4920
4937
|
}
|
|
4921
|
-
function ae(
|
|
4922
|
-
return
|
|
4938
|
+
function ae(l) {
|
|
4939
|
+
return l === "x" ? "y" : "x";
|
|
4923
4940
|
}
|
|
4924
|
-
function Mt(
|
|
4925
|
-
return
|
|
4941
|
+
function Mt(l) {
|
|
4942
|
+
return l === "y" ? "height" : "width";
|
|
4926
4943
|
}
|
|
4927
|
-
function J(
|
|
4928
|
-
return ["top", "bottom"].includes(G(
|
|
4944
|
+
function J(l) {
|
|
4945
|
+
return ["top", "bottom"].includes(G(l)) ? "y" : "x";
|
|
4929
4946
|
}
|
|
4930
|
-
function Ht(
|
|
4931
|
-
return ae(J(
|
|
4947
|
+
function Ht(l) {
|
|
4948
|
+
return ae(J(l));
|
|
4932
4949
|
}
|
|
4933
|
-
function Ri(
|
|
4950
|
+
function Ri(l, t, e) {
|
|
4934
4951
|
e === void 0 && (e = !1);
|
|
4935
|
-
const i = lt(
|
|
4952
|
+
const i = lt(l), s = Ht(l), r = Mt(s);
|
|
4936
4953
|
let o = s === "x" ? i === (e ? "end" : "start") ? "right" : "left" : i === "start" ? "bottom" : "top";
|
|
4937
|
-
return t.reference[r] > t.floating[r] && (o =
|
|
4954
|
+
return t.reference[r] > t.floating[r] && (o = xt(o)), [o, xt(o)];
|
|
4938
4955
|
}
|
|
4939
|
-
function _i(
|
|
4940
|
-
const t =
|
|
4941
|
-
return [Ot(
|
|
4956
|
+
function _i(l) {
|
|
4957
|
+
const t = xt(l);
|
|
4958
|
+
return [Ot(l), t, Ot(t)];
|
|
4942
4959
|
}
|
|
4943
|
-
function Ot(
|
|
4944
|
-
return
|
|
4960
|
+
function Ot(l) {
|
|
4961
|
+
return l.replace(/start|end/g, (t) => vi[t]);
|
|
4945
4962
|
}
|
|
4946
|
-
function Ii(
|
|
4963
|
+
function Ii(l, t, e) {
|
|
4947
4964
|
const i = ["left", "right"], s = ["right", "left"], r = ["top", "bottom"], o = ["bottom", "top"];
|
|
4948
|
-
switch (
|
|
4965
|
+
switch (l) {
|
|
4949
4966
|
case "top":
|
|
4950
4967
|
case "bottom":
|
|
4951
4968
|
return e ? t ? s : i : t ? i : s;
|
|
@@ -4956,38 +4973,38 @@ function Ii(a, t, e) {
|
|
|
4956
4973
|
return [];
|
|
4957
4974
|
}
|
|
4958
4975
|
}
|
|
4959
|
-
function Oi(
|
|
4960
|
-
const s = lt(
|
|
4961
|
-
let r = Ii(G(
|
|
4976
|
+
function Oi(l, t, e, i) {
|
|
4977
|
+
const s = lt(l);
|
|
4978
|
+
let r = Ii(G(l), e === "start", i);
|
|
4962
4979
|
return s && (r = r.map((o) => o + "-" + s), t && (r = r.concat(r.map(Ot)))), r;
|
|
4963
4980
|
}
|
|
4964
|
-
function
|
|
4965
|
-
return
|
|
4981
|
+
function xt(l) {
|
|
4982
|
+
return l.replace(/left|right|bottom|top/g, (t) => bi[t]);
|
|
4966
4983
|
}
|
|
4967
|
-
function Li(
|
|
4984
|
+
function Li(l) {
|
|
4968
4985
|
return {
|
|
4969
4986
|
top: 0,
|
|
4970
4987
|
right: 0,
|
|
4971
4988
|
bottom: 0,
|
|
4972
4989
|
left: 0,
|
|
4973
|
-
...
|
|
4990
|
+
...l
|
|
4974
4991
|
};
|
|
4975
4992
|
}
|
|
4976
|
-
function le(
|
|
4977
|
-
return typeof
|
|
4978
|
-
top:
|
|
4979
|
-
right:
|
|
4980
|
-
bottom:
|
|
4981
|
-
left:
|
|
4993
|
+
function le(l) {
|
|
4994
|
+
return typeof l != "number" ? Li(l) : {
|
|
4995
|
+
top: l,
|
|
4996
|
+
right: l,
|
|
4997
|
+
bottom: l,
|
|
4998
|
+
left: l
|
|
4982
4999
|
};
|
|
4983
5000
|
}
|
|
4984
|
-
function
|
|
5001
|
+
function ut(l) {
|
|
4985
5002
|
const {
|
|
4986
5003
|
x: t,
|
|
4987
5004
|
y: e,
|
|
4988
5005
|
width: i,
|
|
4989
5006
|
height: s
|
|
4990
|
-
} =
|
|
5007
|
+
} = l;
|
|
4991
5008
|
return {
|
|
4992
5009
|
width: i,
|
|
4993
5010
|
height: s,
|
|
@@ -4999,12 +5016,12 @@ function xt(a) {
|
|
|
4999
5016
|
y: e
|
|
5000
5017
|
};
|
|
5001
5018
|
}
|
|
5002
|
-
function $t(
|
|
5019
|
+
function $t(l, t, e) {
|
|
5003
5020
|
let {
|
|
5004
5021
|
reference: i,
|
|
5005
5022
|
floating: s
|
|
5006
|
-
} =
|
|
5007
|
-
const r = J(t), o = Ht(t), n = Mt(o), h = G(t), c = r === "y", d = i.x + i.width / 2 - s.width / 2, f = i.y + i.height / 2 - s.height / 2,
|
|
5023
|
+
} = l;
|
|
5024
|
+
const r = J(t), o = Ht(t), n = Mt(o), h = G(t), c = r === "y", d = i.x + i.width / 2 - s.width / 2, f = i.y + i.height / 2 - s.height / 2, x = i[n] / 2 - s[n] / 2;
|
|
5008
5025
|
let g;
|
|
5009
5026
|
switch (h) {
|
|
5010
5027
|
case "top":
|
|
@@ -5039,15 +5056,15 @@ function $t(a, t, e) {
|
|
|
5039
5056
|
}
|
|
5040
5057
|
switch (lt(t)) {
|
|
5041
5058
|
case "start":
|
|
5042
|
-
g[o] -=
|
|
5059
|
+
g[o] -= x * (e && c ? -1 : 1);
|
|
5043
5060
|
break;
|
|
5044
5061
|
case "end":
|
|
5045
|
-
g[o] +=
|
|
5062
|
+
g[o] += x * (e && c ? -1 : 1);
|
|
5046
5063
|
break;
|
|
5047
5064
|
}
|
|
5048
5065
|
return g;
|
|
5049
5066
|
}
|
|
5050
|
-
const Si = async (
|
|
5067
|
+
const Si = async (l, t, e) => {
|
|
5051
5068
|
const {
|
|
5052
5069
|
placement: i = "bottom",
|
|
5053
5070
|
strategy: s = "absolute",
|
|
@@ -5055,33 +5072,33 @@ const Si = async (a, t, e) => {
|
|
|
5055
5072
|
platform: o
|
|
5056
5073
|
} = e, n = r.filter(Boolean), h = await (o.isRTL == null ? void 0 : o.isRTL(t));
|
|
5057
5074
|
let c = await o.getElementRects({
|
|
5058
|
-
reference:
|
|
5075
|
+
reference: l,
|
|
5059
5076
|
floating: t,
|
|
5060
5077
|
strategy: s
|
|
5061
5078
|
}), {
|
|
5062
5079
|
x: d,
|
|
5063
5080
|
y: f
|
|
5064
|
-
} = $t(c, i, h),
|
|
5065
|
-
for (let
|
|
5081
|
+
} = $t(c, i, h), x = i, g = {}, p = 0;
|
|
5082
|
+
for (let u = 0; u < n.length; u++) {
|
|
5066
5083
|
const {
|
|
5067
5084
|
name: w,
|
|
5068
|
-
fn:
|
|
5069
|
-
} = n[
|
|
5085
|
+
fn: m
|
|
5086
|
+
} = n[u], {
|
|
5070
5087
|
x: C,
|
|
5071
5088
|
y,
|
|
5072
5089
|
data: b,
|
|
5073
5090
|
reset: E
|
|
5074
|
-
} = await
|
|
5091
|
+
} = await m({
|
|
5075
5092
|
x: d,
|
|
5076
5093
|
y: f,
|
|
5077
5094
|
initialPlacement: i,
|
|
5078
|
-
placement:
|
|
5095
|
+
placement: x,
|
|
5079
5096
|
strategy: s,
|
|
5080
5097
|
middlewareData: g,
|
|
5081
5098
|
rects: c,
|
|
5082
5099
|
platform: o,
|
|
5083
5100
|
elements: {
|
|
5084
|
-
reference:
|
|
5101
|
+
reference: l,
|
|
5085
5102
|
floating: t
|
|
5086
5103
|
}
|
|
5087
5104
|
});
|
|
@@ -5091,24 +5108,24 @@ const Si = async (a, t, e) => {
|
|
|
5091
5108
|
...g[w],
|
|
5092
5109
|
...b
|
|
5093
5110
|
}
|
|
5094
|
-
}, E &&
|
|
5095
|
-
reference:
|
|
5111
|
+
}, E && p <= 50 && (p++, typeof E == "object" && (E.placement && (x = E.placement), E.rects && (c = E.rects === !0 ? await o.getElementRects({
|
|
5112
|
+
reference: l,
|
|
5096
5113
|
floating: t,
|
|
5097
5114
|
strategy: s
|
|
5098
5115
|
}) : E.rects), {
|
|
5099
5116
|
x: d,
|
|
5100
5117
|
y: f
|
|
5101
|
-
} = $t(c,
|
|
5118
|
+
} = $t(c, x, h)), u = -1);
|
|
5102
5119
|
}
|
|
5103
5120
|
return {
|
|
5104
5121
|
x: d,
|
|
5105
5122
|
y: f,
|
|
5106
|
-
placement:
|
|
5123
|
+
placement: x,
|
|
5107
5124
|
strategy: s,
|
|
5108
5125
|
middlewareData: g
|
|
5109
5126
|
};
|
|
5110
5127
|
};
|
|
5111
|
-
async function he(
|
|
5128
|
+
async function he(l, t) {
|
|
5112
5129
|
var e;
|
|
5113
5130
|
t === void 0 && (t = {});
|
|
5114
5131
|
const {
|
|
@@ -5118,13 +5135,13 @@ async function he(a, t) {
|
|
|
5118
5135
|
rects: o,
|
|
5119
5136
|
elements: n,
|
|
5120
5137
|
strategy: h
|
|
5121
|
-
} =
|
|
5138
|
+
} = l, {
|
|
5122
5139
|
boundary: c = "clippingAncestors",
|
|
5123
5140
|
rootBoundary: d = "viewport",
|
|
5124
5141
|
elementContext: f = "floating",
|
|
5125
|
-
altBoundary:
|
|
5142
|
+
altBoundary: x = !1,
|
|
5126
5143
|
padding: g = 0
|
|
5127
|
-
} = at(t,
|
|
5144
|
+
} = at(t, l), p = le(g), w = n[x ? f === "floating" ? "reference" : "floating" : f], m = ut(await r.getClippingRect({
|
|
5128
5145
|
element: (e = await (r.isElement == null ? void 0 : r.isElement(w))) == null || e ? w : w.contextElement || await (r.getDocumentElement == null ? void 0 : r.getDocumentElement(n.floating)),
|
|
5129
5146
|
boundary: c,
|
|
5130
5147
|
rootBoundary: d,
|
|
@@ -5140,22 +5157,22 @@ async function he(a, t) {
|
|
|
5140
5157
|
} : {
|
|
5141
5158
|
x: 1,
|
|
5142
5159
|
y: 1
|
|
5143
|
-
}, E =
|
|
5160
|
+
}, E = ut(r.convertOffsetParentRelativeRectToViewportRelativeRect ? await r.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
5144
5161
|
elements: n,
|
|
5145
5162
|
rect: C,
|
|
5146
5163
|
offsetParent: y,
|
|
5147
5164
|
strategy: h
|
|
5148
5165
|
}) : C);
|
|
5149
5166
|
return {
|
|
5150
|
-
top: (
|
|
5151
|
-
bottom: (E.bottom -
|
|
5152
|
-
left: (
|
|
5153
|
-
right: (E.right -
|
|
5167
|
+
top: (m.top - E.top + p.top) / b.y,
|
|
5168
|
+
bottom: (E.bottom - m.bottom + p.bottom) / b.y,
|
|
5169
|
+
left: (m.left - E.left + p.left) / b.x,
|
|
5170
|
+
right: (E.right - m.right + p.right) / b.x
|
|
5154
5171
|
};
|
|
5155
5172
|
}
|
|
5156
|
-
const Ti = (
|
|
5173
|
+
const Ti = (l) => ({
|
|
5157
5174
|
name: "arrow",
|
|
5158
|
-
options:
|
|
5175
|
+
options: l,
|
|
5159
5176
|
async fn(t) {
|
|
5160
5177
|
const {
|
|
5161
5178
|
x: e,
|
|
@@ -5168,21 +5185,21 @@ const Ti = (a) => ({
|
|
|
5168
5185
|
} = t, {
|
|
5169
5186
|
element: c,
|
|
5170
5187
|
padding: d = 0
|
|
5171
|
-
} = at(
|
|
5188
|
+
} = at(l, t) || {};
|
|
5172
5189
|
if (c == null)
|
|
5173
5190
|
return {};
|
|
5174
|
-
const f = le(d),
|
|
5191
|
+
const f = le(d), x = {
|
|
5175
5192
|
x: e,
|
|
5176
5193
|
y: i
|
|
5177
|
-
}, g = Ht(s),
|
|
5194
|
+
}, 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));
|
|
5178
5195
|
let O = R ? R[y] : 0;
|
|
5179
|
-
(!O || !await (o.isElement == null ? void 0 : o.isElement(R))) && (O = n.floating[y] || r.floating[
|
|
5180
|
-
const I = b / 2 - E / 2, _ = O / 2 -
|
|
5196
|
+
(!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], _), S = rt(f[C], _), T = v, M = O - u[p] - S, A = O / 2 - u[p] / 2 + I, N = It(T, A, M), Y = !h.arrow && lt(s) != null && A !== N && r.reference[p] / 2 - (A < T ? v : S) - u[p] / 2 < 0, k = Y ? A < T ? A - T : A - M : 0;
|
|
5181
5198
|
return {
|
|
5182
|
-
[g]:
|
|
5199
|
+
[g]: x[g] + k,
|
|
5183
5200
|
data: {
|
|
5184
|
-
[g]:
|
|
5185
|
-
centerOffset: A -
|
|
5201
|
+
[g]: N,
|
|
5202
|
+
centerOffset: A - N - k,
|
|
5186
5203
|
...Y && {
|
|
5187
5204
|
alignmentOffset: k
|
|
5188
5205
|
}
|
|
@@ -5190,10 +5207,10 @@ const Ti = (a) => ({
|
|
|
5190
5207
|
reset: Y
|
|
5191
5208
|
};
|
|
5192
5209
|
}
|
|
5193
|
-
}), Ai = function(
|
|
5194
|
-
return
|
|
5210
|
+
}), Ai = function(l) {
|
|
5211
|
+
return l === void 0 && (l = {}), {
|
|
5195
5212
|
name: "flip",
|
|
5196
|
-
options:
|
|
5213
|
+
options: l,
|
|
5197
5214
|
async fn(t) {
|
|
5198
5215
|
var e, i;
|
|
5199
5216
|
const {
|
|
@@ -5206,19 +5223,19 @@ const Ti = (a) => ({
|
|
|
5206
5223
|
} = t, {
|
|
5207
5224
|
mainAxis: d = !0,
|
|
5208
5225
|
crossAxis: f = !0,
|
|
5209
|
-
fallbackPlacements:
|
|
5226
|
+
fallbackPlacements: x,
|
|
5210
5227
|
fallbackStrategy: g = "bestFit",
|
|
5211
|
-
fallbackAxisSideDirection:
|
|
5212
|
-
flipAlignment:
|
|
5228
|
+
fallbackAxisSideDirection: p = "none",
|
|
5229
|
+
flipAlignment: u = !0,
|
|
5213
5230
|
...w
|
|
5214
|
-
} = at(
|
|
5231
|
+
} = at(l, t);
|
|
5215
5232
|
if ((e = r.arrow) != null && e.alignmentOffset)
|
|
5216
5233
|
return {};
|
|
5217
|
-
const
|
|
5218
|
-
!
|
|
5234
|
+
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
|
+
!x && R && E.push(...Oi(n, u, p, b));
|
|
5219
5236
|
const O = [n, ...E], I = await he(t, w), _ = [];
|
|
5220
5237
|
let v = ((i = r.flip) == null ? void 0 : i.overflows) || [];
|
|
5221
|
-
if (d && _.push(I[
|
|
5238
|
+
if (d && _.push(I[m]), f) {
|
|
5222
5239
|
const A = Ri(s, o, b);
|
|
5223
5240
|
_.push(I[A[0]], I[A[1]]);
|
|
5224
5241
|
}
|
|
@@ -5227,15 +5244,15 @@ const Ti = (a) => ({
|
|
|
5227
5244
|
overflows: _
|
|
5228
5245
|
}], !_.every((A) => A <= 0)) {
|
|
5229
5246
|
var S, T;
|
|
5230
|
-
const A = (((S = r.flip) == null ? void 0 : S.index) || 0) + 1,
|
|
5231
|
-
if (
|
|
5247
|
+
const A = (((S = r.flip) == null ? void 0 : S.index) || 0) + 1, N = O[A];
|
|
5248
|
+
if (N)
|
|
5232
5249
|
return {
|
|
5233
5250
|
data: {
|
|
5234
5251
|
index: A,
|
|
5235
5252
|
overflows: v
|
|
5236
5253
|
},
|
|
5237
5254
|
reset: {
|
|
5238
|
-
placement:
|
|
5255
|
+
placement: N
|
|
5239
5256
|
}
|
|
5240
5257
|
};
|
|
5241
5258
|
let Y = (T = v.filter((k) => k.overflows[0] <= 0).sort((k, W) => k.overflows[1] - W.overflows[1])[0]) == null ? void 0 : T.placement;
|
|
@@ -5270,16 +5287,16 @@ const Ti = (a) => ({
|
|
|
5270
5287
|
}
|
|
5271
5288
|
};
|
|
5272
5289
|
};
|
|
5273
|
-
async function Mi(
|
|
5290
|
+
async function Mi(l, t) {
|
|
5274
5291
|
const {
|
|
5275
5292
|
placement: e,
|
|
5276
5293
|
platform: i,
|
|
5277
5294
|
elements: s
|
|
5278
|
-
} =
|
|
5295
|
+
} = l, r = await (i.isRTL == null ? void 0 : i.isRTL(s.floating)), o = G(e), n = lt(e), h = J(e) === "y", c = ["left", "top"].includes(o) ? -1 : 1, d = r && h ? -1 : 1, f = at(t, l);
|
|
5279
5296
|
let {
|
|
5280
|
-
mainAxis:
|
|
5297
|
+
mainAxis: x,
|
|
5281
5298
|
crossAxis: g,
|
|
5282
|
-
alignmentAxis:
|
|
5299
|
+
alignmentAxis: p
|
|
5283
5300
|
} = typeof f == "number" ? {
|
|
5284
5301
|
mainAxis: f,
|
|
5285
5302
|
crossAxis: 0,
|
|
@@ -5289,18 +5306,18 @@ async function Mi(a, t) {
|
|
|
5289
5306
|
crossAxis: f.crossAxis || 0,
|
|
5290
5307
|
alignmentAxis: f.alignmentAxis
|
|
5291
5308
|
};
|
|
5292
|
-
return n && typeof
|
|
5309
|
+
return n && typeof p == "number" && (g = n === "end" ? p * -1 : p), h ? {
|
|
5293
5310
|
x: g * d,
|
|
5294
|
-
y:
|
|
5311
|
+
y: x * c
|
|
5295
5312
|
} : {
|
|
5296
|
-
x:
|
|
5313
|
+
x: x * c,
|
|
5297
5314
|
y: g * d
|
|
5298
5315
|
};
|
|
5299
5316
|
}
|
|
5300
|
-
const Hi = function(
|
|
5301
|
-
return
|
|
5317
|
+
const Hi = function(l) {
|
|
5318
|
+
return l === void 0 && (l = 0), {
|
|
5302
5319
|
name: "offset",
|
|
5303
|
-
options:
|
|
5320
|
+
options: l,
|
|
5304
5321
|
async fn(t) {
|
|
5305
5322
|
var e, i;
|
|
5306
5323
|
const {
|
|
@@ -5308,7 +5325,7 @@ const Hi = function(a) {
|
|
|
5308
5325
|
y: r,
|
|
5309
5326
|
placement: o,
|
|
5310
5327
|
middlewareData: n
|
|
5311
|
-
} = t, h = await Mi(t,
|
|
5328
|
+
} = t, h = await Mi(t, l);
|
|
5312
5329
|
return o === ((e = n.offset) == null ? void 0 : e.placement) && (i = n.arrow) != null && i.alignmentOffset ? {} : {
|
|
5313
5330
|
x: s + h.x,
|
|
5314
5331
|
y: r + h.y,
|
|
@@ -5319,10 +5336,10 @@ const Hi = function(a) {
|
|
|
5319
5336
|
};
|
|
5320
5337
|
}
|
|
5321
5338
|
};
|
|
5322
|
-
}, Di = function(
|
|
5323
|
-
return
|
|
5339
|
+
}, Di = function(l) {
|
|
5340
|
+
return l === void 0 && (l = {}), {
|
|
5324
5341
|
name: "shift",
|
|
5325
|
-
options:
|
|
5342
|
+
options: l,
|
|
5326
5343
|
async fn(t) {
|
|
5327
5344
|
const {
|
|
5328
5345
|
x: e,
|
|
@@ -5334,41 +5351,41 @@ const Hi = function(a) {
|
|
|
5334
5351
|
limiter: n = {
|
|
5335
5352
|
fn: (w) => {
|
|
5336
5353
|
let {
|
|
5337
|
-
x:
|
|
5354
|
+
x: m,
|
|
5338
5355
|
y: C
|
|
5339
5356
|
} = w;
|
|
5340
5357
|
return {
|
|
5341
|
-
x:
|
|
5358
|
+
x: m,
|
|
5342
5359
|
y: C
|
|
5343
5360
|
};
|
|
5344
5361
|
}
|
|
5345
5362
|
},
|
|
5346
5363
|
...h
|
|
5347
|
-
} = at(
|
|
5364
|
+
} = at(l, t), c = {
|
|
5348
5365
|
x: e,
|
|
5349
5366
|
y: i
|
|
5350
|
-
}, d = await he(t, h), f = J(G(s)),
|
|
5351
|
-
let g = c[
|
|
5367
|
+
}, d = await he(t, h), f = J(G(s)), x = ae(f);
|
|
5368
|
+
let g = c[x], p = c[f];
|
|
5352
5369
|
if (r) {
|
|
5353
|
-
const w =
|
|
5370
|
+
const w = x === "y" ? "top" : "left", m = x === "y" ? "bottom" : "right", C = g + d[w], y = g - d[m];
|
|
5354
5371
|
g = It(C, g, y);
|
|
5355
5372
|
}
|
|
5356
5373
|
if (o) {
|
|
5357
|
-
const w = f === "y" ? "top" : "left",
|
|
5358
|
-
|
|
5374
|
+
const w = f === "y" ? "top" : "left", m = f === "y" ? "bottom" : "right", C = p + d[w], y = p - d[m];
|
|
5375
|
+
p = It(C, p, y);
|
|
5359
5376
|
}
|
|
5360
|
-
const
|
|
5377
|
+
const u = n.fn({
|
|
5361
5378
|
...t,
|
|
5362
|
-
[
|
|
5363
|
-
[f]:
|
|
5379
|
+
[x]: g,
|
|
5380
|
+
[f]: p
|
|
5364
5381
|
});
|
|
5365
5382
|
return {
|
|
5366
|
-
...
|
|
5383
|
+
...u,
|
|
5367
5384
|
data: {
|
|
5368
|
-
x:
|
|
5369
|
-
y:
|
|
5385
|
+
x: u.x - e,
|
|
5386
|
+
y: u.y - i,
|
|
5370
5387
|
enabled: {
|
|
5371
|
-
[
|
|
5388
|
+
[x]: r,
|
|
5372
5389
|
[f]: o
|
|
5373
5390
|
}
|
|
5374
5391
|
}
|
|
@@ -5379,56 +5396,56 @@ const Hi = function(a) {
|
|
|
5379
5396
|
function gt() {
|
|
5380
5397
|
return typeof window < "u";
|
|
5381
5398
|
}
|
|
5382
|
-
function tt(
|
|
5383
|
-
return ce(
|
|
5399
|
+
function tt(l) {
|
|
5400
|
+
return ce(l) ? (l.nodeName || "").toLowerCase() : "#document";
|
|
5384
5401
|
}
|
|
5385
|
-
function X(
|
|
5402
|
+
function X(l) {
|
|
5386
5403
|
var t;
|
|
5387
|
-
return (
|
|
5404
|
+
return (l == null || (t = l.ownerDocument) == null ? void 0 : t.defaultView) || window;
|
|
5388
5405
|
}
|
|
5389
|
-
function V(
|
|
5406
|
+
function V(l) {
|
|
5390
5407
|
var t;
|
|
5391
|
-
return (t = (ce(
|
|
5408
|
+
return (t = (ce(l) ? l.ownerDocument : l.document) || window.document) == null ? void 0 : t.documentElement;
|
|
5392
5409
|
}
|
|
5393
|
-
function ce(
|
|
5394
|
-
return gt() ?
|
|
5410
|
+
function ce(l) {
|
|
5411
|
+
return gt() ? l instanceof Node || l instanceof X(l).Node : !1;
|
|
5395
5412
|
}
|
|
5396
|
-
function
|
|
5397
|
-
return gt() ?
|
|
5413
|
+
function B(l) {
|
|
5414
|
+
return gt() ? l instanceof Element || l instanceof X(l).Element : !1;
|
|
5398
5415
|
}
|
|
5399
|
-
function K(
|
|
5400
|
-
return gt() ?
|
|
5416
|
+
function K(l) {
|
|
5417
|
+
return gt() ? l instanceof HTMLElement || l instanceof X(l).HTMLElement : !1;
|
|
5401
5418
|
}
|
|
5402
|
-
function qt(
|
|
5403
|
-
return !gt() || typeof ShadowRoot > "u" ? !1 :
|
|
5419
|
+
function qt(l) {
|
|
5420
|
+
return !gt() || typeof ShadowRoot > "u" ? !1 : l instanceof ShadowRoot || l instanceof X(l).ShadowRoot;
|
|
5404
5421
|
}
|
|
5405
|
-
function ht(
|
|
5422
|
+
function ht(l) {
|
|
5406
5423
|
const {
|
|
5407
5424
|
overflow: t,
|
|
5408
5425
|
overflowX: e,
|
|
5409
5426
|
overflowY: i,
|
|
5410
5427
|
display: s
|
|
5411
|
-
} = F(
|
|
5428
|
+
} = F(l);
|
|
5412
5429
|
return /auto|scroll|overlay|hidden|clip/.test(t + i + e) && !["inline", "contents"].includes(s);
|
|
5413
5430
|
}
|
|
5414
|
-
function Xi(
|
|
5415
|
-
return ["table", "td", "th"].includes(tt(
|
|
5431
|
+
function Xi(l) {
|
|
5432
|
+
return ["table", "td", "th"].includes(tt(l));
|
|
5416
5433
|
}
|
|
5417
|
-
function wt(
|
|
5434
|
+
function wt(l) {
|
|
5418
5435
|
return [":popover-open", ":modal"].some((t) => {
|
|
5419
5436
|
try {
|
|
5420
|
-
return
|
|
5437
|
+
return l.matches(t);
|
|
5421
5438
|
} catch {
|
|
5422
5439
|
return !1;
|
|
5423
5440
|
}
|
|
5424
5441
|
});
|
|
5425
5442
|
}
|
|
5426
|
-
function Dt(
|
|
5427
|
-
const t = Xt(), e =
|
|
5443
|
+
function Dt(l) {
|
|
5444
|
+
const t = Xt(), e = B(l) ? F(l) : l;
|
|
5428
5445
|
return e.transform !== "none" || e.perspective !== "none" || (e.containerType ? e.containerType !== "normal" : !1) || !t && (e.backdropFilter ? e.backdropFilter !== "none" : !1) || !t && (e.filter ? e.filter !== "none" : !1) || ["transform", "perspective", "filter"].some((i) => (e.willChange || "").includes(i)) || ["paint", "layout", "strict", "content"].some((i) => (e.contain || "").includes(i));
|
|
5429
5446
|
}
|
|
5430
|
-
function
|
|
5431
|
-
let t = $(
|
|
5447
|
+
function Bi(l) {
|
|
5448
|
+
let t = $(l);
|
|
5432
5449
|
for (; K(t) && !Q(t); ) {
|
|
5433
5450
|
if (Dt(t))
|
|
5434
5451
|
return t;
|
|
@@ -5441,65 +5458,65 @@ function Ni(a) {
|
|
|
5441
5458
|
function Xt() {
|
|
5442
5459
|
return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
|
|
5443
5460
|
}
|
|
5444
|
-
function Q(
|
|
5445
|
-
return ["html", "body", "#document"].includes(tt(
|
|
5461
|
+
function Q(l) {
|
|
5462
|
+
return ["html", "body", "#document"].includes(tt(l));
|
|
5446
5463
|
}
|
|
5447
|
-
function F(
|
|
5448
|
-
return X(
|
|
5464
|
+
function F(l) {
|
|
5465
|
+
return X(l).getComputedStyle(l);
|
|
5449
5466
|
}
|
|
5450
|
-
function pt(
|
|
5451
|
-
return
|
|
5452
|
-
scrollLeft:
|
|
5453
|
-
scrollTop:
|
|
5467
|
+
function pt(l) {
|
|
5468
|
+
return B(l) ? {
|
|
5469
|
+
scrollLeft: l.scrollLeft,
|
|
5470
|
+
scrollTop: l.scrollTop
|
|
5454
5471
|
} : {
|
|
5455
|
-
scrollLeft:
|
|
5456
|
-
scrollTop:
|
|
5472
|
+
scrollLeft: l.scrollX,
|
|
5473
|
+
scrollTop: l.scrollY
|
|
5457
5474
|
};
|
|
5458
5475
|
}
|
|
5459
|
-
function $(
|
|
5460
|
-
if (tt(
|
|
5461
|
-
return
|
|
5476
|
+
function $(l) {
|
|
5477
|
+
if (tt(l) === "html")
|
|
5478
|
+
return l;
|
|
5462
5479
|
const t = (
|
|
5463
5480
|
// Step into the shadow DOM of the parent of a slotted node.
|
|
5464
|
-
|
|
5465
|
-
|
|
5466
|
-
qt(
|
|
5467
|
-
V(
|
|
5481
|
+
l.assignedSlot || // DOM Element detected.
|
|
5482
|
+
l.parentNode || // ShadowRoot detected.
|
|
5483
|
+
qt(l) && l.host || // Fallback.
|
|
5484
|
+
V(l)
|
|
5468
5485
|
);
|
|
5469
5486
|
return qt(t) ? t.host : t;
|
|
5470
5487
|
}
|
|
5471
|
-
function de(
|
|
5472
|
-
const t = $(
|
|
5473
|
-
return Q(t) ?
|
|
5488
|
+
function de(l) {
|
|
5489
|
+
const t = $(l);
|
|
5490
|
+
return Q(t) ? l.ownerDocument ? l.ownerDocument.body : l.body : K(t) && ht(t) ? t : de(t);
|
|
5474
5491
|
}
|
|
5475
|
-
function Lt(
|
|
5492
|
+
function Lt(l, t, e) {
|
|
5476
5493
|
var i;
|
|
5477
5494
|
t === void 0 && (t = []), e === void 0 && (e = !0);
|
|
5478
|
-
const s = de(
|
|
5495
|
+
const s = de(l), r = s === ((i = l.ownerDocument) == null ? void 0 : i.body), o = X(s);
|
|
5479
5496
|
if (r) {
|
|
5480
5497
|
const n = St(o);
|
|
5481
5498
|
return t.concat(o, o.visualViewport || [], ht(s) ? s : [], n && e ? Lt(n) : []);
|
|
5482
5499
|
}
|
|
5483
5500
|
return t.concat(s, Lt(s, [], e));
|
|
5484
5501
|
}
|
|
5485
|
-
function St(
|
|
5486
|
-
return
|
|
5502
|
+
function St(l) {
|
|
5503
|
+
return l.parent && Object.getPrototypeOf(l.parent) ? l.frameElement : null;
|
|
5487
5504
|
}
|
|
5488
|
-
function fe(
|
|
5489
|
-
const t = F(
|
|
5505
|
+
function fe(l) {
|
|
5506
|
+
const t = F(l);
|
|
5490
5507
|
let e = parseFloat(t.width) || 0, i = parseFloat(t.height) || 0;
|
|
5491
|
-
const s = K(
|
|
5508
|
+
const s = K(l), r = s ? l.offsetWidth : e, o = s ? l.offsetHeight : i, n = ft(e) !== r || ft(i) !== o;
|
|
5492
5509
|
return n && (e = r, i = o), {
|
|
5493
5510
|
width: e,
|
|
5494
5511
|
height: i,
|
|
5495
5512
|
$: n
|
|
5496
5513
|
};
|
|
5497
5514
|
}
|
|
5498
|
-
function
|
|
5499
|
-
return
|
|
5515
|
+
function xe(l) {
|
|
5516
|
+
return B(l) ? l : l.contextElement;
|
|
5500
5517
|
}
|
|
5501
|
-
function Z(
|
|
5502
|
-
const t =
|
|
5518
|
+
function Z(l) {
|
|
5519
|
+
const t = xe(l);
|
|
5503
5520
|
if (!K(t))
|
|
5504
5521
|
return z(1);
|
|
5505
5522
|
const e = t.getBoundingClientRect(), {
|
|
@@ -5514,45 +5531,45 @@ function Z(a) {
|
|
|
5514
5531
|
};
|
|
5515
5532
|
}
|
|
5516
5533
|
const Fi = /* @__PURE__ */ z(0);
|
|
5517
|
-
function
|
|
5518
|
-
const t = X(
|
|
5534
|
+
function ue(l) {
|
|
5535
|
+
const t = X(l);
|
|
5519
5536
|
return !Xt() || !t.visualViewport ? Fi : {
|
|
5520
5537
|
x: t.visualViewport.offsetLeft,
|
|
5521
5538
|
y: t.visualViewport.offsetTop
|
|
5522
5539
|
};
|
|
5523
5540
|
}
|
|
5524
|
-
function
|
|
5525
|
-
return t === void 0 && (t = !1), !e || t && e !== X(
|
|
5541
|
+
function Ni(l, t, e) {
|
|
5542
|
+
return t === void 0 && (t = !1), !e || t && e !== X(l) ? !1 : t;
|
|
5526
5543
|
}
|
|
5527
|
-
function ot(
|
|
5544
|
+
function ot(l, t, e, i) {
|
|
5528
5545
|
t === void 0 && (t = !1), e === void 0 && (e = !1);
|
|
5529
|
-
const s =
|
|
5546
|
+
const s = l.getBoundingClientRect(), r = xe(l);
|
|
5530
5547
|
let o = z(1);
|
|
5531
|
-
t && (i ?
|
|
5532
|
-
const n =
|
|
5548
|
+
t && (i ? B(i) && (o = Z(i)) : o = Z(l));
|
|
5549
|
+
const n = Ni(r, e, i) ? ue(r) : z(0);
|
|
5533
5550
|
let h = (s.left + n.x) / o.x, c = (s.top + n.y) / o.y, d = s.width / o.x, f = s.height / o.y;
|
|
5534
5551
|
if (r) {
|
|
5535
|
-
const
|
|
5536
|
-
let
|
|
5537
|
-
for (;
|
|
5538
|
-
const w = Z(
|
|
5539
|
-
h *= w.x, c *= w.y, d *= w.x, f *= w.y, h += y, c += b,
|
|
5552
|
+
const x = X(r), g = i && B(i) ? X(i) : i;
|
|
5553
|
+
let p = x, u = St(p);
|
|
5554
|
+
for (; u && i && g !== p; ) {
|
|
5555
|
+
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
|
+
h *= w.x, c *= w.y, d *= w.x, f *= w.y, h += y, c += b, p = X(u), u = St(p);
|
|
5540
5557
|
}
|
|
5541
5558
|
}
|
|
5542
|
-
return
|
|
5559
|
+
return ut({
|
|
5543
5560
|
width: d,
|
|
5544
5561
|
height: f,
|
|
5545
5562
|
x: h,
|
|
5546
5563
|
y: c
|
|
5547
5564
|
});
|
|
5548
5565
|
}
|
|
5549
|
-
function ki(
|
|
5566
|
+
function ki(l) {
|
|
5550
5567
|
let {
|
|
5551
5568
|
elements: t,
|
|
5552
5569
|
rect: e,
|
|
5553
5570
|
offsetParent: i,
|
|
5554
5571
|
strategy: s
|
|
5555
|
-
} =
|
|
5572
|
+
} = l;
|
|
5556
5573
|
const r = s === "fixed", o = V(i), n = t ? wt(t.floating) : !1;
|
|
5557
5574
|
if (i === o || n && r)
|
|
5558
5575
|
return e;
|
|
@@ -5562,8 +5579,8 @@ function ki(a) {
|
|
|
5562
5579
|
}, c = z(1);
|
|
5563
5580
|
const d = z(0), f = K(i);
|
|
5564
5581
|
if ((f || !f && !r) && ((tt(i) !== "body" || ht(o)) && (h = pt(i)), K(i))) {
|
|
5565
|
-
const
|
|
5566
|
-
c = Z(i), d.x =
|
|
5582
|
+
const x = ot(i);
|
|
5583
|
+
c = Z(i), d.x = x.x + i.clientLeft, d.y = x.y + i.clientTop;
|
|
5567
5584
|
}
|
|
5568
5585
|
return {
|
|
5569
5586
|
width: e.width * c.x,
|
|
@@ -5572,16 +5589,16 @@ function ki(a) {
|
|
|
5572
5589
|
y: e.y * c.y - h.scrollTop * c.y + d.y
|
|
5573
5590
|
};
|
|
5574
5591
|
}
|
|
5575
|
-
function Ki(
|
|
5576
|
-
return Array.from(
|
|
5592
|
+
function Ki(l) {
|
|
5593
|
+
return Array.from(l.getClientRects());
|
|
5577
5594
|
}
|
|
5578
|
-
function Tt(
|
|
5579
|
-
const e = pt(
|
|
5580
|
-
return t ? t.left + e : ot(V(
|
|
5595
|
+
function Tt(l, t) {
|
|
5596
|
+
const e = pt(l).scrollLeft;
|
|
5597
|
+
return t ? t.left + e : ot(V(l)).left + e;
|
|
5581
5598
|
}
|
|
5582
|
-
function Yi(
|
|
5583
|
-
const t = V(
|
|
5584
|
-
let o = -e.scrollLeft + Tt(
|
|
5599
|
+
function Yi(l) {
|
|
5600
|
+
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);
|
|
5601
|
+
let o = -e.scrollLeft + Tt(l);
|
|
5585
5602
|
const n = -e.scrollTop;
|
|
5586
5603
|
return F(i).direction === "rtl" && (o += U(t.clientWidth, i.clientWidth) - s), {
|
|
5587
5604
|
width: s,
|
|
@@ -5590,8 +5607,8 @@ function Yi(a) {
|
|
|
5590
5607
|
y: n
|
|
5591
5608
|
};
|
|
5592
5609
|
}
|
|
5593
|
-
function Vi(
|
|
5594
|
-
const e = X(
|
|
5610
|
+
function Vi(l, t) {
|
|
5611
|
+
const e = X(l), i = V(l), s = e.visualViewport;
|
|
5595
5612
|
let r = i.clientWidth, o = i.clientHeight, n = 0, h = 0;
|
|
5596
5613
|
if (s) {
|
|
5597
5614
|
r = s.width, o = s.height;
|
|
@@ -5605,8 +5622,8 @@ function Vi(a, t) {
|
|
|
5605
5622
|
y: h
|
|
5606
5623
|
};
|
|
5607
5624
|
}
|
|
5608
|
-
function Wi(
|
|
5609
|
-
const e = ot(
|
|
5625
|
+
function Wi(l, t) {
|
|
5626
|
+
const e = ot(l, !0, t === "fixed"), i = e.top + l.clientTop, s = e.left + l.clientLeft, r = K(l) ? Z(l) : z(1), o = l.clientWidth * r.x, n = l.clientHeight * r.y, h = s * r.x, c = i * r.y;
|
|
5610
5627
|
return {
|
|
5611
5628
|
width: o,
|
|
5612
5629
|
height: n,
|
|
@@ -5614,48 +5631,48 @@ function Wi(a, t) {
|
|
|
5614
5631
|
y: c
|
|
5615
5632
|
};
|
|
5616
5633
|
}
|
|
5617
|
-
function Gt(
|
|
5634
|
+
function Gt(l, t, e) {
|
|
5618
5635
|
let i;
|
|
5619
5636
|
if (t === "viewport")
|
|
5620
|
-
i = Vi(
|
|
5637
|
+
i = Vi(l, e);
|
|
5621
5638
|
else if (t === "document")
|
|
5622
|
-
i = Yi(V(
|
|
5623
|
-
else if (
|
|
5639
|
+
i = Yi(V(l));
|
|
5640
|
+
else if (B(t))
|
|
5624
5641
|
i = Wi(t, e);
|
|
5625
5642
|
else {
|
|
5626
|
-
const s =
|
|
5643
|
+
const s = ue(l);
|
|
5627
5644
|
i = {
|
|
5628
5645
|
...t,
|
|
5629
5646
|
x: t.x - s.x,
|
|
5630
5647
|
y: t.y - s.y
|
|
5631
5648
|
};
|
|
5632
5649
|
}
|
|
5633
|
-
return
|
|
5650
|
+
return ut(i);
|
|
5634
5651
|
}
|
|
5635
|
-
function ge(
|
|
5636
|
-
const e = $(
|
|
5637
|
-
return e === t || !
|
|
5652
|
+
function ge(l, t) {
|
|
5653
|
+
const e = $(l);
|
|
5654
|
+
return e === t || !B(e) || Q(e) ? !1 : F(e).position === "fixed" || ge(e, t);
|
|
5638
5655
|
}
|
|
5639
|
-
function Pi(
|
|
5640
|
-
const e = t.get(
|
|
5656
|
+
function Pi(l, t) {
|
|
5657
|
+
const e = t.get(l);
|
|
5641
5658
|
if (e)
|
|
5642
5659
|
return e;
|
|
5643
|
-
let i = Lt(
|
|
5644
|
-
const r = F(
|
|
5645
|
-
let o = r ? $(
|
|
5646
|
-
for (;
|
|
5660
|
+
let i = Lt(l, [], !1).filter((n) => B(n) && tt(n) !== "body"), s = null;
|
|
5661
|
+
const r = F(l).position === "fixed";
|
|
5662
|
+
let o = r ? $(l) : l;
|
|
5663
|
+
for (; B(o) && !Q(o); ) {
|
|
5647
5664
|
const n = F(o), h = Dt(o);
|
|
5648
|
-
!h && n.position === "fixed" && (s = null), (r ? !h && !s : !h && n.position === "static" && !!s && ["absolute", "fixed"].includes(s.position) || ht(o) && !h && ge(
|
|
5665
|
+
!h && n.position === "fixed" && (s = null), (r ? !h && !s : !h && n.position === "static" && !!s && ["absolute", "fixed"].includes(s.position) || ht(o) && !h && ge(l, o)) ? i = i.filter((d) => d !== o) : s = n, o = $(o);
|
|
5649
5666
|
}
|
|
5650
|
-
return t.set(
|
|
5667
|
+
return t.set(l, i), i;
|
|
5651
5668
|
}
|
|
5652
|
-
function zi(
|
|
5669
|
+
function zi(l) {
|
|
5653
5670
|
let {
|
|
5654
5671
|
element: t,
|
|
5655
5672
|
boundary: e,
|
|
5656
5673
|
rootBoundary: i,
|
|
5657
5674
|
strategy: s
|
|
5658
|
-
} =
|
|
5675
|
+
} = l;
|
|
5659
5676
|
const o = [...e === "clippingAncestors" ? wt(t) ? [] : Pi(t, this._c) : [].concat(e), i], n = o[0], h = o.reduce((c, d) => {
|
|
5660
5677
|
const f = Gt(t, d, s);
|
|
5661
5678
|
return c.top = U(f.top, c.top), c.right = rt(f.right, c.right), c.bottom = rt(f.bottom, c.bottom), c.left = U(f.left, c.left), c;
|
|
@@ -5667,18 +5684,18 @@ function zi(a) {
|
|
|
5667
5684
|
y: h.top
|
|
5668
5685
|
};
|
|
5669
5686
|
}
|
|
5670
|
-
function $i(
|
|
5687
|
+
function $i(l) {
|
|
5671
5688
|
const {
|
|
5672
5689
|
width: t,
|
|
5673
5690
|
height: e
|
|
5674
|
-
} = fe(
|
|
5691
|
+
} = fe(l);
|
|
5675
5692
|
return {
|
|
5676
5693
|
width: t,
|
|
5677
5694
|
height: e
|
|
5678
5695
|
};
|
|
5679
5696
|
}
|
|
5680
|
-
function qi(
|
|
5681
|
-
const i = K(t), s = V(t), r = e === "fixed", o = ot(
|
|
5697
|
+
function qi(l, t, e) {
|
|
5698
|
+
const i = K(t), s = V(t), r = e === "fixed", o = ot(l, !0, r, t);
|
|
5682
5699
|
let n = {
|
|
5683
5700
|
scrollLeft: 0,
|
|
5684
5701
|
scrollTop: 0
|
|
@@ -5695,47 +5712,47 @@ function qi(a, t, e) {
|
|
|
5695
5712
|
d = g.top + n.scrollTop, c = g.left + n.scrollLeft - // RTL <body> scrollbar.
|
|
5696
5713
|
Tt(s, g);
|
|
5697
5714
|
}
|
|
5698
|
-
const f = o.left + n.scrollLeft - h.x - c,
|
|
5715
|
+
const f = o.left + n.scrollLeft - h.x - c, x = o.top + n.scrollTop - h.y - d;
|
|
5699
5716
|
return {
|
|
5700
5717
|
x: f,
|
|
5701
|
-
y:
|
|
5718
|
+
y: x,
|
|
5702
5719
|
width: o.width,
|
|
5703
5720
|
height: o.height
|
|
5704
5721
|
};
|
|
5705
5722
|
}
|
|
5706
|
-
function yt(
|
|
5707
|
-
return F(
|
|
5723
|
+
function yt(l) {
|
|
5724
|
+
return F(l).position === "static";
|
|
5708
5725
|
}
|
|
5709
|
-
function jt(
|
|
5710
|
-
if (!K(
|
|
5726
|
+
function jt(l, t) {
|
|
5727
|
+
if (!K(l) || F(l).position === "fixed")
|
|
5711
5728
|
return null;
|
|
5712
5729
|
if (t)
|
|
5713
|
-
return t(
|
|
5714
|
-
let e =
|
|
5715
|
-
return V(
|
|
5730
|
+
return t(l);
|
|
5731
|
+
let e = l.offsetParent;
|
|
5732
|
+
return V(l) === e && (e = e.ownerDocument.body), e;
|
|
5716
5733
|
}
|
|
5717
|
-
function we(
|
|
5718
|
-
const e = X(
|
|
5719
|
-
if (wt(
|
|
5734
|
+
function we(l, t) {
|
|
5735
|
+
const e = X(l);
|
|
5736
|
+
if (wt(l))
|
|
5720
5737
|
return e;
|
|
5721
|
-
if (!K(
|
|
5722
|
-
let s = $(
|
|
5738
|
+
if (!K(l)) {
|
|
5739
|
+
let s = $(l);
|
|
5723
5740
|
for (; s && !Q(s); ) {
|
|
5724
|
-
if (
|
|
5741
|
+
if (B(s) && !yt(s))
|
|
5725
5742
|
return s;
|
|
5726
5743
|
s = $(s);
|
|
5727
5744
|
}
|
|
5728
5745
|
return e;
|
|
5729
5746
|
}
|
|
5730
|
-
let i = jt(
|
|
5747
|
+
let i = jt(l, t);
|
|
5731
5748
|
for (; i && Xi(i) && yt(i); )
|
|
5732
5749
|
i = jt(i, t);
|
|
5733
|
-
return i && Q(i) && yt(i) && !Dt(i) ? e : i ||
|
|
5750
|
+
return i && Q(i) && yt(i) && !Dt(i) ? e : i || Bi(l) || e;
|
|
5734
5751
|
}
|
|
5735
|
-
const Gi = async function(
|
|
5736
|
-
const t = this.getOffsetParent || we, e = this.getDimensions, i = await e(
|
|
5752
|
+
const Gi = async function(l) {
|
|
5753
|
+
const t = this.getOffsetParent || we, e = this.getDimensions, i = await e(l.floating);
|
|
5737
5754
|
return {
|
|
5738
|
-
reference: qi(
|
|
5755
|
+
reference: qi(l.reference, await t(l.floating), l.strategy),
|
|
5739
5756
|
floating: {
|
|
5740
5757
|
x: 0,
|
|
5741
5758
|
y: 0,
|
|
@@ -5744,8 +5761,8 @@ const Gi = async function(a) {
|
|
|
5744
5761
|
}
|
|
5745
5762
|
};
|
|
5746
5763
|
};
|
|
5747
|
-
function ji(
|
|
5748
|
-
return F(
|
|
5764
|
+
function ji(l) {
|
|
5765
|
+
return F(l).direction === "rtl";
|
|
5749
5766
|
}
|
|
5750
5767
|
const Ui = {
|
|
5751
5768
|
convertOffsetParentRelativeRectToViewportRelativeRect: ki,
|
|
@@ -5756,9 +5773,9 @@ const Ui = {
|
|
|
5756
5773
|
getClientRects: Ki,
|
|
5757
5774
|
getDimensions: $i,
|
|
5758
5775
|
getScale: Z,
|
|
5759
|
-
isElement:
|
|
5776
|
+
isElement: B,
|
|
5760
5777
|
isRTL: ji
|
|
5761
|
-
}, pe = Hi, me = Di, ye = Ai, Zi = Ti, Ee = (
|
|
5778
|
+
}, pe = Hi, me = Di, ye = Ai, Zi = Ti, Ee = (l, t, e) => {
|
|
5762
5779
|
const i = /* @__PURE__ */ new Map(), s = {
|
|
5763
5780
|
platform: Ui,
|
|
5764
5781
|
...e
|
|
@@ -5766,18 +5783,18 @@ const Ui = {
|
|
|
5766
5783
|
...s.platform,
|
|
5767
5784
|
_c: i
|
|
5768
5785
|
};
|
|
5769
|
-
return Si(
|
|
5786
|
+
return Si(l, t, {
|
|
5770
5787
|
...s,
|
|
5771
5788
|
platform: r
|
|
5772
5789
|
});
|
|
5773
5790
|
};
|
|
5774
5791
|
let Ji = class {
|
|
5775
5792
|
constructor(t) {
|
|
5776
|
-
|
|
5777
|
-
|
|
5778
|
-
|
|
5779
|
-
|
|
5780
|
-
|
|
5793
|
+
a(this, "ctx");
|
|
5794
|
+
a(this, "enable", !1);
|
|
5795
|
+
a(this, "contentEl");
|
|
5796
|
+
a(this, "floatingEl");
|
|
5797
|
+
a(this, "arrowEl");
|
|
5781
5798
|
this.ctx = t;
|
|
5782
5799
|
const { TOOLTIP_BG_COLOR: e, TOOLTIP_TEXT_COLOR: i, TOOLTIP_ZINDEX: s, TOOLTIP_CUSTOM_STYLE: r, CSS_PREFIX: o } = this.ctx.config;
|
|
5783
5800
|
this.contentEl = document.createElement("div"), this.arrowEl = document.createElement("div"), this.floatingEl = document.createElement("div"), this.floatingEl.className = `${o}-tooltip`, this.contentEl.className = `${o}-tooltip-content`, this.arrowEl.className = `${o}-tooltip-arrow`;
|
|
@@ -5850,26 +5867,26 @@ let Ji = class {
|
|
|
5850
5867
|
top: `${c}px`,
|
|
5851
5868
|
left: `${h}px`
|
|
5852
5869
|
}), f.arrow) {
|
|
5853
|
-
const
|
|
5870
|
+
const x = f.arrow;
|
|
5854
5871
|
["left", "left-start", "left-end"].includes(d) ? Object.assign(this.arrowEl.style, {
|
|
5855
|
-
top: `${
|
|
5872
|
+
top: `${x.y}px`,
|
|
5856
5873
|
bottom: "",
|
|
5857
5874
|
left: "",
|
|
5858
5875
|
right: "-5px"
|
|
5859
5876
|
}) : ["right", "right-start", "right-end"].includes(d) ? Object.assign(this.arrowEl.style, {
|
|
5860
|
-
top: `${
|
|
5877
|
+
top: `${x.y}px`,
|
|
5861
5878
|
bottom: "",
|
|
5862
5879
|
left: "-5px",
|
|
5863
5880
|
right: ""
|
|
5864
5881
|
}) : ["bottom", "bottom-start", "bottom-end"].includes(d) ? Object.assign(this.arrowEl.style, {
|
|
5865
5882
|
top: "-5px",
|
|
5866
5883
|
bottom: "",
|
|
5867
|
-
left: `${
|
|
5884
|
+
left: `${x.x}px`,
|
|
5868
5885
|
right: ""
|
|
5869
5886
|
}) : ["top", "top-start", "top-end"].includes(d) && Object.assign(this.arrowEl.style, {
|
|
5870
5887
|
top: "",
|
|
5871
5888
|
bottom: "-5px",
|
|
5872
|
-
left: `${
|
|
5889
|
+
left: `${x.x}px`,
|
|
5873
5890
|
right: ""
|
|
5874
5891
|
});
|
|
5875
5892
|
}
|
|
@@ -5884,15 +5901,15 @@ let Ji = class {
|
|
|
5884
5901
|
};
|
|
5885
5902
|
class Qi {
|
|
5886
5903
|
constructor(t) {
|
|
5887
|
-
|
|
5888
|
-
|
|
5889
|
-
|
|
5890
|
-
|
|
5891
|
-
|
|
5892
|
-
|
|
5893
|
-
|
|
5894
|
-
|
|
5895
|
-
|
|
5904
|
+
a(this, "editorEl");
|
|
5905
|
+
a(this, "inputEl");
|
|
5906
|
+
a(this, "enable", !1);
|
|
5907
|
+
a(this, "cellTarget", null);
|
|
5908
|
+
a(this, "selectorArrStr", "");
|
|
5909
|
+
a(this, "ctx");
|
|
5910
|
+
a(this, "drawY", 0);
|
|
5911
|
+
a(this, "drawX", 0);
|
|
5912
|
+
a(this, "cancel", !1);
|
|
5896
5913
|
this.ctx = t, this.initTextEditor(), this.init();
|
|
5897
5914
|
}
|
|
5898
5915
|
init() {
|
|
@@ -6033,8 +6050,8 @@ class Qi {
|
|
|
6033
6050
|
let f = this.ctx.body.visibleHeight;
|
|
6034
6051
|
if (r > f && (r = f), this.editorEl.style.display = "inline-block", this.editorEl.style.left = `${this.drawX - 1}px`, this.editorEl.style.top = `${this.drawY - 1}px`, this.editorEl.style.bottom = "auto", this.editorEl.style.maxHeight = `${f}px`, s === "text") {
|
|
6035
6052
|
this.inputEl.style.display = "block", this.inputEl.style.minWidth = `${o - 1}px`, this.inputEl.style.minHeight = `${r - 1}px`, this.inputEl.style.maxHeight = `${f}px`, this.inputEl.style.width = `${o - 1}px`, this.inputEl.style.height = "auto", this.inputEl.style.padding = `${c}px`, i !== null && (this.inputEl.value = i), this.inputEl.focus({ preventScroll: !0 });
|
|
6036
|
-
const
|
|
6037
|
-
this.inputEl.setSelectionRange(
|
|
6053
|
+
const x = this.inputEl.value.length;
|
|
6054
|
+
this.inputEl.setSelectionRange(x, x);
|
|
6038
6055
|
} else
|
|
6039
6056
|
this.inputEl.style.display = "none";
|
|
6040
6057
|
(this.inputEl.scrollHeight > r || this.drawY < d.height) && this.autoSize();
|
|
@@ -6086,8 +6103,8 @@ class Qi {
|
|
|
6086
6103
|
}
|
|
6087
6104
|
class ts {
|
|
6088
6105
|
constructor(t) {
|
|
6089
|
-
|
|
6090
|
-
|
|
6106
|
+
a(this, "ctx");
|
|
6107
|
+
a(this, "emptyEl");
|
|
6091
6108
|
this.ctx = t;
|
|
6092
6109
|
const { EMPTY_TEXT: e, EMPTY_CUSTOM_STYLE: i } = this.ctx.config;
|
|
6093
6110
|
this.ctx.emptyElement ? this.emptyEl = this.ctx.emptyElement : (this.emptyEl = document.createElement("div"), this.emptyEl.innerText = e), this.emptyEl.className = "e-virt-table-empty", this.emptyEl.style.display = "none", this.ctx.containerElement.appendChild(this.emptyEl), this.ctx.on("emptyChange", ({ type: s, headerHeight: r, bodyHeight: o, footerHeight: n }) => {
|
|
@@ -6110,7 +6127,7 @@ class ts {
|
|
|
6110
6127
|
}
|
|
6111
6128
|
class es {
|
|
6112
6129
|
constructor(t) {
|
|
6113
|
-
|
|
6130
|
+
a(this, "ctx");
|
|
6114
6131
|
this.ctx = t;
|
|
6115
6132
|
}
|
|
6116
6133
|
draw() {
|
|
@@ -6141,7 +6158,7 @@ class es {
|
|
|
6141
6158
|
n.forEach((w) => {
|
|
6142
6159
|
w.render && (w.fixed === "left" ? c.push(w) : w.fixed === "right" ? d.push(w) : h.push(w));
|
|
6143
6160
|
});
|
|
6144
|
-
const f = e - i,
|
|
6161
|
+
const f = e - i, x = {
|
|
6145
6162
|
key: "left",
|
|
6146
6163
|
style: {
|
|
6147
6164
|
position: "absolute",
|
|
@@ -6163,7 +6180,7 @@ class es {
|
|
|
6163
6180
|
height: `${o}px`
|
|
6164
6181
|
},
|
|
6165
6182
|
cells: h
|
|
6166
|
-
},
|
|
6183
|
+
}, p = {
|
|
6167
6184
|
key: "right",
|
|
6168
6185
|
style: {
|
|
6169
6186
|
position: "absolute",
|
|
@@ -6184,22 +6201,22 @@ class es {
|
|
|
6184
6201
|
width: `${r}px`,
|
|
6185
6202
|
height: `${o}px`
|
|
6186
6203
|
},
|
|
6187
|
-
views: [
|
|
6204
|
+
views: [x, g, p]
|
|
6188
6205
|
};
|
|
6189
6206
|
}
|
|
6190
6207
|
getBody() {
|
|
6191
6208
|
const t = [], e = [], i = [];
|
|
6192
6209
|
let s = this.ctx.body.renderRows;
|
|
6193
6210
|
this.ctx.config.FOOTER_FIXED || (s = s.concat(this.ctx.footer.renderRows)), s.forEach((w) => {
|
|
6194
|
-
w.cells.forEach((
|
|
6195
|
-
|
|
6211
|
+
w.cells.forEach((m) => {
|
|
6212
|
+
m.cellType === "footer" && (m.render = m.renderFooter), m.render && (m.fixed === "left" ? e.push(m) : m.fixed === "right" ? i.push(m) : t.push(m));
|
|
6196
6213
|
});
|
|
6197
6214
|
});
|
|
6198
6215
|
const {
|
|
6199
6216
|
fixedLeftWidth: r,
|
|
6200
6217
|
fixedRightWidth: o,
|
|
6201
6218
|
config: { SCROLLER_TRACK_SIZE: n, CSS_PREFIX: h }
|
|
6202
|
-
} = this.ctx, { visibleWidth: c, visibleHeight: d } = this.ctx.body, f = o - n,
|
|
6219
|
+
} = this.ctx, { visibleWidth: c, visibleHeight: d } = this.ctx.body, f = o - n, x = {
|
|
6203
6220
|
key: "left",
|
|
6204
6221
|
style: {
|
|
6205
6222
|
position: "absolute",
|
|
@@ -6221,7 +6238,7 @@ class es {
|
|
|
6221
6238
|
height: `${d}px`
|
|
6222
6239
|
},
|
|
6223
6240
|
cells: t
|
|
6224
|
-
},
|
|
6241
|
+
}, p = {
|
|
6225
6242
|
key: "right",
|
|
6226
6243
|
style: {
|
|
6227
6244
|
position: "absolute",
|
|
@@ -6242,13 +6259,13 @@ class es {
|
|
|
6242
6259
|
width: `${c}px`,
|
|
6243
6260
|
height: `${d}px`
|
|
6244
6261
|
},
|
|
6245
|
-
views: [
|
|
6262
|
+
views: [x, g, p]
|
|
6246
6263
|
};
|
|
6247
6264
|
}
|
|
6248
6265
|
getFooter() {
|
|
6249
6266
|
const t = [], e = [], i = [];
|
|
6250
|
-
this.ctx.footer.renderRows.forEach((
|
|
6251
|
-
|
|
6267
|
+
this.ctx.footer.renderRows.forEach((u) => {
|
|
6268
|
+
u.cells.forEach((w) => {
|
|
6252
6269
|
w.cellType === "footer" && w.renderFooter && (w.render = w.renderFooter, w.fixed === "left" ? e.push(w) : w.fixed === "right" ? i.push(w) : t.push(w));
|
|
6253
6270
|
});
|
|
6254
6271
|
});
|
|
@@ -6267,7 +6284,7 @@ class es {
|
|
|
6267
6284
|
height: `${c}px`
|
|
6268
6285
|
},
|
|
6269
6286
|
cells: e
|
|
6270
|
-
},
|
|
6287
|
+
}, x = {
|
|
6271
6288
|
key: "center",
|
|
6272
6289
|
style: {
|
|
6273
6290
|
position: "absolute",
|
|
@@ -6299,15 +6316,15 @@ class es {
|
|
|
6299
6316
|
width: `${h}px`,
|
|
6300
6317
|
height: `${c}px`
|
|
6301
6318
|
},
|
|
6302
|
-
views: [f,
|
|
6319
|
+
views: [f, x, g]
|
|
6303
6320
|
};
|
|
6304
6321
|
}
|
|
6305
6322
|
}
|
|
6306
6323
|
class is {
|
|
6307
6324
|
constructor(t) {
|
|
6308
|
-
|
|
6309
|
-
|
|
6310
|
-
|
|
6325
|
+
a(this, "ctx");
|
|
6326
|
+
a(this, "contextMenuEl");
|
|
6327
|
+
a(this, "custom", !1);
|
|
6311
6328
|
this.ctx = t, this.ctx.contextMenuElement ? (this.custom = !0, this.contextMenuEl = this.ctx.contextMenuElement) : (this.custom = !1, this.contextMenuEl = document.createElement("div")), this.createContextMenu(), this.init();
|
|
6312
6329
|
}
|
|
6313
6330
|
init() {
|
|
@@ -6316,7 +6333,7 @@ class is {
|
|
|
6316
6333
|
e.preventDefault();
|
|
6317
6334
|
const { xArr: i, yArr: s } = this.ctx.selector, [r, o] = i, [n, h] = s, { rowIndex: c, colIndex: d } = t;
|
|
6318
6335
|
c >= n && c <= h && d >= r && d <= o || this.ctx.emit("setSelectorCell", t, e);
|
|
6319
|
-
const
|
|
6336
|
+
const x = {
|
|
6320
6337
|
getBoundingClientRect: () => ({
|
|
6321
6338
|
width: 0,
|
|
6322
6339
|
height: 0,
|
|
@@ -6329,17 +6346,19 @@ class is {
|
|
|
6329
6346
|
}),
|
|
6330
6347
|
contextElement: document.body
|
|
6331
6348
|
};
|
|
6332
|
-
Ee(
|
|
6349
|
+
Ee(x, this.contextMenuEl, {
|
|
6333
6350
|
placement: "right-start",
|
|
6334
6351
|
middleware: [pe(), me(), ye()]
|
|
6335
|
-
}).then(({ x: g, y:
|
|
6336
|
-
this.show(g,
|
|
6352
|
+
}).then(({ x: g, y: p }) => {
|
|
6353
|
+
this.show(g, p);
|
|
6337
6354
|
});
|
|
6338
6355
|
}), this.ctx.on("click", this.hide.bind(this)), this.ctx.on("onScroll", this.hide.bind(this)), this.ctx.on("resize", this.hide.bind(this));
|
|
6339
6356
|
}
|
|
6340
6357
|
//创建右键菜单,绑定子项点击事件
|
|
6341
6358
|
createContextMenu() {
|
|
6342
|
-
if (this.contextMenuEl.className = "e-virt-table-context-menu", this.
|
|
6359
|
+
if (this.contextMenuEl.className = "e-virt-table-context-menu", this.contextMenuEl.addEventListener("contextmenu", function(e) {
|
|
6360
|
+
e.preventDefault();
|
|
6361
|
+
}), this.ctx.containerElement.appendChild(this.contextMenuEl), this.custom) return;
|
|
6343
6362
|
const { CONTEXT_MENU: t } = this.ctx.config;
|
|
6344
6363
|
this.createContextMenuItems(t, (e) => {
|
|
6345
6364
|
switch (e.value) {
|
|
@@ -6389,19 +6408,19 @@ class is {
|
|
|
6389
6408
|
}
|
|
6390
6409
|
class os {
|
|
6391
6410
|
constructor(t, e) {
|
|
6392
|
-
|
|
6393
|
-
|
|
6394
|
-
|
|
6395
|
-
|
|
6396
|
-
|
|
6397
|
-
|
|
6398
|
-
|
|
6399
|
-
|
|
6400
|
-
|
|
6401
|
-
|
|
6402
|
-
|
|
6403
|
-
|
|
6404
|
-
|
|
6411
|
+
a(this, "options");
|
|
6412
|
+
a(this, "scroller");
|
|
6413
|
+
a(this, "header");
|
|
6414
|
+
a(this, "body");
|
|
6415
|
+
a(this, "footer");
|
|
6416
|
+
a(this, "selector");
|
|
6417
|
+
a(this, "autofill");
|
|
6418
|
+
a(this, "tooltip");
|
|
6419
|
+
a(this, "editor");
|
|
6420
|
+
a(this, "empty");
|
|
6421
|
+
a(this, "overlayer");
|
|
6422
|
+
a(this, "contextMenu");
|
|
6423
|
+
a(this, "ctx");
|
|
6405
6424
|
this.options = e;
|
|
6406
6425
|
const { overlayerElement: i, editorElement: s, emptyElement: r, contextMenuElement: o } = e, n = this.createContainer(
|
|
6407
6426
|
t,
|
|
@@ -6489,6 +6508,21 @@ class os {
|
|
|
6489
6508
|
getChangedRows() {
|
|
6490
6509
|
return this.ctx.database.getChangedRows();
|
|
6491
6510
|
}
|
|
6511
|
+
setCurrentRowByRowIndex(t) {
|
|
6512
|
+
this.ctx.currentCell = this.ctx.database.getVirtualBodyCell(t, 0), this.ctx.emit("draw");
|
|
6513
|
+
}
|
|
6514
|
+
setCurrentRow(t) {
|
|
6515
|
+
const e = this.ctx.database.getColumnByColIndex(0);
|
|
6516
|
+
e && (this.ctx.currentCell = this.ctx.database.getVirtualBodyCellByKey(t, e.key), this.ctx.emit("draw"));
|
|
6517
|
+
}
|
|
6518
|
+
getCurrentRow() {
|
|
6519
|
+
const t = this.ctx.currentCell;
|
|
6520
|
+
return t ? {
|
|
6521
|
+
row: t.row,
|
|
6522
|
+
rowIndex: t.rowIndex,
|
|
6523
|
+
rowKey: t.rowKey
|
|
6524
|
+
} : void 0;
|
|
6525
|
+
}
|
|
6492
6526
|
clearValidate() {
|
|
6493
6527
|
this.ctx.database.clearValidate(), this.ctx.emit("draw");
|
|
6494
6528
|
}
|
|
@@ -6580,6 +6614,9 @@ class os {
|
|
|
6580
6614
|
setExpandRowKeys(t, e = !0) {
|
|
6581
6615
|
this.ctx.database.setExpandRowKeys(t, e);
|
|
6582
6616
|
}
|
|
6617
|
+
getExpandRowKeys() {
|
|
6618
|
+
return this.ctx.database.getExpandRowKeys();
|
|
6619
|
+
}
|
|
6583
6620
|
clearSelection() {
|
|
6584
6621
|
this.ctx.database.clearSelection(), this.ctx.emit("draw");
|
|
6585
6622
|
}
|