@ninebone/table 0.0.718 → 0.0.720
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 +692 -611
- package/dist/nine-table.js.map +1 -1
- package/dist/nine-table.umd.js +6 -6
- package/dist/nine-table.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/nine-table.js
CHANGED
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var bs = Object.defineProperty;
|
|
2
|
+
var ps = (q) => {
|
|
3
3
|
throw TypeError(q);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var h = (q,
|
|
7
|
-
var
|
|
8
|
-
var t = (q,
|
|
9
|
-
var
|
|
5
|
+
var ws = (q, s, e) => s in q ? bs(q, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : q[s] = e;
|
|
6
|
+
var h = (q, s) => bs(q, "name", { value: s, configurable: !0 });
|
|
7
|
+
var E = (q, s, e) => ws(q, typeof s != "symbol" ? s + "" : s, e), ve = (q, s, e) => s.has(q) || ps("Cannot " + e);
|
|
8
|
+
var t = (q, s, e) => (ve(q, s, "read from private field"), e ? e.call(q) : s.get(q)), d = (q, s, e) => s.has(q) ? ps("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(q) : s.set(q, e), p = (q, s, e, n) => (ve(q, s, "write to private field"), n ? n.call(q, e) : s.set(q, e), e), Q = (q, s, e) => (ve(q, s, "access private method"), e);
|
|
9
|
+
var ys = (q, s, e, n) => ({
|
|
10
10
|
set _(r) {
|
|
11
|
-
p(q,
|
|
11
|
+
p(q, s, r, e);
|
|
12
12
|
},
|
|
13
13
|
get _() {
|
|
14
|
-
return t(q,
|
|
14
|
+
return t(q, s, n);
|
|
15
15
|
}
|
|
16
16
|
});
|
|
17
|
-
import { trace as
|
|
18
|
-
const
|
|
17
|
+
import { trace as vs } from "@ninebone/util";
|
|
18
|
+
const Ge = class Ge extends vs.constructor {
|
|
19
19
|
constructor() {
|
|
20
20
|
super(), this.init("nine-table", "green");
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
|
-
h(
|
|
24
|
-
let
|
|
25
|
-
const
|
|
26
|
-
var
|
|
27
|
-
const
|
|
23
|
+
h(Ge, "Trace");
|
|
24
|
+
let Se = Ge;
|
|
25
|
+
const R = new Se();
|
|
26
|
+
var B, K, A, tt, et, st, Yt, nt, Vt;
|
|
27
|
+
const Ze = class Ze extends HTMLElement {
|
|
28
28
|
constructor() {
|
|
29
29
|
super();
|
|
30
|
-
d(this,
|
|
31
|
-
d(this,
|
|
32
|
-
d(this,
|
|
33
|
-
d(this,
|
|
34
|
-
d(this,
|
|
35
|
-
d(this,
|
|
36
|
-
d(this,
|
|
37
|
-
if (!t(this,
|
|
38
|
-
const e = t(this,
|
|
39
|
-
e && (p(this,
|
|
30
|
+
d(this, B);
|
|
31
|
+
d(this, K, !1);
|
|
32
|
+
d(this, A);
|
|
33
|
+
d(this, tt);
|
|
34
|
+
d(this, et);
|
|
35
|
+
d(this, st);
|
|
36
|
+
d(this, Yt, /* @__PURE__ */ h(() => {
|
|
37
|
+
if (!t(this, B)) return;
|
|
38
|
+
const e = t(this, B).querySelector(".ng-container-body .ng-part-body");
|
|
39
|
+
e && (p(this, st, new ResizeObserver(() => {
|
|
40
40
|
this.refresh();
|
|
41
|
-
})), t(this,
|
|
41
|
+
})), t(this, st).observe(e));
|
|
42
42
|
}, "#observeResize"));
|
|
43
|
-
|
|
44
|
-
if (!t(this,
|
|
45
|
-
const e = t(this,
|
|
46
|
-
if (!
|
|
47
|
-
const r = t(this,
|
|
43
|
+
E(this, "refresh", /* @__PURE__ */ h(() => {
|
|
44
|
+
if (!t(this, B) || !t(this, A) || t(this, K)) return;
|
|
45
|
+
const e = t(this, A).container, n = e.querySelector("table");
|
|
46
|
+
if (!n) return;
|
|
47
|
+
const r = t(this, A).track, o = t(this, A).thumb, i = t(this, B).querySelector(".ng-container-bottom"), a = e.clientWidth, c = n.scrollWidth;
|
|
48
48
|
if (a !== 0 && c > a)
|
|
49
49
|
i && (i.style.display = "flex");
|
|
50
50
|
else {
|
|
@@ -59,60 +59,60 @@ const Be = class Be extends HTMLElement {
|
|
|
59
59
|
let g = 0;
|
|
60
60
|
b > 0 && (g = parseInt(u / b * (l - f), 10)), g < 0 && (g = 0);
|
|
61
61
|
const y = l - f;
|
|
62
|
-
g > y && (g = y), o.style.left = `${g}px`, t(this,
|
|
62
|
+
g > y && (g = y), o.style.left = `${g}px`, t(this, A).left.disabled = g === 0, t(this, A).right.disabled = g >= y - 1;
|
|
63
63
|
}, "refresh"));
|
|
64
|
-
d(this,
|
|
65
|
-
if (!t(this,
|
|
66
|
-
const
|
|
64
|
+
d(this, nt, /* @__PURE__ */ h((e) => {
|
|
65
|
+
if (!t(this, A)) return !1;
|
|
66
|
+
const n = t(this, A).container, r = n.querySelector("table");
|
|
67
67
|
if (!r) return !1;
|
|
68
|
-
const o = t(this,
|
|
68
|
+
const o = t(this, A).track.getBoundingClientRect(), i = t(this, A).thumb.clientWidth;
|
|
69
69
|
let a = e;
|
|
70
70
|
a < 0 && (a = 0);
|
|
71
71
|
const c = o.width - i;
|
|
72
|
-
a > c && (a = c), a = parseInt(a, 10), t(this,
|
|
73
|
-
const l =
|
|
74
|
-
return c > 0 && u > 0 && (
|
|
72
|
+
a > c && (a = c), a = parseInt(a, 10), t(this, A).thumb.style.left = `${a}px`, t(this, A).left.disabled = a === 0, t(this, A).right.disabled = a >= c - 1;
|
|
73
|
+
const l = n.clientWidth, u = r.scrollWidth - l;
|
|
74
|
+
return c > 0 && u > 0 && (n.scrollLeft = a / c * u), a > 0 && a < c - 1;
|
|
75
75
|
}, "#thumbMoveTo"));
|
|
76
|
-
d(this,
|
|
76
|
+
d(this, Vt, /* @__PURE__ */ h(() => {
|
|
77
77
|
const e = /* @__PURE__ */ h((r) => {
|
|
78
|
-
clearInterval(t(this,
|
|
79
|
-
const o = parseInt(t(this,
|
|
80
|
-
t(this,
|
|
81
|
-
clearInterval(t(this,
|
|
82
|
-
const i = parseInt(t(this,
|
|
83
|
-
t(this,
|
|
78
|
+
clearInterval(t(this, tt)), clearInterval(t(this, et));
|
|
79
|
+
const o = parseInt(t(this, A).thumb.style.left || 0, 10);
|
|
80
|
+
t(this, nt).call(this, o + r), p(this, tt, setInterval(() => {
|
|
81
|
+
clearInterval(t(this, tt)), p(this, et, setInterval(() => {
|
|
82
|
+
const i = parseInt(t(this, A).thumb.style.left || 0, 10);
|
|
83
|
+
t(this, nt).call(this, i + r) || clearInterval(t(this, et));
|
|
84
84
|
}, 50));
|
|
85
85
|
}, 500));
|
|
86
|
-
}, "delayScroll"),
|
|
87
|
-
clearInterval(t(this,
|
|
86
|
+
}, "delayScroll"), n = /* @__PURE__ */ h(() => {
|
|
87
|
+
clearInterval(t(this, tt)), clearInterval(t(this, et));
|
|
88
88
|
}, "clearTimer");
|
|
89
89
|
["mouseup", "mouseleave", "touchend"].forEach((r) => {
|
|
90
|
-
t(this,
|
|
91
|
-
}), t(this,
|
|
90
|
+
t(this, A).left.addEventListener(r, n), t(this, A).right.addEventListener(r, n), t(this, A).track.addEventListener(r, n);
|
|
91
|
+
}), t(this, A).left.addEventListener("mousedown", (r) => {
|
|
92
92
|
r.button === 0 && e(-20);
|
|
93
|
-
}), t(this,
|
|
93
|
+
}), t(this, A).right.addEventListener("mousedown", (r) => {
|
|
94
94
|
r.button === 0 && e(20);
|
|
95
|
-
}), t(this,
|
|
95
|
+
}), t(this, A).left.addEventListener("touchstart", () => e(-20)), t(this, A).right.addEventListener("touchstart", () => e(20)), t(this, A).track.addEventListener("mousedown", (r) => {
|
|
96
96
|
if (r.button !== 0) return;
|
|
97
97
|
r.preventDefault();
|
|
98
|
-
const o = t(this,
|
|
99
|
-
t(this,
|
|
100
|
-
}), t(this,
|
|
98
|
+
const o = t(this, A).track.getBoundingClientRect(), i = t(this, A).thumb.clientWidth;
|
|
99
|
+
t(this, nt).call(this, r.clientX - o.left - i / 2);
|
|
100
|
+
}), t(this, A).thumb.addEventListener("mousedown", (r) => {
|
|
101
101
|
if (r.button !== 0) return;
|
|
102
|
-
r.stopPropagation(), r.preventDefault(), p(this,
|
|
102
|
+
r.stopPropagation(), r.preventDefault(), p(this, K, !0), this.shiftX = r.clientX - t(this, A).thumb.getBoundingClientRect().left;
|
|
103
103
|
const o = /* @__PURE__ */ h((a) => {
|
|
104
|
-
if (!t(this,
|
|
105
|
-
const c = t(this,
|
|
106
|
-
t(this,
|
|
104
|
+
if (!t(this, K)) return;
|
|
105
|
+
const c = t(this, A).track.getBoundingClientRect();
|
|
106
|
+
t(this, nt).call(this, a.clientX - c.left - this.shiftX);
|
|
107
107
|
}, "onMouseMove"), i = /* @__PURE__ */ h(() => {
|
|
108
|
-
p(this,
|
|
108
|
+
p(this, K, !1), n(), document.removeEventListener("mousemove", o), document.removeEventListener("mouseup", i), this.refresh();
|
|
109
109
|
}, "onMouseUp");
|
|
110
110
|
document.addEventListener("mousemove", o), document.addEventListener("mouseup", i);
|
|
111
111
|
});
|
|
112
112
|
}, "#init"));
|
|
113
113
|
}
|
|
114
114
|
connectedCallback() {
|
|
115
|
-
if (p(this,
|
|
115
|
+
if (p(this, B, this.closest("nine-table-sheet") || this.getRootNode().host), !t(this, B)) return;
|
|
116
116
|
this.innerHTML = `
|
|
117
117
|
<style>
|
|
118
118
|
nine-table-hscrollbar {
|
|
@@ -177,85 +177,85 @@ const Be = class Be extends HTMLElement {
|
|
|
177
177
|
<button class='ng-scroll-right' disabled><div class='ng-scroll-icon'></div></button>
|
|
178
178
|
`;
|
|
179
179
|
const e = /* @__PURE__ */ h(() => {
|
|
180
|
-
const
|
|
181
|
-
if (!
|
|
180
|
+
const n = t(this, B).querySelector(".ng-container-body .ng-part-body");
|
|
181
|
+
if (!n) {
|
|
182
182
|
setTimeout(e, 10);
|
|
183
183
|
return;
|
|
184
184
|
}
|
|
185
|
-
p(this,
|
|
186
|
-
container:
|
|
185
|
+
p(this, A, {
|
|
186
|
+
container: n,
|
|
187
187
|
track: this.querySelector(".ng-scroll-track"),
|
|
188
188
|
thumb: this.querySelector(".ng-scroll-thumb"),
|
|
189
189
|
left: this.querySelector(".ng-scroll-left"),
|
|
190
190
|
right: this.querySelector(".ng-scroll-right")
|
|
191
|
-
}),
|
|
192
|
-
t(this,
|
|
193
|
-
}), t(this,
|
|
191
|
+
}), n.addEventListener("scroll", () => {
|
|
192
|
+
t(this, K) || this.refresh();
|
|
193
|
+
}), t(this, Vt).call(this), t(this, Yt).call(this), this.refresh();
|
|
194
194
|
}, "initWhenReady");
|
|
195
195
|
e();
|
|
196
196
|
}
|
|
197
197
|
disconnectedCallback() {
|
|
198
|
-
t(this,
|
|
198
|
+
t(this, st) && t(this, st).disconnect();
|
|
199
199
|
}
|
|
200
200
|
};
|
|
201
|
-
|
|
202
|
-
let
|
|
203
|
-
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar",
|
|
204
|
-
var
|
|
205
|
-
const
|
|
201
|
+
B = new WeakMap(), K = new WeakMap(), A = new WeakMap(), tt = new WeakMap(), et = new WeakMap(), st = new WeakMap(), Yt = new WeakMap(), nt = new WeakMap(), Vt = new WeakMap(), h(Ze, "NineTableHScrollBar");
|
|
202
|
+
let Re = Ze;
|
|
203
|
+
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", Re);
|
|
204
|
+
var rt, ot, bt, C, Tt, Ct, Ut;
|
|
205
|
+
const Je = class Je extends HTMLElement {
|
|
206
206
|
constructor() {
|
|
207
207
|
super();
|
|
208
|
-
d(this,
|
|
209
|
-
d(this,
|
|
210
|
-
d(this,
|
|
208
|
+
d(this, rt);
|
|
209
|
+
d(this, ot);
|
|
210
|
+
d(this, bt, !1);
|
|
211
211
|
d(this, C);
|
|
212
|
-
d(this,
|
|
213
|
-
d(this,
|
|
214
|
-
|
|
215
|
-
if (
|
|
216
|
-
const e = t(this, C).container,
|
|
212
|
+
d(this, Tt, 0);
|
|
213
|
+
d(this, Ct, 0);
|
|
214
|
+
E(this, "refresh", /* @__PURE__ */ h(() => {
|
|
215
|
+
if (R.log("vscrollbar.refresh"), !t(this, rt) || !t(this, C)) return;
|
|
216
|
+
const e = t(this, C).container, n = t(this, C).track, r = t(this, C).thumb, o = e.clientHeight, i = t(this, rt).data.length, a = t(this, ot).getRowHeight(), c = i * a;
|
|
217
217
|
if (c <= o || i === 0) {
|
|
218
218
|
this.style.display = "none";
|
|
219
219
|
return;
|
|
220
220
|
} else
|
|
221
221
|
this.style.display = "flex";
|
|
222
|
-
const l =
|
|
222
|
+
const l = n.clientHeight;
|
|
223
223
|
if (l <= 0) return;
|
|
224
224
|
const f = Math.max(Math.min(l * (o / c), l), 20);
|
|
225
225
|
r.style.height = `${f}px`;
|
|
226
226
|
const u = e.scrollTop, b = Math.max(c - o, 1);
|
|
227
|
-
|
|
227
|
+
R.log(e, u, b);
|
|
228
228
|
let g = 0;
|
|
229
229
|
b > 0 && (g = u / b * (l - f));
|
|
230
230
|
const y = l - f;
|
|
231
231
|
g < 0 && (g = 0), g > y && (g = y), r.style.top = `${g}px`, t(this, C).top.disabled = u <= 0, t(this, C).bottom.disabled = u >= b - 1;
|
|
232
232
|
}, "refresh"));
|
|
233
|
-
d(this,
|
|
234
|
-
|
|
235
|
-
const e = t(this, C).container,
|
|
236
|
-
const o = (t(this,
|
|
233
|
+
d(this, Ut, /* @__PURE__ */ h(() => {
|
|
234
|
+
R.log("nine-table-vscrollbar.#init");
|
|
235
|
+
const e = t(this, C).container, n = /* @__PURE__ */ h(() => {
|
|
236
|
+
const o = (t(this, rt).data.get() || []).length, i = t(this, ot).getRowHeight();
|
|
237
237
|
return o * i;
|
|
238
238
|
}, "getContentHeight");
|
|
239
239
|
t(this, C).thumb.addEventListener("mousedown", (r) => {
|
|
240
240
|
if (r.button !== 0) return;
|
|
241
|
-
r.stopPropagation(), r.preventDefault(), p(this,
|
|
241
|
+
r.stopPropagation(), r.preventDefault(), p(this, bt, !0), p(this, Tt, r.clientY), p(this, Ct, e.scrollTop);
|
|
242
242
|
const o = /* @__PURE__ */ h((a) => {
|
|
243
|
-
if (!t(this,
|
|
244
|
-
const c = t(this, C).track.getBoundingClientRect(), l = t(this, C).thumb.clientHeight, u = c.height - l, b = a.clientY - t(this,
|
|
245
|
-
if (u > 0 &&
|
|
246
|
-
const
|
|
247
|
-
let m = t(this,
|
|
248
|
-
const
|
|
249
|
-
m < 0 && (m = 0), m >
|
|
243
|
+
if (!t(this, bt)) return;
|
|
244
|
+
const c = t(this, C).track.getBoundingClientRect(), l = t(this, C).thumb.clientHeight, u = c.height - l, b = a.clientY - t(this, Tt), g = e.clientHeight, y = n(), w = Math.max(y - g, 1);
|
|
245
|
+
if (u > 0 && w > 0) {
|
|
246
|
+
const v = b / u * w;
|
|
247
|
+
let m = t(this, Ct) + v;
|
|
248
|
+
const I = Math.max(0, y - g);
|
|
249
|
+
m < 0 && (m = 0), m > I && (m = I), e.scrollTop = m;
|
|
250
250
|
}
|
|
251
251
|
this.refresh();
|
|
252
252
|
}, "onMouseMove"), i = /* @__PURE__ */ h(() => {
|
|
253
|
-
p(this,
|
|
253
|
+
p(this, bt, !1), document.removeEventListener("mousemove", o), document.removeEventListener("mouseup", i), this.refresh();
|
|
254
254
|
}, "onMouseUp");
|
|
255
255
|
document.addEventListener("mousemove", o), document.addEventListener("mouseup", i);
|
|
256
256
|
}), t(this, C).track.addEventListener("mousedown", (r) => {
|
|
257
257
|
if (r.button !== 0 || r.target === t(this, C).thumb) return;
|
|
258
|
-
const o = t(this, C).track.getBoundingClientRect(), i = t(this, C).thumb.clientHeight, a = r.clientY - o.top - i / 2, l = o.height - i, f = e.clientHeight, u =
|
|
258
|
+
const o = t(this, C).track.getBoundingClientRect(), i = t(this, C).thumb.clientHeight, a = r.clientY - o.top - i / 2, l = o.height - i, f = e.clientHeight, u = n(), b = Math.max(u - f, 1);
|
|
259
259
|
if (l > 0 && b > 0) {
|
|
260
260
|
const g = Math.max(0, Math.min(1, a / l));
|
|
261
261
|
e.scrollTop = g * b;
|
|
@@ -269,7 +269,7 @@ const De = class De extends HTMLElement {
|
|
|
269
269
|
}, "#init"));
|
|
270
270
|
}
|
|
271
271
|
connectedCallback() {
|
|
272
|
-
p(this,
|
|
272
|
+
p(this, rt, this.getRootNode().host), p(this, ot, this.closest("nine-table-sheet")), this.innerHTML = `
|
|
273
273
|
<style>
|
|
274
274
|
nine-table-vscrollbar {
|
|
275
275
|
display: flex;
|
|
@@ -334,51 +334,51 @@ const De = class De extends HTMLElement {
|
|
|
334
334
|
<button class='ng-scroll-bottom' disabled><div class='ng-scroll-icon'></div></button>
|
|
335
335
|
`;
|
|
336
336
|
const e = /* @__PURE__ */ h(() => {
|
|
337
|
-
const
|
|
338
|
-
if (!
|
|
337
|
+
const n = t(this, ot).querySelector(".ng-container-body .ng-part-body");
|
|
338
|
+
if (!n) {
|
|
339
339
|
setTimeout(e, 10);
|
|
340
340
|
return;
|
|
341
341
|
}
|
|
342
342
|
p(this, C, {
|
|
343
|
-
container:
|
|
343
|
+
container: n,
|
|
344
344
|
track: this.querySelector(".ng-scroll-track"),
|
|
345
345
|
thumb: this.querySelector(".ng-scroll-thumb"),
|
|
346
346
|
top: this.querySelector(".ng-scroll-top"),
|
|
347
347
|
bottom: this.querySelector(".ng-scroll-bottom")
|
|
348
|
-
}), t(this,
|
|
348
|
+
}), t(this, Ut).call(this), this.refresh();
|
|
349
349
|
}, "initWhenReady");
|
|
350
350
|
e();
|
|
351
351
|
}
|
|
352
352
|
};
|
|
353
|
-
|
|
354
|
-
let
|
|
355
|
-
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar",
|
|
356
|
-
var
|
|
357
|
-
const
|
|
358
|
-
constructor(
|
|
359
|
-
d(this,
|
|
353
|
+
rt = new WeakMap(), ot = new WeakMap(), bt = new WeakMap(), C = new WeakMap(), Tt = new WeakMap(), Ct = new WeakMap(), Ut = new WeakMap(), h(Je, "NineTableVScrollBar");
|
|
354
|
+
let Ae = Je;
|
|
355
|
+
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar", Ae);
|
|
356
|
+
var j, S, it, P, D, G, at, kt, Be, Pe, Xt, Kt, Lt, It, Ht, Gt, Zt, Mt, Fe, pt, $t, Jt;
|
|
357
|
+
const Qe = class Qe {
|
|
358
|
+
constructor(s) {
|
|
359
|
+
d(this, j);
|
|
360
360
|
d(this, S);
|
|
361
|
-
d(this,
|
|
361
|
+
d(this, it);
|
|
362
362
|
d(this, P, /* @__PURE__ */ new Map());
|
|
363
|
-
d(this,
|
|
364
|
-
d(this,
|
|
365
|
-
d(this,
|
|
366
|
-
d(this,
|
|
367
|
-
d(this,
|
|
368
|
-
d(this,
|
|
363
|
+
d(this, D, null);
|
|
364
|
+
d(this, G, null);
|
|
365
|
+
d(this, at, 0);
|
|
366
|
+
d(this, kt, 40);
|
|
367
|
+
d(this, Be, !1);
|
|
368
|
+
d(this, Pe, !1);
|
|
369
369
|
//#ticking = false; // 🎯 고속 스크롤 스로틀링용 플래그
|
|
370
|
-
d(this,
|
|
371
|
-
|
|
370
|
+
d(this, Xt, 3);
|
|
371
|
+
E(this, "refresh", /* @__PURE__ */ h(() => {
|
|
372
372
|
var e;
|
|
373
|
-
|
|
374
|
-
const
|
|
375
|
-
|
|
373
|
+
R.log("rowManager.refresh");
|
|
374
|
+
const s = t(this, S).querySelector(".ng-container-body .ng-part-body");
|
|
375
|
+
s && (t(this, Lt).call(this), t(this, It).call(this), t(this, pt).call(this, s.scrollTop), (e = t(this, S).querySelector("nine-table-vscrollbar")) == null || e.refresh());
|
|
376
376
|
}, "refresh"));
|
|
377
|
-
|
|
378
|
-
|
|
377
|
+
E(this, "initialize", /* @__PURE__ */ h(() => {
|
|
378
|
+
R.log("rowManager.initialize"), p(this, it, {
|
|
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
|
-
}), p(this,
|
|
381
|
+
}), p(this, D, null), t(this, P).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((i) => {
|
|
382
382
|
const a = t(this, S).querySelector(i);
|
|
383
383
|
if (!a) return;
|
|
384
384
|
const c = a.querySelector(".ng-part-body table");
|
|
@@ -388,56 +388,56 @@ const Pe = class Pe {
|
|
|
388
388
|
const u = Array.from(l.querySelectorAll("tr")).map((b) => b.cloneNode(!0));
|
|
389
389
|
t(this, P).set(i, u);
|
|
390
390
|
});
|
|
391
|
-
const
|
|
392
|
-
if (
|
|
393
|
-
t(this,
|
|
391
|
+
const s = t(this, S).querySelector(".ng-container-body .ng-part-body"), e = t(this, S).querySelector(".ng-container-left .ng-part-body"), n = t(this, S).querySelector(".ng-container-right .ng-part-body"), r = t(this, S).querySelector(".ng-container-body .ng-part-header"), o = t(this, S).querySelector(".ng-container-body .ng-part-footer");
|
|
392
|
+
if (s) {
|
|
393
|
+
t(this, Lt).call(this), t(this, Mt).call(this), t(this, It).call(this), t(this, pt).call(this, s.scrollTop);
|
|
394
394
|
let i = !1;
|
|
395
395
|
const a = /* @__PURE__ */ h((c) => {
|
|
396
396
|
var u;
|
|
397
397
|
if (i) return;
|
|
398
398
|
i = !0;
|
|
399
399
|
const l = c.scrollTop, f = c.scrollLeft;
|
|
400
|
-
|
|
400
|
+
s && s.scrollTop !== l && (s.scrollTop = l), e && e.scrollTop !== l && (e.scrollTop = l), n && n.scrollTop !== l && (n.scrollTop = l), r && r.scrollLeft !== f && (r.scrollLeft = f), o && o.scrollLeft !== f && (o.scrollLeft = f), t(this, pt).call(this, l), (u = t(this, S).querySelector("nine-table-vscrollbar")) == null || u.refresh(), i = !1;
|
|
401
401
|
}, "handleContainerScroll");
|
|
402
|
-
[
|
|
402
|
+
[s, e, n].forEach((c) => {
|
|
403
403
|
c == null || c.addEventListener("scroll", () => {
|
|
404
404
|
a(c);
|
|
405
405
|
});
|
|
406
406
|
});
|
|
407
407
|
}
|
|
408
408
|
}, "initialize"));
|
|
409
|
-
d(this,
|
|
410
|
-
|
|
411
|
-
const
|
|
412
|
-
if (!
|
|
413
|
-
const r =
|
|
409
|
+
d(this, Kt, /* @__PURE__ */ h((s, e) => {
|
|
410
|
+
R.log("rowManager.#renderRows");
|
|
411
|
+
const n = t(this, P).get(e);
|
|
412
|
+
if (!n || n.length === 0) return;
|
|
413
|
+
const r = s.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
414
414
|
if (!r) return;
|
|
415
415
|
r.querySelectorAll("tr:not(.nodata)").forEach((a) => a.remove());
|
|
416
416
|
const o = r.querySelector("tr.nodata"), i = document.createDocumentFragment();
|
|
417
|
-
for (let a = 0; a < t(this,
|
|
418
|
-
|
|
417
|
+
for (let a = 0; a < t(this, kt); a++)
|
|
418
|
+
n.forEach((c) => {
|
|
419
419
|
i.appendChild(c.cloneNode(!0));
|
|
420
420
|
});
|
|
421
|
-
o ? o.before(i) : r.appendChild(i), e === ".ng-container-body" && (t(this,
|
|
421
|
+
o ? o.before(i) : r.appendChild(i), e === ".ng-container-body" && (t(this, it).firstTr = r.querySelector("tr:not(.nodata)"));
|
|
422
422
|
}, "#renderRows"));
|
|
423
|
-
d(this,
|
|
424
|
-
if (t(this,
|
|
425
|
-
return t(this,
|
|
426
|
-
const
|
|
427
|
-
|
|
423
|
+
d(this, Lt, /* @__PURE__ */ h(() => {
|
|
424
|
+
if (t(this, D) !== null && t(this, D) > 0)
|
|
425
|
+
return t(this, D);
|
|
426
|
+
const s = t(this, S).querySelector(".ng-container-body .ng-part-body");
|
|
427
|
+
R.log("rowManager.#measureAndCacheHeight");
|
|
428
428
|
const e = t(this, P).get(".ng-container-body");
|
|
429
429
|
if (!e || e.length === 0) throw new Error("invalid dom");
|
|
430
|
-
const
|
|
431
|
-
if (
|
|
432
|
-
|
|
433
|
-
const r =
|
|
430
|
+
const n = s.querySelector("tbody.bindable-tbody");
|
|
431
|
+
if (R.log(n), !n) throw new Error("invalid dom");
|
|
432
|
+
n.querySelectorAll("tr:not(.nodata)").forEach((b) => b.remove());
|
|
433
|
+
const r = n.querySelector("tr.nodata"), o = document.createDocumentFragment();
|
|
434
434
|
e.forEach((b) => {
|
|
435
435
|
o.appendChild(b.cloneNode(!0));
|
|
436
|
-
}), r ? r.before(o) :
|
|
436
|
+
}), r ? r.before(o) : n.appendChild(o);
|
|
437
437
|
const i = t(this, S), a = i.style.display, c = i.style.visibility, l = i.style.position;
|
|
438
438
|
(a === "none" || window.getComputedStyle(i).display === "none") && (i.style.display = "block", i.style.visibility = "hidden", i.style.position = "absolute");
|
|
439
439
|
let f = 0;
|
|
440
|
-
const u =
|
|
440
|
+
const u = n.querySelectorAll("tr");
|
|
441
441
|
return u.forEach((b) => {
|
|
442
442
|
let g = b.offsetHeight || b.getBoundingClientRect().height;
|
|
443
443
|
if (g === 0) {
|
|
@@ -445,119 +445,119 @@ const Pe = class Pe {
|
|
|
445
445
|
g = parseFloat(y.height) || parseFloat(y.minHeight) || 0;
|
|
446
446
|
}
|
|
447
447
|
f += g;
|
|
448
|
-
}), u.forEach((b) => b.remove()), i.style.display = a, i.style.visibility = c, i.style.position = l, f <= 0 ? -1 : (p(this,
|
|
448
|
+
}), u.forEach((b) => b.remove()), i.style.display = a, i.style.visibility = c, i.style.position = l, f <= 0 ? -1 : (p(this, D, f), t(this, Ht).call(this), t(this, D));
|
|
449
449
|
}, "#measureAndCacheHeight"));
|
|
450
|
-
d(this,
|
|
451
|
-
|
|
452
|
-
const e = (t(this,
|
|
453
|
-
|
|
450
|
+
d(this, It, /* @__PURE__ */ h(() => {
|
|
451
|
+
R.log("rowManager.#updateVirtualScrollHeight");
|
|
452
|
+
const e = (t(this, j).data.get() || []).length, n = t(this, D), r = e * n;
|
|
453
|
+
R.log("🔍 [VirtualHeight]", { totalCount: e, rowHeight: n, totalVirtualHeight: r }), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((o) => {
|
|
454
454
|
const i = t(this, S).querySelector(o);
|
|
455
455
|
if (!i) return;
|
|
456
456
|
const a = i.querySelector(".ng-part-body .ng-virtual-spacer");
|
|
457
457
|
a && (a.style.height = `${r}px`);
|
|
458
458
|
});
|
|
459
459
|
}, "#updateVirtualScrollHeight"));
|
|
460
|
-
d(this,
|
|
461
|
-
if (t(this,
|
|
462
|
-
const
|
|
463
|
-
p(this,
|
|
460
|
+
d(this, Ht, /* @__PURE__ */ h(() => {
|
|
461
|
+
if (t(this, at) > 0 && t(this, D) > 0) {
|
|
462
|
+
const s = Math.ceil(t(this, at) / t(this, D));
|
|
463
|
+
p(this, kt, s + t(this, Xt));
|
|
464
464
|
}
|
|
465
465
|
}, "#updateRowCount"));
|
|
466
|
-
d(this,
|
|
466
|
+
d(this, Gt, /* @__PURE__ */ h(() => {
|
|
467
467
|
var a, c, l, f, u, b;
|
|
468
|
-
const
|
|
468
|
+
const s = t(this, S).querySelector(".ng-container-left .ng-part-body table"), e = t(this, S).querySelector(".ng-container-body .ng-part-body table"), n = t(this, S).querySelector(".ng-container-right .ng-part-body table");
|
|
469
469
|
if (e) {
|
|
470
|
-
const g =
|
|
471
|
-
for (let m = 0; m <
|
|
472
|
-
const
|
|
470
|
+
const g = s ? Array.from(s.querySelectorAll("tbody tr")) : [], y = Array.from(e.querySelectorAll("tbody tr")), w = n ? Array.from(n.querySelectorAll("tbody tr")) : [], v = Math.max(g.length, y.length, w.length);
|
|
471
|
+
for (let m = 0; m < v; m++) {
|
|
472
|
+
const I = [
|
|
473
473
|
((a = g[m]) == null ? void 0 : a.getBoundingClientRect().height) || 0,
|
|
474
474
|
((c = y[m]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
|
|
475
|
-
((l =
|
|
476
|
-
], T = Math.max(...
|
|
477
|
-
T > 0 && (g[m] && (g[m].style.height = `${T}px`), y[m] && (y[m].style.height = `${T}px`),
|
|
475
|
+
((l = w[m]) == null ? void 0 : l.getBoundingClientRect().height) || 0
|
|
476
|
+
], T = Math.max(...I);
|
|
477
|
+
T > 0 && (g[m] && (g[m].style.height = `${T}px`), y[m] && (y[m].style.height = `${T}px`), w[m] && (w[m].style.height = `${T}px`));
|
|
478
478
|
}
|
|
479
479
|
}
|
|
480
480
|
const r = t(this, S).querySelector(".ng-container-left .ng-part-footer table"), o = t(this, S).querySelector(".ng-container-body .ng-part-footer table"), i = t(this, S).querySelector(".ng-container-right .ng-part-footer table");
|
|
481
481
|
if (o) {
|
|
482
|
-
const g = r ? Array.from(r.querySelectorAll("tfoot tr")) : [], y = Array.from(o.querySelectorAll("tfoot tr")),
|
|
483
|
-
for (let m = 0; m <
|
|
484
|
-
const
|
|
482
|
+
const g = r ? Array.from(r.querySelectorAll("tfoot tr")) : [], y = Array.from(o.querySelectorAll("tfoot tr")), w = i ? Array.from(i.querySelectorAll("tfoot tr")) : [], v = Math.max(g.length, y.length, w.length);
|
|
483
|
+
for (let m = 0; m < v; m++) {
|
|
484
|
+
const I = [
|
|
485
485
|
((f = g[m]) == null ? void 0 : f.getBoundingClientRect().height) || 0,
|
|
486
486
|
((u = y[m]) == null ? void 0 : u.getBoundingClientRect().height) || 0,
|
|
487
|
-
((b =
|
|
488
|
-
], T = Math.max(...
|
|
489
|
-
T > 0 && (g[m] && (g[m].style.height = `${T}px`), y[m] && (y[m].style.height = `${T}px`),
|
|
487
|
+
((b = w[m]) == null ? void 0 : b.getBoundingClientRect().height) || 0
|
|
488
|
+
], T = Math.max(...I);
|
|
489
|
+
T > 0 && (g[m] && (g[m].style.height = `${T}px`), y[m] && (y[m].style.height = `${T}px`), w[m] && (w[m].style.height = `${T}px`));
|
|
490
490
|
}
|
|
491
491
|
}
|
|
492
492
|
}, "#syncRowHeights"));
|
|
493
|
-
d(this,
|
|
494
|
-
!t(this, S) || !(t(this, S) instanceof HTMLElement) || (p(this,
|
|
495
|
-
for (const e of
|
|
496
|
-
const
|
|
497
|
-
if (!
|
|
493
|
+
d(this, Zt, /* @__PURE__ */ h(() => {
|
|
494
|
+
!t(this, S) || !(t(this, S) instanceof HTMLElement) || (p(this, G, new ResizeObserver((s) => {
|
|
495
|
+
for (const e of s) {
|
|
496
|
+
const n = e.target;
|
|
497
|
+
if (!n.classList.contains("active")) continue;
|
|
498
498
|
const r = e.contentRect.height;
|
|
499
499
|
if (r > 0) {
|
|
500
500
|
let o = 0;
|
|
501
|
-
const i =
|
|
501
|
+
const i = n.querySelector(".ng-part-header"), a = n.querySelector(".ng-part-footer");
|
|
502
502
|
i && (o += i.offsetHeight), a && (o += a.offsetHeight);
|
|
503
503
|
const c = Math.max(r - o, 100);
|
|
504
|
-
t(this,
|
|
504
|
+
t(this, at) !== c && (p(this, at, c), t(this, Ht).call(this), t(this, D) !== null && (t(this, Mt).call(this), this.refresh()));
|
|
505
505
|
}
|
|
506
506
|
}
|
|
507
|
-
})), t(this,
|
|
507
|
+
})), t(this, G).observe(t(this, S)));
|
|
508
508
|
}, "#initResizeObserver"));
|
|
509
|
-
d(this,
|
|
510
|
-
|
|
511
|
-
const e = t(this, S).querySelector(
|
|
512
|
-
e && e.querySelector(".ng-part-body tbody.bindable-tbody") && t(this,
|
|
513
|
-
}), t(this,
|
|
509
|
+
d(this, Mt, /* @__PURE__ */ h(() => {
|
|
510
|
+
R.log("rowManager.#renderAllContainers"), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((s) => {
|
|
511
|
+
const e = t(this, S).querySelector(s);
|
|
512
|
+
e && e.querySelector(".ng-part-body tbody.bindable-tbody") && t(this, Kt).call(this, e, s);
|
|
513
|
+
}), t(this, Jt).call(this), t(this, Gt).call(this);
|
|
514
514
|
}, "#renderAllContainers"));
|
|
515
|
-
d(this,
|
|
515
|
+
d(this, Fe, /* @__PURE__ */ h((s) => {
|
|
516
516
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((e) => {
|
|
517
517
|
var l;
|
|
518
|
-
const
|
|
519
|
-
if (!
|
|
520
|
-
const r =
|
|
518
|
+
const n = t(this, S).querySelector(e);
|
|
519
|
+
if (!n) return;
|
|
520
|
+
const r = n.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
521
521
|
if (!r) return;
|
|
522
|
-
const o = Array.from(r.querySelectorAll("tr:not(.nodata)")), i = ((l = t(this, P).get(e)) == null ? void 0 : l.length) || 1, c = (t(this,
|
|
522
|
+
const o = Array.from(r.querySelectorAll("tr:not(.nodata)")), i = ((l = t(this, P).get(e)) == null ? void 0 : l.length) || 1, c = (t(this, j).data.get() || []).length;
|
|
523
523
|
o.forEach((f, u) => {
|
|
524
|
-
const b =
|
|
524
|
+
const b = s + Math.floor(u / i);
|
|
525
525
|
if (b >= c) {
|
|
526
526
|
f.style.visibility = "hidden";
|
|
527
527
|
return;
|
|
528
528
|
}
|
|
529
|
-
const g = t(this,
|
|
530
|
-
f.style.display = "", t(this,
|
|
529
|
+
const g = t(this, j).data.get(b);
|
|
530
|
+
f.style.display = "", t(this, $t).call(this, f, g, b);
|
|
531
531
|
});
|
|
532
532
|
});
|
|
533
533
|
}, "#adjustBufferRows"));
|
|
534
|
-
d(this,
|
|
534
|
+
d(this, pt, /* @__PURE__ */ h((s) => {
|
|
535
535
|
var u, b;
|
|
536
|
-
const e = t(this,
|
|
536
|
+
const e = t(this, D);
|
|
537
537
|
if (!e || e <= 0) return;
|
|
538
|
-
const
|
|
539
|
-
if (
|
|
538
|
+
const n = t(this, j).data.length;
|
|
539
|
+
if (n === 0) return;
|
|
540
540
|
const r = ((u = t(this, P).get(".ng-container-body")) == null ? void 0 : u.length) || 1, o = t(this, S).querySelector(".ng-container-body .ng-part-body");
|
|
541
|
-
|
|
542
|
-
const i = Math.max(0,
|
|
541
|
+
R.log("bodyContainer.clientHeight", o.clientHeight);
|
|
542
|
+
const i = Math.max(0, n - Math.floor(o.clientHeight / e)), a = Math.min(i, Math.max(0, Math.floor(s / e)));
|
|
543
543
|
let c = Math.floor(a * e);
|
|
544
|
-
|
|
545
|
-
const l = t(this,
|
|
546
|
-
(b = t(this,
|
|
544
|
+
R.log(`📜 [Scroll Calc] maxStartIndex: ${i}, startIndex: ${a}, offsetY: ${c}`), a === i && R.log(`📜 [Scroll Inspect] scrollTop: ${s}, rowHeight: ${e}, maxStartIndex: ${i}, startIndex: ${a}, offsetY: ${c}`);
|
|
545
|
+
const l = t(this, it).firstTr, f = l && l.dataset.row !== void 0 ? parseInt(l.dataset.row, 10) : -1;
|
|
546
|
+
(b = t(this, it)) == null || b.scrollTables.forEach((g) => {
|
|
547
547
|
g.style.transform = `translate3d(0, ${c}px, 0)`;
|
|
548
|
-
}), f !== a && (
|
|
548
|
+
}), f !== a && (R.log(`🔄 [Row Bind Trigger] currentStartIndex(${f}) !== startIndex(${a})`), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((g) => {
|
|
549
549
|
const y = t(this, S).querySelector(g);
|
|
550
550
|
if (!y) return;
|
|
551
|
-
const
|
|
552
|
-
if (!
|
|
553
|
-
Array.from(
|
|
554
|
-
const T = a + Math.floor(
|
|
555
|
-
if (T >=
|
|
551
|
+
const w = y.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
552
|
+
if (!w) return;
|
|
553
|
+
Array.from(w.querySelectorAll("tr:not(.nodata)")).forEach((m, I) => {
|
|
554
|
+
const T = a + Math.floor(I / r);
|
|
555
|
+
if (T >= n) {
|
|
556
556
|
m.style.display = "none";
|
|
557
557
|
return;
|
|
558
558
|
}
|
|
559
|
-
const
|
|
560
|
-
m.style.display = "", t(this,
|
|
559
|
+
const H = t(this, j).data.get(T);
|
|
560
|
+
m.style.display = "", t(this, $t).call(this, m, H, T);
|
|
561
561
|
});
|
|
562
562
|
}));
|
|
563
563
|
}, "#handleScroll"));
|
|
@@ -575,19 +575,19 @@ const Pe = class Pe {
|
|
|
575
575
|
cell.dataset.row = dataIndex;
|
|
576
576
|
});
|
|
577
577
|
}; */
|
|
578
|
-
d(this,
|
|
579
|
-
|
|
580
|
-
r.dataset.row =
|
|
578
|
+
d(this, $t, /* @__PURE__ */ h((s, e, n) => {
|
|
579
|
+
s.dataset.row = n, s.data = e, Array.from(s.cells).forEach((r, o) => {
|
|
580
|
+
r.dataset.row = n;
|
|
581
581
|
const i = Array.from(r.children).find((a) => a.tagName.toLowerCase().startsWith("cell-") || typeof a.refresh == "function");
|
|
582
582
|
i && typeof i.refresh == "function" && i.refresh();
|
|
583
583
|
});
|
|
584
584
|
}, "#bindRowData"));
|
|
585
|
-
d(this,
|
|
585
|
+
d(this, Jt, /* @__PURE__ */ h(() => {
|
|
586
586
|
var c, l, f;
|
|
587
|
-
|
|
588
|
-
const
|
|
587
|
+
R.log("rowManager.#syncHeaderHeights");
|
|
588
|
+
const s = t(this, S).querySelector(".ng-container-left .ng-part-header table"), e = t(this, S).querySelector(".ng-container-body .ng-part-header table"), n = t(this, S).querySelector(".ng-container-right .ng-part-header table");
|
|
589
589
|
if (!e) return;
|
|
590
|
-
const r =
|
|
590
|
+
const r = s ? Array.from(s.querySelectorAll("tr")) : [], o = Array.from(e.querySelectorAll("tr")), i = n ? Array.from(n.querySelectorAll("tr")) : [], a = Math.max(r.length, o.length, i.length);
|
|
591
591
|
for (let u = 0; u < a; u++) {
|
|
592
592
|
const b = [
|
|
593
593
|
((c = r[u]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
|
|
@@ -597,43 +597,43 @@ const Pe = class Pe {
|
|
|
597
597
|
g > 0 && (r[u] && (r[u].style.height = `${g}px`), o[u] && (o[u].style.height = `${g}px`), i[u] && (i[u].style.height = `${g}px`));
|
|
598
598
|
}
|
|
599
599
|
}, "#syncHeaderHeights"));
|
|
600
|
-
|
|
601
|
-
t(this,
|
|
600
|
+
E(this, "destroy", /* @__PURE__ */ h(() => {
|
|
601
|
+
t(this, G) && (t(this, G).disconnect(), p(this, G, null));
|
|
602
602
|
}, "destroy"));
|
|
603
|
-
p(this,
|
|
603
|
+
p(this, j, s.getRootNode().host), p(this, S, s), t(this, Zt).call(this);
|
|
604
604
|
}
|
|
605
605
|
getRowHeight() {
|
|
606
|
-
return t(this,
|
|
606
|
+
return t(this, D);
|
|
607
607
|
}
|
|
608
|
-
templateLength(
|
|
608
|
+
templateLength(s = ".ng-container-body") {
|
|
609
609
|
var e;
|
|
610
|
-
return ((e = t(this, P).get(
|
|
610
|
+
return ((e = t(this, P).get(s)) == null ? void 0 : e.length) || 1;
|
|
611
611
|
}
|
|
612
612
|
};
|
|
613
|
-
|
|
614
|
-
let
|
|
615
|
-
const
|
|
613
|
+
j = new WeakMap(), S = new WeakMap(), it = new WeakMap(), P = new WeakMap(), D = new WeakMap(), G = new WeakMap(), at = new WeakMap(), kt = new WeakMap(), Be = new WeakMap(), Pe = new WeakMap(), Xt = new WeakMap(), Kt = new WeakMap(), Lt = new WeakMap(), It = new WeakMap(), Ht = new WeakMap(), Gt = new WeakMap(), Zt = new WeakMap(), Mt = new WeakMap(), Fe = new WeakMap(), pt = new WeakMap(), $t = new WeakMap(), Jt = new WeakMap(), h(Qe, "RowManager");
|
|
614
|
+
let Ee = Qe;
|
|
615
|
+
const Qt = class Qt {
|
|
616
616
|
/**
|
|
617
617
|
* 🎯 레이아웃 내의 여러 rawTables 배열을 일괄로 받아 단일 마스터 템플릿으로 사전 컴파일합니다.
|
|
618
618
|
*/
|
|
619
|
-
static compileAll(
|
|
620
|
-
return Array.isArray(
|
|
619
|
+
static compileAll(s) {
|
|
620
|
+
return Array.isArray(s) ? s.map((e) => Qt.compile(e)) : [];
|
|
621
621
|
}
|
|
622
622
|
/**
|
|
623
623
|
* 🎯 단일 원본 테이블을 받아 기본 구조 보정 및 2차원 격자 인덱스 사전 부여 완료된 마스터 테이블 반환
|
|
624
624
|
*/
|
|
625
|
-
static compile(
|
|
626
|
-
if (!
|
|
625
|
+
static compile(s) {
|
|
626
|
+
if (!s) return null;
|
|
627
627
|
const e = /* @__PURE__ */ h((a) => {
|
|
628
628
|
a.querySelectorAll("tbody td, tbody th, tfoot td, tfoot th").forEach((l) => {
|
|
629
629
|
const f = l.getAttribute("cell-type") || "renderer";
|
|
630
630
|
if (l.children.length > 0 && l.firstElementChild.tagName.includes("-")) return;
|
|
631
631
|
let u = `cell-${f}`;
|
|
632
|
-
const b = l.getAttribute("data-bind"), g = l.getAttribute("data-expr"), y = l.getAttribute("maxbyte"),
|
|
633
|
-
let
|
|
634
|
-
b &&
|
|
632
|
+
const b = l.getAttribute("data-bind"), g = l.getAttribute("data-expr"), y = l.getAttribute("maxbyte"), w = l.getAttribute("type");
|
|
633
|
+
let v = [];
|
|
634
|
+
b && v.push(`data-bind="${b}"`), g && v.push(`data-expr="${g}"`), y && v.push(`maxbyte="${y}"`), w && v.push(`type="${w}"`), l.innerHTML = `<${u} ${v.join(" ")}></${u}>`;
|
|
635
635
|
});
|
|
636
|
-
}, "processCellTypes"),
|
|
636
|
+
}, "processCellTypes"), n = /* @__PURE__ */ h((a) => {
|
|
637
637
|
if (!a.querySelector("colgroup")) {
|
|
638
638
|
const c = a.querySelector("tbody tr") || a.querySelector("tr"), l = c ? c.querySelectorAll("th, td").length : 1, f = document.createElement("colgroup"), u = Math.max(Math.floor(a.clientWidth / l), 100);
|
|
639
639
|
for (let b = 0; b < l; b++) {
|
|
@@ -656,31 +656,31 @@ const Kt = class Kt {
|
|
|
656
656
|
});
|
|
657
657
|
const g = Array.from(Array(u), () => Array(b).fill(null));
|
|
658
658
|
l.forEach((y) => {
|
|
659
|
-
const
|
|
660
|
-
let
|
|
659
|
+
const w = y.sectionRowIndex;
|
|
660
|
+
let v = 0;
|
|
661
661
|
Array.from(y.querySelectorAll("th,td")).forEach((m) => {
|
|
662
|
-
for (let
|
|
663
|
-
if (g[
|
|
664
|
-
|
|
662
|
+
for (let H = 0; H < g[w].length; H++)
|
|
663
|
+
if (g[w][H] === null) {
|
|
664
|
+
v = H;
|
|
665
665
|
break;
|
|
666
666
|
}
|
|
667
|
-
const
|
|
668
|
-
for (let
|
|
669
|
-
for (let
|
|
670
|
-
|
|
667
|
+
const I = m.rowSpan || 1, T = m.colSpan || 1;
|
|
668
|
+
for (let H = 0; H < I; H++)
|
|
669
|
+
for (let F = 0; F < T; F++)
|
|
670
|
+
w + H < u && v + F < b && (g[w + H][v + F] = H === 0 && F === 0 ? "1" : "0");
|
|
671
671
|
});
|
|
672
672
|
}), l.forEach((y) => {
|
|
673
|
-
const
|
|
674
|
-
Array.from(y.querySelectorAll("th,td")).forEach((
|
|
675
|
-
for (let m = 0; m < g[
|
|
676
|
-
if (g[
|
|
677
|
-
|
|
673
|
+
const w = y.sectionRowIndex;
|
|
674
|
+
Array.from(y.querySelectorAll("th,td")).forEach((v) => {
|
|
675
|
+
for (let m = 0; m < g[w].length; m++)
|
|
676
|
+
if (g[w][m] === "1") {
|
|
677
|
+
v.dataset.col = m, g[w][m] = "0";
|
|
678
678
|
break;
|
|
679
679
|
}
|
|
680
680
|
});
|
|
681
681
|
});
|
|
682
|
-
}, "resetColIndex"), o =
|
|
683
|
-
return
|
|
682
|
+
}, "resetColIndex"), o = s.cloneNode(!0);
|
|
683
|
+
return n(o), e(o), r(o, "thead"), r(o, "tbody"), r(o, "tfoot"), Array.from(o.querySelectorAll("colgroup col")).forEach((a, c) => {
|
|
684
684
|
const l = a.getAttribute("fixed");
|
|
685
685
|
l && o.querySelectorAll(`thead [data-col="${c}"], tbody [data-col="${c}"], tfoot [data-col="${c}"]`).forEach((f) => {
|
|
686
686
|
f.setAttribute("fixed", l);
|
|
@@ -689,54 +689,54 @@ const Kt = class Kt {
|
|
|
689
689
|
}
|
|
690
690
|
// 🎯 [추가] td/th에 선언된 cell-type 속성을 읽어 커스텀 태그로 자동 감싸기
|
|
691
691
|
};
|
|
692
|
-
h(
|
|
693
|
-
let
|
|
694
|
-
var
|
|
695
|
-
const
|
|
696
|
-
constructor(
|
|
697
|
-
d(this,
|
|
698
|
-
d(this,
|
|
699
|
-
d(this,
|
|
700
|
-
|
|
701
|
-
const { startRow:
|
|
702
|
-
|
|
703
|
-
const o = t(this,
|
|
692
|
+
h(Qt, "TableCompiler");
|
|
693
|
+
let qe = Qt;
|
|
694
|
+
var _, Y, U, At, ms;
|
|
695
|
+
const ts = class ts {
|
|
696
|
+
constructor(s) {
|
|
697
|
+
d(this, U);
|
|
698
|
+
d(this, _);
|
|
699
|
+
d(this, Y, { startRow: -1, startCol: -1, endRow: -1, endCol: -1 });
|
|
700
|
+
E(this, "render", /* @__PURE__ */ h(() => {
|
|
701
|
+
const { startRow: s, startCol: e, endRow: n, endCol: r } = t(this, Y);
|
|
702
|
+
R.log("🎨 [CellSelection.render] Rendering range ->", t(this, Y));
|
|
703
|
+
const o = t(this, _).querySelectorAll(
|
|
704
704
|
".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body"
|
|
705
705
|
);
|
|
706
706
|
if (o.forEach((a) => {
|
|
707
707
|
a.querySelectorAll(".selected, .selected-top, .selected-bottom, .selected-left, .selected-right").forEach((c) => {
|
|
708
708
|
c.classList.remove("selected", "selected-top", "selected-bottom", "selected-left", "selected-right");
|
|
709
709
|
});
|
|
710
|
-
}),
|
|
711
|
-
|
|
710
|
+
}), s < 0 || e < 0) {
|
|
711
|
+
R.log("⚠️ [CellSelection.render] Range is invalid (< 0), skipping render.");
|
|
712
712
|
return;
|
|
713
713
|
}
|
|
714
714
|
let i = 0;
|
|
715
715
|
o.forEach((a) => {
|
|
716
716
|
a.querySelectorAll("tbody tr").forEach((c) => {
|
|
717
717
|
if (c.classList.contains("nodata")) return;
|
|
718
|
-
const { matrixRow: l } =
|
|
718
|
+
const { matrixRow: l } = Q(this, U, At).call(this, c);
|
|
719
719
|
l < 0 || c.querySelectorAll("td, th").forEach((f) => {
|
|
720
720
|
const u = parseInt(f.dataset.col, 10);
|
|
721
721
|
if (isNaN(u)) return;
|
|
722
|
-
const b = parseInt(f.rowSpan || 1, 10), g = parseInt(f.colSpan || 1, 10), y = l + b - 1,
|
|
723
|
-
y >=
|
|
722
|
+
const b = parseInt(f.rowSpan || 1, 10), g = parseInt(f.colSpan || 1, 10), y = l + b - 1, w = u + g - 1;
|
|
723
|
+
y >= s && l <= n && w >= e && u <= r && (i++, f.classList.add("selected"), l <= s && f.classList.add("selected-top"), y >= n && f.classList.add("selected-bottom"), u <= e && f.classList.add("selected-left"), w >= r && f.classList.add("selected-right"));
|
|
724
724
|
});
|
|
725
725
|
});
|
|
726
|
-
}),
|
|
726
|
+
}), R.log(`✨ [CellSelection.render] Total rendered cells marked: ${i}`);
|
|
727
727
|
}, "render"));
|
|
728
|
-
p(this,
|
|
728
|
+
p(this, _, s), Q(this, U, ms).call(this), t(this, _).querySelectorAll(
|
|
729
729
|
".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body"
|
|
730
|
-
).forEach((
|
|
731
|
-
|
|
732
|
-
t(this,
|
|
730
|
+
).forEach((n) => {
|
|
731
|
+
n.addEventListener("scroll", () => {
|
|
732
|
+
t(this, Y).startRow >= 0 && t(this, Y).startCol >= 0 && this.render();
|
|
733
733
|
});
|
|
734
|
-
}),
|
|
734
|
+
}), R.log("🎯 [CellSelection] Initialized");
|
|
735
735
|
}
|
|
736
|
-
setRange(
|
|
737
|
-
|
|
738
|
-
let o = Math.min(
|
|
739
|
-
const l = t(this,
|
|
736
|
+
setRange(s, e, n, r) {
|
|
737
|
+
R.log(`🔍 [CellSelection.setRange] Input -> startRow: ${s}, startCol: ${e}, endRow: ${n}, endCol: ${r}`);
|
|
738
|
+
let o = Math.min(s, n), i = Math.max(s, n), a = Math.min(e, r), c = Math.max(e, r);
|
|
739
|
+
const l = t(this, _).querySelectorAll(
|
|
740
740
|
".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body"
|
|
741
741
|
);
|
|
742
742
|
let f = !0, u = 0;
|
|
@@ -744,109 +744,193 @@ const Fe = class Fe {
|
|
|
744
744
|
f = !1, u++, l.forEach((b) => {
|
|
745
745
|
b.querySelectorAll("tbody tr").forEach((g) => {
|
|
746
746
|
if (g.classList.contains("nodata")) return;
|
|
747
|
-
const { matrixRow: y } =
|
|
748
|
-
y < 0 || g.querySelectorAll("td, th").forEach((
|
|
749
|
-
const
|
|
750
|
-
if (isNaN(
|
|
751
|
-
const m = parseInt(
|
|
752
|
-
if (T >= o && y <= i &&
|
|
753
|
-
const
|
|
754
|
-
(
|
|
747
|
+
const { matrixRow: y } = Q(this, U, At).call(this, g);
|
|
748
|
+
y < 0 || g.querySelectorAll("td, th").forEach((w) => {
|
|
749
|
+
const v = parseInt(w.dataset.col, 10);
|
|
750
|
+
if (isNaN(v)) return;
|
|
751
|
+
const m = parseInt(w.rowSpan || 1, 10), I = parseInt(w.colSpan || 1, 10), T = y + m - 1, H = v + I - 1;
|
|
752
|
+
if (T >= o && y <= i && H >= a && v <= c) {
|
|
753
|
+
const X = Math.min(o, y), fs = Math.max(i, T), us = Math.min(a, v), gs = Math.max(c, H);
|
|
754
|
+
(X !== o || fs !== i || us !== a || gs !== c) && (o = X, i = fs, a = us, c = gs, f = !0);
|
|
755
755
|
}
|
|
756
756
|
});
|
|
757
757
|
});
|
|
758
758
|
});
|
|
759
|
-
p(this,
|
|
759
|
+
p(this, Y, { startRow: o, startCol: a, endRow: i, endCol: c }), R.log("📦 [CellSelection.setRange] Final Range ->", t(this, Y)), this.render();
|
|
760
760
|
}
|
|
761
761
|
};
|
|
762
|
-
|
|
763
|
-
if (!
|
|
764
|
-
const e = parseInt(
|
|
762
|
+
_ = new WeakMap(), Y = new WeakMap(), U = new WeakSet(), At = /* @__PURE__ */ h(function(s) {
|
|
763
|
+
if (!s || s.classList.contains("nodata")) return { dataRow: -1, subRowIndex: -1, matrixRow: -1 };
|
|
764
|
+
const e = parseInt(s.dataset.row, 10);
|
|
765
765
|
if (isNaN(e)) return { dataRow: -1, subRowIndex: -1, matrixRow: -1 };
|
|
766
|
-
const
|
|
766
|
+
const n = s.closest("tbody"), o = Array.from(n.querySelectorAll("tr:not(.nodata)")).filter((l) => parseInt(l.dataset.row, 10) === e), i = o.indexOf(s), a = o.length > 0 ? o.length : 1, c = e * a + (i >= 0 ? i : s.sectionRowIndex % a);
|
|
767
767
|
return { dataRow: e, subRowIndex: i, matrixRow: c };
|
|
768
|
-
}, "#getMatrixRow"),
|
|
769
|
-
const
|
|
770
|
-
if (!
|
|
771
|
-
|
|
768
|
+
}, "#getMatrixRow"), ms = /* @__PURE__ */ h(function() {
|
|
769
|
+
const s = t(this, _).querySelector(".ng-container-top");
|
|
770
|
+
if (!s) {
|
|
771
|
+
R.log("❌ [CellSelection] .ng-container-top not found!");
|
|
772
772
|
return;
|
|
773
773
|
}
|
|
774
|
-
|
|
774
|
+
s.addEventListener("mousedown", (e) => {
|
|
775
775
|
if (e.button !== 0) return;
|
|
776
|
-
const
|
|
777
|
-
if (!
|
|
778
|
-
t(this,
|
|
779
|
-
const r =
|
|
776
|
+
const n = e.target.closest("td, th");
|
|
777
|
+
if (!n || n.dataset.row === void 0 || n.dataset.col === void 0 || n.closest("tr").classList.contains("nodata")) return;
|
|
778
|
+
t(this, _).style.userSelect = "none", t(this, _).style.webkitUserSelect = "none";
|
|
779
|
+
const r = n.closest("tr"), { matrixRow: o } = Q(this, U, At).call(this, r), i = parseInt(n.dataset.col, 10);
|
|
780
780
|
if (o < 0) {
|
|
781
|
-
t(this,
|
|
781
|
+
t(this, _).style.userSelect = "", t(this, _).style.webkitUserSelect = "";
|
|
782
782
|
return;
|
|
783
783
|
}
|
|
784
|
-
|
|
784
|
+
R.log(`🖱️ [MouseDown Success] startRow: ${o}, startCol: ${i}`), this.setRange(o, i, o, i);
|
|
785
785
|
const a = /* @__PURE__ */ h((l) => {
|
|
786
786
|
const f = document.elementFromPoint(l.clientX, l.clientY);
|
|
787
787
|
let u = f == null ? void 0 : f.closest("td, th");
|
|
788
|
-
if (!u || !t(this,
|
|
789
|
-
const
|
|
790
|
-
for (const
|
|
791
|
-
const m =
|
|
788
|
+
if (!u || !t(this, _).contains(u)) {
|
|
789
|
+
const w = t(this, _).querySelectorAll(".ng-part-body tbody tr:not(.nodata) td, .ng-part-body tbody tr:not(.nodata) th");
|
|
790
|
+
for (const v of w) {
|
|
791
|
+
const m = v.getBoundingClientRect();
|
|
792
792
|
if (l.clientX >= m.left && l.clientX <= m.right && l.clientY >= m.top && l.clientY <= m.bottom) {
|
|
793
|
-
u =
|
|
793
|
+
u = v;
|
|
794
794
|
break;
|
|
795
795
|
}
|
|
796
796
|
}
|
|
797
797
|
}
|
|
798
798
|
if (!u || u.dataset.row === void 0 || u.dataset.col === void 0 || u.closest("tr").classList.contains("nodata")) return;
|
|
799
|
-
const b = u.closest("tr"), { matrixRow: g } =
|
|
799
|
+
const b = u.closest("tr"), { matrixRow: g } = Q(this, U, At).call(this, b), y = parseInt(u.dataset.col, 10);
|
|
800
800
|
g < 0 || this.setRange(o, i, g, y);
|
|
801
801
|
}, "onMouseMove"), c = /* @__PURE__ */ h(() => {
|
|
802
|
-
|
|
802
|
+
R.log("🖱️ [MouseUp] Drag ended."), t(this, _).style.userSelect = "", t(this, _).style.webkitUserSelect = "", document.removeEventListener("mousemove", a), document.removeEventListener("mouseup", c);
|
|
803
803
|
}, "onMouseUp");
|
|
804
804
|
document.addEventListener("mousemove", a), document.addEventListener("mouseup", c);
|
|
805
805
|
});
|
|
806
|
-
}, "#initEvents"), h(
|
|
807
|
-
let
|
|
808
|
-
var
|
|
809
|
-
const
|
|
806
|
+
}, "#initEvents"), h(ts, "CellSelection");
|
|
807
|
+
let Te = ts;
|
|
808
|
+
var V, lt, te, ee, se, xs;
|
|
809
|
+
const es = class es {
|
|
810
|
+
constructor(s) {
|
|
811
|
+
d(this, se);
|
|
812
|
+
d(this, V);
|
|
813
|
+
d(this, lt, null);
|
|
814
|
+
d(this, te, -1);
|
|
815
|
+
d(this, ee, -1);
|
|
816
|
+
p(this, V, s), Q(this, se, xs).call(this), R.log("🎯 [CellNavigation] Initialized");
|
|
817
|
+
}
|
|
818
|
+
get currentCell() {
|
|
819
|
+
return t(this, lt);
|
|
820
|
+
}
|
|
821
|
+
set currentCell(s) {
|
|
822
|
+
if (!s) return;
|
|
823
|
+
p(this, lt, s), s.focus();
|
|
824
|
+
const e = parseInt(s.dataset.row, 10), n = parseInt(s.dataset.col, 10);
|
|
825
|
+
if (!isNaN(e) && !isNaN(n)) {
|
|
826
|
+
p(this, te, e), p(this, ee, n);
|
|
827
|
+
const r = s.closest("tr"), o = r == null ? void 0 : r.closest("tbody");
|
|
828
|
+
if (o) {
|
|
829
|
+
const a = Array.from(o.querySelectorAll("tr:not(.nodata)")).filter((u) => parseInt(u.dataset.row, 10) === e), c = a.length > 0 ? a.length : 1, l = a.indexOf(r), f = e * c + (l >= 0 ? l : 0);
|
|
830
|
+
t(this, V).selection.setRange(f, n, f, n);
|
|
831
|
+
}
|
|
832
|
+
}
|
|
833
|
+
}
|
|
834
|
+
moveCell(s) {
|
|
835
|
+
var I, T, H, F;
|
|
836
|
+
if (!t(this, lt)) return;
|
|
837
|
+
const e = t(this, lt), n = e.closest("tr"), r = parseInt(e.dataset.row, 10), o = parseInt(e.dataset.col, 10), i = n == null ? void 0 : n.closest("tbody"), c = Array.from(i.querySelectorAll("tr:not(.nodata)")).filter((X) => parseInt(X.dataset.row, 10) === r), l = c.length > 0 ? c.length : 1, f = c.indexOf(n);
|
|
838
|
+
let u = r, b = f, g = o;
|
|
839
|
+
switch (s.code) {
|
|
840
|
+
case "Tab":
|
|
841
|
+
s.preventDefault(), g = s.shiftKey ? o - 1 : o + 1;
|
|
842
|
+
break;
|
|
843
|
+
case "ArrowRight":
|
|
844
|
+
g = o + 1;
|
|
845
|
+
break;
|
|
846
|
+
case "ArrowLeft":
|
|
847
|
+
g = o - 1;
|
|
848
|
+
break;
|
|
849
|
+
case "ArrowDown":
|
|
850
|
+
s.preventDefault(), f < l - 1 ? b = f + 1 : (u = r + 1, b = 0);
|
|
851
|
+
break;
|
|
852
|
+
case "ArrowUp":
|
|
853
|
+
s.preventDefault(), f > 0 ? b = f - 1 : (u = r - 1, b = l - 1);
|
|
854
|
+
break;
|
|
855
|
+
}
|
|
856
|
+
let y = null;
|
|
857
|
+
const m = Array.from(i.querySelectorAll("tr:not(.nodata)")).filter((X) => parseInt(X.dataset.row, 10) === u)[b];
|
|
858
|
+
if (m && (y = m.querySelector(`[data-col="${g}"]`)), y)
|
|
859
|
+
this.currentCell = y;
|
|
860
|
+
else if (u !== r && u >= 0) {
|
|
861
|
+
const X = ((T = (I = t(this, V)).getRowHeight) == null ? void 0 : T.call(I)) || 40;
|
|
862
|
+
(F = (H = t(this, V)).scrollToY) == null || F.call(H, u * X);
|
|
863
|
+
}
|
|
864
|
+
}
|
|
865
|
+
};
|
|
866
|
+
V = new WeakMap(), lt = new WeakMap(), te = new WeakMap(), ee = new WeakMap(), se = new WeakSet(), xs = /* @__PURE__ */ h(function() {
|
|
867
|
+
t(this, V).addEventListener("mousedown", (s) => {
|
|
868
|
+
const e = s.target.closest("td, th");
|
|
869
|
+
!e || e.dataset.row === void 0 || e.dataset.col === void 0 || e.closest("tr").classList.contains("nodata") || (this.currentCell = e);
|
|
870
|
+
}), t(this, V).addEventListener("keydown", (s) => {
|
|
871
|
+
["Tab", "ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"].includes(s.code) && this.moveCell(s);
|
|
872
|
+
});
|
|
873
|
+
}, "#initEvents"), h(es, "CellNavigation");
|
|
874
|
+
let Ce = es;
|
|
875
|
+
var ne, _t, Nt;
|
|
876
|
+
const ss = class ss {
|
|
877
|
+
constructor(s) {
|
|
878
|
+
d(this, ne);
|
|
879
|
+
d(this, _t);
|
|
880
|
+
d(this, Nt);
|
|
881
|
+
p(this, ne, s), p(this, _t, new Te(s)), p(this, Nt, new Ce(s)), R.log("🎯 [CellManager] Master Initialized");
|
|
882
|
+
}
|
|
883
|
+
get selection() {
|
|
884
|
+
return t(this, _t);
|
|
885
|
+
}
|
|
886
|
+
get navigation() {
|
|
887
|
+
return t(this, Nt);
|
|
888
|
+
}
|
|
889
|
+
};
|
|
890
|
+
ne = new WeakMap(), _t = new WeakMap(), Nt = new WeakMap(), h(ss, "CellManager");
|
|
891
|
+
let ke = ss;
|
|
892
|
+
var re, ct, ht, oe, ie, ae, yt, le, ce;
|
|
893
|
+
const Et = class Et extends HTMLElement {
|
|
810
894
|
constructor() {
|
|
811
895
|
super();
|
|
812
|
-
d(this,
|
|
813
|
-
d(this,
|
|
814
|
-
d(this,
|
|
815
|
-
d(this,
|
|
816
|
-
|
|
817
|
-
|
|
896
|
+
d(this, re);
|
|
897
|
+
d(this, ct, null);
|
|
898
|
+
d(this, ht);
|
|
899
|
+
d(this, oe);
|
|
900
|
+
E(this, "invalidate", /* @__PURE__ */ h(() => {
|
|
901
|
+
R.log("sheet.invalidate()"), t(this, ht).refresh();
|
|
818
902
|
}, "invalidate"));
|
|
819
|
-
|
|
820
|
-
if (
|
|
821
|
-
p(this,
|
|
822
|
-
const
|
|
823
|
-
|
|
903
|
+
E(this, "generate", /* @__PURE__ */ h((e) => {
|
|
904
|
+
if (R.log("sheet.generate()"), !e) return;
|
|
905
|
+
p(this, ct, qe.compile(e)), t(this, ie).call(this), t(this, ae).call(this);
|
|
906
|
+
const n = this.querySelector(".ng-container-body .ng-part-header"), r = this.querySelector(".ng-container-body .ng-part-footer"), o = this.querySelector(".ng-nodata-overlay");
|
|
907
|
+
n && o && (o.style.top = `${n.offsetHeight}px`), r && o && (o.style.bottom = `${r.offsetHeight}px`), t(this, ht).initialize(), setTimeout(() => {
|
|
824
908
|
var i;
|
|
825
909
|
(i = this.querySelector("nine-table-hscrollbar")) == null || i.refresh();
|
|
826
910
|
}, 0);
|
|
827
911
|
}, "generate"));
|
|
828
|
-
d(this,
|
|
912
|
+
d(this, ie, /* @__PURE__ */ h(() => {
|
|
829
913
|
[
|
|
830
914
|
{ selector: ".ng-container-body", type: null },
|
|
831
915
|
{ selector: ".ng-container-left", type: "left" },
|
|
832
916
|
{ selector: ".ng-container-right", type: "right" }
|
|
833
|
-
].forEach(({ selector:
|
|
917
|
+
].forEach(({ selector: n, type: r }) => {
|
|
834
918
|
var o, i, a;
|
|
835
|
-
(o = this.querySelector(`${
|
|
919
|
+
(o = this.querySelector(`${n} .ng-part-header`)) == null || o.appendChild(t(this, yt).call(this, t(this, ct), r, "header")), (i = this.querySelector(`${n} .ng-virtual-spacer`)) == null || i.before(t(this, yt).call(this, t(this, ct), r, "body")), (a = this.querySelector(`${n} .ng-part-footer`)) == null || a.appendChild(t(this, yt).call(this, t(this, ct), r, "footer"));
|
|
836
920
|
});
|
|
837
921
|
}, "#renderSplitContainers"));
|
|
838
|
-
d(this,
|
|
922
|
+
d(this, ae, /* @__PURE__ */ h(() => {
|
|
839
923
|
["left", "right", "body"].forEach((e) => {
|
|
840
|
-
const
|
|
841
|
-
if (!
|
|
924
|
+
const n = this.querySelector(`.ng-container-${e}`), r = n == null ? void 0 : n.querySelectorAll("table");
|
|
925
|
+
if (!n || !r || r.length === 0) return;
|
|
842
926
|
let o = 0;
|
|
843
927
|
r[0].querySelectorAll("col").forEach((i) => {
|
|
844
928
|
const a = parseInt(i.getAttribute("width"), 10);
|
|
845
929
|
isNaN(o) || (o += a);
|
|
846
|
-
}), e === "body" ?
|
|
930
|
+
}), e === "body" ? n.style.flex = "1" : (n.style.flex = `0 0 ${o}px`, n.style.width = `${o}px`);
|
|
847
931
|
});
|
|
848
932
|
}, "#updateContainerWidths"));
|
|
849
|
-
d(this,
|
|
933
|
+
d(this, yt, /* @__PURE__ */ h((e, n, r) => {
|
|
850
934
|
const o = e.cloneNode(!0), i = o.querySelector("thead"), a = o.querySelector("tbody"), c = o.querySelector("tfoot");
|
|
851
935
|
if (r === "header") {
|
|
852
936
|
if (a && a.remove(), c && c.remove(), e.querySelector("tbody")) {
|
|
@@ -854,28 +938,28 @@ const St = class St extends HTMLElement {
|
|
|
854
938
|
f.className = "fixed-tbody", o.appendChild(f);
|
|
855
939
|
}
|
|
856
940
|
} else r === "body" ? (i && i.remove(), c && c.remove(), a && (a.className = "bindable-tbody")) : r === "footer" && (i && i.remove(), a && a.remove());
|
|
857
|
-
return
|
|
941
|
+
return n === "left" ? o.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((l) => {
|
|
858
942
|
l.getAttribute("fixed") !== "left" && l.remove();
|
|
859
|
-
}) :
|
|
943
|
+
}) : n === "right" ? o.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((l) => {
|
|
860
944
|
l.getAttribute("fixed") !== "right" && l.remove();
|
|
861
945
|
}) : o.querySelectorAll("[fixed=left], [fixed=right]").forEach((l) => {
|
|
862
946
|
l.remove();
|
|
863
947
|
}), o;
|
|
864
948
|
}, "#createSplitTable"));
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
const
|
|
868
|
-
|
|
949
|
+
E(this, "getRowHeight", /* @__PURE__ */ h(() => t(this, ht).getRowHeight(), "getRowHeight"));
|
|
950
|
+
E(this, "scrollToX", /* @__PURE__ */ h((e) => {
|
|
951
|
+
const n = this.querySelector(".ng-container-body .ng-part-body");
|
|
952
|
+
n && (n.scrollLeft = e);
|
|
869
953
|
}, "scrollToX"));
|
|
870
|
-
|
|
871
|
-
const
|
|
872
|
-
|
|
954
|
+
E(this, "scrollToY", /* @__PURE__ */ h((e) => {
|
|
955
|
+
const n = this.querySelector(".ng-container-body .ng-part-body");
|
|
956
|
+
n && (n.scrollTop = e);
|
|
873
957
|
}, "scrollToY"));
|
|
874
|
-
d(this,
|
|
875
|
-
t(this,
|
|
958
|
+
d(this, le, /* @__PURE__ */ h(() => {
|
|
959
|
+
t(this, ce).call(this), p(this, oe, new ke(this));
|
|
876
960
|
}, "#init"));
|
|
877
|
-
d(this,
|
|
878
|
-
const e =
|
|
961
|
+
d(this, ce, /* @__PURE__ */ h(() => {
|
|
962
|
+
const e = Et.SCROLLBAR_SIZE;
|
|
879
963
|
this.innerHTML = `
|
|
880
964
|
<style>
|
|
881
965
|
nine-table-sheet {
|
|
@@ -1076,45 +1160,42 @@ const St = class St extends HTMLElement {
|
|
|
1076
1160
|
</div>
|
|
1077
1161
|
`;
|
|
1078
1162
|
}, "#render"));
|
|
1079
|
-
p(this,
|
|
1163
|
+
p(this, ht, new Ee(this)), p(this, re, this.getRootNode().host);
|
|
1080
1164
|
}
|
|
1081
1165
|
connectedCallback() {
|
|
1082
|
-
t(this,
|
|
1083
|
-
}
|
|
1084
|
-
get selection() {
|
|
1085
|
-
return t(this, It);
|
|
1166
|
+
t(this, le).call(this);
|
|
1086
1167
|
}
|
|
1087
1168
|
disconnectedCallback() {
|
|
1088
|
-
this.innerHTML = "",
|
|
1169
|
+
this.innerHTML = "", R.log("NineTableSheet destroyed.");
|
|
1089
1170
|
}
|
|
1090
1171
|
};
|
|
1091
|
-
|
|
1092
|
-
let
|
|
1093
|
-
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet",
|
|
1094
|
-
var
|
|
1095
|
-
const
|
|
1172
|
+
re = new WeakMap(), ct = new WeakMap(), ht = new WeakMap(), oe = new WeakMap(), ie = new WeakMap(), ae = new WeakMap(), yt = new WeakMap(), le = new WeakMap(), ce = new WeakMap(), h(Et, "NineTableSheet"), E(Et, "SCROLLBAR_SIZE", 16);
|
|
1173
|
+
let jt = Et;
|
|
1174
|
+
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", jt);
|
|
1175
|
+
var he, Dt;
|
|
1176
|
+
const ns = class ns extends HTMLElement {
|
|
1096
1177
|
constructor() {
|
|
1097
1178
|
super();
|
|
1098
|
-
d(this,
|
|
1179
|
+
d(this, he, /* @__PURE__ */ h(() => {
|
|
1099
1180
|
var e;
|
|
1100
|
-
(e = this.querySelector(".nine-tab-bar")) == null || e.addEventListener("click", (
|
|
1181
|
+
(e = this.querySelector(".nine-tab-bar")) == null || e.addEventListener("click", (n) => {
|
|
1101
1182
|
var i;
|
|
1102
|
-
const r =
|
|
1103
|
-
t(this,
|
|
1104
|
-
}), t(this,
|
|
1183
|
+
const r = n.ctrlKey || n.metaKey || n.shiftKey, o = parseInt((i = n.target.closest(".nine-tab-item")) == null ? void 0 : i.dataset.index, 10);
|
|
1184
|
+
t(this, Dt).call(this, o, r);
|
|
1185
|
+
}), t(this, Dt).call(this, 0, !1);
|
|
1105
1186
|
}, "#init"));
|
|
1106
|
-
d(this,
|
|
1187
|
+
d(this, Dt, /* @__PURE__ */ h((e, n = !1) => {
|
|
1107
1188
|
const r = /* @__PURE__ */ h(() => {
|
|
1108
1189
|
const f = Array.from(this.querySelectorAll("nine-table-sheet"));
|
|
1109
1190
|
Array.from(this.querySelectorAll("nine-splitter")).forEach((g) => g.style.setProperty("display", "none"));
|
|
1110
1191
|
const b = f.filter((g) => g.classList.contains("active"));
|
|
1111
1192
|
b.length < 2 || b.forEach((g) => {
|
|
1112
|
-
const y = parseInt(g.getAttribute("data-index"), 10),
|
|
1113
|
-
|
|
1193
|
+
const y = parseInt(g.getAttribute("data-index"), 10), w = this.querySelector(`nine-splitter[data-split-index="${y}"]`), v = f[y + 1];
|
|
1194
|
+
w && v && v.classList.contains("active") && w.style.setProperty("display", "flex");
|
|
1114
1195
|
});
|
|
1115
1196
|
}, "updateSplitters"), o = this.querySelector(".nine-tab-bar"), i = this.querySelector("nine-table-sheets-body"), a = o.querySelectorAll(".nine-tab-item"), c = i.querySelectorAll("nine-table-sheet");
|
|
1116
1197
|
if (!a[e]) return;
|
|
1117
|
-
if (!
|
|
1198
|
+
if (!n)
|
|
1118
1199
|
a.forEach((f, u) => {
|
|
1119
1200
|
f.classList.toggle("active", u === e);
|
|
1120
1201
|
}), c.forEach((f, u) => {
|
|
@@ -1136,42 +1217,42 @@ const je = class je extends HTMLElement {
|
|
|
1136
1217
|
}, "#switchSheet"));
|
|
1137
1218
|
}
|
|
1138
1219
|
connectedCallback() {
|
|
1139
|
-
t(this,
|
|
1220
|
+
t(this, he).call(this);
|
|
1140
1221
|
}
|
|
1141
1222
|
};
|
|
1142
|
-
|
|
1143
|
-
let
|
|
1144
|
-
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets",
|
|
1145
|
-
var
|
|
1146
|
-
const
|
|
1147
|
-
constructor(
|
|
1148
|
-
d(this,
|
|
1149
|
-
d(this,
|
|
1150
|
-
t(this,
|
|
1151
|
-
for (let e of
|
|
1152
|
-
t(this,
|
|
1153
|
-
}).observe(t(this,
|
|
1223
|
+
he = new WeakMap(), Dt = new WeakMap(), h(ns, "NineTableSheets");
|
|
1224
|
+
let Le = ns;
|
|
1225
|
+
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", Le);
|
|
1226
|
+
var N, de, Ot, fe;
|
|
1227
|
+
const rs = class rs {
|
|
1228
|
+
constructor(s) {
|
|
1229
|
+
d(this, N);
|
|
1230
|
+
d(this, de, /* @__PURE__ */ h(() => {
|
|
1231
|
+
t(this, fe).call(this), new ResizeObserver((s) => {
|
|
1232
|
+
for (let e of s)
|
|
1233
|
+
t(this, N).getAttribute("auto-height") === "true" && t(this, Ot).call(this);
|
|
1234
|
+
}).observe(t(this, N));
|
|
1154
1235
|
}, "#init"));
|
|
1155
|
-
d(this,
|
|
1236
|
+
d(this, Ot, /* @__PURE__ */ h(() => {
|
|
1156
1237
|
var c, l;
|
|
1157
|
-
const
|
|
1158
|
-
if (
|
|
1159
|
-
const e = parseInt(t(this,
|
|
1160
|
-
t(this,
|
|
1238
|
+
const s = Array.from(t(this, N).shadowRoot.querySelectorAll("nine-table-sheet.active"));
|
|
1239
|
+
if (s.length === 0) return;
|
|
1240
|
+
const e = parseInt(t(this, N).getAttribute("max-display-row"), 10) || 10, n = Math.max(...s.map((f) => f.getRowHeight())), r = (c = t(this, N).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : c.getBoundingClientRect().height, o = (l = t(this, N).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : l.getBoundingClientRect().height, i = jt.SCROLLBAR_SIZE, a = e * n + r + o + i;
|
|
1241
|
+
t(this, N).style.height = `${a}px`;
|
|
1161
1242
|
}, "#applyAutoHeight"));
|
|
1162
|
-
d(this,
|
|
1163
|
-
const e = Array.from(t(this,
|
|
1243
|
+
d(this, fe, /* @__PURE__ */ h(() => {
|
|
1244
|
+
const e = Array.from(t(this, N).children).filter((c) => c.tagName === "TABLE"), n = t(this, N).getAttribute("auto-height") === "true", r = e.length, o = e.map((c, l) => {
|
|
1164
1245
|
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>` : "";
|
|
1165
1246
|
return u + b;
|
|
1166
1247
|
}).join(""), i = e.map((c, l) => `<div class="nine-tab-item ${l === 0 ? "active" : ""}" data-index="${l}">Sheet ${l + 1}</div>`).join("");
|
|
1167
|
-
t(this,
|
|
1248
|
+
t(this, N).shadowRoot.innerHTML = `
|
|
1168
1249
|
<style>
|
|
1169
1250
|
:host {
|
|
1170
1251
|
display: flex;
|
|
1171
1252
|
flex-direction: column;
|
|
1172
1253
|
position: relative;
|
|
1173
1254
|
overflow: hidden;
|
|
1174
|
-
height: ${
|
|
1255
|
+
height: ${n ? "auto" : "100%"};
|
|
1175
1256
|
background: #fff;
|
|
1176
1257
|
}
|
|
1177
1258
|
|
|
@@ -1284,151 +1365,151 @@ const Ye = class Ye {
|
|
|
1284
1365
|
<nine-table-analysis></nine-table-analysis>
|
|
1285
1366
|
</nine-table-body>
|
|
1286
1367
|
<nine-table-footer></nine-table-footer>
|
|
1287
|
-
`, t(this,
|
|
1288
|
-
const a = t(this,
|
|
1368
|
+
`, t(this, N).shadowRoot.querySelector("nine-table-sheets").classList.add("nodata");
|
|
1369
|
+
const a = t(this, N).shadowRoot.querySelectorAll("nine-table-sheet");
|
|
1289
1370
|
a == null || a.forEach((c, l) => {
|
|
1290
1371
|
e[l] && setTimeout(() => {
|
|
1291
|
-
c.generate(e[l]),
|
|
1372
|
+
c.generate(e[l]), n && t(this, Ot).call(this);
|
|
1292
1373
|
});
|
|
1293
1374
|
});
|
|
1294
1375
|
}, "#render"));
|
|
1295
|
-
p(this,
|
|
1376
|
+
p(this, N, s), t(this, de).call(this);
|
|
1296
1377
|
}
|
|
1297
1378
|
};
|
|
1298
|
-
|
|
1299
|
-
let
|
|
1300
|
-
var
|
|
1301
|
-
const
|
|
1302
|
-
constructor(
|
|
1303
|
-
d(this,
|
|
1304
|
-
d(this,
|
|
1305
|
-
|
|
1306
|
-
p(this,
|
|
1379
|
+
N = new WeakMap(), de = new WeakMap(), Ot = new WeakMap(), fe = new WeakMap(), h(rs, "LayoutManager");
|
|
1380
|
+
let Ie = rs;
|
|
1381
|
+
var zt, mt;
|
|
1382
|
+
const os = class os {
|
|
1383
|
+
constructor(s) {
|
|
1384
|
+
d(this, zt);
|
|
1385
|
+
d(this, mt, -1);
|
|
1386
|
+
E(this, "count", /* @__PURE__ */ h(() => t(this, zt).rawRecords.length, "count"));
|
|
1387
|
+
p(this, zt, s);
|
|
1307
1388
|
}
|
|
1308
1389
|
get at() {
|
|
1309
|
-
return t(this,
|
|
1390
|
+
return t(this, mt);
|
|
1310
1391
|
}
|
|
1311
|
-
set at(
|
|
1312
|
-
p(this,
|
|
1392
|
+
set at(s) {
|
|
1393
|
+
p(this, mt, parseInt(s, 10)), body && !body.querySelector(`tbody.bindable tr[data-row="${t(this, mt)}"]`) && setTimeout(() => {
|
|
1313
1394
|
});
|
|
1314
1395
|
}
|
|
1315
1396
|
};
|
|
1316
|
-
|
|
1317
|
-
let
|
|
1318
|
-
var
|
|
1319
|
-
const
|
|
1320
|
-
constructor(
|
|
1321
|
-
d(this,
|
|
1397
|
+
zt = new WeakMap(), mt = new WeakMap(), h(os, "ngRow");
|
|
1398
|
+
let He = os;
|
|
1399
|
+
var O, k, z, xt, ue, Z, ge, dt, Wt, be, pe, wt;
|
|
1400
|
+
const W = class W {
|
|
1401
|
+
constructor(s, e) {
|
|
1402
|
+
d(this, O);
|
|
1322
1403
|
d(this, k);
|
|
1323
1404
|
d(this, z, []);
|
|
1324
|
-
d(this,
|
|
1325
|
-
d(this,
|
|
1326
|
-
d(this,
|
|
1327
|
-
d(this,
|
|
1328
|
-
p(this,
|
|
1329
|
-
const
|
|
1330
|
-
Array.from(
|
|
1331
|
-
var
|
|
1332
|
-
t(this,
|
|
1405
|
+
d(this, xt, []);
|
|
1406
|
+
d(this, ue, 0);
|
|
1407
|
+
d(this, Z, []);
|
|
1408
|
+
d(this, ge, /* @__PURE__ */ h(() => {
|
|
1409
|
+
p(this, Z, []);
|
|
1410
|
+
const s = t(this, O).template || [];
|
|
1411
|
+
Array.from(s).forEach((e) => {
|
|
1412
|
+
var n;
|
|
1413
|
+
t(this, Z).push(((n = e.getBoundingClientRect) == null ? void 0 : n.call(e).height) || 24);
|
|
1333
1414
|
}), (t(this, k).rawRecords || []).forEach((e) => {
|
|
1334
|
-
e.__ng || (e.__ng = t(this,
|
|
1415
|
+
e.__ng || (e.__ng = t(this, Wt).call(this)), e.__ng.height = t(this, Z).slice();
|
|
1335
1416
|
});
|
|
1336
1417
|
}, "#initialize"));
|
|
1337
|
-
d(this,
|
|
1338
|
-
const
|
|
1339
|
-
|
|
1418
|
+
d(this, dt, /* @__PURE__ */ h(() => {
|
|
1419
|
+
const s = t(this, O).shadowRoot.querySelector("nine-table-sheets");
|
|
1420
|
+
s == null || s.classList.toggle("nodata", this.length === 0), t(this, O).shadowRoot.querySelectorAll("nine-table-sheet").forEach((e) => {
|
|
1340
1421
|
e.invalidate();
|
|
1341
1422
|
});
|
|
1342
1423
|
}, "#invalidate"));
|
|
1343
|
-
|
|
1424
|
+
E(this, "get", /* @__PURE__ */ h((s, e) => {
|
|
1344
1425
|
var o;
|
|
1345
|
-
const
|
|
1346
|
-
if (!
|
|
1347
|
-
if (
|
|
1348
|
-
if (
|
|
1349
|
-
const r = typeof ((o = t(this,
|
|
1426
|
+
const n = this.getValidData();
|
|
1427
|
+
if (!n || n.length <= 0) return;
|
|
1428
|
+
if (s == null) return t(this, wt).call(this, n);
|
|
1429
|
+
if (s < 0 || s >= n.length) return null;
|
|
1430
|
+
const r = typeof ((o = t(this, O).fields) == null ? void 0 : o.get) == "function" ? t(this, O).fields.get() : [];
|
|
1350
1431
|
if (e != null) {
|
|
1351
1432
|
const i = r.indexOf(e);
|
|
1352
|
-
return i >= 0 ? s
|
|
1433
|
+
return i >= 0 ? n[s].v[i] : null;
|
|
1353
1434
|
}
|
|
1354
|
-
return t(this,
|
|
1435
|
+
return t(this, wt).call(this, n[s]);
|
|
1355
1436
|
}, "get"));
|
|
1356
|
-
|
|
1357
|
-
this.clear(), this.add(
|
|
1437
|
+
E(this, "set", /* @__PURE__ */ h((s) => {
|
|
1438
|
+
this.clear(), this.add(s, !1), t(this, dt).call(this);
|
|
1358
1439
|
}, "set"));
|
|
1359
|
-
d(this,
|
|
1360
|
-
rowState:
|
|
1440
|
+
d(this, Wt, /* @__PURE__ */ h(() => ({
|
|
1441
|
+
rowState: W.ROW_STATE.EMPTY,
|
|
1361
1442
|
deleted: !1,
|
|
1362
1443
|
filtered: !1,
|
|
1363
|
-
height: t(this,
|
|
1444
|
+
height: t(this, Z).slice(),
|
|
1364
1445
|
o: {},
|
|
1365
1446
|
c: {},
|
|
1366
|
-
_: [0, 0, 0, 0,
|
|
1447
|
+
_: [0, 0, 0, 0, W.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this, Z).slice(), -1, {}, {}]
|
|
1367
1448
|
}), "#getDefaultMeta"));
|
|
1368
|
-
|
|
1369
|
-
p(this, z, []), p(this,
|
|
1449
|
+
E(this, "reset", /* @__PURE__ */ h(() => {
|
|
1450
|
+
p(this, z, []), p(this, xt, []), t(this, dt).call(this);
|
|
1370
1451
|
}, "reset"));
|
|
1371
|
-
|
|
1372
|
-
var
|
|
1373
|
-
t(this, k).rawRecords = [], p(this, z, []), p(this,
|
|
1452
|
+
E(this, "clear", /* @__PURE__ */ h(() => {
|
|
1453
|
+
var s;
|
|
1454
|
+
t(this, k).rawRecords = [], p(this, z, []), p(this, xt, []), (s = t(this, k).viewRecords) != null && s.reset && t(this, k).viewRecords.reset();
|
|
1374
1455
|
}, "clear"));
|
|
1375
|
-
d(this,
|
|
1456
|
+
d(this, be, /* @__PURE__ */ h((s) => {
|
|
1376
1457
|
var r;
|
|
1377
|
-
Array.isArray(
|
|
1378
|
-
const e = typeof ((r = t(this,
|
|
1379
|
-
return
|
|
1458
|
+
Array.isArray(s) || (s = [s]);
|
|
1459
|
+
const e = typeof ((r = t(this, O).fields) == null ? void 0 : r.get) == "function" ? t(this, O).fields.get() : Object.keys(s[0] || {}), n = [];
|
|
1460
|
+
return s.forEach((o) => {
|
|
1380
1461
|
const i = { v: [] };
|
|
1381
1462
|
e.forEach((a) => {
|
|
1382
1463
|
i.v.push(o[a] !== void 0 && o[a] !== null ? o[a] : "");
|
|
1383
|
-
}),
|
|
1384
|
-
}),
|
|
1464
|
+
}), n.push(i);
|
|
1465
|
+
}), n;
|
|
1385
1466
|
}, "#json2Array"));
|
|
1386
|
-
d(this,
|
|
1387
|
-
e.__ng = t(this,
|
|
1388
|
-
}),
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
const
|
|
1392
|
-
t(this, k).rawRecords = t(this, k).rawRecords.concat(t(this,
|
|
1467
|
+
d(this, pe, /* @__PURE__ */ h((s) => (Array.isArray(s) || (s = [s]), s.forEach((e) => {
|
|
1468
|
+
e.__ng = t(this, Wt).call(this), e.__ng.rowid = this.nextId, e.__ng.rowState = W.ROW_STATE.INSERT, e.__ng._[0] = e.__ng.rowid;
|
|
1469
|
+
}), s), "#defaultInsert"));
|
|
1470
|
+
E(this, "add", /* @__PURE__ */ h((s, e = !0) => {
|
|
1471
|
+
s === void 0 && (s = {});
|
|
1472
|
+
const n = t(this, be).call(this, s);
|
|
1473
|
+
t(this, k).rawRecords = t(this, k).rawRecords.concat(t(this, pe).call(this, n)), this.resetRecords();
|
|
1393
1474
|
const r = this.count() - 1;
|
|
1394
|
-
return e ||
|
|
1475
|
+
return e || n.forEach((o, i) => {
|
|
1395
1476
|
const a = t(this, k).rawRecords[r - i];
|
|
1396
|
-
a && (a.__ng.rowState =
|
|
1397
|
-
}), t(this,
|
|
1477
|
+
a && (a.__ng.rowState = W.ROW_STATE.EMPTY);
|
|
1478
|
+
}), t(this, dt).call(this), r;
|
|
1398
1479
|
}, "add"));
|
|
1399
|
-
|
|
1480
|
+
E(this, "delete", /* @__PURE__ */ h((s) => {
|
|
1400
1481
|
let e = [];
|
|
1401
|
-
Array.isArray(
|
|
1402
|
-
if (t(this, z)[
|
|
1403
|
-
const r = t(this, z)[
|
|
1404
|
-
t(this, z)[
|
|
1405
|
-
o.__ng.rowid === r && (o.__ng.deleted = !0, o.__ng.rowState =
|
|
1482
|
+
Array.isArray(s) ? e = s : typeof s > "u" ? e = [t(this, k).host.row.at] : e = [parseInt(s, 10)], e.sort((n, r) => r - n).forEach((n) => {
|
|
1483
|
+
if (t(this, z)[n]) {
|
|
1484
|
+
const r = t(this, z)[n].__ng.rowid;
|
|
1485
|
+
t(this, z)[n].__ng.rowState === W.ROW_STATE.INSERT ? t(this, k).rawRecords = t(this, k).rawRecords.filter((o) => o.__ng.rowid !== r) : t(this, k).rawRecords.forEach((o) => {
|
|
1486
|
+
o.__ng.rowid === r && (o.__ng.deleted = !0, o.__ng.rowState = W.ROW_STATE.DELETE);
|
|
1406
1487
|
});
|
|
1407
1488
|
}
|
|
1408
|
-
}), this.resetRecords(), t(this,
|
|
1489
|
+
}), this.resetRecords(), t(this, dt).call(this);
|
|
1409
1490
|
}, "delete"));
|
|
1410
|
-
|
|
1491
|
+
E(this, "setValue", /* @__PURE__ */ h((s, e, n) => {
|
|
1411
1492
|
var c;
|
|
1412
|
-
|
|
1413
|
-
const o = (typeof ((c = t(this,
|
|
1493
|
+
s = parseInt(s, 10);
|
|
1494
|
+
const o = (typeof ((c = t(this, O).fields) == null ? void 0 : c.get) == "function" ? t(this, O).fields.get() : []).indexOf(e);
|
|
1414
1495
|
if (o < 0) return;
|
|
1415
|
-
const i = this.getValidData()[
|
|
1496
|
+
const i = this.getValidData()[s];
|
|
1416
1497
|
if (!i) return;
|
|
1417
1498
|
const a = i.v[o];
|
|
1418
|
-
a !==
|
|
1499
|
+
a !== n && i.__ng.rowState !== W.ROW_STATE.INSERT && (i.__ng.o.hasOwnProperty(e) || (i.__ng.o[e] = a), i.__ng.rowState = W.ROW_STATE.UPDATE), i.v[o] = n;
|
|
1419
1500
|
}, "setValue"));
|
|
1420
|
-
|
|
1421
|
-
p(this,
|
|
1422
|
-
|
|
1423
|
-
}), t(this, z).forEach((
|
|
1424
|
-
|
|
1501
|
+
E(this, "resetRecords", /* @__PURE__ */ h(() => {
|
|
1502
|
+
p(this, xt, t(this, k).rawRecords.filter((s) => !s.__ng.deleted)), p(this, z, t(this, k).rawRecords.filter((s) => !s.__ng.deleted && !s.__ng.filtered)), t(this, k).rawRecords.forEach((s, e) => {
|
|
1503
|
+
s.__ng.rowidx = e;
|
|
1504
|
+
}), t(this, z).forEach((s, e) => {
|
|
1505
|
+
s.__ng.i = e;
|
|
1425
1506
|
});
|
|
1426
1507
|
}, "resetRecords"));
|
|
1427
|
-
|
|
1428
|
-
d(this,
|
|
1508
|
+
E(this, "getValidData", /* @__PURE__ */ h(() => (t(this, z).length === 0 && t(this, k).rawRecords.length > 0 && this.resetRecords(), t(this, z)), "getValidData"));
|
|
1509
|
+
d(this, wt, /* @__PURE__ */ h((s) => {
|
|
1429
1510
|
var i;
|
|
1430
|
-
if (!
|
|
1431
|
-
const e = !Array.isArray(
|
|
1511
|
+
if (!s) return s;
|
|
1512
|
+
const e = !Array.isArray(s), n = e ? [s] : s, r = typeof ((i = t(this, O).fields) == null ? void 0 : i.get) == "function" ? t(this, O).fields.get() : [], o = n.filter((a) => !a.__ng.deleted).map((a) => {
|
|
1432
1513
|
const c = {};
|
|
1433
1514
|
return r.forEach((l, f) => {
|
|
1434
1515
|
c[l] = a.v ? a.v[f] : a[l];
|
|
@@ -1436,17 +1517,17 @@ const B = class B {
|
|
|
1436
1517
|
});
|
|
1437
1518
|
return e ? o[0] : o;
|
|
1438
1519
|
}, "#conv"));
|
|
1439
|
-
|
|
1440
|
-
p(this,
|
|
1520
|
+
E(this, "count", /* @__PURE__ */ h(() => this.getValidData().length, "count"));
|
|
1521
|
+
p(this, O, s), p(this, k, e), t(this, ge).call(this);
|
|
1441
1522
|
}
|
|
1442
1523
|
get source() {
|
|
1443
|
-
return t(this,
|
|
1524
|
+
return t(this, wt).call(this, t(this, k).rawRecords);
|
|
1444
1525
|
}
|
|
1445
|
-
set source(
|
|
1446
|
-
this.clear(), this.add(
|
|
1526
|
+
set source(s) {
|
|
1527
|
+
this.clear(), this.add(s, !1);
|
|
1447
1528
|
}
|
|
1448
1529
|
get nextId() {
|
|
1449
|
-
return ++
|
|
1530
|
+
return ++ys(this, ue)._;
|
|
1450
1531
|
}
|
|
1451
1532
|
get count() {
|
|
1452
1533
|
return t(this, z).length;
|
|
@@ -1458,66 +1539,66 @@ const B = class B {
|
|
|
1458
1539
|
return this.length;
|
|
1459
1540
|
}
|
|
1460
1541
|
};
|
|
1461
|
-
|
|
1462
|
-
|
|
1542
|
+
O = new WeakMap(), k = new WeakMap(), z = new WeakMap(), xt = new WeakMap(), ue = new WeakMap(), Z = new WeakMap(), ge = new WeakMap(), dt = new WeakMap(), Wt = new WeakMap(), be = new WeakMap(), pe = new WeakMap(), wt = new WeakMap(), h(W, "ngData"), // 🎯 행 상태 정의 상수를 클래스 내부로 내재화
|
|
1543
|
+
E(W, "ROW_STATE", {
|
|
1463
1544
|
EMPTY: "EMPTY",
|
|
1464
1545
|
NORMAL: "NORMAL",
|
|
1465
1546
|
INSERT: "INSERT",
|
|
1466
1547
|
UPDATE: "UPDATE",
|
|
1467
1548
|
DELETE: "DELETE"
|
|
1468
1549
|
});
|
|
1469
|
-
let
|
|
1470
|
-
var
|
|
1471
|
-
const
|
|
1472
|
-
constructor(
|
|
1473
|
-
d(this,
|
|
1474
|
-
p(this,
|
|
1550
|
+
let Me = W;
|
|
1551
|
+
var ft;
|
|
1552
|
+
const is = class is {
|
|
1553
|
+
constructor(s) {
|
|
1554
|
+
d(this, ft);
|
|
1555
|
+
p(this, ft, s), this.row = new He(this), this.data = new Me(t(this, ft), this), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.pageCnt = 25, this.viewRecords.reset = () => {
|
|
1475
1556
|
var e;
|
|
1476
|
-
(e = t(this,
|
|
1557
|
+
(e = t(this, ft).view) != null && e.redraw && t(this, ft).view.redraw();
|
|
1477
1558
|
}, this.setDataSource = (e) => {
|
|
1478
1559
|
this.data && this.data.reset(), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.data.set(e || []);
|
|
1479
1560
|
}, this.getRowState = (e) => {
|
|
1480
1561
|
var r, o;
|
|
1481
|
-
const
|
|
1482
|
-
if (!(
|
|
1483
|
-
return (o = (r = this.data.getValidData()[
|
|
1562
|
+
const n = parseInt(e, 10);
|
|
1563
|
+
if (!(n >= this.data.count()))
|
|
1564
|
+
return (o = (r = this.data.getValidData()[n]) == null ? void 0 : r.__ng) == null ? void 0 : o.rowState;
|
|
1484
1565
|
}, this.getRowPosition = () => this.row.at, this.setRowPosition = (e) => {
|
|
1485
1566
|
this.row.at = e;
|
|
1486
|
-
}, 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,
|
|
1487
|
-
e = parseInt(e, 10), this.data.setValue(e,
|
|
1567
|
+
}, 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, n) => this.data.get(e, n), this.setColumn = (e, n, r) => {
|
|
1568
|
+
e = parseInt(e, 10), this.data.setValue(e, n, r);
|
|
1488
1569
|
}, this.setDataSource([]);
|
|
1489
1570
|
}
|
|
1490
1571
|
};
|
|
1491
|
-
|
|
1492
|
-
let
|
|
1493
|
-
var
|
|
1494
|
-
const
|
|
1572
|
+
ft = new WeakMap(), h(is, "ngDataManager");
|
|
1573
|
+
let $e = is;
|
|
1574
|
+
var vt, M, Bt, ye;
|
|
1575
|
+
const as = class as {
|
|
1495
1576
|
// 🎯 이제 { name: string, type: string } 객체들의 배열로 관리합니다.
|
|
1496
|
-
constructor(
|
|
1497
|
-
d(this,
|
|
1498
|
-
d(this,
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
t(this,
|
|
1502
|
-
}), t(this,
|
|
1577
|
+
constructor(s) {
|
|
1578
|
+
d(this, vt);
|
|
1579
|
+
d(this, M, []);
|
|
1580
|
+
E(this, "add", /* @__PURE__ */ h((s, e = "string") => {
|
|
1581
|
+
s.forEach((n) => {
|
|
1582
|
+
t(this, M).some((r) => r.name === n) || t(this, M).push({ name: n, type: e });
|
|
1583
|
+
}), t(this, Bt).call(this);
|
|
1503
1584
|
}, "add"));
|
|
1504
|
-
d(this,
|
|
1505
|
-
const
|
|
1506
|
-
t(this,
|
|
1507
|
-
|
|
1508
|
-
}), p(this,
|
|
1585
|
+
d(this, Bt, /* @__PURE__ */ h(() => {
|
|
1586
|
+
const s = /* @__PURE__ */ new Map();
|
|
1587
|
+
t(this, M).forEach((e) => {
|
|
1588
|
+
s.set(e.name, e.type);
|
|
1589
|
+
}), p(this, M, Array.from(s, ([e, n]) => ({ name: e, type: n }))), p(this, M, t(this, M).filter((e) => e.name !== "" && e.name !== "__ng")), t(this, M).sort((e, n) => e.name.length < n.name.length ? 1 : -1);
|
|
1509
1590
|
}, "#adjust"));
|
|
1510
|
-
d(this,
|
|
1511
|
-
p(this,
|
|
1512
|
-
const
|
|
1513
|
-
if (!(!
|
|
1514
|
-
for (const e of
|
|
1515
|
-
|
|
1591
|
+
d(this, ye, /* @__PURE__ */ h(() => {
|
|
1592
|
+
p(this, M, []), R.log(t(this, vt).querySelectorAll("table"));
|
|
1593
|
+
const s = Array.from(t(this, vt).querySelectorAll("table"));
|
|
1594
|
+
if (!(!s || s.length === 0)) {
|
|
1595
|
+
for (const e of s)
|
|
1596
|
+
R.log(e), $("[data-bind]", e).each((n, r) => {
|
|
1516
1597
|
const o = r.dataset.bind, i = r.getAttribute("data-type") || "string";
|
|
1517
|
-
o && t(this,
|
|
1518
|
-
}), ["data-expr", "background-color", "color", "tooltip", "visible", "readonly", "enable-button", "enable-check", "class-expr", "icon-color", "icon-src"].forEach((
|
|
1519
|
-
$(`[${
|
|
1520
|
-
var i = o.getAttribute(
|
|
1598
|
+
o && t(this, M).push({ name: o, type: i });
|
|
1599
|
+
}), ["data-expr", "background-color", "color", "tooltip", "visible", "readonly", "enable-button", "enable-check", "class-expr", "icon-color", "icon-src"].forEach((n) => {
|
|
1600
|
+
$(`[${n}]`, e).each((r, o) => {
|
|
1601
|
+
var i = o.getAttribute(n);
|
|
1521
1602
|
if (i.indexOf("data.") < 0) {
|
|
1522
1603
|
const a = i.search(/[(]/g);
|
|
1523
1604
|
if (a > 0)
|
|
@@ -1531,73 +1612,73 @@ const Xe = class Xe {
|
|
|
1531
1612
|
if (a.trim() != "") {
|
|
1532
1613
|
const c = a.search(/[^_A-Za-z0-9]/g);
|
|
1533
1614
|
let l = "";
|
|
1534
|
-
c >= 0 ? l = a.substring(0, c) : i.startsWith("data.") && (l = a.replace("data.", "")), l && t(this,
|
|
1615
|
+
c >= 0 ? l = a.substring(0, c) : i.startsWith("data.") && (l = a.replace("data.", "")), l && t(this, M).push({ name: l, type: "string" });
|
|
1535
1616
|
}
|
|
1536
1617
|
});
|
|
1537
1618
|
});
|
|
1538
1619
|
});
|
|
1539
|
-
t(this,
|
|
1620
|
+
t(this, Bt).call(this);
|
|
1540
1621
|
}
|
|
1541
1622
|
}, "#init"));
|
|
1542
|
-
p(this,
|
|
1623
|
+
p(this, vt, s), t(this, ye).call(this);
|
|
1543
1624
|
}
|
|
1544
1625
|
// 🎯 기존에 필드 이름만 쓰던 곳들과의 호환을 위해 이름 배열만 리턴하는 메서드 유지
|
|
1545
1626
|
get() {
|
|
1546
|
-
return t(this,
|
|
1627
|
+
return t(this, M).map((s) => s.name);
|
|
1547
1628
|
}
|
|
1548
1629
|
// 🎯 내부 객체 통째로 얻기
|
|
1549
1630
|
getFields() {
|
|
1550
|
-
return t(this,
|
|
1631
|
+
return t(this, M);
|
|
1551
1632
|
}
|
|
1552
1633
|
// 🎯 특정 필드의 데이터 타입 조회
|
|
1553
|
-
getType(
|
|
1554
|
-
const e = t(this,
|
|
1634
|
+
getType(s) {
|
|
1635
|
+
const e = t(this, M).find((n) => n.name === s);
|
|
1555
1636
|
return e ? e.type : "string";
|
|
1556
1637
|
}
|
|
1557
|
-
indexOf(
|
|
1558
|
-
return t(this,
|
|
1638
|
+
indexOf(s) {
|
|
1639
|
+
return t(this, M).findIndex((e) => e.name === s);
|
|
1559
1640
|
}
|
|
1560
|
-
includes(
|
|
1561
|
-
return t(this,
|
|
1641
|
+
includes(s) {
|
|
1642
|
+
return t(this, M).some((e) => e.name === s);
|
|
1562
1643
|
}
|
|
1563
1644
|
};
|
|
1564
|
-
|
|
1565
|
-
let
|
|
1566
|
-
var
|
|
1567
|
-
const
|
|
1645
|
+
vt = new WeakMap(), M = new WeakMap(), Bt = new WeakMap(), ye = new WeakMap(), h(as, "ngFields");
|
|
1646
|
+
let _e = as;
|
|
1647
|
+
var ut, me, xe;
|
|
1648
|
+
const ls = class ls extends HTMLElement {
|
|
1568
1649
|
constructor() {
|
|
1569
1650
|
super();
|
|
1570
1651
|
//#created = false;
|
|
1571
|
-
d(this,
|
|
1572
|
-
d(this,
|
|
1573
|
-
d(this,
|
|
1574
|
-
this.fields = new
|
|
1652
|
+
d(this, ut);
|
|
1653
|
+
d(this, me);
|
|
1654
|
+
d(this, xe, /* @__PURE__ */ h(() => {
|
|
1655
|
+
this.fields = new _e(this), p(this, me, new Ie(this)), R.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
|
|
1575
1656
|
}, "#init"));
|
|
1576
|
-
this.attachShadow({ mode: "open" }), p(this,
|
|
1657
|
+
this.attachShadow({ mode: "open" }), p(this, ut, new $e(this));
|
|
1577
1658
|
}
|
|
1578
1659
|
connectedCallback() {
|
|
1579
|
-
t(this,
|
|
1660
|
+
t(this, xe).call(this);
|
|
1580
1661
|
}
|
|
1581
1662
|
disconnectedCallback() {
|
|
1582
|
-
|
|
1663
|
+
R.log("NineTable disconnected.");
|
|
1583
1664
|
}
|
|
1584
1665
|
// 🎯 외부에서 grid.data.set(...) 형태로 접근할 수 있도록 데이터 매니저 오픈
|
|
1585
1666
|
get data() {
|
|
1586
|
-
return t(this,
|
|
1667
|
+
return t(this, ut).data;
|
|
1587
1668
|
}
|
|
1588
1669
|
// 🎯 행(row) 관련 제어 접근자 오픈
|
|
1589
1670
|
get row() {
|
|
1590
|
-
return t(this,
|
|
1671
|
+
return t(this, ut).row;
|
|
1591
1672
|
}
|
|
1592
1673
|
// 🎯 전체 데이터 매니저 접근 필요할 경우
|
|
1593
1674
|
get dataManager() {
|
|
1594
|
-
return t(this,
|
|
1675
|
+
return t(this, ut);
|
|
1595
1676
|
}
|
|
1596
1677
|
};
|
|
1597
|
-
|
|
1598
|
-
let
|
|
1599
|
-
customElements.get("nine-table") || customElements.define("nine-table",
|
|
1600
|
-
const
|
|
1678
|
+
ut = new WeakMap(), me = new WeakMap(), xe = new WeakMap(), h(ls, "NineTable");
|
|
1679
|
+
let Ne = ls;
|
|
1680
|
+
customElements.get("nine-table") || customElements.define("nine-table", Ne);
|
|
1681
|
+
const qt = class qt extends HTMLElement {
|
|
1601
1682
|
// 👈 커스텀 스타일용 캐시 추가
|
|
1602
1683
|
constructor() {
|
|
1603
1684
|
super();
|
|
@@ -1608,31 +1689,31 @@ const Rt = class Rt extends HTMLElement {
|
|
|
1608
1689
|
connectedCallback() {
|
|
1609
1690
|
}
|
|
1610
1691
|
};
|
|
1611
|
-
h(
|
|
1612
|
-
let
|
|
1613
|
-
var L,
|
|
1614
|
-
const
|
|
1692
|
+
h(qt, "BasicCellElement"), E(qt, "_styleCache", /* @__PURE__ */ new Map()), E(qt, "_customStyleCache", /* @__PURE__ */ new Map());
|
|
1693
|
+
let De = qt;
|
|
1694
|
+
var L, Pt, x, je, Ye, Ve, Ue, Xe;
|
|
1695
|
+
const cs = class cs extends De {
|
|
1615
1696
|
constructor() {
|
|
1616
1697
|
super();
|
|
1617
1698
|
d(this, L);
|
|
1618
|
-
d(this,
|
|
1699
|
+
d(this, Pt);
|
|
1619
1700
|
d(this, x);
|
|
1620
|
-
d(this,
|
|
1621
|
-
d(this,
|
|
1622
|
-
d(this,
|
|
1623
|
-
d(this,
|
|
1624
|
-
|
|
1701
|
+
d(this, je);
|
|
1702
|
+
d(this, Ye);
|
|
1703
|
+
d(this, Ve);
|
|
1704
|
+
d(this, Ue);
|
|
1705
|
+
E(this, "getDisplayText", /* @__PURE__ */ h((e) => {
|
|
1625
1706
|
if (t(this, x))
|
|
1626
1707
|
if (t(this, x).closest("tbody")) {
|
|
1627
|
-
const
|
|
1628
|
-
if (!
|
|
1708
|
+
const n = t(this, x).closest("tr").data, r = parseInt(t(this, x).dataset.row);
|
|
1709
|
+
if (!n) return "";
|
|
1629
1710
|
if (ninegrid.isNull(t(this, x).dataset.expr)) {
|
|
1630
1711
|
if (!ninegrid.isNull(t(this, x).dataset.bind))
|
|
1631
|
-
return
|
|
1712
|
+
return n[t(this, x).dataset.bind] || ninegrid.nvl(e, "");
|
|
1632
1713
|
} else try {
|
|
1633
|
-
return this.getExprValue(t(this, x).dataset.expr,
|
|
1714
|
+
return this.getExprValue(t(this, x).dataset.expr, n, r, t(this, x));
|
|
1634
1715
|
} catch {
|
|
1635
|
-
console.error(t(this, x).dataset.expr,
|
|
1716
|
+
console.error(t(this, x).dataset.expr, n, t(this, x).dataset.row);
|
|
1636
1717
|
}
|
|
1637
1718
|
return ninegrid.nvl(e, "");
|
|
1638
1719
|
} else
|
|
@@ -1641,17 +1722,17 @@ const Ze = class Ze extends qe {
|
|
|
1641
1722
|
} catch {
|
|
1642
1723
|
}
|
|
1643
1724
|
}, "getDisplayText"));
|
|
1644
|
-
d(this,
|
|
1725
|
+
d(this, Xe, /* @__PURE__ */ h(() => {
|
|
1645
1726
|
if (!(!t(this, L) || !t(this, L).template || !t(this, x).closest("tbody.bindable"))) {
|
|
1646
1727
|
var e = ninegrid.j.querySelectorAll(t(this, x)).attr("suppress");
|
|
1647
1728
|
if (e && (e = parseInt(e)), e && !isNaN(e)) {
|
|
1648
|
-
var
|
|
1649
|
-
$("th,td",
|
|
1650
|
-
var T = ninegrid.j.querySelectorAll(
|
|
1651
|
-
T &&
|
|
1729
|
+
var n = t(this, x).closest("tr"), r = [];
|
|
1730
|
+
$("th,td", n).each((m, I) => {
|
|
1731
|
+
var T = ninegrid.j.querySelectorAll(I).attr("suppress");
|
|
1732
|
+
T && I.dataset.row && (T = parseInt(T), !isNaN(T) && T <= e && r.push(T));
|
|
1652
1733
|
}), r.sort();
|
|
1653
1734
|
var o = !1;
|
|
1654
|
-
if (parseInt(
|
|
1735
|
+
if (parseInt(n.sectionRowIndex / t(this, L).template.length) > 0)
|
|
1655
1736
|
for (var i of r) {
|
|
1656
1737
|
if (i > e) break;
|
|
1657
1738
|
var a = parseInt(t(this, x).dataset.row), c = a - 1, l = t(this, x).closest("tr").data, f = t(this, L).data.get(c);
|
|
@@ -1665,17 +1746,17 @@ const Ze = class Ze extends qe {
|
|
|
1665
1746
|
else
|
|
1666
1747
|
o = !0;
|
|
1667
1748
|
o ? ninegrid.j.querySelectorAll(t(this, x)).removeClass("suppress") : ninegrid.j.querySelectorAll(t(this, x)).addClass("suppress"), ninegrid.j.querySelectorAll(t(this, x)).hasClass("hidden") || (o ? ninegrid.j.querySelectorAll(t(this, x)).removeClass("hidden") : ninegrid.j.querySelectorAll(t(this, x)).addClass("hidden"));
|
|
1668
|
-
var y = parseInt(t(this, x).dataset.matrixRow),
|
|
1669
|
-
$(
|
|
1749
|
+
var y = parseInt(t(this, x).dataset.matrixRow), w = y - 1, v = t(this, L).body.querySelector(`tbody.bindable [data-col="${t(this, x).dataset.col}"][data-matrix-row="${w}"]`);
|
|
1750
|
+
$(v).hasClass("suppress") && !ninegrid.j.querySelectorAll(t(this, x)).hasClass("suppress") ? ninegrid.j.querySelectorAll(v).removeClass("last-none-suppress").addClass("last-suppress") : !$(v).hasClass("suppress") && ninegrid.j.querySelectorAll(t(this, x)).hasClass("suppress") ? ninegrid.j.querySelectorAll(v).removeClass("last-suppress").addClass("last-none-suppress") : ninegrid.j.querySelectorAll(v).removeClass("last-none-suppress").removeClass("last-suppress");
|
|
1670
1751
|
}
|
|
1671
1752
|
}
|
|
1672
1753
|
}, "#resetSuppress"));
|
|
1673
|
-
|
|
1754
|
+
E(this, "getExprValue", /* @__PURE__ */ h((e, n, r, o) => {
|
|
1674
1755
|
if (typeof e < "u")
|
|
1675
1756
|
try {
|
|
1676
1757
|
r = parseInt(r);
|
|
1677
1758
|
const i = e.replace("()", "");
|
|
1678
|
-
return t(this, L)[i] ? t(this, L)[i].call(this,
|
|
1759
|
+
return t(this, L)[i] ? t(this, L)[i].call(this, n, r, t(this, x)) : t(this, L).exprFunction(e).call(this, n, r, t(this, L).data);
|
|
1679
1760
|
} catch {
|
|
1680
1761
|
return ["NG-COMBO"].includes(this.tagName) ? "" : e;
|
|
1681
1762
|
}
|
|
@@ -1684,16 +1765,16 @@ const Ze = class Ze extends qe {
|
|
|
1684
1765
|
}, "getExprValue"));
|
|
1685
1766
|
}
|
|
1686
1767
|
connectedCallback() {
|
|
1687
|
-
super.connectedCallback(), p(this, L, this.getRootNode().host), p(this, x, this.closest("th,td")), p(this,
|
|
1768
|
+
super.connectedCallback(), p(this, L, this.getRootNode().host), p(this, x, this.closest("th,td")), p(this, Pt, t(this, x).closest("tr"));
|
|
1688
1769
|
}
|
|
1689
1770
|
get value() {
|
|
1690
1771
|
var e = !t(this, L) || !t(this, L).dataManager || !t(this, x) || !t(this, x).dataset || !t(this, x).dataset.row || !t(this, x).dataset.bind ? "" : t(this, x).closest("tr").data[t(this, x).dataset.bind];
|
|
1691
1772
|
return e ?? "";
|
|
1692
1773
|
}
|
|
1693
1774
|
set value(e) {
|
|
1694
|
-
var
|
|
1775
|
+
var n = parseInt(t(this, x).dataset.row);
|
|
1695
1776
|
const r = this.getAttribute("update-row-state") != "false";
|
|
1696
|
-
|
|
1777
|
+
n < 0 ? t(this, L).data.setValueNF(parseInt(t(this, x).dataset.index), t(this, x).dataset.bind, e, r) : t(this, L).data.setValue(n, t(this, x).dataset.bind, e, r);
|
|
1697
1778
|
}
|
|
1698
1779
|
get row() {
|
|
1699
1780
|
return parseInt(t(this, x).dataset.row);
|
|
@@ -1703,12 +1784,12 @@ const Ze = class Ze extends qe {
|
|
|
1703
1784
|
}
|
|
1704
1785
|
refresh() {
|
|
1705
1786
|
const e = t(this, x).dataset.bind;
|
|
1706
|
-
return parseInt(t(this, x).dataset.row), t(this,
|
|
1787
|
+
return parseInt(t(this, x).dataset.row), t(this, Pt).data[e];
|
|
1707
1788
|
}
|
|
1708
1789
|
};
|
|
1709
|
-
L = new WeakMap(),
|
|
1710
|
-
let
|
|
1711
|
-
const
|
|
1790
|
+
L = new WeakMap(), Pt = new WeakMap(), x = new WeakMap(), je = new WeakMap(), Ye = new WeakMap(), Ve = new WeakMap(), Ue = new WeakMap(), Xe = new WeakMap(), h(cs, "CellElement");
|
|
1791
|
+
let Oe = cs;
|
|
1792
|
+
const hs = class hs extends Oe {
|
|
1712
1793
|
constructor() {
|
|
1713
1794
|
super();
|
|
1714
1795
|
}
|
|
@@ -1719,21 +1800,21 @@ const Ge = class Ge extends Te {
|
|
|
1719
1800
|
return super.refresh();
|
|
1720
1801
|
}
|
|
1721
1802
|
};
|
|
1722
|
-
h(
|
|
1723
|
-
let
|
|
1724
|
-
var
|
|
1725
|
-
const
|
|
1803
|
+
h(hs, "EditableCellElement");
|
|
1804
|
+
let ze = hs;
|
|
1805
|
+
var Ft, gt, St, Rt, we, J, Ke;
|
|
1806
|
+
const ds = class ds extends ze {
|
|
1726
1807
|
constructor() {
|
|
1727
1808
|
super();
|
|
1728
|
-
d(this,
|
|
1729
|
-
d(this,
|
|
1730
|
-
d(this,
|
|
1731
|
-
d(this,
|
|
1732
|
-
d(this,
|
|
1733
|
-
d(this,
|
|
1734
|
-
|
|
1809
|
+
d(this, Ft);
|
|
1810
|
+
d(this, gt);
|
|
1811
|
+
d(this, St);
|
|
1812
|
+
d(this, Rt);
|
|
1813
|
+
d(this, we);
|
|
1814
|
+
d(this, J);
|
|
1815
|
+
E(this, "refresh", /* @__PURE__ */ h(() => {
|
|
1735
1816
|
const e = super.refresh();
|
|
1736
|
-
t(this,
|
|
1817
|
+
t(this, Ft).value = e;
|
|
1737
1818
|
}, "refresh"));
|
|
1738
1819
|
/**
|
|
1739
1820
|
dataRefresh = (v) => {
|
|
@@ -1765,36 +1846,36 @@ const Je = class Je extends Ce {
|
|
|
1765
1846
|
if (!v) this.reset();
|
|
1766
1847
|
};
|
|
1767
1848
|
*/
|
|
1768
|
-
d(this,
|
|
1849
|
+
d(this, Ke, /* @__PURE__ */ h((e) => {
|
|
1769
1850
|
if (!["Escape", "Enter", "Tab", "Home", "End", "ArrowLeft", "ArrowRight", "PageUp", "PageDown", "Backspace", "Delete"].includes(e.code)) {
|
|
1770
|
-
if (t(this,
|
|
1851
|
+
if (t(this, gt) == "number") {
|
|
1771
1852
|
let o = [];
|
|
1772
|
-
if (t(this,
|
|
1773
|
-
var
|
|
1853
|
+
if (t(this, J) && Number(t(this, J)) > 0 && o.push("."), t(this, Rt) && Number(t(this, Rt)) >= 0 && o.push("-"), !(e.keyCode >= 48 && e.keyCode <= 57 || e.keyCode >= 96 && e.keyCode <= 105) && !o.includes(e.key) && e.preventDefault(), t(this, J) && (e.keyCode >= 48 && e.keyCode <= 57 || e.keyCode >= 96 && e.keyCode <= 105) && e.target.selectionStart == e.target.selectionEnd) {
|
|
1854
|
+
var n = e.target.value, r = n.indexOf(".");
|
|
1774
1855
|
if (r >= 0) {
|
|
1775
|
-
var
|
|
1776
|
-
|
|
1856
|
+
var n = n.substr(r + 1, n.length);
|
|
1857
|
+
n.length >= Number(t(this, J)) && e.preventDefault();
|
|
1777
1858
|
}
|
|
1778
1859
|
}
|
|
1779
1860
|
}
|
|
1780
|
-
t(this,
|
|
1861
|
+
t(this, St) && ninegrid.getByteLength(e.target.value) >= Number(t(this, St)) && e.target.selectionStart == e.target.selectionEnd && e.preventDefault();
|
|
1781
1862
|
}
|
|
1782
1863
|
}, "#onKeyDown"));
|
|
1783
|
-
if (this.applyBaseStyle(), p(this,
|
|
1864
|
+
if (this.applyBaseStyle(), p(this, gt, this.getAttribute("type") || "text"), p(this, St, this.getAttribute("maxbyte")), p(this, Rt, this.getAttribute("min")), p(this, we, this.getAttribute("max")), p(this, J, this.getAttribute("scale")), !["text", "number"].includes(t(this, gt))) throw `invalid type : ${t(this, gt)}`;
|
|
1784
1865
|
}
|
|
1785
1866
|
connectedCallback() {
|
|
1786
|
-
for (var e = [],
|
|
1787
|
-
["type", "maxlength", "maxbyte", "min", "max", "step", "scale", "text-align"].includes(this.attributes[
|
|
1867
|
+
for (var e = [], n = 0; n < this.attributes.length; n++)
|
|
1868
|
+
["type", "maxlength", "maxbyte", "min", "max", "step", "scale", "text-align"].includes(this.attributes[n].name) && e.push(`${this.attributes[n].name}="${this.attributes[n].value}"`);
|
|
1788
1869
|
this.innerHTML = `
|
|
1789
1870
|
<input type="text"
|
|
1790
1871
|
${e.join(" ")}
|
|
1791
1872
|
ondragstart="return false;"
|
|
1792
1873
|
>
|
|
1793
|
-
`, super.connectedCallback(), p(this,
|
|
1874
|
+
`, super.connectedCallback(), p(this, Ft, this.querySelector("input"));
|
|
1794
1875
|
}
|
|
1795
1876
|
};
|
|
1796
|
-
|
|
1797
|
-
let
|
|
1877
|
+
Ft = new WeakMap(), gt = new WeakMap(), St = new WeakMap(), Rt = new WeakMap(), we = new WeakMap(), J = new WeakMap(), Ke = new WeakMap(), h(ds, "CellInputText");
|
|
1878
|
+
let We = ds;
|
|
1798
1879
|
customElements.get("cell-input-text");
|
|
1799
|
-
customElements.get("cell-input") || customElements.define("cell-input",
|
|
1880
|
+
customElements.get("cell-input") || customElements.define("cell-input", We);
|
|
1800
1881
|
//# sourceMappingURL=nine-table.js.map
|