@ninebone/table 0.0.439 β 0.0.441
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/nine-table.js +486 -472
- package/dist/nine-table.js.map +1 -1
- package/dist/nine-table.umd.js +6 -6
- package/dist/nine-table.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/nine-table.js
CHANGED
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
throw TypeError(
|
|
1
|
+
var xe = Object.defineProperty;
|
|
2
|
+
var ve = (S) => {
|
|
3
|
+
throw TypeError(S);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
var t = (
|
|
9
|
-
var
|
|
5
|
+
var Ee = (S, i, e) => i in S ? xe(S, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : S[i] = e;
|
|
6
|
+
var h = (S, i) => xe(S, "name", { value: i, configurable: !0 });
|
|
7
|
+
var E = (S, i, e) => Ee(S, typeof i != "symbol" ? i + "" : i, e), we = (S, i, e) => i.has(S) || ve("Cannot " + e);
|
|
8
|
+
var t = (S, i, e) => (we(S, i, "read from private field"), e ? e.call(S) : i.get(S)), d = (S, i, e) => i.has(S) ? ve("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(S) : i.set(S, e), u = (S, i, e, n) => (we(S, i, "write to private field"), n ? n.call(S, e) : i.set(S, e), e);
|
|
9
|
+
var Se = (S, i, e, n) => ({
|
|
10
10
|
set _(s) {
|
|
11
|
-
|
|
11
|
+
u(S, i, s, e);
|
|
12
12
|
},
|
|
13
13
|
get _() {
|
|
14
|
-
return t(
|
|
14
|
+
return t(S, i, n);
|
|
15
15
|
}
|
|
16
16
|
});
|
|
17
|
-
import { trace as
|
|
18
|
-
const
|
|
17
|
+
import { trace as Re } from "@ninebone/util";
|
|
18
|
+
const ce = class ce extends Re.constructor {
|
|
19
19
|
constructor() {
|
|
20
20
|
super(), this.init("nine-table", "green");
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
|
-
|
|
24
|
-
let
|
|
25
|
-
const
|
|
26
|
-
var
|
|
27
|
-
const
|
|
23
|
+
h(ce, "Trace");
|
|
24
|
+
let Gt = ce;
|
|
25
|
+
const ht = new Gt();
|
|
26
|
+
var I, B, m, Y, F, V, At, X, qt;
|
|
27
|
+
const he = class he extends HTMLElement {
|
|
28
28
|
constructor() {
|
|
29
29
|
super();
|
|
30
|
-
d(this,
|
|
31
|
-
d(this,
|
|
32
|
-
d(this,
|
|
33
|
-
d(this,
|
|
34
|
-
d(this,
|
|
35
|
-
d(this,
|
|
36
|
-
d(this,
|
|
37
|
-
if (!t(this,
|
|
38
|
-
const e = t(this,
|
|
39
|
-
e && (
|
|
30
|
+
d(this, I);
|
|
31
|
+
d(this, B, !1);
|
|
32
|
+
d(this, m);
|
|
33
|
+
d(this, Y);
|
|
34
|
+
d(this, F);
|
|
35
|
+
d(this, V);
|
|
36
|
+
d(this, At, /* @__PURE__ */ h(() => {
|
|
37
|
+
if (!t(this, I)) return;
|
|
38
|
+
const e = t(this, I).querySelector(".ng-container-body");
|
|
39
|
+
e && (u(this, V, new ResizeObserver(() => {
|
|
40
40
|
this.refresh();
|
|
41
|
-
})), t(this,
|
|
41
|
+
})), t(this, V).observe(e));
|
|
42
42
|
}, "#observeResize"));
|
|
43
|
-
|
|
44
|
-
if (!t(this,
|
|
45
|
-
const e = t(this,
|
|
43
|
+
E(this, "refresh", /* @__PURE__ */ h(() => {
|
|
44
|
+
if (!t(this, I) || !t(this, m) || t(this, B)) return;
|
|
45
|
+
const e = t(this, m).container, n = e.querySelector("table");
|
|
46
46
|
if (!n) return;
|
|
47
|
-
const s = t(this,
|
|
48
|
-
if (l !== 0 &&
|
|
47
|
+
const s = t(this, m).track, r = t(this, m).thumb, o = t(this, I).querySelector(".ng-container-bottom"), l = e.clientWidth, c = n.scrollWidth;
|
|
48
|
+
if (l !== 0 && c > l)
|
|
49
49
|
o && (o.style.display = "flex");
|
|
50
50
|
else {
|
|
51
51
|
o && (o.style.display = "none");
|
|
@@ -53,66 +53,66 @@ const ae = class ae extends HTMLElement {
|
|
|
53
53
|
}
|
|
54
54
|
const a = s.clientWidth;
|
|
55
55
|
if (a <= 0) return;
|
|
56
|
-
const f = Math.max(Math.min(a * (l /
|
|
56
|
+
const f = Math.max(Math.min(a * (l / c), a), 20);
|
|
57
57
|
r.style.width = `${f}px`;
|
|
58
|
-
const
|
|
59
|
-
let
|
|
60
|
-
|
|
61
|
-
const
|
|
62
|
-
|
|
58
|
+
const g = e.scrollLeft, y = c - l;
|
|
59
|
+
let b = 0;
|
|
60
|
+
y > 0 && (b = parseInt(g / y * (a - f), 10)), b < 0 && (b = 0);
|
|
61
|
+
const p = a - f;
|
|
62
|
+
b > p && (b = p), r.style.left = `${b}px`, ht.log(b), t(this, m).left.disabled = b === 0, t(this, m).right.disabled = b >= p - 1;
|
|
63
63
|
}, "refresh"));
|
|
64
|
-
d(this,
|
|
65
|
-
if (!t(this,
|
|
66
|
-
const n = t(this,
|
|
64
|
+
d(this, X, /* @__PURE__ */ h((e) => {
|
|
65
|
+
if (!t(this, m)) return !1;
|
|
66
|
+
const n = t(this, m).container, s = n.querySelector("table");
|
|
67
67
|
if (!s) return !1;
|
|
68
|
-
const r = t(this,
|
|
68
|
+
const r = t(this, m).track.getBoundingClientRect(), o = t(this, m).thumb.clientWidth;
|
|
69
69
|
let l = e;
|
|
70
70
|
l < 0 && (l = 0);
|
|
71
|
-
const
|
|
72
|
-
l >
|
|
73
|
-
const a = n.clientWidth,
|
|
74
|
-
return
|
|
71
|
+
const c = r.width - o;
|
|
72
|
+
l > c && (l = c), l = parseInt(l, 10), t(this, m).thumb.style.left = `${l}px`, t(this, m).left.disabled = l === 0, t(this, m).right.disabled = l >= c - 1;
|
|
73
|
+
const a = n.clientWidth, g = s.scrollWidth - a;
|
|
74
|
+
return c > 0 && g > 0 && (n.scrollLeft = l / c * g), l > 0 && l < c - 1;
|
|
75
75
|
}, "#thumbMoveTo"));
|
|
76
|
-
d(this,
|
|
77
|
-
const e = /* @__PURE__ */
|
|
78
|
-
clearInterval(t(this,
|
|
79
|
-
const r = parseInt(t(this,
|
|
80
|
-
t(this,
|
|
81
|
-
clearInterval(t(this,
|
|
82
|
-
const o = parseInt(t(this,
|
|
83
|
-
t(this,
|
|
76
|
+
d(this, qt, /* @__PURE__ */ h(() => {
|
|
77
|
+
const e = /* @__PURE__ */ h((s) => {
|
|
78
|
+
clearInterval(t(this, Y)), clearInterval(t(this, F));
|
|
79
|
+
const r = parseInt(t(this, m).thumb.style.left || 0, 10);
|
|
80
|
+
t(this, X).call(this, r + s), u(this, Y, setInterval(() => {
|
|
81
|
+
clearInterval(t(this, Y)), u(this, F, setInterval(() => {
|
|
82
|
+
const o = parseInt(t(this, m).thumb.style.left || 0, 10);
|
|
83
|
+
t(this, X).call(this, o + s) || clearInterval(t(this, F));
|
|
84
84
|
}, 50));
|
|
85
85
|
}, 500));
|
|
86
|
-
}, "delayScroll"), n = /* @__PURE__ */
|
|
87
|
-
clearInterval(t(this,
|
|
86
|
+
}, "delayScroll"), n = /* @__PURE__ */ h(() => {
|
|
87
|
+
clearInterval(t(this, Y)), clearInterval(t(this, F));
|
|
88
88
|
}, "clearTimer");
|
|
89
89
|
["mouseup", "mouseleave", "touchend"].forEach((s) => {
|
|
90
|
-
t(this,
|
|
91
|
-
}), t(this,
|
|
90
|
+
t(this, m).left.addEventListener(s, n), t(this, m).right.addEventListener(s, n), t(this, m).track.addEventListener(s, n);
|
|
91
|
+
}), t(this, m).left.addEventListener("mousedown", (s) => {
|
|
92
92
|
s.button === 0 && e(-20);
|
|
93
|
-
}), t(this,
|
|
93
|
+
}), t(this, m).right.addEventListener("mousedown", (s) => {
|
|
94
94
|
s.button === 0 && e(20);
|
|
95
|
-
}), t(this,
|
|
95
|
+
}), t(this, m).left.addEventListener("touchstart", () => e(-20)), t(this, m).right.addEventListener("touchstart", () => e(20)), t(this, m).track.addEventListener("mousedown", (s) => {
|
|
96
96
|
if (s.button !== 0) return;
|
|
97
97
|
s.preventDefault();
|
|
98
|
-
const r = t(this,
|
|
99
|
-
t(this,
|
|
100
|
-
}), t(this,
|
|
98
|
+
const r = t(this, m).track.getBoundingClientRect(), o = t(this, m).thumb.clientWidth;
|
|
99
|
+
t(this, X).call(this, s.clientX - r.left - o / 2);
|
|
100
|
+
}), t(this, m).thumb.addEventListener("mousedown", (s) => {
|
|
101
101
|
if (s.button !== 0) return;
|
|
102
|
-
s.stopPropagation(), s.preventDefault(),
|
|
103
|
-
const r = /* @__PURE__ */
|
|
104
|
-
if (!t(this,
|
|
105
|
-
const
|
|
106
|
-
t(this,
|
|
107
|
-
}, "onMouseMove"), o = /* @__PURE__ */
|
|
108
|
-
|
|
102
|
+
s.stopPropagation(), s.preventDefault(), u(this, B, !0), this.shiftX = s.clientX - t(this, m).thumb.getBoundingClientRect().left;
|
|
103
|
+
const r = /* @__PURE__ */ h((l) => {
|
|
104
|
+
if (!t(this, B)) return;
|
|
105
|
+
const c = t(this, m).track.getBoundingClientRect();
|
|
106
|
+
t(this, X).call(this, l.clientX - c.left - this.shiftX);
|
|
107
|
+
}, "onMouseMove"), o = /* @__PURE__ */ h(() => {
|
|
108
|
+
u(this, B, !1), n(), document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", o), this.refresh();
|
|
109
109
|
}, "onMouseUp");
|
|
110
110
|
document.addEventListener("mousemove", r), document.addEventListener("mouseup", o);
|
|
111
111
|
});
|
|
112
112
|
}, "#init"));
|
|
113
113
|
}
|
|
114
114
|
connectedCallback() {
|
|
115
|
-
if (
|
|
115
|
+
if (u(this, I, this.closest("nine-table-sheet") || this.getRootNode().host), !t(this, I)) return;
|
|
116
116
|
this.innerHTML = `
|
|
117
117
|
<style>
|
|
118
118
|
nine-table-hscrollbar {
|
|
@@ -176,100 +176,100 @@ const ae = class ae extends HTMLElement {
|
|
|
176
176
|
<div class='ng-scroll-track'><div class='ng-scroll-thumb'></div></div>
|
|
177
177
|
<button class='ng-scroll-right' disabled><div class='ng-scroll-icon'></div></button>
|
|
178
178
|
`;
|
|
179
|
-
const e = /* @__PURE__ */
|
|
180
|
-
const n = t(this,
|
|
179
|
+
const e = /* @__PURE__ */ h(() => {
|
|
180
|
+
const n = t(this, I).querySelector(".ng-container-body");
|
|
181
181
|
if (!n) {
|
|
182
182
|
setTimeout(e, 10);
|
|
183
183
|
return;
|
|
184
184
|
}
|
|
185
|
-
|
|
185
|
+
u(this, m, {
|
|
186
186
|
container: n,
|
|
187
187
|
track: this.querySelector(".ng-scroll-track"),
|
|
188
188
|
thumb: this.querySelector(".ng-scroll-thumb"),
|
|
189
189
|
left: this.querySelector(".ng-scroll-left"),
|
|
190
190
|
right: this.querySelector(".ng-scroll-right")
|
|
191
191
|
}), n.addEventListener("scroll", () => {
|
|
192
|
-
t(this,
|
|
193
|
-
}), t(this,
|
|
192
|
+
t(this, B) || this.refresh();
|
|
193
|
+
}), t(this, qt).call(this), t(this, At).call(this), this.refresh();
|
|
194
194
|
}, "initWhenReady");
|
|
195
195
|
e();
|
|
196
196
|
}
|
|
197
197
|
disconnectedCallback() {
|
|
198
|
-
t(this,
|
|
198
|
+
t(this, V) && t(this, V).disconnect();
|
|
199
199
|
}
|
|
200
200
|
};
|
|
201
|
-
|
|
202
|
-
let
|
|
203
|
-
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar",
|
|
204
|
-
var
|
|
205
|
-
const
|
|
201
|
+
I = new WeakMap(), B = new WeakMap(), m = new WeakMap(), Y = new WeakMap(), F = new WeakMap(), V = new WeakMap(), At = new WeakMap(), X = new WeakMap(), qt = new WeakMap(), h(he, "NineTableHScrollBar");
|
|
202
|
+
let Jt = he;
|
|
203
|
+
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", Jt);
|
|
204
|
+
var N, et, U, R, ft, gt, Tt;
|
|
205
|
+
const de = class de extends HTMLElement {
|
|
206
206
|
constructor() {
|
|
207
207
|
super();
|
|
208
|
-
d(this,
|
|
209
|
-
d(this,
|
|
210
|
-
d(this,
|
|
211
|
-
d(this,
|
|
212
|
-
d(this,
|
|
213
|
-
d(this,
|
|
214
|
-
|
|
215
|
-
if (!t(this,
|
|
216
|
-
const e = t(this,
|
|
208
|
+
d(this, N);
|
|
209
|
+
d(this, et);
|
|
210
|
+
d(this, U, !1);
|
|
211
|
+
d(this, R);
|
|
212
|
+
d(this, ft, 0);
|
|
213
|
+
d(this, gt, 0);
|
|
214
|
+
E(this, "refresh", /* @__PURE__ */ h(() => {
|
|
215
|
+
if (!t(this, N) || !t(this, R)) return;
|
|
216
|
+
const e = t(this, R).container, n = t(this, R).track, s = t(this, R).thumb, r = e.clientHeight, l = (t(this, N).data.get() || []).length, c = t(this, et).getRowHeight(), a = l * c;
|
|
217
217
|
if (a <= r) {
|
|
218
|
-
s.style.display = "none", t(this,
|
|
218
|
+
s.style.display = "none", t(this, R).top.disabled = !0, t(this, R).bottom.disabled = !0;
|
|
219
219
|
return;
|
|
220
220
|
} else
|
|
221
221
|
s.style.display = "block";
|
|
222
222
|
const f = n.clientHeight;
|
|
223
223
|
if (f <= 0) return;
|
|
224
|
-
const
|
|
225
|
-
s.style.height = `${
|
|
226
|
-
const
|
|
227
|
-
let
|
|
228
|
-
|
|
229
|
-
const
|
|
230
|
-
|
|
224
|
+
const g = Math.max(Math.min(f * (r / a), f), 20);
|
|
225
|
+
s.style.height = `${g}px`;
|
|
226
|
+
const y = e.scrollTop, b = Math.max(a - r, 1);
|
|
227
|
+
let p = 0;
|
|
228
|
+
b > 0 && (p = y / b * (f - g));
|
|
229
|
+
const v = f - g;
|
|
230
|
+
p < 0 && (p = 0), p > v && (p = v), s.style.top = `${p}px`, t(this, R).top.disabled = y <= 0, t(this, R).bottom.disabled = y >= b - 1;
|
|
231
231
|
}, "refresh"));
|
|
232
|
-
d(this,
|
|
233
|
-
const e = t(this,
|
|
234
|
-
const r = (t(this,
|
|
232
|
+
d(this, Tt, /* @__PURE__ */ h(() => {
|
|
233
|
+
const e = t(this, R).container, n = /* @__PURE__ */ h(() => {
|
|
234
|
+
const r = (t(this, N).data.get() || []).length, o = t(this, et).getRowHeight();
|
|
235
235
|
return r * o;
|
|
236
236
|
}, "getContentHeight");
|
|
237
237
|
e.addEventListener("scroll", () => {
|
|
238
|
-
t(this,
|
|
239
|
-
}), t(this,
|
|
238
|
+
t(this, U) || this.refresh();
|
|
239
|
+
}), t(this, R).thumb.addEventListener("mousedown", (s) => {
|
|
240
240
|
if (s.button !== 0) return;
|
|
241
|
-
s.stopPropagation(), s.preventDefault(),
|
|
242
|
-
const r = /* @__PURE__ */
|
|
243
|
-
if (!t(this,
|
|
244
|
-
const
|
|
245
|
-
if (
|
|
246
|
-
const
|
|
247
|
-
let
|
|
248
|
-
const
|
|
249
|
-
|
|
241
|
+
s.stopPropagation(), s.preventDefault(), u(this, U, !0), u(this, ft, s.clientY), u(this, gt, e.scrollTop);
|
|
242
|
+
const r = /* @__PURE__ */ h((l) => {
|
|
243
|
+
if (!t(this, U)) return;
|
|
244
|
+
const c = t(this, R).track.getBoundingClientRect(), a = t(this, R).thumb.clientHeight, g = c.height - a, y = l.clientY - t(this, ft), b = e.clientHeight, p = n(), v = Math.max(p - b, 1);
|
|
245
|
+
if (g > 0 && v > 0) {
|
|
246
|
+
const M = y / g * v;
|
|
247
|
+
let x = t(this, gt) + M;
|
|
248
|
+
const tt = Math.max(0, p - b);
|
|
249
|
+
x < 0 && (x = 0), x > tt && (x = tt), e.scrollTop = x;
|
|
250
250
|
}
|
|
251
251
|
this.refresh();
|
|
252
|
-
}, "onMouseMove"), o = /* @__PURE__ */
|
|
253
|
-
|
|
252
|
+
}, "onMouseMove"), o = /* @__PURE__ */ h(() => {
|
|
253
|
+
u(this, U, !1), document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", o), this.refresh();
|
|
254
254
|
}, "onMouseUp");
|
|
255
255
|
document.addEventListener("mousemove", r), document.addEventListener("mouseup", o);
|
|
256
|
-
}), t(this,
|
|
257
|
-
if (s.button !== 0 || s.target === t(this,
|
|
258
|
-
const r = t(this,
|
|
259
|
-
if (a > 0 &&
|
|
260
|
-
const
|
|
261
|
-
e.scrollTop =
|
|
256
|
+
}), t(this, R).track.addEventListener("mousedown", (s) => {
|
|
257
|
+
if (s.button !== 0 || s.target === t(this, R).thumb) return;
|
|
258
|
+
const r = t(this, R).track.getBoundingClientRect(), o = t(this, R).thumb.clientHeight, l = s.clientY - r.top - o / 2, a = r.height - o, f = e.clientHeight, g = n(), y = Math.max(g - f, 1);
|
|
259
|
+
if (a > 0 && y > 0) {
|
|
260
|
+
const b = Math.max(0, Math.min(1, l / a));
|
|
261
|
+
e.scrollTop = b * y;
|
|
262
262
|
}
|
|
263
263
|
this.refresh();
|
|
264
|
-
}), t(this,
|
|
264
|
+
}), t(this, R).top.addEventListener("click", () => {
|
|
265
265
|
e.scrollTop -= 40;
|
|
266
|
-
}), t(this,
|
|
266
|
+
}), t(this, R).bottom.addEventListener("click", () => {
|
|
267
267
|
e.scrollTop += 40;
|
|
268
268
|
});
|
|
269
269
|
}, "#init"));
|
|
270
270
|
}
|
|
271
271
|
connectedCallback() {
|
|
272
|
-
|
|
272
|
+
u(this, N, this.getRootNode().host), u(this, et, this.closest("nine-table-sheet")), this.innerHTML = `
|
|
273
273
|
<style>
|
|
274
274
|
nine-table-vscrollbar {
|
|
275
275
|
display: flex;
|
|
@@ -333,45 +333,45 @@ const ce = class ce extends HTMLElement {
|
|
|
333
333
|
<div class='ng-scroll-track'><div class='ng-scroll-thumb'></div></div>
|
|
334
334
|
<button class='ng-scroll-bottom' disabled><div class='ng-scroll-icon'></div></button>
|
|
335
335
|
`;
|
|
336
|
-
const e = /* @__PURE__ */
|
|
337
|
-
const n = t(this,
|
|
336
|
+
const e = /* @__PURE__ */ h(() => {
|
|
337
|
+
const n = t(this, N).shadowRoot.querySelector(".ng-container-body .ng-part-body");
|
|
338
338
|
if (!n) {
|
|
339
339
|
setTimeout(e, 10);
|
|
340
340
|
return;
|
|
341
341
|
}
|
|
342
|
-
|
|
342
|
+
u(this, R, {
|
|
343
343
|
container: n,
|
|
344
344
|
track: this.querySelector(".ng-scroll-track"),
|
|
345
345
|
thumb: this.querySelector(".ng-scroll-thumb"),
|
|
346
346
|
top: this.querySelector(".ng-scroll-top"),
|
|
347
347
|
bottom: this.querySelector(".ng-scroll-bottom")
|
|
348
|
-
}), t(this,
|
|
348
|
+
}), t(this, Tt).call(this), this.refresh();
|
|
349
349
|
}, "initWhenReady");
|
|
350
350
|
e();
|
|
351
351
|
}
|
|
352
352
|
};
|
|
353
|
-
|
|
354
|
-
let
|
|
355
|
-
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar",
|
|
356
|
-
var
|
|
357
|
-
const
|
|
353
|
+
N = new WeakMap(), et = new WeakMap(), U = new WeakMap(), R = new WeakMap(), ft = new WeakMap(), gt = new WeakMap(), Tt = new WeakMap(), h(de, "NineTableVScrollBar");
|
|
354
|
+
let Qt = de;
|
|
355
|
+
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar", Qt);
|
|
356
|
+
var z, w, W, T, P, j, ut, it, kt, Lt, Ct, bt, yt, Ht, Mt, pt, _t, nt, mt, $t;
|
|
357
|
+
const fe = class fe {
|
|
358
358
|
constructor(i) {
|
|
359
|
-
d(this,
|
|
359
|
+
d(this, z);
|
|
360
360
|
d(this, w);
|
|
361
|
-
d(this,
|
|
362
|
-
d(this,
|
|
363
|
-
d(this,
|
|
364
|
-
d(this,
|
|
365
|
-
d(this,
|
|
366
|
-
d(this,
|
|
367
|
-
d(this,
|
|
368
|
-
|
|
361
|
+
d(this, W, /* @__PURE__ */ new Map());
|
|
362
|
+
d(this, T, null);
|
|
363
|
+
d(this, P, null);
|
|
364
|
+
d(this, j, 0);
|
|
365
|
+
d(this, ut, 40);
|
|
366
|
+
d(this, it, !1);
|
|
367
|
+
d(this, kt, 3);
|
|
368
|
+
E(this, "refresh", /* @__PURE__ */ h(() => {
|
|
369
369
|
var e;
|
|
370
370
|
const i = t(this, w).querySelector(".ng-container-body .ng-part-body");
|
|
371
|
-
i && (t(this,
|
|
371
|
+
i && (t(this, bt).call(this), t(this, nt).call(this, i.scrollTop), (e = t(this, w).querySelector("nine-table-vscrollbar")) == null || e.refresh());
|
|
372
372
|
}, "refresh"));
|
|
373
|
-
|
|
374
|
-
|
|
373
|
+
E(this, "initialize", /* @__PURE__ */ h(() => {
|
|
374
|
+
u(this, T, null), t(this, W).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((s) => {
|
|
375
375
|
const r = t(this, w).querySelector(s);
|
|
376
376
|
if (!r) return;
|
|
377
377
|
const o = r.querySelector(".ng-part-body table");
|
|
@@ -379,57 +379,58 @@ const he = class he {
|
|
|
379
379
|
const l = o.querySelector("tbody.bindable-tbody");
|
|
380
380
|
if (!l) return;
|
|
381
381
|
const a = Array.from(l.querySelectorAll("tr")).map((f) => f.cloneNode(!0));
|
|
382
|
-
t(this,
|
|
382
|
+
t(this, W).set(s, a);
|
|
383
383
|
});
|
|
384
384
|
const i = t(this, w).querySelector(".ng-container-body .ng-part-body"), e = t(this, w).querySelector(".ng-container-left .ng-part-body"), n = t(this, w).querySelector(".ng-container-right .ng-part-body");
|
|
385
385
|
if (i) {
|
|
386
|
-
t(this,
|
|
387
|
-
let s =
|
|
388
|
-
const r = /* @__PURE__ */
|
|
389
|
-
var
|
|
390
|
-
e && e.scrollTop !== o && (e.scrollTop = o), n && n.scrollTop !== o && (n.scrollTop = o), t(this,
|
|
386
|
+
t(this, Ct).call(this, i), t(this, pt).call(this), t(this, bt).call(this), t(this, nt).call(this, i.scrollTop);
|
|
387
|
+
let s = !1;
|
|
388
|
+
const r = /* @__PURE__ */ h((o, l) => {
|
|
389
|
+
var c;
|
|
390
|
+
s || (s = !0, i && i.scrollTop !== o && (i.scrollTop = o), e && e.scrollTop !== o && (e.scrollTop = o), n && n.scrollTop !== o && (n.scrollTop = o), t(this, nt).call(this, o), (c = t(this, w).querySelector("nine-table-vscrollbar")) == null || c.refresh(), s = !1);
|
|
391
391
|
}, "syncScroll");
|
|
392
|
-
i
|
|
393
|
-
|
|
394
|
-
|
|
392
|
+
[i, e, n].forEach((o) => {
|
|
393
|
+
o && o.addEventListener("scroll", () => {
|
|
394
|
+
r(o.scrollTop);
|
|
395
|
+
});
|
|
395
396
|
});
|
|
396
397
|
}
|
|
397
398
|
}, "initialize"));
|
|
398
|
-
d(this,
|
|
399
|
-
const n = t(this,
|
|
399
|
+
d(this, Lt, /* @__PURE__ */ h((i, e) => {
|
|
400
|
+
const n = t(this, W).get(e);
|
|
400
401
|
if (!n || n.length === 0) return;
|
|
401
402
|
const s = i.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
402
403
|
if (!s) return;
|
|
403
404
|
s.querySelectorAll("tr:not(.nodata)").forEach((l) => l.remove());
|
|
404
405
|
const r = s.querySelector("tr.nodata"), o = document.createDocumentFragment();
|
|
405
|
-
for (let l = 0; l < t(this,
|
|
406
|
-
n.forEach((
|
|
407
|
-
o.appendChild(
|
|
406
|
+
for (let l = 0; l < t(this, ut); l++)
|
|
407
|
+
n.forEach((c) => {
|
|
408
|
+
o.appendChild(c.cloneNode(!0));
|
|
408
409
|
});
|
|
409
410
|
r ? r.before(o) : s.appendChild(o);
|
|
410
411
|
}, "#renderRows"));
|
|
411
|
-
d(this,
|
|
412
|
-
if (t(this,
|
|
413
|
-
return t(this,
|
|
414
|
-
const e = t(this,
|
|
412
|
+
d(this, Ct, /* @__PURE__ */ h((i) => {
|
|
413
|
+
if (t(this, T) !== null && t(this, T) > 0)
|
|
414
|
+
return t(this, T);
|
|
415
|
+
const e = t(this, W).get(".ng-container-body");
|
|
415
416
|
if (!e || e.length === 0) return 24;
|
|
416
417
|
const n = i.querySelector("tbody.bindable-tbody");
|
|
417
418
|
if (!n) return 24;
|
|
418
|
-
n.querySelectorAll("tr:not(.nodata)").forEach((
|
|
419
|
+
n.querySelectorAll("tr:not(.nodata)").forEach((y) => y.remove());
|
|
419
420
|
const s = n.querySelector("tr.nodata"), r = document.createDocumentFragment();
|
|
420
|
-
e.forEach((
|
|
421
|
-
r.appendChild(
|
|
421
|
+
e.forEach((y) => {
|
|
422
|
+
r.appendChild(y.cloneNode(!0));
|
|
422
423
|
}), s ? s.before(r) : n.appendChild(r);
|
|
423
|
-
const o = t(this, w), l = o.style.display,
|
|
424
|
+
const o = t(this, w), l = o.style.display, c = o.style.visibility, a = o.style.position;
|
|
424
425
|
(l === "none" || window.getComputedStyle(o).display === "none") && (o.style.display = "block", o.style.visibility = "hidden", o.style.position = "absolute");
|
|
425
426
|
let f = 0;
|
|
426
|
-
const
|
|
427
|
-
return
|
|
428
|
-
f +=
|
|
429
|
-
}),
|
|
427
|
+
const g = n.querySelectorAll("tr:not(.nodata)");
|
|
428
|
+
return g.forEach((y) => {
|
|
429
|
+
f += y.offsetHeight || y.getBoundingClientRect().height;
|
|
430
|
+
}), g.forEach((y) => y.remove()), o.style.display = l, o.style.visibility = c, o.style.position = a, u(this, T, f > 0 ? f : 24), t(this, yt).call(this), t(this, T);
|
|
430
431
|
}, "#measureAndCacheHeight"));
|
|
431
|
-
d(this,
|
|
432
|
-
const e = (t(this,
|
|
432
|
+
d(this, bt, /* @__PURE__ */ h(() => {
|
|
433
|
+
const e = (t(this, z).data.get() || []).length, n = t(this, T) || 24, s = e * n;
|
|
433
434
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((r) => {
|
|
434
435
|
const o = t(this, w).querySelector(r);
|
|
435
436
|
if (!o) return;
|
|
@@ -437,28 +438,41 @@ const he = class he {
|
|
|
437
438
|
l && (l.style.height = `${s}px`);
|
|
438
439
|
});
|
|
439
440
|
}, "#updateVirtualScrollHeight"));
|
|
440
|
-
d(this,
|
|
441
|
-
if (t(this,
|
|
442
|
-
const i = Math.ceil(t(this,
|
|
443
|
-
|
|
441
|
+
d(this, yt, /* @__PURE__ */ h(() => {
|
|
442
|
+
if (t(this, j) > 0 && t(this, T) > 0) {
|
|
443
|
+
const i = Math.ceil(t(this, j) / t(this, T));
|
|
444
|
+
u(this, ut, i + t(this, kt));
|
|
444
445
|
}
|
|
445
446
|
}, "#updateRowCount"));
|
|
446
|
-
d(this,
|
|
447
|
-
var
|
|
447
|
+
d(this, Ht, /* @__PURE__ */ h(() => {
|
|
448
|
+
var l, c, a, f, g, y;
|
|
448
449
|
const i = t(this, w).querySelector(".ng-container-left .ng-part-body table"), e = t(this, w).querySelector(".ng-container-body .ng-part-body table"), n = t(this, w).querySelector(".ng-container-right .ng-part-body table");
|
|
449
|
-
if (
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
450
|
+
if (e) {
|
|
451
|
+
const b = i ? Array.from(i.querySelectorAll("tbody tr")) : [], p = Array.from(e.querySelectorAll("tbody tr")), v = n ? Array.from(n.querySelectorAll("tbody tr")) : [], M = Math.max(b.length, p.length, v.length);
|
|
452
|
+
for (let x = 0; x < M; x++) {
|
|
453
|
+
const tt = [
|
|
454
|
+
((l = b[x]) == null ? void 0 : l.getBoundingClientRect().height) || 0,
|
|
455
|
+
((c = p[x]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
|
|
456
|
+
((a = v[x]) == null ? void 0 : a.getBoundingClientRect().height) || 0
|
|
457
|
+
], O = Math.max(...tt);
|
|
458
|
+
O > 0 && (b[x] && (b[x].style.height = `${O}px`), p[x] && (p[x].style.height = `${O}px`), v[x] && (v[x].style.height = `${O}px`));
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
const s = t(this, w).querySelector(".ng-container-left .ng-part-footer table"), r = t(this, w).querySelector(".ng-container-body .ng-part-footer table"), o = t(this, w).querySelector(".ng-container-right .ng-part-footer table");
|
|
462
|
+
if (r) {
|
|
463
|
+
const b = s ? Array.from(s.querySelectorAll("tfoot tr")) : [], p = Array.from(r.querySelectorAll("tfoot tr")), v = o ? Array.from(o.querySelectorAll("tfoot tr")) : [], M = Math.max(b.length, p.length, v.length);
|
|
464
|
+
for (let x = 0; x < M; x++) {
|
|
465
|
+
const tt = [
|
|
466
|
+
((f = b[x]) == null ? void 0 : f.getBoundingClientRect().height) || 0,
|
|
467
|
+
((g = p[x]) == null ? void 0 : g.getBoundingClientRect().height) || 0,
|
|
468
|
+
((y = v[x]) == null ? void 0 : y.getBoundingClientRect().height) || 0
|
|
469
|
+
], O = Math.max(...tt);
|
|
470
|
+
O > 0 && (b[x] && (b[x].style.height = `${O}px`), p[x] && (p[x].style.height = `${O}px`), v[x] && (v[x].style.height = `${O}px`));
|
|
471
|
+
}
|
|
458
472
|
}
|
|
459
473
|
}, "#syncRowHeights"));
|
|
460
|
-
d(this,
|
|
461
|
-
!t(this, w) || !(t(this, w) instanceof HTMLElement) || (
|
|
474
|
+
d(this, Mt, /* @__PURE__ */ h(() => {
|
|
475
|
+
!t(this, w) || !(t(this, w) instanceof HTMLElement) || (u(this, P, new ResizeObserver((i) => {
|
|
462
476
|
for (const e of i) {
|
|
463
477
|
const n = e.target;
|
|
464
478
|
if (!n.classList.contains("active")) continue;
|
|
@@ -467,102 +481,102 @@ const he = class he {
|
|
|
467
481
|
let r = 0;
|
|
468
482
|
const o = n.querySelector(".ng-part-header"), l = n.querySelector(".ng-part-footer");
|
|
469
483
|
o && (r += o.offsetHeight), l && (r += l.offsetHeight);
|
|
470
|
-
const
|
|
471
|
-
t(this,
|
|
484
|
+
const c = Math.max(s - r, 100);
|
|
485
|
+
t(this, j) !== c && (u(this, j, c), t(this, yt).call(this), t(this, T) !== null && t(this, pt).call(this));
|
|
472
486
|
}
|
|
473
487
|
}
|
|
474
|
-
})), t(this,
|
|
488
|
+
})), t(this, P).observe(t(this, w)));
|
|
475
489
|
}, "#initResizeObserver"));
|
|
476
|
-
d(this,
|
|
490
|
+
d(this, pt, /* @__PURE__ */ h(() => {
|
|
477
491
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((i) => {
|
|
478
492
|
const e = t(this, w).querySelector(i);
|
|
479
|
-
e && e.querySelector(".ng-part-body tbody.bindable-tbody") && t(this,
|
|
480
|
-
}), t(this,
|
|
493
|
+
e && e.querySelector(".ng-part-body tbody.bindable-tbody") && t(this, Lt).call(this, e, i);
|
|
494
|
+
}), t(this, $t).call(this), t(this, Ht).call(this);
|
|
481
495
|
}, "#renderAllContainers"));
|
|
482
|
-
d(this,
|
|
496
|
+
d(this, _t, /* @__PURE__ */ h((i) => {
|
|
483
497
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((e) => {
|
|
484
498
|
var a;
|
|
485
499
|
const n = t(this, w).querySelector(e);
|
|
486
500
|
if (!n) return;
|
|
487
501
|
const s = n.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
488
502
|
if (!s) return;
|
|
489
|
-
const r = Array.from(s.querySelectorAll("tr:not(.nodata)")), o = ((a = t(this,
|
|
490
|
-
r.forEach((f,
|
|
491
|
-
const
|
|
492
|
-
if (
|
|
503
|
+
const r = Array.from(s.querySelectorAll("tr:not(.nodata)")), o = ((a = t(this, W).get(e)) == null ? void 0 : a.length) || 1, c = (t(this, z).data.get() || []).length;
|
|
504
|
+
r.forEach((f, g) => {
|
|
505
|
+
const y = i + Math.floor(g / o);
|
|
506
|
+
if (y >= c) {
|
|
493
507
|
f.style.display = "none";
|
|
494
508
|
return;
|
|
495
509
|
}
|
|
496
|
-
const
|
|
497
|
-
f.style.display = "", t(this,
|
|
510
|
+
const b = t(this, z).data.get(y);
|
|
511
|
+
f.style.display = "", t(this, mt).call(this, f, b, y);
|
|
498
512
|
});
|
|
499
513
|
});
|
|
500
514
|
}, "#adjustBufferRows"));
|
|
501
|
-
d(this,
|
|
502
|
-
var
|
|
503
|
-
const e = t(this,
|
|
515
|
+
d(this, nt, /* @__PURE__ */ h((i) => {
|
|
516
|
+
var c;
|
|
517
|
+
const e = t(this, T);
|
|
504
518
|
if (!e || e <= 0) return;
|
|
505
|
-
const s = (t(this,
|
|
519
|
+
const s = (t(this, z).data.get() || []).length, r = Math.max(0, Math.floor(i / e)), o = r * e, l = ((c = t(this, W).get(".ng-container-body")) == null ? void 0 : c.length) || 1;
|
|
506
520
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((a) => {
|
|
507
521
|
const f = t(this, w).querySelector(a);
|
|
508
522
|
if (!f) return;
|
|
509
|
-
const
|
|
510
|
-
if (!
|
|
511
|
-
|
|
512
|
-
const
|
|
513
|
-
if (
|
|
514
|
-
|
|
523
|
+
const g = f.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
524
|
+
if (!g) return;
|
|
525
|
+
g.style.transform = `translateY(${o}px)`, Array.from(g.querySelectorAll("tr:not(.nodata)")).forEach((b, p) => {
|
|
526
|
+
const v = r + Math.floor(p / l);
|
|
527
|
+
if (v >= s) {
|
|
528
|
+
b.style.display = "none";
|
|
515
529
|
return;
|
|
516
530
|
}
|
|
517
|
-
const
|
|
518
|
-
|
|
531
|
+
const M = t(this, z).data.get(v);
|
|
532
|
+
b.style.display = "", t(this, mt).call(this, b, M, v);
|
|
519
533
|
});
|
|
520
|
-
}), t(this,
|
|
521
|
-
t(this,
|
|
534
|
+
}), t(this, it) || (u(this, it, !0), setTimeout(() => {
|
|
535
|
+
t(this, _t).call(this, r), u(this, it, !1);
|
|
522
536
|
}, 0));
|
|
523
537
|
}, "#handleScroll"));
|
|
524
|
-
d(this,
|
|
538
|
+
d(this, mt, /* @__PURE__ */ h((i, e, n) => {
|
|
525
539
|
i.dataset.row = n, Array.from(i.cells).forEach((s, r) => {
|
|
526
540
|
const o = s.dataset.bind;
|
|
527
541
|
o && e && e[o] !== void 0 ? s.textContent = e[o] : s.textContent = e ? e[Object.keys(e)[r]] ?? `R${n}C${r}` : `ν ${n + 1}`, s.dataset.row = n;
|
|
528
542
|
});
|
|
529
543
|
}, "#bindRowData"));
|
|
530
|
-
d(this,
|
|
531
|
-
var
|
|
544
|
+
d(this, $t, /* @__PURE__ */ h(() => {
|
|
545
|
+
var c, a, f;
|
|
532
546
|
const i = t(this, w).querySelector(".ng-container-left .ng-part-header table"), e = t(this, w).querySelector(".ng-container-body .ng-part-header table"), n = t(this, w).querySelector(".ng-container-right .ng-part-header table");
|
|
533
547
|
if (!e) return;
|
|
534
548
|
const s = i ? Array.from(i.querySelectorAll("tr")) : [], r = Array.from(e.querySelectorAll("tr")), o = n ? Array.from(n.querySelectorAll("tr")) : [], l = Math.max(s.length, r.length, o.length);
|
|
535
|
-
for (let
|
|
536
|
-
const
|
|
537
|
-
((
|
|
538
|
-
((a = r[
|
|
539
|
-
((f = o[
|
|
540
|
-
],
|
|
541
|
-
|
|
549
|
+
for (let g = 0; g < l; g++) {
|
|
550
|
+
const y = [
|
|
551
|
+
((c = s[g]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
|
|
552
|
+
((a = r[g]) == null ? void 0 : a.getBoundingClientRect().height) || 0,
|
|
553
|
+
((f = o[g]) == null ? void 0 : f.getBoundingClientRect().height) || 0
|
|
554
|
+
], b = Math.max(...y);
|
|
555
|
+
b > 0 && (s[g] && (s[g].style.height = `${b}px`), r[g] && (r[g].style.height = `${b}px`), o[g] && (o[g].style.height = `${b}px`));
|
|
542
556
|
}
|
|
543
557
|
}, "#syncHeaderHeights"));
|
|
544
|
-
|
|
545
|
-
t(this,
|
|
558
|
+
E(this, "destroy", /* @__PURE__ */ h(() => {
|
|
559
|
+
t(this, P) && (t(this, P).disconnect(), u(this, P, null));
|
|
546
560
|
}, "destroy"));
|
|
547
|
-
|
|
561
|
+
u(this, z, i.getRootNode().host), u(this, w, i), t(this, Mt).call(this);
|
|
548
562
|
}
|
|
549
563
|
getRowHeight() {
|
|
550
|
-
return t(this,
|
|
564
|
+
return t(this, T);
|
|
551
565
|
}
|
|
552
566
|
templateLength(i = ".ng-container-body") {
|
|
553
567
|
var e;
|
|
554
|
-
return ((e = t(this,
|
|
568
|
+
return ((e = t(this, W).get(i)) == null ? void 0 : e.length) || 1;
|
|
555
569
|
}
|
|
556
570
|
};
|
|
557
|
-
|
|
558
|
-
let
|
|
559
|
-
var
|
|
560
|
-
const
|
|
571
|
+
z = new WeakMap(), w = new WeakMap(), W = new WeakMap(), T = new WeakMap(), P = new WeakMap(), j = new WeakMap(), ut = new WeakMap(), it = new WeakMap(), kt = new WeakMap(), Lt = new WeakMap(), Ct = new WeakMap(), bt = new WeakMap(), yt = new WeakMap(), Ht = new WeakMap(), Mt = new WeakMap(), pt = new WeakMap(), _t = new WeakMap(), nt = new WeakMap(), mt = new WeakMap(), $t = new WeakMap(), h(fe, "RowManager");
|
|
572
|
+
let te = fe;
|
|
573
|
+
var It, st;
|
|
574
|
+
const _ = class _ {
|
|
561
575
|
/**
|
|
562
576
|
* π― λ μ΄μμ λ΄μ μ¬λ¬ rawTables λ°°μ΄μ μΌκ΄λ‘ λ°μ λ¨μΌ λ§μ€ν° ν
νλ¦ΏμΌλ‘ μ¬μ μ»΄νμΌν©λλ€.
|
|
563
577
|
*/
|
|
564
578
|
static compileAll(i) {
|
|
565
|
-
return Array.isArray(i) ? i.map((e) =>
|
|
579
|
+
return Array.isArray(i) ? i.map((e) => _.compile(e)) : [];
|
|
566
580
|
}
|
|
567
581
|
/**
|
|
568
582
|
* π― λ¨μΌ μλ³Έ ν
μ΄λΈμ λ°μ κΈ°λ³Έ ꡬ쑰 보μ λ° 2μ°¨μ 격μ μΈλ±μ€ μ¬μ λΆμ¬ μλ£λ λ§μ€ν° ν
μ΄λΈ λ°ν
|
|
@@ -571,15 +585,15 @@ const H = class H {
|
|
|
571
585
|
var s, r, o, l;
|
|
572
586
|
if (!i) return null;
|
|
573
587
|
const e = i.cloneNode(!0);
|
|
574
|
-
return t(s =
|
|
575
|
-
const f =
|
|
576
|
-
f && e.querySelectorAll(`thead [data-col="${a}"], tbody [data-col="${a}"], tfoot [data-col="${a}"]`).forEach((
|
|
577
|
-
|
|
588
|
+
return t(s = _, It).call(s, e), t(r = _, st).call(r, e, "thead"), t(o = _, st).call(o, e, "tbody"), t(l = _, st).call(l, e, "tfoot"), Array.from(e.querySelectorAll("colgroup col")).forEach((c, a) => {
|
|
589
|
+
const f = c.getAttribute("fixed");
|
|
590
|
+
f && e.querySelectorAll(`thead [data-col="${a}"], tbody [data-col="${a}"], tfoot [data-col="${a}"]`).forEach((g) => {
|
|
591
|
+
g.setAttribute("fixed", f);
|
|
578
592
|
});
|
|
579
593
|
}), e;
|
|
580
594
|
}
|
|
581
595
|
};
|
|
582
|
-
|
|
596
|
+
It = new WeakMap(), st = new WeakMap(), h(_, "TableCompiler"), d(_, It, /* @__PURE__ */ h((i) => {
|
|
583
597
|
if (!i.querySelector("colgroup")) {
|
|
584
598
|
const e = i.querySelector("tbody tr") || i.querySelector("tr"), n = e ? e.querySelectorAll("th, td").length : 1, s = document.createElement("colgroup"), r = Math.max(Math.floor(i.clientWidth / n), 100);
|
|
585
599
|
for (let o = 0; o < n; o++) {
|
|
@@ -593,52 +607,52 @@ _t = new WeakMap(), et = new WeakMap(), c(H, "TableCompiler"), d(H, _t, /* @__PU
|
|
|
593
607
|
n ? n.after(e) : i.prepend(e);
|
|
594
608
|
}
|
|
595
609
|
i.classList.add("nine-table-element"), i.style.display = "table";
|
|
596
|
-
}, "#ensureTableStructure")), d(
|
|
610
|
+
}, "#ensureTableStructure")), d(_, st, /* @__PURE__ */ h((i, e) => {
|
|
597
611
|
const n = Array.from(i.querySelectorAll(e + " tr")), s = Array.from(i.querySelectorAll(e + " th," + e + " td")), r = n.length;
|
|
598
612
|
if (r === 0 || s.length === 0) return;
|
|
599
613
|
let o = 0;
|
|
600
|
-
s.forEach((
|
|
601
|
-
o +=
|
|
614
|
+
s.forEach((c) => {
|
|
615
|
+
o += c.colSpan || 1;
|
|
602
616
|
});
|
|
603
617
|
const l = Array.from(Array(r), () => Array(o).fill(null));
|
|
604
|
-
n.forEach((
|
|
605
|
-
const a =
|
|
618
|
+
n.forEach((c) => {
|
|
619
|
+
const a = c.sectionRowIndex;
|
|
606
620
|
let f = 0;
|
|
607
|
-
Array.from(
|
|
608
|
-
for (let
|
|
609
|
-
if (l[a][
|
|
610
|
-
f =
|
|
621
|
+
Array.from(c.querySelectorAll("th,td")).forEach((g) => {
|
|
622
|
+
for (let p = 0; p < l[a].length; p++)
|
|
623
|
+
if (l[a][p] === null) {
|
|
624
|
+
f = p;
|
|
611
625
|
break;
|
|
612
626
|
}
|
|
613
|
-
const
|
|
614
|
-
for (let
|
|
615
|
-
for (let
|
|
616
|
-
a +
|
|
627
|
+
const y = g.rowSpan || 1, b = g.colSpan || 1;
|
|
628
|
+
for (let p = 0; p < y; p++)
|
|
629
|
+
for (let v = 0; v < b; v++)
|
|
630
|
+
a + p < r && f + v < o && (l[a + p][f + v] = p === 0 && v === 0 ? "1" : "0");
|
|
617
631
|
});
|
|
618
|
-
}), n.forEach((
|
|
619
|
-
const a =
|
|
620
|
-
Array.from(
|
|
621
|
-
for (let
|
|
622
|
-
if (l[a][
|
|
623
|
-
f.dataset.col =
|
|
632
|
+
}), n.forEach((c) => {
|
|
633
|
+
const a = c.sectionRowIndex;
|
|
634
|
+
Array.from(c.querySelectorAll("th,td")).forEach((f) => {
|
|
635
|
+
for (let g = 0; g < l[a].length; g++)
|
|
636
|
+
if (l[a][g] === "1") {
|
|
637
|
+
f.dataset.col = g, l[a][g] = "0";
|
|
624
638
|
break;
|
|
625
639
|
}
|
|
626
640
|
});
|
|
627
641
|
});
|
|
628
642
|
}, "#resetColIndex"));
|
|
629
|
-
let
|
|
630
|
-
var
|
|
631
|
-
const
|
|
643
|
+
let ee = _;
|
|
644
|
+
var Wt, K, Z, Ot, zt, ot, Bt, Nt;
|
|
645
|
+
const dt = class dt extends HTMLElement {
|
|
632
646
|
constructor() {
|
|
633
647
|
super();
|
|
634
|
-
d(this,
|
|
635
|
-
d(this,
|
|
636
|
-
d(this,
|
|
637
|
-
|
|
648
|
+
d(this, Wt);
|
|
649
|
+
d(this, K, null);
|
|
650
|
+
d(this, Z);
|
|
651
|
+
E(this, "invalidate", /* @__PURE__ */ h(() => {
|
|
638
652
|
var e, n;
|
|
639
|
-
t(this,
|
|
653
|
+
t(this, Z).refresh(), (e = this.querySelector("nine-table-hscrollbar")) == null || e.refresh(), (n = this.querySelector("nine-table-vscrollbar")) == null || n.refresh();
|
|
640
654
|
}, "invalidate"));
|
|
641
|
-
d(this,
|
|
655
|
+
d(this, Ot, /* @__PURE__ */ h(() => {
|
|
642
656
|
[
|
|
643
657
|
{ selector: ".ng-container-body", type: null },
|
|
644
658
|
{ selector: ".ng-container-left", type: "left" },
|
|
@@ -648,18 +662,18 @@ const ct = class ct extends HTMLElement {
|
|
|
648
662
|
if (!r) return;
|
|
649
663
|
r.innerHTML = "";
|
|
650
664
|
const o = document.createElement("div");
|
|
651
|
-
o.className = "ng-part-header", o.appendChild(t(this,
|
|
665
|
+
o.className = "ng-part-header", o.appendChild(t(this, ot).call(this, t(this, K), s, "header"));
|
|
652
666
|
const l = document.createElement("div");
|
|
653
667
|
l.className = "ng-part-body";
|
|
654
|
-
const
|
|
655
|
-
|
|
668
|
+
const c = document.createElement("div");
|
|
669
|
+
c.className = "ng-scroll-content", c.style.position = "relative", c.style.width = "100%", c.appendChild(t(this, ot).call(this, t(this, K), s, "body"));
|
|
656
670
|
const a = document.createElement("div");
|
|
657
|
-
a.className = "ng-virtual-spacer", a.style.width = "100%", a.style.pointerEvents = "none",
|
|
671
|
+
a.className = "ng-virtual-spacer", a.style.width = "100%", a.style.pointerEvents = "none", c.appendChild(a), l.appendChild(c);
|
|
658
672
|
const f = document.createElement("div");
|
|
659
|
-
f.className = "ng-part-footer", f.appendChild(t(this,
|
|
673
|
+
f.className = "ng-part-footer", f.appendChild(t(this, ot).call(this, t(this, K), s, "footer")), r.appendChild(o), r.appendChild(l), r.appendChild(f);
|
|
660
674
|
});
|
|
661
675
|
}, "#renderSplitContainers"));
|
|
662
|
-
d(this,
|
|
676
|
+
d(this, zt, /* @__PURE__ */ h(() => {
|
|
663
677
|
["left", "right", "body"].forEach((e) => {
|
|
664
678
|
const n = this.querySelector(`.ng-container-${e}`), s = n == null ? void 0 : n.querySelectorAll("table");
|
|
665
679
|
if (!n || !s || s.length === 0) return;
|
|
@@ -670,20 +684,20 @@ const ct = class ct extends HTMLElement {
|
|
|
670
684
|
}), e === "body" ? n.style.flex = "1" : (n.style.flex = `0 0 ${r}px`, n.style.width = `${r}px`);
|
|
671
685
|
});
|
|
672
686
|
}, "#updateContainerWidths"));
|
|
673
|
-
|
|
674
|
-
e && (
|
|
687
|
+
E(this, "generate", /* @__PURE__ */ h((e) => {
|
|
688
|
+
e && (u(this, K, ee.compile(e)), t(this, Ot).call(this), t(this, zt).call(this), t(this, Z).initialize(), setTimeout(() => {
|
|
675
689
|
var n;
|
|
676
690
|
(n = this.querySelector("nine-table-hscrollbar")) == null || n.refresh();
|
|
677
691
|
}, 0));
|
|
678
692
|
}, "generate"));
|
|
679
|
-
d(this,
|
|
680
|
-
const r = e.cloneNode(!0), o = r.querySelector("thead"), l = r.querySelector("tbody"),
|
|
693
|
+
d(this, ot, /* @__PURE__ */ h((e, n, s) => {
|
|
694
|
+
const r = e.cloneNode(!0), o = r.querySelector("thead"), l = r.querySelector("tbody"), c = r.querySelector("tfoot");
|
|
681
695
|
if (s === "header") {
|
|
682
|
-
if (l && l.remove(),
|
|
696
|
+
if (l && l.remove(), c && c.remove(), e.querySelector("tbody")) {
|
|
683
697
|
const f = document.createElement("tbody");
|
|
684
698
|
f.className = "fixed-tbody", r.appendChild(f);
|
|
685
699
|
}
|
|
686
|
-
} else s === "body" ? (o && o.remove(),
|
|
700
|
+
} else s === "body" ? (o && o.remove(), c && c.remove(), l && (l.className = "bindable-tbody")) : s === "footer" && (o && o.remove(), l && l.remove());
|
|
687
701
|
return n === "left" ? r.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((a) => {
|
|
688
702
|
a.getAttribute("fixed") !== "left" && a.remove();
|
|
689
703
|
}) : n === "right" ? r.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((a) => {
|
|
@@ -692,20 +706,20 @@ const ct = class ct extends HTMLElement {
|
|
|
692
706
|
a.remove();
|
|
693
707
|
}), r;
|
|
694
708
|
}, "#createSplitTable"));
|
|
695
|
-
|
|
696
|
-
|
|
709
|
+
E(this, "getRowHeight", /* @__PURE__ */ h(() => t(this, Z).getRowHeight(), "getRowHeight"));
|
|
710
|
+
E(this, "scrollToX", /* @__PURE__ */ h((e) => {
|
|
697
711
|
const n = this.querySelector(".ng-container-body .ng-part-body");
|
|
698
712
|
n && (n.scrollLeft = e);
|
|
699
713
|
}, "scrollToX"));
|
|
700
|
-
|
|
714
|
+
E(this, "scrollToY", /* @__PURE__ */ h((e) => {
|
|
701
715
|
const n = this.querySelector(".ng-container-body .ng-part-body");
|
|
702
716
|
n && (n.scrollTop = e);
|
|
703
717
|
}, "scrollToY"));
|
|
704
|
-
d(this,
|
|
705
|
-
t(this,
|
|
718
|
+
d(this, Bt, /* @__PURE__ */ h(() => {
|
|
719
|
+
t(this, Nt).call(this);
|
|
706
720
|
}, "#init"));
|
|
707
|
-
d(this,
|
|
708
|
-
const e =
|
|
721
|
+
d(this, Nt, /* @__PURE__ */ h(() => {
|
|
722
|
+
const e = dt.SCROLLBAR_SIZE;
|
|
709
723
|
this.innerHTML = `
|
|
710
724
|
<style>
|
|
711
725
|
nine-table-sheet {
|
|
@@ -846,55 +860,55 @@ const ct = class ct extends HTMLElement {
|
|
|
846
860
|
</div>
|
|
847
861
|
`;
|
|
848
862
|
}, "#render"));
|
|
849
|
-
|
|
863
|
+
u(this, Z, new te(this)), u(this, Wt, this.getRootNode().host);
|
|
850
864
|
}
|
|
851
865
|
connectedCallback() {
|
|
852
|
-
t(this,
|
|
866
|
+
t(this, Bt).call(this);
|
|
853
867
|
}
|
|
854
868
|
disconnectedCallback() {
|
|
855
|
-
this.innerHTML = "",
|
|
869
|
+
this.innerHTML = "", ht.log("NineTableSheet destroyed.");
|
|
856
870
|
}
|
|
857
871
|
};
|
|
858
|
-
|
|
859
|
-
let
|
|
860
|
-
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet",
|
|
861
|
-
var
|
|
862
|
-
const
|
|
872
|
+
Wt = new WeakMap(), K = new WeakMap(), Z = new WeakMap(), Ot = new WeakMap(), zt = new WeakMap(), ot = new WeakMap(), Bt = new WeakMap(), Nt = new WeakMap(), h(dt, "NineTableSheet"), E(dt, "SCROLLBAR_SIZE", 16);
|
|
873
|
+
let Rt = dt;
|
|
874
|
+
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", Rt);
|
|
875
|
+
var Pt, xt;
|
|
876
|
+
const ge = class ge extends HTMLElement {
|
|
863
877
|
constructor() {
|
|
864
878
|
super();
|
|
865
|
-
d(this,
|
|
879
|
+
d(this, Pt, /* @__PURE__ */ h(() => {
|
|
866
880
|
var e;
|
|
867
881
|
(e = this.querySelector(".nine-tab-bar")) == null || e.addEventListener("click", (n) => {
|
|
868
882
|
var o;
|
|
869
883
|
const s = n.ctrlKey || n.metaKey || n.shiftKey, r = parseInt((o = n.target.closest(".nine-tab-item")) == null ? void 0 : o.dataset.index, 10);
|
|
870
|
-
t(this,
|
|
871
|
-
}), t(this,
|
|
884
|
+
t(this, xt).call(this, r, s);
|
|
885
|
+
}), t(this, xt).call(this, 0, !1);
|
|
872
886
|
}, "#init"));
|
|
873
|
-
d(this,
|
|
874
|
-
const s = /* @__PURE__ */
|
|
887
|
+
d(this, xt, /* @__PURE__ */ h((e, n = !1) => {
|
|
888
|
+
const s = /* @__PURE__ */ h(() => {
|
|
875
889
|
const f = Array.from(this.querySelectorAll("nine-table-sheet"));
|
|
876
|
-
Array.from(this.querySelectorAll("nine-splitter")).forEach((
|
|
877
|
-
const
|
|
878
|
-
|
|
879
|
-
const
|
|
880
|
-
|
|
890
|
+
Array.from(this.querySelectorAll("nine-splitter")).forEach((b) => b.style.setProperty("display", "none"));
|
|
891
|
+
const y = f.filter((b) => b.classList.contains("active"));
|
|
892
|
+
y.length < 2 || y.forEach((b) => {
|
|
893
|
+
const p = parseInt(b.getAttribute("data-index"), 10), v = this.querySelector(`nine-splitter[data-split-index="${p}"]`), M = f[p + 1];
|
|
894
|
+
v && M && M.classList.contains("active") && v.style.setProperty("display", "flex");
|
|
881
895
|
});
|
|
882
|
-
}, "updateSplitters"), r = this.querySelector(".nine-tab-bar"), o = this.querySelector("nine-table-sheets-body"), l = r.querySelectorAll(".nine-tab-item"),
|
|
896
|
+
}, "updateSplitters"), r = this.querySelector(".nine-tab-bar"), o = this.querySelector("nine-table-sheets-body"), l = r.querySelectorAll(".nine-tab-item"), c = o.querySelectorAll("nine-table-sheet");
|
|
883
897
|
if (!l[e]) return;
|
|
884
898
|
if (!n)
|
|
885
|
-
l.forEach((f,
|
|
886
|
-
f.classList.toggle("active",
|
|
887
|
-
}),
|
|
888
|
-
const
|
|
889
|
-
f.classList.toggle("active",
|
|
899
|
+
l.forEach((f, g) => {
|
|
900
|
+
f.classList.toggle("active", g === e);
|
|
901
|
+
}), c.forEach((f, g) => {
|
|
902
|
+
const y = g === e;
|
|
903
|
+
f.classList.toggle("active", y), f.style.flex = y ? "1 1 100%" : "";
|
|
890
904
|
});
|
|
891
905
|
else {
|
|
892
|
-
const f = l[e],
|
|
893
|
-
if (f.classList.contains("active") &&
|
|
906
|
+
const f = l[e], g = r.querySelectorAll(".nine-tab-item.active");
|
|
907
|
+
if (f.classList.contains("active") && g.length <= 1)
|
|
894
908
|
return;
|
|
895
909
|
f.classList.toggle("active");
|
|
896
|
-
const
|
|
897
|
-
|
|
910
|
+
const y = o.querySelector(`nine-table-sheet[data-index="${e}"]`);
|
|
911
|
+
y && (y.classList.toggle("active"), y.classList.contains("active") || (y.style.flex = ""));
|
|
898
912
|
}
|
|
899
913
|
const a = o.querySelectorAll("nine-table-sheet.active");
|
|
900
914
|
a == null || a.forEach((f) => {
|
|
@@ -903,35 +917,35 @@ const de = class de extends HTMLElement {
|
|
|
903
917
|
}, "#switchSheet"));
|
|
904
918
|
}
|
|
905
919
|
connectedCallback() {
|
|
906
|
-
t(this,
|
|
920
|
+
t(this, Pt).call(this);
|
|
907
921
|
}
|
|
908
922
|
};
|
|
909
|
-
|
|
910
|
-
let
|
|
911
|
-
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets",
|
|
912
|
-
var
|
|
913
|
-
const
|
|
923
|
+
Pt = new WeakMap(), xt = new WeakMap(), h(ge, "NineTableSheets");
|
|
924
|
+
let ie = ge;
|
|
925
|
+
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", ie);
|
|
926
|
+
var k, Dt, vt, Yt;
|
|
927
|
+
const ue = class ue {
|
|
914
928
|
constructor(i) {
|
|
915
|
-
d(this,
|
|
916
|
-
d(this,
|
|
917
|
-
t(this,
|
|
929
|
+
d(this, k);
|
|
930
|
+
d(this, Dt, /* @__PURE__ */ h(() => {
|
|
931
|
+
t(this, Yt).call(this), new ResizeObserver((i) => {
|
|
918
932
|
for (let e of i)
|
|
919
|
-
t(this,
|
|
920
|
-
}).observe(t(this,
|
|
933
|
+
t(this, k).getAttribute("auto-height") === "true" && t(this, vt).call(this);
|
|
934
|
+
}).observe(t(this, k));
|
|
921
935
|
}, "#init"));
|
|
922
|
-
d(this,
|
|
923
|
-
var
|
|
924
|
-
const i = Array.from(t(this,
|
|
936
|
+
d(this, vt, /* @__PURE__ */ h(() => {
|
|
937
|
+
var c, a;
|
|
938
|
+
const i = Array.from(t(this, k).shadowRoot.querySelectorAll("nine-table-sheet.active"));
|
|
925
939
|
if (i.length === 0) return;
|
|
926
|
-
const e = parseInt(t(this,
|
|
927
|
-
t(this,
|
|
940
|
+
const e = parseInt(t(this, k).getAttribute("max-display-row"), 10) || 10, n = Math.max(...i.map((f) => f.getRowHeight())), s = (c = t(this, k).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : c.getBoundingClientRect().height, r = (a = t(this, k).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : a.getBoundingClientRect().height, o = Rt.SCROLLBAR_SIZE, l = e * n + s + r + o;
|
|
941
|
+
t(this, k).style.height = `${l}px`;
|
|
928
942
|
}, "#applyAutoHeight"));
|
|
929
|
-
d(this,
|
|
930
|
-
const e = Array.from(t(this,
|
|
931
|
-
const
|
|
932
|
-
return
|
|
933
|
-
}).join(""), o = e.map((
|
|
934
|
-
t(this,
|
|
943
|
+
d(this, Yt, /* @__PURE__ */ h(() => {
|
|
944
|
+
const e = Array.from(t(this, k).children).filter((c) => c.tagName === "TABLE"), n = t(this, k).getAttribute("auto-height") === "true", s = e.length, r = e.map((c, a) => {
|
|
945
|
+
const g = `<nine-table-sheet class="${a === 0 ? "active" : ""}" data-index="${a}"></nine-table-sheet>`, y = a < s - 1 ? `<nine-splitter class="h" data-split-index="${a}"></nine-splitter>` : "";
|
|
946
|
+
return g + y;
|
|
947
|
+
}).join(""), o = e.map((c, a) => `<div class="nine-tab-item ${a === 0 ? "active" : ""}" data-index="${a}">Sheet ${a + 1}</div>`).join("");
|
|
948
|
+
t(this, k).shadowRoot.innerHTML = `
|
|
935
949
|
<style>
|
|
936
950
|
:host {
|
|
937
951
|
display: flex;
|
|
@@ -1022,96 +1036,96 @@ const fe = class fe {
|
|
|
1022
1036
|
</nine-table-body>
|
|
1023
1037
|
<nine-table-footer></nine-table-footer>
|
|
1024
1038
|
`;
|
|
1025
|
-
const l = t(this,
|
|
1026
|
-
l == null || l.forEach((
|
|
1039
|
+
const l = t(this, k).shadowRoot.querySelectorAll("nine-table-sheet");
|
|
1040
|
+
l == null || l.forEach((c, a) => {
|
|
1027
1041
|
e[a] && setTimeout(() => {
|
|
1028
|
-
|
|
1042
|
+
c.generate(e[a]), n && t(this, vt).call(this);
|
|
1029
1043
|
});
|
|
1030
1044
|
});
|
|
1031
1045
|
}, "#render"));
|
|
1032
|
-
|
|
1046
|
+
u(this, k, i), t(this, Dt).call(this);
|
|
1033
1047
|
}
|
|
1034
1048
|
};
|
|
1035
|
-
|
|
1036
|
-
let
|
|
1037
|
-
var
|
|
1038
|
-
const
|
|
1049
|
+
k = new WeakMap(), Dt = new WeakMap(), vt = new WeakMap(), Yt = new WeakMap(), h(ue, "LayoutManager");
|
|
1050
|
+
let ne = ue;
|
|
1051
|
+
var wt, rt;
|
|
1052
|
+
const be = class be {
|
|
1039
1053
|
constructor(i) {
|
|
1040
|
-
d(this,
|
|
1041
|
-
d(this,
|
|
1042
|
-
|
|
1043
|
-
|
|
1054
|
+
d(this, wt);
|
|
1055
|
+
d(this, rt, -1);
|
|
1056
|
+
E(this, "count", /* @__PURE__ */ h(() => t(this, wt).rawRecords.length, "count"));
|
|
1057
|
+
u(this, wt, i);
|
|
1044
1058
|
}
|
|
1045
1059
|
get at() {
|
|
1046
|
-
return t(this,
|
|
1060
|
+
return t(this, rt);
|
|
1047
1061
|
}
|
|
1048
1062
|
set at(i) {
|
|
1049
|
-
|
|
1063
|
+
u(this, rt, parseInt(i, 10)), body && !body.querySelector(`tbody.bindable tr[data-row="${t(this, rt)}"]`) && setTimeout(() => {
|
|
1050
1064
|
});
|
|
1051
1065
|
}
|
|
1052
1066
|
};
|
|
1053
|
-
|
|
1054
|
-
let
|
|
1055
|
-
var
|
|
1056
|
-
const
|
|
1067
|
+
wt = new WeakMap(), rt = new WeakMap(), h(be, "ngRow");
|
|
1068
|
+
let se = be;
|
|
1069
|
+
var L, A, C, lt, Ft, D, Vt, G, St, Xt, Ut, at;
|
|
1070
|
+
const H = class H {
|
|
1057
1071
|
constructor(i, e) {
|
|
1058
|
-
d(this,
|
|
1059
|
-
d(this,
|
|
1060
|
-
d(this,
|
|
1061
|
-
d(this,
|
|
1062
|
-
d(this,
|
|
1063
|
-
d(this,
|
|
1064
|
-
d(this,
|
|
1065
|
-
|
|
1066
|
-
const i = t(this,
|
|
1072
|
+
d(this, L);
|
|
1073
|
+
d(this, A);
|
|
1074
|
+
d(this, C, []);
|
|
1075
|
+
d(this, lt, []);
|
|
1076
|
+
d(this, Ft, 0);
|
|
1077
|
+
d(this, D, []);
|
|
1078
|
+
d(this, Vt, /* @__PURE__ */ h(() => {
|
|
1079
|
+
u(this, D, []);
|
|
1080
|
+
const i = t(this, L).template || [];
|
|
1067
1081
|
Array.from(i).forEach((e) => {
|
|
1068
1082
|
var n;
|
|
1069
|
-
t(this,
|
|
1070
|
-
}), (t(this,
|
|
1071
|
-
e.__ng || (e.__ng = t(this,
|
|
1083
|
+
t(this, D).push(((n = e.getBoundingClientRect) == null ? void 0 : n.call(e).height) || 24);
|
|
1084
|
+
}), (t(this, A).rawRecords || []).forEach((e) => {
|
|
1085
|
+
e.__ng || (e.__ng = t(this, St).call(this)), e.__ng.height = t(this, D).slice();
|
|
1072
1086
|
});
|
|
1073
1087
|
}, "#initialize"));
|
|
1074
|
-
d(this,
|
|
1075
|
-
t(this,
|
|
1088
|
+
d(this, G, /* @__PURE__ */ h(() => {
|
|
1089
|
+
t(this, L).shadowRoot.querySelectorAll("nine-table-sheet").forEach((i) => {
|
|
1076
1090
|
i.invalidate();
|
|
1077
1091
|
});
|
|
1078
1092
|
}, "#invalidate"));
|
|
1079
|
-
|
|
1093
|
+
E(this, "get", /* @__PURE__ */ h((i, e) => {
|
|
1080
1094
|
var r;
|
|
1081
1095
|
const n = this.getValidData();
|
|
1082
1096
|
if (!n || n.length <= 0) return;
|
|
1083
|
-
if (i == null) return t(this,
|
|
1097
|
+
if (i == null) return t(this, at).call(this, n);
|
|
1084
1098
|
if (i < 0 || i >= n.length) return null;
|
|
1085
|
-
const s = typeof ((r = t(this,
|
|
1099
|
+
const s = typeof ((r = t(this, L).fields) == null ? void 0 : r.get) == "function" ? t(this, L).fields.get() : [];
|
|
1086
1100
|
if (e != null) {
|
|
1087
1101
|
const o = s.indexOf(e);
|
|
1088
1102
|
return o >= 0 ? n[i].v[o] : null;
|
|
1089
1103
|
}
|
|
1090
|
-
return t(this,
|
|
1104
|
+
return t(this, at).call(this, n[i]);
|
|
1091
1105
|
}, "get"));
|
|
1092
|
-
|
|
1093
|
-
this.clear(), this.add(i, !1), t(this,
|
|
1106
|
+
E(this, "set", /* @__PURE__ */ h((i) => {
|
|
1107
|
+
this.clear(), this.add(i, !1), t(this, G).call(this);
|
|
1094
1108
|
}, "set"));
|
|
1095
|
-
d(this,
|
|
1096
|
-
rowState:
|
|
1109
|
+
d(this, St, /* @__PURE__ */ h(() => ({
|
|
1110
|
+
rowState: H.ROW_STATE.EMPTY,
|
|
1097
1111
|
deleted: !1,
|
|
1098
1112
|
filtered: !1,
|
|
1099
|
-
height: t(this,
|
|
1113
|
+
height: t(this, D).slice(),
|
|
1100
1114
|
o: {},
|
|
1101
1115
|
c: {},
|
|
1102
|
-
_: [0, 0, 0, 0,
|
|
1116
|
+
_: [0, 0, 0, 0, H.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this, D).slice(), -1, {}, {}]
|
|
1103
1117
|
}), "#getDefaultMeta"));
|
|
1104
|
-
|
|
1105
|
-
|
|
1118
|
+
E(this, "reset", /* @__PURE__ */ h(() => {
|
|
1119
|
+
u(this, C, []), u(this, lt, []), t(this, G).call(this);
|
|
1106
1120
|
}, "reset"));
|
|
1107
|
-
|
|
1121
|
+
E(this, "clear", /* @__PURE__ */ h(() => {
|
|
1108
1122
|
var i;
|
|
1109
|
-
t(this,
|
|
1123
|
+
t(this, A).rawRecords = [], u(this, C, []), u(this, lt, []), (i = t(this, A).viewRecords) != null && i.reset && t(this, A).viewRecords.reset();
|
|
1110
1124
|
}, "clear"));
|
|
1111
|
-
d(this,
|
|
1125
|
+
d(this, Xt, /* @__PURE__ */ h((i) => {
|
|
1112
1126
|
var s;
|
|
1113
1127
|
Array.isArray(i) || (i = [i]);
|
|
1114
|
-
const e = typeof ((s = t(this,
|
|
1128
|
+
const e = typeof ((s = t(this, L).fields) == null ? void 0 : s.get) == "function" ? t(this, L).fields.get() : Object.keys(i[0] || {}), n = [];
|
|
1115
1129
|
return i.forEach((r) => {
|
|
1116
1130
|
const o = { v: [] };
|
|
1117
1131
|
e.forEach((l) => {
|
|
@@ -1119,94 +1133,94 @@ const C = class C {
|
|
|
1119
1133
|
}), n.push(o);
|
|
1120
1134
|
}), n;
|
|
1121
1135
|
}, "#json2Array"));
|
|
1122
|
-
d(this,
|
|
1123
|
-
e.__ng = t(this,
|
|
1136
|
+
d(this, Ut, /* @__PURE__ */ h((i) => (Array.isArray(i) || (i = [i]), i.forEach((e) => {
|
|
1137
|
+
e.__ng = t(this, St).call(this), e.__ng.rowid = this.nextId, e.__ng.rowState = H.ROW_STATE.INSERT, e.__ng._[0] = e.__ng.rowid;
|
|
1124
1138
|
}), i), "#defaultInsert"));
|
|
1125
|
-
|
|
1139
|
+
E(this, "add", /* @__PURE__ */ h((i, e = !0) => {
|
|
1126
1140
|
i === void 0 && (i = {});
|
|
1127
|
-
const n = t(this,
|
|
1128
|
-
t(this,
|
|
1141
|
+
const n = t(this, Xt).call(this, i);
|
|
1142
|
+
t(this, A).rawRecords = t(this, A).rawRecords.concat(t(this, Ut).call(this, n)), this.resetRecords();
|
|
1129
1143
|
const s = this.count() - 1;
|
|
1130
1144
|
return e || n.forEach((r, o) => {
|
|
1131
|
-
const l = t(this,
|
|
1132
|
-
l && (l.__ng.rowState =
|
|
1133
|
-
}), t(this,
|
|
1145
|
+
const l = t(this, A).rawRecords[s - o];
|
|
1146
|
+
l && (l.__ng.rowState = H.ROW_STATE.EMPTY);
|
|
1147
|
+
}), t(this, G).call(this), s;
|
|
1134
1148
|
}, "add"));
|
|
1135
|
-
|
|
1149
|
+
E(this, "delete", /* @__PURE__ */ h((i) => {
|
|
1136
1150
|
let e = [];
|
|
1137
|
-
Array.isArray(i) ? e = i : typeof i > "u" ? e = [t(this,
|
|
1138
|
-
if (t(this,
|
|
1139
|
-
const s = t(this,
|
|
1140
|
-
t(this,
|
|
1141
|
-
r.__ng.rowid === s && (r.__ng.deleted = !0, r.__ng.rowState =
|
|
1151
|
+
Array.isArray(i) ? e = i : typeof i > "u" ? e = [t(this, A).host.row.at] : e = [parseInt(i, 10)], e.sort((n, s) => s - n).forEach((n) => {
|
|
1152
|
+
if (t(this, C)[n]) {
|
|
1153
|
+
const s = t(this, C)[n].__ng.rowid;
|
|
1154
|
+
t(this, C)[n].__ng.rowState === H.ROW_STATE.INSERT ? t(this, A).rawRecords = t(this, A).rawRecords.filter((r) => r.__ng.rowid !== s) : t(this, A).rawRecords.forEach((r) => {
|
|
1155
|
+
r.__ng.rowid === s && (r.__ng.deleted = !0, r.__ng.rowState = H.ROW_STATE.DELETE);
|
|
1142
1156
|
});
|
|
1143
1157
|
}
|
|
1144
|
-
}), this.resetRecords(), t(this,
|
|
1158
|
+
}), this.resetRecords(), t(this, G).call(this);
|
|
1145
1159
|
}, "delete"));
|
|
1146
|
-
|
|
1147
|
-
var
|
|
1160
|
+
E(this, "setValue", /* @__PURE__ */ h((i, e, n) => {
|
|
1161
|
+
var c;
|
|
1148
1162
|
i = parseInt(i, 10);
|
|
1149
|
-
const r = (typeof ((
|
|
1163
|
+
const r = (typeof ((c = t(this, L).fields) == null ? void 0 : c.get) == "function" ? t(this, L).fields.get() : []).indexOf(e);
|
|
1150
1164
|
if (r < 0) return;
|
|
1151
1165
|
const o = this.getValidData()[i];
|
|
1152
1166
|
if (!o) return;
|
|
1153
1167
|
const l = o.v[r];
|
|
1154
|
-
l !== n && o.__ng.rowState !==
|
|
1168
|
+
l !== n && o.__ng.rowState !== H.ROW_STATE.INSERT && (o.__ng.o.hasOwnProperty(e) || (o.__ng.o[e] = l), o.__ng.rowState = H.ROW_STATE.UPDATE), o.v[r] = n;
|
|
1155
1169
|
}, "setValue"));
|
|
1156
|
-
|
|
1157
|
-
|
|
1170
|
+
E(this, "resetRecords", /* @__PURE__ */ h(() => {
|
|
1171
|
+
u(this, lt, t(this, A).rawRecords.filter((i) => !i.__ng.deleted)), u(this, C, t(this, A).rawRecords.filter((i) => !i.__ng.deleted && !i.__ng.filtered)), t(this, A).rawRecords.forEach((i, e) => {
|
|
1158
1172
|
i.__ng.rowidx = e;
|
|
1159
|
-
}), t(this,
|
|
1173
|
+
}), t(this, C).forEach((i, e) => {
|
|
1160
1174
|
i.__ng.i = e;
|
|
1161
1175
|
});
|
|
1162
1176
|
}, "resetRecords"));
|
|
1163
|
-
|
|
1164
|
-
d(this,
|
|
1177
|
+
E(this, "getValidData", /* @__PURE__ */ h(() => (t(this, C).length === 0 && t(this, A).rawRecords.length > 0 && this.resetRecords(), t(this, C)), "getValidData"));
|
|
1178
|
+
d(this, at, /* @__PURE__ */ h((i) => {
|
|
1165
1179
|
var o;
|
|
1166
1180
|
if (!i) return i;
|
|
1167
|
-
const e = !Array.isArray(i), n = e ? [i] : i, s = typeof ((o = t(this,
|
|
1168
|
-
const
|
|
1181
|
+
const e = !Array.isArray(i), n = e ? [i] : i, s = typeof ((o = t(this, L).fields) == null ? void 0 : o.get) == "function" ? t(this, L).fields.get() : [], r = n.filter((l) => !l.__ng.deleted).map((l) => {
|
|
1182
|
+
const c = {};
|
|
1169
1183
|
return s.forEach((a, f) => {
|
|
1170
|
-
|
|
1171
|
-
}),
|
|
1184
|
+
c[a] = l.v ? l.v[f] : l[a];
|
|
1185
|
+
}), c.__ng = l.__ng, c;
|
|
1172
1186
|
});
|
|
1173
1187
|
return e ? r[0] : r;
|
|
1174
1188
|
}, "#conv"));
|
|
1175
|
-
|
|
1176
|
-
|
|
1189
|
+
E(this, "count", /* @__PURE__ */ h(() => this.getValidData().length, "count"));
|
|
1190
|
+
u(this, L, i), u(this, A, e), t(this, Vt).call(this);
|
|
1177
1191
|
}
|
|
1178
1192
|
get source() {
|
|
1179
|
-
return t(this,
|
|
1193
|
+
return t(this, at).call(this, t(this, A).rawRecords);
|
|
1180
1194
|
}
|
|
1181
1195
|
set source(i) {
|
|
1182
1196
|
this.clear(), this.add(i, !1);
|
|
1183
1197
|
}
|
|
1184
1198
|
get nextId() {
|
|
1185
|
-
return ++
|
|
1199
|
+
return ++Se(this, Ft)._;
|
|
1186
1200
|
}
|
|
1187
1201
|
get length() {
|
|
1188
|
-
return t(this,
|
|
1202
|
+
return t(this, C).length;
|
|
1189
1203
|
}
|
|
1190
1204
|
getRowCount() {
|
|
1191
1205
|
return this.length;
|
|
1192
1206
|
}
|
|
1193
1207
|
};
|
|
1194
|
-
|
|
1195
|
-
|
|
1208
|
+
L = new WeakMap(), A = new WeakMap(), C = new WeakMap(), lt = new WeakMap(), Ft = new WeakMap(), D = new WeakMap(), Vt = new WeakMap(), G = new WeakMap(), St = new WeakMap(), Xt = new WeakMap(), Ut = new WeakMap(), at = new WeakMap(), h(H, "ngData"), // π― ν μν μ μ μμλ₯Ό ν΄λμ€ λ΄λΆλ‘ λ΄μ¬ν
|
|
1209
|
+
E(H, "ROW_STATE", {
|
|
1196
1210
|
EMPTY: "EMPTY",
|
|
1197
1211
|
NORMAL: "NORMAL",
|
|
1198
1212
|
INSERT: "INSERT",
|
|
1199
1213
|
UPDATE: "UPDATE",
|
|
1200
1214
|
DELETE: "DELETE"
|
|
1201
1215
|
});
|
|
1202
|
-
let
|
|
1203
|
-
var
|
|
1204
|
-
const
|
|
1216
|
+
let oe = H;
|
|
1217
|
+
var J;
|
|
1218
|
+
const ye = class ye {
|
|
1205
1219
|
constructor(i) {
|
|
1206
|
-
d(this,
|
|
1207
|
-
|
|
1220
|
+
d(this, J);
|
|
1221
|
+
u(this, J, i), this.row = new se(this), this.data = new oe(t(this, J), this), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.pageCnt = 25, this.viewRecords.reset = () => {
|
|
1208
1222
|
var e;
|
|
1209
|
-
(e = t(this,
|
|
1223
|
+
(e = t(this, J).view) != null && e.redraw && t(this, J).view.redraw();
|
|
1210
1224
|
}, this.setDataSource = (e) => {
|
|
1211
1225
|
this.data && this.data.reset(), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.data.set(e || []);
|
|
1212
1226
|
}, this.getRowState = (e) => {
|
|
@@ -1221,33 +1235,33 @@ const ge = class ge {
|
|
|
1221
1235
|
}, this.setDataSource([]);
|
|
1222
1236
|
}
|
|
1223
1237
|
};
|
|
1224
|
-
|
|
1225
|
-
let
|
|
1226
|
-
var
|
|
1227
|
-
const
|
|
1238
|
+
J = new WeakMap(), h(ye, "ngDataManager");
|
|
1239
|
+
let re = ye;
|
|
1240
|
+
var ct, q, Et, jt;
|
|
1241
|
+
const pe = class pe {
|
|
1228
1242
|
// π― μ΄μ { name: string, type: string } κ°μ²΄λ€μ λ°°μ΄λ‘ κ΄λ¦¬ν©λλ€.
|
|
1229
1243
|
constructor(i) {
|
|
1230
|
-
d(this,
|
|
1231
|
-
d(this,
|
|
1232
|
-
|
|
1244
|
+
d(this, ct);
|
|
1245
|
+
d(this, q, []);
|
|
1246
|
+
E(this, "add", /* @__PURE__ */ h((i, e = "string") => {
|
|
1233
1247
|
i.forEach((n) => {
|
|
1234
|
-
t(this,
|
|
1235
|
-
}), t(this,
|
|
1248
|
+
t(this, q).some((s) => s.name === n) || t(this, q).push({ name: n, type: e });
|
|
1249
|
+
}), t(this, Et).call(this);
|
|
1236
1250
|
}, "add"));
|
|
1237
|
-
d(this,
|
|
1251
|
+
d(this, Et, /* @__PURE__ */ h(() => {
|
|
1238
1252
|
const i = /* @__PURE__ */ new Map();
|
|
1239
|
-
t(this,
|
|
1253
|
+
t(this, q).forEach((e) => {
|
|
1240
1254
|
i.set(e.name, e.type);
|
|
1241
|
-
}),
|
|
1255
|
+
}), u(this, q, Array.from(i, ([e, n]) => ({ name: e, type: n }))), u(this, q, t(this, q).filter((e) => e.name !== "" && e.name !== "__ng")), t(this, q).sort((e, n) => e.name.length < n.name.length ? 1 : -1);
|
|
1242
1256
|
}, "#adjust"));
|
|
1243
|
-
d(this,
|
|
1244
|
-
|
|
1245
|
-
const i = Array.from(t(this,
|
|
1257
|
+
d(this, jt, /* @__PURE__ */ h(() => {
|
|
1258
|
+
u(this, q, []), ht.log(t(this, ct).querySelectorAll("table"));
|
|
1259
|
+
const i = Array.from(t(this, ct).querySelectorAll("table"));
|
|
1246
1260
|
if (!(!i || i.length === 0)) {
|
|
1247
1261
|
for (const e of i)
|
|
1248
|
-
|
|
1262
|
+
ht.log(e), $("[data-bind]", e).each((n, s) => {
|
|
1249
1263
|
const r = s.dataset.bind, o = s.getAttribute("data-type") || "string";
|
|
1250
|
-
r && t(this,
|
|
1264
|
+
r && t(this, q).push({ name: r, type: o });
|
|
1251
1265
|
}), ["data-expr", "background-color", "color", "tooltip", "visible", "readonly", "enable-button", "enable-check", "class-expr", "icon-color", "icon-src"].forEach((n) => {
|
|
1252
1266
|
$(`[${n}]`, e).each((s, r) => {
|
|
1253
1267
|
var o = r.getAttribute(n);
|
|
@@ -1262,72 +1276,72 @@ const be = class be {
|
|
|
1262
1276
|
}
|
|
1263
1277
|
o.split("data.").forEach((l) => {
|
|
1264
1278
|
if (l.trim() != "") {
|
|
1265
|
-
const
|
|
1279
|
+
const c = l.search(/[^_A-Za-z0-9]/g);
|
|
1266
1280
|
let a = "";
|
|
1267
|
-
|
|
1281
|
+
c >= 0 ? a = l.substring(0, c) : o.startsWith("data.") && (a = l.replace("data.", "")), a && t(this, q).push({ name: a, type: "string" });
|
|
1268
1282
|
}
|
|
1269
1283
|
});
|
|
1270
1284
|
});
|
|
1271
1285
|
});
|
|
1272
|
-
t(this,
|
|
1286
|
+
t(this, Et).call(this);
|
|
1273
1287
|
}
|
|
1274
1288
|
}, "#init"));
|
|
1275
|
-
|
|
1289
|
+
u(this, ct, i), t(this, jt).call(this);
|
|
1276
1290
|
}
|
|
1277
1291
|
// π― κΈ°μ‘΄μ νλ μ΄λ¦λ§ μ°λ κ³³λ€κ³Όμ νΈνμ μν΄ μ΄λ¦ λ°°μ΄λ§ 리ν΄νλ λ©μλ μ μ§
|
|
1278
1292
|
get() {
|
|
1279
|
-
return t(this,
|
|
1293
|
+
return t(this, q).map((i) => i.name);
|
|
1280
1294
|
}
|
|
1281
1295
|
// π― λ΄λΆ κ°μ²΄ ν΅μ§Έλ‘ μ»κΈ°
|
|
1282
1296
|
getFields() {
|
|
1283
|
-
return t(this,
|
|
1297
|
+
return t(this, q);
|
|
1284
1298
|
}
|
|
1285
1299
|
// π― νΉμ νλμ λ°μ΄ν° νμ
μ‘°ν
|
|
1286
1300
|
getType(i) {
|
|
1287
|
-
const e = t(this,
|
|
1301
|
+
const e = t(this, q).find((n) => n.name === i);
|
|
1288
1302
|
return e ? e.type : "string";
|
|
1289
1303
|
}
|
|
1290
1304
|
indexOf(i) {
|
|
1291
|
-
return t(this,
|
|
1305
|
+
return t(this, q).findIndex((e) => e.name === i);
|
|
1292
1306
|
}
|
|
1293
1307
|
includes(i) {
|
|
1294
|
-
return t(this,
|
|
1308
|
+
return t(this, q).some((e) => e.name === i);
|
|
1295
1309
|
}
|
|
1296
1310
|
};
|
|
1297
|
-
|
|
1298
|
-
let
|
|
1299
|
-
var
|
|
1300
|
-
const
|
|
1311
|
+
ct = new WeakMap(), q = new WeakMap(), Et = new WeakMap(), jt = new WeakMap(), h(pe, "ngFields");
|
|
1312
|
+
let le = pe;
|
|
1313
|
+
var Q, Kt, Zt;
|
|
1314
|
+
const me = class me extends HTMLElement {
|
|
1301
1315
|
constructor() {
|
|
1302
1316
|
super();
|
|
1303
1317
|
//#created = false;
|
|
1304
|
-
d(this,
|
|
1305
|
-
d(this,
|
|
1306
|
-
d(this,
|
|
1307
|
-
this.fields = new
|
|
1318
|
+
d(this, Q);
|
|
1319
|
+
d(this, Kt);
|
|
1320
|
+
d(this, Zt, /* @__PURE__ */ h(() => {
|
|
1321
|
+
this.fields = new le(this), u(this, Kt, new ne(this)), ht.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
|
|
1308
1322
|
}, "#init"));
|
|
1309
|
-
this.attachShadow({ mode: "open" }),
|
|
1323
|
+
this.attachShadow({ mode: "open" }), u(this, Q, new re(this));
|
|
1310
1324
|
}
|
|
1311
1325
|
connectedCallback() {
|
|
1312
|
-
t(this,
|
|
1326
|
+
t(this, Zt).call(this);
|
|
1313
1327
|
}
|
|
1314
1328
|
disconnectedCallback() {
|
|
1315
|
-
|
|
1329
|
+
ht.log("NineTable disconnected.");
|
|
1316
1330
|
}
|
|
1317
1331
|
// π― μΈλΆμμ grid.data.set(...) ννλ‘ μ κ·Όν μ μλλ‘ λ°μ΄ν° λ§€λμ μ€ν
|
|
1318
1332
|
get data() {
|
|
1319
|
-
return t(this,
|
|
1333
|
+
return t(this, Q).data;
|
|
1320
1334
|
}
|
|
1321
1335
|
// π― ν(row) κ΄λ ¨ μ μ΄ μ κ·Όμ μ€ν
|
|
1322
1336
|
get row() {
|
|
1323
|
-
return t(this,
|
|
1337
|
+
return t(this, Q).row;
|
|
1324
1338
|
}
|
|
1325
1339
|
// π― μ 체 λ°μ΄ν° λ§€λμ μ κ·Ό νμν κ²½μ°
|
|
1326
1340
|
get dataManager() {
|
|
1327
|
-
return t(this,
|
|
1341
|
+
return t(this, Q);
|
|
1328
1342
|
}
|
|
1329
1343
|
};
|
|
1330
|
-
|
|
1331
|
-
let
|
|
1332
|
-
customElements.get("nine-table") || customElements.define("nine-table",
|
|
1344
|
+
Q = new WeakMap(), Kt = new WeakMap(), Zt = new WeakMap(), h(me, "NineTable");
|
|
1345
|
+
let ae = me;
|
|
1346
|
+
customElements.get("nine-table") || customElements.define("nine-table", ae);
|
|
1333
1347
|
//# sourceMappingURL=nine-table.js.map
|