e-virt-table 0.0.9 → 0.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -1,7 +1,7 @@
1
1
  (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(':root{--e-virt-table-color-white: #fff;--e-virt-table-color-black: #000000;--e-virt-table-color-primary: rgb(82, 146, 247);--e-virt-table-text-color-primary: "#333";--e-virt-table-text-color-regular: "#666";--e-virt-table-text-color-secondary: "#999";--e-virt-table-box-shadow: 0 2px 12px 0 #0000001a;--e-virt-table-editor-bg-color: #fff}.e-virt-table-editor{position:absolute;top:-10000px;left:-10000px;text-align:left;line-height:0;z-index:100;overflow:hidden;background-color:var(--e-virt-table-editor-bg-color);border:2px solid var(--e-virt-table-color-primary);box-sizing:border-box;box-shadow:var(--e-virt-table-box-shadow);pointer-events:auto;display:flex;align-items:center}.e-virt-table-context-menu{position:absolute;font-size:14px;color:var(--e-virt-table-text-color-regular);background-color:var(--e-virt-table-color-white);border-radius:4px;border:1px solid #e4e7ed;box-shadow:var(--e-virt-table-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}.e-virt-table-context-menu-item:hover{color:var(--e-virt-table-color-primary);background-color:#f5f7fa}')),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
