e-virt-table 1.3.12 → 1.3.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +4 -4
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +811 -799
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +5 -5
- package/dist/index.umd.js.map +1 -1
- package/dist/lib/Body.d.ts +1 -1
- package/dist/lib/Body.js +2 -2
- package/dist/lib/Body.js.map +1 -1
- package/dist/lib/Cell.js +18 -10
- package/dist/lib/Cell.js.map +1 -1
- package/dist/lib/Config.d.ts +2 -0
- package/dist/lib/Config.js +7 -0
- package/dist/lib/Config.js.map +1 -1
- package/dist/lib/Database.d.ts +1 -1
- package/dist/lib/Database.js +6 -5
- package/dist/lib/Database.js.map +1 -1
- package/dist/lib/EVirtTable.d.ts +1 -1
- package/dist/lib/EVirtTable.js +18 -24
- package/dist/lib/EVirtTable.js.map +1 -1
- package/dist/lib/Editor.js +15 -10
- package/dist/lib/Editor.js.map +1 -1
- package/dist/lib/Empty.js +0 -5
- package/dist/lib/Empty.js.map +1 -1
- package/dist/lib/EventTable.js +11 -4
- package/dist/lib/EventTable.js.map +1 -1
- package/dist/lib/Overlayer.js +3 -11
- package/dist/lib/Overlayer.js.map +1 -1
- package/dist/lib/Tooltip.js +10 -1
- package/dist/lib/Tooltip.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.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-
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.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-body-bg-color: #fff;--evt-stripe-color: #fafafa;--evt-placeholder-color: #cdd0dc;--evt-header-bg-color: #f8faff;--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-required-color: #f56c6c;--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: rgba(82, 146, 247, .1);--evt-autofill-point-border-color: #fff;--evt-edit-bg-color: #fcf6ed;--evt-checkbox-color: var(--evt-color-primary);--evt-checkbox-uncheck-color: #dde0ea;--evt-checkbox-disabled-color: #f1f2f4;--evt-checkbox-check-disabled-color: #dde0ea;--evt-icon-edit-color: #4e5969;--evt-icon-select-color: #4e5969;--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-text-color: #fff;--evt-resize-column-text-bg-color: var(--evt-color-primary);--evt-resize-column-line-color: #e1e6eb;--evt-tree-line-color: #e1e6eb;--evt-sort-icon-color: var(--evt-color-primary);--evt-drag-tip-bg-color: rgba(82, 146, 247, .1);--evt-drag-tip-line-color: var(--evt-color-primary);--evt-context-menu-min-width: 150px;--evt-context-menu-max-width: 220px;--evt-context-menu-item-padding: 8px 12px;--evt-context-menu-bg-color: #fff;--evt-context-menu-text-color: #333;--evt-context-menu-item-hover-text-color: var(--evt-color-primary);--evt-context-menu-item-hover-bg-color: #f5f5f5;--evt-context-menu-text-size: 13px}.dark{--evt-border-color: #363637;--evt-header-bg-color: #141414;--evt-body-bg-color: #141414;--evt-header-text-color: #a3a6ad;--evt-body-text-color: #cfd3dc;--evt-readonly-text-color: #cfd3dc;--evt-footer-text-color: #cfd3dc;--evt-scroller-color: #414243;--evt-scroller-track-color: #141414;--evt-scroller-focus-color: #a3a6ad;--evt-edit-bg-color: #141414;--evt-footer-bg-color: #262727;--evt-autofill-point-border-color: #fff;--evt-editor-bg-color: #434343;--evt-editor-text-color: #cfd3dc;--evt-context-menu-bg-color: #141414;--evt-context-menu-text-color: #cfd3dc;--evt-context-menu-item-hover-text-color: var(--evt-color-primary);--evt-context-menu-item-hover-bg-color: #414243}.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;background-color:var(--evt-body-bg-color);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:6px 24px;color:var(--evt-text-color-regular)}.e-virt-table-context-menu-item:hover{color:var(--evt-color-primary);background-color:#f5f7fa}.e-virt-table-loading{display:none;position:absolute;left:0;top:0;right:0;bottom:0;width:100%;height:100%;z-index:2000;background-color:#fff6;display:flex;align-items:center;justify-content:center}.e-virt-table-loading-spinner{opacity:1;display:flex;flex-direction:column;align-items:center;justify-content:center}.e-virt-table-loading-spinner svg{color:var(--evt-text-color-regular);animation:rotate 1s linear infinite}@keyframes rotate{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.e-virt-table-loading-text{margin:0;font-size:12px;color:var(--evt-text-color-regular)}.e-virt-table-main-menu,.e-virt-table-submenu{position:absolute;background:var(--evt-context-menu-bg-color);border-radius:4px;box-shadow:0 2px 8px #0000001a;min-width:var(--evt-context-menu-min-width);max-width:var(--evt-context-menu-max-width);color:var(--evt-text-color-primary)}.e-virt-table-main-menu{border:1px solid var(--evt-border-color);z-index:3000;left:-99999px;top:-99999px;display:none;position:fixed;background-color:var(--evt-body-bg-color)}.e-virt-table-submenu{border:1px solid var(--evt-border-color);z-index:1000;max-height:350px;overflow-y:auto;opacity:0;visibility:hidden;transform:translate(-10px);transition:opacity .2s,visibility .2s,transform .2s;-ms-overflow-style:none;scrollbar-width:none}.e-virt-table-submenu::-webkit-scrollbar{display:none}.e-virt-table-submenu.show{opacity:1;visibility:visible;transform:translate(0)}.e-virt-table-submenu:not(.show){transition:none}.e-virt-table-menu-item,.e-virt-table-submenu-item{position:relative;-webkit-user-select:none;user-select:none;padding:var(--evt-context-menu-item-padding);cursor:pointer;display:flex;justify-content:space-between;align-items:center;transition:background .2s,color .2s;color:var(--evt-context-menu-text-color);font-size:var(--evt-context-menu-text-size)}.e-virt-table-menu-item:last-child,.e-virt-table-submenu-item:last-child{border-bottom:none}.e-virt-table-menu-item:has(.e-virt-table-menu-item-icon){padding-left:8px}.e-virt-table-menu-item-content{display:flex;align-items:center;flex:1;min-width:0}.e-virt-table-menu-item-icon{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;margin-right:8px;flex-shrink:0}.e-virt-table-menu-item-icon svg{width:100%;height:100%;fill:currentColor}.e-virt-table-menu-item-text{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.e-virt-table-menu-arrow{display:inline-flex;align-items:center;justify-content:center;color:var(--evt-text-color-regular);transition:color .2s}.e-virt-table-menu-arrow svg{width:20px;height:20px;fill:currentColor}.e-virt-table-submenu-item:hover,.e-virt-table-menu-item:hover,.e-virt-table-menu-item.active{background:var(--evt-context-menu-item-hover-bg-color);color:var(--evt-context-menu-item-hover-text-color)}.e-virt-table-menu-item.disabled,.e-virt-table-submenu-item.disabled{cursor:not-allowed}.e-virt-table-finder-bar{position:absolute;top:8px;right:16px;display:none;z-index:10000;background:#fff;border:1px solid #dadce0;border-radius:12px;box-shadow:0 2px 6px #0003;padding:0 8px;height:48px;min-width:250px;align-items:center;font-size:12px}.e-virt-table-finder-bar.show{display:flex}.e-virt-table-finder-bar-input-wrapper{display:flex;align-items:center;flex:1;padding:0 8px;position:relative}.e-virt-table-finder-bar-input{border:none;outline:none;flex:1;font-size:12px;background:transparent;color:#333;min-width:150px;padding-left:0;position:relative}.e-virt-table-finder-bar-nav{display:flex;flex-direction:row;gap:8px;margin:0 8px;align-items:center}.e-virt-table-finder-bar-nav-btn{border:none;background:transparent;cursor:pointer;padding:0;color:#666;border-radius:50%;display:flex;align-items:center;justify-content:center}.e-virt-table-finder-bar-nav-btn svg{width:24px;height:24px}.e-virt-table-finder-bar-nav-btn.prev-btn{transform:rotate(-90deg)}.e-virt-table-finder-bar-nav-btn.next-btn{transform:rotate(90deg)}.e-virt-table-finder-bar-nav-btn.close-btn{font-size:24px;color:#666;line-height:1;width:24px;height:24px}.e-virt-table-finder-bar-nav-btn:hover{color:#666;background-color:#f0f0f0}.e-virt-table-finder-bar-count{color:#666;font-size:12px;margin:0 8px;white-space:nowrap;flex-shrink:0}.e-virt-table-finder-bar-count.no-results{color:#999}.e-virt-table-finder-bar-loading{display:none;position:absolute;left:8px;top:0;width:16px;height:16px;flex-shrink:0;pointer-events:none;z-index:0}.e-virt-table-finder-bar-loading.show{display:block}.e-virt-table-finder-bar-loading svg{width:100%;height:100%;color:#666;animation:rotate 1s linear infinite}.e-virt-table-empty{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);font-size:14px;color:#666;z-index:15}")),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
|
|
2
2
|
var de = Object.defineProperty;
|
|
3
|
-
var fe = (
|
|
4
|
-
var n = (
|
|
3
|
+
var fe = (c, t, e) => t in c ? de(c, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : c[t] = e;
|
|
4
|
+
var n = (c, t, e) => fe(c, typeof t != "symbol" ? t + "" : t, e);
|
|
5
5
|
class ue {
|
|
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: a, rowIndex: l, value:
|
|
11
|
+
const e = [], { column: i, row: s, key: o, rowKey: r, colIndex: a, rowIndex: l, 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: a,
|
|
21
21
|
rowIndex: l,
|
|
@@ -24,17 +24,17 @@ class ue {
|
|
|
24
24
|
rowKey: r,
|
|
25
25
|
...x
|
|
26
26
|
};
|
|
27
|
-
x.validator(u,
|
|
27
|
+
x.validator(u, h, (g) => {
|
|
28
28
|
g && e.push({
|
|
29
29
|
...u,
|
|
30
30
|
message: g
|
|
31
31
|
});
|
|
32
32
|
});
|
|
33
33
|
}
|
|
34
|
-
if (!x.required && (
|
|
34
|
+
if (!x.required && (h == null || h === ""))
|
|
35
35
|
return e;
|
|
36
|
-
x.pattern && !x.pattern.test(
|
|
37
|
-
value:
|
|
36
|
+
x.pattern && !x.pattern.test(h) && e.push({
|
|
37
|
+
value: h,
|
|
38
38
|
column: i,
|
|
39
39
|
row: s,
|
|
40
40
|
key: o,
|
|
@@ -44,8 +44,8 @@ class ue {
|
|
|
44
44
|
field: d,
|
|
45
45
|
fieldValue: f,
|
|
46
46
|
message: x.message || `${o} is pattern validation error`
|
|
47
|
-
}), x.required && (
|
|
48
|
-
value:
|
|
47
|
+
}), x.required && (h == null || h === "") && e.push({
|
|
48
|
+
value: h,
|
|
49
49
|
column: i,
|
|
50
50
|
row: s,
|
|
51
51
|
key: o,
|
|
@@ -61,26 +61,26 @@ class ue {
|
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
function $t() {
|
|
64
|
-
return "xxxxxxxxxxxxxxxxxx".replace(/[x]/g, function(
|
|
64
|
+
return "xxxxxxxxxxxxxxxxxx".replace(/[x]/g, function(c) {
|
|
65
65
|
const t = Math.random() * 16 | 0;
|
|
66
|
-
return (
|
|
66
|
+
return (c === "x" ? t : t & 3 | 8).toString(16);
|
|
67
67
|
});
|
|
68
68
|
}
|
|
69
|
-
function bt(
|
|
69
|
+
function bt(c, t) {
|
|
70
70
|
let e = 0, i;
|
|
71
71
|
return function(...s) {
|
|
72
72
|
const o = (/* @__PURE__ */ new Date()).getTime(), r = o - e, a = typeof t == "function" ? t() : t;
|
|
73
|
-
!e || r >= a ? (
|
|
74
|
-
|
|
73
|
+
!e || r >= a ? (c.apply(this, s), e = o) : i || (i = setTimeout(() => {
|
|
74
|
+
c.apply(this, s), e = (/* @__PURE__ */ new Date()).getTime(), i = void 0;
|
|
75
75
|
}, a - r));
|
|
76
76
|
};
|
|
77
77
|
}
|
|
78
|
-
function ot(
|
|
79
|
-
return
|
|
78
|
+
function ot(c = []) {
|
|
79
|
+
return c.length ? c.map((t) => ot(t.children) + 1).sort((t, e) => e - t)[0] : 0;
|
|
80
80
|
}
|
|
81
|
-
function xe(
|
|
81
|
+
function xe(c = []) {
|
|
82
82
|
let t = [], e = [], i = [];
|
|
83
|
-
return
|
|
83
|
+
return c.forEach((s) => {
|
|
84
84
|
s.fixed === "left" ? t.push(s) : s.fixed === "right" ? i.push(s) : e.push(s);
|
|
85
85
|
}), [
|
|
86
86
|
...t.sort((s, o) => (s.sort ?? 0) - (o.sort ?? 0)),
|
|
@@ -88,8 +88,8 @@ function xe(h = []) {
|
|
|
88
88
|
...i.sort((s, o) => (s.sort ?? 0) - (o.sort ?? 0))
|
|
89
89
|
];
|
|
90
90
|
}
|
|
91
|
-
function rt(
|
|
92
|
-
return
|
|
91
|
+
function rt(c = [], t = 1, e = 0, i = "") {
|
|
92
|
+
return c.sort((s, o) => (s.sort ?? 0) - (o.sort ?? 0)).map((s) => {
|
|
93
93
|
if (s.children) {
|
|
94
94
|
let o = 0, r = s.fixed;
|
|
95
95
|
s.children.forEach((l) => {
|
|
@@ -105,7 +105,7 @@ function rt(h = [], t = 1, e = 0, i = "") {
|
|
|
105
105
|
rowspan: 1,
|
|
106
106
|
colspan: o,
|
|
107
107
|
parentKey: i,
|
|
108
|
-
children: a.sort((l,
|
|
108
|
+
children: a.sort((l, h) => (l.sort ?? 0) - (h.sort ?? 0))
|
|
109
109
|
};
|
|
110
110
|
}
|
|
111
111
|
return {
|
|
@@ -117,79 +117,79 @@ function rt(h = [], t = 1, e = 0, i = "") {
|
|
|
117
117
|
};
|
|
118
118
|
});
|
|
119
119
|
}
|
|
120
|
-
function J(
|
|
120
|
+
function J(c = []) {
|
|
121
121
|
let t = [];
|
|
122
|
-
return
|
|
122
|
+
return c.forEach((e) => {
|
|
123
123
|
e.children ? t = t.concat(J(e.children)) : t.push(e);
|
|
124
124
|
}), t;
|
|
125
125
|
}
|
|
126
|
-
function Gt(
|
|
127
|
-
return
|
|
126
|
+
function Gt(c) {
|
|
127
|
+
return c.filter((t) => !t.hide).map((t) => Array.isArray(t.children) && t.children.length > 0 ? {
|
|
128
128
|
...t,
|
|
129
129
|
children: Gt(t.children)
|
|
130
130
|
// 递归处理
|
|
131
131
|
} : { ...t });
|
|
132
132
|
}
|
|
133
133
|
const At = /^(\r\n|\n\r|\r|\n)/, ge = /^[^\t\r\n]+/, Ht = /^\t/;
|
|
134
|
-
function we(
|
|
134
|
+
function we(c) {
|
|
135
135
|
let t = [[""]];
|
|
136
|
-
if (
|
|
136
|
+
if (c.length === 0)
|
|
137
137
|
return t;
|
|
138
138
|
let e = 0, i = 0, s;
|
|
139
|
-
for (;
|
|
140
|
-
if (s =
|
|
141
|
-
|
|
142
|
-
else if (
|
|
143
|
-
|
|
139
|
+
for (; c.length > 0 && s !== c.length; )
|
|
140
|
+
if (s = c.length, c.match(Ht))
|
|
141
|
+
c = c.replace(Ht, ""), e += 1, t[i][e] = "";
|
|
142
|
+
else if (c.match(At))
|
|
143
|
+
c = c.replace(At, ""), e = 0, i += 1, t[i] = [""];
|
|
144
144
|
else {
|
|
145
145
|
let o = "";
|
|
146
|
-
if (
|
|
146
|
+
if (c.startsWith('"')) {
|
|
147
147
|
let r = 0, a = !0;
|
|
148
148
|
for (; a; ) {
|
|
149
|
-
const l =
|
|
150
|
-
l === '"' && (r += 1), o += l,
|
|
149
|
+
const l = c.slice(0, 1);
|
|
150
|
+
l === '"' && (r += 1), o += l, c = c.slice(1), (c.length === 0 || c.match(/^[\t\r\n]/) && r % 2 === 0) && (a = !1);
|
|
151
151
|
}
|
|
152
152
|
o = o.replace(/^"/, "").replace(/"$/, "").replace(/["]*/g, (l) => new Array(Math.floor(l.length / 2)).fill('"').join(""));
|
|
153
153
|
} else {
|
|
154
|
-
const r =
|
|
155
|
-
o = r ? r[0] : "",
|
|
154
|
+
const r = c.match(ge);
|
|
155
|
+
o = r ? r[0] : "", c = c.slice(o.length);
|
|
156
156
|
}
|
|
157
157
|
t[i][e] = o;
|
|
158
158
|
}
|
|
159
159
|
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;
|
|
160
160
|
}
|
|
161
|
-
function me(
|
|
161
|
+
function me(c) {
|
|
162
162
|
let t, e, i, s, o = "", r;
|
|
163
|
-
for (t = 0, e =
|
|
164
|
-
for (s =
|
|
165
|
-
i > 0 && (o += " "), r =
|
|
163
|
+
for (t = 0, e = c.length; t < e; t += 1) {
|
|
164
|
+
for (s = c[t].length, i = 0; i < s; i += 1)
|
|
165
|
+
i > 0 && (o += " "), r = c[t][i], typeof r == "string" ? r.indexOf(`
|
|
166
166
|
`) > -1 ? o += `"${r.replace(/"/g, '""')}"` : o += r : r == null ? o += "" : o += r;
|
|
167
167
|
t !== e - 1 && (o += `
|
|
168
168
|
`);
|
|
169
169
|
}
|
|
170
170
|
return o;
|
|
171
171
|
}
|
|
172
|
-
function Ut(
|
|
172
|
+
function Ut(c, t, e = []) {
|
|
173
173
|
let i = 0;
|
|
174
174
|
const s = [];
|
|
175
|
-
return
|
|
175
|
+
return c.forEach((o, r) => {
|
|
176
176
|
if (r === 0)
|
|
177
177
|
s.push(1);
|
|
178
178
|
else {
|
|
179
|
-
const a = e.reduce((
|
|
179
|
+
const a = e.reduce((h, d) => `${h}${o[d] ?? ""}`, "") || o[t], l = e.reduce((h, d) => `${h}${c[r - 1][d] ?? ""}`, "") || c[r - 1][t];
|
|
180
180
|
a === l ? (s[i] += 1, s.push(0)) : (s.push(1), i = r);
|
|
181
181
|
}
|
|
182
182
|
}), s;
|
|
183
183
|
}
|
|
184
|
-
function jt(
|
|
184
|
+
function jt(c, t) {
|
|
185
185
|
let e = "", i = "";
|
|
186
186
|
const s = {};
|
|
187
187
|
return t.forEach((o, r) => {
|
|
188
|
-
r === 0 ? (e = o.key, i = o.key, s[o.key] = 1) :
|
|
188
|
+
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);
|
|
189
189
|
}), s;
|
|
190
190
|
}
|
|
191
|
-
function Ee(
|
|
192
|
-
const { visibleRows: i, rowIndex: s, headIndex: o } =
|
|
191
|
+
function Ee(c, t, e = []) {
|
|
192
|
+
const { visibleRows: i, rowIndex: s, headIndex: o } = c, r = Ut(i, t, e);
|
|
193
193
|
return r[s - o] === 0 ? {
|
|
194
194
|
rowspan: 0,
|
|
195
195
|
colspan: 0,
|
|
@@ -202,8 +202,8 @@ function Ee(h, t, e = []) {
|
|
|
202
202
|
mergeRow: !0
|
|
203
203
|
};
|
|
204
204
|
}
|
|
205
|
-
function pe(
|
|
206
|
-
const { column: e, row: i, visibleLeafColumns: s } =
|
|
205
|
+
function pe(c, t = []) {
|
|
206
|
+
const { column: e, row: i, visibleLeafColumns: s } = c, o = s.filter((r) => t.includes(r.key));
|
|
207
207
|
if (t.includes(e.key)) {
|
|
208
208
|
const r = jt(i, o);
|
|
209
209
|
return r[e.key] === 0 ? {
|
|
@@ -219,15 +219,15 @@ function pe(h, t = []) {
|
|
|
219
219
|
};
|
|
220
220
|
}
|
|
221
221
|
}
|
|
222
|
-
function
|
|
223
|
-
const e =
|
|
222
|
+
function ye(c, t = document.documentElement) {
|
|
223
|
+
const e = c.startsWith("--") ? c : `--${c}`;
|
|
224
224
|
return getComputedStyle(t).getPropertyValue(e).trim();
|
|
225
225
|
}
|
|
226
|
-
function Dt(
|
|
227
|
-
if (!
|
|
228
|
-
if (typeof
|
|
229
|
-
return new Date(
|
|
230
|
-
const t = String(
|
|
226
|
+
function Dt(c) {
|
|
227
|
+
if (!c) return /* @__PURE__ */ new Date(0);
|
|
228
|
+
if (typeof c == "number")
|
|
229
|
+
return new Date(c);
|
|
230
|
+
const t = String(c).trim(), e = new Date(t);
|
|
231
231
|
if (!isNaN(e.getTime()))
|
|
232
232
|
return e;
|
|
233
233
|
const i = [
|
|
@@ -261,24 +261,24 @@ function Dt(h) {
|
|
|
261
261
|
if (o) {
|
|
262
262
|
const r = o.slice(1).map(Number);
|
|
263
263
|
if (s.source.includes("YYYY-MM-DD") || s.source.includes("YYYY/MM/DD") || s.source.includes("YYYY.MM.DD")) {
|
|
264
|
-
const [a, l,
|
|
265
|
-
return new Date(a, l - 1,
|
|
264
|
+
const [a, l, h, d = 0, f = 0, x = 0] = r;
|
|
265
|
+
return new Date(a, l - 1, h, d, f, x);
|
|
266
266
|
} else if (s.source.includes("DD-MM-YYYY") || s.source.includes("DD/MM/YYYY") || s.source.includes("DD.MM.YYYY")) {
|
|
267
|
-
const [a, l,
|
|
268
|
-
return new Date(
|
|
267
|
+
const [a, l, h, d = 0, f = 0, x = 0] = r;
|
|
268
|
+
return new Date(h, l - 1, a, d, f, x);
|
|
269
269
|
} else if (s.source.includes("MM-DD-YYYY") || s.source.includes("MM/DD/YYYY") || s.source.includes("MM.DD.YYYY")) {
|
|
270
|
-
const [a, l,
|
|
271
|
-
return new Date(
|
|
270
|
+
const [a, l, h, d = 0, f = 0, x = 0] = r;
|
|
271
|
+
return new Date(h, a - 1, l, d, f, x);
|
|
272
272
|
} else if (s.source.includes("YYYYMMDD")) {
|
|
273
|
-
const [a, l,
|
|
274
|
-
return new Date(a, l - 1,
|
|
273
|
+
const [a, l, h] = r;
|
|
274
|
+
return new Date(a, l - 1, h);
|
|
275
275
|
}
|
|
276
276
|
}
|
|
277
277
|
}
|
|
278
278
|
return /* @__PURE__ */ new Date(NaN);
|
|
279
279
|
}
|
|
280
|
-
function
|
|
281
|
-
const e = Dt(
|
|
280
|
+
function Ce(c, t) {
|
|
281
|
+
const e = Dt(c), i = Dt(t);
|
|
282
282
|
return isNaN(e.getTime()) && isNaN(i.getTime()) ? 0 : isNaN(e.getTime()) ? -1 : isNaN(i.getTime()) ? 1 : e.getTime() - i.getTime();
|
|
283
283
|
}
|
|
284
284
|
class qt {
|
|
@@ -328,8 +328,8 @@ class qt {
|
|
|
328
328
|
}
|
|
329
329
|
}
|
|
330
330
|
class vt extends qt {
|
|
331
|
-
constructor(e, i, s, o, r, a, l,
|
|
332
|
-
super(e, o, r, a, l, f,
|
|
331
|
+
constructor(e, i, s, o, r, a, l, h, d, f = "body", x = !0) {
|
|
332
|
+
super(e, o, r, a, l, f, h.fixed);
|
|
333
333
|
n(this, "formatter");
|
|
334
334
|
n(this, "formatterFooter");
|
|
335
335
|
n(this, "hoverIconName", "");
|
|
@@ -411,7 +411,7 @@ class vt extends qt {
|
|
|
411
411
|
n(this, "overflowTooltipMaxWidth", 500);
|
|
412
412
|
n(this, "overflowTooltipPlacement", "top");
|
|
413
413
|
n(this, "maxLineClamp", "auto");
|
|
414
|
-
this.visibleWidth = this.width, this.visibleHeight = this.height, this.colIndex = s, this.rowIndex = i, this.key =
|
|
414
|
+
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 || this.ctx.config.COLUMNS_ALIGN, this.verticalAlign = h.verticalAlign || this.ctx.config.COLUMNS_VERTICAL_ALIGN, 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.autoRowHeight = h.autoRowHeight !== void 0 ? h.autoRowHeight : this.ctx.config.AUTO_ROW_HEIGHT, 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.maxLineClamp = h.maxLineClamp || "auto", x && this.update();
|
|
415
415
|
}
|
|
416
416
|
setWidthHeight(e, i) {
|
|
417
417
|
this.width = e, this.height = i;
|
|
@@ -438,7 +438,7 @@ class vt extends qt {
|
|
|
438
438
|
relationRowKeys: r,
|
|
439
439
|
relationColKeys: a,
|
|
440
440
|
mergeRow: l = !1,
|
|
441
|
-
mergeCol:
|
|
441
|
+
mergeCol: h = !1
|
|
442
442
|
} = i({
|
|
443
443
|
row: this.row,
|
|
444
444
|
rowIndex: this.rowIndex,
|
|
@@ -451,7 +451,7 @@ class vt extends qt {
|
|
|
451
451
|
visibleLeafColumns: this.ctx.header.visibleLeafColumns,
|
|
452
452
|
rows: this.ctx.body.data
|
|
453
453
|
}) || {};
|
|
454
|
-
Array.isArray(r) && r.length > 0 ? this.relationRowKeys = r : this.relationRowKeys = [this.key], Array.isArray(a) && a.length > 0 ? this.relationColKeys = a : this.relationColKeys = [this.key], this.mergeCol =
|
|
454
|
+
Array.isArray(r) && r.length > 0 ? this.relationRowKeys = r : this.relationRowKeys = [this.key], Array.isArray(a) && a.length > 0 ? this.relationColKeys = a : this.relationColKeys = [this.key], this.mergeCol = h, this.mergeRow = l, this.colspan = s, this.rowspan = o, this.visibleWidth = this.getWidthByColIndexColSpan(this.colIndex, this.colspan), this.visibleHeight = this.ctx.database.getHeightByRowIndexRowSpan(this.rowIndex, this.rowspan);
|
|
455
455
|
}
|
|
456
456
|
}
|
|
457
457
|
updateSpanInfo() {
|
|
@@ -529,25 +529,25 @@ class vt extends qt {
|
|
|
529
529
|
let o, r = 0, a = "";
|
|
530
530
|
if (!(["tree", "selection-tree", "tree-selection"].includes(this.type) && s === "body"))
|
|
531
531
|
return;
|
|
532
|
-
const l = this.ctx.database.getRowForRowKey(i), { expand:
|
|
533
|
-
this.rowExpand =
|
|
532
|
+
const l = this.ctx.database.getRowForRowKey(i), { expand: h = !1, hasChildren: d = !1, expandLoading: f = !1, level: x = 0 } = l || {};
|
|
533
|
+
this.rowExpand = h, this.rowHasChildren = d;
|
|
534
534
|
const { TREE_INDENT: u = 16, CHECKBOX_SIZE: g, TREE_ICON_SIZE: m } = this.ctx.config;
|
|
535
535
|
if (r = x * u, f) {
|
|
536
536
|
const R = this.ctx.icons.get("loading");
|
|
537
537
|
a = "loading", o = R;
|
|
538
538
|
} else if (d) {
|
|
539
539
|
const R = this.ctx.icons.get("expand"), S = this.ctx.icons.get("shrink");
|
|
540
|
-
o =
|
|
540
|
+
o = h ? S : R, a = h ? "shrink" : "expand";
|
|
541
541
|
}
|
|
542
|
-
let w = m, E = m,
|
|
543
|
-
(this.align === "center" || this.align === "right") && (
|
|
544
|
-
let
|
|
545
|
-
this.type === "selection-tree" ? (
|
|
542
|
+
let w = m, E = m, p = this.drawX;
|
|
543
|
+
(this.align === "center" || this.align === "right") && (p = this.drawX + (this.visibleWidth - w - 2 * e) / 2, this.align = "left");
|
|
544
|
+
let y = p + r + e, b = this.drawY + (this.visibleHeight - E) / 2, C = r + this.drawX + w - 0.5;
|
|
545
|
+
this.type === "selection-tree" ? (y = r + this.drawSelectionImageX + this.drawSelectionImageWidth, C = y + w - e / 2) : this.type === "tree-selection" ? C = y + g + w - e / 2 : C = y + w - e / 2, this.drawTextX = C, this.drawTextWidth = this.drawX + this.visibleWidth - C, !(y + w + e > this.drawX + this.visibleWidth) && (b + E + e > this.drawY + this.visibleHeight || (this.drawTreeImageX = y, this.drawTreeImageY = b, this.drawTreeImageWidth = w, this.drawTreeImageHeight = E, o ? (this.drawTreeImageName = a, this.drawTreeImageSource = o) : (this.drawTreeImageName = "", this.drawTreeImageSource = void 0)));
|
|
546
546
|
}
|
|
547
547
|
drawTreeLine() {
|
|
548
548
|
const { TREE_LINE: e, TREE_INDENT: i = 16, TREE_ICON_SIZE: s = 16, TREE_LINE_COLOR: o = "#e1e6eb" } = this.ctx.config;
|
|
549
549
|
if (!e || this.cellType !== "body" || !["tree", "selection-tree", "tree-selection"].includes(this.type) || this.rowspan === 0 || this.colspan === 0) return;
|
|
550
|
-
const r = this.ctx.database.getRowForRowKey(this.rowKey) || {}, a = r.level ?? 0, l = this.drawTreeImageX + this.drawTreeImageWidth / 2,
|
|
550
|
+
const r = this.ctx.database.getRowForRowKey(this.rowKey) || {}, a = r.level ?? 0, l = this.drawTreeImageX + this.drawTreeImageWidth / 2, h = this.drawTreeImageY + this.drawTreeImageHeight / 2;
|
|
551
551
|
let d = this.drawTreeImageX - a * i;
|
|
552
552
|
const f = Array.isArray(r.parentRowKeys) ? r.parentRowKeys : [];
|
|
553
553
|
if (a > 0) {
|
|
@@ -562,7 +562,7 @@ class vt extends qt {
|
|
|
562
562
|
lineDashOffset: 0
|
|
563
563
|
});
|
|
564
564
|
}
|
|
565
|
-
const x = Math.round(this.drawTreeImageX - i + s / 2), g = !!r.isLastChild ?
|
|
565
|
+
const x = Math.round(this.drawTreeImageX - i + s / 2), g = !!r.isLastChild ? h : this.drawY + this.visibleHeight;
|
|
566
566
|
this.ctx.paint.drawLine([x, this.drawY, x, g], {
|
|
567
567
|
borderColor: o,
|
|
568
568
|
borderWidth: 1,
|
|
@@ -570,7 +570,7 @@ class vt extends qt {
|
|
|
570
570
|
lineDashOffset: 0
|
|
571
571
|
});
|
|
572
572
|
const m = Math.round(d + (a - 1) * i + s / 2);
|
|
573
|
-
this.ctx.paint.drawLine([m,
|
|
573
|
+
this.ctx.paint.drawLine([m, h, l, h], {
|
|
574
574
|
borderColor: o,
|
|
575
575
|
borderWidth: 1,
|
|
576
576
|
lineDash: [4, 4],
|
|
@@ -596,7 +596,7 @@ class vt extends qt {
|
|
|
596
596
|
READONLY_TEXT_COLOR: r,
|
|
597
597
|
BODY_TEXT_COLOR: a,
|
|
598
598
|
FOOTER_TEXT_COLOR: l,
|
|
599
|
-
FOOTER_BG_COLOR:
|
|
599
|
+
FOOTER_BG_COLOR: h,
|
|
600
600
|
HIGHLIGHT_SELECTED_ROW: d,
|
|
601
601
|
HIGHLIGHT_SELECTED_ROW_COLOR: f,
|
|
602
602
|
HIGHLIGHT_HOVER_ROW: x,
|
|
@@ -606,7 +606,7 @@ class vt extends qt {
|
|
|
606
606
|
FINDER_CELL_BG_COLOR: w
|
|
607
607
|
} = this.ctx.config;
|
|
608
608
|
if (this.cellType === "footer") {
|
|
609
|
-
let _ =
|
|
609
|
+
let _ = h, T = l;
|
|
610
610
|
if (typeof o == "function") {
|
|
611
611
|
const M = o, { backgroundColor: L, color: A, font: H } = M({
|
|
612
612
|
row: this.row,
|
|
@@ -621,13 +621,13 @@ class vt extends qt {
|
|
|
621
621
|
return;
|
|
622
622
|
}
|
|
623
623
|
let E = "transparent";
|
|
624
|
-
const
|
|
625
|
-
let b = this.rowIndex,
|
|
624
|
+
const p = this.ctx.hoverCell, y = this.ctx.currentCell;
|
|
625
|
+
let b = this.rowIndex, C = this.rowIndex;
|
|
626
626
|
if (this.rowspan !== 1 && (x || d)) {
|
|
627
627
|
const _ = this.getSpanInfo(), { yArr: T } = _;
|
|
628
|
-
b = T[0],
|
|
628
|
+
b = T[0], C = T[1];
|
|
629
629
|
}
|
|
630
|
-
x &&
|
|
630
|
+
x && p && (p.rowKey === this.rowKey && (E = u), p.rowIndex >= b && p.rowIndex <= C && (E = u)), d && y && (y.rowKey === this.rowKey && (E = f), y.rowIndex >= b && y.rowIndex <= C && (E = f)), this.drawCellSkyBgColor = E;
|
|
631
631
|
let R = e, S = a;
|
|
632
632
|
if (this.ctx.database.getReadonly(this.rowKey, this.key) || (R = i, S = r), g && (this.rowIndex % 2 ? R = m : R = e), typeof s == "function") {
|
|
633
633
|
const _ = s, { backgroundColor: T, color: M, font: L } = _({
|
|
@@ -644,26 +644,26 @@ class vt extends qt {
|
|
|
644
644
|
O === this.rowIndex && v === this.colIndex && I === "body" && (R = w), this.drawCellBgColor = R, this.drawTextColor = S;
|
|
645
645
|
}
|
|
646
646
|
updateSelection() {
|
|
647
|
-
const { visibleWidth: e, visibleHeight: i, rowspan: s, colspan: o, cellType: r, type: a, rowIndex: l, rowKey:
|
|
647
|
+
const { visibleWidth: e, visibleHeight: i, rowspan: s, colspan: o, cellType: r, type: a, rowIndex: l, rowKey: h } = this;
|
|
648
648
|
if (s === 0 || o === 0 || r === "footer" || !["index-selection", "selection", "selection-tree", "tree-selection"].includes(a))
|
|
649
649
|
return;
|
|
650
|
-
const d = this.ctx.database.getRowSelectable(
|
|
650
|
+
const d = this.ctx.database.getRowSelectable(h), { CHECKBOX_SIZE: f = 0, CELL_PADDING: x } = this.ctx.config;
|
|
651
651
|
let u = this.drawX + x;
|
|
652
652
|
(this.align === "center" || this.align === "right") && (u = this.drawX + (e - f) / 2);
|
|
653
653
|
let g = u, m = this.drawY + (i - f) / 2;
|
|
654
654
|
if (a !== "selection-tree") {
|
|
655
655
|
if (a === "tree-selection") {
|
|
656
|
-
const { TREE_INDENT:
|
|
657
|
-
g = u +
|
|
656
|
+
const { TREE_INDENT: p = 16, TREE_ICON_SIZE: y } = this.ctx.config, b = this.ctx.database.getRowForRowKey(h), { level: C = 0 } = b || {}, R = C * p;
|
|
657
|
+
g = u + y + R;
|
|
658
658
|
}
|
|
659
659
|
}
|
|
660
660
|
let w = this.ctx.icons.get("checkbox-uncheck"), E = "checkbox-uncheck";
|
|
661
661
|
if (a === "selection-tree" || a === "tree-selection") {
|
|
662
|
-
const
|
|
663
|
-
|
|
662
|
+
const p = this.ctx.database.getTreeSelectionState(h);
|
|
663
|
+
p.indeterminate && d ? (w = this.ctx.icons.get("checkbox-indeterminate"), E = "checkbox-indeterminate") : p.checked && d ? (w = this.ctx.icons.get("checkbox-check"), E = "checkbox-check") : !p.checked && d ? (w = this.ctx.icons.get("checkbox-uncheck"), E = "checkbox-uncheck") : (w = this.ctx.icons.get("checkbox-disabled"), E = "checkbox-disabled");
|
|
664
664
|
} else {
|
|
665
|
-
const
|
|
666
|
-
|
|
665
|
+
const p = this.ctx.database.getRowSelection(h);
|
|
666
|
+
p && d ? (w = this.ctx.icons.get("checkbox-check"), E = "checkbox-check") : p && !d ? (w = this.ctx.icons.get("checkbox-check-disabled"), E = "checkbox-check-disabled") : !p && d ? (w = this.ctx.icons.get("checkbox-uncheck"), E = "checkbox-uncheck") : (w = this.ctx.icons.get("checkbox-disabled"), E = "checkbox-disabled");
|
|
667
667
|
}
|
|
668
668
|
g + f + x > this.drawX + this.visibleWidth || m + f + x > this.drawY + this.visibleHeight || (a === "index-selection" ? (this.ctx.hoverCell && this.ctx.hoverCell.rowIndex === l || ["checkbox-disabled", "checkbox-check"].includes(E)) && (this.drawSelectionImageX = g, this.drawSelectionImageY = m, this.drawSelectionImageWidth = f, this.drawSelectionImageHeight = f, this.drawSelectionImageName = E, this.drawSelectionImageSource = w) : (this.drawSelectionImageX = g, this.drawSelectionImageY = m, this.drawSelectionImageWidth = f, this.drawSelectionImageHeight = f, this.drawSelectionImageName = E, this.drawSelectionImageSource = w));
|
|
669
669
|
}
|
|
@@ -672,27 +672,27 @@ class vt extends qt {
|
|
|
672
672
|
return;
|
|
673
673
|
const { BODY_CELL_HOVER_ICON_METHOD: i, CELL_HOVER_ICON_SIZE: s, CELL_PADDING: o, ENABLE_MERGE_CELL_LINK: r } = this.ctx.config;
|
|
674
674
|
if (typeof i == "function") {
|
|
675
|
-
const
|
|
675
|
+
const h = i({
|
|
676
676
|
row: this.row,
|
|
677
677
|
rowIndex: this.rowIndex,
|
|
678
678
|
colIndex: this.colIndex,
|
|
679
679
|
column: this.column,
|
|
680
680
|
value: this.getValue()
|
|
681
681
|
});
|
|
682
|
-
|
|
682
|
+
h !== void 0 && (this.hoverIconName = h);
|
|
683
683
|
}
|
|
684
684
|
const { hoverCell: a } = this.ctx;
|
|
685
685
|
if (this.hoverIconName && !this.ctx.editing && a) {
|
|
686
|
-
let l = 0,
|
|
687
|
-
if (a.rowKey === this.rowKey && (l = this.drawX + this.width - s - o,
|
|
686
|
+
let l = 0, h = 0;
|
|
687
|
+
if (a.rowKey === this.rowKey && (l = this.drawX + this.width - s - o, h = this.drawY + (this.height - s) / 2), this.rowspan !== 1 && r) {
|
|
688
688
|
const f = this.getSpanInfo(), { yArr: x } = f, u = x[0], g = x[1];
|
|
689
689
|
if (a.rowIndex >= u && a.rowIndex <= g) {
|
|
690
|
-
const { width: m, height: w, offsetTop: E, offsetLeft:
|
|
691
|
-
l = this.drawX -
|
|
690
|
+
const { width: m, height: w, offsetTop: E, offsetLeft: p } = f;
|
|
691
|
+
l = this.drawX - p + m - s - o, h = this.drawY - E + (w - s) / 2;
|
|
692
692
|
}
|
|
693
693
|
}
|
|
694
694
|
const d = this.ctx.icons.get(this.hoverIconName);
|
|
695
|
-
this.drawHoverImageX = l, this.drawHoverImageY =
|
|
695
|
+
this.drawHoverImageX = l, this.drawHoverImageY = h, this.drawHoverImageWidth = s, this.drawHoverImageHeight = s, this.drawHoverImageName = this.hoverIconName, this.drawHoverImageSource = d;
|
|
696
696
|
}
|
|
697
697
|
}
|
|
698
698
|
/**
|
|
@@ -773,12 +773,19 @@ class vt extends qt {
|
|
|
773
773
|
* 获取样式
|
|
774
774
|
*/
|
|
775
775
|
getOverlayerViewsStyle() {
|
|
776
|
-
let e =
|
|
777
|
-
|
|
776
|
+
let e = this.drawX - this.ctx.fixedLeftWidth, i = this.drawY - this.ctx.body.y;
|
|
777
|
+
if (this.fixed === "left" ? e = this.drawX : this.fixed === "right" && (e = this.drawX - (this.ctx.stageWidth - this.ctx.fixedRightWidth)), this.cellType === "footer" && this.ctx.config.FOOTER_FIXED && (i = this.drawY - this.ctx.footer.y), this.autoRowHeight && this.render && this.verticalAlign === "middle") {
|
|
778
|
+
const s = this.ctx.database.getOverlayerAutoHeight(this.rowIndex, this.colIndex);
|
|
779
|
+
if (s < this.visibleHeight && s > 0) {
|
|
780
|
+
const o = (this.visibleHeight - s) / 2;
|
|
781
|
+
i = i + o;
|
|
782
|
+
}
|
|
783
|
+
}
|
|
784
|
+
return this.autoRowHeight && this.ctx.database.getOverlayerAutoHeight(this.rowIndex, this.colIndex) === 0 && (e = -99999, i = -99999), {
|
|
778
785
|
position: "absolute",
|
|
779
786
|
overflow: "hidden",
|
|
780
|
-
left: e
|
|
781
|
-
top: i
|
|
787
|
+
left: `${Math.round(e - 1)}px`,
|
|
788
|
+
top: `${Math.round(i - 1)}px`,
|
|
782
789
|
width: `${this.visibleWidth}px`,
|
|
783
790
|
height: this.autoRowHeight ? "auto" : `${this.visibleHeight}px`,
|
|
784
791
|
// height: `${this.visibleHeight}px`,
|
|
@@ -815,8 +822,8 @@ class vt extends qt {
|
|
|
815
822
|
const { SELECT_BORDER_COLOR: e, ENABLE_AUTOFILL: i, ENABLE_SELECTOR: s, AUTOFILL_POINT_BORDER_COLOR: o } = this.ctx.config;
|
|
816
823
|
if (!s || !i || this.ctx.editing)
|
|
817
824
|
return;
|
|
818
|
-
const { xArr: r, yArr: a } = this.ctx.selector, l = r[1],
|
|
819
|
-
if (d === l && f ===
|
|
825
|
+
const { xArr: r, yArr: a } = this.ctx.selector, l = r[1], h = a[1], { colIndex: d, rowIndex: f, drawX: x, drawY: u } = this;
|
|
826
|
+
if (d === l && f === h) {
|
|
820
827
|
const m = d === this.ctx.maxColIndex || f === this.ctx.maxRowIndex || d === this.ctx.lastCenterColIndex ? 6 : 4;
|
|
821
828
|
this.ctx.paint.drawRect(x + this.width - m, u + this.height - m, 6, 6, {
|
|
822
829
|
borderColor: o,
|
|
@@ -930,11 +937,11 @@ class vt extends qt {
|
|
|
930
937
|
fillColor: "transparent",
|
|
931
938
|
borderWidth: 1
|
|
932
939
|
});
|
|
933
|
-
const [a, l] = i, [
|
|
934
|
-
!(a === l &&
|
|
940
|
+
const [a, l] = i, [h, d] = s;
|
|
941
|
+
!(a === l && h === d) && this.colIndex >= a && this.colIndex <= l && this.rowIndex >= h && this.rowIndex <= d && this.ctx.paint.drawRect(this.drawX, this.drawY, this.width, this.height, {
|
|
935
942
|
borderColor: "transparent",
|
|
936
943
|
fillColor: this.ctx.config.SELECT_AREA_COLOR || "rgba(82,146,247,0.1)"
|
|
937
|
-
}), this.operation && this.rowIndex >=
|
|
944
|
+
}), this.operation && this.rowIndex >= h && this.rowIndex <= d && this.ctx.paint.drawRect(this.drawX, this.drawY, this.visibleWidth, this.visibleHeight, {
|
|
938
945
|
borderColor: "transparent",
|
|
939
946
|
fillColor: this.ctx.config.SELECT_ROW_COL_BG_COLOR || "transparent"
|
|
940
947
|
});
|
|
@@ -960,11 +967,11 @@ class vt extends qt {
|
|
|
960
967
|
}
|
|
961
968
|
drawBorder(e) {
|
|
962
969
|
const { drawX: i, drawY: s, rowIndex: o, colIndex: r, height: a, width: l } = this;
|
|
963
|
-
let
|
|
964
|
-
const { xArr: f, yArr: x, lineDash: u = [], borderWidth: g = 1, borderColor: m, fillColor: w } = e, E = f[0],
|
|
965
|
-
if (r >= E && r <=
|
|
966
|
-
const
|
|
967
|
-
this.ctx.paint.drawLine([
|
|
970
|
+
let h = i, d = s;
|
|
971
|
+
const { xArr: f, yArr: x, lineDash: u = [], borderWidth: g = 1, borderColor: m, fillColor: w } = e, E = f[0], p = f[1], y = x[0], b = x[1];
|
|
972
|
+
if (r >= E && r <= p && o === y) {
|
|
973
|
+
const C = r === p ? 1 : 0, R = r === E ? 1 : 0;
|
|
974
|
+
this.ctx.paint.drawLine([h + R, d + 1, h + l - C, d + 1], {
|
|
968
975
|
borderColor: m,
|
|
969
976
|
fillColor: w,
|
|
970
977
|
borderWidth: g,
|
|
@@ -973,9 +980,9 @@ class vt extends qt {
|
|
|
973
980
|
lineDash: u
|
|
974
981
|
});
|
|
975
982
|
}
|
|
976
|
-
if (r ===
|
|
977
|
-
const
|
|
978
|
-
this.ctx.paint.drawLine([
|
|
983
|
+
if (r === p && o >= y && o <= b) {
|
|
984
|
+
const C = o === y ? 1 : 0, R = o === b ? 1 : 0;
|
|
985
|
+
this.ctx.paint.drawLine([h + l - 1, d + C, h + l - 1, d + a - R], {
|
|
979
986
|
borderColor: m,
|
|
980
987
|
fillColor: w,
|
|
981
988
|
borderWidth: g,
|
|
@@ -984,9 +991,9 @@ class vt extends qt {
|
|
|
984
991
|
lineDash: u
|
|
985
992
|
});
|
|
986
993
|
}
|
|
987
|
-
if (r >= E && r <=
|
|
988
|
-
const
|
|
989
|
-
this.ctx.paint.drawLine([
|
|
994
|
+
if (r >= E && r <= p && o === b) {
|
|
995
|
+
const C = r === p ? 1 : 0, R = r === E ? 1 : 0;
|
|
996
|
+
this.ctx.paint.drawLine([h + R, d + a - 1, h + l - C, d + a - 1], {
|
|
990
997
|
borderColor: m,
|
|
991
998
|
fillColor: w,
|
|
992
999
|
borderWidth: g,
|
|
@@ -995,9 +1002,9 @@ class vt extends qt {
|
|
|
995
1002
|
lineDash: u
|
|
996
1003
|
});
|
|
997
1004
|
}
|
|
998
|
-
if (r === E && o >=
|
|
999
|
-
const
|
|
1000
|
-
this.ctx.paint.drawLine([
|
|
1005
|
+
if (r === E && o >= y && o <= b) {
|
|
1006
|
+
const C = o === b ? 1 : 0, R = o === y ? 1 : 0;
|
|
1007
|
+
this.ctx.paint.drawLine([h + 1, d + R, h + 1, d + a - C], {
|
|
1001
1008
|
borderColor: m,
|
|
1002
1009
|
fillColor: w,
|
|
1003
1010
|
borderWidth: g,
|
|
@@ -1079,31 +1086,31 @@ class be {
|
|
|
1079
1086
|
DEFAULT_EXPAND_ALL: r,
|
|
1080
1087
|
CELL_HEIGHT: a,
|
|
1081
1088
|
SELECTABLE_METHOD: l,
|
|
1082
|
-
CHECKBOX_KEY:
|
|
1089
|
+
CHECKBOX_KEY: h,
|
|
1083
1090
|
TREE_CHILDREN_KEY: d
|
|
1084
1091
|
} = this.ctx.config;
|
|
1085
1092
|
t.forEach((f, x) => {
|
|
1086
|
-
var
|
|
1093
|
+
var y;
|
|
1087
1094
|
d !== "children" && (f.children = f[d]);
|
|
1088
1095
|
const u = f[o], g = u != null ? `${u}` : $t();
|
|
1089
1096
|
this.itemRowKeyMap.set(f, g);
|
|
1090
1097
|
const m = f._height || a, w = f._readonly;
|
|
1091
1098
|
let E = !0;
|
|
1092
|
-
if (typeof l == "function" && (E = l),
|
|
1093
|
-
const b = f[
|
|
1099
|
+
if (typeof l == "function" && (E = l), h) {
|
|
1100
|
+
const b = f[h];
|
|
1094
1101
|
if (this.checkboxKeyMap.has(b)) {
|
|
1095
|
-
const
|
|
1096
|
-
|
|
1102
|
+
const C = this.checkboxKeyMap.get(b) || [];
|
|
1103
|
+
C.push(g), this.checkboxKeyMap.set(b, C);
|
|
1097
1104
|
} else
|
|
1098
1105
|
this.checkboxKeyMap.set(b, [g]);
|
|
1099
1106
|
}
|
|
1100
1107
|
this.selectionMap.set(g, {
|
|
1101
|
-
key:
|
|
1108
|
+
key: h ? f[h] : g,
|
|
1102
1109
|
row: f,
|
|
1103
|
-
check: ((
|
|
1110
|
+
check: ((y = this.selectionMap.get(g)) == null ? void 0 : y.check) || !1
|
|
1104
1111
|
});
|
|
1105
|
-
const
|
|
1106
|
-
this.expandMap.set(g,
|
|
1112
|
+
const p = r || this.expandMap.get(g) || f._expand || !1;
|
|
1113
|
+
this.expandMap.set(g, p), this.rowKeyMap.set(g, {
|
|
1107
1114
|
readonly: w,
|
|
1108
1115
|
index: x,
|
|
1109
1116
|
rowIndex: x,
|
|
@@ -1112,7 +1119,7 @@ class be {
|
|
|
1112
1119
|
calculatedHeight: -1,
|
|
1113
1120
|
check: !1,
|
|
1114
1121
|
selectable: E,
|
|
1115
|
-
expand:
|
|
1122
|
+
expand: p,
|
|
1116
1123
|
expandLazy: !1,
|
|
1117
1124
|
hasChildren: f._hasChildren || (Array.isArray(f.children) ? f.children.length > 0 : !1),
|
|
1118
1125
|
expandLoading: !1,
|
|
@@ -1147,7 +1154,7 @@ class be {
|
|
|
1147
1154
|
}
|
|
1148
1155
|
// 批量设置计算行高度
|
|
1149
1156
|
setBatchCalculatedRowHeight(t) {
|
|
1150
|
-
t.every(({ height: i, rowIndex: s }) => this.getPositionForRowIndex(s).calculatedHeight === i)
|
|
1157
|
+
return t.every(({ height: i, rowIndex: s }) => this.getPositionForRowIndex(s).calculatedHeight === i) ? !1 : (t.forEach(({ rowIndex: i, height: s }) => {
|
|
1151
1158
|
const o = this.rowIndexRowKeyMap.get(i);
|
|
1152
1159
|
if (o) {
|
|
1153
1160
|
const r = this.rowKeyMap.get(o);
|
|
@@ -1156,7 +1163,7 @@ class be {
|
|
|
1156
1163
|
s > a && this.maxRowHeightMap.set(o, s);
|
|
1157
1164
|
}
|
|
1158
1165
|
}
|
|
1159
|
-
}), this.clearBufferData(), this.getData(),
|
|
1166
|
+
}), this.clearBufferData(), this.getData(), !0);
|
|
1160
1167
|
}
|
|
1161
1168
|
/**
|
|
1162
1169
|
* 清除最大行高记录
|
|
@@ -1179,19 +1186,20 @@ class be {
|
|
|
1179
1186
|
}
|
|
1180
1187
|
generateColumns(t) {
|
|
1181
1188
|
const e = (i) => i.map((s) => {
|
|
1182
|
-
var
|
|
1189
|
+
var h, d, f, x, u, g, m, w;
|
|
1183
1190
|
const o = s.children && Array.isArray(s.children) ? e(s.children) : void 0, r = {
|
|
1184
|
-
hide: (
|
|
1185
|
-
fixed: (
|
|
1186
|
-
sort: (
|
|
1187
|
-
width: (
|
|
1191
|
+
hide: (d = (h = this.customHeader) == null ? void 0 : h.hideData) == null ? void 0 : d[s.key],
|
|
1192
|
+
fixed: (x = (f = this.customHeader) == null ? void 0 : f.fixedData) == null ? void 0 : x[s.key],
|
|
1193
|
+
sort: (g = (u = this.customHeader) == null ? void 0 : u.sortData) == null ? void 0 : g[s.key],
|
|
1194
|
+
width: (w = (m = this.customHeader) == null ? void 0 : m.resizableData) == null ? void 0 : w[s.key]
|
|
1188
1195
|
}, a = {};
|
|
1189
|
-
for (const [
|
|
1190
|
-
|
|
1196
|
+
for (const [E, p] of Object.entries(r))
|
|
1197
|
+
p !== void 0 && (a[E] = p);
|
|
1198
|
+
const l = o && o.every((E) => E.hide);
|
|
1191
1199
|
return {
|
|
1192
1200
|
...s,
|
|
1193
1201
|
children: o,
|
|
1194
|
-
hide: typeof s.hide == "function" ? s.hide(s) : s.hide,
|
|
1202
|
+
hide: l || (typeof s.hide == "function" ? s.hide(s) : s.hide),
|
|
1195
1203
|
...a
|
|
1196
1204
|
};
|
|
1197
1205
|
});
|
|
@@ -1222,7 +1230,7 @@ class be {
|
|
|
1222
1230
|
const i = (o) => {
|
|
1223
1231
|
o.forEach((r) => {
|
|
1224
1232
|
t.push(r);
|
|
1225
|
-
const a = this.itemRowKeyMap.get(r), { expand: l, hasChildren:
|
|
1233
|
+
const a = this.itemRowKeyMap.get(r), { expand: l, hasChildren: h, height: d, calculatedHeight: f } = this.rowKeyMap.get(a), x = this.sumHeight;
|
|
1226
1234
|
let u = Math.max(f, d);
|
|
1227
1235
|
if (this.ctx.config.REMEMBER_MAX_ROW_HEIGHT) {
|
|
1228
1236
|
const g = this.maxRowHeightMap.get(a) || d;
|
|
@@ -1233,7 +1241,7 @@ class be {
|
|
|
1233
1241
|
height: u,
|
|
1234
1242
|
bottom: this.sumHeight,
|
|
1235
1243
|
calculatedHeight: f
|
|
1236
|
-
}), e += 1, l &&
|
|
1244
|
+
}), e += 1, l && h && i(r.children);
|
|
1237
1245
|
});
|
|
1238
1246
|
};
|
|
1239
1247
|
this.rowIndexRowKeyMap.clear(), this.rowKeyRowIndexMap.clear();
|
|
@@ -1311,17 +1319,17 @@ class be {
|
|
|
1311
1319
|
applySingleColumnSort(t, e, i, s) {
|
|
1312
1320
|
return t.sort((o, r) => {
|
|
1313
1321
|
const a = o[e], l = r[e];
|
|
1314
|
-
let
|
|
1322
|
+
let h = 0;
|
|
1315
1323
|
if (typeof s == "function")
|
|
1316
|
-
|
|
1324
|
+
h = s(o, r);
|
|
1317
1325
|
else if (s === "number") {
|
|
1318
1326
|
const d = Number(a) || 0, f = Number(l) || 0;
|
|
1319
|
-
|
|
1327
|
+
h = d - f;
|
|
1320
1328
|
} else if (s === "string") {
|
|
1321
1329
|
const d = String(a || ""), f = String(l || "");
|
|
1322
|
-
|
|
1323
|
-
} else s === "date" && (
|
|
1324
|
-
return i === "asc" ?
|
|
1330
|
+
h = d.localeCompare(f);
|
|
1331
|
+
} else s === "date" && (h = Ce(a, l));
|
|
1332
|
+
return i === "asc" ? h : -h;
|
|
1325
1333
|
});
|
|
1326
1334
|
}
|
|
1327
1335
|
/**
|
|
@@ -1433,23 +1441,23 @@ class be {
|
|
|
1433
1441
|
async batchSetItemValue(t, e = !1, i = !0, s = "none") {
|
|
1434
1442
|
let o = [], r = i;
|
|
1435
1443
|
const a = /* @__PURE__ */ new Set();
|
|
1436
|
-
let l = [],
|
|
1444
|
+
let l = [], h = t.map((g) => {
|
|
1437
1445
|
const { rowKey: m, key: w } = g;
|
|
1438
|
-
let E = g.value,
|
|
1439
|
-
const
|
|
1440
|
-
return (
|
|
1446
|
+
let E = g.value, p = E;
|
|
1447
|
+
const y = this.getRowDataItemForRowKey(m), b = this.getItemValue(m, w), C = this.getVirtualBodyCellByKey(m, w);
|
|
1448
|
+
return (C == null ? void 0 : C.type) === "number" && (["", void 0, null].includes(E) ? p = null : /^-?\d+(\.\d+)?$/.test(`${E}`) ? p = Number(E) : (p = b, l.push({
|
|
1441
1449
|
...g,
|
|
1442
|
-
value:
|
|
1450
|
+
value: p,
|
|
1443
1451
|
oldValue: b,
|
|
1444
|
-
row:
|
|
1452
|
+
row: y
|
|
1445
1453
|
}))), {
|
|
1446
1454
|
...g,
|
|
1447
|
-
value:
|
|
1455
|
+
value: p,
|
|
1448
1456
|
oldValue: b,
|
|
1449
|
-
row:
|
|
1457
|
+
row: y
|
|
1450
1458
|
};
|
|
1451
1459
|
});
|
|
1452
|
-
if (
|
|
1460
|
+
if (h = h.filter((g) => !l.some((m) => g.rowKey === m.rowKey && g.key === m.key)), l.length) {
|
|
1453
1461
|
const g = {
|
|
1454
1462
|
code: "ERR_BATCH_SET_NUMBER_VALUE",
|
|
1455
1463
|
message: "Assignment failed, not a numeric type",
|
|
@@ -1457,15 +1465,15 @@ class be {
|
|
|
1457
1465
|
};
|
|
1458
1466
|
this.ctx.emit("error", g);
|
|
1459
1467
|
}
|
|
1460
|
-
if (
|
|
1468
|
+
if (h = h.filter((g) => g.oldValue !== g.value), !h.length)
|
|
1461
1469
|
return;
|
|
1462
1470
|
const { BEFORE_VALUE_CHANGE_METHOD: d } = this.ctx.config;
|
|
1463
|
-
s === "none" && typeof d == "function" && (
|
|
1464
|
-
const { value: m, rowKey: w, key: E } = g,
|
|
1471
|
+
s === "none" && typeof d == "function" && (h = await d(h), r = !1), h.forEach((g) => {
|
|
1472
|
+
const { value: m, rowKey: w, key: E } = g, p = this.getItemValue(w, E);
|
|
1465
1473
|
a.add(w), this.setItemValue(w, E, m, !1, !1, !1, r), o.push({
|
|
1466
1474
|
rowKey: w,
|
|
1467
1475
|
key: E,
|
|
1468
|
-
oldValue:
|
|
1476
|
+
oldValue: p,
|
|
1469
1477
|
newValue: m
|
|
1470
1478
|
});
|
|
1471
1479
|
});
|
|
@@ -1473,11 +1481,11 @@ class be {
|
|
|
1473
1481
|
a.forEach((g) => {
|
|
1474
1482
|
f.push(this.ctx.database.getRowDataItemForRowKey(g));
|
|
1475
1483
|
});
|
|
1476
|
-
const x =
|
|
1484
|
+
const x = h.map(({ rowKey: g, key: m }) => this.getValidator(g, m));
|
|
1477
1485
|
Promise.all(x).then(() => {
|
|
1478
1486
|
this.validationErrorMap.size === 0 && this.changedDataMap.size > 0 && this.ctx.emit("validateChangedData", this.getChangedData());
|
|
1479
1487
|
});
|
|
1480
|
-
const u =
|
|
1488
|
+
const u = h.map((g) => {
|
|
1481
1489
|
const m = !!this.getValidationError(g.rowKey, g.key).length;
|
|
1482
1490
|
return {
|
|
1483
1491
|
...g,
|
|
@@ -1506,15 +1514,15 @@ class be {
|
|
|
1506
1514
|
if (!this.rowKeyMap.has(t))
|
|
1507
1515
|
return {};
|
|
1508
1516
|
const { item: l } = this.rowKeyMap.get(t);
|
|
1509
|
-
let
|
|
1517
|
+
let h = l[e], d = i;
|
|
1510
1518
|
if (a && this.ctx.database.getReadonly(t, e))
|
|
1511
1519
|
return {
|
|
1512
|
-
oldValue:
|
|
1513
|
-
newValue:
|
|
1520
|
+
oldValue: h,
|
|
1521
|
+
newValue: h
|
|
1514
1522
|
};
|
|
1515
|
-
l[e] !== null && typeof l[e] == "object" && (
|
|
1523
|
+
l[e] !== null && typeof l[e] == "object" && (h = JSON.parse(JSON.stringify(l[e])));
|
|
1516
1524
|
const f = `${t}_${e}`;
|
|
1517
|
-
this.originalDataMap.has(f) || this.originalDataMap.set(f,
|
|
1525
|
+
this.originalDataMap.has(f) || this.originalDataMap.set(f, h);
|
|
1518
1526
|
const x = this.originalDataMap.get(f), u = this.getRowDataItemForRowKey(t);
|
|
1519
1527
|
if (r) {
|
|
1520
1528
|
const g = this.getVirtualBodyCellByKey(t, e);
|
|
@@ -1524,7 +1532,7 @@ class be {
|
|
|
1524
1532
|
else if (/^-?\d+(\.\d+)?$/.test(`${i}`))
|
|
1525
1533
|
d = Number(i);
|
|
1526
1534
|
else {
|
|
1527
|
-
d =
|
|
1535
|
+
d = h;
|
|
1528
1536
|
const w = {
|
|
1529
1537
|
code: "ERR_SET_NUMBER_VALUE",
|
|
1530
1538
|
message: "Assignment failed, not a numeric type",
|
|
@@ -1533,31 +1541,31 @@ class be {
|
|
|
1533
1541
|
rowKey: t,
|
|
1534
1542
|
key: e,
|
|
1535
1543
|
value: d,
|
|
1536
|
-
oldValue:
|
|
1544
|
+
oldValue: h,
|
|
1537
1545
|
row: u
|
|
1538
1546
|
}
|
|
1539
1547
|
]
|
|
1540
1548
|
};
|
|
1541
1549
|
this.ctx.emit("error", w);
|
|
1542
1550
|
}
|
|
1543
|
-
if (d ===
|
|
1551
|
+
if (d === h)
|
|
1544
1552
|
return {
|
|
1545
|
-
oldValue:
|
|
1546
|
-
newValue:
|
|
1553
|
+
oldValue: h,
|
|
1554
|
+
newValue: h
|
|
1547
1555
|
};
|
|
1548
1556
|
let m = [
|
|
1549
1557
|
{
|
|
1550
1558
|
rowKey: t,
|
|
1551
1559
|
key: e,
|
|
1552
1560
|
value: d,
|
|
1553
|
-
oldValue:
|
|
1561
|
+
oldValue: h,
|
|
1554
1562
|
row: u
|
|
1555
1563
|
}
|
|
1556
1564
|
];
|
|
1557
1565
|
this.batchSetItemValue(m, s, !1), this.ctx.emit("editChange", {
|
|
1558
1566
|
rowKey: t,
|
|
1559
1567
|
key: e,
|
|
1560
|
-
oldValue:
|
|
1568
|
+
oldValue: h,
|
|
1561
1569
|
value: d,
|
|
1562
1570
|
originalValue: x,
|
|
1563
1571
|
row: u
|
|
@@ -1567,12 +1575,12 @@ class be {
|
|
|
1567
1575
|
return this.ctx.hasEvent("iterationChange") && this.ctx.emit("iterationChange", {
|
|
1568
1576
|
rowKey: t,
|
|
1569
1577
|
key: e,
|
|
1570
|
-
oldValue:
|
|
1578
|
+
oldValue: h,
|
|
1571
1579
|
value: d,
|
|
1572
1580
|
originalValue: this.originalDataMap.get(f),
|
|
1573
1581
|
row: u
|
|
1574
1582
|
}), o && this.ctx.emit("draw"), {
|
|
1575
|
-
oldValue:
|
|
1583
|
+
oldValue: h,
|
|
1576
1584
|
newValue: d
|
|
1577
1585
|
};
|
|
1578
1586
|
}
|
|
@@ -1646,7 +1654,7 @@ class be {
|
|
|
1646
1654
|
const e = this.getTreeParent(t);
|
|
1647
1655
|
if (!e)
|
|
1648
1656
|
return;
|
|
1649
|
-
const s = this.getTreeChildren(e).map((
|
|
1657
|
+
const s = this.getTreeChildren(e).map((h) => this.selectionMap.get(h)), o = s.filter((h) => h == null ? void 0 : h.check).length, r = s.length;
|
|
1650
1658
|
let a = !1;
|
|
1651
1659
|
r > 0 && (o === 0 ? a = !1 : o === r || this.ctx.config.TREE_SELECT_MODE === "auto" ? a = !0 : this.ctx.config.TREE_SELECT_MODE === "cautious" && (a = !1));
|
|
1652
1660
|
const l = this.selectionMap.get(e);
|
|
@@ -1687,22 +1695,22 @@ class be {
|
|
|
1687
1695
|
return { checked: s, indeterminate: !1 };
|
|
1688
1696
|
let r = !1, a = s;
|
|
1689
1697
|
if (this.ctx.config.TREE_SELECT_MODE === "auto") {
|
|
1690
|
-
const
|
|
1698
|
+
const h = (w) => {
|
|
1691
1699
|
const E = this.getTreeChildren(w);
|
|
1692
|
-
let
|
|
1693
|
-
for (const
|
|
1694
|
-
|
|
1695
|
-
return
|
|
1696
|
-
}, f =
|
|
1700
|
+
let p = [];
|
|
1701
|
+
for (const y of E)
|
|
1702
|
+
p.push(y), p.push(...h(y));
|
|
1703
|
+
return p;
|
|
1704
|
+
}, f = h(t).map((w) => this.selectionMap.get(w)), x = f.filter((w) => w == null ? void 0 : w.check).length, u = f.length, g = x > 0;
|
|
1697
1705
|
r = g && !(x === u), a = s || g, s && u > 0 && x === 0 && (a = !1, r = !1);
|
|
1698
1706
|
} else if (this.ctx.config.TREE_SELECT_MODE === "cautious") {
|
|
1699
|
-
const
|
|
1707
|
+
const h = (w) => {
|
|
1700
1708
|
const E = this.getTreeChildren(w);
|
|
1701
|
-
let
|
|
1702
|
-
for (const
|
|
1703
|
-
|
|
1704
|
-
return
|
|
1705
|
-
}, f =
|
|
1709
|
+
let p = [];
|
|
1710
|
+
for (const y of E)
|
|
1711
|
+
p.push(y), p.push(...h(y));
|
|
1712
|
+
return p;
|
|
1713
|
+
}, f = h(t).map((w) => this.selectionMap.get(w)), x = f.filter((w) => w == null ? void 0 : w.check).length, u = f.length, g = x > 0, m = x === u;
|
|
1706
1714
|
r = g && !m, a = s || m, s && u > 0 && x === 0 && (a = !1, r = !1);
|
|
1707
1715
|
} else this.ctx.config.TREE_SELECT_MODE === "strictly" && (r = !1, a = s);
|
|
1708
1716
|
return { checked: a, indeterminate: r };
|
|
@@ -1729,9 +1737,9 @@ class be {
|
|
|
1729
1737
|
for (const a of o.children) {
|
|
1730
1738
|
if (this.getRowKeyByItem(a) === s)
|
|
1731
1739
|
return r;
|
|
1732
|
-
const
|
|
1733
|
-
if (
|
|
1734
|
-
return
|
|
1740
|
+
const h = e(o.children, s);
|
|
1741
|
+
if (h)
|
|
1742
|
+
return h;
|
|
1735
1743
|
}
|
|
1736
1744
|
}
|
|
1737
1745
|
return null;
|
|
@@ -1814,15 +1822,15 @@ class be {
|
|
|
1814
1822
|
rowIndex: x.rowIndex
|
|
1815
1823
|
})), g && (o += 1);
|
|
1816
1824
|
});
|
|
1817
|
-
const l = r > i && s === 0 && a,
|
|
1825
|
+
const l = r > i && s === 0 && a, h = o && o > s && s > 0 || l, d = o !== 0, f = !!o && o === s;
|
|
1818
1826
|
return this.bufferCheckState = {
|
|
1819
1827
|
buffer: !0,
|
|
1820
1828
|
check: f,
|
|
1821
|
-
indeterminate:
|
|
1829
|
+
indeterminate: h,
|
|
1822
1830
|
selectable: d
|
|
1823
1831
|
}, {
|
|
1824
1832
|
check: f,
|
|
1825
|
-
indeterminate:
|
|
1833
|
+
indeterminate: h,
|
|
1826
1834
|
selectable: d
|
|
1827
1835
|
};
|
|
1828
1836
|
}
|
|
@@ -1952,7 +1960,7 @@ class be {
|
|
|
1952
1960
|
d && (l = d);
|
|
1953
1961
|
}
|
|
1954
1962
|
if (l) {
|
|
1955
|
-
const
|
|
1963
|
+
const h = {
|
|
1956
1964
|
row: s.item,
|
|
1957
1965
|
rowIndex: s.rowIndex,
|
|
1958
1966
|
colIndex: o.colIndex,
|
|
@@ -1962,7 +1970,7 @@ class be {
|
|
|
1962
1970
|
value: this.getItemValue(t, e),
|
|
1963
1971
|
field: e,
|
|
1964
1972
|
fieldValue: this.getItemValue(t, e)
|
|
1965
|
-
}, f = new ue(l).validate(
|
|
1973
|
+
}, f = new ue(l).validate(h);
|
|
1966
1974
|
this.setValidationError(t, e, f), i(f);
|
|
1967
1975
|
} else
|
|
1968
1976
|
this.clearValidationError(t, e), i([]);
|
|
@@ -1985,7 +1993,7 @@ class be {
|
|
|
1985
1993
|
value: r,
|
|
1986
1994
|
colIndex: a,
|
|
1987
1995
|
relationRowKeys: l,
|
|
1988
|
-
relationColKeys:
|
|
1996
|
+
relationColKeys: h,
|
|
1989
1997
|
rowspan: d,
|
|
1990
1998
|
height: f,
|
|
1991
1999
|
width: x,
|
|
@@ -2012,7 +2020,7 @@ class be {
|
|
|
2012
2020
|
}
|
|
2013
2021
|
]
|
|
2014
2022
|
};
|
|
2015
|
-
let w = e, E = e,
|
|
2023
|
+
let w = e, E = e, p = a, y = a, b = [], C = 0, R = 0, S = 0, O = 0;
|
|
2016
2024
|
if (d !== 1 && g) {
|
|
2017
2025
|
O = x;
|
|
2018
2026
|
const v = l.reduce((I, _) => {
|
|
@@ -2041,7 +2049,7 @@ class be {
|
|
|
2041
2049
|
}
|
|
2042
2050
|
for (let I = w; I < e; I++) {
|
|
2043
2051
|
const { height: _ } = this.positions[I];
|
|
2044
|
-
|
|
2052
|
+
C += _;
|
|
2045
2053
|
}
|
|
2046
2054
|
for (let I = w; I <= E; I++) {
|
|
2047
2055
|
const { height: _ } = this.positions[I];
|
|
@@ -2062,8 +2070,8 @@ class be {
|
|
|
2062
2070
|
if (!I)
|
|
2063
2071
|
break;
|
|
2064
2072
|
const _ = this.getItemValue(s, i), T = this.getItemValue(s, I.key);
|
|
2065
|
-
if (_ === T &&
|
|
2066
|
-
|
|
2073
|
+
if (_ === T && h.includes(I.key))
|
|
2074
|
+
p = v;
|
|
2067
2075
|
else
|
|
2068
2076
|
break;
|
|
2069
2077
|
}
|
|
@@ -2072,18 +2080,18 @@ class be {
|
|
|
2072
2080
|
if (!I)
|
|
2073
2081
|
break;
|
|
2074
2082
|
const _ = this.getItemValue(s, i), T = this.getItemValue(s, I.key);
|
|
2075
|
-
if (_ === T &&
|
|
2076
|
-
|
|
2083
|
+
if (_ === T && h.includes(I.key))
|
|
2084
|
+
y = v;
|
|
2077
2085
|
else
|
|
2078
2086
|
break;
|
|
2079
2087
|
}
|
|
2080
|
-
for (let v =
|
|
2088
|
+
for (let v = p; v < a; v++) {
|
|
2081
2089
|
const I = this.getColumnByColIndex(v);
|
|
2082
2090
|
if (!I)
|
|
2083
2091
|
break;
|
|
2084
2092
|
R += I.width || 100;
|
|
2085
2093
|
}
|
|
2086
|
-
for (let v =
|
|
2094
|
+
for (let v = p; v <= y; v++) {
|
|
2087
2095
|
const I = this.getColumnByColIndex(v);
|
|
2088
2096
|
if (!I)
|
|
2089
2097
|
break;
|
|
@@ -2096,13 +2104,13 @@ class be {
|
|
|
2096
2104
|
}
|
|
2097
2105
|
}
|
|
2098
2106
|
return {
|
|
2099
|
-
xArr: [
|
|
2107
|
+
xArr: [p, y],
|
|
2100
2108
|
yArr: [w, E],
|
|
2101
2109
|
rowspan: d,
|
|
2102
2110
|
colspan: u,
|
|
2103
2111
|
height: S,
|
|
2104
2112
|
width: O,
|
|
2105
|
-
offsetTop:
|
|
2113
|
+
offsetTop: C,
|
|
2106
2114
|
offsetLeft: R,
|
|
2107
2115
|
dataList: b
|
|
2108
2116
|
};
|
|
@@ -2111,7 +2119,7 @@ class be {
|
|
|
2111
2119
|
const s = `${t}_${e}`, o = this.getRowForRowKey(t), r = o == null ? void 0 : o.rowIndex, a = this.getColumnByKey(e);
|
|
2112
2120
|
if (!t || !a || !o)
|
|
2113
2121
|
return;
|
|
2114
|
-
const l = this.getItemValue(t, e),
|
|
2122
|
+
const l = this.getItemValue(t, e), h = [
|
|
2115
2123
|
{
|
|
2116
2124
|
key: e,
|
|
2117
2125
|
rowKey: t,
|
|
@@ -2125,7 +2133,7 @@ class be {
|
|
|
2125
2133
|
fieldValue: l
|
|
2126
2134
|
}
|
|
2127
2135
|
];
|
|
2128
|
-
this.validationErrorMap.set(s,
|
|
2136
|
+
this.validationErrorMap.set(s, h);
|
|
2129
2137
|
}
|
|
2130
2138
|
setValidationError(t, e, i) {
|
|
2131
2139
|
const s = `${t}_${e}`;
|
|
@@ -2228,10 +2236,10 @@ class be {
|
|
|
2228
2236
|
const e = (s, o = {}) => {
|
|
2229
2237
|
s.forEach((r) => {
|
|
2230
2238
|
r.children && r.children.length > 0 && e(r.children, o);
|
|
2231
|
-
const a = (l,
|
|
2239
|
+
const a = (l, h) => {
|
|
2232
2240
|
var f, x;
|
|
2233
2241
|
const d = (f = this.customHeader[l]) == null ? void 0 : f[r.key];
|
|
2234
|
-
d !== void 0 && d !==
|
|
2242
|
+
d !== void 0 && d !== h && (o[l] || (o[l] = {}), o[l][r.key] = d, l === "fixedData" && !d && !h && ((x = o[l]) == null || delete x[r.key]));
|
|
2235
2243
|
};
|
|
2236
2244
|
a("fixedData", r.fixed), a("sortData", r.sort), a("hideData", r.hide), a("resizableData", r.width);
|
|
2237
2245
|
});
|
|
@@ -2458,21 +2466,21 @@ class _e {
|
|
|
2458
2466
|
* @param {string} color - 阴影的颜色
|
|
2459
2467
|
*/
|
|
2460
2468
|
drawShadow(t, e, i, s, o) {
|
|
2461
|
-
const { fillColor: r, side: a, shadowWidth: l, colorStart:
|
|
2469
|
+
const { fillColor: r, side: a, shadowWidth: l, colorStart: h, colorEnd: d } = o;
|
|
2462
2470
|
this.ctx.save(), r && (this.ctx.fillStyle = r, this.ctx.fillRect(t, e, i, s));
|
|
2463
2471
|
let f;
|
|
2464
2472
|
switch (a) {
|
|
2465
2473
|
case "left":
|
|
2466
|
-
f = this.ctx.createLinearGradient(t - l, e, t, e), f.addColorStop(0,
|
|
2474
|
+
f = this.ctx.createLinearGradient(t - l, e, t, e), f.addColorStop(0, h), f.addColorStop(1, d), this.ctx.fillStyle = f, this.ctx.fillRect(t - l, e, l, s);
|
|
2467
2475
|
break;
|
|
2468
2476
|
case "right":
|
|
2469
|
-
f = this.ctx.createLinearGradient(t + i, e, t + i + l, e), f.addColorStop(0,
|
|
2477
|
+
f = this.ctx.createLinearGradient(t + i, e, t + i + l, e), f.addColorStop(0, h), f.addColorStop(1, d), this.ctx.fillStyle = f, this.ctx.fillRect(t + i, e, l, s);
|
|
2470
2478
|
break;
|
|
2471
2479
|
case "top":
|
|
2472
|
-
f = this.ctx.createLinearGradient(t, e - l, t, e), f.addColorStop(0,
|
|
2480
|
+
f = this.ctx.createLinearGradient(t, e - l, t, e), f.addColorStop(0, h), f.addColorStop(1, d), this.ctx.fillStyle = f, this.ctx.fillRect(t, e - l, i, l);
|
|
2473
2481
|
break;
|
|
2474
2482
|
case "bottom":
|
|
2475
|
-
f = this.ctx.createLinearGradient(t, e + s, t, e + s + l), f.addColorStop(0,
|
|
2483
|
+
f = this.ctx.createLinearGradient(t, e + s, t, e + s + l), f.addColorStop(0, h), f.addColorStop(1, d), this.ctx.fillStyle = f, this.ctx.fillRect(t, e + s, i, l);
|
|
2476
2484
|
break;
|
|
2477
2485
|
default:
|
|
2478
2486
|
console.error("Invalid side specified for shadow");
|
|
@@ -2498,8 +2506,8 @@ class _e {
|
|
|
2498
2506
|
if (this.ctx.save(), this.ctx.beginPath(), a !== void 0 && (this.ctx.fillStyle = a), r !== void 0 && (this.ctx.lineWidth = o, this.ctx.strokeStyle = r), l === 0)
|
|
2499
2507
|
this.ctx.rect(t - 0.5, e - 0.5, i, s);
|
|
2500
2508
|
else {
|
|
2501
|
-
const [
|
|
2502
|
-
this.ctx.moveTo(t +
|
|
2509
|
+
const [h, d, f, x] = typeof l == "number" ? [l, l, l, l] : l;
|
|
2510
|
+
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);
|
|
2503
2511
|
}
|
|
2504
2512
|
a !== void 0 && this.ctx.fill(), r !== void 0 && this.ctx.stroke(), this.ctx.restore();
|
|
2505
2513
|
}
|
|
@@ -2519,7 +2527,7 @@ class _e {
|
|
|
2519
2527
|
const {
|
|
2520
2528
|
font: a = "12px Arial",
|
|
2521
2529
|
align: l = "center",
|
|
2522
|
-
color:
|
|
2530
|
+
color: h = "#495060",
|
|
2523
2531
|
padding: d = 0,
|
|
2524
2532
|
verticalAlign: f = "middle",
|
|
2525
2533
|
maxLineClamp: x = 1,
|
|
@@ -2527,29 +2535,29 @@ class _e {
|
|
|
2527
2535
|
offsetLeft: g = 0,
|
|
2528
2536
|
offsetRight: m = 0
|
|
2529
2537
|
} = r;
|
|
2530
|
-
if (this.ctx.font = a, this.ctx.fillStyle =
|
|
2538
|
+
if (this.ctx.font = a, this.ctx.fillStyle = h, this.ctx.textAlign = l, ["", null, void 0].includes(t))
|
|
2531
2539
|
return this.ctx.restore(), !1;
|
|
2532
|
-
const E = parseInt(((I = a.match(/\d+/)) == null ? void 0 : I[0]) || "12") * (r.lineHeight || 1.2),
|
|
2533
|
-
let
|
|
2540
|
+
const E = parseInt(((I = a.match(/\d+/)) == null ? void 0 : I[0]) || "12") * (r.lineHeight || 1.2), p = s - d * 2 - g - m;
|
|
2541
|
+
let y = !1;
|
|
2534
2542
|
const b = Math.round((o - 2 * d) / E);
|
|
2535
|
-
let
|
|
2536
|
-
x === "auto" && u ? R =
|
|
2543
|
+
let C = this.wrapText(t, p, r.cacheTextKey), R = Math.min(C.length, Math.max(b, 1));
|
|
2544
|
+
x === "auto" && u ? R = C.length : typeof x == "number" && x < R && x !== 1 ? R = x : (x === 1 && (C = [t], R = 1), x === "auto" && b === 1 && (C = [t], R = 1));
|
|
2537
2545
|
let S = i + d;
|
|
2538
2546
|
const O = Math.round(R * E);
|
|
2539
2547
|
f === "middle" ? S = i + (o - O) / 2 : f === "bottom" && (S = i + o - O - d);
|
|
2540
2548
|
let v = e + d + g;
|
|
2541
2549
|
l === "center" ? v = e + s / 2 : l === "right" && (v = e + s - d - m);
|
|
2542
|
-
for (let _ = 0; _ <
|
|
2543
|
-
const T =
|
|
2550
|
+
for (let _ = 0; _ < C.length; _++) {
|
|
2551
|
+
const T = C[_], M = S + _ * E;
|
|
2544
2552
|
if (this.ctx.textBaseline = "top", _ === R - 1) {
|
|
2545
|
-
const A =
|
|
2546
|
-
this.ctx.fillText(H, v, M),
|
|
2553
|
+
const A = C.slice(_).join(""), { _text: H, ellipsis: D } = this.handleEllipsis(A, s, d, a);
|
|
2554
|
+
this.ctx.fillText(H, v, M), y = D;
|
|
2547
2555
|
break;
|
|
2548
2556
|
}
|
|
2549
2557
|
this.ctx.fillText(T, v, M);
|
|
2550
2558
|
}
|
|
2551
|
-
if (r.textCallback &&
|
|
2552
|
-
const _ =
|
|
2559
|
+
if (r.textCallback && C.length) {
|
|
2560
|
+
const _ = C.reduce((H, D) => Math.max(H, this.ctx.measureText(D).width), 0), T = Math.round(_);
|
|
2553
2561
|
let M = v, L = v + T;
|
|
2554
2562
|
l === "center" ? (M = v - T / 2, L = v + T / 2) : l === "right" && (M = v - T, L = v);
|
|
2555
2563
|
const A = {
|
|
@@ -2564,7 +2572,7 @@ class _e {
|
|
|
2564
2572
|
};
|
|
2565
2573
|
r.textCallback(A);
|
|
2566
2574
|
}
|
|
2567
|
-
return this.ctx.restore(),
|
|
2575
|
+
return this.ctx.restore(), y;
|
|
2568
2576
|
}
|
|
2569
2577
|
/**
|
|
2570
2578
|
* 将文本按宽度换行
|
|
@@ -2584,12 +2592,12 @@ class _e {
|
|
|
2584
2592
|
continue;
|
|
2585
2593
|
}
|
|
2586
2594
|
const l = a.split("");
|
|
2587
|
-
let
|
|
2595
|
+
let h = "";
|
|
2588
2596
|
for (const d of l) {
|
|
2589
|
-
const f =
|
|
2590
|
-
this.ctx.measureText(f).width <= e ?
|
|
2597
|
+
const f = h + d;
|
|
2598
|
+
this.ctx.measureText(f).width <= e ? h = f : h ? (s.push(h), h = d) : (s.push(d), h = "");
|
|
2591
2599
|
}
|
|
2592
|
-
|
|
2600
|
+
h && s.push(h);
|
|
2593
2601
|
}
|
|
2594
2602
|
const r = s.length > 0 ? s : [""];
|
|
2595
2603
|
return i && this.textCacheMap.set(i, r), r;
|
|
@@ -2609,10 +2617,10 @@ class _e {
|
|
|
2609
2617
|
align: r = "center",
|
|
2610
2618
|
color: a = "#495060",
|
|
2611
2619
|
maxLineClamp: l = 1,
|
|
2612
|
-
cacheTextKey:
|
|
2620
|
+
cacheTextKey: h = ""
|
|
2613
2621
|
} = i;
|
|
2614
2622
|
this.ctx.save(), this.ctx.font = s, this.ctx.fillStyle = a, this.ctx.textAlign = r;
|
|
2615
|
-
const d = parseInt(((m = s.match(/\d+/)) == null ? void 0 : m[0]) || "12"), f = d * (i.lineHeight || 1.2), x = e - o * 2, u = this.wrapText(t, x,
|
|
2623
|
+
const d = parseInt(((m = s.match(/\d+/)) == null ? void 0 : m[0]) || "12"), f = d * (i.lineHeight || 1.2), x = e - o * 2, u = this.wrapText(t, x, h);
|
|
2616
2624
|
let g = 1;
|
|
2617
2625
|
return l === "auto" ? g = u.length : u.length > l ? g = l : g = u.length, this.ctx.restore(), Math.max(Math.floor(g * f + o * 2), Math.floor(d + o * 2));
|
|
2618
2626
|
}
|
|
@@ -2630,12 +2638,12 @@ class _e {
|
|
|
2630
2638
|
_text: "",
|
|
2631
2639
|
ellipsis: !0
|
|
2632
2640
|
};
|
|
2633
|
-
const l = this.ctx.measureText(t).width,
|
|
2634
|
-
if (l && l >=
|
|
2641
|
+
const l = this.ctx.measureText(t).width, h = e - i * 2;
|
|
2642
|
+
if (l && l >= h) {
|
|
2635
2643
|
o = !0;
|
|
2636
2644
|
let d = 0;
|
|
2637
2645
|
for (let f = 0; f < t.length; f++)
|
|
2638
|
-
if (d += this.ctx.measureText(t[f]).width, d >=
|
|
2646
|
+
if (d += this.ctx.measureText(t[f]).width, d >= h - a) {
|
|
2639
2647
|
r = t.slice(0, f) + "...", o = !0;
|
|
2640
2648
|
break;
|
|
2641
2649
|
}
|
|
@@ -2677,6 +2685,8 @@ class Nt {
|
|
|
2677
2685
|
n(this, "EMPTY_BODY_HEIGHT", 120);
|
|
2678
2686
|
/** 自定义空样式 */
|
|
2679
2687
|
n(this, "EMPTY_CUSTOM_STYLE", {});
|
|
2688
|
+
/** 数字类型错误提示 */
|
|
2689
|
+
n(this, "NUMBER_ERROR_TIP", "只允许输入数字");
|
|
2680
2690
|
/** 空数据文本 */
|
|
2681
2691
|
n(this, "EMPTY_TEXT", "暂无数据");
|
|
2682
2692
|
/** 加载文本 */
|
|
@@ -3003,7 +3013,7 @@ class Nt {
|
|
|
3003
3013
|
let t = {};
|
|
3004
3014
|
Object.keys(this).forEach((e) => {
|
|
3005
3015
|
if (e.endsWith("_COLOR") || e.endsWith("_FONT")) {
|
|
3006
|
-
const i = `--evt-${e.toLocaleLowerCase().replace(/_/g, "-")}`, s =
|
|
3016
|
+
const i = `--evt-${e.toLocaleLowerCase().replace(/_/g, "-")}`, s = ye(i);
|
|
3007
3017
|
s && (t[e] = s);
|
|
3008
3018
|
}
|
|
3009
3019
|
}), Object.assign(this, t, this._config);
|
|
@@ -3137,22 +3147,22 @@ class Oe {
|
|
|
3137
3147
|
}
|
|
3138
3148
|
async createImageFromSVG(t, e, i = !1) {
|
|
3139
3149
|
const r = new DOMParser().parseFromString(t, "image/svg+xml").documentElement;
|
|
3140
|
-
e && r.querySelectorAll("*").forEach((
|
|
3141
|
-
const d =
|
|
3142
|
-
(d === "currentColor" || d === null) &&
|
|
3150
|
+
e && r.querySelectorAll("*").forEach((h) => {
|
|
3151
|
+
const d = h.getAttribute("fill");
|
|
3152
|
+
(d === "currentColor" || d === null) && h.setAttribute("fill", e);
|
|
3143
3153
|
});
|
|
3144
3154
|
const a = new Image();
|
|
3145
3155
|
let l = "";
|
|
3146
3156
|
if (i) {
|
|
3147
|
-
const
|
|
3157
|
+
const h = new Blob([new XMLSerializer().serializeToString(r)], {
|
|
3148
3158
|
type: "image/svg+xml"
|
|
3149
3159
|
});
|
|
3150
|
-
l = URL.createObjectURL(
|
|
3160
|
+
l = URL.createObjectURL(h);
|
|
3151
3161
|
} else
|
|
3152
3162
|
l = "data:image/svg+xml;charset=utf-8," + encodeURIComponent(new XMLSerializer().serializeToString(r));
|
|
3153
|
-
return a.src = l, new Promise((
|
|
3163
|
+
return a.src = l, new Promise((h, d) => {
|
|
3154
3164
|
a.onerror = () => d(new Error("Failed to load image:" + t)), a.onload = () => {
|
|
3155
|
-
|
|
3165
|
+
h(a);
|
|
3156
3166
|
};
|
|
3157
3167
|
});
|
|
3158
3168
|
}
|
|
@@ -3245,7 +3255,7 @@ class mt extends qt {
|
|
|
3245
3255
|
const { HEADER_CELL_STYLE_METHOD: e, HEADER_BG_COLOR: i, HEADER_TEXT_COLOR: s } = this.ctx.config;
|
|
3246
3256
|
let o = i, r = s;
|
|
3247
3257
|
if (typeof e == "function") {
|
|
3248
|
-
const
|
|
3258
|
+
const h = e, { backgroundColor: d, color: f, font: x } = h({
|
|
3249
3259
|
colIndex: this.colIndex,
|
|
3250
3260
|
column: this.column
|
|
3251
3261
|
}) || {};
|
|
@@ -3325,8 +3335,8 @@ class mt extends qt {
|
|
|
3325
3335
|
const { indeterminate: e, check: i, selectable: s } = this.ctx.database.getCheckedState(), { CHECKBOX_SIZE: o = 0, CELL_PADDING: r } = this.ctx.config;
|
|
3326
3336
|
let a = this.drawX + (this.width - o) / 2, l = this.drawY + (this.height - o) / 2;
|
|
3327
3337
|
this.drawTextX = a + o - r / 2, this.drawTextWidth = this.drawX + this.visibleWidth - this.drawTextX, (this.align === "left" || this.align === "right") && (a = this.drawX + r, this.drawTextX = a + o - r / 2, this.drawTextWidth = this.drawX + this.visibleWidth - this.drawTextX), this.verticalAlign === "top" ? l = this.drawY + r / 2 : this.verticalAlign === "bottom" && (l = this.drawY + this.height - o - r / 2);
|
|
3328
|
-
let
|
|
3329
|
-
e ? (
|
|
3338
|
+
let h = this.ctx.icons.get("checkbox-uncheck"), d = "checkbox-uncheck";
|
|
3339
|
+
e ? (h = this.ctx.icons.get("checkbox-indeterminate"), d = "checkbox-indeterminate") : i && s ? (h = this.ctx.icons.get("checkbox-check"), d = "checkbox-check") : i && !s ? (h = this.ctx.icons.get("checkbox-check-disabled"), d = "checkbox-check-disabled") : !i && s ? (h = this.ctx.icons.get("checkbox-uncheck"), d = "checkbox-uncheck") : (h = this.ctx.icons.get("checkbox-disabled"), d = "checkbox-disabled"), h && (this.drawSelectionImageX = a, this.drawSelectionImageY = l, this.drawSelectionImageWidth = o, this.drawSelectionImageHeight = o, this.drawSelectionImageName = d, this.drawSelectionImageSource = h, this.ctx.paint.drawImage(
|
|
3330
3340
|
this.drawSelectionImageSource,
|
|
3331
3341
|
this.drawSelectionImageX,
|
|
3332
3342
|
this.drawSelectionImageY,
|
|
@@ -3390,14 +3400,16 @@ class Le {
|
|
|
3390
3400
|
attributeFilter: ["class"]
|
|
3391
3401
|
// ✅ 只监听 class 更改
|
|
3392
3402
|
}), this.ctx.on("mousedown", (t) => {
|
|
3393
|
-
if (
|
|
3403
|
+
if (this.isBusy(t))
|
|
3394
3404
|
return;
|
|
3395
|
-
const { offsetY: e, offsetX: i } = this.ctx.getOffset(t), s = e, o = i
|
|
3396
|
-
|
|
3397
|
-
|
|
3398
|
-
|
|
3399
|
-
this.ctx.
|
|
3400
|
-
})
|
|
3405
|
+
const { offsetY: e, offsetX: i } = this.ctx.getOffset(t), s = e, o = i, {
|
|
3406
|
+
body: { height: r, visibleHeight: a, visibleWidth: l, y: h }
|
|
3407
|
+
} = this.ctx, d = Math.min(r, a);
|
|
3408
|
+
o > 0 && o < l && s > h && s < h + d || this.ctx.emit("mousedownBodyOutside", t), t.button === 0 && (this.handleHeaderEvent(o, s, this.ctx.header.renderCellHeaders, (x) => {
|
|
3409
|
+
this.ctx.focusCellHeader = x, this.ctx.focusCell = void 0, this.ctx.emit("cellHeaderMousedown", x, t);
|
|
3410
|
+
}), this.handleBodyEvent(o, s, this.ctx.body.renderRows, (x) => {
|
|
3411
|
+
this.ctx.setFocusCell(x), this.ctx.focusCellHeader = void 0, this.ctx.emit("cellMousedown", x, t);
|
|
3412
|
+
}));
|
|
3401
3413
|
}), this.ctx.on("mouseup", (t) => {
|
|
3402
3414
|
if (t.button !== 0 || this.isBusy(t))
|
|
3403
3415
|
return;
|
|
@@ -3517,8 +3529,8 @@ class Le {
|
|
|
3517
3529
|
t.drawTreeImageHeight
|
|
3518
3530
|
))
|
|
3519
3531
|
return;
|
|
3520
|
-
const l = this.ctx.database.getRowForRowKey(t.rowKey), { expand:
|
|
3521
|
-
if (f && x && !
|
|
3532
|
+
const l = this.ctx.database.getRowForRowKey(t.rowKey), { expand: h = !1, expandLazy: d = !1 } = l || {}, { EXPAND_LAZY: f, EXPAND_LAZY_METHOD: x } = this.ctx.config;
|
|
3533
|
+
if (f && x && !h && !d)
|
|
3522
3534
|
typeof x == "function" && (this.ctx.database.expandLoading(t.rowKey, !0), x({
|
|
3523
3535
|
row: t.row,
|
|
3524
3536
|
rowIndex: t.rowIndex,
|
|
@@ -3632,13 +3644,13 @@ class Le {
|
|
|
3632
3644
|
for (const r of i) {
|
|
3633
3645
|
const a = r.fixedCells.concat(r.noFixedCells);
|
|
3634
3646
|
for (const l of a) {
|
|
3635
|
-
const
|
|
3647
|
+
const h = l.getDrawX(), d = l.getDrawY();
|
|
3636
3648
|
if (o) {
|
|
3637
|
-
if (t >
|
|
3649
|
+
if (t > h && t < h + l.visibleWidth && e > d && e < d + l.visibleHeight) {
|
|
3638
3650
|
s(l);
|
|
3639
3651
|
return;
|
|
3640
3652
|
}
|
|
3641
|
-
} else if (t >
|
|
3653
|
+
} else if (t > h && t < h + l.width && e > d && e < d + l.height) {
|
|
3642
3654
|
s(l);
|
|
3643
3655
|
return;
|
|
3644
3656
|
}
|
|
@@ -3658,13 +3670,13 @@ class Le {
|
|
|
3658
3670
|
for (const r of i) {
|
|
3659
3671
|
const a = r.fixedCells.concat(r.noFixedCells);
|
|
3660
3672
|
for (const l of a) {
|
|
3661
|
-
const
|
|
3673
|
+
const h = l.getDrawX(), d = l.getDrawY();
|
|
3662
3674
|
if (o) {
|
|
3663
|
-
if (t >
|
|
3675
|
+
if (t > h && t < h + l.visibleWidth && e > d && e < d + l.visibleHeight) {
|
|
3664
3676
|
s(l);
|
|
3665
3677
|
return;
|
|
3666
3678
|
}
|
|
3667
|
-
} else if (t >
|
|
3679
|
+
} else if (t > h && t < h + l.width && e > d && e < d + l.height) {
|
|
3668
3680
|
s(l);
|
|
3669
3681
|
return;
|
|
3670
3682
|
}
|
|
@@ -3822,10 +3834,10 @@ class Me {
|
|
|
3822
3834
|
overlayerElement: r,
|
|
3823
3835
|
editorElement: a,
|
|
3824
3836
|
emptyElement: l,
|
|
3825
|
-
loadingElement:
|
|
3837
|
+
loadingElement: h,
|
|
3826
3838
|
contextMenuElement: d
|
|
3827
3839
|
} = t;
|
|
3828
|
-
this.containerElement = i, s.tabIndex = 0, this.stageElement = s, this.canvasElement = o, this.overlayerElement = r, this.editorElement = a, this.emptyElement = l, this.loadingElement =
|
|
3840
|
+
this.containerElement = i, s.tabIndex = 0, this.stageElement = s, this.canvasElement = o, this.overlayerElement = r, this.editorElement = a, this.emptyElement = l, this.loadingElement = h, this.contextMenuElement = d, this.config = new Nt(e.config || {}), this.eventBus = new Re(), this.eventBrowser = new Ie(this), this.eventTable = new Le(this), this.paint = new _e(this.canvasElement), this.database = new be(this, e), this.history = new ve(this), this.icons = new Oe(this);
|
|
3829
3841
|
}
|
|
3830
3842
|
setConfig(t) {
|
|
3831
3843
|
this.config = new Nt(t);
|
|
@@ -3834,8 +3846,8 @@ class Me {
|
|
|
3834
3846
|
if (this.config.ENABLE_MERGE_CELL_LINK) {
|
|
3835
3847
|
const a = this.database.getVirtualBodyCellByKey(t, e);
|
|
3836
3848
|
if (a && (a.mergeRow || a.mergeCol)) {
|
|
3837
|
-
const { dataList: l } = a.getSpanInfo(),
|
|
3838
|
-
this.database.batchSetItemValue(
|
|
3849
|
+
const { dataList: l } = a.getSpanInfo(), h = l.map((d) => ({ ...d, value: i }));
|
|
3850
|
+
this.database.batchSetItemValue(h, s, r);
|
|
3839
3851
|
return;
|
|
3840
3852
|
}
|
|
3841
3853
|
}
|
|
@@ -3849,7 +3861,7 @@ class Me {
|
|
|
3849
3861
|
if (r === void 0 || a === void 0) return;
|
|
3850
3862
|
const l = this.database.getVirtualBodyCell(r, a);
|
|
3851
3863
|
if (l) {
|
|
3852
|
-
const { dataList:
|
|
3864
|
+
const { dataList: h } = l.getSpanInfo(), d = h.map((f) => ({ ...f, value: o.value }));
|
|
3853
3865
|
s.push(...d);
|
|
3854
3866
|
}
|
|
3855
3867
|
}), this.database.batchSetItemValue(s, e, i);
|
|
@@ -3894,7 +3906,7 @@ class Me {
|
|
|
3894
3906
|
for (let o = 0; o <= e[1] - e[0]; o++) {
|
|
3895
3907
|
const r = [];
|
|
3896
3908
|
for (let a = 0; a <= i[1] - i[0]; a++) {
|
|
3897
|
-
const l = o + e[0],
|
|
3909
|
+
const l = o + e[0], h = a + i[0], d = this.database.getVirtualBodyCell(l, h);
|
|
3898
3910
|
d && (d.selectorCellValueType === "displayText" ? r.push(d.displayText) : r.push(d.getValue()));
|
|
3899
3911
|
}
|
|
3900
3912
|
s += `${r.join(" ")}\r`, t.push(r);
|
|
@@ -4048,21 +4060,21 @@ class Xt {
|
|
|
4048
4060
|
stageHeight: i,
|
|
4049
4061
|
stageWidth: s,
|
|
4050
4062
|
config: { SCROLLER_TRACK_SIZE: o = 0, SCROLLER_SIZE: r = 0, BORDER: a }
|
|
4051
|
-
} = this.ctx, l = s,
|
|
4063
|
+
} = this.ctx, l = s, h = i, d = e.height, f = e.width, x = t.height, u = this.ctx.footer.height;
|
|
4052
4064
|
if (this.type === "vertical") {
|
|
4053
|
-
this.visibleDistance =
|
|
4065
|
+
this.visibleDistance = h - o - d, this.distance = x - this.visibleDistance + u, this.trackX = l - 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;
|
|
4054
4066
|
const g = this.distance ? this.visibleDistance / (x + u) : 0;
|
|
4055
4067
|
let m = Math.floor(g * this.visibleDistance);
|
|
4056
4068
|
m < 30 ? m = 30 : m > this.visibleDistance && (m = 0), this.barHeight = m, this.barY = d + this.scroll / this.distance * (this.visibleDistance - this.barHeight), this.scroll = Math.max(0, Math.min(this.scroll, this.distance));
|
|
4057
4069
|
} else {
|
|
4058
4070
|
this.visibleDistance = l - o, this.distance = f - this.visibleDistance, this.splitPoints = [
|
|
4059
4071
|
l - o,
|
|
4060
|
-
|
|
4072
|
+
h - o,
|
|
4061
4073
|
l - o,
|
|
4062
|
-
|
|
4074
|
+
h
|
|
4063
4075
|
];
|
|
4064
4076
|
const g = a ? 0 : 0.5;
|
|
4065
|
-
this.trackX = 0, this.trackY =
|
|
4077
|
+
this.trackX = 0, this.trackY = h - o + g, this.trackWidth = l, this.trackHeight = o;
|
|
4066
4078
|
const m = this.distance ? this.visibleDistance / f : 0;
|
|
4067
4079
|
let w = Math.floor(m * this.visibleDistance);
|
|
4068
4080
|
this.barY = this.trackY - 1 + (o - r) / 2, w < 30 ? w = 30 : w >= this.visibleDistance && (w = 0), this.barWidth = w, this.barHeight = r, this.barX = this.scroll / this.distance * (this.visibleDistance - this.barWidth), this.scroll = Math.max(0, Math.min(this.scroll, this.distance));
|
|
@@ -4180,19 +4192,19 @@ class Ae {
|
|
|
4180
4192
|
let s = "", o = "";
|
|
4181
4193
|
if (((r = this.ctx.focusCell) == null ? void 0 : r.fixed) !== "left" && e < this.ctx.fixedLeftWidth ? s = "left" : ((a = this.ctx.focusCell) == null ? void 0 : a.fixed) !== "right" && e > this.ctx.body.visibleWidth - this.ctx.fixedRightWidth ? s = "right" : (s = "", this.stopAdjustPosition(!0, !1)), !this.mousedownHeader && i < this.ctx.header.visibleHeight ? o = "top" : i > this.ctx.header.visibleHeight + this.ctx.body.visibleHeight ? o = "bottom" : (o = "", this.stopAdjustPosition(!1, !0)), s && this.adjustPositionX !== s) {
|
|
4182
4194
|
this.adjustPositionX = s;
|
|
4183
|
-
let
|
|
4195
|
+
let h = 10 * (s === "left" ? -1 : 1);
|
|
4184
4196
|
this.timerX && (clearInterval(this.timerX), this.timerX = 0), this.timerX = setInterval(() => {
|
|
4185
|
-
|
|
4186
|
-
const { scrollX: d } = this.ctx, f = d +
|
|
4197
|
+
h *= 1.5;
|
|
4198
|
+
const { scrollX: d } = this.ctx, f = d + h;
|
|
4187
4199
|
(f < 0 || f > this.ctx.body.width) && (clearInterval(this.timerX), this.timerX = 0), this.ctx.setScrollX(f);
|
|
4188
4200
|
}, 100);
|
|
4189
4201
|
}
|
|
4190
4202
|
if (o && this.adjustPositionY !== o) {
|
|
4191
4203
|
this.adjustPositionY = o;
|
|
4192
|
-
let
|
|
4204
|
+
let h = 10 * (o === "top" ? -1 : 1);
|
|
4193
4205
|
this.timerY && (clearInterval(this.timerY), this.timerY = 0), this.timerY = setInterval(() => {
|
|
4194
|
-
|
|
4195
|
-
const { scrollY: d } = this.ctx, f = d +
|
|
4206
|
+
h *= 1.5;
|
|
4207
|
+
const { scrollY: d } = this.ctx, f = d + h;
|
|
4196
4208
|
(f < 0 || f > this.ctx.body.height) && (clearInterval(this.timerY), this.timerY = 0), this.ctx.setScrollY(f);
|
|
4197
4209
|
}, 100);
|
|
4198
4210
|
}
|
|
@@ -4224,8 +4236,8 @@ class He {
|
|
|
4224
4236
|
this.root.splice(r, 1);
|
|
4225
4237
|
const l = this.findNodeWithParent(this.root, e[this.key]);
|
|
4226
4238
|
if (!l) throw new Error("Target node not found");
|
|
4227
|
-
const { parent:
|
|
4228
|
-
i === "before" ?
|
|
4239
|
+
const { parent: h, index: d } = l;
|
|
4240
|
+
i === "before" ? h ? h[this.childrenKey].splice(d, 0, a) : this.root.splice(d, 0, a) : i === "after" && (h ? h[this.childrenKey].splice(d + 1, 0, a) : this.root.splice(d + 1, 0, a));
|
|
4229
4241
|
}
|
|
4230
4242
|
/** 在树中找到节点及其父节点 */
|
|
4231
4243
|
findNodeWithParent(t, e, i = null) {
|
|
@@ -4318,8 +4330,8 @@ class De {
|
|
|
4318
4330
|
const f = Math.floor(l / this.resizeNum * 100) / 100;
|
|
4319
4331
|
this.resizeAllColumn(f);
|
|
4320
4332
|
}
|
|
4321
|
-
const
|
|
4322
|
-
this.ctx.fixedLeftWidth =
|
|
4333
|
+
const h = this.fixedLeftCellHeaders.filter((f) => !f.hasChildren);
|
|
4334
|
+
this.ctx.fixedLeftWidth = h.reduce((f, x) => f + x.width, 0);
|
|
4323
4335
|
const d = this.fixedRightCellHeaders.filter((f) => !f.hasChildren);
|
|
4324
4336
|
this.ctx.fixedRightWidth = d.reduce((f, x) => f + x.width, i), 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.allCellHeaders = this.allCellHeaders, this.ctx.header.visibleWidth = this.visibleWidth, this.ctx.header.visibleHeight = this.visibleHeight;
|
|
4325
4337
|
}
|
|
@@ -4349,9 +4361,9 @@ class De {
|
|
|
4349
4361
|
this.ctx.stageElement.style.cursor === "col-resize" && (this.ctx.stageElement.style.cursor = "default");
|
|
4350
4362
|
const s = [...this.renderFixedCellHeaders, ...this.renderCenterCellHeaders];
|
|
4351
4363
|
for (const o of s) {
|
|
4352
|
-
const { offsetX: r, offsetY: a } = this.ctx.getOffset(t), l = r,
|
|
4364
|
+
const { offsetX: r, offsetY: a } = this.ctx.getOffset(t), l = r, h = a, d = o.getDrawX(), f = o.getDrawY();
|
|
4353
4365
|
if (l > d + o.width - 5 && l < d + o.width + 4 && l < e - 4 && // 视窗中最后一列不允许调整宽
|
|
4354
|
-
|
|
4366
|
+
h > f) {
|
|
4355
4367
|
const x = o.colIndex + o.colspan - 1, u = this.leafCellHeaders.find((g) => g.colIndex === x);
|
|
4356
4368
|
if (!u || !u.fixed && this.ctx.stageWidth - this.ctx.fixedRightWidth < d + o.width)
|
|
4357
4369
|
return;
|
|
@@ -4369,7 +4381,7 @@ class De {
|
|
|
4369
4381
|
}), this.ctx.on("mouseup", () => {
|
|
4370
4382
|
if (this.ctx.config.ENABLE_DRAG_COLUMN) {
|
|
4371
4383
|
if (this.dragingCell && this.dragTarget) {
|
|
4372
|
-
const t = (
|
|
4384
|
+
const t = (h, d = {}) => (h.forEach((f, x) => {
|
|
4373
4385
|
f.children && t(f.children, d), d[f.key] = x;
|
|
4374
4386
|
}), d), e = this.ctx.database.getColumns(), i = rt(e, ot(e)), s = new He(i, {
|
|
4375
4387
|
key: "key",
|
|
@@ -4474,10 +4486,10 @@ class De {
|
|
|
4474
4486
|
let s = e;
|
|
4475
4487
|
const { HEADER_HEIGHT: o = 0 } = this.ctx.config;
|
|
4476
4488
|
for (let r = 0; r < i; r++) {
|
|
4477
|
-
const a = t[r], l = o * (a.rowspan || 0),
|
|
4489
|
+
const a = t[r], l = o * (a.rowspan || 0), h = o * (a.level || 0);
|
|
4478
4490
|
let { minWidth: d, maxWidth: f } = a, x = a.width || 100;
|
|
4479
4491
|
d && x < d && (x = d), f && x > f && (x = f), a.children && (x = J(a.children).reduce((m, w) => m + ((w == null ? void 0 : w.width) || 100), 0));
|
|
4480
|
-
const u = new mt(this.ctx, this.columnIndex, s,
|
|
4492
|
+
const u = new mt(this.ctx, this.columnIndex, s, h, x, l, a);
|
|
4481
4493
|
this.ctx.database.setHeader(a.key, u), this.allCellHeaders.push(u), a.children || (this.leafCellHeaders.push(u), u.column.widthFillDisable || this.resizeNum++), a.fixed === "left" ? this.fixedLeftCellHeaders.push(u) : a.fixed === "right" ? this.fixedRightCellHeaders.push(u) : this.centerCellHeaders.push(u), !a.children && this.columnIndex++, a.children && this.render(a.children, s), s += x;
|
|
4482
4494
|
}
|
|
4483
4495
|
}
|
|
@@ -4491,8 +4503,8 @@ class De {
|
|
|
4491
4503
|
RESIZE_COLUMN_TEXT_BG_COLOR: s,
|
|
4492
4504
|
ENABLE_RESIZE_COLUMN_TEXT: o
|
|
4493
4505
|
}
|
|
4494
|
-
} = this.ctx, r = this.resizeTarget.getDrawX(), a = this.resizeTarget.width, l = r + a + this.resizeDiff - 0.5,
|
|
4495
|
-
if (this.ctx.paint.drawLine(
|
|
4506
|
+
} = this.ctx, r = this.resizeTarget.getDrawX(), a = this.resizeTarget.width, l = r + a + this.resizeDiff - 0.5, h = [l - 0.5, 0, l - 0.5, t];
|
|
4507
|
+
if (this.ctx.paint.drawLine(h, {
|
|
4496
4508
|
borderColor: e
|
|
4497
4509
|
}), o) {
|
|
4498
4510
|
const f = `${Math.floor(a + this.resizeDiff)}px`, x = 45, u = 24;
|
|
@@ -4524,9 +4536,9 @@ class De {
|
|
|
4524
4536
|
}
|
|
4525
4537
|
), this.dragingCell) {
|
|
4526
4538
|
const { drawX: s, drawY: o, visibleWidth: r, colIndex: a } = this.dragingCell;
|
|
4527
|
-
let l = s,
|
|
4539
|
+
let l = s, h = o;
|
|
4528
4540
|
a > this.dragTarget.colIndex && (l = s + r), a === 0 && (l = l + 1), a === this.ctx.maxColIndex && (l = l - 1);
|
|
4529
|
-
const d = [l,
|
|
4541
|
+
const d = [l, h, l, this.ctx.stageHeight], f = [l - 4, h, l + 4, h, l, h + 6, l - 4, h];
|
|
4530
4542
|
this.ctx.paint.drawLine(f, {
|
|
4531
4543
|
borderColor: e,
|
|
4532
4544
|
borderWidth: 1.2,
|
|
@@ -4695,7 +4707,7 @@ class Ne {
|
|
|
4695
4707
|
SCROLLER_TRACK_SIZE: r = 0,
|
|
4696
4708
|
HEIGHT: a,
|
|
4697
4709
|
EMPTY_BODY_HEIGHT: l = 0,
|
|
4698
|
-
MAX_HEIGHT:
|
|
4710
|
+
MAX_HEIGHT: h = 0,
|
|
4699
4711
|
ENABLE_OFFSET_HEIGHT: d = 0,
|
|
4700
4712
|
OFFSET_HEIGHT: f = 0,
|
|
4701
4713
|
FOOTER_POSITION: x
|
|
@@ -4711,15 +4723,15 @@ class Ne {
|
|
|
4711
4723
|
let w = this.height + e.height + r;
|
|
4712
4724
|
w += m;
|
|
4713
4725
|
let E = w;
|
|
4714
|
-
const
|
|
4715
|
-
if (
|
|
4716
|
-
const T =
|
|
4717
|
-
T > e.height + r ? E = T : w >
|
|
4718
|
-
} else this.data.length && a ? E = a : this.data.length &&
|
|
4726
|
+
const p = window.innerHeight, { top: y } = this.containerRect || this.ctx.containerElement.getBoundingClientRect();
|
|
4727
|
+
if (p > y && d && !a) {
|
|
4728
|
+
const T = p - y - f;
|
|
4729
|
+
T > e.height + r ? E = T : w > h && (E = h);
|
|
4730
|
+
} else this.data.length && a ? E = a : this.data.length && h && w > h && (E = h);
|
|
4719
4731
|
E > 0 && (this.ctx.stageHeight = Math.floor(E), this.ctx.stageElement.style.height = `${this.ctx.stageHeight}px`);
|
|
4720
4732
|
let b = this.ctx.stageHeight - e.height - r;
|
|
4721
4733
|
o ? this.visibleHeight = b - m : this.visibleHeight = b, this.data.length || (this.height = this.visibleHeight), this.ctx.body.x = this.x, this.ctx.body.y = this.y, this.ctx.body.width = this.width, this.ctx.body.height = this.height, this.ctx.body.visibleWidth = this.visibleWidth, this.ctx.body.visibleHeight = this.visibleHeight, this.ctx.body.data = u;
|
|
4722
|
-
const
|
|
4734
|
+
const C = window.devicePixelRatio || 1, R = this.ctx.stageWidth * C, S = this.ctx.stageHeight * C;
|
|
4723
4735
|
t.width = Math.round(R), t.height = Math.round(S);
|
|
4724
4736
|
const O = this.data.length ? "not-empty" : "empty";
|
|
4725
4737
|
this.ctx.emit("emptyChange", {
|
|
@@ -4731,8 +4743,8 @@ class Ne {
|
|
|
4731
4743
|
width: this.width,
|
|
4732
4744
|
height: this.data.length ? 0 : l + m
|
|
4733
4745
|
});
|
|
4734
|
-
const v = Math.round(t.width /
|
|
4735
|
-
this.ctx.canvasElement.setAttribute("style", `height:${I}px;width:${v}px;`), this.ctx.paint.scale(
|
|
4746
|
+
const v = Math.round(t.width / C * 1e4) / 1e4, I = Math.round(t.height / C * 1e4) / 1e4;
|
|
4747
|
+
this.ctx.canvasElement.setAttribute("style", `height:${I}px;width:${v}px;`), this.ctx.paint.scale(C);
|
|
4736
4748
|
}
|
|
4737
4749
|
// 调整行的高度
|
|
4738
4750
|
initResizeRow() {
|
|
@@ -4751,12 +4763,12 @@ class Ne {
|
|
|
4751
4763
|
const { offsetY: e, offsetX: i } = this.ctx.getOffset(t), s = e, o = i, r = t.clientY, {
|
|
4752
4764
|
stageHeight: a,
|
|
4753
4765
|
scrollY: l,
|
|
4754
|
-
config: { RESIZE_ROW_MIN_HEIGHT:
|
|
4766
|
+
config: { RESIZE_ROW_MIN_HEIGHT: h = 0 }
|
|
4755
4767
|
} = this.ctx;
|
|
4756
4768
|
if (this.isResizing && this.resizeTarget) {
|
|
4757
4769
|
const d = this.resizeTarget.height;
|
|
4758
4770
|
let f = r - this.clientY;
|
|
4759
|
-
const { calculatedHeight: x } = this.resizeTarget, u = x === -1 ?
|
|
4771
|
+
const { calculatedHeight: x } = this.resizeTarget, u = x === -1 ? h : x;
|
|
4760
4772
|
f + d < u && (f = -(d - u)), this.resizeDiff = f, this.ctx.emit("draw");
|
|
4761
4773
|
} else {
|
|
4762
4774
|
if (this.resizeTarget = null, this.isMouseDown)
|
|
@@ -4848,12 +4860,12 @@ class Ne {
|
|
|
4848
4860
|
config: { CELL_HEIGHT: s }
|
|
4849
4861
|
} = this.ctx, o = i, { data: r, positions: a } = e.getData();
|
|
4850
4862
|
this.ctx.maxRowIndex = r.length - 1;
|
|
4851
|
-
let l = this.binarySearch(a, o),
|
|
4852
|
-
if (
|
|
4863
|
+
let l = this.binarySearch(a, o), h = this.binarySearch(a, o + this.visibleHeight);
|
|
4864
|
+
if (h === -1 && (h = this.ctx.maxRowIndex), l === -1 && h === this.ctx.maxRowIndex) {
|
|
4853
4865
|
const f = Math.floor(this.visibleHeight / s);
|
|
4854
4866
|
l = this.ctx.maxRowIndex - f;
|
|
4855
4867
|
}
|
|
4856
|
-
this.headIndex = Math.max(0, l), this.tailIndex = Math.min(this.ctx.maxRowIndex,
|
|
4868
|
+
this.headIndex = Math.max(0, l), 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;
|
|
4857
4869
|
const d = [];
|
|
4858
4870
|
for (let f = 0; f < this.visibleRows.length; f++) {
|
|
4859
4871
|
const x = this.headIndex + f, u = this.visibleRows[f], { height: g, top: m } = this.ctx.database.getPositionForRowIndex(x), w = new Jt(this.ctx, x, 0, m + this.y, t.width, g, u);
|
|
@@ -4864,7 +4876,7 @@ class Ne {
|
|
|
4864
4876
|
updateAutoHeight() {
|
|
4865
4877
|
const t = this.ctx.body.renderRows;
|
|
4866
4878
|
if (!t.some((s) => s.calculatedHeightCells.length > 0))
|
|
4867
|
-
return;
|
|
4879
|
+
return !1;
|
|
4868
4880
|
t.forEach((s) => {
|
|
4869
4881
|
s.updateCalculatedHeight();
|
|
4870
4882
|
});
|
|
@@ -4872,7 +4884,7 @@ class Ne {
|
|
|
4872
4884
|
height: s.calculatedHeight,
|
|
4873
4885
|
rowIndex: s.rowIndex
|
|
4874
4886
|
}));
|
|
4875
|
-
this.ctx.database.setBatchCalculatedRowHeight(i);
|
|
4887
|
+
return this.ctx.database.setBatchCalculatedRowHeight(i);
|
|
4876
4888
|
}
|
|
4877
4889
|
draw() {
|
|
4878
4890
|
this.renderRows.forEach((t) => {
|
|
@@ -4925,8 +4937,8 @@ class ke {
|
|
|
4925
4937
|
colorStart: "rgba(0,0,0,0.1)",
|
|
4926
4938
|
colorEnd: "rgba(0,0,0,0)"
|
|
4927
4939
|
}), i < Math.floor(s.width - o - 1) && e !== a) {
|
|
4928
|
-
const
|
|
4929
|
-
this.ctx.paint.drawShadow(
|
|
4940
|
+
const h = s.width - (this.x + this.width) + o - e;
|
|
4941
|
+
this.ctx.paint.drawShadow(h, l, e, this.height, {
|
|
4930
4942
|
fillColor: r,
|
|
4931
4943
|
side: "left",
|
|
4932
4944
|
shadowWidth: 4,
|
|
@@ -5079,22 +5091,22 @@ class Be {
|
|
|
5079
5091
|
const {
|
|
5080
5092
|
SELECTOR_AREA_MIN_X: a,
|
|
5081
5093
|
SELECTOR_AREA_MAX_X: l,
|
|
5082
|
-
SELECTOR_AREA_MIN_Y:
|
|
5094
|
+
SELECTOR_AREA_MIN_Y: h,
|
|
5083
5095
|
SELECTOR_AREA_MAX_Y: d,
|
|
5084
5096
|
SELECTOR_AREA_MAX_X_OFFSET: f,
|
|
5085
5097
|
SELECTOR_AREA_MAX_Y_OFFSET: x
|
|
5086
|
-
} = this.ctx.config, u = a, g = l || this.ctx.maxColIndex - f, m =
|
|
5087
|
-
let [E,
|
|
5088
|
-
if (E < u ||
|
|
5098
|
+
} = this.ctx.config, u = a, g = l || this.ctx.maxColIndex - f, m = h, w = d || this.ctx.maxRowIndex - x;
|
|
5099
|
+
let [E, p] = o, [y, b] = r;
|
|
5100
|
+
if (E < u || p > g || y < m || b > w)
|
|
5089
5101
|
return;
|
|
5090
5102
|
if (this.ctx.config.ENABLE_MERGE_CELL_LINK) {
|
|
5091
5103
|
const R = this.adjustMergeCells(o, r);
|
|
5092
|
-
|
|
5104
|
+
y = R.yArr[0], b = R.yArr[1], E = R.xArr[0], p = R.xArr[1], this.ctx.onlyMergeCell = R.onlyMergeCell;
|
|
5093
5105
|
}
|
|
5094
|
-
E ===
|
|
5095
|
-
const { BEFORE_SET_SELECTOR_METHOD:
|
|
5096
|
-
if (typeof
|
|
5097
|
-
const S =
|
|
5106
|
+
E === p && y === b ? this.ctx.selectOnlyOne = !0 : this.ctx.selectOnlyOne = !1, o = [Math.max(u, E), Math.min(g, p)], r = [Math.max(m, y), Math.min(w, b)];
|
|
5107
|
+
const { BEFORE_SET_SELECTOR_METHOD: C } = this.ctx.config;
|
|
5108
|
+
if (typeof C == "function") {
|
|
5109
|
+
const S = C({
|
|
5098
5110
|
focusCell: this.ctx.focusCell,
|
|
5099
5111
|
xArr: o,
|
|
5100
5112
|
yArr: r
|
|
@@ -5103,7 +5115,7 @@ class Be {
|
|
|
5103
5115
|
return;
|
|
5104
5116
|
o = S.xArr, r = S.yArr;
|
|
5105
5117
|
}
|
|
5106
|
-
this.ctx.selector.xArr = o, this.ctx.selector.yArr = r, b === this.ctx.maxRowIndex &&
|
|
5118
|
+
this.ctx.selector.xArr = o, this.ctx.selector.yArr = r, b === this.ctx.maxRowIndex && y === 0 ? this.ctx.selectColsIng = !0 : this.ctx.selectColsIng = !1, p === this.ctx.maxColIndex && E === 0 ? this.ctx.selectRowsIng = !0 : this.ctx.selectRowsIng = !1, this.ctx.emit("setSelector", this.ctx.selector), this.ctx.emit("drawView");
|
|
5107
5119
|
}
|
|
5108
5120
|
}
|
|
5109
5121
|
adjustMergeCells(t, e) {
|
|
@@ -5118,13 +5130,13 @@ class Be {
|
|
|
5118
5130
|
let a = [], l = [];
|
|
5119
5131
|
for (let m = 0; m <= e[1] - e[0]; m++)
|
|
5120
5132
|
for (let w = 0; w <= t[1] - t[0]; w++) {
|
|
5121
|
-
const E = m + e[0],
|
|
5122
|
-
|
|
5133
|
+
const E = m + e[0], p = w + t[0], y = this.ctx.database.getVirtualBodyCell(E, p);
|
|
5134
|
+
y && ((E === i || E === s) && a.push(y), (p === o || p === r) && l.push(y));
|
|
5123
5135
|
}
|
|
5124
|
-
const
|
|
5136
|
+
const h = a.reduce(
|
|
5125
5137
|
(m, w) => {
|
|
5126
|
-
const { yArr: E } = w.getSpanInfo(), [
|
|
5127
|
-
return m.minY = Math.min(m.minY,
|
|
5138
|
+
const { yArr: E } = w.getSpanInfo(), [p, y] = E;
|
|
5139
|
+
return m.minY = Math.min(m.minY, p), m.maxY = Math.max(m.maxY, y), m;
|
|
5128
5140
|
},
|
|
5129
5141
|
{
|
|
5130
5142
|
minY: i,
|
|
@@ -5132,16 +5144,16 @@ class Be {
|
|
|
5132
5144
|
}
|
|
5133
5145
|
), d = l.reduce(
|
|
5134
5146
|
(m, w) => {
|
|
5135
|
-
const { xArr: E } = w.getSpanInfo(), [
|
|
5136
|
-
return m.minX = Math.min(m.minX,
|
|
5147
|
+
const { xArr: E } = w.getSpanInfo(), [p, y] = E;
|
|
5148
|
+
return m.minX = Math.min(m.minX, p), m.maxX = Math.max(m.maxX, y), m;
|
|
5137
5149
|
},
|
|
5138
5150
|
{
|
|
5139
5151
|
minX: o,
|
|
5140
5152
|
maxX: r
|
|
5141
5153
|
}
|
|
5142
|
-
), f = [d.minX, d.maxX], x = [
|
|
5154
|
+
), f = [d.minX, d.maxX], x = [h.minY, h.maxY];
|
|
5143
5155
|
let u = !1;
|
|
5144
|
-
if (d.minX !== d.maxX ||
|
|
5156
|
+
if (d.minX !== d.maxX || h.minY !== h.maxY) {
|
|
5145
5157
|
const m = JSON.stringify(f) + JSON.stringify(x), w = (g = this.ctx.focusCell) == null ? void 0 : g.getSpanInfo();
|
|
5146
5158
|
u = (w && JSON.stringify(w.xArr) + JSON.stringify(w.yArr)) === m;
|
|
5147
5159
|
}
|
|
@@ -5158,11 +5170,11 @@ class Be {
|
|
|
5158
5170
|
if (this.ctx.focusCellHeader) {
|
|
5159
5171
|
const { colIndex: a } = this.ctx.focusCellHeader;
|
|
5160
5172
|
if (this.ctx.clearSelector(), this.ctx.mousedown && t.colIndex >= a) {
|
|
5161
|
-
const l = [a, t.colIndex + t.colspan - 1],
|
|
5162
|
-
this.setSelector(l,
|
|
5173
|
+
const l = [a, t.colIndex + t.colspan - 1], h = [o, r];
|
|
5174
|
+
this.setSelector(l, h);
|
|
5163
5175
|
} else {
|
|
5164
|
-
const l = [t.colIndex, a + t.colspan - 1],
|
|
5165
|
-
this.setSelector(l,
|
|
5176
|
+
const l = [t.colIndex, a + t.colspan - 1], h = [o, r];
|
|
5177
|
+
this.setSelector(l, h);
|
|
5166
5178
|
}
|
|
5167
5179
|
}
|
|
5168
5180
|
}
|
|
@@ -5178,7 +5190,7 @@ class Be {
|
|
|
5178
5190
|
SELECTOR_AREA_MAX_Y: r,
|
|
5179
5191
|
SELECTOR_AREA_MAX_X_OFFSET: a,
|
|
5180
5192
|
SELECTOR_AREA_MAX_Y_OFFSET: l
|
|
5181
|
-
} = this.ctx.config,
|
|
5193
|
+
} = this.ctx.config, h = i, d = s || this.ctx.maxColIndex - a, f = o, x = r || this.ctx.maxRowIndex - l, u = [h, d], g = [f, x];
|
|
5182
5194
|
this.setSelector(u, g);
|
|
5183
5195
|
}
|
|
5184
5196
|
}
|
|
@@ -5188,17 +5200,17 @@ class Be {
|
|
|
5188
5200
|
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, a = i;
|
|
5189
5201
|
if (e) {
|
|
5190
5202
|
this.ctx.setFocusCell(t);
|
|
5191
|
-
const l = [a, r],
|
|
5192
|
-
this.setSelector(l,
|
|
5203
|
+
const l = [a, r], h = [t.rowIndex, t.rowIndex];
|
|
5204
|
+
this.setSelector(l, h);
|
|
5193
5205
|
}
|
|
5194
5206
|
if (this.ctx.focusCell && this.ctx.mousedown) {
|
|
5195
5207
|
const { rowIndex: l } = this.ctx.focusCell;
|
|
5196
5208
|
if (t.rowIndex >= l) {
|
|
5197
|
-
const
|
|
5198
|
-
this.setSelector(
|
|
5209
|
+
const h = [a, r], d = [l, t.rowIndex];
|
|
5210
|
+
this.setSelector(h, d);
|
|
5199
5211
|
} else {
|
|
5200
|
-
const
|
|
5201
|
-
this.setSelector(
|
|
5212
|
+
const h = [a, r], d = [t.rowIndex, l];
|
|
5213
|
+
this.setSelector(h, d);
|
|
5202
5214
|
}
|
|
5203
5215
|
}
|
|
5204
5216
|
}
|
|
@@ -5207,7 +5219,7 @@ class Be {
|
|
|
5207
5219
|
return;
|
|
5208
5220
|
const { mousedown: t, focusCell: e, hoverCell: i } = this.ctx;
|
|
5209
5221
|
if (t && e && i) {
|
|
5210
|
-
const { rowIndex: s, colIndex: o } = e, r = Math.min(i.colIndex, o), a = Math.max(i.colIndex, o), l = Math.min(i.rowIndex, s),
|
|
5222
|
+
const { rowIndex: s, colIndex: o } = e, r = Math.min(i.colIndex, o), a = Math.max(i.colIndex, o), l = Math.min(i.rowIndex, s), h = Math.max(i.rowIndex, s), d = [r, a], f = [l, h];
|
|
5211
5223
|
this.setSelector(d, f);
|
|
5212
5224
|
}
|
|
5213
5225
|
}
|
|
@@ -5217,7 +5229,7 @@ class Be {
|
|
|
5217
5229
|
if (this.ctx.selector.enable = !0, i && t) {
|
|
5218
5230
|
if (this.ctx.config.ENABLE_SELECTOR_SINGLE)
|
|
5219
5231
|
return;
|
|
5220
|
-
const { colIndex: s, rowIndex: o } = i, { colIndex: r, rowIndex: a } = e, l = Math.min(r, s),
|
|
5232
|
+
const { colIndex: s, rowIndex: o } = i, { colIndex: r, rowIndex: a } = e, l = Math.min(r, s), h = Math.max(r, s), d = Math.min(a, o), f = Math.max(a, o), x = [l, h], u = [d, f];
|
|
5221
5233
|
this.setSelector(x, u);
|
|
5222
5234
|
} else {
|
|
5223
5235
|
this.ctx.emit("cellSelectedClick", e);
|
|
@@ -5283,8 +5295,8 @@ class Be {
|
|
|
5283
5295
|
let o = [];
|
|
5284
5296
|
const r = /* @__PURE__ */ new Set();
|
|
5285
5297
|
for (let l = 0; l <= e[1] - e[0]; l++)
|
|
5286
|
-
for (let
|
|
5287
|
-
const d = l + e[0], f =
|
|
5298
|
+
for (let h = 0; h <= t[1] - t[0]; h++) {
|
|
5299
|
+
const d = l + e[0], f = h + t[0], x = this.ctx.database.getItemValueForRowIndexAndColIndex(d, f);
|
|
5288
5300
|
if (x) {
|
|
5289
5301
|
const { rowKey: u, key: g } = x;
|
|
5290
5302
|
this.ctx.database.getReadonly(u, g) || (r.add(u), o.push({
|
|
@@ -5316,11 +5328,11 @@ class Be {
|
|
|
5316
5328
|
const e = this.ctx.selector.yArr[0], i = this.ctx.selector.xArr[0], s = /* @__PURE__ */ new Set();
|
|
5317
5329
|
navigator.clipboard.readText().then(async (o) => {
|
|
5318
5330
|
let r = we(o);
|
|
5319
|
-
const a = [i, i + r[0].length - 1], l = [e, e + r.length - 1], [
|
|
5331
|
+
const a = [i, i + r[0].length - 1], l = [e, e + r.length - 1], [h, d] = l, [f, x] = a, u = d - this.ctx.maxRowIndex, g = x - this.ctx.maxColIndex;
|
|
5320
5332
|
(u > 0 || g > 0) && this.ctx.emit("onPastedDataOverflow", {
|
|
5321
5333
|
maxY: d,
|
|
5322
5334
|
maxX: x,
|
|
5323
|
-
minY:
|
|
5335
|
+
minY: h,
|
|
5324
5336
|
minX: f,
|
|
5325
5337
|
overflowRowCount: u,
|
|
5326
5338
|
overflowColCount: g,
|
|
@@ -5328,18 +5340,18 @@ class Be {
|
|
|
5328
5340
|
});
|
|
5329
5341
|
const m = r.length === 1 && r[0].length === 1;
|
|
5330
5342
|
if (this.ctx.config.ENABLE_MERGE_CELL_LINK && this.ctx.database.hasMergeCell(a, l) && !m) {
|
|
5331
|
-
const
|
|
5343
|
+
const y = {
|
|
5332
5344
|
code: "ERR_MERGED_CELLS_PASTE",
|
|
5333
5345
|
message: "Merged cells cannot span paste data"
|
|
5334
5346
|
};
|
|
5335
|
-
this.ctx.hasEvent("error") ? this.ctx.emit("error",
|
|
5347
|
+
this.ctx.hasEvent("error") ? this.ctx.emit("error", y) : alert(y.message);
|
|
5336
5348
|
return;
|
|
5337
5349
|
}
|
|
5338
5350
|
let w = [];
|
|
5339
|
-
for (let
|
|
5340
|
-
const b = r[
|
|
5341
|
-
for (let
|
|
5342
|
-
const R =
|
|
5351
|
+
for (let y = 0; y <= r.length - 1; y++) {
|
|
5352
|
+
const b = r[y].length;
|
|
5353
|
+
for (let C = 0; C <= b - 1; C++) {
|
|
5354
|
+
const R = y + e, S = C + i, O = r[y][C], v = this.ctx.database.getItemValueForRowIndexAndColIndex(
|
|
5343
5355
|
R,
|
|
5344
5356
|
S
|
|
5345
5357
|
);
|
|
@@ -5356,35 +5368,35 @@ class Be {
|
|
|
5356
5368
|
}
|
|
5357
5369
|
}
|
|
5358
5370
|
if (this.isCut) {
|
|
5359
|
-
const
|
|
5371
|
+
const y = this.clearSelectedData(
|
|
5360
5372
|
this.ctx.selector.xArrCopy,
|
|
5361
5373
|
this.ctx.selector.yArrCopy,
|
|
5362
5374
|
!0
|
|
5363
5375
|
// 忽略设置,只返回数据,用于cut,实现历史回退需要返回两次问题
|
|
5364
|
-
), b = w.map((
|
|
5365
|
-
|
|
5366
|
-
b.includes(`${
|
|
5376
|
+
), b = w.map((C) => `${C.rowKey}-${C.key}`);
|
|
5377
|
+
y.forEach((C) => {
|
|
5378
|
+
b.includes(`${C.rowKey}-${C.key}`) || w.unshift(C);
|
|
5367
5379
|
}), this.isCut = !1;
|
|
5368
5380
|
}
|
|
5369
5381
|
if (!w.length)
|
|
5370
5382
|
return;
|
|
5371
5383
|
const { BEFORE_PASTE_DATA_METHOD: E } = this.ctx.config;
|
|
5372
5384
|
if (typeof E == "function") {
|
|
5373
|
-
const
|
|
5374
|
-
rowKey:
|
|
5375
|
-
key:
|
|
5376
|
-
value:
|
|
5377
|
-
oldValue: this.ctx.database.getItemValue(
|
|
5378
|
-
row: this.ctx.database.getRowDataItemForRowKey(
|
|
5385
|
+
const y = E, b = w.map((C) => ({
|
|
5386
|
+
rowKey: C.rowKey,
|
|
5387
|
+
key: C.key,
|
|
5388
|
+
value: C.value,
|
|
5389
|
+
oldValue: this.ctx.database.getItemValue(C.rowKey, C.key),
|
|
5390
|
+
row: this.ctx.database.getRowDataItemForRowKey(C.rowKey)
|
|
5379
5391
|
}));
|
|
5380
|
-
if (w = await
|
|
5392
|
+
if (w = await y(b, a, l, r), w && !w.length)
|
|
5381
5393
|
return;
|
|
5382
5394
|
}
|
|
5383
5395
|
this.clearCopyLine(), this.ctx.batchSetItemValueByEditor(w, !0);
|
|
5384
|
-
let
|
|
5385
|
-
s.forEach((
|
|
5386
|
-
|
|
5387
|
-
}), this.ctx.emit("pasteChange", w,
|
|
5396
|
+
let p = [];
|
|
5397
|
+
s.forEach((y) => {
|
|
5398
|
+
p.push(this.ctx.database.getRowDataItemForRowKey(y));
|
|
5399
|
+
}), this.ctx.emit("pasteChange", w, p), this.ctx.emit("draw");
|
|
5388
5400
|
}).catch((o) => {
|
|
5389
5401
|
console.error("Failed to get the clipboard content:", o);
|
|
5390
5402
|
});
|
|
@@ -5415,8 +5427,8 @@ class Be {
|
|
|
5415
5427
|
s < l && s++;
|
|
5416
5428
|
break;
|
|
5417
5429
|
}
|
|
5418
|
-
const
|
|
5419
|
-
f && (f.operation || this.isInSettingRange(f.rowIndex, f.colIndex) && (this.ctx.setFocusCell(f), this.setSelector(
|
|
5430
|
+
const h = [i, i], d = [s, s], f = this.getCell(s, i);
|
|
5431
|
+
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")));
|
|
5420
5432
|
}
|
|
5421
5433
|
// 判断是否在设置范围内
|
|
5422
5434
|
isInSettingRange(t, e) {
|
|
@@ -5427,8 +5439,8 @@ class Be {
|
|
|
5427
5439
|
SELECTOR_AREA_MAX_Y: r,
|
|
5428
5440
|
SELECTOR_AREA_MAX_X_OFFSET: a,
|
|
5429
5441
|
SELECTOR_AREA_MAX_Y_OFFSET: l
|
|
5430
|
-
} = this.ctx.config,
|
|
5431
|
-
return !(e <
|
|
5442
|
+
} = this.ctx.config, h = i, d = s || this.ctx.maxColIndex - a, f = o, x = r || this.ctx.maxRowIndex - l;
|
|
5443
|
+
return !(e < h || e > d || t < f || t > x);
|
|
5432
5444
|
}
|
|
5433
5445
|
/**
|
|
5434
5446
|
* 调整滚动条位置,让焦点单元格始终出现在可视区域内
|
|
@@ -5443,21 +5455,21 @@ class Be {
|
|
|
5443
5455
|
header: r,
|
|
5444
5456
|
footer: a,
|
|
5445
5457
|
body: l,
|
|
5446
|
-
scrollX:
|
|
5458
|
+
scrollX: h,
|
|
5447
5459
|
scrollY: d,
|
|
5448
5460
|
config: { SCROLLER_TRACK_SIZE: f, FOOTER_FIXED: x, FOOTER_POSITION: u, ENABLE_MERGE_CELL_LINK: g }
|
|
5449
5461
|
} = this.ctx;
|
|
5450
5462
|
if (!i)
|
|
5451
5463
|
return;
|
|
5452
5464
|
g && this.ctx.onlyMergeCell && i.updateSpanInfo();
|
|
5453
|
-
const { drawX: m, drawY: w, width: E, height:
|
|
5454
|
-
let R = r.height - w, S =
|
|
5465
|
+
const { drawX: m, drawY: w, width: E, height: p, fixed: y } = i, b = o - m + 1, C = i.drawX + E - (e - s) + 1;
|
|
5466
|
+
let R = r.height - w, S = p;
|
|
5455
5467
|
S > l.visibleHeight && (S = l.visibleHeight);
|
|
5456
5468
|
let O = 0;
|
|
5457
5469
|
x && (u === "top" ? R = r.height + a.height - w : O = a.visibleHeight);
|
|
5458
5470
|
const v = w + S - (t - O - f);
|
|
5459
|
-
let I =
|
|
5460
|
-
|
|
5471
|
+
let I = h, _ = d;
|
|
5472
|
+
C > 0 && !y ? I = Math.floor(h + C) : b > 0 && !y && (I = Math.floor(h - b)), R > 0 ? _ = Math.floor(d - R) : v > 0 && (_ = Math.floor(d + v)), (Math.abs(h - I) > 2 || Math.abs(d - _) > 2) && (this.ctx.adjustPositioning = !0, this.ctx.emit("adjustBoundaryPosition", i), this.ctx.setScroll(I, _));
|
|
5461
5473
|
}
|
|
5462
5474
|
destroy() {
|
|
5463
5475
|
}
|
|
@@ -5472,7 +5484,7 @@ class Xe {
|
|
|
5472
5484
|
this.ctx.on("mousemove", (t) => {
|
|
5473
5485
|
if (this.ctx.stageElement.style.cursor === "crosshair" && (this.ctx.stageElement.style.cursor = "default"), this.ctx.editing || !this.ctx.focusCell || !this.maxColRowCell)
|
|
5474
5486
|
return;
|
|
5475
|
-
const { offsetX: e, offsetY: i } = this.ctx.getOffset(t), { colIndex: s, rowIndex: o, drawX: r, drawY: a, width: l, height:
|
|
5487
|
+
const { offsetX: e, offsetY: i } = this.ctx.getOffset(t), { colIndex: s, rowIndex: o, drawX: r, drawY: a, width: l, height: h } = this.maxColRowCell, d = 6, f = s === this.ctx.maxColIndex || o === this.ctx.maxRowIndex ? 0 : 2, x = r + l - d + f, u = a + h - d + f;
|
|
5476
5488
|
e > x && i > u && e < x + d && i < u + d && (this.ctx.stageElement.style.cursor = "crosshair"), this.ctx.autofillMove && this.ctx.startAdjustPosition(t);
|
|
5477
5489
|
}), this.ctx.on("cellMouseenter", (t) => {
|
|
5478
5490
|
const { xArr: e, yArr: i } = this.ctx.selector, s = e[1], o = i[1], { colIndex: r, rowIndex: a } = t;
|
|
@@ -5506,8 +5518,8 @@ class Xe {
|
|
|
5506
5518
|
if (!i)
|
|
5507
5519
|
return;
|
|
5508
5520
|
let r = t, a = e;
|
|
5509
|
-
const l = this.ctx.selector.xArr,
|
|
5510
|
-
if (!(!o && JSON.stringify(
|
|
5521
|
+
const l = this.ctx.selector.xArr, h = this.ctx.selector.yArr;
|
|
5522
|
+
if (!(!o && JSON.stringify(h) !== JSON.stringify(a)) && !(!s && JSON.stringify(l) !== JSON.stringify(r)) && (JSON.stringify(this.ctx.autofill.xArr) !== JSON.stringify(r) || JSON.stringify(this.ctx.autofill.yArr) !== JSON.stringify(a))) {
|
|
5511
5523
|
const {
|
|
5512
5524
|
SELECTOR_AREA_MIN_X: d,
|
|
5513
5525
|
SELECTOR_AREA_MAX_X: f,
|
|
@@ -5515,11 +5527,11 @@ class Xe {
|
|
|
5515
5527
|
SELECTOR_AREA_MAX_Y: u,
|
|
5516
5528
|
SELECTOR_AREA_MAX_X_OFFSET: g,
|
|
5517
5529
|
SELECTOR_AREA_MAX_Y_OFFSET: m
|
|
5518
|
-
} = this.ctx.config, w = d, E = f || this.ctx.maxColIndex - g,
|
|
5519
|
-
let [b,
|
|
5520
|
-
if (b < w || R <
|
|
5530
|
+
} = this.ctx.config, w = d, E = f || this.ctx.maxColIndex - g, p = x, y = u || this.ctx.maxRowIndex - m;
|
|
5531
|
+
let [b, C] = r, [R, S] = a;
|
|
5532
|
+
if (b < w || R < p)
|
|
5521
5533
|
return;
|
|
5522
|
-
r = [Math.max(w, b), Math.min(E,
|
|
5534
|
+
r = [Math.max(w, b), Math.min(E, C)], a = [Math.max(p, R), Math.min(y, S)];
|
|
5523
5535
|
const { BEFORE_SET_AUTOFILL_METHOD: O } = this.ctx.config;
|
|
5524
5536
|
if (typeof O == "function") {
|
|
5525
5537
|
const I = O({
|
|
@@ -5544,8 +5556,8 @@ class Xe {
|
|
|
5544
5556
|
const m = u + e.yArr[0], w = g + e.xArr[0];
|
|
5545
5557
|
i.set(`${m}-${w}`, !0);
|
|
5546
5558
|
}
|
|
5547
|
-
const { value: s } = e, o = s[0].length, r = s.length, a = this.ctx.autofill.xArr, l = this.ctx.autofill.yArr,
|
|
5548
|
-
if (this.ctx.config.ENABLE_MERGE_CELL_LINK && this.ctx.database.hasMergeCell(a, l) && !
|
|
5559
|
+
const { value: s } = e, o = s[0].length, r = s.length, a = this.ctx.autofill.xArr, l = this.ctx.autofill.yArr, h = o === 1 && r === 1;
|
|
5560
|
+
if (this.ctx.config.ENABLE_MERGE_CELL_LINK && this.ctx.database.hasMergeCell(a, l) && !h) {
|
|
5549
5561
|
const u = {
|
|
5550
5562
|
code: "ERR_MERGED_CELLS_AUTOFILL",
|
|
5551
5563
|
message: "Merged cells cannot span autofill data"
|
|
@@ -5556,12 +5568,12 @@ class Xe {
|
|
|
5556
5568
|
let d = [];
|
|
5557
5569
|
for (let u = 0; u <= l[1] - l[0]; u++)
|
|
5558
5570
|
for (let g = 0; g <= a[1] - a[0]; g++) {
|
|
5559
|
-
const m = g + a[0], w = u + l[0], E = s[u % r][g % o],
|
|
5560
|
-
if (
|
|
5561
|
-
const { rowKey: b, key:
|
|
5562
|
-
this.ctx.database.getReadonly(b,
|
|
5571
|
+
const m = g + a[0], w = u + l[0], E = s[u % r][g % o], p = this.ctx.database.getItemValueForRowIndexAndColIndex(w, m), y = `${w}-${m}`;
|
|
5572
|
+
if (p && !i.has(y)) {
|
|
5573
|
+
const { rowKey: b, key: C } = p;
|
|
5574
|
+
this.ctx.database.getReadonly(b, C) || (t.add(b), d.push({
|
|
5563
5575
|
rowKey: b,
|
|
5564
|
-
key:
|
|
5576
|
+
key: C,
|
|
5565
5577
|
value: E,
|
|
5566
5578
|
row: {}
|
|
5567
5579
|
}));
|
|
@@ -5600,9 +5612,9 @@ class Xe {
|
|
|
5600
5612
|
destroy() {
|
|
5601
5613
|
}
|
|
5602
5614
|
}
|
|
5603
|
-
const j = Math.min, z = Math.max, at = Math.round, st = Math.floor, Y = (
|
|
5604
|
-
x:
|
|
5605
|
-
y:
|
|
5615
|
+
const j = Math.min, z = Math.max, at = Math.round, st = Math.floor, Y = (c) => ({
|
|
5616
|
+
x: c,
|
|
5617
|
+
y: c
|
|
5606
5618
|
}), Ye = {
|
|
5607
5619
|
left: "right",
|
|
5608
5620
|
right: "left",
|
|
@@ -5612,47 +5624,47 @@ const j = Math.min, z = Math.max, at = Math.round, st = Math.floor, Y = (h) => (
|
|
|
5612
5624
|
start: "end",
|
|
5613
5625
|
end: "start"
|
|
5614
5626
|
};
|
|
5615
|
-
function Et(
|
|
5616
|
-
return z(
|
|
5627
|
+
function Et(c, t, e) {
|
|
5628
|
+
return z(c, j(t, e));
|
|
5617
5629
|
}
|
|
5618
|
-
function tt(
|
|
5619
|
-
return typeof
|
|
5630
|
+
function tt(c, t) {
|
|
5631
|
+
return typeof c == "function" ? c(t) : c;
|
|
5620
5632
|
}
|
|
5621
|
-
function $(
|
|
5622
|
-
return
|
|
5633
|
+
function $(c) {
|
|
5634
|
+
return c.split("-")[0];
|
|
5623
5635
|
}
|
|
5624
|
-
function et(
|
|
5625
|
-
return
|
|
5636
|
+
function et(c) {
|
|
5637
|
+
return c.split("-")[1];
|
|
5626
5638
|
}
|
|
5627
|
-
function Qt(
|
|
5628
|
-
return
|
|
5639
|
+
function Qt(c) {
|
|
5640
|
+
return c === "x" ? "y" : "x";
|
|
5629
5641
|
}
|
|
5630
|
-
function Rt(
|
|
5631
|
-
return
|
|
5642
|
+
function Rt(c) {
|
|
5643
|
+
return c === "y" ? "height" : "width";
|
|
5632
5644
|
}
|
|
5633
5645
|
const Fe = /* @__PURE__ */ new Set(["top", "bottom"]);
|
|
5634
|
-
function V(
|
|
5635
|
-
return Fe.has($(
|
|
5646
|
+
function V(c) {
|
|
5647
|
+
return Fe.has($(c)) ? "y" : "x";
|
|
5636
5648
|
}
|
|
5637
|
-
function _t(
|
|
5638
|
-
return Qt(V(
|
|
5649
|
+
function _t(c) {
|
|
5650
|
+
return Qt(V(c));
|
|
5639
5651
|
}
|
|
5640
|
-
function We(
|
|
5652
|
+
function We(c, t, e) {
|
|
5641
5653
|
e === void 0 && (e = !1);
|
|
5642
|
-
const i = et(
|
|
5654
|
+
const i = et(c), s = _t(c), o = Rt(s);
|
|
5643
5655
|
let r = s === "x" ? i === (e ? "end" : "start") ? "right" : "left" : i === "start" ? "bottom" : "top";
|
|
5644
5656
|
return t.reference[o] > t.floating[o] && (r = lt(r)), [r, lt(r)];
|
|
5645
5657
|
}
|
|
5646
|
-
function Ve(
|
|
5647
|
-
const t = lt(
|
|
5648
|
-
return [pt(
|
|
5658
|
+
function Ve(c) {
|
|
5659
|
+
const t = lt(c);
|
|
5660
|
+
return [pt(c), t, pt(t)];
|
|
5649
5661
|
}
|
|
5650
|
-
function pt(
|
|
5651
|
-
return
|
|
5662
|
+
function pt(c) {
|
|
5663
|
+
return c.replace(/start|end/g, (t) => Ke[t]);
|
|
5652
5664
|
}
|
|
5653
5665
|
const Yt = ["left", "right"], Kt = ["right", "left"], Pe = ["top", "bottom"], ze = ["bottom", "top"];
|
|
5654
|
-
function $e(
|
|
5655
|
-
switch (
|
|
5666
|
+
function $e(c, t, e) {
|
|
5667
|
+
switch (c) {
|
|
5656
5668
|
case "top":
|
|
5657
5669
|
case "bottom":
|
|
5658
5670
|
return e ? t ? Kt : Yt : t ? Yt : Kt;
|
|
@@ -5663,38 +5675,38 @@ function $e(h, t, e) {
|
|
|
5663
5675
|
return [];
|
|
5664
5676
|
}
|
|
5665
5677
|
}
|
|
5666
|
-
function Ge(
|
|
5667
|
-
const s = et(
|
|
5668
|
-
let o = $e($(
|
|
5678
|
+
function Ge(c, t, e, i) {
|
|
5679
|
+
const s = et(c);
|
|
5680
|
+
let o = $e($(c), e === "start", i);
|
|
5669
5681
|
return s && (o = o.map((r) => r + "-" + s), t && (o = o.concat(o.map(pt)))), o;
|
|
5670
5682
|
}
|
|
5671
|
-
function lt(
|
|
5672
|
-
return
|
|
5683
|
+
function lt(c) {
|
|
5684
|
+
return c.replace(/left|right|bottom|top/g, (t) => Ye[t]);
|
|
5673
5685
|
}
|
|
5674
|
-
function Ue(
|
|
5686
|
+
function Ue(c) {
|
|
5675
5687
|
return {
|
|
5676
5688
|
top: 0,
|
|
5677
5689
|
right: 0,
|
|
5678
5690
|
bottom: 0,
|
|
5679
5691
|
left: 0,
|
|
5680
|
-
...
|
|
5692
|
+
...c
|
|
5681
5693
|
};
|
|
5682
5694
|
}
|
|
5683
|
-
function te(
|
|
5684
|
-
return typeof
|
|
5685
|
-
top:
|
|
5686
|
-
right:
|
|
5687
|
-
bottom:
|
|
5688
|
-
left:
|
|
5695
|
+
function te(c) {
|
|
5696
|
+
return typeof c != "number" ? Ue(c) : {
|
|
5697
|
+
top: c,
|
|
5698
|
+
right: c,
|
|
5699
|
+
bottom: c,
|
|
5700
|
+
left: c
|
|
5689
5701
|
};
|
|
5690
5702
|
}
|
|
5691
|
-
function
|
|
5703
|
+
function ht(c) {
|
|
5692
5704
|
const {
|
|
5693
5705
|
x: t,
|
|
5694
5706
|
y: e,
|
|
5695
5707
|
width: i,
|
|
5696
5708
|
height: s
|
|
5697
|
-
} =
|
|
5709
|
+
} = c;
|
|
5698
5710
|
return {
|
|
5699
5711
|
width: i,
|
|
5700
5712
|
height: s,
|
|
@@ -5706,12 +5718,12 @@ function ct(h) {
|
|
|
5706
5718
|
y: e
|
|
5707
5719
|
};
|
|
5708
5720
|
}
|
|
5709
|
-
function Ft(
|
|
5721
|
+
function Ft(c, t, e) {
|
|
5710
5722
|
let {
|
|
5711
5723
|
reference: i,
|
|
5712
5724
|
floating: s
|
|
5713
|
-
} =
|
|
5714
|
-
const o = V(t), r = _t(t), a = Rt(r), l = $(t),
|
|
5725
|
+
} = c;
|
|
5726
|
+
const o = V(t), r = _t(t), a = Rt(r), l = $(t), h = o === "y", d = i.x + i.width / 2 - s.width / 2, f = i.y + i.height / 2 - s.height / 2, x = i[a] / 2 - s[a] / 2;
|
|
5715
5727
|
let u;
|
|
5716
5728
|
switch (l) {
|
|
5717
5729
|
case "top":
|
|
@@ -5746,38 +5758,38 @@ function Ft(h, t, e) {
|
|
|
5746
5758
|
}
|
|
5747
5759
|
switch (et(t)) {
|
|
5748
5760
|
case "start":
|
|
5749
|
-
u[r] -= x * (e &&
|
|
5761
|
+
u[r] -= x * (e && h ? -1 : 1);
|
|
5750
5762
|
break;
|
|
5751
5763
|
case "end":
|
|
5752
|
-
u[r] += x * (e &&
|
|
5764
|
+
u[r] += x * (e && h ? -1 : 1);
|
|
5753
5765
|
break;
|
|
5754
5766
|
}
|
|
5755
5767
|
return u;
|
|
5756
5768
|
}
|
|
5757
|
-
const je = async (
|
|
5769
|
+
const je = async (c, t, e) => {
|
|
5758
5770
|
const {
|
|
5759
5771
|
placement: i = "bottom",
|
|
5760
5772
|
strategy: s = "absolute",
|
|
5761
5773
|
middleware: o = [],
|
|
5762
5774
|
platform: r
|
|
5763
5775
|
} = e, a = o.filter(Boolean), l = await (r.isRTL == null ? void 0 : r.isRTL(t));
|
|
5764
|
-
let
|
|
5765
|
-
reference:
|
|
5776
|
+
let h = await r.getElementRects({
|
|
5777
|
+
reference: c,
|
|
5766
5778
|
floating: t,
|
|
5767
5779
|
strategy: s
|
|
5768
5780
|
}), {
|
|
5769
5781
|
x: d,
|
|
5770
5782
|
y: f
|
|
5771
|
-
} = Ft(
|
|
5783
|
+
} = Ft(h, i, l), x = i, u = {}, g = 0;
|
|
5772
5784
|
for (let m = 0; m < a.length; m++) {
|
|
5773
5785
|
const {
|
|
5774
5786
|
name: w,
|
|
5775
5787
|
fn: E
|
|
5776
5788
|
} = a[m], {
|
|
5777
|
-
x:
|
|
5778
|
-
y
|
|
5789
|
+
x: p,
|
|
5790
|
+
y,
|
|
5779
5791
|
data: b,
|
|
5780
|
-
reset:
|
|
5792
|
+
reset: C
|
|
5781
5793
|
} = await E({
|
|
5782
5794
|
x: d,
|
|
5783
5795
|
y: f,
|
|
@@ -5785,27 +5797,27 @@ const je = async (h, t, e) => {
|
|
|
5785
5797
|
placement: x,
|
|
5786
5798
|
strategy: s,
|
|
5787
5799
|
middlewareData: u,
|
|
5788
|
-
rects:
|
|
5800
|
+
rects: h,
|
|
5789
5801
|
platform: r,
|
|
5790
5802
|
elements: {
|
|
5791
|
-
reference:
|
|
5803
|
+
reference: c,
|
|
5792
5804
|
floating: t
|
|
5793
5805
|
}
|
|
5794
5806
|
});
|
|
5795
|
-
d =
|
|
5807
|
+
d = p ?? d, f = y ?? f, u = {
|
|
5796
5808
|
...u,
|
|
5797
5809
|
[w]: {
|
|
5798
5810
|
...u[w],
|
|
5799
5811
|
...b
|
|
5800
5812
|
}
|
|
5801
|
-
},
|
|
5802
|
-
reference:
|
|
5813
|
+
}, C && g <= 50 && (g++, typeof C == "object" && (C.placement && (x = C.placement), C.rects && (h = C.rects === !0 ? await r.getElementRects({
|
|
5814
|
+
reference: c,
|
|
5803
5815
|
floating: t,
|
|
5804
5816
|
strategy: s
|
|
5805
|
-
}) :
|
|
5817
|
+
}) : C.rects), {
|
|
5806
5818
|
x: d,
|
|
5807
5819
|
y: f
|
|
5808
|
-
} = Ft(
|
|
5820
|
+
} = Ft(h, x, l)), m = -1);
|
|
5809
5821
|
}
|
|
5810
5822
|
return {
|
|
5811
5823
|
x: d,
|
|
@@ -5815,7 +5827,7 @@ const je = async (h, t, e) => {
|
|
|
5815
5827
|
middlewareData: u
|
|
5816
5828
|
};
|
|
5817
5829
|
};
|
|
5818
|
-
async function ee(
|
|
5830
|
+
async function ee(c, t) {
|
|
5819
5831
|
var e;
|
|
5820
5832
|
t === void 0 && (t = {});
|
|
5821
5833
|
const {
|
|
@@ -5825,44 +5837,44 @@ async function ee(h, t) {
|
|
|
5825
5837
|
rects: r,
|
|
5826
5838
|
elements: a,
|
|
5827
5839
|
strategy: l
|
|
5828
|
-
} =
|
|
5829
|
-
boundary:
|
|
5840
|
+
} = c, {
|
|
5841
|
+
boundary: h = "clippingAncestors",
|
|
5830
5842
|
rootBoundary: d = "viewport",
|
|
5831
5843
|
elementContext: f = "floating",
|
|
5832
5844
|
altBoundary: x = !1,
|
|
5833
5845
|
padding: u = 0
|
|
5834
|
-
} = tt(t,
|
|
5846
|
+
} = tt(t, c), g = te(u), w = a[x ? f === "floating" ? "reference" : "floating" : f], E = ht(await o.getClippingRect({
|
|
5835
5847
|
element: (e = await (o.isElement == null ? void 0 : o.isElement(w))) == null || e ? w : w.contextElement || await (o.getDocumentElement == null ? void 0 : o.getDocumentElement(a.floating)),
|
|
5836
|
-
boundary:
|
|
5848
|
+
boundary: h,
|
|
5837
5849
|
rootBoundary: d,
|
|
5838
5850
|
strategy: l
|
|
5839
|
-
})),
|
|
5851
|
+
})), p = f === "floating" ? {
|
|
5840
5852
|
x: i,
|
|
5841
5853
|
y: s,
|
|
5842
5854
|
width: r.floating.width,
|
|
5843
5855
|
height: r.floating.height
|
|
5844
|
-
} : r.reference,
|
|
5856
|
+
} : r.reference, y = await (o.getOffsetParent == null ? void 0 : o.getOffsetParent(a.floating)), b = await (o.isElement == null ? void 0 : o.isElement(y)) ? await (o.getScale == null ? void 0 : o.getScale(y)) || {
|
|
5845
5857
|
x: 1,
|
|
5846
5858
|
y: 1
|
|
5847
5859
|
} : {
|
|
5848
5860
|
x: 1,
|
|
5849
5861
|
y: 1
|
|
5850
|
-
},
|
|
5862
|
+
}, C = ht(o.convertOffsetParentRelativeRectToViewportRelativeRect ? await o.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
5851
5863
|
elements: a,
|
|
5852
|
-
rect:
|
|
5853
|
-
offsetParent:
|
|
5864
|
+
rect: p,
|
|
5865
|
+
offsetParent: y,
|
|
5854
5866
|
strategy: l
|
|
5855
|
-
}) :
|
|
5867
|
+
}) : p);
|
|
5856
5868
|
return {
|
|
5857
|
-
top: (E.top -
|
|
5858
|
-
bottom: (
|
|
5859
|
-
left: (E.left -
|
|
5860
|
-
right: (
|
|
5869
|
+
top: (E.top - C.top + g.top) / b.y,
|
|
5870
|
+
bottom: (C.bottom - E.bottom + g.bottom) / b.y,
|
|
5871
|
+
left: (E.left - C.left + g.left) / b.x,
|
|
5872
|
+
right: (C.right - E.right + g.right) / b.x
|
|
5861
5873
|
};
|
|
5862
5874
|
}
|
|
5863
|
-
const qe = (
|
|
5875
|
+
const qe = (c) => ({
|
|
5864
5876
|
name: "arrow",
|
|
5865
|
-
options:
|
|
5877
|
+
options: c,
|
|
5866
5878
|
async fn(t) {
|
|
5867
5879
|
const {
|
|
5868
5880
|
x: e,
|
|
@@ -5873,18 +5885,18 @@ const qe = (h) => ({
|
|
|
5873
5885
|
elements: a,
|
|
5874
5886
|
middlewareData: l
|
|
5875
5887
|
} = t, {
|
|
5876
|
-
element:
|
|
5888
|
+
element: h,
|
|
5877
5889
|
padding: d = 0
|
|
5878
|
-
} = tt(
|
|
5879
|
-
if (
|
|
5890
|
+
} = tt(c, t) || {};
|
|
5891
|
+
if (h == null)
|
|
5880
5892
|
return {};
|
|
5881
5893
|
const f = te(d), x = {
|
|
5882
5894
|
x: e,
|
|
5883
5895
|
y: i
|
|
5884
|
-
}, u = _t(s), g = Rt(u), m = await r.getDimensions(
|
|
5885
|
-
let S = R ? R[
|
|
5886
|
-
(!S || !await (r.isElement == null ? void 0 : r.isElement(R))) && (S = a.floating[
|
|
5887
|
-
const O = b / 2 -
|
|
5896
|
+
}, u = _t(s), g = Rt(u), m = await r.getDimensions(h), w = u === "y", E = w ? "top" : "left", p = w ? "bottom" : "right", y = w ? "clientHeight" : "clientWidth", b = o.reference[g] + o.reference[u] - x[u] - o.floating[g], C = x[u] - o.reference[u], R = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(h));
|
|
5897
|
+
let S = R ? R[y] : 0;
|
|
5898
|
+
(!S || !await (r.isElement == null ? void 0 : r.isElement(R))) && (S = a.floating[y] || o.floating[g]);
|
|
5899
|
+
const O = b / 2 - C / 2, v = S / 2 - m[g] / 2 - 1, I = j(f[E], v), _ = j(f[p], v), T = I, M = S - m[g] - _, L = S / 2 - m[g] / 2 + O, A = Et(T, L, M), H = !l.arrow && et(s) != null && L !== A && o.reference[g] / 2 - (L < T ? I : _) - m[g] / 2 < 0, D = H ? L < T ? L - T : L - M : 0;
|
|
5888
5900
|
return {
|
|
5889
5901
|
[u]: x[u] + D,
|
|
5890
5902
|
data: {
|
|
@@ -5897,10 +5909,10 @@ const qe = (h) => ({
|
|
|
5897
5909
|
reset: H
|
|
5898
5910
|
};
|
|
5899
5911
|
}
|
|
5900
|
-
}), Ze = function(
|
|
5901
|
-
return
|
|
5912
|
+
}), Ze = function(c) {
|
|
5913
|
+
return c === void 0 && (c = {}), {
|
|
5902
5914
|
name: "flip",
|
|
5903
|
-
options:
|
|
5915
|
+
options: c,
|
|
5904
5916
|
async fn(t) {
|
|
5905
5917
|
var e, i;
|
|
5906
5918
|
const {
|
|
@@ -5909,7 +5921,7 @@ const qe = (h) => ({
|
|
|
5909
5921
|
rects: r,
|
|
5910
5922
|
initialPlacement: a,
|
|
5911
5923
|
platform: l,
|
|
5912
|
-
elements:
|
|
5924
|
+
elements: h
|
|
5913
5925
|
} = t, {
|
|
5914
5926
|
mainAxis: d = !0,
|
|
5915
5927
|
crossAxis: f = !0,
|
|
@@ -5918,12 +5930,12 @@ const qe = (h) => ({
|
|
|
5918
5930
|
fallbackAxisSideDirection: g = "none",
|
|
5919
5931
|
flipAlignment: m = !0,
|
|
5920
5932
|
...w
|
|
5921
|
-
} = tt(
|
|
5933
|
+
} = tt(c, t);
|
|
5922
5934
|
if ((e = o.arrow) != null && e.alignmentOffset)
|
|
5923
5935
|
return {};
|
|
5924
|
-
const E = $(s),
|
|
5925
|
-
!x && R &&
|
|
5926
|
-
const S = [a, ...
|
|
5936
|
+
const E = $(s), p = V(a), y = $(a) === a, b = await (l.isRTL == null ? void 0 : l.isRTL(h.floating)), C = x || (y || !m ? [lt(a)] : Ve(a)), R = g !== "none";
|
|
5937
|
+
!x && R && C.push(...Ge(a, m, g, b));
|
|
5938
|
+
const S = [a, ...C], O = await ee(t, w), v = [];
|
|
5927
5939
|
let I = ((i = o.flip) == null ? void 0 : i.overflows) || [];
|
|
5928
5940
|
if (d && v.push(O[E]), f) {
|
|
5929
5941
|
const L = We(s, r, b);
|
|
@@ -5935,9 +5947,9 @@ const qe = (h) => ({
|
|
|
5935
5947
|
}], !v.every((L) => L <= 0)) {
|
|
5936
5948
|
var _, T;
|
|
5937
5949
|
const L = (((_ = o.flip) == null ? void 0 : _.index) || 0) + 1, A = S[L];
|
|
5938
|
-
if (A && (!(f === "alignment" ?
|
|
5950
|
+
if (A && (!(f === "alignment" ? p !== V(A) : !1) || // We leave the current main axis only if every placement on that axis
|
|
5939
5951
|
// overflows the main axis.
|
|
5940
|
-
I.every((k) => V(k.placement) ===
|
|
5952
|
+
I.every((k) => V(k.placement) === p ? k.overflows[0] > 0 : !0)))
|
|
5941
5953
|
return {
|
|
5942
5954
|
data: {
|
|
5943
5955
|
index: L,
|
|
@@ -5955,12 +5967,12 @@ const qe = (h) => ({
|
|
|
5955
5967
|
const D = (M = I.filter((k) => {
|
|
5956
5968
|
if (R) {
|
|
5957
5969
|
const W = V(k.placement);
|
|
5958
|
-
return W ===
|
|
5970
|
+
return W === p || // Create a bias to the `y` side axis due to horizontal
|
|
5959
5971
|
// reading directions favoring greater width.
|
|
5960
5972
|
W === "y";
|
|
5961
5973
|
}
|
|
5962
5974
|
return !0;
|
|
5963
|
-
}).map((k) => [k.placement, k.overflows.filter((W) => W > 0).reduce((W,
|
|
5975
|
+
}).map((k) => [k.placement, k.overflows.filter((W) => W > 0).reduce((W, ce) => W + ce, 0)]).sort((k, W) => k[1] - W[1])[0]) == null ? void 0 : M[0];
|
|
5964
5976
|
D && (H = D);
|
|
5965
5977
|
break;
|
|
5966
5978
|
}
|
|
@@ -5979,12 +5991,12 @@ const qe = (h) => ({
|
|
|
5979
5991
|
}
|
|
5980
5992
|
};
|
|
5981
5993
|
}, Je = /* @__PURE__ */ new Set(["left", "top"]);
|
|
5982
|
-
async function Qe(
|
|
5994
|
+
async function Qe(c, t) {
|
|
5983
5995
|
const {
|
|
5984
5996
|
placement: e,
|
|
5985
5997
|
platform: i,
|
|
5986
5998
|
elements: s
|
|
5987
|
-
} =
|
|
5999
|
+
} = c, o = await (i.isRTL == null ? void 0 : i.isRTL(s.floating)), r = $(e), a = et(e), l = V(e) === "y", h = Je.has(r) ? -1 : 1, d = o && l ? -1 : 1, f = tt(t, c);
|
|
5988
6000
|
let {
|
|
5989
6001
|
mainAxis: x,
|
|
5990
6002
|
crossAxis: u,
|
|
@@ -6000,16 +6012,16 @@ async function Qe(h, t) {
|
|
|
6000
6012
|
};
|
|
6001
6013
|
return a && typeof g == "number" && (u = a === "end" ? g * -1 : g), l ? {
|
|
6002
6014
|
x: u * d,
|
|
6003
|
-
y: x *
|
|
6015
|
+
y: x * h
|
|
6004
6016
|
} : {
|
|
6005
|
-
x: x *
|
|
6017
|
+
x: x * h,
|
|
6006
6018
|
y: u * d
|
|
6007
6019
|
};
|
|
6008
6020
|
}
|
|
6009
|
-
const ti = function(
|
|
6010
|
-
return
|
|
6021
|
+
const ti = function(c) {
|
|
6022
|
+
return c === void 0 && (c = 0), {
|
|
6011
6023
|
name: "offset",
|
|
6012
|
-
options:
|
|
6024
|
+
options: c,
|
|
6013
6025
|
async fn(t) {
|
|
6014
6026
|
var e, i;
|
|
6015
6027
|
const {
|
|
@@ -6017,7 +6029,7 @@ const ti = function(h) {
|
|
|
6017
6029
|
y: o,
|
|
6018
6030
|
placement: r,
|
|
6019
6031
|
middlewareData: a
|
|
6020
|
-
} = t, l = await Qe(t,
|
|
6032
|
+
} = t, l = await Qe(t, c);
|
|
6021
6033
|
return r === ((e = a.offset) == null ? void 0 : e.placement) && (i = a.arrow) != null && i.alignmentOffset ? {} : {
|
|
6022
6034
|
x: s + l.x,
|
|
6023
6035
|
y: o + l.y,
|
|
@@ -6028,10 +6040,10 @@ const ti = function(h) {
|
|
|
6028
6040
|
};
|
|
6029
6041
|
}
|
|
6030
6042
|
};
|
|
6031
|
-
}, ei = function(
|
|
6032
|
-
return
|
|
6043
|
+
}, ei = function(c) {
|
|
6044
|
+
return c === void 0 && (c = {}), {
|
|
6033
6045
|
name: "shift",
|
|
6034
|
-
options:
|
|
6046
|
+
options: c,
|
|
6035
6047
|
async fn(t) {
|
|
6036
6048
|
const {
|
|
6037
6049
|
x: e,
|
|
@@ -6044,27 +6056,27 @@ const ti = function(h) {
|
|
|
6044
6056
|
fn: (w) => {
|
|
6045
6057
|
let {
|
|
6046
6058
|
x: E,
|
|
6047
|
-
y:
|
|
6059
|
+
y: p
|
|
6048
6060
|
} = w;
|
|
6049
6061
|
return {
|
|
6050
6062
|
x: E,
|
|
6051
|
-
y:
|
|
6063
|
+
y: p
|
|
6052
6064
|
};
|
|
6053
6065
|
}
|
|
6054
6066
|
},
|
|
6055
6067
|
...l
|
|
6056
|
-
} = tt(
|
|
6068
|
+
} = tt(c, t), h = {
|
|
6057
6069
|
x: e,
|
|
6058
6070
|
y: i
|
|
6059
6071
|
}, d = await ee(t, l), f = V($(s)), x = Qt(f);
|
|
6060
|
-
let u =
|
|
6072
|
+
let u = h[x], g = h[f];
|
|
6061
6073
|
if (o) {
|
|
6062
|
-
const w = x === "y" ? "top" : "left", E = x === "y" ? "bottom" : "right",
|
|
6063
|
-
u = Et(
|
|
6074
|
+
const w = x === "y" ? "top" : "left", E = x === "y" ? "bottom" : "right", p = u + d[w], y = u - d[E];
|
|
6075
|
+
u = Et(p, u, y);
|
|
6064
6076
|
}
|
|
6065
6077
|
if (r) {
|
|
6066
|
-
const w = f === "y" ? "top" : "left", E = f === "y" ? "bottom" : "right",
|
|
6067
|
-
g = Et(
|
|
6078
|
+
const w = f === "y" ? "top" : "left", E = f === "y" ? "bottom" : "right", p = g + d[w], y = g - d[E];
|
|
6079
|
+
g = Et(p, g, y);
|
|
6068
6080
|
}
|
|
6069
6081
|
const m = a.fn({
|
|
6070
6082
|
...t,
|
|
@@ -6088,60 +6100,60 @@ const ti = function(h) {
|
|
|
6088
6100
|
function ut() {
|
|
6089
6101
|
return typeof window < "u";
|
|
6090
6102
|
}
|
|
6091
|
-
function Z(
|
|
6092
|
-
return ie(
|
|
6103
|
+
function Z(c) {
|
|
6104
|
+
return ie(c) ? (c.nodeName || "").toLowerCase() : "#document";
|
|
6093
6105
|
}
|
|
6094
|
-
function N(
|
|
6106
|
+
function N(c) {
|
|
6095
6107
|
var t;
|
|
6096
|
-
return (
|
|
6108
|
+
return (c == null || (t = c.ownerDocument) == null ? void 0 : t.defaultView) || window;
|
|
6097
6109
|
}
|
|
6098
|
-
function F(
|
|
6110
|
+
function F(c) {
|
|
6099
6111
|
var t;
|
|
6100
|
-
return (t = (ie(
|
|
6112
|
+
return (t = (ie(c) ? c.ownerDocument : c.document) || window.document) == null ? void 0 : t.documentElement;
|
|
6101
6113
|
}
|
|
6102
|
-
function ie(
|
|
6103
|
-
return ut() ?
|
|
6114
|
+
function ie(c) {
|
|
6115
|
+
return ut() ? c instanceof Node || c instanceof N(c).Node : !1;
|
|
6104
6116
|
}
|
|
6105
|
-
function B(
|
|
6106
|
-
return ut() ?
|
|
6117
|
+
function B(c) {
|
|
6118
|
+
return ut() ? c instanceof Element || c instanceof N(c).Element : !1;
|
|
6107
6119
|
}
|
|
6108
|
-
function K(
|
|
6109
|
-
return ut() ?
|
|
6120
|
+
function K(c) {
|
|
6121
|
+
return ut() ? c instanceof HTMLElement || c instanceof N(c).HTMLElement : !1;
|
|
6110
6122
|
}
|
|
6111
|
-
function Wt(
|
|
6112
|
-
return !ut() || typeof ShadowRoot > "u" ? !1 :
|
|
6123
|
+
function Wt(c) {
|
|
6124
|
+
return !ut() || typeof ShadowRoot > "u" ? !1 : c instanceof ShadowRoot || c instanceof N(c).ShadowRoot;
|
|
6113
6125
|
}
|
|
6114
6126
|
const ii = /* @__PURE__ */ new Set(["inline", "contents"]);
|
|
6115
|
-
function it(
|
|
6127
|
+
function it(c) {
|
|
6116
6128
|
const {
|
|
6117
6129
|
overflow: t,
|
|
6118
6130
|
overflowX: e,
|
|
6119
6131
|
overflowY: i,
|
|
6120
6132
|
display: s
|
|
6121
|
-
} = X(
|
|
6133
|
+
} = X(c);
|
|
6122
6134
|
return /auto|scroll|overlay|hidden|clip/.test(t + i + e) && !ii.has(s);
|
|
6123
6135
|
}
|
|
6124
6136
|
const si = /* @__PURE__ */ new Set(["table", "td", "th"]);
|
|
6125
|
-
function oi(
|
|
6126
|
-
return si.has(Z(
|
|
6137
|
+
function oi(c) {
|
|
6138
|
+
return si.has(Z(c));
|
|
6127
6139
|
}
|
|
6128
6140
|
const ri = [":popover-open", ":modal"];
|
|
6129
|
-
function xt(
|
|
6141
|
+
function xt(c) {
|
|
6130
6142
|
return ri.some((t) => {
|
|
6131
6143
|
try {
|
|
6132
|
-
return
|
|
6144
|
+
return c.matches(t);
|
|
6133
6145
|
} catch {
|
|
6134
6146
|
return !1;
|
|
6135
6147
|
}
|
|
6136
6148
|
});
|
|
6137
6149
|
}
|
|
6138
6150
|
const ni = ["transform", "translate", "scale", "rotate", "perspective"], ai = ["transform", "translate", "scale", "rotate", "perspective", "filter"], li = ["paint", "layout", "strict", "content"];
|
|
6139
|
-
function St(
|
|
6140
|
-
const t = Tt(), e = B(
|
|
6151
|
+
function St(c) {
|
|
6152
|
+
const t = Tt(), e = B(c) ? X(c) : c;
|
|
6141
6153
|
return ni.some((i) => e[i] ? e[i] !== "none" : !1) || (e.containerType ? e.containerType !== "normal" : !1) || !t && (e.backdropFilter ? e.backdropFilter !== "none" : !1) || !t && (e.filter ? e.filter !== "none" : !1) || ai.some((i) => (e.willChange || "").includes(i)) || li.some((i) => (e.contain || "").includes(i));
|
|
6142
6154
|
}
|
|
6143
|
-
function
|
|
6144
|
-
let t = P(
|
|
6155
|
+
function hi(c) {
|
|
6156
|
+
let t = P(c);
|
|
6145
6157
|
for (; K(t) && !q(t); ) {
|
|
6146
6158
|
if (St(t))
|
|
6147
6159
|
return t;
|
|
@@ -6154,66 +6166,66 @@ function ci(h) {
|
|
|
6154
6166
|
function Tt() {
|
|
6155
6167
|
return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
|
|
6156
6168
|
}
|
|
6157
|
-
const
|
|
6158
|
-
function q(
|
|
6159
|
-
return
|
|
6169
|
+
const ci = /* @__PURE__ */ new Set(["html", "body", "#document"]);
|
|
6170
|
+
function q(c) {
|
|
6171
|
+
return ci.has(Z(c));
|
|
6160
6172
|
}
|
|
6161
|
-
function X(
|
|
6162
|
-
return N(
|
|
6173
|
+
function X(c) {
|
|
6174
|
+
return N(c).getComputedStyle(c);
|
|
6163
6175
|
}
|
|
6164
|
-
function gt(
|
|
6165
|
-
return B(
|
|
6166
|
-
scrollLeft:
|
|
6167
|
-
scrollTop:
|
|
6176
|
+
function gt(c) {
|
|
6177
|
+
return B(c) ? {
|
|
6178
|
+
scrollLeft: c.scrollLeft,
|
|
6179
|
+
scrollTop: c.scrollTop
|
|
6168
6180
|
} : {
|
|
6169
|
-
scrollLeft:
|
|
6170
|
-
scrollTop:
|
|
6181
|
+
scrollLeft: c.scrollX,
|
|
6182
|
+
scrollTop: c.scrollY
|
|
6171
6183
|
};
|
|
6172
6184
|
}
|
|
6173
|
-
function P(
|
|
6174
|
-
if (Z(
|
|
6175
|
-
return
|
|
6185
|
+
function P(c) {
|
|
6186
|
+
if (Z(c) === "html")
|
|
6187
|
+
return c;
|
|
6176
6188
|
const t = (
|
|
6177
6189
|
// Step into the shadow DOM of the parent of a slotted node.
|
|
6178
|
-
|
|
6179
|
-
|
|
6180
|
-
Wt(
|
|
6181
|
-
F(
|
|
6190
|
+
c.assignedSlot || // DOM Element detected.
|
|
6191
|
+
c.parentNode || // ShadowRoot detected.
|
|
6192
|
+
Wt(c) && c.host || // Fallback.
|
|
6193
|
+
F(c)
|
|
6182
6194
|
);
|
|
6183
6195
|
return Wt(t) ? t.host : t;
|
|
6184
6196
|
}
|
|
6185
|
-
function se(
|
|
6186
|
-
const t = P(
|
|
6187
|
-
return q(t) ?
|
|
6197
|
+
function se(c) {
|
|
6198
|
+
const t = P(c);
|
|
6199
|
+
return q(t) ? c.ownerDocument ? c.ownerDocument.body : c.body : K(t) && it(t) ? t : se(t);
|
|
6188
6200
|
}
|
|
6189
|
-
function Q(
|
|
6201
|
+
function Q(c, t, e) {
|
|
6190
6202
|
var i;
|
|
6191
6203
|
t === void 0 && (t = []), e === void 0 && (e = !0);
|
|
6192
|
-
const s = se(
|
|
6204
|
+
const s = se(c), o = s === ((i = c.ownerDocument) == null ? void 0 : i.body), r = N(s);
|
|
6193
6205
|
if (o) {
|
|
6194
|
-
const a =
|
|
6206
|
+
const a = yt(r);
|
|
6195
6207
|
return t.concat(r, r.visualViewport || [], it(s) ? s : [], a && e ? Q(a) : []);
|
|
6196
6208
|
}
|
|
6197
6209
|
return t.concat(s, Q(s, [], e));
|
|
6198
6210
|
}
|
|
6199
|
-
function
|
|
6200
|
-
return
|
|
6211
|
+
function yt(c) {
|
|
6212
|
+
return c.parent && Object.getPrototypeOf(c.parent) ? c.frameElement : null;
|
|
6201
6213
|
}
|
|
6202
|
-
function oe(
|
|
6203
|
-
const t = X(
|
|
6214
|
+
function oe(c) {
|
|
6215
|
+
const t = X(c);
|
|
6204
6216
|
let e = parseFloat(t.width) || 0, i = parseFloat(t.height) || 0;
|
|
6205
|
-
const s = K(
|
|
6217
|
+
const s = K(c), o = s ? c.offsetWidth : e, r = s ? c.offsetHeight : i, a = at(e) !== o || at(i) !== r;
|
|
6206
6218
|
return a && (e = o, i = r), {
|
|
6207
6219
|
width: e,
|
|
6208
6220
|
height: i,
|
|
6209
6221
|
$: a
|
|
6210
6222
|
};
|
|
6211
6223
|
}
|
|
6212
|
-
function Ot(
|
|
6213
|
-
return B(
|
|
6224
|
+
function Ot(c) {
|
|
6225
|
+
return B(c) ? c : c.contextElement;
|
|
6214
6226
|
}
|
|
6215
|
-
function U(
|
|
6216
|
-
const t = Ot(
|
|
6227
|
+
function U(c) {
|
|
6228
|
+
const t = Ot(c);
|
|
6217
6229
|
if (!K(t))
|
|
6218
6230
|
return Y(1);
|
|
6219
6231
|
const e = t.getBoundingClientRect(), {
|
|
@@ -6228,86 +6240,86 @@ function U(h) {
|
|
|
6228
6240
|
};
|
|
6229
6241
|
}
|
|
6230
6242
|
const di = /* @__PURE__ */ Y(0);
|
|
6231
|
-
function re(
|
|
6232
|
-
const t = N(
|
|
6243
|
+
function re(c) {
|
|
6244
|
+
const t = N(c);
|
|
6233
6245
|
return !Tt() || !t.visualViewport ? di : {
|
|
6234
6246
|
x: t.visualViewport.offsetLeft,
|
|
6235
6247
|
y: t.visualViewport.offsetTop
|
|
6236
6248
|
};
|
|
6237
6249
|
}
|
|
6238
|
-
function fi(
|
|
6239
|
-
return t === void 0 && (t = !1), !e || t && e !== N(
|
|
6250
|
+
function fi(c, t, e) {
|
|
6251
|
+
return t === void 0 && (t = !1), !e || t && e !== N(c) ? !1 : t;
|
|
6240
6252
|
}
|
|
6241
|
-
function G(
|
|
6253
|
+
function G(c, t, e, i) {
|
|
6242
6254
|
t === void 0 && (t = !1), e === void 0 && (e = !1);
|
|
6243
|
-
const s =
|
|
6255
|
+
const s = c.getBoundingClientRect(), o = Ot(c);
|
|
6244
6256
|
let r = Y(1);
|
|
6245
|
-
t && (i ? B(i) && (r = U(i)) : r = U(
|
|
6257
|
+
t && (i ? B(i) && (r = U(i)) : r = U(c));
|
|
6246
6258
|
const a = fi(o, e, i) ? re(o) : Y(0);
|
|
6247
|
-
let l = (s.left + a.x) / r.x,
|
|
6259
|
+
let l = (s.left + a.x) / r.x, h = (s.top + a.y) / r.y, d = s.width / r.x, f = s.height / r.y;
|
|
6248
6260
|
if (o) {
|
|
6249
6261
|
const x = N(o), u = i && B(i) ? N(i) : i;
|
|
6250
|
-
let g = x, m =
|
|
6262
|
+
let g = x, m = yt(g);
|
|
6251
6263
|
for (; m && i && u !== g; ) {
|
|
6252
|
-
const w = U(m), E = m.getBoundingClientRect(),
|
|
6253
|
-
l *= w.x,
|
|
6264
|
+
const w = U(m), E = m.getBoundingClientRect(), p = X(m), y = E.left + (m.clientLeft + parseFloat(p.paddingLeft)) * w.x, b = E.top + (m.clientTop + parseFloat(p.paddingTop)) * w.y;
|
|
6265
|
+
l *= w.x, h *= w.y, d *= w.x, f *= w.y, l += y, h += b, g = N(m), m = yt(g);
|
|
6254
6266
|
}
|
|
6255
6267
|
}
|
|
6256
|
-
return
|
|
6268
|
+
return ht({
|
|
6257
6269
|
width: d,
|
|
6258
6270
|
height: f,
|
|
6259
6271
|
x: l,
|
|
6260
|
-
y:
|
|
6272
|
+
y: h
|
|
6261
6273
|
});
|
|
6262
6274
|
}
|
|
6263
|
-
function Lt(
|
|
6264
|
-
const e = gt(
|
|
6265
|
-
return t ? t.left + e : G(F(
|
|
6275
|
+
function Lt(c, t) {
|
|
6276
|
+
const e = gt(c).scrollLeft;
|
|
6277
|
+
return t ? t.left + e : G(F(c)).left + e;
|
|
6266
6278
|
}
|
|
6267
|
-
function ne(
|
|
6279
|
+
function ne(c, t, e) {
|
|
6268
6280
|
e === void 0 && (e = !1);
|
|
6269
|
-
const i =
|
|
6281
|
+
const i = c.getBoundingClientRect(), s = i.left + t.scrollLeft - (e ? 0 : (
|
|
6270
6282
|
// RTL <body> scrollbar.
|
|
6271
|
-
Lt(
|
|
6283
|
+
Lt(c, i)
|
|
6272
6284
|
)), o = i.top + t.scrollTop;
|
|
6273
6285
|
return {
|
|
6274
6286
|
x: s,
|
|
6275
6287
|
y: o
|
|
6276
6288
|
};
|
|
6277
6289
|
}
|
|
6278
|
-
function ui(
|
|
6290
|
+
function ui(c) {
|
|
6279
6291
|
let {
|
|
6280
6292
|
elements: t,
|
|
6281
6293
|
rect: e,
|
|
6282
6294
|
offsetParent: i,
|
|
6283
6295
|
strategy: s
|
|
6284
|
-
} =
|
|
6296
|
+
} = c;
|
|
6285
6297
|
const o = s === "fixed", r = F(i), a = t ? xt(t.floating) : !1;
|
|
6286
6298
|
if (i === r || a && o)
|
|
6287
6299
|
return e;
|
|
6288
6300
|
let l = {
|
|
6289
6301
|
scrollLeft: 0,
|
|
6290
6302
|
scrollTop: 0
|
|
6291
|
-
},
|
|
6303
|
+
}, h = Y(1);
|
|
6292
6304
|
const d = Y(0), f = K(i);
|
|
6293
6305
|
if ((f || !f && !o) && ((Z(i) !== "body" || it(r)) && (l = gt(i)), K(i))) {
|
|
6294
6306
|
const u = G(i);
|
|
6295
|
-
|
|
6307
|
+
h = U(i), d.x = u.x + i.clientLeft, d.y = u.y + i.clientTop;
|
|
6296
6308
|
}
|
|
6297
6309
|
const x = r && !f && !o ? ne(r, l, !0) : Y(0);
|
|
6298
6310
|
return {
|
|
6299
|
-
width: e.width *
|
|
6300
|
-
height: e.height *
|
|
6301
|
-
x: e.x *
|
|
6302
|
-
y: e.y *
|
|
6311
|
+
width: e.width * h.x,
|
|
6312
|
+
height: e.height * h.y,
|
|
6313
|
+
x: e.x * h.x - l.scrollLeft * h.x + d.x + x.x,
|
|
6314
|
+
y: e.y * h.y - l.scrollTop * h.y + d.y + x.y
|
|
6303
6315
|
};
|
|
6304
6316
|
}
|
|
6305
|
-
function xi(
|
|
6306
|
-
return Array.from(
|
|
6317
|
+
function xi(c) {
|
|
6318
|
+
return Array.from(c.getClientRects());
|
|
6307
6319
|
}
|
|
6308
|
-
function gi(
|
|
6309
|
-
const t = F(
|
|
6310
|
-
let r = -e.scrollLeft + Lt(
|
|
6320
|
+
function gi(c) {
|
|
6321
|
+
const t = F(c), e = gt(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);
|
|
6322
|
+
let r = -e.scrollLeft + Lt(c);
|
|
6311
6323
|
const a = -e.scrollTop;
|
|
6312
6324
|
return X(i).direction === "rtl" && (r += z(t.clientWidth, i.clientWidth) - s), {
|
|
6313
6325
|
width: s,
|
|
@@ -6316,13 +6328,13 @@ function gi(h) {
|
|
|
6316
6328
|
y: a
|
|
6317
6329
|
};
|
|
6318
6330
|
}
|
|
6319
|
-
function wi(
|
|
6320
|
-
const e = N(
|
|
6331
|
+
function wi(c, t) {
|
|
6332
|
+
const e = N(c), i = F(c), s = e.visualViewport;
|
|
6321
6333
|
let o = i.clientWidth, r = i.clientHeight, a = 0, l = 0;
|
|
6322
6334
|
if (s) {
|
|
6323
6335
|
o = s.width, r = s.height;
|
|
6324
|
-
const
|
|
6325
|
-
(!
|
|
6336
|
+
const h = Tt();
|
|
6337
|
+
(!h || h && t === "fixed") && (a = s.offsetLeft, l = s.offsetTop);
|
|
6326
6338
|
}
|
|
6327
6339
|
return {
|
|
6328
6340
|
width: o,
|
|
@@ -6332,25 +6344,25 @@ function wi(h, t) {
|
|
|
6332
6344
|
};
|
|
6333
6345
|
}
|
|
6334
6346
|
const mi = /* @__PURE__ */ new Set(["absolute", "fixed"]);
|
|
6335
|
-
function Ei(
|
|
6336
|
-
const e = G(
|
|
6347
|
+
function Ei(c, t) {
|
|
6348
|
+
const e = G(c, !0, t === "fixed"), i = e.top + c.clientTop, s = e.left + c.clientLeft, o = K(c) ? U(c) : Y(1), r = c.clientWidth * o.x, a = c.clientHeight * o.y, l = s * o.x, h = i * o.y;
|
|
6337
6349
|
return {
|
|
6338
6350
|
width: r,
|
|
6339
6351
|
height: a,
|
|
6340
6352
|
x: l,
|
|
6341
|
-
y:
|
|
6353
|
+
y: h
|
|
6342
6354
|
};
|
|
6343
6355
|
}
|
|
6344
|
-
function Vt(
|
|
6356
|
+
function Vt(c, t, e) {
|
|
6345
6357
|
let i;
|
|
6346
6358
|
if (t === "viewport")
|
|
6347
|
-
i = wi(
|
|
6359
|
+
i = wi(c, e);
|
|
6348
6360
|
else if (t === "document")
|
|
6349
|
-
i = gi(F(
|
|
6361
|
+
i = gi(F(c));
|
|
6350
6362
|
else if (B(t))
|
|
6351
6363
|
i = Ei(t, e);
|
|
6352
6364
|
else {
|
|
6353
|
-
const s = re(
|
|
6365
|
+
const s = re(c);
|
|
6354
6366
|
i = {
|
|
6355
6367
|
x: t.x - s.x,
|
|
6356
6368
|
y: t.y - s.y,
|
|
@@ -6358,35 +6370,35 @@ function Vt(h, t, e) {
|
|
|
6358
6370
|
height: t.height
|
|
6359
6371
|
};
|
|
6360
6372
|
}
|
|
6361
|
-
return
|
|
6373
|
+
return ht(i);
|
|
6362
6374
|
}
|
|
6363
|
-
function ae(
|
|
6364
|
-
const e = P(
|
|
6375
|
+
function ae(c, t) {
|
|
6376
|
+
const e = P(c);
|
|
6365
6377
|
return e === t || !B(e) || q(e) ? !1 : X(e).position === "fixed" || ae(e, t);
|
|
6366
6378
|
}
|
|
6367
|
-
function pi(
|
|
6368
|
-
const e = t.get(
|
|
6379
|
+
function pi(c, t) {
|
|
6380
|
+
const e = t.get(c);
|
|
6369
6381
|
if (e)
|
|
6370
6382
|
return e;
|
|
6371
|
-
let i = Q(
|
|
6372
|
-
const o = X(
|
|
6373
|
-
let r = o ? P(
|
|
6383
|
+
let i = Q(c, [], !1).filter((a) => B(a) && Z(a) !== "body"), s = null;
|
|
6384
|
+
const o = X(c).position === "fixed";
|
|
6385
|
+
let r = o ? P(c) : c;
|
|
6374
6386
|
for (; B(r) && !q(r); ) {
|
|
6375
6387
|
const a = X(r), l = St(r);
|
|
6376
|
-
!l && a.position === "fixed" && (s = null), (o ? !l && !s : !l && a.position === "static" && !!s && mi.has(s.position) || it(r) && !l && ae(
|
|
6388
|
+
!l && a.position === "fixed" && (s = null), (o ? !l && !s : !l && a.position === "static" && !!s && mi.has(s.position) || it(r) && !l && ae(c, r)) ? i = i.filter((d) => d !== r) : s = a, r = P(r);
|
|
6377
6389
|
}
|
|
6378
|
-
return t.set(
|
|
6390
|
+
return t.set(c, i), i;
|
|
6379
6391
|
}
|
|
6380
|
-
function
|
|
6392
|
+
function yi(c) {
|
|
6381
6393
|
let {
|
|
6382
6394
|
element: t,
|
|
6383
6395
|
boundary: e,
|
|
6384
6396
|
rootBoundary: i,
|
|
6385
6397
|
strategy: s
|
|
6386
|
-
} =
|
|
6387
|
-
const r = [...e === "clippingAncestors" ? xt(t) ? [] : pi(t, this._c) : [].concat(e), i], a = r[0], l = r.reduce((
|
|
6398
|
+
} = c;
|
|
6399
|
+
const r = [...e === "clippingAncestors" ? xt(t) ? [] : pi(t, this._c) : [].concat(e), i], a = r[0], l = r.reduce((h, d) => {
|
|
6388
6400
|
const f = Vt(t, d, s);
|
|
6389
|
-
return
|
|
6401
|
+
return h.top = z(f.top, h.top), h.right = j(f.right, h.right), h.bottom = j(f.bottom, h.bottom), h.left = z(f.left, h.left), h;
|
|
6390
6402
|
}, Vt(t, a, s));
|
|
6391
6403
|
return {
|
|
6392
6404
|
width: l.right - l.left,
|
|
@@ -6395,32 +6407,32 @@ function Ci(h) {
|
|
|
6395
6407
|
y: l.top
|
|
6396
6408
|
};
|
|
6397
6409
|
}
|
|
6398
|
-
function
|
|
6410
|
+
function Ci(c) {
|
|
6399
6411
|
const {
|
|
6400
6412
|
width: t,
|
|
6401
6413
|
height: e
|
|
6402
|
-
} = oe(
|
|
6414
|
+
} = oe(c);
|
|
6403
6415
|
return {
|
|
6404
6416
|
width: t,
|
|
6405
6417
|
height: e
|
|
6406
6418
|
};
|
|
6407
6419
|
}
|
|
6408
|
-
function bi(
|
|
6409
|
-
const i = K(t), s = F(t), o = e === "fixed", r = G(
|
|
6420
|
+
function bi(c, t, e) {
|
|
6421
|
+
const i = K(t), s = F(t), o = e === "fixed", r = G(c, !0, o, t);
|
|
6410
6422
|
let a = {
|
|
6411
6423
|
scrollLeft: 0,
|
|
6412
6424
|
scrollTop: 0
|
|
6413
6425
|
};
|
|
6414
6426
|
const l = Y(0);
|
|
6415
|
-
function
|
|
6427
|
+
function h() {
|
|
6416
6428
|
l.x = Lt(s);
|
|
6417
6429
|
}
|
|
6418
6430
|
if (i || !i && !o)
|
|
6419
6431
|
if ((Z(t) !== "body" || it(s)) && (a = gt(t)), i) {
|
|
6420
6432
|
const u = G(t, !0, o, t);
|
|
6421
6433
|
l.x = u.x + t.clientLeft, l.y = u.y + t.clientTop;
|
|
6422
|
-
} else s &&
|
|
6423
|
-
o && !i && s &&
|
|
6434
|
+
} else s && h();
|
|
6435
|
+
o && !i && s && h();
|
|
6424
6436
|
const d = s && !i && !o ? ne(s, a) : Y(0), f = r.left + a.scrollLeft - l.x - d.x, x = r.top + a.scrollTop - l.y - d.y;
|
|
6425
6437
|
return {
|
|
6426
6438
|
x: f,
|
|
@@ -6429,23 +6441,23 @@ function bi(h, t, e) {
|
|
|
6429
6441
|
height: r.height
|
|
6430
6442
|
};
|
|
6431
6443
|
}
|
|
6432
|
-
function wt(
|
|
6433
|
-
return X(
|
|
6444
|
+
function wt(c) {
|
|
6445
|
+
return X(c).position === "static";
|
|
6434
6446
|
}
|
|
6435
|
-
function Pt(
|
|
6436
|
-
if (!K(
|
|
6447
|
+
function Pt(c, t) {
|
|
6448
|
+
if (!K(c) || X(c).position === "fixed")
|
|
6437
6449
|
return null;
|
|
6438
6450
|
if (t)
|
|
6439
|
-
return t(
|
|
6440
|
-
let e =
|
|
6441
|
-
return F(
|
|
6451
|
+
return t(c);
|
|
6452
|
+
let e = c.offsetParent;
|
|
6453
|
+
return F(c) === e && (e = e.ownerDocument.body), e;
|
|
6442
6454
|
}
|
|
6443
|
-
function le(
|
|
6444
|
-
const e = N(
|
|
6445
|
-
if (xt(
|
|
6455
|
+
function le(c, t) {
|
|
6456
|
+
const e = N(c);
|
|
6457
|
+
if (xt(c))
|
|
6446
6458
|
return e;
|
|
6447
|
-
if (!K(
|
|
6448
|
-
let s = P(
|
|
6459
|
+
if (!K(c)) {
|
|
6460
|
+
let s = P(c);
|
|
6449
6461
|
for (; s && !q(s); ) {
|
|
6450
6462
|
if (B(s) && !wt(s))
|
|
6451
6463
|
return s;
|
|
@@ -6453,15 +6465,15 @@ function le(h, t) {
|
|
|
6453
6465
|
}
|
|
6454
6466
|
return e;
|
|
6455
6467
|
}
|
|
6456
|
-
let i = Pt(
|
|
6468
|
+
let i = Pt(c, t);
|
|
6457
6469
|
for (; i && oi(i) && wt(i); )
|
|
6458
6470
|
i = Pt(i, t);
|
|
6459
|
-
return i && q(i) && wt(i) && !St(i) ? e : i ||
|
|
6471
|
+
return i && q(i) && wt(i) && !St(i) ? e : i || hi(c) || e;
|
|
6460
6472
|
}
|
|
6461
|
-
const vi = async function(
|
|
6462
|
-
const t = this.getOffsetParent || le, e = this.getDimensions, i = await e(
|
|
6473
|
+
const vi = async function(c) {
|
|
6474
|
+
const t = this.getOffsetParent || le, e = this.getDimensions, i = await e(c.floating);
|
|
6463
6475
|
return {
|
|
6464
|
-
reference: bi(
|
|
6476
|
+
reference: bi(c.reference, await t(c.floating), c.strategy),
|
|
6465
6477
|
floating: {
|
|
6466
6478
|
x: 0,
|
|
6467
6479
|
y: 0,
|
|
@@ -6470,47 +6482,47 @@ const vi = async function(h) {
|
|
|
6470
6482
|
}
|
|
6471
6483
|
};
|
|
6472
6484
|
};
|
|
6473
|
-
function Ii(
|
|
6474
|
-
return X(
|
|
6485
|
+
function Ii(c) {
|
|
6486
|
+
return X(c).direction === "rtl";
|
|
6475
6487
|
}
|
|
6476
6488
|
const Ri = {
|
|
6477
6489
|
convertOffsetParentRelativeRectToViewportRelativeRect: ui,
|
|
6478
6490
|
getDocumentElement: F,
|
|
6479
|
-
getClippingRect:
|
|
6491
|
+
getClippingRect: yi,
|
|
6480
6492
|
getOffsetParent: le,
|
|
6481
6493
|
getElementRects: vi,
|
|
6482
6494
|
getClientRects: xi,
|
|
6483
|
-
getDimensions:
|
|
6495
|
+
getDimensions: Ci,
|
|
6484
6496
|
getScale: U,
|
|
6485
6497
|
isElement: B,
|
|
6486
6498
|
isRTL: Ii
|
|
6487
6499
|
};
|
|
6488
|
-
function
|
|
6489
|
-
return
|
|
6500
|
+
function he(c, t) {
|
|
6501
|
+
return c.x === t.x && c.y === t.y && c.width === t.width && c.height === t.height;
|
|
6490
6502
|
}
|
|
6491
|
-
function _i(
|
|
6503
|
+
function _i(c, t) {
|
|
6492
6504
|
let e = null, i;
|
|
6493
|
-
const s = F(
|
|
6505
|
+
const s = F(c);
|
|
6494
6506
|
function o() {
|
|
6495
6507
|
var a;
|
|
6496
6508
|
clearTimeout(i), (a = e) == null || a.disconnect(), e = null;
|
|
6497
6509
|
}
|
|
6498
6510
|
function r(a, l) {
|
|
6499
6511
|
a === void 0 && (a = !1), l === void 0 && (l = 1), o();
|
|
6500
|
-
const
|
|
6512
|
+
const h = c.getBoundingClientRect(), {
|
|
6501
6513
|
left: d,
|
|
6502
6514
|
top: f,
|
|
6503
6515
|
width: x,
|
|
6504
6516
|
height: u
|
|
6505
|
-
} =
|
|
6517
|
+
} = h;
|
|
6506
6518
|
if (a || t(), !x || !u)
|
|
6507
6519
|
return;
|
|
6508
|
-
const g = st(f), m = st(s.clientWidth - (d + x)), w = st(s.clientHeight - (f + u)), E = st(d),
|
|
6520
|
+
const g = st(f), m = st(s.clientWidth - (d + x)), w = st(s.clientHeight - (f + u)), E = st(d), y = {
|
|
6509
6521
|
rootMargin: -g + "px " + -m + "px " + -w + "px " + -E + "px",
|
|
6510
6522
|
threshold: z(0, j(1, l)) || 1
|
|
6511
6523
|
};
|
|
6512
6524
|
let b = !0;
|
|
6513
|
-
function
|
|
6525
|
+
function C(R) {
|
|
6514
6526
|
const S = R[0].intersectionRatio;
|
|
6515
6527
|
if (S !== l) {
|
|
6516
6528
|
if (!b)
|
|
@@ -6519,22 +6531,22 @@ function _i(h, t) {
|
|
|
6519
6531
|
r(!1, 1e-7);
|
|
6520
6532
|
}, 1e3);
|
|
6521
6533
|
}
|
|
6522
|
-
S === 1 && !
|
|
6534
|
+
S === 1 && !he(h, c.getBoundingClientRect()) && r(), b = !1;
|
|
6523
6535
|
}
|
|
6524
6536
|
try {
|
|
6525
|
-
e = new IntersectionObserver(
|
|
6526
|
-
...
|
|
6537
|
+
e = new IntersectionObserver(C, {
|
|
6538
|
+
...y,
|
|
6527
6539
|
// Handle <iframe>s
|
|
6528
6540
|
root: s.ownerDocument
|
|
6529
6541
|
});
|
|
6530
6542
|
} catch {
|
|
6531
|
-
e = new IntersectionObserver(
|
|
6543
|
+
e = new IntersectionObserver(C, y);
|
|
6532
6544
|
}
|
|
6533
|
-
e.observe(
|
|
6545
|
+
e.observe(c);
|
|
6534
6546
|
}
|
|
6535
6547
|
return r(!0), o;
|
|
6536
6548
|
}
|
|
6537
|
-
function
|
|
6549
|
+
function Ct(c, t, e, i) {
|
|
6538
6550
|
i === void 0 && (i = {});
|
|
6539
6551
|
const {
|
|
6540
6552
|
ancestorScroll: s = !0,
|
|
@@ -6542,35 +6554,35 @@ function yt(h, t, e, i) {
|
|
|
6542
6554
|
elementResize: r = typeof ResizeObserver == "function",
|
|
6543
6555
|
layoutShift: a = typeof IntersectionObserver == "function",
|
|
6544
6556
|
animationFrame: l = !1
|
|
6545
|
-
} = i,
|
|
6557
|
+
} = i, h = Ot(c), d = s || o ? [...h ? Q(h) : [], ...Q(t)] : [];
|
|
6546
6558
|
d.forEach((E) => {
|
|
6547
6559
|
s && E.addEventListener("scroll", e, {
|
|
6548
6560
|
passive: !0
|
|
6549
6561
|
}), o && E.addEventListener("resize", e);
|
|
6550
6562
|
});
|
|
6551
|
-
const f =
|
|
6563
|
+
const f = h && a ? _i(h, e) : null;
|
|
6552
6564
|
let x = -1, u = null;
|
|
6553
6565
|
r && (u = new ResizeObserver((E) => {
|
|
6554
|
-
let [
|
|
6555
|
-
|
|
6556
|
-
var
|
|
6557
|
-
(
|
|
6566
|
+
let [p] = E;
|
|
6567
|
+
p && p.target === h && u && (u.unobserve(t), cancelAnimationFrame(x), x = requestAnimationFrame(() => {
|
|
6568
|
+
var y;
|
|
6569
|
+
(y = u) == null || y.observe(t);
|
|
6558
6570
|
})), e();
|
|
6559
|
-
}),
|
|
6560
|
-
let g, m = l ? G(
|
|
6571
|
+
}), h && !l && u.observe(h), u.observe(t));
|
|
6572
|
+
let g, m = l ? G(c) : null;
|
|
6561
6573
|
l && w();
|
|
6562
6574
|
function w() {
|
|
6563
|
-
const E = G(
|
|
6564
|
-
m && !
|
|
6575
|
+
const E = G(c);
|
|
6576
|
+
m && !he(m, E) && e(), m = E, g = requestAnimationFrame(w);
|
|
6565
6577
|
}
|
|
6566
6578
|
return e(), () => {
|
|
6567
6579
|
var E;
|
|
6568
|
-
d.forEach((
|
|
6569
|
-
s &&
|
|
6580
|
+
d.forEach((p) => {
|
|
6581
|
+
s && p.removeEventListener("scroll", e), o && p.removeEventListener("resize", e);
|
|
6570
6582
|
}), f == null || f(), (E = u) == null || E.disconnect(), u = null, l && cancelAnimationFrame(g);
|
|
6571
6583
|
};
|
|
6572
6584
|
}
|
|
6573
|
-
const
|
|
6585
|
+
const ct = ti, dt = ei, Mt = Ze, Si = qe, ft = (c, t, e) => {
|
|
6574
6586
|
const i = /* @__PURE__ */ new Map(), s = {
|
|
6575
6587
|
platform: Ri,
|
|
6576
6588
|
...e
|
|
@@ -6578,7 +6590,7 @@ const ht = ti, dt = ei, Mt = Ze, Si = qe, ft = (h, t, e) => {
|
|
|
6578
6590
|
...s.platform,
|
|
6579
6591
|
_c: i
|
|
6580
6592
|
};
|
|
6581
|
-
return je(
|
|
6593
|
+
return je(c, t, {
|
|
6582
6594
|
...s,
|
|
6583
6595
|
platform: o
|
|
6584
6596
|
});
|
|
@@ -6636,61 +6648,65 @@ let Ti = class {
|
|
|
6636
6648
|
this.floatingEl.contains(e.target) || this.hide();
|
|
6637
6649
|
}), this.ctx.on("cellFooterHoverChange", (t, e) => {
|
|
6638
6650
|
this.floatingEl.contains(e.target) || t.ellipsis && this.show(t);
|
|
6651
|
+
}), this.ctx.on("cellShowTooltip", (t, e) => {
|
|
6652
|
+
this.show(t, e);
|
|
6653
|
+
}), this.ctx.on("cellHideTooltip", () => {
|
|
6654
|
+
this.hide();
|
|
6639
6655
|
});
|
|
6640
6656
|
}
|
|
6641
|
-
show(t) {
|
|
6657
|
+
show(t, e) {
|
|
6642
6658
|
if (this.ctx.contextMenuIng || !t.overflowTooltipShow || this.ctx.mousedown)
|
|
6643
6659
|
return;
|
|
6644
6660
|
this.floatingEl.style.display = "block";
|
|
6645
|
-
let
|
|
6646
|
-
t.message && (
|
|
6647
|
-
const
|
|
6648
|
-
if (!
|
|
6661
|
+
let i = t.getText();
|
|
6662
|
+
t.message && (i = t.message), e && (i = e);
|
|
6663
|
+
const s = this.ctx.containerElement.getBoundingClientRect();
|
|
6664
|
+
if (!s)
|
|
6649
6665
|
return;
|
|
6650
|
-
this.enable = !0, this.contentEl.style.maxWidth = `${t.overflowTooltipMaxWidth || 500}px`, this.contentEl.style.minWidth = "100px", this.contentEl.style.width = "100%", this.contentEl.style.display = "inline-block", this.contentEl.style.wordBreak = "break-all", this.contentEl.style.lineHeight = "1.5", this.contentEl.innerText =
|
|
6651
|
-
const
|
|
6666
|
+
this.enable = !0, this.contentEl.style.maxWidth = `${t.overflowTooltipMaxWidth || 500}px`, this.contentEl.style.minWidth = "100px", this.contentEl.style.width = "100%", this.contentEl.style.display = "inline-block", this.contentEl.style.wordBreak = "break-all", this.contentEl.style.lineHeight = "1.5", this.contentEl.innerText = i;
|
|
6667
|
+
const o = t.drawX + s.x, r = t.drawY + s.y;
|
|
6652
6668
|
ft({
|
|
6653
6669
|
getBoundingClientRect() {
|
|
6654
6670
|
return {
|
|
6655
6671
|
width: t.visibleWidth,
|
|
6656
6672
|
height: t.visibleHeight,
|
|
6657
|
-
x:
|
|
6658
|
-
y:
|
|
6659
|
-
left:
|
|
6660
|
-
right:
|
|
6661
|
-
top:
|
|
6662
|
-
bottom:
|
|
6673
|
+
x: o,
|
|
6674
|
+
y: r,
|
|
6675
|
+
left: o,
|
|
6676
|
+
right: o + t.visibleWidth,
|
|
6677
|
+
top: r,
|
|
6678
|
+
bottom: r + t.visibleHeight
|
|
6663
6679
|
};
|
|
6664
6680
|
}
|
|
6665
6681
|
}, this.floatingEl, {
|
|
6666
6682
|
placement: t.overflowTooltipPlacement,
|
|
6667
|
-
middleware: [dt(), Mt(),
|
|
6668
|
-
}).then((
|
|
6669
|
-
const { x:
|
|
6683
|
+
middleware: [dt(), Mt(), ct(6), Si({ element: this.arrowEl })]
|
|
6684
|
+
}).then((l) => {
|
|
6685
|
+
const { x: h, y: d, placement: f, middlewareData: x } = l;
|
|
6670
6686
|
if (Object.assign(this.floatingEl.style, {
|
|
6671
|
-
top: `${
|
|
6672
|
-
left: `${
|
|
6673
|
-
}),
|
|
6674
|
-
const
|
|
6675
|
-
["left", "left-start", "left-end"].includes(
|
|
6676
|
-
top: `${
|
|
6687
|
+
top: `${d}px`,
|
|
6688
|
+
left: `${h}px`
|
|
6689
|
+
}), x.arrow) {
|
|
6690
|
+
const u = x.arrow;
|
|
6691
|
+
["left", "left-start", "left-end"].includes(f) ? Object.assign(this.arrowEl.style, {
|
|
6692
|
+
top: `${u.y}px`,
|
|
6677
6693
|
bottom: "",
|
|
6678
6694
|
left: "",
|
|
6679
6695
|
right: "-5px"
|
|
6680
|
-
}) : ["right", "right-start", "right-end"].includes(
|
|
6681
|
-
top: `${
|
|
6696
|
+
}) : ["right", "right-start", "right-end"].includes(f) ? Object.assign(this.arrowEl.style, {
|
|
6697
|
+
top: `${u.y}px`,
|
|
6682
6698
|
bottom: "",
|
|
6683
6699
|
left: "-5px",
|
|
6684
6700
|
right: ""
|
|
6685
|
-
}) : ["bottom", "bottom-start", "bottom-end"].includes(
|
|
6701
|
+
}) : ["bottom", "bottom-start", "bottom-end"].includes(f) ? Object.assign(this.arrowEl.style, {
|
|
6686
6702
|
top: "-5px",
|
|
6687
6703
|
bottom: "",
|
|
6688
|
-
left: `${
|
|
6704
|
+
left: `${u.x}px`,
|
|
6689
6705
|
right: ""
|
|
6690
|
-
}) : ["top", "top-start", "top-end"].includes(
|
|
6706
|
+
}) : ["top", "top-start", "top-end"].includes(f) && Object.assign(this.arrowEl.style, {
|
|
6691
6707
|
top: "",
|
|
6692
6708
|
bottom: "-5px",
|
|
6693
|
-
left: `${
|
|
6709
|
+
left: `${u.x}px`,
|
|
6694
6710
|
right: ""
|
|
6695
6711
|
});
|
|
6696
6712
|
}
|
|
@@ -6725,8 +6741,6 @@ class Oi {
|
|
|
6725
6741
|
this.selectorArrStr = JSON.stringify(e) + JSON.stringify(i);
|
|
6726
6742
|
}), this.ctx.on("onScroll", () => {
|
|
6727
6743
|
this.enable && this.doneEdit();
|
|
6728
|
-
}), this.ctx.on("cellHeaderMousedown", () => {
|
|
6729
|
-
this.enable && this.doneEdit(), this.cellTarget = null;
|
|
6730
6744
|
}), this.ctx.on("hoverIconClick", (t) => {
|
|
6731
6745
|
this.ctx.disableHoverIconClick || this.editCell(t.rowIndex, t.colIndex);
|
|
6732
6746
|
}), this.ctx.on("cellMousedown", () => {
|
|
@@ -6742,8 +6756,8 @@ class Oi {
|
|
|
6742
6756
|
}
|
|
6743
6757
|
if ((t.altKey || t.metaKey) && t.code === "Enter" && this.ctx.editing && this.inputEl) {
|
|
6744
6758
|
t.preventDefault();
|
|
6745
|
-
const l = this.inputEl.selectionStart,
|
|
6746
|
-
this.inputEl.value =
|
|
6759
|
+
const l = this.inputEl.selectionStart, h = this.inputEl.value.substring(0, l), d = this.inputEl.value.substring(l);
|
|
6760
|
+
this.inputEl.value = h + `
|
|
6747
6761
|
` + d, this.inputEl.selectionStart = this.inputEl.selectionEnd = l + 1, this.autoSize();
|
|
6748
6762
|
return;
|
|
6749
6763
|
}
|
|
@@ -6817,6 +6831,8 @@ class Oi {
|
|
|
6817
6831
|
}
|
|
6818
6832
|
this.ctx.selectOnlyOne && this.startEdit();
|
|
6819
6833
|
}
|
|
6834
|
+
}), this.ctx.on("mousedownBodyOutside", () => {
|
|
6835
|
+
this.enable && this.doneEdit(), this.cellTarget = null;
|
|
6820
6836
|
});
|
|
6821
6837
|
}
|
|
6822
6838
|
isInSelectorRange(t, e) {
|
|
@@ -6827,16 +6843,17 @@ class Oi {
|
|
|
6827
6843
|
this.inputEl = document.createElement("textarea"), this.inputEl.id = "e-virt-table-editor-textarea", this.inputEl.setAttribute("rows", "1"), this.inputEl.setAttribute("tabindex", "-1"), this.inputEl.addEventListener("input", this.autoSize.bind(this)), this.editorEl = this.ctx.editorElement, this.inputEl.className = "e-virt-table-editor-textarea", this.editorEl.appendChild(this.inputEl), this.ctx.containerElement.appendChild(this.editorEl);
|
|
6828
6844
|
}
|
|
6829
6845
|
autoSize() {
|
|
6830
|
-
this.inputEl.
|
|
6831
|
-
|
|
6832
|
-
|
|
6846
|
+
const t = this.inputEl.value;
|
|
6847
|
+
this.cellTarget && this.cellTarget.type === "number" && t !== "" && (this.ctx.emit("cellHideTooltip"), /^-?\d+(\.\d+)?$/.test(t) || this.ctx.emit("cellShowTooltip", this.cellTarget, this.ctx.config.NUMBER_ERROR_TIP)), this.inputEl.style.height = "auto";
|
|
6848
|
+
let e = this.inputEl.scrollHeight, i = this.ctx.body.visibleHeight;
|
|
6849
|
+
e > i && (e = i);
|
|
6833
6850
|
const {
|
|
6834
|
-
stageHeight:
|
|
6835
|
-
footer:
|
|
6836
|
-
header:
|
|
6837
|
-
config: { SCROLLER_TRACK_SIZE:
|
|
6838
|
-
} = this.ctx,
|
|
6839
|
-
this.editorEl.style.bottom = "auto", this.drawY <
|
|
6851
|
+
stageHeight: s,
|
|
6852
|
+
footer: o,
|
|
6853
|
+
header: r,
|
|
6854
|
+
config: { SCROLLER_TRACK_SIZE: a }
|
|
6855
|
+
} = this.ctx, l = s - o.height - a;
|
|
6856
|
+
this.editorEl.style.bottom = "auto", this.drawY < r.height && (this.editorEl.style.top = `${r.height - 1}px`), this.drawY + e > l && (this.editorEl.style.left = `${this.drawX - 1}px`, this.editorEl.style.top = "auto", this.editorEl.style.bottom = `${s - l}px`), this.inputEl.style.height = `${e}px`;
|
|
6840
6857
|
}
|
|
6841
6858
|
startEditByInput(t, e = !1) {
|
|
6842
6859
|
const i = e ? null : t.getValue(), { editorType: s } = t;
|
|
@@ -6846,11 +6863,11 @@ class Oi {
|
|
|
6846
6863
|
let { height: o, width: r, drawY: a, drawX: l } = t;
|
|
6847
6864
|
this.drawX = l, this.drawY = a;
|
|
6848
6865
|
const {
|
|
6849
|
-
config: { CELL_PADDING:
|
|
6866
|
+
config: { CELL_PADDING: h },
|
|
6850
6867
|
header: d
|
|
6851
6868
|
} = this.ctx;
|
|
6852
6869
|
let f = this.ctx.body.visibleHeight;
|
|
6853
|
-
o > f && (o = f), this.editorEl.style.display = "inline-block", this.editorEl.style.zIndex = "100", 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" ? (this.inputEl.style.display = "inline-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 = `${
|
|
6870
|
+
o > f && (o = f), this.editorEl.style.display = "inline-block", this.editorEl.style.zIndex = "100", 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" ? (this.inputEl.style.display = "inline-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`, this.inputEl.value = "", i !== null && (this.inputEl.value = i, this.inputEl.focus({ preventScroll: !0 }))) : this.inputEl.style.display = "none", (this.inputEl.scrollHeight > o || this.drawY < d.height) && this.autoSize();
|
|
6854
6871
|
}
|
|
6855
6872
|
doneEditByInput() {
|
|
6856
6873
|
if (this.cellTarget && this.cellTarget.editorType === "text") {
|
|
@@ -6861,7 +6878,7 @@ class Oi {
|
|
|
6861
6878
|
startEdit(t = !1) {
|
|
6862
6879
|
this.cancel = !1;
|
|
6863
6880
|
const { ENABLE_EDIT_CLICK_SELECTOR: e } = this.ctx.config;
|
|
6864
|
-
if (!e
|
|
6881
|
+
if (!e)
|
|
6865
6882
|
return;
|
|
6866
6883
|
const i = this.ctx.focusCell;
|
|
6867
6884
|
if (!i || ["index", "index-selection", "selection"].includes(i.type) || this.enable || !(i.isVerticalVisible() && i.isHorizontalVisible()))
|
|
@@ -6870,10 +6887,10 @@ class Oi {
|
|
|
6870
6887
|
i && !a && (this.enable = !0, this.ctx.editing = !0, this.cellTarget = i, this.startEditByInput(this.cellTarget, t), this.ctx.emit("startEdit", this.cellTarget), this.ctx.emit("draw"));
|
|
6871
6888
|
}
|
|
6872
6889
|
editCell(t, e) {
|
|
6873
|
-
const i = this.ctx.body.renderRows.find((
|
|
6890
|
+
const i = this.ctx.body.renderRows.find((h) => h.rowIndex === t);
|
|
6874
6891
|
if (!i)
|
|
6875
6892
|
return;
|
|
6876
|
-
const s = i.cells.find((
|
|
6893
|
+
const s = i.cells.find((h) => h.colIndex === e);
|
|
6877
6894
|
if (!s)
|
|
6878
6895
|
return;
|
|
6879
6896
|
this.ctx.emit("setSelectorCell", s);
|
|
@@ -6884,7 +6901,7 @@ class Oi {
|
|
|
6884
6901
|
o && !l && (this.enable = !0, this.ctx.editing = !0, this.cellTarget = o, this.startEditByInput(this.cellTarget), this.ctx.emit("startEdit", this.cellTarget), this.ctx.emit("draw"));
|
|
6885
6902
|
}
|
|
6886
6903
|
doneEdit() {
|
|
6887
|
-
this.enable && (this.doneEditByInput(), this.ctx.emit("doneEdit", this.cellTarget), this.enable = !1, this.ctx.editing = !1, this.inputEl.style.display = "inline-block", this.editorEl.style.zIndex = "-1", setTimeout(() => {
|
|
6904
|
+
this.enable && (this.doneEditByInput(), this.ctx.emit("cellHideTooltip"), this.ctx.emit("doneEdit", this.cellTarget), this.enable = !1, this.ctx.editing = !1, this.inputEl.style.display = "inline-block", this.editorEl.style.zIndex = "-1", setTimeout(() => {
|
|
6888
6905
|
this.inputEl.focus({ preventScroll: !0 });
|
|
6889
6906
|
}, 0), this.ctx.emit("draw"));
|
|
6890
6907
|
}
|
|
@@ -6903,17 +6920,12 @@ let Li = class {
|
|
|
6903
6920
|
this.ctx = t;
|
|
6904
6921
|
const { EMPTY_TEXT: e, EMPTY_CUSTOM_STYLE: i } = this.ctx.config;
|
|
6905
6922
|
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: a }) => {
|
|
6906
|
-
const l = o + (r + a) / 2,
|
|
6923
|
+
const l = o + (r + a) / 2, h = {
|
|
6907
6924
|
display: s === "empty" ? "block" : "none",
|
|
6908
|
-
position: "absolute",
|
|
6909
|
-
fontSize: "14px",
|
|
6910
|
-
color: "#666",
|
|
6911
|
-
left: "50%",
|
|
6912
6925
|
top: `${l}px`,
|
|
6913
|
-
transform: "translate(-50%, -50%)",
|
|
6914
6926
|
...i
|
|
6915
6927
|
};
|
|
6916
|
-
Object.assign(this.emptyEl.style,
|
|
6928
|
+
Object.assign(this.emptyEl.style, h);
|
|
6917
6929
|
});
|
|
6918
6930
|
}
|
|
6919
6931
|
destroy() {
|
|
@@ -6938,10 +6950,10 @@ class Mi {
|
|
|
6938
6950
|
const t = this.ctx.overlayerElement.querySelectorAll('[data-auto-height="true"]'), e = /* @__PURE__ */ new Map();
|
|
6939
6951
|
t.forEach((o) => {
|
|
6940
6952
|
const r = Number(o.getAttribute("data-row-index")), a = Number(o.getAttribute("data-col-index"));
|
|
6941
|
-
if (isNaN(r) || isNaN(a)
|
|
6953
|
+
if (isNaN(r) || isNaN(a))
|
|
6942
6954
|
return;
|
|
6943
|
-
const l = `${r}_${a}`;
|
|
6944
|
-
e.set(
|
|
6955
|
+
const l = o.getBoundingClientRect(), h = `${r}_${a}`;
|
|
6956
|
+
e.set(h, Math.round(l.height));
|
|
6945
6957
|
});
|
|
6946
6958
|
const i = this.ctx.database.getOverlayerAutoHeightMap();
|
|
6947
6959
|
if (!this.arerMapsEqual(i, e)) {
|
|
@@ -6958,8 +6970,8 @@ class Mi {
|
|
|
6958
6970
|
const r = document.createElement("div");
|
|
6959
6971
|
Object.assign(r.style, o.style), o.cells.forEach((a) => {
|
|
6960
6972
|
const l = document.createElement("div");
|
|
6961
|
-
Object.assign(l.style, a.style), Object.keys(a.domDataset).forEach((
|
|
6962
|
-
l.setAttribute(
|
|
6973
|
+
Object.assign(l.style, a.style), Object.keys(a.domDataset).forEach((h) => {
|
|
6974
|
+
l.setAttribute(h, a.domDataset[h]);
|
|
6963
6975
|
}), typeof a.render == "function" && a.render(l, a), r.appendChild(l);
|
|
6964
6976
|
}), s.appendChild(r);
|
|
6965
6977
|
}), e.appendChild(s);
|
|
@@ -6990,9 +7002,9 @@ class Mi {
|
|
|
6990
7002
|
fixedRightWidth: e,
|
|
6991
7003
|
config: { SCROLLER_TRACK_SIZE: i, CSS_PREFIX: s }
|
|
6992
7004
|
} = this.ctx, { visibleWidth: o, visibleHeight: r, renderCellHeaders: a } = this.ctx.header;
|
|
6993
|
-
let l = [],
|
|
7005
|
+
let l = [], h = [], d = [];
|
|
6994
7006
|
a.forEach((w) => {
|
|
6995
|
-
w.render && (w.fixed === "left" ?
|
|
7007
|
+
w.render && (w.fixed === "left" ? h.push(w) : w.fixed === "right" ? d.push(w) : l.push(w));
|
|
6996
7008
|
});
|
|
6997
7009
|
const f = e - i, x = {
|
|
6998
7010
|
key: "left",
|
|
@@ -7004,7 +7016,7 @@ class Mi {
|
|
|
7004
7016
|
width: `${t}px`,
|
|
7005
7017
|
height: `${r}px`
|
|
7006
7018
|
},
|
|
7007
|
-
cells:
|
|
7019
|
+
cells: h
|
|
7008
7020
|
}, u = {
|
|
7009
7021
|
key: "center",
|
|
7010
7022
|
style: {
|
|
@@ -7052,7 +7064,7 @@ class Mi {
|
|
|
7052
7064
|
fixedLeftWidth: o,
|
|
7053
7065
|
fixedRightWidth: r,
|
|
7054
7066
|
config: { SCROLLER_TRACK_SIZE: a, CSS_PREFIX: l }
|
|
7055
|
-
} = this.ctx, { visibleWidth:
|
|
7067
|
+
} = this.ctx, { visibleWidth: h, visibleHeight: d } = this.ctx.body, f = r - a, x = {
|
|
7056
7068
|
key: "left",
|
|
7057
7069
|
style: {
|
|
7058
7070
|
position: "absolute",
|
|
@@ -7070,7 +7082,7 @@ class Mi {
|
|
|
7070
7082
|
top: `${0.5}px`,
|
|
7071
7083
|
left: `${o - 0.5}px`,
|
|
7072
7084
|
overflow: "hidden",
|
|
7073
|
-
width: `${
|
|
7085
|
+
width: `${h - o - f}px`,
|
|
7074
7086
|
height: `${d}px`
|
|
7075
7087
|
},
|
|
7076
7088
|
cells: t
|
|
@@ -7092,7 +7104,7 @@ class Mi {
|
|
|
7092
7104
|
style: {
|
|
7093
7105
|
position: "relative",
|
|
7094
7106
|
overflow: "hidden",
|
|
7095
|
-
width: `${
|
|
7107
|
+
width: `${h}px`,
|
|
7096
7108
|
height: `${d}px`
|
|
7097
7109
|
},
|
|
7098
7110
|
views: [x, u, g]
|
|
@@ -7109,7 +7121,7 @@ class Mi {
|
|
|
7109
7121
|
fixedLeftWidth: s,
|
|
7110
7122
|
fixedRightWidth: o,
|
|
7111
7123
|
config: { SCROLLER_TRACK_SIZE: r, CSS_PREFIX: a }
|
|
7112
|
-
} = this.ctx, { visibleWidth: l, visibleHeight:
|
|
7124
|
+
} = this.ctx, { visibleWidth: l, visibleHeight: h } = this.ctx.footer, d = o - r, f = {
|
|
7113
7125
|
key: "left",
|
|
7114
7126
|
style: {
|
|
7115
7127
|
position: "absolute",
|
|
@@ -7117,7 +7129,7 @@ class Mi {
|
|
|
7117
7129
|
left: `${0.5}px`,
|
|
7118
7130
|
overflow: "hidden",
|
|
7119
7131
|
width: `${s}px`,
|
|
7120
|
-
height: `${
|
|
7132
|
+
height: `${h}px`
|
|
7121
7133
|
},
|
|
7122
7134
|
cells: e
|
|
7123
7135
|
}, x = {
|
|
@@ -7128,7 +7140,7 @@ class Mi {
|
|
|
7128
7140
|
left: `${s - 0.5}px`,
|
|
7129
7141
|
overflow: "hidden",
|
|
7130
7142
|
width: `${l - s - d}px`,
|
|
7131
|
-
height: `${
|
|
7143
|
+
height: `${h}px`
|
|
7132
7144
|
},
|
|
7133
7145
|
cells: t
|
|
7134
7146
|
}, u = {
|
|
@@ -7139,7 +7151,7 @@ class Mi {
|
|
|
7139
7151
|
right: `${0.5}px`,
|
|
7140
7152
|
overflow: "hidden",
|
|
7141
7153
|
width: `${d}px`,
|
|
7142
|
-
height: `${
|
|
7154
|
+
height: `${h}px`
|
|
7143
7155
|
},
|
|
7144
7156
|
cells: i
|
|
7145
7157
|
};
|
|
@@ -7150,7 +7162,7 @@ class Mi {
|
|
|
7150
7162
|
position: "relative",
|
|
7151
7163
|
overflow: "hidden",
|
|
7152
7164
|
width: `${l}px`,
|
|
7153
|
-
height: `${
|
|
7165
|
+
height: `${h}px`
|
|
7154
7166
|
},
|
|
7155
7167
|
views: [f, x, u]
|
|
7156
7168
|
};
|
|
@@ -7244,10 +7256,10 @@ class zt {
|
|
|
7244
7256
|
async showSubmenu(t, e) {
|
|
7245
7257
|
if (this.activeSubmenus.has(e)) return;
|
|
7246
7258
|
this.activeSubmenus.add(e), e.classList.add("show");
|
|
7247
|
-
const i =
|
|
7248
|
-
const s = this.container.getBoundingClientRect(), o = window.innerWidth, r = e.offsetWidth || 200, a = o - s.right, l = s.left,
|
|
7249
|
-
placement:
|
|
7250
|
-
middleware: [
|
|
7259
|
+
const i = Ct(t, e, async () => {
|
|
7260
|
+
const s = this.container.getBoundingClientRect(), o = window.innerWidth, r = e.offsetWidth || 200, a = o - s.right, l = s.left, h = a >= r || a >= l ? "right-start" : "left-start", { x: d, y: f } = await ft(t, e, {
|
|
7261
|
+
placement: h,
|
|
7262
|
+
middleware: [ct(8), dt({ padding: 8 })]
|
|
7251
7263
|
});
|
|
7252
7264
|
Object.assign(e.style, {
|
|
7253
7265
|
left: `${d}px`,
|
|
@@ -7314,10 +7326,10 @@ class zt {
|
|
|
7314
7326
|
}),
|
|
7315
7327
|
contextElement: document.body
|
|
7316
7328
|
};
|
|
7317
|
-
|
|
7329
|
+
Ct(e, this.container, () => {
|
|
7318
7330
|
ft(e, this.container, {
|
|
7319
7331
|
placement: "right-start",
|
|
7320
|
-
middleware: [
|
|
7332
|
+
middleware: [ct(), dt(), Mt()]
|
|
7321
7333
|
}).then(({ x: i, y: s }) => {
|
|
7322
7334
|
this.container && Object.assign(this.container.style, {
|
|
7323
7335
|
left: `${i}px`,
|
|
@@ -7362,8 +7374,8 @@ class zt {
|
|
|
7362
7374
|
const a = this.container.querySelectorAll("[data-menu], [data-submenu]");
|
|
7363
7375
|
for (const l of a)
|
|
7364
7376
|
if (l._submenu === i) {
|
|
7365
|
-
const
|
|
7366
|
-
|
|
7377
|
+
const h = l.getAttribute("data-menu") || l.getAttribute("data-submenu");
|
|
7378
|
+
h && (l.hasAttribute("data-menu") ? this.removeMenuItem(h) : this.removeSubMenuItem(h));
|
|
7367
7379
|
break;
|
|
7368
7380
|
}
|
|
7369
7381
|
}
|
|
@@ -7401,8 +7413,8 @@ class Ai {
|
|
|
7401
7413
|
const { ENABLE_CONTEXT_MENU: i, CUSTOM_BODY_CONTEXT_MENU: s, CONTEXT_MENU: o } = this.ctx.config, r = [...o, ...s];
|
|
7402
7414
|
if (!i || r.length === 0) return;
|
|
7403
7415
|
e.preventDefault();
|
|
7404
|
-
const { xArr: a, yArr: l } = this.ctx.selector, [
|
|
7405
|
-
u >= f && u <= x && g >=
|
|
7416
|
+
const { xArr: a, yArr: l } = this.ctx.selector, [h, d] = a, [f, x] = l, { rowIndex: u, colIndex: g } = t;
|
|
7417
|
+
u >= f && u <= x && g >= h && g <= d || this.ctx.emit("setSelectorCell", t, e), this.currentDOMTreeMenu && this.currentDOMTreeMenu.destroy(), this.ctx.contextMenuIng = !0, this.currentDOMTreeMenu = new zt(this.contextMenuEl, r, {
|
|
7406
7418
|
onClick: (w, E) => {
|
|
7407
7419
|
E === "copy" ? (this.ctx.emit("contextMenuCopy"), this.hide()) : E === "paste" ? (this.ctx.emit("contextMenuPaste"), this.hide()) : E === "cut" ? (this.ctx.emit("contextMenuCut"), this.hide()) : E === "clearSelected" && (this.ctx.emit("contextMenuClearSelected"), this.hide());
|
|
7408
7420
|
}
|
|
@@ -7415,18 +7427,18 @@ class Ai {
|
|
|
7415
7427
|
const { SELECTOR_AREA_MIN_X: i, SELECTOR_AREA_MAX_X: s, SELECTOR_AREA_MAX_X_OFFSET: o } = this.ctx.config, r = i, a = s || this.ctx.maxColIndex - o;
|
|
7416
7428
|
if (t.colIndex < r || t.colIndex > a)
|
|
7417
7429
|
return;
|
|
7418
|
-
const { HEADER_CONTEXT_MENU: l, CUSTOM_HEADER_CONTEXT_MENU:
|
|
7430
|
+
const { HEADER_CONTEXT_MENU: l, CUSTOM_HEADER_CONTEXT_MENU: h, ENABLE_HEADER_CONTEXT_MENU: d } = this.ctx.config, f = [...l, ...h];
|
|
7419
7431
|
if (!d || f.length === 0) return;
|
|
7420
7432
|
e.preventDefault();
|
|
7421
7433
|
const { xArr: x } = this.ctx.selector, [u, g] = x, { colIndex: m } = t;
|
|
7422
7434
|
m >= u && m <= g || (this.ctx.focusCellHeader = t, this.ctx.emit("selectCols", t)), this.currentDOMTreeMenu && this.currentDOMTreeMenu.destroy();
|
|
7423
|
-
const E = this.ctx.database.getColumns(),
|
|
7424
|
-
...
|
|
7435
|
+
const E = this.ctx.database.getColumns(), p = f.map((y) => y.value === "visible" ? {
|
|
7436
|
+
...y,
|
|
7425
7437
|
children: this.filterColumns(E)
|
|
7426
|
-
} :
|
|
7427
|
-
this.ctx.contextMenuIng = !0, this.currentDOMTreeMenu = new zt(this.contextMenuEl,
|
|
7428
|
-
onClick: (
|
|
7429
|
-
const { xArr:
|
|
7438
|
+
} : y);
|
|
7439
|
+
this.ctx.contextMenuIng = !0, this.currentDOMTreeMenu = new zt(this.contextMenuEl, p, {
|
|
7440
|
+
onClick: (y, b) => {
|
|
7441
|
+
const { xArr: C } = this.ctx.selector, [R, S] = C;
|
|
7430
7442
|
if (b === "fixedLeft" || b === "fixedRight" || b === "fixedNone") {
|
|
7431
7443
|
const O = this.ctx.header.allCellHeaders.filter((v) => v.colIndex >= R && v.colIndex <= S).filter((v) => v.level === 0).filter((v) => !v.column.fixedDisabled).map((v) => v.key);
|
|
7432
7444
|
this.ctx.database.setCustomHeaderFixedData(
|
|
@@ -7437,12 +7449,12 @@ class Ai {
|
|
|
7437
7449
|
const O = this.ctx.header.leafCellHeaders.filter((v) => v.colIndex >= R && v.colIndex <= S).filter((v) => !v.children.length).filter((v) => !v.column.hideDisabled).map((v) => v.key);
|
|
7438
7450
|
O.length > 0 && this.ctx.database.setCustomHeaderHideData(O, !0), this.hide();
|
|
7439
7451
|
} else if (b !== "visible") if (b.startsWith("visible_")) {
|
|
7440
|
-
if (!
|
|
7441
|
-
if (
|
|
7442
|
-
const _ = this.getLeafKeys(
|
|
7452
|
+
if (!y.key) return;
|
|
7453
|
+
if (y.children) {
|
|
7454
|
+
const _ = this.getLeafKeys(y.children);
|
|
7443
7455
|
this.ctx.database.setCustomHeaderHideData(_, !1);
|
|
7444
7456
|
} else
|
|
7445
|
-
this.ctx.database.setCustomHeaderHideData([
|
|
7457
|
+
this.ctx.database.setCustomHeaderHideData([y.key], !1);
|
|
7446
7458
|
this.currentDOMTreeMenu && this.currentDOMTreeMenu.removeSubMenuItem(b);
|
|
7447
7459
|
const O = this.ctx.database.getColumns();
|
|
7448
7460
|
J(O).filter((_) => _.hide).length === 0 && this.hide();
|
|
@@ -7467,10 +7479,10 @@ class Ai {
|
|
|
7467
7479
|
}),
|
|
7468
7480
|
contextElement: document.body
|
|
7469
7481
|
};
|
|
7470
|
-
|
|
7482
|
+
Ct(e, this.contextMenuEl, () => {
|
|
7471
7483
|
ft(e, this.contextMenuEl, {
|
|
7472
7484
|
placement: "right-start",
|
|
7473
|
-
middleware: [
|
|
7485
|
+
middleware: [ct(), dt(), Mt()]
|
|
7474
7486
|
}).then(({ x: i, y: s }) => {
|
|
7475
7487
|
this.contextMenuEl && Object.assign(this.contextMenuEl.style, {
|
|
7476
7488
|
left: `${i}px`,
|
|
@@ -7712,7 +7724,6 @@ class Xi {
|
|
|
7712
7724
|
n(this, "loading");
|
|
7713
7725
|
n(this, "finderBar");
|
|
7714
7726
|
n(this, "animationFrameId");
|
|
7715
|
-
n(this, "animationFrameId2");
|
|
7716
7727
|
n(this, "ctx");
|
|
7717
7728
|
this.options = e;
|
|
7718
7729
|
const { overlayerElement: i, editorElement: s, emptyElement: o, contextMenuElement: r } = this.options, a = this.createContainer(
|
|
@@ -7732,24 +7743,25 @@ class Xi {
|
|
|
7732
7743
|
t.className = "e-virt-table-container";
|
|
7733
7744
|
const r = document.createElement("div"), a = document.createElement("canvas"), l = e || document.createElement("div");
|
|
7734
7745
|
r.className = "e-virt-table-stage", t.tabIndex = 0, a.className = "e-virt-table-canvas", l.className = "e-virt-table-overlayer", l.setAttribute("data-overlayer", e ? "custom" : "default");
|
|
7735
|
-
const
|
|
7736
|
-
|
|
7746
|
+
const h = i || document.createElement("div");
|
|
7747
|
+
h.className = "e-virt-table-editor";
|
|
7737
7748
|
const d = s, f = o;
|
|
7738
7749
|
return r.appendChild(a), r.appendChild(l), t.appendChild(r), {
|
|
7739
7750
|
containerElement: t,
|
|
7740
7751
|
stageElement: r,
|
|
7741
7752
|
canvasElement: a,
|
|
7742
7753
|
overlayerElement: l,
|
|
7743
|
-
editorElement:
|
|
7754
|
+
editorElement: h,
|
|
7744
7755
|
emptyElement: d,
|
|
7745
7756
|
contextMenuElement: f
|
|
7746
7757
|
};
|
|
7747
7758
|
}
|
|
7759
|
+
doDraw(t = !1) {
|
|
7760
|
+
this.header.update(), this.footer.update(), this.body.update(), this.ctx.paint.clear(), this.body.draw(), this.footer.draw(), this.header.draw(), this.scroller.draw(), t || this.overlayer.draw();
|
|
7761
|
+
}
|
|
7748
7762
|
draw(t = !1) {
|
|
7749
7763
|
this.animationFrameId && cancelAnimationFrame(this.animationFrameId), this.animationFrameId = requestAnimationFrame(() => {
|
|
7750
|
-
this.
|
|
7751
|
-
this.body.updateAutoHeight();
|
|
7752
|
-
});
|
|
7764
|
+
this.doDraw(t), this.body.updateAutoHeight() && this.doDraw(t);
|
|
7753
7765
|
});
|
|
7754
7766
|
}
|
|
7755
7767
|
loadConfig(t) {
|
|
@@ -7835,15 +7847,15 @@ class Xi {
|
|
|
7835
7847
|
return new Promise(async (i, s) => {
|
|
7836
7848
|
let o = [];
|
|
7837
7849
|
for (let r = 0; r < t.length; r++) {
|
|
7838
|
-
const { rowKey: a, key: l } = t[r],
|
|
7839
|
-
Array.isArray(
|
|
7850
|
+
const { rowKey: a, key: l } = t[r], h = await this.ctx.database.getValidator(a, l);
|
|
7851
|
+
Array.isArray(h) && h.length && o.push(h);
|
|
7840
7852
|
}
|
|
7841
7853
|
if (o.length) {
|
|
7842
7854
|
if (s(o), e) {
|
|
7843
7855
|
const [r] = o;
|
|
7844
7856
|
if (Array.isArray(r) && r.length) {
|
|
7845
|
-
const [a] = r, { rowKey: l, key:
|
|
7846
|
-
this.scrollToRowkey(l), this.scrollToColkey(
|
|
7857
|
+
const [a] = r, { rowKey: l, key: h } = a;
|
|
7858
|
+
this.scrollToRowkey(l), this.scrollToColkey(h);
|
|
7847
7859
|
}
|
|
7848
7860
|
}
|
|
7849
7861
|
this.ctx.emit("draw");
|
|
@@ -7860,9 +7872,9 @@ class Xi {
|
|
|
7860
7872
|
if (t && Array.isArray(s) && s.length) {
|
|
7861
7873
|
const [o] = s;
|
|
7862
7874
|
if (Array.isArray(o) && o.length) {
|
|
7863
|
-
const [r] = o, { rowKey: a, key: l } = r,
|
|
7864
|
-
if (
|
|
7865
|
-
const { parentRowKeys: d = [] } =
|
|
7875
|
+
const [r] = o, { rowKey: a, key: l } = r, h = this.ctx.database.getRowForRowKey(a);
|
|
7876
|
+
if (h) {
|
|
7877
|
+
const { parentRowKeys: d = [] } = h;
|
|
7866
7878
|
d && d.length && this.setExpandRowKeys(d, !0);
|
|
7867
7879
|
}
|
|
7868
7880
|
this.scrollToRowkey(a), this.scrollToColkey(l);
|