@ninebone/table 0.0.719 → 0.0.721
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 +677 -609
- 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 ds = Object.defineProperty;
|
|
2
|
+
var fs = (q) => {
|
|
3
3
|
throw TypeError(q);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var h = (q,
|
|
7
|
-
var
|
|
8
|
-
var t = (q,
|
|
9
|
-
var
|
|
5
|
+
var ps = (q, s, e) => s in q ? ds(q, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : q[s] = e;
|
|
6
|
+
var h = (q, s) => ds(q, "name", { value: s, configurable: !0 });
|
|
7
|
+
var E = (q, s, e) => ps(q, typeof s != "symbol" ? s + "" : s, e), xe = (q, s, e) => s.has(q) || fs("Cannot " + e);
|
|
8
|
+
var t = (q, s, e) => (xe(q, s, "read from private field"), e ? e.call(q) : s.get(q)), d = (q, s, e) => s.has(q) ? fs("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(q) : s.set(q, e), p = (q, s, e, n) => (xe(q, s, "write to private field"), n ? n.call(q, e) : s.set(q, e), e), Q = (q, s, e) => (xe(q, s, "access private method"), e);
|
|
9
|
+
var us = (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 ys } from "@ninebone/util";
|
|
18
|
+
const Ue = class Ue extends ys.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(Ue, "Trace");
|
|
24
|
+
let we = Ue;
|
|
25
|
+
const R = new we();
|
|
26
|
+
var B, K, A, tt, et, st, jt, nt, Yt;
|
|
27
|
+
const Xe = class Xe 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, jt, /* @__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, Yt, /* @__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, Yt).call(this), t(this, jt).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(), jt = new WeakMap(), nt = new WeakMap(), Yt = new WeakMap(), h(Xe, "NineTableHScrollBar");
|
|
202
|
+
let ve = Xe;
|
|
203
|
+
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", ve);
|
|
204
|
+
var rt, ot, bt, C, Tt, Ct, Vt;
|
|
205
|
+
const Ke = class Ke 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, Vt, /* @__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, Vt).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(), Vt = new WeakMap(), h(Ke, "NineTableVScrollBar");
|
|
354
|
+
let Se = Ke;
|
|
355
|
+
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar", Se);
|
|
356
|
+
var j, S, it, P, D, G, at, kt, Oe, ze, Ut, Xt, Lt, It, Ht, Kt, Gt, Mt, We, pt, $t, Zt;
|
|
357
|
+
const Ge = class Ge {
|
|
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, Oe, !1);
|
|
368
|
+
d(this, ze, !1);
|
|
369
369
|
//#ticking = false; // 🎯 고속 스크롤 스로틀링용 플래그
|
|
370
|
-
d(this,
|
|
371
|
-
|
|
370
|
+
d(this, Ut, 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, Xt, /* @__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, Ut));
|
|
464
464
|
}
|
|
465
465
|
}, "#updateRowCount"));
|
|
466
|
-
d(this,
|
|
466
|
+
d(this, Kt, /* @__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, Gt, /* @__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, Xt).call(this, e, s);
|
|
513
|
+
}), t(this, Zt).call(this), t(this, Kt).call(this);
|
|
514
514
|
}, "#renderAllContainers"));
|
|
515
|
-
d(this,
|
|
515
|
+
d(this, We, /* @__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, Zt, /* @__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, Gt).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(), Oe = new WeakMap(), ze = new WeakMap(), Ut = new WeakMap(), Xt = new WeakMap(), Lt = new WeakMap(), It = new WeakMap(), Ht = new WeakMap(), Kt = new WeakMap(), Gt = new WeakMap(), Mt = new WeakMap(), We = new WeakMap(), pt = new WeakMap(), $t = new WeakMap(), Zt = new WeakMap(), h(Ge, "RowManager");
|
|
614
|
+
let Re = Ge;
|
|
615
|
+
const Jt = class Jt {
|
|
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) => Jt.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(Jt, "TableCompiler");
|
|
693
|
+
let Ae = Jt;
|
|
694
|
+
var _, Y, U, At, gs;
|
|
695
|
+
const Ze = class Ze {
|
|
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, gs).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,177 @@ 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), ls = Math.max(i, T), cs = Math.min(a, v), hs = Math.max(c, H);
|
|
754
|
+
(X !== o || ls !== i || cs !== a || hs !== c) && (o = X, i = ls, a = cs, c = hs, 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"), gs = /* @__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(Ze, "CellSelection");
|
|
807
|
+
let Ee = Ze;
|
|
808
|
+
var V, lt, Qt, te, ee, bs;
|
|
809
|
+
const Je = class Je {
|
|
810
|
+
constructor(s) {
|
|
811
|
+
d(this, ee);
|
|
812
|
+
d(this, V);
|
|
813
|
+
d(this, lt, null);
|
|
814
|
+
d(this, Qt, -1);
|
|
815
|
+
d(this, te, -1);
|
|
816
|
+
p(this, V, s), Q(this, ee, bs).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, Qt, e), p(this, te, 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(), Qt = new WeakMap(), te = new WeakMap(), ee = new WeakSet(), bs = /* @__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(Je, "CellNavigation");
|
|
874
|
+
let qe = Je;
|
|
875
|
+
var se, ct, ht, _t, ne, re, oe, yt, ie, ae;
|
|
876
|
+
const Et = class Et extends HTMLElement {
|
|
810
877
|
constructor() {
|
|
811
878
|
super();
|
|
812
|
-
d(this,
|
|
813
|
-
d(this,
|
|
814
|
-
d(this,
|
|
815
|
-
d(this,
|
|
816
|
-
|
|
817
|
-
|
|
879
|
+
d(this, se);
|
|
880
|
+
d(this, ct, null);
|
|
881
|
+
d(this, ht);
|
|
882
|
+
d(this, _t);
|
|
883
|
+
d(this, ne);
|
|
884
|
+
E(this, "invalidate", /* @__PURE__ */ h(() => {
|
|
885
|
+
R.log("sheet.invalidate()"), t(this, ht).refresh();
|
|
818
886
|
}, "invalidate"));
|
|
819
|
-
|
|
820
|
-
if (
|
|
821
|
-
p(this,
|
|
822
|
-
const
|
|
823
|
-
|
|
887
|
+
E(this, "generate", /* @__PURE__ */ h((e) => {
|
|
888
|
+
if (R.log("sheet.generate()"), !e) return;
|
|
889
|
+
p(this, ct, Ae.compile(e)), t(this, re).call(this), t(this, oe).call(this);
|
|
890
|
+
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");
|
|
891
|
+
n && o && (o.style.top = `${n.offsetHeight}px`), r && o && (o.style.bottom = `${r.offsetHeight}px`), t(this, ht).initialize(), setTimeout(() => {
|
|
824
892
|
var i;
|
|
825
893
|
(i = this.querySelector("nine-table-hscrollbar")) == null || i.refresh();
|
|
826
894
|
}, 0);
|
|
827
895
|
}, "generate"));
|
|
828
|
-
d(this,
|
|
896
|
+
d(this, re, /* @__PURE__ */ h(() => {
|
|
829
897
|
[
|
|
830
898
|
{ selector: ".ng-container-body", type: null },
|
|
831
899
|
{ selector: ".ng-container-left", type: "left" },
|
|
832
900
|
{ selector: ".ng-container-right", type: "right" }
|
|
833
|
-
].forEach(({ selector:
|
|
901
|
+
].forEach(({ selector: n, type: r }) => {
|
|
834
902
|
var o, i, a;
|
|
835
|
-
(o = this.querySelector(`${
|
|
903
|
+
(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
904
|
});
|
|
837
905
|
}, "#renderSplitContainers"));
|
|
838
|
-
d(this,
|
|
906
|
+
d(this, oe, /* @__PURE__ */ h(() => {
|
|
839
907
|
["left", "right", "body"].forEach((e) => {
|
|
840
|
-
const
|
|
841
|
-
if (!
|
|
908
|
+
const n = this.querySelector(`.ng-container-${e}`), r = n == null ? void 0 : n.querySelectorAll("table");
|
|
909
|
+
if (!n || !r || r.length === 0) return;
|
|
842
910
|
let o = 0;
|
|
843
911
|
r[0].querySelectorAll("col").forEach((i) => {
|
|
844
912
|
const a = parseInt(i.getAttribute("width"), 10);
|
|
845
913
|
isNaN(o) || (o += a);
|
|
846
|
-
}), e === "body" ?
|
|
914
|
+
}), e === "body" ? n.style.flex = "1" : (n.style.flex = `0 0 ${o}px`, n.style.width = `${o}px`);
|
|
847
915
|
});
|
|
848
916
|
}, "#updateContainerWidths"));
|
|
849
|
-
d(this,
|
|
917
|
+
d(this, yt, /* @__PURE__ */ h((e, n, r) => {
|
|
850
918
|
const o = e.cloneNode(!0), i = o.querySelector("thead"), a = o.querySelector("tbody"), c = o.querySelector("tfoot");
|
|
851
919
|
if (r === "header") {
|
|
852
920
|
if (a && a.remove(), c && c.remove(), e.querySelector("tbody")) {
|
|
@@ -854,28 +922,28 @@ const St = class St extends HTMLElement {
|
|
|
854
922
|
f.className = "fixed-tbody", o.appendChild(f);
|
|
855
923
|
}
|
|
856
924
|
} else r === "body" ? (i && i.remove(), c && c.remove(), a && (a.className = "bindable-tbody")) : r === "footer" && (i && i.remove(), a && a.remove());
|
|
857
|
-
return
|
|
925
|
+
return n === "left" ? o.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((l) => {
|
|
858
926
|
l.getAttribute("fixed") !== "left" && l.remove();
|
|
859
|
-
}) :
|
|
927
|
+
}) : n === "right" ? o.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((l) => {
|
|
860
928
|
l.getAttribute("fixed") !== "right" && l.remove();
|
|
861
929
|
}) : o.querySelectorAll("[fixed=left], [fixed=right]").forEach((l) => {
|
|
862
930
|
l.remove();
|
|
863
931
|
}), o;
|
|
864
932
|
}, "#createSplitTable"));
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
const
|
|
868
|
-
|
|
933
|
+
E(this, "getRowHeight", /* @__PURE__ */ h(() => t(this, ht).getRowHeight(), "getRowHeight"));
|
|
934
|
+
E(this, "scrollToX", /* @__PURE__ */ h((e) => {
|
|
935
|
+
const n = this.querySelector(".ng-container-body .ng-part-body");
|
|
936
|
+
n && (n.scrollLeft = e);
|
|
869
937
|
}, "scrollToX"));
|
|
870
|
-
|
|
871
|
-
const
|
|
872
|
-
|
|
938
|
+
E(this, "scrollToY", /* @__PURE__ */ h((e) => {
|
|
939
|
+
const n = this.querySelector(".ng-container-body .ng-part-body");
|
|
940
|
+
n && (n.scrollTop = e);
|
|
873
941
|
}, "scrollToY"));
|
|
874
|
-
d(this,
|
|
875
|
-
t(this,
|
|
942
|
+
d(this, ie, /* @__PURE__ */ h(() => {
|
|
943
|
+
t(this, ae).call(this), p(this, _t, new Ee(this)), p(this, ne, new qe(this));
|
|
876
944
|
}, "#init"));
|
|
877
|
-
d(this,
|
|
878
|
-
const e =
|
|
945
|
+
d(this, ae, /* @__PURE__ */ h(() => {
|
|
946
|
+
const e = Et.SCROLLBAR_SIZE;
|
|
879
947
|
this.innerHTML = `
|
|
880
948
|
<style>
|
|
881
949
|
nine-table-sheet {
|
|
@@ -1076,45 +1144,45 @@ const St = class St extends HTMLElement {
|
|
|
1076
1144
|
</div>
|
|
1077
1145
|
`;
|
|
1078
1146
|
}, "#render"));
|
|
1079
|
-
p(this,
|
|
1147
|
+
p(this, ht, new Re(this)), p(this, se, this.getRootNode().host);
|
|
1080
1148
|
}
|
|
1081
1149
|
connectedCallback() {
|
|
1082
|
-
t(this,
|
|
1150
|
+
t(this, ie).call(this);
|
|
1083
1151
|
}
|
|
1084
1152
|
get selection() {
|
|
1085
|
-
return t(this,
|
|
1153
|
+
return t(this, _t);
|
|
1086
1154
|
}
|
|
1087
1155
|
disconnectedCallback() {
|
|
1088
|
-
this.innerHTML = "",
|
|
1156
|
+
this.innerHTML = "", R.log("NineTableSheet destroyed.");
|
|
1089
1157
|
}
|
|
1090
1158
|
};
|
|
1091
|
-
|
|
1092
|
-
let
|
|
1093
|
-
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet",
|
|
1094
|
-
var
|
|
1095
|
-
const
|
|
1159
|
+
se = new WeakMap(), ct = new WeakMap(), ht = new WeakMap(), _t = new WeakMap(), ne = new WeakMap(), re = new WeakMap(), oe = new WeakMap(), yt = new WeakMap(), ie = new WeakMap(), ae = new WeakMap(), h(Et, "NineTableSheet"), E(Et, "SCROLLBAR_SIZE", 16);
|
|
1160
|
+
let Ft = Et;
|
|
1161
|
+
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", Ft);
|
|
1162
|
+
var le, Nt;
|
|
1163
|
+
const Qe = class Qe extends HTMLElement {
|
|
1096
1164
|
constructor() {
|
|
1097
1165
|
super();
|
|
1098
|
-
d(this,
|
|
1166
|
+
d(this, le, /* @__PURE__ */ h(() => {
|
|
1099
1167
|
var e;
|
|
1100
|
-
(e = this.querySelector(".nine-tab-bar")) == null || e.addEventListener("click", (
|
|
1168
|
+
(e = this.querySelector(".nine-tab-bar")) == null || e.addEventListener("click", (n) => {
|
|
1101
1169
|
var i;
|
|
1102
|
-
const r =
|
|
1103
|
-
t(this,
|
|
1104
|
-
}), t(this,
|
|
1170
|
+
const r = n.ctrlKey || n.metaKey || n.shiftKey, o = parseInt((i = n.target.closest(".nine-tab-item")) == null ? void 0 : i.dataset.index, 10);
|
|
1171
|
+
t(this, Nt).call(this, o, r);
|
|
1172
|
+
}), t(this, Nt).call(this, 0, !1);
|
|
1105
1173
|
}, "#init"));
|
|
1106
|
-
d(this,
|
|
1174
|
+
d(this, Nt, /* @__PURE__ */ h((e, n = !1) => {
|
|
1107
1175
|
const r = /* @__PURE__ */ h(() => {
|
|
1108
1176
|
const f = Array.from(this.querySelectorAll("nine-table-sheet"));
|
|
1109
1177
|
Array.from(this.querySelectorAll("nine-splitter")).forEach((g) => g.style.setProperty("display", "none"));
|
|
1110
1178
|
const b = f.filter((g) => g.classList.contains("active"));
|
|
1111
1179
|
b.length < 2 || b.forEach((g) => {
|
|
1112
|
-
const y = parseInt(g.getAttribute("data-index"), 10),
|
|
1113
|
-
|
|
1180
|
+
const y = parseInt(g.getAttribute("data-index"), 10), w = this.querySelector(`nine-splitter[data-split-index="${y}"]`), v = f[y + 1];
|
|
1181
|
+
w && v && v.classList.contains("active") && w.style.setProperty("display", "flex");
|
|
1114
1182
|
});
|
|
1115
1183
|
}, "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
1184
|
if (!a[e]) return;
|
|
1117
|
-
if (!
|
|
1185
|
+
if (!n)
|
|
1118
1186
|
a.forEach((f, u) => {
|
|
1119
1187
|
f.classList.toggle("active", u === e);
|
|
1120
1188
|
}), c.forEach((f, u) => {
|
|
@@ -1136,42 +1204,42 @@ const je = class je extends HTMLElement {
|
|
|
1136
1204
|
}, "#switchSheet"));
|
|
1137
1205
|
}
|
|
1138
1206
|
connectedCallback() {
|
|
1139
|
-
t(this,
|
|
1207
|
+
t(this, le).call(this);
|
|
1140
1208
|
}
|
|
1141
1209
|
};
|
|
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,
|
|
1210
|
+
le = new WeakMap(), Nt = new WeakMap(), h(Qe, "NineTableSheets");
|
|
1211
|
+
let Te = Qe;
|
|
1212
|
+
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", Te);
|
|
1213
|
+
var N, ce, Dt, he;
|
|
1214
|
+
const ts = class ts {
|
|
1215
|
+
constructor(s) {
|
|
1216
|
+
d(this, N);
|
|
1217
|
+
d(this, ce, /* @__PURE__ */ h(() => {
|
|
1218
|
+
t(this, he).call(this), new ResizeObserver((s) => {
|
|
1219
|
+
for (let e of s)
|
|
1220
|
+
t(this, N).getAttribute("auto-height") === "true" && t(this, Dt).call(this);
|
|
1221
|
+
}).observe(t(this, N));
|
|
1154
1222
|
}, "#init"));
|
|
1155
|
-
d(this,
|
|
1223
|
+
d(this, Dt, /* @__PURE__ */ h(() => {
|
|
1156
1224
|
var c, l;
|
|
1157
|
-
const
|
|
1158
|
-
if (
|
|
1159
|
-
const e = parseInt(t(this,
|
|
1160
|
-
t(this,
|
|
1225
|
+
const s = Array.from(t(this, N).shadowRoot.querySelectorAll("nine-table-sheet.active"));
|
|
1226
|
+
if (s.length === 0) return;
|
|
1227
|
+
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 = Ft.SCROLLBAR_SIZE, a = e * n + r + o + i;
|
|
1228
|
+
t(this, N).style.height = `${a}px`;
|
|
1161
1229
|
}, "#applyAutoHeight"));
|
|
1162
|
-
d(this,
|
|
1163
|
-
const e = Array.from(t(this,
|
|
1230
|
+
d(this, he, /* @__PURE__ */ h(() => {
|
|
1231
|
+
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
1232
|
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
1233
|
return u + b;
|
|
1166
1234
|
}).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,
|
|
1235
|
+
t(this, N).shadowRoot.innerHTML = `
|
|
1168
1236
|
<style>
|
|
1169
1237
|
:host {
|
|
1170
1238
|
display: flex;
|
|
1171
1239
|
flex-direction: column;
|
|
1172
1240
|
position: relative;
|
|
1173
1241
|
overflow: hidden;
|
|
1174
|
-
height: ${
|
|
1242
|
+
height: ${n ? "auto" : "100%"};
|
|
1175
1243
|
background: #fff;
|
|
1176
1244
|
}
|
|
1177
1245
|
|
|
@@ -1284,151 +1352,151 @@ const Ye = class Ye {
|
|
|
1284
1352
|
<nine-table-analysis></nine-table-analysis>
|
|
1285
1353
|
</nine-table-body>
|
|
1286
1354
|
<nine-table-footer></nine-table-footer>
|
|
1287
|
-
`, t(this,
|
|
1288
|
-
const a = t(this,
|
|
1355
|
+
`, t(this, N).shadowRoot.querySelector("nine-table-sheets").classList.add("nodata");
|
|
1356
|
+
const a = t(this, N).shadowRoot.querySelectorAll("nine-table-sheet");
|
|
1289
1357
|
a == null || a.forEach((c, l) => {
|
|
1290
1358
|
e[l] && setTimeout(() => {
|
|
1291
|
-
c.generate(e[l]),
|
|
1359
|
+
c.generate(e[l]), n && t(this, Dt).call(this);
|
|
1292
1360
|
});
|
|
1293
1361
|
});
|
|
1294
1362
|
}, "#render"));
|
|
1295
|
-
p(this,
|
|
1363
|
+
p(this, N, s), t(this, ce).call(this);
|
|
1296
1364
|
}
|
|
1297
1365
|
};
|
|
1298
|
-
|
|
1299
|
-
let
|
|
1300
|
-
var
|
|
1301
|
-
const
|
|
1302
|
-
constructor(
|
|
1303
|
-
d(this,
|
|
1304
|
-
d(this,
|
|
1305
|
-
|
|
1306
|
-
p(this,
|
|
1366
|
+
N = new WeakMap(), ce = new WeakMap(), Dt = new WeakMap(), he = new WeakMap(), h(ts, "LayoutManager");
|
|
1367
|
+
let Ce = ts;
|
|
1368
|
+
var Ot, mt;
|
|
1369
|
+
const es = class es {
|
|
1370
|
+
constructor(s) {
|
|
1371
|
+
d(this, Ot);
|
|
1372
|
+
d(this, mt, -1);
|
|
1373
|
+
E(this, "count", /* @__PURE__ */ h(() => t(this, Ot).rawRecords.length, "count"));
|
|
1374
|
+
p(this, Ot, s);
|
|
1307
1375
|
}
|
|
1308
1376
|
get at() {
|
|
1309
|
-
return t(this,
|
|
1377
|
+
return t(this, mt);
|
|
1310
1378
|
}
|
|
1311
|
-
set at(
|
|
1312
|
-
p(this,
|
|
1379
|
+
set at(s) {
|
|
1380
|
+
p(this, mt, parseInt(s, 10)), body && !body.querySelector(`tbody.bindable tr[data-row="${t(this, mt)}"]`) && setTimeout(() => {
|
|
1313
1381
|
});
|
|
1314
1382
|
}
|
|
1315
1383
|
};
|
|
1316
|
-
|
|
1317
|
-
let
|
|
1318
|
-
var
|
|
1319
|
-
const
|
|
1320
|
-
constructor(
|
|
1321
|
-
d(this,
|
|
1384
|
+
Ot = new WeakMap(), mt = new WeakMap(), h(es, "ngRow");
|
|
1385
|
+
let ke = es;
|
|
1386
|
+
var O, k, z, xt, de, Z, fe, dt, zt, ue, ge, wt;
|
|
1387
|
+
const W = class W {
|
|
1388
|
+
constructor(s, e) {
|
|
1389
|
+
d(this, O);
|
|
1322
1390
|
d(this, k);
|
|
1323
1391
|
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,
|
|
1392
|
+
d(this, xt, []);
|
|
1393
|
+
d(this, de, 0);
|
|
1394
|
+
d(this, Z, []);
|
|
1395
|
+
d(this, fe, /* @__PURE__ */ h(() => {
|
|
1396
|
+
p(this, Z, []);
|
|
1397
|
+
const s = t(this, O).template || [];
|
|
1398
|
+
Array.from(s).forEach((e) => {
|
|
1399
|
+
var n;
|
|
1400
|
+
t(this, Z).push(((n = e.getBoundingClientRect) == null ? void 0 : n.call(e).height) || 24);
|
|
1333
1401
|
}), (t(this, k).rawRecords || []).forEach((e) => {
|
|
1334
|
-
e.__ng || (e.__ng = t(this,
|
|
1402
|
+
e.__ng || (e.__ng = t(this, zt).call(this)), e.__ng.height = t(this, Z).slice();
|
|
1335
1403
|
});
|
|
1336
1404
|
}, "#initialize"));
|
|
1337
|
-
d(this,
|
|
1338
|
-
const
|
|
1339
|
-
|
|
1405
|
+
d(this, dt, /* @__PURE__ */ h(() => {
|
|
1406
|
+
const s = t(this, O).shadowRoot.querySelector("nine-table-sheets");
|
|
1407
|
+
s == null || s.classList.toggle("nodata", this.length === 0), t(this, O).shadowRoot.querySelectorAll("nine-table-sheet").forEach((e) => {
|
|
1340
1408
|
e.invalidate();
|
|
1341
1409
|
});
|
|
1342
1410
|
}, "#invalidate"));
|
|
1343
|
-
|
|
1411
|
+
E(this, "get", /* @__PURE__ */ h((s, e) => {
|
|
1344
1412
|
var o;
|
|
1345
|
-
const
|
|
1346
|
-
if (!
|
|
1347
|
-
if (
|
|
1348
|
-
if (
|
|
1349
|
-
const r = typeof ((o = t(this,
|
|
1413
|
+
const n = this.getValidData();
|
|
1414
|
+
if (!n || n.length <= 0) return;
|
|
1415
|
+
if (s == null) return t(this, wt).call(this, n);
|
|
1416
|
+
if (s < 0 || s >= n.length) return null;
|
|
1417
|
+
const r = typeof ((o = t(this, O).fields) == null ? void 0 : o.get) == "function" ? t(this, O).fields.get() : [];
|
|
1350
1418
|
if (e != null) {
|
|
1351
1419
|
const i = r.indexOf(e);
|
|
1352
|
-
return i >= 0 ? s
|
|
1420
|
+
return i >= 0 ? n[s].v[i] : null;
|
|
1353
1421
|
}
|
|
1354
|
-
return t(this,
|
|
1422
|
+
return t(this, wt).call(this, n[s]);
|
|
1355
1423
|
}, "get"));
|
|
1356
|
-
|
|
1357
|
-
this.clear(), this.add(
|
|
1424
|
+
E(this, "set", /* @__PURE__ */ h((s) => {
|
|
1425
|
+
this.clear(), this.add(s, !1), t(this, dt).call(this);
|
|
1358
1426
|
}, "set"));
|
|
1359
|
-
d(this,
|
|
1360
|
-
rowState:
|
|
1427
|
+
d(this, zt, /* @__PURE__ */ h(() => ({
|
|
1428
|
+
rowState: W.ROW_STATE.EMPTY,
|
|
1361
1429
|
deleted: !1,
|
|
1362
1430
|
filtered: !1,
|
|
1363
|
-
height: t(this,
|
|
1431
|
+
height: t(this, Z).slice(),
|
|
1364
1432
|
o: {},
|
|
1365
1433
|
c: {},
|
|
1366
|
-
_: [0, 0, 0, 0,
|
|
1434
|
+
_: [0, 0, 0, 0, W.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this, Z).slice(), -1, {}, {}]
|
|
1367
1435
|
}), "#getDefaultMeta"));
|
|
1368
|
-
|
|
1369
|
-
p(this, z, []), p(this,
|
|
1436
|
+
E(this, "reset", /* @__PURE__ */ h(() => {
|
|
1437
|
+
p(this, z, []), p(this, xt, []), t(this, dt).call(this);
|
|
1370
1438
|
}, "reset"));
|
|
1371
|
-
|
|
1372
|
-
var
|
|
1373
|
-
t(this, k).rawRecords = [], p(this, z, []), p(this,
|
|
1439
|
+
E(this, "clear", /* @__PURE__ */ h(() => {
|
|
1440
|
+
var s;
|
|
1441
|
+
t(this, k).rawRecords = [], p(this, z, []), p(this, xt, []), (s = t(this, k).viewRecords) != null && s.reset && t(this, k).viewRecords.reset();
|
|
1374
1442
|
}, "clear"));
|
|
1375
|
-
d(this,
|
|
1443
|
+
d(this, ue, /* @__PURE__ */ h((s) => {
|
|
1376
1444
|
var r;
|
|
1377
|
-
Array.isArray(
|
|
1378
|
-
const e = typeof ((r = t(this,
|
|
1379
|
-
return
|
|
1445
|
+
Array.isArray(s) || (s = [s]);
|
|
1446
|
+
const e = typeof ((r = t(this, O).fields) == null ? void 0 : r.get) == "function" ? t(this, O).fields.get() : Object.keys(s[0] || {}), n = [];
|
|
1447
|
+
return s.forEach((o) => {
|
|
1380
1448
|
const i = { v: [] };
|
|
1381
1449
|
e.forEach((a) => {
|
|
1382
1450
|
i.v.push(o[a] !== void 0 && o[a] !== null ? o[a] : "");
|
|
1383
|
-
}),
|
|
1384
|
-
}),
|
|
1451
|
+
}), n.push(i);
|
|
1452
|
+
}), n;
|
|
1385
1453
|
}, "#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,
|
|
1454
|
+
d(this, ge, /* @__PURE__ */ h((s) => (Array.isArray(s) || (s = [s]), s.forEach((e) => {
|
|
1455
|
+
e.__ng = t(this, zt).call(this), e.__ng.rowid = this.nextId, e.__ng.rowState = W.ROW_STATE.INSERT, e.__ng._[0] = e.__ng.rowid;
|
|
1456
|
+
}), s), "#defaultInsert"));
|
|
1457
|
+
E(this, "add", /* @__PURE__ */ h((s, e = !0) => {
|
|
1458
|
+
s === void 0 && (s = {});
|
|
1459
|
+
const n = t(this, ue).call(this, s);
|
|
1460
|
+
t(this, k).rawRecords = t(this, k).rawRecords.concat(t(this, ge).call(this, n)), this.resetRecords();
|
|
1393
1461
|
const r = this.count() - 1;
|
|
1394
|
-
return e ||
|
|
1462
|
+
return e || n.forEach((o, i) => {
|
|
1395
1463
|
const a = t(this, k).rawRecords[r - i];
|
|
1396
|
-
a && (a.__ng.rowState =
|
|
1397
|
-
}), t(this,
|
|
1464
|
+
a && (a.__ng.rowState = W.ROW_STATE.EMPTY);
|
|
1465
|
+
}), t(this, dt).call(this), r;
|
|
1398
1466
|
}, "add"));
|
|
1399
|
-
|
|
1467
|
+
E(this, "delete", /* @__PURE__ */ h((s) => {
|
|
1400
1468
|
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 =
|
|
1469
|
+
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) => {
|
|
1470
|
+
if (t(this, z)[n]) {
|
|
1471
|
+
const r = t(this, z)[n].__ng.rowid;
|
|
1472
|
+
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) => {
|
|
1473
|
+
o.__ng.rowid === r && (o.__ng.deleted = !0, o.__ng.rowState = W.ROW_STATE.DELETE);
|
|
1406
1474
|
});
|
|
1407
1475
|
}
|
|
1408
|
-
}), this.resetRecords(), t(this,
|
|
1476
|
+
}), this.resetRecords(), t(this, dt).call(this);
|
|
1409
1477
|
}, "delete"));
|
|
1410
|
-
|
|
1478
|
+
E(this, "setValue", /* @__PURE__ */ h((s, e, n) => {
|
|
1411
1479
|
var c;
|
|
1412
|
-
|
|
1413
|
-
const o = (typeof ((c = t(this,
|
|
1480
|
+
s = parseInt(s, 10);
|
|
1481
|
+
const o = (typeof ((c = t(this, O).fields) == null ? void 0 : c.get) == "function" ? t(this, O).fields.get() : []).indexOf(e);
|
|
1414
1482
|
if (o < 0) return;
|
|
1415
|
-
const i = this.getValidData()[
|
|
1483
|
+
const i = this.getValidData()[s];
|
|
1416
1484
|
if (!i) return;
|
|
1417
1485
|
const a = i.v[o];
|
|
1418
|
-
a !==
|
|
1486
|
+
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
1487
|
}, "setValue"));
|
|
1420
|
-
|
|
1421
|
-
p(this,
|
|
1422
|
-
|
|
1423
|
-
}), t(this, z).forEach((
|
|
1424
|
-
|
|
1488
|
+
E(this, "resetRecords", /* @__PURE__ */ h(() => {
|
|
1489
|
+
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) => {
|
|
1490
|
+
s.__ng.rowidx = e;
|
|
1491
|
+
}), t(this, z).forEach((s, e) => {
|
|
1492
|
+
s.__ng.i = e;
|
|
1425
1493
|
});
|
|
1426
1494
|
}, "resetRecords"));
|
|
1427
|
-
|
|
1428
|
-
d(this,
|
|
1495
|
+
E(this, "getValidData", /* @__PURE__ */ h(() => (t(this, z).length === 0 && t(this, k).rawRecords.length > 0 && this.resetRecords(), t(this, z)), "getValidData"));
|
|
1496
|
+
d(this, wt, /* @__PURE__ */ h((s) => {
|
|
1429
1497
|
var i;
|
|
1430
|
-
if (!
|
|
1431
|
-
const e = !Array.isArray(
|
|
1498
|
+
if (!s) return s;
|
|
1499
|
+
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
1500
|
const c = {};
|
|
1433
1501
|
return r.forEach((l, f) => {
|
|
1434
1502
|
c[l] = a.v ? a.v[f] : a[l];
|
|
@@ -1436,17 +1504,17 @@ const B = class B {
|
|
|
1436
1504
|
});
|
|
1437
1505
|
return e ? o[0] : o;
|
|
1438
1506
|
}, "#conv"));
|
|
1439
|
-
|
|
1440
|
-
p(this,
|
|
1507
|
+
E(this, "count", /* @__PURE__ */ h(() => this.getValidData().length, "count"));
|
|
1508
|
+
p(this, O, s), p(this, k, e), t(this, fe).call(this);
|
|
1441
1509
|
}
|
|
1442
1510
|
get source() {
|
|
1443
|
-
return t(this,
|
|
1511
|
+
return t(this, wt).call(this, t(this, k).rawRecords);
|
|
1444
1512
|
}
|
|
1445
|
-
set source(
|
|
1446
|
-
this.clear(), this.add(
|
|
1513
|
+
set source(s) {
|
|
1514
|
+
this.clear(), this.add(s, !1);
|
|
1447
1515
|
}
|
|
1448
1516
|
get nextId() {
|
|
1449
|
-
return ++
|
|
1517
|
+
return ++us(this, de)._;
|
|
1450
1518
|
}
|
|
1451
1519
|
get count() {
|
|
1452
1520
|
return t(this, z).length;
|
|
@@ -1458,66 +1526,66 @@ const B = class B {
|
|
|
1458
1526
|
return this.length;
|
|
1459
1527
|
}
|
|
1460
1528
|
};
|
|
1461
|
-
|
|
1462
|
-
|
|
1529
|
+
O = new WeakMap(), k = new WeakMap(), z = new WeakMap(), xt = new WeakMap(), de = new WeakMap(), Z = new WeakMap(), fe = new WeakMap(), dt = new WeakMap(), zt = new WeakMap(), ue = new WeakMap(), ge = new WeakMap(), wt = new WeakMap(), h(W, "ngData"), // 🎯 행 상태 정의 상수를 클래스 내부로 내재화
|
|
1530
|
+
E(W, "ROW_STATE", {
|
|
1463
1531
|
EMPTY: "EMPTY",
|
|
1464
1532
|
NORMAL: "NORMAL",
|
|
1465
1533
|
INSERT: "INSERT",
|
|
1466
1534
|
UPDATE: "UPDATE",
|
|
1467
1535
|
DELETE: "DELETE"
|
|
1468
1536
|
});
|
|
1469
|
-
let
|
|
1470
|
-
var
|
|
1471
|
-
const
|
|
1472
|
-
constructor(
|
|
1473
|
-
d(this,
|
|
1474
|
-
p(this,
|
|
1537
|
+
let Le = W;
|
|
1538
|
+
var ft;
|
|
1539
|
+
const ss = class ss {
|
|
1540
|
+
constructor(s) {
|
|
1541
|
+
d(this, ft);
|
|
1542
|
+
p(this, ft, s), this.row = new ke(this), this.data = new Le(t(this, ft), this), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.pageCnt = 25, this.viewRecords.reset = () => {
|
|
1475
1543
|
var e;
|
|
1476
|
-
(e = t(this,
|
|
1544
|
+
(e = t(this, ft).view) != null && e.redraw && t(this, ft).view.redraw();
|
|
1477
1545
|
}, this.setDataSource = (e) => {
|
|
1478
1546
|
this.data && this.data.reset(), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.data.set(e || []);
|
|
1479
1547
|
}, this.getRowState = (e) => {
|
|
1480
1548
|
var r, o;
|
|
1481
|
-
const
|
|
1482
|
-
if (!(
|
|
1483
|
-
return (o = (r = this.data.getValidData()[
|
|
1549
|
+
const n = parseInt(e, 10);
|
|
1550
|
+
if (!(n >= this.data.count()))
|
|
1551
|
+
return (o = (r = this.data.getValidData()[n]) == null ? void 0 : r.__ng) == null ? void 0 : o.rowState;
|
|
1484
1552
|
}, this.getRowPosition = () => this.row.at, this.setRowPosition = (e) => {
|
|
1485
1553
|
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,
|
|
1554
|
+
}, 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) => {
|
|
1555
|
+
e = parseInt(e, 10), this.data.setValue(e, n, r);
|
|
1488
1556
|
}, this.setDataSource([]);
|
|
1489
1557
|
}
|
|
1490
1558
|
};
|
|
1491
|
-
|
|
1492
|
-
let
|
|
1493
|
-
var
|
|
1494
|
-
const
|
|
1559
|
+
ft = new WeakMap(), h(ss, "ngDataManager");
|
|
1560
|
+
let Ie = ss;
|
|
1561
|
+
var vt, M, Wt, be;
|
|
1562
|
+
const ns = class ns {
|
|
1495
1563
|
// 🎯 이제 { name: string, type: string } 객체들의 배열로 관리합니다.
|
|
1496
|
-
constructor(
|
|
1497
|
-
d(this,
|
|
1498
|
-
d(this,
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
t(this,
|
|
1502
|
-
}), t(this,
|
|
1564
|
+
constructor(s) {
|
|
1565
|
+
d(this, vt);
|
|
1566
|
+
d(this, M, []);
|
|
1567
|
+
E(this, "add", /* @__PURE__ */ h((s, e = "string") => {
|
|
1568
|
+
s.forEach((n) => {
|
|
1569
|
+
t(this, M).some((r) => r.name === n) || t(this, M).push({ name: n, type: e });
|
|
1570
|
+
}), t(this, Wt).call(this);
|
|
1503
1571
|
}, "add"));
|
|
1504
|
-
d(this,
|
|
1505
|
-
const
|
|
1506
|
-
t(this,
|
|
1507
|
-
|
|
1508
|
-
}), p(this,
|
|
1572
|
+
d(this, Wt, /* @__PURE__ */ h(() => {
|
|
1573
|
+
const s = /* @__PURE__ */ new Map();
|
|
1574
|
+
t(this, M).forEach((e) => {
|
|
1575
|
+
s.set(e.name, e.type);
|
|
1576
|
+
}), 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
1577
|
}, "#adjust"));
|
|
1510
|
-
d(this,
|
|
1511
|
-
p(this,
|
|
1512
|
-
const
|
|
1513
|
-
if (!(!
|
|
1514
|
-
for (const e of
|
|
1515
|
-
|
|
1578
|
+
d(this, be, /* @__PURE__ */ h(() => {
|
|
1579
|
+
p(this, M, []), R.log(t(this, vt).querySelectorAll("table"));
|
|
1580
|
+
const s = Array.from(t(this, vt).querySelectorAll("table"));
|
|
1581
|
+
if (!(!s || s.length === 0)) {
|
|
1582
|
+
for (const e of s)
|
|
1583
|
+
R.log(e), $("[data-bind]", e).each((n, r) => {
|
|
1516
1584
|
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(
|
|
1585
|
+
o && t(this, M).push({ name: o, type: i });
|
|
1586
|
+
}), ["data-expr", "background-color", "color", "tooltip", "visible", "readonly", "enable-button", "enable-check", "class-expr", "icon-color", "icon-src"].forEach((n) => {
|
|
1587
|
+
$(`[${n}]`, e).each((r, o) => {
|
|
1588
|
+
var i = o.getAttribute(n);
|
|
1521
1589
|
if (i.indexOf("data.") < 0) {
|
|
1522
1590
|
const a = i.search(/[(]/g);
|
|
1523
1591
|
if (a > 0)
|
|
@@ -1531,73 +1599,73 @@ const Xe = class Xe {
|
|
|
1531
1599
|
if (a.trim() != "") {
|
|
1532
1600
|
const c = a.search(/[^_A-Za-z0-9]/g);
|
|
1533
1601
|
let l = "";
|
|
1534
|
-
c >= 0 ? l = a.substring(0, c) : i.startsWith("data.") && (l = a.replace("data.", "")), l && t(this,
|
|
1602
|
+
c >= 0 ? l = a.substring(0, c) : i.startsWith("data.") && (l = a.replace("data.", "")), l && t(this, M).push({ name: l, type: "string" });
|
|
1535
1603
|
}
|
|
1536
1604
|
});
|
|
1537
1605
|
});
|
|
1538
1606
|
});
|
|
1539
|
-
t(this,
|
|
1607
|
+
t(this, Wt).call(this);
|
|
1540
1608
|
}
|
|
1541
1609
|
}, "#init"));
|
|
1542
|
-
p(this,
|
|
1610
|
+
p(this, vt, s), t(this, be).call(this);
|
|
1543
1611
|
}
|
|
1544
1612
|
// 🎯 기존에 필드 이름만 쓰던 곳들과의 호환을 위해 이름 배열만 리턴하는 메서드 유지
|
|
1545
1613
|
get() {
|
|
1546
|
-
return t(this,
|
|
1614
|
+
return t(this, M).map((s) => s.name);
|
|
1547
1615
|
}
|
|
1548
1616
|
// 🎯 내부 객체 통째로 얻기
|
|
1549
1617
|
getFields() {
|
|
1550
|
-
return t(this,
|
|
1618
|
+
return t(this, M);
|
|
1551
1619
|
}
|
|
1552
1620
|
// 🎯 특정 필드의 데이터 타입 조회
|
|
1553
|
-
getType(
|
|
1554
|
-
const e = t(this,
|
|
1621
|
+
getType(s) {
|
|
1622
|
+
const e = t(this, M).find((n) => n.name === s);
|
|
1555
1623
|
return e ? e.type : "string";
|
|
1556
1624
|
}
|
|
1557
|
-
indexOf(
|
|
1558
|
-
return t(this,
|
|
1625
|
+
indexOf(s) {
|
|
1626
|
+
return t(this, M).findIndex((e) => e.name === s);
|
|
1559
1627
|
}
|
|
1560
|
-
includes(
|
|
1561
|
-
return t(this,
|
|
1628
|
+
includes(s) {
|
|
1629
|
+
return t(this, M).some((e) => e.name === s);
|
|
1562
1630
|
}
|
|
1563
1631
|
};
|
|
1564
|
-
|
|
1565
|
-
let
|
|
1566
|
-
var
|
|
1567
|
-
const
|
|
1632
|
+
vt = new WeakMap(), M = new WeakMap(), Wt = new WeakMap(), be = new WeakMap(), h(ns, "ngFields");
|
|
1633
|
+
let He = ns;
|
|
1634
|
+
var ut, pe, ye;
|
|
1635
|
+
const rs = class rs extends HTMLElement {
|
|
1568
1636
|
constructor() {
|
|
1569
1637
|
super();
|
|
1570
1638
|
//#created = false;
|
|
1571
|
-
d(this,
|
|
1572
|
-
d(this,
|
|
1573
|
-
d(this,
|
|
1574
|
-
this.fields = new
|
|
1639
|
+
d(this, ut);
|
|
1640
|
+
d(this, pe);
|
|
1641
|
+
d(this, ye, /* @__PURE__ */ h(() => {
|
|
1642
|
+
this.fields = new He(this), p(this, pe, new Ce(this)), R.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
|
|
1575
1643
|
}, "#init"));
|
|
1576
|
-
this.attachShadow({ mode: "open" }), p(this,
|
|
1644
|
+
this.attachShadow({ mode: "open" }), p(this, ut, new Ie(this));
|
|
1577
1645
|
}
|
|
1578
1646
|
connectedCallback() {
|
|
1579
|
-
t(this,
|
|
1647
|
+
t(this, ye).call(this);
|
|
1580
1648
|
}
|
|
1581
1649
|
disconnectedCallback() {
|
|
1582
|
-
|
|
1650
|
+
R.log("NineTable disconnected.");
|
|
1583
1651
|
}
|
|
1584
1652
|
// 🎯 외부에서 grid.data.set(...) 형태로 접근할 수 있도록 데이터 매니저 오픈
|
|
1585
1653
|
get data() {
|
|
1586
|
-
return t(this,
|
|
1654
|
+
return t(this, ut).data;
|
|
1587
1655
|
}
|
|
1588
1656
|
// 🎯 행(row) 관련 제어 접근자 오픈
|
|
1589
1657
|
get row() {
|
|
1590
|
-
return t(this,
|
|
1658
|
+
return t(this, ut).row;
|
|
1591
1659
|
}
|
|
1592
1660
|
// 🎯 전체 데이터 매니저 접근 필요할 경우
|
|
1593
1661
|
get dataManager() {
|
|
1594
|
-
return t(this,
|
|
1662
|
+
return t(this, ut);
|
|
1595
1663
|
}
|
|
1596
1664
|
};
|
|
1597
|
-
|
|
1598
|
-
let
|
|
1599
|
-
customElements.get("nine-table") || customElements.define("nine-table",
|
|
1600
|
-
const
|
|
1665
|
+
ut = new WeakMap(), pe = new WeakMap(), ye = new WeakMap(), h(rs, "NineTable");
|
|
1666
|
+
let Me = rs;
|
|
1667
|
+
customElements.get("nine-table") || customElements.define("nine-table", Me);
|
|
1668
|
+
const qt = class qt extends HTMLElement {
|
|
1601
1669
|
// 👈 커스텀 스타일용 캐시 추가
|
|
1602
1670
|
constructor() {
|
|
1603
1671
|
super();
|
|
@@ -1608,31 +1676,31 @@ const Rt = class Rt extends HTMLElement {
|
|
|
1608
1676
|
connectedCallback() {
|
|
1609
1677
|
}
|
|
1610
1678
|
};
|
|
1611
|
-
h(
|
|
1612
|
-
let
|
|
1613
|
-
var L,
|
|
1614
|
-
const
|
|
1679
|
+
h(qt, "BasicCellElement"), E(qt, "_styleCache", /* @__PURE__ */ new Map()), E(qt, "_customStyleCache", /* @__PURE__ */ new Map());
|
|
1680
|
+
let $e = qt;
|
|
1681
|
+
var L, Bt, x, Be, Pe, Fe, je, Ye;
|
|
1682
|
+
const os = class os extends $e {
|
|
1615
1683
|
constructor() {
|
|
1616
1684
|
super();
|
|
1617
1685
|
d(this, L);
|
|
1618
|
-
d(this,
|
|
1686
|
+
d(this, Bt);
|
|
1619
1687
|
d(this, x);
|
|
1620
|
-
d(this,
|
|
1621
|
-
d(this,
|
|
1622
|
-
d(this,
|
|
1623
|
-
d(this,
|
|
1624
|
-
|
|
1688
|
+
d(this, Be);
|
|
1689
|
+
d(this, Pe);
|
|
1690
|
+
d(this, Fe);
|
|
1691
|
+
d(this, je);
|
|
1692
|
+
E(this, "getDisplayText", /* @__PURE__ */ h((e) => {
|
|
1625
1693
|
if (t(this, x))
|
|
1626
1694
|
if (t(this, x).closest("tbody")) {
|
|
1627
|
-
const
|
|
1628
|
-
if (!
|
|
1695
|
+
const n = t(this, x).closest("tr").data, r = parseInt(t(this, x).dataset.row);
|
|
1696
|
+
if (!n) return "";
|
|
1629
1697
|
if (ninegrid.isNull(t(this, x).dataset.expr)) {
|
|
1630
1698
|
if (!ninegrid.isNull(t(this, x).dataset.bind))
|
|
1631
|
-
return
|
|
1699
|
+
return n[t(this, x).dataset.bind] || ninegrid.nvl(e, "");
|
|
1632
1700
|
} else try {
|
|
1633
|
-
return this.getExprValue(t(this, x).dataset.expr,
|
|
1701
|
+
return this.getExprValue(t(this, x).dataset.expr, n, r, t(this, x));
|
|
1634
1702
|
} catch {
|
|
1635
|
-
console.error(t(this, x).dataset.expr,
|
|
1703
|
+
console.error(t(this, x).dataset.expr, n, t(this, x).dataset.row);
|
|
1636
1704
|
}
|
|
1637
1705
|
return ninegrid.nvl(e, "");
|
|
1638
1706
|
} else
|
|
@@ -1641,17 +1709,17 @@ const Ze = class Ze extends qe {
|
|
|
1641
1709
|
} catch {
|
|
1642
1710
|
}
|
|
1643
1711
|
}, "getDisplayText"));
|
|
1644
|
-
d(this,
|
|
1712
|
+
d(this, Ye, /* @__PURE__ */ h(() => {
|
|
1645
1713
|
if (!(!t(this, L) || !t(this, L).template || !t(this, x).closest("tbody.bindable"))) {
|
|
1646
1714
|
var e = ninegrid.j.querySelectorAll(t(this, x)).attr("suppress");
|
|
1647
1715
|
if (e && (e = parseInt(e)), e && !isNaN(e)) {
|
|
1648
|
-
var
|
|
1649
|
-
$("th,td",
|
|
1650
|
-
var T = ninegrid.j.querySelectorAll(
|
|
1651
|
-
T &&
|
|
1716
|
+
var n = t(this, x).closest("tr"), r = [];
|
|
1717
|
+
$("th,td", n).each((m, I) => {
|
|
1718
|
+
var T = ninegrid.j.querySelectorAll(I).attr("suppress");
|
|
1719
|
+
T && I.dataset.row && (T = parseInt(T), !isNaN(T) && T <= e && r.push(T));
|
|
1652
1720
|
}), r.sort();
|
|
1653
1721
|
var o = !1;
|
|
1654
|
-
if (parseInt(
|
|
1722
|
+
if (parseInt(n.sectionRowIndex / t(this, L).template.length) > 0)
|
|
1655
1723
|
for (var i of r) {
|
|
1656
1724
|
if (i > e) break;
|
|
1657
1725
|
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 +1733,17 @@ const Ze = class Ze extends qe {
|
|
|
1665
1733
|
else
|
|
1666
1734
|
o = !0;
|
|
1667
1735
|
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
|
-
$(
|
|
1736
|
+
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}"]`);
|
|
1737
|
+
$(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
1738
|
}
|
|
1671
1739
|
}
|
|
1672
1740
|
}, "#resetSuppress"));
|
|
1673
|
-
|
|
1741
|
+
E(this, "getExprValue", /* @__PURE__ */ h((e, n, r, o) => {
|
|
1674
1742
|
if (typeof e < "u")
|
|
1675
1743
|
try {
|
|
1676
1744
|
r = parseInt(r);
|
|
1677
1745
|
const i = e.replace("()", "");
|
|
1678
|
-
return t(this, L)[i] ? t(this, L)[i].call(this,
|
|
1746
|
+
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
1747
|
} catch {
|
|
1680
1748
|
return ["NG-COMBO"].includes(this.tagName) ? "" : e;
|
|
1681
1749
|
}
|
|
@@ -1684,16 +1752,16 @@ const Ze = class Ze extends qe {
|
|
|
1684
1752
|
}, "getExprValue"));
|
|
1685
1753
|
}
|
|
1686
1754
|
connectedCallback() {
|
|
1687
|
-
super.connectedCallback(), p(this, L, this.getRootNode().host), p(this, x, this.closest("th,td")), p(this,
|
|
1755
|
+
super.connectedCallback(), p(this, L, this.getRootNode().host), p(this, x, this.closest("th,td")), p(this, Bt, t(this, x).closest("tr"));
|
|
1688
1756
|
}
|
|
1689
1757
|
get value() {
|
|
1690
1758
|
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
1759
|
return e ?? "";
|
|
1692
1760
|
}
|
|
1693
1761
|
set value(e) {
|
|
1694
|
-
var
|
|
1762
|
+
var n = parseInt(t(this, x).dataset.row);
|
|
1695
1763
|
const r = this.getAttribute("update-row-state") != "false";
|
|
1696
|
-
|
|
1764
|
+
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
1765
|
}
|
|
1698
1766
|
get row() {
|
|
1699
1767
|
return parseInt(t(this, x).dataset.row);
|
|
@@ -1703,12 +1771,12 @@ const Ze = class Ze extends qe {
|
|
|
1703
1771
|
}
|
|
1704
1772
|
refresh() {
|
|
1705
1773
|
const e = t(this, x).dataset.bind;
|
|
1706
|
-
return parseInt(t(this, x).dataset.row), t(this,
|
|
1774
|
+
return parseInt(t(this, x).dataset.row), t(this, Bt).data[e];
|
|
1707
1775
|
}
|
|
1708
1776
|
};
|
|
1709
|
-
L = new WeakMap(),
|
|
1710
|
-
let
|
|
1711
|
-
const
|
|
1777
|
+
L = new WeakMap(), Bt = new WeakMap(), x = new WeakMap(), Be = new WeakMap(), Pe = new WeakMap(), Fe = new WeakMap(), je = new WeakMap(), Ye = new WeakMap(), h(os, "CellElement");
|
|
1778
|
+
let _e = os;
|
|
1779
|
+
const is = class is extends _e {
|
|
1712
1780
|
constructor() {
|
|
1713
1781
|
super();
|
|
1714
1782
|
}
|
|
@@ -1719,21 +1787,21 @@ const Ge = class Ge extends Te {
|
|
|
1719
1787
|
return super.refresh();
|
|
1720
1788
|
}
|
|
1721
1789
|
};
|
|
1722
|
-
h(
|
|
1723
|
-
let
|
|
1724
|
-
var
|
|
1725
|
-
const
|
|
1790
|
+
h(is, "EditableCellElement");
|
|
1791
|
+
let Ne = is;
|
|
1792
|
+
var Pt, gt, St, Rt, me, J, Ve;
|
|
1793
|
+
const as = class as extends Ne {
|
|
1726
1794
|
constructor() {
|
|
1727
1795
|
super();
|
|
1728
|
-
d(this,
|
|
1729
|
-
d(this,
|
|
1730
|
-
d(this,
|
|
1731
|
-
d(this,
|
|
1732
|
-
d(this,
|
|
1733
|
-
d(this,
|
|
1734
|
-
|
|
1796
|
+
d(this, Pt);
|
|
1797
|
+
d(this, gt);
|
|
1798
|
+
d(this, St);
|
|
1799
|
+
d(this, Rt);
|
|
1800
|
+
d(this, me);
|
|
1801
|
+
d(this, J);
|
|
1802
|
+
E(this, "refresh", /* @__PURE__ */ h(() => {
|
|
1735
1803
|
const e = super.refresh();
|
|
1736
|
-
t(this,
|
|
1804
|
+
t(this, Pt).value = e;
|
|
1737
1805
|
}, "refresh"));
|
|
1738
1806
|
/**
|
|
1739
1807
|
dataRefresh = (v) => {
|
|
@@ -1765,36 +1833,36 @@ const Je = class Je extends Ce {
|
|
|
1765
1833
|
if (!v) this.reset();
|
|
1766
1834
|
};
|
|
1767
1835
|
*/
|
|
1768
|
-
d(this,
|
|
1836
|
+
d(this, Ve, /* @__PURE__ */ h((e) => {
|
|
1769
1837
|
if (!["Escape", "Enter", "Tab", "Home", "End", "ArrowLeft", "ArrowRight", "PageUp", "PageDown", "Backspace", "Delete"].includes(e.code)) {
|
|
1770
|
-
if (t(this,
|
|
1838
|
+
if (t(this, gt) == "number") {
|
|
1771
1839
|
let o = [];
|
|
1772
|
-
if (t(this,
|
|
1773
|
-
var
|
|
1840
|
+
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) {
|
|
1841
|
+
var n = e.target.value, r = n.indexOf(".");
|
|
1774
1842
|
if (r >= 0) {
|
|
1775
|
-
var
|
|
1776
|
-
|
|
1843
|
+
var n = n.substr(r + 1, n.length);
|
|
1844
|
+
n.length >= Number(t(this, J)) && e.preventDefault();
|
|
1777
1845
|
}
|
|
1778
1846
|
}
|
|
1779
1847
|
}
|
|
1780
|
-
t(this,
|
|
1848
|
+
t(this, St) && ninegrid.getByteLength(e.target.value) >= Number(t(this, St)) && e.target.selectionStart == e.target.selectionEnd && e.preventDefault();
|
|
1781
1849
|
}
|
|
1782
1850
|
}, "#onKeyDown"));
|
|
1783
|
-
if (this.applyBaseStyle(), p(this,
|
|
1851
|
+
if (this.applyBaseStyle(), p(this, gt, this.getAttribute("type") || "text"), p(this, St, this.getAttribute("maxbyte")), p(this, Rt, this.getAttribute("min")), p(this, me, this.getAttribute("max")), p(this, J, this.getAttribute("scale")), !["text", "number"].includes(t(this, gt))) throw `invalid type : ${t(this, gt)}`;
|
|
1784
1852
|
}
|
|
1785
1853
|
connectedCallback() {
|
|
1786
|
-
for (var e = [],
|
|
1787
|
-
["type", "maxlength", "maxbyte", "min", "max", "step", "scale", "text-align"].includes(this.attributes[
|
|
1854
|
+
for (var e = [], n = 0; n < this.attributes.length; n++)
|
|
1855
|
+
["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
1856
|
this.innerHTML = `
|
|
1789
1857
|
<input type="text"
|
|
1790
1858
|
${e.join(" ")}
|
|
1791
1859
|
ondragstart="return false;"
|
|
1792
1860
|
>
|
|
1793
|
-
`, super.connectedCallback(), p(this,
|
|
1861
|
+
`, super.connectedCallback(), p(this, Pt, this.querySelector("input"));
|
|
1794
1862
|
}
|
|
1795
1863
|
};
|
|
1796
|
-
|
|
1797
|
-
let
|
|
1864
|
+
Pt = new WeakMap(), gt = new WeakMap(), St = new WeakMap(), Rt = new WeakMap(), me = new WeakMap(), J = new WeakMap(), Ve = new WeakMap(), h(as, "CellInputText");
|
|
1865
|
+
let De = as;
|
|
1798
1866
|
customElements.get("cell-input-text");
|
|
1799
|
-
customElements.get("cell-input") || customElements.define("cell-input",
|
|
1867
|
+
customElements.get("cell-input") || customElements.define("cell-input", De);
|
|
1800
1868
|
//# sourceMappingURL=nine-table.js.map
|