@ninebone/table 0.0.547 → 0.0.548
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 +451 -452
- 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
|
@@ -2,16 +2,16 @@ var Fe = Object.defineProperty;
|
|
|
2
2
|
var Ve = (R) => {
|
|
3
3
|
throw TypeError(R);
|
|
4
4
|
};
|
|
5
|
-
var Xe = (R,
|
|
6
|
-
var
|
|
7
|
-
var E = (R,
|
|
8
|
-
var t = (R,
|
|
9
|
-
var Ue = (R,
|
|
10
|
-
set _(
|
|
11
|
-
y(R,
|
|
5
|
+
var Xe = (R, i, e) => i in R ? Fe(R, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : R[i] = e;
|
|
6
|
+
var c = (R, i) => Fe(R, "name", { value: i, configurable: !0 });
|
|
7
|
+
var E = (R, i, e) => Xe(R, typeof i != "symbol" ? i + "" : i, e), Ye = (R, i, e) => i.has(R) || Ve("Cannot " + e);
|
|
8
|
+
var t = (R, i, e) => (Ye(R, i, "read from private field"), e ? e.call(R) : i.get(R)), h = (R, i, e) => i.has(R) ? Ve("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(R) : i.set(R, e), y = (R, i, e, s) => (Ye(R, i, "write to private field"), s ? s.call(R, e) : i.set(R, e), e);
|
|
9
|
+
var Ue = (R, i, e, s) => ({
|
|
10
|
+
set _(r) {
|
|
11
|
+
y(R, i, r, e);
|
|
12
12
|
},
|
|
13
13
|
get _() {
|
|
14
|
-
return t(R,
|
|
14
|
+
return t(R, i, s);
|
|
15
15
|
}
|
|
16
16
|
});
|
|
17
17
|
import { trace as Ke } from "@ninebone/util";
|
|
@@ -20,91 +20,91 @@ const He = class He extends Ke.constructor {
|
|
|
20
20
|
super(), this.init("nine-table", "green");
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
|
-
|
|
23
|
+
c(He, "Trace");
|
|
24
24
|
let oe = He;
|
|
25
25
|
const N = new oe();
|
|
26
26
|
var z, j, w, X, K, Z, It, G, _t;
|
|
27
27
|
const Me = class Me extends HTMLElement {
|
|
28
28
|
constructor() {
|
|
29
29
|
super();
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
30
|
+
h(this, z);
|
|
31
|
+
h(this, j, !1);
|
|
32
|
+
h(this, w);
|
|
33
|
+
h(this, X);
|
|
34
|
+
h(this, K);
|
|
35
|
+
h(this, Z);
|
|
36
|
+
h(this, It, /* @__PURE__ */ c(() => {
|
|
37
37
|
if (!t(this, z)) return;
|
|
38
38
|
const e = t(this, z).querySelector(".ng-container-body .ng-part-body");
|
|
39
39
|
e && (y(this, Z, new ResizeObserver(() => {
|
|
40
40
|
this.refresh();
|
|
41
41
|
})), t(this, Z).observe(e));
|
|
42
42
|
}, "#observeResize"));
|
|
43
|
-
E(this, "refresh", /* @__PURE__ */
|
|
43
|
+
E(this, "refresh", /* @__PURE__ */ c(() => {
|
|
44
44
|
if (!t(this, z) || !t(this, w) || t(this, j)) return;
|
|
45
45
|
const e = t(this, w).container, s = e.querySelector("table");
|
|
46
46
|
if (!s) return;
|
|
47
|
-
const
|
|
48
|
-
if (o !== 0 &&
|
|
47
|
+
const r = t(this, w).track, n = t(this, w).thumb, a = t(this, z).querySelector(".ng-container-bottom"), o = e.clientWidth, d = s.scrollWidth;
|
|
48
|
+
if (o !== 0 && d > o)
|
|
49
49
|
a && (a.style.display = "flex");
|
|
50
50
|
else {
|
|
51
51
|
a && (a.style.display = "none");
|
|
52
52
|
return;
|
|
53
53
|
}
|
|
54
|
-
const l =
|
|
54
|
+
const l = r.clientWidth;
|
|
55
55
|
if (l <= 0) return;
|
|
56
|
-
const f = Math.max(Math.min(l * (o /
|
|
56
|
+
const f = Math.max(Math.min(l * (o / d), l), 20);
|
|
57
57
|
n.style.width = `${f}px`;
|
|
58
|
-
const u = e.scrollLeft,
|
|
59
|
-
let
|
|
60
|
-
|
|
58
|
+
const u = e.scrollLeft, b = d - o;
|
|
59
|
+
let g = 0;
|
|
60
|
+
b > 0 && (g = parseInt(u / b * (l - f), 10)), g < 0 && (g = 0);
|
|
61
61
|
const x = l - f;
|
|
62
|
-
|
|
62
|
+
g > x && (g = x), n.style.left = `${g}px`, t(this, w).left.disabled = g === 0, t(this, w).right.disabled = g >= x - 1;
|
|
63
63
|
}, "refresh"));
|
|
64
|
-
|
|
64
|
+
h(this, G, /* @__PURE__ */ c((e) => {
|
|
65
65
|
if (!t(this, w)) return !1;
|
|
66
|
-
const s = t(this, w).container,
|
|
67
|
-
if (!
|
|
66
|
+
const s = t(this, w).container, r = s.querySelector("table");
|
|
67
|
+
if (!r) return !1;
|
|
68
68
|
const n = t(this, w).track.getBoundingClientRect(), a = t(this, w).thumb.clientWidth;
|
|
69
69
|
let o = e;
|
|
70
70
|
o < 0 && (o = 0);
|
|
71
|
-
const
|
|
72
|
-
o >
|
|
73
|
-
const l = s.clientWidth, u =
|
|
74
|
-
return
|
|
71
|
+
const d = n.width - a;
|
|
72
|
+
o > d && (o = d), o = parseInt(o, 10), t(this, w).thumb.style.left = `${o}px`, t(this, w).left.disabled = o === 0, t(this, w).right.disabled = o >= d - 1;
|
|
73
|
+
const l = s.clientWidth, u = r.scrollWidth - l;
|
|
74
|
+
return d > 0 && u > 0 && (s.scrollLeft = o / d * u), o > 0 && o < d - 1;
|
|
75
75
|
}, "#thumbMoveTo"));
|
|
76
|
-
|
|
77
|
-
const e = /* @__PURE__ */
|
|
76
|
+
h(this, _t, /* @__PURE__ */ c(() => {
|
|
77
|
+
const e = /* @__PURE__ */ c((r) => {
|
|
78
78
|
clearInterval(t(this, X)), clearInterval(t(this, K));
|
|
79
79
|
const n = parseInt(t(this, w).thumb.style.left || 0, 10);
|
|
80
|
-
t(this, G).call(this, n +
|
|
80
|
+
t(this, G).call(this, n + r), y(this, X, setInterval(() => {
|
|
81
81
|
clearInterval(t(this, X)), y(this, K, setInterval(() => {
|
|
82
82
|
const a = parseInt(t(this, w).thumb.style.left || 0, 10);
|
|
83
|
-
t(this, G).call(this, a +
|
|
83
|
+
t(this, G).call(this, a + r) || clearInterval(t(this, K));
|
|
84
84
|
}, 50));
|
|
85
85
|
}, 500));
|
|
86
|
-
}, "delayScroll"), s = /* @__PURE__ */
|
|
86
|
+
}, "delayScroll"), s = /* @__PURE__ */ c(() => {
|
|
87
87
|
clearInterval(t(this, X)), clearInterval(t(this, K));
|
|
88
88
|
}, "clearTimer");
|
|
89
|
-
["mouseup", "mouseleave", "touchend"].forEach((
|
|
90
|
-
t(this, w).left.addEventListener(
|
|
91
|
-
}), t(this, w).left.addEventListener("mousedown", (
|
|
92
|
-
|
|
93
|
-
}), t(this, w).right.addEventListener("mousedown", (
|
|
94
|
-
|
|
95
|
-
}), t(this, w).left.addEventListener("touchstart", () => e(-20)), t(this, w).right.addEventListener("touchstart", () => e(20)), t(this, w).track.addEventListener("mousedown", (
|
|
96
|
-
if (
|
|
97
|
-
|
|
89
|
+
["mouseup", "mouseleave", "touchend"].forEach((r) => {
|
|
90
|
+
t(this, w).left.addEventListener(r, s), t(this, w).right.addEventListener(r, s), t(this, w).track.addEventListener(r, s);
|
|
91
|
+
}), t(this, w).left.addEventListener("mousedown", (r) => {
|
|
92
|
+
r.button === 0 && e(-20);
|
|
93
|
+
}), t(this, w).right.addEventListener("mousedown", (r) => {
|
|
94
|
+
r.button === 0 && e(20);
|
|
95
|
+
}), t(this, w).left.addEventListener("touchstart", () => e(-20)), t(this, w).right.addEventListener("touchstart", () => e(20)), t(this, w).track.addEventListener("mousedown", (r) => {
|
|
96
|
+
if (r.button !== 0) return;
|
|
97
|
+
r.preventDefault();
|
|
98
98
|
const n = t(this, w).track.getBoundingClientRect(), a = t(this, w).thumb.clientWidth;
|
|
99
|
-
t(this, G).call(this,
|
|
100
|
-
}), t(this, w).thumb.addEventListener("mousedown", (
|
|
101
|
-
if (
|
|
102
|
-
|
|
103
|
-
const n = /* @__PURE__ */
|
|
99
|
+
t(this, G).call(this, r.clientX - n.left - a / 2);
|
|
100
|
+
}), t(this, w).thumb.addEventListener("mousedown", (r) => {
|
|
101
|
+
if (r.button !== 0) return;
|
|
102
|
+
r.stopPropagation(), r.preventDefault(), y(this, j, !0), this.shiftX = r.clientX - t(this, w).thumb.getBoundingClientRect().left;
|
|
103
|
+
const n = /* @__PURE__ */ c((o) => {
|
|
104
104
|
if (!t(this, j)) return;
|
|
105
|
-
const
|
|
106
|
-
t(this, G).call(this, o.clientX -
|
|
107
|
-
}, "onMouseMove"), a = /* @__PURE__ */
|
|
105
|
+
const d = t(this, w).track.getBoundingClientRect();
|
|
106
|
+
t(this, G).call(this, o.clientX - d.left - this.shiftX);
|
|
107
|
+
}, "onMouseMove"), a = /* @__PURE__ */ c(() => {
|
|
108
108
|
y(this, j, !1), s(), document.removeEventListener("mousemove", n), document.removeEventListener("mouseup", a), this.refresh();
|
|
109
109
|
}, "onMouseUp");
|
|
110
110
|
document.addEventListener("mousemove", n), document.addEventListener("mouseup", a);
|
|
@@ -176,7 +176,7 @@ 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__ */ c(() => {
|
|
180
180
|
const s = t(this, z).querySelector(".ng-container-body .ng-part-body");
|
|
181
181
|
if (!s) {
|
|
182
182
|
setTimeout(e, 10);
|
|
@@ -198,68 +198,68 @@ const Me = class Me extends HTMLElement {
|
|
|
198
198
|
t(this, Z) && t(this, Z).disconnect();
|
|
199
199
|
}
|
|
200
200
|
};
|
|
201
|
-
z = new WeakMap(), j = new WeakMap(), w = new WeakMap(), X = new WeakMap(), K = new WeakMap(), Z = new WeakMap(), It = new WeakMap(), G = new WeakMap(), _t = new WeakMap(),
|
|
201
|
+
z = new WeakMap(), j = new WeakMap(), w = new WeakMap(), X = new WeakMap(), K = new WeakMap(), Z = new WeakMap(), It = new WeakMap(), G = new WeakMap(), _t = new WeakMap(), c(Me, "NineTableHScrollBar");
|
|
202
202
|
let ae = Me;
|
|
203
203
|
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", ae);
|
|
204
204
|
var F, at, J, q, xt, vt, Nt;
|
|
205
205
|
const $e = class $e extends HTMLElement {
|
|
206
206
|
constructor() {
|
|
207
207
|
super();
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
E(this, "refresh", /* @__PURE__ */
|
|
208
|
+
h(this, F);
|
|
209
|
+
h(this, at);
|
|
210
|
+
h(this, J, !1);
|
|
211
|
+
h(this, q);
|
|
212
|
+
h(this, xt, 0);
|
|
213
|
+
h(this, vt, 0);
|
|
214
|
+
E(this, "refresh", /* @__PURE__ */ c(() => {
|
|
215
215
|
if (!t(this, F) || !t(this, q)) return;
|
|
216
|
-
const e = t(this, q).container, s = t(this, q).track,
|
|
216
|
+
const e = t(this, q).container, s = t(this, q).track, r = t(this, q).thumb, n = e.clientHeight, o = (t(this, F).data.get() || []).length, d = t(this, at).getRowHeight(), l = o * d;
|
|
217
217
|
if (l <= n) {
|
|
218
|
-
|
|
218
|
+
r.style.display = "none", t(this, q).top.disabled = !0, t(this, q).bottom.disabled = !0;
|
|
219
219
|
return;
|
|
220
220
|
} else
|
|
221
|
-
|
|
221
|
+
r.style.display = "block";
|
|
222
222
|
const f = s.clientHeight;
|
|
223
223
|
if (f <= 0) return;
|
|
224
224
|
const u = Math.max(Math.min(f * (n / l), f), 20);
|
|
225
|
-
|
|
226
|
-
const
|
|
225
|
+
r.style.height = `${u}px`;
|
|
226
|
+
const b = e.scrollTop, g = Math.max(l - n, 1);
|
|
227
227
|
let x = 0;
|
|
228
|
-
|
|
228
|
+
g > 0 && (x = b / g * (f - u));
|
|
229
229
|
const v = f - u;
|
|
230
|
-
x < 0 && (x = 0), x > v && (x = v),
|
|
230
|
+
x < 0 && (x = 0), x > v && (x = v), r.style.top = `${x}px`, t(this, q).top.disabled = b <= 0, t(this, q).bottom.disabled = b >= g - 1;
|
|
231
231
|
}, "refresh"));
|
|
232
|
-
|
|
232
|
+
h(this, Nt, /* @__PURE__ */ c(() => {
|
|
233
233
|
N.log("nine-table-vscrollbar.#init");
|
|
234
|
-
const e = t(this, q).container, s = /* @__PURE__ */
|
|
234
|
+
const e = t(this, q).container, s = /* @__PURE__ */ c(() => {
|
|
235
235
|
const n = (t(this, F).data.get() || []).length, a = t(this, at).getRowHeight();
|
|
236
236
|
return n * a;
|
|
237
237
|
}, "getContentHeight");
|
|
238
238
|
e.addEventListener("scroll", () => {
|
|
239
239
|
t(this, J) || this.refresh();
|
|
240
|
-
}), t(this, q).thumb.addEventListener("mousedown", (
|
|
241
|
-
if (
|
|
242
|
-
|
|
243
|
-
const n = /* @__PURE__ */
|
|
240
|
+
}), t(this, q).thumb.addEventListener("mousedown", (r) => {
|
|
241
|
+
if (r.button !== 0) return;
|
|
242
|
+
r.stopPropagation(), r.preventDefault(), y(this, J, !0), y(this, xt, r.clientY), y(this, vt, e.scrollTop);
|
|
243
|
+
const n = /* @__PURE__ */ c((o) => {
|
|
244
244
|
if (!t(this, J)) return;
|
|
245
|
-
const
|
|
245
|
+
const d = t(this, q).track.getBoundingClientRect(), l = t(this, q).thumb.clientHeight, u = d.height - l, b = o.clientY - t(this, xt), g = e.clientHeight, x = s(), v = Math.max(x - g, 1);
|
|
246
246
|
if (u > 0 && v > 0) {
|
|
247
|
-
const A =
|
|
247
|
+
const A = b / u * v;
|
|
248
248
|
let m = t(this, vt) + A;
|
|
249
|
-
const W = Math.max(0, x -
|
|
249
|
+
const W = Math.max(0, x - g);
|
|
250
250
|
m < 0 && (m = 0), m > W && (m = W), e.scrollTop = m;
|
|
251
251
|
}
|
|
252
252
|
this.refresh();
|
|
253
|
-
}, "onMouseMove"), a = /* @__PURE__ */
|
|
253
|
+
}, "onMouseMove"), a = /* @__PURE__ */ c(() => {
|
|
254
254
|
y(this, J, !1), document.removeEventListener("mousemove", n), document.removeEventListener("mouseup", a), this.refresh();
|
|
255
255
|
}, "onMouseUp");
|
|
256
256
|
document.addEventListener("mousemove", n), document.addEventListener("mouseup", a);
|
|
257
|
-
}), t(this, q).track.addEventListener("mousedown", (
|
|
258
|
-
if (
|
|
259
|
-
const n = t(this, q).track.getBoundingClientRect(), a = t(this, q).thumb.clientHeight, o =
|
|
260
|
-
if (l > 0 &&
|
|
261
|
-
const
|
|
262
|
-
e.scrollTop =
|
|
257
|
+
}), t(this, q).track.addEventListener("mousedown", (r) => {
|
|
258
|
+
if (r.button !== 0 || r.target === t(this, q).thumb) return;
|
|
259
|
+
const n = t(this, q).track.getBoundingClientRect(), a = t(this, q).thumb.clientHeight, o = r.clientY - n.top - a / 2, l = n.height - a, f = e.clientHeight, u = s(), b = Math.max(u - f, 1);
|
|
260
|
+
if (l > 0 && b > 0) {
|
|
261
|
+
const g = Math.max(0, Math.min(1, o / l));
|
|
262
|
+
e.scrollTop = g * b;
|
|
263
263
|
}
|
|
264
264
|
this.refresh();
|
|
265
265
|
}), t(this, q).top.addEventListener("click", () => {
|
|
@@ -334,7 +334,7 @@ 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__ */
|
|
337
|
+
const e = /* @__PURE__ */ c(() => {
|
|
338
338
|
const s = t(this, F).shadowRoot.querySelector(".ng-container-body .ng-part-body");
|
|
339
339
|
if (!s) {
|
|
340
340
|
setTimeout(e, 10);
|
|
@@ -351,183 +351,182 @@ const $e = class $e extends HTMLElement {
|
|
|
351
351
|
e();
|
|
352
352
|
}
|
|
353
353
|
};
|
|
354
|
-
F = new WeakMap(), at = new WeakMap(), J = new WeakMap(), q = new WeakMap(), xt = new WeakMap(), vt = new WeakMap(), Nt = new WeakMap(),
|
|
354
|
+
F = new WeakMap(), at = new WeakMap(), J = new WeakMap(), q = new WeakMap(), xt = new WeakMap(), vt = new WeakMap(), Nt = new WeakMap(), c($e, "NineTableVScrollBar");
|
|
355
355
|
let le = $e;
|
|
356
356
|
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar", le);
|
|
357
357
|
var D, S, Q, P, H, V, tt, wt, Se, Ee, Wt, Ot, Bt, St, Et, zt, Pt, At, Ae, lt, Rt, Dt;
|
|
358
358
|
const Ie = class Ie {
|
|
359
|
-
constructor(
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
E(this, "refresh", /* @__PURE__ */
|
|
359
|
+
constructor(i) {
|
|
360
|
+
h(this, D);
|
|
361
|
+
h(this, S);
|
|
362
|
+
h(this, Q);
|
|
363
|
+
h(this, P, /* @__PURE__ */ new Map());
|
|
364
|
+
h(this, H, null);
|
|
365
|
+
h(this, V, null);
|
|
366
|
+
h(this, tt, 0);
|
|
367
|
+
h(this, wt, 40);
|
|
368
|
+
h(this, Se, !1);
|
|
369
|
+
h(this, Ee, !1);
|
|
370
|
+
h(this, Wt, 3);
|
|
371
|
+
E(this, "refresh", /* @__PURE__ */ c(() => {
|
|
372
372
|
var e;
|
|
373
373
|
N.log("rowManager.refresh");
|
|
374
|
-
const
|
|
375
|
-
|
|
374
|
+
const i = t(this, S).querySelector(".ng-container-body .ng-part-body");
|
|
375
|
+
i && (t(this, St).call(this), t(this, lt).call(this, i.scrollTop), (e = t(this, S).querySelector("nine-table-vscrollbar")) == null || e.refresh());
|
|
376
376
|
}, "refresh"));
|
|
377
|
-
E(this, "initialize", /* @__PURE__ */
|
|
377
|
+
E(this, "initialize", /* @__PURE__ */ c(() => {
|
|
378
378
|
N.log("rowManager.initialize"), y(this, Q, {
|
|
379
379
|
scrollTables: t(this, S).querySelectorAll(".ng-part-body table"),
|
|
380
380
|
firstTr: t(this, S).querySelector(".ng-container-body .ng-part-body tbody.bindable-tbody tr:not(.nodata)")
|
|
381
|
-
}), y(this, H, null), t(this, P).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((
|
|
382
|
-
const
|
|
381
|
+
}), y(this, H, null), t(this, P).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((r) => {
|
|
382
|
+
const n = t(this, S).querySelector(r);
|
|
383
|
+
if (!n) return;
|
|
384
|
+
const a = n.querySelector(".ng-part-body table");
|
|
385
|
+
if (!a) return;
|
|
386
|
+
const o = a.querySelector("tbody.bindable-tbody");
|
|
383
387
|
if (!o) return;
|
|
384
|
-
const
|
|
385
|
-
|
|
386
|
-
const l = c.querySelector("tbody.bindable-tbody");
|
|
387
|
-
if (!l) return;
|
|
388
|
-
const u = Array.from(l.querySelectorAll("tr")).map((g) => g.cloneNode(!0));
|
|
389
|
-
t(this, P).set(a, u);
|
|
388
|
+
const l = Array.from(o.querySelectorAll("tr")).map((f) => f.cloneNode(!0));
|
|
389
|
+
t(this, P).set(r, l);
|
|
390
390
|
});
|
|
391
|
-
const
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
e && (e.scrollTop = a), s && (s.scrollTop = a), i && (i.scrollLeft = o), n && (n.scrollLeft = o), t(this, lt).call(this, a), (c = t(this, S).querySelector("nine-table-vscrollbar")) == null || c.refresh();
|
|
391
|
+
const i = t(this, S).querySelector(".ng-container-body .ng-part-body"), e = t(this, S).querySelector(".ng-container-left .ng-part-body"), s = t(this, S).querySelector(".ng-container-right .ng-part-body");
|
|
392
|
+
t(this, S).querySelector(".ng-container-body .ng-part-header"), t(this, S).querySelector(".ng-container-body .ng-part-footer"), i && (t(this, Bt).call(this, i), t(this, At).call(this), t(this, St).call(this), t(this, lt).call(this, i.scrollTop), i.addEventListener("scroll", () => {
|
|
393
|
+
const r = i.scrollTop;
|
|
394
|
+
i.scrollLeft, e && (e.scrollTop = r), s && (s.scrollTop = r), t(this, lt).call(this, r);
|
|
396
395
|
}));
|
|
397
396
|
}, "initialize"));
|
|
398
|
-
|
|
397
|
+
h(this, Ot, /* @__PURE__ */ c((i, e) => {
|
|
399
398
|
N.log("rowManager.#renderRows");
|
|
400
399
|
const s = t(this, P).get(e);
|
|
401
400
|
if (!s || s.length === 0) return;
|
|
402
|
-
const
|
|
403
|
-
if (!
|
|
404
|
-
|
|
405
|
-
const n =
|
|
401
|
+
const r = i.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
402
|
+
if (!r) return;
|
|
403
|
+
r.querySelectorAll("tr:not(.nodata)").forEach((o) => o.remove());
|
|
404
|
+
const n = r.querySelector("tr.nodata"), a = document.createDocumentFragment();
|
|
406
405
|
for (let o = 0; o < t(this, wt); o++)
|
|
407
|
-
s.forEach((
|
|
408
|
-
a.appendChild(
|
|
406
|
+
s.forEach((d) => {
|
|
407
|
+
a.appendChild(d.cloneNode(!0));
|
|
409
408
|
});
|
|
410
|
-
n ? n.before(a) :
|
|
409
|
+
n ? n.before(a) : r.appendChild(a), e === ".ng-container-body" && (t(this, Q).firstTr = r.querySelector("tr:not(.nodata)"));
|
|
411
410
|
}, "#renderRows"));
|
|
412
|
-
|
|
411
|
+
h(this, Bt, /* @__PURE__ */ c((i) => {
|
|
413
412
|
if (N.log("rowManager.#measureAndCacheHeight"), t(this, H) !== null && t(this, H) > 0)
|
|
414
413
|
return t(this, H);
|
|
415
414
|
N.log("#measureAndCacheHeight");
|
|
416
415
|
const e = t(this, P).get(".ng-container-body");
|
|
417
416
|
if (!e || e.length === 0) return 24;
|
|
418
|
-
const s =
|
|
417
|
+
const s = i.querySelector("tbody.bindable-tbody");
|
|
419
418
|
if (!s) return 24;
|
|
420
|
-
s.querySelectorAll("tr:not(.nodata)").forEach((
|
|
421
|
-
const
|
|
422
|
-
e.forEach((
|
|
423
|
-
n.appendChild(
|
|
424
|
-
}),
|
|
425
|
-
const a = t(this, S), o = a.style.display,
|
|
419
|
+
s.querySelectorAll("tr:not(.nodata)").forEach((b) => b.remove());
|
|
420
|
+
const r = s.querySelector("tr.nodata"), n = document.createDocumentFragment();
|
|
421
|
+
e.forEach((b) => {
|
|
422
|
+
n.appendChild(b.cloneNode(!0));
|
|
423
|
+
}), r ? r.before(n) : s.appendChild(n);
|
|
424
|
+
const a = t(this, S), o = a.style.display, d = a.style.visibility, l = a.style.position;
|
|
426
425
|
(o === "none" || window.getComputedStyle(a).display === "none") && (a.style.display = "block", a.style.visibility = "hidden", a.style.position = "absolute");
|
|
427
426
|
let f = 0;
|
|
428
427
|
const u = s.querySelectorAll("tr:not(.nodata)");
|
|
429
|
-
return u.forEach((
|
|
430
|
-
f +=
|
|
431
|
-
}), u.forEach((
|
|
428
|
+
return u.forEach((b) => {
|
|
429
|
+
f += b.offsetHeight || b.getBoundingClientRect().height;
|
|
430
|
+
}), u.forEach((b) => b.remove()), a.style.display = o, a.style.visibility = d, a.style.position = l, y(this, H, f > 0 ? f : 24), t(this, Et).call(this), t(this, H);
|
|
432
431
|
}, "#measureAndCacheHeight"));
|
|
433
|
-
|
|
432
|
+
h(this, St, /* @__PURE__ */ c(() => {
|
|
434
433
|
N.log("rowManager.#updateVirtualScrollHeight");
|
|
435
|
-
const e = (t(this, D).data.get() || []).length, s = t(this, H),
|
|
434
|
+
const e = (t(this, D).data.get() || []).length, s = t(this, H), r = e * s;
|
|
436
435
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((n) => {
|
|
437
436
|
const a = t(this, S).querySelector(n);
|
|
438
437
|
if (!a) return;
|
|
439
438
|
const o = a.querySelector(".ng-part-body .ng-virtual-spacer");
|
|
440
|
-
o && (o.style.height = `${
|
|
439
|
+
o && (o.style.height = `${r}px`);
|
|
441
440
|
});
|
|
442
441
|
}, "#updateVirtualScrollHeight"));
|
|
443
|
-
|
|
442
|
+
h(this, Et, /* @__PURE__ */ c(() => {
|
|
444
443
|
if (t(this, tt) > 0 && t(this, H) > 0) {
|
|
445
|
-
const
|
|
446
|
-
y(this, wt,
|
|
444
|
+
const i = Math.ceil(t(this, tt) / t(this, H));
|
|
445
|
+
y(this, wt, i + t(this, Wt));
|
|
447
446
|
}
|
|
448
447
|
}, "#updateRowCount"));
|
|
449
|
-
|
|
450
|
-
var o,
|
|
451
|
-
const
|
|
448
|
+
h(this, zt, /* @__PURE__ */ c(() => {
|
|
449
|
+
var o, d, l, f, u, b;
|
|
450
|
+
const i = t(this, S).querySelector(".ng-container-left .ng-part-body table"), e = t(this, S).querySelector(".ng-container-body .ng-part-body table"), s = t(this, S).querySelector(".ng-container-right .ng-part-body table");
|
|
452
451
|
if (e) {
|
|
453
|
-
const
|
|
452
|
+
const g = i ? Array.from(i.querySelectorAll("tbody tr")) : [], x = Array.from(e.querySelectorAll("tbody tr")), v = s ? Array.from(s.querySelectorAll("tbody tr")) : [], A = Math.max(g.length, x.length, v.length);
|
|
454
453
|
for (let m = 0; m < A; m++) {
|
|
455
454
|
const W = [
|
|
456
|
-
((o =
|
|
457
|
-
((
|
|
455
|
+
((o = g[m]) == null ? void 0 : o.getBoundingClientRect().height) || 0,
|
|
456
|
+
((d = x[m]) == null ? void 0 : d.getBoundingClientRect().height) || 0,
|
|
458
457
|
((l = v[m]) == null ? void 0 : l.getBoundingClientRect().height) || 0
|
|
459
458
|
], C = Math.max(...W);
|
|
460
|
-
C > 0 && (
|
|
459
|
+
C > 0 && (g[m] && (g[m].style.height = `${C}px`), x[m] && (x[m].style.height = `${C}px`), v[m] && (v[m].style.height = `${C}px`));
|
|
461
460
|
}
|
|
462
461
|
}
|
|
463
|
-
const
|
|
462
|
+
const r = t(this, S).querySelector(".ng-container-left .ng-part-footer table"), n = t(this, S).querySelector(".ng-container-body .ng-part-footer table"), a = t(this, S).querySelector(".ng-container-right .ng-part-footer table");
|
|
464
463
|
if (n) {
|
|
465
|
-
const
|
|
464
|
+
const g = r ? Array.from(r.querySelectorAll("tfoot tr")) : [], x = Array.from(n.querySelectorAll("tfoot tr")), v = a ? Array.from(a.querySelectorAll("tfoot tr")) : [], A = Math.max(g.length, x.length, v.length);
|
|
466
465
|
for (let m = 0; m < A; m++) {
|
|
467
466
|
const W = [
|
|
468
|
-
((f =
|
|
467
|
+
((f = g[m]) == null ? void 0 : f.getBoundingClientRect().height) || 0,
|
|
469
468
|
((u = x[m]) == null ? void 0 : u.getBoundingClientRect().height) || 0,
|
|
470
|
-
((
|
|
469
|
+
((b = v[m]) == null ? void 0 : b.getBoundingClientRect().height) || 0
|
|
471
470
|
], C = Math.max(...W);
|
|
472
|
-
C > 0 && (
|
|
471
|
+
C > 0 && (g[m] && (g[m].style.height = `${C}px`), x[m] && (x[m].style.height = `${C}px`), v[m] && (v[m].style.height = `${C}px`));
|
|
473
472
|
}
|
|
474
473
|
}
|
|
475
474
|
}, "#syncRowHeights"));
|
|
476
|
-
|
|
477
|
-
!t(this, S) || !(t(this, S) instanceof HTMLElement) || (y(this, V, new ResizeObserver((
|
|
478
|
-
for (const e of
|
|
475
|
+
h(this, Pt, /* @__PURE__ */ c(() => {
|
|
476
|
+
!t(this, S) || !(t(this, S) instanceof HTMLElement) || (y(this, V, new ResizeObserver((i) => {
|
|
477
|
+
for (const e of i) {
|
|
479
478
|
const s = e.target;
|
|
480
479
|
if (!s.classList.contains("active")) continue;
|
|
481
|
-
const
|
|
482
|
-
if (
|
|
480
|
+
const r = e.contentRect.height;
|
|
481
|
+
if (r > 0) {
|
|
483
482
|
let n = 0;
|
|
484
483
|
const a = s.querySelector(".ng-part-header"), o = s.querySelector(".ng-part-footer");
|
|
485
484
|
a && (n += a.offsetHeight), o && (n += o.offsetHeight);
|
|
486
|
-
const
|
|
487
|
-
t(this, tt) !==
|
|
485
|
+
const d = Math.max(r - n, 100);
|
|
486
|
+
t(this, tt) !== d && (y(this, tt, d), t(this, Et).call(this), t(this, H) !== null && (t(this, At).call(this), this.refresh()));
|
|
488
487
|
}
|
|
489
488
|
}
|
|
490
489
|
})), t(this, V).observe(t(this, S)));
|
|
491
490
|
}, "#initResizeObserver"));
|
|
492
|
-
|
|
493
|
-
N.log("rowManager.#renderAllContainers"), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((
|
|
494
|
-
const e = t(this, S).querySelector(
|
|
495
|
-
e && e.querySelector(".ng-part-body tbody.bindable-tbody") && t(this, Ot).call(this, e,
|
|
491
|
+
h(this, At, /* @__PURE__ */ c(() => {
|
|
492
|
+
N.log("rowManager.#renderAllContainers"), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((i) => {
|
|
493
|
+
const e = t(this, S).querySelector(i);
|
|
494
|
+
e && e.querySelector(".ng-part-body tbody.bindable-tbody") && t(this, Ot).call(this, e, i);
|
|
496
495
|
}), t(this, Dt).call(this), t(this, zt).call(this);
|
|
497
496
|
}, "#renderAllContainers"));
|
|
498
|
-
|
|
497
|
+
h(this, Ae, /* @__PURE__ */ c((i) => {
|
|
499
498
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((e) => {
|
|
500
499
|
var l;
|
|
501
500
|
const s = t(this, S).querySelector(e);
|
|
502
501
|
if (!s) return;
|
|
503
|
-
const
|
|
504
|
-
if (!
|
|
505
|
-
const n = Array.from(
|
|
502
|
+
const r = s.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
503
|
+
if (!r) return;
|
|
504
|
+
const n = Array.from(r.querySelectorAll("tr:not(.nodata)")), a = ((l = t(this, P).get(e)) == null ? void 0 : l.length) || 1, d = (t(this, D).data.get() || []).length;
|
|
506
505
|
n.forEach((f, u) => {
|
|
507
|
-
const
|
|
508
|
-
if (
|
|
506
|
+
const b = i + Math.floor(u / a);
|
|
507
|
+
if (b >= d) {
|
|
509
508
|
f.style.display = "none";
|
|
510
509
|
return;
|
|
511
510
|
}
|
|
512
|
-
const
|
|
513
|
-
f.style.display = "", t(this, Rt).call(this, f,
|
|
511
|
+
const g = t(this, D).data.get(b);
|
|
512
|
+
f.style.display = "", t(this, Rt).call(this, f, g, b);
|
|
514
513
|
});
|
|
515
514
|
});
|
|
516
515
|
}, "#adjustBufferRows"));
|
|
517
|
-
|
|
516
|
+
h(this, lt, /* @__PURE__ */ c((i) => {
|
|
518
517
|
var l, f;
|
|
519
518
|
const e = t(this, H);
|
|
520
519
|
if (!e || e <= 0) return;
|
|
521
|
-
const s = t(this, D).data.length,
|
|
520
|
+
const s = t(this, D).data.length, r = Math.max(0, Math.floor(i / e)), n = r * e, a = ((l = t(this, P).get(".ng-container-body")) == null ? void 0 : l.length) || 1, o = t(this, Q).firstTr, d = o && o.dataset.row !== void 0 ? parseInt(o.dataset.row, 10) : -1;
|
|
522
521
|
(f = t(this, Q)) == null || f.scrollTables.forEach((u) => {
|
|
523
522
|
u.style.transform = `translate3d(0, ${n}px, 0)`;
|
|
524
|
-
}),
|
|
525
|
-
const
|
|
526
|
-
if (!g) return;
|
|
527
|
-
const b = g.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
523
|
+
}), d !== r && [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((u) => {
|
|
524
|
+
const b = t(this, S).querySelector(u);
|
|
528
525
|
if (!b) return;
|
|
529
|
-
|
|
530
|
-
|
|
526
|
+
const g = b.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
527
|
+
if (!g) return;
|
|
528
|
+
Array.from(g.querySelectorAll("tr:not(.nodata)")).forEach((v, A) => {
|
|
529
|
+
const m = r + Math.floor(A / a);
|
|
531
530
|
if (m >= s) {
|
|
532
531
|
v.style.display = "none";
|
|
533
532
|
return;
|
|
@@ -551,178 +550,178 @@ const Ie = class Ie {
|
|
|
551
550
|
cell.dataset.row = dataIndex;
|
|
552
551
|
});
|
|
553
552
|
}; */
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
const a = Array.from(
|
|
553
|
+
h(this, Rt, /* @__PURE__ */ c((i, e, s) => {
|
|
554
|
+
i.dataset.row = s, i.data = e, Array.from(i.cells).forEach((r, n) => {
|
|
555
|
+
r.dataset.row = s;
|
|
556
|
+
const a = Array.from(r.children).find((o) => o.tagName.toLowerCase().startsWith("cell-") || typeof o.refresh == "function");
|
|
558
557
|
a && typeof a.refresh == "function" && a.refresh();
|
|
559
558
|
});
|
|
560
559
|
}, "#bindRowData"));
|
|
561
|
-
|
|
562
|
-
var
|
|
560
|
+
h(this, Dt, /* @__PURE__ */ c(() => {
|
|
561
|
+
var d, l, f;
|
|
563
562
|
N.log("rowManager.#syncHeaderHeights");
|
|
564
|
-
const
|
|
563
|
+
const i = t(this, S).querySelector(".ng-container-left .ng-part-header table"), e = t(this, S).querySelector(".ng-container-body .ng-part-header table"), s = t(this, S).querySelector(".ng-container-right .ng-part-header table");
|
|
565
564
|
if (!e) return;
|
|
566
|
-
const
|
|
565
|
+
const r = i ? Array.from(i.querySelectorAll("tr")) : [], n = Array.from(e.querySelectorAll("tr")), a = s ? Array.from(s.querySelectorAll("tr")) : [], o = Math.max(r.length, n.length, a.length);
|
|
567
566
|
for (let u = 0; u < o; u++) {
|
|
568
|
-
const
|
|
569
|
-
((
|
|
567
|
+
const b = [
|
|
568
|
+
((d = r[u]) == null ? void 0 : d.getBoundingClientRect().height) || 0,
|
|
570
569
|
((l = n[u]) == null ? void 0 : l.getBoundingClientRect().height) || 0,
|
|
571
570
|
((f = a[u]) == null ? void 0 : f.getBoundingClientRect().height) || 0
|
|
572
|
-
],
|
|
573
|
-
|
|
571
|
+
], g = Math.max(...b);
|
|
572
|
+
g > 0 && (r[u] && (r[u].style.height = `${g}px`), n[u] && (n[u].style.height = `${g}px`), a[u] && (a[u].style.height = `${g}px`));
|
|
574
573
|
}
|
|
575
574
|
}, "#syncHeaderHeights"));
|
|
576
|
-
E(this, "destroy", /* @__PURE__ */
|
|
575
|
+
E(this, "destroy", /* @__PURE__ */ c(() => {
|
|
577
576
|
t(this, V) && (t(this, V).disconnect(), y(this, V, null));
|
|
578
577
|
}, "destroy"));
|
|
579
|
-
y(this, D,
|
|
578
|
+
y(this, D, i.getRootNode().host), y(this, S, i), t(this, Pt).call(this);
|
|
580
579
|
}
|
|
581
580
|
getRowHeight() {
|
|
582
581
|
return t(this, H);
|
|
583
582
|
}
|
|
584
|
-
templateLength(
|
|
583
|
+
templateLength(i = ".ng-container-body") {
|
|
585
584
|
var e;
|
|
586
|
-
return ((e = t(this, P).get(
|
|
585
|
+
return ((e = t(this, P).get(i)) == null ? void 0 : e.length) || 1;
|
|
587
586
|
}
|
|
588
587
|
};
|
|
589
|
-
D = new WeakMap(), S = new WeakMap(), Q = new WeakMap(), P = new WeakMap(), H = new WeakMap(), V = new WeakMap(), tt = new WeakMap(), wt = new WeakMap(), Se = new WeakMap(), Ee = new WeakMap(), Wt = new WeakMap(), Ot = new WeakMap(), Bt = new WeakMap(), St = new WeakMap(), Et = new WeakMap(), zt = new WeakMap(), Pt = new WeakMap(), At = new WeakMap(), Ae = new WeakMap(), lt = new WeakMap(), Rt = new WeakMap(), Dt = new WeakMap(),
|
|
588
|
+
D = new WeakMap(), S = new WeakMap(), Q = new WeakMap(), P = new WeakMap(), H = new WeakMap(), V = new WeakMap(), tt = new WeakMap(), wt = new WeakMap(), Se = new WeakMap(), Ee = new WeakMap(), Wt = new WeakMap(), Ot = new WeakMap(), Bt = new WeakMap(), St = new WeakMap(), Et = new WeakMap(), zt = new WeakMap(), Pt = new WeakMap(), At = new WeakMap(), Ae = new WeakMap(), lt = new WeakMap(), Rt = new WeakMap(), Dt = new WeakMap(), c(Ie, "RowManager");
|
|
590
589
|
let ce = Ie;
|
|
591
590
|
const jt = class jt {
|
|
592
591
|
/**
|
|
593
592
|
* 🎯 레이아웃 내의 여러 rawTables 배열을 일괄로 받아 단일 마스터 템플릿으로 사전 컴파일합니다.
|
|
594
593
|
*/
|
|
595
|
-
static compileAll(
|
|
596
|
-
return Array.isArray(
|
|
594
|
+
static compileAll(i) {
|
|
595
|
+
return Array.isArray(i) ? i.map((e) => jt.compile(e)) : [];
|
|
597
596
|
}
|
|
598
597
|
/**
|
|
599
598
|
* 🎯 단일 원본 테이블을 받아 기본 구조 보정 및 2차원 격자 인덱스 사전 부여 완료된 마스터 테이블 반환
|
|
600
599
|
*/
|
|
601
|
-
static compile(
|
|
602
|
-
if (!
|
|
603
|
-
const e = /* @__PURE__ */
|
|
600
|
+
static compile(i) {
|
|
601
|
+
if (!i) return null;
|
|
602
|
+
const e = /* @__PURE__ */ c((o) => {
|
|
604
603
|
o.querySelectorAll("tbody td, tbody th, tfoot td, tfoot th").forEach((l) => {
|
|
605
604
|
const f = l.getAttribute("cell-type") || "renderer";
|
|
606
605
|
if (l.children.length > 0 && l.firstElementChild.tagName.includes("-")) return;
|
|
607
606
|
let u = `cell-${f}`;
|
|
608
|
-
const
|
|
607
|
+
const b = l.getAttribute("data-bind"), g = l.getAttribute("data-expr"), x = l.getAttribute("maxbyte"), v = l.getAttribute("type");
|
|
609
608
|
let A = [];
|
|
610
|
-
|
|
609
|
+
b && A.push(`data-bind="${b}"`), g && A.push(`data-expr="${g}"`), x && A.push(`maxbyte="${x}"`), v && A.push(`type="${v}"`), l.innerHTML = `<${u} ${A.join(" ")}></${u}>`;
|
|
611
610
|
});
|
|
612
|
-
}, "processCellTypes"), s = /* @__PURE__ */
|
|
611
|
+
}, "processCellTypes"), s = /* @__PURE__ */ c((o) => {
|
|
613
612
|
if (!o.querySelector("colgroup")) {
|
|
614
|
-
const
|
|
615
|
-
for (let
|
|
616
|
-
const
|
|
617
|
-
|
|
613
|
+
const d = o.querySelector("tbody tr") || o.querySelector("tr"), l = d ? d.querySelectorAll("th, td").length : 1, f = document.createElement("colgroup"), u = Math.max(Math.floor(o.clientWidth / l), 100);
|
|
614
|
+
for (let b = 0; b < l; b++) {
|
|
615
|
+
const g = document.createElement("col");
|
|
616
|
+
g.setAttribute("width", u), f.appendChild(g);
|
|
618
617
|
}
|
|
619
618
|
o.prepend(f);
|
|
620
619
|
}
|
|
621
620
|
if (!o.querySelector("thead")) {
|
|
622
|
-
const
|
|
623
|
-
l ? l.after(
|
|
621
|
+
const d = document.createElement("thead"), l = o.querySelector("colgroup");
|
|
622
|
+
l ? l.after(d) : o.prepend(d);
|
|
624
623
|
}
|
|
625
624
|
o.classList.add("nine-table-element"), o.style.display = "table";
|
|
626
|
-
}, "ensureTableStructure"),
|
|
627
|
-
const l = Array.from(o.querySelectorAll(
|
|
625
|
+
}, "ensureTableStructure"), r = /* @__PURE__ */ c((o, d) => {
|
|
626
|
+
const l = Array.from(o.querySelectorAll(d + " tr")), f = Array.from(o.querySelectorAll(d + " th," + d + " td")), u = l.length;
|
|
628
627
|
if (u === 0 || f.length === 0) return;
|
|
629
|
-
let
|
|
628
|
+
let b = 0;
|
|
630
629
|
f.forEach((x) => {
|
|
631
|
-
|
|
630
|
+
b += x.colSpan || 1;
|
|
632
631
|
});
|
|
633
|
-
const
|
|
632
|
+
const g = Array.from(Array(u), () => Array(b).fill(null));
|
|
634
633
|
l.forEach((x) => {
|
|
635
634
|
const v = x.sectionRowIndex;
|
|
636
635
|
let A = 0;
|
|
637
636
|
Array.from(x.querySelectorAll("th,td")).forEach((m) => {
|
|
638
|
-
for (let B = 0; B <
|
|
639
|
-
if (
|
|
637
|
+
for (let B = 0; B < g[v].length; B++)
|
|
638
|
+
if (g[v][B] === null) {
|
|
640
639
|
A = B;
|
|
641
640
|
break;
|
|
642
641
|
}
|
|
643
642
|
const W = m.rowSpan || 1, C = m.colSpan || 1;
|
|
644
643
|
for (let B = 0; B < W; B++)
|
|
645
644
|
for (let yt = 0; yt < C; yt++)
|
|
646
|
-
v + B < u && A + yt <
|
|
645
|
+
v + B < u && A + yt < b && (g[v + B][A + yt] = B === 0 && yt === 0 ? "1" : "0");
|
|
647
646
|
});
|
|
648
647
|
}), l.forEach((x) => {
|
|
649
648
|
const v = x.sectionRowIndex;
|
|
650
649
|
Array.from(x.querySelectorAll("th,td")).forEach((A) => {
|
|
651
|
-
for (let m = 0; m <
|
|
652
|
-
if (
|
|
653
|
-
A.dataset.col = m,
|
|
650
|
+
for (let m = 0; m < g[v].length; m++)
|
|
651
|
+
if (g[v][m] === "1") {
|
|
652
|
+
A.dataset.col = m, g[v][m] = "0";
|
|
654
653
|
break;
|
|
655
654
|
}
|
|
656
655
|
});
|
|
657
656
|
});
|
|
658
|
-
}, "resetColIndex"), n =
|
|
659
|
-
return s(n), e(n),
|
|
657
|
+
}, "resetColIndex"), n = i.cloneNode(!0);
|
|
658
|
+
return s(n), e(n), r(n, "thead"), r(n, "tbody"), r(n, "tfoot"), Array.from(n.querySelectorAll("colgroup col")).forEach((o, d) => {
|
|
660
659
|
const l = o.getAttribute("fixed");
|
|
661
|
-
l && n.querySelectorAll(`thead [data-col="${
|
|
660
|
+
l && n.querySelectorAll(`thead [data-col="${d}"], tbody [data-col="${d}"], tfoot [data-col="${d}"]`).forEach((f) => {
|
|
662
661
|
f.setAttribute("fixed", l);
|
|
663
662
|
});
|
|
664
663
|
}), n;
|
|
665
664
|
}
|
|
666
665
|
// 🎯 [추가] td/th에 선언된 cell-type 속성을 읽어 커스텀 태그로 자동 감싸기
|
|
667
666
|
};
|
|
668
|
-
|
|
667
|
+
c(jt, "TableCompiler");
|
|
669
668
|
let he = jt;
|
|
670
669
|
var Ft, et, st, Vt, Yt, ct, Ut, Xt;
|
|
671
670
|
const pt = class pt extends HTMLElement {
|
|
672
671
|
constructor() {
|
|
673
672
|
super();
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
E(this, "invalidate", /* @__PURE__ */
|
|
673
|
+
h(this, Ft);
|
|
674
|
+
h(this, et, null);
|
|
675
|
+
h(this, st);
|
|
676
|
+
E(this, "invalidate", /* @__PURE__ */ c(() => {
|
|
678
677
|
t(this, st).refresh();
|
|
679
678
|
}, "invalidate"));
|
|
680
|
-
|
|
679
|
+
h(this, Vt, /* @__PURE__ */ c(() => {
|
|
681
680
|
[
|
|
682
681
|
{ selector: ".ng-container-body", type: null },
|
|
683
682
|
{ selector: ".ng-container-left", type: "left" },
|
|
684
683
|
{ selector: ".ng-container-right", type: "right" }
|
|
685
|
-
].forEach(({ selector: s, type:
|
|
684
|
+
].forEach(({ selector: s, type: r }) => {
|
|
686
685
|
const n = this.querySelector(s);
|
|
687
686
|
if (!n) return;
|
|
688
687
|
n.innerHTML = "";
|
|
689
688
|
const a = document.createElement("div");
|
|
690
|
-
a.className = "ng-part-header", a.appendChild(t(this, ct).call(this, t(this, et),
|
|
689
|
+
a.className = "ng-part-header", a.appendChild(t(this, ct).call(this, t(this, et), r, "header"));
|
|
691
690
|
const o = document.createElement("div");
|
|
692
691
|
o.className = "ng-part-body";
|
|
693
|
-
const
|
|
694
|
-
|
|
692
|
+
const d = document.createElement("div");
|
|
693
|
+
d.className = "ng-scroll-content", d.style.position = "relative", d.style.width = "100%", d.appendChild(t(this, ct).call(this, t(this, et), r, "body"));
|
|
695
694
|
const l = document.createElement("div");
|
|
696
|
-
l.className = "ng-virtual-spacer", l.style.width = "100%", l.style.pointerEvents = "none",
|
|
695
|
+
l.className = "ng-virtual-spacer", l.style.width = "100%", l.style.pointerEvents = "none", d.appendChild(l), o.appendChild(d);
|
|
697
696
|
const f = document.createElement("div");
|
|
698
|
-
f.className = "ng-part-footer", f.appendChild(t(this, ct).call(this, t(this, et),
|
|
697
|
+
f.className = "ng-part-footer", f.appendChild(t(this, ct).call(this, t(this, et), r, "footer")), n.appendChild(a), n.appendChild(o), n.appendChild(f);
|
|
699
698
|
});
|
|
700
699
|
}, "#renderSplitContainers"));
|
|
701
|
-
|
|
700
|
+
h(this, Yt, /* @__PURE__ */ c(() => {
|
|
702
701
|
["left", "right", "body"].forEach((e) => {
|
|
703
|
-
const s = this.querySelector(`.ng-container-${e}`),
|
|
704
|
-
if (!s || !
|
|
702
|
+
const s = this.querySelector(`.ng-container-${e}`), r = s == null ? void 0 : s.querySelectorAll("table");
|
|
703
|
+
if (!s || !r || r.length === 0) return;
|
|
705
704
|
let n = 0;
|
|
706
|
-
|
|
705
|
+
r[0].querySelectorAll("col").forEach((a) => {
|
|
707
706
|
const o = parseInt(a.getAttribute("width"), 10);
|
|
708
707
|
isNaN(n) || (n += o);
|
|
709
708
|
}), e === "body" ? s.style.flex = "1" : (s.style.flex = `0 0 ${n}px`, s.style.width = `${n}px`);
|
|
710
709
|
});
|
|
711
710
|
}, "#updateContainerWidths"));
|
|
712
|
-
E(this, "generate", /* @__PURE__ */
|
|
711
|
+
E(this, "generate", /* @__PURE__ */ c((e) => {
|
|
713
712
|
e && (y(this, et, he.compile(e)), t(this, Vt).call(this), t(this, Yt).call(this), t(this, st).initialize(), setTimeout(() => {
|
|
714
713
|
var s;
|
|
715
714
|
(s = this.querySelector("nine-table-hscrollbar")) == null || s.refresh();
|
|
716
715
|
}, 0));
|
|
717
716
|
}, "generate"));
|
|
718
|
-
|
|
719
|
-
const n = e.cloneNode(!0), a = n.querySelector("thead"), o = n.querySelector("tbody"),
|
|
720
|
-
if (
|
|
721
|
-
if (o && o.remove(),
|
|
717
|
+
h(this, ct, /* @__PURE__ */ c((e, s, r) => {
|
|
718
|
+
const n = e.cloneNode(!0), a = n.querySelector("thead"), o = n.querySelector("tbody"), d = n.querySelector("tfoot");
|
|
719
|
+
if (r === "header") {
|
|
720
|
+
if (o && o.remove(), d && d.remove(), e.querySelector("tbody")) {
|
|
722
721
|
const f = document.createElement("tbody");
|
|
723
722
|
f.className = "fixed-tbody", n.appendChild(f);
|
|
724
723
|
}
|
|
725
|
-
} else
|
|
724
|
+
} else r === "body" ? (a && a.remove(), d && d.remove(), o && (o.className = "bindable-tbody")) : r === "footer" && (a && a.remove(), o && o.remove());
|
|
726
725
|
return s === "left" ? n.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((l) => {
|
|
727
726
|
l.getAttribute("fixed") !== "left" && l.remove();
|
|
728
727
|
}) : s === "right" ? n.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((l) => {
|
|
@@ -731,19 +730,19 @@ const pt = class pt extends HTMLElement {
|
|
|
731
730
|
l.remove();
|
|
732
731
|
}), n;
|
|
733
732
|
}, "#createSplitTable"));
|
|
734
|
-
E(this, "getRowHeight", /* @__PURE__ */
|
|
735
|
-
E(this, "scrollToX", /* @__PURE__ */
|
|
733
|
+
E(this, "getRowHeight", /* @__PURE__ */ c(() => t(this, st).getRowHeight(), "getRowHeight"));
|
|
734
|
+
E(this, "scrollToX", /* @__PURE__ */ c((e) => {
|
|
736
735
|
const s = this.querySelector(".ng-container-body .ng-part-body");
|
|
737
736
|
s && (s.scrollLeft = e);
|
|
738
737
|
}, "scrollToX"));
|
|
739
|
-
E(this, "scrollToY", /* @__PURE__ */
|
|
738
|
+
E(this, "scrollToY", /* @__PURE__ */ c((e) => {
|
|
740
739
|
const s = this.querySelector(".ng-container-body .ng-part-body");
|
|
741
740
|
s && (s.scrollTop = e);
|
|
742
741
|
}, "scrollToY"));
|
|
743
|
-
|
|
742
|
+
h(this, Ut, /* @__PURE__ */ c(() => {
|
|
744
743
|
t(this, Xt).call(this);
|
|
745
744
|
}, "#init"));
|
|
746
|
-
|
|
745
|
+
h(this, Xt, /* @__PURE__ */ c(() => {
|
|
747
746
|
const e = pt.SCROLLBAR_SIZE;
|
|
748
747
|
this.innerHTML = `
|
|
749
748
|
<style>
|
|
@@ -901,82 +900,82 @@ const pt = class pt extends HTMLElement {
|
|
|
901
900
|
this.innerHTML = "", N.log("NineTableSheet destroyed.");
|
|
902
901
|
}
|
|
903
902
|
};
|
|
904
|
-
Ft = new WeakMap(), et = new WeakMap(), st = new WeakMap(), Vt = new WeakMap(), Yt = new WeakMap(), ct = new WeakMap(), Ut = new WeakMap(), Xt = new WeakMap(),
|
|
903
|
+
Ft = new WeakMap(), et = new WeakMap(), st = new WeakMap(), Vt = new WeakMap(), Yt = new WeakMap(), ct = new WeakMap(), Ut = new WeakMap(), Xt = new WeakMap(), c(pt, "NineTableSheet"), E(pt, "SCROLLBAR_SIZE", 16);
|
|
905
904
|
let $t = pt;
|
|
906
905
|
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", $t);
|
|
907
906
|
var Kt, qt;
|
|
908
907
|
const _e = class _e extends HTMLElement {
|
|
909
908
|
constructor() {
|
|
910
909
|
super();
|
|
911
|
-
|
|
910
|
+
h(this, Kt, /* @__PURE__ */ c(() => {
|
|
912
911
|
var e;
|
|
913
912
|
(e = this.querySelector(".nine-tab-bar")) == null || e.addEventListener("click", (s) => {
|
|
914
913
|
var a;
|
|
915
|
-
const
|
|
916
|
-
t(this, qt).call(this, n,
|
|
914
|
+
const r = s.ctrlKey || s.metaKey || s.shiftKey, n = parseInt((a = s.target.closest(".nine-tab-item")) == null ? void 0 : a.dataset.index, 10);
|
|
915
|
+
t(this, qt).call(this, n, r);
|
|
917
916
|
}), t(this, qt).call(this, 0, !1);
|
|
918
917
|
}, "#init"));
|
|
919
|
-
|
|
920
|
-
const
|
|
918
|
+
h(this, qt, /* @__PURE__ */ c((e, s = !1) => {
|
|
919
|
+
const r = /* @__PURE__ */ c(() => {
|
|
921
920
|
const f = Array.from(this.querySelectorAll("nine-table-sheet"));
|
|
922
|
-
Array.from(this.querySelectorAll("nine-splitter")).forEach((
|
|
923
|
-
const
|
|
924
|
-
|
|
925
|
-
const x = parseInt(
|
|
921
|
+
Array.from(this.querySelectorAll("nine-splitter")).forEach((g) => g.style.setProperty("display", "none"));
|
|
922
|
+
const b = f.filter((g) => g.classList.contains("active"));
|
|
923
|
+
b.length < 2 || b.forEach((g) => {
|
|
924
|
+
const x = parseInt(g.getAttribute("data-index"), 10), v = this.querySelector(`nine-splitter[data-split-index="${x}"]`), A = f[x + 1];
|
|
926
925
|
v && A && A.classList.contains("active") && v.style.setProperty("display", "flex");
|
|
927
926
|
});
|
|
928
|
-
}, "updateSplitters"), n = this.querySelector(".nine-tab-bar"), a = this.querySelector("nine-table-sheets-body"), o = n.querySelectorAll(".nine-tab-item"),
|
|
927
|
+
}, "updateSplitters"), n = this.querySelector(".nine-tab-bar"), a = this.querySelector("nine-table-sheets-body"), o = n.querySelectorAll(".nine-tab-item"), d = a.querySelectorAll("nine-table-sheet");
|
|
929
928
|
if (!o[e]) return;
|
|
930
929
|
if (!s)
|
|
931
930
|
o.forEach((f, u) => {
|
|
932
931
|
f.classList.toggle("active", u === e);
|
|
933
|
-
}),
|
|
934
|
-
const
|
|
935
|
-
f.classList.toggle("active",
|
|
932
|
+
}), d.forEach((f, u) => {
|
|
933
|
+
const b = u === e;
|
|
934
|
+
f.classList.toggle("active", b), f.style.flex = b ? "1 1 100%" : "";
|
|
936
935
|
});
|
|
937
936
|
else {
|
|
938
937
|
const f = o[e], u = n.querySelectorAll(".nine-tab-item.active");
|
|
939
938
|
if (f.classList.contains("active") && u.length <= 1)
|
|
940
939
|
return;
|
|
941
940
|
f.classList.toggle("active");
|
|
942
|
-
const
|
|
943
|
-
|
|
941
|
+
const b = a.querySelector(`nine-table-sheet[data-index="${e}"]`);
|
|
942
|
+
b && (b.classList.toggle("active"), b.classList.contains("active") || (b.style.flex = ""));
|
|
944
943
|
}
|
|
945
944
|
const l = a.querySelectorAll("nine-table-sheet.active");
|
|
946
945
|
l == null || l.forEach((f) => {
|
|
947
946
|
f.style.flex = l.length > 1 ? "1 1 0%" : "1 1 100%";
|
|
948
|
-
}),
|
|
947
|
+
}), r();
|
|
949
948
|
}, "#switchSheet"));
|
|
950
949
|
}
|
|
951
950
|
connectedCallback() {
|
|
952
951
|
t(this, Kt).call(this);
|
|
953
952
|
}
|
|
954
953
|
};
|
|
955
|
-
Kt = new WeakMap(), qt = new WeakMap(),
|
|
954
|
+
Kt = new WeakMap(), qt = new WeakMap(), c(_e, "NineTableSheets");
|
|
956
955
|
let de = _e;
|
|
957
956
|
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", de);
|
|
958
957
|
var M, Zt, Tt, Gt;
|
|
959
958
|
const Ne = class Ne {
|
|
960
|
-
constructor(
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
t(this, Gt).call(this), new ResizeObserver((
|
|
964
|
-
for (let e of
|
|
959
|
+
constructor(i) {
|
|
960
|
+
h(this, M);
|
|
961
|
+
h(this, Zt, /* @__PURE__ */ c(() => {
|
|
962
|
+
t(this, Gt).call(this), new ResizeObserver((i) => {
|
|
963
|
+
for (let e of i)
|
|
965
964
|
t(this, M).getAttribute("auto-height") === "true" && t(this, Tt).call(this);
|
|
966
965
|
}).observe(t(this, M));
|
|
967
966
|
}, "#init"));
|
|
968
|
-
|
|
969
|
-
var
|
|
970
|
-
const
|
|
971
|
-
if (
|
|
972
|
-
const e = parseInt(t(this, M).getAttribute("max-display-row"), 10) || 10, s = Math.max(...
|
|
967
|
+
h(this, Tt, /* @__PURE__ */ c(() => {
|
|
968
|
+
var d, l;
|
|
969
|
+
const i = Array.from(t(this, M).shadowRoot.querySelectorAll("nine-table-sheet.active"));
|
|
970
|
+
if (i.length === 0) return;
|
|
971
|
+
const e = parseInt(t(this, M).getAttribute("max-display-row"), 10) || 10, s = Math.max(...i.map((f) => f.getRowHeight())), r = (d = t(this, M).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : d.getBoundingClientRect().height, n = (l = t(this, M).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : l.getBoundingClientRect().height, a = $t.SCROLLBAR_SIZE, o = e * s + r + n + a;
|
|
973
972
|
t(this, M).style.height = `${o}px`;
|
|
974
973
|
}, "#applyAutoHeight"));
|
|
975
|
-
|
|
976
|
-
const e = Array.from(t(this, M).children).filter((
|
|
977
|
-
const u = `<nine-table-sheet class="${l === 0 ? "active" : ""}" data-index="${l}"></nine-table-sheet>`,
|
|
978
|
-
return u +
|
|
979
|
-
}).join(""), a = e.map((
|
|
974
|
+
h(this, Gt, /* @__PURE__ */ c(() => {
|
|
975
|
+
const e = Array.from(t(this, M).children).filter((d) => d.tagName === "TABLE"), s = t(this, M).getAttribute("auto-height") === "true", r = e.length, n = e.map((d, l) => {
|
|
976
|
+
const u = `<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>` : "";
|
|
977
|
+
return u + b;
|
|
978
|
+
}).join(""), a = e.map((d, l) => `<div class="nine-tab-item ${l === 0 ? "active" : ""}" data-index="${l}">Sheet ${l + 1}</div>`).join("");
|
|
980
979
|
t(this, M).shadowRoot.innerHTML = `
|
|
981
980
|
<style>
|
|
982
981
|
:host {
|
|
@@ -1069,76 +1068,76 @@ const Ne = class Ne {
|
|
|
1069
1068
|
<nine-table-footer></nine-table-footer>
|
|
1070
1069
|
`;
|
|
1071
1070
|
const o = t(this, M).shadowRoot.querySelectorAll("nine-table-sheet");
|
|
1072
|
-
o == null || o.forEach((
|
|
1071
|
+
o == null || o.forEach((d, l) => {
|
|
1073
1072
|
e[l] && setTimeout(() => {
|
|
1074
|
-
|
|
1073
|
+
d.generate(e[l]), s && t(this, Tt).call(this);
|
|
1075
1074
|
});
|
|
1076
1075
|
});
|
|
1077
1076
|
}, "#render"));
|
|
1078
|
-
y(this, M,
|
|
1077
|
+
y(this, M, i), t(this, Zt).call(this);
|
|
1079
1078
|
}
|
|
1080
1079
|
};
|
|
1081
|
-
M = new WeakMap(), Zt = new WeakMap(), Tt = new WeakMap(), Gt = new WeakMap(),
|
|
1080
|
+
M = new WeakMap(), Zt = new WeakMap(), Tt = new WeakMap(), Gt = new WeakMap(), c(Ne, "LayoutManager");
|
|
1082
1081
|
let fe = Ne;
|
|
1083
1082
|
var kt, ht;
|
|
1084
1083
|
const We = class We {
|
|
1085
|
-
constructor(
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
E(this, "count", /* @__PURE__ */
|
|
1089
|
-
y(this, kt,
|
|
1084
|
+
constructor(i) {
|
|
1085
|
+
h(this, kt);
|
|
1086
|
+
h(this, ht, -1);
|
|
1087
|
+
E(this, "count", /* @__PURE__ */ c(() => t(this, kt).rawRecords.length, "count"));
|
|
1088
|
+
y(this, kt, i);
|
|
1090
1089
|
}
|
|
1091
1090
|
get at() {
|
|
1092
1091
|
return t(this, ht);
|
|
1093
1092
|
}
|
|
1094
|
-
set at(
|
|
1095
|
-
y(this, ht, parseInt(
|
|
1093
|
+
set at(i) {
|
|
1094
|
+
y(this, ht, parseInt(i, 10)), body && !body.querySelector(`tbody.bindable tr[data-row="${t(this, ht)}"]`) && setTimeout(() => {
|
|
1096
1095
|
});
|
|
1097
1096
|
}
|
|
1098
1097
|
};
|
|
1099
|
-
kt = new WeakMap(), ht = new WeakMap(),
|
|
1098
|
+
kt = new WeakMap(), ht = new WeakMap(), c(We, "ngRow");
|
|
1100
1099
|
let ue = We;
|
|
1101
|
-
var I, T, _, dt, Jt, Y, Qt,
|
|
1100
|
+
var I, T, _, dt, Jt, Y, Qt, it, Ct, te, ee, ft;
|
|
1102
1101
|
const O = class O {
|
|
1103
|
-
constructor(
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1102
|
+
constructor(i, e) {
|
|
1103
|
+
h(this, I);
|
|
1104
|
+
h(this, T);
|
|
1105
|
+
h(this, _, []);
|
|
1106
|
+
h(this, dt, []);
|
|
1107
|
+
h(this, Jt, 0);
|
|
1108
|
+
h(this, Y, []);
|
|
1109
|
+
h(this, Qt, /* @__PURE__ */ c(() => {
|
|
1111
1110
|
y(this, Y, []);
|
|
1112
|
-
const
|
|
1113
|
-
Array.from(
|
|
1111
|
+
const i = t(this, I).template || [];
|
|
1112
|
+
Array.from(i).forEach((e) => {
|
|
1114
1113
|
var s;
|
|
1115
1114
|
t(this, Y).push(((s = e.getBoundingClientRect) == null ? void 0 : s.call(e).height) || 24);
|
|
1116
1115
|
}), (t(this, T).rawRecords || []).forEach((e) => {
|
|
1117
1116
|
e.__ng || (e.__ng = t(this, Ct).call(this)), e.__ng.height = t(this, Y).slice();
|
|
1118
1117
|
});
|
|
1119
1118
|
}, "#initialize"));
|
|
1120
|
-
|
|
1121
|
-
t(this, I).shadowRoot.querySelectorAll("nine-table-sheet").forEach((
|
|
1122
|
-
|
|
1119
|
+
h(this, it, /* @__PURE__ */ c(() => {
|
|
1120
|
+
t(this, I).shadowRoot.querySelectorAll("nine-table-sheet").forEach((i) => {
|
|
1121
|
+
i.invalidate();
|
|
1123
1122
|
});
|
|
1124
1123
|
}, "#invalidate"));
|
|
1125
|
-
E(this, "get", /* @__PURE__ */
|
|
1124
|
+
E(this, "get", /* @__PURE__ */ c((i, e) => {
|
|
1126
1125
|
var n;
|
|
1127
1126
|
const s = this.getValidData();
|
|
1128
1127
|
if (!s || s.length <= 0) return;
|
|
1129
|
-
if (
|
|
1130
|
-
if (
|
|
1131
|
-
const
|
|
1128
|
+
if (i == null) return t(this, ft).call(this, s);
|
|
1129
|
+
if (i < 0 || i >= s.length) return null;
|
|
1130
|
+
const r = typeof ((n = t(this, I).fields) == null ? void 0 : n.get) == "function" ? t(this, I).fields.get() : [];
|
|
1132
1131
|
if (e != null) {
|
|
1133
|
-
const a =
|
|
1134
|
-
return a >= 0 ? s[
|
|
1132
|
+
const a = r.indexOf(e);
|
|
1133
|
+
return a >= 0 ? s[i].v[a] : null;
|
|
1135
1134
|
}
|
|
1136
|
-
return t(this, ft).call(this, s[
|
|
1135
|
+
return t(this, ft).call(this, s[i]);
|
|
1137
1136
|
}, "get"));
|
|
1138
|
-
E(this, "set", /* @__PURE__ */
|
|
1139
|
-
this.clear(), this.add(
|
|
1137
|
+
E(this, "set", /* @__PURE__ */ c((i) => {
|
|
1138
|
+
this.clear(), this.add(i, !1), t(this, it).call(this);
|
|
1140
1139
|
}, "set"));
|
|
1141
|
-
|
|
1140
|
+
h(this, Ct, /* @__PURE__ */ c(() => ({
|
|
1142
1141
|
rowState: O.ROW_STATE.EMPTY,
|
|
1143
1142
|
deleted: !1,
|
|
1144
1143
|
filtered: !1,
|
|
@@ -1147,85 +1146,85 @@ const O = class O {
|
|
|
1147
1146
|
c: {},
|
|
1148
1147
|
_: [0, 0, 0, 0, O.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this, Y).slice(), -1, {}, {}]
|
|
1149
1148
|
}), "#getDefaultMeta"));
|
|
1150
|
-
E(this, "reset", /* @__PURE__ */
|
|
1151
|
-
y(this, _, []), y(this, dt, []), t(this,
|
|
1149
|
+
E(this, "reset", /* @__PURE__ */ c(() => {
|
|
1150
|
+
y(this, _, []), y(this, dt, []), t(this, it).call(this);
|
|
1152
1151
|
}, "reset"));
|
|
1153
|
-
E(this, "clear", /* @__PURE__ */
|
|
1154
|
-
var r;
|
|
1155
|
-
t(this, T).rawRecords = [], y(this, _, []), y(this, dt, []), (r = t(this, T).viewRecords) != null && r.reset && t(this, T).viewRecords.reset();
|
|
1156
|
-
}, "clear"));
|
|
1157
|
-
d(this, te, /* @__PURE__ */ h((r) => {
|
|
1152
|
+
E(this, "clear", /* @__PURE__ */ c(() => {
|
|
1158
1153
|
var i;
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1154
|
+
t(this, T).rawRecords = [], y(this, _, []), y(this, dt, []), (i = t(this, T).viewRecords) != null && i.reset && t(this, T).viewRecords.reset();
|
|
1155
|
+
}, "clear"));
|
|
1156
|
+
h(this, te, /* @__PURE__ */ c((i) => {
|
|
1157
|
+
var r;
|
|
1158
|
+
Array.isArray(i) || (i = [i]);
|
|
1159
|
+
const e = typeof ((r = t(this, I).fields) == null ? void 0 : r.get) == "function" ? t(this, I).fields.get() : Object.keys(i[0] || {}), s = [];
|
|
1160
|
+
return i.forEach((n) => {
|
|
1162
1161
|
const a = { v: [] };
|
|
1163
1162
|
e.forEach((o) => {
|
|
1164
1163
|
a.v.push(n[o] !== void 0 && n[o] !== null ? n[o] : "");
|
|
1165
1164
|
}), s.push(a);
|
|
1166
1165
|
}), s;
|
|
1167
1166
|
}, "#json2Array"));
|
|
1168
|
-
|
|
1167
|
+
h(this, ee, /* @__PURE__ */ c((i) => (Array.isArray(i) || (i = [i]), i.forEach((e) => {
|
|
1169
1168
|
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;
|
|
1170
|
-
}),
|
|
1171
|
-
E(this, "add", /* @__PURE__ */
|
|
1172
|
-
|
|
1173
|
-
const s = t(this, te).call(this,
|
|
1169
|
+
}), i), "#defaultInsert"));
|
|
1170
|
+
E(this, "add", /* @__PURE__ */ c((i, e = !0) => {
|
|
1171
|
+
i === void 0 && (i = {});
|
|
1172
|
+
const s = t(this, te).call(this, i);
|
|
1174
1173
|
t(this, T).rawRecords = t(this, T).rawRecords.concat(t(this, ee).call(this, s)), this.resetRecords();
|
|
1175
|
-
const
|
|
1174
|
+
const r = this.count() - 1;
|
|
1176
1175
|
return e || s.forEach((n, a) => {
|
|
1177
|
-
const o = t(this, T).rawRecords[
|
|
1176
|
+
const o = t(this, T).rawRecords[r - a];
|
|
1178
1177
|
o && (o.__ng.rowState = O.ROW_STATE.EMPTY);
|
|
1179
|
-
}), t(this,
|
|
1178
|
+
}), t(this, it).call(this), r;
|
|
1180
1179
|
}, "add"));
|
|
1181
|
-
E(this, "delete", /* @__PURE__ */
|
|
1180
|
+
E(this, "delete", /* @__PURE__ */ c((i) => {
|
|
1182
1181
|
let e = [];
|
|
1183
|
-
Array.isArray(
|
|
1182
|
+
Array.isArray(i) ? e = i : typeof i > "u" ? e = [t(this, T).host.row.at] : e = [parseInt(i, 10)], e.sort((s, r) => r - s).forEach((s) => {
|
|
1184
1183
|
if (t(this, _)[s]) {
|
|
1185
|
-
const
|
|
1186
|
-
t(this, _)[s].__ng.rowState === O.ROW_STATE.INSERT ? t(this, T).rawRecords = t(this, T).rawRecords.filter((n) => n.__ng.rowid !==
|
|
1187
|
-
n.__ng.rowid ===
|
|
1184
|
+
const r = t(this, _)[s].__ng.rowid;
|
|
1185
|
+
t(this, _)[s].__ng.rowState === O.ROW_STATE.INSERT ? t(this, T).rawRecords = t(this, T).rawRecords.filter((n) => n.__ng.rowid !== r) : t(this, T).rawRecords.forEach((n) => {
|
|
1186
|
+
n.__ng.rowid === r && (n.__ng.deleted = !0, n.__ng.rowState = O.ROW_STATE.DELETE);
|
|
1188
1187
|
});
|
|
1189
1188
|
}
|
|
1190
|
-
}), this.resetRecords(), t(this,
|
|
1189
|
+
}), this.resetRecords(), t(this, it).call(this);
|
|
1191
1190
|
}, "delete"));
|
|
1192
|
-
E(this, "setValue", /* @__PURE__ */
|
|
1193
|
-
var
|
|
1194
|
-
|
|
1195
|
-
const n = (typeof ((
|
|
1191
|
+
E(this, "setValue", /* @__PURE__ */ c((i, e, s) => {
|
|
1192
|
+
var d;
|
|
1193
|
+
i = parseInt(i, 10);
|
|
1194
|
+
const n = (typeof ((d = t(this, I).fields) == null ? void 0 : d.get) == "function" ? t(this, I).fields.get() : []).indexOf(e);
|
|
1196
1195
|
if (n < 0) return;
|
|
1197
|
-
const a = this.getValidData()[
|
|
1196
|
+
const a = this.getValidData()[i];
|
|
1198
1197
|
if (!a) return;
|
|
1199
1198
|
const o = a.v[n];
|
|
1200
1199
|
o !== s && a.__ng.rowState !== O.ROW_STATE.INSERT && (a.__ng.o.hasOwnProperty(e) || (a.__ng.o[e] = o), a.__ng.rowState = O.ROW_STATE.UPDATE), a.v[n] = s;
|
|
1201
1200
|
}, "setValue"));
|
|
1202
|
-
E(this, "resetRecords", /* @__PURE__ */
|
|
1203
|
-
y(this, dt, t(this, T).rawRecords.filter((
|
|
1204
|
-
|
|
1205
|
-
}), t(this, _).forEach((
|
|
1206
|
-
|
|
1201
|
+
E(this, "resetRecords", /* @__PURE__ */ c(() => {
|
|
1202
|
+
y(this, dt, t(this, T).rawRecords.filter((i) => !i.__ng.deleted)), y(this, _, t(this, T).rawRecords.filter((i) => !i.__ng.deleted && !i.__ng.filtered)), t(this, T).rawRecords.forEach((i, e) => {
|
|
1203
|
+
i.__ng.rowidx = e;
|
|
1204
|
+
}), t(this, _).forEach((i, e) => {
|
|
1205
|
+
i.__ng.i = e;
|
|
1207
1206
|
});
|
|
1208
1207
|
}, "resetRecords"));
|
|
1209
|
-
E(this, "getValidData", /* @__PURE__ */
|
|
1210
|
-
|
|
1208
|
+
E(this, "getValidData", /* @__PURE__ */ c(() => (t(this, _).length === 0 && t(this, T).rawRecords.length > 0 && this.resetRecords(), t(this, _)), "getValidData"));
|
|
1209
|
+
h(this, ft, /* @__PURE__ */ c((i) => {
|
|
1211
1210
|
var a;
|
|
1212
|
-
if (!
|
|
1213
|
-
const e = !Array.isArray(
|
|
1214
|
-
const
|
|
1215
|
-
return
|
|
1216
|
-
|
|
1217
|
-
}),
|
|
1211
|
+
if (!i) return i;
|
|
1212
|
+
const e = !Array.isArray(i), s = e ? [i] : i, r = typeof ((a = t(this, I).fields) == null ? void 0 : a.get) == "function" ? t(this, I).fields.get() : [], n = s.filter((o) => !o.__ng.deleted).map((o) => {
|
|
1213
|
+
const d = {};
|
|
1214
|
+
return r.forEach((l, f) => {
|
|
1215
|
+
d[l] = o.v ? o.v[f] : o[l];
|
|
1216
|
+
}), d.__ng = o.__ng, d;
|
|
1218
1217
|
});
|
|
1219
1218
|
return e ? n[0] : n;
|
|
1220
1219
|
}, "#conv"));
|
|
1221
|
-
E(this, "count", /* @__PURE__ */
|
|
1222
|
-
y(this, I,
|
|
1220
|
+
E(this, "count", /* @__PURE__ */ c(() => this.getValidData().length, "count"));
|
|
1221
|
+
y(this, I, i), y(this, T, e), t(this, Qt).call(this);
|
|
1223
1222
|
}
|
|
1224
1223
|
get source() {
|
|
1225
1224
|
return t(this, ft).call(this, t(this, T).rawRecords);
|
|
1226
1225
|
}
|
|
1227
|
-
set source(
|
|
1228
|
-
this.clear(), this.add(
|
|
1226
|
+
set source(i) {
|
|
1227
|
+
this.clear(), this.add(i, !1);
|
|
1229
1228
|
}
|
|
1230
1229
|
get nextId() {
|
|
1231
1230
|
return ++Ue(this, Jt)._;
|
|
@@ -1240,7 +1239,7 @@ const O = class O {
|
|
|
1240
1239
|
return this.length;
|
|
1241
1240
|
}
|
|
1242
1241
|
};
|
|
1243
|
-
I = new WeakMap(), T = new WeakMap(), _ = new WeakMap(), dt = new WeakMap(), Jt = new WeakMap(), Y = new WeakMap(), Qt = new WeakMap(),
|
|
1242
|
+
I = new WeakMap(), T = new WeakMap(), _ = 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(), c(O, "ngData"), // 🎯 행 상태 정의 상수를 클래스 내부로 내재화
|
|
1244
1243
|
E(O, "ROW_STATE", {
|
|
1245
1244
|
EMPTY: "EMPTY",
|
|
1246
1245
|
NORMAL: "NORMAL",
|
|
@@ -1249,56 +1248,56 @@ E(O, "ROW_STATE", {
|
|
|
1249
1248
|
DELETE: "DELETE"
|
|
1250
1249
|
});
|
|
1251
1250
|
let ge = O;
|
|
1252
|
-
var
|
|
1251
|
+
var rt;
|
|
1253
1252
|
const Oe = class Oe {
|
|
1254
|
-
constructor(
|
|
1255
|
-
|
|
1256
|
-
y(this,
|
|
1253
|
+
constructor(i) {
|
|
1254
|
+
h(this, rt);
|
|
1255
|
+
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 = () => {
|
|
1257
1256
|
var e;
|
|
1258
|
-
(e = t(this,
|
|
1257
|
+
(e = t(this, rt).view) != null && e.redraw && t(this, rt).view.redraw();
|
|
1259
1258
|
}, this.setDataSource = (e) => {
|
|
1260
1259
|
this.data && this.data.reset(), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.data.set(e || []);
|
|
1261
1260
|
}, this.getRowState = (e) => {
|
|
1262
|
-
var
|
|
1261
|
+
var r, n;
|
|
1263
1262
|
const s = parseInt(e, 10);
|
|
1264
1263
|
if (!(s >= this.data.count()))
|
|
1265
|
-
return (n = (
|
|
1264
|
+
return (n = (r = this.data.getValidData()[s]) == null ? void 0 : r.__ng) == null ? void 0 : n.rowState;
|
|
1266
1265
|
}, this.getRowPosition = () => this.row.at, this.setRowPosition = (e) => {
|
|
1267
1266
|
this.row.at = e;
|
|
1268
|
-
}, this.scrollTo_V1 = (e) => (e < 0 && (e = 0), e >= this.rawRecords.length && (e = this.rawRecords.length - 1), this.viewRecords.rawIndex = e, this.viewRecords.reset && this.viewRecords.reset(), !(e <= 0 || e >= this.rawRecords.length - 1)), this.getColumn = (e, s) => this.data.get(e, s), this.setColumn = (e, s,
|
|
1269
|
-
e = parseInt(e, 10), this.data.setValue(e, s,
|
|
1267
|
+
}, this.scrollTo_V1 = (e) => (e < 0 && (e = 0), e >= this.rawRecords.length && (e = this.rawRecords.length - 1), this.viewRecords.rawIndex = e, this.viewRecords.reset && this.viewRecords.reset(), !(e <= 0 || e >= this.rawRecords.length - 1)), this.getColumn = (e, s) => this.data.get(e, s), this.setColumn = (e, s, r) => {
|
|
1268
|
+
e = parseInt(e, 10), this.data.setValue(e, s, r);
|
|
1270
1269
|
}, this.setDataSource([]);
|
|
1271
1270
|
}
|
|
1272
1271
|
};
|
|
1273
|
-
|
|
1272
|
+
rt = new WeakMap(), c(Oe, "ngDataManager");
|
|
1274
1273
|
let be = Oe;
|
|
1275
1274
|
var ut, L, Lt, se;
|
|
1276
1275
|
const Be = class Be {
|
|
1277
1276
|
// 🎯 이제 { name: string, type: string } 객체들의 배열로 관리합니다.
|
|
1278
|
-
constructor(
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
E(this, "add", /* @__PURE__ */
|
|
1282
|
-
|
|
1283
|
-
t(this, L).some((
|
|
1277
|
+
constructor(i) {
|
|
1278
|
+
h(this, ut);
|
|
1279
|
+
h(this, L, []);
|
|
1280
|
+
E(this, "add", /* @__PURE__ */ c((i, e = "string") => {
|
|
1281
|
+
i.forEach((s) => {
|
|
1282
|
+
t(this, L).some((r) => r.name === s) || t(this, L).push({ name: s, type: e });
|
|
1284
1283
|
}), t(this, Lt).call(this);
|
|
1285
1284
|
}, "add"));
|
|
1286
|
-
|
|
1287
|
-
const
|
|
1285
|
+
h(this, Lt, /* @__PURE__ */ c(() => {
|
|
1286
|
+
const i = /* @__PURE__ */ new Map();
|
|
1288
1287
|
t(this, L).forEach((e) => {
|
|
1289
|
-
|
|
1290
|
-
}), y(this, L, Array.from(
|
|
1288
|
+
i.set(e.name, e.type);
|
|
1289
|
+
}), 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);
|
|
1291
1290
|
}, "#adjust"));
|
|
1292
|
-
|
|
1291
|
+
h(this, se, /* @__PURE__ */ c(() => {
|
|
1293
1292
|
y(this, L, []), N.log(t(this, ut).querySelectorAll("table"));
|
|
1294
|
-
const
|
|
1295
|
-
if (!(!
|
|
1296
|
-
for (const e of
|
|
1297
|
-
N.log(e), $("[data-bind]", e).each((s,
|
|
1298
|
-
const n =
|
|
1293
|
+
const i = Array.from(t(this, ut).querySelectorAll("table"));
|
|
1294
|
+
if (!(!i || i.length === 0)) {
|
|
1295
|
+
for (const e of i)
|
|
1296
|
+
N.log(e), $("[data-bind]", e).each((s, r) => {
|
|
1297
|
+
const n = r.dataset.bind, a = r.getAttribute("data-type") || "string";
|
|
1299
1298
|
n && t(this, L).push({ name: n, type: a });
|
|
1300
1299
|
}), ["data-expr", "background-color", "color", "tooltip", "visible", "readonly", "enable-button", "enable-check", "class-expr", "icon-color", "icon-src"].forEach((s) => {
|
|
1301
|
-
$(`[${s}]`, e).each((
|
|
1300
|
+
$(`[${s}]`, e).each((r, n) => {
|
|
1302
1301
|
var a = n.getAttribute(s);
|
|
1303
1302
|
if (a.indexOf("data.") < 0) {
|
|
1304
1303
|
const o = a.search(/[(]/g);
|
|
@@ -1311,9 +1310,9 @@ const Be = class Be {
|
|
|
1311
1310
|
}
|
|
1312
1311
|
a.split("data.").forEach((o) => {
|
|
1313
1312
|
if (o.trim() != "") {
|
|
1314
|
-
const
|
|
1313
|
+
const d = o.search(/[^_A-Za-z0-9]/g);
|
|
1315
1314
|
let l = "";
|
|
1316
|
-
|
|
1315
|
+
d >= 0 ? l = o.substring(0, d) : a.startsWith("data.") && (l = o.replace("data.", "")), l && t(this, L).push({ name: l, type: "string" });
|
|
1317
1316
|
}
|
|
1318
1317
|
});
|
|
1319
1318
|
});
|
|
@@ -1321,44 +1320,44 @@ const Be = class Be {
|
|
|
1321
1320
|
t(this, Lt).call(this);
|
|
1322
1321
|
}
|
|
1323
1322
|
}, "#init"));
|
|
1324
|
-
y(this, ut,
|
|
1323
|
+
y(this, ut, i), t(this, se).call(this);
|
|
1325
1324
|
}
|
|
1326
1325
|
// 🎯 기존에 필드 이름만 쓰던 곳들과의 호환을 위해 이름 배열만 리턴하는 메서드 유지
|
|
1327
1326
|
get() {
|
|
1328
|
-
return t(this, L).map((
|
|
1327
|
+
return t(this, L).map((i) => i.name);
|
|
1329
1328
|
}
|
|
1330
1329
|
// 🎯 내부 객체 통째로 얻기
|
|
1331
1330
|
getFields() {
|
|
1332
1331
|
return t(this, L);
|
|
1333
1332
|
}
|
|
1334
1333
|
// 🎯 특정 필드의 데이터 타입 조회
|
|
1335
|
-
getType(
|
|
1336
|
-
const e = t(this, L).find((s) => s.name ===
|
|
1334
|
+
getType(i) {
|
|
1335
|
+
const e = t(this, L).find((s) => s.name === i);
|
|
1337
1336
|
return e ? e.type : "string";
|
|
1338
1337
|
}
|
|
1339
|
-
indexOf(
|
|
1340
|
-
return t(this, L).findIndex((e) => e.name ===
|
|
1338
|
+
indexOf(i) {
|
|
1339
|
+
return t(this, L).findIndex((e) => e.name === i);
|
|
1341
1340
|
}
|
|
1342
|
-
includes(
|
|
1343
|
-
return t(this, L).some((e) => e.name ===
|
|
1341
|
+
includes(i) {
|
|
1342
|
+
return t(this, L).some((e) => e.name === i);
|
|
1344
1343
|
}
|
|
1345
1344
|
};
|
|
1346
|
-
ut = new WeakMap(), L = new WeakMap(), Lt = new WeakMap(), se = new WeakMap(),
|
|
1345
|
+
ut = new WeakMap(), L = new WeakMap(), Lt = new WeakMap(), se = new WeakMap(), c(Be, "ngFields");
|
|
1347
1346
|
let ye = Be;
|
|
1348
|
-
var nt,
|
|
1347
|
+
var nt, ie, re;
|
|
1349
1348
|
const ze = class ze extends HTMLElement {
|
|
1350
1349
|
constructor() {
|
|
1351
1350
|
super();
|
|
1352
1351
|
//#created = false;
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
this.fields = new ye(this), y(this,
|
|
1352
|
+
h(this, nt);
|
|
1353
|
+
h(this, ie);
|
|
1354
|
+
h(this, re, /* @__PURE__ */ c(() => {
|
|
1355
|
+
this.fields = new ye(this), y(this, ie, new fe(this)), N.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
|
|
1357
1356
|
}, "#init"));
|
|
1358
1357
|
this.attachShadow({ mode: "open" }), y(this, nt, new be(this));
|
|
1359
1358
|
}
|
|
1360
1359
|
connectedCallback() {
|
|
1361
|
-
t(this,
|
|
1360
|
+
t(this, re).call(this);
|
|
1362
1361
|
}
|
|
1363
1362
|
disconnectedCallback() {
|
|
1364
1363
|
N.log("NineTable disconnected.");
|
|
@@ -1376,7 +1375,7 @@ const ze = class ze extends HTMLElement {
|
|
|
1376
1375
|
return t(this, nt);
|
|
1377
1376
|
}
|
|
1378
1377
|
};
|
|
1379
|
-
nt = new WeakMap(),
|
|
1378
|
+
nt = new WeakMap(), ie = new WeakMap(), re = new WeakMap(), c(ze, "NineTable");
|
|
1380
1379
|
let pe = ze;
|
|
1381
1380
|
customElements.get("nine-table") || customElements.define("nine-table", pe);
|
|
1382
1381
|
const mt = class mt extends HTMLElement {
|
|
@@ -1390,29 +1389,29 @@ const mt = class mt extends HTMLElement {
|
|
|
1390
1389
|
connectedCallback() {
|
|
1391
1390
|
}
|
|
1392
1391
|
};
|
|
1393
|
-
|
|
1392
|
+
c(mt, "BasicCellElement"), E(mt, "_styleCache", /* @__PURE__ */ new Map()), E(mt, "_customStyleCache", /* @__PURE__ */ new Map());
|
|
1394
1393
|
let me = mt;
|
|
1395
1394
|
var k, Ht, p, Re, qe, Te, ke, Ce;
|
|
1396
1395
|
const Pe = class Pe extends me {
|
|
1397
1396
|
constructor() {
|
|
1398
1397
|
super();
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
E(this, "getDisplayText", /* @__PURE__ */
|
|
1398
|
+
h(this, k);
|
|
1399
|
+
h(this, Ht);
|
|
1400
|
+
h(this, p);
|
|
1401
|
+
h(this, Re);
|
|
1402
|
+
h(this, qe);
|
|
1403
|
+
h(this, Te);
|
|
1404
|
+
h(this, ke);
|
|
1405
|
+
E(this, "getDisplayText", /* @__PURE__ */ c((e) => {
|
|
1407
1406
|
if (t(this, p))
|
|
1408
1407
|
if (t(this, p).closest("tbody")) {
|
|
1409
|
-
const s = t(this, p).closest("tr").data,
|
|
1408
|
+
const s = t(this, p).closest("tr").data, r = parseInt(t(this, p).dataset.row);
|
|
1410
1409
|
if (!s) return "";
|
|
1411
1410
|
if (ninegrid.isNull(t(this, p).dataset.expr)) {
|
|
1412
1411
|
if (!ninegrid.isNull(t(this, p).dataset.bind))
|
|
1413
1412
|
return s[t(this, p).dataset.bind] || ninegrid.nvl(e, "");
|
|
1414
1413
|
} else try {
|
|
1415
|
-
return this.getExprValue(t(this, p).dataset.expr, s,
|
|
1414
|
+
return this.getExprValue(t(this, p).dataset.expr, s, r, t(this, p));
|
|
1416
1415
|
} catch {
|
|
1417
1416
|
console.error(t(this, p).dataset.expr, s, t(this, p).dataset.row);
|
|
1418
1417
|
}
|
|
@@ -1423,23 +1422,23 @@ const Pe = class Pe extends me {
|
|
|
1423
1422
|
} catch {
|
|
1424
1423
|
}
|
|
1425
1424
|
}, "getDisplayText"));
|
|
1426
|
-
|
|
1425
|
+
h(this, Ce, /* @__PURE__ */ c(() => {
|
|
1427
1426
|
if (!(!t(this, k) || !t(this, k).template || !t(this, p).closest("tbody.bindable"))) {
|
|
1428
1427
|
var e = ninegrid.j.querySelectorAll(t(this, p)).attr("suppress");
|
|
1429
1428
|
if (e && (e = parseInt(e)), e && !isNaN(e)) {
|
|
1430
|
-
var s = t(this, p).closest("tr"),
|
|
1429
|
+
var s = t(this, p).closest("tr"), r = [];
|
|
1431
1430
|
$("th,td", s).each((m, W) => {
|
|
1432
1431
|
var C = ninegrid.j.querySelectorAll(W).attr("suppress");
|
|
1433
|
-
C && W.dataset.row && (C = parseInt(C), !isNaN(C) && C <= e &&
|
|
1434
|
-
}),
|
|
1432
|
+
C && W.dataset.row && (C = parseInt(C), !isNaN(C) && C <= e && r.push(C));
|
|
1433
|
+
}), r.sort();
|
|
1435
1434
|
var n = !1;
|
|
1436
1435
|
if (parseInt(s.sectionRowIndex / t(this, k).template.length) > 0)
|
|
1437
|
-
for (var a of
|
|
1436
|
+
for (var a of r) {
|
|
1438
1437
|
if (a > e) break;
|
|
1439
|
-
var o = parseInt(t(this, p).dataset.row),
|
|
1438
|
+
var o = parseInt(t(this, p).dataset.row), d = o - 1, l = t(this, p).closest("tr").data, f = t(this, k).data.get(d);
|
|
1440
1439
|
t(this, p).dataset.matrixRow;
|
|
1441
|
-
var u = t(this, k).body.querySelector(`tbody.bindable [suppress="${a}"][data-matrix-row="${t(this, p).dataset.matrixRow}"]`),
|
|
1442
|
-
if (
|
|
1440
|
+
var u = t(this, k).body.querySelector(`tbody.bindable [suppress="${a}"][data-matrix-row="${t(this, p).dataset.matrixRow}"]`), b = u.dataset.expr ? this.getExprValue(u.dataset.expr, l, o) : l[u.dataset.bind], g = u.dataset.expr ? this.getExprValue(u.dataset.expr, f, d) : f[u.dataset.bind];
|
|
1441
|
+
if (b != g) {
|
|
1443
1442
|
n = !0;
|
|
1444
1443
|
break;
|
|
1445
1444
|
}
|
|
@@ -1452,12 +1451,12 @@ const Pe = class Pe extends me {
|
|
|
1452
1451
|
}
|
|
1453
1452
|
}
|
|
1454
1453
|
}, "#resetSuppress"));
|
|
1455
|
-
E(this, "getExprValue", /* @__PURE__ */
|
|
1454
|
+
E(this, "getExprValue", /* @__PURE__ */ c((e, s, r, n) => {
|
|
1456
1455
|
if (typeof e < "u")
|
|
1457
1456
|
try {
|
|
1458
|
-
|
|
1457
|
+
r = parseInt(r);
|
|
1459
1458
|
const a = e.replace("()", "");
|
|
1460
|
-
return t(this, k)[a] ? t(this, k)[a].call(this, s,
|
|
1459
|
+
return t(this, k)[a] ? t(this, k)[a].call(this, s, r, t(this, p)) : t(this, k).exprFunction(e).call(this, s, r, t(this, k).data);
|
|
1461
1460
|
} catch {
|
|
1462
1461
|
return ["NG-COMBO"].includes(this.tagName) ? "" : e;
|
|
1463
1462
|
}
|
|
@@ -1474,8 +1473,8 @@ const Pe = class Pe extends me {
|
|
|
1474
1473
|
}
|
|
1475
1474
|
set value(e) {
|
|
1476
1475
|
var s = parseInt(t(this, p).dataset.row);
|
|
1477
|
-
const
|
|
1478
|
-
s < 0 ? t(this, k).data.setValueNF(parseInt(t(this, p).dataset.index), t(this, p).dataset.bind, e,
|
|
1476
|
+
const r = this.getAttribute("update-row-state") != "false";
|
|
1477
|
+
s < 0 ? t(this, k).data.setValueNF(parseInt(t(this, p).dataset.index), t(this, p).dataset.bind, e, r) : t(this, k).data.setValue(s, t(this, p).dataset.bind, e, r);
|
|
1479
1478
|
}
|
|
1480
1479
|
get row() {
|
|
1481
1480
|
return parseInt(t(this, p).dataset.row);
|
|
@@ -1488,7 +1487,7 @@ const Pe = class Pe extends me {
|
|
|
1488
1487
|
return parseInt(t(this, p).dataset.row), t(this, Ht).data[e];
|
|
1489
1488
|
}
|
|
1490
1489
|
};
|
|
1491
|
-
k = new WeakMap(), Ht = new WeakMap(), p = new WeakMap(), Re = new WeakMap(), qe = new WeakMap(), Te = new WeakMap(), ke = new WeakMap(), Ce = new WeakMap(),
|
|
1490
|
+
k = new WeakMap(), Ht = new WeakMap(), p = new WeakMap(), Re = new WeakMap(), qe = new WeakMap(), Te = new WeakMap(), ke = new WeakMap(), Ce = new WeakMap(), c(Pe, "CellElement");
|
|
1492
1491
|
let xe = Pe;
|
|
1493
1492
|
const De = class De extends xe {
|
|
1494
1493
|
constructor() {
|
|
@@ -1501,19 +1500,19 @@ const De = class De extends xe {
|
|
|
1501
1500
|
return super.refresh();
|
|
1502
1501
|
}
|
|
1503
1502
|
};
|
|
1504
|
-
|
|
1503
|
+
c(De, "EditableCellElement");
|
|
1505
1504
|
let ve = De;
|
|
1506
1505
|
var Mt, ot, gt, bt, ne, U, Le;
|
|
1507
1506
|
const je = class je extends ve {
|
|
1508
1507
|
constructor() {
|
|
1509
1508
|
super();
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
E(this, "refresh", /* @__PURE__ */
|
|
1509
|
+
h(this, Mt);
|
|
1510
|
+
h(this, ot);
|
|
1511
|
+
h(this, gt);
|
|
1512
|
+
h(this, bt);
|
|
1513
|
+
h(this, ne);
|
|
1514
|
+
h(this, U);
|
|
1515
|
+
E(this, "refresh", /* @__PURE__ */ c(() => {
|
|
1517
1516
|
const e = super.refresh();
|
|
1518
1517
|
t(this, Mt).value = e;
|
|
1519
1518
|
}, "refresh"));
|
|
@@ -1547,14 +1546,14 @@ const je = class je extends ve {
|
|
|
1547
1546
|
if (!v) this.reset();
|
|
1548
1547
|
};
|
|
1549
1548
|
*/
|
|
1550
|
-
|
|
1549
|
+
h(this, Le, /* @__PURE__ */ c((e) => {
|
|
1551
1550
|
if (!["Escape", "Enter", "Tab", "Home", "End", "ArrowLeft", "ArrowRight", "PageUp", "PageDown", "Backspace", "Delete"].includes(e.code)) {
|
|
1552
1551
|
if (t(this, ot) == "number") {
|
|
1553
1552
|
let n = [];
|
|
1554
1553
|
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) {
|
|
1555
|
-
var s = e.target.value,
|
|
1556
|
-
if (
|
|
1557
|
-
var s = s.substr(
|
|
1554
|
+
var s = e.target.value, r = s.indexOf(".");
|
|
1555
|
+
if (r >= 0) {
|
|
1556
|
+
var s = s.substr(r + 1, s.length);
|
|
1558
1557
|
s.length >= Number(t(this, U)) && e.preventDefault();
|
|
1559
1558
|
}
|
|
1560
1559
|
}
|
|
@@ -1575,7 +1574,7 @@ const je = class je extends ve {
|
|
|
1575
1574
|
`, super.connectedCallback(), y(this, Mt, this.querySelector("input"));
|
|
1576
1575
|
}
|
|
1577
1576
|
};
|
|
1578
|
-
Mt = new WeakMap(), ot = new WeakMap(), gt = new WeakMap(), bt = new WeakMap(), ne = new WeakMap(), U = new WeakMap(), Le = new WeakMap(),
|
|
1577
|
+
Mt = new WeakMap(), ot = new WeakMap(), gt = new WeakMap(), bt = new WeakMap(), ne = new WeakMap(), U = new WeakMap(), Le = new WeakMap(), c(je, "CellInputText");
|
|
1579
1578
|
let we = je;
|
|
1580
1579
|
customElements.get("cell-input-text");
|
|
1581
1580
|
customElements.get("cell-input") || customElements.define("cell-input", we);
|