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