e-virt-table 1.2.17 → 1.2.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +3 -3
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +496 -481
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +2 -2
- package/dist/index.umd.js.map +1 -1
- package/dist/lib/Cell.d.ts +2 -1
- package/dist/lib/Cell.js +7 -0
- package/dist/lib/Cell.js.map +1 -1
- package/dist/lib/Config.d.ts +3 -1
- package/dist/lib/Config.js +7 -0
- package/dist/lib/Config.js.map +1 -1
- package/dist/lib/Context.d.ts +2 -0
- package/dist/lib/Context.js +22 -3
- package/dist/lib/Context.js.map +1 -1
- package/dist/lib/Database.js +22 -1
- package/dist/lib/Database.js.map +1 -1
- package/dist/lib/types.d.ts +2 -0
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
(function(){"use strict";try{if(typeof document<"u"){var o=document.createElement("style");o.appendChild(document.createTextNode(":root{--evt-header-font: 12px normal Arial;--evt-body-font: 12px normal Arial;--evt-color-white: #fff;--evt-color-black: #000000;--evt-color-primary: rgb(82, 146, 247);--evt-text-color-primary: #333;--evt-text-color-regular: #666;--evt-text-color-secondary: #999;--evt-box-shadow: 0 2px 12px 0 #0000001a;--evt-editor-bg-color: #fff;--evt-editor-text-color: #333;--evt-border-color: #e1e6eb;--evt-stripe-color: #fafafa;--evt-placeholder-color: #cdd0dc;--evt-header-bg-color: #f8faff;--evt-body-bg-color: #fff;--evt-header-text-color: #1d2129;--evt-body-text-color: #4e5969;--evt-footer-text-color: #4e5969;--evt-loading-icon-color: #4e5969;--evt-expand-icon-color: #4e5969;--evt-shrink-icon-color: #4e5969;--evt-error-tip-icon-color: red;--evt-cell-hover-icon-bg-color: #fff;--evt-cell-hover-icon-border-color: #dde0ea;--evt-scroller-color: #dee0e3;--evt-scroller-track-color: #fff;--evt-scroller-focus-color: #bbbec4;--evt-select-border-color: var(--evt-color-primary);--evt-select-area-color: rgba(82, 146, 247, .1);--evt-select-row-col-bg-color: transparent;--evt-autofill-point-border-color: #fff;--evt-edit-bg-color: #fcf6ed;--evt-checkbox-color: var(--evt-color-primary);--evt-readonly-color: #fff;--evt-readonly-text-color: var(--evt-body-text-color);--evt-error-tip-color: #ed3f14;--evt-footer-bg-color: #fafafa;--evt-highlight-hover-row-color: rgba(186, 203, 231, .1);--evt-highlight-selected-row-color: rgba(82, 146, 247, .1);--evt-tooltip-bg-color: #303133;--evt-tooltip-text-color: #fff;--evt-resize-row-line-color: #e1e6eb;--evt-resize-column-line-color: #e1e6eb}.dark{--evt-border-color: #363637;--evt-header-bg-color: #141414;--evt-body-bg-color: #141414;--evt-header-text-color: #a3a6ad;--evt-scroller-color: #414243;--evt-scroller-track-color: #141414;--evt-scroller-focus-color: #a3a6ad;--evt-edit-bg-color: #141414;--evt-readonly-text-color: #cfd3dc;--evt-footer-bg-color: #262727;--evt-autofill-point-border-color: #fff;--evt-editor-bg-color: #434343;--evt-editor-text-color: #cfd3dc}.e-virt-table-container{position:relative;outline:none}.e-virt-table-stage{position:relative;overflow:hidden;outline:none;box-sizing:border-box;z-index:10;border-radius:8px;border:1px solid var(--evt-border-color)}.e-virt-table-canvas{position:absolute;left:0;top:0;box-sizing:border-box;border:none;outline:none;z-index:10}.e-virt-table-editor{position:absolute;top:-10000px;left:-10000px;text-align:left;height:auto;line-height:0;z-index:100;overflow:hidden;background-color:var(--evt-editor-bg-color);border:2px solid var(--evt-color-primary);box-sizing:border-box;box-shadow:var(--evt-box-shadow);display:flex;align-items:center}.e-virt-table-overlayer{position:absolute;left:0;top:0;overflow:hidden;z-index:100;pointer-events:none}.e-virt-table-editor-textarea{width:100%;box-sizing:border-box;outline:none;font-weight:400;padding:8px;font-size:12px;color:inherit;white-space:pre-wrap;word-wrap:break-word;word-break:break-all;line-height:1.5;margin:0;border:none;vertical-align:middle;background:var(--evt-editor-bg-color);color:var(--evt-editor-text-color);overflow-y:auto;resize:none}.e-virt-table-context-menu{position:absolute;font-size:14px;color:var(--evt-text-color-regular);background-color:var(--evt-color-white);border-radius:4px;border:1px solid #e4e7ed;box-shadow:var(--evt-box-shadow);width:fit-content;padding:6px 0;z-index:9999;left:-99999px;top:-99999px}.e-virt-table-context-menu-item{cursor:pointer;padding:8px 24px;color:var(--evt-text-color-regular)}.e-virt-table-context-menu-item:hover{color:var(--evt-color-primary);background-color:#f5f7fa}")),document.head.appendChild(o)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
|
|
2
2
|
var Jt = Object.defineProperty;
|
|
3
|
-
var Qt = (
|
|
4
|
-
var n = (
|
|
3
|
+
var Qt = (c, t, e) => t in c ? Jt(c, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : c[t] = e;
|
|
4
|
+
var n = (c, t, e) => Qt(c, typeof t != "symbol" ? t + "" : t, e);
|
|
5
5
|
class te {
|
|
6
6
|
constructor(t) {
|
|
7
7
|
n(this, "rules");
|
|
8
8
|
this.rules = t;
|
|
9
9
|
}
|
|
10
10
|
validate(t) {
|
|
11
|
-
const e = [], { column: i, row: s, key: o, rowKey: r, colIndex: l, rowIndex: a, value:
|
|
11
|
+
const e = [], { column: i, row: s, key: o, rowKey: r, colIndex: l, rowIndex: a, value: h, field: d, fieldValue: f } = t;
|
|
12
12
|
Array.isArray(this.rules) || (this.rules = [this.rules]);
|
|
13
13
|
for (const x of this.rules) {
|
|
14
14
|
if (x.validator) {
|
|
15
15
|
const u = {
|
|
16
16
|
field: d,
|
|
17
17
|
fieldValue: f,
|
|
18
|
-
value:
|
|
18
|
+
value: h,
|
|
19
19
|
column: i,
|
|
20
20
|
colIndex: l,
|
|
21
21
|
rowIndex: a,
|
|
@@ -24,15 +24,15 @@ class te {
|
|
|
24
24
|
rowKey: r,
|
|
25
25
|
...x
|
|
26
26
|
};
|
|
27
|
-
x.validator(u,
|
|
27
|
+
x.validator(u, h, (p) => {
|
|
28
28
|
p && e.push({
|
|
29
29
|
...u,
|
|
30
30
|
message: p
|
|
31
31
|
});
|
|
32
32
|
});
|
|
33
33
|
}
|
|
34
|
-
x.pattern && !x.pattern.test(
|
|
35
|
-
value:
|
|
34
|
+
x.pattern && !x.pattern.test(h) && e.push({
|
|
35
|
+
value: h,
|
|
36
36
|
column: i,
|
|
37
37
|
row: s,
|
|
38
38
|
key: o,
|
|
@@ -42,8 +42,8 @@ class te {
|
|
|
42
42
|
field: d,
|
|
43
43
|
fieldValue: f,
|
|
44
44
|
message: x.message || `${o} is pattern validation error`
|
|
45
|
-
}), x.required && (
|
|
46
|
-
value:
|
|
45
|
+
}), x.required && (h == null || h === "") && e.push({
|
|
46
|
+
value: h,
|
|
47
47
|
column: i,
|
|
48
48
|
row: s,
|
|
49
49
|
key: o,
|
|
@@ -59,26 +59,26 @@ class te {
|
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
function St() {
|
|
62
|
-
return "xxxxxxxxxxxxxxxxxx".replace(/[x]/g, function(
|
|
62
|
+
return "xxxxxxxxxxxxxxxxxx".replace(/[x]/g, function(c) {
|
|
63
63
|
const t = Math.random() * 16 | 0;
|
|
64
|
-
return (
|
|
64
|
+
return (c === "x" ? t : t & 3 | 8).toString(16);
|
|
65
65
|
});
|
|
66
66
|
}
|
|
67
|
-
function Lt(
|
|
67
|
+
function Lt(c, t) {
|
|
68
68
|
let e = 0, i;
|
|
69
69
|
return function(...s) {
|
|
70
70
|
const o = (/* @__PURE__ */ new Date()).getTime(), r = o - e;
|
|
71
|
-
!e || r >= t ? (
|
|
72
|
-
|
|
71
|
+
!e || r >= t ? (c.apply(this, s), e = o) : i || (i = setTimeout(() => {
|
|
72
|
+
c.apply(this, s), e = (/* @__PURE__ */ new Date()).getTime(), i = void 0;
|
|
73
73
|
}, t - r));
|
|
74
74
|
};
|
|
75
75
|
}
|
|
76
|
-
function Tt(
|
|
77
|
-
return
|
|
76
|
+
function Tt(c = []) {
|
|
77
|
+
return c.length ? c.map((t) => Tt(t.children) + 1).sort((t, e) => e - t)[0] : 0;
|
|
78
78
|
}
|
|
79
|
-
function ee(
|
|
79
|
+
function ee(c = []) {
|
|
80
80
|
let t = [], e = [], i = [];
|
|
81
|
-
return
|
|
81
|
+
return c.forEach((s) => {
|
|
82
82
|
s.fixed === "left" ? t.push(s) : s.fixed === "right" ? i.push(s) : e.push(s);
|
|
83
83
|
}), [
|
|
84
84
|
...t.sort((s, o) => (s.sort ?? 0) - (o.sort ?? 0)),
|
|
@@ -86,8 +86,8 @@ function ee(h = []) {
|
|
|
86
86
|
...i.sort((s, o) => (s.sort ?? 0) - (o.sort ?? 0))
|
|
87
87
|
];
|
|
88
88
|
}
|
|
89
|
-
function At(
|
|
90
|
-
return
|
|
89
|
+
function At(c = [], t = 1, e = 0) {
|
|
90
|
+
return c.map((i) => {
|
|
91
91
|
if (i.children) {
|
|
92
92
|
let s = 0, o = i.fixed;
|
|
93
93
|
i.children.forEach((l) => {
|
|
@@ -113,72 +113,72 @@ function At(h = [], t = 1, e = 0) {
|
|
|
113
113
|
};
|
|
114
114
|
});
|
|
115
115
|
}
|
|
116
|
-
function
|
|
116
|
+
function et(c = []) {
|
|
117
117
|
let t = [];
|
|
118
|
-
return
|
|
119
|
-
e.children ? t = t.concat(
|
|
118
|
+
return c.forEach((e) => {
|
|
119
|
+
e.children ? t = t.concat(et(e.children)) : t.push(e);
|
|
120
120
|
}), t;
|
|
121
121
|
}
|
|
122
122
|
const mt = /^(\r\n|\n\r|\r|\n)/, ie = /^[^\t\r\n]+/, yt = /^\t/;
|
|
123
|
-
function se(
|
|
123
|
+
function se(c) {
|
|
124
124
|
let t = [[""]];
|
|
125
|
-
if (
|
|
125
|
+
if (c.length === 0)
|
|
126
126
|
return t;
|
|
127
127
|
let e = 0, i = 0, s;
|
|
128
|
-
for (;
|
|
129
|
-
if (s =
|
|
130
|
-
|
|
131
|
-
else if (
|
|
132
|
-
|
|
128
|
+
for (; c.length > 0 && s !== c.length; )
|
|
129
|
+
if (s = c.length, c.match(yt))
|
|
130
|
+
c = c.replace(yt, ""), e += 1, t[i][e] = "";
|
|
131
|
+
else if (c.match(mt))
|
|
132
|
+
c = c.replace(mt, ""), e = 0, i += 1, t[i] = [""];
|
|
133
133
|
else {
|
|
134
134
|
let o = "";
|
|
135
|
-
if (
|
|
135
|
+
if (c.startsWith('"')) {
|
|
136
136
|
let r = 0, l = !0;
|
|
137
137
|
for (; l; ) {
|
|
138
|
-
const a =
|
|
139
|
-
a === '"' && (r += 1), o += a,
|
|
138
|
+
const a = c.slice(0, 1);
|
|
139
|
+
a === '"' && (r += 1), o += a, c = c.slice(1), (c.length === 0 || c.match(/^[\t\r\n]/) && r % 2 === 0) && (l = !1);
|
|
140
140
|
}
|
|
141
141
|
o = o.replace(/^"/, "").replace(/"$/, "").replace(/["]*/g, (a) => new Array(Math.floor(a.length / 2)).fill('"').join(""));
|
|
142
142
|
} else {
|
|
143
|
-
const r =
|
|
144
|
-
o = r ? r[0] : "",
|
|
143
|
+
const r = c.match(ie);
|
|
144
|
+
o = r ? r[0] : "", c = c.slice(o.length);
|
|
145
145
|
}
|
|
146
146
|
t[i][e] = o;
|
|
147
147
|
}
|
|
148
148
|
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;
|
|
149
149
|
}
|
|
150
|
-
function oe(
|
|
150
|
+
function oe(c) {
|
|
151
151
|
let t, e, i, s, o = "", r;
|
|
152
|
-
for (t = 0, e =
|
|
153
|
-
for (s =
|
|
154
|
-
i > 0 && (o += " "), r =
|
|
152
|
+
for (t = 0, e = c.length; t < e; t += 1) {
|
|
153
|
+
for (s = c[t].length, i = 0; i < s; i += 1)
|
|
154
|
+
i > 0 && (o += " "), r = c[t][i], typeof r == "string" ? r.indexOf(`
|
|
155
155
|
`) > -1 ? o += `"${r.replace(/"/g, '""')}"` : o += r : r == null ? o += "" : o += r;
|
|
156
156
|
t !== e - 1 && (o += `
|
|
157
157
|
`);
|
|
158
158
|
}
|
|
159
159
|
return o;
|
|
160
160
|
}
|
|
161
|
-
function Mt(
|
|
161
|
+
function Mt(c, t, e = []) {
|
|
162
162
|
let i = 0;
|
|
163
163
|
const s = [];
|
|
164
|
-
return
|
|
164
|
+
return c.forEach((o, r) => {
|
|
165
165
|
if (r === 0)
|
|
166
166
|
s.push(1);
|
|
167
167
|
else {
|
|
168
|
-
const l = e.reduce((
|
|
168
|
+
const l = e.reduce((h, d) => `${h}${o[d] ?? ""}`, "") || o[t], a = e.reduce((h, d) => `${h}${c[r - 1][d] ?? ""}`, "") || c[r - 1][t];
|
|
169
169
|
l === a ? (s[i] += 1, s.push(0)) : (s.push(1), i = r);
|
|
170
170
|
}
|
|
171
171
|
}), s;
|
|
172
172
|
}
|
|
173
|
-
function Ht(
|
|
173
|
+
function Ht(c, t) {
|
|
174
174
|
let e = "", i = "";
|
|
175
175
|
const s = {};
|
|
176
176
|
return t.forEach((o, r) => {
|
|
177
|
-
r === 0 ? (e = o.key, i = o.key, s[o.key] = 1) :
|
|
177
|
+
r === 0 ? (e = o.key, i = o.key, s[o.key] = 1) : c[o.key] === c[e] ? (s[o.key] = 0, s[i] += 1) : (s[o.key] = 1, e = o.key, i = o.key);
|
|
178
178
|
}), s;
|
|
179
179
|
}
|
|
180
|
-
function re(
|
|
181
|
-
const { visibleRows: i, rowIndex: s, headIndex: o } =
|
|
180
|
+
function re(c, t, e = []) {
|
|
181
|
+
const { visibleRows: i, rowIndex: s, headIndex: o } = c, r = Mt(i, t, e);
|
|
182
182
|
return r[s - o] === 0 ? {
|
|
183
183
|
rowspan: 0,
|
|
184
184
|
colspan: 0,
|
|
@@ -191,8 +191,8 @@ function re(h, t, e = []) {
|
|
|
191
191
|
mergeRow: !0
|
|
192
192
|
};
|
|
193
193
|
}
|
|
194
|
-
function ne(
|
|
195
|
-
const { column: e, row: i, visibleLeafColumns: s } =
|
|
194
|
+
function ne(c, t = []) {
|
|
195
|
+
const { column: e, row: i, visibleLeafColumns: s } = c, o = s.filter((r) => t.includes(r.key));
|
|
196
196
|
if (t.includes(e.key)) {
|
|
197
197
|
const r = Ht(i, o);
|
|
198
198
|
return r[e.key] === 0 ? {
|
|
@@ -208,8 +208,8 @@ function ne(h, t = []) {
|
|
|
208
208
|
};
|
|
209
209
|
}
|
|
210
210
|
}
|
|
211
|
-
function le(
|
|
212
|
-
const e =
|
|
211
|
+
function le(c, t = document.documentElement) {
|
|
212
|
+
const e = c.startsWith("--") ? c : `--${c}`;
|
|
213
213
|
return getComputedStyle(t).getPropertyValue(e).trim();
|
|
214
214
|
}
|
|
215
215
|
class Dt {
|
|
@@ -259,8 +259,8 @@ class Dt {
|
|
|
259
259
|
}
|
|
260
260
|
}
|
|
261
261
|
class ut extends Dt {
|
|
262
|
-
constructor(e, i, s, o, r, l, a,
|
|
263
|
-
super(e, o, r, l, a, f,
|
|
262
|
+
constructor(e, i, s, o, r, l, a, h, d, f = "body") {
|
|
263
|
+
super(e, o, r, l, a, f, h.fixed);
|
|
264
264
|
n(this, "formatter");
|
|
265
265
|
n(this, "formatterFooter");
|
|
266
266
|
n(this, "hoverIconName", "");
|
|
@@ -315,9 +315,10 @@ class ut extends Dt {
|
|
|
315
315
|
n(this, "rowExpand", !1);
|
|
316
316
|
n(this, "rowHasChildren", !1);
|
|
317
317
|
n(this, "overflowTooltipShow", !0);
|
|
318
|
+
n(this, "selectorCellValueType", "value");
|
|
318
319
|
n(this, "overflowTooltipMaxWidth", 500);
|
|
319
320
|
n(this, "overflowTooltipPlacement", "top");
|
|
320
|
-
this.visibleWidth = this.width, this.visibleHeight = this.height, this.colIndex = s, this.rowIndex = i, this.key =
|
|
321
|
+
this.visibleWidth = this.width, this.visibleHeight = this.height, this.colIndex = s, this.rowIndex = i, this.key = h.key, this.type = h.type || "", this.editorType = h.editorType || "text", this.selectorCellValueType = h.selectorCellValueType || this.ctx.config.SELECTOR_CELL_VALUE_TYPE || "value", this.editorProps = h.editorProps || {}, this.cellType = f, this.align = h.align || "center", this.verticalAlign = h.verticalAlign || "middle", this.fixed = h.fixed, this.level = h.level || 0, this.operation = h.operation || !1, this.column = h, this.rules = h.rules || [], this.row = d, 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.formatterFooter = h.formatterFooter, this.update();
|
|
321
322
|
}
|
|
322
323
|
setWidthHeight(e, i) {
|
|
323
324
|
this.width = e, this.height = i;
|
|
@@ -344,7 +345,7 @@ class ut extends Dt {
|
|
|
344
345
|
relationRowKeys: r,
|
|
345
346
|
relationColKeys: l,
|
|
346
347
|
mergeRow: a = !1,
|
|
347
|
-
mergeCol:
|
|
348
|
+
mergeCol: h = !1
|
|
348
349
|
} = i({
|
|
349
350
|
row: this.row,
|
|
350
351
|
rowIndex: this.rowIndex,
|
|
@@ -357,7 +358,7 @@ class ut extends Dt {
|
|
|
357
358
|
visibleLeafColumns: this.ctx.header.visibleLeafColumns,
|
|
358
359
|
rows: this.ctx.body.data
|
|
359
360
|
}) || {};
|
|
360
|
-
Array.isArray(r) && r.length > 0 ? this.relationRowKeys = r : this.relationRowKeys = [this.key], Array.isArray(l) && l.length > 0 ? this.relationColKeys = l : this.relationColKeys = [this.key], this.mergeCol =
|
|
361
|
+
Array.isArray(r) && r.length > 0 ? this.relationRowKeys = r : this.relationRowKeys = [this.key], Array.isArray(l) && l.length > 0 ? this.relationColKeys = l : this.relationColKeys = [this.key], this.mergeCol = h, this.mergeRow = a, this.colspan = s, this.rowspan = o, this.visibleWidth = this.getWidthByColIndexColSpan(this.colIndex, this.colspan), this.visibleHeight = this.ctx.database.getHeightByRowIndexRowSpan(this.rowIndex, this.rowspan);
|
|
361
362
|
}
|
|
362
363
|
}
|
|
363
364
|
updateSpanInfo() {
|
|
@@ -430,13 +431,13 @@ class ut extends Dt {
|
|
|
430
431
|
const { CELL_PADDING: e = 0 } = this.ctx.config, { rowKey: i, cellType: s } = this;
|
|
431
432
|
let o, r = 0, l = "";
|
|
432
433
|
if (this.type === "tree" && s === "body") {
|
|
433
|
-
const a = this.ctx.database.getRowForRowKey(i), { expand:
|
|
434
|
-
if (this.rowExpand =
|
|
434
|
+
const a = this.ctx.database.getRowForRowKey(i), { expand: h = !1, hasChildren: d = !1, expandLoading: f = !1, level: x = 0 } = a || {};
|
|
435
|
+
if (this.rowExpand = h, this.rowHasChildren = d, f) {
|
|
435
436
|
const w = this.ctx.icons.get("loading");
|
|
436
437
|
l = "loading", o = w, r = x * 8;
|
|
437
438
|
} else if (d) {
|
|
438
439
|
const w = this.ctx.icons.get("expand"), g = this.ctx.icons.get("shrink");
|
|
439
|
-
o =
|
|
440
|
+
o = h ? g : w, l = h ? "shrink" : "expand", r = x * 8;
|
|
440
441
|
} else
|
|
441
442
|
r = x * 8;
|
|
442
443
|
let u = 20, p = 20;
|
|
@@ -456,7 +457,7 @@ class ut extends Dt {
|
|
|
456
457
|
READONLY_TEXT_COLOR: r,
|
|
457
458
|
BODY_TEXT_COLOR: l,
|
|
458
459
|
FOOTER_TEXT_COLOR: a,
|
|
459
|
-
FOOTER_BG_COLOR:
|
|
460
|
+
FOOTER_BG_COLOR: h,
|
|
460
461
|
HIGHLIGHT_SELECTED_ROW: d,
|
|
461
462
|
HIGHLIGHT_SELECTED_ROW_COLOR: f,
|
|
462
463
|
HIGHLIGHT_HOVER_ROW: x,
|
|
@@ -465,7 +466,7 @@ class ut extends Dt {
|
|
|
465
466
|
STRIPE_COLOR: w
|
|
466
467
|
} = this.ctx.config;
|
|
467
468
|
if (this.cellType === "footer") {
|
|
468
|
-
let _ =
|
|
469
|
+
let _ = h, S = a;
|
|
469
470
|
if (typeof o == "function") {
|
|
470
471
|
const v = o, { backgroundColor: b, color: O } = v({
|
|
471
472
|
row: this.row,
|
|
@@ -502,9 +503,9 @@ class ut extends Dt {
|
|
|
502
503
|
this.drawCellBgColor = y, this.drawTextColor = I;
|
|
503
504
|
}
|
|
504
505
|
updateSelection() {
|
|
505
|
-
const { visibleWidth: e, visibleHeight: i, rowspan: s, colspan: o, cellType: r, type: l, rowIndex: a, rowKey:
|
|
506
|
+
const { visibleWidth: e, visibleHeight: i, rowspan: s, colspan: o, cellType: r, type: l, rowIndex: a, rowKey: h } = this;
|
|
506
507
|
if (!(s === 0 || o === 0) && r !== "footer" && ["index-selection", "selection"].includes(l)) {
|
|
507
|
-
const d = this.ctx.database.getRowSelection(
|
|
508
|
+
const d = this.ctx.database.getRowSelection(h), f = this.ctx.database.getRowSelectable(h), { CHECKBOX_SIZE: x = 0 } = this.ctx.config, u = this.drawX + (e - x) / 2, p = this.drawY + (i - x) / 2;
|
|
508
509
|
let w = this.ctx.icons.get("checkbox-uncheck"), g = "checkbox-uncheck";
|
|
509
510
|
d && f ? (w = this.ctx.icons.get("checkbox-check"), g = "checkbox-check") : d && f ? (w = this.ctx.icons.get("checkbox-check-disabled"), g = "checkbox-check-disabled") : !d && f ? (w = this.ctx.icons.get("checkbox-uncheck"), g = "checkbox-uncheck") : (w = this.ctx.icons.get("checkbox-disabled"), g = "checkbox-disabled"), w && l == "index-selection" ? (this.ctx.hoverCell && this.ctx.hoverCell.rowIndex === a || ["checkbox-disabled", "checkbox-check"].includes(g)) && (this.drawImageX = u, this.drawImageY = p, this.drawImageWidth = x, this.drawImageHeight = x, this.drawImageName = g, this.drawImageSource = w) : w && l === "selection" && (this.drawImageX = u, this.drawImageY = p, this.drawImageWidth = x, this.drawImageHeight = x, this.drawImageName = g, this.drawImageSource = w);
|
|
510
511
|
}
|
|
@@ -514,27 +515,27 @@ class ut extends Dt {
|
|
|
514
515
|
return;
|
|
515
516
|
const { BODY_CELL_HOVER_ICON_METHOD: i, CELL_HOVER_ICON_SIZE: s, CELL_PADDING: o, ENABLE_MERGE_CELL_LINK: r } = this.ctx.config;
|
|
516
517
|
if (typeof i == "function") {
|
|
517
|
-
const
|
|
518
|
+
const h = i({
|
|
518
519
|
row: this.row,
|
|
519
520
|
rowIndex: this.rowIndex,
|
|
520
521
|
colIndex: this.colIndex,
|
|
521
522
|
column: this.column,
|
|
522
523
|
value: this.getValue()
|
|
523
524
|
});
|
|
524
|
-
|
|
525
|
+
h !== void 0 && (this.hoverIconName = h);
|
|
525
526
|
}
|
|
526
527
|
const { hoverCell: l } = this.ctx;
|
|
527
528
|
if (this.hoverIconName && !this.ctx.editing && l) {
|
|
528
|
-
let a = 0,
|
|
529
|
-
if (l.rowKey === this.rowKey && (a = this.drawX + this.width - s - o,
|
|
529
|
+
let a = 0, h = 0;
|
|
530
|
+
if (l.rowKey === this.rowKey && (a = this.drawX + this.width - s - o, h = this.drawY + (this.height - s) / 2), this.rowspan !== 1 && r) {
|
|
530
531
|
const f = this.getSpanInfo(), { yArr: x } = f, u = x[0], p = x[1];
|
|
531
532
|
if (l.rowIndex >= u && l.rowIndex <= p) {
|
|
532
533
|
const { width: w, height: g, offsetTop: E, offsetLeft: C } = f;
|
|
533
|
-
a = this.drawX - C + w - s - o,
|
|
534
|
+
a = this.drawX - C + w - s - o, h = this.drawY - E + (g - s) / 2;
|
|
534
535
|
}
|
|
535
536
|
}
|
|
536
537
|
const d = this.ctx.icons.get(this.hoverIconName);
|
|
537
|
-
this.drawImageX = a, this.drawImageY =
|
|
538
|
+
this.drawImageX = a, this.drawImageY = h, this.drawImageWidth = s, this.drawImageHeight = s, this.drawImageName = this.hoverIconName, this.drawImageSource = d;
|
|
538
539
|
}
|
|
539
540
|
}
|
|
540
541
|
// 过去跨度配置
|
|
@@ -629,8 +630,8 @@ class ut extends Dt {
|
|
|
629
630
|
const { SELECT_BORDER_COLOR: e, ENABLE_AUTOFILL: i, ENABLE_SELECTOR: s, AUTOFILL_POINT_BORDER_COLOR: o } = this.ctx.config;
|
|
630
631
|
if (!s || !i || this.ctx.editing)
|
|
631
632
|
return;
|
|
632
|
-
const { xArr: r, yArr: l } = this.ctx.selector, a = r[1],
|
|
633
|
-
if (d === a && f ===
|
|
633
|
+
const { xArr: r, yArr: l } = this.ctx.selector, a = r[1], h = l[1], { colIndex: d, rowIndex: f, drawX: x, drawY: u } = this;
|
|
634
|
+
if (d === a && f === h) {
|
|
634
635
|
const w = d === this.ctx.maxColIndex || f === this.ctx.maxRowIndex || d === this.ctx.lastCenterColIndex ? 6 : 4;
|
|
635
636
|
this.ctx.paint.drawRect(x + this.width - w, u + this.height - w, 6, 6, {
|
|
636
637
|
borderColor: o,
|
|
@@ -665,13 +666,13 @@ class ut extends Dt {
|
|
|
665
666
|
const { ellipsis: r } = this.ctx.paint.handleEllipsis(this.displayText, o, e, i);
|
|
666
667
|
this.ellipsis = r;
|
|
667
668
|
const { placeholder: l } = this.column;
|
|
668
|
-
let a = this.displayText,
|
|
669
|
-
return !this.ctx.database.getReadonly(this.rowKey, this.key) && l && ["", null, void 0].includes(this.text) && this.cellType === "body" && !(this.rowspan === 0 || this.colspan === 0) && (a = l,
|
|
669
|
+
let a = this.displayText, h = this.drawTextColor;
|
|
670
|
+
return !this.ctx.database.getReadonly(this.rowKey, this.key) && l && ["", null, void 0].includes(this.text) && this.cellType === "body" && !(this.rowspan === 0 || this.colspan === 0) && (a = l, h = s), this.ctx.paint.drawText(a, this.drawTextX, this.drawTextY, o, this.visibleHeight, {
|
|
670
671
|
font: i,
|
|
671
672
|
padding: e,
|
|
672
673
|
align: this.align,
|
|
673
674
|
verticalAlign: this.verticalAlign,
|
|
674
|
-
color:
|
|
675
|
+
color: h
|
|
675
676
|
});
|
|
676
677
|
}
|
|
677
678
|
drawImage() {
|
|
@@ -728,11 +729,11 @@ class ut extends Dt {
|
|
|
728
729
|
fillColor: "transparent",
|
|
729
730
|
borderWidth: 1
|
|
730
731
|
});
|
|
731
|
-
const [l, a] = i, [
|
|
732
|
-
!(l === a &&
|
|
732
|
+
const [l, a] = i, [h, d] = s;
|
|
733
|
+
!(l === a && h === d) && this.colIndex >= l && this.colIndex <= a && this.rowIndex >= h && this.rowIndex <= d && this.ctx.paint.drawRect(this.drawX, this.drawY, this.width, this.height, {
|
|
733
734
|
borderColor: "transparent",
|
|
734
735
|
fillColor: this.ctx.config.SELECT_AREA_COLOR || "rgba(82,146,247,0.1)"
|
|
735
|
-
}), this.operation && this.rowIndex >=
|
|
736
|
+
}), this.operation && this.rowIndex >= h && this.rowIndex <= d && this.ctx.paint.drawRect(this.drawX, this.drawY, this.visibleWidth, this.visibleHeight, {
|
|
736
737
|
borderColor: "transparent",
|
|
737
738
|
fillColor: this.ctx.config.SELECT_ROW_COL_BG_COLOR || "transparent"
|
|
738
739
|
});
|
|
@@ -758,11 +759,11 @@ class ut extends Dt {
|
|
|
758
759
|
}
|
|
759
760
|
drawBorder(e) {
|
|
760
761
|
const { drawX: i, drawY: s, rowIndex: o, colIndex: r, height: l, width: a } = this;
|
|
761
|
-
let
|
|
762
|
+
let h = i, d = s;
|
|
762
763
|
const { xArr: f, yArr: x, lineDash: u = [], borderWidth: p = 1, borderColor: w, fillColor: g } = e, E = f[0], C = f[1], m = x[0], R = x[1];
|
|
763
764
|
if (r >= E && r <= C && o === m) {
|
|
764
765
|
const y = r === C ? 1 : 0, I = r === E ? 1 : 0;
|
|
765
|
-
this.ctx.paint.drawLine([
|
|
766
|
+
this.ctx.paint.drawLine([h + I, d + 1, h + a - y, d + 1], {
|
|
766
767
|
borderColor: w,
|
|
767
768
|
fillColor: g,
|
|
768
769
|
borderWidth: p,
|
|
@@ -773,7 +774,7 @@ class ut extends Dt {
|
|
|
773
774
|
}
|
|
774
775
|
if (r === C && o >= m && o <= R) {
|
|
775
776
|
const y = o === m ? 1 : 0, I = o === R ? 1 : 0;
|
|
776
|
-
this.ctx.paint.drawLine([
|
|
777
|
+
this.ctx.paint.drawLine([h + a - 1, d + y, h + a - 1, d + l - I], {
|
|
777
778
|
borderColor: w,
|
|
778
779
|
fillColor: g,
|
|
779
780
|
borderWidth: p,
|
|
@@ -784,7 +785,7 @@ class ut extends Dt {
|
|
|
784
785
|
}
|
|
785
786
|
if (r >= E && r <= C && o === R) {
|
|
786
787
|
const y = r === C ? 1 : 0, I = r === E ? 1 : 0;
|
|
787
|
-
this.ctx.paint.drawLine([
|
|
788
|
+
this.ctx.paint.drawLine([h + I, d + l - 1, h + a - y, d + l - 1], {
|
|
788
789
|
borderColor: w,
|
|
789
790
|
fillColor: g,
|
|
790
791
|
borderWidth: p,
|
|
@@ -795,7 +796,7 @@ class ut extends Dt {
|
|
|
795
796
|
}
|
|
796
797
|
if (r === E && o >= m && o <= R) {
|
|
797
798
|
const y = o === R ? 1 : 0, I = o === m ? 1 : 0;
|
|
798
|
-
this.ctx.paint.drawLine([
|
|
799
|
+
this.ctx.paint.drawLine([h + 1, d + I, h + 1, d + l - y], {
|
|
799
800
|
borderColor: w,
|
|
800
801
|
fillColor: g,
|
|
801
802
|
borderWidth: p,
|
|
@@ -842,7 +843,14 @@ class ae {
|
|
|
842
843
|
}
|
|
843
844
|
// 初始化默认不忽略清空改变值和校验map
|
|
844
845
|
init(t = !0) {
|
|
845
|
-
this.clearBufferData(), this.rowKeyMap.clear(), this.checkboxKeyMap.clear(), this.colIndexKeyMap.clear(), this.rowIndexRowKeyMap.clear(), this.rowKeyRowIndexMap.clear()
|
|
846
|
+
this.clearBufferData(), this.rowKeyMap.clear(), this.checkboxKeyMap.clear(), this.colIndexKeyMap.clear(), this.rowIndexRowKeyMap.clear(), this.rowKeyRowIndexMap.clear();
|
|
847
|
+
const e = this.getColumns(), i = et(e);
|
|
848
|
+
if (this.ctx.hasSelection = i.some((s) => s.type === "selection"), this.ctx.hasTree = i.some((s) => s.type === "tree"), t) {
|
|
849
|
+
this.originalDataMap.clear(), this.changedDataMap.clear(), this.validationErrorMap.clear();
|
|
850
|
+
const { ROW_KEY: s } = this.ctx.config;
|
|
851
|
+
s ? (this.ctx.hasSelection || this.selectionMap.clear(), this.ctx.hasTree || this.expandMap.clear()) : (this.selectionMap.clear(), this.expandMap.clear());
|
|
852
|
+
}
|
|
853
|
+
this.itemRowKeyMap = /* @__PURE__ */ new WeakMap(), this.initData(this.data), this.getData(), this.bufferCheckState.buffer = !1;
|
|
846
854
|
}
|
|
847
855
|
/**
|
|
848
856
|
* 清除缓存数据
|
|
@@ -858,11 +866,11 @@ class ae {
|
|
|
858
866
|
initData(t, e = 0, i = []) {
|
|
859
867
|
t.forEach((s, o) => {
|
|
860
868
|
var E;
|
|
861
|
-
const { ROW_KEY: r = "", DEFAULT_EXPAND_ALL: l, CELL_HEIGHT: a, SELECTABLE_METHOD:
|
|
869
|
+
const { ROW_KEY: r = "", DEFAULT_EXPAND_ALL: l, CELL_HEIGHT: a, SELECTABLE_METHOD: h, CHECKBOX_KEY: d } = this.ctx.config, f = s[r], x = f != null ? `${f}` : St();
|
|
862
870
|
this.itemRowKeyMap.set(s, x);
|
|
863
871
|
const u = s._height || a, p = s._readonly;
|
|
864
872
|
let w = !0;
|
|
865
|
-
if (typeof
|
|
873
|
+
if (typeof h == "function" && (w = h), d) {
|
|
866
874
|
const C = s[d];
|
|
867
875
|
if (this.checkboxKeyMap.has(C)) {
|
|
868
876
|
const m = this.checkboxKeyMap.get(C) || [];
|
|
@@ -952,12 +960,12 @@ class ae {
|
|
|
952
960
|
const i = (o) => {
|
|
953
961
|
o.forEach((r) => {
|
|
954
962
|
t.push(r);
|
|
955
|
-
const l = this.itemRowKeyMap.get(r), { expand: a, hasChildren:
|
|
963
|
+
const l = this.itemRowKeyMap.get(r), { expand: a, hasChildren: h, height: d } = this.rowKeyMap.get(l), f = this.sumHeight;
|
|
956
964
|
this.sumHeight += d, this.rowIndexRowKeyMap.set(e, l), this.rowKeyRowIndexMap.set(l, e), this.positions.push({
|
|
957
965
|
top: f,
|
|
958
966
|
height: d,
|
|
959
967
|
bottom: this.sumHeight
|
|
960
|
-
}), e += 1, a &&
|
|
968
|
+
}), e += 1, a && h && i(r.children);
|
|
961
969
|
});
|
|
962
970
|
};
|
|
963
971
|
this.rowIndexRowKeyMap.clear(), this.rowKeyRowIndexMap.clear();
|
|
@@ -1135,8 +1143,8 @@ class ae {
|
|
|
1135
1143
|
s.forEach((d) => {
|
|
1136
1144
|
a.push(this.ctx.database.getRowDataItemForRowKey(d));
|
|
1137
1145
|
});
|
|
1138
|
-
const
|
|
1139
|
-
Promise.all(
|
|
1146
|
+
const h = r.map(({ rowKey: d, key: f }) => this.getValidator(d, f));
|
|
1147
|
+
Promise.all(h).then(() => {
|
|
1140
1148
|
this.validationErrorMap.size === 0 && this.changedDataMap.size > 0 && this.ctx.emit("validateChangedData", this.getChangedData());
|
|
1141
1149
|
}), this.ctx.emit("change", r, a), e && this.ctx.history.pushState({
|
|
1142
1150
|
changeList: i,
|
|
@@ -1159,7 +1167,7 @@ class ae {
|
|
|
1159
1167
|
if (!this.rowKeyMap.has(t))
|
|
1160
1168
|
return {};
|
|
1161
1169
|
const { item: l } = this.rowKeyMap.get(t);
|
|
1162
|
-
let a = l[e],
|
|
1170
|
+
let a = l[e], h = i;
|
|
1163
1171
|
if (this.ctx.database.getReadonly(t, e))
|
|
1164
1172
|
return {
|
|
1165
1173
|
oldValue: a,
|
|
@@ -1173,11 +1181,11 @@ class ae {
|
|
|
1173
1181
|
const u = this.getVirtualBodyCellByKey(t, e);
|
|
1174
1182
|
if ((u == null ? void 0 : u.type) === "number")
|
|
1175
1183
|
if (["", void 0, null].includes(i))
|
|
1176
|
-
|
|
1184
|
+
h = null;
|
|
1177
1185
|
else if (/^-?\d+(\.\d+)?$/.test(`${i}`))
|
|
1178
|
-
|
|
1186
|
+
h = Number(i);
|
|
1179
1187
|
else {
|
|
1180
|
-
|
|
1188
|
+
h = a;
|
|
1181
1189
|
const g = {
|
|
1182
1190
|
code: "ERR_SET_NUMBER_VALUE",
|
|
1183
1191
|
message: "Assignment failed, not a numeric type",
|
|
@@ -1185,7 +1193,7 @@ class ae {
|
|
|
1185
1193
|
{
|
|
1186
1194
|
rowKey: t,
|
|
1187
1195
|
key: e,
|
|
1188
|
-
value:
|
|
1196
|
+
value: h,
|
|
1189
1197
|
oldValue: a,
|
|
1190
1198
|
row: x
|
|
1191
1199
|
}
|
|
@@ -1193,7 +1201,7 @@ class ae {
|
|
|
1193
1201
|
};
|
|
1194
1202
|
this.ctx.emit("error", g);
|
|
1195
1203
|
}
|
|
1196
|
-
if (
|
|
1204
|
+
if (h === a)
|
|
1197
1205
|
return {
|
|
1198
1206
|
oldValue: a,
|
|
1199
1207
|
newValue: a
|
|
@@ -1204,19 +1212,19 @@ class ae {
|
|
|
1204
1212
|
{
|
|
1205
1213
|
rowKey: t,
|
|
1206
1214
|
key: e,
|
|
1207
|
-
value:
|
|
1215
|
+
value: h,
|
|
1208
1216
|
oldValue: l[e],
|
|
1209
1217
|
row: x
|
|
1210
1218
|
}
|
|
1211
1219
|
]);
|
|
1212
|
-
E && E.length && (
|
|
1220
|
+
E && E.length && (h = E[0].value);
|
|
1213
1221
|
}
|
|
1214
|
-
this.changedDataMap.set(d,
|
|
1222
|
+
this.changedDataMap.set(d, h), l[e] = h;
|
|
1215
1223
|
const w = {
|
|
1216
1224
|
rowKey: t,
|
|
1217
1225
|
key: e,
|
|
1218
1226
|
oldValue: a,
|
|
1219
|
-
value:
|
|
1227
|
+
value: h,
|
|
1220
1228
|
row: x
|
|
1221
1229
|
};
|
|
1222
1230
|
this.getValidator(t, e).then(() => {
|
|
@@ -1225,17 +1233,17 @@ class ae {
|
|
|
1225
1233
|
rowKey: t,
|
|
1226
1234
|
key: e,
|
|
1227
1235
|
oldValue: a,
|
|
1228
|
-
value:
|
|
1236
|
+
value: h,
|
|
1229
1237
|
originalValue: f,
|
|
1230
1238
|
row: x
|
|
1231
1239
|
});
|
|
1232
1240
|
} else
|
|
1233
|
-
this.changedDataMap.set(d,
|
|
1241
|
+
this.changedDataMap.set(d, h), l[e] = h;
|
|
1234
1242
|
return this.ctx.hasEvent("iterationChange") && this.ctx.emit("iterationChange", {
|
|
1235
1243
|
rowKey: t,
|
|
1236
1244
|
key: e,
|
|
1237
1245
|
oldValue: a,
|
|
1238
|
-
value:
|
|
1246
|
+
value: h,
|
|
1239
1247
|
originalValue: this.originalDataMap.get(d),
|
|
1240
1248
|
row: x
|
|
1241
1249
|
}), s && this.ctx.history.pushState({
|
|
@@ -1247,12 +1255,12 @@ class ae {
|
|
|
1247
1255
|
rowKey: t,
|
|
1248
1256
|
key: e,
|
|
1249
1257
|
oldValue: a,
|
|
1250
|
-
newValue:
|
|
1258
|
+
newValue: h
|
|
1251
1259
|
}
|
|
1252
1260
|
]
|
|
1253
1261
|
}), o && this.ctx.emit("draw"), {
|
|
1254
1262
|
oldValue: a,
|
|
1255
|
-
newValue:
|
|
1263
|
+
newValue: h
|
|
1256
1264
|
};
|
|
1257
1265
|
}
|
|
1258
1266
|
/**
|
|
@@ -1380,15 +1388,15 @@ class ae {
|
|
|
1380
1388
|
rowIndex: x.rowIndex
|
|
1381
1389
|
})), p && (o += 1);
|
|
1382
1390
|
});
|
|
1383
|
-
const a = r > i && s === 0 && l,
|
|
1391
|
+
const a = r > i && s === 0 && l, h = o && o > s && s > 0 || a, d = o !== 0, f = !!o && o === s;
|
|
1384
1392
|
return this.bufferCheckState = {
|
|
1385
1393
|
buffer: !0,
|
|
1386
1394
|
check: f,
|
|
1387
|
-
indeterminate:
|
|
1395
|
+
indeterminate: h,
|
|
1388
1396
|
selectable: d
|
|
1389
1397
|
}, {
|
|
1390
1398
|
check: f,
|
|
1391
|
-
indeterminate:
|
|
1399
|
+
indeterminate: h,
|
|
1392
1400
|
selectable: d
|
|
1393
1401
|
};
|
|
1394
1402
|
}
|
|
@@ -1517,7 +1525,7 @@ class ae {
|
|
|
1517
1525
|
d && (a = d);
|
|
1518
1526
|
}
|
|
1519
1527
|
if (a) {
|
|
1520
|
-
const
|
|
1528
|
+
const h = {
|
|
1521
1529
|
row: s.item,
|
|
1522
1530
|
rowIndex: s.rowIndex,
|
|
1523
1531
|
colIndex: o.colIndex,
|
|
@@ -1527,7 +1535,7 @@ class ae {
|
|
|
1527
1535
|
value: this.getItemValue(t, e),
|
|
1528
1536
|
field: e,
|
|
1529
1537
|
fieldValue: this.getItemValue(t, e)
|
|
1530
|
-
}, f = new te(a).validate(
|
|
1538
|
+
}, f = new te(a).validate(h);
|
|
1531
1539
|
this.setValidationError(t, e, f), i(f);
|
|
1532
1540
|
} else
|
|
1533
1541
|
this.clearValidationError(t, e), i([]);
|
|
@@ -1550,7 +1558,7 @@ class ae {
|
|
|
1550
1558
|
value: r,
|
|
1551
1559
|
colIndex: l,
|
|
1552
1560
|
relationRowKeys: a,
|
|
1553
|
-
relationColKeys:
|
|
1561
|
+
relationColKeys: h,
|
|
1554
1562
|
rowspan: d,
|
|
1555
1563
|
height: f,
|
|
1556
1564
|
width: x,
|
|
@@ -1627,7 +1635,7 @@ class ae {
|
|
|
1627
1635
|
if (!b)
|
|
1628
1636
|
break;
|
|
1629
1637
|
const O = this.getItemValue(s, i), L = this.getItemValue(s, b.key);
|
|
1630
|
-
if (O === L &&
|
|
1638
|
+
if (O === L && h.includes(b.key))
|
|
1631
1639
|
C = v;
|
|
1632
1640
|
else
|
|
1633
1641
|
break;
|
|
@@ -1637,7 +1645,7 @@ class ae {
|
|
|
1637
1645
|
if (!b)
|
|
1638
1646
|
break;
|
|
1639
1647
|
const O = this.getItemValue(s, i), L = this.getItemValue(s, b.key);
|
|
1640
|
-
if (O === L &&
|
|
1648
|
+
if (O === L && h.includes(b.key))
|
|
1641
1649
|
m = v;
|
|
1642
1650
|
else
|
|
1643
1651
|
break;
|
|
@@ -1682,7 +1690,7 @@ class ae {
|
|
|
1682
1690
|
const s = this.rowIndexRowKeyMap.get(t), o = `${s}_${e}`, r = this.getRowForRowIndex(t), l = this.getColumnByKey(e);
|
|
1683
1691
|
if (!s || !l || !r)
|
|
1684
1692
|
return;
|
|
1685
|
-
const a = this.getItemValue(s, e),
|
|
1693
|
+
const a = this.getItemValue(s, e), h = [
|
|
1686
1694
|
{
|
|
1687
1695
|
key: e,
|
|
1688
1696
|
rowKey: s,
|
|
@@ -1696,7 +1704,7 @@ class ae {
|
|
|
1696
1704
|
fieldValue: a
|
|
1697
1705
|
}
|
|
1698
1706
|
];
|
|
1699
|
-
this.validationErrorMap.set(o,
|
|
1707
|
+
this.validationErrorMap.set(o, h);
|
|
1700
1708
|
}
|
|
1701
1709
|
setValidationError(t, e, i) {
|
|
1702
1710
|
const s = `${t}_${e}`;
|
|
@@ -1938,21 +1946,21 @@ class fe {
|
|
|
1938
1946
|
* @param {string} color - 阴影的颜色
|
|
1939
1947
|
*/
|
|
1940
1948
|
drawShadow(t, e, i, s, o) {
|
|
1941
|
-
const { fillColor: r, side: l, shadowWidth: a, colorStart:
|
|
1949
|
+
const { fillColor: r, side: l, shadowWidth: a, colorStart: h, colorEnd: d } = o;
|
|
1942
1950
|
this.ctx.save(), r && (this.ctx.fillStyle = r, this.ctx.fillRect(t, e, i, s));
|
|
1943
1951
|
let f;
|
|
1944
1952
|
switch (l) {
|
|
1945
1953
|
case "left":
|
|
1946
|
-
f = this.ctx.createLinearGradient(t - a, e, t, e), f.addColorStop(0,
|
|
1954
|
+
f = this.ctx.createLinearGradient(t - a, e, t, e), f.addColorStop(0, h), f.addColorStop(1, d), this.ctx.fillStyle = f, this.ctx.fillRect(t - a, e, a, s);
|
|
1947
1955
|
break;
|
|
1948
1956
|
case "right":
|
|
1949
|
-
f = this.ctx.createLinearGradient(t + i, e, t + i + a, e), f.addColorStop(0,
|
|
1957
|
+
f = this.ctx.createLinearGradient(t + i, e, t + i + a, e), f.addColorStop(0, h), f.addColorStop(1, d), this.ctx.fillStyle = f, this.ctx.fillRect(t + i, e, a, s);
|
|
1950
1958
|
break;
|
|
1951
1959
|
case "top":
|
|
1952
|
-
f = this.ctx.createLinearGradient(t, e - a, t, e), f.addColorStop(0,
|
|
1960
|
+
f = this.ctx.createLinearGradient(t, e - a, t, e), f.addColorStop(0, h), f.addColorStop(1, d), this.ctx.fillStyle = f, this.ctx.fillRect(t, e - a, i, a);
|
|
1953
1961
|
break;
|
|
1954
1962
|
case "bottom":
|
|
1955
|
-
f = this.ctx.createLinearGradient(t, e + s, t, e + s + a), f.addColorStop(0,
|
|
1963
|
+
f = this.ctx.createLinearGradient(t, e + s, t, e + s + a), f.addColorStop(0, h), f.addColorStop(1, d), this.ctx.fillStyle = f, this.ctx.fillRect(t, e + s, i, a);
|
|
1956
1964
|
break;
|
|
1957
1965
|
default:
|
|
1958
1966
|
console.error("Invalid side specified for shadow");
|
|
@@ -1977,8 +1985,8 @@ class fe {
|
|
|
1977
1985
|
if (this.ctx.save(), this.ctx.beginPath(), l !== void 0 && (this.ctx.fillStyle = l), r !== void 0 && (this.ctx.lineWidth = o, this.ctx.strokeStyle = r), a === 0)
|
|
1978
1986
|
this.ctx.rect(t - 0.5, e - 0.5, i, s);
|
|
1979
1987
|
else {
|
|
1980
|
-
const [
|
|
1981
|
-
this.ctx.moveTo(t +
|
|
1988
|
+
const [h, d, f, x] = typeof a == "number" ? [a, a, a, a] : a;
|
|
1989
|
+
this.ctx.moveTo(t + h, e), this.ctx.arcTo(t + i, e, t + i, e + d, d), this.ctx.arcTo(t + i, e + s, t + i - f, e + s, f), this.ctx.arcTo(t, e + s, t, e + s - x, x), this.ctx.arcTo(t, e, t + h, e, h);
|
|
1982
1990
|
}
|
|
1983
1991
|
l !== void 0 && this.ctx.fill(), r !== void 0 && this.ctx.stroke(), this.ctx.restore();
|
|
1984
1992
|
}
|
|
@@ -1997,11 +2005,11 @@ class fe {
|
|
|
1997
2005
|
const {
|
|
1998
2006
|
font: l = "12px Arial",
|
|
1999
2007
|
align: a = "center",
|
|
2000
|
-
color:
|
|
2008
|
+
color: h = "#495060",
|
|
2001
2009
|
padding: d = 0,
|
|
2002
2010
|
verticalAlign: f = "middle"
|
|
2003
2011
|
} = r;
|
|
2004
|
-
this.ctx.font = l, this.ctx.fillStyle =
|
|
2012
|
+
this.ctx.font = l, this.ctx.fillStyle = h, this.ctx.textBaseline = f, this.ctx.textAlign = a;
|
|
2005
2013
|
let x = 0;
|
|
2006
2014
|
f === "top" ? x = i + d : f === "bottom" ? x = i + o - d : x = i + (o + 1) / 2;
|
|
2007
2015
|
let u = 0;
|
|
@@ -2019,9 +2027,9 @@ class fe {
|
|
|
2019
2027
|
const l = this.ctx.measureText("...").width, a = this.ctx.measureText(t).width;
|
|
2020
2028
|
if (a && a + l >= e - i * 2) {
|
|
2021
2029
|
o = !0;
|
|
2022
|
-
let
|
|
2030
|
+
let h = 0;
|
|
2023
2031
|
for (let d = 0; d < t.length; d++)
|
|
2024
|
-
if (
|
|
2032
|
+
if (h += this.ctx.measureText(t[d]).width, h >= e - i * 2 - l) {
|
|
2025
2033
|
r = t.slice(0, d) + "...";
|
|
2026
2034
|
break;
|
|
2027
2035
|
}
|
|
@@ -2185,6 +2193,9 @@ class Ct {
|
|
|
2185
2193
|
n(this, "SELECTOR_AREA_MAX_Y", 0);
|
|
2186
2194
|
/** 选择器Y最大范围,0默认rowMax */
|
|
2187
2195
|
n(this, "SELECTOR_AREA_MAX_Y_OFFSET", 0);
|
|
2196
|
+
/** 选择器值类型,value,displayText,区别displayText受format影响 */
|
|
2197
|
+
n(this, "SELECTOR_CELL_VALUE_TYPE", "value");
|
|
2198
|
+
// displayText | value
|
|
2188
2199
|
/** 启用自动主题 */
|
|
2189
2200
|
n(this, "ENABLE_AUTO_THEME", !0);
|
|
2190
2201
|
/** 启用选择器-选择器单选 */
|
|
@@ -2416,21 +2427,21 @@ class xe {
|
|
|
2416
2427
|
}
|
|
2417
2428
|
async createImageFromSVG(t, e, i = !1) {
|
|
2418
2429
|
const r = new DOMParser().parseFromString(t, "image/svg+xml").documentElement;
|
|
2419
|
-
e && r.querySelectorAll("*").forEach((
|
|
2420
|
-
|
|
2430
|
+
e && r.querySelectorAll("*").forEach((h) => {
|
|
2431
|
+
h.setAttribute("fill", e);
|
|
2421
2432
|
});
|
|
2422
2433
|
const l = new Image();
|
|
2423
2434
|
let a = "";
|
|
2424
2435
|
if (i) {
|
|
2425
|
-
const
|
|
2436
|
+
const h = new Blob([new XMLSerializer().serializeToString(r)], {
|
|
2426
2437
|
type: "image/svg+xml"
|
|
2427
2438
|
});
|
|
2428
|
-
a = URL.createObjectURL(
|
|
2439
|
+
a = URL.createObjectURL(h);
|
|
2429
2440
|
} else
|
|
2430
2441
|
a = "data:image/svg+xml;charset=utf-8," + encodeURIComponent(new XMLSerializer().serializeToString(r));
|
|
2431
|
-
return l.src = a, new Promise((
|
|
2442
|
+
return l.src = a, new Promise((h, d) => {
|
|
2432
2443
|
l.onerror = () => d(new Error("Failed to load image")), l.onload = () => {
|
|
2433
|
-
|
|
2444
|
+
h(l);
|
|
2434
2445
|
};
|
|
2435
2446
|
});
|
|
2436
2447
|
}
|
|
@@ -2501,11 +2512,11 @@ class Xt extends Dt {
|
|
|
2501
2512
|
const { HEADER_CELL_STYLE_METHOD: e, HEADER_BG_COLOR: i, HEADER_TEXT_COLOR: s } = this.ctx.config;
|
|
2502
2513
|
let o = i, r = s;
|
|
2503
2514
|
if (typeof e == "function") {
|
|
2504
|
-
const l = e, { backgroundColor: a, color:
|
|
2515
|
+
const l = e, { backgroundColor: a, color: h } = l({
|
|
2505
2516
|
colIndex: this.colIndex,
|
|
2506
2517
|
column: this.column
|
|
2507
2518
|
}) || {};
|
|
2508
|
-
a && (o = a),
|
|
2519
|
+
a && (o = a), h && (r = h);
|
|
2509
2520
|
}
|
|
2510
2521
|
this.drawCellBgColor = o, this.drawTextColor = r;
|
|
2511
2522
|
}
|
|
@@ -2516,11 +2527,11 @@ class Xt extends Dt {
|
|
|
2516
2527
|
const {
|
|
2517
2528
|
paint: e,
|
|
2518
2529
|
config: { BORDER_COLOR: i, CELL_PADDING: s, HEADER_FONT: o, BORDER: r }
|
|
2519
|
-
} = this.ctx, { drawX: l, drawY: a, displayText:
|
|
2530
|
+
} = this.ctx, { drawX: l, drawY: a, displayText: h } = this;
|
|
2520
2531
|
e.drawRect(l, a, this.width, this.height, {
|
|
2521
2532
|
borderColor: r ? i : "transparent",
|
|
2522
2533
|
fillColor: this.drawCellBgColor
|
|
2523
|
-
}), this.ellipsis = e.drawText(
|
|
2534
|
+
}), this.ellipsis = e.drawText(h, l, a, this.width, this.height, {
|
|
2524
2535
|
font: o,
|
|
2525
2536
|
padding: s,
|
|
2526
2537
|
color: this.drawTextColor,
|
|
@@ -2541,9 +2552,9 @@ class Xt extends Dt {
|
|
|
2541
2552
|
drawSelection() {
|
|
2542
2553
|
const { width: e, height: i, type: s } = this;
|
|
2543
2554
|
if (["index-selection", "selection"].includes(s)) {
|
|
2544
|
-
const { indeterminate: o, check: r, selectable: l } = this.ctx.database.getCheckedState(), { CHECKBOX_SIZE: a = 0 } = this.ctx.config,
|
|
2555
|
+
const { indeterminate: o, check: r, selectable: l } = this.ctx.database.getCheckedState(), { CHECKBOX_SIZE: a = 0 } = this.ctx.config, h = this.drawX + (e - a) / 2, d = this.drawY + (i - a) / 2;
|
|
2545
2556
|
let f = this.ctx.icons.get("checkbox-uncheck"), x = "checkbox-uncheck";
|
|
2546
|
-
o ? (f = this.ctx.icons.get("checkbox-indeterminate"), x = "checkbox-indeterminate") : r && l ? (f = this.ctx.icons.get("checkbox-check"), x = "checkbox-check") : r && l ? (f = this.ctx.icons.get("checkbox-check-disabled"), x = "checkbox-check-disabled") : !r && l ? (f = this.ctx.icons.get("checkbox-uncheck"), x = "checkbox-uncheck") : (f = this.ctx.icons.get("checkbox-disabled"), x = "checkbox-disabled"), f && (this.drawImageX =
|
|
2557
|
+
o ? (f = this.ctx.icons.get("checkbox-indeterminate"), x = "checkbox-indeterminate") : r && l ? (f = this.ctx.icons.get("checkbox-check"), x = "checkbox-check") : r && l ? (f = this.ctx.icons.get("checkbox-check-disabled"), x = "checkbox-check-disabled") : !r && l ? (f = this.ctx.icons.get("checkbox-uncheck"), x = "checkbox-uncheck") : (f = this.ctx.icons.get("checkbox-disabled"), x = "checkbox-disabled"), f && (this.drawImageX = h, this.drawImageY = d, this.drawImageWidth = a, this.drawImageHeight = a, this.drawImageName = x, this.drawImageSource = f, this.ctx.paint.drawImage(
|
|
2547
2558
|
this.drawImageSource,
|
|
2548
2559
|
this.drawImageX,
|
|
2549
2560
|
this.drawImageY,
|
|
@@ -2716,13 +2727,13 @@ class ue {
|
|
|
2716
2727
|
for (const r of i) {
|
|
2717
2728
|
const l = r.fixedCells.concat(r.noFixedCells);
|
|
2718
2729
|
for (const a of l) {
|
|
2719
|
-
const
|
|
2730
|
+
const h = a.getDrawX(), d = a.getDrawY();
|
|
2720
2731
|
if (o) {
|
|
2721
|
-
if (t >
|
|
2732
|
+
if (t > h && t < h + a.visibleWidth && e > d && e < d + a.visibleHeight) {
|
|
2722
2733
|
s(a);
|
|
2723
2734
|
return;
|
|
2724
2735
|
}
|
|
2725
|
-
} else if (t >
|
|
2736
|
+
} else if (t > h && t < h + a.width && e > d && e < d + a.height) {
|
|
2726
2737
|
s(a);
|
|
2727
2738
|
return;
|
|
2728
2739
|
}
|
|
@@ -2785,6 +2796,10 @@ class ge {
|
|
|
2785
2796
|
// 只有合并单元格
|
|
2786
2797
|
n(this, "selectOnlyOne", !1);
|
|
2787
2798
|
// 只选择一个
|
|
2799
|
+
n(this, "hasSelection", !1);
|
|
2800
|
+
// 是否有选中
|
|
2801
|
+
n(this, "hasTree", !1);
|
|
2802
|
+
// 是否有树形结构
|
|
2788
2803
|
n(this, "scrollY", 0);
|
|
2789
2804
|
n(this, "scrollX", 0);
|
|
2790
2805
|
n(this, "fixedLeftWidth", 0);
|
|
@@ -2859,9 +2874,9 @@ class ge {
|
|
|
2859
2874
|
overlayerElement: r,
|
|
2860
2875
|
editorElement: l,
|
|
2861
2876
|
emptyElement: a,
|
|
2862
|
-
contextMenuElement:
|
|
2877
|
+
contextMenuElement: h
|
|
2863
2878
|
} = t;
|
|
2864
|
-
this.containerElement = i, s.tabIndex = 0, this.stageElement = s, this.canvasElement = o, this.overlayerElement = r, this.editorElement = l, this.emptyElement = a, this.contextMenuElement =
|
|
2879
|
+
this.containerElement = i, s.tabIndex = 0, this.stageElement = s, this.canvasElement = o, this.overlayerElement = r, this.editorElement = l, this.emptyElement = a, this.contextMenuElement = h, this.config = new Ct(e.config || {}), this.eventBus = new de(), this.eventBrowser = new ce(this), this.eventTable = new ue(this), this.paint = new fe(this.canvasElement), this.database = new ae(this, e), this.history = new he(this), this.icons = new xe(this);
|
|
2865
2880
|
}
|
|
2866
2881
|
setConfig(t) {
|
|
2867
2882
|
this.config = new Ct(t);
|
|
@@ -2870,7 +2885,7 @@ class ge {
|
|
|
2870
2885
|
if (this.config.ENABLE_MERGE_CELL_LINK) {
|
|
2871
2886
|
const r = this.database.getVirtualBodyCellByKey(t, e);
|
|
2872
2887
|
if (r && (r.mergeRow || r.mergeCol)) {
|
|
2873
|
-
const { dataList: l } = r.getSpanInfo(), a = l.map((
|
|
2888
|
+
const { dataList: l } = r.getSpanInfo(), a = l.map((h) => ({ ...h, value: i }));
|
|
2874
2889
|
this.database.batchSetItemValue(a, s);
|
|
2875
2890
|
return;
|
|
2876
2891
|
}
|
|
@@ -2885,8 +2900,8 @@ class ge {
|
|
|
2885
2900
|
if (o === void 0 || r === void 0) return;
|
|
2886
2901
|
const l = this.database.getVirtualBodyCell(o, r);
|
|
2887
2902
|
if (l) {
|
|
2888
|
-
const { dataList: a } = l.getSpanInfo(),
|
|
2889
|
-
i.push(...
|
|
2903
|
+
const { dataList: a } = l.getSpanInfo(), h = a.map((d) => ({ ...d, value: s.value }));
|
|
2904
|
+
i.push(...h);
|
|
2890
2905
|
}
|
|
2891
2906
|
}), this.database.batchSetItemValue(i, e);
|
|
2892
2907
|
} else
|
|
@@ -2930,8 +2945,8 @@ class ge {
|
|
|
2930
2945
|
for (let o = 0; o <= e[1] - e[0]; o++) {
|
|
2931
2946
|
const r = [];
|
|
2932
2947
|
for (let l = 0; l <= i[1] - i[0]; l++) {
|
|
2933
|
-
const a = o + e[0],
|
|
2934
|
-
d && r.push(d.
|
|
2948
|
+
const a = o + e[0], h = l + i[0], d = this.database.getVirtualBodyCell(a, h);
|
|
2949
|
+
d && (d.selectorCellValueType === "displayText" ? r.push(d.displayText) : r.push(d.getValue()));
|
|
2935
2950
|
}
|
|
2936
2951
|
s += `${r.join(" ")}\r`, t.push(r);
|
|
2937
2952
|
}
|
|
@@ -3078,21 +3093,21 @@ class Rt {
|
|
|
3078
3093
|
stageHeight: i,
|
|
3079
3094
|
stageWidth: s,
|
|
3080
3095
|
config: { SCROLLER_TRACK_SIZE: o = 0, SCROLLER_SIZE: r = 0, BORDER: l }
|
|
3081
|
-
} = this.ctx, a = s,
|
|
3096
|
+
} = this.ctx, a = s, h = i, d = e.height, f = e.width, x = t.height, u = this.ctx.footer.height;
|
|
3082
3097
|
if (this.type === "vertical") {
|
|
3083
|
-
this.visibleDistance =
|
|
3098
|
+
this.visibleDistance = h - o - d, this.distance = x - this.visibleDistance + u, this.trackX = a - o, this.trackY = 0, this.splitPoints = [this.trackX, d, this.trackX + o, d], this.trackWidth = o, this.trackHeight = h, this.barX = this.trackX - 1 + (o - r) / 2, this.barWidth = r;
|
|
3084
3099
|
const p = this.distance ? this.visibleDistance / (x + u) : 0;
|
|
3085
3100
|
let w = Math.floor(p * this.visibleDistance);
|
|
3086
3101
|
w < 30 ? w = 30 : w > this.visibleDistance && (w = 0), this.barHeight = w, this.barY = d + this.scroll / this.distance * (this.visibleDistance - this.barHeight), this.scroll = Math.max(0, Math.min(this.scroll, this.distance));
|
|
3087
3102
|
} else {
|
|
3088
3103
|
this.visibleDistance = a - o, this.distance = f - this.visibleDistance, this.splitPoints = [
|
|
3089
3104
|
a - o,
|
|
3090
|
-
|
|
3105
|
+
h - o,
|
|
3091
3106
|
a - o,
|
|
3092
|
-
|
|
3107
|
+
h
|
|
3093
3108
|
];
|
|
3094
3109
|
const p = l ? 0 : 0.5;
|
|
3095
|
-
this.trackX = 0, this.trackY =
|
|
3110
|
+
this.trackX = 0, this.trackY = h - o + p, this.trackWidth = a, this.trackHeight = o;
|
|
3096
3111
|
const w = this.distance ? this.visibleDistance / f : 0;
|
|
3097
3112
|
let g = Math.floor(w * this.visibleDistance);
|
|
3098
3113
|
this.barY = this.trackY - 1 + (o - r) / 2, g < 30 ? g = 30 : g >= this.visibleDistance && (g = 0), this.barWidth = g, this.barHeight = r, this.barX = this.scroll / this.distance * (this.visibleDistance - this.barWidth), this.scroll = Math.max(0, Math.min(this.scroll, this.distance));
|
|
@@ -3232,7 +3247,7 @@ class pe {
|
|
|
3232
3247
|
config: { HEADER_HEIGHT: t, SCROLLER_TRACK_SIZE: e }
|
|
3233
3248
|
} = this.ctx, i = this.ctx.database.getColumns();
|
|
3234
3249
|
this.columns = i, this.allCellHeaders = [], this.leafCellHeaders = [], this.fixedLeftCellHeaders = [], this.fixedRightCellHeaders = [], this.centerCellHeaders = [];
|
|
3235
|
-
const s = Tt(i), o =
|
|
3250
|
+
const s = Tt(i), o = et(i);
|
|
3236
3251
|
this.height = t * s, this.width = o.reduce((f, x) => {
|
|
3237
3252
|
const u = x.width || 100, { maxWidth: p, minWidth: w } = x;
|
|
3238
3253
|
return p && u > p ? f + p : w && u < w ? f + w : f + u;
|
|
@@ -3246,8 +3261,8 @@ class pe {
|
|
|
3246
3261
|
const f = Math.floor(a / this.resizeNum * 100) / 100;
|
|
3247
3262
|
this.resizeAllColumn(f);
|
|
3248
3263
|
}
|
|
3249
|
-
const
|
|
3250
|
-
this.ctx.fixedLeftWidth =
|
|
3264
|
+
const h = this.fixedLeftCellHeaders.filter((f) => !f.hasChildren);
|
|
3265
|
+
this.ctx.fixedLeftWidth = h.reduce((f, x) => f + x.width, 0);
|
|
3251
3266
|
const d = this.fixedRightCellHeaders.filter((f) => !f.hasChildren);
|
|
3252
3267
|
this.ctx.fixedRightWidth = d.reduce((f, x) => f + x.width, e), this.ctx.maxColIndex = this.leafCellHeaders.length - 1, this.ctx.header.x = this.x, this.ctx.header.y = this.y, this.ctx.header.width = this.width, this.ctx.header.height = this.height, this.ctx.header.visibleWidth = this.visibleWidth, this.ctx.header.visibleHeight = this.visibleHeight;
|
|
3253
3268
|
}
|
|
@@ -3280,8 +3295,8 @@ class pe {
|
|
|
3280
3295
|
this.ctx.stageElement.style.cursor === "col-resize" && (this.ctx.stageElement.style.cursor = "default");
|
|
3281
3296
|
const o = [...this.renderFixedCellHeaders, ...this.renderCenterCellHeaders];
|
|
3282
3297
|
for (const r of o) {
|
|
3283
|
-
const { offsetX: l, offsetY: a } = this.ctx.getOffset(e),
|
|
3284
|
-
|
|
3298
|
+
const { offsetX: l, offsetY: a } = this.ctx.getOffset(e), h = l, d = r.getDrawX();
|
|
3299
|
+
h > d + r.width - 5 && h < d + r.width + 4 && h < i - 4 && // 视窗中最后一列不允许调整宽
|
|
3285
3300
|
r.colspan <= 1 && this.ctx.isTarget(e) && a <= this.height && (this.ctx.stageElement.style.cursor = "col-resize", this.resizeTarget = r);
|
|
3286
3301
|
}
|
|
3287
3302
|
}
|
|
@@ -3336,10 +3351,10 @@ class pe {
|
|
|
3336
3351
|
let s = e;
|
|
3337
3352
|
const { HEADER_HEIGHT: o = 0 } = this.ctx.config;
|
|
3338
3353
|
for (let r = 0; r < i; r++) {
|
|
3339
|
-
const l = t[r], a = o * (l.rowspan || 0),
|
|
3354
|
+
const l = t[r], a = o * (l.rowspan || 0), h = o * (l.level || 0);
|
|
3340
3355
|
let { minWidth: d, maxWidth: f } = l, x = l.width || 100;
|
|
3341
|
-
d && x < d && (x = d), f && x > f && (x = f), l.children && (x =
|
|
3342
|
-
const u = new Xt(this.ctx, this.columnIndex, s,
|
|
3356
|
+
d && x < d && (x = d), f && x > f && (x = f), l.children && (x = et(l.children).reduce((w, g) => w + ((g == null ? void 0 : g.width) || 100), 0));
|
|
3357
|
+
const u = new Xt(this.ctx, this.columnIndex, s, h, x, a, l);
|
|
3343
3358
|
this.ctx.database.setHeader(l.key, u), this.allCellHeaders.push(u), l.children || (this.leafCellHeaders.push(u), u.column.widthFillDisable || this.resizeNum++), l.fixed === "left" ? this.fixedLeftCellHeaders.push(u) : l.fixed === "right" ? this.fixedRightCellHeaders.push(u) : this.centerCellHeaders.push(u), !l.children && this.columnIndex++, l.children && this.render(l.children, s), s += x;
|
|
3344
3359
|
}
|
|
3345
3360
|
}
|
|
@@ -3506,7 +3521,7 @@ class Ee {
|
|
|
3506
3521
|
SCROLLER_TRACK_SIZE: r = 0,
|
|
3507
3522
|
HEIGHT: l,
|
|
3508
3523
|
EMPTY_BODY_HEIGHT: a = 0,
|
|
3509
|
-
MAX_HEIGHT:
|
|
3524
|
+
MAX_HEIGHT: h = 0,
|
|
3510
3525
|
ENABLE_OFFSET_HEIGHT: d = 0,
|
|
3511
3526
|
OFFSET_HEIGHT: f = 0,
|
|
3512
3527
|
FOOTER_POSITION: x
|
|
@@ -3525,8 +3540,8 @@ class Ee {
|
|
|
3525
3540
|
const C = window.innerHeight, { top: m } = this.containerRect || this.ctx.containerElement.getBoundingClientRect();
|
|
3526
3541
|
if (C > m && d && !l) {
|
|
3527
3542
|
const L = C - m - f;
|
|
3528
|
-
L > e.height + r ? E = L : g >
|
|
3529
|
-
} else this.data.length && l ? E = l : this.data.length &&
|
|
3543
|
+
L > e.height + r ? E = L : g > h && (E = h);
|
|
3544
|
+
} else this.data.length && l ? E = l : this.data.length && h && g > h && (E = h);
|
|
3530
3545
|
E > 0 && (this.ctx.stageHeight = Math.floor(E), this.ctx.stageElement.style.height = `${this.ctx.stageHeight}px`);
|
|
3531
3546
|
let R = this.ctx.stageHeight - e.height - r;
|
|
3532
3547
|
o ? this.visibleHeight = R - w : this.visibleHeight = R, this.data.length || (this.height = this.visibleHeight), this.ctx.body.x = this.x, this.ctx.body.y = this.y, this.ctx.body.width = this.width, this.ctx.body.height = this.height, this.ctx.body.visibleWidth = this.visibleWidth, this.ctx.body.visibleHeight = this.visibleHeight, this.ctx.body.data = u;
|
|
@@ -3564,7 +3579,7 @@ class Ee {
|
|
|
3564
3579
|
if (this.ctx.editing) return;
|
|
3565
3580
|
const { offsetY: i, offsetX: s } = this.ctx.getOffset(e), o = i, r = s, l = e.clientY, {
|
|
3566
3581
|
stageHeight: a,
|
|
3567
|
-
scrollY:
|
|
3582
|
+
scrollY: h,
|
|
3568
3583
|
config: { RESIZE_ROW_MIN_HEIGHT: d = 0 }
|
|
3569
3584
|
} = this.ctx;
|
|
3570
3585
|
if (this.isResizing && this.resizeTarget) {
|
|
@@ -3583,7 +3598,7 @@ class Ee {
|
|
|
3583
3598
|
this.ctx.stageElement.style.cursor === "row-resize" && (this.ctx.stageElement.style.cursor = "default");
|
|
3584
3599
|
for (let f = 0; f < this.renderRows.length; f++) {
|
|
3585
3600
|
const x = this.renderRows[f];
|
|
3586
|
-
if (o > x.y -
|
|
3601
|
+
if (o > x.y - h + x.height - 1.5 && o < x.y - h + x.height + 1.5 && o < a - 4)
|
|
3587
3602
|
for (let p = 0; p < x.cells.length; p++) {
|
|
3588
3603
|
const w = x.cells[p];
|
|
3589
3604
|
r > w.drawX + 10 && r < w.drawX + w.width - 10 && w.rowspan === 1 && (this.ctx.stageElement.style.cursor = "row-resize", this.resizeTarget = x);
|
|
@@ -3661,12 +3676,12 @@ class Ee {
|
|
|
3661
3676
|
config: { CELL_HEIGHT: s }
|
|
3662
3677
|
} = this.ctx, o = i, { data: r, positions: l } = e.getData();
|
|
3663
3678
|
this.ctx.maxRowIndex = r.length - 1;
|
|
3664
|
-
let a = this.binarySearch(l, o),
|
|
3665
|
-
if (
|
|
3679
|
+
let a = this.binarySearch(l, o), h = this.binarySearch(l, o + this.visibleHeight);
|
|
3680
|
+
if (h === -1 && (h = this.ctx.maxRowIndex), a === -1 && h === this.ctx.maxRowIndex) {
|
|
3666
3681
|
const f = Math.floor(this.visibleHeight / s);
|
|
3667
3682
|
a = this.ctx.maxRowIndex - f;
|
|
3668
3683
|
}
|
|
3669
|
-
this.headIndex = Math.max(0, a), this.tailIndex = Math.min(this.ctx.maxRowIndex,
|
|
3684
|
+
this.headIndex = Math.max(0, a), this.tailIndex = Math.min(this.ctx.maxRowIndex, h + 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;
|
|
3670
3685
|
const d = [];
|
|
3671
3686
|
for (let f = 0; f < this.visibleRows.length; f++) {
|
|
3672
3687
|
const x = this.headIndex + f, u = this.visibleRows[f], { height: p, top: w } = this.ctx.database.getPositionForRowIndex(x), g = new kt(this.ctx, x, 0, w + this.y, t.width, p, u);
|
|
@@ -3725,8 +3740,8 @@ class me {
|
|
|
3725
3740
|
colorStart: "rgba(0,0,0,0.1)",
|
|
3726
3741
|
colorEnd: "rgba(0,0,0,0)"
|
|
3727
3742
|
}), i < Math.floor(s.width - o - 1) && e !== l) {
|
|
3728
|
-
const
|
|
3729
|
-
this.ctx.paint.drawShadow(
|
|
3743
|
+
const h = s.width - (this.x + this.width) + o - e;
|
|
3744
|
+
this.ctx.paint.drawShadow(h, a, e, this.height, {
|
|
3730
3745
|
fillColor: r,
|
|
3731
3746
|
side: "left",
|
|
3732
3747
|
shadowWidth: 4,
|
|
@@ -3885,11 +3900,11 @@ class ye {
|
|
|
3885
3900
|
const {
|
|
3886
3901
|
SELECTOR_AREA_MIN_X: l,
|
|
3887
3902
|
SELECTOR_AREA_MAX_X: a,
|
|
3888
|
-
SELECTOR_AREA_MIN_Y:
|
|
3903
|
+
SELECTOR_AREA_MIN_Y: h,
|
|
3889
3904
|
SELECTOR_AREA_MAX_Y: d,
|
|
3890
3905
|
SELECTOR_AREA_MAX_X_OFFSET: f,
|
|
3891
3906
|
SELECTOR_AREA_MAX_Y_OFFSET: x
|
|
3892
|
-
} = this.ctx.config, u = l, p = a || this.ctx.maxColIndex - f, w =
|
|
3907
|
+
} = this.ctx.config, u = l, p = a || this.ctx.maxColIndex - f, w = h, g = d || this.ctx.maxRowIndex - x;
|
|
3893
3908
|
let [E, C] = o, [m, R] = r;
|
|
3894
3909
|
if (E < u || C > p || m < w || R > g)
|
|
3895
3910
|
return;
|
|
@@ -3921,7 +3936,7 @@ class ye {
|
|
|
3921
3936
|
const E = w + e[0], C = g + t[0], m = this.ctx.database.getVirtualBodyCell(E, C);
|
|
3922
3937
|
m && ((E === i || E === s) && l.push(m), (C === o || C === r) && a.push(m));
|
|
3923
3938
|
}
|
|
3924
|
-
const
|
|
3939
|
+
const h = l.reduce(
|
|
3925
3940
|
(w, g) => {
|
|
3926
3941
|
const { yArr: E } = g.getSpanInfo(), [C, m] = E;
|
|
3927
3942
|
return w.minY = Math.min(w.minY, C), w.maxY = Math.max(w.maxY, m), w;
|
|
@@ -3939,9 +3954,9 @@ class ye {
|
|
|
3939
3954
|
minX: o,
|
|
3940
3955
|
maxX: r
|
|
3941
3956
|
}
|
|
3942
|
-
), f = [d.minX, d.maxX], x = [
|
|
3957
|
+
), f = [d.minX, d.maxX], x = [h.minY, h.maxY];
|
|
3943
3958
|
let u = !1;
|
|
3944
|
-
if (d.minX !== d.maxX ||
|
|
3959
|
+
if (d.minX !== d.maxX || h.minY !== h.maxY) {
|
|
3945
3960
|
const w = JSON.stringify(f) + JSON.stringify(x), g = (p = this.ctx.focusCell) == null ? void 0 : p.getSpanInfo();
|
|
3946
3961
|
u = (g && JSON.stringify(g.xArr) + JSON.stringify(g.yArr)) === w;
|
|
3947
3962
|
}
|
|
@@ -3962,11 +3977,11 @@ class ye {
|
|
|
3962
3977
|
if (this.ctx.mousedown && this.ctx.focusCellHeader) {
|
|
3963
3978
|
const { colIndex: l } = this.ctx.focusCellHeader;
|
|
3964
3979
|
if (this.ctx.clearSelector(), t.colIndex >= l) {
|
|
3965
|
-
const a = [l, t.colIndex + t.colspan - 1],
|
|
3966
|
-
this.setSelector(a,
|
|
3980
|
+
const a = [l, t.colIndex + t.colspan - 1], h = [o, r];
|
|
3981
|
+
this.setSelector(a, h);
|
|
3967
3982
|
} else {
|
|
3968
|
-
const a = [t.colIndex, l],
|
|
3969
|
-
this.setSelector(a,
|
|
3983
|
+
const a = [t.colIndex, l], h = [o, r];
|
|
3984
|
+
this.setSelector(a, h);
|
|
3970
3985
|
}
|
|
3971
3986
|
} else {
|
|
3972
3987
|
const l = [t.colIndex, t.colIndex + t.colspan - 1], a = [o, r];
|
|
@@ -3985,7 +4000,7 @@ class ye {
|
|
|
3985
4000
|
SELECTOR_AREA_MAX_Y: r,
|
|
3986
4001
|
SELECTOR_AREA_MAX_X_OFFSET: l,
|
|
3987
4002
|
SELECTOR_AREA_MAX_Y_OFFSET: a
|
|
3988
|
-
} = this.ctx.config,
|
|
4003
|
+
} = this.ctx.config, h = i, d = s || this.ctx.maxColIndex - l, f = o, x = r || this.ctx.maxRowIndex - a, u = [h, d], p = [f, x];
|
|
3989
4004
|
this.setSelector(u, p);
|
|
3990
4005
|
}
|
|
3991
4006
|
}
|
|
@@ -3995,17 +4010,17 @@ class ye {
|
|
|
3995
4010
|
const { SELECTOR_AREA_MIN_X: i, SELECTOR_AREA_MAX_X: s, SELECTOR_AREA_MAX_X_OFFSET: o } = this.ctx.config, r = s || this.ctx.maxColIndex - o, l = i;
|
|
3996
4011
|
if (e) {
|
|
3997
4012
|
this.ctx.setFocusCell(t);
|
|
3998
|
-
const a = [l, r],
|
|
3999
|
-
this.setSelector(a,
|
|
4013
|
+
const a = [l, r], h = [t.rowIndex, t.rowIndex];
|
|
4014
|
+
this.setSelector(a, h);
|
|
4000
4015
|
}
|
|
4001
4016
|
if (this.ctx.focusCell && this.ctx.mousedown) {
|
|
4002
4017
|
const { rowIndex: a } = this.ctx.focusCell;
|
|
4003
4018
|
if (t.rowIndex >= a) {
|
|
4004
|
-
const
|
|
4005
|
-
this.setSelector(
|
|
4019
|
+
const h = [l, r], d = [a, t.rowIndex];
|
|
4020
|
+
this.setSelector(h, d);
|
|
4006
4021
|
} else {
|
|
4007
|
-
const
|
|
4008
|
-
this.setSelector(
|
|
4022
|
+
const h = [l, r], d = [t.rowIndex, a];
|
|
4023
|
+
this.setSelector(h, d);
|
|
4009
4024
|
}
|
|
4010
4025
|
}
|
|
4011
4026
|
}
|
|
@@ -4014,7 +4029,7 @@ class ye {
|
|
|
4014
4029
|
return;
|
|
4015
4030
|
const { mousedown: t, focusCell: e, hoverCell: i } = this.ctx;
|
|
4016
4031
|
if (t && e && i) {
|
|
4017
|
-
const { rowIndex: s, colIndex: o } = e, r = Math.min(i.colIndex, o), l = Math.max(i.colIndex, o), a = Math.min(i.rowIndex, s),
|
|
4032
|
+
const { rowIndex: s, colIndex: o } = e, r = Math.min(i.colIndex, o), l = Math.max(i.colIndex, o), a = Math.min(i.rowIndex, s), h = Math.max(i.rowIndex, s), d = [r, l], f = [a, h];
|
|
4018
4033
|
this.setSelector(d, f);
|
|
4019
4034
|
}
|
|
4020
4035
|
}
|
|
@@ -4024,7 +4039,7 @@ class ye {
|
|
|
4024
4039
|
if (this.ctx.selector.enable = !0, i && t) {
|
|
4025
4040
|
if (this.ctx.config.ENABLE_SELECTOR_SINGLE)
|
|
4026
4041
|
return;
|
|
4027
|
-
const { colIndex: s, rowIndex: o } = i, { colIndex: r, rowIndex: l } = e, a = Math.min(r, s),
|
|
4042
|
+
const { colIndex: s, rowIndex: o } = i, { colIndex: r, rowIndex: l } = e, a = Math.min(r, s), h = Math.max(r, s), d = Math.min(l, o), f = Math.max(l, o), x = [a, h], u = [d, f];
|
|
4028
4043
|
this.setSelector(x, u);
|
|
4029
4044
|
} else {
|
|
4030
4045
|
this.ctx.emit("cellSelectedClick", e);
|
|
@@ -4091,7 +4106,7 @@ class ye {
|
|
|
4091
4106
|
const o = /* @__PURE__ */ new Set();
|
|
4092
4107
|
for (let l = 0; l <= e[1] - e[0]; l++)
|
|
4093
4108
|
for (let a = 0; a <= t[1] - t[0]; a++) {
|
|
4094
|
-
const
|
|
4109
|
+
const h = l + e[0], d = a + t[0], f = this.ctx.database.getItemValueForRowIndexAndColIndex(h, d);
|
|
4095
4110
|
if (f) {
|
|
4096
4111
|
const { rowKey: x, key: u } = f;
|
|
4097
4112
|
this.ctx.database.getReadonly(x, u) || (o.add(x), s.push({
|
|
@@ -4123,11 +4138,11 @@ class ye {
|
|
|
4123
4138
|
const e = this.ctx.selector.yArr[0], i = this.ctx.selector.xArr[0], s = /* @__PURE__ */ new Set();
|
|
4124
4139
|
navigator.clipboard.readText().then(async (o) => {
|
|
4125
4140
|
let r = se(o);
|
|
4126
|
-
const l = [i, i + r[0].length - 1], a = [e, e + r.length - 1], [
|
|
4141
|
+
const l = [i, i + r[0].length - 1], a = [e, e + r.length - 1], [h, d] = a, [f, x] = l, u = d - this.ctx.maxRowIndex, p = x - this.ctx.maxColIndex;
|
|
4127
4142
|
(u > 0 || p > 0) && this.ctx.emit("onPastedDataOverflow", {
|
|
4128
4143
|
maxY: d,
|
|
4129
4144
|
maxX: x,
|
|
4130
|
-
minY:
|
|
4145
|
+
minY: h,
|
|
4131
4146
|
minX: f,
|
|
4132
4147
|
overflowRowCount: u,
|
|
4133
4148
|
overflowColCount: p,
|
|
@@ -4222,8 +4237,8 @@ class ye {
|
|
|
4222
4237
|
s < a && s++;
|
|
4223
4238
|
break;
|
|
4224
4239
|
}
|
|
4225
|
-
const
|
|
4226
|
-
f && (f.operation || this.isInSettingRange(f.rowIndex, f.colIndex) && (this.ctx.setFocusCell(f), this.setSelector(
|
|
4240
|
+
const h = [i, i], d = [s, s], f = this.getCell(s, i);
|
|
4241
|
+
f && (f.operation || this.isInSettingRange(f.rowIndex, f.colIndex) && (this.ctx.setFocusCell(f), this.setSelector(h, d), this.adjustBoundaryPosition(), this.ctx.emit("moveFocus", f), this.ctx.emit("draw")));
|
|
4227
4242
|
}
|
|
4228
4243
|
stopAdjustPosition() {
|
|
4229
4244
|
this.adjustPositionX = "", this.adjustPositionY = "", this.timerX && (clearInterval(this.timerX), this.timerX = 0), this.timerY && (clearInterval(this.timerY), this.timerY = 0);
|
|
@@ -4237,8 +4252,8 @@ class ye {
|
|
|
4237
4252
|
SELECTOR_AREA_MAX_Y: r,
|
|
4238
4253
|
SELECTOR_AREA_MAX_X_OFFSET: l,
|
|
4239
4254
|
SELECTOR_AREA_MAX_Y_OFFSET: a
|
|
4240
|
-
} = this.ctx.config,
|
|
4241
|
-
return !(e <
|
|
4255
|
+
} = this.ctx.config, h = i, d = s || this.ctx.maxColIndex - l, f = o, x = r || this.ctx.maxRowIndex - a;
|
|
4256
|
+
return !(e < h || e > d || t < f || t > x);
|
|
4242
4257
|
}
|
|
4243
4258
|
/**
|
|
4244
4259
|
* 调整滚动条位置,让到达边界时自动滚动
|
|
@@ -4251,8 +4266,8 @@ class ye {
|
|
|
4251
4266
|
let l = 10 * (s === "left" ? -1 : 1);
|
|
4252
4267
|
this.timerX && (clearInterval(this.timerX), this.timerX = 0), this.timerX = setInterval(() => {
|
|
4253
4268
|
l *= 1.5;
|
|
4254
|
-
const { scrollX: a } = this.ctx,
|
|
4255
|
-
(
|
|
4269
|
+
const { scrollX: a } = this.ctx, h = a + l;
|
|
4270
|
+
(h < 0 || h > this.ctx.body.width) && (clearInterval(this.timerX), this.timerX = 0), this.ctx.setScrollX(h);
|
|
4256
4271
|
}, 100);
|
|
4257
4272
|
}
|
|
4258
4273
|
if (o && this.adjustPositionY !== o) {
|
|
@@ -4260,8 +4275,8 @@ class ye {
|
|
|
4260
4275
|
let l = 10 * (o === "top" ? -1 : 1);
|
|
4261
4276
|
this.timerY && (clearInterval(this.timerY), this.timerY = 0), this.timerY = setInterval(() => {
|
|
4262
4277
|
l *= 1.5;
|
|
4263
|
-
const { scrollY: a } = this.ctx,
|
|
4264
|
-
(
|
|
4278
|
+
const { scrollY: a } = this.ctx, h = a + l;
|
|
4279
|
+
(h < 0 || h > this.ctx.body.height) && (clearInterval(this.timerY), this.timerY = 0), this.ctx.setScrollY(h);
|
|
4265
4280
|
}, 100);
|
|
4266
4281
|
}
|
|
4267
4282
|
}
|
|
@@ -4278,7 +4293,7 @@ class ye {
|
|
|
4278
4293
|
header: r,
|
|
4279
4294
|
footer: l,
|
|
4280
4295
|
body: a,
|
|
4281
|
-
scrollX:
|
|
4296
|
+
scrollX: h,
|
|
4282
4297
|
scrollY: d,
|
|
4283
4298
|
config: { SCROLLER_TRACK_SIZE: f, FOOTER_FIXED: x, FOOTER_POSITION: u, ENABLE_MERGE_CELL_LINK: p }
|
|
4284
4299
|
} = this.ctx;
|
|
@@ -4291,8 +4306,8 @@ class ye {
|
|
|
4291
4306
|
let S = 0;
|
|
4292
4307
|
x && (u === "top" ? I = r.height + l.height - g : S = l.visibleHeight);
|
|
4293
4308
|
const v = g + _ - (t - S - f);
|
|
4294
|
-
let b =
|
|
4295
|
-
y > 0 && !m ? b = Math.floor(
|
|
4309
|
+
let b = h, O = d;
|
|
4310
|
+
y > 0 && !m ? b = Math.floor(h + y) : R > 0 && !m && (b = Math.floor(h - R)), I > 0 ? O = Math.floor(d - I) : v > 0 && (O = Math.floor(d + v)), (Math.abs(h - b) > 2 || Math.abs(d - O) > 2) && (this.ctx.adjustPositioning = !0, this.ctx.setScroll(b, O), this.ctx.emit("adjustBoundaryPosition", i));
|
|
4296
4311
|
}
|
|
4297
4312
|
destroy() {
|
|
4298
4313
|
this.timerX && (clearTimeout(this.timerX), this.timerX = 0), this.timerY && (clearTimeout(this.timerY), this.timerY = 0);
|
|
@@ -4308,7 +4323,7 @@ class Ce {
|
|
|
4308
4323
|
this.ctx.on("mousemove", (t) => {
|
|
4309
4324
|
if (this.ctx.stageElement.style.cursor === "crosshair" && (this.ctx.stageElement.style.cursor = "default"), this.ctx.editing || !this.ctx.focusCell || !this.maxColRowCell)
|
|
4310
4325
|
return;
|
|
4311
|
-
const { offsetX: e, offsetY: i } = this.ctx.getOffset(t), { colIndex: s, rowIndex: o, drawX: r, drawY: l, width: a, height:
|
|
4326
|
+
const { offsetX: e, offsetY: i } = this.ctx.getOffset(t), { colIndex: s, rowIndex: o, drawX: r, drawY: l, width: a, height: h } = this.maxColRowCell, d = 6, f = s === this.ctx.maxColIndex || o === this.ctx.maxRowIndex ? 0 : 2, x = r + a - d + f, u = l + h - d + f;
|
|
4312
4327
|
e > x && i > u && e < x + d && i < u + d && (this.ctx.stageElement.style.cursor = "crosshair");
|
|
4313
4328
|
}), this.ctx.on("cellMouseenter", (t) => {
|
|
4314
4329
|
const { xArr: e, yArr: i } = this.ctx.selector, s = e[1], o = i[1], { colIndex: r, rowIndex: l } = t;
|
|
@@ -4351,12 +4366,12 @@ class Ce {
|
|
|
4351
4366
|
if (JSON.stringify(this.ctx.autofill.xArr) !== JSON.stringify(r) || JSON.stringify(this.ctx.autofill.yArr) !== JSON.stringify(l)) {
|
|
4352
4367
|
const {
|
|
4353
4368
|
SELECTOR_AREA_MIN_X: a,
|
|
4354
|
-
SELECTOR_AREA_MAX_X:
|
|
4369
|
+
SELECTOR_AREA_MAX_X: h,
|
|
4355
4370
|
SELECTOR_AREA_MIN_Y: d,
|
|
4356
4371
|
SELECTOR_AREA_MAX_Y: f,
|
|
4357
4372
|
SELECTOR_AREA_MAX_X_OFFSET: x,
|
|
4358
4373
|
SELECTOR_AREA_MAX_Y_OFFSET: u
|
|
4359
|
-
} = this.ctx.config, p = a, w =
|
|
4374
|
+
} = this.ctx.config, p = a, w = h || this.ctx.maxColIndex - x, g = d, E = f || this.ctx.maxRowIndex - u;
|
|
4360
4375
|
let [C, m] = r, [R, y] = l;
|
|
4361
4376
|
if (C < p || R < g)
|
|
4362
4377
|
return;
|
|
@@ -4385,8 +4400,8 @@ class Ce {
|
|
|
4385
4400
|
const w = u + e.yArr[0], g = p + e.xArr[0];
|
|
4386
4401
|
i.set(`${w}-${g}`, !0);
|
|
4387
4402
|
}
|
|
4388
|
-
const { value: s } = e, o = s[0].length, r = s.length, l = this.ctx.autofill.xArr, a = this.ctx.autofill.yArr,
|
|
4389
|
-
if (this.ctx.config.ENABLE_MERGE_CELL_LINK && this.ctx.database.hasMergeCell(l, a) && !
|
|
4403
|
+
const { value: s } = e, o = s[0].length, r = s.length, l = this.ctx.autofill.xArr, a = this.ctx.autofill.yArr, h = o === 1 && r === 1;
|
|
4404
|
+
if (this.ctx.config.ENABLE_MERGE_CELL_LINK && this.ctx.database.hasMergeCell(l, a) && !h) {
|
|
4390
4405
|
const u = {
|
|
4391
4406
|
code: "ERR_MERGED_CELLS_AUTOFILL",
|
|
4392
4407
|
message: "Merged cells cannot span autofill data"
|
|
@@ -4441,9 +4456,9 @@ class Ce {
|
|
|
4441
4456
|
destroy() {
|
|
4442
4457
|
}
|
|
4443
4458
|
}
|
|
4444
|
-
const Z = Math.min, z = Math.max,
|
|
4445
|
-
x:
|
|
4446
|
-
y:
|
|
4459
|
+
const Z = Math.min, z = Math.max, it = Math.round, V = (c) => ({
|
|
4460
|
+
x: c,
|
|
4461
|
+
y: c
|
|
4447
4462
|
}), be = {
|
|
4448
4463
|
left: "right",
|
|
4449
4464
|
right: "left",
|
|
@@ -4453,46 +4468,46 @@ const Z = Math.min, z = Math.max, et = Math.round, W = (h) => ({
|
|
|
4453
4468
|
start: "end",
|
|
4454
4469
|
end: "start"
|
|
4455
4470
|
};
|
|
4456
|
-
function ht(
|
|
4457
|
-
return z(
|
|
4471
|
+
function ht(c, t, e) {
|
|
4472
|
+
return z(c, Z(t, e));
|
|
4458
4473
|
}
|
|
4459
|
-
function J(
|
|
4460
|
-
return typeof
|
|
4474
|
+
function J(c, t) {
|
|
4475
|
+
return typeof c == "function" ? c(t) : c;
|
|
4461
4476
|
}
|
|
4462
|
-
function P(
|
|
4463
|
-
return
|
|
4477
|
+
function P(c) {
|
|
4478
|
+
return c.split("-")[0];
|
|
4464
4479
|
}
|
|
4465
|
-
function Q(
|
|
4466
|
-
return
|
|
4480
|
+
function Q(c) {
|
|
4481
|
+
return c.split("-")[1];
|
|
4467
4482
|
}
|
|
4468
|
-
function Bt(
|
|
4469
|
-
return
|
|
4483
|
+
function Bt(c) {
|
|
4484
|
+
return c === "x" ? "y" : "x";
|
|
4470
4485
|
}
|
|
4471
|
-
function gt(
|
|
4472
|
-
return
|
|
4486
|
+
function gt(c) {
|
|
4487
|
+
return c === "y" ? "height" : "width";
|
|
4473
4488
|
}
|
|
4474
|
-
function G(
|
|
4475
|
-
return ["top", "bottom"].includes(P(
|
|
4489
|
+
function G(c) {
|
|
4490
|
+
return ["top", "bottom"].includes(P(c)) ? "y" : "x";
|
|
4476
4491
|
}
|
|
4477
|
-
function wt(
|
|
4478
|
-
return Bt(G(
|
|
4492
|
+
function wt(c) {
|
|
4493
|
+
return Bt(G(c));
|
|
4479
4494
|
}
|
|
4480
|
-
function ve(
|
|
4495
|
+
function ve(c, t, e) {
|
|
4481
4496
|
e === void 0 && (e = !1);
|
|
4482
|
-
const i = Q(
|
|
4497
|
+
const i = Q(c), s = wt(c), o = gt(s);
|
|
4483
4498
|
let r = s === "x" ? i === (e ? "end" : "start") ? "right" : "left" : i === "start" ? "bottom" : "top";
|
|
4484
|
-
return t.reference[o] > t.floating[o] && (r =
|
|
4499
|
+
return t.reference[o] > t.floating[o] && (r = st(r)), [r, st(r)];
|
|
4485
4500
|
}
|
|
4486
|
-
function Ie(
|
|
4487
|
-
const t =
|
|
4488
|
-
return [ct(
|
|
4501
|
+
function Ie(c) {
|
|
4502
|
+
const t = st(c);
|
|
4503
|
+
return [ct(c), t, ct(t)];
|
|
4489
4504
|
}
|
|
4490
|
-
function ct(
|
|
4491
|
-
return
|
|
4505
|
+
function ct(c) {
|
|
4506
|
+
return c.replace(/start|end/g, (t) => Re[t]);
|
|
4492
4507
|
}
|
|
4493
|
-
function _e(
|
|
4508
|
+
function _e(c, t, e) {
|
|
4494
4509
|
const i = ["left", "right"], s = ["right", "left"], o = ["top", "bottom"], r = ["bottom", "top"];
|
|
4495
|
-
switch (
|
|
4510
|
+
switch (c) {
|
|
4496
4511
|
case "top":
|
|
4497
4512
|
case "bottom":
|
|
4498
4513
|
return e ? t ? s : i : t ? i : s;
|
|
@@ -4503,38 +4518,38 @@ function _e(h, t, e) {
|
|
|
4503
4518
|
return [];
|
|
4504
4519
|
}
|
|
4505
4520
|
}
|
|
4506
|
-
function Oe(
|
|
4507
|
-
const s = Q(
|
|
4508
|
-
let o = _e(P(
|
|
4521
|
+
function Oe(c, t, e, i) {
|
|
4522
|
+
const s = Q(c);
|
|
4523
|
+
let o = _e(P(c), e === "start", i);
|
|
4509
4524
|
return s && (o = o.map((r) => r + "-" + s), t && (o = o.concat(o.map(ct)))), o;
|
|
4510
4525
|
}
|
|
4511
|
-
function
|
|
4512
|
-
return
|
|
4526
|
+
function st(c) {
|
|
4527
|
+
return c.replace(/left|right|bottom|top/g, (t) => be[t]);
|
|
4513
4528
|
}
|
|
4514
|
-
function Se(
|
|
4529
|
+
function Se(c) {
|
|
4515
4530
|
return {
|
|
4516
4531
|
top: 0,
|
|
4517
4532
|
right: 0,
|
|
4518
4533
|
bottom: 0,
|
|
4519
4534
|
left: 0,
|
|
4520
|
-
...
|
|
4535
|
+
...c
|
|
4521
4536
|
};
|
|
4522
4537
|
}
|
|
4523
|
-
function Kt(
|
|
4524
|
-
return typeof
|
|
4525
|
-
top:
|
|
4526
|
-
right:
|
|
4527
|
-
bottom:
|
|
4528
|
-
left:
|
|
4538
|
+
function Kt(c) {
|
|
4539
|
+
return typeof c != "number" ? Se(c) : {
|
|
4540
|
+
top: c,
|
|
4541
|
+
right: c,
|
|
4542
|
+
bottom: c,
|
|
4543
|
+
left: c
|
|
4529
4544
|
};
|
|
4530
4545
|
}
|
|
4531
|
-
function
|
|
4546
|
+
function ot(c) {
|
|
4532
4547
|
const {
|
|
4533
4548
|
x: t,
|
|
4534
4549
|
y: e,
|
|
4535
4550
|
width: i,
|
|
4536
4551
|
height: s
|
|
4537
|
-
} =
|
|
4552
|
+
} = c;
|
|
4538
4553
|
return {
|
|
4539
4554
|
width: i,
|
|
4540
4555
|
height: s,
|
|
@@ -4546,12 +4561,12 @@ function st(h) {
|
|
|
4546
4561
|
y: e
|
|
4547
4562
|
};
|
|
4548
4563
|
}
|
|
4549
|
-
function vt(
|
|
4564
|
+
function vt(c, t, e) {
|
|
4550
4565
|
let {
|
|
4551
4566
|
reference: i,
|
|
4552
4567
|
floating: s
|
|
4553
|
-
} =
|
|
4554
|
-
const o = G(t), r = wt(t), l = gt(r), a = P(t),
|
|
4568
|
+
} = c;
|
|
4569
|
+
const o = G(t), r = wt(t), l = gt(r), a = P(t), h = o === "y", d = i.x + i.width / 2 - s.width / 2, f = i.y + i.height / 2 - s.height / 2, x = i[l] / 2 - s[l] / 2;
|
|
4555
4570
|
let u;
|
|
4556
4571
|
switch (a) {
|
|
4557
4572
|
case "top":
|
|
@@ -4586,29 +4601,29 @@ function vt(h, t, e) {
|
|
|
4586
4601
|
}
|
|
4587
4602
|
switch (Q(t)) {
|
|
4588
4603
|
case "start":
|
|
4589
|
-
u[r] -= x * (e &&
|
|
4604
|
+
u[r] -= x * (e && h ? -1 : 1);
|
|
4590
4605
|
break;
|
|
4591
4606
|
case "end":
|
|
4592
|
-
u[r] += x * (e &&
|
|
4607
|
+
u[r] += x * (e && h ? -1 : 1);
|
|
4593
4608
|
break;
|
|
4594
4609
|
}
|
|
4595
4610
|
return u;
|
|
4596
4611
|
}
|
|
4597
|
-
const Le = async (
|
|
4612
|
+
const Le = async (c, t, e) => {
|
|
4598
4613
|
const {
|
|
4599
4614
|
placement: i = "bottom",
|
|
4600
4615
|
strategy: s = "absolute",
|
|
4601
4616
|
middleware: o = [],
|
|
4602
4617
|
platform: r
|
|
4603
4618
|
} = e, l = o.filter(Boolean), a = await (r.isRTL == null ? void 0 : r.isRTL(t));
|
|
4604
|
-
let
|
|
4605
|
-
reference:
|
|
4619
|
+
let h = await r.getElementRects({
|
|
4620
|
+
reference: c,
|
|
4606
4621
|
floating: t,
|
|
4607
4622
|
strategy: s
|
|
4608
4623
|
}), {
|
|
4609
4624
|
x: d,
|
|
4610
4625
|
y: f
|
|
4611
|
-
} = vt(
|
|
4626
|
+
} = vt(h, i, a), x = i, u = {}, p = 0;
|
|
4612
4627
|
for (let w = 0; w < l.length; w++) {
|
|
4613
4628
|
const {
|
|
4614
4629
|
name: g,
|
|
@@ -4625,10 +4640,10 @@ const Le = async (h, t, e) => {
|
|
|
4625
4640
|
placement: x,
|
|
4626
4641
|
strategy: s,
|
|
4627
4642
|
middlewareData: u,
|
|
4628
|
-
rects:
|
|
4643
|
+
rects: h,
|
|
4629
4644
|
platform: r,
|
|
4630
4645
|
elements: {
|
|
4631
|
-
reference:
|
|
4646
|
+
reference: c,
|
|
4632
4647
|
floating: t
|
|
4633
4648
|
}
|
|
4634
4649
|
});
|
|
@@ -4638,14 +4653,14 @@ const Le = async (h, t, e) => {
|
|
|
4638
4653
|
...u[g],
|
|
4639
4654
|
...R
|
|
4640
4655
|
}
|
|
4641
|
-
}, y && p <= 50 && (p++, typeof y == "object" && (y.placement && (x = y.placement), y.rects && (
|
|
4642
|
-
reference:
|
|
4656
|
+
}, y && p <= 50 && (p++, typeof y == "object" && (y.placement && (x = y.placement), y.rects && (h = y.rects === !0 ? await r.getElementRects({
|
|
4657
|
+
reference: c,
|
|
4643
4658
|
floating: t,
|
|
4644
4659
|
strategy: s
|
|
4645
4660
|
}) : y.rects), {
|
|
4646
4661
|
x: d,
|
|
4647
4662
|
y: f
|
|
4648
|
-
} = vt(
|
|
4663
|
+
} = vt(h, x, a)), w = -1);
|
|
4649
4664
|
}
|
|
4650
4665
|
return {
|
|
4651
4666
|
x: d,
|
|
@@ -4655,7 +4670,7 @@ const Le = async (h, t, e) => {
|
|
|
4655
4670
|
middlewareData: u
|
|
4656
4671
|
};
|
|
4657
4672
|
};
|
|
4658
|
-
async function Nt(
|
|
4673
|
+
async function Nt(c, t) {
|
|
4659
4674
|
var e;
|
|
4660
4675
|
t === void 0 && (t = {});
|
|
4661
4676
|
const {
|
|
@@ -4665,15 +4680,15 @@ async function Nt(h, t) {
|
|
|
4665
4680
|
rects: r,
|
|
4666
4681
|
elements: l,
|
|
4667
4682
|
strategy: a
|
|
4668
|
-
} =
|
|
4669
|
-
boundary:
|
|
4683
|
+
} = c, {
|
|
4684
|
+
boundary: h = "clippingAncestors",
|
|
4670
4685
|
rootBoundary: d = "viewport",
|
|
4671
4686
|
elementContext: f = "floating",
|
|
4672
4687
|
altBoundary: x = !1,
|
|
4673
4688
|
padding: u = 0
|
|
4674
|
-
} = J(t,
|
|
4689
|
+
} = J(t, c), p = Kt(u), g = l[x ? f === "floating" ? "reference" : "floating" : f], E = ot(await o.getClippingRect({
|
|
4675
4690
|
element: (e = await (o.isElement == null ? void 0 : o.isElement(g))) == null || e ? g : g.contextElement || await (o.getDocumentElement == null ? void 0 : o.getDocumentElement(l.floating)),
|
|
4676
|
-
boundary:
|
|
4691
|
+
boundary: h,
|
|
4677
4692
|
rootBoundary: d,
|
|
4678
4693
|
strategy: a
|
|
4679
4694
|
})), C = f === "floating" ? {
|
|
@@ -4687,7 +4702,7 @@ async function Nt(h, t) {
|
|
|
4687
4702
|
} : {
|
|
4688
4703
|
x: 1,
|
|
4689
4704
|
y: 1
|
|
4690
|
-
}, y =
|
|
4705
|
+
}, y = ot(o.convertOffsetParentRelativeRectToViewportRelativeRect ? await o.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
4691
4706
|
elements: l,
|
|
4692
4707
|
rect: C,
|
|
4693
4708
|
offsetParent: m,
|
|
@@ -4700,9 +4715,9 @@ async function Nt(h, t) {
|
|
|
4700
4715
|
right: (y.right - E.right + p.right) / R.x
|
|
4701
4716
|
};
|
|
4702
4717
|
}
|
|
4703
|
-
const Te = (
|
|
4718
|
+
const Te = (c) => ({
|
|
4704
4719
|
name: "arrow",
|
|
4705
|
-
options:
|
|
4720
|
+
options: c,
|
|
4706
4721
|
async fn(t) {
|
|
4707
4722
|
const {
|
|
4708
4723
|
x: e,
|
|
@@ -4713,15 +4728,15 @@ const Te = (h) => ({
|
|
|
4713
4728
|
elements: l,
|
|
4714
4729
|
middlewareData: a
|
|
4715
4730
|
} = t, {
|
|
4716
|
-
element:
|
|
4731
|
+
element: h,
|
|
4717
4732
|
padding: d = 0
|
|
4718
|
-
} = J(
|
|
4719
|
-
if (
|
|
4733
|
+
} = J(c, t) || {};
|
|
4734
|
+
if (h == null)
|
|
4720
4735
|
return {};
|
|
4721
4736
|
const f = Kt(d), x = {
|
|
4722
4737
|
x: e,
|
|
4723
4738
|
y: i
|
|
4724
|
-
}, u = wt(s), p = gt(u), w = await r.getDimensions(
|
|
4739
|
+
}, u = wt(s), p = gt(u), w = await r.getDimensions(h), g = u === "y", E = g ? "top" : "left", C = g ? "bottom" : "right", m = g ? "clientHeight" : "clientWidth", R = o.reference[p] + o.reference[u] - x[u] - o.floating[p], y = x[u] - o.reference[u], I = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(h));
|
|
4725
4740
|
let _ = I ? I[m] : 0;
|
|
4726
4741
|
(!_ || !await (r.isElement == null ? void 0 : r.isElement(I))) && (_ = l.floating[m] || o.floating[p]);
|
|
4727
4742
|
const S = R / 2 - y / 2, v = _ / 2 - w[p] / 2 - 1, b = Z(f[E], v), O = Z(f[C], v), L = b, M = _ - w[p] - O, T = _ / 2 - w[p] / 2 + S, X = ht(L, T, M), K = !a.arrow && Q(s) != null && T !== X && o.reference[p] / 2 - (T < L ? b : O) - w[p] / 2 < 0, k = K ? T < L ? T - L : T - M : 0;
|
|
@@ -4737,10 +4752,10 @@ const Te = (h) => ({
|
|
|
4737
4752
|
reset: K
|
|
4738
4753
|
};
|
|
4739
4754
|
}
|
|
4740
|
-
}), Ae = function(
|
|
4741
|
-
return
|
|
4755
|
+
}), Ae = function(c) {
|
|
4756
|
+
return c === void 0 && (c = {}), {
|
|
4742
4757
|
name: "flip",
|
|
4743
|
-
options:
|
|
4758
|
+
options: c,
|
|
4744
4759
|
async fn(t) {
|
|
4745
4760
|
var e, i;
|
|
4746
4761
|
const {
|
|
@@ -4749,7 +4764,7 @@ const Te = (h) => ({
|
|
|
4749
4764
|
rects: r,
|
|
4750
4765
|
initialPlacement: l,
|
|
4751
4766
|
platform: a,
|
|
4752
|
-
elements:
|
|
4767
|
+
elements: h
|
|
4753
4768
|
} = t, {
|
|
4754
4769
|
mainAxis: d = !0,
|
|
4755
4770
|
crossAxis: f = !0,
|
|
@@ -4758,10 +4773,10 @@ const Te = (h) => ({
|
|
|
4758
4773
|
fallbackAxisSideDirection: p = "none",
|
|
4759
4774
|
flipAlignment: w = !0,
|
|
4760
4775
|
...g
|
|
4761
|
-
} = J(
|
|
4776
|
+
} = J(c, t);
|
|
4762
4777
|
if ((e = o.arrow) != null && e.alignmentOffset)
|
|
4763
4778
|
return {};
|
|
4764
|
-
const E = P(s), C = G(l), m = P(l) === l, R = await (a.isRTL == null ? void 0 : a.isRTL(
|
|
4779
|
+
const E = P(s), C = G(l), m = P(l) === l, R = await (a.isRTL == null ? void 0 : a.isRTL(h.floating)), y = x || (m || !w ? [st(l)] : Ie(l)), I = p !== "none";
|
|
4765
4780
|
!x && I && y.push(...Oe(l, w, p, R));
|
|
4766
4781
|
const _ = [l, ...y], S = await Nt(t, g), v = [];
|
|
4767
4782
|
let b = ((i = o.flip) == null ? void 0 : i.overflows) || [];
|
|
@@ -4817,12 +4832,12 @@ const Te = (h) => ({
|
|
|
4817
4832
|
}
|
|
4818
4833
|
};
|
|
4819
4834
|
};
|
|
4820
|
-
async function Me(
|
|
4835
|
+
async function Me(c, t) {
|
|
4821
4836
|
const {
|
|
4822
4837
|
placement: e,
|
|
4823
4838
|
platform: i,
|
|
4824
4839
|
elements: s
|
|
4825
|
-
} =
|
|
4840
|
+
} = c, o = await (i.isRTL == null ? void 0 : i.isRTL(s.floating)), r = P(e), l = Q(e), a = G(e) === "y", h = ["left", "top"].includes(r) ? -1 : 1, d = o && a ? -1 : 1, f = J(t, c);
|
|
4826
4841
|
let {
|
|
4827
4842
|
mainAxis: x,
|
|
4828
4843
|
crossAxis: u,
|
|
@@ -4838,16 +4853,16 @@ async function Me(h, t) {
|
|
|
4838
4853
|
};
|
|
4839
4854
|
return l && typeof p == "number" && (u = l === "end" ? p * -1 : p), a ? {
|
|
4840
4855
|
x: u * d,
|
|
4841
|
-
y: x *
|
|
4856
|
+
y: x * h
|
|
4842
4857
|
} : {
|
|
4843
|
-
x: x *
|
|
4858
|
+
x: x * h,
|
|
4844
4859
|
y: u * d
|
|
4845
4860
|
};
|
|
4846
4861
|
}
|
|
4847
|
-
const He = function(
|
|
4848
|
-
return
|
|
4862
|
+
const He = function(c) {
|
|
4863
|
+
return c === void 0 && (c = 0), {
|
|
4849
4864
|
name: "offset",
|
|
4850
|
-
options:
|
|
4865
|
+
options: c,
|
|
4851
4866
|
async fn(t) {
|
|
4852
4867
|
var e, i;
|
|
4853
4868
|
const {
|
|
@@ -4855,7 +4870,7 @@ const He = function(h) {
|
|
|
4855
4870
|
y: o,
|
|
4856
4871
|
placement: r,
|
|
4857
4872
|
middlewareData: l
|
|
4858
|
-
} = t, a = await Me(t,
|
|
4873
|
+
} = t, a = await Me(t, c);
|
|
4859
4874
|
return r === ((e = l.offset) == null ? void 0 : e.placement) && (i = l.arrow) != null && i.alignmentOffset ? {} : {
|
|
4860
4875
|
x: s + a.x,
|
|
4861
4876
|
y: o + a.y,
|
|
@@ -4866,10 +4881,10 @@ const He = function(h) {
|
|
|
4866
4881
|
};
|
|
4867
4882
|
}
|
|
4868
4883
|
};
|
|
4869
|
-
}, De = function(
|
|
4870
|
-
return
|
|
4884
|
+
}, De = function(c) {
|
|
4885
|
+
return c === void 0 && (c = {}), {
|
|
4871
4886
|
name: "shift",
|
|
4872
|
-
options:
|
|
4887
|
+
options: c,
|
|
4873
4888
|
async fn(t) {
|
|
4874
4889
|
const {
|
|
4875
4890
|
x: e,
|
|
@@ -4891,11 +4906,11 @@ const He = function(h) {
|
|
|
4891
4906
|
}
|
|
4892
4907
|
},
|
|
4893
4908
|
...a
|
|
4894
|
-
} = J(
|
|
4909
|
+
} = J(c, t), h = {
|
|
4895
4910
|
x: e,
|
|
4896
4911
|
y: i
|
|
4897
4912
|
}, d = await Nt(t, a), f = G(P(s)), x = Bt(f);
|
|
4898
|
-
let u =
|
|
4913
|
+
let u = h[x], p = h[f];
|
|
4899
4914
|
if (o) {
|
|
4900
4915
|
const g = x === "y" ? "top" : "left", E = x === "y" ? "bottom" : "right", C = u + d[g], m = u - d[E];
|
|
4901
4916
|
u = ht(C, u, m);
|
|
@@ -4923,212 +4938,212 @@ const He = function(h) {
|
|
|
4923
4938
|
}
|
|
4924
4939
|
};
|
|
4925
4940
|
};
|
|
4926
|
-
function
|
|
4941
|
+
function rt() {
|
|
4927
4942
|
return typeof window < "u";
|
|
4928
4943
|
}
|
|
4929
|
-
function j(
|
|
4930
|
-
return Yt(
|
|
4944
|
+
function j(c) {
|
|
4945
|
+
return Yt(c) ? (c.nodeName || "").toLowerCase() : "#document";
|
|
4931
4946
|
}
|
|
4932
|
-
function A(
|
|
4947
|
+
function A(c) {
|
|
4933
4948
|
var t;
|
|
4934
|
-
return (
|
|
4949
|
+
return (c == null || (t = c.ownerDocument) == null ? void 0 : t.defaultView) || window;
|
|
4935
4950
|
}
|
|
4936
|
-
function N(
|
|
4951
|
+
function N(c) {
|
|
4937
4952
|
var t;
|
|
4938
|
-
return (t = (Yt(
|
|
4953
|
+
return (t = (Yt(c) ? c.ownerDocument : c.document) || window.document) == null ? void 0 : t.documentElement;
|
|
4939
4954
|
}
|
|
4940
|
-
function Yt(
|
|
4941
|
-
return
|
|
4955
|
+
function Yt(c) {
|
|
4956
|
+
return rt() ? c instanceof Node || c instanceof A(c).Node : !1;
|
|
4942
4957
|
}
|
|
4943
|
-
function H(
|
|
4944
|
-
return
|
|
4958
|
+
function H(c) {
|
|
4959
|
+
return rt() ? c instanceof Element || c instanceof A(c).Element : !1;
|
|
4945
4960
|
}
|
|
4946
|
-
function B(
|
|
4947
|
-
return
|
|
4961
|
+
function B(c) {
|
|
4962
|
+
return rt() ? c instanceof HTMLElement || c instanceof A(c).HTMLElement : !1;
|
|
4948
4963
|
}
|
|
4949
|
-
function It(
|
|
4950
|
-
return !
|
|
4964
|
+
function It(c) {
|
|
4965
|
+
return !rt() || typeof ShadowRoot > "u" ? !1 : c instanceof ShadowRoot || c instanceof A(c).ShadowRoot;
|
|
4951
4966
|
}
|
|
4952
|
-
function tt(
|
|
4967
|
+
function tt(c) {
|
|
4953
4968
|
const {
|
|
4954
4969
|
overflow: t,
|
|
4955
4970
|
overflowX: e,
|
|
4956
4971
|
overflowY: i,
|
|
4957
4972
|
display: s
|
|
4958
|
-
} = D(
|
|
4973
|
+
} = D(c);
|
|
4959
4974
|
return /auto|scroll|overlay|hidden|clip/.test(t + i + e) && !["inline", "contents"].includes(s);
|
|
4960
4975
|
}
|
|
4961
|
-
function Xe(
|
|
4962
|
-
return ["table", "td", "th"].includes(j(
|
|
4976
|
+
function Xe(c) {
|
|
4977
|
+
return ["table", "td", "th"].includes(j(c));
|
|
4963
4978
|
}
|
|
4964
|
-
function
|
|
4979
|
+
function nt(c) {
|
|
4965
4980
|
return [":popover-open", ":modal"].some((t) => {
|
|
4966
4981
|
try {
|
|
4967
|
-
return
|
|
4982
|
+
return c.matches(t);
|
|
4968
4983
|
} catch {
|
|
4969
4984
|
return !1;
|
|
4970
4985
|
}
|
|
4971
4986
|
});
|
|
4972
4987
|
}
|
|
4973
|
-
function pt(
|
|
4974
|
-
const t = Et(), e = H(
|
|
4988
|
+
function pt(c) {
|
|
4989
|
+
const t = Et(), e = H(c) ? D(c) : c;
|
|
4975
4990
|
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));
|
|
4976
4991
|
}
|
|
4977
|
-
function ke(
|
|
4978
|
-
let t =
|
|
4992
|
+
function ke(c) {
|
|
4993
|
+
let t = W(c);
|
|
4979
4994
|
for (; B(t) && !U(t); ) {
|
|
4980
4995
|
if (pt(t))
|
|
4981
4996
|
return t;
|
|
4982
|
-
if (
|
|
4997
|
+
if (nt(t))
|
|
4983
4998
|
return null;
|
|
4984
|
-
t =
|
|
4999
|
+
t = W(t);
|
|
4985
5000
|
}
|
|
4986
5001
|
return null;
|
|
4987
5002
|
}
|
|
4988
5003
|
function Et() {
|
|
4989
5004
|
return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
|
|
4990
5005
|
}
|
|
4991
|
-
function U(
|
|
4992
|
-
return ["html", "body", "#document"].includes(j(
|
|
5006
|
+
function U(c) {
|
|
5007
|
+
return ["html", "body", "#document"].includes(j(c));
|
|
4993
5008
|
}
|
|
4994
|
-
function D(
|
|
4995
|
-
return A(
|
|
5009
|
+
function D(c) {
|
|
5010
|
+
return A(c).getComputedStyle(c);
|
|
4996
5011
|
}
|
|
4997
|
-
function
|
|
4998
|
-
return H(
|
|
4999
|
-
scrollLeft:
|
|
5000
|
-
scrollTop:
|
|
5012
|
+
function lt(c) {
|
|
5013
|
+
return H(c) ? {
|
|
5014
|
+
scrollLeft: c.scrollLeft,
|
|
5015
|
+
scrollTop: c.scrollTop
|
|
5001
5016
|
} : {
|
|
5002
|
-
scrollLeft:
|
|
5003
|
-
scrollTop:
|
|
5017
|
+
scrollLeft: c.scrollX,
|
|
5018
|
+
scrollTop: c.scrollY
|
|
5004
5019
|
};
|
|
5005
5020
|
}
|
|
5006
|
-
function
|
|
5007
|
-
if (j(
|
|
5008
|
-
return
|
|
5021
|
+
function W(c) {
|
|
5022
|
+
if (j(c) === "html")
|
|
5023
|
+
return c;
|
|
5009
5024
|
const t = (
|
|
5010
5025
|
// Step into the shadow DOM of the parent of a slotted node.
|
|
5011
|
-
|
|
5012
|
-
|
|
5013
|
-
It(
|
|
5014
|
-
N(
|
|
5026
|
+
c.assignedSlot || // DOM Element detected.
|
|
5027
|
+
c.parentNode || // ShadowRoot detected.
|
|
5028
|
+
It(c) && c.host || // Fallback.
|
|
5029
|
+
N(c)
|
|
5015
5030
|
);
|
|
5016
5031
|
return It(t) ? t.host : t;
|
|
5017
5032
|
}
|
|
5018
|
-
function Ft(
|
|
5019
|
-
const t =
|
|
5020
|
-
return U(t) ?
|
|
5033
|
+
function Ft(c) {
|
|
5034
|
+
const t = W(c);
|
|
5035
|
+
return U(t) ? c.ownerDocument ? c.ownerDocument.body : c.body : B(t) && tt(t) ? t : Ft(t);
|
|
5021
5036
|
}
|
|
5022
|
-
function dt(
|
|
5037
|
+
function dt(c, t, e) {
|
|
5023
5038
|
var i;
|
|
5024
5039
|
t === void 0 && (t = []), e === void 0 && (e = !0);
|
|
5025
|
-
const s = Ft(
|
|
5040
|
+
const s = Ft(c), o = s === ((i = c.ownerDocument) == null ? void 0 : i.body), r = A(s);
|
|
5026
5041
|
if (o) {
|
|
5027
5042
|
const l = ft(r);
|
|
5028
5043
|
return t.concat(r, r.visualViewport || [], tt(s) ? s : [], l && e ? dt(l) : []);
|
|
5029
5044
|
}
|
|
5030
5045
|
return t.concat(s, dt(s, [], e));
|
|
5031
5046
|
}
|
|
5032
|
-
function ft(
|
|
5033
|
-
return
|
|
5047
|
+
function ft(c) {
|
|
5048
|
+
return c.parent && Object.getPrototypeOf(c.parent) ? c.frameElement : null;
|
|
5034
5049
|
}
|
|
5035
|
-
function
|
|
5036
|
-
const t = D(
|
|
5050
|
+
function Vt(c) {
|
|
5051
|
+
const t = D(c);
|
|
5037
5052
|
let e = parseFloat(t.width) || 0, i = parseFloat(t.height) || 0;
|
|
5038
|
-
const s = B(
|
|
5053
|
+
const s = B(c), o = s ? c.offsetWidth : e, r = s ? c.offsetHeight : i, l = it(e) !== o || it(i) !== r;
|
|
5039
5054
|
return l && (e = o, i = r), {
|
|
5040
5055
|
width: e,
|
|
5041
5056
|
height: i,
|
|
5042
5057
|
$: l
|
|
5043
5058
|
};
|
|
5044
5059
|
}
|
|
5045
|
-
function
|
|
5046
|
-
return H(
|
|
5060
|
+
function Wt(c) {
|
|
5061
|
+
return H(c) ? c : c.contextElement;
|
|
5047
5062
|
}
|
|
5048
|
-
function $(
|
|
5049
|
-
const t =
|
|
5063
|
+
function $(c) {
|
|
5064
|
+
const t = Wt(c);
|
|
5050
5065
|
if (!B(t))
|
|
5051
|
-
return
|
|
5066
|
+
return V(1);
|
|
5052
5067
|
const e = t.getBoundingClientRect(), {
|
|
5053
5068
|
width: i,
|
|
5054
5069
|
height: s,
|
|
5055
5070
|
$: o
|
|
5056
|
-
} =
|
|
5057
|
-
let r = (o ?
|
|
5071
|
+
} = Vt(t);
|
|
5072
|
+
let r = (o ? it(e.width) : e.width) / i, l = (o ? it(e.height) : e.height) / s;
|
|
5058
5073
|
return (!r || !Number.isFinite(r)) && (r = 1), (!l || !Number.isFinite(l)) && (l = 1), {
|
|
5059
5074
|
x: r,
|
|
5060
5075
|
y: l
|
|
5061
5076
|
};
|
|
5062
5077
|
}
|
|
5063
|
-
const Be = /* @__PURE__ */
|
|
5064
|
-
function Pt(
|
|
5065
|
-
const t = A(
|
|
5078
|
+
const Be = /* @__PURE__ */ V(0);
|
|
5079
|
+
function Pt(c) {
|
|
5080
|
+
const t = A(c);
|
|
5066
5081
|
return !Et() || !t.visualViewport ? Be : {
|
|
5067
5082
|
x: t.visualViewport.offsetLeft,
|
|
5068
5083
|
y: t.visualViewport.offsetTop
|
|
5069
5084
|
};
|
|
5070
5085
|
}
|
|
5071
|
-
function Ke(
|
|
5072
|
-
return t === void 0 && (t = !1), !e || t && e !== A(
|
|
5086
|
+
function Ke(c, t, e) {
|
|
5087
|
+
return t === void 0 && (t = !1), !e || t && e !== A(c) ? !1 : t;
|
|
5073
5088
|
}
|
|
5074
|
-
function q(
|
|
5089
|
+
function q(c, t, e, i) {
|
|
5075
5090
|
t === void 0 && (t = !1), e === void 0 && (e = !1);
|
|
5076
|
-
const s =
|
|
5077
|
-
let r =
|
|
5078
|
-
t && (i ? H(i) && (r = $(i)) : r = $(
|
|
5079
|
-
const l = Ke(o, e, i) ? Pt(o) :
|
|
5080
|
-
let a = (s.left + l.x) / r.x,
|
|
5091
|
+
const s = c.getBoundingClientRect(), o = Wt(c);
|
|
5092
|
+
let r = V(1);
|
|
5093
|
+
t && (i ? H(i) && (r = $(i)) : r = $(c));
|
|
5094
|
+
const l = Ke(o, e, i) ? Pt(o) : V(0);
|
|
5095
|
+
let a = (s.left + l.x) / r.x, h = (s.top + l.y) / r.y, d = s.width / r.x, f = s.height / r.y;
|
|
5081
5096
|
if (o) {
|
|
5082
5097
|
const x = A(o), u = i && H(i) ? A(i) : i;
|
|
5083
5098
|
let p = x, w = ft(p);
|
|
5084
5099
|
for (; w && i && u !== p; ) {
|
|
5085
5100
|
const g = $(w), E = w.getBoundingClientRect(), C = D(w), m = E.left + (w.clientLeft + parseFloat(C.paddingLeft)) * g.x, R = E.top + (w.clientTop + parseFloat(C.paddingTop)) * g.y;
|
|
5086
|
-
a *= g.x,
|
|
5101
|
+
a *= g.x, h *= g.y, d *= g.x, f *= g.y, a += m, h += R, p = A(w), w = ft(p);
|
|
5087
5102
|
}
|
|
5088
5103
|
}
|
|
5089
|
-
return
|
|
5104
|
+
return ot({
|
|
5090
5105
|
width: d,
|
|
5091
5106
|
height: f,
|
|
5092
5107
|
x: a,
|
|
5093
|
-
y:
|
|
5108
|
+
y: h
|
|
5094
5109
|
});
|
|
5095
5110
|
}
|
|
5096
|
-
function Ne(
|
|
5111
|
+
function Ne(c) {
|
|
5097
5112
|
let {
|
|
5098
5113
|
elements: t,
|
|
5099
5114
|
rect: e,
|
|
5100
5115
|
offsetParent: i,
|
|
5101
5116
|
strategy: s
|
|
5102
|
-
} =
|
|
5103
|
-
const o = s === "fixed", r = N(i), l = t ?
|
|
5117
|
+
} = c;
|
|
5118
|
+
const o = s === "fixed", r = N(i), l = t ? nt(t.floating) : !1;
|
|
5104
5119
|
if (i === r || l && o)
|
|
5105
5120
|
return e;
|
|
5106
5121
|
let a = {
|
|
5107
5122
|
scrollLeft: 0,
|
|
5108
5123
|
scrollTop: 0
|
|
5109
|
-
},
|
|
5110
|
-
const d =
|
|
5111
|
-
if ((f || !f && !o) && ((j(i) !== "body" || tt(r)) && (a =
|
|
5124
|
+
}, h = V(1);
|
|
5125
|
+
const d = V(0), f = B(i);
|
|
5126
|
+
if ((f || !f && !o) && ((j(i) !== "body" || tt(r)) && (a = lt(i)), B(i))) {
|
|
5112
5127
|
const x = q(i);
|
|
5113
|
-
|
|
5128
|
+
h = $(i), d.x = x.x + i.clientLeft, d.y = x.y + i.clientTop;
|
|
5114
5129
|
}
|
|
5115
5130
|
return {
|
|
5116
|
-
width: e.width *
|
|
5117
|
-
height: e.height *
|
|
5118
|
-
x: e.x *
|
|
5119
|
-
y: e.y *
|
|
5131
|
+
width: e.width * h.x,
|
|
5132
|
+
height: e.height * h.y,
|
|
5133
|
+
x: e.x * h.x - a.scrollLeft * h.x + d.x,
|
|
5134
|
+
y: e.y * h.y - a.scrollTop * h.y + d.y
|
|
5120
5135
|
};
|
|
5121
5136
|
}
|
|
5122
|
-
function Ye(
|
|
5123
|
-
return Array.from(
|
|
5137
|
+
function Ye(c) {
|
|
5138
|
+
return Array.from(c.getClientRects());
|
|
5124
5139
|
}
|
|
5125
|
-
function xt(
|
|
5126
|
-
const e =
|
|
5127
|
-
return t ? t.left + e : q(N(
|
|
5140
|
+
function xt(c, t) {
|
|
5141
|
+
const e = lt(c).scrollLeft;
|
|
5142
|
+
return t ? t.left + e : q(N(c)).left + e;
|
|
5128
5143
|
}
|
|
5129
|
-
function Fe(
|
|
5130
|
-
const t = N(
|
|
5131
|
-
let r = -e.scrollLeft + xt(
|
|
5144
|
+
function Fe(c) {
|
|
5145
|
+
const t = N(c), e = lt(c), i = c.ownerDocument.body, s = z(t.scrollWidth, t.clientWidth, i.scrollWidth, i.clientWidth), o = z(t.scrollHeight, t.clientHeight, i.scrollHeight, i.clientHeight);
|
|
5146
|
+
let r = -e.scrollLeft + xt(c);
|
|
5132
5147
|
const l = -e.scrollTop;
|
|
5133
5148
|
return D(i).direction === "rtl" && (r += z(t.clientWidth, i.clientWidth) - s), {
|
|
5134
5149
|
width: s,
|
|
@@ -5137,13 +5152,13 @@ function Fe(h) {
|
|
|
5137
5152
|
y: l
|
|
5138
5153
|
};
|
|
5139
5154
|
}
|
|
5140
|
-
function
|
|
5141
|
-
const e = A(
|
|
5155
|
+
function Ve(c, t) {
|
|
5156
|
+
const e = A(c), i = N(c), s = e.visualViewport;
|
|
5142
5157
|
let o = i.clientWidth, r = i.clientHeight, l = 0, a = 0;
|
|
5143
5158
|
if (s) {
|
|
5144
5159
|
o = s.width, r = s.height;
|
|
5145
|
-
const
|
|
5146
|
-
(!
|
|
5160
|
+
const h = Et();
|
|
5161
|
+
(!h || h && t === "fixed") && (l = s.offsetLeft, a = s.offsetTop);
|
|
5147
5162
|
}
|
|
5148
5163
|
return {
|
|
5149
5164
|
width: o,
|
|
@@ -5152,60 +5167,60 @@ function We(h, t) {
|
|
|
5152
5167
|
y: a
|
|
5153
5168
|
};
|
|
5154
5169
|
}
|
|
5155
|
-
function
|
|
5156
|
-
const e = q(
|
|
5170
|
+
function We(c, t) {
|
|
5171
|
+
const e = q(c, !0, t === "fixed"), i = e.top + c.clientTop, s = e.left + c.clientLeft, o = B(c) ? $(c) : V(1), r = c.clientWidth * o.x, l = c.clientHeight * o.y, a = s * o.x, h = i * o.y;
|
|
5157
5172
|
return {
|
|
5158
5173
|
width: r,
|
|
5159
5174
|
height: l,
|
|
5160
5175
|
x: a,
|
|
5161
|
-
y:
|
|
5176
|
+
y: h
|
|
5162
5177
|
};
|
|
5163
5178
|
}
|
|
5164
|
-
function _t(
|
|
5179
|
+
function _t(c, t, e) {
|
|
5165
5180
|
let i;
|
|
5166
5181
|
if (t === "viewport")
|
|
5167
|
-
i =
|
|
5182
|
+
i = Ve(c, e);
|
|
5168
5183
|
else if (t === "document")
|
|
5169
|
-
i = Fe(N(
|
|
5184
|
+
i = Fe(N(c));
|
|
5170
5185
|
else if (H(t))
|
|
5171
|
-
i =
|
|
5186
|
+
i = We(t, e);
|
|
5172
5187
|
else {
|
|
5173
|
-
const s = Pt(
|
|
5188
|
+
const s = Pt(c);
|
|
5174
5189
|
i = {
|
|
5175
5190
|
...t,
|
|
5176
5191
|
x: t.x - s.x,
|
|
5177
5192
|
y: t.y - s.y
|
|
5178
5193
|
};
|
|
5179
5194
|
}
|
|
5180
|
-
return
|
|
5195
|
+
return ot(i);
|
|
5181
5196
|
}
|
|
5182
|
-
function zt(
|
|
5183
|
-
const e =
|
|
5197
|
+
function zt(c, t) {
|
|
5198
|
+
const e = W(c);
|
|
5184
5199
|
return e === t || !H(e) || U(e) ? !1 : D(e).position === "fixed" || zt(e, t);
|
|
5185
5200
|
}
|
|
5186
|
-
function Pe(
|
|
5187
|
-
const e = t.get(
|
|
5201
|
+
function Pe(c, t) {
|
|
5202
|
+
const e = t.get(c);
|
|
5188
5203
|
if (e)
|
|
5189
5204
|
return e;
|
|
5190
|
-
let i = dt(
|
|
5191
|
-
const o = D(
|
|
5192
|
-
let r = o ?
|
|
5205
|
+
let i = dt(c, [], !1).filter((l) => H(l) && j(l) !== "body"), s = null;
|
|
5206
|
+
const o = D(c).position === "fixed";
|
|
5207
|
+
let r = o ? W(c) : c;
|
|
5193
5208
|
for (; H(r) && !U(r); ) {
|
|
5194
5209
|
const l = D(r), a = pt(r);
|
|
5195
|
-
!a && l.position === "fixed" && (s = null), (o ? !a && !s : !a && l.position === "static" && !!s && ["absolute", "fixed"].includes(s.position) || tt(r) && !a && zt(
|
|
5210
|
+
!a && l.position === "fixed" && (s = null), (o ? !a && !s : !a && l.position === "static" && !!s && ["absolute", "fixed"].includes(s.position) || tt(r) && !a && zt(c, r)) ? i = i.filter((d) => d !== r) : s = l, r = W(r);
|
|
5196
5211
|
}
|
|
5197
|
-
return t.set(
|
|
5212
|
+
return t.set(c, i), i;
|
|
5198
5213
|
}
|
|
5199
|
-
function ze(
|
|
5214
|
+
function ze(c) {
|
|
5200
5215
|
let {
|
|
5201
5216
|
element: t,
|
|
5202
5217
|
boundary: e,
|
|
5203
5218
|
rootBoundary: i,
|
|
5204
5219
|
strategy: s
|
|
5205
|
-
} =
|
|
5206
|
-
const r = [...e === "clippingAncestors" ?
|
|
5220
|
+
} = c;
|
|
5221
|
+
const r = [...e === "clippingAncestors" ? nt(t) ? [] : Pe(t, this._c) : [].concat(e), i], l = r[0], a = r.reduce((h, d) => {
|
|
5207
5222
|
const f = _t(t, d, s);
|
|
5208
|
-
return
|
|
5223
|
+
return h.top = z(f.top, h.top), h.right = Z(f.right, h.right), h.bottom = Z(f.bottom, h.bottom), h.left = z(f.left, h.left), h;
|
|
5209
5224
|
}, _t(t, l, s));
|
|
5210
5225
|
return {
|
|
5211
5226
|
width: a.right - a.left,
|
|
@@ -5214,35 +5229,35 @@ function ze(h) {
|
|
|
5214
5229
|
y: a.top
|
|
5215
5230
|
};
|
|
5216
5231
|
}
|
|
5217
|
-
function $e(
|
|
5232
|
+
function $e(c) {
|
|
5218
5233
|
const {
|
|
5219
5234
|
width: t,
|
|
5220
5235
|
height: e
|
|
5221
|
-
} =
|
|
5236
|
+
} = Vt(c);
|
|
5222
5237
|
return {
|
|
5223
5238
|
width: t,
|
|
5224
5239
|
height: e
|
|
5225
5240
|
};
|
|
5226
5241
|
}
|
|
5227
|
-
function Ge(
|
|
5228
|
-
const i = B(t), s = N(t), o = e === "fixed", r = q(
|
|
5242
|
+
function Ge(c, t, e) {
|
|
5243
|
+
const i = B(t), s = N(t), o = e === "fixed", r = q(c, !0, o, t);
|
|
5229
5244
|
let l = {
|
|
5230
5245
|
scrollLeft: 0,
|
|
5231
5246
|
scrollTop: 0
|
|
5232
5247
|
};
|
|
5233
|
-
const a =
|
|
5248
|
+
const a = V(0);
|
|
5234
5249
|
if (i || !i && !o)
|
|
5235
|
-
if ((j(t) !== "body" || tt(s)) && (l =
|
|
5250
|
+
if ((j(t) !== "body" || tt(s)) && (l = lt(t)), i) {
|
|
5236
5251
|
const u = q(t, !0, o, t);
|
|
5237
5252
|
a.x = u.x + t.clientLeft, a.y = u.y + t.clientTop;
|
|
5238
5253
|
} else s && (a.x = xt(s));
|
|
5239
|
-
let
|
|
5254
|
+
let h = 0, d = 0;
|
|
5240
5255
|
if (s && !i && !o) {
|
|
5241
5256
|
const u = s.getBoundingClientRect();
|
|
5242
|
-
d = u.top + l.scrollTop,
|
|
5257
|
+
d = u.top + l.scrollTop, h = u.left + l.scrollLeft - // RTL <body> scrollbar.
|
|
5243
5258
|
xt(s, u);
|
|
5244
5259
|
}
|
|
5245
|
-
const f = r.left + l.scrollLeft - a.x -
|
|
5260
|
+
const f = r.left + l.scrollLeft - a.x - h, x = r.top + l.scrollTop - a.y - d;
|
|
5246
5261
|
return {
|
|
5247
5262
|
x: f,
|
|
5248
5263
|
y: x,
|
|
@@ -5250,39 +5265,39 @@ function Ge(h, t, e) {
|
|
|
5250
5265
|
height: r.height
|
|
5251
5266
|
};
|
|
5252
5267
|
}
|
|
5253
|
-
function
|
|
5254
|
-
return D(
|
|
5268
|
+
function at(c) {
|
|
5269
|
+
return D(c).position === "static";
|
|
5255
5270
|
}
|
|
5256
|
-
function Ot(
|
|
5257
|
-
if (!B(
|
|
5271
|
+
function Ot(c, t) {
|
|
5272
|
+
if (!B(c) || D(c).position === "fixed")
|
|
5258
5273
|
return null;
|
|
5259
5274
|
if (t)
|
|
5260
|
-
return t(
|
|
5261
|
-
let e =
|
|
5262
|
-
return N(
|
|
5275
|
+
return t(c);
|
|
5276
|
+
let e = c.offsetParent;
|
|
5277
|
+
return N(c) === e && (e = e.ownerDocument.body), e;
|
|
5263
5278
|
}
|
|
5264
|
-
function $t(
|
|
5265
|
-
const e = A(
|
|
5266
|
-
if (
|
|
5279
|
+
function $t(c, t) {
|
|
5280
|
+
const e = A(c);
|
|
5281
|
+
if (nt(c))
|
|
5267
5282
|
return e;
|
|
5268
|
-
if (!B(
|
|
5269
|
-
let s =
|
|
5283
|
+
if (!B(c)) {
|
|
5284
|
+
let s = W(c);
|
|
5270
5285
|
for (; s && !U(s); ) {
|
|
5271
|
-
if (H(s) && !
|
|
5286
|
+
if (H(s) && !at(s))
|
|
5272
5287
|
return s;
|
|
5273
|
-
s =
|
|
5288
|
+
s = W(s);
|
|
5274
5289
|
}
|
|
5275
5290
|
return e;
|
|
5276
5291
|
}
|
|
5277
|
-
let i = Ot(
|
|
5278
|
-
for (; i && Xe(i) &&
|
|
5292
|
+
let i = Ot(c, t);
|
|
5293
|
+
for (; i && Xe(i) && at(i); )
|
|
5279
5294
|
i = Ot(i, t);
|
|
5280
|
-
return i && U(i) &&
|
|
5295
|
+
return i && U(i) && at(i) && !pt(i) ? e : i || ke(c) || e;
|
|
5281
5296
|
}
|
|
5282
|
-
const Ue = async function(
|
|
5283
|
-
const t = this.getOffsetParent || $t, e = this.getDimensions, i = await e(
|
|
5297
|
+
const Ue = async function(c) {
|
|
5298
|
+
const t = this.getOffsetParent || $t, e = this.getDimensions, i = await e(c.floating);
|
|
5284
5299
|
return {
|
|
5285
|
-
reference: Ge(
|
|
5300
|
+
reference: Ge(c.reference, await t(c.floating), c.strategy),
|
|
5286
5301
|
floating: {
|
|
5287
5302
|
x: 0,
|
|
5288
5303
|
y: 0,
|
|
@@ -5291,8 +5306,8 @@ const Ue = async function(h) {
|
|
|
5291
5306
|
}
|
|
5292
5307
|
};
|
|
5293
5308
|
};
|
|
5294
|
-
function je(
|
|
5295
|
-
return D(
|
|
5309
|
+
function je(c) {
|
|
5310
|
+
return D(c).direction === "rtl";
|
|
5296
5311
|
}
|
|
5297
5312
|
const Ze = {
|
|
5298
5313
|
convertOffsetParentRelativeRectToViewportRelativeRect: Ne,
|
|
@@ -5305,7 +5320,7 @@ const Ze = {
|
|
|
5305
5320
|
getScale: $,
|
|
5306
5321
|
isElement: H,
|
|
5307
5322
|
isRTL: je
|
|
5308
|
-
}, Gt = He, Ut = De, jt = Ae, qe = Te, Zt = (
|
|
5323
|
+
}, Gt = He, Ut = De, jt = Ae, qe = Te, Zt = (c, t, e) => {
|
|
5309
5324
|
const i = /* @__PURE__ */ new Map(), s = {
|
|
5310
5325
|
platform: Ze,
|
|
5311
5326
|
...e
|
|
@@ -5313,7 +5328,7 @@ const Ze = {
|
|
|
5313
5328
|
...s.platform,
|
|
5314
5329
|
_c: i
|
|
5315
5330
|
};
|
|
5316
|
-
return Le(
|
|
5331
|
+
return Le(c, t, {
|
|
5317
5332
|
...s,
|
|
5318
5333
|
platform: o
|
|
5319
5334
|
});
|
|
@@ -5397,9 +5412,9 @@ let Je = class {
|
|
|
5397
5412
|
placement: t.overflowTooltipPlacement,
|
|
5398
5413
|
middleware: [Ut(), jt(), Gt(6), qe({ element: this.arrowEl })]
|
|
5399
5414
|
}).then((l) => {
|
|
5400
|
-
const { x: a, y:
|
|
5415
|
+
const { x: a, y: h, placement: d, middlewareData: f } = l;
|
|
5401
5416
|
if (Object.assign(this.floatingEl.style, {
|
|
5402
|
-
top: `${
|
|
5417
|
+
top: `${h}px`,
|
|
5403
5418
|
left: `${a}px`
|
|
5404
5419
|
}), f.arrow) {
|
|
5405
5420
|
const x = f.arrow;
|
|
@@ -5471,8 +5486,8 @@ class Qe {
|
|
|
5471
5486
|
}
|
|
5472
5487
|
if ((t.altKey || t.metaKey) && t.code === "Enter" && this.ctx.editing && this.inputEl) {
|
|
5473
5488
|
t.preventDefault();
|
|
5474
|
-
const a = this.inputEl.selectionStart,
|
|
5475
|
-
this.inputEl.value =
|
|
5489
|
+
const a = this.inputEl.selectionStart, h = this.inputEl.value.substring(0, a), d = this.inputEl.value.substring(a);
|
|
5490
|
+
this.inputEl.value = h + `
|
|
5476
5491
|
` + d, this.inputEl.selectionStart = this.inputEl.selectionEnd = a + 1, this.autoSize();
|
|
5477
5492
|
return;
|
|
5478
5493
|
}
|
|
@@ -5579,12 +5594,12 @@ class Qe {
|
|
|
5579
5594
|
let { height: o, width: r, drawY: l, drawX: a } = t;
|
|
5580
5595
|
this.drawX = a, this.drawY = l;
|
|
5581
5596
|
const {
|
|
5582
|
-
config: { CELL_PADDING:
|
|
5597
|
+
config: { CELL_PADDING: h },
|
|
5583
5598
|
header: d
|
|
5584
5599
|
} = this.ctx;
|
|
5585
5600
|
let f = this.ctx.body.visibleHeight;
|
|
5586
5601
|
if (o > f && (o = f), this.editorEl.style.display = "inline-block", this.editorEl.style.left = `${this.drawX - 1}px`, this.editorEl.style.top = `${this.drawY - 1}px`, this.editorEl.style.bottom = "auto", this.editorEl.style.maxHeight = `${f}px`, s === "text") {
|
|
5587
|
-
this.inputEl.style.display = "block", this.inputEl.style.minWidth = `${r - 1}px`, this.inputEl.style.minHeight = `${o - 1}px`, this.inputEl.style.maxHeight = `${f}px`, this.inputEl.style.width = `${r - 1}px`, this.inputEl.style.height = "auto", this.inputEl.style.padding = `${
|
|
5602
|
+
this.inputEl.style.display = "block", this.inputEl.style.minWidth = `${r - 1}px`, this.inputEl.style.minHeight = `${o - 1}px`, this.inputEl.style.maxHeight = `${f}px`, this.inputEl.style.width = `${r - 1}px`, this.inputEl.style.height = "auto", this.inputEl.style.padding = `${h}px`, i !== null && (this.inputEl.value = i), this.inputEl.focus({ preventScroll: !0 });
|
|
5588
5603
|
const x = this.inputEl.value.length;
|
|
5589
5604
|
this.inputEl.setSelectionRange(x, x);
|
|
5590
5605
|
} else
|
|
@@ -5612,10 +5627,10 @@ class Qe {
|
|
|
5612
5627
|
i && !a && (this.enable = !0, this.ctx.editing = !0, this.cellTarget = i, this.startEditByInput(this.cellTarget, t), this.ctx.emit("startEdit", this.cellTarget));
|
|
5613
5628
|
}
|
|
5614
5629
|
editCell(t, e) {
|
|
5615
|
-
const i = this.ctx.body.renderRows.find((
|
|
5630
|
+
const i = this.ctx.body.renderRows.find((h) => h.rowIndex === t);
|
|
5616
5631
|
if (!i)
|
|
5617
5632
|
return;
|
|
5618
|
-
const s = i.cells.find((
|
|
5633
|
+
const s = i.cells.find((h) => h.colIndex === e);
|
|
5619
5634
|
if (!s)
|
|
5620
5635
|
return;
|
|
5621
5636
|
this.ctx.emit("setSelectorCell", s);
|
|
@@ -5643,7 +5658,7 @@ class ti {
|
|
|
5643
5658
|
this.ctx = t;
|
|
5644
5659
|
const { EMPTY_TEXT: e, EMPTY_CUSTOM_STYLE: i } = this.ctx.config;
|
|
5645
5660
|
this.ctx.emptyElement ? this.emptyEl = this.ctx.emptyElement : (this.emptyEl = document.createElement("div"), this.emptyEl.innerText = e), this.emptyEl.className = "e-virt-table-empty", this.emptyEl.style.display = "none", this.ctx.containerElement.appendChild(this.emptyEl), this.ctx.on("emptyChange", ({ type: s, headerHeight: o, bodyHeight: r, footerHeight: l }) => {
|
|
5646
|
-
const a = o + (r + l) / 2,
|
|
5661
|
+
const a = o + (r + l) / 2, h = {
|
|
5647
5662
|
display: s === "empty" ? "block" : "none",
|
|
5648
5663
|
position: "absolute",
|
|
5649
5664
|
fontSize: "14px",
|
|
@@ -5653,7 +5668,7 @@ class ti {
|
|
|
5653
5668
|
transform: "translate(-50%, -50%)",
|
|
5654
5669
|
...i
|
|
5655
5670
|
};
|
|
5656
|
-
Object.assign(this.emptyEl.style,
|
|
5671
|
+
Object.assign(this.emptyEl.style, h);
|
|
5657
5672
|
});
|
|
5658
5673
|
}
|
|
5659
5674
|
destroy() {
|
|
@@ -5689,9 +5704,9 @@ class ei {
|
|
|
5689
5704
|
fixedRightWidth: e,
|
|
5690
5705
|
config: { SCROLLER_TRACK_SIZE: i, CSS_PREFIX: s }
|
|
5691
5706
|
} = this.ctx, { visibleWidth: o, visibleHeight: r, renderCellHeaders: l } = this.ctx.header;
|
|
5692
|
-
let a = [],
|
|
5707
|
+
let a = [], h = [], d = [];
|
|
5693
5708
|
l.forEach((g) => {
|
|
5694
|
-
g.render && (g.fixed === "left" ?
|
|
5709
|
+
g.render && (g.fixed === "left" ? h.push(g) : g.fixed === "right" ? d.push(g) : a.push(g));
|
|
5695
5710
|
});
|
|
5696
5711
|
const f = e - i, x = {
|
|
5697
5712
|
key: "left",
|
|
@@ -5703,7 +5718,7 @@ class ei {
|
|
|
5703
5718
|
width: `${t}px`,
|
|
5704
5719
|
height: `${r}px`
|
|
5705
5720
|
},
|
|
5706
|
-
cells:
|
|
5721
|
+
cells: h
|
|
5707
5722
|
}, u = {
|
|
5708
5723
|
key: "center",
|
|
5709
5724
|
style: {
|
|
@@ -5751,7 +5766,7 @@ class ei {
|
|
|
5751
5766
|
fixedLeftWidth: o,
|
|
5752
5767
|
fixedRightWidth: r,
|
|
5753
5768
|
config: { SCROLLER_TRACK_SIZE: l, CSS_PREFIX: a }
|
|
5754
|
-
} = this.ctx, { visibleWidth:
|
|
5769
|
+
} = this.ctx, { visibleWidth: h, visibleHeight: d } = this.ctx.body, f = r - l, x = {
|
|
5755
5770
|
key: "left",
|
|
5756
5771
|
style: {
|
|
5757
5772
|
position: "absolute",
|
|
@@ -5769,7 +5784,7 @@ class ei {
|
|
|
5769
5784
|
top: `${0.5}px`,
|
|
5770
5785
|
left: `${o - 0.5}px`,
|
|
5771
5786
|
overflow: "hidden",
|
|
5772
|
-
width: `${
|
|
5787
|
+
width: `${h - o - f}px`,
|
|
5773
5788
|
height: `${d}px`
|
|
5774
5789
|
},
|
|
5775
5790
|
cells: t
|
|
@@ -5791,7 +5806,7 @@ class ei {
|
|
|
5791
5806
|
style: {
|
|
5792
5807
|
position: "relative",
|
|
5793
5808
|
overflow: "hidden",
|
|
5794
|
-
width: `${
|
|
5809
|
+
width: `${h}px`,
|
|
5795
5810
|
height: `${d}px`
|
|
5796
5811
|
},
|
|
5797
5812
|
views: [x, u, p]
|
|
@@ -5808,7 +5823,7 @@ class ei {
|
|
|
5808
5823
|
fixedLeftWidth: s,
|
|
5809
5824
|
fixedRightWidth: o,
|
|
5810
5825
|
config: { SCROLLER_TRACK_SIZE: r, CSS_PREFIX: l }
|
|
5811
|
-
} = this.ctx, { visibleWidth: a, visibleHeight:
|
|
5826
|
+
} = this.ctx, { visibleWidth: a, visibleHeight: h } = this.ctx.footer, d = o - r, f = {
|
|
5812
5827
|
key: "left",
|
|
5813
5828
|
style: {
|
|
5814
5829
|
position: "absolute",
|
|
@@ -5816,7 +5831,7 @@ class ei {
|
|
|
5816
5831
|
left: `${0.5}px`,
|
|
5817
5832
|
overflow: "hidden",
|
|
5818
5833
|
width: `${s}px`,
|
|
5819
|
-
height: `${
|
|
5834
|
+
height: `${h}px`
|
|
5820
5835
|
},
|
|
5821
5836
|
cells: e
|
|
5822
5837
|
}, x = {
|
|
@@ -5827,7 +5842,7 @@ class ei {
|
|
|
5827
5842
|
left: `${s - 0.5}px`,
|
|
5828
5843
|
overflow: "hidden",
|
|
5829
5844
|
width: `${a - s - d}px`,
|
|
5830
|
-
height: `${
|
|
5845
|
+
height: `${h}px`
|
|
5831
5846
|
},
|
|
5832
5847
|
cells: t
|
|
5833
5848
|
}, u = {
|
|
@@ -5838,7 +5853,7 @@ class ei {
|
|
|
5838
5853
|
right: `${0.5}px`,
|
|
5839
5854
|
overflow: "hidden",
|
|
5840
5855
|
width: `${d}px`,
|
|
5841
|
-
height: `${
|
|
5856
|
+
height: `${h}px`
|
|
5842
5857
|
},
|
|
5843
5858
|
cells: i
|
|
5844
5859
|
};
|
|
@@ -5849,7 +5864,7 @@ class ei {
|
|
|
5849
5864
|
position: "relative",
|
|
5850
5865
|
overflow: "hidden",
|
|
5851
5866
|
width: `${a}px`,
|
|
5852
|
-
height: `${
|
|
5867
|
+
height: `${h}px`
|
|
5853
5868
|
},
|
|
5854
5869
|
views: [f, x, u]
|
|
5855
5870
|
};
|
|
@@ -5866,8 +5881,8 @@ class ii {
|
|
|
5866
5881
|
this.ctx.on("cellContextMenuClick", (t, e) => {
|
|
5867
5882
|
if (!this.ctx.config.ENABLE_CONTEXT_MENU) return;
|
|
5868
5883
|
e.preventDefault();
|
|
5869
|
-
const { xArr: i, yArr: s } = this.ctx.selector, [o, r] = i, [l, a] = s, { rowIndex:
|
|
5870
|
-
|
|
5884
|
+
const { xArr: i, yArr: s } = this.ctx.selector, [o, r] = i, [l, a] = s, { rowIndex: h, colIndex: d } = t;
|
|
5885
|
+
h >= l && h <= a && d >= o && d <= r || this.ctx.emit("setSelectorCell", t, e);
|
|
5871
5886
|
const x = {
|
|
5872
5887
|
getBoundingClientRect: () => ({
|
|
5873
5888
|
width: 0,
|
|
@@ -5974,15 +5989,15 @@ class ri {
|
|
|
5974
5989
|
t.className = "e-virt-table-container";
|
|
5975
5990
|
const r = document.createElement("div"), l = document.createElement("canvas"), a = e || document.createElement("div");
|
|
5976
5991
|
r.className = "e-virt-table-stage", t.tabIndex = 0, l.className = "e-virt-table-canvas", a.className = "e-virt-table-overlayer";
|
|
5977
|
-
const
|
|
5978
|
-
|
|
5992
|
+
const h = i || document.createElement("div");
|
|
5993
|
+
h.className = "e-virt-table-editor";
|
|
5979
5994
|
const d = s, f = o;
|
|
5980
5995
|
return r.appendChild(l), r.appendChild(a), t.appendChild(r), {
|
|
5981
5996
|
containerElement: t,
|
|
5982
5997
|
stageElement: r,
|
|
5983
5998
|
canvasElement: l,
|
|
5984
5999
|
overlayerElement: a,
|
|
5985
|
-
editorElement:
|
|
6000
|
+
editorElement: h,
|
|
5986
6001
|
emptyElement: d,
|
|
5987
6002
|
contextMenuElement: f
|
|
5988
6003
|
};
|
|
@@ -6065,15 +6080,15 @@ class ri {
|
|
|
6065
6080
|
return new Promise(async (i, s) => {
|
|
6066
6081
|
let o = [];
|
|
6067
6082
|
for (let r = 0; r < t.length; r++) {
|
|
6068
|
-
const { rowKey: l, key: a } = t[r],
|
|
6069
|
-
Array.isArray(
|
|
6083
|
+
const { rowKey: l, key: a } = t[r], h = await this.ctx.database.getValidator(l, a);
|
|
6084
|
+
Array.isArray(h) && h.length && o.push(h);
|
|
6070
6085
|
}
|
|
6071
6086
|
if (o.length) {
|
|
6072
6087
|
if (s(o), e) {
|
|
6073
6088
|
const [r] = o;
|
|
6074
6089
|
if (Array.isArray(r) && r.length) {
|
|
6075
|
-
const [l] = r, { rowKey: a, key:
|
|
6076
|
-
this.scrollToRowkey(a), this.scrollToColkey(
|
|
6090
|
+
const [l] = r, { rowKey: a, key: h } = l;
|
|
6091
|
+
this.scrollToRowkey(a), this.scrollToColkey(h);
|
|
6077
6092
|
}
|
|
6078
6093
|
}
|
|
6079
6094
|
this.ctx.emit("draw");
|
|
@@ -6090,9 +6105,9 @@ class ri {
|
|
|
6090
6105
|
if (t && Array.isArray(s) && s.length) {
|
|
6091
6106
|
const [o] = s;
|
|
6092
6107
|
if (Array.isArray(o) && o.length) {
|
|
6093
|
-
const [r] = o, { rowKey: l, key: a } = r,
|
|
6094
|
-
if (
|
|
6095
|
-
const { parentRowKeys: d = [] } =
|
|
6108
|
+
const [r] = o, { rowKey: l, key: a } = r, h = this.ctx.database.getRowForRowKey(l);
|
|
6109
|
+
if (h) {
|
|
6110
|
+
const { parentRowKeys: d = [] } = h;
|
|
6096
6111
|
d && d.length && this.setExpandRowKeys(d, !0);
|
|
6097
6112
|
}
|
|
6098
6113
|
this.scrollToRowkey(l), this.scrollToColkey(a);
|