@ninebone/table 0.0.535 → 0.0.537
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 +274 -273
- 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,44 +1,44 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
throw TypeError(
|
|
1
|
+
var Ve = Object.defineProperty;
|
|
2
|
+
var Ye = (q) => {
|
|
3
|
+
throw TypeError(q);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var h = (
|
|
7
|
-
var A = (
|
|
8
|
-
var t = (
|
|
9
|
-
var
|
|
5
|
+
var Ke = (q, r, e) => r in q ? Ve(q, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : q[r] = e;
|
|
6
|
+
var h = (q, r) => Ve(q, "name", { value: r, configurable: !0 });
|
|
7
|
+
var A = (q, r, e) => Ke(q, typeof r != "symbol" ? r + "" : r, e), Ue = (q, r, e) => r.has(q) || Ye("Cannot " + e);
|
|
8
|
+
var t = (q, r, e) => (Ue(q, r, "read from private field"), e ? e.call(q) : r.get(q)), d = (q, r, e) => r.has(q) ? Ye("Cannot add the same private member more than once") : r instanceof WeakSet ? r.add(q) : r.set(q, e), b = (q, r, e, s) => (Ue(q, r, "write to private field"), s ? s.call(q, e) : r.set(q, e), e);
|
|
9
|
+
var Xe = (q, r, e, s) => ({
|
|
10
10
|
set _(i) {
|
|
11
|
-
|
|
11
|
+
b(q, r, i, e);
|
|
12
12
|
},
|
|
13
13
|
get _() {
|
|
14
|
-
return t(
|
|
14
|
+
return t(q, r, s);
|
|
15
15
|
}
|
|
16
16
|
});
|
|
17
|
-
import { trace as
|
|
18
|
-
const
|
|
17
|
+
import { trace as Ze } from "@ninebone/util";
|
|
18
|
+
const Me = class Me extends Ze.constructor {
|
|
19
19
|
constructor() {
|
|
20
20
|
super(), this.init("nine-table", "green");
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
|
-
h(
|
|
24
|
-
let
|
|
25
|
-
const H = new
|
|
26
|
-
var z, j, w,
|
|
27
|
-
const
|
|
23
|
+
h(Me, "Trace");
|
|
24
|
+
let le = Me;
|
|
25
|
+
const H = new le();
|
|
26
|
+
var z, j, w, K, Z, G, Nt, J, Wt;
|
|
27
|
+
const $e = class $e extends HTMLElement {
|
|
28
28
|
constructor() {
|
|
29
29
|
super();
|
|
30
30
|
d(this, z);
|
|
31
31
|
d(this, j, !1);
|
|
32
32
|
d(this, w);
|
|
33
|
-
d(this, X);
|
|
34
33
|
d(this, K);
|
|
35
34
|
d(this, Z);
|
|
36
|
-
d(this,
|
|
35
|
+
d(this, G);
|
|
36
|
+
d(this, Nt, /* @__PURE__ */ h(() => {
|
|
37
37
|
if (!t(this, z)) return;
|
|
38
38
|
const e = t(this, z).querySelector(".ng-container-body .ng-part-body");
|
|
39
|
-
e && (
|
|
39
|
+
e && (b(this, G, new ResizeObserver(() => {
|
|
40
40
|
this.refresh();
|
|
41
|
-
})), t(this,
|
|
41
|
+
})), t(this, G).observe(e));
|
|
42
42
|
}, "#observeResize"));
|
|
43
43
|
A(this, "refresh", /* @__PURE__ */ h(() => {
|
|
44
44
|
if (!t(this, z) || !t(this, w) || t(this, j)) return;
|
|
@@ -56,12 +56,12 @@ const Me = class Me extends HTMLElement {
|
|
|
56
56
|
const f = Math.max(Math.min(c * (o / l), c), 20);
|
|
57
57
|
n.style.width = `${f}px`;
|
|
58
58
|
const u = e.scrollLeft, g = l - o;
|
|
59
|
-
let
|
|
60
|
-
g > 0 && (
|
|
59
|
+
let y = 0;
|
|
60
|
+
g > 0 && (y = parseInt(u / g * (c - f), 10)), y < 0 && (y = 0);
|
|
61
61
|
const m = c - f;
|
|
62
|
-
|
|
62
|
+
y > m && (y = m), n.style.left = `${y}px`, t(this, w).left.disabled = y === 0, t(this, w).right.disabled = y >= m - 1;
|
|
63
63
|
}, "refresh"));
|
|
64
|
-
d(this,
|
|
64
|
+
d(this, J, /* @__PURE__ */ h((e) => {
|
|
65
65
|
if (!t(this, w)) return !1;
|
|
66
66
|
const s = t(this, w).container, i = s.querySelector("table");
|
|
67
67
|
if (!i) return !1;
|
|
@@ -73,18 +73,18 @@ const Me = class Me extends HTMLElement {
|
|
|
73
73
|
const c = s.clientWidth, u = i.scrollWidth - c;
|
|
74
74
|
return l > 0 && u > 0 && (s.scrollLeft = o / l * u), o > 0 && o < l - 1;
|
|
75
75
|
}, "#thumbMoveTo"));
|
|
76
|
-
d(this,
|
|
76
|
+
d(this, Wt, /* @__PURE__ */ h(() => {
|
|
77
77
|
const e = /* @__PURE__ */ h((i) => {
|
|
78
|
-
clearInterval(t(this,
|
|
78
|
+
clearInterval(t(this, K)), clearInterval(t(this, Z));
|
|
79
79
|
const n = parseInt(t(this, w).thumb.style.left || 0, 10);
|
|
80
|
-
t(this,
|
|
81
|
-
clearInterval(t(this,
|
|
80
|
+
t(this, J).call(this, n + i), b(this, K, setInterval(() => {
|
|
81
|
+
clearInterval(t(this, K)), b(this, Z, setInterval(() => {
|
|
82
82
|
const a = parseInt(t(this, w).thumb.style.left || 0, 10);
|
|
83
|
-
t(this,
|
|
83
|
+
t(this, J).call(this, a + i) || clearInterval(t(this, Z));
|
|
84
84
|
}, 50));
|
|
85
85
|
}, 500));
|
|
86
86
|
}, "delayScroll"), s = /* @__PURE__ */ h(() => {
|
|
87
|
-
clearInterval(t(this,
|
|
87
|
+
clearInterval(t(this, K)), clearInterval(t(this, Z));
|
|
88
88
|
}, "clearTimer");
|
|
89
89
|
["mouseup", "mouseleave", "touchend"].forEach((i) => {
|
|
90
90
|
t(this, w).left.addEventListener(i, s), t(this, w).right.addEventListener(i, s), t(this, w).track.addEventListener(i, s);
|
|
@@ -96,23 +96,23 @@ const Me = class Me extends HTMLElement {
|
|
|
96
96
|
if (i.button !== 0) return;
|
|
97
97
|
i.preventDefault();
|
|
98
98
|
const n = t(this, w).track.getBoundingClientRect(), a = t(this, w).thumb.clientWidth;
|
|
99
|
-
t(this,
|
|
99
|
+
t(this, J).call(this, i.clientX - n.left - a / 2);
|
|
100
100
|
}), t(this, w).thumb.addEventListener("mousedown", (i) => {
|
|
101
101
|
if (i.button !== 0) return;
|
|
102
|
-
i.stopPropagation(), i.preventDefault(),
|
|
102
|
+
i.stopPropagation(), i.preventDefault(), b(this, j, !0), this.shiftX = i.clientX - t(this, w).thumb.getBoundingClientRect().left;
|
|
103
103
|
const n = /* @__PURE__ */ h((o) => {
|
|
104
104
|
if (!t(this, j)) return;
|
|
105
105
|
const l = t(this, w).track.getBoundingClientRect();
|
|
106
|
-
t(this,
|
|
106
|
+
t(this, J).call(this, o.clientX - l.left - this.shiftX);
|
|
107
107
|
}, "onMouseMove"), a = /* @__PURE__ */ h(() => {
|
|
108
|
-
|
|
108
|
+
b(this, j, !1), s(), document.removeEventListener("mousemove", n), document.removeEventListener("mouseup", a), this.refresh();
|
|
109
109
|
}, "onMouseUp");
|
|
110
110
|
document.addEventListener("mousemove", n), document.addEventListener("mouseup", a);
|
|
111
111
|
});
|
|
112
112
|
}, "#init"));
|
|
113
113
|
}
|
|
114
114
|
connectedCallback() {
|
|
115
|
-
if (
|
|
115
|
+
if (b(this, z, this.closest("nine-table-sheet") || this.getRootNode().host), !t(this, z)) return;
|
|
116
116
|
this.innerHTML = `
|
|
117
117
|
<style>
|
|
118
118
|
nine-table-hscrollbar {
|
|
@@ -182,7 +182,7 @@ const Me = class Me extends HTMLElement {
|
|
|
182
182
|
setTimeout(e, 10);
|
|
183
183
|
return;
|
|
184
184
|
}
|
|
185
|
-
|
|
185
|
+
b(this, w, {
|
|
186
186
|
container: s,
|
|
187
187
|
track: this.querySelector(".ng-scroll-track"),
|
|
188
188
|
thumb: this.querySelector(".ng-scroll-thumb"),
|
|
@@ -190,33 +190,33 @@ const Me = class Me extends HTMLElement {
|
|
|
190
190
|
right: this.querySelector(".ng-scroll-right")
|
|
191
191
|
}), s.addEventListener("scroll", () => {
|
|
192
192
|
t(this, j) || this.refresh();
|
|
193
|
-
}), t(this,
|
|
193
|
+
}), t(this, Wt).call(this), t(this, Nt).call(this), this.refresh();
|
|
194
194
|
}, "initWhenReady");
|
|
195
195
|
e();
|
|
196
196
|
}
|
|
197
197
|
disconnectedCallback() {
|
|
198
|
-
t(this,
|
|
198
|
+
t(this, G) && t(this, G).disconnect();
|
|
199
199
|
}
|
|
200
200
|
};
|
|
201
|
-
z = new WeakMap(), j = new WeakMap(), w = new WeakMap(),
|
|
202
|
-
let
|
|
203
|
-
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar",
|
|
204
|
-
var F, at,
|
|
205
|
-
const
|
|
201
|
+
z = new WeakMap(), j = new WeakMap(), w = new WeakMap(), K = new WeakMap(), Z = new WeakMap(), G = new WeakMap(), Nt = new WeakMap(), J = new WeakMap(), Wt = new WeakMap(), h($e, "NineTableHScrollBar");
|
|
202
|
+
let ce = $e;
|
|
203
|
+
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", ce);
|
|
204
|
+
var F, at, Q, R, vt, wt, Ot;
|
|
205
|
+
const Ie = class Ie extends HTMLElement {
|
|
206
206
|
constructor() {
|
|
207
207
|
super();
|
|
208
208
|
d(this, F);
|
|
209
209
|
d(this, at);
|
|
210
|
-
d(this,
|
|
211
|
-
d(this,
|
|
210
|
+
d(this, Q, !1);
|
|
211
|
+
d(this, R);
|
|
212
212
|
d(this, vt, 0);
|
|
213
213
|
d(this, wt, 0);
|
|
214
214
|
A(this, "refresh", /* @__PURE__ */ h(() => {
|
|
215
|
-
if (!t(this, F) || !t(this,
|
|
215
|
+
if (!t(this, F) || !t(this, R)) return;
|
|
216
216
|
H.log("nine-table-vscrollbar.refresh");
|
|
217
|
-
const e = t(this,
|
|
217
|
+
const e = t(this, R).container, s = t(this, R).track, i = t(this, R).thumb, n = e.clientHeight, o = (t(this, F).data.get() || []).length, l = t(this, at).getRowHeight(), c = o * l;
|
|
218
218
|
if (c <= n) {
|
|
219
|
-
i.style.display = "none", t(this,
|
|
219
|
+
i.style.display = "none", t(this, R).top.disabled = !0, t(this, R).bottom.disabled = !0;
|
|
220
220
|
return;
|
|
221
221
|
} else
|
|
222
222
|
i.style.display = "block";
|
|
@@ -224,54 +224,54 @@ const $e = class $e extends HTMLElement {
|
|
|
224
224
|
if (f <= 0) return;
|
|
225
225
|
const u = Math.max(Math.min(f * (n / c), f), 20);
|
|
226
226
|
i.style.height = `${u}px`;
|
|
227
|
-
const g = e.scrollTop,
|
|
227
|
+
const g = e.scrollTop, y = Math.max(c - n, 1);
|
|
228
228
|
let m = 0;
|
|
229
|
-
|
|
229
|
+
y > 0 && (m = g / y * (f - u));
|
|
230
230
|
const v = f - u;
|
|
231
|
-
m < 0 && (m = 0), m > v && (m = v), i.style.top = `${m}px`, t(this,
|
|
231
|
+
m < 0 && (m = 0), m > v && (m = v), i.style.top = `${m}px`, t(this, R).top.disabled = g <= 0, t(this, R).bottom.disabled = g >= y - 1;
|
|
232
232
|
}, "refresh"));
|
|
233
|
-
d(this,
|
|
233
|
+
d(this, Ot, /* @__PURE__ */ h(() => {
|
|
234
234
|
H.log("nine-table-vscrollbar.#init");
|
|
235
|
-
const e = t(this,
|
|
235
|
+
const e = t(this, R).container, s = /* @__PURE__ */ h(() => {
|
|
236
236
|
const n = (t(this, F).data.get() || []).length, a = t(this, at).getRowHeight();
|
|
237
237
|
return n * a;
|
|
238
238
|
}, "getContentHeight");
|
|
239
239
|
e.addEventListener("scroll", () => {
|
|
240
|
-
t(this,
|
|
241
|
-
}), t(this,
|
|
240
|
+
t(this, Q) || this.refresh();
|
|
241
|
+
}), t(this, R).thumb.addEventListener("mousedown", (i) => {
|
|
242
242
|
if (i.button !== 0) return;
|
|
243
|
-
i.stopPropagation(), i.preventDefault(),
|
|
243
|
+
i.stopPropagation(), i.preventDefault(), b(this, Q, !0), b(this, vt, i.clientY), b(this, wt, e.scrollTop);
|
|
244
244
|
const n = /* @__PURE__ */ h((o) => {
|
|
245
|
-
if (!t(this,
|
|
246
|
-
const l = t(this,
|
|
245
|
+
if (!t(this, Q)) return;
|
|
246
|
+
const l = t(this, R).track.getBoundingClientRect(), c = t(this, R).thumb.clientHeight, u = l.height - c, g = o.clientY - t(this, vt), y = e.clientHeight, m = s(), v = Math.max(m - y, 1);
|
|
247
247
|
if (u > 0 && v > 0) {
|
|
248
248
|
const E = g / u * v;
|
|
249
249
|
let x = t(this, wt) + E;
|
|
250
|
-
const M = Math.max(0, m -
|
|
250
|
+
const M = Math.max(0, m - y);
|
|
251
251
|
x < 0 && (x = 0), x > M && (x = M), e.scrollTop = x;
|
|
252
252
|
}
|
|
253
253
|
this.refresh();
|
|
254
254
|
}, "onMouseMove"), a = /* @__PURE__ */ h(() => {
|
|
255
|
-
|
|
255
|
+
b(this, Q, !1), document.removeEventListener("mousemove", n), document.removeEventListener("mouseup", a), this.refresh();
|
|
256
256
|
}, "onMouseUp");
|
|
257
257
|
document.addEventListener("mousemove", n), document.addEventListener("mouseup", a);
|
|
258
|
-
}), t(this,
|
|
259
|
-
if (i.button !== 0 || i.target === t(this,
|
|
260
|
-
const n = t(this,
|
|
258
|
+
}), t(this, R).track.addEventListener("mousedown", (i) => {
|
|
259
|
+
if (i.button !== 0 || i.target === t(this, R).thumb) return;
|
|
260
|
+
const n = t(this, R).track.getBoundingClientRect(), a = t(this, R).thumb.clientHeight, o = i.clientY - n.top - a / 2, c = n.height - a, f = e.clientHeight, u = s(), g = Math.max(u - f, 1);
|
|
261
261
|
if (c > 0 && g > 0) {
|
|
262
|
-
const
|
|
263
|
-
e.scrollTop =
|
|
262
|
+
const y = Math.max(0, Math.min(1, o / c));
|
|
263
|
+
e.scrollTop = y * g;
|
|
264
264
|
}
|
|
265
265
|
this.refresh();
|
|
266
|
-
}), t(this,
|
|
266
|
+
}), t(this, R).top.addEventListener("click", () => {
|
|
267
267
|
e.scrollTop -= 40;
|
|
268
|
-
}), t(this,
|
|
268
|
+
}), t(this, R).bottom.addEventListener("click", () => {
|
|
269
269
|
e.scrollTop += 40;
|
|
270
270
|
});
|
|
271
271
|
}, "#init"));
|
|
272
272
|
}
|
|
273
273
|
connectedCallback() {
|
|
274
|
-
|
|
274
|
+
b(this, F, this.getRootNode().host), b(this, at, this.closest("nine-table-sheet")), this.innerHTML = `
|
|
275
275
|
<style>
|
|
276
276
|
nine-table-vscrollbar {
|
|
277
277
|
display: flex;
|
|
@@ -341,44 +341,44 @@ const $e = class $e extends HTMLElement {
|
|
|
341
341
|
setTimeout(e, 10);
|
|
342
342
|
return;
|
|
343
343
|
}
|
|
344
|
-
|
|
344
|
+
b(this, R, {
|
|
345
345
|
container: s,
|
|
346
346
|
track: this.querySelector(".ng-scroll-track"),
|
|
347
347
|
thumb: this.querySelector(".ng-scroll-thumb"),
|
|
348
348
|
top: this.querySelector(".ng-scroll-top"),
|
|
349
349
|
bottom: this.querySelector(".ng-scroll-bottom")
|
|
350
|
-
}), t(this,
|
|
350
|
+
}), t(this, Ot).call(this), this.refresh();
|
|
351
351
|
}, "initWhenReady");
|
|
352
352
|
e();
|
|
353
353
|
}
|
|
354
354
|
};
|
|
355
|
-
F = new WeakMap(), at = new WeakMap(),
|
|
356
|
-
let
|
|
357
|
-
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar",
|
|
358
|
-
var P, S,
|
|
359
|
-
const
|
|
355
|
+
F = new WeakMap(), at = new WeakMap(), Q = new WeakMap(), R = new WeakMap(), vt = new WeakMap(), wt = new WeakMap(), Ot = new WeakMap(), h(Ie, "NineTableVScrollBar");
|
|
356
|
+
let he = Ie;
|
|
357
|
+
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar", he);
|
|
358
|
+
var P, S, V, D, I, Y, tt, St, Ae, lt, Bt, Et, zt, Dt, At, qt, Pt, jt, Rt, qe, ct, Tt, Ft;
|
|
359
|
+
const _e = class _e {
|
|
360
360
|
constructor(r) {
|
|
361
361
|
d(this, P);
|
|
362
362
|
d(this, S);
|
|
363
|
-
d(this,
|
|
363
|
+
d(this, V);
|
|
364
364
|
d(this, D, /* @__PURE__ */ new Map());
|
|
365
365
|
d(this, I, null);
|
|
366
|
-
d(this,
|
|
366
|
+
d(this, Y, null);
|
|
367
367
|
d(this, tt, 0);
|
|
368
368
|
d(this, St, 40);
|
|
369
|
-
d(this,
|
|
369
|
+
d(this, Ae, !1);
|
|
370
370
|
d(this, lt, !1);
|
|
371
|
-
d(this,
|
|
371
|
+
d(this, Bt, 3);
|
|
372
372
|
A(this, "refresh", /* @__PURE__ */ h(() => {
|
|
373
373
|
H.log("rowManager.refresh");
|
|
374
374
|
const r = t(this, S).querySelector(".ng-container-body .ng-part-body");
|
|
375
|
-
r && (t(this,
|
|
375
|
+
r && (t(this, At).call(this), t(this, ct).call(this, r.scrollTop));
|
|
376
376
|
}, "refresh"));
|
|
377
377
|
A(this, "initialize", /* @__PURE__ */ h(() => {
|
|
378
|
-
H.log("rowManager.initialize"),
|
|
378
|
+
H.log("rowManager.initialize"), b(this, V, {
|
|
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
|
-
}),
|
|
381
|
+
}), b(this, I, null), t(this, D).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((a) => {
|
|
382
382
|
const o = t(this, S).querySelector(a);
|
|
383
383
|
if (!o) return;
|
|
384
384
|
const l = o.querySelector(".ng-part-body table");
|
|
@@ -390,7 +390,7 @@ const Ie = class Ie {
|
|
|
390
390
|
});
|
|
391
391
|
const r = t(this, S).querySelector(".ng-container-body .ng-part-body"), e = t(this, S).querySelector(".ng-container-left .ng-part-body"), s = t(this, S).querySelector(".ng-container-right .ng-part-body"), i = t(this, S).querySelector(".ng-container-body .ng-part-header"), n = t(this, S).querySelector(".ng-container-body .ng-part-footer");
|
|
392
392
|
if (r) {
|
|
393
|
-
t(this,
|
|
393
|
+
t(this, Dt).call(this, r), t(this, Rt).call(this), t(this, At).call(this), t(this, ct).call(this, r.scrollTop);
|
|
394
394
|
let a = !1;
|
|
395
395
|
const o = /* @__PURE__ */ h((l, c, f) => {
|
|
396
396
|
var u;
|
|
@@ -398,14 +398,15 @@ const Ie = class Ie {
|
|
|
398
398
|
}, "syncScroll");
|
|
399
399
|
[r, e, s].forEach((l) => {
|
|
400
400
|
l && l.addEventListener("scroll", () => {
|
|
401
|
-
t(this, lt) || (
|
|
402
|
-
o(l.scrollTop, l.scrollLeft),
|
|
401
|
+
t(this, lt) || (b(this, lt, !0), requestAnimationFrame(() => {
|
|
402
|
+
o(l.scrollTop, l.scrollLeft), b(this, lt, !1);
|
|
403
403
|
}));
|
|
404
404
|
});
|
|
405
405
|
});
|
|
406
406
|
}
|
|
407
407
|
}, "initialize"));
|
|
408
|
-
d(this,
|
|
408
|
+
d(this, Et);
|
|
409
|
+
d(this, zt, /* @__PURE__ */ h((r, e) => {
|
|
409
410
|
H.log("rowManager.#renderRows");
|
|
410
411
|
const s = t(this, D).get(e);
|
|
411
412
|
if (!s || s.length === 0) return;
|
|
@@ -417,9 +418,9 @@ const Ie = class Ie {
|
|
|
417
418
|
s.forEach((l) => {
|
|
418
419
|
a.appendChild(l.cloneNode(!0));
|
|
419
420
|
});
|
|
420
|
-
n ? n.before(a) : i.appendChild(a);
|
|
421
|
+
n ? n.before(a) : i.appendChild(a), e === ".ng-container-body" && (b(this, Et, i.querySelector("tr:not(.nodata)")), t(this, V).firstTr = i.querySelector("tr:not(.nodata)"));
|
|
421
422
|
}, "#renderRows"));
|
|
422
|
-
d(this,
|
|
423
|
+
d(this, Dt, /* @__PURE__ */ h((r) => {
|
|
423
424
|
if (H.log("rowManager.#measureAndCacheHeight"), t(this, I) !== null && t(this, I) > 0)
|
|
424
425
|
return t(this, I);
|
|
425
426
|
H.log("#measureAndCacheHeight");
|
|
@@ -438,9 +439,9 @@ const Ie = class Ie {
|
|
|
438
439
|
const u = s.querySelectorAll("tr:not(.nodata)");
|
|
439
440
|
return u.forEach((g) => {
|
|
440
441
|
f += g.offsetHeight || g.getBoundingClientRect().height;
|
|
441
|
-
}), u.forEach((g) => g.remove()), a.style.display = o, a.style.visibility = l, a.style.position = c,
|
|
442
|
+
}), u.forEach((g) => g.remove()), a.style.display = o, a.style.visibility = l, a.style.position = c, b(this, I, f > 0 ? f : 24), t(this, qt).call(this), t(this, I);
|
|
442
443
|
}, "#measureAndCacheHeight"));
|
|
443
|
-
d(this,
|
|
444
|
+
d(this, At, /* @__PURE__ */ h(() => {
|
|
444
445
|
H.log("rowManager.#updateVirtualScrollHeight");
|
|
445
446
|
const e = (t(this, P).data.get() || []).length, s = t(this, I), i = e * s;
|
|
446
447
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((n) => {
|
|
@@ -450,41 +451,41 @@ const Ie = class Ie {
|
|
|
450
451
|
o && (o.style.height = `${i}px`);
|
|
451
452
|
});
|
|
452
453
|
}, "#updateVirtualScrollHeight"));
|
|
453
|
-
d(this,
|
|
454
|
+
d(this, qt, /* @__PURE__ */ h(() => {
|
|
454
455
|
if (t(this, tt) > 0 && t(this, I) > 0) {
|
|
455
456
|
const r = Math.ceil(t(this, tt) / t(this, I));
|
|
456
|
-
|
|
457
|
+
b(this, St, r + t(this, Bt));
|
|
457
458
|
}
|
|
458
459
|
}, "#updateRowCount"));
|
|
459
|
-
d(this,
|
|
460
|
+
d(this, Pt, /* @__PURE__ */ h(() => {
|
|
460
461
|
var o, l, c, f, u, g;
|
|
461
462
|
const r = t(this, S).querySelector(".ng-container-left .ng-part-body table"), e = t(this, S).querySelector(".ng-container-body .ng-part-body table"), s = t(this, S).querySelector(".ng-container-right .ng-part-body table");
|
|
462
463
|
if (e) {
|
|
463
|
-
const
|
|
464
|
+
const y = r ? Array.from(r.querySelectorAll("tbody tr")) : [], m = Array.from(e.querySelectorAll("tbody tr")), v = s ? Array.from(s.querySelectorAll("tbody tr")) : [], E = Math.max(y.length, m.length, v.length);
|
|
464
465
|
for (let x = 0; x < E; x++) {
|
|
465
466
|
const M = [
|
|
466
|
-
((o =
|
|
467
|
+
((o = y[x]) == null ? void 0 : o.getBoundingClientRect().height) || 0,
|
|
467
468
|
((l = m[x]) == null ? void 0 : l.getBoundingClientRect().height) || 0,
|
|
468
469
|
((c = v[x]) == null ? void 0 : c.getBoundingClientRect().height) || 0
|
|
469
|
-
],
|
|
470
|
-
|
|
470
|
+
], T = Math.max(...M);
|
|
471
|
+
T > 0 && (y[x] && (y[x].style.height = `${T}px`), m[x] && (m[x].style.height = `${T}px`), v[x] && (v[x].style.height = `${T}px`));
|
|
471
472
|
}
|
|
472
473
|
}
|
|
473
474
|
const i = t(this, S).querySelector(".ng-container-left .ng-part-footer table"), n = t(this, S).querySelector(".ng-container-body .ng-part-footer table"), a = t(this, S).querySelector(".ng-container-right .ng-part-footer table");
|
|
474
475
|
if (n) {
|
|
475
|
-
const
|
|
476
|
+
const y = i ? Array.from(i.querySelectorAll("tfoot tr")) : [], m = Array.from(n.querySelectorAll("tfoot tr")), v = a ? Array.from(a.querySelectorAll("tfoot tr")) : [], E = Math.max(y.length, m.length, v.length);
|
|
476
477
|
for (let x = 0; x < E; x++) {
|
|
477
478
|
const M = [
|
|
478
|
-
((f =
|
|
479
|
+
((f = y[x]) == null ? void 0 : f.getBoundingClientRect().height) || 0,
|
|
479
480
|
((u = m[x]) == null ? void 0 : u.getBoundingClientRect().height) || 0,
|
|
480
481
|
((g = v[x]) == null ? void 0 : g.getBoundingClientRect().height) || 0
|
|
481
|
-
],
|
|
482
|
-
|
|
482
|
+
], T = Math.max(...M);
|
|
483
|
+
T > 0 && (y[x] && (y[x].style.height = `${T}px`), m[x] && (m[x].style.height = `${T}px`), v[x] && (v[x].style.height = `${T}px`));
|
|
483
484
|
}
|
|
484
485
|
}
|
|
485
486
|
}, "#syncRowHeights"));
|
|
486
|
-
d(this,
|
|
487
|
-
!t(this, S) || !(t(this, S) instanceof HTMLElement) || (
|
|
487
|
+
d(this, jt, /* @__PURE__ */ h(() => {
|
|
488
|
+
!t(this, S) || !(t(this, S) instanceof HTMLElement) || (b(this, Y, new ResizeObserver((r) => {
|
|
488
489
|
for (const e of r) {
|
|
489
490
|
const s = e.target;
|
|
490
491
|
if (!s.classList.contains("active")) continue;
|
|
@@ -494,18 +495,18 @@ const Ie = class Ie {
|
|
|
494
495
|
const a = s.querySelector(".ng-part-header"), o = s.querySelector(".ng-part-footer");
|
|
495
496
|
a && (n += a.offsetHeight), o && (n += o.offsetHeight);
|
|
496
497
|
const l = Math.max(i - n, 100);
|
|
497
|
-
t(this, tt) !== l && (
|
|
498
|
+
t(this, tt) !== l && (b(this, tt, l), t(this, qt).call(this), t(this, I) !== null && (t(this, Rt).call(this), this.refresh()));
|
|
498
499
|
}
|
|
499
500
|
}
|
|
500
|
-
})), t(this,
|
|
501
|
+
})), t(this, Y).observe(t(this, S)));
|
|
501
502
|
}, "#initResizeObserver"));
|
|
502
503
|
d(this, Rt, /* @__PURE__ */ h(() => {
|
|
503
504
|
H.log("rowManager.#renderAllContainers"), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((r) => {
|
|
504
505
|
const e = t(this, S).querySelector(r);
|
|
505
|
-
e && e.querySelector(".ng-part-body tbody.bindable-tbody") && t(this,
|
|
506
|
-
}), t(this,
|
|
506
|
+
e && e.querySelector(".ng-part-body tbody.bindable-tbody") && t(this, zt).call(this, e, r);
|
|
507
|
+
}), t(this, Ft).call(this), t(this, Pt).call(this);
|
|
507
508
|
}, "#renderAllContainers"));
|
|
508
|
-
d(this,
|
|
509
|
+
d(this, qe, /* @__PURE__ */ h((r) => {
|
|
509
510
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((e) => {
|
|
510
511
|
var c;
|
|
511
512
|
const s = t(this, S).querySelector(e);
|
|
@@ -519,8 +520,8 @@ const Ie = class Ie {
|
|
|
519
520
|
f.style.display = "none";
|
|
520
521
|
return;
|
|
521
522
|
}
|
|
522
|
-
const
|
|
523
|
-
f.style.display = "", t(this,
|
|
523
|
+
const y = t(this, P).data.get(g);
|
|
524
|
+
f.style.display = "", t(this, Tt).call(this, f, y, g);
|
|
524
525
|
});
|
|
525
526
|
});
|
|
526
527
|
}, "#adjustBufferRows"));
|
|
@@ -529,14 +530,14 @@ const Ie = class Ie {
|
|
|
529
530
|
const e = t(this, I);
|
|
530
531
|
if (!e || e <= 0) return;
|
|
531
532
|
const s = t(this, P).data.length, i = Math.max(0, Math.floor(r / e)), n = i * e, a = ((f = t(this, D).get(".ng-container-body")) == null ? void 0 : f.length) || 1, o = t(this, S).querySelector(".ng-container-body"), l = o == null ? void 0 : o.querySelector(".ng-part-body tbody.bindable-tbody tr:not(.nodata)");
|
|
532
|
-
H.log(t(this,
|
|
533
|
+
H.log(t(this, Et), t(this, V).firstTr, t(this, V).firstTr.dataset.row);
|
|
533
534
|
const c = l && l.dataset.row !== void 0 ? parseInt(l.dataset.row, 10) : -1;
|
|
534
|
-
(u = t(this,
|
|
535
|
+
(u = t(this, V)) == null || u.scrollTables.forEach((g) => {
|
|
535
536
|
g.style.transform = `translateY(${n}px)`;
|
|
536
537
|
}), c !== i && [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((g) => {
|
|
537
|
-
const
|
|
538
|
-
if (!
|
|
539
|
-
const m =
|
|
538
|
+
const y = t(this, S).querySelector(g);
|
|
539
|
+
if (!y) return;
|
|
540
|
+
const m = y.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
540
541
|
if (!m) return;
|
|
541
542
|
Array.from(m.querySelectorAll("tr:not(.nodata)")).forEach((E, x) => {
|
|
542
543
|
const M = i + Math.floor(x / a);
|
|
@@ -544,8 +545,8 @@ const Ie = class Ie {
|
|
|
544
545
|
E.style.display = "none";
|
|
545
546
|
return;
|
|
546
547
|
}
|
|
547
|
-
const
|
|
548
|
-
E.style.display = "", t(this,
|
|
548
|
+
const T = t(this, P).data.get(M);
|
|
549
|
+
E.style.display = "", t(this, Tt).call(this, E, T, M);
|
|
549
550
|
});
|
|
550
551
|
});
|
|
551
552
|
}, "#handleScroll"));
|
|
@@ -563,14 +564,14 @@ const Ie = class Ie {
|
|
|
563
564
|
cell.dataset.row = dataIndex;
|
|
564
565
|
});
|
|
565
566
|
}; */
|
|
566
|
-
d(this,
|
|
567
|
+
d(this, Tt, /* @__PURE__ */ h((r, e, s) => {
|
|
567
568
|
r.dataset.row = s, r.data = e, Array.from(r.cells).forEach((i, n) => {
|
|
568
569
|
i.dataset.row = s;
|
|
569
570
|
const a = Array.from(i.children).find((o) => o.tagName.toLowerCase().startsWith("cell-") || typeof o.refresh == "function");
|
|
570
571
|
a && typeof a.refresh == "function" && a.refresh();
|
|
571
572
|
});
|
|
572
573
|
}, "#bindRowData"));
|
|
573
|
-
d(this,
|
|
574
|
+
d(this, Ft, /* @__PURE__ */ h(() => {
|
|
574
575
|
var l, c, f;
|
|
575
576
|
H.log("rowManager.#syncHeaderHeights");
|
|
576
577
|
const r = t(this, S).querySelector(".ng-container-left .ng-part-header table"), e = t(this, S).querySelector(".ng-container-body .ng-part-header table"), s = t(this, S).querySelector(".ng-container-right .ng-part-header table");
|
|
@@ -581,14 +582,14 @@ const Ie = class Ie {
|
|
|
581
582
|
((l = i[u]) == null ? void 0 : l.getBoundingClientRect().height) || 0,
|
|
582
583
|
((c = n[u]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
|
|
583
584
|
((f = a[u]) == null ? void 0 : f.getBoundingClientRect().height) || 0
|
|
584
|
-
],
|
|
585
|
-
|
|
585
|
+
], y = Math.max(...g);
|
|
586
|
+
y > 0 && (i[u] && (i[u].style.height = `${y}px`), n[u] && (n[u].style.height = `${y}px`), a[u] && (a[u].style.height = `${y}px`));
|
|
586
587
|
}
|
|
587
588
|
}, "#syncHeaderHeights"));
|
|
588
589
|
A(this, "destroy", /* @__PURE__ */ h(() => {
|
|
589
|
-
t(this,
|
|
590
|
+
t(this, Y) && (t(this, Y).disconnect(), b(this, Y, null));
|
|
590
591
|
}, "destroy"));
|
|
591
|
-
|
|
592
|
+
b(this, P, r.getRootNode().host), b(this, S, r), t(this, jt).call(this);
|
|
592
593
|
}
|
|
593
594
|
getRowHeight() {
|
|
594
595
|
return t(this, I);
|
|
@@ -598,14 +599,14 @@ const Ie = class Ie {
|
|
|
598
599
|
return ((e = t(this, D).get(r)) == null ? void 0 : e.length) || 1;
|
|
599
600
|
}
|
|
600
601
|
};
|
|
601
|
-
P = new WeakMap(), S = new WeakMap(),
|
|
602
|
-
let
|
|
603
|
-
const
|
|
602
|
+
P = new WeakMap(), S = new WeakMap(), V = new WeakMap(), D = new WeakMap(), I = new WeakMap(), Y = new WeakMap(), tt = new WeakMap(), St = new WeakMap(), Ae = new WeakMap(), lt = new WeakMap(), Bt = new WeakMap(), Et = new WeakMap(), zt = new WeakMap(), Dt = new WeakMap(), At = new WeakMap(), qt = new WeakMap(), Pt = new WeakMap(), jt = new WeakMap(), Rt = new WeakMap(), qe = new WeakMap(), ct = new WeakMap(), Tt = new WeakMap(), Ft = new WeakMap(), h(_e, "RowManager");
|
|
603
|
+
let de = _e;
|
|
604
|
+
const Vt = class Vt {
|
|
604
605
|
/**
|
|
605
606
|
* 🎯 레이아웃 내의 여러 rawTables 배열을 일괄로 받아 단일 마스터 템플릿으로 사전 컴파일합니다.
|
|
606
607
|
*/
|
|
607
608
|
static compileAll(r) {
|
|
608
|
-
return Array.isArray(r) ? r.map((e) =>
|
|
609
|
+
return Array.isArray(r) ? r.map((e) => Vt.compile(e)) : [];
|
|
609
610
|
}
|
|
610
611
|
/**
|
|
611
612
|
* 🎯 단일 원본 테이블을 받아 기본 구조 보정 및 2차원 격자 인덱스 사전 부여 완료된 마스터 테이블 반환
|
|
@@ -617,16 +618,16 @@ const Ft = class Ft {
|
|
|
617
618
|
const f = c.getAttribute("cell-type") || "renderer";
|
|
618
619
|
if (c.children.length > 0 && c.firstElementChild.tagName.includes("-")) return;
|
|
619
620
|
let u = `cell-${f}`;
|
|
620
|
-
const g = c.getAttribute("data-bind"),
|
|
621
|
+
const g = c.getAttribute("data-bind"), y = c.getAttribute("data-expr"), m = c.getAttribute("maxbyte"), v = c.getAttribute("type");
|
|
621
622
|
let E = [];
|
|
622
|
-
g && E.push(`data-bind="${g}"`),
|
|
623
|
+
g && E.push(`data-bind="${g}"`), y && E.push(`data-expr="${y}"`), m && E.push(`maxbyte="${m}"`), v && E.push(`type="${v}"`), c.innerHTML = `<${u} ${E.join(" ")}></${u}>`;
|
|
623
624
|
});
|
|
624
625
|
}, "processCellTypes"), s = /* @__PURE__ */ h((o) => {
|
|
625
626
|
if (!o.querySelector("colgroup")) {
|
|
626
627
|
const l = o.querySelector("tbody tr") || o.querySelector("tr"), c = l ? l.querySelectorAll("th, td").length : 1, f = document.createElement("colgroup"), u = Math.max(Math.floor(o.clientWidth / c), 100);
|
|
627
628
|
for (let g = 0; g < c; g++) {
|
|
628
|
-
const
|
|
629
|
-
|
|
629
|
+
const y = document.createElement("col");
|
|
630
|
+
y.setAttribute("width", u), f.appendChild(y);
|
|
630
631
|
}
|
|
631
632
|
o.prepend(f);
|
|
632
633
|
}
|
|
@@ -642,27 +643,27 @@ const Ft = class Ft {
|
|
|
642
643
|
f.forEach((m) => {
|
|
643
644
|
g += m.colSpan || 1;
|
|
644
645
|
});
|
|
645
|
-
const
|
|
646
|
+
const y = Array.from(Array(u), () => Array(g).fill(null));
|
|
646
647
|
c.forEach((m) => {
|
|
647
648
|
const v = m.sectionRowIndex;
|
|
648
649
|
let E = 0;
|
|
649
650
|
Array.from(m.querySelectorAll("th,td")).forEach((x) => {
|
|
650
|
-
for (let B = 0; B <
|
|
651
|
-
if (
|
|
651
|
+
for (let B = 0; B < y[v].length; B++)
|
|
652
|
+
if (y[v][B] === null) {
|
|
652
653
|
E = B;
|
|
653
654
|
break;
|
|
654
655
|
}
|
|
655
|
-
const M = x.rowSpan || 1,
|
|
656
|
+
const M = x.rowSpan || 1, T = x.colSpan || 1;
|
|
656
657
|
for (let B = 0; B < M; B++)
|
|
657
|
-
for (let pt = 0; pt <
|
|
658
|
-
v + B < u && E + pt < g && (
|
|
658
|
+
for (let pt = 0; pt < T; pt++)
|
|
659
|
+
v + B < u && E + pt < g && (y[v + B][E + pt] = B === 0 && pt === 0 ? "1" : "0");
|
|
659
660
|
});
|
|
660
661
|
}), c.forEach((m) => {
|
|
661
662
|
const v = m.sectionRowIndex;
|
|
662
663
|
Array.from(m.querySelectorAll("th,td")).forEach((E) => {
|
|
663
|
-
for (let x = 0; x <
|
|
664
|
-
if (
|
|
665
|
-
E.dataset.col = x,
|
|
664
|
+
for (let x = 0; x < y[v].length; x++)
|
|
665
|
+
if (y[v][x] === "1") {
|
|
666
|
+
E.dataset.col = x, y[v][x] = "0";
|
|
666
667
|
break;
|
|
667
668
|
}
|
|
668
669
|
});
|
|
@@ -677,19 +678,19 @@ const Ft = class Ft {
|
|
|
677
678
|
}
|
|
678
679
|
// 🎯 [추가] td/th에 선언된 cell-type 속성을 읽어 커스텀 태그로 자동 감싸기
|
|
679
680
|
};
|
|
680
|
-
h(
|
|
681
|
-
let
|
|
682
|
-
var
|
|
681
|
+
h(Vt, "TableCompiler");
|
|
682
|
+
let fe = Vt;
|
|
683
|
+
var Yt, et, st, Ut, Xt, ht, Kt, Zt;
|
|
683
684
|
const mt = class mt extends HTMLElement {
|
|
684
685
|
constructor() {
|
|
685
686
|
super();
|
|
686
|
-
d(this,
|
|
687
|
+
d(this, Yt);
|
|
687
688
|
d(this, et, null);
|
|
688
689
|
d(this, st);
|
|
689
690
|
A(this, "invalidate", /* @__PURE__ */ h(() => {
|
|
690
691
|
t(this, st).refresh();
|
|
691
692
|
}, "invalidate"));
|
|
692
|
-
d(this,
|
|
693
|
+
d(this, Ut, /* @__PURE__ */ h(() => {
|
|
693
694
|
[
|
|
694
695
|
{ selector: ".ng-container-body", type: null },
|
|
695
696
|
{ selector: ".ng-container-left", type: "left" },
|
|
@@ -710,7 +711,7 @@ const mt = class mt extends HTMLElement {
|
|
|
710
711
|
f.className = "ng-part-footer", f.appendChild(t(this, ht).call(this, t(this, et), i, "footer")), n.appendChild(a), n.appendChild(o), n.appendChild(f);
|
|
711
712
|
});
|
|
712
713
|
}, "#renderSplitContainers"));
|
|
713
|
-
d(this,
|
|
714
|
+
d(this, Xt, /* @__PURE__ */ h(() => {
|
|
714
715
|
["left", "right", "body"].forEach((e) => {
|
|
715
716
|
const s = this.querySelector(`.ng-container-${e}`), i = s == null ? void 0 : s.querySelectorAll("table");
|
|
716
717
|
if (!s || !i || i.length === 0) return;
|
|
@@ -722,7 +723,7 @@ const mt = class mt extends HTMLElement {
|
|
|
722
723
|
});
|
|
723
724
|
}, "#updateContainerWidths"));
|
|
724
725
|
A(this, "generate", /* @__PURE__ */ h((e) => {
|
|
725
|
-
e && (
|
|
726
|
+
e && (b(this, et, fe.compile(e)), t(this, Ut).call(this), t(this, Xt).call(this), t(this, st).initialize(), setTimeout(() => {
|
|
726
727
|
var s;
|
|
727
728
|
(s = this.querySelector("nine-table-hscrollbar")) == null || s.refresh();
|
|
728
729
|
}, 0));
|
|
@@ -752,10 +753,10 @@ const mt = class mt extends HTMLElement {
|
|
|
752
753
|
const s = this.querySelector(".ng-container-body .ng-part-body");
|
|
753
754
|
s && (s.scrollTop = e);
|
|
754
755
|
}, "scrollToY"));
|
|
755
|
-
d(this, Xt, /* @__PURE__ */ h(() => {
|
|
756
|
-
t(this, Kt).call(this);
|
|
757
|
-
}, "#init"));
|
|
758
756
|
d(this, Kt, /* @__PURE__ */ h(() => {
|
|
757
|
+
t(this, Zt).call(this);
|
|
758
|
+
}, "#init"));
|
|
759
|
+
d(this, Zt, /* @__PURE__ */ h(() => {
|
|
759
760
|
const e = mt.SCROLLBAR_SIZE;
|
|
760
761
|
this.innerHTML = `
|
|
761
762
|
<style>
|
|
@@ -898,23 +899,23 @@ const mt = class mt extends HTMLElement {
|
|
|
898
899
|
</div>
|
|
899
900
|
`;
|
|
900
901
|
}, "#render"));
|
|
901
|
-
|
|
902
|
+
b(this, st, new de(this)), b(this, Yt, this.getRootNode().host);
|
|
902
903
|
}
|
|
903
904
|
connectedCallback() {
|
|
904
|
-
t(this,
|
|
905
|
+
t(this, Kt).call(this);
|
|
905
906
|
}
|
|
906
907
|
disconnectedCallback() {
|
|
907
908
|
this.innerHTML = "", H.log("NineTableSheet destroyed.");
|
|
908
909
|
}
|
|
909
910
|
};
|
|
910
|
-
|
|
911
|
-
let
|
|
912
|
-
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet",
|
|
913
|
-
var
|
|
914
|
-
const
|
|
911
|
+
Yt = new WeakMap(), et = new WeakMap(), st = new WeakMap(), Ut = new WeakMap(), Xt = new WeakMap(), ht = new WeakMap(), Kt = new WeakMap(), Zt = new WeakMap(), h(mt, "NineTableSheet"), A(mt, "SCROLLBAR_SIZE", 16);
|
|
912
|
+
let _t = mt;
|
|
913
|
+
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", _t);
|
|
914
|
+
var Gt, kt;
|
|
915
|
+
const Ne = class Ne extends HTMLElement {
|
|
915
916
|
constructor() {
|
|
916
917
|
super();
|
|
917
|
-
d(this,
|
|
918
|
+
d(this, Gt, /* @__PURE__ */ h(() => {
|
|
918
919
|
var e;
|
|
919
920
|
(e = this.querySelector(".nine-tab-bar")) == null || e.addEventListener("click", (s) => {
|
|
920
921
|
var a;
|
|
@@ -925,10 +926,10 @@ const _e = class _e extends HTMLElement {
|
|
|
925
926
|
d(this, kt, /* @__PURE__ */ h((e, s = !1) => {
|
|
926
927
|
const i = /* @__PURE__ */ h(() => {
|
|
927
928
|
const f = Array.from(this.querySelectorAll("nine-table-sheet"));
|
|
928
|
-
Array.from(this.querySelectorAll("nine-splitter")).forEach((
|
|
929
|
-
const g = f.filter((
|
|
930
|
-
g.length < 2 || g.forEach((
|
|
931
|
-
const m = parseInt(
|
|
929
|
+
Array.from(this.querySelectorAll("nine-splitter")).forEach((y) => y.style.setProperty("display", "none"));
|
|
930
|
+
const g = f.filter((y) => y.classList.contains("active"));
|
|
931
|
+
g.length < 2 || g.forEach((y) => {
|
|
932
|
+
const m = parseInt(y.getAttribute("data-index"), 10), v = this.querySelector(`nine-splitter[data-split-index="${m}"]`), E = f[m + 1];
|
|
932
933
|
v && E && E.classList.contains("active") && v.style.setProperty("display", "flex");
|
|
933
934
|
});
|
|
934
935
|
}, "updateSplitters"), n = this.querySelector(".nine-tab-bar"), a = this.querySelector("nine-table-sheets-body"), o = n.querySelectorAll(".nine-tab-item"), l = a.querySelectorAll("nine-table-sheet");
|
|
@@ -955,30 +956,30 @@ const _e = class _e extends HTMLElement {
|
|
|
955
956
|
}, "#switchSheet"));
|
|
956
957
|
}
|
|
957
958
|
connectedCallback() {
|
|
958
|
-
t(this,
|
|
959
|
+
t(this, Gt).call(this);
|
|
959
960
|
}
|
|
960
961
|
};
|
|
961
|
-
|
|
962
|
-
let
|
|
963
|
-
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets",
|
|
964
|
-
var _,
|
|
965
|
-
const
|
|
962
|
+
Gt = new WeakMap(), kt = new WeakMap(), h(Ne, "NineTableSheets");
|
|
963
|
+
let ue = Ne;
|
|
964
|
+
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", ue);
|
|
965
|
+
var _, Jt, Ct, Qt;
|
|
966
|
+
const We = class We {
|
|
966
967
|
constructor(r) {
|
|
967
968
|
d(this, _);
|
|
968
|
-
d(this,
|
|
969
|
-
t(this,
|
|
969
|
+
d(this, Jt, /* @__PURE__ */ h(() => {
|
|
970
|
+
t(this, Qt).call(this), new ResizeObserver((r) => {
|
|
970
971
|
for (let e of r)
|
|
971
|
-
t(this, _).getAttribute("auto-height") === "true" && t(this,
|
|
972
|
+
t(this, _).getAttribute("auto-height") === "true" && t(this, Ct).call(this);
|
|
972
973
|
}).observe(t(this, _));
|
|
973
974
|
}, "#init"));
|
|
974
|
-
d(this,
|
|
975
|
+
d(this, Ct, /* @__PURE__ */ h(() => {
|
|
975
976
|
var l, c;
|
|
976
977
|
const r = Array.from(t(this, _).shadowRoot.querySelectorAll("nine-table-sheet.active"));
|
|
977
978
|
if (r.length === 0) return;
|
|
978
|
-
const e = parseInt(t(this, _).getAttribute("max-display-row"), 10) || 10, s = Math.max(...r.map((f) => f.getRowHeight())), i = (l = t(this, _).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : l.getBoundingClientRect().height, n = (c = t(this, _).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : c.getBoundingClientRect().height, a =
|
|
979
|
+
const e = parseInt(t(this, _).getAttribute("max-display-row"), 10) || 10, s = Math.max(...r.map((f) => f.getRowHeight())), i = (l = t(this, _).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : l.getBoundingClientRect().height, n = (c = t(this, _).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : c.getBoundingClientRect().height, a = _t.SCROLLBAR_SIZE, o = e * s + i + n + a;
|
|
979
980
|
t(this, _).style.height = `${o}px`;
|
|
980
981
|
}, "#applyAutoHeight"));
|
|
981
|
-
d(this,
|
|
982
|
+
d(this, Qt, /* @__PURE__ */ h(() => {
|
|
982
983
|
const e = Array.from(t(this, _).children).filter((l) => l.tagName === "TABLE"), s = t(this, _).getAttribute("auto-height") === "true", i = e.length, n = e.map((l, c) => {
|
|
983
984
|
const u = `<nine-table-sheet class="${c === 0 ? "active" : ""}" data-index="${c}"></nine-table-sheet>`, g = c < i - 1 ? `<nine-splitter class="h" data-split-index="${c}"></nine-splitter>` : "";
|
|
984
985
|
return u + g;
|
|
@@ -1077,50 +1078,50 @@ const Ne = class Ne {
|
|
|
1077
1078
|
const o = t(this, _).shadowRoot.querySelectorAll("nine-table-sheet");
|
|
1078
1079
|
o == null || o.forEach((l, c) => {
|
|
1079
1080
|
e[c] && setTimeout(() => {
|
|
1080
|
-
l.generate(e[c]), s && t(this,
|
|
1081
|
+
l.generate(e[c]), s && t(this, Ct).call(this);
|
|
1081
1082
|
});
|
|
1082
1083
|
});
|
|
1083
1084
|
}, "#render"));
|
|
1084
|
-
|
|
1085
|
+
b(this, _, r), t(this, Jt).call(this);
|
|
1085
1086
|
}
|
|
1086
1087
|
};
|
|
1087
|
-
_ = new WeakMap(),
|
|
1088
|
-
let
|
|
1089
|
-
var
|
|
1090
|
-
const
|
|
1088
|
+
_ = new WeakMap(), Jt = new WeakMap(), Ct = new WeakMap(), Qt = new WeakMap(), h(We, "LayoutManager");
|
|
1089
|
+
let ge = We;
|
|
1090
|
+
var Lt, dt;
|
|
1091
|
+
const Oe = class Oe {
|
|
1091
1092
|
constructor(r) {
|
|
1092
|
-
d(this,
|
|
1093
|
+
d(this, Lt);
|
|
1093
1094
|
d(this, dt, -1);
|
|
1094
|
-
A(this, "count", /* @__PURE__ */ h(() => t(this,
|
|
1095
|
-
|
|
1095
|
+
A(this, "count", /* @__PURE__ */ h(() => t(this, Lt).rawRecords.length, "count"));
|
|
1096
|
+
b(this, Lt, r);
|
|
1096
1097
|
}
|
|
1097
1098
|
get at() {
|
|
1098
1099
|
return t(this, dt);
|
|
1099
1100
|
}
|
|
1100
1101
|
set at(r) {
|
|
1101
|
-
|
|
1102
|
+
b(this, dt, parseInt(r, 10)), body && !body.querySelector(`tbody.bindable tr[data-row="${t(this, dt)}"]`) && setTimeout(() => {
|
|
1102
1103
|
});
|
|
1103
1104
|
}
|
|
1104
1105
|
};
|
|
1105
|
-
|
|
1106
|
-
let
|
|
1107
|
-
var N,
|
|
1106
|
+
Lt = new WeakMap(), dt = new WeakMap(), h(Oe, "ngRow");
|
|
1107
|
+
let be = Oe;
|
|
1108
|
+
var N, k, W, ft, te, U, ee, rt, Ht, se, re, ut;
|
|
1108
1109
|
const O = class O {
|
|
1109
1110
|
constructor(r, e) {
|
|
1110
1111
|
d(this, N);
|
|
1111
|
-
d(this,
|
|
1112
|
+
d(this, k);
|
|
1112
1113
|
d(this, W, []);
|
|
1113
1114
|
d(this, ft, []);
|
|
1114
|
-
d(this,
|
|
1115
|
-
d(this,
|
|
1116
|
-
d(this,
|
|
1117
|
-
|
|
1115
|
+
d(this, te, 0);
|
|
1116
|
+
d(this, U, []);
|
|
1117
|
+
d(this, ee, /* @__PURE__ */ h(() => {
|
|
1118
|
+
b(this, U, []);
|
|
1118
1119
|
const r = t(this, N).template || [];
|
|
1119
1120
|
Array.from(r).forEach((e) => {
|
|
1120
1121
|
var s;
|
|
1121
|
-
t(this,
|
|
1122
|
-
}), (t(this,
|
|
1123
|
-
e.__ng || (e.__ng = t(this,
|
|
1122
|
+
t(this, U).push(((s = e.getBoundingClientRect) == null ? void 0 : s.call(e).height) || 24);
|
|
1123
|
+
}), (t(this, k).rawRecords || []).forEach((e) => {
|
|
1124
|
+
e.__ng || (e.__ng = t(this, Ht).call(this)), e.__ng.height = t(this, U).slice();
|
|
1124
1125
|
});
|
|
1125
1126
|
}, "#initialize"));
|
|
1126
1127
|
d(this, rt, /* @__PURE__ */ h(() => {
|
|
@@ -1144,23 +1145,23 @@ const O = class O {
|
|
|
1144
1145
|
A(this, "set", /* @__PURE__ */ h((r) => {
|
|
1145
1146
|
this.clear(), this.add(r, !1), t(this, rt).call(this);
|
|
1146
1147
|
}, "set"));
|
|
1147
|
-
d(this,
|
|
1148
|
+
d(this, Ht, /* @__PURE__ */ h(() => ({
|
|
1148
1149
|
rowState: O.ROW_STATE.EMPTY,
|
|
1149
1150
|
deleted: !1,
|
|
1150
1151
|
filtered: !1,
|
|
1151
|
-
height: t(this,
|
|
1152
|
+
height: t(this, U).slice(),
|
|
1152
1153
|
o: {},
|
|
1153
1154
|
c: {},
|
|
1154
|
-
_: [0, 0, 0, 0, O.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this,
|
|
1155
|
+
_: [0, 0, 0, 0, O.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this, U).slice(), -1, {}, {}]
|
|
1155
1156
|
}), "#getDefaultMeta"));
|
|
1156
1157
|
A(this, "reset", /* @__PURE__ */ h(() => {
|
|
1157
|
-
|
|
1158
|
+
b(this, W, []), b(this, ft, []), t(this, rt).call(this);
|
|
1158
1159
|
}, "reset"));
|
|
1159
1160
|
A(this, "clear", /* @__PURE__ */ h(() => {
|
|
1160
1161
|
var r;
|
|
1161
|
-
t(this,
|
|
1162
|
+
t(this, k).rawRecords = [], b(this, W, []), b(this, ft, []), (r = t(this, k).viewRecords) != null && r.reset && t(this, k).viewRecords.reset();
|
|
1162
1163
|
}, "clear"));
|
|
1163
|
-
d(this,
|
|
1164
|
+
d(this, se, /* @__PURE__ */ h((r) => {
|
|
1164
1165
|
var i;
|
|
1165
1166
|
Array.isArray(r) || (r = [r]);
|
|
1166
1167
|
const e = typeof ((i = t(this, N).fields) == null ? void 0 : i.get) == "function" ? t(this, N).fields.get() : Object.keys(r[0] || {}), s = [];
|
|
@@ -1171,25 +1172,25 @@ const O = class O {
|
|
|
1171
1172
|
}), s.push(a);
|
|
1172
1173
|
}), s;
|
|
1173
1174
|
}, "#json2Array"));
|
|
1174
|
-
d(this,
|
|
1175
|
-
e.__ng = t(this,
|
|
1175
|
+
d(this, re, /* @__PURE__ */ h((r) => (Array.isArray(r) || (r = [r]), r.forEach((e) => {
|
|
1176
|
+
e.__ng = t(this, Ht).call(this), e.__ng.rowid = this.nextId, e.__ng.rowState = O.ROW_STATE.INSERT, e.__ng._[0] = e.__ng.rowid;
|
|
1176
1177
|
}), r), "#defaultInsert"));
|
|
1177
1178
|
A(this, "add", /* @__PURE__ */ h((r, e = !0) => {
|
|
1178
1179
|
r === void 0 && (r = {});
|
|
1179
|
-
const s = t(this,
|
|
1180
|
-
t(this,
|
|
1180
|
+
const s = t(this, se).call(this, r);
|
|
1181
|
+
t(this, k).rawRecords = t(this, k).rawRecords.concat(t(this, re).call(this, s)), this.resetRecords();
|
|
1181
1182
|
const i = this.count() - 1;
|
|
1182
1183
|
return e || s.forEach((n, a) => {
|
|
1183
|
-
const o = t(this,
|
|
1184
|
+
const o = t(this, k).rawRecords[i - a];
|
|
1184
1185
|
o && (o.__ng.rowState = O.ROW_STATE.EMPTY);
|
|
1185
1186
|
}), t(this, rt).call(this), i;
|
|
1186
1187
|
}, "add"));
|
|
1187
1188
|
A(this, "delete", /* @__PURE__ */ h((r) => {
|
|
1188
1189
|
let e = [];
|
|
1189
|
-
Array.isArray(r) ? e = r : typeof r > "u" ? e = [t(this,
|
|
1190
|
+
Array.isArray(r) ? e = r : typeof r > "u" ? e = [t(this, k).host.row.at] : e = [parseInt(r, 10)], e.sort((s, i) => i - s).forEach((s) => {
|
|
1190
1191
|
if (t(this, W)[s]) {
|
|
1191
1192
|
const i = t(this, W)[s].__ng.rowid;
|
|
1192
|
-
t(this, W)[s].__ng.rowState === O.ROW_STATE.INSERT ? t(this,
|
|
1193
|
+
t(this, W)[s].__ng.rowState === O.ROW_STATE.INSERT ? t(this, k).rawRecords = t(this, k).rawRecords.filter((n) => n.__ng.rowid !== i) : t(this, k).rawRecords.forEach((n) => {
|
|
1193
1194
|
n.__ng.rowid === i && (n.__ng.deleted = !0, n.__ng.rowState = O.ROW_STATE.DELETE);
|
|
1194
1195
|
});
|
|
1195
1196
|
}
|
|
@@ -1206,13 +1207,13 @@ const O = class O {
|
|
|
1206
1207
|
o !== s && a.__ng.rowState !== O.ROW_STATE.INSERT && (a.__ng.o.hasOwnProperty(e) || (a.__ng.o[e] = o), a.__ng.rowState = O.ROW_STATE.UPDATE), a.v[n] = s;
|
|
1207
1208
|
}, "setValue"));
|
|
1208
1209
|
A(this, "resetRecords", /* @__PURE__ */ h(() => {
|
|
1209
|
-
|
|
1210
|
+
b(this, ft, t(this, k).rawRecords.filter((r) => !r.__ng.deleted)), b(this, W, t(this, k).rawRecords.filter((r) => !r.__ng.deleted && !r.__ng.filtered)), t(this, k).rawRecords.forEach((r, e) => {
|
|
1210
1211
|
r.__ng.rowidx = e;
|
|
1211
1212
|
}), t(this, W).forEach((r, e) => {
|
|
1212
1213
|
r.__ng.i = e;
|
|
1213
1214
|
});
|
|
1214
1215
|
}, "resetRecords"));
|
|
1215
|
-
A(this, "getValidData", /* @__PURE__ */ h(() => (t(this, W).length === 0 && t(this,
|
|
1216
|
+
A(this, "getValidData", /* @__PURE__ */ h(() => (t(this, W).length === 0 && t(this, k).rawRecords.length > 0 && this.resetRecords(), t(this, W)), "getValidData"));
|
|
1216
1217
|
d(this, ut, /* @__PURE__ */ h((r) => {
|
|
1217
1218
|
var a;
|
|
1218
1219
|
if (!r) return r;
|
|
@@ -1225,16 +1226,16 @@ const O = class O {
|
|
|
1225
1226
|
return e ? n[0] : n;
|
|
1226
1227
|
}, "#conv"));
|
|
1227
1228
|
A(this, "count", /* @__PURE__ */ h(() => this.getValidData().length, "count"));
|
|
1228
|
-
|
|
1229
|
+
b(this, N, r), b(this, k, e), t(this, ee).call(this);
|
|
1229
1230
|
}
|
|
1230
1231
|
get source() {
|
|
1231
|
-
return t(this, ut).call(this, t(this,
|
|
1232
|
+
return t(this, ut).call(this, t(this, k).rawRecords);
|
|
1232
1233
|
}
|
|
1233
1234
|
set source(r) {
|
|
1234
1235
|
this.clear(), this.add(r, !1);
|
|
1235
1236
|
}
|
|
1236
1237
|
get nextId() {
|
|
1237
|
-
return ++
|
|
1238
|
+
return ++Xe(this, te)._;
|
|
1238
1239
|
}
|
|
1239
1240
|
get count() {
|
|
1240
1241
|
return t(this, W).length;
|
|
@@ -1246,7 +1247,7 @@ const O = class O {
|
|
|
1246
1247
|
return this.length;
|
|
1247
1248
|
}
|
|
1248
1249
|
};
|
|
1249
|
-
N = new WeakMap(),
|
|
1250
|
+
N = new WeakMap(), k = new WeakMap(), W = new WeakMap(), ft = new WeakMap(), te = new WeakMap(), U = new WeakMap(), ee = new WeakMap(), rt = new WeakMap(), Ht = new WeakMap(), se = new WeakMap(), re = new WeakMap(), ut = new WeakMap(), h(O, "ngData"), // 🎯 행 상태 정의 상수를 클래스 내부로 내재화
|
|
1250
1251
|
A(O, "ROW_STATE", {
|
|
1251
1252
|
EMPTY: "EMPTY",
|
|
1252
1253
|
NORMAL: "NORMAL",
|
|
@@ -1254,12 +1255,12 @@ A(O, "ROW_STATE", {
|
|
|
1254
1255
|
UPDATE: "UPDATE",
|
|
1255
1256
|
DELETE: "DELETE"
|
|
1256
1257
|
});
|
|
1257
|
-
let
|
|
1258
|
+
let ye = O;
|
|
1258
1259
|
var it;
|
|
1259
|
-
const
|
|
1260
|
+
const Be = class Be {
|
|
1260
1261
|
constructor(r) {
|
|
1261
1262
|
d(this, it);
|
|
1262
|
-
|
|
1263
|
+
b(this, it, r), this.row = new be(this), this.data = new ye(t(this, it), this), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.pageCnt = 25, this.viewRecords.reset = () => {
|
|
1263
1264
|
var e;
|
|
1264
1265
|
(e = t(this, it).view) != null && e.redraw && t(this, it).view.redraw();
|
|
1265
1266
|
}, this.setDataSource = (e) => {
|
|
@@ -1276,10 +1277,10 @@ const Oe = class Oe {
|
|
|
1276
1277
|
}, this.setDataSource([]);
|
|
1277
1278
|
}
|
|
1278
1279
|
};
|
|
1279
|
-
it = new WeakMap(), h(
|
|
1280
|
-
let
|
|
1281
|
-
var gt, L,
|
|
1282
|
-
const
|
|
1280
|
+
it = new WeakMap(), h(Be, "ngDataManager");
|
|
1281
|
+
let pe = Be;
|
|
1282
|
+
var gt, L, Mt, ie;
|
|
1283
|
+
const ze = class ze {
|
|
1283
1284
|
// 🎯 이제 { name: string, type: string } 객체들의 배열로 관리합니다.
|
|
1284
1285
|
constructor(r) {
|
|
1285
1286
|
d(this, gt);
|
|
@@ -1287,16 +1288,16 @@ const Be = class Be {
|
|
|
1287
1288
|
A(this, "add", /* @__PURE__ */ h((r, e = "string") => {
|
|
1288
1289
|
r.forEach((s) => {
|
|
1289
1290
|
t(this, L).some((i) => i.name === s) || t(this, L).push({ name: s, type: e });
|
|
1290
|
-
}), t(this,
|
|
1291
|
+
}), t(this, Mt).call(this);
|
|
1291
1292
|
}, "add"));
|
|
1292
|
-
d(this,
|
|
1293
|
+
d(this, Mt, /* @__PURE__ */ h(() => {
|
|
1293
1294
|
const r = /* @__PURE__ */ new Map();
|
|
1294
1295
|
t(this, L).forEach((e) => {
|
|
1295
1296
|
r.set(e.name, e.type);
|
|
1296
|
-
}),
|
|
1297
|
+
}), b(this, L, Array.from(r, ([e, s]) => ({ name: e, type: s }))), b(this, L, t(this, L).filter((e) => e.name !== "" && e.name !== "__ng")), t(this, L).sort((e, s) => e.name.length < s.name.length ? 1 : -1);
|
|
1297
1298
|
}, "#adjust"));
|
|
1298
|
-
d(this,
|
|
1299
|
-
|
|
1299
|
+
d(this, ie, /* @__PURE__ */ h(() => {
|
|
1300
|
+
b(this, L, []), H.log(t(this, gt).querySelectorAll("table"));
|
|
1300
1301
|
const r = Array.from(t(this, gt).querySelectorAll("table"));
|
|
1301
1302
|
if (!(!r || r.length === 0)) {
|
|
1302
1303
|
for (const e of r)
|
|
@@ -1324,10 +1325,10 @@ const Be = class Be {
|
|
|
1324
1325
|
});
|
|
1325
1326
|
});
|
|
1326
1327
|
});
|
|
1327
|
-
t(this,
|
|
1328
|
+
t(this, Mt).call(this);
|
|
1328
1329
|
}
|
|
1329
1330
|
}, "#init"));
|
|
1330
|
-
|
|
1331
|
+
b(this, gt, r), t(this, ie).call(this);
|
|
1331
1332
|
}
|
|
1332
1333
|
// 🎯 기존에 필드 이름만 쓰던 곳들과의 호환을 위해 이름 배열만 리턴하는 메서드 유지
|
|
1333
1334
|
get() {
|
|
@@ -1349,22 +1350,22 @@ const Be = class Be {
|
|
|
1349
1350
|
return t(this, L).some((e) => e.name === r);
|
|
1350
1351
|
}
|
|
1351
1352
|
};
|
|
1352
|
-
gt = new WeakMap(), L = new WeakMap(),
|
|
1353
|
-
let
|
|
1354
|
-
var nt,
|
|
1355
|
-
const
|
|
1353
|
+
gt = new WeakMap(), L = new WeakMap(), Mt = new WeakMap(), ie = new WeakMap(), h(ze, "ngFields");
|
|
1354
|
+
let me = ze;
|
|
1355
|
+
var nt, ne, oe;
|
|
1356
|
+
const De = class De extends HTMLElement {
|
|
1356
1357
|
constructor() {
|
|
1357
1358
|
super();
|
|
1358
1359
|
//#created = false;
|
|
1359
1360
|
d(this, nt);
|
|
1360
|
-
d(this,
|
|
1361
|
-
d(this,
|
|
1362
|
-
this.fields = new
|
|
1361
|
+
d(this, ne);
|
|
1362
|
+
d(this, oe, /* @__PURE__ */ h(() => {
|
|
1363
|
+
this.fields = new me(this), b(this, ne, new ge(this)), H.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
|
|
1363
1364
|
}, "#init"));
|
|
1364
|
-
this.attachShadow({ mode: "open" }),
|
|
1365
|
+
this.attachShadow({ mode: "open" }), b(this, nt, new pe(this));
|
|
1365
1366
|
}
|
|
1366
1367
|
connectedCallback() {
|
|
1367
|
-
t(this,
|
|
1368
|
+
t(this, oe).call(this);
|
|
1368
1369
|
}
|
|
1369
1370
|
disconnectedCallback() {
|
|
1370
1371
|
H.log("NineTable disconnected.");
|
|
@@ -1382,9 +1383,9 @@ const ze = class ze extends HTMLElement {
|
|
|
1382
1383
|
return t(this, nt);
|
|
1383
1384
|
}
|
|
1384
1385
|
};
|
|
1385
|
-
nt = new WeakMap(),
|
|
1386
|
-
let
|
|
1387
|
-
customElements.get("nine-table") || customElements.define("nine-table",
|
|
1386
|
+
nt = new WeakMap(), ne = new WeakMap(), oe = new WeakMap(), h(De, "NineTable");
|
|
1387
|
+
let xe = De;
|
|
1388
|
+
customElements.get("nine-table") || customElements.define("nine-table", xe);
|
|
1388
1389
|
const xt = class xt extends HTMLElement {
|
|
1389
1390
|
// 👈 커스텀 스타일용 캐시 추가
|
|
1390
1391
|
constructor() {
|
|
@@ -1397,18 +1398,18 @@ const xt = class xt extends HTMLElement {
|
|
|
1397
1398
|
}
|
|
1398
1399
|
};
|
|
1399
1400
|
h(xt, "BasicCellElement"), A(xt, "_styleCache", /* @__PURE__ */ new Map()), A(xt, "_customStyleCache", /* @__PURE__ */ new Map());
|
|
1400
|
-
let
|
|
1401
|
-
var C,
|
|
1402
|
-
const
|
|
1401
|
+
let ve = xt;
|
|
1402
|
+
var C, $t, p, Re, Te, ke, Ce, Le;
|
|
1403
|
+
const Pe = class Pe extends ve {
|
|
1403
1404
|
constructor() {
|
|
1404
1405
|
super();
|
|
1405
1406
|
d(this, C);
|
|
1406
|
-
d(this,
|
|
1407
|
+
d(this, $t);
|
|
1407
1408
|
d(this, p);
|
|
1408
1409
|
d(this, Re);
|
|
1409
|
-
d(this, qe);
|
|
1410
|
-
d(this, ke);
|
|
1411
1410
|
d(this, Te);
|
|
1411
|
+
d(this, ke);
|
|
1412
|
+
d(this, Ce);
|
|
1412
1413
|
A(this, "getDisplayText", /* @__PURE__ */ h((e) => {
|
|
1413
1414
|
if (t(this, p))
|
|
1414
1415
|
if (t(this, p).closest("tbody")) {
|
|
@@ -1429,14 +1430,14 @@ const De = class De extends xe {
|
|
|
1429
1430
|
} catch {
|
|
1430
1431
|
}
|
|
1431
1432
|
}, "getDisplayText"));
|
|
1432
|
-
d(this,
|
|
1433
|
+
d(this, Le, /* @__PURE__ */ h(() => {
|
|
1433
1434
|
if (!(!t(this, C) || !t(this, C).template || !t(this, p).closest("tbody.bindable"))) {
|
|
1434
1435
|
var e = ninegrid.j.querySelectorAll(t(this, p)).attr("suppress");
|
|
1435
1436
|
if (e && (e = parseInt(e)), e && !isNaN(e)) {
|
|
1436
1437
|
var s = t(this, p).closest("tr"), i = [];
|
|
1437
1438
|
$("th,td", s).each((x, M) => {
|
|
1438
|
-
var
|
|
1439
|
-
|
|
1439
|
+
var T = ninegrid.j.querySelectorAll(M).attr("suppress");
|
|
1440
|
+
T && M.dataset.row && (T = parseInt(T), !isNaN(T) && T <= e && i.push(T));
|
|
1440
1441
|
}), i.sort();
|
|
1441
1442
|
var n = !1;
|
|
1442
1443
|
if (parseInt(s.sectionRowIndex / t(this, C).template.length) > 0)
|
|
@@ -1444,8 +1445,8 @@ const De = class De extends xe {
|
|
|
1444
1445
|
if (a > e) break;
|
|
1445
1446
|
var o = parseInt(t(this, p).dataset.row), l = o - 1, c = t(this, p).closest("tr").data, f = t(this, C).data.get(l);
|
|
1446
1447
|
t(this, p).dataset.matrixRow;
|
|
1447
|
-
var u = t(this, C).body.querySelector(`tbody.bindable [suppress="${a}"][data-matrix-row="${t(this, p).dataset.matrixRow}"]`), g = u.dataset.expr ? this.getExprValue(u.dataset.expr, c, o) : c[u.dataset.bind],
|
|
1448
|
-
if (g !=
|
|
1448
|
+
var u = t(this, C).body.querySelector(`tbody.bindable [suppress="${a}"][data-matrix-row="${t(this, p).dataset.matrixRow}"]`), g = u.dataset.expr ? this.getExprValue(u.dataset.expr, c, o) : c[u.dataset.bind], y = u.dataset.expr ? this.getExprValue(u.dataset.expr, f, l) : f[u.dataset.bind];
|
|
1449
|
+
if (g != y) {
|
|
1449
1450
|
n = !0;
|
|
1450
1451
|
break;
|
|
1451
1452
|
}
|
|
@@ -1472,7 +1473,7 @@ const De = class De extends xe {
|
|
|
1472
1473
|
}, "getExprValue"));
|
|
1473
1474
|
}
|
|
1474
1475
|
connectedCallback() {
|
|
1475
|
-
super.connectedCallback(),
|
|
1476
|
+
super.connectedCallback(), b(this, C, this.getRootNode().host), b(this, p, this.closest("th,td")), b(this, $t, t(this, p).closest("tr"));
|
|
1476
1477
|
}
|
|
1477
1478
|
get value() {
|
|
1478
1479
|
var e = !t(this, C) || !t(this, C).dataManager || !t(this, p) || !t(this, p).dataset || !t(this, p).dataset.row || !t(this, p).dataset.bind ? "" : t(this, p).closest("tr").data[t(this, p).dataset.bind];
|
|
@@ -1491,12 +1492,12 @@ const De = class De extends xe {
|
|
|
1491
1492
|
}
|
|
1492
1493
|
refresh() {
|
|
1493
1494
|
const e = t(this, p).dataset.bind;
|
|
1494
|
-
return parseInt(t(this, p).dataset.row), t(this,
|
|
1495
|
+
return parseInt(t(this, p).dataset.row), t(this, $t).data[e];
|
|
1495
1496
|
}
|
|
1496
1497
|
};
|
|
1497
|
-
C = new WeakMap(),
|
|
1498
|
-
let
|
|
1499
|
-
const
|
|
1498
|
+
C = new WeakMap(), $t = new WeakMap(), p = new WeakMap(), Re = new WeakMap(), Te = new WeakMap(), ke = new WeakMap(), Ce = new WeakMap(), Le = new WeakMap(), h(Pe, "CellElement");
|
|
1499
|
+
let we = Pe;
|
|
1500
|
+
const je = class je extends we {
|
|
1500
1501
|
constructor() {
|
|
1501
1502
|
super();
|
|
1502
1503
|
}
|
|
@@ -1507,21 +1508,21 @@ const Pe = class Pe extends ve {
|
|
|
1507
1508
|
return super.refresh();
|
|
1508
1509
|
}
|
|
1509
1510
|
};
|
|
1510
|
-
h(
|
|
1511
|
-
let
|
|
1512
|
-
var
|
|
1513
|
-
const
|
|
1511
|
+
h(je, "EditableCellElement");
|
|
1512
|
+
let Se = je;
|
|
1513
|
+
var It, ot, bt, yt, ae, X, He;
|
|
1514
|
+
const Fe = class Fe extends Se {
|
|
1514
1515
|
constructor() {
|
|
1515
1516
|
super();
|
|
1516
|
-
d(this,
|
|
1517
|
+
d(this, It);
|
|
1517
1518
|
d(this, ot);
|
|
1518
1519
|
d(this, bt);
|
|
1519
1520
|
d(this, yt);
|
|
1520
|
-
d(this,
|
|
1521
|
-
d(this,
|
|
1521
|
+
d(this, ae);
|
|
1522
|
+
d(this, X);
|
|
1522
1523
|
A(this, "refresh", /* @__PURE__ */ h(() => {
|
|
1523
1524
|
const e = super.refresh();
|
|
1524
|
-
H.log("::", e), t(this,
|
|
1525
|
+
H.log("::", e), t(this, It).value = e;
|
|
1525
1526
|
}, "refresh"));
|
|
1526
1527
|
/**
|
|
1527
1528
|
dataRefresh = (v) => {
|
|
@@ -1553,22 +1554,22 @@ const je = class je extends we {
|
|
|
1553
1554
|
if (!v) this.reset();
|
|
1554
1555
|
};
|
|
1555
1556
|
*/
|
|
1556
|
-
d(this,
|
|
1557
|
+
d(this, He, /* @__PURE__ */ h((e) => {
|
|
1557
1558
|
if (!["Escape", "Enter", "Tab", "Home", "End", "ArrowLeft", "ArrowRight", "PageUp", "PageDown", "Backspace", "Delete"].includes(e.code)) {
|
|
1558
1559
|
if (t(this, ot) == "number") {
|
|
1559
1560
|
let n = [];
|
|
1560
|
-
if (t(this,
|
|
1561
|
+
if (t(this, X) && Number(t(this, X)) > 0 && n.push("."), t(this, yt) && Number(t(this, yt)) >= 0 && n.push("-"), !(e.keyCode >= 48 && e.keyCode <= 57 || e.keyCode >= 96 && e.keyCode <= 105) && !n.includes(e.key) && e.preventDefault(), t(this, X) && (e.keyCode >= 48 && e.keyCode <= 57 || e.keyCode >= 96 && e.keyCode <= 105) && e.target.selectionStart == e.target.selectionEnd) {
|
|
1561
1562
|
var s = e.target.value, i = s.indexOf(".");
|
|
1562
1563
|
if (i >= 0) {
|
|
1563
1564
|
var s = s.substr(i + 1, s.length);
|
|
1564
|
-
s.length >= Number(t(this,
|
|
1565
|
+
s.length >= Number(t(this, X)) && e.preventDefault();
|
|
1565
1566
|
}
|
|
1566
1567
|
}
|
|
1567
1568
|
}
|
|
1568
1569
|
t(this, bt) && ninegrid.getByteLength(e.target.value) >= Number(t(this, bt)) && e.target.selectionStart == e.target.selectionEnd && e.preventDefault();
|
|
1569
1570
|
}
|
|
1570
1571
|
}, "#onKeyDown"));
|
|
1571
|
-
if (this.applyBaseStyle(),
|
|
1572
|
+
if (this.applyBaseStyle(), b(this, ot, this.getAttribute("type") || "text"), b(this, bt, this.getAttribute("maxbyte")), b(this, yt, this.getAttribute("min")), b(this, ae, this.getAttribute("max")), b(this, X, this.getAttribute("scale")), !["text", "number"].includes(t(this, ot))) throw `invalid type : ${t(this, ot)}`;
|
|
1572
1573
|
}
|
|
1573
1574
|
connectedCallback() {
|
|
1574
1575
|
for (var e = [], s = 0; s < this.attributes.length; s++)
|
|
@@ -1578,11 +1579,11 @@ const je = class je extends we {
|
|
|
1578
1579
|
${e.join(" ")}
|
|
1579
1580
|
ondragstart="return false;"
|
|
1580
1581
|
>
|
|
1581
|
-
`, super.connectedCallback(),
|
|
1582
|
+
`, super.connectedCallback(), b(this, It, this.querySelector("input"));
|
|
1582
1583
|
}
|
|
1583
1584
|
};
|
|
1584
|
-
|
|
1585
|
-
let
|
|
1585
|
+
It = new WeakMap(), ot = new WeakMap(), bt = new WeakMap(), yt = new WeakMap(), ae = new WeakMap(), X = new WeakMap(), He = new WeakMap(), h(Fe, "CellInputText");
|
|
1586
|
+
let Ee = Fe;
|
|
1586
1587
|
customElements.get("cell-input-text");
|
|
1587
|
-
customElements.get("cell-input") || customElements.define("cell-input",
|
|
1588
|
+
customElements.get("cell-input") || customElements.define("cell-input", Ee);
|
|
1588
1589
|
//# sourceMappingURL=nine-table.js.map
|