@ninebone/table 0.0.641 → 0.0.642
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 +384 -386
- package/dist/nine-table.js.map +1 -1
- package/dist/nine-table.umd.js +7 -7
- package/dist/nine-table.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/nine-table.js
CHANGED
|
@@ -2,9 +2,9 @@ var Fe = Object.defineProperty;
|
|
|
2
2
|
var Ve = (q) => {
|
|
3
3
|
throw TypeError(q);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
5
|
+
var Xe = (q, i, e) => i in q ? Fe(q, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : q[i] = e;
|
|
6
|
+
var h = (q, i) => Fe(q, "name", { value: i, configurable: !0 });
|
|
7
|
+
var A = (q, i, e) => Xe(q, typeof i != "symbol" ? i + "" : i, e), Ye = (q, i, e) => i.has(q) || Ve("Cannot " + e);
|
|
8
8
|
var t = (q, i, e) => (Ye(q, i, "read from private field"), e ? e.call(q) : i.get(q)), d = (q, i, e) => i.has(q) ? Ve("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(q) : i.set(q, e), y = (q, i, e, s) => (Ye(q, i, "write to private field"), s ? s.call(q, e) : i.set(q, e), e);
|
|
9
9
|
var Ue = (q, i, e, s) => ({
|
|
10
10
|
set _(r) {
|
|
@@ -14,38 +14,38 @@ var Ue = (q, i, e, s) => ({
|
|
|
14
14
|
return t(q, i, s);
|
|
15
15
|
}
|
|
16
16
|
});
|
|
17
|
-
import { trace as
|
|
18
|
-
const He = class He extends
|
|
17
|
+
import { trace as Ke } from "@ninebone/util";
|
|
18
|
+
const He = class He extends Ke.constructor {
|
|
19
19
|
constructor() {
|
|
20
20
|
super(), this.init("nine-table", "green");
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
|
-
|
|
23
|
+
h(He, "Trace");
|
|
24
24
|
let oe = He;
|
|
25
25
|
const H = new oe();
|
|
26
|
-
var B,
|
|
26
|
+
var B, j, x, X, K, Z, It, G, _t;
|
|
27
27
|
const Me = class Me extends HTMLElement {
|
|
28
28
|
constructor() {
|
|
29
29
|
super();
|
|
30
30
|
d(this, B);
|
|
31
|
-
d(this,
|
|
32
|
-
d(this,
|
|
31
|
+
d(this, j, !1);
|
|
32
|
+
d(this, x);
|
|
33
|
+
d(this, X);
|
|
33
34
|
d(this, K);
|
|
34
35
|
d(this, Z);
|
|
35
|
-
d(this,
|
|
36
|
-
d(this, It, /* @__PURE__ */ c(() => {
|
|
36
|
+
d(this, It, /* @__PURE__ */ h(() => {
|
|
37
37
|
if (!t(this, B)) return;
|
|
38
38
|
const e = t(this, B).querySelector(".ng-container-body .ng-part-body");
|
|
39
|
-
e && (y(this,
|
|
39
|
+
e && (y(this, Z, new ResizeObserver(() => {
|
|
40
40
|
this.refresh();
|
|
41
|
-
})), t(this,
|
|
41
|
+
})), t(this, Z).observe(e));
|
|
42
42
|
}, "#observeResize"));
|
|
43
|
-
|
|
44
|
-
if (!t(this, B) || !t(this,
|
|
45
|
-
const e = t(this,
|
|
43
|
+
A(this, "refresh", /* @__PURE__ */ h(() => {
|
|
44
|
+
if (!t(this, B) || !t(this, x) || t(this, j)) return;
|
|
45
|
+
const e = t(this, x).container, s = e.querySelector("table");
|
|
46
46
|
if (!s) return;
|
|
47
|
-
const r = t(this,
|
|
48
|
-
if (a !== 0 &&
|
|
47
|
+
const r = t(this, x).track, n = t(this, x).thumb, o = t(this, B).querySelector(".ng-container-bottom"), a = e.clientWidth, c = s.scrollWidth;
|
|
48
|
+
if (a !== 0 && c > a)
|
|
49
49
|
o && (o.style.display = "flex");
|
|
50
50
|
else {
|
|
51
51
|
o && (o.style.display = "none");
|
|
@@ -53,59 +53,59 @@ const Me = class Me extends HTMLElement {
|
|
|
53
53
|
}
|
|
54
54
|
const l = r.clientWidth;
|
|
55
55
|
if (l <= 0) return;
|
|
56
|
-
const f = Math.max(Math.min(l * (a /
|
|
56
|
+
const f = Math.max(Math.min(l * (a / c), l), 20);
|
|
57
57
|
n.style.width = `${f}px`;
|
|
58
|
-
const g = e.scrollLeft, b =
|
|
58
|
+
const g = e.scrollLeft, b = c - a;
|
|
59
59
|
let u = 0;
|
|
60
60
|
b > 0 && (u = parseInt(g / b * (l - f), 10)), u < 0 && (u = 0);
|
|
61
|
-
const
|
|
62
|
-
u >
|
|
61
|
+
const m = l - f;
|
|
62
|
+
u > m && (u = m), n.style.left = `${u}px`, t(this, x).left.disabled = u === 0, t(this, x).right.disabled = u >= m - 1;
|
|
63
63
|
}, "refresh"));
|
|
64
|
-
d(this,
|
|
65
|
-
if (!t(this,
|
|
66
|
-
const s = t(this,
|
|
64
|
+
d(this, G, /* @__PURE__ */ h((e) => {
|
|
65
|
+
if (!t(this, x)) return !1;
|
|
66
|
+
const s = t(this, x).container, r = s.querySelector("table");
|
|
67
67
|
if (!r) return !1;
|
|
68
|
-
const n = t(this,
|
|
68
|
+
const n = t(this, x).track.getBoundingClientRect(), o = t(this, x).thumb.clientWidth;
|
|
69
69
|
let a = e;
|
|
70
70
|
a < 0 && (a = 0);
|
|
71
|
-
const
|
|
72
|
-
a >
|
|
71
|
+
const c = n.width - o;
|
|
72
|
+
a > c && (a = c), a = parseInt(a, 10), t(this, x).thumb.style.left = `${a}px`, t(this, x).left.disabled = a === 0, t(this, x).right.disabled = a >= c - 1;
|
|
73
73
|
const l = s.clientWidth, g = r.scrollWidth - l;
|
|
74
|
-
return
|
|
74
|
+
return c > 0 && g > 0 && (s.scrollLeft = a / c * g), a > 0 && a < c - 1;
|
|
75
75
|
}, "#thumbMoveTo"));
|
|
76
|
-
d(this, _t, /* @__PURE__ */
|
|
77
|
-
const e = /* @__PURE__ */
|
|
78
|
-
clearInterval(t(this,
|
|
79
|
-
const n = parseInt(t(this,
|
|
80
|
-
t(this,
|
|
81
|
-
clearInterval(t(this,
|
|
82
|
-
const o = parseInt(t(this,
|
|
83
|
-
t(this,
|
|
76
|
+
d(this, _t, /* @__PURE__ */ h(() => {
|
|
77
|
+
const e = /* @__PURE__ */ h((r) => {
|
|
78
|
+
clearInterval(t(this, X)), clearInterval(t(this, K));
|
|
79
|
+
const n = parseInt(t(this, x).thumb.style.left || 0, 10);
|
|
80
|
+
t(this, G).call(this, n + r), y(this, X, setInterval(() => {
|
|
81
|
+
clearInterval(t(this, X)), y(this, K, setInterval(() => {
|
|
82
|
+
const o = parseInt(t(this, x).thumb.style.left || 0, 10);
|
|
83
|
+
t(this, G).call(this, o + r) || clearInterval(t(this, K));
|
|
84
84
|
}, 50));
|
|
85
85
|
}, 500));
|
|
86
|
-
}, "delayScroll"), s = /* @__PURE__ */
|
|
87
|
-
clearInterval(t(this,
|
|
86
|
+
}, "delayScroll"), s = /* @__PURE__ */ h(() => {
|
|
87
|
+
clearInterval(t(this, X)), clearInterval(t(this, K));
|
|
88
88
|
}, "clearTimer");
|
|
89
89
|
["mouseup", "mouseleave", "touchend"].forEach((r) => {
|
|
90
|
-
t(this,
|
|
91
|
-
}), t(this,
|
|
90
|
+
t(this, x).left.addEventListener(r, s), t(this, x).right.addEventListener(r, s), t(this, x).track.addEventListener(r, s);
|
|
91
|
+
}), t(this, x).left.addEventListener("mousedown", (r) => {
|
|
92
92
|
r.button === 0 && e(-20);
|
|
93
|
-
}), t(this,
|
|
93
|
+
}), t(this, x).right.addEventListener("mousedown", (r) => {
|
|
94
94
|
r.button === 0 && e(20);
|
|
95
|
-
}), t(this,
|
|
95
|
+
}), t(this, x).left.addEventListener("touchstart", () => e(-20)), t(this, x).right.addEventListener("touchstart", () => e(20)), t(this, x).track.addEventListener("mousedown", (r) => {
|
|
96
96
|
if (r.button !== 0) return;
|
|
97
97
|
r.preventDefault();
|
|
98
|
-
const n = t(this,
|
|
99
|
-
t(this,
|
|
100
|
-
}), t(this,
|
|
98
|
+
const n = t(this, x).track.getBoundingClientRect(), o = t(this, x).thumb.clientWidth;
|
|
99
|
+
t(this, G).call(this, r.clientX - n.left - o / 2);
|
|
100
|
+
}), t(this, x).thumb.addEventListener("mousedown", (r) => {
|
|
101
101
|
if (r.button !== 0) return;
|
|
102
|
-
r.stopPropagation(), r.preventDefault(), y(this,
|
|
103
|
-
const n = /* @__PURE__ */
|
|
104
|
-
if (!t(this,
|
|
105
|
-
const
|
|
106
|
-
t(this,
|
|
107
|
-
}, "onMouseMove"), o = /* @__PURE__ */
|
|
108
|
-
y(this,
|
|
102
|
+
r.stopPropagation(), r.preventDefault(), y(this, j, !0), this.shiftX = r.clientX - t(this, x).thumb.getBoundingClientRect().left;
|
|
103
|
+
const n = /* @__PURE__ */ h((a) => {
|
|
104
|
+
if (!t(this, j)) return;
|
|
105
|
+
const c = t(this, x).track.getBoundingClientRect();
|
|
106
|
+
t(this, G).call(this, a.clientX - c.left - this.shiftX);
|
|
107
|
+
}, "onMouseMove"), o = /* @__PURE__ */ h(() => {
|
|
108
|
+
y(this, j, !1), s(), document.removeEventListener("mousemove", n), document.removeEventListener("mouseup", o), this.refresh();
|
|
109
109
|
}, "onMouseUp");
|
|
110
110
|
document.addEventListener("mousemove", n), document.addEventListener("mouseup", o);
|
|
111
111
|
});
|
|
@@ -176,82 +176,82 @@ const Me = class Me 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__ */
|
|
179
|
+
const e = /* @__PURE__ */ h(() => {
|
|
180
180
|
const s = t(this, B).querySelector(".ng-container-body .ng-part-body");
|
|
181
181
|
if (!s) {
|
|
182
182
|
setTimeout(e, 10);
|
|
183
183
|
return;
|
|
184
184
|
}
|
|
185
|
-
y(this,
|
|
185
|
+
y(this, x, {
|
|
186
186
|
container: s,
|
|
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
|
}), s.addEventListener("scroll", () => {
|
|
192
|
-
t(this,
|
|
192
|
+
t(this, j) || this.refresh();
|
|
193
193
|
}), t(this, _t).call(this), t(this, It).call(this), this.refresh();
|
|
194
194
|
}, "initWhenReady");
|
|
195
195
|
e();
|
|
196
196
|
}
|
|
197
197
|
disconnectedCallback() {
|
|
198
|
-
t(this,
|
|
198
|
+
t(this, Z) && t(this, Z).disconnect();
|
|
199
199
|
}
|
|
200
200
|
};
|
|
201
|
-
B = new WeakMap(),
|
|
201
|
+
B = new WeakMap(), j = new WeakMap(), x = new WeakMap(), X = new WeakMap(), K = new WeakMap(), Z = new WeakMap(), It = new WeakMap(), G = new WeakMap(), _t = new WeakMap(), h(Me, "NineTableHScrollBar");
|
|
202
202
|
let ae = Me;
|
|
203
203
|
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", ae);
|
|
204
|
-
var
|
|
204
|
+
var F, at, J, T, vt, xt, Nt;
|
|
205
205
|
const $e = class $e extends HTMLElement {
|
|
206
206
|
constructor() {
|
|
207
207
|
super();
|
|
208
|
-
d(this,
|
|
209
|
-
d(this,
|
|
210
|
-
d(this,
|
|
208
|
+
d(this, F);
|
|
209
|
+
d(this, at);
|
|
210
|
+
d(this, J, !1);
|
|
211
211
|
d(this, T);
|
|
212
212
|
d(this, vt, 0);
|
|
213
213
|
d(this, xt, 0);
|
|
214
|
-
|
|
215
|
-
if (!t(this,
|
|
216
|
-
const e = t(this, T).container, s = t(this, T).track, r = t(this, T).thumb, n = e.clientHeight, o = t(this,
|
|
217
|
-
if (
|
|
214
|
+
A(this, "refresh", /* @__PURE__ */ h(() => {
|
|
215
|
+
if (!t(this, F) || !t(this, T)) return;
|
|
216
|
+
const e = t(this, T).container, s = t(this, T).track, r = t(this, T).thumb, n = e.clientHeight, o = t(this, F).data.length, a = t(this, at).getRowHeight(), c = o * a;
|
|
217
|
+
if (c <= n || o === 0) {
|
|
218
218
|
this.style.display = "none";
|
|
219
219
|
return;
|
|
220
220
|
} else
|
|
221
221
|
this.style.display = "flex";
|
|
222
222
|
const l = s.clientHeight;
|
|
223
223
|
if (l <= 0) return;
|
|
224
|
-
const f = Math.max(Math.min(l * (n /
|
|
224
|
+
const f = Math.max(Math.min(l * (n / c), l), 20);
|
|
225
225
|
r.style.height = `${f}px`;
|
|
226
|
-
const g = e.scrollTop, b = Math.max(
|
|
226
|
+
const g = e.scrollTop, b = Math.max(c - n, 1);
|
|
227
227
|
let u = 0;
|
|
228
228
|
b > 0 && (u = g / b * (l - f));
|
|
229
|
-
const
|
|
230
|
-
u < 0 && (u = 0), u >
|
|
229
|
+
const m = l - f;
|
|
230
|
+
u < 0 && (u = 0), u > m && (u = m), r.style.top = `${u}px`, t(this, T).top.disabled = g <= 0, t(this, T).bottom.disabled = g >= b - 1;
|
|
231
231
|
}, "refresh"));
|
|
232
|
-
d(this, Nt, /* @__PURE__ */
|
|
232
|
+
d(this, Nt, /* @__PURE__ */ h(() => {
|
|
233
233
|
H.log("nine-table-vscrollbar.#init");
|
|
234
|
-
const e = t(this, T).container, s = /* @__PURE__ */
|
|
235
|
-
const n = (t(this,
|
|
234
|
+
const e = t(this, T).container, s = /* @__PURE__ */ h(() => {
|
|
235
|
+
const n = (t(this, F).data.get() || []).length, o = t(this, at).getRowHeight();
|
|
236
236
|
return n * o;
|
|
237
237
|
}, "getContentHeight");
|
|
238
238
|
e.addEventListener("scroll", () => {
|
|
239
|
-
t(this,
|
|
239
|
+
t(this, J) || this.refresh();
|
|
240
240
|
}), t(this, T).thumb.addEventListener("mousedown", (r) => {
|
|
241
241
|
if (r.button !== 0) return;
|
|
242
|
-
r.stopPropagation(), r.preventDefault(), y(this,
|
|
243
|
-
const n = /* @__PURE__ */
|
|
244
|
-
if (!t(this,
|
|
245
|
-
const
|
|
246
|
-
if (g > 0 &&
|
|
247
|
-
const
|
|
248
|
-
let
|
|
249
|
-
const
|
|
250
|
-
|
|
242
|
+
r.stopPropagation(), r.preventDefault(), y(this, J, !0), y(this, vt, r.clientY), y(this, xt, e.scrollTop);
|
|
243
|
+
const n = /* @__PURE__ */ h((a) => {
|
|
244
|
+
if (!t(this, J)) return;
|
|
245
|
+
const c = t(this, T).track.getBoundingClientRect(), l = t(this, T).thumb.clientHeight, g = c.height - l, b = a.clientY - t(this, vt), u = e.clientHeight, m = s(), S = Math.max(m - u, 1);
|
|
246
|
+
if (g > 0 && S > 0) {
|
|
247
|
+
const E = b / g * S;
|
|
248
|
+
let v = t(this, xt) + E;
|
|
249
|
+
const I = Math.max(0, m - u);
|
|
250
|
+
v < 0 && (v = 0), v > I && (v = I), e.scrollTop = v;
|
|
251
251
|
}
|
|
252
252
|
this.refresh();
|
|
253
|
-
}, "onMouseMove"), o = /* @__PURE__ */
|
|
254
|
-
y(this,
|
|
253
|
+
}, "onMouseMove"), o = /* @__PURE__ */ h(() => {
|
|
254
|
+
y(this, J, !1), document.removeEventListener("mousemove", n), document.removeEventListener("mouseup", o), this.refresh();
|
|
255
255
|
}, "onMouseUp");
|
|
256
256
|
document.addEventListener("mousemove", n), document.addEventListener("mouseup", o);
|
|
257
257
|
}), t(this, T).track.addEventListener("mousedown", (r) => {
|
|
@@ -270,7 +270,7 @@ const $e = class $e extends HTMLElement {
|
|
|
270
270
|
}, "#init"));
|
|
271
271
|
}
|
|
272
272
|
connectedCallback() {
|
|
273
|
-
y(this,
|
|
273
|
+
y(this, F, this.getRootNode().host), y(this, at, this.closest("nine-table-sheet")), this.innerHTML = `
|
|
274
274
|
<style>
|
|
275
275
|
nine-table-vscrollbar {
|
|
276
276
|
display: flex;
|
|
@@ -334,8 +334,8 @@ const $e = class $e extends HTMLElement {
|
|
|
334
334
|
<div class='ng-scroll-track'><div class='ng-scroll-thumb'></div></div>
|
|
335
335
|
<button class='ng-scroll-bottom' disabled><div class='ng-scroll-icon'></div></button>
|
|
336
336
|
`;
|
|
337
|
-
const e = /* @__PURE__ */
|
|
338
|
-
const s = t(this,
|
|
337
|
+
const e = /* @__PURE__ */ h(() => {
|
|
338
|
+
const s = t(this, F).shadowRoot.querySelector(".ng-container-body .ng-part-body");
|
|
339
339
|
if (!s) {
|
|
340
340
|
setTimeout(e, 10);
|
|
341
341
|
return;
|
|
@@ -351,62 +351,62 @@ const $e = class $e extends HTMLElement {
|
|
|
351
351
|
e();
|
|
352
352
|
}
|
|
353
353
|
};
|
|
354
|
-
|
|
354
|
+
F = new WeakMap(), at = new WeakMap(), J = new WeakMap(), T = new WeakMap(), vt = new WeakMap(), xt = new WeakMap(), Nt = new WeakMap(), h($e, "NineTableVScrollBar");
|
|
355
355
|
let le = $e;
|
|
356
356
|
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar", le);
|
|
357
|
-
var
|
|
357
|
+
var P, w, Q, D, _, V, tt, wt, Se, Ee, Wt, Ot, zt, St, Et, Bt, Dt, At, Ae, lt, qt, Pt;
|
|
358
358
|
const Ie = class Ie {
|
|
359
359
|
constructor(i) {
|
|
360
|
-
d(this,
|
|
361
|
-
d(this,
|
|
362
|
-
d(this,
|
|
360
|
+
d(this, P);
|
|
361
|
+
d(this, w);
|
|
362
|
+
d(this, Q);
|
|
363
363
|
d(this, D, /* @__PURE__ */ new Map());
|
|
364
|
-
d(this,
|
|
365
|
-
d(this,
|
|
366
|
-
d(this,
|
|
364
|
+
d(this, _, null);
|
|
365
|
+
d(this, V, null);
|
|
366
|
+
d(this, tt, 0);
|
|
367
367
|
d(this, wt, 40);
|
|
368
368
|
d(this, Se, !1);
|
|
369
369
|
d(this, Ee, !1);
|
|
370
370
|
//#ticking = false; // 🎯 고속 스크롤 스로틀링용 플래그
|
|
371
371
|
d(this, Wt, 3);
|
|
372
|
-
|
|
372
|
+
A(this, "refresh", /* @__PURE__ */ h(() => {
|
|
373
373
|
var e;
|
|
374
374
|
H.log("rowManager.refresh");
|
|
375
|
-
const i = t(this,
|
|
376
|
-
i && (t(this, St).call(this), t(this,
|
|
375
|
+
const i = t(this, w).querySelector(".ng-container-body .ng-part-body");
|
|
376
|
+
i && (t(this, St).call(this), t(this, lt).call(this, i.scrollTop), (e = t(this, w).querySelector("nine-table-vscrollbar")) == null || e.refresh());
|
|
377
377
|
}, "refresh"));
|
|
378
|
-
|
|
379
|
-
H.log("rowManager.initialize"), y(this,
|
|
380
|
-
scrollTables: t(this,
|
|
381
|
-
firstTr: t(this,
|
|
382
|
-
}), y(this,
|
|
383
|
-
const a = t(this,
|
|
378
|
+
A(this, "initialize", /* @__PURE__ */ h(() => {
|
|
379
|
+
H.log("rowManager.initialize"), y(this, Q, {
|
|
380
|
+
scrollTables: t(this, w).querySelectorAll(".ng-part-body table"),
|
|
381
|
+
firstTr: t(this, w).querySelector(".ng-container-body .ng-part-body tbody.bindable-tbody tr:not(.nodata)")
|
|
382
|
+
}), y(this, _, null), t(this, D).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((o) => {
|
|
383
|
+
const a = t(this, w).querySelector(o);
|
|
384
384
|
if (!a) return;
|
|
385
|
-
const
|
|
386
|
-
if (!
|
|
387
|
-
const l =
|
|
385
|
+
const c = a.querySelector(".ng-part-body table");
|
|
386
|
+
if (!c) return;
|
|
387
|
+
const l = c.querySelector("tbody.bindable-tbody");
|
|
388
388
|
if (!l) return;
|
|
389
389
|
const g = Array.from(l.querySelectorAll("tr")).map((b) => b.cloneNode(!0));
|
|
390
390
|
t(this, D).set(o, g);
|
|
391
391
|
});
|
|
392
|
-
const i = t(this,
|
|
392
|
+
const i = t(this, w).querySelector(".ng-container-body .ng-part-body"), e = t(this, w).querySelector(".ng-container-left .ng-part-body"), s = t(this, w).querySelector(".ng-container-right .ng-part-body"), r = t(this, w).querySelector(".ng-container-body .ng-part-header"), n = t(this, w).querySelector(".ng-container-body .ng-part-footer");
|
|
393
393
|
if (i) {
|
|
394
|
-
t(this, zt).call(this, i), t(this, At).call(this), t(this, St).call(this), t(this,
|
|
394
|
+
t(this, zt).call(this, i), t(this, At).call(this), t(this, St).call(this), t(this, lt).call(this, i.scrollTop);
|
|
395
395
|
let o = !1;
|
|
396
|
-
const a = /* @__PURE__ */
|
|
396
|
+
const a = /* @__PURE__ */ h((c) => {
|
|
397
397
|
if (o) return;
|
|
398
398
|
o = !0;
|
|
399
|
-
const l =
|
|
400
|
-
i && i.scrollTop !== l && (i.scrollTop = l), e && e.scrollTop !== l && (e.scrollTop = l), s && s.scrollTop !== l && (s.scrollTop = l), r && r.scrollLeft !== f && (r.scrollLeft = f), n && n.scrollLeft !== f && (n.scrollLeft = f), t(this,
|
|
399
|
+
const l = c.scrollTop, f = c.scrollLeft;
|
|
400
|
+
i && i.scrollTop !== l && (i.scrollTop = l), e && e.scrollTop !== l && (e.scrollTop = l), s && s.scrollTop !== l && (s.scrollTop = l), r && r.scrollLeft !== f && (r.scrollLeft = f), n && n.scrollLeft !== f && (n.scrollLeft = f), t(this, lt).call(this, l), o = !1;
|
|
401
401
|
}, "handleContainerScroll");
|
|
402
|
-
[i, e, s].forEach((
|
|
403
|
-
|
|
404
|
-
a(
|
|
402
|
+
[i, e, s].forEach((c) => {
|
|
403
|
+
c && c.addEventListener("scroll", () => {
|
|
404
|
+
a(c);
|
|
405
405
|
}, { passive: !0 });
|
|
406
406
|
});
|
|
407
407
|
}
|
|
408
408
|
}, "initialize"));
|
|
409
|
-
d(this, Ot, /* @__PURE__ */
|
|
409
|
+
d(this, Ot, /* @__PURE__ */ h((i, e) => {
|
|
410
410
|
H.log("rowManager.#renderRows");
|
|
411
411
|
const s = t(this, D).get(e);
|
|
412
412
|
if (!s || s.length === 0) return;
|
|
@@ -415,14 +415,14 @@ const Ie = class Ie {
|
|
|
415
415
|
r.querySelectorAll("tr:not(.nodata)").forEach((a) => a.remove());
|
|
416
416
|
const n = r.querySelector("tr.nodata"), o = document.createDocumentFragment();
|
|
417
417
|
for (let a = 0; a < t(this, wt); a++)
|
|
418
|
-
s.forEach((
|
|
419
|
-
o.appendChild(
|
|
418
|
+
s.forEach((c) => {
|
|
419
|
+
o.appendChild(c.cloneNode(!0));
|
|
420
420
|
});
|
|
421
|
-
n ? n.before(o) : r.appendChild(o), e === ".ng-container-body" && (t(this,
|
|
421
|
+
n ? n.before(o) : r.appendChild(o), e === ".ng-container-body" && (t(this, Q).firstTr = r.querySelector("tr:not(.nodata)"));
|
|
422
422
|
}, "#renderRows"));
|
|
423
|
-
d(this, zt, /* @__PURE__ */
|
|
424
|
-
if (H.log("rowManager.#measureAndCacheHeight"), t(this,
|
|
425
|
-
return t(this,
|
|
423
|
+
d(this, zt, /* @__PURE__ */ h((i) => {
|
|
424
|
+
if (H.log("rowManager.#measureAndCacheHeight"), t(this, _) !== null && t(this, _) > 0)
|
|
425
|
+
return t(this, _);
|
|
426
426
|
H.log("#measureAndCacheHeight");
|
|
427
427
|
const e = t(this, D).get(".ng-container-body");
|
|
428
428
|
if (!e || e.length === 0) throw new Error("invalid dom");
|
|
@@ -433,65 +433,65 @@ const Ie = class Ie {
|
|
|
433
433
|
e.forEach((b) => {
|
|
434
434
|
n.appendChild(b.cloneNode(!0));
|
|
435
435
|
}), r ? r.before(n) : s.appendChild(n);
|
|
436
|
-
const o = t(this,
|
|
436
|
+
const o = t(this, w), a = o.style.display, c = o.style.visibility, l = o.style.position;
|
|
437
437
|
(a === "none" || window.getComputedStyle(o).display === "none") && (o.style.display = "block", o.style.visibility = "hidden", o.style.position = "absolute");
|
|
438
438
|
let f = 0;
|
|
439
439
|
const g = s.querySelectorAll("tr");
|
|
440
440
|
if (g.forEach((b) => {
|
|
441
441
|
let u = b.offsetHeight || b.getBoundingClientRect().height;
|
|
442
442
|
if (u === 0) {
|
|
443
|
-
const
|
|
444
|
-
u = parseFloat(
|
|
443
|
+
const m = window.getComputedStyle(b);
|
|
444
|
+
u = parseFloat(m.height) || parseFloat(m.minHeight) || 0;
|
|
445
445
|
}
|
|
446
446
|
f += u;
|
|
447
|
-
}), g.forEach((b) => b.remove()), o.style.display = a, o.style.visibility =
|
|
448
|
-
return y(this,
|
|
447
|
+
}), g.forEach((b) => b.remove()), o.style.display = a, o.style.visibility = c, o.style.position = l, f <= 0) throw new Error("invalid dom");
|
|
448
|
+
return y(this, _, f), t(this, Et).call(this), t(this, _);
|
|
449
449
|
}, "#measureAndCacheHeight"));
|
|
450
|
-
d(this, St, /* @__PURE__ */
|
|
450
|
+
d(this, St, /* @__PURE__ */ h(() => {
|
|
451
451
|
H.log("rowManager.#updateVirtualScrollHeight");
|
|
452
|
-
const e = (t(this,
|
|
452
|
+
const e = (t(this, P).data.get() || []).length, s = t(this, _), r = e * s;
|
|
453
453
|
H.log("🔍 [VirtualHeight]", { totalCount: e, rowHeight: s, totalVirtualHeight: r }), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((n) => {
|
|
454
|
-
const o = t(this,
|
|
454
|
+
const o = t(this, w).querySelector(n);
|
|
455
455
|
if (!o) return;
|
|
456
456
|
const a = o.querySelector(".ng-part-body .ng-virtual-spacer");
|
|
457
457
|
a && (a.style.height = `${r}px`);
|
|
458
458
|
});
|
|
459
459
|
}, "#updateVirtualScrollHeight"));
|
|
460
|
-
d(this, Et, /* @__PURE__ */
|
|
461
|
-
if (t(this,
|
|
462
|
-
const i = Math.ceil(t(this,
|
|
460
|
+
d(this, Et, /* @__PURE__ */ h(() => {
|
|
461
|
+
if (t(this, tt) > 0 && t(this, _) > 0) {
|
|
462
|
+
const i = Math.ceil(t(this, tt) / t(this, _));
|
|
463
463
|
y(this, wt, i + t(this, Wt));
|
|
464
464
|
}
|
|
465
465
|
}, "#updateRowCount"));
|
|
466
|
-
d(this, Bt, /* @__PURE__ */
|
|
467
|
-
var a,
|
|
468
|
-
const i = t(this,
|
|
466
|
+
d(this, Bt, /* @__PURE__ */ h(() => {
|
|
467
|
+
var a, c, l, f, g, b;
|
|
468
|
+
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"), s = t(this, w).querySelector(".ng-container-right .ng-part-body table");
|
|
469
469
|
if (e) {
|
|
470
|
-
const u = i ? Array.from(i.querySelectorAll("tbody tr")) : [],
|
|
471
|
-
for (let
|
|
472
|
-
const
|
|
473
|
-
((a = u[
|
|
474
|
-
((
|
|
475
|
-
((l =
|
|
476
|
-
], R = Math.max(...
|
|
477
|
-
R > 0 && (u[
|
|
470
|
+
const u = i ? Array.from(i.querySelectorAll("tbody tr")) : [], m = Array.from(e.querySelectorAll("tbody tr")), S = s ? Array.from(s.querySelectorAll("tbody tr")) : [], E = Math.max(u.length, m.length, S.length);
|
|
471
|
+
for (let v = 0; v < E; v++) {
|
|
472
|
+
const I = [
|
|
473
|
+
((a = u[v]) == null ? void 0 : a.getBoundingClientRect().height) || 0,
|
|
474
|
+
((c = m[v]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
|
|
475
|
+
((l = S[v]) == null ? void 0 : l.getBoundingClientRect().height) || 0
|
|
476
|
+
], R = Math.max(...I);
|
|
477
|
+
R > 0 && (u[v] && (u[v].style.height = `${R}px`), m[v] && (m[v].style.height = `${R}px`), S[v] && (S[v].style.height = `${R}px`));
|
|
478
478
|
}
|
|
479
479
|
}
|
|
480
|
-
const r = t(this,
|
|
480
|
+
const r = t(this, w).querySelector(".ng-container-left .ng-part-footer table"), n = t(this, w).querySelector(".ng-container-body .ng-part-footer table"), o = t(this, w).querySelector(".ng-container-right .ng-part-footer table");
|
|
481
481
|
if (n) {
|
|
482
|
-
const u = r ? Array.from(r.querySelectorAll("tfoot tr")) : [],
|
|
483
|
-
for (let
|
|
484
|
-
const
|
|
485
|
-
((f = u[
|
|
486
|
-
((g = v
|
|
487
|
-
((b =
|
|
488
|
-
], R = Math.max(...
|
|
489
|
-
R > 0 && (u[
|
|
482
|
+
const u = r ? Array.from(r.querySelectorAll("tfoot tr")) : [], m = Array.from(n.querySelectorAll("tfoot tr")), S = o ? Array.from(o.querySelectorAll("tfoot tr")) : [], E = Math.max(u.length, m.length, S.length);
|
|
483
|
+
for (let v = 0; v < E; v++) {
|
|
484
|
+
const I = [
|
|
485
|
+
((f = u[v]) == null ? void 0 : f.getBoundingClientRect().height) || 0,
|
|
486
|
+
((g = m[v]) == null ? void 0 : g.getBoundingClientRect().height) || 0,
|
|
487
|
+
((b = S[v]) == null ? void 0 : b.getBoundingClientRect().height) || 0
|
|
488
|
+
], R = Math.max(...I);
|
|
489
|
+
R > 0 && (u[v] && (u[v].style.height = `${R}px`), m[v] && (m[v].style.height = `${R}px`), S[v] && (S[v].style.height = `${R}px`));
|
|
490
490
|
}
|
|
491
491
|
}
|
|
492
492
|
}, "#syncRowHeights"));
|
|
493
|
-
d(this, Dt, /* @__PURE__ */
|
|
494
|
-
!t(this,
|
|
493
|
+
d(this, Dt, /* @__PURE__ */ h(() => {
|
|
494
|
+
!t(this, w) || !(t(this, w) instanceof HTMLElement) || (y(this, V, new ResizeObserver((i) => {
|
|
495
495
|
for (const e of i) {
|
|
496
496
|
const s = e.target;
|
|
497
497
|
if (!s.classList.contains("active")) continue;
|
|
@@ -500,63 +500,61 @@ const Ie = class Ie {
|
|
|
500
500
|
let n = 0;
|
|
501
501
|
const o = s.querySelector(".ng-part-header"), a = s.querySelector(".ng-part-footer");
|
|
502
502
|
o && (n += o.offsetHeight), a && (n += a.offsetHeight);
|
|
503
|
-
const
|
|
504
|
-
t(this,
|
|
503
|
+
const c = Math.max(r - n, 100);
|
|
504
|
+
t(this, tt) !== c && (y(this, tt, c), t(this, Et).call(this), t(this, _) !== null && (t(this, At).call(this), this.refresh()));
|
|
505
505
|
}
|
|
506
506
|
}
|
|
507
|
-
})), t(this,
|
|
507
|
+
})), t(this, V).observe(t(this, w)));
|
|
508
508
|
}, "#initResizeObserver"));
|
|
509
|
-
d(this, At, /* @__PURE__ */
|
|
509
|
+
d(this, At, /* @__PURE__ */ h(() => {
|
|
510
510
|
H.log("rowManager.#renderAllContainers"), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((i) => {
|
|
511
|
-
const e = t(this,
|
|
511
|
+
const e = t(this, w).querySelector(i);
|
|
512
512
|
e && e.querySelector(".ng-part-body tbody.bindable-tbody") && t(this, Ot).call(this, e, i);
|
|
513
513
|
}), t(this, Pt).call(this), t(this, Bt).call(this);
|
|
514
514
|
}, "#renderAllContainers"));
|
|
515
|
-
d(this, Ae, /* @__PURE__ */
|
|
515
|
+
d(this, Ae, /* @__PURE__ */ h((i) => {
|
|
516
516
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((e) => {
|
|
517
517
|
var l;
|
|
518
|
-
const s = t(this,
|
|
518
|
+
const s = t(this, w).querySelector(e);
|
|
519
519
|
if (!s) return;
|
|
520
520
|
const r = s.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
521
521
|
if (!r) return;
|
|
522
|
-
const n = Array.from(r.querySelectorAll("tr:not(.nodata)")), o = ((l = t(this, D).get(e)) == null ? void 0 : l.length) || 1,
|
|
522
|
+
const n = Array.from(r.querySelectorAll("tr:not(.nodata)")), o = ((l = t(this, D).get(e)) == null ? void 0 : l.length) || 1, c = (t(this, P).data.get() || []).length;
|
|
523
523
|
n.forEach((f, g) => {
|
|
524
524
|
const b = i + Math.floor(g / o);
|
|
525
|
-
if (b >=
|
|
525
|
+
if (b >= c) {
|
|
526
526
|
f.style.visibility = "hidden";
|
|
527
527
|
return;
|
|
528
528
|
}
|
|
529
|
-
const u = t(this,
|
|
529
|
+
const u = t(this, P).data.get(b);
|
|
530
530
|
f.style.display = "", t(this, qt).call(this, f, u, b);
|
|
531
531
|
});
|
|
532
532
|
});
|
|
533
533
|
}, "#adjustBufferRows"));
|
|
534
|
-
d(this,
|
|
535
|
-
var
|
|
536
|
-
const e = t(this,
|
|
534
|
+
d(this, lt, /* @__PURE__ */ h((i) => {
|
|
535
|
+
var f, g;
|
|
536
|
+
const e = t(this, _);
|
|
537
537
|
if (!e || e <= 0) return;
|
|
538
|
-
const s = t(this,
|
|
538
|
+
const s = t(this, P).data.length;
|
|
539
539
|
if (s === 0) return;
|
|
540
|
-
const r = ((
|
|
541
|
-
|
|
542
|
-
const
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
const
|
|
549
|
-
if (!A) return;
|
|
550
|
-
const m = A.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
540
|
+
const r = ((f = t(this, D).get(".ng-container-body")) == null ? void 0 : f.length) || 1, n = Math.max(0, s - 1), o = Math.min(n, Math.max(0, Math.floor(i / e))), a = Math.floor(o * e);
|
|
541
|
+
H.log(`📜 [Scroll Inspect] scrollTop: ${i}, rowHeight: ${e}, startIndex: ${o}, offsetY: ${a}`);
|
|
542
|
+
const c = t(this, Q).firstTr, l = c && c.dataset.row !== void 0 ? parseInt(c.dataset.row, 10) : -1;
|
|
543
|
+
(g = t(this, Q)) == null || g.scrollTables.forEach((b) => {
|
|
544
|
+
b.style.transform = `translate3d(0, ${a}px, 0)`;
|
|
545
|
+
}), l !== o && [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((b) => {
|
|
546
|
+
const u = t(this, w).querySelector(b);
|
|
547
|
+
if (!u) return;
|
|
548
|
+
const m = u.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
551
549
|
if (!m) return;
|
|
552
|
-
Array.from(m.querySelectorAll("tr:not(.nodata)")).forEach((
|
|
553
|
-
const
|
|
554
|
-
if (
|
|
555
|
-
|
|
550
|
+
Array.from(m.querySelectorAll("tr:not(.nodata)")).forEach((E, v) => {
|
|
551
|
+
const I = o + Math.floor(v / r);
|
|
552
|
+
if (I >= s) {
|
|
553
|
+
E.style.display = "none";
|
|
556
554
|
return;
|
|
557
555
|
}
|
|
558
|
-
const
|
|
559
|
-
|
|
556
|
+
const R = t(this, P).data.get(I);
|
|
557
|
+
E.style.display = "", t(this, qt).call(this, E, R, I);
|
|
560
558
|
});
|
|
561
559
|
});
|
|
562
560
|
}, "#handleScroll"));
|
|
@@ -574,42 +572,42 @@ const Ie = class Ie {
|
|
|
574
572
|
cell.dataset.row = dataIndex;
|
|
575
573
|
});
|
|
576
574
|
}; */
|
|
577
|
-
d(this, qt, /* @__PURE__ */
|
|
575
|
+
d(this, qt, /* @__PURE__ */ h((i, e, s) => {
|
|
578
576
|
i.dataset.row = s, i.data = e, Array.from(i.cells).forEach((r, n) => {
|
|
579
577
|
r.dataset.row = s;
|
|
580
578
|
const o = Array.from(r.children).find((a) => a.tagName.toLowerCase().startsWith("cell-") || typeof a.refresh == "function");
|
|
581
579
|
o && typeof o.refresh == "function" && o.refresh();
|
|
582
580
|
});
|
|
583
581
|
}, "#bindRowData"));
|
|
584
|
-
d(this, Pt, /* @__PURE__ */
|
|
585
|
-
var
|
|
582
|
+
d(this, Pt, /* @__PURE__ */ h(() => {
|
|
583
|
+
var c, l, f;
|
|
586
584
|
H.log("rowManager.#syncHeaderHeights");
|
|
587
|
-
const i = t(this,
|
|
585
|
+
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"), s = t(this, w).querySelector(".ng-container-right .ng-part-header table");
|
|
588
586
|
if (!e) return;
|
|
589
587
|
const r = i ? Array.from(i.querySelectorAll("tr")) : [], n = Array.from(e.querySelectorAll("tr")), o = s ? Array.from(s.querySelectorAll("tr")) : [], a = Math.max(r.length, n.length, o.length);
|
|
590
588
|
for (let g = 0; g < a; g++) {
|
|
591
589
|
const b = [
|
|
592
|
-
((
|
|
590
|
+
((c = r[g]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
|
|
593
591
|
((l = n[g]) == null ? void 0 : l.getBoundingClientRect().height) || 0,
|
|
594
592
|
((f = o[g]) == null ? void 0 : f.getBoundingClientRect().height) || 0
|
|
595
593
|
], u = Math.max(...b);
|
|
596
594
|
u > 0 && (r[g] && (r[g].style.height = `${u}px`), n[g] && (n[g].style.height = `${u}px`), o[g] && (o[g].style.height = `${u}px`));
|
|
597
595
|
}
|
|
598
596
|
}, "#syncHeaderHeights"));
|
|
599
|
-
|
|
600
|
-
t(this,
|
|
597
|
+
A(this, "destroy", /* @__PURE__ */ h(() => {
|
|
598
|
+
t(this, V) && (t(this, V).disconnect(), y(this, V, null));
|
|
601
599
|
}, "destroy"));
|
|
602
|
-
y(this,
|
|
600
|
+
y(this, P, i.getRootNode().host), y(this, w, i), t(this, Dt).call(this);
|
|
603
601
|
}
|
|
604
602
|
getRowHeight() {
|
|
605
|
-
return t(this,
|
|
603
|
+
return t(this, _);
|
|
606
604
|
}
|
|
607
605
|
templateLength(i = ".ng-container-body") {
|
|
608
606
|
var e;
|
|
609
607
|
return ((e = t(this, D).get(i)) == null ? void 0 : e.length) || 1;
|
|
610
608
|
}
|
|
611
609
|
};
|
|
612
|
-
|
|
610
|
+
P = new WeakMap(), w = new WeakMap(), Q = new WeakMap(), D = new WeakMap(), _ = new WeakMap(), V = new WeakMap(), tt = new WeakMap(), wt = new WeakMap(), Se = new WeakMap(), Ee = new WeakMap(), Wt = new WeakMap(), Ot = new WeakMap(), zt = new WeakMap(), St = new WeakMap(), Et = new WeakMap(), Bt = new WeakMap(), Dt = new WeakMap(), At = new WeakMap(), Ae = new WeakMap(), lt = new WeakMap(), qt = new WeakMap(), Pt = new WeakMap(), h(Ie, "RowManager");
|
|
613
611
|
let ce = Ie;
|
|
614
612
|
const jt = class jt {
|
|
615
613
|
/**
|
|
@@ -623,18 +621,18 @@ const jt = class jt {
|
|
|
623
621
|
*/
|
|
624
622
|
static compile(i) {
|
|
625
623
|
if (!i) return null;
|
|
626
|
-
const e = /* @__PURE__ */
|
|
624
|
+
const e = /* @__PURE__ */ h((a) => {
|
|
627
625
|
a.querySelectorAll("tbody td, tbody th, tfoot td, tfoot th").forEach((l) => {
|
|
628
626
|
const f = l.getAttribute("cell-type") || "renderer";
|
|
629
627
|
if (l.children.length > 0 && l.firstElementChild.tagName.includes("-")) return;
|
|
630
628
|
let g = `cell-${f}`;
|
|
631
|
-
const b = l.getAttribute("data-bind"), u = l.getAttribute("data-expr"),
|
|
632
|
-
let
|
|
633
|
-
b &&
|
|
629
|
+
const b = l.getAttribute("data-bind"), u = l.getAttribute("data-expr"), m = l.getAttribute("maxbyte"), S = l.getAttribute("type");
|
|
630
|
+
let E = [];
|
|
631
|
+
b && E.push(`data-bind="${b}"`), u && E.push(`data-expr="${u}"`), m && E.push(`maxbyte="${m}"`), S && E.push(`type="${S}"`), l.innerHTML = `<${g} ${E.join(" ")}></${g}>`;
|
|
634
632
|
});
|
|
635
|
-
}, "processCellTypes"), s = /* @__PURE__ */
|
|
633
|
+
}, "processCellTypes"), s = /* @__PURE__ */ h((a) => {
|
|
636
634
|
if (!a.querySelector("colgroup")) {
|
|
637
|
-
const
|
|
635
|
+
const c = a.querySelector("tbody tr") || a.querySelector("tr"), l = c ? c.querySelectorAll("th, td").length : 1, f = document.createElement("colgroup"), g = Math.max(Math.floor(a.clientWidth / l), 100);
|
|
638
636
|
for (let b = 0; b < l; b++) {
|
|
639
637
|
const u = document.createElement("col");
|
|
640
638
|
u.setAttribute("width", g), f.appendChild(u);
|
|
@@ -642,75 +640,75 @@ const jt = class jt {
|
|
|
642
640
|
a.prepend(f);
|
|
643
641
|
}
|
|
644
642
|
if (!a.querySelector("thead")) {
|
|
645
|
-
const
|
|
646
|
-
l ? l.after(
|
|
643
|
+
const c = document.createElement("thead"), l = a.querySelector("colgroup");
|
|
644
|
+
l ? l.after(c) : a.prepend(c);
|
|
647
645
|
}
|
|
648
646
|
a.classList.add("nine-table-element");
|
|
649
|
-
}, "ensureTableStructure"), r = /* @__PURE__ */
|
|
650
|
-
const l = Array.from(a.querySelectorAll(
|
|
647
|
+
}, "ensureTableStructure"), r = /* @__PURE__ */ h((a, c) => {
|
|
648
|
+
const l = Array.from(a.querySelectorAll(c + " tr")), f = Array.from(a.querySelectorAll(c + " th," + c + " td")), g = l.length;
|
|
651
649
|
if (g === 0 || f.length === 0) return;
|
|
652
650
|
let b = 0;
|
|
653
|
-
f.forEach((
|
|
654
|
-
b +=
|
|
651
|
+
f.forEach((m) => {
|
|
652
|
+
b += m.colSpan || 1;
|
|
655
653
|
});
|
|
656
654
|
const u = Array.from(Array(g), () => Array(b).fill(null));
|
|
657
|
-
l.forEach((
|
|
658
|
-
const
|
|
659
|
-
let
|
|
660
|
-
Array.from(
|
|
661
|
-
for (let
|
|
662
|
-
if (u[
|
|
663
|
-
|
|
655
|
+
l.forEach((m) => {
|
|
656
|
+
const S = m.sectionRowIndex;
|
|
657
|
+
let E = 0;
|
|
658
|
+
Array.from(m.querySelectorAll("th,td")).forEach((v) => {
|
|
659
|
+
for (let z = 0; z < u[S].length; z++)
|
|
660
|
+
if (u[S][z] === null) {
|
|
661
|
+
E = z;
|
|
664
662
|
break;
|
|
665
663
|
}
|
|
666
|
-
const
|
|
667
|
-
for (let
|
|
668
|
-
for (let
|
|
669
|
-
|
|
664
|
+
const I = v.rowSpan || 1, R = v.colSpan || 1;
|
|
665
|
+
for (let z = 0; z < I; z++)
|
|
666
|
+
for (let yt = 0; yt < R; yt++)
|
|
667
|
+
S + z < g && E + yt < b && (u[S + z][E + yt] = z === 0 && yt === 0 ? "1" : "0");
|
|
670
668
|
});
|
|
671
|
-
}), l.forEach((
|
|
672
|
-
const
|
|
673
|
-
Array.from(
|
|
674
|
-
for (let
|
|
675
|
-
if (u[
|
|
676
|
-
|
|
669
|
+
}), l.forEach((m) => {
|
|
670
|
+
const S = m.sectionRowIndex;
|
|
671
|
+
Array.from(m.querySelectorAll("th,td")).forEach((E) => {
|
|
672
|
+
for (let v = 0; v < u[S].length; v++)
|
|
673
|
+
if (u[S][v] === "1") {
|
|
674
|
+
E.dataset.col = v, u[S][v] = "0";
|
|
677
675
|
break;
|
|
678
676
|
}
|
|
679
677
|
});
|
|
680
678
|
});
|
|
681
679
|
}, "resetColIndex"), n = i.cloneNode(!0);
|
|
682
|
-
return s(n), e(n), r(n, "thead"), r(n, "tbody"), r(n, "tfoot"), Array.from(n.querySelectorAll("colgroup col")).forEach((a,
|
|
680
|
+
return s(n), e(n), r(n, "thead"), r(n, "tbody"), r(n, "tfoot"), Array.from(n.querySelectorAll("colgroup col")).forEach((a, c) => {
|
|
683
681
|
const l = a.getAttribute("fixed");
|
|
684
|
-
l && n.querySelectorAll(`thead [data-col="${
|
|
682
|
+
l && n.querySelectorAll(`thead [data-col="${c}"], tbody [data-col="${c}"], tfoot [data-col="${c}"]`).forEach((f) => {
|
|
685
683
|
f.setAttribute("fixed", l);
|
|
686
684
|
});
|
|
687
685
|
}), n;
|
|
688
686
|
}
|
|
689
687
|
// 🎯 [추가] td/th에 선언된 cell-type 속성을 읽어 커스텀 태그로 자동 감싸기
|
|
690
688
|
};
|
|
691
|
-
|
|
689
|
+
h(jt, "TableCompiler");
|
|
692
690
|
let he = jt;
|
|
693
|
-
var Ft,
|
|
691
|
+
var Ft, et, st, Vt, Yt, ct, Ut, Xt;
|
|
694
692
|
const pt = class pt extends HTMLElement {
|
|
695
693
|
constructor() {
|
|
696
694
|
super();
|
|
697
695
|
d(this, Ft);
|
|
698
|
-
d(this,
|
|
699
|
-
d(this,
|
|
700
|
-
|
|
701
|
-
t(this,
|
|
696
|
+
d(this, et, null);
|
|
697
|
+
d(this, st);
|
|
698
|
+
A(this, "invalidate", /* @__PURE__ */ h(() => {
|
|
699
|
+
t(this, st).refresh();
|
|
702
700
|
}, "invalidate"));
|
|
703
|
-
d(this, Vt, /* @__PURE__ */
|
|
701
|
+
d(this, Vt, /* @__PURE__ */ h(() => {
|
|
704
702
|
[
|
|
705
703
|
{ selector: ".ng-container-body", type: null },
|
|
706
704
|
{ selector: ".ng-container-left", type: "left" },
|
|
707
705
|
{ selector: ".ng-container-right", type: "right" }
|
|
708
706
|
].forEach(({ selector: s, type: r }) => {
|
|
709
707
|
var n, o, a;
|
|
710
|
-
(n = this.querySelector(`${s} .ng-part-header`)) == null || n.appendChild(t(this,
|
|
708
|
+
(n = this.querySelector(`${s} .ng-part-header`)) == null || n.appendChild(t(this, ct).call(this, t(this, et), r, "header")), (o = this.querySelector(`${s} .ng-virtual-spacer`)) == null || o.before(t(this, ct).call(this, t(this, et), r, "body")), (a = this.querySelector(`${s} .ng-part-footer`)) == null || a.appendChild(t(this, ct).call(this, t(this, et), r, "footer"));
|
|
711
709
|
});
|
|
712
710
|
}, "#renderSplitContainers"));
|
|
713
|
-
d(this, Yt, /* @__PURE__ */
|
|
711
|
+
d(this, Yt, /* @__PURE__ */ h(() => {
|
|
714
712
|
["left", "right", "body"].forEach((e) => {
|
|
715
713
|
const s = this.querySelector(`.ng-container-${e}`), r = s == null ? void 0 : s.querySelectorAll("table");
|
|
716
714
|
if (!s || !r || r.length === 0) return;
|
|
@@ -721,23 +719,23 @@ const pt = class pt extends HTMLElement {
|
|
|
721
719
|
}), e === "body" ? s.style.flex = "1" : (s.style.flex = `0 0 ${n}px`, s.style.width = `${n}px`);
|
|
722
720
|
});
|
|
723
721
|
}, "#updateContainerWidths"));
|
|
724
|
-
|
|
722
|
+
A(this, "generate", /* @__PURE__ */ h((e) => {
|
|
725
723
|
if (!e) return;
|
|
726
|
-
y(this,
|
|
724
|
+
y(this, et, he.compile(e)), t(this, Vt).call(this), t(this, Yt).call(this);
|
|
727
725
|
const s = this.querySelector(".ng-container-body .ng-part-header"), r = this.querySelector(".ng-container-body .ng-part-footer"), n = this.querySelector(".ng-nodata-overlay");
|
|
728
|
-
s && n && (n.style.top = `${s.offsetHeight}px`), r && n && (n.style.bottom = `${r.offsetHeight}px`), t(this,
|
|
726
|
+
s && n && (n.style.top = `${s.offsetHeight}px`), r && n && (n.style.bottom = `${r.offsetHeight}px`), t(this, st).initialize(), setTimeout(() => {
|
|
729
727
|
var o;
|
|
730
728
|
(o = this.querySelector("nine-table-hscrollbar")) == null || o.refresh();
|
|
731
729
|
}, 0);
|
|
732
730
|
}, "generate"));
|
|
733
|
-
d(this,
|
|
734
|
-
const n = e.cloneNode(!0), o = n.querySelector("thead"), a = n.querySelector("tbody"),
|
|
731
|
+
d(this, ct, /* @__PURE__ */ h((e, s, r) => {
|
|
732
|
+
const n = e.cloneNode(!0), o = n.querySelector("thead"), a = n.querySelector("tbody"), c = n.querySelector("tfoot");
|
|
735
733
|
if (r === "header") {
|
|
736
|
-
if (a && a.remove(),
|
|
734
|
+
if (a && a.remove(), c && c.remove(), e.querySelector("tbody")) {
|
|
737
735
|
const f = document.createElement("tbody");
|
|
738
736
|
f.className = "fixed-tbody", n.appendChild(f);
|
|
739
737
|
}
|
|
740
|
-
} else r === "body" ? (o && o.remove(),
|
|
738
|
+
} else r === "body" ? (o && o.remove(), c && c.remove(), a && (a.className = "bindable-tbody")) : r === "footer" && (o && o.remove(), a && a.remove());
|
|
741
739
|
return s === "left" ? n.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((l) => {
|
|
742
740
|
l.getAttribute("fixed") !== "left" && l.remove();
|
|
743
741
|
}) : s === "right" ? n.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((l) => {
|
|
@@ -746,19 +744,19 @@ const pt = class pt extends HTMLElement {
|
|
|
746
744
|
l.remove();
|
|
747
745
|
}), n;
|
|
748
746
|
}, "#createSplitTable"));
|
|
749
|
-
|
|
750
|
-
|
|
747
|
+
A(this, "getRowHeight", /* @__PURE__ */ h(() => t(this, st).getRowHeight(), "getRowHeight"));
|
|
748
|
+
A(this, "scrollToX", /* @__PURE__ */ h((e) => {
|
|
751
749
|
const s = this.querySelector(".ng-container-body .ng-part-body");
|
|
752
750
|
s && (s.scrollLeft = e);
|
|
753
751
|
}, "scrollToX"));
|
|
754
|
-
|
|
752
|
+
A(this, "scrollToY", /* @__PURE__ */ h((e) => {
|
|
755
753
|
const s = this.querySelector(".ng-container-body .ng-part-body");
|
|
756
754
|
s && (s.scrollTop = e);
|
|
757
755
|
}, "scrollToY"));
|
|
758
|
-
d(this, Ut, /* @__PURE__ */
|
|
756
|
+
d(this, Ut, /* @__PURE__ */ h(() => {
|
|
759
757
|
t(this, Xt).call(this);
|
|
760
758
|
}, "#init"));
|
|
761
|
-
d(this, Xt, /* @__PURE__ */
|
|
759
|
+
d(this, Xt, /* @__PURE__ */ h(() => {
|
|
762
760
|
const e = pt.SCROLLBAR_SIZE;
|
|
763
761
|
this.innerHTML = `
|
|
764
762
|
<style>
|
|
@@ -947,7 +945,7 @@ const pt = class pt extends HTMLElement {
|
|
|
947
945
|
</div>
|
|
948
946
|
`;
|
|
949
947
|
}, "#render"));
|
|
950
|
-
y(this,
|
|
948
|
+
y(this, st, new ce(this)), y(this, Ft, this.getRootNode().host);
|
|
951
949
|
}
|
|
952
950
|
connectedCallback() {
|
|
953
951
|
t(this, Ut).call(this);
|
|
@@ -956,14 +954,14 @@ const pt = class pt extends HTMLElement {
|
|
|
956
954
|
this.innerHTML = "", H.log("NineTableSheet destroyed.");
|
|
957
955
|
}
|
|
958
956
|
};
|
|
959
|
-
Ft = new WeakMap(),
|
|
957
|
+
Ft = new WeakMap(), et = new WeakMap(), st = new WeakMap(), Vt = new WeakMap(), Yt = new WeakMap(), ct = new WeakMap(), Ut = new WeakMap(), Xt = new WeakMap(), h(pt, "NineTableSheet"), A(pt, "SCROLLBAR_SIZE", 16);
|
|
960
958
|
let $t = pt;
|
|
961
959
|
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", $t);
|
|
962
960
|
var Kt, Rt;
|
|
963
961
|
const _e = class _e extends HTMLElement {
|
|
964
962
|
constructor() {
|
|
965
963
|
super();
|
|
966
|
-
d(this, Kt, /* @__PURE__ */
|
|
964
|
+
d(this, Kt, /* @__PURE__ */ h(() => {
|
|
967
965
|
var e;
|
|
968
966
|
(e = this.querySelector(".nine-tab-bar")) == null || e.addEventListener("click", (s) => {
|
|
969
967
|
var o;
|
|
@@ -971,21 +969,21 @@ const _e = class _e extends HTMLElement {
|
|
|
971
969
|
t(this, Rt).call(this, n, r);
|
|
972
970
|
}), t(this, Rt).call(this, 0, !1);
|
|
973
971
|
}, "#init"));
|
|
974
|
-
d(this, Rt, /* @__PURE__ */
|
|
975
|
-
const r = /* @__PURE__ */
|
|
972
|
+
d(this, Rt, /* @__PURE__ */ h((e, s = !1) => {
|
|
973
|
+
const r = /* @__PURE__ */ h(() => {
|
|
976
974
|
const f = Array.from(this.querySelectorAll("nine-table-sheet"));
|
|
977
975
|
Array.from(this.querySelectorAll("nine-splitter")).forEach((u) => u.style.setProperty("display", "none"));
|
|
978
976
|
const b = f.filter((u) => u.classList.contains("active"));
|
|
979
977
|
b.length < 2 || b.forEach((u) => {
|
|
980
|
-
const
|
|
981
|
-
|
|
978
|
+
const m = parseInt(u.getAttribute("data-index"), 10), S = this.querySelector(`nine-splitter[data-split-index="${m}"]`), E = f[m + 1];
|
|
979
|
+
S && E && E.classList.contains("active") && S.style.setProperty("display", "flex");
|
|
982
980
|
});
|
|
983
|
-
}, "updateSplitters"), n = this.querySelector(".nine-tab-bar"), o = this.querySelector("nine-table-sheets-body"), a = n.querySelectorAll(".nine-tab-item"),
|
|
981
|
+
}, "updateSplitters"), n = this.querySelector(".nine-tab-bar"), o = this.querySelector("nine-table-sheets-body"), a = n.querySelectorAll(".nine-tab-item"), c = o.querySelectorAll("nine-table-sheet");
|
|
984
982
|
if (!a[e]) return;
|
|
985
983
|
if (!s)
|
|
986
984
|
a.forEach((f, g) => {
|
|
987
985
|
f.classList.toggle("active", g === e);
|
|
988
|
-
}),
|
|
986
|
+
}), c.forEach((f, g) => {
|
|
989
987
|
const b = g === e;
|
|
990
988
|
f.classList.toggle("active", b), f.style.flex = b ? "1 1 100%" : "";
|
|
991
989
|
});
|
|
@@ -1007,31 +1005,31 @@ const _e = class _e extends HTMLElement {
|
|
|
1007
1005
|
t(this, Kt).call(this);
|
|
1008
1006
|
}
|
|
1009
1007
|
};
|
|
1010
|
-
Kt = new WeakMap(), Rt = new WeakMap(),
|
|
1008
|
+
Kt = new WeakMap(), Rt = new WeakMap(), h(_e, "NineTableSheets");
|
|
1011
1009
|
let de = _e;
|
|
1012
1010
|
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", de);
|
|
1013
1011
|
var M, Zt, Tt, Gt;
|
|
1014
1012
|
const Ne = class Ne {
|
|
1015
1013
|
constructor(i) {
|
|
1016
1014
|
d(this, M);
|
|
1017
|
-
d(this, Zt, /* @__PURE__ */
|
|
1015
|
+
d(this, Zt, /* @__PURE__ */ h(() => {
|
|
1018
1016
|
t(this, Gt).call(this), new ResizeObserver((i) => {
|
|
1019
1017
|
for (let e of i)
|
|
1020
1018
|
t(this, M).getAttribute("auto-height") === "true" && t(this, Tt).call(this);
|
|
1021
1019
|
}).observe(t(this, M));
|
|
1022
1020
|
}, "#init"));
|
|
1023
|
-
d(this, Tt, /* @__PURE__ */
|
|
1024
|
-
var
|
|
1021
|
+
d(this, Tt, /* @__PURE__ */ h(() => {
|
|
1022
|
+
var c, l;
|
|
1025
1023
|
const i = Array.from(t(this, M).shadowRoot.querySelectorAll("nine-table-sheet.active"));
|
|
1026
1024
|
if (i.length === 0) return;
|
|
1027
|
-
const e = parseInt(t(this, M).getAttribute("max-display-row"), 10) || 10, s = Math.max(...i.map((f) => f.getRowHeight())), r = (
|
|
1025
|
+
const e = parseInt(t(this, M).getAttribute("max-display-row"), 10) || 10, s = Math.max(...i.map((f) => f.getRowHeight())), r = (c = t(this, M).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : c.getBoundingClientRect().height, n = (l = t(this, M).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : l.getBoundingClientRect().height, o = $t.SCROLLBAR_SIZE, a = e * s + r + n + o;
|
|
1028
1026
|
t(this, M).style.height = `${a}px`;
|
|
1029
1027
|
}, "#applyAutoHeight"));
|
|
1030
|
-
d(this, Gt, /* @__PURE__ */
|
|
1031
|
-
const e = Array.from(t(this, M).children).filter((
|
|
1028
|
+
d(this, Gt, /* @__PURE__ */ h(() => {
|
|
1029
|
+
const e = Array.from(t(this, M).children).filter((c) => c.tagName === "TABLE"), s = t(this, M).getAttribute("auto-height") === "true", r = e.length, n = e.map((c, l) => {
|
|
1032
1030
|
const g = `<nine-table-sheet class="${l === 0 ? "active" : ""}" data-index="${l}"></nine-table-sheet>`, b = l < r - 1 ? `<nine-splitter class="h" data-split-index="${l}"></nine-splitter>` : "";
|
|
1033
1031
|
return g + b;
|
|
1034
|
-
}).join(""), o = e.map((
|
|
1032
|
+
}).join(""), o = e.map((c, l) => `<div class="nine-tab-item ${l === 0 ? "active" : ""}" data-index="${l}">Sheet ${l + 1}</div>`).join("");
|
|
1035
1033
|
t(this, M).shadowRoot.innerHTML = `
|
|
1036
1034
|
<style>
|
|
1037
1035
|
:host {
|
|
@@ -1154,96 +1152,96 @@ const Ne = class Ne {
|
|
|
1154
1152
|
<nine-table-footer></nine-table-footer>
|
|
1155
1153
|
`, t(this, M).shadowRoot.querySelector("nine-table-sheets").classList.add("nodata");
|
|
1156
1154
|
const a = t(this, M).shadowRoot.querySelectorAll("nine-table-sheet");
|
|
1157
|
-
a == null || a.forEach((
|
|
1155
|
+
a == null || a.forEach((c, l) => {
|
|
1158
1156
|
e[l] && setTimeout(() => {
|
|
1159
|
-
|
|
1157
|
+
c.generate(e[l]), s && t(this, Tt).call(this);
|
|
1160
1158
|
});
|
|
1161
1159
|
});
|
|
1162
1160
|
}, "#render"));
|
|
1163
1161
|
y(this, M, i), t(this, Zt).call(this);
|
|
1164
1162
|
}
|
|
1165
1163
|
};
|
|
1166
|
-
M = new WeakMap(), Zt = new WeakMap(), Tt = new WeakMap(), Gt = new WeakMap(),
|
|
1164
|
+
M = new WeakMap(), Zt = new WeakMap(), Tt = new WeakMap(), Gt = new WeakMap(), h(Ne, "LayoutManager");
|
|
1167
1165
|
let fe = Ne;
|
|
1168
|
-
var kt,
|
|
1166
|
+
var kt, ht;
|
|
1169
1167
|
const We = class We {
|
|
1170
1168
|
constructor(i) {
|
|
1171
1169
|
d(this, kt);
|
|
1172
|
-
d(this,
|
|
1173
|
-
|
|
1170
|
+
d(this, ht, -1);
|
|
1171
|
+
A(this, "count", /* @__PURE__ */ h(() => t(this, kt).rawRecords.length, "count"));
|
|
1174
1172
|
y(this, kt, i);
|
|
1175
1173
|
}
|
|
1176
1174
|
get at() {
|
|
1177
|
-
return t(this,
|
|
1175
|
+
return t(this, ht);
|
|
1178
1176
|
}
|
|
1179
1177
|
set at(i) {
|
|
1180
|
-
y(this,
|
|
1178
|
+
y(this, ht, parseInt(i, 10)), body && !body.querySelector(`tbody.bindable tr[data-row="${t(this, ht)}"]`) && setTimeout(() => {
|
|
1181
1179
|
});
|
|
1182
1180
|
}
|
|
1183
1181
|
};
|
|
1184
|
-
kt = new WeakMap(),
|
|
1182
|
+
kt = new WeakMap(), ht = new WeakMap(), h(We, "ngRow");
|
|
1185
1183
|
let ue = We;
|
|
1186
|
-
var
|
|
1187
|
-
const
|
|
1184
|
+
var N, k, W, dt, Jt, Y, Qt, it, Ct, te, ee, ft;
|
|
1185
|
+
const O = class O {
|
|
1188
1186
|
constructor(i, e) {
|
|
1189
|
-
d(this,
|
|
1187
|
+
d(this, N);
|
|
1190
1188
|
d(this, k);
|
|
1191
|
-
d(this,
|
|
1192
|
-
d(this,
|
|
1189
|
+
d(this, W, []);
|
|
1190
|
+
d(this, dt, []);
|
|
1193
1191
|
d(this, Jt, 0);
|
|
1194
|
-
d(this,
|
|
1195
|
-
d(this, Qt, /* @__PURE__ */
|
|
1196
|
-
y(this,
|
|
1197
|
-
const i = t(this,
|
|
1192
|
+
d(this, Y, []);
|
|
1193
|
+
d(this, Qt, /* @__PURE__ */ h(() => {
|
|
1194
|
+
y(this, Y, []);
|
|
1195
|
+
const i = t(this, N).template || [];
|
|
1198
1196
|
Array.from(i).forEach((e) => {
|
|
1199
1197
|
var s;
|
|
1200
|
-
t(this,
|
|
1198
|
+
t(this, Y).push(((s = e.getBoundingClientRect) == null ? void 0 : s.call(e).height) || 24);
|
|
1201
1199
|
}), (t(this, k).rawRecords || []).forEach((e) => {
|
|
1202
|
-
e.__ng || (e.__ng = t(this, Ct).call(this)), e.__ng.height = t(this,
|
|
1200
|
+
e.__ng || (e.__ng = t(this, Ct).call(this)), e.__ng.height = t(this, Y).slice();
|
|
1203
1201
|
});
|
|
1204
1202
|
}, "#initialize"));
|
|
1205
|
-
d(this,
|
|
1206
|
-
const i = t(this,
|
|
1207
|
-
i == null || i.classList.toggle("nodata", this.length === 0), t(this,
|
|
1203
|
+
d(this, it, /* @__PURE__ */ h(() => {
|
|
1204
|
+
const i = t(this, N).shadowRoot.querySelector("nine-table-sheets");
|
|
1205
|
+
i == null || i.classList.toggle("nodata", this.length === 0), t(this, N).shadowRoot.querySelectorAll("nine-table-sheet").forEach((e) => {
|
|
1208
1206
|
e.invalidate();
|
|
1209
1207
|
});
|
|
1210
1208
|
}, "#invalidate"));
|
|
1211
|
-
|
|
1209
|
+
A(this, "get", /* @__PURE__ */ h((i, e) => {
|
|
1212
1210
|
var n;
|
|
1213
1211
|
const s = this.getValidData();
|
|
1214
1212
|
if (!s || s.length <= 0) return;
|
|
1215
|
-
if (i == null) return t(this,
|
|
1213
|
+
if (i == null) return t(this, ft).call(this, s);
|
|
1216
1214
|
if (i < 0 || i >= s.length) return null;
|
|
1217
|
-
const r = typeof ((n = t(this,
|
|
1215
|
+
const r = typeof ((n = t(this, N).fields) == null ? void 0 : n.get) == "function" ? t(this, N).fields.get() : [];
|
|
1218
1216
|
if (e != null) {
|
|
1219
1217
|
const o = r.indexOf(e);
|
|
1220
1218
|
return o >= 0 ? s[i].v[o] : null;
|
|
1221
1219
|
}
|
|
1222
|
-
return t(this,
|
|
1220
|
+
return t(this, ft).call(this, s[i]);
|
|
1223
1221
|
}, "get"));
|
|
1224
|
-
|
|
1225
|
-
this.clear(), this.add(i, !1), t(this,
|
|
1222
|
+
A(this, "set", /* @__PURE__ */ h((i) => {
|
|
1223
|
+
this.clear(), this.add(i, !1), t(this, it).call(this);
|
|
1226
1224
|
}, "set"));
|
|
1227
|
-
d(this, Ct, /* @__PURE__ */
|
|
1228
|
-
rowState:
|
|
1225
|
+
d(this, Ct, /* @__PURE__ */ h(() => ({
|
|
1226
|
+
rowState: O.ROW_STATE.EMPTY,
|
|
1229
1227
|
deleted: !1,
|
|
1230
1228
|
filtered: !1,
|
|
1231
|
-
height: t(this,
|
|
1229
|
+
height: t(this, Y).slice(),
|
|
1232
1230
|
o: {},
|
|
1233
1231
|
c: {},
|
|
1234
|
-
_: [0, 0, 0, 0,
|
|
1232
|
+
_: [0, 0, 0, 0, O.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this, Y).slice(), -1, {}, {}]
|
|
1235
1233
|
}), "#getDefaultMeta"));
|
|
1236
|
-
|
|
1237
|
-
y(this,
|
|
1234
|
+
A(this, "reset", /* @__PURE__ */ h(() => {
|
|
1235
|
+
y(this, W, []), y(this, dt, []), t(this, it).call(this);
|
|
1238
1236
|
}, "reset"));
|
|
1239
|
-
|
|
1237
|
+
A(this, "clear", /* @__PURE__ */ h(() => {
|
|
1240
1238
|
var i;
|
|
1241
|
-
t(this, k).rawRecords = [], y(this,
|
|
1239
|
+
t(this, k).rawRecords = [], y(this, W, []), y(this, dt, []), (i = t(this, k).viewRecords) != null && i.reset && t(this, k).viewRecords.reset();
|
|
1242
1240
|
}, "clear"));
|
|
1243
|
-
d(this, te, /* @__PURE__ */
|
|
1241
|
+
d(this, te, /* @__PURE__ */ h((i) => {
|
|
1244
1242
|
var r;
|
|
1245
1243
|
Array.isArray(i) || (i = [i]);
|
|
1246
|
-
const e = typeof ((r = t(this,
|
|
1244
|
+
const e = typeof ((r = t(this, N).fields) == null ? void 0 : r.get) == "function" ? t(this, N).fields.get() : Object.keys(i[0] || {}), s = [];
|
|
1247
1245
|
return i.forEach((n) => {
|
|
1248
1246
|
const o = { v: [] };
|
|
1249
1247
|
e.forEach((a) => {
|
|
@@ -1251,64 +1249,64 @@ const z = class z {
|
|
|
1251
1249
|
}), s.push(o);
|
|
1252
1250
|
}), s;
|
|
1253
1251
|
}, "#json2Array"));
|
|
1254
|
-
d(this, ee, /* @__PURE__ */
|
|
1255
|
-
e.__ng = t(this, Ct).call(this), e.__ng.rowid = this.nextId, e.__ng.rowState =
|
|
1252
|
+
d(this, ee, /* @__PURE__ */ h((i) => (Array.isArray(i) || (i = [i]), i.forEach((e) => {
|
|
1253
|
+
e.__ng = t(this, Ct).call(this), e.__ng.rowid = this.nextId, e.__ng.rowState = O.ROW_STATE.INSERT, e.__ng._[0] = e.__ng.rowid;
|
|
1256
1254
|
}), i), "#defaultInsert"));
|
|
1257
|
-
|
|
1255
|
+
A(this, "add", /* @__PURE__ */ h((i, e = !0) => {
|
|
1258
1256
|
i === void 0 && (i = {});
|
|
1259
1257
|
const s = t(this, te).call(this, i);
|
|
1260
1258
|
t(this, k).rawRecords = t(this, k).rawRecords.concat(t(this, ee).call(this, s)), this.resetRecords();
|
|
1261
1259
|
const r = this.count() - 1;
|
|
1262
1260
|
return e || s.forEach((n, o) => {
|
|
1263
1261
|
const a = t(this, k).rawRecords[r - o];
|
|
1264
|
-
a && (a.__ng.rowState =
|
|
1265
|
-
}), t(this,
|
|
1262
|
+
a && (a.__ng.rowState = O.ROW_STATE.EMPTY);
|
|
1263
|
+
}), t(this, it).call(this), r;
|
|
1266
1264
|
}, "add"));
|
|
1267
|
-
|
|
1265
|
+
A(this, "delete", /* @__PURE__ */ h((i) => {
|
|
1268
1266
|
let e = [];
|
|
1269
1267
|
Array.isArray(i) ? e = i : typeof i > "u" ? e = [t(this, k).host.row.at] : e = [parseInt(i, 10)], e.sort((s, r) => r - s).forEach((s) => {
|
|
1270
|
-
if (t(this,
|
|
1271
|
-
const r = t(this,
|
|
1272
|
-
t(this,
|
|
1273
|
-
n.__ng.rowid === r && (n.__ng.deleted = !0, n.__ng.rowState =
|
|
1268
|
+
if (t(this, W)[s]) {
|
|
1269
|
+
const r = t(this, W)[s].__ng.rowid;
|
|
1270
|
+
t(this, W)[s].__ng.rowState === O.ROW_STATE.INSERT ? t(this, k).rawRecords = t(this, k).rawRecords.filter((n) => n.__ng.rowid !== r) : t(this, k).rawRecords.forEach((n) => {
|
|
1271
|
+
n.__ng.rowid === r && (n.__ng.deleted = !0, n.__ng.rowState = O.ROW_STATE.DELETE);
|
|
1274
1272
|
});
|
|
1275
1273
|
}
|
|
1276
|
-
}), this.resetRecords(), t(this,
|
|
1274
|
+
}), this.resetRecords(), t(this, it).call(this);
|
|
1277
1275
|
}, "delete"));
|
|
1278
|
-
|
|
1279
|
-
var
|
|
1276
|
+
A(this, "setValue", /* @__PURE__ */ h((i, e, s) => {
|
|
1277
|
+
var c;
|
|
1280
1278
|
i = parseInt(i, 10);
|
|
1281
|
-
const n = (typeof ((
|
|
1279
|
+
const n = (typeof ((c = t(this, N).fields) == null ? void 0 : c.get) == "function" ? t(this, N).fields.get() : []).indexOf(e);
|
|
1282
1280
|
if (n < 0) return;
|
|
1283
1281
|
const o = this.getValidData()[i];
|
|
1284
1282
|
if (!o) return;
|
|
1285
1283
|
const a = o.v[n];
|
|
1286
|
-
a !== s && o.__ng.rowState !==
|
|
1284
|
+
a !== s && o.__ng.rowState !== O.ROW_STATE.INSERT && (o.__ng.o.hasOwnProperty(e) || (o.__ng.o[e] = a), o.__ng.rowState = O.ROW_STATE.UPDATE), o.v[n] = s;
|
|
1287
1285
|
}, "setValue"));
|
|
1288
|
-
|
|
1289
|
-
y(this,
|
|
1286
|
+
A(this, "resetRecords", /* @__PURE__ */ h(() => {
|
|
1287
|
+
y(this, dt, t(this, k).rawRecords.filter((i) => !i.__ng.deleted)), y(this, W, t(this, k).rawRecords.filter((i) => !i.__ng.deleted && !i.__ng.filtered)), t(this, k).rawRecords.forEach((i, e) => {
|
|
1290
1288
|
i.__ng.rowidx = e;
|
|
1291
|
-
}), t(this,
|
|
1289
|
+
}), t(this, W).forEach((i, e) => {
|
|
1292
1290
|
i.__ng.i = e;
|
|
1293
1291
|
});
|
|
1294
1292
|
}, "resetRecords"));
|
|
1295
|
-
|
|
1296
|
-
d(this,
|
|
1293
|
+
A(this, "getValidData", /* @__PURE__ */ h(() => (t(this, W).length === 0 && t(this, k).rawRecords.length > 0 && this.resetRecords(), t(this, W)), "getValidData"));
|
|
1294
|
+
d(this, ft, /* @__PURE__ */ h((i) => {
|
|
1297
1295
|
var o;
|
|
1298
1296
|
if (!i) return i;
|
|
1299
|
-
const e = !Array.isArray(i), s = e ? [i] : i, r = typeof ((o = t(this,
|
|
1300
|
-
const
|
|
1297
|
+
const e = !Array.isArray(i), s = e ? [i] : i, r = typeof ((o = t(this, N).fields) == null ? void 0 : o.get) == "function" ? t(this, N).fields.get() : [], n = s.filter((a) => !a.__ng.deleted).map((a) => {
|
|
1298
|
+
const c = {};
|
|
1301
1299
|
return r.forEach((l, f) => {
|
|
1302
|
-
|
|
1303
|
-
}),
|
|
1300
|
+
c[l] = a.v ? a.v[f] : a[l];
|
|
1301
|
+
}), c.__ng = a.__ng, c;
|
|
1304
1302
|
});
|
|
1305
1303
|
return e ? n[0] : n;
|
|
1306
1304
|
}, "#conv"));
|
|
1307
|
-
|
|
1308
|
-
y(this,
|
|
1305
|
+
A(this, "count", /* @__PURE__ */ h(() => this.getValidData().length, "count"));
|
|
1306
|
+
y(this, N, i), y(this, k, e), t(this, Qt).call(this);
|
|
1309
1307
|
}
|
|
1310
1308
|
get source() {
|
|
1311
|
-
return t(this,
|
|
1309
|
+
return t(this, ft).call(this, t(this, k).rawRecords);
|
|
1312
1310
|
}
|
|
1313
1311
|
set source(i) {
|
|
1314
1312
|
this.clear(), this.add(i, !1);
|
|
@@ -1317,31 +1315,31 @@ const z = class z {
|
|
|
1317
1315
|
return ++Ue(this, Jt)._;
|
|
1318
1316
|
}
|
|
1319
1317
|
get count() {
|
|
1320
|
-
return t(this,
|
|
1318
|
+
return t(this, W).length;
|
|
1321
1319
|
}
|
|
1322
1320
|
get length() {
|
|
1323
|
-
return t(this,
|
|
1321
|
+
return t(this, W).length;
|
|
1324
1322
|
}
|
|
1325
1323
|
getRowCount() {
|
|
1326
1324
|
return this.length;
|
|
1327
1325
|
}
|
|
1328
1326
|
};
|
|
1329
|
-
|
|
1330
|
-
|
|
1327
|
+
N = new WeakMap(), k = new WeakMap(), W = new WeakMap(), dt = new WeakMap(), Jt = new WeakMap(), Y = new WeakMap(), Qt = new WeakMap(), it = new WeakMap(), Ct = new WeakMap(), te = new WeakMap(), ee = new WeakMap(), ft = new WeakMap(), h(O, "ngData"), // 🎯 행 상태 정의 상수를 클래스 내부로 내재화
|
|
1328
|
+
A(O, "ROW_STATE", {
|
|
1331
1329
|
EMPTY: "EMPTY",
|
|
1332
1330
|
NORMAL: "NORMAL",
|
|
1333
1331
|
INSERT: "INSERT",
|
|
1334
1332
|
UPDATE: "UPDATE",
|
|
1335
1333
|
DELETE: "DELETE"
|
|
1336
1334
|
});
|
|
1337
|
-
let ge =
|
|
1338
|
-
var
|
|
1335
|
+
let ge = O;
|
|
1336
|
+
var rt;
|
|
1339
1337
|
const Oe = class Oe {
|
|
1340
1338
|
constructor(i) {
|
|
1341
|
-
d(this,
|
|
1342
|
-
y(this,
|
|
1339
|
+
d(this, rt);
|
|
1340
|
+
y(this, rt, i), this.row = new ue(this), this.data = new ge(t(this, rt), this), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.pageCnt = 25, this.viewRecords.reset = () => {
|
|
1343
1341
|
var e;
|
|
1344
|
-
(e = t(this,
|
|
1342
|
+
(e = t(this, rt).view) != null && e.redraw && t(this, rt).view.redraw();
|
|
1345
1343
|
}, this.setDataSource = (e) => {
|
|
1346
1344
|
this.data && this.data.reset(), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.data.set(e || []);
|
|
1347
1345
|
}, this.getRowState = (e) => {
|
|
@@ -1356,28 +1354,28 @@ const Oe = class Oe {
|
|
|
1356
1354
|
}, this.setDataSource([]);
|
|
1357
1355
|
}
|
|
1358
1356
|
};
|
|
1359
|
-
|
|
1357
|
+
rt = new WeakMap(), h(Oe, "ngDataManager");
|
|
1360
1358
|
let be = Oe;
|
|
1361
|
-
var
|
|
1359
|
+
var ut, L, Lt, se;
|
|
1362
1360
|
const ze = class ze {
|
|
1363
1361
|
// 🎯 이제 { name: string, type: string } 객체들의 배열로 관리합니다.
|
|
1364
1362
|
constructor(i) {
|
|
1365
|
-
d(this,
|
|
1363
|
+
d(this, ut);
|
|
1366
1364
|
d(this, L, []);
|
|
1367
|
-
|
|
1365
|
+
A(this, "add", /* @__PURE__ */ h((i, e = "string") => {
|
|
1368
1366
|
i.forEach((s) => {
|
|
1369
1367
|
t(this, L).some((r) => r.name === s) || t(this, L).push({ name: s, type: e });
|
|
1370
1368
|
}), t(this, Lt).call(this);
|
|
1371
1369
|
}, "add"));
|
|
1372
|
-
d(this, Lt, /* @__PURE__ */
|
|
1370
|
+
d(this, Lt, /* @__PURE__ */ h(() => {
|
|
1373
1371
|
const i = /* @__PURE__ */ new Map();
|
|
1374
1372
|
t(this, L).forEach((e) => {
|
|
1375
1373
|
i.set(e.name, e.type);
|
|
1376
1374
|
}), y(this, L, Array.from(i, ([e, s]) => ({ name: e, type: s }))), y(this, L, t(this, L).filter((e) => e.name !== "" && e.name !== "__ng")), t(this, L).sort((e, s) => e.name.length < s.name.length ? 1 : -1);
|
|
1377
1375
|
}, "#adjust"));
|
|
1378
|
-
d(this, se, /* @__PURE__ */
|
|
1379
|
-
y(this, L, []), H.log(t(this,
|
|
1380
|
-
const i = Array.from(t(this,
|
|
1376
|
+
d(this, se, /* @__PURE__ */ h(() => {
|
|
1377
|
+
y(this, L, []), H.log(t(this, ut).querySelectorAll("table"));
|
|
1378
|
+
const i = Array.from(t(this, ut).querySelectorAll("table"));
|
|
1381
1379
|
if (!(!i || i.length === 0)) {
|
|
1382
1380
|
for (const e of i)
|
|
1383
1381
|
H.log(e), $("[data-bind]", e).each((s, r) => {
|
|
@@ -1397,9 +1395,9 @@ const ze = class ze {
|
|
|
1397
1395
|
}
|
|
1398
1396
|
o.split("data.").forEach((a) => {
|
|
1399
1397
|
if (a.trim() != "") {
|
|
1400
|
-
const
|
|
1398
|
+
const c = a.search(/[^_A-Za-z0-9]/g);
|
|
1401
1399
|
let l = "";
|
|
1402
|
-
|
|
1400
|
+
c >= 0 ? l = a.substring(0, c) : o.startsWith("data.") && (l = a.replace("data.", "")), l && t(this, L).push({ name: l, type: "string" });
|
|
1403
1401
|
}
|
|
1404
1402
|
});
|
|
1405
1403
|
});
|
|
@@ -1407,7 +1405,7 @@ const ze = class ze {
|
|
|
1407
1405
|
t(this, Lt).call(this);
|
|
1408
1406
|
}
|
|
1409
1407
|
}, "#init"));
|
|
1410
|
-
y(this,
|
|
1408
|
+
y(this, ut, i), t(this, se).call(this);
|
|
1411
1409
|
}
|
|
1412
1410
|
// 🎯 기존에 필드 이름만 쓰던 곳들과의 호환을 위해 이름 배열만 리턴하는 메서드 유지
|
|
1413
1411
|
get() {
|
|
@@ -1429,19 +1427,19 @@ const ze = class ze {
|
|
|
1429
1427
|
return t(this, L).some((e) => e.name === i);
|
|
1430
1428
|
}
|
|
1431
1429
|
};
|
|
1432
|
-
|
|
1430
|
+
ut = new WeakMap(), L = new WeakMap(), Lt = new WeakMap(), se = new WeakMap(), h(ze, "ngFields");
|
|
1433
1431
|
let ye = ze;
|
|
1434
|
-
var
|
|
1432
|
+
var nt, ie, re;
|
|
1435
1433
|
const Be = class Be extends HTMLElement {
|
|
1436
1434
|
constructor() {
|
|
1437
1435
|
super();
|
|
1438
1436
|
//#created = false;
|
|
1439
|
-
d(this,
|
|
1437
|
+
d(this, nt);
|
|
1440
1438
|
d(this, ie);
|
|
1441
|
-
d(this, re, /* @__PURE__ */
|
|
1439
|
+
d(this, re, /* @__PURE__ */ h(() => {
|
|
1442
1440
|
this.fields = new ye(this), y(this, ie, new fe(this)), H.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
|
|
1443
1441
|
}, "#init"));
|
|
1444
|
-
this.attachShadow({ mode: "open" }), y(this,
|
|
1442
|
+
this.attachShadow({ mode: "open" }), y(this, nt, new be(this));
|
|
1445
1443
|
}
|
|
1446
1444
|
connectedCallback() {
|
|
1447
1445
|
t(this, re).call(this);
|
|
@@ -1451,18 +1449,18 @@ const Be = class Be extends HTMLElement {
|
|
|
1451
1449
|
}
|
|
1452
1450
|
// 🎯 외부에서 grid.data.set(...) 형태로 접근할 수 있도록 데이터 매니저 오픈
|
|
1453
1451
|
get data() {
|
|
1454
|
-
return t(this,
|
|
1452
|
+
return t(this, nt).data;
|
|
1455
1453
|
}
|
|
1456
1454
|
// 🎯 행(row) 관련 제어 접근자 오픈
|
|
1457
1455
|
get row() {
|
|
1458
|
-
return t(this,
|
|
1456
|
+
return t(this, nt).row;
|
|
1459
1457
|
}
|
|
1460
1458
|
// 🎯 전체 데이터 매니저 접근 필요할 경우
|
|
1461
1459
|
get dataManager() {
|
|
1462
|
-
return t(this,
|
|
1460
|
+
return t(this, nt);
|
|
1463
1461
|
}
|
|
1464
1462
|
};
|
|
1465
|
-
|
|
1463
|
+
nt = new WeakMap(), ie = new WeakMap(), re = new WeakMap(), h(Be, "NineTable");
|
|
1466
1464
|
let pe = Be;
|
|
1467
1465
|
customElements.get("nine-table") || customElements.define("nine-table", pe);
|
|
1468
1466
|
const mt = class mt extends HTMLElement {
|
|
@@ -1476,7 +1474,7 @@ const mt = class mt extends HTMLElement {
|
|
|
1476
1474
|
connectedCallback() {
|
|
1477
1475
|
}
|
|
1478
1476
|
};
|
|
1479
|
-
|
|
1477
|
+
h(mt, "BasicCellElement"), A(mt, "_styleCache", /* @__PURE__ */ new Map()), A(mt, "_customStyleCache", /* @__PURE__ */ new Map());
|
|
1480
1478
|
let me = mt;
|
|
1481
1479
|
var C, Ht, p, qe, Re, Te, ke, Ce;
|
|
1482
1480
|
const De = class De extends me {
|
|
@@ -1489,7 +1487,7 @@ const De = class De extends me {
|
|
|
1489
1487
|
d(this, Re);
|
|
1490
1488
|
d(this, Te);
|
|
1491
1489
|
d(this, ke);
|
|
1492
|
-
|
|
1490
|
+
A(this, "getDisplayText", /* @__PURE__ */ h((e) => {
|
|
1493
1491
|
if (t(this, p))
|
|
1494
1492
|
if (t(this, p).closest("tbody")) {
|
|
1495
1493
|
const s = t(this, p).closest("tr").data, r = parseInt(t(this, p).dataset.row);
|
|
@@ -1509,22 +1507,22 @@ const De = class De extends me {
|
|
|
1509
1507
|
} catch {
|
|
1510
1508
|
}
|
|
1511
1509
|
}, "getDisplayText"));
|
|
1512
|
-
d(this, Ce, /* @__PURE__ */
|
|
1510
|
+
d(this, Ce, /* @__PURE__ */ h(() => {
|
|
1513
1511
|
if (!(!t(this, C) || !t(this, C).template || !t(this, p).closest("tbody.bindable"))) {
|
|
1514
1512
|
var e = ninegrid.j.querySelectorAll(t(this, p)).attr("suppress");
|
|
1515
1513
|
if (e && (e = parseInt(e)), e && !isNaN(e)) {
|
|
1516
1514
|
var s = t(this, p).closest("tr"), r = [];
|
|
1517
|
-
$("th,td", s).each((
|
|
1518
|
-
var R = ninegrid.j.querySelectorAll(
|
|
1519
|
-
R &&
|
|
1515
|
+
$("th,td", s).each((v, I) => {
|
|
1516
|
+
var R = ninegrid.j.querySelectorAll(I).attr("suppress");
|
|
1517
|
+
R && I.dataset.row && (R = parseInt(R), !isNaN(R) && R <= e && r.push(R));
|
|
1520
1518
|
}), r.sort();
|
|
1521
1519
|
var n = !1;
|
|
1522
1520
|
if (parseInt(s.sectionRowIndex / t(this, C).template.length) > 0)
|
|
1523
1521
|
for (var o of r) {
|
|
1524
1522
|
if (o > e) break;
|
|
1525
|
-
var a = parseInt(t(this, p).dataset.row),
|
|
1523
|
+
var a = parseInt(t(this, p).dataset.row), c = a - 1, l = t(this, p).closest("tr").data, f = t(this, C).data.get(c);
|
|
1526
1524
|
t(this, p).dataset.matrixRow;
|
|
1527
|
-
var g = t(this, C).body.querySelector(`tbody.bindable [suppress="${o}"][data-matrix-row="${t(this, p).dataset.matrixRow}"]`), b = g.dataset.expr ? this.getExprValue(g.dataset.expr, l, a) : l[g.dataset.bind], u = g.dataset.expr ? this.getExprValue(g.dataset.expr, f,
|
|
1525
|
+
var g = t(this, C).body.querySelector(`tbody.bindable [suppress="${o}"][data-matrix-row="${t(this, p).dataset.matrixRow}"]`), b = g.dataset.expr ? this.getExprValue(g.dataset.expr, l, a) : l[g.dataset.bind], u = g.dataset.expr ? this.getExprValue(g.dataset.expr, f, c) : f[g.dataset.bind];
|
|
1528
1526
|
if (b != u) {
|
|
1529
1527
|
n = !0;
|
|
1530
1528
|
break;
|
|
@@ -1533,12 +1531,12 @@ const De = class De extends me {
|
|
|
1533
1531
|
else
|
|
1534
1532
|
n = !0;
|
|
1535
1533
|
n ? ninegrid.j.querySelectorAll(t(this, p)).removeClass("suppress") : ninegrid.j.querySelectorAll(t(this, p)).addClass("suppress"), ninegrid.j.querySelectorAll(t(this, p)).hasClass("hidden") || (n ? ninegrid.j.querySelectorAll(t(this, p)).removeClass("hidden") : ninegrid.j.querySelectorAll(t(this, p)).addClass("hidden"));
|
|
1536
|
-
var
|
|
1537
|
-
$(
|
|
1534
|
+
var m = parseInt(t(this, p).dataset.matrixRow), S = m - 1, E = t(this, C).body.querySelector(`tbody.bindable [data-col="${t(this, p).dataset.col}"][data-matrix-row="${S}"]`);
|
|
1535
|
+
$(E).hasClass("suppress") && !ninegrid.j.querySelectorAll(t(this, p)).hasClass("suppress") ? ninegrid.j.querySelectorAll(E).removeClass("last-none-suppress").addClass("last-suppress") : !$(E).hasClass("suppress") && ninegrid.j.querySelectorAll(t(this, p)).hasClass("suppress") ? ninegrid.j.querySelectorAll(E).removeClass("last-suppress").addClass("last-none-suppress") : ninegrid.j.querySelectorAll(E).removeClass("last-none-suppress").removeClass("last-suppress");
|
|
1538
1536
|
}
|
|
1539
1537
|
}
|
|
1540
1538
|
}, "#resetSuppress"));
|
|
1541
|
-
|
|
1539
|
+
A(this, "getExprValue", /* @__PURE__ */ h((e, s, r, n) => {
|
|
1542
1540
|
if (typeof e < "u")
|
|
1543
1541
|
try {
|
|
1544
1542
|
r = parseInt(r);
|
|
@@ -1574,7 +1572,7 @@ const De = class De extends me {
|
|
|
1574
1572
|
return parseInt(t(this, p).dataset.row), t(this, Ht).data[e];
|
|
1575
1573
|
}
|
|
1576
1574
|
};
|
|
1577
|
-
C = new WeakMap(), Ht = new WeakMap(), p = new WeakMap(), qe = new WeakMap(), Re = new WeakMap(), Te = new WeakMap(), ke = new WeakMap(), Ce = new WeakMap(),
|
|
1575
|
+
C = new WeakMap(), Ht = new WeakMap(), p = new WeakMap(), qe = new WeakMap(), Re = new WeakMap(), Te = new WeakMap(), ke = new WeakMap(), Ce = new WeakMap(), h(De, "CellElement");
|
|
1578
1576
|
let ve = De;
|
|
1579
1577
|
const Pe = class Pe extends ve {
|
|
1580
1578
|
constructor() {
|
|
@@ -1587,19 +1585,19 @@ const Pe = class Pe extends ve {
|
|
|
1587
1585
|
return super.refresh();
|
|
1588
1586
|
}
|
|
1589
1587
|
};
|
|
1590
|
-
|
|
1588
|
+
h(Pe, "EditableCellElement");
|
|
1591
1589
|
let xe = Pe;
|
|
1592
|
-
var Mt,
|
|
1590
|
+
var Mt, ot, gt, bt, ne, U, Le;
|
|
1593
1591
|
const je = class je extends xe {
|
|
1594
1592
|
constructor() {
|
|
1595
1593
|
super();
|
|
1596
1594
|
d(this, Mt);
|
|
1597
|
-
d(this,
|
|
1595
|
+
d(this, ot);
|
|
1596
|
+
d(this, gt);
|
|
1598
1597
|
d(this, bt);
|
|
1599
|
-
d(this, yt);
|
|
1600
1598
|
d(this, ne);
|
|
1601
|
-
d(this,
|
|
1602
|
-
|
|
1599
|
+
d(this, U);
|
|
1600
|
+
A(this, "refresh", /* @__PURE__ */ h(() => {
|
|
1603
1601
|
const e = super.refresh();
|
|
1604
1602
|
t(this, Mt).value = e;
|
|
1605
1603
|
}, "refresh"));
|
|
@@ -1633,22 +1631,22 @@ const je = class je extends xe {
|
|
|
1633
1631
|
if (!v) this.reset();
|
|
1634
1632
|
};
|
|
1635
1633
|
*/
|
|
1636
|
-
d(this, Le, /* @__PURE__ */
|
|
1634
|
+
d(this, Le, /* @__PURE__ */ h((e) => {
|
|
1637
1635
|
if (!["Escape", "Enter", "Tab", "Home", "End", "ArrowLeft", "ArrowRight", "PageUp", "PageDown", "Backspace", "Delete"].includes(e.code)) {
|
|
1638
|
-
if (t(this,
|
|
1636
|
+
if (t(this, ot) == "number") {
|
|
1639
1637
|
let n = [];
|
|
1640
|
-
if (t(this,
|
|
1638
|
+
if (t(this, U) && Number(t(this, U)) > 0 && n.push("."), t(this, bt) && Number(t(this, bt)) >= 0 && n.push("-"), !(e.keyCode >= 48 && e.keyCode <= 57 || e.keyCode >= 96 && e.keyCode <= 105) && !n.includes(e.key) && e.preventDefault(), t(this, U) && (e.keyCode >= 48 && e.keyCode <= 57 || e.keyCode >= 96 && e.keyCode <= 105) && e.target.selectionStart == e.target.selectionEnd) {
|
|
1641
1639
|
var s = e.target.value, r = s.indexOf(".");
|
|
1642
1640
|
if (r >= 0) {
|
|
1643
1641
|
var s = s.substr(r + 1, s.length);
|
|
1644
|
-
s.length >= Number(t(this,
|
|
1642
|
+
s.length >= Number(t(this, U)) && e.preventDefault();
|
|
1645
1643
|
}
|
|
1646
1644
|
}
|
|
1647
1645
|
}
|
|
1648
|
-
t(this,
|
|
1646
|
+
t(this, gt) && ninegrid.getByteLength(e.target.value) >= Number(t(this, gt)) && e.target.selectionStart == e.target.selectionEnd && e.preventDefault();
|
|
1649
1647
|
}
|
|
1650
1648
|
}, "#onKeyDown"));
|
|
1651
|
-
if (this.applyBaseStyle(), y(this,
|
|
1649
|
+
if (this.applyBaseStyle(), y(this, ot, this.getAttribute("type") || "text"), y(this, gt, this.getAttribute("maxbyte")), y(this, bt, this.getAttribute("min")), y(this, ne, this.getAttribute("max")), y(this, U, this.getAttribute("scale")), !["text", "number"].includes(t(this, ot))) throw `invalid type : ${t(this, ot)}`;
|
|
1652
1650
|
}
|
|
1653
1651
|
connectedCallback() {
|
|
1654
1652
|
for (var e = [], s = 0; s < this.attributes.length; s++)
|
|
@@ -1661,7 +1659,7 @@ const je = class je extends xe {
|
|
|
1661
1659
|
`, super.connectedCallback(), y(this, Mt, this.querySelector("input"));
|
|
1662
1660
|
}
|
|
1663
1661
|
};
|
|
1664
|
-
Mt = new WeakMap(),
|
|
1662
|
+
Mt = new WeakMap(), ot = new WeakMap(), gt = new WeakMap(), bt = new WeakMap(), ne = new WeakMap(), U = new WeakMap(), Le = new WeakMap(), h(je, "CellInputText");
|
|
1665
1663
|
let we = je;
|
|
1666
1664
|
customElements.get("cell-input-text");
|
|
1667
1665
|
customElements.get("cell-input") || customElements.define("cell-input", we);
|