2
- var pe = Object.defineProperty;
3
- var ye = (a, t, e) => t in a ? pe(a, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[t] = e;
4
- var c = (a, t, e) => ye(a, typeof t != "symbol" ? t + "" : t, e);
2
+ var me = Object.defineProperty;
3
+ var Ee = (a, t, e) => t in a ? me(a, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[t] = e;
4
+ var c = (a, t, e) => Ee(a, typeof t != "symbol" ? t + "" : t, e);
5
5
  function $() {
6
6
  return $ = Object.assign ? Object.assign.bind() : function(a) {
7
7
  for (var t = 1; t < arguments.length; t++) {
@@ -12,7 +12,7 @@ function $() {
12
12
  return a;
13
13
  }, $.apply(this, arguments);
14
14
  }
15
- function me(a, t) {
15
+ function be(a, t) {
16
16
  a.prototype = Object.create(t.prototype), a.prototype.constructor = a, st(a, t);
17
17
  }
18
18
  function Et(a) {
@@ -25,7 +25,7 @@ function st(a, t) {
25
25
  return i.__proto__ = s, i;
26
26
  }, st(a, t);
27
27
  }
28
- function Ee() {
28
+ function Ce() {
29
29
  if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham) return !1;
30
30
  if (typeof Proxy == "function") return !0;
31
31
  try {
@@ -36,20 +36,20 @@ function Ee() {
36
36
  }
37
37
  }
38
38
  function dt(a, t, e) {
39
- return Ee() ? dt = Reflect.construct.bind() : dt = function(s, r, o) {
39
+ return Ce() ? dt = Reflect.construct.bind() : dt = function(s, o, r) {
40
40
  var n = [null];
41
- n.push.apply(n, r);
41
+ n.push.apply(n, o);
42
42
  var l = Function.bind.apply(s, n), h = new l();
43
- return o && st(h, o.prototype), h;
43
+ return r && st(h, r.prototype), h;
44
44
  }, dt.apply(null, arguments);
45
45
  }
46
- function be(a) {
46
+ function ve(a) {
47
47
  return Function.toString.call(a).indexOf("[native code]") !== -1;
48
48
  }
49
49
  function bt(a) {
50
50
  var t = typeof Map == "function" ? /* @__PURE__ */ new Map() : void 0;
51
51
  return bt = function(i) {
52
- if (i === null || !be(i)) return i;
52
+ if (i === null || !ve(i)) return i;
53
53
  if (typeof i != "function")
54
54
  throw new TypeError("Super expression must either be null or a function");
55
55
  if (typeof t < "u") {
@@ -69,9 +69,9 @@ function bt(a) {
69
69
  }), st(s, i);
70
70
  }, bt(a);
71
71
  }
72
- var Ce = /%[sdj%]/g, qt = function() {
72
+ var Re = /%[sdj%]/g, jt = function() {
73
73
  };
74
- typeof process < "u" && process.env && process.env.NODE_ENV !== "production" && typeof window < "u" && typeof document < "u" && (qt = function(t, e) {
74
+ typeof process < "u" && process.env && process.env.NODE_ENV !== "production" && typeof window < "u" && typeof document < "u" && (jt = function(t, e) {
75
75
  typeof console < "u" && console.warn && typeof ASYNC_VALIDATOR_NO_WARNING > "u" && e.every(function(i) {
76
76
  return typeof i == "string";
77
77
  }) && console.warn(t, e);
@@ -84,17 +84,17 @@ function Ct(a) {
84
84
  t[i] = t[i] || [], t[i].push(e);
85
85
  }), t;
86
86
  }
87
- function H(a) {
87
+ function M(a) {
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
- var s = 0, r = e.length;
90
+ var s = 0, o = e.length;
91
91
  if (typeof a == "function")
92
92
  return a.apply(null, e);
93
93
  if (typeof a == "string") {
94
- var o = a.replace(Ce, function(n) {
94
+ var r = a.replace(Re, function(n) {
95
95
  if (n === "%%")
96
96
  return "%";
97
- if (s >= r)
97
+ if (s >= o)
98
98
  return n;
99
99
  switch (n) {
100
100
  case "%s":
@@ -112,81 +112,81 @@ function H(a) {
112
112
  return n;
113
113
  }
114
114
  });
115
- return o;
115
+ return r;
116
116
  }
117
117
  return a;
118
118
  }
119
- function ve(a) {
119
+ function Ie(a) {
120
120
  return a === "string" || a === "url" || a === "hex" || a === "email" || a === "date" || a === "pattern";
121
121
  }
122
122
  function I(a, t) {
123
- return !!(a == null || t === "array" && Array.isArray(a) && !a.length || ve(t) && typeof a == "string" && !a);
123
+ return !!(a == null || t === "array" && Array.isArray(a) && !a.length || Ie(t) && typeof a == "string" && !a);
124
124
  }
125
- function Re(a, t, e) {
126
- var i = [], s = 0, r = a.length;
127
- function o(n) {
128
- i.push.apply(i, n || []), s++, s === r && e(i);
125
+ function _e(a, t, e) {
126
+ var i = [], s = 0, o = a.length;
127
+ function r(n) {
128
+ i.push.apply(i, n || []), s++, s === o && e(i);
129
129
  }
130
130
  a.forEach(function(n) {
131
- t(n, o);
131
+ t(n, r);
132
132
  });
133
133
  }
134
- function Ft(a, t, e) {
134
+ function kt(a, t, e) {
135
135
  var i = 0, s = a.length;
136
- function r(o) {
137
- if (o && o.length) {
138
- e(o);
136
+ function o(r) {
137
+ if (r && r.length) {
138
+ e(r);
139
139
  return;
140
140
  }
141
141
  var n = i;
142
- i = i + 1, n < s ? t(a[n], r) : e([]);
142
+ i = i + 1, n < s ? t(a[n], o) : e([]);
143
143
  }
144
- r([]);
144
+ o([]);
145
145
  }
146
- function Ie(a) {
146
+ function Oe(a) {
147
147
  var t = [];
148
148
  return Object.keys(a).forEach(function(e) {
149
149
  t.push.apply(t, a[e] || []);
150
150
  }), t;
151
151
  }
152
- var Xt = /* @__PURE__ */ function(a) {
153
- me(t, a);
152
+ var Ft = /* @__PURE__ */ function(a) {
153
+ be(t, a);
154
154
  function t(e, i) {
155
155
  var s;
156
156
  return s = a.call(this, "Async Validation Error") || this, s.errors = e, s.fields = i, s;
157
157
  }
158
158
  return t;
159
159
  }(/* @__PURE__ */ bt(Error));
160
- function Oe(a, t, e, i, s) {
160
+ function Se(a, t, e, i, s) {
161
161
  if (t.first) {
162
- var r = new Promise(function(x, u) {
162
+ var o = new Promise(function(x, u) {
163
163
  var y = function(p) {
164
- return i(p), p.length ? u(new Xt(p, Ct(p))) : x(s);
165
- }, g = Ie(a);
166
- Ft(g, e, y);
164
+ return i(p), p.length ? u(new Ft(p, Ct(p))) : x(s);
165
+ }, g = Oe(a);
166
+ kt(g, e, y);
167
167
  });
168
- return r.catch(function(x) {
168
+ return o.catch(function(x) {
169
169
  return x;
170
- }), r;
170
+ }), o;
171
171
  }
172
- var o = t.firstFields === !0 ? Object.keys(a) : t.firstFields || [], n = Object.keys(a), l = n.length, h = 0, f = [], d = new Promise(function(x, u) {
172
+ var r = t.firstFields === !0 ? Object.keys(a) : t.firstFields || [], n = Object.keys(a), l = n.length, h = 0, f = [], d = new Promise(function(x, u) {
173
173
  var y = function(w) {
174
174
  if (f.push.apply(f, w), h++, h === l)
175
- return i(f), f.length ? u(new Xt(f, Ct(f))) : x(s);
175
+ return i(f), f.length ? u(new Ft(f, Ct(f))) : x(s);
176
176
  };
177
177
  n.length || (i(f), x(s)), n.forEach(function(g) {
178
178
  var w = a[g];
179
- o.indexOf(g) !== -1 ? Ft(w, e, y) : Re(w, e, y);
179
+ r.indexOf(g) !== -1 ? kt(w, e, y) : _e(w, e, y);
180
180
  });
181
181
  });
182
182
  return d.catch(function(x) {
183
183
  return x;
184
184
  }), d;
185
185
  }
186
- function _e(a) {
186
+ function Te(a) {
187
187
  return !!(a && a.message !== void 0);
188
188
  }
189
- function Se(a, t) {
189
+ function Le(a, t) {
190
190
  for (var e = a, i = 0; i < t.length; i++) {
191
191
  if (e == null)
192
192
  return e;
@@ -197,14 +197,14 @@ function Se(a, t) {
197
197
  function Nt(a, t) {
198
198
  return function(e) {
199
199
  var i;
200
- return a.fullFields ? i = Se(t, a.fullFields) : i = t[e.field || a.fullField], _e(e) ? (e.field = e.field || a.fullField, e.fieldValue = i, e) : {
200
+ return a.fullFields ? i = Le(t, a.fullFields) : i = t[e.field || a.fullField], Te(e) ? (e.field = e.field || a.fullField, e.fieldValue = i, e) : {
201
201
  message: typeof e == "function" ? e() : e,
202
202
  fieldValue: i,
203
203
  field: e.field || a.fullField
204
204
  };
205
205
  };
206
206
  }
207
- function Kt(a, t) {
207
+ function Yt(a, t) {
208
208
  if (t) {
209
209
  for (var e in t)
210
210
  if (t.hasOwnProperty(e)) {
@@ -214,11 +214,11 @@ function Kt(a, t) {
214
214
  }
215
215
  return a;
216
216
  }
217
- var Gt = function(t, e, i, s, r, o) {
218
- t.required && (!i.hasOwnProperty(t.field) || I(e, o || t.type)) && s.push(H(r.messages.required, t.fullField));
219
- }, Te = function(t, e, i, s, r) {
220
- (/^\s+$/.test(e) || e === "") && s.push(H(r.messages.whitespace, t.fullField));
221
- }, ht, Le = function() {
217
+ var Ut = function(t, e, i, s, o, r) {
218
+ t.required && (!i.hasOwnProperty(t.field) || I(e, r || t.type)) && s.push(M(o.messages.required, t.fullField));
219
+ }, Ae = function(t, e, i, s, o) {
220
+ (/^\s+$/.test(e) || e === "") && s.push(M(o.messages.whitespace, t.fullField));
221
+ }, ht, Me = function() {
222
222
  if (ht)
223
223
  return ht;
224
224
  var a = "[a-fA-F\\d:]", t = function(b) {
@@ -234,17 +234,17 @@ var Gt = function(t, e, i, s, r, o) {
234
234
  (?:` + i + ":){1}(?:(?::" + i + "){0,4}:" + e + "|(?::" + i + `){1,6}|:)| // 1:: 1::3:4:5:6:7:8 1::8 1::3:4:5:6:7:1.2.3.4
235
235
  (?::(?:(?::` + i + "){0,5}:" + e + "|(?::" + i + `){1,7}|:)) // ::2:3:4:5:6:7:8 ::2:3:4:5:6:7:8 ::8 ::1.2.3.4
236
236
  )(?:%[0-9a-zA-Z]{1,})? // %eth0 %1
237
- `).replace(/\s*\/\/.*$/gm, "").replace(/\n/g, "").trim(), r = new RegExp("(?:^" + e + "$)|(?:^" + s + "$)"), o = new RegExp("^" + e + "$"), n = new RegExp("^" + s + "$"), l = function(b) {
238
- return b && b.exact ? r : new RegExp("(?:" + t(b) + e + t(b) + ")|(?:" + t(b) + s + t(b) + ")", "g");
237
+ `).replace(/\s*\/\/.*$/gm, "").replace(/\n/g, "").trim(), o = new RegExp("(?:^" + e + "$)|(?:^" + s + "$)"), r = new RegExp("^" + e + "$"), n = new RegExp("^" + s + "$"), l = function(b) {
238
+ return b && b.exact ? o : new RegExp("(?:" + t(b) + e + t(b) + ")|(?:" + t(b) + s + t(b) + ")", "g");
239
239
  };
240
240
  l.v4 = function(m) {
241
- return m && m.exact ? o : new RegExp("" + t(m) + e + t(m), "g");
241
+ return m && m.exact ? r : new RegExp("" + t(m) + e + t(m), "g");
242
242
  }, l.v6 = function(m) {
243
243
  return m && m.exact ? n : new RegExp("" + t(m) + s + t(m), "g");
244
244
  };
245
245
  var h = "(?:(?:[a-z]+:)?//)", f = "(?:\\S+(?::\\S*)?@)?", d = l.v4().source, x = l.v6().source, u = "(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)", y = "(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*", g = "(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))", w = "(?::\\d{2,5})?", p = '(?:[/?#][^\\s"]*)?', E = "(?:" + h + "|www\\.)" + f + "(?:localhost|" + d + "|" + x + "|" + u + y + g + ")" + w + p;
246
246
  return ht = new RegExp("(?:^" + E + "$)", "i"), ht;
247
- }, Yt = {
247
+ }, Kt = {
248
248
  // http://emailregex.com/
249
249
  email: /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,
250
250
  // url: new RegExp(
@@ -284,180 +284,180 @@ var Gt = function(t, e, i, s, r, o) {
284
284
  return typeof t == "function";
285
285
  },
286
286
  email: function(t) {
287
- return typeof t == "string" && t.length <= 320 && !!t.match(Yt.email);
287
+ return typeof t == "string" && t.length <= 320 && !!t.match(Kt.email);
288
288
  },
289
289
  url: function(t) {
290
- return typeof t == "string" && t.length <= 2048 && !!t.match(Le());
290
+ return typeof t == "string" && t.length <= 2048 && !!t.match(Me());
291
291
  },
292
292
  hex: function(t) {
293
- return typeof t == "string" && !!t.match(Yt.hex);
293
+ return typeof t == "string" && !!t.match(Kt.hex);
294
294
  }
295
- }, Ae = function(t, e, i, s, r) {
295
+ }, He = function(t, e, i, s, o) {
296
296
  if (t.required && e === void 0) {
297
- Gt(t, e, i, s, r);
297
+ Ut(t, e, i, s, o);
298
298
  return;
299
299
  }
300
- var o = ["integer", "float", "array", "regexp", "object", "method", "email", "number", "date", "url", "hex"], n = t.type;
301
- o.indexOf(n) > -1 ? et[n](e) || s.push(H(r.messages.types[n], t.fullField, t.type)) : n && typeof e !== t.type && s.push(H(r.messages.types[n], t.fullField, t.type));
302
- }, He = function(t, e, i, s, r) {
303
- var o = typeof t.len == "number", n = typeof t.min == "number", l = typeof t.max == "number", h = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g, f = e, d = null, x = typeof e == "number", u = typeof e == "string", y = Array.isArray(e);
300
+ var r = ["integer", "float", "array", "regexp", "object", "method", "email", "number", "date", "url", "hex"], n = t.type;
301
+ r.indexOf(n) > -1 ? et[n](e) || s.push(M(o.messages.types[n], t.fullField, t.type)) : n && typeof e !== t.type && s.push(M(o.messages.types[n], t.fullField, t.type));
302
+ }, De = function(t, e, i, s, o) {
303
+ var r = typeof t.len == "number", n = typeof t.min == "number", l = typeof t.max == "number", h = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g, f = e, d = null, x = typeof e == "number", u = typeof e == "string", y = Array.isArray(e);
304
304
  if (x ? d = "number" : u ? d = "string" : y && (d = "array"), !d)
305
305
  return !1;
306
- y && (f = e.length), u && (f = e.replace(h, "_").length), o ? f !== t.len && s.push(H(r.messages[d].len, t.fullField, t.len)) : n && !l && f < t.min ? s.push(H(r.messages[d].min, t.fullField, t.min)) : l && !n && f > t.max ? s.push(H(r.messages[d].max, t.fullField, t.max)) : n && l && (f < t.min || f > t.max) && s.push(H(r.messages[d].range, t.fullField, t.min, t.max));
307
- }, j = "enum", Me = function(t, e, i, s, r) {
308
- t[j] = Array.isArray(t[j]) ? t[j] : [], t[j].indexOf(e) === -1 && s.push(H(r.messages[j], t.fullField, t[j].join(", ")));
309
- }, De = function(t, e, i, s, r) {
306
+ y && (f = e.length), u && (f = e.replace(h, "_").length), r ? f !== t.len && s.push(M(o.messages[d].len, t.fullField, t.len)) : n && !l && f < t.min ? s.push(M(o.messages[d].min, t.fullField, t.min)) : l && !n && f > t.max ? s.push(M(o.messages[d].max, t.fullField, t.max)) : n && l && (f < t.min || f > t.max) && s.push(M(o.messages[d].range, t.fullField, t.min, t.max));
307
+ }, j = "enum", Xe = function(t, e, i, s, o) {
308
+ t[j] = Array.isArray(t[j]) ? t[j] : [], t[j].indexOf(e) === -1 && s.push(M(o.messages[j], t.fullField, t[j].join(", ")));
309
+ }, ke = function(t, e, i, s, o) {
310
310
  if (t.pattern) {
311
311
  if (t.pattern instanceof RegExp)
312
- t.pattern.lastIndex = 0, t.pattern.test(e) || s.push(H(r.messages.pattern.mismatch, t.fullField, e, t.pattern));
312
+ t.pattern.lastIndex = 0, t.pattern.test(e) || s.push(M(o.messages.pattern.mismatch, t.fullField, e, t.pattern));
313
313
  else if (typeof t.pattern == "string") {
314
- var o = new RegExp(t.pattern);
315
- o.test(e) || s.push(H(r.messages.pattern.mismatch, t.fullField, e, t.pattern));
314
+ var r = new RegExp(t.pattern);
315
+ r.test(e) || s.push(M(o.messages.pattern.mismatch, t.fullField, e, t.pattern));
316
316
  }
317
317
  }
318
318
  }, v = {
319
- required: Gt,
320
- whitespace: Te,
321
- type: Ae,
322
- range: He,
323
- enum: Me,
324
- pattern: De
325
- }, ke = function(t, e, i, s, r) {
326
- var o = [], n = t.required || !t.required && s.hasOwnProperty(t.field);
319
+ required: Ut,
320
+ whitespace: Ae,
321
+ type: He,
322
+ range: De,
323
+ enum: Xe,
324
+ pattern: ke
325
+ }, Fe = function(t, e, i, s, o) {
326
+ var r = [], n = t.required || !t.required && s.hasOwnProperty(t.field);
327
327
  if (n) {
328
328
  if (I(e, "string") && !t.required)
329
329
  return i();
330
- v.required(t, e, s, o, r, "string"), I(e, "string") || (v.type(t, e, s, o, r), v.range(t, e, s, o, r), v.pattern(t, e, s, o, r), t.whitespace === !0 && v.whitespace(t, e, s, o, r));
330
+ v.required(t, e, s, r, o, "string"), I(e, "string") || (v.type(t, e, s, r, o), v.range(t, e, s, r, o), v.pattern(t, e, s, r, o), t.whitespace === !0 && v.whitespace(t, e, s, r, o));
331
331
  }
332
- i(o);
333
- }, Fe = function(t, e, i, s, r) {
334
- var o = [], n = t.required || !t.required && s.hasOwnProperty(t.field);
332
+ i(r);
333
+ }, Ne = function(t, e, i, s, o) {
334
+ var r = [], n = t.required || !t.required && s.hasOwnProperty(t.field);
335
335
  if (n) {
336
336
  if (I(e) && !t.required)
337
337
  return i();
338
- v.required(t, e, s, o, r), e !== void 0 && v.type(t, e, s, o, r);
338
+ v.required(t, e, s, r, o), e !== void 0 && v.type(t, e, s, r, o);
339
339
  }
340
- i(o);
341
- }, Xe = function(t, e, i, s, r) {
342
- var o = [], n = t.required || !t.required && s.hasOwnProperty(t.field);
340
+ i(r);
341
+ }, Ye = function(t, e, i, s, o) {
342
+ var r = [], n = t.required || !t.required && s.hasOwnProperty(t.field);
343
343
  if (n) {
344
344
  if (e === "" && (e = void 0), I(e) && !t.required)
345
345
  return i();
346
- v.required(t, e, s, o, r), e !== void 0 && (v.type(t, e, s, o, r), v.range(t, e, s, o, r));
346
+ v.required(t, e, s, r, o), e !== void 0 && (v.type(t, e, s, r, o), v.range(t, e, s, r, o));
347
347
  }
348
- i(o);
349
- }, Ne = function(t, e, i, s, r) {
350
- var o = [], n = t.required || !t.required && s.hasOwnProperty(t.field);
348
+ i(r);
349
+ }, Ke = function(t, e, i, s, o) {
350
+ var r = [], n = t.required || !t.required && s.hasOwnProperty(t.field);
351
351
  if (n) {
352
352
  if (I(e) && !t.required)
353
353
  return i();
354
- v.required(t, e, s, o, r), e !== void 0 && v.type(t, e, s, o, r);
354
+ v.required(t, e, s, r, o), e !== void 0 && v.type(t, e, s, r, o);
355
355
  }
356
- i(o);
357
- }, Ke = function(t, e, i, s, r) {
358
- var o = [], n = t.required || !t.required && s.hasOwnProperty(t.field);
356
+ i(r);
357
+ }, Be = function(t, e, i, s, o) {
358
+ var r = [], n = t.required || !t.required && s.hasOwnProperty(t.field);
359
359
  if (n) {
360
360
  if (I(e) && !t.required)
361
361
  return i();
362
- v.required(t, e, s, o, r), I(e) || v.type(t, e, s, o, r);
362
+ v.required(t, e, s, r, o), I(e) || v.type(t, e, s, r, o);
363
363
  }
364
- i(o);
365
- }, Ye = function(t, e, i, s, r) {
366
- var o = [], n = t.required || !t.required && s.hasOwnProperty(t.field);
364
+ i(r);
365
+ }, We = function(t, e, i, s, o) {
366
+ var r = [], n = t.required || !t.required && s.hasOwnProperty(t.field);
367
367
  if (n) {
368
368
  if (I(e) && !t.required)
369
369
  return i();
370
- v.required(t, e, s, o, r), e !== void 0 && (v.type(t, e, s, o, r), v.range(t, e, s, o, r));
370
+ v.required(t, e, s, r, o), e !== void 0 && (v.type(t, e, s, r, o), v.range(t, e, s, r, o));
371
371
  }
372
- i(o);
373
- }, Be = function(t, e, i, s, r) {
374
- var o = [], n = t.required || !t.required && s.hasOwnProperty(t.field);
372
+ i(r);
373
+ }, Pe = function(t, e, i, s, o) {
374
+ var r = [], n = t.required || !t.required && s.hasOwnProperty(t.field);
375
375
  if (n) {
376
376
  if (I(e) && !t.required)
377
377
  return i();
378
- v.required(t, e, s, o, r), e !== void 0 && (v.type(t, e, s, o, r), v.range(t, e, s, o, r));
378
+ v.required(t, e, s, r, o), e !== void 0 && (v.type(t, e, s, r, o), v.range(t, e, s, r, o));
379
379
  }
380
- i(o);
381
- }, We = function(t, e, i, s, r) {
382
- var o = [], n = t.required || !t.required && s.hasOwnProperty(t.field);
380
+ i(r);
381
+ }, Ve = function(t, e, i, s, o) {
382
+ var r = [], n = t.required || !t.required && s.hasOwnProperty(t.field);
383
383
  if (n) {
384
384
  if (e == null && !t.required)
385
385
  return i();
386
- v.required(t, e, s, o, r, "array"), e != null && (v.type(t, e, s, o, r), v.range(t, e, s, o, r));
386
+ v.required(t, e, s, r, o, "array"), e != null && (v.type(t, e, s, r, o), v.range(t, e, s, r, o));
387
387
  }
388
- i(o);
389
- }, Pe = function(t, e, i, s, r) {
390
- var o = [], n = t.required || !t.required && s.hasOwnProperty(t.field);
388
+ i(r);
389
+ }, ze = function(t, e, i, s, o) {
390
+ var r = [], n = t.required || !t.required && s.hasOwnProperty(t.field);
391
391
  if (n) {
392
392
  if (I(e) && !t.required)
393
393
  return i();
394
- v.required(t, e, s, o, r), e !== void 0 && v.type(t, e, s, o, r);
394
+ v.required(t, e, s, r, o), e !== void 0 && v.type(t, e, s, r, o);
395
395
  }
396
- i(o);
397
- }, Ve = "enum", ze = function(t, e, i, s, r) {
398
- var o = [], n = t.required || !t.required && s.hasOwnProperty(t.field);
396
+ i(r);
397
+ }, $e = "enum", qe = function(t, e, i, s, o) {
398
+ var r = [], n = t.required || !t.required && s.hasOwnProperty(t.field);
399
399
  if (n) {
400
400
  if (I(e) && !t.required)
401
401
  return i();
402
- v.required(t, e, s, o, r), e !== void 0 && v[Ve](t, e, s, o, r);
402
+ v.required(t, e, s, r, o), e !== void 0 && v[$e](t, e, s, r, o);
403
403
  }
404
- i(o);
405
- }, $e = function(t, e, i, s, r) {
406
- var o = [], n = t.required || !t.required && s.hasOwnProperty(t.field);
404
+ i(r);
405
+ }, Ge = function(t, e, i, s, o) {
406
+ var r = [], n = t.required || !t.required && s.hasOwnProperty(t.field);
407
407
  if (n) {
408
408
  if (I(e, "string") && !t.required)
409
409
  return i();
410
- v.required(t, e, s, o, r), I(e, "string") || v.pattern(t, e, s, o, r);
410
+ v.required(t, e, s, r, o), I(e, "string") || v.pattern(t, e, s, r, o);
411
411
  }
412
- i(o);
413
- }, qe = function(t, e, i, s, r) {
414
- var o = [], n = t.required || !t.required && s.hasOwnProperty(t.field);
412
+ i(r);
413
+ }, je = function(t, e, i, s, o) {
414
+ var r = [], n = t.required || !t.required && s.hasOwnProperty(t.field);
415
415
  if (n) {
416
416
  if (I(e, "date") && !t.required)
417
417
  return i();
418
- if (v.required(t, e, s, o, r), !I(e, "date")) {
418
+ if (v.required(t, e, s, r, o), !I(e, "date")) {
419
419
  var l;
420
- e instanceof Date ? l = e : l = new Date(e), v.type(t, l, s, o, r), l && v.range(t, l.getTime(), s, o, r);
420
+ e instanceof Date ? l = e : l = new Date(e), v.type(t, l, s, r, o), l && v.range(t, l.getTime(), s, r, o);
421
421
  }
422
422
  }
423
- i(o);
424
- }, Ge = function(t, e, i, s, r) {
425
- var o = [], n = Array.isArray(e) ? "array" : typeof e;
426
- v.required(t, e, s, o, r, n), i(o);
427
- }, yt = function(t, e, i, s, r) {
428
- var o = t.type, n = [], l = t.required || !t.required && s.hasOwnProperty(t.field);
423
+ i(r);
424
+ }, Ue = function(t, e, i, s, o) {
425
+ var r = [], n = Array.isArray(e) ? "array" : typeof e;
426
+ v.required(t, e, s, r, o, n), i(r);
427
+ }, yt = function(t, e, i, s, o) {
428
+ var r = t.type, n = [], l = t.required || !t.required && s.hasOwnProperty(t.field);
429
429
  if (l) {
430
- if (I(e, o) && !t.required)
430
+ if (I(e, r) && !t.required)
431
431
  return i();
432
- v.required(t, e, s, n, r, o), I(e, o) || v.type(t, e, s, n, r);
432
+ v.required(t, e, s, n, o, r), I(e, r) || v.type(t, e, s, n, o);
433
433
  }
434
434
  i(n);
435
- }, je = function(t, e, i, s, r) {
436
- var o = [], n = t.required || !t.required && s.hasOwnProperty(t.field);
435
+ }, Ze = function(t, e, i, s, o) {
436
+ var r = [], n = t.required || !t.required && s.hasOwnProperty(t.field);
437
437
  if (n) {
438
438
  if (I(e) && !t.required)
439
439
  return i();
440
- v.required(t, e, s, o, r);
440
+ v.required(t, e, s, r, o);
441
441
  }
442
- i(o);
442
+ i(r);
443
443
  }, it = {
444
- string: ke,
445
- method: Fe,
446
- number: Xe,
447
- boolean: Ne,
448
- regexp: Ke,
449
- integer: Ye,
450
- float: Be,
451
- array: We,
452
- object: Pe,
453
- enum: ze,
454
- pattern: $e,
455
- date: qe,
444
+ string: Fe,
445
+ method: Ne,
446
+ number: Ye,
447
+ boolean: Ke,
448
+ regexp: Be,
449
+ integer: We,
450
+ float: Pe,
451
+ array: Ve,
452
+ object: ze,
453
+ enum: qe,
454
+ pattern: Ge,
455
+ date: je,
456
456
  url: yt,
457
457
  hex: yt,
458
458
  email: yt,
459
- required: Ge,
460
- any: je
459
+ required: Ue,
460
+ any: Ze
461
461
  };
462
462
  function vt() {
463
463
  return {
@@ -523,17 +523,17 @@ var Rt = vt(), nt = /* @__PURE__ */ function() {
523
523
  throw new Error("Cannot configure a schema with no rules");
524
524
  if (typeof i != "object" || Array.isArray(i))
525
525
  throw new Error("Rules must be an object");
526
- this.rules = {}, Object.keys(i).forEach(function(r) {
527
- var o = i[r];
528
- s.rules[r] = Array.isArray(o) ? o : [o];
526
+ this.rules = {}, Object.keys(i).forEach(function(o) {
527
+ var r = i[o];
528
+ s.rules[o] = Array.isArray(r) ? r : [r];
529
529
  });
530
530
  }, t.messages = function(i) {
531
- return i && (this._messages = Kt(vt(), i)), this._messages;
532
- }, t.validate = function(i, s, r) {
533
- var o = this;
534
- s === void 0 && (s = {}), r === void 0 && (r = function() {
531
+ return i && (this._messages = Yt(vt(), i)), this._messages;
532
+ }, t.validate = function(i, s, o) {
533
+ var r = this;
534
+ s === void 0 && (s = {}), o === void 0 && (o = function() {
535
535
  });
536
- var n = i, l = s, h = r;
536
+ var n = i, l = s, h = o;
537
537
  if (typeof l == "function" && (h = l, l = {}), !this.rules || Object.keys(this.rules).length === 0)
538
538
  return h && h(null, n), Promise.resolve(n);
539
539
  function f(g) {
@@ -551,17 +551,17 @@ var Rt = vt(), nt = /* @__PURE__ */ function() {
551
551
  }
552
552
  if (l.messages) {
553
553
  var d = this.messages();
554
- d === Rt && (d = vt()), Kt(d, l.messages), l.messages = d;
554
+ d === Rt && (d = vt()), Yt(d, l.messages), l.messages = d;
555
555
  } else
556
556
  l.messages = this.messages();
557
557
  var x = {}, u = l.keys || Object.keys(this.rules);
558
558
  u.forEach(function(g) {
559
- var w = o.rules[g], p = n[g];
559
+ var w = r.rules[g], p = n[g];
560
560
  w.forEach(function(E) {
561
561
  var m = E;
562
562
  typeof m.transform == "function" && (n === i && (n = $({}, n)), p = n[g] = m.transform(p)), typeof m == "function" ? m = {
563
563
  validator: m
564
- } : m = $({}, m), m.validator = o.getValidationMethod(m), m.validator && (m.field = g, m.fullField = m.fullField || g, m.type = o.getType(m), x[g] = x[g] || [], x[g].push({
564
+ } : m = $({}, m), m.validator = r.getValidationMethod(m), m.validator && (m.field = g, m.fullField = m.fullField || g, m.type = r.getType(m), x[g] = x[g] || [], x[g].push({
565
565
  rule: m,
566
566
  value: p,
567
567
  source: n,
@@ -570,7 +570,7 @@ var Rt = vt(), nt = /* @__PURE__ */ function() {
570
570
  });
571
571
  });
572
572
  var y = {};
573
- return Oe(x, l, function(g, w) {
573
+ return Se(x, l, function(g, w) {
574
574
  var p = g.rule, E = (p.type === "object" || p.type === "array") && (typeof p.fields == "object" || typeof p.defaultField == "object");
575
575
  E = E && (p.required || !p.required && g.value), p.field = g.field;
576
576
  function m(R, T) {
@@ -590,20 +590,20 @@ var Rt = vt(), nt = /* @__PURE__ */ function() {
590
590
  w(L);
591
591
  else {
592
592
  if (p.required && !g.value)
593
- return p.message !== void 0 ? L = [].concat(p.message).map(Nt(p, n)) : l.error && (L = [l.error(p, H(l.messages.required, p.field))]), w(L);
593
+ return p.message !== void 0 ? L = [].concat(p.message).map(Nt(p, n)) : l.error && (L = [l.error(p, M(l.messages.required, p.field))]), w(L);
594
594
  var A = {};
595
- p.defaultField && Object.keys(g.value).map(function(O) {
596
- A[O] = p.defaultField;
595
+ p.defaultField && Object.keys(g.value).map(function(_) {
596
+ A[_] = p.defaultField;
597
597
  }), A = $({}, A, g.rule.fields);
598
598
  var D = {};
599
- Object.keys(A).forEach(function(O) {
600
- var S = A[O], _ = Array.isArray(S) ? S : [S];
601
- D[O] = _.map(m.bind(null, O));
599
+ Object.keys(A).forEach(function(_) {
600
+ var S = A[_], O = Array.isArray(S) ? S : [S];
601
+ D[_] = O.map(m.bind(null, _));
602
602
  });
603
603
  var B = new a(D);
604
- B.messages(l.messages), g.rule.options && (g.rule.options.messages = l.messages, g.rule.options.error = l.error), B.validate(g.value, g.rule.options || l, function(O) {
604
+ B.messages(l.messages), g.rule.options && (g.rule.options.messages = l.messages, g.rule.options.error = l.error), B.validate(g.value, g.rule.options || l, function(_) {
605
605
  var S = [];
606
- L && L.length && S.push.apply(S, L), O && O.length && S.push.apply(S, O), w(S.length ? S : null);
606
+ L && L.length && S.push.apply(S, L), _ && _.length && S.push.apply(S, _), w(S.length ? S : null);
607
607
  });
608
608
  }
609
609
  }
@@ -630,13 +630,13 @@ var Rt = vt(), nt = /* @__PURE__ */ function() {
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))
633
- throw new Error(H("Unknown rule type %s", i.type));
633
+ throw new Error(M("Unknown rule type %s", i.type));
634
634
  return i.type || "string";
635
635
  }, t.getValidationMethod = function(i) {
636
636
  if (typeof i.validator == "function")
637
637
  return i.validator;
638
- var s = Object.keys(i), r = s.indexOf("message");
639
- return r !== -1 && s.splice(r, 1), s.length === 1 && s[0] === "required" ? it.required : it[this.getType(i)] || void 0;
638
+ var s = Object.keys(i), o = s.indexOf("message");
639
+ return o !== -1 && s.splice(o, 1), s.length === 1 && s[0] === "required" ? it.required : it[this.getType(i)] || void 0;
640
640
  }, a;
641
641
  }();
642
642
  nt.register = function(t, e) {
@@ -644,7 +644,7 @@ nt.register = function(t, e) {
644
644
  throw new Error("Cannot register a validator by type, validator is not a function");
645
645
  it[t] = e;
646
646
  };
647
- nt.warning = qt;
647
+ nt.warning = jt;
648
648
  nt.messages = Rt;
649
649
  nt.validators = it;
650
650
  function At() {
@@ -653,37 +653,37 @@ function At() {
653
653
  return (a === "x" ? t : t & 3 | 8).toString(16);
654
654
  });
655
655
  }
656
- function jt(a, t) {
656
+ function Zt(a, t) {
657
657
  let e = 0, i;
658
658
  return function(...s) {
659
- const r = (/* @__PURE__ */ new Date()).getTime(), o = r - e;
660
- !e || o >= t ? (a.apply(this, s), e = r) : i || (i = setTimeout(() => {
659
+ const o = (/* @__PURE__ */ new Date()).getTime(), r = o - e;
660
+ !e || r >= t ? (a.apply(this, s), e = o) : i || (i = setTimeout(() => {
661
661
  a.apply(this, s), e = (/* @__PURE__ */ new Date()).getTime(), i = void 0;
662
- }, t - o));
662
+ }, t - r));
663
663
  };
664
664
  }
665
- function Ut(a) {
666
- return a ? a.map((t) => Ut(t.children) + 1).sort((t, e) => e - t)[0] : 0;
665
+ function Jt(a) {
666
+ return a ? a.map((t) => Jt(t.children) + 1).sort((t, e) => e - t)[0] : 0;
667
667
  }
668
- function Ue(a = []) {
668
+ function Je(a = []) {
669
669
  let t = [], e = [], i = [];
670
670
  return a.forEach((s) => {
671
671
  s.fixed === "left" ? t.push(s) : s.fixed === "right" ? i.push(s) : e.push(s);
672
672
  }), [
673
- ...t.sort((s, r) => s.sort - r.sort),
674
- ...e.sort((s, r) => s.sort - r.sort),
675
- ...i.sort((s, r) => s.sort - r.sort)
673
+ ...t.sort((s, o) => s.sort - o.sort),
674
+ ...e.sort((s, o) => s.sort - o.sort),
675
+ ...i.sort((s, o) => s.sort - o.sort)
676
676
  ];
677
677
  }
678
- function Zt(a = [], t = 1, e = 0) {
678
+ function Qt(a = [], t = 1, e = 0) {
679
679
  return a.map((i) => {
680
680
  if (i.children) {
681
- let s = 0, r = i.fixed;
681
+ let s = 0, o = i.fixed;
682
682
  i.children.forEach((n) => {
683
- n.fixed = r;
683
+ n.fixed = o;
684
684
  });
685
- const o = Zt(i.children, t - 1, e + 1);
686
- return o && o.forEach((n) => {
685
+ const r = Qt(i.children, t - 1, e + 1);
686
+ return r && r.forEach((n) => {
687
687
  s += n.colspan;
688
688
  }), {
689
689
  ...i,
@@ -691,7 +691,7 @@ function Zt(a = [], t = 1, e = 0) {
691
691
  level: e,
692
692
  rowspan: 1,
693
693
  colspan: s,
694
- children: o
694
+ children: r
695
695
  };
696
696
  }
697
697
  return {
@@ -708,7 +708,46 @@ function It(a = []) {
708
708
  e.children ? t = t.concat(It(e.children)) : t.push(e);
709
709
  }), t;
710
710
  }
711
- class Ze {
711
+ const Bt = /^(\r\n|\n\r|\r|\n)/, Qe = /^[^\t\r\n]+/, Wt = /^\t/;
712
+ function ti(a) {
713
+ let t = [[""]];
714
+ if (a.length === 0)
715
+ return t;
716
+ let e = 0, i = 0, s;
717
+ for (; a.length > 0 && s !== a.length; )
718
+ if (s = a.length, a.match(Wt))
719
+ a = a.replace(Wt, ""), e += 1, t[i][e] = "";
720
+ else if (a.match(Bt))
721
+ a = a.replace(Bt, ""), e = 0, i += 1, t[i] = [""];
722
+ else {
723
+ let o = "";
724
+ if (a.startsWith('"')) {
725
+ let r = 0, n = !0;
726
+ for (; n; ) {
727
+ const l = a.slice(0, 1);
728
+ l === '"' && (r += 1), o += l, a = a.slice(1), (a.length === 0 || a.match(/^[\t\r\n]/) && r % 2 === 0) && (n = !1);
729
+ }
730
+ o = o.replace(/^"/, "").replace(/"$/, "").replace(/["]*/g, (l) => new Array(Math.floor(l.length / 2)).fill('"').join(""));
731
+ } else {
732
+ const r = a.match(Qe);
733
+ o = r ? r[0] : "", a = a.slice(o.length);
734
+ }
735
+ t[i][e] = o;
736
+ }
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
+ }
739
+ function ei(a) {
740
+ let t, e, i, s, o = "", r;
741
+ for (t = 0, e = a.length; t < e; t += 1) {
742
+ for (s = a[t].length, i = 0; i < s; i += 1)
743
+ i > 0 && (o += " "), r = a[t][i], typeof r == "string" ? r.indexOf(`
744
+ `) > -1 ? o += `"${r.replace(/"/g, '""')}"` : o += r : r == null ? o += "" : o += r;
745
+ t !== e - 1 && (o += `
746
+ `);
747
+ }
748
+ return o;
749
+ }
750
+ class ii {
712
751
  //虚拟滚动位置
713
752
  constructor(t, e) {
714
753
  c(this, "loading", !1);
@@ -730,8 +769,8 @@ class Ze {
730
769
  c(this, "filterMethod");
731
770
  c(this, "positions", []);
732
771
  this.ctx = t;
733
- const { data: i = [], columns: s = [], footerData: r = [] } = e;
734
- this.data = i, this.footerData = r, this.columns = s, this.setLoading(!0), this.init();
772
+ const { data: i = [], columns: s = [], footerData: o = [] } = e;
773
+ this.data = i, this.footerData = o, this.columns = s, this.setLoading(!0), this.init();
735
774
  }
736
775
  init() {
737
776
  this.clearBufferData(), this.rowKeyMap.clear(), this.checkboxKeyMap.clear(), this.colIndexKeyMap.clear(), this.rowIndexRowKeyMap.clear(), this.originalDataMap.clear(), this.changedDataMap.clear(), this.validationErrorMap.clear(), this.itemRowKeyMap = /* @__PURE__ */ new WeakMap(), this.initData(this.data);
@@ -749,9 +788,9 @@ class Ze {
749
788
  */
750
789
  initData(t, e = 0) {
751
790
  t.forEach((i, s) => {
752
- let r = !1;
753
- Array.isArray(i.children) && (r = !0, this.initData(i.children, e + 1));
754
- const { ROW_KEY: o = "", DEFAULT_EXPAND_ALL: n, CELL_HEIGHT: l, SELECTABLE_METHOD: h, CHECKBOX_KEY: f } = this.ctx.config, d = i[o], x = d ?? At();
791
+ let o = !1;
792
+ Array.isArray(i.children) && (o = !0, this.initData(i.children, e + 1));
793
+ const { ROW_KEY: r = "", DEFAULT_EXPAND_ALL: n, CELL_HEIGHT: l, SELECTABLE_METHOD: h, CHECKBOX_KEY: f } = this.ctx.config, d = i[r], x = d ?? At();
755
794
  this.itemRowKeyMap.set(i, x);
756
795
  const u = i._height || l, y = i._readonly;
757
796
  let g = !0;
@@ -773,7 +812,7 @@ class Ze {
773
812
  selectable: g,
774
813
  expand: n,
775
814
  expandLazy: !1,
776
- hasChildren: r,
815
+ hasChildren: o,
777
816
  expandLoading: !1,
778
817
  item: i
779
818
  });
@@ -804,8 +843,8 @@ class Ze {
804
843
  filterColumns(t) {
805
844
  return t.reduce((e, i) => {
806
845
  if (!(typeof i.hide == "function" ? i.hide() : i.hide)) {
807
- const r = { ...i };
808
- r.children && Array.isArray(r.children) && (r.children = this.filterColumns(r.children)), e.push(r);
846
+ const o = { ...i };
847
+ o.children && Array.isArray(o.children) && (o.children = this.filterColumns(o.children)), e.push(o);
809
848
  }
810
849
  return e;
811
850
  }, []);
@@ -832,15 +871,15 @@ class Ze {
832
871
  };
833
872
  let t = [], e = 0;
834
873
  this.sumHeight = 0, this.positions = [];
835
- const i = (r) => {
836
- r.forEach((o) => {
837
- t.push(o);
838
- const n = this.itemRowKeyMap.get(o), { expand: l, hasChildren: h, height: f } = this.rowKeyMap.get(n), d = this.sumHeight;
874
+ const i = (o) => {
875
+ o.forEach((r) => {
876
+ t.push(r);
877
+ const n = this.itemRowKeyMap.get(r), { expand: l, hasChildren: h, height: f } = this.rowKeyMap.get(n), d = this.sumHeight;
839
878
  this.sumHeight += f, this.rowIndexRowKeyMap.set(e, n), this.positions.push({
840
879
  top: d,
841
880
  height: f,
842
881
  bottom: this.sumHeight
843
- }), e += 1, l && h && i(o.children);
882
+ }), e += 1, l && h && i(r.children);
844
883
  });
845
884
  };
846
885
  this.rowIndexRowKeyMap.clear();
@@ -936,11 +975,11 @@ class Ze {
936
975
  getItemValueForRowIndexAndColIndex(t, e) {
937
976
  if (!(this.rowIndexRowKeyMap.has(t) && this.colIndexKeyMap.get(e)))
938
977
  return null;
939
- const s = this.rowIndexRowKeyMap.get(t), r = this.colIndexKeyMap.get(e);
978
+ const s = this.rowIndexRowKeyMap.get(t), o = this.colIndexKeyMap.get(e);
940
979
  return {
941
980
  rowKey: s,
942
- key: r,
943
- value: this.getItemValue(s, r)
981
+ key: o,
982
+ value: this.getItemValue(s, o)
944
983
  };
945
984
  }
946
985
  /**
@@ -971,8 +1010,8 @@ class Ze {
971
1010
  newValue: x
972
1011
  });
973
1012
  });
974
- let r = [];
975
- const o = i.map((n) => {
1013
+ let o = [];
1014
+ const r = i.map((n) => {
976
1015
  const l = this.ctx.database.getRowDataItemForRowKey(n.rowKey);
977
1016
  return {
978
1017
  rowKey: n.rowKey,
@@ -982,8 +1021,8 @@ class Ze {
982
1021
  };
983
1022
  });
984
1023
  return s.forEach((n) => {
985
- r.push(this.ctx.database.getRowDataItemForRowKey(n));
986
- }), this.ctx.emit("change", o, r), e && this.ctx.history.pushState({
1024
+ o.push(this.ctx.database.getRowDataItemForRowKey(n));
1025
+ }), this.ctx.emit("change", r, o), e && this.ctx.history.pushState({
987
1026
  changeList: i,
988
1027
  scrollX: this.ctx.scrollX,
989
1028
  scrollY: this.ctx.scrollY,
@@ -1000,7 +1039,7 @@ class Ze {
1000
1039
  * @param isEditor 是否是编辑器
1001
1040
  * @returns
1002
1041
  */
1003
- setItemValue(t, e, i, s = !1, r = !1, o = !1) {
1042
+ setItemValue(t, e, i, s = !1, o = !1, r = !1) {
1004
1043
  if (!this.rowKeyMap.has(t))
1005
1044
  return {};
1006
1045
  const { item: n } = this.rowKeyMap.get(t);
@@ -1012,7 +1051,7 @@ class Ze {
1012
1051
  };
1013
1052
  n[e] !== null && typeof n[e] == "object" && (l = JSON.parse(JSON.stringify(n[e])));
1014
1053
  const h = `${t}_${e}`;
1015
- if (this.originalDataMap.has(h) || this.originalDataMap.set(h, l), this.changedDataMap.set(h, i), n[e] = i, o) {
1054
+ if (this.originalDataMap.has(h) || this.originalDataMap.set(h, l), this.changedDataMap.set(h, i), n[e] = i, r) {
1016
1055
  const f = this.ctx.database.getRowDataItemForRowKey(t), d = {
1017
1056
  rowKey: t,
1018
1057
  key: e,
@@ -1047,7 +1086,7 @@ class Ze {
1047
1086
  newValue: i
1048
1087
  }
1049
1088
  ]
1050
- }), r && this.ctx.emit("draw"), {
1089
+ }), o && this.ctx.emit("draw"), {
1051
1090
  oldValue: l,
1052
1091
  newValue: i
1053
1092
  };
@@ -1073,8 +1112,8 @@ class Ze {
1073
1112
  if (i) {
1074
1113
  if (!this.rowKeyMap.has(t))
1075
1114
  return !1;
1076
- const { item: s } = this.rowKeyMap.get(t), r = s[i];
1077
- this.checkboxKeyMap.has(r) && this.checkboxKeyMap.get(r).forEach((n) => {
1115
+ const { item: s } = this.rowKeyMap.get(t), o = s[i];
1116
+ this.checkboxKeyMap.has(o) && this.checkboxKeyMap.get(o).forEach((n) => {
1078
1117
  const l = this.rowKeyMap.get(n);
1079
1118
  l.check = e;
1080
1119
  });
@@ -1161,12 +1200,12 @@ class Ze {
1161
1200
  */
1162
1201
  getCheckedState() {
1163
1202
  let t = 0, e = 0;
1164
- this.rowKeyMap.forEach((o) => {
1165
- o.check && (t += 1);
1166
- const n = o.selectable;
1203
+ this.rowKeyMap.forEach((r) => {
1204
+ r.check && (t += 1);
1205
+ const n = r.selectable;
1167
1206
  typeof n == "function" ? n({
1168
- row: o.item,
1169
- rowIndex: o.rowIndex
1207
+ row: r.item,
1208
+ rowIndex: r.rowIndex
1170
1209
  }) && (e += 1) : n && (e += 1);
1171
1210
  });
1172
1211
  const i = e && e > t && t > 0;
@@ -1191,12 +1230,12 @@ class Ze {
1191
1230
  getChangedData() {
1192
1231
  let t = [];
1193
1232
  return this.changedDataMap.forEach((e, i) => {
1194
- const s = this.originalDataMap.get(i), r = i.split("_")[0], o = i.split("_")[1];
1233
+ const s = this.originalDataMap.get(i), o = i.split("_")[0], r = i.split("_")[1];
1195
1234
  s !== e && t.push({
1196
- rowKey: r,
1197
- colKey: o,
1235
+ rowKey: o,
1236
+ colKey: r,
1198
1237
  originalValue: s,
1199
- row: this.rowKeyMap.get(r),
1238
+ row: this.rowKeyMap.get(o),
1200
1239
  value: e
1201
1240
  });
1202
1241
  }), t;
@@ -1204,8 +1243,8 @@ class Ze {
1204
1243
  getChangedRows() {
1205
1244
  const t = /* @__PURE__ */ new Set();
1206
1245
  this.changedDataMap.forEach((i, s) => {
1207
- const r = this.originalDataMap.get(s), o = s.split("_")[0];
1208
- r !== i && t.add(o);
1246
+ const o = this.originalDataMap.get(s), r = s.split("_")[0];
1247
+ o !== i && t.add(r);
1209
1248
  });
1210
1249
  let e = [];
1211
1250
  return t.forEach((i) => {
@@ -1222,8 +1261,8 @@ class Ze {
1222
1261
  const i = `${t}_${e}`;
1223
1262
  if (!this.changedDataMap.has(i))
1224
1263
  return !1;
1225
- const s = this.originalDataMap.get(i), r = this.changedDataMap.get(i);
1226
- return s !== r;
1264
+ const s = this.originalDataMap.get(i), o = this.changedDataMap.get(i);
1265
+ return s !== o;
1227
1266
  }
1228
1267
  getPositionForRowIndex(t) {
1229
1268
  return t < this.positions.length ? this.positions[t] : {
@@ -1236,7 +1275,7 @@ class Ze {
1236
1275
  return t ? (this.headerMap.set(t, e), !0) : !1;
1237
1276
  }
1238
1277
  getReadonly(t, e) {
1239
- const i = this.rowKeyMap.get(t), s = this.headerMap.get(e), r = i == null ? void 0 : i.readonly, o = s == null ? void 0 : s.readonly, { CELL_READONLY_METHOD: n } = this.ctx.config;
1278
+ const i = this.rowKeyMap.get(t), s = this.headerMap.get(e), o = i == null ? void 0 : i.readonly, r = s == null ? void 0 : s.readonly, { CELL_READONLY_METHOD: n } = this.ctx.config;
1240
1279
  if (typeof n == "function") {
1241
1280
  const h = n({
1242
1281
  row: i.item,
@@ -1248,20 +1287,20 @@ class Ze {
1248
1287
  if (h !== void 0)
1249
1288
  return h;
1250
1289
  }
1251
- return o || r;
1290
+ return r || o;
1252
1291
  }
1253
1292
  clearValidate() {
1254
1293
  this.validationErrorMap.clear();
1255
1294
  }
1256
1295
  getValidator(t, e) {
1257
1296
  return new Promise((i) => {
1258
- const s = this.rowKeyMap.get(t), r = this.headerMap.get(e), { CELL_RULES_METHOD: o } = this.ctx.config, n = r.column;
1297
+ const s = this.rowKeyMap.get(t), o = this.headerMap.get(e), { CELL_RULES_METHOD: r } = this.ctx.config, n = o.column;
1259
1298
  let l = n.rules;
1260
- if (typeof o == "function") {
1261
- const f = o({
1299
+ if (typeof r == "function") {
1300
+ const f = r({
1262
1301
  row: s.item,
1263
1302
  rowIndex: s.rowIndex,
1264
- colIndex: r.colIndex,
1303
+ colIndex: o.colIndex,
1265
1304
  column: n,
1266
1305
  value: this.getItemValue(t, e)
1267
1306
  });
@@ -1275,7 +1314,7 @@ class Ze {
1275
1314
  row: s.item,
1276
1315
  column: n,
1277
1316
  rowIndex: s.rowIndex,
1278
- colIndex: r.colIndex
1317
+ colIndex: o.colIndex
1279
1318
  }));
1280
1319
  h[e] = x;
1281
1320
  } else
@@ -1284,7 +1323,7 @@ class Ze {
1284
1323
  row: s.item,
1285
1324
  column: n,
1286
1325
  rowIndex: s.rowIndex,
1287
- colIndex: r.colIndex
1326
+ colIndex: o.colIndex
1288
1327
  };
1289
1328
  new nt(h).validate(f).then(() => {
1290
1329
  this.setValidationError(t, e, []), i([]);
@@ -1305,8 +1344,8 @@ class Ze {
1305
1344
  getHeightByRowIndexRowSpan(t, e) {
1306
1345
  let i = 0;
1307
1346
  for (let s = 0; s < e; s++) {
1308
- const r = this.positions[t + s];
1309
- r && (i += r.height);
1347
+ const o = this.positions[t + s];
1348
+ o && (i += o.height);
1310
1349
  }
1311
1350
  return i;
1312
1351
  }
@@ -1317,12 +1356,12 @@ class Ze {
1317
1356
  return this.loading;
1318
1357
  }
1319
1358
  setValidationErrorByRowIndex(t, e, i) {
1320
- const r = `${this.rowIndexRowKeyMap.get(t)}_${e}`, o = [
1359
+ const o = `${this.rowIndexRowKeyMap.get(t)}_${e}`, r = [
1321
1360
  {
1322
1361
  message: i
1323
1362
  }
1324
1363
  ];
1325
- this.validationErrorMap.set(r, o);
1364
+ this.validationErrorMap.set(o, r);
1326
1365
  }
1327
1366
  setValidationError(t, e, i) {
1328
1367
  const s = `${t}_${e}`;
@@ -1333,7 +1372,7 @@ class Ze {
1333
1372
  return this.validationErrorMap.get(i) || [];
1334
1373
  }
1335
1374
  }
1336
- class Je {
1375
+ class si {
1337
1376
  constructor(t) {
1338
1377
  c(this, "ctx");
1339
1378
  c(this, "history", []);
@@ -1360,10 +1399,10 @@ class Je {
1360
1399
  backState() {
1361
1400
  if (this.historyIndex >= 0) {
1362
1401
  const { changeList: t, scrollX: e, scrollY: i } = this.history[this.historyIndex], s = t.map(
1363
- (r) => ({
1364
- rowKey: r.rowKey,
1365
- key: r.key,
1366
- value: r.oldValue,
1402
+ (o) => ({
1403
+ rowKey: o.rowKey,
1404
+ key: o.key,
1405
+ value: o.oldValue,
1367
1406
  row: {}
1368
1407
  })
1369
1408
  );
@@ -1390,7 +1429,7 @@ class Je {
1390
1429
  this.history = [], this.historyIndex = -1;
1391
1430
  }
1392
1431
  }
1393
- class Qe {
1432
+ class ri {
1394
1433
  constructor(t) {
1395
1434
  c(this, "eventTasks", /* @__PURE__ */ new Map());
1396
1435
  c(this, "ctx");
@@ -1436,7 +1475,7 @@ class Qe {
1436
1475
  t.removeEventListener(e, i), this.eventTasks.delete(e);
1437
1476
  }
1438
1477
  }
1439
- class ti {
1478
+ class oi {
1440
1479
  constructor() {
1441
1480
  c(this, "events", /* @__PURE__ */ new Map());
1442
1481
  }
@@ -1474,7 +1513,7 @@ class ti {
1474
1513
  this.events.clear();
1475
1514
  }
1476
1515
  }
1477
- class ei {
1516
+ class ni {
1478
1517
  constructor(t) {
1479
1518
  c(this, "ctx");
1480
1519
  const e = t.getContext("2d");
@@ -1511,9 +1550,9 @@ class ei {
1511
1550
  * @param {number} shadowWidth - 阴影的宽度
1512
1551
  * @param {string} color - 阴影的颜色
1513
1552
  */
1514
- drawShadow(t, e, i, s, r) {
1515
- const { fillColor: o, side: n, shadowWidth: l, colorStart: h, colorEnd: f } = r;
1516
- this.ctx.save(), o && (this.ctx.fillStyle = o, this.ctx.fillRect(t, e, i, s));
1553
+ drawShadow(t, e, i, s, o) {
1554
+ const { fillColor: r, side: n, shadowWidth: l, colorStart: h, colorEnd: f } = o;
1555
+ this.ctx.save(), r && (this.ctx.fillStyle = r, this.ctx.fillRect(t, e, i, s));
1517
1556
  let d;
1518
1557
  switch (n) {
1519
1558
  case "left":
@@ -1550,21 +1589,21 @@ class ei {
1550
1589
  this.ctx.save();
1551
1590
  const { borderColor: i = "black", borderWidth: s = 1 } = e;
1552
1591
  this.ctx.beginPath(), this.ctx.moveTo(t[0] + 0.5, t[1] + 0.5);
1553
- for (let r = 2; r < t.length; r += 2)
1554
- this.ctx.lineTo(t[r] + 0.5, t[r + 1] + 0.5);
1592
+ for (let o = 2; o < t.length; o += 2)
1593
+ this.ctx.lineTo(t[o] + 0.5, t[o + 1] + 0.5);
1555
1594
  this.ctx.strokeStyle = i, this.ctx.lineWidth = s, e.lineDash && (this.ctx.lineDashOffset = 4, this.ctx.setLineDash(e.lineDash)), e.fillColor && (this.ctx.fillStyle = e.fillColor, this.ctx.fill()), e.borderColor && (this.ctx.strokeStyle = e.borderColor), this.ctx.stroke(), this.ctx.closePath(), this.ctx.restore();
1556
1595
  }
1557
- drawImage(t, e, i, s, r) {
1558
- this.ctx.save(), this.ctx.drawImage(t, e, i, s, r), this.ctx.restore();
1596
+ drawImage(t, e, i, s, o) {
1597
+ this.ctx.save(), this.ctx.drawImage(t, e, i, s, o), this.ctx.restore();
1559
1598
  }
1560
- drawRect(t, e, i, s, { borderWidth: r = 1, borderColor: o, fillColor: n, radius: l = 0 } = {}) {
1561
- 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), l === 0)
1599
+ drawRect(t, e, i, s, { borderWidth: o = 1, borderColor: r, fillColor: n, radius: l = 0 } = {}) {
1600
+ if (this.ctx.save(), this.ctx.beginPath(), n !== void 0 && (this.ctx.fillStyle = n), r !== void 0 && (this.ctx.lineWidth = o, this.ctx.strokeStyle = r), l === 0)
1562
1601
  this.ctx.rect(t + 0.5, e + 0.5, i, s);
1563
1602
  else {
1564
1603
  const [h, f, d, x] = typeof l == "number" ? [l, l, l, l] : l;
1565
1604
  this.ctx.moveTo(t + h, e), this.ctx.arcTo(t + i, e, t + i, e + f, f), this.ctx.arcTo(t + i, e + s, t + i - d, e + s, d), this.ctx.arcTo(t, e + s, t, e + s - x, x), this.ctx.arcTo(t, e, t + h, e, h);
1566
1605
  }
1567
- n !== void 0 && this.ctx.fill(), o !== void 0 && this.ctx.stroke(), this.ctx.restore();
1606
+ n !== void 0 && this.ctx.fill(), r !== void 0 && this.ctx.stroke(), this.ctx.restore();
1568
1607
  }
1569
1608
  /**
1570
1609
  * 画文本
@@ -1576,7 +1615,7 @@ class ei {
1576
1615
  * @param options
1577
1616
  * @returns 是否溢出
1578
1617
  */
1579
- drawText(t = "", e, i, s, r, o = {}) {
1618
+ drawText(t = "", e, i, s, o, r = {}) {
1580
1619
  this.ctx.save();
1581
1620
  const {
1582
1621
  font: n = "12px Arial",
@@ -1584,39 +1623,39 @@ class ei {
1584
1623
  color: h = "#495060",
1585
1624
  padding: f = 0,
1586
1625
  verticalAlign: d = "middle"
1587
- } = o;
1626
+ } = r;
1588
1627
  this.ctx.font = n, this.ctx.fillStyle = h, this.ctx.textBaseline = d, this.ctx.textAlign = l;
1589
1628
  let x = 0;
1590
- d === "top" ? x = i + f : d === "bottom" ? x = i + r - f : x = i + (r + f) / 2;
1629
+ d === "top" ? x = i + f : d === "bottom" ? x = i + o - f : x = i + (o + f) / 2;
1591
1630
  let u = 0;
1592
1631
  l === "left" ? u = e + f : l === "right" ? u = e + s - f : u = e + s / 2;
1593
1632
  const { _text: y, ellipsis: g } = this.handleEllipsis(t, s, f);
1594
1633
  return this.ctx.fillText(y, u, x), this.ctx.restore(), g;
1595
1634
  }
1596
1635
  handleEllipsis(t, e, i = 0) {
1597
- let s = !1, r = t;
1636
+ let s = !1, o = t;
1598
1637
  if (t == null || t === "")
1599
1638
  return {
1600
1639
  _text: "",
1601
1640
  ellipsis: s
1602
1641
  };
1603
- const o = this.ctx.measureText("...").width, n = this.ctx.measureText(t).width;
1604
- if (n && n + o >= e - i * 2) {
1642
+ const r = this.ctx.measureText("...").width, n = this.ctx.measureText(t).width;
1643
+ if (n && n + r >= e - i * 2) {
1605
1644
  s = !0;
1606
1645
  let l = 0;
1607
1646
  for (let h = 0; h < t.length; h++)
1608
- if (l += this.ctx.measureText(t[h]).width, l >= e - i * 2 - o) {
1609
- r = t.slice(0, h) + "...";
1647
+ if (l += this.ctx.measureText(t[h]).width, l >= e - i * 2 - r) {
1648
+ o = t.slice(0, h) + "...";
1610
1649
  break;
1611
1650
  }
1612
1651
  }
1613
1652
  return {
1614
- _text: r,
1653
+ _text: o,
1615
1654
  ellipsis: s
1616
1655
  };
1617
1656
  }
1618
1657
  }
1619
- class Bt {
1658
+ class Pt {
1620
1659
  constructor(t) {
1621
1660
  c(this, "PROCESSOR_NUM", 50);
1622
1661
  c(this, "CSS_PREFIX", "e-virt-table");
@@ -1681,6 +1720,14 @@ class Bt {
1681
1720
  // 启用单点击立马编辑
1682
1721
  c(this, "ENABLE_EDIT_CLICK_SELECTOR", !0);
1683
1722
  // 启用点击选择器编辑
1723
+ c(this, "SELECTOR_AREA_MIN_X", 0);
1724
+ // 选择器X最小范围
1725
+ c(this, "SELECTOR_AREA_MAX_X", 0);
1726
+ // 选择器X最大范围,0默认最大colMax
1727
+ c(this, "SELECTOR_AREA_MIN_Y", 0);
1728
+ // 选择器Y最小范围
1729
+ c(this, "SELECTOR_AREA_MAX_Y", 0);
1730
+ // 选择器Y最大范围,0默认rowMax
1684
1731
  c(this, "ENABLE_SELECTOR_SINGLE", !1);
1685
1732
  c(this, "ENABLE_SELECTOR_SPAN_COL", !0);
1686
1733
  c(this, "ENABLE_SELECTOR_SPAN_ROW", !0);
@@ -1733,7 +1780,7 @@ class Bt {
1733
1780
  Object.assign(this, t);
1734
1781
  }
1735
1782
  }
1736
- class ii {
1783
+ class ai {
1737
1784
  constructor(t) {
1738
1785
  c(this, "ctx");
1739
1786
  c(this, "list", [
@@ -1807,35 +1854,35 @@ class ii {
1807
1854
  const i = this.list[e];
1808
1855
  let s = i.color;
1809
1856
  if (i.configColorName) {
1810
- const o = this.ctx.config[i.configColorName];
1811
- o && (s = o);
1857
+ const r = this.ctx.config[i.configColorName];
1858
+ r && (s = r);
1812
1859
  }
1813
- const r = this.createImageFromSVG(i.svg, s).then((o) => {
1814
- this.icons.set(i.name, o);
1860
+ const o = this.createImageFromSVG(i.svg, s).then((r) => {
1861
+ this.icons.set(i.name, r);
1815
1862
  });
1816
- t.push(r);
1863
+ t.push(o);
1817
1864
  }
1818
1865
  for (let e = 0; e < this.ctx.config.ICONS.length; e++) {
1819
1866
  const i = this.ctx.config.ICONS[e];
1820
1867
  let s = i.color;
1821
- const r = this.createImageFromSVG(i.svg, s).then((o) => {
1822
- this.icons.set(i.name, o);
1868
+ const o = this.createImageFromSVG(i.svg, s).then((r) => {
1869
+ this.icons.set(i.name, r);
1823
1870
  });
1824
- t.push(r);
1871
+ t.push(o);
1825
1872
  }
1826
1873
  await Promise.all(t), this.ctx.emit("draw");
1827
1874
  }
1828
1875
  async createImageFromSVG(t, e) {
1829
- const r = new DOMParser().parseFromString(t, "image/svg+xml").documentElement;
1830
- e && r.querySelectorAll("*").forEach((h) => {
1876
+ const o = new DOMParser().parseFromString(t, "image/svg+xml").documentElement;
1877
+ e && o.querySelectorAll("*").forEach((h) => {
1831
1878
  h.setAttribute("fill", e);
1832
1879
  });
1833
- const o = new Image(), n = new Blob([new XMLSerializer().serializeToString(r)], {
1880
+ const r = new Image(), n = new Blob([new XMLSerializer().serializeToString(o)], {
1834
1881
  type: "image/svg+xml"
1835
1882
  }), l = URL.createObjectURL(n);
1836
- return o.src = l, new Promise((h, f) => {
1837
- o.onerror = () => f(new Error("Failed to load image")), o.onload = () => {
1838
- h(o);
1883
+ return r.src = l, new Promise((h, f) => {
1884
+ r.onerror = () => f(new Error("Failed to load image")), r.onload = () => {
1885
+ h(r);
1839
1886
  };
1840
1887
  });
1841
1888
  }
@@ -1843,8 +1890,8 @@ class ii {
1843
1890
  return this.icons.get(t);
1844
1891
  }
1845
1892
  }
1846
- class Jt {
1847
- constructor(t, e, i, s, r, o, n) {
1893
+ class te {
1894
+ constructor(t, e, i, s, o, r, n) {
1848
1895
  c(this, "ctx");
1849
1896
  c(this, "x", 0);
1850
1897
  c(this, "y", 0);
@@ -1852,13 +1899,13 @@ class Jt {
1852
1899
  c(this, "height", 0);
1853
1900
  c(this, "fixed");
1854
1901
  c(this, "cellType");
1855
- this.ctx = t, this.x = e, this.y = i, this.width = s, this.height = r, this.fixed = o, this.cellType = n;
1902
+ this.ctx = t, this.x = e, this.y = i, this.width = s, this.height = o, this.fixed = r, this.cellType = n;
1856
1903
  }
1857
1904
  isHorizontalVisible() {
1858
1905
  if (this.fixed)
1859
1906
  return !0;
1860
- const { target: t, fixedLeftWidth: e, scrollX: i, fixedRightWidth: s } = this.ctx, r = t.width;
1861
- return !(this.x + this.width - e - i <= 0 || this.x - i >= r - s);
1907
+ const { target: t, fixedLeftWidth: e, scrollX: i, fixedRightWidth: s } = this.ctx, o = t.width;
1908
+ return !(this.x + this.width - e - i <= 0 || this.x - i >= o - s);
1862
1909
  }
1863
1910
  isVerticalVisible() {
1864
1911
  const { target: t, scrollY: e } = this.ctx, i = t.height;
@@ -1880,11 +1927,12 @@ class Jt {
1880
1927
  getRightFixedX() {
1881
1928
  }
1882
1929
  }
1883
- class Qt extends Jt {
1884
- constructor(e, i, s, r, o, n, l, h, f, d = "body") {
1885
- super(e, r, o, n, l, h.fixed, d);
1930
+ class ee extends te {
1931
+ constructor(e, i, s, o, r, n, l, h, f, d = "body") {
1932
+ super(e, o, r, n, l, h.fixed, d);
1886
1933
  c(this, "formatter");
1887
1934
  c(this, "hoverIconName", "");
1935
+ c(this, "operation", !1);
1888
1936
  c(this, "align");
1889
1937
  c(this, "verticalAlign");
1890
1938
  c(this, "fixed");
@@ -1927,7 +1975,7 @@ class Qt extends Jt {
1927
1975
  c(this, "overflowTooltipShow", !0);
1928
1976
  c(this, "overflowTooltipMaxWidth", 500);
1929
1977
  c(this, "overflowTooltipPlacement", "top");
1930
- this.visibleWidth = this.width, this.visibleHeight = this.height, this.colIndex = s, this.rowIndex = i, this.key = h.key, this.type = h.type || "text", this.editorType = h.editorType || "text", this.cellType = d, this.align = h.align || "center", this.verticalAlign = h.verticalAlign || "middle", this.fixed = h.fixed, this.level = h.level, this.column = h, this.rules = h.rules, this.row = f, this.rowKey = this.cellType === "body" ? this.ctx.database.getRowKeyForRowIndex(i) : `${this.cellType}_${this.rowIndex}`, this.value = this.getValue(), this.render = h.render, this.overflowTooltipShow = h.overflowTooltipShow !== !1, this.overflowTooltipMaxWidth = h.overflowTooltipMaxWidth || 500, this.overflowTooltipPlacement = h.overflowTooltipPlacement || "top", this.renderFooter = h.renderFooter, this.hoverIconName = h.hoverIconName, this.formatter = h.formatter, this.update();
1978
+ this.visibleWidth = this.width, this.visibleHeight = this.height, this.colIndex = s, this.rowIndex = i, this.key = h.key, this.type = h.type || "text", this.editorType = h.editorType || "text", this.cellType = d, this.align = h.align || "center", this.verticalAlign = h.verticalAlign || "middle", this.fixed = h.fixed, this.level = h.level, this.operation = h.operation || !1, this.column = h, this.rules = h.rules, this.row = f, this.rowKey = this.cellType === "body" ? this.ctx.database.getRowKeyForRowIndex(i) : `${this.cellType}_${this.rowIndex}`, this.value = this.getValue(), this.render = h.render, this.overflowTooltipShow = h.overflowTooltipShow !== !1, this.overflowTooltipMaxWidth = h.overflowTooltipMaxWidth || 500, this.overflowTooltipPlacement = h.overflowTooltipPlacement || "top", this.renderFooter = h.renderFooter, this.hoverIconName = h.hoverIconName, this.formatter = h.formatter, this.update();
1931
1979
  }
1932
1980
  getValidationMessage() {
1933
1981
  const e = this.ctx.database.getValidationError(this.rowKey, this.key);
@@ -1945,7 +1993,7 @@ class Qt extends Jt {
1945
1993
  return;
1946
1994
  const { SPAN_METHOD: e } = this.ctx.config;
1947
1995
  if (typeof e == "function") {
1948
- const i = e, { colspan: s = 1, rowspan: r = 1 } = i({
1996
+ const i = e, { colspan: s = 1, rowspan: o = 1 } = i({
1949
1997
  row: this.row,
1950
1998
  rowIndex: this.rowIndex,
1951
1999
  colIndex: this.colIndex,
@@ -1957,7 +2005,7 @@ class Qt extends Jt {
1957
2005
  visibleLeafColumns: this.ctx.header.visibleLeafColumns,
1958
2006
  rows: this.ctx.body.data
1959
2007
  }) || {};
1960
- this.colspan = s, this.rowspan = r, this.visibleWidth = this.getWidthByColIndexColSpan(this.colIndex, this.colspan), this.visibleHeight = this.ctx.database.getHeightByRowIndexRowSpan(this.rowIndex, this.rowspan);
2008
+ this.colspan = s, this.rowspan = o, this.visibleWidth = this.getWidthByColIndexColSpan(this.colIndex, this.colspan), this.visibleHeight = this.ctx.database.getHeightByRowIndexRowSpan(this.rowIndex, this.rowspan);
1961
2009
  }
1962
2010
  }
1963
2011
  updateType() {
@@ -2019,20 +2067,20 @@ class Qt extends Jt {
2019
2067
  }
2020
2068
  updateTree() {
2021
2069
  const { CELL_PADDING: e = 0 } = this.ctx.config, { rowKey: i, cellType: s } = this;
2022
- let r, o = 0, n = "";
2070
+ let o, r = 0, n = "";
2023
2071
  if (this.type === "tree" && s === "body") {
2024
2072
  const l = this.ctx.database.getRowForRowKey(i), { expand: h = !1, hasChildren: f = !1, expandLoading: d = !1, level: x = 0 } = l || {};
2025
2073
  if (d) {
2026
2074
  const u = this.ctx.icons.get("loading");
2027
- n = "loading", r = u, o = x * 8;
2075
+ n = "loading", o = u, r = x * 8;
2028
2076
  } else if (f) {
2029
2077
  const u = this.ctx.icons.get("expand"), y = this.ctx.icons.get("shrink");
2030
- r = h ? y : u, n = h ? "shrink" : "expand", o = x * 8;
2078
+ o = h ? y : u, n = h ? "shrink" : "expand", r = x * 8;
2031
2079
  } else
2032
- o = x * 8;
2033
- if (r) {
2034
- let u = 20, y = 20, g = this.drawX + o + e, w = this.drawY + (this.visibleHeight - y) / 2 + 2;
2035
- this.ctx.paint.drawImage(r, g, w, u, y), this.drawImageX = g, this.drawImageY = w, this.drawImageWidth = u, this.drawImageHeight = y, this.drawImageName = n, this.drawImageSource = r, this.align = "left", this.drawTextX = o + this.drawX + u + 0.5;
2080
+ r = x * 8;
2081
+ if (o) {
2082
+ let u = 20, y = 20, g = this.drawX + r + e, w = this.drawY + (this.visibleHeight - y) / 2 + 2;
2083
+ this.ctx.paint.drawImage(o, g, w, u, y), this.drawImageX = g, this.drawImageY = w, this.drawImageWidth = u, this.drawImageHeight = y, this.drawImageName = n, this.drawImageSource = o, this.align = "left", this.drawTextX = r + this.drawX + u + 0.5;
2036
2084
  }
2037
2085
  }
2038
2086
  }
@@ -2041,8 +2089,8 @@ class Qt extends Jt {
2041
2089
  BODY_BG_COLOR: e,
2042
2090
  EDIT_BG_COLOR: i,
2043
2091
  BODY_CELL_STYLE_METHOD: s,
2044
- FOOTER_CELL_STYLE_METHOD: r,
2045
- READONLY_TEXT_COLOR: o,
2092
+ FOOTER_CELL_STYLE_METHOD: o,
2093
+ READONLY_TEXT_COLOR: r,
2046
2094
  FOOTER_BG_COLOR: n,
2047
2095
  HIGHLIGHT_SELECTED_ROW: l,
2048
2096
  HIGHLIGHT_SELECTED_ROW_COLOR: h,
@@ -2050,9 +2098,9 @@ class Qt extends Jt {
2050
2098
  HIGHLIGHT_HOVER_ROW_COLOR: d
2051
2099
  } = this.ctx.config;
2052
2100
  if (this.cellType === "footer") {
2053
- let p = n, E = o;
2054
- if (typeof r == "function") {
2055
- const m = r, { backgroundColor: b, color: C } = m({
2101
+ let p = n, E = r;
2102
+ if (typeof o == "function") {
2103
+ const m = o, { backgroundColor: b, color: C } = m({
2056
2104
  row: this.row,
2057
2105
  rowIndex: this.rowIndex,
2058
2106
  colIndex: this.colIndex,
@@ -2067,12 +2115,12 @@ class Qt extends Jt {
2067
2115
  let x = "transparent";
2068
2116
  const u = this.ctx.focusCell, y = this.ctx.hoverCell;
2069
2117
  f && (y == null ? void 0 : y.rowKey) === this.rowKey && (x = d), l && (u == null ? void 0 : u.rowKey) === this.rowKey && (x = h), this.drawCellSkyBgColor = x;
2070
- let g = e, w = o;
2118
+ let g = e, w = r;
2071
2119
  if (["index", "index-selection", "selection"].includes(this.type)) {
2072
- this.drawCellBgColor = e, this.drawTextColor = o;
2120
+ this.drawCellBgColor = e, this.drawTextColor = r;
2073
2121
  return;
2074
2122
  }
2075
- if (this.ctx.database.getReadonly(this.rowKey, this.key) || (g = i, w = o), typeof s == "function") {
2123
+ if (this.ctx.database.getReadonly(this.rowKey, this.key) || (g = i, w = r), typeof s == "function") {
2076
2124
  const p = s, { backgroundColor: E, color: m } = p({
2077
2125
  row: this.row,
2078
2126
  rowIndex: this.rowIndex,
@@ -2085,8 +2133,8 @@ class Qt extends Jt {
2085
2133
  this.drawCellBgColor = g, this.drawTextColor = w;
2086
2134
  }
2087
2135
  updateSelection() {
2088
- const { visibleWidth: e, visibleHeight: i, rowspan: s, colspan: r, cellType: o, type: n, rowIndex: l, rowKey: h } = this;
2089
- if (!(s === 0 || r === 0) && o !== "footer" && ["index-selection", "selection"].includes(n)) {
2136
+ const { visibleWidth: e, visibleHeight: i, rowspan: s, colspan: o, cellType: r, type: n, rowIndex: l, rowKey: h } = this;
2137
+ if (!(s === 0 || o === 0) && r !== "footer" && ["index-selection", "selection"].includes(n)) {
2090
2138
  const f = this.ctx.database.getRowSelection(h), d = this.ctx.database.getRowSelectable(h), { CHECKBOX_SIZE: x = 0 } = this.ctx.config, u = this.drawX + (e - x) / 2, y = this.drawY + (i - x) / 2;
2091
2139
  let g = this.ctx.icons.get("checkbox-uncheck"), w = "checkbox-uncheck";
2092
2140
  f && d ? (g = this.ctx.icons.get("checkbox-check"), w = "checkbox-check") : f && d ? (g = this.ctx.icons.get("checkbox-check-disabled"), w = "checkbox-check-disabled") : !f && d ? (g = this.ctx.icons.get("checkbox-uncheck"), w = "checkbox-uncheck") : (g = this.ctx.icons.get("checkbox-disabled"), w = "checkbox-disabled"), g && n == "index-selection" ? (this.ctx.hoverCell && this.ctx.hoverCell.rowIndex === l || ["checkbox-disabled", "checkbox-check"].includes(w)) && (this.drawImageX = u, this.drawImageY = y, this.drawImageWidth = x, this.drawImageHeight = x, this.drawImageName = w, this.drawImageSource = g) : g && n === "selection" && (this.drawImageX = u, this.drawImageY = y, this.drawImageWidth = x, this.drawImageHeight = x, this.drawImageName = w, this.drawImageSource = g);
@@ -2104,10 +2152,10 @@ class Qt extends Jt {
2104
2152
  });
2105
2153
  l !== void 0 && (this.hoverIconName = l);
2106
2154
  }
2107
- const r = this.drawX + this.width - i - s, o = this.drawY + (this.height - i) / 2;
2155
+ const o = this.drawX + this.width - i - s, r = this.drawY + (this.height - i) / 2;
2108
2156
  if (this.hoverIconName && this.ctx.hoverCell && this.ctx.hoverCell.rowIndex === this.rowIndex) {
2109
2157
  const n = this.ctx.icons.get(this.hoverIconName);
2110
- this.drawImageX = r, this.drawImageY = o, this.drawImageWidth = i, this.drawImageHeight = i, this.drawImageName = this.hoverIconName, this.drawImageSource = n;
2158
+ this.drawImageX = o, this.drawImageY = r, this.drawImageWidth = i, this.drawImageHeight = i, this.drawImageName = this.hoverIconName, this.drawImageSource = n;
2111
2159
  }
2112
2160
  }
2113
2161
  /**
@@ -2163,11 +2211,11 @@ class Qt extends Jt {
2163
2211
  const {
2164
2212
  paint: e,
2165
2213
  config: { BORDER_COLOR: i }
2166
- } = this.ctx, { drawX: s, drawY: r } = this;
2167
- e.drawRect(s, r, this.visibleWidth, this.visibleHeight, {
2214
+ } = this.ctx, { drawX: s, drawY: o } = this;
2215
+ e.drawRect(s, o, this.visibleWidth, this.visibleHeight, {
2168
2216
  borderColor: i,
2169
2217
  fillColor: this.drawCellBgColor
2170
- }), e.drawRect(s, r, this.width, this.height, {
2218
+ }), e.drawRect(s, o, this.width, this.height, {
2171
2219
  borderColor: "transparent",
2172
2220
  borderWidth: 1,
2173
2221
  fillColor: this.drawCellSkyBgColor
@@ -2181,9 +2229,9 @@ class Qt extends Jt {
2181
2229
  if (i === 0)
2182
2230
  return 0;
2183
2231
  let s = 0;
2184
- for (let r = e; r < e + i; r++) {
2185
- const o = this.ctx.header.leafCellHeaders[r];
2186
- s += o.width;
2232
+ for (let o = e; o < e + i; o++) {
2233
+ const r = this.ctx.header.leafCellHeaders[o];
2234
+ s += r.width;
2187
2235
  }
2188
2236
  return s;
2189
2237
  }
@@ -2219,7 +2267,7 @@ class Qt extends Jt {
2219
2267
  const { SELECT_BORDER_COLOR: e, ENABLE_AUTOFILL: i, ENABLE_SELECTOR: s } = this.ctx.config;
2220
2268
  if (!s || !i)
2221
2269
  return;
2222
- const { xArr: r, yArr: o } = this.ctx.selector, n = r[1], l = o[1], { colIndex: h, rowIndex: f, drawX: d, drawY: x } = this;
2270
+ const { xArr: o, yArr: r } = this.ctx.selector, n = o[1], l = r[1], { colIndex: h, rowIndex: f, drawX: d, drawY: x } = this;
2223
2271
  h === n && f === l && this.ctx.paint.drawRect(d + this.width - 6, x + this.height - 6, 6, 6, {
2224
2272
  borderColor: "#fff",
2225
2273
  fillColor: e
@@ -2231,10 +2279,10 @@ class Qt extends Jt {
2231
2279
  const { ENABLE_SELECTOR: e } = this.ctx.config;
2232
2280
  if (!e)
2233
2281
  return;
2234
- const { xArr: i, yArr: s, xArrCopy: r, yArrCopy: o } = this.ctx.selector;
2282
+ const { xArr: i, yArr: s, xArrCopy: o, yArrCopy: r } = this.ctx.selector;
2235
2283
  this.drawBorder({
2236
- xArr: r,
2237
- yArr: o,
2284
+ xArr: o,
2285
+ yArr: r,
2238
2286
  borderColor: this.ctx.config.SELECT_BORDER_COLOR || "rgb(82,146,247)",
2239
2287
  fillColor: this.ctx.config.SELECT_AREA_COLOR || "rgba(82,146,247,0.1)",
2240
2288
  borderWidth: 1,
@@ -2257,13 +2305,13 @@ class Qt extends Jt {
2257
2305
  drawErrorTip() {
2258
2306
  if (this.cellType === "footer" || !this.message)
2259
2307
  return;
2260
- const { ERROR_TIP_ICON_SIZE: e, ERROR_TIP_COLOR: i } = this.ctx.config, { width: s } = this, r = this.drawX, o = this.drawY, n = [
2261
- r + s - e - 0.5,
2262
- o,
2263
- r + s - 0.5,
2264
- o,
2265
- r + s - 0.5,
2266
- o + e
2308
+ const { ERROR_TIP_ICON_SIZE: e, ERROR_TIP_COLOR: i } = this.ctx.config, { width: s } = this, o = this.drawX, r = this.drawY, n = [
2309
+ o + s - e - 0.5,
2310
+ r,
2311
+ o + s - 0.5,
2312
+ r,
2313
+ o + s - 0.5,
2314
+ r + e
2267
2315
  ];
2268
2316
  this.ctx.paint.drawLine(n, {
2269
2317
  borderColor: i,
@@ -2274,32 +2322,32 @@ class Qt extends Jt {
2274
2322
  });
2275
2323
  }
2276
2324
  drawBorder(e) {
2277
- const { drawX: i, drawY: s, width: r, rowIndex: o, colIndex: n } = this, l = i + 0.5;
2325
+ const { drawX: i, drawY: s, width: o, rowIndex: r, colIndex: n } = this, l = i + 0.5;
2278
2326
  let h = s + 0.5, f = this.height;
2279
- o === 0 && (h = this.y + 1, f = f - 1);
2327
+ r === 0 && (h = this.y + 1, f = f - 1);
2280
2328
  const { xArr: d, yArr: x, lineDash: u = [], borderWidth: y = 1, borderColor: g, fillColor: w } = e, p = d[0], E = d[1], m = x[0], b = x[1];
2281
- n >= p && n <= E && o === m && this.ctx.paint.drawLine([l, h, l + r - 2, h], {
2329
+ n >= p && n <= E && r === m && this.ctx.paint.drawLine([l, h, l + o - 2, h], {
2282
2330
  borderColor: g,
2283
2331
  fillColor: w,
2284
2332
  borderWidth: y,
2285
2333
  lineCap: "round",
2286
2334
  lineJoin: "round",
2287
2335
  lineDash: u
2288
- }), n >= p && n <= E && o === b && this.ctx.paint.drawLine([l, h + f - 1.5, l + r, h + f - 1.5], {
2336
+ }), n >= p && n <= E && r === b && this.ctx.paint.drawLine([l, h + f - 1.5, l + o, h + f - 1.5], {
2289
2337
  borderColor: g,
2290
2338
  fillColor: w,
2291
2339
  borderWidth: y,
2292
2340
  lineCap: "round",
2293
2341
  lineJoin: "round",
2294
2342
  lineDash: u
2295
- }), n === p && o >= m && o <= b && this.ctx.paint.drawLine([l, h, l, h + f - 1], {
2343
+ }), n === p && r >= m && r <= b && this.ctx.paint.drawLine([l, h, l, h + f - 1], {
2296
2344
  borderColor: g,
2297
2345
  fillColor: w,
2298
2346
  borderWidth: y,
2299
2347
  lineCap: "round",
2300
2348
  lineJoin: "round",
2301
2349
  lineDash: u
2302
- }), n === E && o >= m && o <= b && this.ctx.paint.drawLine([l + r - 1, h, l + r - 1, h + f - 1], {
2350
+ }), n === E && r >= m && r <= b && this.ctx.paint.drawLine([l + o - 1, h, l + o - 1, h + f - 1], {
2303
2351
  borderColor: g,
2304
2352
  fillColor: w,
2305
2353
  borderWidth: y,
@@ -2309,14 +2357,15 @@ class Qt extends Jt {
2309
2357
  });
2310
2358
  }
2311
2359
  }
2312
- class te extends Jt {
2313
- constructor(e, i, s, r, o, n, l) {
2314
- super(e, s, r, o, n, l.fixed, "header");
2360
+ class ie extends te {
2361
+ constructor(e, i, s, o, r, n, l) {
2362
+ super(e, s, o, r, n, l.fixed, "header");
2315
2363
  c(this, "align");
2316
2364
  c(this, "verticalAlign", "middle");
2317
2365
  c(this, "fixed");
2318
2366
  c(this, "widthFillDisable");
2319
2367
  c(this, "type");
2368
+ c(this, "operation", !1);
2320
2369
  c(this, "editorType");
2321
2370
  c(this, "level");
2322
2371
  c(this, "text");
@@ -2344,7 +2393,7 @@ class te extends Jt {
2344
2393
  c(this, "drawImageHeight", 0);
2345
2394
  c(this, "drawImageName", "");
2346
2395
  c(this, "drawImageSource");
2347
- this.ctx = e, this.x = s, this.y = r, this.width = o, this.height = n, this.colIndex = i, this.key = l.key, this.type = l.type, this.editorType = l.editorType || "text", this.align = l.align || "center", this.verticalAlign = l.verticalAlign || "middle", this.fixed = l.fixed, this.level = l.level, this.text = l.title, this.column = l, this.colspan = l.colspan, this.widthFillDisable = l.widthFillDisable, this.rowspan = l.rowspan, this.rules = l.rules, this.readonly = l.readonly, this.required = l.required, this.rowKey = At(), this.hasChildren = l.children && l.children.length > 0 || !1, this.render = l.renderHeader;
2396
+ this.ctx = e, this.x = s, this.y = o, this.width = r, this.height = n, this.colIndex = i, this.key = l.key, this.type = l.type, this.editorType = l.editorType || "text", this.align = l.align || "center", this.verticalAlign = l.verticalAlign || "middle", this.fixed = l.fixed, this.level = l.level, this.operation = l.operation || !1, this.text = l.title, this.column = l, this.colspan = l.colspan, this.widthFillDisable = l.widthFillDisable, this.rowspan = l.rowspan, this.rules = l.rules, this.readonly = l.readonly, this.required = l.required, this.rowKey = At(), this.hasChildren = l.children && l.children.length > 0 || !1, this.render = l.renderHeader;
2348
2397
  }
2349
2398
  /**
2350
2399
  * 是否可见,覆盖基类方法,表头是跟y滚动条没有关系的所以不需要加滚动参数
@@ -2362,15 +2411,15 @@ class te extends Jt {
2362
2411
  }
2363
2412
  updateContainer() {
2364
2413
  const { HEADER_CELL_STYLE_METHOD: e, HEADER_BG_COLOR: i, HEADER_TEXT_COLOR: s } = this.ctx.config;
2365
- let r = i, o = s;
2414
+ let o = i, r = s;
2366
2415
  if (typeof e == "function") {
2367
2416
  const n = e, { backgroundColor: l, color: h } = n({
2368
2417
  colIndex: this.colIndex,
2369
2418
  column: this.column
2370
2419
  }) || {};
2371
- l && (r = l), h && (o = h);
2420
+ l && (o = l), h && (r = h);
2372
2421
  }
2373
- this.drawCellBgColor = r, this.drawTextColor = o;
2422
+ this.drawCellBgColor = o, this.drawTextColor = r;
2374
2423
  }
2375
2424
  update() {
2376
2425
  this.updateContainer(), this.displayText = this.getText(), this.drawX = this.getDrawX(), this.drawY = this.getDrawY(), this.updateStyle();
@@ -2378,13 +2427,13 @@ class te extends Jt {
2378
2427
  draw() {
2379
2428
  const {
2380
2429
  paint: e,
2381
- config: { BORDER_COLOR: i, CELL_PADDING: s, HEADER_FONT: r }
2382
- } = this.ctx, { drawX: o, drawY: n, displayText: l } = this;
2383
- e.drawRect(o, n, this.width, this.height, {
2430
+ config: { BORDER_COLOR: i, CELL_PADDING: s, HEADER_FONT: o }
2431
+ } = this.ctx, { drawX: r, drawY: n, displayText: l } = this;
2432
+ e.drawRect(r, n, this.width, this.height, {
2384
2433
  borderColor: i,
2385
2434
  fillColor: this.drawCellBgColor
2386
- }), e.drawText(l, o, n, this.width, this.height, {
2387
- font: r,
2435
+ }), e.drawText(l, r, n, this.width, this.height, {
2436
+ font: o,
2388
2437
  padding: s,
2389
2438
  color: this.drawTextColor,
2390
2439
  align: this.align,
@@ -2394,9 +2443,9 @@ class te extends Jt {
2394
2443
  drawSelection() {
2395
2444
  const { width: e, height: i, type: s } = this;
2396
2445
  if (["index-selection", "selection"].includes(s)) {
2397
- const { indeterminate: r, check: o, selectable: n } = this.ctx.database.getCheckedState(), { CHECKBOX_SIZE: l = 0 } = this.ctx.config, h = this.drawX + (e - l) / 2, f = this.drawY + (i - l) / 2;
2446
+ const { indeterminate: o, check: r, selectable: n } = this.ctx.database.getCheckedState(), { CHECKBOX_SIZE: l = 0 } = this.ctx.config, h = this.drawX + (e - l) / 2, f = this.drawY + (i - l) / 2;
2398
2447
  let d = this.ctx.icons.get("checkbox-uncheck"), x = "checkbox-uncheck";
2399
- r ? (d = this.ctx.icons.get("checkbox-indeterminate"), x = "checkbox-indeterminate") : o && n ? (d = this.ctx.icons.get("checkbox-check"), x = "checkbox-check") : o && n ? (d = this.ctx.icons.get("checkbox-check-disabled"), x = "checkbox-check-disabled") : !o && n ? (d = this.ctx.icons.get("checkbox-uncheck"), x = "checkbox-uncheck") : (d = this.ctx.icons.get("checkbox-disabled"), x = "checkbox-disabled"), d && (this.drawImageX = h, this.drawImageY = f, this.drawImageWidth = l, this.drawImageHeight = l, this.drawImageName = x, this.drawImageSource = d, this.ctx.paint.drawImage(
2448
+ o ? (d = this.ctx.icons.get("checkbox-indeterminate"), x = "checkbox-indeterminate") : r && n ? (d = this.ctx.icons.get("checkbox-check"), x = "checkbox-check") : r && n ? (d = this.ctx.icons.get("checkbox-check-disabled"), x = "checkbox-check-disabled") : !r && n ? (d = this.ctx.icons.get("checkbox-uncheck"), x = "checkbox-uncheck") : (d = this.ctx.icons.get("checkbox-disabled"), x = "checkbox-disabled"), d && (this.drawImageX = h, this.drawImageY = f, this.drawImageWidth = l, this.drawImageHeight = l, this.drawImageName = x, this.drawImageSource = d, this.ctx.paint.drawImage(
2400
2449
  this.drawImageSource,
2401
2450
  this.drawImageX,
2402
2451
  this.drawImageY,
@@ -2424,7 +2473,7 @@ class te extends Jt {
2424
2473
  };
2425
2474
  }
2426
2475
  }
2427
- class si {
2476
+ class ci {
2428
2477
  constructor(t) {
2429
2478
  c(this, "ctx");
2430
2479
  c(this, "visibleHoverCell");
@@ -2438,16 +2487,16 @@ class si {
2438
2487
  if (t.button !== 0 || this.isBusy(t))
2439
2488
  return;
2440
2489
  const e = t.offsetY, i = t.offsetX, s = this.ctx.header.renderCellHeaders;
2441
- for (const o of s) {
2442
- const n = o.getDrawX(), l = o.getDrawY();
2443
- if (i > n && i < n + o.width && e > l && e < l + o.height) {
2444
- this.ctx.focusCellHeader = o, this.ctx.emit("cellHeaderMousedown", o, t);
2490
+ for (const r of s) {
2491
+ const n = r.getDrawX(), l = r.getDrawY();
2492
+ if (i > n && i < n + r.width && e > l && e < l + r.height) {
2493
+ this.ctx.focusCellHeader = r, this.ctx.emit("cellHeaderMousedown", r, t);
2445
2494
  return;
2446
2495
  }
2447
2496
  }
2448
- const r = this.ctx.body.renderRows;
2449
- for (const o of r) {
2450
- const n = o.fixedCells.concat(o.noFixedCells);
2497
+ const o = this.ctx.body.renderRows;
2498
+ for (const r of o) {
2499
+ const n = r.fixedCells.concat(r.noFixedCells);
2451
2500
  for (const l of n) {
2452
2501
  const h = l.getDrawX(), f = l.getDrawY();
2453
2502
  if (i > h && i < h + l.width && e > f && e < f + l.height) {
@@ -2460,16 +2509,16 @@ class si {
2460
2509
  if (t.button !== 0 || this.isBusy(t))
2461
2510
  return;
2462
2511
  const e = t.offsetY, i = t.offsetX, s = this.ctx.header.renderCellHeaders;
2463
- for (const o of s) {
2464
- const n = o.getDrawX(), l = o.getDrawY();
2465
- if (i > n && i < n + o.width && e > l && e < l + o.height) {
2466
- this.ctx.clickCellHeader = o, this.ctx.emit("cellHeaderClick", o, t), this.selectionClick(o);
2512
+ for (const r of s) {
2513
+ const n = r.getDrawX(), l = r.getDrawY();
2514
+ if (i > n && i < n + r.width && e > l && e < l + r.height) {
2515
+ this.ctx.clickCellHeader = r, this.ctx.emit("cellHeaderClick", r, t), this.selectionClick(r);
2467
2516
  return;
2468
2517
  }
2469
2518
  }
2470
- const r = this.ctx.body.renderRows;
2471
- for (const o of r) {
2472
- const n = o.fixedCells.concat(o.noFixedCells);
2519
+ const o = this.ctx.body.renderRows;
2520
+ for (const r of o) {
2521
+ const n = r.fixedCells.concat(r.noFixedCells);
2473
2522
  for (const l of n) {
2474
2523
  const h = l.getDrawX(), f = l.getDrawY();
2475
2524
  if (i > h && i < h + l.width && e > f && e < f + l.height) {
@@ -2482,16 +2531,16 @@ class si {
2482
2531
  if (this.isBusy(t))
2483
2532
  return;
2484
2533
  const e = t.offsetY, i = t.offsetX, s = this.ctx.header.renderCellHeaders;
2485
- for (const o of s) {
2486
- const n = o.getDrawX(), l = o.getDrawY();
2487
- if (i > n && i < n + o.width && e > l && e < l + o.height) {
2488
- this.ctx.emit("cellHeaderContextMenuClick", o, t);
2534
+ for (const r of s) {
2535
+ const n = r.getDrawX(), l = r.getDrawY();
2536
+ if (i > n && i < n + r.width && e > l && e < l + r.height) {
2537
+ this.ctx.emit("cellHeaderContextMenuClick", r, t);
2489
2538
  return;
2490
2539
  }
2491
2540
  }
2492
- const r = this.ctx.body.renderRows;
2493
- for (const o of r) {
2494
- const n = o.fixedCells.concat(o.noFixedCells);
2541
+ const o = this.ctx.body.renderRows;
2542
+ for (const r of o) {
2543
+ const n = r.fixedCells.concat(r.noFixedCells);
2495
2544
  for (const l of n) {
2496
2545
  const h = l.getDrawX(), f = l.getDrawY();
2497
2546
  if (i > h && i < h + l.width && e > f && e < f + l.height) {
@@ -2501,7 +2550,7 @@ class si {
2501
2550
  }
2502
2551
  }
2503
2552
  }), this.ctx.on("mousemove", (t) => {
2504
- var o;
2553
+ var r;
2505
2554
  if (this.isBusy(t))
2506
2555
  return;
2507
2556
  const e = t.offsetY, i = t.offsetX, s = this.ctx.header.renderCellHeaders;
@@ -2514,14 +2563,14 @@ class si {
2514
2563
  return;
2515
2564
  }
2516
2565
  }
2517
- const r = this.ctx.body.renderRows;
2518
- for (const n of r) {
2566
+ const o = this.ctx.body.renderRows;
2567
+ for (const n of o) {
2519
2568
  const l = n.fixedCells.concat(n.noFixedCells);
2520
2569
  for (const h of l) {
2521
2570
  const f = h.getDrawX(), d = h.getDrawY();
2522
2571
  if (i > f && i < f + h.visibleWidth && e > d && e < d + h.visibleHeight && (this.imageEnterAndLeave(h, t), this.visibleHoverCell !== h && (this.ctx.emit("visibleCellMouseleave", h, t), this.visibleHoverCell = h, this.ctx.emit("visibleCellHoverChange", h, t))), i > f && i < f + h.width && e > d && e < d + h.height) {
2523
2572
  if (this.ctx.emit("cellMouseenter", h, t), this.ctx.hoverCell && this.ctx.hoverCell !== h && this.ctx.emit("cellMouseleave", this.ctx.hoverCell, t), this.ctx.hoverCell === h) return;
2524
- ((o = this.ctx.hoverCell) == null ? void 0 : o.rowKey) !== h.rowKey && (this.ctx.hoverCell = h, this.ctx.hoverRow = this.ctx.body.renderRows.find((x) => x.rowKey === h.rowKey), this.ctx.emit("rowHoverChange", this.ctx.hoverRow, h, t), this.ctx.emit("draw")), this.ctx.hoverCell = h, this.ctx.emit("cellHoverChange", h, t);
2573
+ ((r = this.ctx.hoverCell) == null ? void 0 : r.rowKey) !== h.rowKey && (this.ctx.hoverCell = h, this.ctx.hoverRow = this.ctx.body.renderRows.find((x) => x.rowKey === h.rowKey), this.ctx.emit("rowHoverChange", this.ctx.hoverRow, h, t), this.ctx.emit("draw")), this.ctx.hoverCell = h, this.ctx.emit("cellHoverChange", h, t);
2525
2574
  return;
2526
2575
  }
2527
2576
  }
@@ -2534,7 +2583,7 @@ class si {
2534
2583
  */
2535
2584
  selectionClick(t) {
2536
2585
  if (["selection", "index-selection"].includes(t.type) && this.ctx.isPointer)
2537
- if (t instanceof te)
2586
+ if (t instanceof ie)
2538
2587
  t.drawImageName === "checkbox-uncheck" || t.drawImageName === "checkbox-indeterminate" ? this.ctx.database.toggleAllSelection() : t.drawImageName === "checkbox-check" && this.ctx.database.clearSelection();
2539
2588
  else {
2540
2589
  if (!this.ctx.database.getRowSelectable(t.rowKey))
@@ -2548,9 +2597,9 @@ class si {
2548
2597
  */
2549
2598
  treeClick(t) {
2550
2599
  if (t.type === "tree" && this.ctx.isPointer) {
2551
- const e = this.ctx.database.getRowForRowKey(t.rowKey), { expand: i = !1, expandLazy: s = !1 } = e || {}, { EXPAND_LAZY: r, EXPAND_LAZY_METHOD: o } = this.ctx.config;
2552
- if (r && o && !i && !s)
2553
- typeof o == "function" && (this.ctx.database.expandLoading(t.rowKey, !0), o({
2600
+ const e = this.ctx.database.getRowForRowKey(t.rowKey), { expand: i = !1, expandLazy: s = !1 } = e || {}, { EXPAND_LAZY: o, EXPAND_LAZY_METHOD: r } = this.ctx.config;
2601
+ if (o && r && !i && !s)
2602
+ typeof r == "function" && (this.ctx.database.expandLoading(t.rowKey, !0), r({
2554
2603
  row: t.row,
2555
2604
  rowIndex: t.rowIndex,
2556
2605
  colIndex: t.colIndex,
@@ -2574,7 +2623,7 @@ class si {
2574
2623
  */
2575
2624
  imageEnterAndLeave(t, e) {
2576
2625
  const i = e.offsetY, s = e.offsetX;
2577
- s > t.drawImageX && s < t.drawImageX + t.drawImageWidth && i > t.drawImageY && i < t.drawImageY + t.drawImageHeight ? (this.ctx.target.style.cursor = "pointer", this.ctx.isPointer = !0, t instanceof Qt && ["selection", "index-selection"].includes(t.type) && (this.ctx.database.getRowSelectable(t.rowKey) || (this.ctx.target.style.cursor = "not-allowed"))) : (this.ctx.isPointer = !1, this.ctx.target.style.cursor === "pointer" && (this.ctx.target.style.cursor = "default"));
2626
+ s > t.drawImageX && s < t.drawImageX + t.drawImageWidth && i > t.drawImageY && i < t.drawImageY + t.drawImageHeight ? (this.ctx.target.style.cursor = "pointer", this.ctx.isPointer = !0, t instanceof ee && ["selection", "index-selection"].includes(t.type) && (this.ctx.database.getRowSelectable(t.rowKey) || (this.ctx.target.style.cursor = "not-allowed"))) : (this.ctx.isPointer = !1, this.ctx.target.style.cursor === "pointer" && (this.ctx.target.style.cursor = "default"));
2578
2627
  }
2579
2628
  isBusy(t) {
2580
2629
  const e = t.offsetY, i = t.offsetX;
@@ -2587,7 +2636,7 @@ class si {
2587
2636
  this.resizeObserver.unobserve(this.ctx.target);
2588
2637
  }
2589
2638
  }
2590
- class ri {
2639
+ class li {
2591
2640
  constructor(t, e, i) {
2592
2641
  c(this, "eventBus");
2593
2642
  c(this, "eventBrowser");
@@ -2678,10 +2727,10 @@ class ri {
2678
2727
  c(this, "database");
2679
2728
  c(this, "history");
2680
2729
  c(this, "config");
2681
- this.target = e, this.targetContainer = t, this.target.setAttribute("uuid", this.uuid), this.config = new Bt(i.config || {}), this.eventBus = new ti(), this.eventBrowser = new Qe(this), this.eventTable = new si(this), this.paint = new ei(e), this.database = new Ze(this, i), this.history = new Je(this), this.icons = new ii(this);
2730
+ this.target = e, this.targetContainer = t, this.target.setAttribute("uuid", this.uuid), this.config = new Pt(i.config || {}), this.eventBus = new oi(), this.eventBrowser = new ri(this), this.eventTable = new ci(this), this.paint = new ni(e), this.database = new ii(this, i), this.history = new si(this), this.icons = new ai(this);
2682
2731
  }
2683
2732
  setConfig(t) {
2684
- this.config = new Bt(t);
2733
+ this.config = new Pt(t);
2685
2734
  }
2686
2735
  setFocusCell(t) {
2687
2736
  var e;
@@ -2710,13 +2759,13 @@ class ri {
2710
2759
  getSelectedData() {
2711
2760
  const t = [], e = this.selector.yArr, i = this.selector.xArr;
2712
2761
  let s = "";
2713
- for (let r = 0; r <= e[1] - e[0]; r++) {
2714
- const o = [];
2762
+ for (let o = 0; o <= e[1] - e[0]; o++) {
2763
+ const r = [];
2715
2764
  for (let n = 0; n <= i[1] - i[0]; n++) {
2716
- const l = r + e[0], h = n + i[0], f = this.database.getItemValueForRowIndexAndColIndex(l, h);
2717
- f && o.push(f.value);
2765
+ const l = o + e[0], h = n + i[0], f = this.database.getItemValueForRowIndexAndColIndex(l, h);
2766
+ f && r.push(f.value);
2718
2767
  }
2719
- s += `${o.join(" ")}\r`, t.push(o);
2768
+ s += `${r.join(" ")}\r`, t.push(r);
2720
2769
  }
2721
2770
  return s = s ? s.replace(/\r$/, "") : " ", {
2722
2771
  xArr: i,
@@ -2729,9 +2778,9 @@ class ri {
2729
2778
  let i = Math.floor(t);
2730
2779
  const s = this.body.width - this.body.visibleWidth;
2731
2780
  i < 0 ? i = 0 : i > s && (i = s);
2732
- let r = Math.floor(e);
2733
- const o = this.body.height - this.body.visibleHeight - this.footer.height;
2734
- r < 0 ? r = 0 : r > o && (r = o), this.emit("setScroll", i, r);
2781
+ let o = Math.floor(e);
2782
+ const r = this.body.height - this.body.visibleHeight - this.footer.height;
2783
+ o < 0 ? o = 0 : o > r && (o = r), this.emit("setScroll", i, o);
2735
2784
  }
2736
2785
  setScrollX(t) {
2737
2786
  let e = Math.floor(t);
@@ -2767,7 +2816,7 @@ class ri {
2767
2816
  this.eventTable.destroy(), this.eventBrowser.destroy(), this.eventBus.destroy();
2768
2817
  }
2769
2818
  }
2770
- class Wt {
2819
+ class Vt {
2771
2820
  constructor(t, e) {
2772
2821
  c(this, "ctx");
2773
2822
  c(this, "type");
@@ -2798,13 +2847,13 @@ class Wt {
2798
2847
  this.updateScroll(t);
2799
2848
  }
2800
2849
  onMouseDown(t) {
2801
- const { offsetX: e, offsetY: i, clientX: s, clientY: r } = t;
2802
- if (!(s == this.clientX && r == this.clientY)) {
2850
+ const { offsetX: e, offsetY: i, clientX: s, clientY: o } = t;
2851
+ if (!(s == this.clientX && o == this.clientY)) {
2803
2852
  if (this.isOnScrollbar(e, i))
2804
- this.clientX = s, this.clientY = r, this.isDragging = !0, this.ctx.scrollerMove = !0, this.isFocus = !0, this.dragStart = this.scroll;
2853
+ this.clientX = s, this.clientY = o, this.isDragging = !0, this.ctx.scrollerMove = !0, this.isFocus = !0, this.dragStart = this.scroll;
2805
2854
  else if (this.isOnTrack(e, i)) {
2806
- let o = 0;
2807
- this.type === "vertical" ? o = (i - this.ctx.header.height - this.barHeight / 2) / (this.visibleDistance - this.barHeight) * this.distance : o = (e - this.barWidth / 2) / (this.visibleDistance - this.barWidth) * this.distance, this.scroll = Math.max(0, Math.min(o, this.distance));
2855
+ let r = 0;
2856
+ this.type === "vertical" ? r = (i - this.ctx.header.height - this.barHeight / 2) / (this.visibleDistance - this.barHeight) * this.distance : r = (e - this.barWidth / 2) / (this.visibleDistance - this.barWidth) * this.distance, this.scroll = Math.max(0, Math.min(r, this.distance));
2808
2857
  }
2809
2858
  }
2810
2859
  }
@@ -2812,16 +2861,16 @@ class Wt {
2812
2861
  this.isDragging = !1, this.isFocus = !1, this.clientX = 0, this.clientY = 0;
2813
2862
  }
2814
2863
  onMouseMove(t) {
2815
- const { offsetX: e, offsetY: i, clientX: s, clientY: r } = t;
2816
- if (this.isOnScrollbar(e, i) && t.target === this.ctx.target ? this.isFocus = !0 : this.isFocus = !1, s == this.clientX && r == this.clientY) return;
2817
- let o = 0;
2818
- if (this.type === "horizontal" ? o = s - this.clientX : o = r - this.clientY, this.isDragging && o !== 0) {
2864
+ const { offsetX: e, offsetY: i, clientX: s, clientY: o } = t;
2865
+ if (this.isOnScrollbar(e, i) && t.target === this.ctx.target ? this.isFocus = !0 : this.isFocus = !1, s == this.clientX && o == this.clientY) return;
2866
+ let r = 0;
2867
+ if (this.type === "horizontal" ? r = s - this.clientX : r = o - this.clientY, this.isDragging && r !== 0) {
2819
2868
  let n = 0;
2820
- this.type === "vertical" ? n = this.dragStart + o / (this.visibleDistance - this.barHeight) * this.distance : n = this.dragStart + o / (this.visibleDistance - this.barWidth) * this.distance, this.scroll = Math.max(0, Math.min(n, this.distance));
2869
+ this.type === "vertical" ? n = this.dragStart + r / (this.visibleDistance - this.barHeight) * this.distance : n = this.dragStart + r / (this.visibleDistance - this.barWidth) * this.distance, this.scroll = Math.max(0, Math.min(n, this.distance));
2821
2870
  }
2822
2871
  }
2823
- isPointInElement(t, e, i, s, r, o) {
2824
- return t >= i && t <= i + r && e >= s && e <= s + o;
2872
+ isPointInElement(t, e, i, s, o, r) {
2873
+ return t >= i && t <= i + o && e >= s && e <= s + r;
2825
2874
  }
2826
2875
  isOnScrollbar(t, e) {
2827
2876
  return this.isPointInElement(t, e, this.barX, this.barY, this.barWidth, this.barHeight);
@@ -2838,19 +2887,19 @@ class Wt {
2838
2887
  body: t,
2839
2888
  header: e,
2840
2889
  config: { SCROLLER_TRACK_SIZE: i = 0, SCROLLER_SIZE: s = 0 }
2841
- } = this.ctx, r = this.ctx.target.width + 1, o = this.ctx.target.height, n = e.height, l = e.width, h = t.height, f = this.ctx.footer.height;
2890
+ } = this.ctx, o = this.ctx.target.width + 1, r = this.ctx.target.height, n = e.height, l = e.width, h = t.height, f = this.ctx.footer.height;
2842
2891
  if (this.type === "vertical") {
2843
- this.visibleDistance = o - i - n, this.distance = h - this.visibleDistance + f, this.trackX = r - i, this.trackY = 0, this.splitPoints = [this.trackX, n, this.trackX + i, n], this.trackWidth = i, this.trackHeight = o, this.barX = this.trackX + (i - s) / 2, this.barWidth = s;
2892
+ this.visibleDistance = r - i - n, this.distance = h - this.visibleDistance + f, this.trackX = o - i, this.trackY = 0, this.splitPoints = [this.trackX, n, this.trackX + i, n], this.trackWidth = i, this.trackHeight = r, this.barX = this.trackX + (i - s) / 2, this.barWidth = s;
2844
2893
  const d = this.distance ? this.visibleDistance / h : 0;
2845
2894
  let x = Math.floor(d * this.visibleDistance);
2846
2895
  x < 30 ? x = 30 : x > this.visibleDistance && (x = 0), this.barHeight = x, this.barY = n + this.scroll / this.distance * (this.visibleDistance - this.barHeight), this.scroll = Math.max(0, Math.min(this.scroll, this.distance));
2847
2896
  } else {
2848
- this.visibleDistance = r - i, this.distance = l - this.visibleDistance, this.splitPoints = [
2849
- r - i,
2897
+ this.visibleDistance = o - i, this.distance = l - this.visibleDistance, this.splitPoints = [
2850
2898
  o - i,
2851
2899
  r - i,
2852
- o
2853
- ], this.trackX = 0, this.trackY = o - i, this.trackWidth = r, this.trackHeight = i;
2900
+ o - i,
2901
+ r
2902
+ ], this.trackX = 0, this.trackY = r - i, this.trackWidth = o, this.trackHeight = i;
2854
2903
  const d = this.distance ? this.visibleDistance / l : 0;
2855
2904
  let x = Math.floor(d * this.visibleDistance);
2856
2905
  this.barY = this.trackY + 0.5 + (i - s) / 2, x < 30 ? x = 30 : x >= this.visibleDistance && (x = 0), this.barWidth = x, this.barHeight = s, this.barX = this.scroll / this.distance * (this.visibleDistance - this.barWidth), this.scroll = Math.max(0, Math.min(this.scroll, this.distance));
@@ -2872,12 +2921,12 @@ class Wt {
2872
2921
  }), this.ctx.scrollerFocus = this.isFocus;
2873
2922
  }
2874
2923
  }
2875
- class oi {
2924
+ class hi {
2876
2925
  constructor(t) {
2877
2926
  c(this, "ctx");
2878
2927
  c(this, "verticalScrollbar");
2879
2928
  c(this, "horizontalScrollbar");
2880
- this.ctx = t, this.verticalScrollbar = new Wt(t, "vertical"), this.horizontalScrollbar = new Wt(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("setScroll", (e, i) => {
2929
+ this.ctx = t, this.verticalScrollbar = new Vt(t, "vertical"), this.horizontalScrollbar = new Vt(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("setScroll", (e, i) => {
2881
2930
  this.setScroll(e, i);
2882
2931
  }), this.ctx.on("setScrollX", (e) => {
2883
2932
  this.setScrollX(e);
@@ -2924,11 +2973,11 @@ class oi {
2924
2973
  s > e.visibleHeight && this.setScrollY(s - e.visibleHeight / 2);
2925
2974
  }
2926
2975
  scrollToRowKey(t) {
2927
- const { body: e, database: i } = this.ctx, s = i.getRowIndexForRowKey(t), { top: r } = i.getPositionForRowIndex(s);
2928
- this.setScrollY(r - e.visibleHeight / 2);
2976
+ const { body: e, database: i } = this.ctx, s = i.getRowIndexForRowKey(t), { top: o } = i.getPositionForRowIndex(s);
2977
+ this.setScrollY(o - e.visibleHeight / 2);
2929
2978
  }
2930
2979
  }
2931
- class ni {
2980
+ class di {
2932
2981
  constructor(t) {
2933
2982
  c(this, "ctx");
2934
2983
  // 上下文
@@ -2967,7 +3016,7 @@ class ni {
2967
3016
  c(this, "renderFixedCellHeaders", []);
2968
3017
  this.ctx = t, this.ctx.on(
2969
3018
  "resetHeader",
2970
- jt(() => {
3019
+ Zt(() => {
2971
3020
  this.init(), this.ctx.emit("draw");
2972
3021
  }, 100)
2973
3022
  ), this.init(), this.initResizeColumn();
@@ -2977,10 +3026,10 @@ class ni {
2977
3026
  config: { HEADER_HEIGHT: t, SCROLLER_TRACK_SIZE: e }
2978
3027
  } = this.ctx, i = this.ctx.database.getColumns();
2979
3028
  this.columns = i, this.allCellHeaders = [], this.leafCellHeaders = [], this.fixedLeftCellHeaders = [], this.fixedRightCellHeaders = [], this.centerCellHeaders = [];
2980
- const s = Ut(i), r = It(i);
2981
- this.height = t * s, this.width = r.reduce((d, x) => d + ((x == null ? void 0 : x.width) || 100), 0), this.visibleHeight = this.height;
2982
- const o = Ue(Zt(i, s));
2983
- this.columnIndex = 0, this.resizeNum = 0, this.render(o, 0), this.ctx.database.updateColIndexKeyMap(this.leafCellHeaders);
3029
+ const s = Jt(i), o = It(i);
3030
+ this.height = t * s, this.width = o.reduce((d, x) => d + ((x == null ? void 0 : x.width) || 100), 0), this.visibleHeight = this.height;
3031
+ const r = Je(Qt(i, s));
3032
+ this.columnIndex = 0, this.resizeNum = 0, this.render(r, 0), this.ctx.database.updateColIndexKeyMap(this.leafCellHeaders);
2984
3033
  const n = this.ctx.targetContainer.getBoundingClientRect();
2985
3034
  this.resizeNum > 0 ? this.ctx.target.width = n.width : this.ctx.target.width = this.width + e - 1, this.visibleWidth = this.ctx.target.width - e;
2986
3035
  const l = this.visibleWidth - this.width;
@@ -3009,36 +3058,36 @@ class ni {
3009
3058
  config: { RESIZE_COLUMN_MIN_WIDTH: s }
3010
3059
  } = this.ctx;
3011
3060
  if (this.isResizing && this.resizeTarget) {
3012
- const r = this.resizeTarget.width;
3013
- let o = e.offsetX - this.offsetX;
3014
- o + r < s && (o = -(r - s)), this.resizeDiff = o, this.ctx.emit("draw");
3061
+ const o = this.resizeTarget.width;
3062
+ let r = e.offsetX - this.offsetX;
3063
+ r + o < s && (r = -(o - s)), this.resizeDiff = r, this.ctx.emit("draw");
3015
3064
  } else {
3016
3065
  if (this.resizeTarget = null, this.isMouseDown)
3017
3066
  return;
3018
3067
  this.ctx.target.style.cursor === "col-resize" && (this.ctx.target.style.cursor = "default");
3019
- const r = [...this.renderFixedCellHeaders, ...this.renderCenterCellHeaders];
3020
- for (const o of r) {
3021
- const n = e.layerX, l = o.getDrawX();
3022
- n > l + o.width - 5 && n < l + o.width + 4 && n < i.width - 4 && // 视窗中最后一列不允许调整宽
3023
- o.colspan <= 1 && e.target instanceof HTMLCanvasElement && this.ctx.isTarget(e.target) && e.layerY <= this.height && (this.ctx.target.style.cursor = "col-resize", this.resizeTarget = o);
3068
+ const o = [...this.renderFixedCellHeaders, ...this.renderCenterCellHeaders];
3069
+ for (const r of o) {
3070
+ const n = e.layerX, l = r.getDrawX();
3071
+ n > l + r.width - 5 && n < l + r.width + 4 && n < i.width - 4 && // 视窗中最后一列不允许调整宽
3072
+ r.colspan <= 1 && e.target instanceof HTMLCanvasElement && this.ctx.isTarget(e.target) && e.layerY <= this.height && (this.ctx.target.style.cursor = "col-resize", this.resizeTarget = r);
3024
3073
  }
3025
3074
  }
3026
3075
  }));
3027
3076
  }
3028
3077
  resizeColumn(t, e) {
3029
- const i = (r) => {
3030
- r.forEach((o) => {
3031
- if (o.children && o.children.length > 0 && i(o.children), o.key === t.key) {
3032
- const n = o.width || 100;
3033
- o.width = n + e;
3078
+ const i = (o) => {
3079
+ o.forEach((r) => {
3080
+ if (r.children && r.children.length > 0 && i(r.children), r.key === t.key) {
3081
+ const n = r.width || 100;
3082
+ r.width = n + e;
3034
3083
  }
3035
3084
  });
3036
3085
  };
3037
3086
  i(this.columns), this.ctx.database.setColumns(this.columns), this.init(), this.ctx.emit("draw");
3038
3087
  let s = 0;
3039
3088
  if (this.width < this.visibleWidth) {
3040
- const r = this.visibleWidth - this.width;
3041
- s = Math.floor(r / this.resizeNum * 100) / 100, this.resizeAllColumn(s), this.ctx.emit("draw");
3089
+ const o = this.visibleWidth - this.width;
3090
+ s = Math.floor(o / this.resizeNum * 100) / 100, this.resizeAllColumn(s), this.ctx.emit("draw");
3042
3091
  }
3043
3092
  this.ctx.emit("resizeColumnChange", {
3044
3093
  colIndex: t.colIndex,
@@ -3053,18 +3102,18 @@ class ni {
3053
3102
  if (t === 0) return;
3054
3103
  const e = /* @__PURE__ */ new Map();
3055
3104
  let i = !0;
3056
- for (const r of this.allCellHeaders)
3057
- if (r.widthFillDisable)
3058
- e.set(r.key, r.width);
3105
+ for (const o of this.allCellHeaders)
3106
+ if (o.widthFillDisable)
3107
+ e.set(o.key, o.width);
3059
3108
  else {
3060
- const o = r.width + t * r.colspan;
3061
- e.set(r.key, o), o < this.ctx.config.RESIZE_COLUMN_MIN_WIDTH && (i = !1);
3109
+ const r = o.width + t * o.colspan;
3110
+ e.set(o.key, r), r < this.ctx.config.RESIZE_COLUMN_MIN_WIDTH && (i = !1);
3062
3111
  }
3063
3112
  if (!i)
3064
3113
  return;
3065
- const s = (r) => {
3066
- r.forEach((o) => {
3067
- e.has(o.key) && (o.width = e.get(o.key)), o.children && o.children.length > 0 && s(o.children);
3114
+ const s = (o) => {
3115
+ o.forEach((r) => {
3116
+ e.has(r.key) && (r.width = e.get(r.key)), r.children && r.children.length > 0 && s(r.children);
3068
3117
  });
3069
3118
  };
3070
3119
  s(this.columns), this.ctx.database.setColumns(this.columns), this.init();
@@ -3072,12 +3121,12 @@ class ni {
3072
3121
  render(t, e) {
3073
3122
  const i = t.length;
3074
3123
  let s = e;
3075
- const { HEADER_HEIGHT: r = 0 } = this.ctx.config;
3076
- for (let o = 0; o < i; o++) {
3077
- const n = t[o], l = r * (n.rowspan || 1), h = r * n.level;
3124
+ const { HEADER_HEIGHT: o = 0 } = this.ctx.config;
3125
+ for (let r = 0; r < i; r++) {
3126
+ const n = t[r], l = o * (n.rowspan || 1), h = o * n.level;
3078
3127
  let f = n.width || 100;
3079
3128
  n.children && (f = It(n.children).reduce((u, y) => u + ((y == null ? void 0 : y.width) || 100), 0));
3080
- const d = new te(this.ctx, this.columnIndex, s, h, f, l, n);
3129
+ const d = new ie(this.ctx, this.columnIndex, s, h, f, l, n);
3081
3130
  this.ctx.database.setHeader(n.key, d), this.allCellHeaders.push(d), n.children || (this.leafCellHeaders.push(d), d.column.widthFillDisable || this.resizeNum++), n.fixed === "left" ? this.fixedLeftCellHeaders.push(d) : n.fixed === "right" ? this.fixedRightCellHeaders.push(d) : this.centerCellHeaders.push(d), !n.children && this.columnIndex++, n.children && this.render(n.children, s), s += f;
3082
3131
  }
3083
3132
  }
@@ -3086,8 +3135,8 @@ class ni {
3086
3135
  const {
3087
3136
  target: t,
3088
3137
  config: { RESIZE_COLUMN_LINE_COLOR: e }
3089
- } = this.ctx, i = this.resizeTarget.getDrawX(), s = this.resizeTarget.width, r = i + s + this.resizeDiff - 0.5, o = [r + 0.5, 0, r + 0.5, t.height];
3090
- this.ctx.paint.drawLine(o, {
3138
+ } = this.ctx, i = this.resizeTarget.getDrawX(), s = this.resizeTarget.width, o = i + s + this.resizeDiff - 0.5, r = [o + 0.5, 0, o + 0.5, t.height];
3139
+ this.ctx.paint.drawLine(r, {
3091
3140
  borderColor: e,
3092
3141
  borderWidth: 1
3093
3142
  });
@@ -3099,19 +3148,19 @@ class ni {
3099
3148
  fixedRightWidth: e,
3100
3149
  scrollX: i,
3101
3150
  header: s,
3102
- target: r,
3103
- config: { HEADER_BG_COLOR: o, SCROLLER_TRACK_SIZE: n }
3151
+ target: o,
3152
+ config: { HEADER_BG_COLOR: r, SCROLLER_TRACK_SIZE: n }
3104
3153
  } = this.ctx;
3105
3154
  if (i > 0 && t !== 0 && this.ctx.paint.drawShadow(this.x, this.y, t, this.height, {
3106
- fillColor: o,
3155
+ fillColor: r,
3107
3156
  side: "right",
3108
3157
  shadowWidth: 4,
3109
3158
  colorStart: "rgba(0,0,0,0.1)",
3110
3159
  colorEnd: "rgba(0,0,0,0)"
3111
3160
  }), i < Math.floor(s.width - s.visibleWidth - 1) && e !== n) {
3112
- const l = s.width - (this.x + this.width) + r.width - e;
3161
+ const l = s.width - (this.x + this.width) + o.width - e;
3113
3162
  this.ctx.paint.drawShadow(l + 1, this.y, e, this.height, {
3114
- fillColor: o,
3163
+ fillColor: r,
3115
3164
  side: "left",
3116
3165
  shadowWidth: 4,
3117
3166
  colorStart: "rgba(0,0,0,0)",
@@ -3127,7 +3176,7 @@ class ni {
3127
3176
  i.push(s), s.hasChildren || t.push(s);
3128
3177
  }), this.fixedRightCellHeaders.forEach((s) => {
3129
3178
  i.push(s), s.hasChildren || t.push(s);
3130
- }), this.renderCenterCellHeaders = e, this.renderFixedCellHeaders = i, this.renderLeafCellHeaders = t.sort((s, r) => s.x - r.x), this.visibleLeafColumns = this.renderLeafCellHeaders.map((s) => s.column), this.ctx.header.visibleLeafColumns = this.visibleLeafColumns, this.ctx.header.leafCellHeaders = this.leafCellHeaders, this.ctx.header.renderLeafCellHeaders = this.renderLeafCellHeaders, this.ctx.header.renderCellHeaders = this.renderFixedCellHeaders.concat(this.renderCenterCellHeaders);
3179
+ }), this.renderCenterCellHeaders = e, this.renderFixedCellHeaders = i, this.renderLeafCellHeaders = t.sort((s, o) => s.x - o.x), this.visibleLeafColumns = this.renderLeafCellHeaders.map((s) => s.column), this.ctx.header.visibleLeafColumns = this.visibleLeafColumns, this.ctx.header.leafCellHeaders = this.leafCellHeaders, this.ctx.header.renderLeafCellHeaders = this.renderLeafCellHeaders, this.ctx.header.renderCellHeaders = this.renderFixedCellHeaders.concat(this.renderCenterCellHeaders);
3131
3180
  }
3132
3181
  draw() {
3133
3182
  this.renderCenterCellHeaders.forEach((t) => {
@@ -3137,8 +3186,8 @@ class ni {
3137
3186
  }), this.drawTipLine();
3138
3187
  }
3139
3188
  }
3140
- class ee {
3141
- constructor(t, e, i = 0, s = 0, r = 0, o = 0, n, l = "body") {
3189
+ class se {
3190
+ constructor(t, e, i = 0, s = 0, o = 0, r = 0, n, l = "body") {
3142
3191
  c(this, "ctx");
3143
3192
  c(this, "x", 0);
3144
3193
  c(this, "y", 0);
@@ -3151,24 +3200,24 @@ class ee {
3151
3200
  c(this, "rowKey", "");
3152
3201
  c(this, "rowType", "body");
3153
3202
  c(this, "data");
3154
- 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 = l, this.data = n, this.update();
3203
+ this.ctx = t, this.x = i, this.y = s, this.width = o, this.height = r, this.rowIndex = e, this.rowKey = t.database.getRowKeyForRowIndex(e), this.rowType = l, this.data = n, this.update();
3155
3204
  }
3156
3205
  update() {
3157
3206
  const { header: t } = this.ctx, e = [], i = [], s = [];
3158
- t.renderLeafCellHeaders.forEach((r) => {
3159
- const o = new Qt(
3207
+ t.renderLeafCellHeaders.forEach((o) => {
3208
+ const r = new ee(
3160
3209
  this.ctx,
3161
3210
  this.rowIndex,
3162
- r.colIndex,
3163
- r.x,
3211
+ o.colIndex,
3212
+ o.x,
3164
3213
  this.y,
3165
- r.width,
3214
+ o.width,
3166
3215
  this.height,
3167
- r.column,
3216
+ o.column,
3168
3217
  this.data,
3169
3218
  this.rowType
3170
3219
  );
3171
- o.fixed ? i.push(o) : s.push(o), e.push(o);
3220
+ r.fixed ? i.push(r) : s.push(r), e.push(r);
3172
3221
  }), this.cells = e, this.fixedCells = i, this.noFixedCells = s;
3173
3222
  }
3174
3223
  drawCenter() {
@@ -3189,7 +3238,7 @@ class ee {
3189
3238
  });
3190
3239
  }
3191
3240
  }
3192
- class ai {
3241
+ class fi {
3193
3242
  constructor(t) {
3194
3243
  c(this, "resizeTarget", null);
3195
3244
  //调整行大小的目标
@@ -3222,8 +3271,8 @@ class ai {
3222
3271
  database: i,
3223
3272
  config: {
3224
3273
  FOOTER_FIXED: s,
3225
- SCROLLER_TRACK_SIZE: r = 0,
3226
- BORDER_COLOR: o,
3274
+ SCROLLER_TRACK_SIZE: o = 0,
3275
+ BORDER_COLOR: r,
3227
3276
  BORDER_RADIUS: n,
3228
3277
  HEIGHT: l,
3229
3278
  EMPTY_BODY_HEIGHT: h = 0,
@@ -3238,7 +3287,7 @@ class ai {
3238
3287
  const { data: u, sumHeight: y } = i.getData();
3239
3288
  this.height = y, this.data = u;
3240
3289
  const { top: g } = t.getBoundingClientRect();
3241
- this.width = e.width, this.visibleWidth = t.width - r;
3290
+ this.width = e.width, this.visibleWidth = t.width - o;
3242
3291
  const w = this.ctx.footer.height;
3243
3292
  this.data.length || (this.height = h);
3244
3293
  const p = this.data.length ? "not-empty" : "empty";
@@ -3251,16 +3300,16 @@ class ai {
3251
3300
  width: this.width,
3252
3301
  height: this.data.length ? 0 : h + w
3253
3302
  });
3254
- let E = this.height + e.height + r;
3303
+ let E = this.height + e.height + o;
3255
3304
  E += w;
3256
3305
  let m = 0;
3257
3306
  this.data.length && d ? (m = window.innerHeight - g - x, m < 0 && (m = 32, console.error(
3258
3307
  "There is an error in the height calculation ENABLE_OFFSET_HEIGHT and OFFSET_HEIGHT are invalid"
3259
3308
  ))) : this.data.length && l ? m = l : this.data.length && f && E > f ? m = f : m = E, m > 0 && (this.ctx.target.height = m);
3260
- let b = t.height - e.height - r;
3309
+ let b = t.height - e.height - o;
3261
3310
  s ? this.visibleHeight = b - w : this.visibleHeight = b, 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 = u, this.ctx.target.setAttribute(
3262
3311
  "style",
3263
- `outline: none; position: relative; border-radius: ${n}px; border: 1px solid ${o}; height:${this.ctx.target.height}px;width:${this.ctx.target.width - 1}px;`
3312
+ `outline: none; position: relative; border-radius: ${n}px; border: 1px solid ${r}; height:${this.ctx.target.height}px;width:${this.ctx.target.width - 1}px;`
3264
3313
  );
3265
3314
  }
3266
3315
  // 调整行的高度
@@ -3277,8 +3326,8 @@ class ai {
3277
3326
  }), this.ctx.on("mousemove", (e) => {
3278
3327
  if (this.ctx.editing) return;
3279
3328
  const i = e.offsetY, s = e.offsetX, {
3280
- target: r,
3281
- scrollY: o,
3329
+ target: o,
3330
+ scrollY: r,
3282
3331
  config: { RESIZE_ROW_MIN_HEIGHT: n = 0 }
3283
3332
  } = this.ctx;
3284
3333
  if (this.isResizing && this.resizeTarget) {
@@ -3291,7 +3340,7 @@ class ai {
3291
3340
  this.ctx.target.style.cursor === "row-resize" && (this.ctx.target.style.cursor = "default");
3292
3341
  for (let l = 0; l < this.renderRows.length; l++) {
3293
3342
  const h = this.renderRows[l];
3294
- if (i > h.y - o + h.height - 1.5 && i < h.y - o + h.height + 1.5 && i < r.height - 4)
3343
+ if (i > h.y - r + h.height - 1.5 && i < h.y - r + h.height + 1.5 && i < o.height - 4)
3295
3344
  for (let d = 0; d < h.cells.length; d++) {
3296
3345
  const x = h.cells[d];
3297
3346
  s > x.drawX + 10 && s < x.drawX + x.width - 10 && x.rowspan === 1 && (this.ctx.target.style.cursor = "row-resize", this.resizeTarget = h);
@@ -3301,13 +3350,13 @@ class ai {
3301
3350
  }));
3302
3351
  }
3303
3352
  resizeRow(t, e) {
3304
- const { rowIndex: i, height: s, rowKey: r, data: o } = t;
3353
+ const { rowIndex: i, height: s, rowKey: o, data: r } = t;
3305
3354
  this.ctx.database.setRowHeight(i, s + e), this.init(), this.ctx.emit("draw"), this.ctx.emit("resizeRowChange", {
3306
3355
  rowIndex: i,
3307
3356
  oldHeight: s,
3308
3357
  height: s + e,
3309
- rowKey: r,
3310
- row: o,
3358
+ rowKey: o,
3359
+ row: r,
3311
3360
  data: this.data
3312
3361
  });
3313
3362
  }
@@ -3317,7 +3366,7 @@ class ai {
3317
3366
  target: t,
3318
3367
  scrollY: e,
3319
3368
  config: { RESIZE_ROW_LINE_COLOR: i }
3320
- } = this.ctx, s = this.resizeTarget.y - e, r = this.resizeTarget.height, o = s + r + this.resizeDiff - 0.5, n = [0, o + 0.5, t.width, o + 0.5];
3369
+ } = this.ctx, s = this.resizeTarget.y - e, o = this.resizeTarget.height, r = s + o + this.resizeDiff - 0.5, n = [0, r + 0.5, t.width, r + 0.5];
3321
3370
  this.ctx.paint.drawLine(n, {
3322
3371
  borderColor: i,
3323
3372
  borderWidth: 1
@@ -3330,19 +3379,19 @@ class ai {
3330
3379
  fixedRightWidth: e,
3331
3380
  scrollX: i,
3332
3381
  header: s,
3333
- target: r,
3334
- config: { HEADER_BG_COLOR: o, SCROLLER_TRACK_SIZE: n }
3382
+ target: o,
3383
+ config: { HEADER_BG_COLOR: r, SCROLLER_TRACK_SIZE: n }
3335
3384
  } = this.ctx;
3336
3385
  if (i > 0 && t !== 0 && this.ctx.paint.drawShadow(this.x, this.y, t, this.height, {
3337
- fillColor: o,
3386
+ fillColor: r,
3338
3387
  side: "right",
3339
3388
  shadowWidth: 4,
3340
3389
  colorStart: "rgba(0,0,0,0.1)",
3341
3390
  colorEnd: "rgba(0,0,0,0)"
3342
3391
  }), i < Math.floor(s.width - s.visibleWidth - 1) && e !== n) {
3343
- const l = s.width - (this.x + this.width) + r.width - e;
3392
+ const l = s.width - (this.x + this.width) + o.width - e;
3344
3393
  this.ctx.paint.drawShadow(l + 1, this.y, e, this.height, {
3345
- fillColor: o,
3394
+ fillColor: r,
3346
3395
  side: "left",
3347
3396
  shadowWidth: 4,
3348
3397
  colorStart: "rgba(0,0,0,0)",
@@ -3351,25 +3400,25 @@ class ai {
3351
3400
  }
3352
3401
  }
3353
3402
  binarySearch(t, e) {
3354
- let i = 0, s = t.length - 1, r = -1;
3403
+ let i = 0, s = t.length - 1, o = -1;
3355
3404
  for (; i <= s; ) {
3356
- let o = Math.floor((i + s) / 2), n = t[o].bottom;
3405
+ let r = Math.floor((i + s) / 2), n = t[r].bottom;
3357
3406
  if (n === e)
3358
- return o;
3359
- n < e ? i = o + 1 : (r = o, s = o - 1);
3407
+ return r;
3408
+ n < e ? i = r + 1 : (o = r, s = r - 1);
3360
3409
  }
3361
- return r;
3410
+ return o;
3362
3411
  }
3363
3412
  update() {
3364
3413
  this.init();
3365
- const { header: t, database: e, scrollY: i } = this.ctx, s = i, { data: r, positions: o } = e.getData();
3366
- this.ctx.maxRowIndex = r.length - 1;
3367
- const n = this.binarySearch(o, s);
3368
- let l = this.binarySearch(o, s + this.visibleHeight);
3369
- l === -1 && (l = r.length), this.headIndex = Math.max(0, n), this.tailIndex = Math.min(this.ctx.maxRowIndex, l + 1), this.visibleRows = r.slice(this.headIndex, this.tailIndex + 1), this.ctx.body.headIndex = this.headIndex, this.ctx.body.tailIndex = this.tailIndex, this.ctx.body.visibleRows = this.visibleRows;
3414
+ const { header: t, database: e, scrollY: i } = this.ctx, s = i, { data: o, positions: r } = e.getData();
3415
+ this.ctx.maxRowIndex = o.length - 1;
3416
+ const n = this.binarySearch(r, s);
3417
+ let l = this.binarySearch(r, s + this.visibleHeight);
3418
+ l === -1 && (l = o.length), this.headIndex = Math.max(0, n), this.tailIndex = Math.min(this.ctx.maxRowIndex, l + 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;
3370
3419
  const h = [];
3371
3420
  for (let f = 0; f < this.visibleRows.length; f++) {
3372
- const d = this.headIndex + f, x = this.visibleRows[f], { height: u, top: y } = this.ctx.database.getPositionForRowIndex(d), g = new ee(this.ctx, d, 0, y + this.y, t.width, u, x);
3421
+ const d = this.headIndex + f, x = this.visibleRows[f], { height: u, top: y } = this.ctx.database.getPositionForRowIndex(d), g = new se(this.ctx, d, 0, y + this.y, t.width, u, x);
3373
3422
  h.push(g);
3374
3423
  }
3375
3424
  this.renderRows = h, this.ctx.body.renderRows = h;
@@ -3382,7 +3431,7 @@ class ai {
3382
3431
  }), this.drawTipLine();
3383
3432
  }
3384
3433
  }
3385
- class ci {
3434
+ class xi {
3386
3435
  constructor(t) {
3387
3436
  c(this, "ctx");
3388
3437
  c(this, "renderRows", []);
@@ -3400,9 +3449,9 @@ class ci {
3400
3449
  const {
3401
3450
  header: t,
3402
3451
  body: e,
3403
- config: { CELL_FOOTER_HEIGHT: i, FOOTER_FIXED: s, SCROLLER_TRACK_SIZE: r }
3452
+ config: { CELL_FOOTER_HEIGHT: i, FOOTER_FIXED: s, SCROLLER_TRACK_SIZE: o }
3404
3453
  } = this.ctx;
3405
- this.width = t.width, this.visibleWidth = t.visibleWidth, this.height = this.data.reduce((o) => o + i, 0), this.visibleHeight = this.height, s ? this.y = this.ctx.target.height - this.height - r : this.y = e.y + e.height, this.ctx.footer.x = this.x, this.ctx.footer.y = this.y, this.ctx.footer.height = this.height, this.ctx.footer.width = this.width, this.ctx.footer.visibleWidth = this.visibleWidth, this.ctx.footer.visibleHeight = this.visibleHeight;
3454
+ this.width = t.width, this.visibleWidth = t.visibleWidth, this.height = this.data.reduce((r) => r + i, 0), this.visibleHeight = this.height, s ? this.y = this.ctx.target.height - this.height - o : this.y = e.y + e.height, this.ctx.footer.x = this.x, this.ctx.footer.y = this.y, this.ctx.footer.height = this.height, this.ctx.footer.width = this.width, this.ctx.footer.visibleWidth = this.visibleWidth, this.ctx.footer.visibleHeight = this.visibleHeight;
3406
3455
  }
3407
3456
  drawFiexShadow() {
3408
3457
  const {
@@ -3410,20 +3459,20 @@ class ci {
3410
3459
  fixedRightWidth: e,
3411
3460
  scrollX: i,
3412
3461
  header: s,
3413
- target: r,
3414
- config: { HEADER_BG_COLOR: o, SCROLLER_TRACK_SIZE: n }
3462
+ target: o,
3463
+ config: { HEADER_BG_COLOR: r, SCROLLER_TRACK_SIZE: n }
3415
3464
  } = this.ctx;
3416
3465
  let l = this.y;
3417
3466
  if (this.ctx.config.FOOTER_FIXED || (l = this.y - this.ctx.scrollY), i > 0 && t !== 0 && this.ctx.paint.drawShadow(this.x, l, t, this.height, {
3418
- fillColor: o,
3467
+ fillColor: r,
3419
3468
  side: "right",
3420
3469
  shadowWidth: 4,
3421
3470
  colorStart: "rgba(0,0,0,0.1)",
3422
3471
  colorEnd: "rgba(0,0,0,0)"
3423
3472
  }), i < Math.floor(s.width - s.visibleWidth - 1) && e !== n) {
3424
- const h = s.width - (this.x + this.width) + r.width - e;
3473
+ const h = s.width - (this.x + this.width) + o.width - e;
3425
3474
  this.ctx.paint.drawShadow(h + 1, l, e, this.height, {
3426
- fillColor: o,
3475
+ fillColor: r,
3427
3476
  side: "left",
3428
3477
  shadowWidth: 4,
3429
3478
  colorStart: "rgba(0,0,0,0)",
@@ -3436,10 +3485,10 @@ class ci {
3436
3485
  const { CELL_FOOTER_HEIGHT: t } = this.ctx.config;
3437
3486
  let e = this.y;
3438
3487
  const i = [];
3439
- this.data.forEach((s, r) => {
3440
- const o = new ee(
3488
+ this.data.forEach((s, o) => {
3489
+ const r = new se(
3441
3490
  this.ctx,
3442
- r,
3491
+ o,
3443
3492
  0,
3444
3493
  e,
3445
3494
  this.width,
@@ -3447,7 +3496,7 @@ class ci {
3447
3496
  s,
3448
3497
  "footer"
3449
3498
  );
3450
- e += t, i.push(o);
3499
+ e += t, i.push(r);
3451
3500
  }), this.renderRows = i, this.ctx.footer.renderRows = this.renderRows;
3452
3501
  }
3453
3502
  draw() {
@@ -3458,7 +3507,7 @@ class ci {
3458
3507
  });
3459
3508
  }
3460
3509
  }
3461
- class li {
3510
+ class ui {
3462
3511
  // 垂直滚动定时器
3463
3512
  constructor(t) {
3464
3513
  c(this, "isCut", !1);
@@ -3474,13 +3523,13 @@ class li {
3474
3523
  init() {
3475
3524
  this.ctx.on(
3476
3525
  "mousemove",
3477
- jt((t) => {
3526
+ Zt((t) => {
3478
3527
  const { offsetX: e, offsetY: i } = t, s = this.ctx.isTarget(t.target) && e > 0 && e < this.ctx.body.visibleWidth && i > this.ctx.header.visibleHeight && i < this.ctx.header.visibleHeight + this.ctx.body.visibleHeight;
3479
3528
  (this.ctx.selectorMove || this.ctx.autofillMove) && (s ? this.stopAdjustPosition() : this.startAdjustPosition(t));
3480
3529
  }, 100)
3481
3530
  ), this.ctx.on("cellHoverChange", (t) => {
3482
3531
  if (!this.ctx.autofillMove) {
3483
- if (["index-selection", "selection", "index"].includes(t.type)) {
3532
+ if (t.operation) {
3484
3533
  this.selectRows(t, !1);
3485
3534
  return;
3486
3535
  }
@@ -3488,7 +3537,7 @@ class li {
3488
3537
  }
3489
3538
  }), this.ctx.on("cellMousedown", (t, e) => {
3490
3539
  if (this.ctx.isTarget(e.target) && this.ctx.target.style.cursor !== "pointer" && !this.ctx.isPointer && this.ctx.target.style.cursor !== "crosshair") {
3491
- if (["index-selection", "selection", "index"].includes(t.type)) {
3540
+ if (t.operation) {
3492
3541
  this.isMultipleRow = !0, this.selectRows(t);
3493
3542
  return;
3494
3543
  }
@@ -3550,37 +3599,44 @@ class li {
3550
3599
  }
3551
3600
  setSelector(t, e) {
3552
3601
  const { ENABLE_SELECTOR_SPAN_COL: i, ENABLE_SELECTOR_SPAN_ROW: s } = this.ctx.config;
3553
- let r = t, o = e;
3602
+ let o = t, r = e;
3554
3603
  if (!s) {
3604
+ const [n] = r;
3605
+ r = [n, n];
3606
+ }
3607
+ if (!i) {
3555
3608
  const [n] = o;
3556
3609
  o = [n, n];
3557
3610
  }
3558
- if (!i) {
3559
- const [n] = r;
3560
- r = [n, n];
3611
+ if (JSON.stringify(this.ctx.selector.xArr) !== JSON.stringify(o) || JSON.stringify(this.ctx.selector.yArr) !== JSON.stringify(r)) {
3612
+ this.ctx.mousedown && (this.ctx.selectorMove = !0), this.ctx.selector.enable = !0;
3613
+ const { SELECTOR_AREA_MIN_X: n, SELECTOR_AREA_MAX_X: l, SELECTOR_AREA_MIN_Y: h, SELECTOR_AREA_MAX_Y: f } = this.ctx.config, d = n, x = l || this.ctx.maxColIndex, u = h, y = f || this.ctx.maxRowIndex;
3614
+ let [g, w] = o, [p, E] = r;
3615
+ if (g < d || p < u)
3616
+ return;
3617
+ this.ctx.selector.xArr = [Math.max(d, g), Math.min(x, w)], this.ctx.selector.yArr = [Math.max(u, p), Math.min(y, E)], this.ctx.emit("setSelector", this.ctx.selector), this.ctx.emit("draw");
3561
3618
  }
3562
- (JSON.stringify(this.ctx.selector.xArr) !== JSON.stringify(r) || JSON.stringify(this.ctx.selector.yArr) !== JSON.stringify(o)) && (this.ctx.mousedown && (this.ctx.selectorMove = !0), this.ctx.selector.enable = !0, this.ctx.selector.xArr = r, this.ctx.selector.yArr = o, this.ctx.emit("setSelector", this.ctx.selector), this.ctx.emit("draw"));
3563
3619
  }
3564
3620
  selectCols(t) {
3565
3621
  if (this.ctx.config.ENABLE_SELECTOR_SINGLE || !this.ctx.config.ENABLE_SELECTOR_ALL_ROWS || this.ctx.autofillMove || this.ctx.columnResizing)
3566
3622
  return;
3567
- if (["index", "index-selection", "selection"].includes(t.type)) {
3623
+ if (t.operation) {
3568
3624
  this.selectAll();
3569
3625
  return;
3570
3626
  }
3571
- const e = 0, i = this.ctx.maxRowIndex;
3627
+ const { SELECTOR_AREA_MIN_Y: e, SELECTOR_AREA_MAX_Y: i } = this.ctx.config, s = e, o = i || this.ctx.maxRowIndex;
3572
3628
  if (this.ctx.mousedown && this.ctx.focusCellHeader) {
3573
- const { colIndex: s } = this.ctx.focusCellHeader;
3574
- if (t.colIndex >= s) {
3575
- const r = [s, t.colIndex + t.colspan - 1], o = [e, i];
3576
- this.setSelector(r, o);
3629
+ const { colIndex: r } = this.ctx.focusCellHeader;
3630
+ if (this.ctx.clearSelector(), t.colIndex >= r) {
3631
+ const n = [r, t.colIndex + t.colspan - 1], l = [s, o];
3632
+ this.setSelector(n, l);
3577
3633
  } else {
3578
- const r = [t.colIndex, s], o = [e, i];
3579
- this.setSelector(r, o);
3634
+ const n = [t.colIndex, r], l = [s, o];
3635
+ this.setSelector(n, l);
3580
3636
  }
3581
3637
  } else {
3582
- const s = [t.colIndex, t.colIndex + t.colspan - 1], r = [e, i];
3583
- this.setSelector(s, r);
3638
+ const r = [t.colIndex, t.colIndex + t.colspan - 1], n = [s, o];
3639
+ this.setSelector(r, n);
3584
3640
  }
3585
3641
  }
3586
3642
  selectAll() {
@@ -3588,27 +3644,27 @@ class li {
3588
3644
  return;
3589
3645
  const { ENABLE_SELECTOR_ALL_ROWS: t, ENABLE_SELECTOR_ALL_COLS: e } = this.ctx.config;
3590
3646
  if (t && e) {
3591
- const s = this.ctx.maxColIndex, r = 0, o = this.ctx.maxRowIndex, n = [1, s], l = [r, o];
3592
- this.setSelector(n, l);
3647
+ const { SELECTOR_AREA_MIN_X: i, SELECTOR_AREA_MAX_X: s, SELECTOR_AREA_MIN_Y: o, SELECTOR_AREA_MAX_Y: r } = this.ctx.config, n = i, l = s || this.ctx.maxColIndex, h = o, f = r || this.ctx.maxRowIndex, d = [n, l], x = [h, f];
3648
+ this.setSelector(d, x);
3593
3649
  }
3594
3650
  }
3595
3651
  selectRows(t, e = !0) {
3596
3652
  if (this.ctx.config.ENABLE_SELECTOR_SINGLE || !this.ctx.config.ENABLE_SELECTOR_ALL_COLS || this.ctx.autofillMove)
3597
3653
  return;
3598
- const i = this.ctx.maxColIndex, s = t.colIndex + 1;
3654
+ const { SELECTOR_AREA_MIN_X: i, SELECTOR_AREA_MAX_X: s } = this.ctx.config, o = s || this.ctx.maxColIndex, r = i;
3599
3655
  if (e) {
3600
3656
  this.ctx.setFocusCell(t);
3601
- const r = [s, i], o = [t.rowIndex, t.rowIndex];
3602
- this.setSelector(r, o);
3657
+ const n = [r, o], l = [t.rowIndex, t.rowIndex];
3658
+ this.setSelector(n, l);
3603
3659
  }
3604
3660
  if (this.ctx.focusCell && this.ctx.mousedown) {
3605
- const { rowIndex: r } = this.ctx.focusCell;
3606
- if (t.rowIndex >= r) {
3607
- const o = [s, i], n = [r, t.rowIndex];
3608
- this.setSelector(o, n);
3661
+ const { rowIndex: n } = this.ctx.focusCell;
3662
+ if (t.rowIndex >= n) {
3663
+ const l = [r, o], h = [n, t.rowIndex];
3664
+ this.setSelector(l, h);
3609
3665
  } else {
3610
- const o = [s, i], n = [t.rowIndex, r];
3611
- this.setSelector(o, n);
3666
+ const l = [r, o], h = [t.rowIndex, n];
3667
+ this.setSelector(l, h);
3612
3668
  }
3613
3669
  }
3614
3670
  }
@@ -3617,7 +3673,7 @@ class li {
3617
3673
  return;
3618
3674
  const { mousedown: t, focusCell: e, hoverCell: i } = this.ctx;
3619
3675
  if (t && e && i) {
3620
- const { rowIndex: s, colIndex: r } = e, o = Math.min(i.colIndex, r), n = Math.max(i.colIndex, r), l = Math.min(i.rowIndex, s), h = Math.max(i.rowIndex, s), f = [o, n], d = [l, h];
3676
+ const { rowIndex: s, colIndex: o } = e, r = Math.min(i.colIndex, o), n = Math.max(i.colIndex, o), l = Math.min(i.rowIndex, s), h = Math.max(i.rowIndex, s), f = [r, n], d = [l, h];
3621
3677
  this.setSelector(f, d);
3622
3678
  }
3623
3679
  }
@@ -3625,12 +3681,12 @@ class li {
3625
3681
  const { focusCell: e, clickCell: i } = this.ctx;
3626
3682
  if (e)
3627
3683
  if (this.ctx.selector.enable = !0, i && t) {
3628
- const { colIndex: s, rowIndex: r } = i, { colIndex: o, rowIndex: n } = e, l = Math.min(o, s), h = Math.max(o, s), f = Math.min(n, r), d = Math.max(n, r), x = [l, h], u = [f, d];
3684
+ const { colIndex: s, rowIndex: o } = i, { colIndex: r, rowIndex: n } = e, l = Math.min(r, s), h = Math.max(r, s), f = Math.min(n, o), d = Math.max(n, o), x = [l, h], u = [f, d];
3629
3685
  this.setSelector(x, u);
3630
3686
  } else {
3631
3687
  this.ctx.emit("cellSelectedClick", e);
3632
- const s = [e.colIndex, e.colIndex], r = [e.rowIndex, e.rowIndex];
3633
- this.setSelector(s, r), this.adjustBoundaryPosition();
3688
+ const s = [e.colIndex, e.colIndex], o = [e.rowIndex, e.rowIndex];
3689
+ this.setSelector(s, o), this.adjustBoundaryPosition();
3634
3690
  }
3635
3691
  }
3636
3692
  clearCopyLine() {
@@ -3643,8 +3699,8 @@ class li {
3643
3699
  * @returns
3644
3700
  */
3645
3701
  getCell(t, e) {
3646
- const i = this.ctx.body.renderRows.find((r) => r.rowIndex === t);
3647
- return i == null ? void 0 : i.cells.find((r) => r.colIndex === e);
3702
+ const i = this.ctx.body.renderRows.find((o) => o.rowIndex === t);
3703
+ return i == null ? void 0 : i.cells.find((o) => o.colIndex === e);
3648
3704
  }
3649
3705
  /**
3650
3706
  * 复制
@@ -3653,20 +3709,20 @@ class li {
3653
3709
  copy() {
3654
3710
  if (!this.ctx.config.ENABLE_COPY)
3655
3711
  return;
3656
- const { text: t } = this.ctx.getSelectedData();
3657
- navigator.clipboard ? navigator.clipboard.writeText(t).then(() => {
3712
+ const { value: t } = this.ctx.getSelectedData(), e = ei(t);
3713
+ navigator.clipboard ? navigator.clipboard.writeText(e).then(() => {
3658
3714
  this.ctx.selector.xArrCopy = this.ctx.selector.xArr.slice(), this.ctx.selector.yArrCopy = this.ctx.selector.yArr.slice(), this.ctx.emit("setCopy", this.ctx.selector), this.ctx.emit("draw");
3659
- }).catch((e) => console.error("复制失败:", e)) : console.error("当前浏览器不支持Clipboard API");
3715
+ }).catch((i) => console.error("复制失败:", i)) : console.error("当前浏览器不支持Clipboard API");
3660
3716
  }
3661
3717
  clearSelectedData(t, e, i = !1) {
3662
3718
  let s = [];
3663
- const r = /* @__PURE__ */ new Set();
3719
+ const o = /* @__PURE__ */ new Set();
3664
3720
  for (let n = 0; n <= e[1] - e[0]; n++)
3665
3721
  for (let l = 0; l <= t[1] - t[0]; l++) {
3666
3722
  const h = n + e[0], f = l + t[0], d = this.ctx.database.getItemValueForRowIndexAndColIndex(h, f);
3667
3723
  if (d) {
3668
3724
  const { rowKey: x, key: u } = d;
3669
- this.ctx.database.getReadonly(x, u) || (r.add(x), s.push({
3725
+ this.ctx.database.getReadonly(x, u) || (o.add(x), s.push({
3670
3726
  rowKey: x,
3671
3727
  key: u,
3672
3728
  value: null,
@@ -3680,10 +3736,10 @@ class li {
3680
3736
  if (i)
3681
3737
  return s;
3682
3738
  this.ctx.database.batchSetItemValue(s, !0);
3683
- let o = [];
3684
- return r.forEach((n) => {
3685
- o.push(this.ctx.database.getRowDataItemForRowKey(n));
3686
- }), this.ctx.emit("clearSelectedDataChange", s, o), this.ctx.emit("draw"), s;
3739
+ let r = [];
3740
+ return o.forEach((n) => {
3741
+ r.push(this.ctx.database.getRowDataItemForRowKey(n));
3742
+ }), this.ctx.emit("clearSelectedDataChange", s, r), this.ctx.emit("draw"), s;
3687
3743
  }
3688
3744
  paste() {
3689
3745
  if (!navigator.clipboard) {
@@ -3693,25 +3749,21 @@ class li {
3693
3749
  const { ENABLE_PASTER: t } = this.ctx.config;
3694
3750
  if (this.ctx.selector.enable && t) {
3695
3751
  const e = this.ctx.selector.yArr[0], i = this.ctx.selector.xArr[0], s = /* @__PURE__ */ new Set();
3696
- navigator.clipboard.readText().then((r) => {
3697
- let o = [];
3698
- const n = r.split("\r");
3699
- n.length === 1 ? o = n[0].split(`
3700
- `).map((d) => d.split(" ")) : o = n.map((f) => f.split(" "));
3701
- let l = [];
3702
- for (let f = 0; f <= o.length - 1; f++) {
3703
- const d = o[f].length;
3704
- for (let x = 0; x <= d - 1; x++) {
3705
- const u = f + e, y = x + i, g = o[f][x], w = this.ctx.database.getItemValueForRowIndexAndColIndex(
3706
- u,
3707
- y
3752
+ navigator.clipboard.readText().then((o) => {
3753
+ let r = ti(o), n = [];
3754
+ for (let h = 0; h <= r.length - 1; h++) {
3755
+ const f = r[h].length;
3756
+ for (let d = 0; d <= f - 1; d++) {
3757
+ const x = h + e, u = d + i, y = r[h][d], g = this.ctx.database.getItemValueForRowIndexAndColIndex(
3758
+ x,
3759
+ u
3708
3760
  );
3709
- if (w) {
3710
- const { rowKey: p, key: E } = w;
3711
- this.ctx.database.getReadonly(p, E) || (s.add(p), l.push({
3712
- rowKey: p,
3713
- key: E,
3714
- value: g,
3761
+ if (g) {
3762
+ const { rowKey: w, key: p } = g;
3763
+ this.ctx.database.getReadonly(w, p) || (s.add(w), n.push({
3764
+ rowKey: w,
3765
+ key: p,
3766
+ value: y,
3715
3767
  row: {}
3716
3768
  //内部有设置
3717
3769
  }));
@@ -3719,25 +3771,25 @@ class li {
3719
3771
  }
3720
3772
  }
3721
3773
  if (this.isCut) {
3722
- const f = this.clearSelectedData(
3774
+ const h = this.clearSelectedData(
3723
3775
  this.ctx.selector.xArrCopy,
3724
3776
  this.ctx.selector.yArrCopy,
3725
3777
  !0
3726
3778
  // 忽略设置,只返回数据,用于cut,实现历史回退需要返回两次问题
3727
- ), d = l.map((x) => `${x.rowKey}-${x.key}`);
3728
- f.forEach((x) => {
3729
- d.includes(`${x.rowKey}-${x.key}`) || l.unshift(x);
3779
+ ), f = n.map((d) => `${d.rowKey}-${d.key}`);
3780
+ h.forEach((d) => {
3781
+ f.includes(`${d.rowKey}-${d.key}`) || n.unshift(d);
3730
3782
  }), this.isCut = !1;
3731
3783
  }
3732
- if (!l.length)
3784
+ if (!n.length)
3733
3785
  return;
3734
- this.ctx.database.batchSetItemValue(l, !0);
3735
- let h = [];
3736
- s.forEach((f) => {
3737
- h.push(this.ctx.database.getRowDataItemForRowKey(f));
3738
- }), this.ctx.emit("pasteChange", l, h), this.clearCopyLine(), this.ctx.emit("draw");
3739
- }).catch((r) => {
3740
- console.error("获取剪贴板内容失败:", r);
3786
+ this.ctx.database.batchSetItemValue(n, !0);
3787
+ let l = [];
3788
+ s.forEach((h) => {
3789
+ l.push(this.ctx.database.getRowDataItemForRowKey(h));
3790
+ }), this.ctx.emit("pasteChange", n, l), this.clearCopyLine(), this.ctx.emit("draw");
3791
+ }).catch((o) => {
3792
+ console.error("获取剪贴板内容失败:", o);
3741
3793
  });
3742
3794
  }
3743
3795
  }
@@ -3751,13 +3803,13 @@ class li {
3751
3803
  if (!e)
3752
3804
  return;
3753
3805
  let { colIndex: i = 0, rowIndex: s = 0 } = e;
3754
- const r = 0, o = 0, n = this.ctx.maxColIndex, l = this.ctx.maxRowIndex;
3806
+ const o = 0, r = 0, n = this.ctx.maxColIndex, l = this.ctx.maxRowIndex;
3755
3807
  switch (t) {
3756
3808
  case "LEFT":
3757
- i > r && i--;
3809
+ i > o && i--;
3758
3810
  break;
3759
3811
  case "TOP":
3760
- s > o && s--;
3812
+ s > r && s--;
3761
3813
  break;
3762
3814
  case "RIGHT":
3763
3815
  i < n && i++;
@@ -3768,7 +3820,7 @@ class li {
3768
3820
  }
3769
3821
  const h = [i, i], f = [s, s], d = this.getCell(s, i);
3770
3822
  if (d) {
3771
- if (["index", "index-selection", "selection"].includes(d.type))
3823
+ if (d.operation)
3772
3824
  return;
3773
3825
  this.ctx.setFocusCell(d);
3774
3826
  }
@@ -3782,8 +3834,8 @@ class li {
3782
3834
  */
3783
3835
  startAdjustPosition(t) {
3784
3836
  const { offsetX: e, offsetY: i } = t;
3785
- let s = "", r = "";
3786
- if (e < 0 ? s = "left" : e > this.ctx.body.visibleWidth && (s = "right"), i < this.ctx.header.visibleHeight ? r = "top" : i > this.ctx.header.visibleHeight + this.ctx.body.visibleHeight && (r = "bottom"), s && this.adjustPositionX !== s) {
3837
+ let s = "", o = "";
3838
+ if (e < 0 ? s = "left" : e > this.ctx.body.visibleWidth && (s = "right"), i < this.ctx.header.visibleHeight ? o = "top" : i > this.ctx.header.visibleHeight + this.ctx.body.visibleHeight && (o = "bottom"), s && this.adjustPositionX !== s) {
3787
3839
  this.adjustPositionX = s;
3788
3840
  let n = 10 * (s === "left" ? -1 : 1);
3789
3841
  this.timerX && (clearInterval(this.timerX), this.timerX = 0), this.timerX = setInterval(() => {
@@ -3792,9 +3844,9 @@ class li {
3792
3844
  (h < 0 || h > this.ctx.body.width) && (clearInterval(this.timerX), this.timerX = 0), this.ctx.setScrollX(h);
3793
3845
  }, 100);
3794
3846
  }
3795
- if (r && this.adjustPositionY !== r) {
3796
- this.adjustPositionY = r;
3797
- let n = 10 * (r === "top" ? -1 : 1);
3847
+ if (o && this.adjustPositionY !== o) {
3848
+ this.adjustPositionY = o;
3849
+ let n = 10 * (o === "top" ? -1 : 1);
3798
3850
  this.timerY && (clearInterval(this.timerY), this.timerY = 0), this.timerY = setInterval(() => {
3799
3851
  n *= 1.5;
3800
3852
  const { scrollY: l } = this.ctx, h = l + n;
@@ -3806,20 +3858,20 @@ class li {
3806
3858
  * 调整滚动条位置,让焦点单元格始终出现在可视区域内
3807
3859
  */
3808
3860
  adjustBoundaryPosition() {
3809
- const { target: t, focusCell: e, fixedRightWidth: i, fixedLeftWidth: s, header: r, footer: o, scrollX: n, scrollY: l } = this.ctx;
3861
+ const { target: t, focusCell: e, fixedRightWidth: i, fixedLeftWidth: s, header: o, footer: r, scrollX: n, scrollY: l } = this.ctx;
3810
3862
  if (!e)
3811
3863
  return;
3812
3864
  const { SCROLLER_TRACK_SIZE: h = 0, FOOTER_FIXED: f } = this.ctx.config;
3813
3865
  let d = 0;
3814
- f && (d = o.visibleHeight);
3815
- const x = s - e.drawX + 1, u = e.drawX + e.width - (t.width - i) + 1, y = r.height - e.drawY, g = e.drawY + e.height - (t.height - d - h);
3866
+ f && (d = r.visibleHeight);
3867
+ const x = s - e.drawX + 1, u = e.drawX + e.width - (t.width - i) + 1, y = o.height - e.drawY, g = e.drawY + e.height - (t.height - d - h);
3816
3868
  u > 0 && !e.fixed ? this.ctx.setScrollX(n + u) : x > 0 && !e.fixed && this.ctx.setScrollX(n - x), y > 0 ? this.ctx.setScrollY(l - y) : g > 0 && this.ctx.setScrollY(l + g);
3817
3869
  }
3818
3870
  destroy() {
3819
3871
  this.timerX && (clearTimeout(this.timerX), this.timerX = 0), this.timerY && (clearTimeout(this.timerY), this.timerY = 0);
3820
3872
  }
3821
3873
  }
3822
- class hi {
3874
+ class gi {
3823
3875
  constructor(t) {
3824
3876
  c(this, "ctx");
3825
3877
  this.ctx = t, this.init();
@@ -3827,8 +3879,8 @@ class hi {
3827
3879
  init() {
3828
3880
  this.ctx.on("cellMouseenter", (t, e) => {
3829
3881
  this.ctx.target.style.cursor === "crosshair" && (this.ctx.target.style.cursor = "default");
3830
- const { xArr: i, yArr: s } = this.ctx.selector, r = i[1], o = s[1], { colIndex: n, rowIndex: l, drawX: h, drawY: f, width: d, height: x } = t;
3831
- if (this.ctx.config.ENABLE_AUTOFILL && n === r && l === o) {
3882
+ const { xArr: i, yArr: s } = this.ctx.selector, o = i[1], r = s[1], { colIndex: n, rowIndex: l, drawX: h, drawY: f, width: d, height: x } = t;
3883
+ if (this.ctx.config.ENABLE_AUTOFILL && n === o && l === r) {
3832
3884
  const y = h + d - 6, g = f + x - 6;
3833
3885
  e.offsetX > y && e.offsetY > g && (this.ctx.target.style.cursor = "crosshair");
3834
3886
  }
@@ -3856,23 +3908,25 @@ class hi {
3856
3908
  this.isAutofillIng() && this.autofillData(), this.ctx.autofill.enable = !1, this.ctx.autofillMove = !1, this.ctx.autofill.xArr = [-1, -1], this.ctx.autofill.yArr = [-1, -1];
3857
3909
  }
3858
3910
  setAutofill(t, e) {
3859
- const {
3860
- ENABLE_AUTOFILL: i,
3861
- ENABLE_SELECTOR_SPAN_COL: s,
3862
- ENABLE_SELECTOR_SPAN_ROW: r
3863
- } = this.ctx.config;
3911
+ const { ENABLE_AUTOFILL: i, ENABLE_SELECTOR_SPAN_COL: s, ENABLE_SELECTOR_SPAN_ROW: o } = this.ctx.config;
3864
3912
  if (!i)
3865
3913
  return;
3866
- let o = t, n = e;
3867
- if (!r) {
3914
+ let r = t, n = e;
3915
+ if (!o) {
3868
3916
  const [l] = n;
3869
3917
  n = [l, l];
3870
3918
  }
3871
3919
  if (!s) {
3872
- const [l] = o;
3873
- o = [l, l];
3920
+ const [l] = r;
3921
+ r = [l, l];
3922
+ }
3923
+ if (JSON.stringify(this.ctx.autofill.xArr) !== JSON.stringify(r) || JSON.stringify(this.ctx.autofill.yArr) !== JSON.stringify(n)) {
3924
+ const { SELECTOR_AREA_MIN_X: l, SELECTOR_AREA_MAX_X: h, SELECTOR_AREA_MIN_Y: f, SELECTOR_AREA_MAX_Y: d } = this.ctx.config, x = l, u = h || this.ctx.maxColIndex, y = f, g = d || this.ctx.maxRowIndex;
3925
+ let [w, p] = r, [E, m] = n;
3926
+ if (w < x || E < y)
3927
+ return;
3928
+ this.ctx.autofill.xArr = [Math.max(x, w), Math.min(u, p)], this.ctx.autofill.yArr = [Math.max(y, E), Math.min(g, m)], this.ctx.emit("setAutofill", this.ctx.autofill), this.ctx.emit("draw");
3874
3929
  }
3875
- (JSON.stringify(this.ctx.autofill.xArr) !== JSON.stringify(o) || JSON.stringify(this.ctx.autofill.yArr) !== JSON.stringify(n)) && (this.ctx.autofill.xArr = o, this.ctx.autofill.yArr = n, this.ctx.emit("setAutofill", this.ctx.autofill), this.ctx.emit("draw"));
3876
3930
  }
3877
3931
  /**
3878
3932
  * 填充数据
@@ -3884,14 +3938,11 @@ class hi {
3884
3938
  const u = d + e.yArr[0], y = x + e.xArr[0];
3885
3939
  i.set(`${u}-${y}`, !0);
3886
3940
  }
3887
- const { value: s } = e, r = s[0].length, o = s.length, n = this.ctx.autofill.xArr, l = this.ctx.autofill.yArr;
3941
+ const { value: s } = e, o = s[0].length, r = s.length, n = this.ctx.autofill.xArr, l = this.ctx.autofill.yArr;
3888
3942
  let h = [];
3889
3943
  for (let d = 0; d <= l[1] - l[0]; d++)
3890
3944
  for (let x = 0; x <= n[1] - n[0]; x++) {
3891
- const u = x + n[0], y = d + l[0], g = s[d % o][x % r], w = this.ctx.database.getItemValueForRowIndexAndColIndex(
3892
- y,
3893
- u
3894
- ), p = `${y}-${u}`;
3945
+ const u = x + n[0], y = d + l[0], g = s[d % r][x % o], w = this.ctx.database.getItemValueForRowIndexAndColIndex(y, u), p = `${y}-${u}`;
3895
3946
  if (w && !i.has(p)) {
3896
3947
  const { rowKey: E, key: m } = w;
3897
3948
  this.ctx.database.getReadonly(E, m) || (t.add(E), h.push({
@@ -3915,8 +3966,8 @@ class hi {
3915
3966
  return;
3916
3967
  const { selector: e, autofill: i } = this.ctx;
3917
3968
  if (this.ctx.mousedown && e.enable && i.enable) {
3918
- const { rowIndex: s, colIndex: r } = t, o = e.xArr.slice(), n = e.yArr.slice();
3919
- s >= e.yArr[0] && s <= e.yArr[1] ? r > e.xArr[1] ? o.splice(1, 1, r) : r < e.xArr[0] && o.splice(0, 1, r) : s > e.yArr[1] ? n.splice(1, 1, s) : s < e.yArr[0] && n.splice(0, 1, s), this.setAutofill(o, n);
3969
+ const { rowIndex: s, colIndex: o } = t, r = e.xArr.slice(), n = e.yArr.slice();
3970
+ s >= e.yArr[0] && s <= e.yArr[1] ? o > e.xArr[1] ? r.splice(1, 1, o) : o < e.xArr[0] && r.splice(0, 1, o) : s > e.yArr[1] ? n.splice(1, 1, s) : s < e.yArr[0] && n.splice(0, 1, s), this.setAutofill(r, n);
3920
3971
  }
3921
3972
  }
3922
3973
  destroy() {
@@ -3925,16 +3976,16 @@ class hi {
3925
3976
  const rt = Math.min, U = Math.max, ft = Math.round, V = (a) => ({
3926
3977
  x: a,
3927
3978
  y: a
3928
- }), di = {
3979
+ }), wi = {
3929
3980
  left: "right",
3930
3981
  right: "left",
3931
3982
  bottom: "top",
3932
3983
  top: "bottom"
3933
- }, fi = {
3984
+ }, pi = {
3934
3985
  start: "end",
3935
3986
  end: "start"
3936
3987
  };
3937
- function Ot(a, t, e) {
3988
+ function _t(a, t, e) {
3938
3989
  return U(a, rt(t, e));
3939
3990
  }
3940
3991
  function at(a, t) {
@@ -3946,53 +3997,53 @@ function q(a) {
3946
3997
  function ct(a) {
3947
3998
  return a.split("-")[1];
3948
3999
  }
3949
- function ie(a) {
4000
+ function re(a) {
3950
4001
  return a === "x" ? "y" : "x";
3951
4002
  }
3952
- function Ht(a) {
4003
+ function Mt(a) {
3953
4004
  return a === "y" ? "height" : "width";
3954
4005
  }
3955
4006
  function J(a) {
3956
4007
  return ["top", "bottom"].includes(q(a)) ? "y" : "x";
3957
4008
  }
3958
- function Mt(a) {
3959
- return ie(J(a));
4009
+ function Ht(a) {
4010
+ return re(J(a));
3960
4011
  }
3961
- function xi(a, t, e) {
4012
+ function yi(a, t, e) {
3962
4013
  e === void 0 && (e = !1);
3963
- const i = ct(a), s = Mt(a), r = Ht(s);
3964
- let o = s === "x" ? i === (e ? "end" : "start") ? "right" : "left" : i === "start" ? "bottom" : "top";
3965
- return t.reference[r] > t.floating[r] && (o = xt(o)), [o, xt(o)];
4014
+ const i = ct(a), s = Ht(a), o = Mt(s);
4015
+ let r = s === "x" ? i === (e ? "end" : "start") ? "right" : "left" : i === "start" ? "bottom" : "top";
4016
+ return t.reference[o] > t.floating[o] && (r = xt(r)), [r, xt(r)];
3966
4017
  }
3967
- function ui(a) {
4018
+ function mi(a) {
3968
4019
  const t = xt(a);
3969
- return [_t(a), t, _t(t)];
4020
+ return [Ot(a), t, Ot(t)];
3970
4021
  }
3971
- function _t(a) {
3972
- return a.replace(/start|end/g, (t) => fi[t]);
4022
+ function Ot(a) {
4023
+ return a.replace(/start|end/g, (t) => pi[t]);
3973
4024
  }
3974
- function gi(a, t, e) {
3975
- const i = ["left", "right"], s = ["right", "left"], r = ["top", "bottom"], o = ["bottom", "top"];
4025
+ function Ei(a, t, e) {
4026
+ const i = ["left", "right"], s = ["right", "left"], o = ["top", "bottom"], r = ["bottom", "top"];
3976
4027
  switch (a) {
3977
4028
  case "top":
3978
4029
  case "bottom":
3979
4030
  return e ? t ? s : i : t ? i : s;
3980
4031
  case "left":
3981
4032
  case "right":
3982
- return t ? r : o;
4033
+ return t ? o : r;
3983
4034
  default:
3984
4035
  return [];
3985
4036
  }
3986
4037
  }
3987
- function wi(a, t, e, i) {
4038
+ function bi(a, t, e, i) {
3988
4039
  const s = ct(a);
3989
- let r = gi(q(a), e === "start", i);
3990
- return s && (r = r.map((o) => o + "-" + s), t && (r = r.concat(r.map(_t)))), r;
4040
+ let o = Ei(q(a), e === "start", i);
4041
+ return s && (o = o.map((r) => r + "-" + s), t && (o = o.concat(o.map(Ot)))), o;
3991
4042
  }
3992
4043
  function xt(a) {
3993
- return a.replace(/left|right|bottom|top/g, (t) => di[t]);
4044
+ return a.replace(/left|right|bottom|top/g, (t) => wi[t]);
3994
4045
  }
3995
- function pi(a) {
4046
+ function Ci(a) {
3996
4047
  return {
3997
4048
  top: 0,
3998
4049
  right: 0,
@@ -4001,8 +4052,8 @@ function pi(a) {
4001
4052
  ...a
4002
4053
  };
4003
4054
  }
4004
- function se(a) {
4005
- return typeof a != "number" ? pi(a) : {
4055
+ function oe(a) {
4056
+ return typeof a != "number" ? Ci(a) : {
4006
4057
  top: a,
4007
4058
  right: a,
4008
4059
  bottom: a,
@@ -4027,12 +4078,12 @@ function ut(a) {
4027
4078
  y: e
4028
4079
  };
4029
4080
  }
4030
- function Pt(a, t, e) {
4081
+ function zt(a, t, e) {
4031
4082
  let {
4032
4083
  reference: i,
4033
4084
  floating: s
4034
4085
  } = a;
4035
- const r = J(t), o = Mt(t), n = Ht(o), l = q(t), h = r === "y", f = i.x + i.width / 2 - s.width / 2, d = i.y + i.height / 2 - s.height / 2, x = i[n] / 2 - s[n] / 2;
4086
+ const o = J(t), r = Ht(t), n = Mt(r), l = q(t), h = o === "y", f = i.x + i.width / 2 - s.width / 2, d = i.y + i.height / 2 - s.height / 2, x = i[n] / 2 - s[n] / 2;
4036
4087
  let u;
4037
4088
  switch (l) {
4038
4089
  case "top":
@@ -4067,29 +4118,29 @@ function Pt(a, t, e) {
4067
4118
  }
4068
4119
  switch (ct(t)) {
4069
4120
  case "start":
4070
- u[o] -= x * (e && h ? -1 : 1);
4121
+ u[r] -= x * (e && h ? -1 : 1);
4071
4122
  break;
4072
4123
  case "end":
4073
- u[o] += x * (e && h ? -1 : 1);
4124
+ u[r] += x * (e && h ? -1 : 1);
4074
4125
  break;
4075
4126
  }
4076
4127
  return u;
4077
4128
  }
4078
- const yi = async (a, t, e) => {
4129
+ const vi = async (a, t, e) => {
4079
4130
  const {
4080
4131
  placement: i = "bottom",
4081
4132
  strategy: s = "absolute",
4082
- middleware: r = [],
4083
- platform: o
4084
- } = e, n = r.filter(Boolean), l = await (o.isRTL == null ? void 0 : o.isRTL(t));
4085
- let h = await o.getElementRects({
4133
+ middleware: o = [],
4134
+ platform: r
4135
+ } = e, n = o.filter(Boolean), l = await (r.isRTL == null ? void 0 : r.isRTL(t));
4136
+ let h = await r.getElementRects({
4086
4137
  reference: a,
4087
4138
  floating: t,
4088
4139
  strategy: s
4089
4140
  }), {
4090
4141
  x: f,
4091
4142
  y: d
4092
- } = Pt(h, i, l), x = i, u = {}, y = 0;
4143
+ } = zt(h, i, l), x = i, u = {}, y = 0;
4093
4144
  for (let g = 0; g < n.length; g++) {
4094
4145
  const {
4095
4146
  name: w,
@@ -4107,7 +4158,7 @@ const yi = async (a, t, e) => {
4107
4158
  strategy: s,
4108
4159
  middlewareData: u,
4109
4160
  rects: h,
4110
- platform: o,
4161
+ platform: r,
4111
4162
  elements: {
4112
4163
  reference: a,
4113
4164
  floating: t
@@ -4119,14 +4170,14 @@ const yi = async (a, t, e) => {
4119
4170
  ...u[w],
4120
4171
  ...b
4121
4172
  }
4122
- }, C && y <= 50 && (y++, typeof C == "object" && (C.placement && (x = C.placement), C.rects && (h = C.rects === !0 ? await o.getElementRects({
4173
+ }, C && y <= 50 && (y++, typeof C == "object" && (C.placement && (x = C.placement), C.rects && (h = C.rects === !0 ? await r.getElementRects({
4123
4174
  reference: a,
4124
4175
  floating: t,
4125
4176
  strategy: s
4126
4177
  }) : C.rects), {
4127
4178
  x: f,
4128
4179
  y: d
4129
- } = Pt(h, x, l)), g = -1);
4180
+ } = zt(h, x, l)), g = -1);
4130
4181
  }
4131
4182
  return {
4132
4183
  x: f,
@@ -4136,14 +4187,14 @@ const yi = async (a, t, e) => {
4136
4187
  middlewareData: u
4137
4188
  };
4138
4189
  };
4139
- async function re(a, t) {
4190
+ async function ne(a, t) {
4140
4191
  var e;
4141
4192
  t === void 0 && (t = {});
4142
4193
  const {
4143
4194
  x: i,
4144
4195
  y: s,
4145
- platform: r,
4146
- rects: o,
4196
+ platform: o,
4197
+ rects: r,
4147
4198
  elements: n,
4148
4199
  strategy: l
4149
4200
  } = a, {
@@ -4152,23 +4203,23 @@ async function re(a, t) {
4152
4203
  elementContext: d = "floating",
4153
4204
  altBoundary: x = !1,
4154
4205
  padding: u = 0
4155
- } = at(t, a), y = se(u), w = n[x ? d === "floating" ? "reference" : "floating" : d], p = ut(await r.getClippingRect({
4156
- 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)),
4206
+ } = at(t, a), y = oe(u), w = n[x ? d === "floating" ? "reference" : "floating" : d], p = ut(await o.getClippingRect({
4207
+ element: (e = await (o.isElement == null ? void 0 : o.isElement(w))) == null || e ? w : w.contextElement || await (o.getDocumentElement == null ? void 0 : o.getDocumentElement(n.floating)),
4157
4208
  boundary: h,
4158
4209
  rootBoundary: f,
4159
4210
  strategy: l
4160
4211
  })), E = d === "floating" ? {
4161
4212
  x: i,
4162
4213
  y: s,
4163
- width: o.floating.width,
4164
- height: o.floating.height
4165
- } : o.reference, m = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(n.floating)), b = await (r.isElement == null ? void 0 : r.isElement(m)) ? await (r.getScale == null ? void 0 : r.getScale(m)) || {
4214
+ width: r.floating.width,
4215
+ height: r.floating.height
4216
+ } : r.reference, m = await (o.getOffsetParent == null ? void 0 : o.getOffsetParent(n.floating)), b = await (o.isElement == null ? void 0 : o.isElement(m)) ? await (o.getScale == null ? void 0 : o.getScale(m)) || {
4166
4217
  x: 1,
4167
4218
  y: 1
4168
4219
  } : {
4169
4220
  x: 1,
4170
4221
  y: 1
4171
- }, C = ut(r.convertOffsetParentRelativeRectToViewportRelativeRect ? await r.convertOffsetParentRelativeRectToViewportRelativeRect({
4222
+ }, C = ut(o.convertOffsetParentRelativeRectToViewportRelativeRect ? await o.convertOffsetParentRelativeRectToViewportRelativeRect({
4172
4223
  elements: n,
4173
4224
  rect: E,
4174
4225
  offsetParent: m,
@@ -4181,7 +4232,7 @@ async function re(a, t) {
4181
4232
  right: (C.right - p.right + y.right) / b.x
4182
4233
  };
4183
4234
  }
4184
- const mi = (a) => ({
4235
+ const Ri = (a) => ({
4185
4236
  name: "arrow",
4186
4237
  options: a,
4187
4238
  async fn(t) {
@@ -4189,8 +4240,8 @@ const mi = (a) => ({
4189
4240
  x: e,
4190
4241
  y: i,
4191
4242
  placement: s,
4192
- rects: r,
4193
- platform: o,
4243
+ rects: o,
4244
+ platform: r,
4194
4245
  elements: n,
4195
4246
  middlewareData: l
4196
4247
  } = t, {
@@ -4199,26 +4250,26 @@ const mi = (a) => ({
4199
4250
  } = at(a, t) || {};
4200
4251
  if (h == null)
4201
4252
  return {};
4202
- const d = se(f), x = {
4253
+ const d = oe(f), x = {
4203
4254
  x: e,
4204
4255
  y: i
4205
- }, u = Mt(s), y = Ht(u), g = await o.getDimensions(h), w = u === "y", p = w ? "top" : "left", E = w ? "bottom" : "right", m = w ? "clientHeight" : "clientWidth", b = r.reference[y] + r.reference[u] - x[u] - r.floating[y], C = x[u] - r.reference[u], R = await (o.getOffsetParent == null ? void 0 : o.getOffsetParent(h));
4256
+ }, u = Ht(s), y = Mt(u), g = await r.getDimensions(h), w = u === "y", p = w ? "top" : "left", E = w ? "bottom" : "right", m = w ? "clientHeight" : "clientWidth", b = o.reference[y] + o.reference[u] - x[u] - o.floating[y], C = x[u] - o.reference[u], R = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(h));
4206
4257
  let T = R ? R[m] : 0;
4207
- (!T || !await (o.isElement == null ? void 0 : o.isElement(R))) && (T = n.floating[m] || r.floating[y]);
4208
- const L = b / 2 - C / 2, A = T / 2 - g[y] / 2 - 1, D = rt(d[p], A), B = rt(d[E], A), O = D, S = T - g[y] - B, _ = T / 2 - g[y] / 2 + L, G = Ot(O, _, S), K = !l.arrow && ct(s) != null && _ !== G && r.reference[y] / 2 - (_ < O ? D : B) - g[y] / 2 < 0, X = K ? _ < O ? _ - O : _ - S : 0;
4258
+ (!T || !await (r.isElement == null ? void 0 : r.isElement(R))) && (T = n.floating[m] || o.floating[y]);
4259
+ const L = b / 2 - C / 2, A = T / 2 - g[y] / 2 - 1, D = rt(d[p], A), B = rt(d[E], A), _ = D, S = T - g[y] - B, O = T / 2 - g[y] / 2 + L, G = _t(_, O, S), Y = !l.arrow && ct(s) != null && O !== G && o.reference[y] / 2 - (O < _ ? D : B) - g[y] / 2 < 0, F = Y ? O < _ ? O - _ : O - S : 0;
4209
4260
  return {
4210
- [u]: x[u] + X,
4261
+ [u]: x[u] + F,
4211
4262
  data: {
4212
4263
  [u]: G,
4213
- centerOffset: _ - G - X,
4214
- ...K && {
4215
- alignmentOffset: X
4264
+ centerOffset: O - G - F,
4265
+ ...Y && {
4266
+ alignmentOffset: F
4216
4267
  }
4217
4268
  },
4218
- reset: K
4269
+ reset: Y
4219
4270
  };
4220
4271
  }
4221
- }), Ei = function(a) {
4272
+ }), Ii = function(a) {
4222
4273
  return a === void 0 && (a = {}), {
4223
4274
  name: "flip",
4224
4275
  options: a,
@@ -4226,8 +4277,8 @@ const mi = (a) => ({
4226
4277
  var e, i;
4227
4278
  const {
4228
4279
  placement: s,
4229
- middlewareData: r,
4230
- rects: o,
4280
+ middlewareData: o,
4281
+ rects: r,
4231
4282
  initialPlacement: n,
4232
4283
  platform: l,
4233
4284
  elements: h
@@ -4240,38 +4291,38 @@ const mi = (a) => ({
4240
4291
  flipAlignment: g = !0,
4241
4292
  ...w
4242
4293
  } = at(a, t);
4243
- if ((e = r.arrow) != null && e.alignmentOffset)
4294
+ if ((e = o.arrow) != null && e.alignmentOffset)
4244
4295
  return {};
4245
- const p = q(s), E = J(n), m = q(n) === n, b = await (l.isRTL == null ? void 0 : l.isRTL(h.floating)), C = x || (m || !g ? [xt(n)] : ui(n)), R = y !== "none";
4246
- !x && R && C.push(...wi(n, g, y, b));
4247
- const T = [n, ...C], L = await re(t, w), A = [];
4248
- let D = ((i = r.flip) == null ? void 0 : i.overflows) || [];
4296
+ const p = q(s), E = J(n), m = q(n) === n, b = await (l.isRTL == null ? void 0 : l.isRTL(h.floating)), C = x || (m || !g ? [xt(n)] : mi(n)), R = y !== "none";
4297
+ !x && R && C.push(...bi(n, g, y, b));
4298
+ const T = [n, ...C], L = await ne(t, w), A = [];
4299
+ let D = ((i = o.flip) == null ? void 0 : i.overflows) || [];
4249
4300
  if (f && A.push(L[p]), d) {
4250
- const _ = xi(s, o, b);
4251
- A.push(L[_[0]], L[_[1]]);
4301
+ const O = yi(s, r, b);
4302
+ A.push(L[O[0]], L[O[1]]);
4252
4303
  }
4253
4304
  if (D = [...D, {
4254
4305
  placement: s,
4255
4306
  overflows: A
4256
- }], !A.every((_) => _ <= 0)) {
4257
- var B, O;
4258
- const _ = (((B = r.flip) == null ? void 0 : B.index) || 0) + 1, G = T[_];
4307
+ }], !A.every((O) => O <= 0)) {
4308
+ var B, _;
4309
+ const O = (((B = o.flip) == null ? void 0 : B.index) || 0) + 1, G = T[O];
4259
4310
  if (G)
4260
4311
  return {
4261
4312
  data: {
4262
- index: _,
4313
+ index: O,
4263
4314
  overflows: D
4264
4315
  },
4265
4316
  reset: {
4266
4317
  placement: G
4267
4318
  }
4268
4319
  };
4269
- let K = (O = D.filter((X) => X.overflows[0] <= 0).sort((X, W) => X.overflows[1] - W.overflows[1])[0]) == null ? void 0 : O.placement;
4270
- if (!K)
4320
+ let Y = (_ = D.filter((F) => F.overflows[0] <= 0).sort((F, W) => F.overflows[1] - W.overflows[1])[0]) == null ? void 0 : _.placement;
4321
+ if (!Y)
4271
4322
  switch (u) {
4272
4323
  case "bestFit": {
4273
4324
  var S;
4274
- const X = (S = D.filter((W) => {
4325
+ const F = (S = D.filter((W) => {
4275
4326
  if (R) {
4276
4327
  const P = J(W.placement);
4277
4328
  return P === E || // Create a bias to the `y` side axis due to horizontal
@@ -4279,18 +4330,18 @@ const mi = (a) => ({
4279
4330
  P === "y";
4280
4331
  }
4281
4332
  return !0;
4282
- }).map((W) => [W.placement, W.overflows.filter((P) => P > 0).reduce((P, we) => P + we, 0)]).sort((W, P) => W[1] - P[1])[0]) == null ? void 0 : S[0];
4283
- X && (K = X);
4333
+ }).map((W) => [W.placement, W.overflows.filter((P) => P > 0).reduce((P, ye) => P + ye, 0)]).sort((W, P) => W[1] - P[1])[0]) == null ? void 0 : S[0];
4334
+ F && (Y = F);
4284
4335
  break;
4285
4336
  }
4286
4337
  case "initialPlacement":
4287
- K = n;
4338
+ Y = n;
4288
4339
  break;
4289
4340
  }
4290
- if (s !== K)
4341
+ if (s !== Y)
4291
4342
  return {
4292
4343
  reset: {
4293
- placement: K
4344
+ placement: Y
4294
4345
  }
4295
4346
  };
4296
4347
  }
@@ -4298,12 +4349,12 @@ const mi = (a) => ({
4298
4349
  }
4299
4350
  };
4300
4351
  };
4301
- async function bi(a, t) {
4352
+ async function _i(a, t) {
4302
4353
  const {
4303
4354
  placement: e,
4304
4355
  platform: i,
4305
4356
  elements: s
4306
- } = a, r = await (i.isRTL == null ? void 0 : i.isRTL(s.floating)), o = q(e), n = ct(e), l = J(e) === "y", h = ["left", "top"].includes(o) ? -1 : 1, f = r && l ? -1 : 1, d = at(t, a);
4357
+ } = a, o = await (i.isRTL == null ? void 0 : i.isRTL(s.floating)), r = q(e), n = ct(e), l = J(e) === "y", h = ["left", "top"].includes(r) ? -1 : 1, f = o && l ? -1 : 1, d = at(t, a);
4307
4358
  let {
4308
4359
  mainAxis: x,
4309
4360
  crossAxis: u,
@@ -4325,7 +4376,7 @@ async function bi(a, t) {
4325
4376
  y: u * f
4326
4377
  };
4327
4378
  }
4328
- const Ci = function(a) {
4379
+ const Oi = function(a) {
4329
4380
  return a === void 0 && (a = 0), {
4330
4381
  name: "offset",
4331
4382
  options: a,
@@ -4333,21 +4384,21 @@ const Ci = function(a) {
4333
4384
  var e, i;
4334
4385
  const {
4335
4386
  x: s,
4336
- y: r,
4337
- placement: o,
4387
+ y: o,
4388
+ placement: r,
4338
4389
  middlewareData: n
4339
- } = t, l = await bi(t, a);
4340
- return o === ((e = n.offset) == null ? void 0 : e.placement) && (i = n.arrow) != null && i.alignmentOffset ? {} : {
4390
+ } = t, l = await _i(t, a);
4391
+ return r === ((e = n.offset) == null ? void 0 : e.placement) && (i = n.arrow) != null && i.alignmentOffset ? {} : {
4341
4392
  x: s + l.x,
4342
- y: r + l.y,
4393
+ y: o + l.y,
4343
4394
  data: {
4344
4395
  ...l,
4345
- placement: o
4396
+ placement: r
4346
4397
  }
4347
4398
  };
4348
4399
  }
4349
4400
  };
4350
- }, vi = function(a) {
4401
+ }, Si = function(a) {
4351
4402
  return a === void 0 && (a = {}), {
4352
4403
  name: "shift",
4353
4404
  options: a,
@@ -4357,8 +4408,8 @@ const Ci = function(a) {
4357
4408
  y: i,
4358
4409
  placement: s
4359
4410
  } = t, {
4360
- mainAxis: r = !0,
4361
- crossAxis: o = !1,
4411
+ mainAxis: o = !0,
4412
+ crossAxis: r = !1,
4362
4413
  limiter: n = {
4363
4414
  fn: (w) => {
4364
4415
  let {
@@ -4375,15 +4426,15 @@ const Ci = function(a) {
4375
4426
  } = at(a, t), h = {
4376
4427
  x: e,
4377
4428
  y: i
4378
- }, f = await re(t, l), d = J(q(s)), x = ie(d);
4429
+ }, f = await ne(t, l), d = J(q(s)), x = re(d);
4379
4430
  let u = h[x], y = h[d];
4380
- if (r) {
4431
+ if (o) {
4381
4432
  const w = x === "y" ? "top" : "left", p = x === "y" ? "bottom" : "right", E = u + f[w], m = u - f[p];
4382
- u = Ot(E, u, m);
4433
+ u = _t(E, u, m);
4383
4434
  }
4384
- if (o) {
4435
+ if (r) {
4385
4436
  const w = d === "y" ? "top" : "left", p = d === "y" ? "bottom" : "right", E = y + f[w], m = y - f[p];
4386
- y = Ot(E, y, m);
4437
+ y = _t(E, y, m);
4387
4438
  }
4388
4439
  const g = n.fn({
4389
4440
  ...t,
@@ -4396,8 +4447,8 @@ const Ci = function(a) {
4396
4447
  x: g.x - e,
4397
4448
  y: g.y - i,
4398
4449
  enabled: {
4399
- [x]: r,
4400
- [d]: o
4450
+ [x]: o,
4451
+ [d]: r
4401
4452
  }
4402
4453
  }
4403
4454
  };
@@ -4408,27 +4459,27 @@ function gt() {
4408
4459
  return typeof window < "u";
4409
4460
  }
4410
4461
  function tt(a) {
4411
- return oe(a) ? (a.nodeName || "").toLowerCase() : "#document";
4462
+ return ae(a) ? (a.nodeName || "").toLowerCase() : "#document";
4412
4463
  }
4413
- function M(a) {
4464
+ function H(a) {
4414
4465
  var t;
4415
4466
  return (a == null || (t = a.ownerDocument) == null ? void 0 : t.defaultView) || window;
4416
4467
  }
4417
- function Y(a) {
4468
+ function K(a) {
4418
4469
  var t;
4419
- return (t = (oe(a) ? a.ownerDocument : a.document) || window.document) == null ? void 0 : t.documentElement;
4470
+ return (t = (ae(a) ? a.ownerDocument : a.document) || window.document) == null ? void 0 : t.documentElement;
4420
4471
  }
4421
- function oe(a) {
4422
- return gt() ? a instanceof Node || a instanceof M(a).Node : !1;
4472
+ function ae(a) {
4473
+ return gt() ? a instanceof Node || a instanceof H(a).Node : !1;
4423
4474
  }
4424
- function k(a) {
4425
- return gt() ? a instanceof Element || a instanceof M(a).Element : !1;
4475
+ function X(a) {
4476
+ return gt() ? a instanceof Element || a instanceof H(a).Element : !1;
4426
4477
  }
4427
4478
  function N(a) {
4428
- return gt() ? a instanceof HTMLElement || a instanceof M(a).HTMLElement : !1;
4479
+ return gt() ? a instanceof HTMLElement || a instanceof H(a).HTMLElement : !1;
4429
4480
  }
4430
- function Vt(a) {
4431
- return !gt() || typeof ShadowRoot > "u" ? !1 : a instanceof ShadowRoot || a instanceof M(a).ShadowRoot;
4481
+ function $t(a) {
4482
+ return !gt() || typeof ShadowRoot > "u" ? !1 : a instanceof ShadowRoot || a instanceof H(a).ShadowRoot;
4432
4483
  }
4433
4484
  function lt(a) {
4434
4485
  const {
@@ -4436,10 +4487,10 @@ function lt(a) {
4436
4487
  overflowX: e,
4437
4488
  overflowY: i,
4438
4489
  display: s
4439
- } = F(a);
4490
+ } = k(a);
4440
4491
  return /auto|scroll|overlay|hidden|clip/.test(t + i + e) && !["inline", "contents"].includes(s);
4441
4492
  }
4442
- function Ri(a) {
4493
+ function Ti(a) {
4443
4494
  return ["table", "td", "th"].includes(tt(a));
4444
4495
  }
4445
4496
  function wt(a) {
@@ -4452,10 +4503,10 @@ function wt(a) {
4452
4503
  });
4453
4504
  }
4454
4505
  function Dt(a) {
4455
- const t = kt(), e = k(a) ? F(a) : a;
4506
+ const t = Xt(), e = X(a) ? k(a) : a;
4456
4507
  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));
4457
4508
  }
4458
- function Ii(a) {
4509
+ function Li(a) {
4459
4510
  let t = z(a);
4460
4511
  for (; N(t) && !Q(t); ) {
4461
4512
  if (Dt(t))
@@ -4466,17 +4517,17 @@ function Ii(a) {
4466
4517
  }
4467
4518
  return null;
4468
4519
  }
4469
- function kt() {
4520
+ function Xt() {
4470
4521
  return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
4471
4522
  }
4472
4523
  function Q(a) {
4473
4524
  return ["html", "body", "#document"].includes(tt(a));
4474
4525
  }
4475
- function F(a) {
4476
- return M(a).getComputedStyle(a);
4526
+ function k(a) {
4527
+ return H(a).getComputedStyle(a);
4477
4528
  }
4478
4529
  function pt(a) {
4479
- return k(a) ? {
4530
+ return X(a) ? {
4480
4531
  scrollLeft: a.scrollLeft,
4481
4532
  scrollTop: a.scrollTop
4482
4533
  } : {
@@ -4491,80 +4542,80 @@ function z(a) {
4491
4542
  // Step into the shadow DOM of the parent of a slotted node.
4492
4543
  a.assignedSlot || // DOM Element detected.
4493
4544
  a.parentNode || // ShadowRoot detected.
4494
- Vt(a) && a.host || // Fallback.
4495
- Y(a)
4545
+ $t(a) && a.host || // Fallback.
4546
+ K(a)
4496
4547
  );
4497
- return Vt(t) ? t.host : t;
4548
+ return $t(t) ? t.host : t;
4498
4549
  }
4499
- function ne(a) {
4550
+ function ce(a) {
4500
4551
  const t = z(a);
4501
- return Q(t) ? a.ownerDocument ? a.ownerDocument.body : a.body : N(t) && lt(t) ? t : ne(t);
4552
+ return Q(t) ? a.ownerDocument ? a.ownerDocument.body : a.body : N(t) && lt(t) ? t : ce(t);
4502
4553
  }
4503
4554
  function St(a, t, e) {
4504
4555
  var i;
4505
4556
  t === void 0 && (t = []), e === void 0 && (e = !0);
4506
- const s = ne(a), r = s === ((i = a.ownerDocument) == null ? void 0 : i.body), o = M(s);
4507
- if (r) {
4508
- const n = Tt(o);
4509
- return t.concat(o, o.visualViewport || [], lt(s) ? s : [], n && e ? St(n) : []);
4557
+ const s = ce(a), o = s === ((i = a.ownerDocument) == null ? void 0 : i.body), r = H(s);
4558
+ if (o) {
4559
+ const n = Tt(r);
4560
+ return t.concat(r, r.visualViewport || [], lt(s) ? s : [], n && e ? St(n) : []);
4510
4561
  }
4511
4562
  return t.concat(s, St(s, [], e));
4512
4563
  }
4513
4564
  function Tt(a) {
4514
4565
  return a.parent && Object.getPrototypeOf(a.parent) ? a.frameElement : null;
4515
4566
  }
4516
- function ae(a) {
4517
- const t = F(a);
4567
+ function le(a) {
4568
+ const t = k(a);
4518
4569
  let e = parseFloat(t.width) || 0, i = parseFloat(t.height) || 0;
4519
- const s = N(a), r = s ? a.offsetWidth : e, o = s ? a.offsetHeight : i, n = ft(e) !== r || ft(i) !== o;
4520
- return n && (e = r, i = o), {
4570
+ const s = N(a), o = s ? a.offsetWidth : e, r = s ? a.offsetHeight : i, n = ft(e) !== o || ft(i) !== r;
4571
+ return n && (e = o, i = r), {
4521
4572
  width: e,
4522
4573
  height: i,
4523
4574
  $: n
4524
4575
  };
4525
4576
  }
4526
- function ce(a) {
4527
- return k(a) ? a : a.contextElement;
4577
+ function he(a) {
4578
+ return X(a) ? a : a.contextElement;
4528
4579
  }
4529
4580
  function Z(a) {
4530
- const t = ce(a);
4581
+ const t = he(a);
4531
4582
  if (!N(t))
4532
4583
  return V(1);
4533
4584
  const e = t.getBoundingClientRect(), {
4534
4585
  width: i,
4535
4586
  height: s,
4536
- $: r
4537
- } = ae(t);
4538
- let o = (r ? ft(e.width) : e.width) / i, n = (r ? ft(e.height) : e.height) / s;
4539
- return (!o || !Number.isFinite(o)) && (o = 1), (!n || !Number.isFinite(n)) && (n = 1), {
4540
- x: o,
4587
+ $: o
4588
+ } = le(t);
4589
+ let r = (o ? ft(e.width) : e.width) / i, n = (o ? ft(e.height) : e.height) / s;
4590
+ return (!r || !Number.isFinite(r)) && (r = 1), (!n || !Number.isFinite(n)) && (n = 1), {
4591
+ x: r,
4541
4592
  y: n
4542
4593
  };
4543
4594
  }
4544
- const Oi = /* @__PURE__ */ V(0);
4545
- function le(a) {
4546
- const t = M(a);
4547
- return !kt() || !t.visualViewport ? Oi : {
4595
+ const Ai = /* @__PURE__ */ V(0);
4596
+ function de(a) {
4597
+ const t = H(a);
4598
+ return !Xt() || !t.visualViewport ? Ai : {
4548
4599
  x: t.visualViewport.offsetLeft,
4549
4600
  y: t.visualViewport.offsetTop
4550
4601
  };
4551
4602
  }
4552
- function _i(a, t, e) {
4553
- return t === void 0 && (t = !1), !e || t && e !== M(a) ? !1 : t;
4603
+ function Mi(a, t, e) {
4604
+ return t === void 0 && (t = !1), !e || t && e !== H(a) ? !1 : t;
4554
4605
  }
4555
4606
  function ot(a, t, e, i) {
4556
4607
  t === void 0 && (t = !1), e === void 0 && (e = !1);
4557
- const s = a.getBoundingClientRect(), r = ce(a);
4558
- let o = V(1);
4559
- t && (i ? k(i) && (o = Z(i)) : o = Z(a));
4560
- const n = _i(r, e, i) ? le(r) : V(0);
4561
- let l = (s.left + n.x) / o.x, h = (s.top + n.y) / o.y, f = s.width / o.x, d = s.height / o.y;
4562
- if (r) {
4563
- const x = M(r), u = i && k(i) ? M(i) : i;
4608
+ const s = a.getBoundingClientRect(), o = he(a);
4609
+ let r = V(1);
4610
+ t && (i ? X(i) && (r = Z(i)) : r = Z(a));
4611
+ const n = Mi(o, e, i) ? de(o) : V(0);
4612
+ let l = (s.left + n.x) / r.x, h = (s.top + n.y) / r.y, f = s.width / r.x, d = s.height / r.y;
4613
+ if (o) {
4614
+ const x = H(o), u = i && X(i) ? H(i) : i;
4564
4615
  let y = x, g = Tt(y);
4565
4616
  for (; g && i && u !== y; ) {
4566
- const w = Z(g), p = g.getBoundingClientRect(), E = F(g), m = p.left + (g.clientLeft + parseFloat(E.paddingLeft)) * w.x, b = p.top + (g.clientTop + parseFloat(E.paddingTop)) * w.y;
4567
- l *= w.x, h *= w.y, f *= w.x, d *= w.y, l += m, h += b, y = M(g), g = Tt(y);
4617
+ const w = Z(g), p = g.getBoundingClientRect(), E = k(g), m = p.left + (g.clientLeft + parseFloat(E.paddingLeft)) * w.x, b = p.top + (g.clientTop + parseFloat(E.paddingTop)) * w.y;
4618
+ l *= w.x, h *= w.y, f *= w.x, d *= w.y, l += m, h += b, y = H(g), g = Tt(y);
4568
4619
  }
4569
4620
  }
4570
4621
  return ut({
@@ -4574,22 +4625,22 @@ function ot(a, t, e, i) {
4574
4625
  y: h
4575
4626
  });
4576
4627
  }
4577
- function Si(a) {
4628
+ function Hi(a) {
4578
4629
  let {
4579
4630
  elements: t,
4580
4631
  rect: e,
4581
4632
  offsetParent: i,
4582
4633
  strategy: s
4583
4634
  } = a;
4584
- const r = s === "fixed", o = Y(i), n = t ? wt(t.floating) : !1;
4585
- if (i === o || n && r)
4635
+ const o = s === "fixed", r = K(i), n = t ? wt(t.floating) : !1;
4636
+ if (i === r || n && o)
4586
4637
  return e;
4587
4638
  let l = {
4588
4639
  scrollLeft: 0,
4589
4640
  scrollTop: 0
4590
4641
  }, h = V(1);
4591
4642
  const f = V(0), d = N(i);
4592
- if ((d || !d && !r) && ((tt(i) !== "body" || lt(o)) && (l = pt(i)), N(i))) {
4643
+ if ((d || !d && !o) && ((tt(i) !== "body" || lt(r)) && (l = pt(i)), N(i))) {
4593
4644
  const x = ot(i);
4594
4645
  h = Z(i), f.x = x.x + i.clientLeft, f.y = x.y + i.clientTop;
4595
4646
  }
@@ -4600,58 +4651,58 @@ function Si(a) {
4600
4651
  y: e.y * h.y - l.scrollTop * h.y + f.y
4601
4652
  };
4602
4653
  }
4603
- function Ti(a) {
4654
+ function Di(a) {
4604
4655
  return Array.from(a.getClientRects());
4605
4656
  }
4606
4657
  function Lt(a, t) {
4607
4658
  const e = pt(a).scrollLeft;
4608
- return t ? t.left + e : ot(Y(a)).left + e;
4659
+ return t ? t.left + e : ot(K(a)).left + e;
4609
4660
  }
4610
- function Li(a) {
4611
- const t = Y(a), e = pt(a), i = a.ownerDocument.body, s = U(t.scrollWidth, t.clientWidth, i.scrollWidth, i.clientWidth), r = U(t.scrollHeight, t.clientHeight, i.scrollHeight, i.clientHeight);
4612
- let o = -e.scrollLeft + Lt(a);
4661
+ function Xi(a) {
4662
+ const t = K(a), e = pt(a), i = a.ownerDocument.body, s = U(t.scrollWidth, t.clientWidth, i.scrollWidth, i.clientWidth), o = U(t.scrollHeight, t.clientHeight, i.scrollHeight, i.clientHeight);
4663
+ let r = -e.scrollLeft + Lt(a);
4613
4664
  const n = -e.scrollTop;
4614
- return F(i).direction === "rtl" && (o += U(t.clientWidth, i.clientWidth) - s), {
4665
+ return k(i).direction === "rtl" && (r += U(t.clientWidth, i.clientWidth) - s), {
4615
4666
  width: s,
4616
- height: r,
4617
- x: o,
4667
+ height: o,
4668
+ x: r,
4618
4669
  y: n
4619
4670
  };
4620
4671
  }
4621
- function Ai(a, t) {
4622
- const e = M(a), i = Y(a), s = e.visualViewport;
4623
- let r = i.clientWidth, o = i.clientHeight, n = 0, l = 0;
4672
+ function ki(a, t) {
4673
+ const e = H(a), i = K(a), s = e.visualViewport;
4674
+ let o = i.clientWidth, r = i.clientHeight, n = 0, l = 0;
4624
4675
  if (s) {
4625
- r = s.width, o = s.height;
4626
- const h = kt();
4676
+ o = s.width, r = s.height;
4677
+ const h = Xt();
4627
4678
  (!h || h && t === "fixed") && (n = s.offsetLeft, l = s.offsetTop);
4628
4679
  }
4629
4680
  return {
4630
- width: r,
4631
- height: o,
4681
+ width: o,
4682
+ height: r,
4632
4683
  x: n,
4633
4684
  y: l
4634
4685
  };
4635
4686
  }
4636
- function Hi(a, t) {
4637
- const e = ot(a, !0, t === "fixed"), i = e.top + a.clientTop, s = e.left + a.clientLeft, r = N(a) ? Z(a) : V(1), o = a.clientWidth * r.x, n = a.clientHeight * r.y, l = s * r.x, h = i * r.y;
4687
+ function Fi(a, t) {
4688
+ const e = ot(a, !0, t === "fixed"), i = e.top + a.clientTop, s = e.left + a.clientLeft, o = N(a) ? Z(a) : V(1), r = a.clientWidth * o.x, n = a.clientHeight * o.y, l = s * o.x, h = i * o.y;
4638
4689
  return {
4639
- width: o,
4690
+ width: r,
4640
4691
  height: n,
4641
4692
  x: l,
4642
4693
  y: h
4643
4694
  };
4644
4695
  }
4645
- function zt(a, t, e) {
4696
+ function qt(a, t, e) {
4646
4697
  let i;
4647
4698
  if (t === "viewport")
4648
- i = Ai(a, e);
4699
+ i = ki(a, e);
4649
4700
  else if (t === "document")
4650
- i = Li(Y(a));
4651
- else if (k(t))
4652
- i = Hi(t, e);
4701
+ i = Xi(K(a));
4702
+ else if (X(t))
4703
+ i = Fi(t, e);
4653
4704
  else {
4654
- const s = le(a);
4705
+ const s = de(a);
4655
4706
  i = {
4656
4707
  ...t,
4657
4708
  x: t.x - s.x,
@@ -4660,34 +4711,34 @@ function zt(a, t, e) {
4660
4711
  }
4661
4712
  return ut(i);
4662
4713
  }
4663
- function he(a, t) {
4714
+ function fe(a, t) {
4664
4715
  const e = z(a);
4665
- return e === t || !k(e) || Q(e) ? !1 : F(e).position === "fixed" || he(e, t);
4716
+ return e === t || !X(e) || Q(e) ? !1 : k(e).position === "fixed" || fe(e, t);
4666
4717
  }
4667
- function Mi(a, t) {
4718
+ function Ni(a, t) {
4668
4719
  const e = t.get(a);
4669
4720
  if (e)
4670
4721
  return e;
4671
- let i = St(a, [], !1).filter((n) => k(n) && tt(n) !== "body"), s = null;
4672
- const r = F(a).position === "fixed";
4673
- let o = r ? z(a) : a;
4674
- for (; k(o) && !Q(o); ) {
4675
- const n = F(o), l = Dt(o);
4676
- !l && n.position === "fixed" && (s = null), (r ? !l && !s : !l && n.position === "static" && !!s && ["absolute", "fixed"].includes(s.position) || lt(o) && !l && he(a, o)) ? i = i.filter((f) => f !== o) : s = n, o = z(o);
4722
+ let i = St(a, [], !1).filter((n) => X(n) && tt(n) !== "body"), s = null;
4723
+ const o = k(a).position === "fixed";
4724
+ let r = o ? z(a) : a;
4725
+ for (; X(r) && !Q(r); ) {
4726
+ const n = k(r), l = Dt(r);
4727
+ !l && n.position === "fixed" && (s = null), (o ? !l && !s : !l && n.position === "static" && !!s && ["absolute", "fixed"].includes(s.position) || lt(r) && !l && fe(a, r)) ? i = i.filter((f) => f !== r) : s = n, r = z(r);
4677
4728
  }
4678
4729
  return t.set(a, i), i;
4679
4730
  }
4680
- function Di(a) {
4731
+ function Yi(a) {
4681
4732
  let {
4682
4733
  element: t,
4683
4734
  boundary: e,
4684
4735
  rootBoundary: i,
4685
4736
  strategy: s
4686
4737
  } = a;
4687
- const o = [...e === "clippingAncestors" ? wt(t) ? [] : Mi(t, this._c) : [].concat(e), i], n = o[0], l = o.reduce((h, f) => {
4688
- const d = zt(t, f, s);
4738
+ const r = [...e === "clippingAncestors" ? wt(t) ? [] : Ni(t, this._c) : [].concat(e), i], n = r[0], l = r.reduce((h, f) => {
4739
+ const d = qt(t, f, s);
4689
4740
  return h.top = U(d.top, h.top), h.right = rt(d.right, h.right), h.bottom = rt(d.bottom, h.bottom), h.left = U(d.left, h.left), h;
4690
- }, zt(t, n, s));
4741
+ }, qt(t, n, s));
4691
4742
  return {
4692
4743
  width: l.right - l.left,
4693
4744
  height: l.bottom - l.top,
@@ -4695,75 +4746,75 @@ function Di(a) {
4695
4746
  y: l.top
4696
4747
  };
4697
4748
  }
4698
- function ki(a) {
4749
+ function Ki(a) {
4699
4750
  const {
4700
4751
  width: t,
4701
4752
  height: e
4702
- } = ae(a);
4753
+ } = le(a);
4703
4754
  return {
4704
4755
  width: t,
4705
4756
  height: e
4706
4757
  };
4707
4758
  }
4708
- function Fi(a, t, e) {
4709
- const i = N(t), s = Y(t), r = e === "fixed", o = ot(a, !0, r, t);
4759
+ function Bi(a, t, e) {
4760
+ const i = N(t), s = K(t), o = e === "fixed", r = ot(a, !0, o, t);
4710
4761
  let n = {
4711
4762
  scrollLeft: 0,
4712
4763
  scrollTop: 0
4713
4764
  };
4714
4765
  const l = V(0);
4715
- if (i || !i && !r)
4766
+ if (i || !i && !o)
4716
4767
  if ((tt(t) !== "body" || lt(s)) && (n = pt(t)), i) {
4717
- const u = ot(t, !0, r, t);
4768
+ const u = ot(t, !0, o, t);
4718
4769
  l.x = u.x + t.clientLeft, l.y = u.y + t.clientTop;
4719
4770
  } else s && (l.x = Lt(s));
4720
4771
  let h = 0, f = 0;
4721
- if (s && !i && !r) {
4772
+ if (s && !i && !o) {
4722
4773
  const u = s.getBoundingClientRect();
4723
4774
  f = u.top + n.scrollTop, h = u.left + n.scrollLeft - // RTL <body> scrollbar.
4724
4775
  Lt(s, u);
4725
4776
  }
4726
- const d = o.left + n.scrollLeft - l.x - h, x = o.top + n.scrollTop - l.y - f;
4777
+ const d = r.left + n.scrollLeft - l.x - h, x = r.top + n.scrollTop - l.y - f;
4727
4778
  return {
4728
4779
  x: d,
4729
4780
  y: x,
4730
- width: o.width,
4731
- height: o.height
4781
+ width: r.width,
4782
+ height: r.height
4732
4783
  };
4733
4784
  }
4734
4785
  function mt(a) {
4735
- return F(a).position === "static";
4786
+ return k(a).position === "static";
4736
4787
  }
4737
- function $t(a, t) {
4738
- if (!N(a) || F(a).position === "fixed")
4788
+ function Gt(a, t) {
4789
+ if (!N(a) || k(a).position === "fixed")
4739
4790
  return null;
4740
4791
  if (t)
4741
4792
  return t(a);
4742
4793
  let e = a.offsetParent;
4743
- return Y(a) === e && (e = e.ownerDocument.body), e;
4794
+ return K(a) === e && (e = e.ownerDocument.body), e;
4744
4795
  }
4745
- function de(a, t) {
4746
- const e = M(a);
4796
+ function xe(a, t) {
4797
+ const e = H(a);
4747
4798
  if (wt(a))
4748
4799
  return e;
4749
4800
  if (!N(a)) {
4750
4801
  let s = z(a);
4751
4802
  for (; s && !Q(s); ) {
4752
- if (k(s) && !mt(s))
4803
+ if (X(s) && !mt(s))
4753
4804
  return s;
4754
4805
  s = z(s);
4755
4806
  }
4756
4807
  return e;
4757
4808
  }
4758
- let i = $t(a, t);
4759
- for (; i && Ri(i) && mt(i); )
4760
- i = $t(i, t);
4761
- return i && Q(i) && mt(i) && !Dt(i) ? e : i || Ii(a) || e;
4809
+ let i = Gt(a, t);
4810
+ for (; i && Ti(i) && mt(i); )
4811
+ i = Gt(i, t);
4812
+ return i && Q(i) && mt(i) && !Dt(i) ? e : i || Li(a) || e;
4762
4813
  }
4763
- const Xi = async function(a) {
4764
- const t = this.getOffsetParent || de, e = this.getDimensions, i = await e(a.floating);
4814
+ const Wi = async function(a) {
4815
+ const t = this.getOffsetParent || xe, e = this.getDimensions, i = await e(a.floating);
4765
4816
  return {
4766
- reference: Fi(a.reference, await t(a.floating), a.strategy),
4817
+ reference: Bi(a.reference, await t(a.floating), a.strategy),
4767
4818
  floating: {
4768
4819
  x: 0,
4769
4820
  y: 0,
@@ -4772,34 +4823,34 @@ const Xi = async function(a) {
4772
4823
  }
4773
4824
  };
4774
4825
  };
4775
- function Ni(a) {
4776
- return F(a).direction === "rtl";
4826
+ function Pi(a) {
4827
+ return k(a).direction === "rtl";
4777
4828
  }
4778
- const Ki = {
4779
- convertOffsetParentRelativeRectToViewportRelativeRect: Si,
4780
- getDocumentElement: Y,
4781
- getClippingRect: Di,
4782
- getOffsetParent: de,
4783
- getElementRects: Xi,
4784
- getClientRects: Ti,
4785
- getDimensions: ki,
4829
+ const Vi = {
4830
+ convertOffsetParentRelativeRectToViewportRelativeRect: Hi,
4831
+ getDocumentElement: K,
4832
+ getClippingRect: Yi,
4833
+ getOffsetParent: xe,
4834
+ getElementRects: Wi,
4835
+ getClientRects: Di,
4836
+ getDimensions: Ki,
4786
4837
  getScale: Z,
4787
- isElement: k,
4788
- isRTL: Ni
4789
- }, fe = Ci, xe = vi, ue = Ei, Yi = mi, ge = (a, t, e) => {
4838
+ isElement: X,
4839
+ isRTL: Pi
4840
+ }, ue = Oi, ge = Si, we = Ii, zi = Ri, pe = (a, t, e) => {
4790
4841
  const i = /* @__PURE__ */ new Map(), s = {
4791
- platform: Ki,
4842
+ platform: Vi,
4792
4843
  ...e
4793
- }, r = {
4844
+ }, o = {
4794
4845
  ...s.platform,
4795
4846
  _c: i
4796
4847
  };
4797
- return yi(a, t, {
4848
+ return vi(a, t, {
4798
4849
  ...s,
4799
- platform: r
4850
+ platform: o
4800
4851
  });
4801
4852
  };
4802
- let Bi = class {
4853
+ let $i = class {
4803
4854
  constructor(t) {
4804
4855
  c(this, "ctx");
4805
4856
  c(this, "enable", !1);
@@ -4807,8 +4858,8 @@ let Bi = class {
4807
4858
  c(this, "floatingEl");
4808
4859
  c(this, "arrowEl");
4809
4860
  this.ctx = t;
4810
- const { TOOLTIP_BG_COLOR: e, TOOLTIP_TEXT_COLOR: i, TOOLTIP_ZINDEX: s, TOOLTIP_CUSTOM_STYLE: r, CSS_PREFIX: o } = this.ctx.config;
4811
- 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`;
4861
+ const { TOOLTIP_BG_COLOR: e, TOOLTIP_TEXT_COLOR: i, TOOLTIP_ZINDEX: s, TOOLTIP_CUSTOM_STYLE: o, CSS_PREFIX: r } = this.ctx.config;
4862
+ this.contentEl = document.createElement("div"), this.arrowEl = document.createElement("div"), this.floatingEl = document.createElement("div"), this.floatingEl.className = `${r}-tooltip`, this.contentEl.className = `${r}-tooltip-content`, this.arrowEl.className = `${r}-tooltip-arrow`;
4812
4863
  const n = {
4813
4864
  display: "none",
4814
4865
  position: "absolute",
@@ -4819,7 +4870,7 @@ let Bi = class {
4819
4870
  padding: "8px",
4820
4871
  borderRadius: "4px",
4821
4872
  fontSize: "12px",
4822
- ...r
4873
+ ...o
4823
4874
  }, l = {
4824
4875
  position: "absolute",
4825
4876
  width: "10px",
@@ -4853,23 +4904,23 @@ let Bi = class {
4853
4904
  if (!i)
4854
4905
  return;
4855
4906
  this.enable = !0, this.contentEl.style.maxWidth = `${t.overflowTooltipMaxWidth || 500}px`, this.contentEl.style.width = "100%", this.contentEl.style.display = "inline-block", this.contentEl.style.wordBreak = "break-all", this.contentEl.style.lineHeight = "1.5", this.contentEl.innerText = e;
4856
- const s = t.drawX + i.x, r = t.drawY + i.y;
4857
- ge({
4907
+ const s = t.drawX + i.x, o = t.drawY + i.y;
4908
+ pe({
4858
4909
  getBoundingClientRect() {
4859
4910
  return {
4860
4911
  width: t.visibleWidth,
4861
4912
  height: t.visibleHeight,
4862
4913
  x: s,
4863
- y: r,
4914
+ y: o,
4864
4915
  left: s,
4865
4916
  right: s + t.visibleWidth,
4866
- top: r,
4867
- bottom: r + t.visibleHeight
4917
+ top: o,
4918
+ bottom: o + t.visibleHeight
4868
4919
  };
4869
4920
  }
4870
4921
  }, this.floatingEl, {
4871
4922
  placement: t.overflowTooltipPlacement,
4872
- middleware: [xe(), ue(), fe(6), Yi({ element: this.arrowEl })]
4923
+ middleware: [ge(), we(), ue(6), zi({ element: this.arrowEl })]
4873
4924
  }).then((n) => {
4874
4925
  const { x: l, y: h, placement: f, middlewareData: d } = n;
4875
4926
  if (Object.assign(this.floatingEl.style, {
@@ -4908,7 +4959,7 @@ let Bi = class {
4908
4959
  this.contentEl.remove(), this.arrowEl.remove(), this.floatingEl.remove();
4909
4960
  }
4910
4961
  };
4911
- class Wi {
4962
+ class qi {
4912
4963
  constructor(t) {
4913
4964
  c(this, "editorEl");
4914
4965
  c(this, "inputEl");
@@ -4921,10 +4972,10 @@ class Wi {
4921
4972
  this.ctx.on("onScroll", () => {
4922
4973
  this.enable && this.doneEdit();
4923
4974
  }), this.ctx.on("cellHeaderMousedown", () => {
4924
- this.enable && this.doneEdit();
4975
+ this.enable && this.doneEdit(), this.cellTarget = null;
4925
4976
  }), this.ctx.on("keydown", (t) => {
4926
- const e = t.key, i = t.ctrlKey, s = t.altKey, r = t.shiftKey, o = t.metaKey;
4927
- if (!(i || s || r || o || [
4977
+ const e = t.key, i = t.ctrlKey, s = t.altKey, o = t.shiftKey, r = t.metaKey;
4978
+ if (!(i || s || o || r || [
4928
4979
  // "Enter",
4929
4980
  "Escape",
4930
4981
  "Tab",
@@ -4965,10 +5016,10 @@ class Wi {
4965
5016
  }
4966
5017
  initTextEditor() {
4967
5018
  const { CSS_PREFIX: t, SELECT_BORDER_COLOR: e } = this.ctx.config;
4968
- this.inputEl = document.createElement("div"), this.inputEl.addEventListener("keydown", (o) => {
5019
+ this.inputEl = document.createElement("div"), this.inputEl.addEventListener("keydown", (r) => {
4969
5020
  if (this.enable) {
4970
- if ((o.altKey || o.metaKey) && o.code === "Enter") {
4971
- o.preventDefault();
5021
+ if ((r.altKey || r.metaKey) && r.code === "Enter") {
5022
+ r.preventDefault();
4972
5023
  const n = this.inputEl.textContent;
4973
5024
  this.inputEl.textContent = `${n}
4974
5025
 
@@ -4977,7 +5028,7 @@ class Wi {
4977
5028
  l == null || l.selectAllChildren(this.inputEl), l == null || l.collapseToEnd();
4978
5029
  return;
4979
5030
  }
4980
- (o.code === "Escape" || o.code === "Enter") && (o.preventDefault(), this.inputEl.blur());
5031
+ (r.code === "Escape" || r.code === "Enter") && (r.preventDefault(), this.inputEl.blur());
4981
5032
  }
4982
5033
  }), this.inputEl.addEventListener("blur", () => {
4983
5034
  this.doneEdit();
@@ -5016,14 +5067,14 @@ class Wi {
5016
5067
  cursor: "text"
5017
5068
  };
5018
5069
  Object.assign(this.inputEl.style, s);
5019
- const r = navigator.userAgent.toLowerCase().includes("firefox");
5020
- this.inputEl.contentEditable = r ? "true" : "plaintext-only", this.editorEl.appendChild(this.inputEl), this.ctx.targetContainer.appendChild(this.editorEl);
5070
+ const o = navigator.userAgent.toLowerCase().includes("firefox");
5071
+ this.inputEl.contentEditable = o ? "true" : "plaintext-only", this.editorEl.appendChild(this.inputEl), this.ctx.targetContainer.appendChild(this.editorEl);
5021
5072
  }
5022
5073
  startEditByInput(t) {
5023
5074
  if (t.editorType !== "text")
5024
5075
  return;
5025
- const e = t.getValue(), { width: i, height: s } = t, r = t.getDrawX(), o = t.getDrawY(), { CELL_PADDING: n } = this.ctx.config;
5026
- this.editorEl.style.left = `${r}px`, this.editorEl.style.top = `${o}px`, this.inputEl.style.minWidth = `${i - 1}px`, this.inputEl.style.minHeight = `${s - 1}px`, this.inputEl.style.padding = `${n}px`, e !== null && (this.inputEl.textContent = e), this.inputEl.focus();
5076
+ const e = t.getValue(), { width: i, height: s } = t, o = t.getDrawX(), r = t.getDrawY(), { CELL_PADDING: n } = this.ctx.config;
5077
+ this.editorEl.style.left = `${o}px`, this.editorEl.style.top = `${r}px`, this.inputEl.style.minWidth = `${i - 1}px`, this.inputEl.style.minHeight = `${s - 1}px`, this.inputEl.style.padding = `${n}px`, e !== null && (this.inputEl.textContent = e), this.inputEl.focus();
5027
5078
  const l = window.getSelection();
5028
5079
  l == null || l.selectAllChildren(this.inputEl), l == null || l.collapseToEnd();
5029
5080
  }
@@ -5040,8 +5091,8 @@ class Wi {
5040
5091
  const e = this.ctx.focusCell;
5041
5092
  if (!e || ["index", "index-selection", "selection"].includes(e.type) || this.enable)
5042
5093
  return;
5043
- const { rowKey: i, key: s } = e, r = this.ctx.database.getReadonly(i, s);
5044
- e && !r && (this.enable = !0, this.ctx.editing = !0, this.cellTarget = e, this.startEditByInput(this.cellTarget), this.ctx.emit("startEdit", this.cellTarget));
5094
+ const { rowKey: i, key: s } = e, o = this.ctx.database.getReadonly(i, s);
5095
+ e && !o && (this.enable = !0, this.ctx.editing = !0, this.cellTarget = e, this.startEditByInput(this.cellTarget), this.ctx.emit("startEdit", this.cellTarget));
5045
5096
  }
5046
5097
  editCell(t, e) {
5047
5098
  const i = this.ctx.body.renderRows.find((h) => h.rowIndex === t);
@@ -5051,11 +5102,11 @@ class Wi {
5051
5102
  if (!s)
5052
5103
  return;
5053
5104
  this.ctx.emit("setSelectorCell", s);
5054
- const r = this.ctx.focusCell;
5055
- if (!r || ["index", "index-selection", "selection"].includes(r.type) || this.enable)
5105
+ const o = this.ctx.focusCell;
5106
+ if (!o || ["index", "index-selection", "selection"].includes(o.type) || this.enable)
5056
5107
  return;
5057
- const { rowKey: o, key: n } = r, l = this.ctx.database.getReadonly(o, n);
5058
- r && !l && (this.enable = !0, this.ctx.editing = !0, this.cellTarget = r, this.startEditByInput(this.cellTarget), this.ctx.emit("startEdit", this.cellTarget));
5108
+ const { rowKey: r, key: n } = o, l = this.ctx.database.getReadonly(r, n);
5109
+ o && !l && (this.enable = !0, this.ctx.editing = !0, this.cellTarget = o, this.startEditByInput(this.cellTarget), this.ctx.emit("startEdit", this.cellTarget));
5059
5110
  }
5060
5111
  doneEdit() {
5061
5112
  this.enable && this.cellTarget && (this.ctx.emit("doneEdit", this.cellTarget), this.doneEditByInput(), this.enable = !1, this.ctx.target.focus(), this.ctx.editing = !1, this.cellTarget = null, this.ctx.emit("draw"));
@@ -5063,17 +5114,17 @@ class Wi {
5063
5114
  destroy() {
5064
5115
  }
5065
5116
  }
5066
- class Pi {
5117
+ class Gi {
5067
5118
  constructor(t) {
5068
5119
  c(this, "ctx");
5069
5120
  c(this, "emptyEl");
5070
5121
  this.ctx = t;
5071
- const { EMPTY_TEXT: e, EMPTY_CUSTOM: i, EMPTY_CUSTOM_STYLE: s, CSS_PREFIX: r } = this.ctx.config;
5072
- this.emptyEl = document.createElement("div"), this.emptyEl.className = `${r}-empty`, this.emptyEl.style.display = "none", this.emptyEl.innerText = e, this.ctx.targetContainer.appendChild(this.emptyEl), this.ctx.on("emptyChange", ({ type: o, headerHeight: n, bodyHeight: l, footerHeight: h }) => {
5122
+ const { EMPTY_TEXT: e, EMPTY_CUSTOM: i, EMPTY_CUSTOM_STYLE: s, CSS_PREFIX: o } = this.ctx.config;
5123
+ this.emptyEl = document.createElement("div"), this.emptyEl.className = `${o}-empty`, this.emptyEl.style.display = "none", this.emptyEl.innerText = e, this.ctx.targetContainer.appendChild(this.emptyEl), this.ctx.on("emptyChange", ({ type: r, headerHeight: n, bodyHeight: l, footerHeight: h }) => {
5073
5124
  if (i)
5074
5125
  return;
5075
5126
  const f = n + (l + h) / 2, d = {
5076
- display: o === "empty" ? "block" : "none",
5127
+ display: r === "empty" ? "block" : "none",
5077
5128
  position: "absolute",
5078
5129
  fontSize: "14px",
5079
5130
  color: "#666",
@@ -5089,7 +5140,7 @@ class Pi {
5089
5140
  this.emptyEl.remove();
5090
5141
  }
5091
5142
  }
5092
- class Vi {
5143
+ class ji {
5093
5144
  constructor(t) {
5094
5145
  c(this, "ctx");
5095
5146
  this.ctx = t;
@@ -5108,10 +5159,10 @@ class Vi {
5108
5159
  const {
5109
5160
  target: t,
5110
5161
  config: { SCROLLER_TRACK_SIZE: e }
5111
- } = this.ctx, i = t.width - e, s = t.height - e, r = this.getHeader(), o = this.getBody(), n = this.getFooter();
5112
- let l = [r, o, n];
5162
+ } = this.ctx, i = t.width - e, s = t.height - e, o = this.getHeader(), r = this.getBody(), n = this.getFooter();
5163
+ let l = [o, r, n];
5113
5164
  const { FOOTER_FIXED: h } = this.ctx.config;
5114
- return h || (l = [r, o]), {
5165
+ return h || (l = [o, r]), {
5115
5166
  style: {
5116
5167
  position: "absolute",
5117
5168
  left: "0px",
@@ -5129,7 +5180,7 @@ class Vi {
5129
5180
  fixedLeftWidth: t,
5130
5181
  fixedRightWidth: e,
5131
5182
  config: { SCROLLER_TRACK_SIZE: i, CSS_PREFIX: s }
5132
- } = this.ctx, { visibleWidth: r, visibleHeight: o, renderCellHeaders: n } = this.ctx.header;
5183
+ } = this.ctx, { visibleWidth: o, visibleHeight: r, renderCellHeaders: n } = this.ctx.header;
5133
5184
  let l = [], h = [], f = [];
5134
5185
  n.forEach((w) => {
5135
5186
  w.render && (w.fixed === "left" ? h.push(w) : w.fixed === "right" ? f.push(w) : l.push(w));
@@ -5142,7 +5193,7 @@ class Vi {
5142
5193
  left: `${0.5}px`,
5143
5194
  overflow: "hidden",
5144
5195
  width: `${t}px`,
5145
- height: `${o}px`
5196
+ height: `${r}px`
5146
5197
  },
5147
5198
  cells: h
5148
5199
  }, u = {
@@ -5152,8 +5203,8 @@ class Vi {
5152
5203
  top: `${0.5}px`,
5153
5204
  left: `${t}px`,
5154
5205
  overflow: "hidden",
5155
- width: `${r - t - d}px`,
5156
- height: `${o}px`
5206
+ width: `${o - t - d}px`,
5207
+ height: `${r}px`
5157
5208
  },
5158
5209
  cells: l
5159
5210
  }, y = {
@@ -5164,7 +5215,7 @@ class Vi {
5164
5215
  right: `${0.5}px`,
5165
5216
  overflow: "hidden",
5166
5217
  width: `${d}px`,
5167
- height: `${o}px`
5218
+ height: `${r}px`
5168
5219
  },
5169
5220
  cells: f
5170
5221
  };
@@ -5174,8 +5225,8 @@ class Vi {
5174
5225
  style: {
5175
5226
  position: "relative",
5176
5227
  overflow: "hidden",
5177
- width: `${r}px`,
5178
- height: `${o}px`
5228
+ width: `${o}px`,
5229
+ height: `${r}px`
5179
5230
  },
5180
5231
  views: [x, u, y]
5181
5232
  };
@@ -5189,17 +5240,17 @@ class Vi {
5189
5240
  });
5190
5241
  });
5191
5242
  const {
5192
- fixedLeftWidth: r,
5193
- fixedRightWidth: o,
5243
+ fixedLeftWidth: o,
5244
+ fixedRightWidth: r,
5194
5245
  config: { SCROLLER_TRACK_SIZE: n, CSS_PREFIX: l }
5195
- } = this.ctx, { visibleWidth: h, visibleHeight: f } = this.ctx.body, d = o - n, x = {
5246
+ } = this.ctx, { visibleWidth: h, visibleHeight: f } = this.ctx.body, d = r - n, x = {
5196
5247
  key: "left",
5197
5248
  style: {
5198
5249
  position: "absolute",
5199
5250
  top: `${0.5}px`,
5200
5251
  left: `${0.5}px`,
5201
5252
  overflow: "hidden",
5202
- width: `${r}px`,
5253
+ width: `${o}px`,
5203
5254
  height: `${f}px`
5204
5255
  },
5205
5256
  cells: e
@@ -5208,9 +5259,9 @@ class Vi {
5208
5259
  style: {
5209
5260
  position: "absolute",
5210
5261
  top: `${0.5}px`,
5211
- left: `${r + 0.5}px`,
5262
+ left: `${o + 0.5}px`,
5212
5263
  overflow: "hidden",
5213
- width: `${h - r - d}px`,
5264
+ width: `${h - o - d}px`,
5214
5265
  height: `${f}px`
5215
5266
  },
5216
5267
  cells: t
@@ -5247,9 +5298,9 @@ class Vi {
5247
5298
  });
5248
5299
  const {
5249
5300
  fixedLeftWidth: s,
5250
- fixedRightWidth: r,
5251
- config: { SCROLLER_TRACK_SIZE: o, CSS_PREFIX: n }
5252
- } = this.ctx, { visibleWidth: l, visibleHeight: h } = this.ctx.footer, f = r - o, d = {
5301
+ fixedRightWidth: o,
5302
+ config: { SCROLLER_TRACK_SIZE: r, CSS_PREFIX: n }
5303
+ } = this.ctx, { visibleWidth: l, visibleHeight: h } = this.ctx.footer, f = o - r, d = {
5253
5304
  key: "left",
5254
5305
  style: {
5255
5306
  position: "absolute",
@@ -5296,7 +5347,7 @@ class Vi {
5296
5347
  };
5297
5348
  }
5298
5349
  }
5299
- class zi {
5350
+ class Ui {
5300
5351
  constructor(t) {
5301
5352
  c(this, "ctx");
5302
5353
  c(this, "contextMenuEl");
@@ -5306,8 +5357,8 @@ class zi {
5306
5357
  this.ctx.on("cellContextMenuClick", (t, e) => {
5307
5358
  if (!this.ctx.config.ENABLE_CONTEXT_MENU) return;
5308
5359
  e.preventDefault();
5309
- const { xArr: i, yArr: s } = this.ctx.selector, [r, o] = i, [n, l] = s, { rowIndex: h, colIndex: f } = t;
5310
- h >= n && h <= l && f >= r && f <= o || this.ctx.emit("setSelectorCell", t, e);
5360
+ const { xArr: i, yArr: s } = this.ctx.selector, [o, r] = i, [n, l] = s, { rowIndex: h, colIndex: f } = t;
5361
+ h >= n && h <= l && f >= o && f <= r || this.ctx.emit("setSelectorCell", t, e);
5311
5362
  const x = {
5312
5363
  getBoundingClientRect: () => ({
5313
5364
  width: 0,
@@ -5321,9 +5372,9 @@ class zi {
5321
5372
  }),
5322
5373
  contextElement: document.body
5323
5374
  };
5324
- ge(x, this.contextMenuEl, {
5375
+ pe(x, this.contextMenuEl, {
5325
5376
  placement: "right-start",
5326
- middleware: [fe(), xe(), ue()]
5377
+ middleware: [ue(), ge(), we()]
5327
5378
  }).then(({ x: u, y }) => {
5328
5379
  this.show(u, y);
5329
5380
  });
@@ -5379,7 +5430,7 @@ class zi {
5379
5430
  this.contextMenuEl.remove();
5380
5431
  }
5381
5432
  }
5382
- class Gi {
5433
+ class Qi {
5383
5434
  constructor(t, e) {
5384
5435
  c(this, "targetContainer");
5385
5436
  c(this, "target");
@@ -5396,7 +5447,7 @@ class Gi {
5396
5447
  c(this, "overlayer");
5397
5448
  c(this, "contextMenu");
5398
5449
  c(this, "ctx");
5399
- this.target = document.createElement("canvas"), this.targetContainer = t, this.targetContainer.style.position = "relative", this.targetContainer.appendChild(this.target), this.options = e, this.ctx = new ri(this.targetContainer, this.target, this.options), this.header = new ni(this.ctx), this.body = new ai(this.ctx), this.footer = new ci(this.ctx), this.scroller = new oi(this.ctx), this.selector = new li(this.ctx), this.autofill = new hi(this.ctx), this.tooltip = new Bi(this.ctx), this.empty = new Pi(this.ctx), this.editor = new Wi(this.ctx), this.overlayer = new Vi(this.ctx), this.contextMenu = new zi(this.ctx), this.ctx.on("draw", this.draw.bind(this)), this.draw();
5450
+ this.target = document.createElement("canvas"), this.targetContainer = t, this.targetContainer.style.position = "relative", this.targetContainer.appendChild(this.target), this.options = e, this.ctx = new li(this.targetContainer, this.target, this.options), this.header = new di(this.ctx), this.body = new fi(this.ctx), this.footer = new xi(this.ctx), this.scroller = new hi(this.ctx), this.selector = new ui(this.ctx), this.autofill = new gi(this.ctx), this.tooltip = new $i(this.ctx), this.empty = new Gi(this.ctx), this.editor = new qi(this.ctx), this.overlayer = new ji(this.ctx), this.contextMenu = new Ui(this.ctx), this.ctx.on("draw", this.draw.bind(this)), this.draw();
5400
5451
  }
5401
5452
  draw() {
5402
5453
  requestAnimationFrame(() => {
@@ -5430,14 +5481,14 @@ class Gi {
5430
5481
  editCell(t, e) {
5431
5482
  this.editor.editCell(t, e);
5432
5483
  }
5433
- setItemValue(t, e, i, s = !0, r = !0, o = !1) {
5434
- this.ctx.database.setItemValue(t, e, i, s, r, o);
5484
+ setItemValue(t, e, i, s = !0, o = !0, r = !1) {
5485
+ this.ctx.database.setItemValue(t, e, i, s, o, r);
5435
5486
  }
5436
5487
  batchSetItemValue(t, e = !0, i = !0) {
5437
5488
  this.ctx.database.batchSetItemValue(t, e), i && this.ctx.emit("draw");
5438
5489
  }
5439
- setItemValueByEditor(t, e, i, s = !0, r = !0) {
5440
- this.ctx.database.setItemValue(t, e, i, s, r, !0), this.editor.doneEdit();
5490
+ setItemValueByEditor(t, e, i, s = !0, o = !0) {
5491
+ this.ctx.database.setItemValue(t, e, i, s, o, !0), this.editor.doneEdit();
5441
5492
  }
5442
5493
  doLayout() {
5443
5494
  this.ctx.emit("draw");
@@ -5458,9 +5509,9 @@ class Gi {
5458
5509
  e(s);
5459
5510
  } catch (s) {
5460
5511
  if (t && Array.isArray(s) && s.length) {
5461
- const [r] = s;
5462
- if (Array.isArray(r) && r.length) {
5463
- const [o] = r, { rowKey: n, key: l } = o;
5512
+ const [o] = s;
5513
+ if (Array.isArray(o) && o.length) {
5514
+ const [r] = o, { rowKey: n, key: l } = r;
5464
5515
  this.scrollToRowkey(n), this.scrollToColkey(l);
5465
5516
  }
5466
5517
  }
@@ -5470,8 +5521,8 @@ class Gi {
5470
5521
  }
5471
5522
  setValidations(t) {
5472
5523
  if (t.forEach((e) => {
5473
- const { rowIndex: i, key: s, message: r } = e;
5474
- this.ctx.database.setValidationErrorByRowIndex(i, s, r);
5524
+ const { rowIndex: i, key: s, message: o } = e;
5525
+ this.ctx.database.setValidationErrorByRowIndex(i, s, o);
5475
5526
  }), t && Array.isArray(t) && t.length) {
5476
5527
  const [e] = t;
5477
5528
  if (e && e.rowIndex >= 0 && e.key) {
@@ -5483,13 +5534,13 @@ class Gi {
5483
5534
  getValidations() {
5484
5535
  return new Promise(async (t, e) => {
5485
5536
  const i = this.ctx.database.getAllRowsData(), s = this.ctx.header.leafCellHeaders;
5486
- let r = [];
5487
- for (let o = 0; o < i.length; o++)
5537
+ let o = [];
5538
+ for (let r = 0; r < i.length; r++)
5488
5539
  for (let n = 0; n < s.length; n++) {
5489
- const l = this.ctx.database.getRowKeyByItem(i[o]), f = s[n].key, d = await this.ctx.database.getValidator(l, f);
5490
- Array.isArray(d) && d.length && r.push(d);
5540
+ const l = this.ctx.database.getRowKeyByItem(i[r]), f = s[n].key, d = await this.ctx.database.getValidator(l, f);
5541
+ Array.isArray(d) && d.length && o.push(d);
5491
5542
  }
5492
- r.length ? (e(r), this.ctx.emit("draw")) : (t([]), this.ctx.emit("draw"));
5543
+ o.length ? (e(o), this.ctx.emit("draw")) : (t([]), this.ctx.emit("draw"));
5493
5544
  });
5494
5545
  }
5495
5546
  scrollTo(t, e) {
@@ -5548,6 +5599,6 @@ class Gi {
5548
5599
  }
5549
5600
  }
5550
5601
  export {
5551
- Gi as default
5602
+ Qi as default
5552
5603
  };
5553
5604
  //# sourceMappingURL=index.es.js.map