@ninebone/table 0.0.770 → 0.0.772
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 +573 -518
- package/dist/nine-table.js.map +1 -1
- package/dist/nine-table.umd.js +6 -6
- package/dist/nine-table.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/nine-table.js
CHANGED
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var bs = Object.defineProperty;
|
|
2
|
+
var ps = (T) => {
|
|
3
3
|
throw TypeError(T);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var h = (T,
|
|
7
|
-
var q = (T,
|
|
8
|
-
var t = (T,
|
|
9
|
-
var
|
|
5
|
+
var ws = (T, n, e) => n in T ? bs(T, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : T[n] = e;
|
|
6
|
+
var h = (T, n) => bs(T, "name", { value: n, configurable: !0 });
|
|
7
|
+
var q = (T, n, e) => ws(T, typeof n != "symbol" ? n + "" : n, e), Se = (T, n, e) => n.has(T) || ps("Cannot " + e);
|
|
8
|
+
var t = (T, n, e) => (Se(T, n, "read from private field"), e ? e.call(T) : n.get(T)), d = (T, n, e) => n.has(T) ? ps("Cannot add the same private member more than once") : n instanceof WeakSet ? n.add(T) : n.set(T, e), p = (T, n, e, s) => (Se(T, n, "write to private field"), s ? s.call(T, e) : n.set(T, e), e), Z = (T, n, e) => (Se(T, n, "access private method"), e);
|
|
9
|
+
var ys = (T, n, e, s) => ({
|
|
10
10
|
set _(r) {
|
|
11
|
-
p(T,
|
|
11
|
+
p(T, n, r, e);
|
|
12
12
|
},
|
|
13
13
|
get _() {
|
|
14
|
-
return t(T,
|
|
14
|
+
return t(T, n, s);
|
|
15
15
|
}
|
|
16
16
|
});
|
|
17
|
-
import { trace as
|
|
18
|
-
const
|
|
17
|
+
import { trace as vs } from "@ninebone/util";
|
|
18
|
+
const Ke = class Ke extends vs.constructor {
|
|
19
19
|
constructor() {
|
|
20
20
|
super(), this.init("nine-table", "green");
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
|
-
h(
|
|
24
|
-
let
|
|
25
|
-
const S = new
|
|
26
|
-
var B,
|
|
27
|
-
const
|
|
23
|
+
h(Ke, "Trace");
|
|
24
|
+
let Ae = Ke;
|
|
25
|
+
const S = new Ae();
|
|
26
|
+
var B, U, E, J, Q, tt, Xt, et, Gt;
|
|
27
|
+
const Ze = class Ze extends HTMLElement {
|
|
28
28
|
constructor() {
|
|
29
29
|
super();
|
|
30
30
|
d(this, B);
|
|
31
|
-
d(this,
|
|
31
|
+
d(this, U, !1);
|
|
32
32
|
d(this, E);
|
|
33
|
+
d(this, J);
|
|
34
|
+
d(this, Q);
|
|
33
35
|
d(this, tt);
|
|
34
|
-
d(this,
|
|
35
|
-
d(this, st);
|
|
36
|
-
d(this, Yt, /* @__PURE__ */ h(() => {
|
|
36
|
+
d(this, Xt, /* @__PURE__ */ h(() => {
|
|
37
37
|
if (!t(this, B)) return;
|
|
38
38
|
const e = t(this, B).querySelector(".ng-container-body .ng-part-body");
|
|
39
|
-
e && (p(this,
|
|
39
|
+
e && (p(this, tt, new ResizeObserver(() => {
|
|
40
40
|
this.refresh();
|
|
41
|
-
})), t(this,
|
|
41
|
+
})), t(this, tt).observe(e));
|
|
42
42
|
}, "#observeResize"));
|
|
43
43
|
q(this, "refresh", /* @__PURE__ */ h(() => {
|
|
44
|
-
if (!t(this, B) || !t(this, E) || t(this,
|
|
45
|
-
const e = t(this, E).container,
|
|
46
|
-
if (!
|
|
47
|
-
const r = t(this, E).track, o = t(this, E).thumb, i = t(this, B).querySelector(".ng-container-bottom"), a = e.clientWidth, c =
|
|
44
|
+
if (!t(this, B) || !t(this, E) || t(this, U)) return;
|
|
45
|
+
const e = t(this, E).container, s = e.querySelector("table");
|
|
46
|
+
if (!s) return;
|
|
47
|
+
const r = t(this, E).track, o = t(this, E).thumb, i = t(this, B).querySelector(".ng-container-bottom"), a = e.clientWidth, c = s.scrollWidth;
|
|
48
48
|
if (a !== 0 && c > a)
|
|
49
49
|
i && (i.style.display = "flex");
|
|
50
50
|
else {
|
|
@@ -61,33 +61,33 @@ const Ke = class Ke extends HTMLElement {
|
|
|
61
61
|
const y = l - f;
|
|
62
62
|
g > y && (g = y), o.style.left = `${g}px`, t(this, E).left.disabled = g === 0, t(this, E).right.disabled = g >= y - 1;
|
|
63
63
|
}, "refresh"));
|
|
64
|
-
d(this,
|
|
64
|
+
d(this, et, /* @__PURE__ */ h((e) => {
|
|
65
65
|
if (!t(this, E)) return !1;
|
|
66
|
-
const
|
|
66
|
+
const s = t(this, E).container, r = s.querySelector("table");
|
|
67
67
|
if (!r) return !1;
|
|
68
68
|
const o = t(this, E).track.getBoundingClientRect(), i = t(this, E).thumb.clientWidth;
|
|
69
69
|
let a = e;
|
|
70
70
|
a < 0 && (a = 0);
|
|
71
71
|
const c = o.width - i;
|
|
72
72
|
a > c && (a = c), a = parseInt(a, 10), t(this, E).thumb.style.left = `${a}px`, t(this, E).left.disabled = a === 0, t(this, E).right.disabled = a >= c - 1;
|
|
73
|
-
const l =
|
|
74
|
-
return c > 0 && u > 0 && (
|
|
73
|
+
const l = s.clientWidth, u = r.scrollWidth - l;
|
|
74
|
+
return c > 0 && u > 0 && (s.scrollLeft = a / c * u), a > 0 && a < c - 1;
|
|
75
75
|
}, "#thumbMoveTo"));
|
|
76
|
-
d(this,
|
|
76
|
+
d(this, Gt, /* @__PURE__ */ h(() => {
|
|
77
77
|
const e = /* @__PURE__ */ h((r) => {
|
|
78
|
-
clearInterval(t(this,
|
|
78
|
+
clearInterval(t(this, J)), clearInterval(t(this, Q));
|
|
79
79
|
const o = parseInt(t(this, E).thumb.style.left || 0, 10);
|
|
80
|
-
t(this,
|
|
81
|
-
clearInterval(t(this,
|
|
80
|
+
t(this, et).call(this, o + r), p(this, J, setInterval(() => {
|
|
81
|
+
clearInterval(t(this, J)), p(this, Q, setInterval(() => {
|
|
82
82
|
const i = parseInt(t(this, E).thumb.style.left || 0, 10);
|
|
83
|
-
t(this,
|
|
83
|
+
t(this, et).call(this, i + r) || clearInterval(t(this, Q));
|
|
84
84
|
}, 50));
|
|
85
85
|
}, 500));
|
|
86
|
-
}, "delayScroll"),
|
|
87
|
-
clearInterval(t(this,
|
|
86
|
+
}, "delayScroll"), s = /* @__PURE__ */ h(() => {
|
|
87
|
+
clearInterval(t(this, J)), clearInterval(t(this, Q));
|
|
88
88
|
}, "clearTimer");
|
|
89
89
|
["mouseup", "mouseleave", "touchend"].forEach((r) => {
|
|
90
|
-
t(this, E).left.addEventListener(r,
|
|
90
|
+
t(this, E).left.addEventListener(r, s), t(this, E).right.addEventListener(r, s), t(this, E).track.addEventListener(r, s);
|
|
91
91
|
}), t(this, E).left.addEventListener("mousedown", (r) => {
|
|
92
92
|
r.button === 0 && e(-20);
|
|
93
93
|
}), t(this, E).right.addEventListener("mousedown", (r) => {
|
|
@@ -96,16 +96,16 @@ const Ke = class Ke extends HTMLElement {
|
|
|
96
96
|
if (r.button !== 0) return;
|
|
97
97
|
r.preventDefault();
|
|
98
98
|
const o = t(this, E).track.getBoundingClientRect(), i = t(this, E).thumb.clientWidth;
|
|
99
|
-
t(this,
|
|
99
|
+
t(this, et).call(this, r.clientX - o.left - i / 2);
|
|
100
100
|
}), t(this, E).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, U, !0), this.shiftX = r.clientX - t(this, E).thumb.getBoundingClientRect().left;
|
|
103
103
|
const o = /* @__PURE__ */ h((a) => {
|
|
104
|
-
if (!t(this,
|
|
104
|
+
if (!t(this, U)) return;
|
|
105
105
|
const c = t(this, E).track.getBoundingClientRect();
|
|
106
|
-
t(this,
|
|
106
|
+
t(this, et).call(this, a.clientX - c.left - this.shiftX);
|
|
107
107
|
}, "onMouseMove"), i = /* @__PURE__ */ h(() => {
|
|
108
|
-
p(this,
|
|
108
|
+
p(this, U, !1), s(), 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
|
});
|
|
@@ -177,49 +177,49 @@ const Ke = class Ke 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 s = t(this, B).querySelector(".ng-container-body .ng-part-body");
|
|
181
|
+
if (!s) {
|
|
182
182
|
setTimeout(e, 10);
|
|
183
183
|
return;
|
|
184
184
|
}
|
|
185
185
|
p(this, E, {
|
|
186
|
-
container:
|
|
186
|
+
container: s,
|
|
187
187
|
track: this.querySelector(".ng-scroll-track"),
|
|
188
188
|
thumb: this.querySelector(".ng-scroll-thumb"),
|
|
189
189
|
left: this.querySelector(".ng-scroll-left"),
|
|
190
190
|
right: this.querySelector(".ng-scroll-right")
|
|
191
|
-
}),
|
|
192
|
-
t(this,
|
|
193
|
-
}), t(this,
|
|
191
|
+
}), s.addEventListener("scroll", () => {
|
|
192
|
+
t(this, U) || this.refresh();
|
|
193
|
+
}), t(this, Gt).call(this), t(this, Xt).call(this), this.refresh();
|
|
194
194
|
}, "initWhenReady");
|
|
195
195
|
e();
|
|
196
196
|
}
|
|
197
197
|
disconnectedCallback() {
|
|
198
|
-
t(this,
|
|
198
|
+
t(this, tt) && t(this, tt).disconnect();
|
|
199
199
|
}
|
|
200
200
|
};
|
|
201
|
-
B = new WeakMap(),
|
|
202
|
-
let
|
|
203
|
-
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar",
|
|
204
|
-
var
|
|
205
|
-
const
|
|
201
|
+
B = new WeakMap(), U = new WeakMap(), E = new WeakMap(), J = new WeakMap(), Q = new WeakMap(), tt = new WeakMap(), Xt = new WeakMap(), et = new WeakMap(), Gt = new WeakMap(), h(Ze, "NineTableHScrollBar");
|
|
202
|
+
let Re = Ze;
|
|
203
|
+
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", Re);
|
|
204
|
+
var st, nt, gt, k, qt, Tt, Kt;
|
|
205
|
+
const Je = class Je extends HTMLElement {
|
|
206
206
|
constructor() {
|
|
207
207
|
super();
|
|
208
|
-
d(this,
|
|
209
|
-
d(this,
|
|
210
|
-
d(this,
|
|
208
|
+
d(this, st);
|
|
209
|
+
d(this, nt);
|
|
210
|
+
d(this, gt, !1);
|
|
211
211
|
d(this, k);
|
|
212
|
+
d(this, qt, 0);
|
|
212
213
|
d(this, Tt, 0);
|
|
213
|
-
d(this, Ct, 0);
|
|
214
214
|
q(this, "refresh", /* @__PURE__ */ h(() => {
|
|
215
|
-
if (S.log("vscrollbar.refresh"), !t(this,
|
|
216
|
-
const e = t(this, k).container,
|
|
215
|
+
if (S.log("vscrollbar.refresh"), !t(this, st) || !t(this, k)) return;
|
|
216
|
+
const e = t(this, k).container, s = t(this, k).track, r = t(this, k).thumb, o = e.clientHeight, i = t(this, st).data.length, a = t(this, nt).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 = s.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`;
|
|
@@ -230,32 +230,32 @@ const Ge = class Ge extends HTMLElement {
|
|
|
230
230
|
const y = l - f;
|
|
231
231
|
g < 0 && (g = 0), g > y && (g = y), r.style.top = `${g}px`, t(this, k).top.disabled = u <= 0, t(this, k).bottom.disabled = u >= b - 1;
|
|
232
232
|
}, "refresh"));
|
|
233
|
-
d(this,
|
|
233
|
+
d(this, Kt, /* @__PURE__ */ h(() => {
|
|
234
234
|
S.log("nine-table-vscrollbar.#init");
|
|
235
|
-
const e = t(this, k).container,
|
|
236
|
-
const o = (t(this,
|
|
235
|
+
const e = t(this, k).container, s = /* @__PURE__ */ h(() => {
|
|
236
|
+
const o = (t(this, st).data.get() || []).length, i = t(this, nt).getRowHeight();
|
|
237
237
|
return o * i;
|
|
238
238
|
}, "getContentHeight");
|
|
239
239
|
t(this, k).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, gt, !0), p(this, qt, r.clientY), p(this, Tt, e.scrollTop);
|
|
242
242
|
const o = /* @__PURE__ */ h((a) => {
|
|
243
|
-
if (!t(this,
|
|
244
|
-
const c = t(this, k).track.getBoundingClientRect(), l = t(this, k).thumb.clientHeight, u = c.height - l, b = a.clientY - t(this,
|
|
243
|
+
if (!t(this, gt)) return;
|
|
244
|
+
const c = t(this, k).track.getBoundingClientRect(), l = t(this, k).thumb.clientHeight, u = c.height - l, b = a.clientY - t(this, qt), g = e.clientHeight, y = s(), w = Math.max(y - g, 1);
|
|
245
245
|
if (u > 0 && w > 0) {
|
|
246
246
|
const v = b / u * w;
|
|
247
|
-
let m = t(this,
|
|
247
|
+
let m = t(this, Tt) + v;
|
|
248
248
|
const C = Math.max(0, y - g);
|
|
249
249
|
m < 0 && (m = 0), m > C && (m = C), e.scrollTop = m;
|
|
250
250
|
}
|
|
251
251
|
this.refresh();
|
|
252
252
|
}, "onMouseMove"), i = /* @__PURE__ */ h(() => {
|
|
253
|
-
p(this,
|
|
253
|
+
p(this, gt, !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, k).track.addEventListener("mousedown", (r) => {
|
|
257
257
|
if (r.button !== 0 || r.target === t(this, k).thumb) return;
|
|
258
|
-
const o = t(this, k).track.getBoundingClientRect(), i = t(this, k).thumb.clientHeight, a = r.clientY - o.top - i / 2, l = o.height - i, f = e.clientHeight, u =
|
|
258
|
+
const o = t(this, k).track.getBoundingClientRect(), i = t(this, k).thumb.clientHeight, a = r.clientY - o.top - i / 2, l = o.height - i, f = e.clientHeight, u = s(), 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 Ge = class Ge extends HTMLElement {
|
|
|
269
269
|
}, "#init"));
|
|
270
270
|
}
|
|
271
271
|
connectedCallback() {
|
|
272
|
-
p(this,
|
|
272
|
+
p(this, st, this.getRootNode().host), p(this, nt, this.closest("nine-table-sheet")), this.innerHTML = `
|
|
273
273
|
<style>
|
|
274
274
|
nine-table-vscrollbar {
|
|
275
275
|
display: flex;
|
|
@@ -334,48 +334,48 @@ const Ge = class Ge 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 s = t(this, nt).querySelector(".ng-container-body .ng-part-body");
|
|
338
|
+
if (!s) {
|
|
339
339
|
setTimeout(e, 10);
|
|
340
340
|
return;
|
|
341
341
|
}
|
|
342
342
|
p(this, k, {
|
|
343
|
-
container:
|
|
343
|
+
container: s,
|
|
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, Kt).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 j, R,
|
|
357
|
-
const
|
|
358
|
-
constructor(
|
|
353
|
+
st = new WeakMap(), nt = new WeakMap(), gt = new WeakMap(), k = new WeakMap(), qt = new WeakMap(), Tt = new WeakMap(), Kt = new WeakMap(), h(Je, "NineTableVScrollBar");
|
|
354
|
+
let Ee = Je;
|
|
355
|
+
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar", Ee);
|
|
356
|
+
var j, R, rt, P, D, X, ot, Ct, Be, Pe, Zt, Jt, kt, Lt, It, Qt, te, Ht, Fe, bt, Mt, ee;
|
|
357
|
+
const Qe = class Qe {
|
|
358
|
+
constructor(n) {
|
|
359
359
|
d(this, j);
|
|
360
360
|
d(this, R);
|
|
361
|
-
d(this,
|
|
361
|
+
d(this, rt);
|
|
362
362
|
d(this, P, /* @__PURE__ */ new Map());
|
|
363
363
|
d(this, D, null);
|
|
364
|
-
d(this,
|
|
365
|
-
d(this,
|
|
366
|
-
d(this,
|
|
367
|
-
d(this,
|
|
368
|
-
d(this,
|
|
364
|
+
d(this, X, null);
|
|
365
|
+
d(this, ot, 0);
|
|
366
|
+
d(this, Ct, 40);
|
|
367
|
+
d(this, Be, !1);
|
|
368
|
+
d(this, Pe, !1);
|
|
369
369
|
//#ticking = false; // 🎯 고속 스크롤 스로틀링용 플래그
|
|
370
|
-
d(this,
|
|
370
|
+
d(this, Zt, 3);
|
|
371
371
|
q(this, "refresh", /* @__PURE__ */ h(() => {
|
|
372
372
|
var e;
|
|
373
373
|
S.log("rowManager.refresh");
|
|
374
|
-
const
|
|
375
|
-
|
|
374
|
+
const n = t(this, R).querySelector(".ng-container-body .ng-part-body");
|
|
375
|
+
n && (t(this, kt).call(this), t(this, Lt).call(this), t(this, bt).call(this, n.scrollTop), (e = t(this, R).querySelector("nine-table-vscrollbar")) == null || e.refresh());
|
|
376
376
|
}, "refresh"));
|
|
377
377
|
q(this, "initialize", /* @__PURE__ */ h(() => {
|
|
378
|
-
S.log("rowManager.initialize"), p(this,
|
|
378
|
+
S.log("rowManager.initialize"), p(this, rt, {
|
|
379
379
|
scrollTables: t(this, R).querySelectorAll(".ng-part-body table"),
|
|
380
380
|
firstTr: t(this, R).querySelector(".ng-container-body .ng-part-body tbody.bindable-tbody tr:not(.nodata)")
|
|
381
381
|
}), p(this, D, null), t(this, P).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((i) => {
|
|
@@ -388,56 +388,56 @@ const Ze = class Ze {
|
|
|
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 n = t(this, R).querySelector(".ng-container-body .ng-part-body"), e = t(this, R).querySelector(".ng-container-left .ng-part-body"), s = t(this, R).querySelector(".ng-container-right .ng-part-body"), r = t(this, R).querySelector(".ng-container-body .ng-part-header"), o = t(this, R).querySelector(".ng-container-body .ng-part-footer");
|
|
392
|
+
if (n) {
|
|
393
|
+
t(this, kt).call(this), t(this, Ht).call(this), t(this, Lt).call(this), t(this, bt).call(this, n.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
|
+
n && n.scrollTop !== l && (n.scrollTop = l), e && e.scrollTop !== l && (e.scrollTop = l), s && s.scrollTop !== l && (s.scrollTop = l), r && r.scrollLeft !== f && (r.scrollLeft = f), o && o.scrollLeft !== f && (o.scrollLeft = f), t(this, bt).call(this, l), (u = t(this, R).querySelector("nine-table-vscrollbar")) == null || u.refresh(), i = !1;
|
|
401
401
|
}, "handleContainerScroll");
|
|
402
|
-
[
|
|
402
|
+
[n, e, s].forEach((c) => {
|
|
403
403
|
c == null || c.addEventListener("scroll", (l) => {
|
|
404
404
|
S.log(l), S.log("rowManager.scroll event"), a(c);
|
|
405
405
|
});
|
|
406
406
|
});
|
|
407
407
|
}
|
|
408
408
|
}, "initialize"));
|
|
409
|
-
d(this,
|
|
409
|
+
d(this, Jt, /* @__PURE__ */ h((n, e) => {
|
|
410
410
|
S.log("rowManager.#renderRows");
|
|
411
|
-
const
|
|
412
|
-
if (!
|
|
413
|
-
const r =
|
|
411
|
+
const s = t(this, P).get(e);
|
|
412
|
+
if (!s || s.length === 0) return;
|
|
413
|
+
const r = n.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, Ct); a++)
|
|
418
|
+
s.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, rt).firstTr = r.querySelector("tr:not(.nodata)"));
|
|
422
422
|
}, "#renderRows"));
|
|
423
|
-
d(this,
|
|
423
|
+
d(this, kt, /* @__PURE__ */ h(() => {
|
|
424
424
|
if (t(this, D) !== null && t(this, D) > 0)
|
|
425
425
|
return t(this, D);
|
|
426
|
-
const
|
|
426
|
+
const n = t(this, R).querySelector(".ng-container-body .ng-part-body");
|
|
427
427
|
S.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 (S.log(
|
|
432
|
-
|
|
433
|
-
const r =
|
|
430
|
+
const s = n.querySelector("tbody.bindable-tbody");
|
|
431
|
+
if (S.log(s), !s) throw new Error("invalid dom");
|
|
432
|
+
s.querySelectorAll("tr:not(.nodata)").forEach((b) => b.remove());
|
|
433
|
+
const r = s.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) : s.appendChild(o);
|
|
437
437
|
const i = t(this, R), 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 = s.querySelectorAll("tr");
|
|
441
441
|
return u.forEach((b) => {
|
|
442
442
|
let g = b.offsetHeight || b.getBoundingClientRect().height;
|
|
443
443
|
if (g === 0) {
|
|
@@ -445,29 +445,29 @@ const Ze = class Ze {
|
|
|
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, D, f), t(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, It).call(this), t(this, D));
|
|
449
449
|
}, "#measureAndCacheHeight"));
|
|
450
|
-
d(this,
|
|
450
|
+
d(this, Lt, /* @__PURE__ */ h(() => {
|
|
451
451
|
S.log("rowManager.#updateVirtualScrollHeight");
|
|
452
|
-
const e = (t(this, j).data.get() || []).length,
|
|
453
|
-
S.log("🔍 [VirtualHeight]", { totalCount: e, rowHeight:
|
|
452
|
+
const e = (t(this, j).data.get() || []).length, s = t(this, D), r = e * s;
|
|
453
|
+
S.log("🔍 [VirtualHeight]", { totalCount: e, rowHeight: s, totalVirtualHeight: r }), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((o) => {
|
|
454
454
|
const i = t(this, R).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, It, /* @__PURE__ */ h(() => {
|
|
461
|
+
if (t(this, ot) > 0 && t(this, D) > 0) {
|
|
462
|
+
const n = Math.ceil(t(this, ot) / t(this, D));
|
|
463
|
+
p(this, Ct, n + t(this, Zt));
|
|
464
464
|
}
|
|
465
465
|
}, "#updateRowCount"));
|
|
466
|
-
d(this,
|
|
466
|
+
d(this, Qt, /* @__PURE__ */ h(() => {
|
|
467
467
|
var a, c, l, f, u, b;
|
|
468
|
-
const
|
|
468
|
+
const n = t(this, R).querySelector(".ng-container-left .ng-part-body table"), e = t(this, R).querySelector(".ng-container-body .ng-part-body table"), s = t(this, R).querySelector(".ng-container-right .ng-part-body table");
|
|
469
469
|
if (e) {
|
|
470
|
-
const g =
|
|
470
|
+
const g = n ? Array.from(n.querySelectorAll("tbody tr")) : [], y = Array.from(e.querySelectorAll("tbody tr")), w = s ? Array.from(s.querySelectorAll("tbody tr")) : [], v = Math.max(g.length, y.length, w.length);
|
|
471
471
|
for (let m = 0; m < v; m++) {
|
|
472
472
|
const C = [
|
|
473
473
|
((a = g[m]) == null ? void 0 : a.getBoundingClientRect().height) || 0,
|
|
@@ -490,38 +490,38 @@ const Ze = class Ze {
|
|
|
490
490
|
}
|
|
491
491
|
}
|
|
492
492
|
}, "#syncRowHeights"));
|
|
493
|
-
d(this,
|
|
494
|
-
!t(this, R) || !(t(this, R) instanceof HTMLElement) || (p(this,
|
|
495
|
-
for (const e of
|
|
496
|
-
const
|
|
497
|
-
if (!
|
|
493
|
+
d(this, te, /* @__PURE__ */ h(() => {
|
|
494
|
+
!t(this, R) || !(t(this, R) instanceof HTMLElement) || (p(this, X, new ResizeObserver((n) => {
|
|
495
|
+
for (const e of n) {
|
|
496
|
+
const s = e.target;
|
|
497
|
+
if (!s.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 = s.querySelector(".ng-part-header"), a = s.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, ot) !== c && (p(this, ot, c), t(this, It).call(this), t(this, D) !== null && (t(this, Ht).call(this), this.refresh()));
|
|
505
505
|
}
|
|
506
506
|
}
|
|
507
|
-
})), t(this,
|
|
507
|
+
})), t(this, X).observe(t(this, R)));
|
|
508
508
|
}, "#initResizeObserver"));
|
|
509
|
-
d(this,
|
|
510
|
-
S.log("rowManager.#renderAllContainers"), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((
|
|
511
|
-
const e = t(this, R).querySelector(
|
|
512
|
-
e && e.querySelector(".ng-part-body tbody.bindable-tbody") && t(this,
|
|
513
|
-
}), t(this,
|
|
509
|
+
d(this, Ht, /* @__PURE__ */ h(() => {
|
|
510
|
+
S.log("rowManager.#renderAllContainers"), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((n) => {
|
|
511
|
+
const e = t(this, R).querySelector(n);
|
|
512
|
+
e && e.querySelector(".ng-part-body tbody.bindable-tbody") && t(this, Jt).call(this, e, n);
|
|
513
|
+
}), t(this, ee).call(this), t(this, Qt).call(this);
|
|
514
514
|
}, "#renderAllContainers"));
|
|
515
|
-
d(this,
|
|
515
|
+
d(this, Fe, /* @__PURE__ */ h((n) => {
|
|
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 s = t(this, R).querySelector(e);
|
|
519
|
+
if (!s) return;
|
|
520
|
+
const r = s.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
521
521
|
if (!r) return;
|
|
522
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 = n + Math.floor(u / i);
|
|
525
525
|
if (b >= c) {
|
|
526
526
|
f.style.visibility = "hidden";
|
|
527
527
|
return;
|
|
@@ -531,19 +531,19 @@ const Ze = class Ze {
|
|
|
531
531
|
});
|
|
532
532
|
});
|
|
533
533
|
}, "#adjustBufferRows"));
|
|
534
|
-
d(this,
|
|
534
|
+
d(this, bt, /* @__PURE__ */ h((n) => {
|
|
535
535
|
var u, b;
|
|
536
536
|
const e = t(this, D);
|
|
537
537
|
if (!e || e <= 0) return;
|
|
538
|
-
const
|
|
539
|
-
if (
|
|
538
|
+
const s = t(this, j).data.length;
|
|
539
|
+
if (s === 0) return;
|
|
540
540
|
const r = ((u = t(this, P).get(".ng-container-body")) == null ? void 0 : u.length) || 1, o = t(this, R).querySelector(".ng-container-body .ng-part-body");
|
|
541
541
|
S.log("bodyContainer.clientHeight", o.clientHeight);
|
|
542
|
-
const i = Math.max(0,
|
|
542
|
+
const i = Math.max(0, s - Math.floor(o.clientHeight / e)), a = Math.min(i, Math.max(0, Math.floor(n / e)));
|
|
543
543
|
let c = Math.floor(a * e);
|
|
544
|
-
S.log(`📜 [Scroll Calc] maxStartIndex: ${i}, startIndex: ${a}, offsetY: ${c}`), a === i && S.log(`📜 [Scroll Inspect] scrollTop: ${
|
|
545
|
-
const l = t(this,
|
|
546
|
-
(b = t(this,
|
|
544
|
+
S.log(`📜 [Scroll Calc] maxStartIndex: ${i}, startIndex: ${a}, offsetY: ${c}`), a === i && S.log(`📜 [Scroll Inspect] scrollTop: ${n}, rowHeight: ${e}, maxStartIndex: ${i}, startIndex: ${a}, offsetY: ${c}`);
|
|
545
|
+
const l = t(this, rt).firstTr, f = l && l.dataset.row !== void 0 ? parseInt(l.dataset.row, 10) : -1;
|
|
546
|
+
(b = t(this, rt)) == null || b.scrollTables.forEach((g) => {
|
|
547
547
|
g.style.transform = `translate3d(0, ${c}px, 0)`;
|
|
548
548
|
}), f !== a && (S.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, R).querySelector(g);
|
|
@@ -552,7 +552,7 @@ const Ze = class Ze {
|
|
|
552
552
|
if (!w) return;
|
|
553
553
|
Array.from(w.querySelectorAll("tr:not(.nodata)")).forEach((m, C) => {
|
|
554
554
|
const A = a + Math.floor(C / r);
|
|
555
|
-
if (A >=
|
|
555
|
+
if (A >= s) {
|
|
556
556
|
m.style.display = "none";
|
|
557
557
|
return;
|
|
558
558
|
}
|
|
@@ -575,19 +575,19 @@ const Ze = class Ze {
|
|
|
575
575
|
cell.dataset.row = dataIndex;
|
|
576
576
|
});
|
|
577
577
|
}; */
|
|
578
|
-
d(this, Mt, /* @__PURE__ */ h((
|
|
579
|
-
|
|
580
|
-
r.dataset.row =
|
|
578
|
+
d(this, Mt, /* @__PURE__ */ h((n, e, s) => {
|
|
579
|
+
n.dataset.row = s, n.data = e, Array.from(n.cells).forEach((r, o) => {
|
|
580
|
+
r.dataset.row = s;
|
|
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, ee, /* @__PURE__ */ h(() => {
|
|
586
586
|
var c, l, f;
|
|
587
587
|
S.log("rowManager.#syncHeaderHeights");
|
|
588
|
-
const
|
|
588
|
+
const n = t(this, R).querySelector(".ng-container-left .ng-part-header table"), e = t(this, R).querySelector(".ng-container-body .ng-part-header table"), s = t(this, R).querySelector(".ng-container-right .ng-part-header table");
|
|
589
589
|
if (!e) return;
|
|
590
|
-
const r =
|
|
590
|
+
const r = n ? Array.from(n.querySelectorAll("tr")) : [], o = Array.from(e.querySelectorAll("tr")), i = s ? Array.from(s.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,
|
|
@@ -598,32 +598,32 @@ const Ze = class Ze {
|
|
|
598
598
|
}
|
|
599
599
|
}, "#syncHeaderHeights"));
|
|
600
600
|
q(this, "destroy", /* @__PURE__ */ h(() => {
|
|
601
|
-
t(this,
|
|
601
|
+
t(this, X) && (t(this, X).disconnect(), p(this, X, null));
|
|
602
602
|
}, "destroy"));
|
|
603
|
-
p(this, j,
|
|
603
|
+
p(this, j, n.getRootNode().host), p(this, R, n), t(this, te).call(this);
|
|
604
604
|
}
|
|
605
605
|
getRowHeight() {
|
|
606
606
|
return t(this, D);
|
|
607
607
|
}
|
|
608
|
-
templateLength(
|
|
608
|
+
templateLength(n = ".ng-container-body") {
|
|
609
609
|
var e;
|
|
610
|
-
return ((e = t(this, P).get(
|
|
610
|
+
return ((e = t(this, P).get(n)) == null ? void 0 : e.length) || 1;
|
|
611
611
|
}
|
|
612
612
|
};
|
|
613
|
-
j = new WeakMap(), R = new WeakMap(),
|
|
614
|
-
let
|
|
615
|
-
const
|
|
613
|
+
j = new WeakMap(), R = new WeakMap(), rt = new WeakMap(), P = new WeakMap(), D = new WeakMap(), X = new WeakMap(), ot = new WeakMap(), Ct = new WeakMap(), Be = new WeakMap(), Pe = new WeakMap(), Zt = new WeakMap(), Jt = new WeakMap(), kt = new WeakMap(), Lt = new WeakMap(), It = new WeakMap(), Qt = new WeakMap(), te = new WeakMap(), Ht = new WeakMap(), Fe = new WeakMap(), bt = new WeakMap(), Mt = new WeakMap(), ee = new WeakMap(), h(Qe, "RowManager");
|
|
614
|
+
let qe = Qe;
|
|
615
|
+
const se = class se {
|
|
616
616
|
/**
|
|
617
617
|
* 🎯 레이아웃 내의 여러 rawTables 배열을 일괄로 받아 단일 마스터 템플릿으로 사전 컴파일합니다.
|
|
618
618
|
*/
|
|
619
|
-
static compileAll(
|
|
620
|
-
return Array.isArray(
|
|
619
|
+
static compileAll(n) {
|
|
620
|
+
return Array.isArray(n) ? n.map((e) => se.compile(e)) : [];
|
|
621
621
|
}
|
|
622
622
|
/**
|
|
623
623
|
* 🎯 단일 원본 테이블을 받아 기본 구조 보정 및 2차원 격자 인덱스 사전 부여 완료된 마스터 테이블 반환
|
|
624
624
|
*/
|
|
625
|
-
static compile(
|
|
626
|
-
if (!
|
|
625
|
+
static compile(n) {
|
|
626
|
+
if (!n) 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";
|
|
@@ -635,7 +635,7 @@ const Qt = class Qt {
|
|
|
635
635
|
}), a.querySelectorAll("tbody td, tfoot td").forEach((l) => {
|
|
636
636
|
l.setAttribute("tabindex", "0");
|
|
637
637
|
});
|
|
638
|
-
}, "processCellTypes"),
|
|
638
|
+
}, "processCellTypes"), s = /* @__PURE__ */ h((a) => {
|
|
639
639
|
if (!a.querySelector("colgroup")) {
|
|
640
640
|
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);
|
|
641
641
|
for (let b = 0; b < l; b++) {
|
|
@@ -668,8 +668,8 @@ const Qt = class Qt {
|
|
|
668
668
|
}
|
|
669
669
|
const C = m.rowSpan || 1, A = m.colSpan || 1;
|
|
670
670
|
for (let H = 0; H < C; H++)
|
|
671
|
-
for (let
|
|
672
|
-
w + H < u && v +
|
|
671
|
+
for (let ut = 0; ut < A; ut++)
|
|
672
|
+
w + H < u && v + ut < b && (g[w + H][v + ut] = H === 0 && ut === 0 ? "1" : "0");
|
|
673
673
|
});
|
|
674
674
|
}), l.forEach((y) => {
|
|
675
675
|
const w = y.sectionRowIndex;
|
|
@@ -681,8 +681,8 @@ const Qt = class Qt {
|
|
|
681
681
|
}
|
|
682
682
|
});
|
|
683
683
|
});
|
|
684
|
-
}, "resetColIndex"), o =
|
|
685
|
-
return
|
|
684
|
+
}, "resetColIndex"), o = n.cloneNode(!0);
|
|
685
|
+
return s(o), e(o), r(o, "thead"), r(o, "tbody"), r(o, "tfoot"), Array.from(o.querySelectorAll("colgroup col")).forEach((a, c) => {
|
|
686
686
|
const l = a.getAttribute("fixed");
|
|
687
687
|
l && o.querySelectorAll(`thead [data-col="${c}"], tbody [data-col="${c}"], tfoot [data-col="${c}"]`).forEach((f) => {
|
|
688
688
|
f.setAttribute("fixed", l);
|
|
@@ -691,53 +691,53 @@ const Qt = class Qt {
|
|
|
691
691
|
}
|
|
692
692
|
// 🎯 [추가] td/th에 선언된 cell-type 속성을 읽어 커스텀 태그로 자동 감싸기
|
|
693
693
|
};
|
|
694
|
-
h(
|
|
695
|
-
let
|
|
696
|
-
var
|
|
697
|
-
const
|
|
698
|
-
constructor(
|
|
694
|
+
h(se, "TableCompiler");
|
|
695
|
+
let Te = se;
|
|
696
|
+
var N, Y, V, At, ms;
|
|
697
|
+
const ts = class ts {
|
|
698
|
+
constructor(n) {
|
|
699
699
|
d(this, V);
|
|
700
|
-
d(this,
|
|
700
|
+
d(this, N);
|
|
701
701
|
d(this, Y, { startRow: -1, startCol: -1, endRow: -1, endCol: -1 });
|
|
702
702
|
q(this, "render", /* @__PURE__ */ h(() => {
|
|
703
|
-
const { startRow:
|
|
703
|
+
const { startRow: n, startCol: e, endRow: s, endCol: r } = t(this, Y);
|
|
704
704
|
S.log("🎨 [CellSelection.render] Rendering range ->", t(this, Y));
|
|
705
|
-
const o = t(this,
|
|
705
|
+
const o = t(this, N).querySelectorAll(
|
|
706
706
|
".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body"
|
|
707
707
|
);
|
|
708
708
|
if (o.forEach((a) => {
|
|
709
709
|
a.querySelectorAll(".selected, .selected-top, .selected-bottom, .selected-left, .selected-right").forEach((c) => {
|
|
710
710
|
c.classList.remove("selected", "selected-top", "selected-bottom", "selected-left", "selected-right");
|
|
711
711
|
});
|
|
712
|
-
}),
|
|
712
|
+
}), n < 0 || e < 0) {
|
|
713
713
|
S.log("⚠️ [CellSelection.render] Range is invalid (< 0), skipping render.");
|
|
714
714
|
return;
|
|
715
715
|
}
|
|
716
716
|
let i = 0;
|
|
717
717
|
o.forEach((a) => {
|
|
718
718
|
a.querySelectorAll("tbody tr").forEach((c) => {
|
|
719
|
-
const { matrixRow: l } =
|
|
719
|
+
const { matrixRow: l } = Z(this, V, At).call(this, c);
|
|
720
720
|
l < 0 || c.querySelectorAll("td, th").forEach((f) => {
|
|
721
721
|
const u = parseInt(f.dataset.col, 10);
|
|
722
722
|
if (isNaN(u)) return;
|
|
723
723
|
const b = parseInt(f.rowSpan || 1, 10), g = parseInt(f.colSpan || 1, 10), y = l + b - 1, w = u + g - 1;
|
|
724
|
-
y >=
|
|
724
|
+
y >= n && l <= s && w >= e && u <= r && (i++, f.classList.add("selected"), S.log(f, n, e, s, r), l <= n && f.classList.add("selected-top"), y >= s && f.classList.add("selected-bottom"), u <= e && f.classList.add("selected-left"), w >= r && f.classList.add("selected-right"));
|
|
725
725
|
});
|
|
726
726
|
});
|
|
727
727
|
}), S.log(`✨ [CellSelection.render] Total rendered cells marked: ${i}`);
|
|
728
728
|
}, "render"));
|
|
729
|
-
p(this,
|
|
729
|
+
p(this, N, n), Z(this, V, ms).call(this), t(this, N).querySelectorAll(
|
|
730
730
|
".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body"
|
|
731
|
-
).forEach((
|
|
732
|
-
|
|
731
|
+
).forEach((s) => {
|
|
732
|
+
s.addEventListener("scroll", () => {
|
|
733
733
|
t(this, Y).startRow >= 0 && t(this, Y).startCol >= 0 && this.render();
|
|
734
734
|
});
|
|
735
735
|
}), S.log("🎯 [CellSelection] Initialized");
|
|
736
736
|
}
|
|
737
|
-
setRange(
|
|
738
|
-
S.log(`🔍 [CellSelection.setRange] Input -> startRow: ${
|
|
739
|
-
let o = Math.min(
|
|
740
|
-
const l = t(this,
|
|
737
|
+
setRange(n, e, s, r) {
|
|
738
|
+
S.log(`🔍 [CellSelection.setRange] Input -> startRow: ${n}, startCol: ${e}, endRow: ${s}, endCol: ${r}`);
|
|
739
|
+
let o = Math.min(n, s), i = Math.max(n, s), a = Math.min(e, r), c = Math.max(e, r);
|
|
740
|
+
const l = t(this, N).querySelectorAll(
|
|
741
741
|
".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body"
|
|
742
742
|
);
|
|
743
743
|
let f = !0, u = 0;
|
|
@@ -745,14 +745,14 @@ const Je = class Je {
|
|
|
745
745
|
f = !1, u++, l.forEach((b) => {
|
|
746
746
|
b.querySelectorAll("tbody tr").forEach((g) => {
|
|
747
747
|
if (g.classList.contains("nodata")) return;
|
|
748
|
-
const { matrixRow: y } =
|
|
748
|
+
const { matrixRow: y } = Z(this, V, At).call(this, g);
|
|
749
749
|
y < 0 || g.querySelectorAll("td, th").forEach((w) => {
|
|
750
750
|
const v = parseInt(w.dataset.col, 10);
|
|
751
751
|
if (isNaN(v)) return;
|
|
752
752
|
const m = parseInt(w.rowSpan || 1, 10), C = parseInt(w.colSpan || 1, 10), A = y + m - 1, H = v + C - 1;
|
|
753
753
|
if (A >= o && y <= i && H >= a && v <= c) {
|
|
754
|
-
const
|
|
755
|
-
(
|
|
754
|
+
const ds = Math.min(o, y), fs = Math.max(i, A), us = Math.min(a, v), gs = Math.max(c, H);
|
|
755
|
+
(ds !== o || fs !== i || us !== a || gs !== c) && (o = ds, i = fs, a = us, c = gs, f = !0);
|
|
756
756
|
}
|
|
757
757
|
});
|
|
758
758
|
});
|
|
@@ -760,35 +760,35 @@ const Je = class Je {
|
|
|
760
760
|
p(this, Y, { startRow: o, startCol: a, endRow: i, endCol: c }), S.log("📦 [CellSelection.setRange] Final Range ->", t(this, Y)), this.render();
|
|
761
761
|
}
|
|
762
762
|
};
|
|
763
|
-
|
|
764
|
-
if (!
|
|
765
|
-
const e = parseInt(
|
|
763
|
+
N = new WeakMap(), Y = new WeakMap(), V = new WeakSet(), At = /* @__PURE__ */ h(function(n) {
|
|
764
|
+
if (!n || n.classList.contains("nodata")) return { dataRow: -1, subRowIndex: -1, matrixRow: -1 };
|
|
765
|
+
const e = parseInt(n.dataset.row, 10);
|
|
766
766
|
if (isNaN(e)) return { dataRow: -1, subRowIndex: -1, matrixRow: -1 };
|
|
767
|
-
const
|
|
767
|
+
const s = n.closest("tbody"), o = Array.from(s.querySelectorAll("tr:not(.nodata)")).filter((l) => parseInt(l.dataset.row, 10) === e), i = o.indexOf(n), a = o.length > 0 ? o.length : 1, c = e * a + (i >= 0 ? i : n.sectionRowIndex % a);
|
|
768
768
|
return { dataRow: e, subRowIndex: i, matrixRow: c };
|
|
769
|
-
}, "#getMatrixRow"),
|
|
770
|
-
const
|
|
771
|
-
if (!
|
|
769
|
+
}, "#getMatrixRow"), ms = /* @__PURE__ */ h(function() {
|
|
770
|
+
const n = t(this, N).querySelector(".ng-container-top");
|
|
771
|
+
if (!n) {
|
|
772
772
|
S.log("❌ [CellSelection] .ng-container-top not found!");
|
|
773
773
|
return;
|
|
774
774
|
}
|
|
775
|
-
|
|
775
|
+
n.addEventListener("mousedown", (e) => {
|
|
776
776
|
if (e.button !== 0) return;
|
|
777
|
-
const
|
|
778
|
-
if (!
|
|
779
|
-
t(this,
|
|
780
|
-
const r =
|
|
777
|
+
const s = e.target.closest("td, th");
|
|
778
|
+
if (!s || s.dataset.row === void 0 || s.dataset.col === void 0 || s.closest("tr").classList.contains("nodata")) return;
|
|
779
|
+
t(this, N).style.userSelect = "none", t(this, N).style.webkitUserSelect = "none";
|
|
780
|
+
const r = s.closest("tr"), { matrixRow: o } = Z(this, V, At).call(this, r), i = parseInt(s.dataset.col, 10);
|
|
781
781
|
if (o < 0) {
|
|
782
|
-
t(this,
|
|
782
|
+
t(this, N).style.userSelect = "", t(this, N).style.webkitUserSelect = "";
|
|
783
783
|
return;
|
|
784
784
|
}
|
|
785
|
-
S.log(`🖱️ [MouseDown Success] startRow: ${o}, startCol: ${i}`), t(this,
|
|
785
|
+
S.log(`🖱️ [MouseDown Success] startRow: ${o}, startCol: ${i}`), t(this, N).navigation.currentCell = s;
|
|
786
786
|
let a = o, c = i;
|
|
787
787
|
const l = /* @__PURE__ */ h((u) => {
|
|
788
788
|
const b = document.elementFromPoint(u.clientX, u.clientY);
|
|
789
789
|
let g = b == null ? void 0 : b.closest("td, th");
|
|
790
|
-
if (!g || !t(this,
|
|
791
|
-
const m = t(this,
|
|
790
|
+
if (!g || !t(this, N).contains(g)) {
|
|
791
|
+
const m = t(this, N).querySelectorAll(".ng-part-body tbody tr:not(.nodata) td, .ng-part-body tbody tr:not(.nodata) th");
|
|
792
792
|
for (const C of m) {
|
|
793
793
|
const A = C.getBoundingClientRect();
|
|
794
794
|
if (u.clientX >= A.left && u.clientX <= A.right && u.clientY >= A.top && u.clientY <= A.bottom) {
|
|
@@ -798,128 +798,183 @@ _ = new WeakMap(), Y = new WeakMap(), V = new WeakSet(), At = /* @__PURE__ */ h(
|
|
|
798
798
|
}
|
|
799
799
|
}
|
|
800
800
|
if (!g || g.dataset.row === void 0 || g.dataset.col === void 0 || g.closest("tr").classList.contains("nodata")) return;
|
|
801
|
-
const y = g.closest("tr"), { matrixRow: w } =
|
|
801
|
+
const y = g.closest("tr"), { matrixRow: w } = Z(this, V, At).call(this, y), v = parseInt(g.dataset.col, 10);
|
|
802
802
|
w < 0 || a === w && c === v || (a = w, c = v, this.setRange(o, i, w, v));
|
|
803
803
|
}, "onMouseMove"), f = /* @__PURE__ */ h(() => {
|
|
804
|
-
S.log("🖱️ [MouseUp] Drag ended."), t(this,
|
|
804
|
+
S.log("🖱️ [MouseUp] Drag ended."), t(this, N).style.userSelect = "", t(this, N).style.webkitUserSelect = "", document.removeEventListener("mousemove", l), document.removeEventListener("mouseup", f);
|
|
805
805
|
}, "onMouseUp");
|
|
806
806
|
document.addEventListener("mousemove", l), document.addEventListener("mouseup", f);
|
|
807
807
|
});
|
|
808
|
-
}, "#initEvents"), h(
|
|
809
|
-
let
|
|
810
|
-
var
|
|
811
|
-
const
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
d(this,
|
|
815
|
-
d(this,
|
|
816
|
-
d(this,
|
|
817
|
-
d(this,
|
|
818
|
-
d(this,
|
|
819
|
-
|
|
820
|
-
|
|
808
|
+
}, "#initEvents"), h(ts, "CellSelection");
|
|
809
|
+
let Ce = ts;
|
|
810
|
+
var F, it, ne, re, $t, Nt, _t, Dt, oe, xs;
|
|
811
|
+
const es = class es {
|
|
812
|
+
constructor(n) {
|
|
813
|
+
d(this, oe);
|
|
814
|
+
d(this, F);
|
|
815
|
+
d(this, it, null);
|
|
816
|
+
d(this, ne, -1);
|
|
817
|
+
d(this, re, -1);
|
|
818
|
+
d(this, $t, /* @__PURE__ */ h((n, e, s) => {
|
|
819
|
+
const r = t(this, _t).call(this, n, e);
|
|
820
|
+
if (!r) return s + 1;
|
|
821
|
+
const o = Array.from(r.querySelectorAll("th, td"));
|
|
822
|
+
let i = !1, a = s + 1;
|
|
823
|
+
for (const c of o) {
|
|
824
|
+
const l = parseInt(c.dataset.col, 10), f = parseInt(c.colSpan || 1, 10);
|
|
825
|
+
if (l === s) {
|
|
826
|
+
a = s + f, i = !0;
|
|
827
|
+
break;
|
|
828
|
+
}
|
|
829
|
+
}
|
|
830
|
+
return i ? a : s + 1;
|
|
831
|
+
}, "#getNextCol"));
|
|
832
|
+
d(this, Nt, /* @__PURE__ */ h((n, e, s) => {
|
|
833
|
+
const r = t(this, _t).call(this, n, e);
|
|
834
|
+
if (!r) return Math.max(0, s - 1);
|
|
835
|
+
const o = Array.from(r.querySelectorAll("th, td"));
|
|
836
|
+
let i = Math.max(0, s - 1);
|
|
837
|
+
for (const a of o) {
|
|
838
|
+
const c = parseInt(a.dataset.col, 10), l = parseInt(a.colSpan || 1, 10);
|
|
839
|
+
if (c + l === s) {
|
|
840
|
+
i = c;
|
|
841
|
+
break;
|
|
842
|
+
}
|
|
843
|
+
}
|
|
844
|
+
return i;
|
|
845
|
+
}, "#getPreviousCol"));
|
|
846
|
+
d(this, _t, /* @__PURE__ */ h((n, e) => {
|
|
847
|
+
const s = t(this, F).querySelectorAll(
|
|
848
|
+
".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body"
|
|
849
|
+
);
|
|
850
|
+
for (const r of s) {
|
|
851
|
+
const i = Array.from(r.querySelectorAll("tbody tr:not(.nodata)")).filter((a) => parseInt(a.dataset.row, 10) === n);
|
|
852
|
+
if (i[e])
|
|
853
|
+
return i[e];
|
|
854
|
+
}
|
|
855
|
+
return null;
|
|
856
|
+
}, "#findTargetTr"));
|
|
857
|
+
d(this, Dt, /* @__PURE__ */ h((n, e, s) => {
|
|
858
|
+
const r = t(this, F).querySelectorAll(
|
|
859
|
+
".ng-container-left .ng-part-body, .ng-container-body .ng-part-body, .ng-container-right .ng-part-body"
|
|
860
|
+
);
|
|
861
|
+
for (const o of r) {
|
|
862
|
+
const c = Array.from(o.querySelectorAll("tbody tr:not(.nodata)")).filter((l) => parseInt(l.dataset.row, 10) === n)[e];
|
|
863
|
+
if (c) {
|
|
864
|
+
const l = c.querySelector(`[data-col="${s}"]`);
|
|
865
|
+
if (l && window.getComputedStyle(l).display !== "none")
|
|
866
|
+
return l;
|
|
867
|
+
}
|
|
868
|
+
}
|
|
869
|
+
return null;
|
|
870
|
+
}, "#getNearElement"));
|
|
871
|
+
p(this, F, n), Z(this, oe, xs).call(this), S.log("🎯 [CellNavigation] Initialized");
|
|
821
872
|
}
|
|
822
873
|
get currentCell() {
|
|
823
|
-
return t(this,
|
|
824
|
-
}
|
|
825
|
-
set currentCell(
|
|
826
|
-
if (!
|
|
827
|
-
p(this,
|
|
828
|
-
const e = parseInt(
|
|
829
|
-
if (!isNaN(e) && !isNaN(
|
|
830
|
-
p(this,
|
|
831
|
-
const r =
|
|
874
|
+
return t(this, it);
|
|
875
|
+
}
|
|
876
|
+
set currentCell(n) {
|
|
877
|
+
if (!n) return;
|
|
878
|
+
p(this, it, n), n.focus({ preventScroll: !0 });
|
|
879
|
+
const e = parseInt(n.dataset.row, 10), s = parseInt(n.dataset.col, 10);
|
|
880
|
+
if (!isNaN(e) && !isNaN(s)) {
|
|
881
|
+
p(this, ne, e), p(this, re, s);
|
|
882
|
+
const r = n.closest("tr"), o = r == null ? void 0 : r.closest("tbody");
|
|
832
883
|
if (o) {
|
|
833
884
|
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);
|
|
834
|
-
|
|
885
|
+
t(this, F).selection.setRange(f, s, f, s);
|
|
835
886
|
}
|
|
836
887
|
}
|
|
837
888
|
}
|
|
838
|
-
moveCell(
|
|
839
|
-
var
|
|
840
|
-
if (!t(this,
|
|
841
|
-
const e = t(this,
|
|
889
|
+
moveCell(n) {
|
|
890
|
+
var w, v, m, C;
|
|
891
|
+
if (!t(this, it)) return;
|
|
892
|
+
const e = t(this, it), s = e.closest("tr"), r = parseInt(e.dataset.row, 10), o = parseInt(e.dataset.col, 10), i = s == null ? void 0 : s.closest("tbody");
|
|
893
|
+
if (!i) return;
|
|
894
|
+
const c = Array.from(i.querySelectorAll("tr:not(.nodata)")).filter((A) => parseInt(A.dataset.row, 10) === r), l = c.length > 0 ? c.length : 1, f = c.indexOf(s);
|
|
842
895
|
let u = r, b = f, g = o;
|
|
843
|
-
switch (
|
|
896
|
+
switch (n.code) {
|
|
844
897
|
case "Tab":
|
|
845
|
-
|
|
898
|
+
n.preventDefault(), g = n.shiftKey ? t(this, Nt).call(this, r, f, o) : t(this, $t).call(this, r, f, o);
|
|
846
899
|
break;
|
|
847
900
|
case "ArrowRight":
|
|
848
|
-
g =
|
|
901
|
+
g = t(this, $t).call(this, r, f, o);
|
|
849
902
|
break;
|
|
850
903
|
case "ArrowLeft":
|
|
851
|
-
g =
|
|
904
|
+
g = t(this, Nt).call(this, r, f, o);
|
|
852
905
|
break;
|
|
853
906
|
case "ArrowDown":
|
|
854
|
-
|
|
907
|
+
n.preventDefault(), f < l - 1 ? b = f + 1 : (u = r + 1, b = 0);
|
|
855
908
|
break;
|
|
856
909
|
case "ArrowUp":
|
|
857
|
-
|
|
910
|
+
n.preventDefault(), f > 0 ? b = f - 1 : (u = r - 1, b = l - 1);
|
|
858
911
|
break;
|
|
859
912
|
}
|
|
860
|
-
let y =
|
|
861
|
-
|
|
862
|
-
if (m && (y = m.querySelector(`[data-col="${g}"]`)), y)
|
|
913
|
+
let y = t(this, Dt).call(this, u, b, g);
|
|
914
|
+
if (y)
|
|
863
915
|
this.currentCell = y;
|
|
864
916
|
else if (u !== r && u >= 0) {
|
|
865
|
-
const
|
|
866
|
-
(
|
|
917
|
+
const A = ((v = (w = t(this, F)).getRowHeight) == null ? void 0 : v.call(w)) || 40;
|
|
918
|
+
(C = (m = t(this, F)).scrollToY) == null || C.call(m, u * A), setTimeout(() => {
|
|
919
|
+
const H = t(this, Dt).call(this, u, b, g);
|
|
920
|
+
H && (this.currentCell = H);
|
|
921
|
+
}, 0);
|
|
867
922
|
}
|
|
868
923
|
}
|
|
869
924
|
};
|
|
870
|
-
|
|
871
|
-
t(this,
|
|
872
|
-
["Tab", "ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"].includes(
|
|
925
|
+
F = new WeakMap(), it = new WeakMap(), ne = new WeakMap(), re = new WeakMap(), $t = new WeakMap(), Nt = new WeakMap(), _t = new WeakMap(), Dt = new WeakMap(), oe = new WeakSet(), xs = /* @__PURE__ */ h(function() {
|
|
926
|
+
t(this, F).addEventListener("keydown", (n) => {
|
|
927
|
+
["Tab", "ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"].includes(n.code) && this.moveCell(n);
|
|
873
928
|
});
|
|
874
|
-
}, "#initEvents"), h(
|
|
875
|
-
let
|
|
876
|
-
var
|
|
877
|
-
const
|
|
929
|
+
}, "#initEvents"), h(es, "CellNavigation");
|
|
930
|
+
let ke = es;
|
|
931
|
+
var ie, at, lt, Ot, Wt, ae, le, pt, ce, he;
|
|
932
|
+
const Rt = class Rt extends HTMLElement {
|
|
878
933
|
constructor() {
|
|
879
934
|
super();
|
|
880
|
-
d(this,
|
|
881
|
-
d(this,
|
|
882
|
-
d(this,
|
|
883
|
-
d(this,
|
|
884
|
-
d(this,
|
|
935
|
+
d(this, ie);
|
|
936
|
+
d(this, at, null);
|
|
937
|
+
d(this, lt);
|
|
938
|
+
d(this, Ot);
|
|
939
|
+
d(this, Wt);
|
|
885
940
|
q(this, "invalidate", /* @__PURE__ */ h(() => {
|
|
886
|
-
S.log("sheet.invalidate()"), t(this,
|
|
941
|
+
S.log("sheet.invalidate()"), t(this, lt).refresh();
|
|
887
942
|
}, "invalidate"));
|
|
888
943
|
q(this, "generate", /* @__PURE__ */ h((e) => {
|
|
889
944
|
if (S.log("sheet.generate()"), !e) return;
|
|
890
|
-
p(this,
|
|
891
|
-
const
|
|
892
|
-
|
|
945
|
+
p(this, at, Te.compile(e)), t(this, ae).call(this), t(this, le).call(this);
|
|
946
|
+
const s = this.querySelector(".ng-container-body .ng-part-header"), r = this.querySelector(".ng-container-body .ng-part-footer"), o = this.querySelector(".ng-nodata-overlay");
|
|
947
|
+
s && o && (o.style.top = `${s.offsetHeight}px`), r && o && (o.style.bottom = `${r.offsetHeight}px`), t(this, lt).initialize(), setTimeout(() => {
|
|
893
948
|
var i;
|
|
894
949
|
(i = this.querySelector("nine-table-hscrollbar")) == null || i.refresh();
|
|
895
950
|
}, 0);
|
|
896
951
|
}, "generate"));
|
|
897
|
-
d(this,
|
|
952
|
+
d(this, ae, /* @__PURE__ */ h(() => {
|
|
898
953
|
[
|
|
899
954
|
{ selector: ".ng-container-body", type: null },
|
|
900
955
|
{ selector: ".ng-container-left", type: "left" },
|
|
901
956
|
{ selector: ".ng-container-right", type: "right" }
|
|
902
|
-
].forEach(({ selector:
|
|
957
|
+
].forEach(({ selector: s, type: r }) => {
|
|
903
958
|
var o, i, a;
|
|
904
|
-
(o = this.querySelector(`${
|
|
959
|
+
(o = this.querySelector(`${s} .ng-part-header`)) == null || o.appendChild(t(this, pt).call(this, t(this, at), r, "header")), (i = this.querySelector(`${s} .ng-virtual-spacer`)) == null || i.before(t(this, pt).call(this, t(this, at), r, "body")), (a = this.querySelector(`${s} .ng-part-footer`)) == null || a.appendChild(t(this, pt).call(this, t(this, at), r, "footer"));
|
|
905
960
|
});
|
|
906
961
|
}, "#renderSplitContainers"));
|
|
907
|
-
d(this,
|
|
962
|
+
d(this, le, /* @__PURE__ */ h(() => {
|
|
908
963
|
["left", "right", "body"].forEach((e) => {
|
|
909
|
-
const
|
|
910
|
-
if (!
|
|
964
|
+
const s = this.querySelector(`.ng-container-${e}`), r = s == null ? void 0 : s.querySelectorAll("table");
|
|
965
|
+
if (!s || !r || r.length === 0) return;
|
|
911
966
|
let o = 0;
|
|
912
967
|
r[0].querySelectorAll("col").forEach((i) => {
|
|
913
968
|
const a = parseInt(i.getAttribute("width"), 10);
|
|
914
969
|
isNaN(a) || (o += a);
|
|
915
|
-
}), e === "body" ? (
|
|
970
|
+
}), e === "body" ? (s.style.flex = "1", r.forEach((i) => {
|
|
916
971
|
i.style.width = `${o}px`, i.style.minWidth = `${o}px`;
|
|
917
|
-
})) : (
|
|
972
|
+
})) : (s.style.flex = `0 0 ${o}px`, s.style.width = `${o}px`, r.forEach((i) => {
|
|
918
973
|
i.style.width = `${o}px`, i.style.minWidth = `${o}px`;
|
|
919
974
|
}));
|
|
920
975
|
});
|
|
921
976
|
}, "#updateContainerWidths"));
|
|
922
|
-
d(this,
|
|
977
|
+
d(this, pt, /* @__PURE__ */ h((e, s, r) => {
|
|
923
978
|
const o = e.cloneNode(!0), i = o.querySelector("thead"), a = o.querySelector("tbody"), c = o.querySelector("tfoot");
|
|
924
979
|
if (r === "header") {
|
|
925
980
|
if (a && a.remove(), c && c.remove(), e.querySelector("tbody")) {
|
|
@@ -927,28 +982,28 @@ const Et = class Et extends HTMLElement {
|
|
|
927
982
|
f.className = "fixed-tbody", o.appendChild(f);
|
|
928
983
|
}
|
|
929
984
|
} else r === "body" ? (i && i.remove(), c && c.remove(), a && (a.className = "bindable-tbody")) : r === "footer" && (i && i.remove(), a && a.remove());
|
|
930
|
-
return
|
|
985
|
+
return s === "left" ? o.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((l) => {
|
|
931
986
|
l.getAttribute("fixed") !== "left" && l.remove();
|
|
932
|
-
}) :
|
|
987
|
+
}) : s === "right" ? o.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((l) => {
|
|
933
988
|
l.getAttribute("fixed") !== "right" && l.remove();
|
|
934
989
|
}) : o.querySelectorAll("[fixed=left], [fixed=right]").forEach((l) => {
|
|
935
990
|
l.remove();
|
|
936
991
|
}), o;
|
|
937
992
|
}, "#createSplitTable"));
|
|
938
|
-
q(this, "getRowHeight", /* @__PURE__ */ h(() => t(this,
|
|
993
|
+
q(this, "getRowHeight", /* @__PURE__ */ h(() => t(this, lt).getRowHeight(), "getRowHeight"));
|
|
939
994
|
q(this, "scrollToX", /* @__PURE__ */ h((e) => {
|
|
940
|
-
const
|
|
941
|
-
|
|
995
|
+
const s = this.querySelector(".ng-container-body .ng-part-body");
|
|
996
|
+
s && (s.scrollLeft = e);
|
|
942
997
|
}, "scrollToX"));
|
|
943
998
|
q(this, "scrollToY", /* @__PURE__ */ h((e) => {
|
|
944
|
-
const
|
|
945
|
-
|
|
999
|
+
const s = this.querySelector(".ng-container-body .ng-part-body");
|
|
1000
|
+
s && (s.scrollTop = e);
|
|
946
1001
|
}, "scrollToY"));
|
|
947
|
-
d(this,
|
|
948
|
-
t(this,
|
|
1002
|
+
d(this, ce, /* @__PURE__ */ h(() => {
|
|
1003
|
+
t(this, he).call(this), p(this, Ot, new Ce(this)), p(this, Wt, new ke(this));
|
|
949
1004
|
}, "#init"));
|
|
950
|
-
d(this,
|
|
951
|
-
const e =
|
|
1005
|
+
d(this, he, /* @__PURE__ */ h(() => {
|
|
1006
|
+
const e = Rt.SCROLLBAR_SIZE;
|
|
952
1007
|
this.innerHTML = `
|
|
953
1008
|
<style>
|
|
954
1009
|
nine-table-sheet {
|
|
@@ -1149,37 +1204,37 @@ const Et = class Et extends HTMLElement {
|
|
|
1149
1204
|
</div>
|
|
1150
1205
|
`;
|
|
1151
1206
|
}, "#render"));
|
|
1152
|
-
p(this,
|
|
1207
|
+
p(this, lt, new qe(this)), p(this, ie, this.getRootNode().host);
|
|
1153
1208
|
}
|
|
1154
1209
|
connectedCallback() {
|
|
1155
|
-
t(this,
|
|
1210
|
+
t(this, ce).call(this);
|
|
1156
1211
|
}
|
|
1157
1212
|
get selection() {
|
|
1158
|
-
return t(this,
|
|
1213
|
+
return t(this, Ot);
|
|
1159
1214
|
}
|
|
1160
1215
|
get navigation() {
|
|
1161
|
-
return t(this,
|
|
1216
|
+
return t(this, Wt);
|
|
1162
1217
|
}
|
|
1163
1218
|
disconnectedCallback() {
|
|
1164
1219
|
this.innerHTML = "", S.log("NineTableSheet destroyed.");
|
|
1165
1220
|
}
|
|
1166
1221
|
};
|
|
1167
|
-
|
|
1168
|
-
let
|
|
1169
|
-
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet",
|
|
1170
|
-
var
|
|
1171
|
-
const
|
|
1222
|
+
ie = new WeakMap(), at = new WeakMap(), lt = new WeakMap(), Ot = new WeakMap(), Wt = new WeakMap(), ae = new WeakMap(), le = new WeakMap(), pt = new WeakMap(), ce = new WeakMap(), he = new WeakMap(), h(Rt, "NineTableSheet"), q(Rt, "SCROLLBAR_SIZE", 16);
|
|
1223
|
+
let Ut = Rt;
|
|
1224
|
+
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", Ut);
|
|
1225
|
+
var de, zt;
|
|
1226
|
+
const ss = class ss extends HTMLElement {
|
|
1172
1227
|
constructor() {
|
|
1173
1228
|
super();
|
|
1174
|
-
d(this,
|
|
1229
|
+
d(this, de, /* @__PURE__ */ h(() => {
|
|
1175
1230
|
var e;
|
|
1176
|
-
(e = this.querySelector(".nine-tab-bar")) == null || e.addEventListener("click", (
|
|
1231
|
+
(e = this.querySelector(".nine-tab-bar")) == null || e.addEventListener("click", (s) => {
|
|
1177
1232
|
var i;
|
|
1178
|
-
const r =
|
|
1179
|
-
t(this,
|
|
1180
|
-
}), t(this,
|
|
1233
|
+
const r = s.ctrlKey || s.metaKey || s.shiftKey, o = parseInt((i = s.target.closest(".nine-tab-item")) == null ? void 0 : i.dataset.index, 10);
|
|
1234
|
+
t(this, zt).call(this, o, r);
|
|
1235
|
+
}), t(this, zt).call(this, 0, !1);
|
|
1181
1236
|
}, "#init"));
|
|
1182
|
-
d(this,
|
|
1237
|
+
d(this, zt, /* @__PURE__ */ h((e, s = !1) => {
|
|
1183
1238
|
const r = /* @__PURE__ */ h(() => {
|
|
1184
1239
|
const f = Array.from(this.querySelectorAll("nine-table-sheet"));
|
|
1185
1240
|
Array.from(this.querySelectorAll("nine-splitter")).forEach((g) => g.style.setProperty("display", "none"));
|
|
@@ -1190,7 +1245,7 @@ const ts = class ts extends HTMLElement {
|
|
|
1190
1245
|
});
|
|
1191
1246
|
}, "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");
|
|
1192
1247
|
if (!a[e]) return;
|
|
1193
|
-
if (!
|
|
1248
|
+
if (!s)
|
|
1194
1249
|
a.forEach((f, u) => {
|
|
1195
1250
|
f.classList.toggle("active", u === e);
|
|
1196
1251
|
}), c.forEach((f, u) => {
|
|
@@ -1212,42 +1267,42 @@ const ts = class ts extends HTMLElement {
|
|
|
1212
1267
|
}, "#switchSheet"));
|
|
1213
1268
|
}
|
|
1214
1269
|
connectedCallback() {
|
|
1215
|
-
t(this,
|
|
1270
|
+
t(this, de).call(this);
|
|
1216
1271
|
}
|
|
1217
1272
|
};
|
|
1218
|
-
|
|
1219
|
-
let
|
|
1220
|
-
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets",
|
|
1221
|
-
var
|
|
1222
|
-
const
|
|
1223
|
-
constructor(
|
|
1224
|
-
d(this,
|
|
1225
|
-
d(this,
|
|
1226
|
-
t(this,
|
|
1227
|
-
for (let e of
|
|
1228
|
-
t(this,
|
|
1229
|
-
}).observe(t(this,
|
|
1273
|
+
de = new WeakMap(), zt = new WeakMap(), h(ss, "NineTableSheets");
|
|
1274
|
+
let Le = ss;
|
|
1275
|
+
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", Le);
|
|
1276
|
+
var _, fe, Bt, ue;
|
|
1277
|
+
const ns = class ns {
|
|
1278
|
+
constructor(n) {
|
|
1279
|
+
d(this, _);
|
|
1280
|
+
d(this, fe, /* @__PURE__ */ h(() => {
|
|
1281
|
+
t(this, ue).call(this), new ResizeObserver((n) => {
|
|
1282
|
+
for (let e of n)
|
|
1283
|
+
t(this, _).getAttribute("auto-height") === "true" && t(this, Bt).call(this);
|
|
1284
|
+
}).observe(t(this, _));
|
|
1230
1285
|
}, "#init"));
|
|
1231
|
-
d(this,
|
|
1286
|
+
d(this, Bt, /* @__PURE__ */ h(() => {
|
|
1232
1287
|
var c, l;
|
|
1233
|
-
const
|
|
1234
|
-
if (
|
|
1235
|
-
const e = parseInt(t(this,
|
|
1236
|
-
t(this,
|
|
1288
|
+
const n = Array.from(t(this, _).shadowRoot.querySelectorAll("nine-table-sheet.active"));
|
|
1289
|
+
if (n.length === 0) return;
|
|
1290
|
+
const e = parseInt(t(this, _).getAttribute("max-display-row"), 10) || 10, s = Math.max(...n.map((f) => f.getRowHeight())), r = (c = t(this, _).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : c.getBoundingClientRect().height, o = (l = t(this, _).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : l.getBoundingClientRect().height, i = Ut.SCROLLBAR_SIZE, a = e * s + r + o + i;
|
|
1291
|
+
t(this, _).style.height = `${a}px`;
|
|
1237
1292
|
}, "#applyAutoHeight"));
|
|
1238
|
-
d(this,
|
|
1239
|
-
const e = Array.from(t(this,
|
|
1293
|
+
d(this, ue, /* @__PURE__ */ h(() => {
|
|
1294
|
+
const e = Array.from(t(this, _).children).filter((c) => c.tagName === "TABLE"), s = t(this, _).getAttribute("auto-height") === "true", r = e.length, o = e.map((c, l) => {
|
|
1240
1295
|
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>` : "";
|
|
1241
1296
|
return u + b;
|
|
1242
1297
|
}).join(""), i = e.map((c, l) => `<div class="nine-tab-item ${l === 0 ? "active" : ""}" data-index="${l}">Sheet ${l + 1}</div>`).join("");
|
|
1243
|
-
t(this,
|
|
1298
|
+
t(this, _).shadowRoot.innerHTML = `
|
|
1244
1299
|
<style>
|
|
1245
1300
|
:host {
|
|
1246
1301
|
display: flex;
|
|
1247
1302
|
flex-direction: column;
|
|
1248
1303
|
position: relative;
|
|
1249
1304
|
overflow: hidden;
|
|
1250
|
-
height: ${
|
|
1305
|
+
height: ${s ? "auto" : "100%"};
|
|
1251
1306
|
background: #fff;
|
|
1252
1307
|
}
|
|
1253
1308
|
|
|
@@ -1360,151 +1415,151 @@ const es = class es {
|
|
|
1360
1415
|
<nine-table-analysis></nine-table-analysis>
|
|
1361
1416
|
</nine-table-body>
|
|
1362
1417
|
<nine-table-footer></nine-table-footer>
|
|
1363
|
-
`, t(this,
|
|
1364
|
-
const a = t(this,
|
|
1418
|
+
`, t(this, _).shadowRoot.querySelector("nine-table-sheets").classList.add("nodata");
|
|
1419
|
+
const a = t(this, _).shadowRoot.querySelectorAll("nine-table-sheet");
|
|
1365
1420
|
a == null || a.forEach((c, l) => {
|
|
1366
1421
|
e[l] && setTimeout(() => {
|
|
1367
|
-
c.generate(e[l]),
|
|
1422
|
+
c.generate(e[l]), s && t(this, Bt).call(this);
|
|
1368
1423
|
});
|
|
1369
1424
|
});
|
|
1370
1425
|
}, "#render"));
|
|
1371
|
-
p(this,
|
|
1426
|
+
p(this, _, n), t(this, fe).call(this);
|
|
1372
1427
|
}
|
|
1373
1428
|
};
|
|
1374
|
-
|
|
1375
|
-
let
|
|
1376
|
-
var
|
|
1377
|
-
const
|
|
1378
|
-
constructor(
|
|
1379
|
-
d(this,
|
|
1380
|
-
d(this,
|
|
1381
|
-
q(this, "count", /* @__PURE__ */ h(() => t(this,
|
|
1382
|
-
p(this,
|
|
1429
|
+
_ = new WeakMap(), fe = new WeakMap(), Bt = new WeakMap(), ue = new WeakMap(), h(ns, "LayoutManager");
|
|
1430
|
+
let Ie = ns;
|
|
1431
|
+
var Pt, yt;
|
|
1432
|
+
const rs = class rs {
|
|
1433
|
+
constructor(n) {
|
|
1434
|
+
d(this, Pt);
|
|
1435
|
+
d(this, yt, -1);
|
|
1436
|
+
q(this, "count", /* @__PURE__ */ h(() => t(this, Pt).rawRecords.length, "count"));
|
|
1437
|
+
p(this, Pt, n);
|
|
1383
1438
|
}
|
|
1384
1439
|
get at() {
|
|
1385
|
-
return t(this,
|
|
1440
|
+
return t(this, yt);
|
|
1386
1441
|
}
|
|
1387
|
-
set at(
|
|
1388
|
-
p(this,
|
|
1442
|
+
set at(n) {
|
|
1443
|
+
p(this, yt, parseInt(n, 10)), body && !body.querySelector(`tbody.bindable tr[data-row="${t(this, yt)}"]`) && setTimeout(() => {
|
|
1389
1444
|
});
|
|
1390
1445
|
}
|
|
1391
1446
|
};
|
|
1392
|
-
|
|
1393
|
-
let
|
|
1394
|
-
var O, L, W,
|
|
1447
|
+
Pt = new WeakMap(), yt = new WeakMap(), h(rs, "ngRow");
|
|
1448
|
+
let He = rs;
|
|
1449
|
+
var O, L, W, mt, ge, G, be, ct, Ft, pe, ye, xt;
|
|
1395
1450
|
const z = class z {
|
|
1396
|
-
constructor(
|
|
1451
|
+
constructor(n, e) {
|
|
1397
1452
|
d(this, O);
|
|
1398
1453
|
d(this, L);
|
|
1399
1454
|
d(this, W, []);
|
|
1400
|
-
d(this,
|
|
1401
|
-
d(this,
|
|
1402
|
-
d(this,
|
|
1403
|
-
d(this,
|
|
1404
|
-
p(this,
|
|
1405
|
-
const
|
|
1406
|
-
Array.from(
|
|
1407
|
-
var
|
|
1408
|
-
t(this,
|
|
1455
|
+
d(this, mt, []);
|
|
1456
|
+
d(this, ge, 0);
|
|
1457
|
+
d(this, G, []);
|
|
1458
|
+
d(this, be, /* @__PURE__ */ h(() => {
|
|
1459
|
+
p(this, G, []);
|
|
1460
|
+
const n = t(this, O).template || [];
|
|
1461
|
+
Array.from(n).forEach((e) => {
|
|
1462
|
+
var s;
|
|
1463
|
+
t(this, G).push(((s = e.getBoundingClientRect) == null ? void 0 : s.call(e).height) || 24);
|
|
1409
1464
|
}), (t(this, L).rawRecords || []).forEach((e) => {
|
|
1410
|
-
e.__ng || (e.__ng = t(this,
|
|
1465
|
+
e.__ng || (e.__ng = t(this, Ft).call(this)), e.__ng.height = t(this, G).slice();
|
|
1411
1466
|
});
|
|
1412
1467
|
}, "#initialize"));
|
|
1413
|
-
d(this,
|
|
1414
|
-
const
|
|
1415
|
-
|
|
1468
|
+
d(this, ct, /* @__PURE__ */ h(() => {
|
|
1469
|
+
const n = t(this, O).shadowRoot.querySelector("nine-table-sheets");
|
|
1470
|
+
n == null || n.classList.toggle("nodata", this.length === 0), t(this, O).shadowRoot.querySelectorAll("nine-table-sheet").forEach((e) => {
|
|
1416
1471
|
e.invalidate();
|
|
1417
1472
|
});
|
|
1418
1473
|
}, "#invalidate"));
|
|
1419
|
-
q(this, "get", /* @__PURE__ */ h((
|
|
1474
|
+
q(this, "get", /* @__PURE__ */ h((n, e) => {
|
|
1420
1475
|
var o;
|
|
1421
|
-
const
|
|
1422
|
-
if (!
|
|
1423
|
-
if (
|
|
1424
|
-
if (
|
|
1476
|
+
const s = this.getValidData();
|
|
1477
|
+
if (!s || s.length <= 0) return;
|
|
1478
|
+
if (n == null) return t(this, xt).call(this, s);
|
|
1479
|
+
if (n < 0 || n >= s.length) return null;
|
|
1425
1480
|
const r = typeof ((o = t(this, O).fields) == null ? void 0 : o.get) == "function" ? t(this, O).fields.get() : [];
|
|
1426
1481
|
if (e != null) {
|
|
1427
1482
|
const i = r.indexOf(e);
|
|
1428
|
-
return i >= 0 ? n
|
|
1483
|
+
return i >= 0 ? s[n].v[i] : null;
|
|
1429
1484
|
}
|
|
1430
|
-
return t(this,
|
|
1485
|
+
return t(this, xt).call(this, s[n]);
|
|
1431
1486
|
}, "get"));
|
|
1432
|
-
q(this, "set", /* @__PURE__ */ h((
|
|
1433
|
-
this.clear(), this.add(
|
|
1487
|
+
q(this, "set", /* @__PURE__ */ h((n) => {
|
|
1488
|
+
this.clear(), this.add(n, !1), t(this, ct).call(this);
|
|
1434
1489
|
}, "set"));
|
|
1435
|
-
d(this,
|
|
1490
|
+
d(this, Ft, /* @__PURE__ */ h(() => ({
|
|
1436
1491
|
rowState: z.ROW_STATE.EMPTY,
|
|
1437
1492
|
deleted: !1,
|
|
1438
1493
|
filtered: !1,
|
|
1439
|
-
height: t(this,
|
|
1494
|
+
height: t(this, G).slice(),
|
|
1440
1495
|
o: {},
|
|
1441
1496
|
c: {},
|
|
1442
|
-
_: [0, 0, 0, 0, z.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this,
|
|
1497
|
+
_: [0, 0, 0, 0, z.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this, G).slice(), -1, {}, {}]
|
|
1443
1498
|
}), "#getDefaultMeta"));
|
|
1444
1499
|
q(this, "reset", /* @__PURE__ */ h(() => {
|
|
1445
|
-
p(this, W, []), p(this,
|
|
1500
|
+
p(this, W, []), p(this, mt, []), t(this, ct).call(this);
|
|
1446
1501
|
}, "reset"));
|
|
1447
1502
|
q(this, "clear", /* @__PURE__ */ h(() => {
|
|
1448
|
-
var
|
|
1449
|
-
t(this, L).rawRecords = [], p(this, W, []), p(this,
|
|
1503
|
+
var n;
|
|
1504
|
+
t(this, L).rawRecords = [], p(this, W, []), p(this, mt, []), (n = t(this, L).viewRecords) != null && n.reset && t(this, L).viewRecords.reset();
|
|
1450
1505
|
}, "clear"));
|
|
1451
|
-
d(this,
|
|
1506
|
+
d(this, pe, /* @__PURE__ */ h((n) => {
|
|
1452
1507
|
var r;
|
|
1453
|
-
Array.isArray(
|
|
1454
|
-
const e = typeof ((r = t(this, O).fields) == null ? void 0 : r.get) == "function" ? t(this, O).fields.get() : Object.keys(
|
|
1455
|
-
return
|
|
1508
|
+
Array.isArray(n) || (n = [n]);
|
|
1509
|
+
const e = typeof ((r = t(this, O).fields) == null ? void 0 : r.get) == "function" ? t(this, O).fields.get() : Object.keys(n[0] || {}), s = [];
|
|
1510
|
+
return n.forEach((o) => {
|
|
1456
1511
|
const i = { v: [] };
|
|
1457
1512
|
e.forEach((a) => {
|
|
1458
1513
|
i.v.push(o[a] !== void 0 && o[a] !== null ? o[a] : "");
|
|
1459
|
-
}),
|
|
1460
|
-
}),
|
|
1514
|
+
}), s.push(i);
|
|
1515
|
+
}), s;
|
|
1461
1516
|
}, "#json2Array"));
|
|
1462
|
-
d(this,
|
|
1463
|
-
e.__ng = t(this,
|
|
1464
|
-
}),
|
|
1465
|
-
q(this, "add", /* @__PURE__ */ h((
|
|
1466
|
-
|
|
1467
|
-
const
|
|
1468
|
-
t(this, L).rawRecords = t(this, L).rawRecords.concat(t(this,
|
|
1517
|
+
d(this, ye, /* @__PURE__ */ h((n) => (Array.isArray(n) || (n = [n]), n.forEach((e) => {
|
|
1518
|
+
e.__ng = t(this, Ft).call(this), e.__ng.rowid = this.nextId, e.__ng.rowState = z.ROW_STATE.INSERT, e.__ng._[0] = e.__ng.rowid;
|
|
1519
|
+
}), n), "#defaultInsert"));
|
|
1520
|
+
q(this, "add", /* @__PURE__ */ h((n, e = !0) => {
|
|
1521
|
+
n === void 0 && (n = {});
|
|
1522
|
+
const s = t(this, pe).call(this, n);
|
|
1523
|
+
t(this, L).rawRecords = t(this, L).rawRecords.concat(t(this, ye).call(this, s)), this.resetRecords();
|
|
1469
1524
|
const r = this.count() - 1;
|
|
1470
|
-
return e ||
|
|
1525
|
+
return e || s.forEach((o, i) => {
|
|
1471
1526
|
const a = t(this, L).rawRecords[r - i];
|
|
1472
1527
|
a && (a.__ng.rowState = z.ROW_STATE.EMPTY);
|
|
1473
|
-
}), t(this,
|
|
1528
|
+
}), t(this, ct).call(this), r;
|
|
1474
1529
|
}, "add"));
|
|
1475
|
-
q(this, "delete", /* @__PURE__ */ h((
|
|
1530
|
+
q(this, "delete", /* @__PURE__ */ h((n) => {
|
|
1476
1531
|
let e = [];
|
|
1477
|
-
Array.isArray(
|
|
1478
|
-
if (t(this, W)[
|
|
1479
|
-
const r = t(this, W)[
|
|
1480
|
-
t(this, W)[
|
|
1532
|
+
Array.isArray(n) ? e = n : typeof n > "u" ? e = [t(this, L).host.row.at] : e = [parseInt(n, 10)], e.sort((s, r) => r - s).forEach((s) => {
|
|
1533
|
+
if (t(this, W)[s]) {
|
|
1534
|
+
const r = t(this, W)[s].__ng.rowid;
|
|
1535
|
+
t(this, W)[s].__ng.rowState === z.ROW_STATE.INSERT ? t(this, L).rawRecords = t(this, L).rawRecords.filter((o) => o.__ng.rowid !== r) : t(this, L).rawRecords.forEach((o) => {
|
|
1481
1536
|
o.__ng.rowid === r && (o.__ng.deleted = !0, o.__ng.rowState = z.ROW_STATE.DELETE);
|
|
1482
1537
|
});
|
|
1483
1538
|
}
|
|
1484
|
-
}), this.resetRecords(), t(this,
|
|
1539
|
+
}), this.resetRecords(), t(this, ct).call(this);
|
|
1485
1540
|
}, "delete"));
|
|
1486
|
-
q(this, "setValue", /* @__PURE__ */ h((
|
|
1541
|
+
q(this, "setValue", /* @__PURE__ */ h((n, e, s) => {
|
|
1487
1542
|
var c;
|
|
1488
|
-
|
|
1543
|
+
n = parseInt(n, 10);
|
|
1489
1544
|
const o = (typeof ((c = t(this, O).fields) == null ? void 0 : c.get) == "function" ? t(this, O).fields.get() : []).indexOf(e);
|
|
1490
1545
|
if (o < 0) return;
|
|
1491
|
-
const i = this.getValidData()[
|
|
1546
|
+
const i = this.getValidData()[n];
|
|
1492
1547
|
if (!i) return;
|
|
1493
1548
|
const a = i.v[o];
|
|
1494
|
-
a !==
|
|
1549
|
+
a !== s && i.__ng.rowState !== z.ROW_STATE.INSERT && (i.__ng.o.hasOwnProperty(e) || (i.__ng.o[e] = a), i.__ng.rowState = z.ROW_STATE.UPDATE), i.v[o] = s;
|
|
1495
1550
|
}, "setValue"));
|
|
1496
1551
|
q(this, "resetRecords", /* @__PURE__ */ h(() => {
|
|
1497
|
-
p(this,
|
|
1498
|
-
|
|
1499
|
-
}), t(this, W).forEach((
|
|
1500
|
-
|
|
1552
|
+
p(this, mt, t(this, L).rawRecords.filter((n) => !n.__ng.deleted)), p(this, W, t(this, L).rawRecords.filter((n) => !n.__ng.deleted && !n.__ng.filtered)), t(this, L).rawRecords.forEach((n, e) => {
|
|
1553
|
+
n.__ng.rowidx = e;
|
|
1554
|
+
}), t(this, W).forEach((n, e) => {
|
|
1555
|
+
n.__ng.i = e;
|
|
1501
1556
|
});
|
|
1502
1557
|
}, "resetRecords"));
|
|
1503
1558
|
q(this, "getValidData", /* @__PURE__ */ h(() => (t(this, W).length === 0 && t(this, L).rawRecords.length > 0 && this.resetRecords(), t(this, W)), "getValidData"));
|
|
1504
|
-
d(this,
|
|
1559
|
+
d(this, xt, /* @__PURE__ */ h((n) => {
|
|
1505
1560
|
var i;
|
|
1506
|
-
if (!
|
|
1507
|
-
const e = !Array.isArray(
|
|
1561
|
+
if (!n) return n;
|
|
1562
|
+
const e = !Array.isArray(n), s = e ? [n] : n, r = typeof ((i = t(this, O).fields) == null ? void 0 : i.get) == "function" ? t(this, O).fields.get() : [], o = s.filter((a) => !a.__ng.deleted).map((a) => {
|
|
1508
1563
|
const c = {};
|
|
1509
1564
|
return r.forEach((l, f) => {
|
|
1510
1565
|
c[l] = a.v ? a.v[f] : a[l];
|
|
@@ -1513,16 +1568,16 @@ const z = class z {
|
|
|
1513
1568
|
return e ? o[0] : o;
|
|
1514
1569
|
}, "#conv"));
|
|
1515
1570
|
q(this, "count", /* @__PURE__ */ h(() => this.getValidData().length, "count"));
|
|
1516
|
-
p(this, O,
|
|
1571
|
+
p(this, O, n), p(this, L, e), t(this, be).call(this);
|
|
1517
1572
|
}
|
|
1518
1573
|
get source() {
|
|
1519
|
-
return t(this,
|
|
1574
|
+
return t(this, xt).call(this, t(this, L).rawRecords);
|
|
1520
1575
|
}
|
|
1521
|
-
set source(
|
|
1522
|
-
this.clear(), this.add(
|
|
1576
|
+
set source(n) {
|
|
1577
|
+
this.clear(), this.add(n, !1);
|
|
1523
1578
|
}
|
|
1524
1579
|
get nextId() {
|
|
1525
|
-
return ++
|
|
1580
|
+
return ++ys(this, ge)._;
|
|
1526
1581
|
}
|
|
1527
1582
|
get count() {
|
|
1528
1583
|
return t(this, W).length;
|
|
@@ -1534,7 +1589,7 @@ const z = class z {
|
|
|
1534
1589
|
return this.length;
|
|
1535
1590
|
}
|
|
1536
1591
|
};
|
|
1537
|
-
O = new WeakMap(), L = new WeakMap(), W = new WeakMap(),
|
|
1592
|
+
O = new WeakMap(), L = new WeakMap(), W = new WeakMap(), mt = new WeakMap(), ge = new WeakMap(), G = new WeakMap(), be = new WeakMap(), ct = new WeakMap(), Ft = new WeakMap(), pe = new WeakMap(), ye = new WeakMap(), xt = new WeakMap(), h(z, "ngData"), // 🎯 행 상태 정의 상수를 클래스 내부로 내재화
|
|
1538
1593
|
q(z, "ROW_STATE", {
|
|
1539
1594
|
EMPTY: "EMPTY",
|
|
1540
1595
|
NORMAL: "NORMAL",
|
|
@@ -1542,58 +1597,58 @@ q(z, "ROW_STATE", {
|
|
|
1542
1597
|
UPDATE: "UPDATE",
|
|
1543
1598
|
DELETE: "DELETE"
|
|
1544
1599
|
});
|
|
1545
|
-
let
|
|
1546
|
-
var
|
|
1547
|
-
const
|
|
1548
|
-
constructor(
|
|
1549
|
-
d(this,
|
|
1550
|
-
p(this,
|
|
1600
|
+
let Me = z;
|
|
1601
|
+
var ht;
|
|
1602
|
+
const os = class os {
|
|
1603
|
+
constructor(n) {
|
|
1604
|
+
d(this, ht);
|
|
1605
|
+
p(this, ht, n), this.row = new He(this), this.data = new Me(t(this, ht), this), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.pageCnt = 25, this.viewRecords.reset = () => {
|
|
1551
1606
|
var e;
|
|
1552
|
-
(e = t(this,
|
|
1607
|
+
(e = t(this, ht).view) != null && e.redraw && t(this, ht).view.redraw();
|
|
1553
1608
|
}, this.setDataSource = (e) => {
|
|
1554
1609
|
this.data && this.data.reset(), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.data.set(e || []);
|
|
1555
1610
|
}, this.getRowState = (e) => {
|
|
1556
1611
|
var r, o;
|
|
1557
|
-
const
|
|
1558
|
-
if (!(
|
|
1559
|
-
return (o = (r = this.data.getValidData()[
|
|
1612
|
+
const s = parseInt(e, 10);
|
|
1613
|
+
if (!(s >= this.data.count()))
|
|
1614
|
+
return (o = (r = this.data.getValidData()[s]) == null ? void 0 : r.__ng) == null ? void 0 : o.rowState;
|
|
1560
1615
|
}, this.getRowPosition = () => this.row.at, this.setRowPosition = (e) => {
|
|
1561
1616
|
this.row.at = e;
|
|
1562
|
-
}, 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,
|
|
1563
|
-
e = parseInt(e, 10), this.data.setValue(e,
|
|
1617
|
+
}, this.scrollTo_V1 = (e) => (e < 0 && (e = 0), e >= this.rawRecords.length && (e = this.rawRecords.length - 1), this.viewRecords.rawIndex = e, this.viewRecords.reset && this.viewRecords.reset(), !(e <= 0 || e >= this.rawRecords.length - 1)), this.getColumn = (e, s) => this.data.get(e, s), this.setColumn = (e, s, r) => {
|
|
1618
|
+
e = parseInt(e, 10), this.data.setValue(e, s, r);
|
|
1564
1619
|
}, this.setDataSource([]);
|
|
1565
1620
|
}
|
|
1566
1621
|
};
|
|
1567
|
-
|
|
1568
|
-
let
|
|
1569
|
-
var
|
|
1570
|
-
const
|
|
1622
|
+
ht = new WeakMap(), h(os, "ngDataManager");
|
|
1623
|
+
let $e = os;
|
|
1624
|
+
var wt, M, jt, me;
|
|
1625
|
+
const is = class is {
|
|
1571
1626
|
// 🎯 이제 { name: string, type: string } 객체들의 배열로 관리합니다.
|
|
1572
|
-
constructor(
|
|
1573
|
-
d(this,
|
|
1627
|
+
constructor(n) {
|
|
1628
|
+
d(this, wt);
|
|
1574
1629
|
d(this, M, []);
|
|
1575
|
-
q(this, "add", /* @__PURE__ */ h((
|
|
1576
|
-
|
|
1577
|
-
t(this, M).some((r) => r.name ===
|
|
1578
|
-
}), t(this,
|
|
1630
|
+
q(this, "add", /* @__PURE__ */ h((n, e = "string") => {
|
|
1631
|
+
n.forEach((s) => {
|
|
1632
|
+
t(this, M).some((r) => r.name === s) || t(this, M).push({ name: s, type: e });
|
|
1633
|
+
}), t(this, jt).call(this);
|
|
1579
1634
|
}, "add"));
|
|
1580
|
-
d(this,
|
|
1581
|
-
const
|
|
1635
|
+
d(this, jt, /* @__PURE__ */ h(() => {
|
|
1636
|
+
const n = /* @__PURE__ */ new Map();
|
|
1582
1637
|
t(this, M).forEach((e) => {
|
|
1583
|
-
|
|
1584
|
-
}), p(this, M, Array.from(
|
|
1638
|
+
n.set(e.name, e.type);
|
|
1639
|
+
}), p(this, M, Array.from(n, ([e, s]) => ({ name: e, type: s }))), p(this, M, t(this, M).filter((e) => e.name !== "" && e.name !== "__ng")), t(this, M).sort((e, s) => e.name.length < s.name.length ? 1 : -1);
|
|
1585
1640
|
}, "#adjust"));
|
|
1586
|
-
d(this,
|
|
1587
|
-
p(this, M, []), S.log(t(this,
|
|
1588
|
-
const
|
|
1589
|
-
if (!(!
|
|
1590
|
-
for (const e of
|
|
1591
|
-
S.log(e), $("[data-bind]", e).each((
|
|
1641
|
+
d(this, me, /* @__PURE__ */ h(() => {
|
|
1642
|
+
p(this, M, []), S.log(t(this, wt).querySelectorAll("table"));
|
|
1643
|
+
const n = Array.from(t(this, wt).querySelectorAll("table"));
|
|
1644
|
+
if (!(!n || n.length === 0)) {
|
|
1645
|
+
for (const e of n)
|
|
1646
|
+
S.log(e), $("[data-bind]", e).each((s, r) => {
|
|
1592
1647
|
const o = r.dataset.bind, i = r.getAttribute("data-type") || "string";
|
|
1593
1648
|
o && t(this, M).push({ name: o, type: i });
|
|
1594
|
-
}), ["data-expr", "background-color", "color", "tooltip", "visible", "readonly", "enable-button", "enable-check", "class-expr", "icon-color", "icon-src"].forEach((
|
|
1595
|
-
$(`[${
|
|
1596
|
-
var i = o.getAttribute(
|
|
1649
|
+
}), ["data-expr", "background-color", "color", "tooltip", "visible", "readonly", "enable-button", "enable-check", "class-expr", "icon-color", "icon-src"].forEach((s) => {
|
|
1650
|
+
$(`[${s}]`, e).each((r, o) => {
|
|
1651
|
+
var i = o.getAttribute(s);
|
|
1597
1652
|
if (i.indexOf("data.") < 0) {
|
|
1598
1653
|
const a = i.search(/[(]/g);
|
|
1599
1654
|
if (a > 0)
|
|
@@ -1612,68 +1667,68 @@ const rs = class rs {
|
|
|
1612
1667
|
});
|
|
1613
1668
|
});
|
|
1614
1669
|
});
|
|
1615
|
-
t(this,
|
|
1670
|
+
t(this, jt).call(this);
|
|
1616
1671
|
}
|
|
1617
1672
|
}, "#init"));
|
|
1618
|
-
p(this,
|
|
1673
|
+
p(this, wt, n), t(this, me).call(this);
|
|
1619
1674
|
}
|
|
1620
1675
|
// 🎯 기존에 필드 이름만 쓰던 곳들과의 호환을 위해 이름 배열만 리턴하는 메서드 유지
|
|
1621
1676
|
get() {
|
|
1622
|
-
return t(this, M).map((
|
|
1677
|
+
return t(this, M).map((n) => n.name);
|
|
1623
1678
|
}
|
|
1624
1679
|
// 🎯 내부 객체 통째로 얻기
|
|
1625
1680
|
getFields() {
|
|
1626
1681
|
return t(this, M);
|
|
1627
1682
|
}
|
|
1628
1683
|
// 🎯 특정 필드의 데이터 타입 조회
|
|
1629
|
-
getType(
|
|
1630
|
-
const e = t(this, M).find((
|
|
1684
|
+
getType(n) {
|
|
1685
|
+
const e = t(this, M).find((s) => s.name === n);
|
|
1631
1686
|
return e ? e.type : "string";
|
|
1632
1687
|
}
|
|
1633
|
-
indexOf(
|
|
1634
|
-
return t(this, M).findIndex((e) => e.name ===
|
|
1688
|
+
indexOf(n) {
|
|
1689
|
+
return t(this, M).findIndex((e) => e.name === n);
|
|
1635
1690
|
}
|
|
1636
|
-
includes(
|
|
1637
|
-
return t(this, M).some((e) => e.name ===
|
|
1691
|
+
includes(n) {
|
|
1692
|
+
return t(this, M).some((e) => e.name === n);
|
|
1638
1693
|
}
|
|
1639
1694
|
};
|
|
1640
|
-
|
|
1641
|
-
let
|
|
1642
|
-
var
|
|
1643
|
-
const
|
|
1695
|
+
wt = new WeakMap(), M = new WeakMap(), jt = new WeakMap(), me = new WeakMap(), h(is, "ngFields");
|
|
1696
|
+
let Ne = is;
|
|
1697
|
+
var dt, xe, we;
|
|
1698
|
+
const as = class as extends HTMLElement {
|
|
1644
1699
|
constructor() {
|
|
1645
1700
|
super();
|
|
1646
1701
|
//#created = false;
|
|
1647
|
-
d(this,
|
|
1648
|
-
d(this,
|
|
1649
|
-
d(this,
|
|
1650
|
-
this.fields = new
|
|
1702
|
+
d(this, dt);
|
|
1703
|
+
d(this, xe);
|
|
1704
|
+
d(this, we, /* @__PURE__ */ h(() => {
|
|
1705
|
+
this.fields = new Ne(this), p(this, xe, new Ie(this)), S.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
|
|
1651
1706
|
}, "#init"));
|
|
1652
|
-
this.attachShadow({ mode: "open" }), p(this,
|
|
1707
|
+
this.attachShadow({ mode: "open" }), p(this, dt, new $e(this));
|
|
1653
1708
|
}
|
|
1654
1709
|
connectedCallback() {
|
|
1655
|
-
t(this,
|
|
1710
|
+
t(this, we).call(this);
|
|
1656
1711
|
}
|
|
1657
1712
|
disconnectedCallback() {
|
|
1658
1713
|
S.log("NineTable disconnected.");
|
|
1659
1714
|
}
|
|
1660
1715
|
// 🎯 외부에서 grid.data.set(...) 형태로 접근할 수 있도록 데이터 매니저 오픈
|
|
1661
1716
|
get data() {
|
|
1662
|
-
return t(this,
|
|
1717
|
+
return t(this, dt).data;
|
|
1663
1718
|
}
|
|
1664
1719
|
// 🎯 행(row) 관련 제어 접근자 오픈
|
|
1665
1720
|
get row() {
|
|
1666
|
-
return t(this,
|
|
1721
|
+
return t(this, dt).row;
|
|
1667
1722
|
}
|
|
1668
1723
|
// 🎯 전체 데이터 매니저 접근 필요할 경우
|
|
1669
1724
|
get dataManager() {
|
|
1670
|
-
return t(this,
|
|
1725
|
+
return t(this, dt);
|
|
1671
1726
|
}
|
|
1672
1727
|
};
|
|
1673
|
-
|
|
1674
|
-
let
|
|
1675
|
-
customElements.get("nine-table") || customElements.define("nine-table",
|
|
1676
|
-
const
|
|
1728
|
+
dt = new WeakMap(), xe = new WeakMap(), we = new WeakMap(), h(as, "NineTable");
|
|
1729
|
+
let _e = as;
|
|
1730
|
+
customElements.get("nine-table") || customElements.define("nine-table", _e);
|
|
1731
|
+
const Et = class Et extends HTMLElement {
|
|
1677
1732
|
// 👈 커스텀 스타일용 캐시 추가
|
|
1678
1733
|
constructor() {
|
|
1679
1734
|
super();
|
|
@@ -1684,31 +1739,31 @@ const qt = class qt extends HTMLElement {
|
|
|
1684
1739
|
connectedCallback() {
|
|
1685
1740
|
}
|
|
1686
1741
|
};
|
|
1687
|
-
h(
|
|
1688
|
-
let
|
|
1689
|
-
var I,
|
|
1690
|
-
const
|
|
1742
|
+
h(Et, "BasicCellElement"), q(Et, "_styleCache", /* @__PURE__ */ new Map()), q(Et, "_customStyleCache", /* @__PURE__ */ new Map());
|
|
1743
|
+
let De = Et;
|
|
1744
|
+
var I, Yt, x, je, Ye, Ve, Ue, Xe;
|
|
1745
|
+
const ls = class ls extends De {
|
|
1691
1746
|
constructor() {
|
|
1692
1747
|
super();
|
|
1693
1748
|
d(this, I);
|
|
1694
|
-
d(this,
|
|
1749
|
+
d(this, Yt);
|
|
1695
1750
|
d(this, x);
|
|
1696
|
-
d(this, Pe);
|
|
1697
|
-
d(this, Fe);
|
|
1698
1751
|
d(this, je);
|
|
1699
1752
|
d(this, Ye);
|
|
1753
|
+
d(this, Ve);
|
|
1754
|
+
d(this, Ue);
|
|
1700
1755
|
q(this, "getDisplayText", /* @__PURE__ */ h((e) => {
|
|
1701
1756
|
if (t(this, x))
|
|
1702
1757
|
if (t(this, x).closest("tbody")) {
|
|
1703
|
-
const
|
|
1704
|
-
if (!
|
|
1758
|
+
const s = t(this, x).closest("tr").data, r = parseInt(t(this, x).dataset.row);
|
|
1759
|
+
if (!s) return "";
|
|
1705
1760
|
if (ninegrid.isNull(t(this, x).dataset.expr)) {
|
|
1706
1761
|
if (!ninegrid.isNull(t(this, x).dataset.bind))
|
|
1707
|
-
return
|
|
1762
|
+
return s[t(this, x).dataset.bind] || ninegrid.nvl(e, "");
|
|
1708
1763
|
} else try {
|
|
1709
|
-
return this.getExprValue(t(this, x).dataset.expr,
|
|
1764
|
+
return this.getExprValue(t(this, x).dataset.expr, s, r, t(this, x));
|
|
1710
1765
|
} catch {
|
|
1711
|
-
console.error(t(this, x).dataset.expr,
|
|
1766
|
+
console.error(t(this, x).dataset.expr, s, t(this, x).dataset.row);
|
|
1712
1767
|
}
|
|
1713
1768
|
return ninegrid.nvl(e, "");
|
|
1714
1769
|
} else
|
|
@@ -1717,17 +1772,17 @@ const is = class is extends Me {
|
|
|
1717
1772
|
} catch {
|
|
1718
1773
|
}
|
|
1719
1774
|
}, "getDisplayText"));
|
|
1720
|
-
d(this,
|
|
1775
|
+
d(this, Xe, /* @__PURE__ */ h(() => {
|
|
1721
1776
|
if (!(!t(this, I) || !t(this, I).template || !t(this, x).closest("tbody.bindable"))) {
|
|
1722
1777
|
var e = ninegrid.j.querySelectorAll(t(this, x)).attr("suppress");
|
|
1723
1778
|
if (e && (e = parseInt(e)), e && !isNaN(e)) {
|
|
1724
|
-
var
|
|
1725
|
-
$("th,td",
|
|
1779
|
+
var s = t(this, x).closest("tr"), r = [];
|
|
1780
|
+
$("th,td", s).each((m, C) => {
|
|
1726
1781
|
var A = ninegrid.j.querySelectorAll(C).attr("suppress");
|
|
1727
1782
|
A && C.dataset.row && (A = parseInt(A), !isNaN(A) && A <= e && r.push(A));
|
|
1728
1783
|
}), r.sort();
|
|
1729
1784
|
var o = !1;
|
|
1730
|
-
if (parseInt(
|
|
1785
|
+
if (parseInt(s.sectionRowIndex / t(this, I).template.length) > 0)
|
|
1731
1786
|
for (var i of r) {
|
|
1732
1787
|
if (i > e) break;
|
|
1733
1788
|
var a = parseInt(t(this, x).dataset.row), c = a - 1, l = t(this, x).closest("tr").data, f = t(this, I).data.get(c);
|
|
@@ -1746,12 +1801,12 @@ const is = class is extends Me {
|
|
|
1746
1801
|
}
|
|
1747
1802
|
}
|
|
1748
1803
|
}, "#resetSuppress"));
|
|
1749
|
-
q(this, "getExprValue", /* @__PURE__ */ h((e,
|
|
1804
|
+
q(this, "getExprValue", /* @__PURE__ */ h((e, s, r, o) => {
|
|
1750
1805
|
if (typeof e < "u")
|
|
1751
1806
|
try {
|
|
1752
1807
|
r = parseInt(r);
|
|
1753
1808
|
const i = e.replace("()", "");
|
|
1754
|
-
return t(this, I)[i] ? t(this, I)[i].call(this,
|
|
1809
|
+
return t(this, I)[i] ? t(this, I)[i].call(this, s, r, t(this, x)) : t(this, I).exprFunction(e).call(this, s, r, t(this, I).data);
|
|
1755
1810
|
} catch {
|
|
1756
1811
|
return ["NG-COMBO"].includes(this.tagName) ? "" : e;
|
|
1757
1812
|
}
|
|
@@ -1760,16 +1815,16 @@ const is = class is extends Me {
|
|
|
1760
1815
|
}, "getExprValue"));
|
|
1761
1816
|
}
|
|
1762
1817
|
connectedCallback() {
|
|
1763
|
-
super.connectedCallback(), p(this, I, this.getRootNode().host), p(this, x, this.closest("th,td")), p(this,
|
|
1818
|
+
super.connectedCallback(), p(this, I, this.getRootNode().host), p(this, x, this.closest("th,td")), p(this, Yt, t(this, x).closest("tr"));
|
|
1764
1819
|
}
|
|
1765
1820
|
get value() {
|
|
1766
1821
|
var e = !t(this, I) || !t(this, I).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];
|
|
1767
1822
|
return e ?? "";
|
|
1768
1823
|
}
|
|
1769
1824
|
set value(e) {
|
|
1770
|
-
var
|
|
1825
|
+
var s = parseInt(t(this, x).dataset.row);
|
|
1771
1826
|
const r = this.getAttribute("update-row-state") != "false";
|
|
1772
|
-
|
|
1827
|
+
s < 0 ? t(this, I).data.setValueNF(parseInt(t(this, x).dataset.index), t(this, x).dataset.bind, e, r) : t(this, I).data.setValue(s, t(this, x).dataset.bind, e, r);
|
|
1773
1828
|
}
|
|
1774
1829
|
get row() {
|
|
1775
1830
|
return parseInt(t(this, x).dataset.row);
|
|
@@ -1779,12 +1834,12 @@ const is = class is extends Me {
|
|
|
1779
1834
|
}
|
|
1780
1835
|
refresh() {
|
|
1781
1836
|
const e = t(this, x).dataset.bind;
|
|
1782
|
-
return parseInt(t(this, x).dataset.row), t(this,
|
|
1837
|
+
return parseInt(t(this, x).dataset.row), t(this, Yt).data[e];
|
|
1783
1838
|
}
|
|
1784
1839
|
};
|
|
1785
|
-
I = new WeakMap(),
|
|
1786
|
-
let
|
|
1787
|
-
const
|
|
1840
|
+
I = new WeakMap(), Yt = new WeakMap(), x = new WeakMap(), je = new WeakMap(), Ye = new WeakMap(), Ve = new WeakMap(), Ue = new WeakMap(), Xe = new WeakMap(), h(ls, "CellElement");
|
|
1841
|
+
let Oe = ls;
|
|
1842
|
+
const cs = class cs extends Oe {
|
|
1788
1843
|
constructor() {
|
|
1789
1844
|
super();
|
|
1790
1845
|
}
|
|
@@ -1795,21 +1850,21 @@ const as = class as extends _e {
|
|
|
1795
1850
|
return super.refresh();
|
|
1796
1851
|
}
|
|
1797
1852
|
};
|
|
1798
|
-
h(
|
|
1799
|
-
let
|
|
1800
|
-
var
|
|
1801
|
-
const
|
|
1853
|
+
h(cs, "EditableCellElement");
|
|
1854
|
+
let We = cs;
|
|
1855
|
+
var Vt, ft, vt, St, ve, K, Ge;
|
|
1856
|
+
const hs = class hs extends We {
|
|
1802
1857
|
constructor() {
|
|
1803
1858
|
super();
|
|
1804
|
-
d(this,
|
|
1805
|
-
d(this,
|
|
1859
|
+
d(this, Vt);
|
|
1860
|
+
d(this, ft);
|
|
1861
|
+
d(this, vt);
|
|
1806
1862
|
d(this, St);
|
|
1807
|
-
d(this,
|
|
1808
|
-
d(this,
|
|
1809
|
-
d(this, J);
|
|
1863
|
+
d(this, ve);
|
|
1864
|
+
d(this, K);
|
|
1810
1865
|
q(this, "refresh", /* @__PURE__ */ h(() => {
|
|
1811
1866
|
const e = super.refresh();
|
|
1812
|
-
t(this,
|
|
1867
|
+
t(this, Vt).value = e;
|
|
1813
1868
|
}, "refresh"));
|
|
1814
1869
|
/**
|
|
1815
1870
|
dataRefresh = (v) => {
|
|
@@ -1841,36 +1896,36 @@ const ls = class ls extends Ne {
|
|
|
1841
1896
|
if (!v) this.reset();
|
|
1842
1897
|
};
|
|
1843
1898
|
*/
|
|
1844
|
-
d(this,
|
|
1899
|
+
d(this, Ge, /* @__PURE__ */ h((e) => {
|
|
1845
1900
|
if (!["Escape", "Enter", "Tab", "Home", "End", "ArrowLeft", "ArrowRight", "PageUp", "PageDown", "Backspace", "Delete"].includes(e.code)) {
|
|
1846
|
-
if (t(this,
|
|
1901
|
+
if (t(this, ft) == "number") {
|
|
1847
1902
|
let o = [];
|
|
1848
|
-
if (t(this,
|
|
1849
|
-
var
|
|
1903
|
+
if (t(this, K) && Number(t(this, K)) > 0 && o.push("."), t(this, St) && Number(t(this, St)) >= 0 && o.push("-"), !(e.keyCode >= 48 && e.keyCode <= 57 || e.keyCode >= 96 && e.keyCode <= 105) && !o.includes(e.key) && e.preventDefault(), t(this, K) && (e.keyCode >= 48 && e.keyCode <= 57 || e.keyCode >= 96 && e.keyCode <= 105) && e.target.selectionStart == e.target.selectionEnd) {
|
|
1904
|
+
var s = e.target.value, r = s.indexOf(".");
|
|
1850
1905
|
if (r >= 0) {
|
|
1851
|
-
var
|
|
1852
|
-
|
|
1906
|
+
var s = s.substr(r + 1, s.length);
|
|
1907
|
+
s.length >= Number(t(this, K)) && e.preventDefault();
|
|
1853
1908
|
}
|
|
1854
1909
|
}
|
|
1855
1910
|
}
|
|
1856
|
-
t(this,
|
|
1911
|
+
t(this, vt) && ninegrid.getByteLength(e.target.value) >= Number(t(this, vt)) && e.target.selectionStart == e.target.selectionEnd && e.preventDefault();
|
|
1857
1912
|
}
|
|
1858
1913
|
}, "#onKeyDown"));
|
|
1859
|
-
if (this.applyBaseStyle(), p(this,
|
|
1914
|
+
if (this.applyBaseStyle(), p(this, ft, this.getAttribute("type") || "text"), p(this, vt, this.getAttribute("maxbyte")), p(this, St, this.getAttribute("min")), p(this, ve, this.getAttribute("max")), p(this, K, this.getAttribute("scale")), !["text", "number"].includes(t(this, ft))) throw `invalid type : ${t(this, ft)}`;
|
|
1860
1915
|
}
|
|
1861
1916
|
connectedCallback() {
|
|
1862
|
-
for (var e = [],
|
|
1863
|
-
["type", "maxlength", "maxbyte", "min", "max", "step", "scale", "text-align"].includes(this.attributes[
|
|
1917
|
+
for (var e = [], s = 0; s < this.attributes.length; s++)
|
|
1918
|
+
["type", "maxlength", "maxbyte", "min", "max", "step", "scale", "text-align"].includes(this.attributes[s].name) && e.push(`${this.attributes[s].name}="${this.attributes[s].value}"`);
|
|
1864
1919
|
this.innerHTML = `
|
|
1865
1920
|
<input type="text"
|
|
1866
1921
|
${e.join(" ")}
|
|
1867
1922
|
ondragstart="return false;"
|
|
1868
1923
|
>
|
|
1869
|
-
`, super.connectedCallback(), p(this,
|
|
1924
|
+
`, super.connectedCallback(), p(this, Vt, this.querySelector("input"));
|
|
1870
1925
|
}
|
|
1871
1926
|
};
|
|
1872
|
-
|
|
1873
|
-
let
|
|
1927
|
+
Vt = new WeakMap(), ft = new WeakMap(), vt = new WeakMap(), St = new WeakMap(), ve = new WeakMap(), K = new WeakMap(), Ge = new WeakMap(), h(hs, "CellInputText");
|
|
1928
|
+
let ze = hs;
|
|
1874
1929
|
customElements.get("cell-input-text");
|
|
1875
|
-
customElements.get("cell-input") || customElements.define("cell-input",
|
|
1930
|
+
customElements.get("cell-input") || customElements.define("cell-input", ze);
|
|
1876
1931
|
//# sourceMappingURL=nine-table.js.map
|