@ninebone/table 0.0.493 → 0.0.495
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 +436 -435
- 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,17 +1,17 @@
|
|
|
1
1
|
var je = Object.defineProperty;
|
|
2
|
-
var Fe = (
|
|
3
|
-
throw TypeError(
|
|
2
|
+
var Fe = (R) => {
|
|
3
|
+
throw TypeError(R);
|
|
4
4
|
};
|
|
5
|
-
var Ue = (
|
|
6
|
-
var h = (
|
|
7
|
-
var A = (
|
|
8
|
-
var t = (
|
|
9
|
-
var Ye = (
|
|
5
|
+
var Ue = (R, i, e) => i in R ? je(R, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : R[i] = e;
|
|
6
|
+
var h = (R, i) => je(R, "name", { value: i, configurable: !0 });
|
|
7
|
+
var A = (R, i, e) => Ue(R, typeof i != "symbol" ? i + "" : i, e), Ve = (R, i, e) => i.has(R) || Fe("Cannot " + e);
|
|
8
|
+
var t = (R, i, e) => (Ve(R, i, "read from private field"), e ? e.call(R) : i.get(R)), d = (R, i, e) => i.has(R) ? Fe("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(R) : i.set(R, e), y = (R, i, e, s) => (Ve(R, i, "write to private field"), s ? s.call(R, e) : i.set(R, e), e);
|
|
9
|
+
var Ye = (R, i, e, s) => ({
|
|
10
10
|
set _(r) {
|
|
11
|
-
y(
|
|
11
|
+
y(R, i, r, e);
|
|
12
12
|
},
|
|
13
13
|
get _() {
|
|
14
|
-
return t(
|
|
14
|
+
return t(R, i, s);
|
|
15
15
|
}
|
|
16
16
|
});
|
|
17
17
|
import { trace as Xe } from "@ninebone/util";
|
|
@@ -23,7 +23,7 @@ const Le = class Le extends Xe.constructor {
|
|
|
23
23
|
h(Le, "Trace");
|
|
24
24
|
let oe = Le;
|
|
25
25
|
const P = new oe();
|
|
26
|
-
var B, j, w, X, K, Z,
|
|
26
|
+
var B, j, w, X, K, Z, It, G, _t;
|
|
27
27
|
const He = class He extends HTMLElement {
|
|
28
28
|
constructor() {
|
|
29
29
|
super();
|
|
@@ -33,7 +33,7 @@ const He = class He extends HTMLElement {
|
|
|
33
33
|
d(this, X);
|
|
34
34
|
d(this, K);
|
|
35
35
|
d(this, Z);
|
|
36
|
-
d(this,
|
|
36
|
+
d(this, It, /* @__PURE__ */ h(() => {
|
|
37
37
|
if (!t(this, B)) return;
|
|
38
38
|
const e = t(this, B).querySelector(".ng-container-body .ng-part-body");
|
|
39
39
|
e && (y(this, Z, new ResizeObserver(() => {
|
|
@@ -42,38 +42,38 @@ const He = class He extends HTMLElement {
|
|
|
42
42
|
}, "#observeResize"));
|
|
43
43
|
A(this, "refresh", /* @__PURE__ */ h(() => {
|
|
44
44
|
if (!t(this, B) || !t(this, w) || t(this, j)) return;
|
|
45
|
-
const e = t(this, w).container,
|
|
46
|
-
if (!
|
|
47
|
-
const r = t(this, w).track, n = t(this, w).thumb, o = t(this, B).querySelector(".ng-container-bottom"), a = e.clientWidth,
|
|
48
|
-
if (a !== 0 &&
|
|
45
|
+
const e = t(this, w).container, s = e.querySelector("table");
|
|
46
|
+
if (!s) return;
|
|
47
|
+
const r = t(this, w).track, n = t(this, w).thumb, o = t(this, B).querySelector(".ng-container-bottom"), a = e.clientWidth, l = s.scrollWidth;
|
|
48
|
+
if (a !== 0 && l > 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
|
|
55
|
-
if (
|
|
56
|
-
const f = Math.max(Math.min(
|
|
54
|
+
const c = r.clientWidth;
|
|
55
|
+
if (c <= 0) return;
|
|
56
|
+
const f = Math.max(Math.min(c * (a / l), c), 20);
|
|
57
57
|
n.style.width = `${f}px`;
|
|
58
|
-
const u = e.scrollLeft,
|
|
59
|
-
let
|
|
60
|
-
|
|
61
|
-
const m =
|
|
62
|
-
|
|
58
|
+
const u = e.scrollLeft, g = l - a;
|
|
59
|
+
let b = 0;
|
|
60
|
+
g > 0 && (b = parseInt(u / g * (c - f), 10)), b < 0 && (b = 0);
|
|
61
|
+
const m = c - f;
|
|
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
64
|
d(this, G, /* @__PURE__ */ h((e) => {
|
|
65
65
|
if (!t(this, w)) return !1;
|
|
66
|
-
const
|
|
66
|
+
const s = t(this, w).container, r = s.querySelector("table");
|
|
67
67
|
if (!r) 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
|
-
const
|
|
72
|
-
a >
|
|
73
|
-
const
|
|
74
|
-
return
|
|
71
|
+
const l = n.width - o;
|
|
72
|
+
a > l && (a = l), 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 >= l - 1;
|
|
73
|
+
const c = s.clientWidth, u = r.scrollWidth - c;
|
|
74
|
+
return l > 0 && u > 0 && (s.scrollLeft = a / l * u), a > 0 && a < l - 1;
|
|
75
75
|
}, "#thumbMoveTo"));
|
|
76
|
-
d(this,
|
|
76
|
+
d(this, _t, /* @__PURE__ */ h(() => {
|
|
77
77
|
const e = /* @__PURE__ */ h((r) => {
|
|
78
78
|
clearInterval(t(this, X)), clearInterval(t(this, K));
|
|
79
79
|
const n = parseInt(t(this, w).thumb.style.left || 0, 10);
|
|
@@ -83,11 +83,11 @@ const He = class He extends HTMLElement {
|
|
|
83
83
|
t(this, G).call(this, o + r) || clearInterval(t(this, K));
|
|
84
84
|
}, 50));
|
|
85
85
|
}, 500));
|
|
86
|
-
}, "delayScroll"),
|
|
86
|
+
}, "delayScroll"), s = /* @__PURE__ */ h(() => {
|
|
87
87
|
clearInterval(t(this, X)), clearInterval(t(this, K));
|
|
88
88
|
}, "clearTimer");
|
|
89
89
|
["mouseup", "mouseleave", "touchend"].forEach((r) => {
|
|
90
|
-
t(this, w).left.addEventListener(r,
|
|
90
|
+
t(this, w).left.addEventListener(r, s), t(this, w).right.addEventListener(r, s), t(this, w).track.addEventListener(r, s);
|
|
91
91
|
}), t(this, w).left.addEventListener("mousedown", (r) => {
|
|
92
92
|
r.button === 0 && e(-20);
|
|
93
93
|
}), t(this, w).right.addEventListener("mousedown", (r) => {
|
|
@@ -102,10 +102,10 @@ const He = class He extends HTMLElement {
|
|
|
102
102
|
r.stopPropagation(), r.preventDefault(), y(this, j, !0), this.shiftX = r.clientX - t(this, w).thumb.getBoundingClientRect().left;
|
|
103
103
|
const n = /* @__PURE__ */ h((a) => {
|
|
104
104
|
if (!t(this, j)) return;
|
|
105
|
-
const
|
|
106
|
-
t(this, G).call(this, a.clientX -
|
|
105
|
+
const l = t(this, w).track.getBoundingClientRect();
|
|
106
|
+
t(this, G).call(this, a.clientX - l.left - this.shiftX);
|
|
107
107
|
}, "onMouseMove"), o = /* @__PURE__ */ h(() => {
|
|
108
|
-
y(this, j, !1),
|
|
108
|
+
y(this, j, !1), s(), document.removeEventListener("mousemove", n), document.removeEventListener("mouseup", o), this.refresh();
|
|
109
109
|
}, "onMouseUp");
|
|
110
110
|
document.addEventListener("mousemove", n), document.addEventListener("mouseup", o);
|
|
111
111
|
});
|
|
@@ -177,20 +177,20 @@ const He = class He extends HTMLElement {
|
|
|
177
177
|
<button class='ng-scroll-right' disabled><div class='ng-scroll-icon'></div></button>
|
|
178
178
|
`;
|
|
179
179
|
const e = /* @__PURE__ */ h(() => {
|
|
180
|
-
const
|
|
181
|
-
if (!
|
|
180
|
+
const s = t(this, B).querySelector(".ng-container-body .ng-part-body");
|
|
181
|
+
if (!s) {
|
|
182
182
|
setTimeout(e, 10);
|
|
183
183
|
return;
|
|
184
184
|
}
|
|
185
185
|
y(this, w, {
|
|
186
|
-
container:
|
|
186
|
+
container: s,
|
|
187
187
|
track: this.querySelector(".ng-scroll-track"),
|
|
188
188
|
thumb: this.querySelector(".ng-scroll-thumb"),
|
|
189
189
|
left: this.querySelector(".ng-scroll-left"),
|
|
190
190
|
right: this.querySelector(".ng-scroll-right")
|
|
191
|
-
}),
|
|
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
|
}
|
|
@@ -198,54 +198,54 @@ const He = class He extends HTMLElement {
|
|
|
198
198
|
t(this, Z) && t(this, Z).disconnect();
|
|
199
199
|
}
|
|
200
200
|
};
|
|
201
|
-
B = new WeakMap(), j = new WeakMap(), w = new WeakMap(), X = new WeakMap(), K = new WeakMap(), Z = new WeakMap(),
|
|
201
|
+
B = 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(He, "NineTableHScrollBar");
|
|
202
202
|
let ae = He;
|
|
203
203
|
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", ae);
|
|
204
|
-
var F, ot, J,
|
|
204
|
+
var F, ot, J, q, xt, vt, Nt;
|
|
205
205
|
const Me = class Me extends HTMLElement {
|
|
206
206
|
constructor() {
|
|
207
207
|
super();
|
|
208
208
|
d(this, F);
|
|
209
209
|
d(this, ot);
|
|
210
210
|
d(this, J, !1);
|
|
211
|
-
d(this,
|
|
211
|
+
d(this, q);
|
|
212
|
+
d(this, xt, 0);
|
|
212
213
|
d(this, vt, 0);
|
|
213
|
-
d(this, wt, 0);
|
|
214
214
|
A(this, "refresh", /* @__PURE__ */ h(() => {
|
|
215
|
-
if (!t(this, F) || !t(this,
|
|
216
|
-
const e = t(this,
|
|
217
|
-
if (
|
|
218
|
-
r.style.display = "none", t(this,
|
|
215
|
+
if (!t(this, F) || !t(this, q)) return;
|
|
216
|
+
const e = t(this, q).container, s = t(this, q).track, r = t(this, q).thumb, n = e.clientHeight, a = (t(this, F).data.get() || []).length, l = t(this, ot).getRowHeight(), c = a * l;
|
|
217
|
+
if (c <= n) {
|
|
218
|
+
r.style.display = "none", t(this, q).top.disabled = !0, t(this, q).bottom.disabled = !0;
|
|
219
219
|
return;
|
|
220
220
|
} else
|
|
221
221
|
r.style.display = "block";
|
|
222
|
-
const f =
|
|
222
|
+
const f = s.clientHeight;
|
|
223
223
|
if (f <= 0) return;
|
|
224
|
-
const u = Math.max(Math.min(f * (n /
|
|
224
|
+
const u = Math.max(Math.min(f * (n / c), f), 20);
|
|
225
225
|
r.style.height = `${u}px`;
|
|
226
|
-
const
|
|
226
|
+
const g = e.scrollTop, b = Math.max(c - 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), r.style.top = `${m}px`, t(this,
|
|
230
|
+
m < 0 && (m = 0), m > v && (m = v), r.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
|
-
const e = t(this,
|
|
232
|
+
d(this, Nt, /* @__PURE__ */ h(() => {
|
|
233
|
+
const e = t(this, q).container, s = /* @__PURE__ */ h(() => {
|
|
234
234
|
const n = (t(this, F).data.get() || []).length, o = t(this, ot).getRowHeight();
|
|
235
235
|
return n * o;
|
|
236
236
|
}, "getContentHeight");
|
|
237
237
|
e.addEventListener("scroll", () => {
|
|
238
238
|
t(this, J) || this.refresh();
|
|
239
|
-
}), t(this,
|
|
239
|
+
}), t(this, q).thumb.addEventListener("mousedown", (r) => {
|
|
240
240
|
if (r.button !== 0) return;
|
|
241
|
-
r.stopPropagation(), r.preventDefault(), y(this, J, !0), y(this,
|
|
241
|
+
r.stopPropagation(), r.preventDefault(), y(this, J, !0), y(this, xt, r.clientY), y(this, vt, e.scrollTop);
|
|
242
242
|
const n = /* @__PURE__ */ h((a) => {
|
|
243
243
|
if (!t(this, J)) return;
|
|
244
|
-
const
|
|
244
|
+
const l = t(this, q).track.getBoundingClientRect(), c = t(this, q).thumb.clientHeight, u = l.height - c, g = a.clientY - t(this, xt), b = e.clientHeight, m = s(), v = Math.max(m - b, 1);
|
|
245
245
|
if (u > 0 && v > 0) {
|
|
246
|
-
const E =
|
|
247
|
-
let x = t(this,
|
|
248
|
-
const H = Math.max(0, m -
|
|
246
|
+
const E = g / u * v;
|
|
247
|
+
let x = t(this, vt) + E;
|
|
248
|
+
const H = Math.max(0, m - b);
|
|
249
249
|
x < 0 && (x = 0), x > H && (x = H), e.scrollTop = x;
|
|
250
250
|
}
|
|
251
251
|
this.refresh();
|
|
@@ -253,17 +253,17 @@ const Me = class Me extends HTMLElement {
|
|
|
253
253
|
y(this, J, !1), document.removeEventListener("mousemove", n), document.removeEventListener("mouseup", o), this.refresh();
|
|
254
254
|
}, "onMouseUp");
|
|
255
255
|
document.addEventListener("mousemove", n), document.addEventListener("mouseup", o);
|
|
256
|
-
}), t(this,
|
|
257
|
-
if (r.button !== 0 || r.target === t(this,
|
|
258
|
-
const n = t(this,
|
|
259
|
-
if (
|
|
260
|
-
const
|
|
261
|
-
e.scrollTop =
|
|
256
|
+
}), t(this, q).track.addEventListener("mousedown", (r) => {
|
|
257
|
+
if (r.button !== 0 || r.target === t(this, q).thumb) return;
|
|
258
|
+
const n = t(this, q).track.getBoundingClientRect(), o = t(this, q).thumb.clientHeight, a = r.clientY - n.top - o / 2, c = n.height - o, f = e.clientHeight, u = s(), g = Math.max(u - f, 1);
|
|
259
|
+
if (c > 0 && g > 0) {
|
|
260
|
+
const b = Math.max(0, Math.min(1, a / c));
|
|
261
|
+
e.scrollTop = b * g;
|
|
262
262
|
}
|
|
263
263
|
this.refresh();
|
|
264
|
-
}), t(this,
|
|
264
|
+
}), t(this, q).top.addEventListener("click", () => {
|
|
265
265
|
e.scrollTop -= 40;
|
|
266
|
-
}), t(this,
|
|
266
|
+
}), t(this, q).bottom.addEventListener("click", () => {
|
|
267
267
|
e.scrollTop += 40;
|
|
268
268
|
});
|
|
269
269
|
}, "#init"));
|
|
@@ -334,107 +334,108 @@ const Me = class Me extends HTMLElement {
|
|
|
334
334
|
<button class='ng-scroll-bottom' disabled><div class='ng-scroll-icon'></div></button>
|
|
335
335
|
`;
|
|
336
336
|
const e = /* @__PURE__ */ h(() => {
|
|
337
|
-
const
|
|
338
|
-
if (!
|
|
337
|
+
const s = t(this, F).shadowRoot.querySelector(".ng-container-body .ng-part-body");
|
|
338
|
+
if (!s) {
|
|
339
339
|
setTimeout(e, 10);
|
|
340
340
|
return;
|
|
341
341
|
}
|
|
342
|
-
y(this,
|
|
343
|
-
container:
|
|
342
|
+
y(this, q, {
|
|
343
|
+
container: s,
|
|
344
344
|
track: this.querySelector(".ng-scroll-track"),
|
|
345
345
|
thumb: this.querySelector(".ng-scroll-thumb"),
|
|
346
346
|
top: this.querySelector(".ng-scroll-top"),
|
|
347
347
|
bottom: this.querySelector(".ng-scroll-bottom")
|
|
348
|
-
}), t(this,
|
|
348
|
+
}), t(this, Nt).call(this), this.refresh();
|
|
349
349
|
}, "initWhenReady");
|
|
350
350
|
e();
|
|
351
351
|
}
|
|
352
352
|
};
|
|
353
|
-
F = new WeakMap(), ot = new WeakMap(), J = new WeakMap(),
|
|
353
|
+
F = new WeakMap(), ot = new WeakMap(), J = new WeakMap(), q = new WeakMap(), xt = new WeakMap(), vt = new WeakMap(), Nt = new WeakMap(), h(Me, "NineTableVScrollBar");
|
|
354
354
|
let le = Me;
|
|
355
355
|
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar", le);
|
|
356
|
-
var D, S, z, M, V, Q,
|
|
356
|
+
var D, S, z, M, V, Q, wt, Se, at, Wt, Ot, Bt, St, Et, zt, Dt, At, Ee, lt, Rt, Pt;
|
|
357
357
|
const $e = class $e {
|
|
358
|
-
constructor(
|
|
358
|
+
constructor(i) {
|
|
359
359
|
d(this, D);
|
|
360
360
|
d(this, S);
|
|
361
361
|
d(this, z, /* @__PURE__ */ new Map());
|
|
362
362
|
d(this, M, null);
|
|
363
363
|
d(this, V, null);
|
|
364
364
|
d(this, Q, 0);
|
|
365
|
-
d(this,
|
|
365
|
+
d(this, wt, 40);
|
|
366
366
|
d(this, Se, !1);
|
|
367
367
|
d(this, at, !1);
|
|
368
|
-
d(this,
|
|
368
|
+
d(this, Wt, 3);
|
|
369
369
|
A(this, "refresh", /* @__PURE__ */ h(() => {
|
|
370
370
|
P.log("rowManager.refresh");
|
|
371
|
-
const
|
|
372
|
-
|
|
371
|
+
const i = t(this, S).querySelector(".ng-container-body .ng-part-body");
|
|
372
|
+
i && (t(this, St).call(this), t(this, lt).call(this, i.scrollTop));
|
|
373
373
|
}, "refresh"));
|
|
374
374
|
A(this, "initialize", /* @__PURE__ */ h(() => {
|
|
375
375
|
y(this, M, null), t(this, z).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((o) => {
|
|
376
376
|
const a = t(this, S).querySelector(o);
|
|
377
377
|
if (!a) return;
|
|
378
|
-
const
|
|
379
|
-
if (!c) return;
|
|
380
|
-
const l = c.querySelector("tbody.bindable-tbody");
|
|
378
|
+
const l = a.querySelector(".ng-part-body table");
|
|
381
379
|
if (!l) return;
|
|
382
|
-
const
|
|
380
|
+
const c = l.querySelector("tbody.bindable-tbody");
|
|
381
|
+
if (!c) return;
|
|
382
|
+
const u = Array.from(c.querySelectorAll("tr")).map((g) => g.cloneNode(!0));
|
|
383
383
|
t(this, z).set(o, u);
|
|
384
384
|
});
|
|
385
|
-
const
|
|
386
|
-
if (
|
|
387
|
-
t(this,
|
|
385
|
+
const i = 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"), r = t(this, S).querySelector(".ng-container-body .ng-part-header"), n = t(this, S).querySelector(".ng-container-body .ng-part-footer");
|
|
386
|
+
if (i) {
|
|
387
|
+
t(this, Bt).call(this, i), t(this, At).call(this), t(this, St).call(this), t(this, lt).call(this, i.scrollTop);
|
|
388
388
|
let o = !1;
|
|
389
|
-
const a = /* @__PURE__ */ h((
|
|
389
|
+
const a = /* @__PURE__ */ h((l, c, f) => {
|
|
390
390
|
var u;
|
|
391
|
-
o || (o = !0,
|
|
391
|
+
o || (o = !0, i && i.scrollTop !== l && (i.scrollTop = l), e && e.scrollTop !== l && (e.scrollTop = l), s && s.scrollTop !== l && (s.scrollTop = l), r && r.scrollLeft !== c && (r.scrollLeft = c), n && n.scrollLeft !== c && (n.scrollLeft = c), t(this, lt).call(this, l), (u = t(this, S).querySelector("nine-table-vscrollbar")) == null || u.refresh(), o = !1);
|
|
392
392
|
}, "syncScroll");
|
|
393
|
-
[
|
|
394
|
-
|
|
393
|
+
[i, e, s].forEach((l) => {
|
|
394
|
+
l && l.addEventListener("scroll", () => {
|
|
395
395
|
t(this, at) || (y(this, at, !0), requestAnimationFrame(() => {
|
|
396
|
-
a(
|
|
396
|
+
a(l.scrollTop, l.scrollLeft), y(this, at, !1);
|
|
397
397
|
}));
|
|
398
398
|
});
|
|
399
399
|
});
|
|
400
400
|
}
|
|
401
401
|
}, "initialize"));
|
|
402
|
-
d(this,
|
|
403
|
-
const
|
|
404
|
-
if (!
|
|
405
|
-
const r =
|
|
402
|
+
d(this, Ot, /* @__PURE__ */ h((i, e) => {
|
|
403
|
+
const s = t(this, z).get(e);
|
|
404
|
+
if (!s || s.length === 0) return;
|
|
405
|
+
const r = i.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
406
406
|
if (!r) return;
|
|
407
|
-
r.querySelectorAll("tr:not(.nodata)").forEach((
|
|
408
|
-
const n = r.querySelector("tr.nodata"), o = document.createDocumentFragment();
|
|
409
|
-
for (let
|
|
410
|
-
|
|
411
|
-
|
|
407
|
+
r.querySelectorAll("tr:not(.nodata)").forEach((l) => l.remove());
|
|
408
|
+
const n = r.querySelector("tr.nodata"), o = document.createDocumentFragment(), a = s.length;
|
|
409
|
+
for (let l = 0; l < t(this, wt); l++)
|
|
410
|
+
s.forEach((c, f) => {
|
|
411
|
+
const u = c.cloneNode(!0), g = l * a + f;
|
|
412
|
+
u.dataset.row = g, o.appendChild(u);
|
|
412
413
|
});
|
|
413
414
|
n ? n.before(o) : r.appendChild(o);
|
|
414
415
|
}, "#renderRows"));
|
|
415
|
-
d(this,
|
|
416
|
+
d(this, Bt, /* @__PURE__ */ h((i) => {
|
|
416
417
|
if (t(this, M) !== null && t(this, M) > 0)
|
|
417
418
|
return t(this, M);
|
|
418
419
|
P.log("#measureAndCacheHeight");
|
|
419
420
|
const e = t(this, z).get(".ng-container-body");
|
|
420
421
|
if (!e || e.length === 0) return 24;
|
|
421
|
-
const
|
|
422
|
-
if (!
|
|
423
|
-
|
|
424
|
-
const r =
|
|
425
|
-
e.forEach((
|
|
426
|
-
n.appendChild(
|
|
427
|
-
}), r ? r.before(n) :
|
|
428
|
-
const o = t(this, S), a = o.style.display,
|
|
422
|
+
const s = i.querySelector("tbody.bindable-tbody");
|
|
423
|
+
if (!s) return 24;
|
|
424
|
+
s.querySelectorAll("tr:not(.nodata)").forEach((g) => g.remove());
|
|
425
|
+
const r = s.querySelector("tr.nodata"), n = document.createDocumentFragment();
|
|
426
|
+
e.forEach((g) => {
|
|
427
|
+
n.appendChild(g.cloneNode(!0));
|
|
428
|
+
}), r ? r.before(n) : s.appendChild(n);
|
|
429
|
+
const o = t(this, S), a = o.style.display, l = o.style.visibility, c = o.style.position;
|
|
429
430
|
(a === "none" || window.getComputedStyle(o).display === "none") && (o.style.display = "block", o.style.visibility = "hidden", o.style.position = "absolute");
|
|
430
431
|
let f = 0;
|
|
431
|
-
const u =
|
|
432
|
-
return u.forEach((
|
|
433
|
-
f +=
|
|
434
|
-
}), u.forEach((
|
|
432
|
+
const u = s.querySelectorAll("tr:not(.nodata)");
|
|
433
|
+
return u.forEach((g) => {
|
|
434
|
+
f += g.offsetHeight || g.getBoundingClientRect().height;
|
|
435
|
+
}), u.forEach((g) => g.remove()), o.style.display = a, o.style.visibility = l, o.style.position = c, y(this, M, f > 0 ? f : 24), t(this, Et).call(this), t(this, M);
|
|
435
436
|
}, "#measureAndCacheHeight"));
|
|
436
|
-
d(this,
|
|
437
|
-
const e = (t(this, D).data.get() || []).length,
|
|
437
|
+
d(this, St, /* @__PURE__ */ h(() => {
|
|
438
|
+
const e = (t(this, D).data.get() || []).length, s = t(this, M), r = e * s;
|
|
438
439
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((n) => {
|
|
439
440
|
const o = t(this, S).querySelector(n);
|
|
440
441
|
if (!o) return;
|
|
@@ -442,94 +443,94 @@ const $e = class $e {
|
|
|
442
443
|
a && (a.style.height = `${r}px`);
|
|
443
444
|
});
|
|
444
445
|
}, "#updateVirtualScrollHeight"));
|
|
445
|
-
d(this,
|
|
446
|
+
d(this, Et, /* @__PURE__ */ h(() => {
|
|
446
447
|
if (t(this, Q) > 0 && t(this, M) > 0) {
|
|
447
|
-
const
|
|
448
|
-
y(this,
|
|
448
|
+
const i = Math.ceil(t(this, Q) / t(this, M));
|
|
449
|
+
y(this, wt, i + t(this, Wt));
|
|
449
450
|
}
|
|
450
451
|
}, "#updateRowCount"));
|
|
451
452
|
d(this, zt, /* @__PURE__ */ h(() => {
|
|
452
|
-
var a,
|
|
453
|
-
const
|
|
453
|
+
var a, l, c, f, u, g;
|
|
454
|
+
const i = 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");
|
|
454
455
|
if (e) {
|
|
455
|
-
const
|
|
456
|
+
const b = i ? Array.from(i.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);
|
|
456
457
|
for (let x = 0; x < E; x++) {
|
|
457
458
|
const H = [
|
|
458
|
-
((a =
|
|
459
|
-
((
|
|
460
|
-
((
|
|
459
|
+
((a = b[x]) == null ? void 0 : a.getBoundingClientRect().height) || 0,
|
|
460
|
+
((l = m[x]) == null ? void 0 : l.getBoundingClientRect().height) || 0,
|
|
461
|
+
((c = v[x]) == null ? void 0 : c.getBoundingClientRect().height) || 0
|
|
461
462
|
], k = Math.max(...H);
|
|
462
|
-
k > 0 && (
|
|
463
|
+
k > 0 && (b[x] && (b[x].style.height = `${k}px`), m[x] && (m[x].style.height = `${k}px`), v[x] && (v[x].style.height = `${k}px`));
|
|
463
464
|
}
|
|
464
465
|
}
|
|
465
466
|
const r = 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");
|
|
466
467
|
if (n) {
|
|
467
|
-
const
|
|
468
|
+
const b = r ? Array.from(r.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);
|
|
468
469
|
for (let x = 0; x < E; x++) {
|
|
469
470
|
const H = [
|
|
470
|
-
((f =
|
|
471
|
+
((f = b[x]) == null ? void 0 : f.getBoundingClientRect().height) || 0,
|
|
471
472
|
((u = m[x]) == null ? void 0 : u.getBoundingClientRect().height) || 0,
|
|
472
|
-
((
|
|
473
|
+
((g = v[x]) == null ? void 0 : g.getBoundingClientRect().height) || 0
|
|
473
474
|
], k = Math.max(...H);
|
|
474
|
-
k > 0 && (
|
|
475
|
+
k > 0 && (b[x] && (b[x].style.height = `${k}px`), m[x] && (m[x].style.height = `${k}px`), v[x] && (v[x].style.height = `${k}px`));
|
|
475
476
|
}
|
|
476
477
|
}
|
|
477
478
|
}, "#syncRowHeights"));
|
|
478
479
|
d(this, Dt, /* @__PURE__ */ h(() => {
|
|
479
|
-
!t(this, S) || !(t(this, S) instanceof HTMLElement) || (y(this, V, new ResizeObserver((
|
|
480
|
-
for (const e of
|
|
481
|
-
const
|
|
482
|
-
if (!
|
|
480
|
+
!t(this, S) || !(t(this, S) instanceof HTMLElement) || (y(this, V, new ResizeObserver((i) => {
|
|
481
|
+
for (const e of i) {
|
|
482
|
+
const s = e.target;
|
|
483
|
+
if (!s.classList.contains("active")) continue;
|
|
483
484
|
const r = e.contentRect.height;
|
|
484
485
|
if (r > 0) {
|
|
485
486
|
let n = 0;
|
|
486
|
-
const o =
|
|
487
|
+
const o = s.querySelector(".ng-part-header"), a = s.querySelector(".ng-part-footer");
|
|
487
488
|
o && (n += o.offsetHeight), a && (n += a.offsetHeight);
|
|
488
|
-
const
|
|
489
|
-
t(this, Q) !==
|
|
489
|
+
const l = Math.max(r - n, 100);
|
|
490
|
+
t(this, Q) !== l && (y(this, Q, l), t(this, Et).call(this), t(this, M) !== null && t(this, At).call(this));
|
|
490
491
|
}
|
|
491
492
|
}
|
|
492
493
|
})), t(this, V).observe(t(this, S)));
|
|
493
494
|
}, "#initResizeObserver"));
|
|
494
|
-
d(this,
|
|
495
|
-
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((
|
|
496
|
-
const e = t(this, S).querySelector(
|
|
497
|
-
e && e.querySelector(".ng-part-body tbody.bindable-tbody") && t(this,
|
|
495
|
+
d(this, At, /* @__PURE__ */ h(() => {
|
|
496
|
+
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((i) => {
|
|
497
|
+
const e = t(this, S).querySelector(i);
|
|
498
|
+
e && e.querySelector(".ng-part-body tbody.bindable-tbody") && t(this, Ot).call(this, e, i);
|
|
498
499
|
}), t(this, Pt).call(this), t(this, zt).call(this);
|
|
499
500
|
}, "#renderAllContainers"));
|
|
500
|
-
d(this, Ee, /* @__PURE__ */ h((
|
|
501
|
+
d(this, Ee, /* @__PURE__ */ h((i) => {
|
|
501
502
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((e) => {
|
|
502
|
-
var
|
|
503
|
-
const
|
|
504
|
-
if (!
|
|
505
|
-
const r =
|
|
503
|
+
var c;
|
|
504
|
+
const s = t(this, S).querySelector(e);
|
|
505
|
+
if (!s) return;
|
|
506
|
+
const r = s.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
506
507
|
if (!r) return;
|
|
507
|
-
const n = Array.from(r.querySelectorAll("tr:not(.nodata)")), o = ((
|
|
508
|
+
const n = Array.from(r.querySelectorAll("tr:not(.nodata)")), o = ((c = t(this, z).get(e)) == null ? void 0 : c.length) || 1, l = (t(this, D).data.get() || []).length;
|
|
508
509
|
n.forEach((f, u) => {
|
|
509
|
-
const
|
|
510
|
-
if (
|
|
510
|
+
const g = i + Math.floor(u / o);
|
|
511
|
+
if (g >= l) {
|
|
511
512
|
f.style.display = "none";
|
|
512
513
|
return;
|
|
513
514
|
}
|
|
514
|
-
const
|
|
515
|
-
f.style.display = "", t(this, Rt).call(this, f,
|
|
515
|
+
const b = t(this, D).data.get(g);
|
|
516
|
+
f.style.display = "", t(this, Rt).call(this, f, b, g);
|
|
516
517
|
});
|
|
517
518
|
});
|
|
518
519
|
}, "#adjustBufferRows"));
|
|
519
|
-
d(this,
|
|
520
|
+
d(this, lt, /* @__PURE__ */ h((i) => {
|
|
520
521
|
var u;
|
|
521
522
|
const e = t(this, M);
|
|
522
523
|
if (!e || e <= 0) return;
|
|
523
|
-
const r = (t(this, D).data.get() || []).length, n = Math.max(0, Math.floor(
|
|
524
|
-
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((
|
|
525
|
-
const
|
|
526
|
-
if (!
|
|
527
|
-
const m =
|
|
524
|
+
const r = (t(this, D).data.get() || []).length, n = Math.max(0, Math.floor(i / e)), o = n * e, a = ((u = t(this, z).get(".ng-container-body")) == null ? void 0 : u.length) || 1, l = t(this, S).querySelector(".ng-container-body"), c = l == null ? void 0 : l.querySelector(".ng-part-body tbody.bindable-tbody tr:not(.nodata)"), f = c && c.dataset.row !== void 0 ? parseInt(c.dataset.row, 10) : -1;
|
|
525
|
+
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((g) => {
|
|
526
|
+
const b = t(this, S).querySelector(g);
|
|
527
|
+
if (!b) return;
|
|
528
|
+
const m = b.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
528
529
|
m && (m.style.transform = `translateY(${o}px)`);
|
|
529
|
-
}), P.log("#handleScroll", f, n), f !== n && [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((
|
|
530
|
-
const
|
|
531
|
-
if (!
|
|
532
|
-
const m =
|
|
530
|
+
}), P.log("#handleScroll", f, n), f !== n && [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((g) => {
|
|
531
|
+
const b = t(this, S).querySelector(g);
|
|
532
|
+
if (!b) return;
|
|
533
|
+
const m = b.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
533
534
|
if (!m) return;
|
|
534
535
|
Array.from(m.querySelectorAll("tr:not(.nodata)")).forEach((E, x) => {
|
|
535
536
|
const H = n + Math.floor(x / a);
|
|
@@ -556,114 +557,114 @@ const $e = class $e {
|
|
|
556
557
|
cell.dataset.row = dataIndex;
|
|
557
558
|
});
|
|
558
559
|
}; */
|
|
559
|
-
d(this, Rt, /* @__PURE__ */ h((
|
|
560
|
-
|
|
561
|
-
r.dataset.row =
|
|
560
|
+
d(this, Rt, /* @__PURE__ */ h((i, e, s) => {
|
|
561
|
+
i.dataset.row = s, i.data = e, Array.from(i.cells).forEach((r, n) => {
|
|
562
|
+
r.dataset.row = s;
|
|
562
563
|
const o = Array.from(r.children).find((a) => a.tagName.toLowerCase().startsWith("cell-") || typeof a.refresh == "function");
|
|
563
564
|
o && typeof o.refresh == "function" && o.refresh();
|
|
564
565
|
});
|
|
565
566
|
}, "#bindRowData"));
|
|
566
567
|
d(this, Pt, /* @__PURE__ */ h(() => {
|
|
567
|
-
var
|
|
568
|
-
const
|
|
568
|
+
var l, c, f;
|
|
569
|
+
const i = 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");
|
|
569
570
|
if (!e) return;
|
|
570
|
-
const r =
|
|
571
|
+
const r = i ? Array.from(i.querySelectorAll("tr")) : [], n = Array.from(e.querySelectorAll("tr")), o = s ? Array.from(s.querySelectorAll("tr")) : [], a = Math.max(r.length, n.length, o.length);
|
|
571
572
|
for (let u = 0; u < a; u++) {
|
|
572
|
-
const
|
|
573
|
-
((
|
|
574
|
-
((
|
|
573
|
+
const g = [
|
|
574
|
+
((l = r[u]) == null ? void 0 : l.getBoundingClientRect().height) || 0,
|
|
575
|
+
((c = n[u]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
|
|
575
576
|
((f = o[u]) == null ? void 0 : f.getBoundingClientRect().height) || 0
|
|
576
|
-
],
|
|
577
|
-
|
|
577
|
+
], b = Math.max(...g);
|
|
578
|
+
b > 0 && (r[u] && (r[u].style.height = `${b}px`), n[u] && (n[u].style.height = `${b}px`), o[u] && (o[u].style.height = `${b}px`));
|
|
578
579
|
}
|
|
579
580
|
}, "#syncHeaderHeights"));
|
|
580
581
|
A(this, "destroy", /* @__PURE__ */ h(() => {
|
|
581
582
|
t(this, V) && (t(this, V).disconnect(), y(this, V, null));
|
|
582
583
|
}, "destroy"));
|
|
583
|
-
y(this, D,
|
|
584
|
+
y(this, D, i.getRootNode().host), y(this, S, i), t(this, Dt).call(this);
|
|
584
585
|
}
|
|
585
586
|
getRowHeight() {
|
|
586
587
|
return t(this, M);
|
|
587
588
|
}
|
|
588
|
-
templateLength(
|
|
589
|
+
templateLength(i = ".ng-container-body") {
|
|
589
590
|
var e;
|
|
590
|
-
return ((e = t(this, z).get(
|
|
591
|
+
return ((e = t(this, z).get(i)) == null ? void 0 : e.length) || 1;
|
|
591
592
|
}
|
|
592
593
|
};
|
|
593
|
-
D = new WeakMap(), S = new WeakMap(), z = new WeakMap(), M = new WeakMap(), V = new WeakMap(), Q = new WeakMap(),
|
|
594
|
+
D = new WeakMap(), S = new WeakMap(), z = new WeakMap(), M = new WeakMap(), V = new WeakMap(), Q = new WeakMap(), wt = new WeakMap(), Se = new WeakMap(), at = new WeakMap(), Wt = new WeakMap(), Ot = new WeakMap(), Bt = new WeakMap(), St = new WeakMap(), Et = new WeakMap(), zt = new WeakMap(), Dt = new WeakMap(), At = new WeakMap(), Ee = new WeakMap(), lt = new WeakMap(), Rt = new WeakMap(), Pt = new WeakMap(), h($e, "RowManager");
|
|
594
595
|
let ce = $e;
|
|
595
596
|
const jt = class jt {
|
|
596
597
|
/**
|
|
597
598
|
* 🎯 레이아웃 내의 여러 rawTables 배열을 일괄로 받아 단일 마스터 템플릿으로 사전 컴파일합니다.
|
|
598
599
|
*/
|
|
599
|
-
static compileAll(
|
|
600
|
-
return Array.isArray(
|
|
600
|
+
static compileAll(i) {
|
|
601
|
+
return Array.isArray(i) ? i.map((e) => jt.compile(e)) : [];
|
|
601
602
|
}
|
|
602
603
|
/**
|
|
603
604
|
* 🎯 단일 원본 테이블을 받아 기본 구조 보정 및 2차원 격자 인덱스 사전 부여 완료된 마스터 테이블 반환
|
|
604
605
|
*/
|
|
605
|
-
static compile(
|
|
606
|
-
if (!
|
|
606
|
+
static compile(i) {
|
|
607
|
+
if (!i) return null;
|
|
607
608
|
const e = /* @__PURE__ */ h((a) => {
|
|
608
|
-
a.querySelectorAll("tbody td, tbody th, tfoot td, tfoot th").forEach((
|
|
609
|
-
const f =
|
|
610
|
-
if (
|
|
609
|
+
a.querySelectorAll("tbody td, tbody th, tfoot td, tfoot th").forEach((c) => {
|
|
610
|
+
const f = c.getAttribute("cell-type") || "renderer";
|
|
611
|
+
if (c.children.length > 0 && c.firstElementChild.tagName.includes("-")) return;
|
|
611
612
|
let u = `cell-${f}`;
|
|
612
|
-
const
|
|
613
|
+
const g = c.getAttribute("data-bind"), b = c.getAttribute("data-expr"), m = c.getAttribute("maxbyte"), v = c.getAttribute("type");
|
|
613
614
|
let E = [];
|
|
614
|
-
|
|
615
|
+
g && E.push(`data-bind="${g}"`), b && E.push(`data-expr="${b}"`), m && E.push(`maxbyte="${m}"`), v && E.push(`type="${v}"`), c.innerHTML = `<${u} ${E.join(" ")}></${u}>`;
|
|
615
616
|
});
|
|
616
|
-
}, "processCellTypes"),
|
|
617
|
+
}, "processCellTypes"), s = /* @__PURE__ */ h((a) => {
|
|
617
618
|
if (!a.querySelector("colgroup")) {
|
|
618
|
-
const
|
|
619
|
-
for (let
|
|
620
|
-
const
|
|
621
|
-
|
|
619
|
+
const l = a.querySelector("tbody tr") || a.querySelector("tr"), c = l ? l.querySelectorAll("th, td").length : 1, f = document.createElement("colgroup"), u = Math.max(Math.floor(a.clientWidth / c), 100);
|
|
620
|
+
for (let g = 0; g < c; g++) {
|
|
621
|
+
const b = document.createElement("col");
|
|
622
|
+
b.setAttribute("width", u), f.appendChild(b);
|
|
622
623
|
}
|
|
623
624
|
a.prepend(f);
|
|
624
625
|
}
|
|
625
626
|
if (!a.querySelector("thead")) {
|
|
626
|
-
const
|
|
627
|
-
|
|
627
|
+
const l = document.createElement("thead"), c = a.querySelector("colgroup");
|
|
628
|
+
c ? c.after(l) : a.prepend(l);
|
|
628
629
|
}
|
|
629
630
|
a.classList.add("nine-table-element"), a.style.display = "table";
|
|
630
|
-
}, "ensureTableStructure"), r = /* @__PURE__ */ h((a,
|
|
631
|
-
const
|
|
631
|
+
}, "ensureTableStructure"), r = /* @__PURE__ */ h((a, l) => {
|
|
632
|
+
const c = Array.from(a.querySelectorAll(l + " tr")), f = Array.from(a.querySelectorAll(l + " th," + l + " td")), u = c.length;
|
|
632
633
|
if (u === 0 || f.length === 0) return;
|
|
633
|
-
let
|
|
634
|
+
let g = 0;
|
|
634
635
|
f.forEach((m) => {
|
|
635
|
-
|
|
636
|
+
g += m.colSpan || 1;
|
|
636
637
|
});
|
|
637
|
-
const
|
|
638
|
-
|
|
638
|
+
const b = Array.from(Array(u), () => Array(g).fill(null));
|
|
639
|
+
c.forEach((m) => {
|
|
639
640
|
const v = m.sectionRowIndex;
|
|
640
641
|
let E = 0;
|
|
641
642
|
Array.from(m.querySelectorAll("th,td")).forEach((x) => {
|
|
642
|
-
for (let O = 0; O <
|
|
643
|
-
if (
|
|
643
|
+
for (let O = 0; O < b[v].length; O++)
|
|
644
|
+
if (b[v][O] === null) {
|
|
644
645
|
E = O;
|
|
645
646
|
break;
|
|
646
647
|
}
|
|
647
648
|
const H = x.rowSpan || 1, k = x.colSpan || 1;
|
|
648
649
|
for (let O = 0; O < H; O++)
|
|
649
|
-
for (let
|
|
650
|
-
v + O < u && E +
|
|
650
|
+
for (let yt = 0; yt < k; yt++)
|
|
651
|
+
v + O < u && E + yt < g && (b[v + O][E + yt] = O === 0 && yt === 0 ? "1" : "0");
|
|
651
652
|
});
|
|
652
|
-
}),
|
|
653
|
+
}), c.forEach((m) => {
|
|
653
654
|
const v = m.sectionRowIndex;
|
|
654
655
|
Array.from(m.querySelectorAll("th,td")).forEach((E) => {
|
|
655
|
-
for (let x = 0; x <
|
|
656
|
-
if (
|
|
657
|
-
E.dataset.col = x,
|
|
656
|
+
for (let x = 0; x < b[v].length; x++)
|
|
657
|
+
if (b[v][x] === "1") {
|
|
658
|
+
E.dataset.col = x, b[v][x] = "0";
|
|
658
659
|
break;
|
|
659
660
|
}
|
|
660
661
|
});
|
|
661
662
|
});
|
|
662
|
-
}, "resetColIndex"), n =
|
|
663
|
-
return
|
|
664
|
-
const
|
|
665
|
-
|
|
666
|
-
f.setAttribute("fixed",
|
|
663
|
+
}, "resetColIndex"), n = i.cloneNode(!0);
|
|
664
|
+
return s(n), e(n), r(n, "thead"), r(n, "tbody"), r(n, "tfoot"), Array.from(n.querySelectorAll("colgroup col")).forEach((a, l) => {
|
|
665
|
+
const c = a.getAttribute("fixed");
|
|
666
|
+
c && n.querySelectorAll(`thead [data-col="${l}"], tbody [data-col="${l}"], tfoot [data-col="${l}"]`).forEach((f) => {
|
|
667
|
+
f.setAttribute("fixed", c);
|
|
667
668
|
});
|
|
668
669
|
}), n;
|
|
669
670
|
}
|
|
@@ -671,8 +672,8 @@ const jt = class jt {
|
|
|
671
672
|
};
|
|
672
673
|
h(jt, "TableCompiler");
|
|
673
674
|
let he = jt;
|
|
674
|
-
var Ft, tt, et, Vt, Yt,
|
|
675
|
-
const
|
|
675
|
+
var Ft, tt, et, Vt, Yt, ct, Ut, Xt;
|
|
676
|
+
const pt = class pt extends HTMLElement {
|
|
676
677
|
constructor() {
|
|
677
678
|
super();
|
|
678
679
|
d(this, Ft);
|
|
@@ -686,69 +687,69 @@ const mt = class mt extends HTMLElement {
|
|
|
686
687
|
{ selector: ".ng-container-body", type: null },
|
|
687
688
|
{ selector: ".ng-container-left", type: "left" },
|
|
688
689
|
{ selector: ".ng-container-right", type: "right" }
|
|
689
|
-
].forEach(({ selector:
|
|
690
|
-
const n = this.querySelector(
|
|
690
|
+
].forEach(({ selector: s, type: r }) => {
|
|
691
|
+
const n = this.querySelector(s);
|
|
691
692
|
if (!n) return;
|
|
692
693
|
n.innerHTML = "";
|
|
693
694
|
const o = document.createElement("div");
|
|
694
|
-
o.className = "ng-part-header", o.appendChild(t(this,
|
|
695
|
+
o.className = "ng-part-header", o.appendChild(t(this, ct).call(this, t(this, tt), r, "header"));
|
|
695
696
|
const a = document.createElement("div");
|
|
696
697
|
a.className = "ng-part-body";
|
|
697
|
-
const c = document.createElement("div");
|
|
698
|
-
c.className = "ng-scroll-content", c.style.position = "relative", c.style.width = "100%", c.appendChild(t(this, ht).call(this, t(this, tt), r, "body"));
|
|
699
698
|
const l = document.createElement("div");
|
|
700
|
-
l.className = "ng-
|
|
699
|
+
l.className = "ng-scroll-content", l.style.position = "relative", l.style.width = "100%", l.appendChild(t(this, ct).call(this, t(this, tt), r, "body"));
|
|
700
|
+
const c = document.createElement("div");
|
|
701
|
+
c.className = "ng-virtual-spacer", c.style.width = "100%", c.style.pointerEvents = "none", l.appendChild(c), a.appendChild(l);
|
|
701
702
|
const f = document.createElement("div");
|
|
702
|
-
f.className = "ng-part-footer", f.appendChild(t(this,
|
|
703
|
+
f.className = "ng-part-footer", f.appendChild(t(this, ct).call(this, t(this, tt), r, "footer")), n.appendChild(o), n.appendChild(a), n.appendChild(f);
|
|
703
704
|
});
|
|
704
705
|
}, "#renderSplitContainers"));
|
|
705
706
|
d(this, Yt, /* @__PURE__ */ h(() => {
|
|
706
707
|
["left", "right", "body"].forEach((e) => {
|
|
707
|
-
const
|
|
708
|
-
if (!
|
|
708
|
+
const s = this.querySelector(`.ng-container-${e}`), r = s == null ? void 0 : s.querySelectorAll("table");
|
|
709
|
+
if (!s || !r || r.length === 0) return;
|
|
709
710
|
let n = 0;
|
|
710
711
|
r[0].querySelectorAll("col").forEach((o) => {
|
|
711
712
|
const a = parseInt(o.getAttribute("width"), 10);
|
|
712
713
|
isNaN(n) || (n += a);
|
|
713
|
-
}), e === "body" ?
|
|
714
|
+
}), e === "body" ? s.style.flex = "1" : (s.style.flex = `0 0 ${n}px`, s.style.width = `${n}px`);
|
|
714
715
|
});
|
|
715
716
|
}, "#updateContainerWidths"));
|
|
716
717
|
A(this, "generate", /* @__PURE__ */ h((e) => {
|
|
717
718
|
e && (y(this, tt, he.compile(e)), t(this, Vt).call(this), t(this, Yt).call(this), t(this, et).initialize(), setTimeout(() => {
|
|
718
|
-
var
|
|
719
|
-
(
|
|
719
|
+
var s;
|
|
720
|
+
(s = this.querySelector("nine-table-hscrollbar")) == null || s.refresh();
|
|
720
721
|
}, 0));
|
|
721
722
|
}, "generate"));
|
|
722
|
-
d(this,
|
|
723
|
-
const n = e.cloneNode(!0), o = n.querySelector("thead"), a = n.querySelector("tbody"),
|
|
723
|
+
d(this, ct, /* @__PURE__ */ h((e, s, r) => {
|
|
724
|
+
const n = e.cloneNode(!0), o = n.querySelector("thead"), a = n.querySelector("tbody"), l = n.querySelector("tfoot");
|
|
724
725
|
if (r === "header") {
|
|
725
|
-
if (a && a.remove(),
|
|
726
|
+
if (a && a.remove(), l && l.remove(), e.querySelector("tbody")) {
|
|
726
727
|
const f = document.createElement("tbody");
|
|
727
728
|
f.className = "fixed-tbody", n.appendChild(f);
|
|
728
729
|
}
|
|
729
|
-
} else r === "body" ? (o && o.remove(),
|
|
730
|
-
return
|
|
731
|
-
|
|
732
|
-
}) :
|
|
733
|
-
|
|
734
|
-
}) : n.querySelectorAll("[fixed=left], [fixed=right]").forEach((
|
|
735
|
-
|
|
730
|
+
} else r === "body" ? (o && o.remove(), l && l.remove(), a && (a.className = "bindable-tbody")) : r === "footer" && (o && o.remove(), a && a.remove());
|
|
731
|
+
return s === "left" ? n.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((c) => {
|
|
732
|
+
c.getAttribute("fixed") !== "left" && c.remove();
|
|
733
|
+
}) : s === "right" ? n.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((c) => {
|
|
734
|
+
c.getAttribute("fixed") !== "right" && c.remove();
|
|
735
|
+
}) : n.querySelectorAll("[fixed=left], [fixed=right]").forEach((c) => {
|
|
736
|
+
c.remove();
|
|
736
737
|
}), n;
|
|
737
738
|
}, "#createSplitTable"));
|
|
738
739
|
A(this, "getRowHeight", /* @__PURE__ */ h(() => t(this, et).getRowHeight(), "getRowHeight"));
|
|
739
740
|
A(this, "scrollToX", /* @__PURE__ */ h((e) => {
|
|
740
|
-
const
|
|
741
|
-
|
|
741
|
+
const s = this.querySelector(".ng-container-body .ng-part-body");
|
|
742
|
+
s && (s.scrollLeft = e);
|
|
742
743
|
}, "scrollToX"));
|
|
743
744
|
A(this, "scrollToY", /* @__PURE__ */ h((e) => {
|
|
744
|
-
const
|
|
745
|
-
|
|
745
|
+
const s = this.querySelector(".ng-container-body .ng-part-body");
|
|
746
|
+
s && (s.scrollTop = e);
|
|
746
747
|
}, "scrollToY"));
|
|
747
748
|
d(this, Ut, /* @__PURE__ */ h(() => {
|
|
748
749
|
t(this, Xt).call(this);
|
|
749
750
|
}, "#init"));
|
|
750
751
|
d(this, Xt, /* @__PURE__ */ h(() => {
|
|
751
|
-
const e =
|
|
752
|
+
const e = pt.SCROLLBAR_SIZE;
|
|
752
753
|
this.innerHTML = `
|
|
753
754
|
<style>
|
|
754
755
|
nine-table-sheet {
|
|
@@ -899,50 +900,50 @@ const mt = class mt extends HTMLElement {
|
|
|
899
900
|
this.innerHTML = "", P.log("NineTableSheet destroyed.");
|
|
900
901
|
}
|
|
901
902
|
};
|
|
902
|
-
Ft = new WeakMap(), tt = new WeakMap(), et = new WeakMap(), Vt = new WeakMap(), Yt = new WeakMap(),
|
|
903
|
-
let
|
|
904
|
-
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet",
|
|
905
|
-
var Kt,
|
|
903
|
+
Ft = new WeakMap(), tt = new WeakMap(), et = new WeakMap(), Vt = new WeakMap(), Yt = new WeakMap(), ct = new WeakMap(), Ut = new WeakMap(), Xt = new WeakMap(), h(pt, "NineTableSheet"), A(pt, "SCROLLBAR_SIZE", 16);
|
|
904
|
+
let $t = pt;
|
|
905
|
+
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", $t);
|
|
906
|
+
var Kt, qt;
|
|
906
907
|
const Ie = class Ie extends HTMLElement {
|
|
907
908
|
constructor() {
|
|
908
909
|
super();
|
|
909
910
|
d(this, Kt, /* @__PURE__ */ h(() => {
|
|
910
911
|
var e;
|
|
911
|
-
(e = this.querySelector(".nine-tab-bar")) == null || e.addEventListener("click", (
|
|
912
|
+
(e = this.querySelector(".nine-tab-bar")) == null || e.addEventListener("click", (s) => {
|
|
912
913
|
var o;
|
|
913
|
-
const r =
|
|
914
|
-
t(this,
|
|
915
|
-
}), t(this,
|
|
914
|
+
const r = s.ctrlKey || s.metaKey || s.shiftKey, n = parseInt((o = s.target.closest(".nine-tab-item")) == null ? void 0 : o.dataset.index, 10);
|
|
915
|
+
t(this, qt).call(this, n, r);
|
|
916
|
+
}), t(this, qt).call(this, 0, !1);
|
|
916
917
|
}, "#init"));
|
|
917
|
-
d(this,
|
|
918
|
+
d(this, qt, /* @__PURE__ */ h((e, s = !1) => {
|
|
918
919
|
const r = /* @__PURE__ */ h(() => {
|
|
919
920
|
const f = Array.from(this.querySelectorAll("nine-table-sheet"));
|
|
920
|
-
Array.from(this.querySelectorAll("nine-splitter")).forEach((
|
|
921
|
-
const
|
|
922
|
-
|
|
923
|
-
const m = parseInt(
|
|
921
|
+
Array.from(this.querySelectorAll("nine-splitter")).forEach((b) => b.style.setProperty("display", "none"));
|
|
922
|
+
const g = f.filter((b) => b.classList.contains("active"));
|
|
923
|
+
g.length < 2 || g.forEach((b) => {
|
|
924
|
+
const m = parseInt(b.getAttribute("data-index"), 10), v = this.querySelector(`nine-splitter[data-split-index="${m}"]`), E = f[m + 1];
|
|
924
925
|
v && E && E.classList.contains("active") && v.style.setProperty("display", "flex");
|
|
925
926
|
});
|
|
926
|
-
}, "updateSplitters"), n = this.querySelector(".nine-tab-bar"), o = this.querySelector("nine-table-sheets-body"), a = n.querySelectorAll(".nine-tab-item"),
|
|
927
|
+
}, "updateSplitters"), n = this.querySelector(".nine-tab-bar"), o = this.querySelector("nine-table-sheets-body"), a = n.querySelectorAll(".nine-tab-item"), l = o.querySelectorAll("nine-table-sheet");
|
|
927
928
|
if (!a[e]) return;
|
|
928
|
-
if (!
|
|
929
|
+
if (!s)
|
|
929
930
|
a.forEach((f, u) => {
|
|
930
931
|
f.classList.toggle("active", u === e);
|
|
931
|
-
}),
|
|
932
|
-
const
|
|
933
|
-
f.classList.toggle("active",
|
|
932
|
+
}), l.forEach((f, u) => {
|
|
933
|
+
const g = u === e;
|
|
934
|
+
f.classList.toggle("active", g), f.style.flex = g ? "1 1 100%" : "";
|
|
934
935
|
});
|
|
935
936
|
else {
|
|
936
937
|
const f = a[e], u = n.querySelectorAll(".nine-tab-item.active");
|
|
937
938
|
if (f.classList.contains("active") && u.length <= 1)
|
|
938
939
|
return;
|
|
939
940
|
f.classList.toggle("active");
|
|
940
|
-
const
|
|
941
|
-
|
|
941
|
+
const g = o.querySelector(`nine-table-sheet[data-index="${e}"]`);
|
|
942
|
+
g && (g.classList.toggle("active"), g.classList.contains("active") || (g.style.flex = ""));
|
|
942
943
|
}
|
|
943
|
-
const
|
|
944
|
-
|
|
945
|
-
f.style.flex =
|
|
944
|
+
const c = o.querySelectorAll("nine-table-sheet.active");
|
|
945
|
+
c == null || c.forEach((f) => {
|
|
946
|
+
f.style.flex = c.length > 1 ? "1 1 0%" : "1 1 100%";
|
|
946
947
|
}), r();
|
|
947
948
|
}, "#switchSheet"));
|
|
948
949
|
}
|
|
@@ -950,31 +951,31 @@ const Ie = class Ie extends HTMLElement {
|
|
|
950
951
|
t(this, Kt).call(this);
|
|
951
952
|
}
|
|
952
953
|
};
|
|
953
|
-
Kt = new WeakMap(),
|
|
954
|
+
Kt = new WeakMap(), qt = new WeakMap(), h(Ie, "NineTableSheets");
|
|
954
955
|
let de = Ie;
|
|
955
956
|
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", de);
|
|
956
|
-
var I, Zt,
|
|
957
|
+
var I, Zt, kt, Gt;
|
|
957
958
|
const _e = class _e {
|
|
958
|
-
constructor(
|
|
959
|
+
constructor(i) {
|
|
959
960
|
d(this, I);
|
|
960
961
|
d(this, Zt, /* @__PURE__ */ h(() => {
|
|
961
|
-
t(this, Gt).call(this), new ResizeObserver((
|
|
962
|
-
for (let e of
|
|
963
|
-
t(this, I).getAttribute("auto-height") === "true" && t(this,
|
|
962
|
+
t(this, Gt).call(this), new ResizeObserver((i) => {
|
|
963
|
+
for (let e of i)
|
|
964
|
+
t(this, I).getAttribute("auto-height") === "true" && t(this, kt).call(this);
|
|
964
965
|
}).observe(t(this, I));
|
|
965
966
|
}, "#init"));
|
|
966
|
-
d(this,
|
|
967
|
-
var
|
|
968
|
-
const
|
|
969
|
-
if (
|
|
970
|
-
const e = parseInt(t(this, I).getAttribute("max-display-row"), 10) || 10,
|
|
967
|
+
d(this, kt, /* @__PURE__ */ h(() => {
|
|
968
|
+
var l, c;
|
|
969
|
+
const i = Array.from(t(this, I).shadowRoot.querySelectorAll("nine-table-sheet.active"));
|
|
970
|
+
if (i.length === 0) return;
|
|
971
|
+
const e = parseInt(t(this, I).getAttribute("max-display-row"), 10) || 10, s = Math.max(...i.map((f) => f.getRowHeight())), r = (l = t(this, I).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : l.getBoundingClientRect().height, n = (c = t(this, I).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : c.getBoundingClientRect().height, o = $t.SCROLLBAR_SIZE, a = e * s + r + n + o;
|
|
971
972
|
t(this, I).style.height = `${a}px`;
|
|
972
973
|
}, "#applyAutoHeight"));
|
|
973
974
|
d(this, Gt, /* @__PURE__ */ h(() => {
|
|
974
|
-
const e = Array.from(t(this, I).children).filter((
|
|
975
|
-
const u = `<nine-table-sheet class="${
|
|
976
|
-
return u +
|
|
977
|
-
}).join(""), o = e.map((
|
|
975
|
+
const e = Array.from(t(this, I).children).filter((l) => l.tagName === "TABLE"), s = t(this, I).getAttribute("auto-height") === "true", r = e.length, n = e.map((l, c) => {
|
|
976
|
+
const u = `<nine-table-sheet class="${c === 0 ? "active" : ""}" data-index="${c}"></nine-table-sheet>`, g = c < r - 1 ? `<nine-splitter class="h" data-split-index="${c}"></nine-splitter>` : "";
|
|
977
|
+
return u + g;
|
|
978
|
+
}).join(""), o = e.map((l, c) => `<div class="nine-tab-item ${c === 0 ? "active" : ""}" data-index="${c}">Sheet ${c + 1}</div>`).join("");
|
|
978
979
|
t(this, I).shadowRoot.innerHTML = `
|
|
979
980
|
<style>
|
|
980
981
|
:host {
|
|
@@ -982,7 +983,7 @@ const _e = class _e {
|
|
|
982
983
|
flex-direction: column;
|
|
983
984
|
position: relative;
|
|
984
985
|
overflow: hidden;
|
|
985
|
-
height: ${
|
|
986
|
+
height: ${s ? "auto" : "100%"};
|
|
986
987
|
background: #fff;
|
|
987
988
|
}
|
|
988
989
|
|
|
@@ -1067,76 +1068,76 @@ const _e = class _e {
|
|
|
1067
1068
|
<nine-table-footer></nine-table-footer>
|
|
1068
1069
|
`;
|
|
1069
1070
|
const a = t(this, I).shadowRoot.querySelectorAll("nine-table-sheet");
|
|
1070
|
-
a == null || a.forEach((
|
|
1071
|
-
e[
|
|
1072
|
-
|
|
1071
|
+
a == null || a.forEach((l, c) => {
|
|
1072
|
+
e[c] && setTimeout(() => {
|
|
1073
|
+
l.generate(e[c]), s && t(this, kt).call(this);
|
|
1073
1074
|
});
|
|
1074
1075
|
});
|
|
1075
1076
|
}, "#render"));
|
|
1076
|
-
y(this, I,
|
|
1077
|
+
y(this, I, i), t(this, Zt).call(this);
|
|
1077
1078
|
}
|
|
1078
1079
|
};
|
|
1079
|
-
I = new WeakMap(), Zt = new WeakMap(),
|
|
1080
|
+
I = new WeakMap(), Zt = new WeakMap(), kt = new WeakMap(), Gt = new WeakMap(), h(_e, "LayoutManager");
|
|
1080
1081
|
let fe = _e;
|
|
1081
|
-
var
|
|
1082
|
+
var Tt, ht;
|
|
1082
1083
|
const Ne = class Ne {
|
|
1083
|
-
constructor(
|
|
1084
|
-
d(this,
|
|
1085
|
-
d(this,
|
|
1086
|
-
A(this, "count", /* @__PURE__ */ h(() => t(this,
|
|
1087
|
-
y(this,
|
|
1084
|
+
constructor(i) {
|
|
1085
|
+
d(this, Tt);
|
|
1086
|
+
d(this, ht, -1);
|
|
1087
|
+
A(this, "count", /* @__PURE__ */ h(() => t(this, Tt).rawRecords.length, "count"));
|
|
1088
|
+
y(this, Tt, i);
|
|
1088
1089
|
}
|
|
1089
1090
|
get at() {
|
|
1090
|
-
return t(this,
|
|
1091
|
+
return t(this, ht);
|
|
1091
1092
|
}
|
|
1092
|
-
set at(
|
|
1093
|
-
y(this,
|
|
1093
|
+
set at(i) {
|
|
1094
|
+
y(this, ht, parseInt(i, 10)), body && !body.querySelector(`tbody.bindable tr[data-row="${t(this, ht)}"]`) && setTimeout(() => {
|
|
1094
1095
|
});
|
|
1095
1096
|
}
|
|
1096
1097
|
};
|
|
1097
|
-
|
|
1098
|
+
Tt = new WeakMap(), ht = new WeakMap(), h(Ne, "ngRow");
|
|
1098
1099
|
let ue = Ne;
|
|
1099
|
-
var _, T, N,
|
|
1100
|
+
var _, T, N, dt, Jt, Y, Qt, st, Ct, te, ee, ft;
|
|
1100
1101
|
const W = class W {
|
|
1101
|
-
constructor(
|
|
1102
|
+
constructor(i, e) {
|
|
1102
1103
|
d(this, _);
|
|
1103
1104
|
d(this, T);
|
|
1104
1105
|
d(this, N, []);
|
|
1105
|
-
d(this,
|
|
1106
|
+
d(this, dt, []);
|
|
1106
1107
|
d(this, Jt, 0);
|
|
1107
1108
|
d(this, Y, []);
|
|
1108
1109
|
d(this, Qt, /* @__PURE__ */ h(() => {
|
|
1109
1110
|
y(this, Y, []);
|
|
1110
|
-
const
|
|
1111
|
-
Array.from(
|
|
1112
|
-
var
|
|
1113
|
-
t(this, Y).push(((
|
|
1111
|
+
const i = t(this, _).template || [];
|
|
1112
|
+
Array.from(i).forEach((e) => {
|
|
1113
|
+
var s;
|
|
1114
|
+
t(this, Y).push(((s = e.getBoundingClientRect) == null ? void 0 : s.call(e).height) || 24);
|
|
1114
1115
|
}), (t(this, T).rawRecords || []).forEach((e) => {
|
|
1115
|
-
e.__ng || (e.__ng = t(this,
|
|
1116
|
+
e.__ng || (e.__ng = t(this, Ct).call(this)), e.__ng.height = t(this, Y).slice();
|
|
1116
1117
|
});
|
|
1117
1118
|
}, "#initialize"));
|
|
1118
1119
|
d(this, st, /* @__PURE__ */ h(() => {
|
|
1119
|
-
t(this, _).shadowRoot.querySelectorAll("nine-table-sheet").forEach((
|
|
1120
|
-
|
|
1120
|
+
t(this, _).shadowRoot.querySelectorAll("nine-table-sheet").forEach((i) => {
|
|
1121
|
+
i.invalidate();
|
|
1121
1122
|
});
|
|
1122
1123
|
}, "#invalidate"));
|
|
1123
|
-
A(this, "get", /* @__PURE__ */ h((
|
|
1124
|
+
A(this, "get", /* @__PURE__ */ h((i, e) => {
|
|
1124
1125
|
var n;
|
|
1125
|
-
const
|
|
1126
|
-
if (!
|
|
1127
|
-
if (
|
|
1128
|
-
if (
|
|
1126
|
+
const s = this.getValidData();
|
|
1127
|
+
if (!s || s.length <= 0) return;
|
|
1128
|
+
if (i == null) return t(this, ft).call(this, s);
|
|
1129
|
+
if (i < 0 || i >= s.length) return null;
|
|
1129
1130
|
const r = typeof ((n = t(this, _).fields) == null ? void 0 : n.get) == "function" ? t(this, _).fields.get() : [];
|
|
1130
1131
|
if (e != null) {
|
|
1131
1132
|
const o = r.indexOf(e);
|
|
1132
|
-
return o >= 0 ? i
|
|
1133
|
+
return o >= 0 ? s[i].v[o] : null;
|
|
1133
1134
|
}
|
|
1134
|
-
return t(this,
|
|
1135
|
+
return t(this, ft).call(this, s[i]);
|
|
1135
1136
|
}, "get"));
|
|
1136
|
-
A(this, "set", /* @__PURE__ */ h((
|
|
1137
|
-
this.clear(), this.add(
|
|
1137
|
+
A(this, "set", /* @__PURE__ */ h((i) => {
|
|
1138
|
+
this.clear(), this.add(i, !1), t(this, st).call(this);
|
|
1138
1139
|
}, "set"));
|
|
1139
|
-
d(this,
|
|
1140
|
+
d(this, Ct, /* @__PURE__ */ h(() => ({
|
|
1140
1141
|
rowState: W.ROW_STATE.EMPTY,
|
|
1141
1142
|
deleted: !1,
|
|
1142
1143
|
filtered: !1,
|
|
@@ -1146,84 +1147,84 @@ const W = class W {
|
|
|
1146
1147
|
_: [0, 0, 0, 0, W.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this, Y).slice(), -1, {}, {}]
|
|
1147
1148
|
}), "#getDefaultMeta"));
|
|
1148
1149
|
A(this, "reset", /* @__PURE__ */ h(() => {
|
|
1149
|
-
y(this, N, []), y(this,
|
|
1150
|
+
y(this, N, []), y(this, dt, []), t(this, st).call(this);
|
|
1150
1151
|
}, "reset"));
|
|
1151
1152
|
A(this, "clear", /* @__PURE__ */ h(() => {
|
|
1152
|
-
var
|
|
1153
|
-
t(this, T).rawRecords = [], y(this, N, []), y(this,
|
|
1153
|
+
var i;
|
|
1154
|
+
t(this, T).rawRecords = [], y(this, N, []), y(this, dt, []), (i = t(this, T).viewRecords) != null && i.reset && t(this, T).viewRecords.reset();
|
|
1154
1155
|
}, "clear"));
|
|
1155
|
-
d(this, te, /* @__PURE__ */ h((
|
|
1156
|
+
d(this, te, /* @__PURE__ */ h((i) => {
|
|
1156
1157
|
var r;
|
|
1157
|
-
Array.isArray(
|
|
1158
|
-
const e = typeof ((r = t(this, _).fields) == null ? void 0 : r.get) == "function" ? t(this, _).fields.get() : Object.keys(
|
|
1159
|
-
return
|
|
1158
|
+
Array.isArray(i) || (i = [i]);
|
|
1159
|
+
const e = typeof ((r = t(this, _).fields) == null ? void 0 : r.get) == "function" ? t(this, _).fields.get() : Object.keys(i[0] || {}), s = [];
|
|
1160
|
+
return i.forEach((n) => {
|
|
1160
1161
|
const o = { v: [] };
|
|
1161
1162
|
e.forEach((a) => {
|
|
1162
1163
|
o.v.push(n[a] !== void 0 && n[a] !== null ? n[a] : "");
|
|
1163
|
-
}),
|
|
1164
|
-
}),
|
|
1164
|
+
}), s.push(o);
|
|
1165
|
+
}), s;
|
|
1165
1166
|
}, "#json2Array"));
|
|
1166
|
-
d(this, ee, /* @__PURE__ */ h((
|
|
1167
|
-
e.__ng = t(this,
|
|
1168
|
-
}),
|
|
1169
|
-
A(this, "add", /* @__PURE__ */ h((
|
|
1170
|
-
|
|
1171
|
-
const
|
|
1172
|
-
t(this, T).rawRecords = t(this, T).rawRecords.concat(t(this, ee).call(this,
|
|
1167
|
+
d(this, ee, /* @__PURE__ */ h((i) => (Array.isArray(i) || (i = [i]), i.forEach((e) => {
|
|
1168
|
+
e.__ng = t(this, Ct).call(this), e.__ng.rowid = this.nextId, e.__ng.rowState = W.ROW_STATE.INSERT, e.__ng._[0] = e.__ng.rowid;
|
|
1169
|
+
}), i), "#defaultInsert"));
|
|
1170
|
+
A(this, "add", /* @__PURE__ */ h((i, e = !0) => {
|
|
1171
|
+
i === void 0 && (i = {});
|
|
1172
|
+
const s = t(this, te).call(this, i);
|
|
1173
|
+
t(this, T).rawRecords = t(this, T).rawRecords.concat(t(this, ee).call(this, s)), this.resetRecords();
|
|
1173
1174
|
const r = this.count() - 1;
|
|
1174
|
-
return e ||
|
|
1175
|
+
return e || s.forEach((n, o) => {
|
|
1175
1176
|
const a = t(this, T).rawRecords[r - o];
|
|
1176
1177
|
a && (a.__ng.rowState = W.ROW_STATE.EMPTY);
|
|
1177
1178
|
}), t(this, st).call(this), r;
|
|
1178
1179
|
}, "add"));
|
|
1179
|
-
A(this, "delete", /* @__PURE__ */ h((
|
|
1180
|
+
A(this, "delete", /* @__PURE__ */ h((i) => {
|
|
1180
1181
|
let e = [];
|
|
1181
|
-
Array.isArray(
|
|
1182
|
-
if (t(this, N)[
|
|
1183
|
-
const r = t(this, N)[
|
|
1184
|
-
t(this, N)[
|
|
1182
|
+
Array.isArray(i) ? e = i : typeof i > "u" ? e = [t(this, T).host.row.at] : e = [parseInt(i, 10)], e.sort((s, r) => r - s).forEach((s) => {
|
|
1183
|
+
if (t(this, N)[s]) {
|
|
1184
|
+
const r = t(this, N)[s].__ng.rowid;
|
|
1185
|
+
t(this, N)[s].__ng.rowState === W.ROW_STATE.INSERT ? t(this, T).rawRecords = t(this, T).rawRecords.filter((n) => n.__ng.rowid !== r) : t(this, T).rawRecords.forEach((n) => {
|
|
1185
1186
|
n.__ng.rowid === r && (n.__ng.deleted = !0, n.__ng.rowState = W.ROW_STATE.DELETE);
|
|
1186
1187
|
});
|
|
1187
1188
|
}
|
|
1188
1189
|
}), this.resetRecords(), t(this, st).call(this);
|
|
1189
1190
|
}, "delete"));
|
|
1190
|
-
A(this, "setValue", /* @__PURE__ */ h((
|
|
1191
|
-
var
|
|
1192
|
-
|
|
1193
|
-
const n = (typeof ((
|
|
1191
|
+
A(this, "setValue", /* @__PURE__ */ h((i, e, s) => {
|
|
1192
|
+
var l;
|
|
1193
|
+
i = parseInt(i, 10);
|
|
1194
|
+
const n = (typeof ((l = t(this, _).fields) == null ? void 0 : l.get) == "function" ? t(this, _).fields.get() : []).indexOf(e);
|
|
1194
1195
|
if (n < 0) return;
|
|
1195
|
-
const o = this.getValidData()[
|
|
1196
|
+
const o = this.getValidData()[i];
|
|
1196
1197
|
if (!o) return;
|
|
1197
1198
|
const a = o.v[n];
|
|
1198
|
-
a !==
|
|
1199
|
+
a !== s && o.__ng.rowState !== W.ROW_STATE.INSERT && (o.__ng.o.hasOwnProperty(e) || (o.__ng.o[e] = a), o.__ng.rowState = W.ROW_STATE.UPDATE), o.v[n] = s;
|
|
1199
1200
|
}, "setValue"));
|
|
1200
1201
|
A(this, "resetRecords", /* @__PURE__ */ h(() => {
|
|
1201
|
-
y(this,
|
|
1202
|
-
|
|
1203
|
-
}), t(this, N).forEach((
|
|
1204
|
-
|
|
1202
|
+
y(this, dt, t(this, T).rawRecords.filter((i) => !i.__ng.deleted)), y(this, N, t(this, T).rawRecords.filter((i) => !i.__ng.deleted && !i.__ng.filtered)), t(this, T).rawRecords.forEach((i, e) => {
|
|
1203
|
+
i.__ng.rowidx = e;
|
|
1204
|
+
}), t(this, N).forEach((i, e) => {
|
|
1205
|
+
i.__ng.i = e;
|
|
1205
1206
|
});
|
|
1206
1207
|
}, "resetRecords"));
|
|
1207
1208
|
A(this, "getValidData", /* @__PURE__ */ h(() => (t(this, N).length === 0 && t(this, T).rawRecords.length > 0 && this.resetRecords(), t(this, N)), "getValidData"));
|
|
1208
|
-
d(this,
|
|
1209
|
+
d(this, ft, /* @__PURE__ */ h((i) => {
|
|
1209
1210
|
var o;
|
|
1210
|
-
if (!
|
|
1211
|
-
const e = !Array.isArray(
|
|
1212
|
-
const
|
|
1213
|
-
return r.forEach((
|
|
1214
|
-
c
|
|
1215
|
-
}),
|
|
1211
|
+
if (!i) return i;
|
|
1212
|
+
const e = !Array.isArray(i), s = e ? [i] : i, r = typeof ((o = t(this, _).fields) == null ? void 0 : o.get) == "function" ? t(this, _).fields.get() : [], n = s.filter((a) => !a.__ng.deleted).map((a) => {
|
|
1213
|
+
const l = {};
|
|
1214
|
+
return r.forEach((c, f) => {
|
|
1215
|
+
l[c] = a.v ? a.v[f] : a[c];
|
|
1216
|
+
}), l.__ng = a.__ng, l;
|
|
1216
1217
|
});
|
|
1217
1218
|
return e ? n[0] : n;
|
|
1218
1219
|
}, "#conv"));
|
|
1219
1220
|
A(this, "count", /* @__PURE__ */ h(() => this.getValidData().length, "count"));
|
|
1220
|
-
y(this, _,
|
|
1221
|
+
y(this, _, i), y(this, T, e), t(this, Qt).call(this);
|
|
1221
1222
|
}
|
|
1222
1223
|
get source() {
|
|
1223
|
-
return t(this,
|
|
1224
|
+
return t(this, ft).call(this, t(this, T).rawRecords);
|
|
1224
1225
|
}
|
|
1225
|
-
set source(
|
|
1226
|
-
this.clear(), this.add(
|
|
1226
|
+
set source(i) {
|
|
1227
|
+
this.clear(), this.add(i, !1);
|
|
1227
1228
|
}
|
|
1228
1229
|
get nextId() {
|
|
1229
1230
|
return ++Ye(this, Jt)._;
|
|
@@ -1235,7 +1236,7 @@ const W = class W {
|
|
|
1235
1236
|
return this.length;
|
|
1236
1237
|
}
|
|
1237
1238
|
};
|
|
1238
|
-
_ = new WeakMap(), T = new WeakMap(), N = new WeakMap(),
|
|
1239
|
+
_ = new WeakMap(), T = new WeakMap(), N = new WeakMap(), dt = new WeakMap(), Jt = new WeakMap(), Y = new WeakMap(), Qt = new WeakMap(), st = new WeakMap(), Ct = new WeakMap(), te = new WeakMap(), ee = new WeakMap(), ft = new WeakMap(), h(W, "ngData"), // 🎯 행 상태 정의 상수를 클래스 내부로 내재화
|
|
1239
1240
|
A(W, "ROW_STATE", {
|
|
1240
1241
|
EMPTY: "EMPTY",
|
|
1241
1242
|
NORMAL: "NORMAL",
|
|
@@ -1246,55 +1247,55 @@ A(W, "ROW_STATE", {
|
|
|
1246
1247
|
let ge = W;
|
|
1247
1248
|
var it;
|
|
1248
1249
|
const We = class We {
|
|
1249
|
-
constructor(
|
|
1250
|
+
constructor(i) {
|
|
1250
1251
|
d(this, it);
|
|
1251
|
-
y(this, it,
|
|
1252
|
+
y(this, it, i), 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 = () => {
|
|
1252
1253
|
var e;
|
|
1253
1254
|
(e = t(this, it).view) != null && e.redraw && t(this, it).view.redraw();
|
|
1254
1255
|
}, this.setDataSource = (e) => {
|
|
1255
1256
|
this.data && this.data.reset(), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.data.set(e || []);
|
|
1256
1257
|
}, this.getRowState = (e) => {
|
|
1257
1258
|
var r, n;
|
|
1258
|
-
const
|
|
1259
|
-
if (!(
|
|
1260
|
-
return (n = (r = this.data.getValidData()[
|
|
1259
|
+
const s = parseInt(e, 10);
|
|
1260
|
+
if (!(s >= this.data.count()))
|
|
1261
|
+
return (n = (r = this.data.getValidData()[s]) == null ? void 0 : r.__ng) == null ? void 0 : n.rowState;
|
|
1261
1262
|
}, this.getRowPosition = () => this.row.at, this.setRowPosition = (e) => {
|
|
1262
1263
|
this.row.at = e;
|
|
1263
|
-
}, 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,
|
|
1264
|
-
e = parseInt(e, 10), this.data.setValue(e,
|
|
1264
|
+
}, this.scrollTo_V1 = (e) => (e < 0 && (e = 0), e >= this.rawRecords.length && (e = this.rawRecords.length - 1), this.viewRecords.rawIndex = e, this.viewRecords.reset && this.viewRecords.reset(), !(e <= 0 || e >= this.rawRecords.length - 1)), this.getColumn = (e, s) => this.data.get(e, s), this.setColumn = (e, s, r) => {
|
|
1265
|
+
e = parseInt(e, 10), this.data.setValue(e, s, r);
|
|
1265
1266
|
}, this.setDataSource([]);
|
|
1266
1267
|
}
|
|
1267
1268
|
};
|
|
1268
1269
|
it = new WeakMap(), h(We, "ngDataManager");
|
|
1269
1270
|
let be = We;
|
|
1270
|
-
var
|
|
1271
|
+
var ut, L, Lt, se;
|
|
1271
1272
|
const Oe = class Oe {
|
|
1272
1273
|
// 🎯 이제 { name: string, type: string } 객체들의 배열로 관리합니다.
|
|
1273
|
-
constructor(
|
|
1274
|
-
d(this,
|
|
1274
|
+
constructor(i) {
|
|
1275
|
+
d(this, ut);
|
|
1275
1276
|
d(this, L, []);
|
|
1276
|
-
A(this, "add", /* @__PURE__ */ h((
|
|
1277
|
-
|
|
1278
|
-
t(this, L).some((r) => r.name ===
|
|
1279
|
-
}), t(this,
|
|
1277
|
+
A(this, "add", /* @__PURE__ */ h((i, e = "string") => {
|
|
1278
|
+
i.forEach((s) => {
|
|
1279
|
+
t(this, L).some((r) => r.name === s) || t(this, L).push({ name: s, type: e });
|
|
1280
|
+
}), t(this, Lt).call(this);
|
|
1280
1281
|
}, "add"));
|
|
1281
|
-
d(this,
|
|
1282
|
-
const
|
|
1282
|
+
d(this, Lt, /* @__PURE__ */ h(() => {
|
|
1283
|
+
const i = /* @__PURE__ */ new Map();
|
|
1283
1284
|
t(this, L).forEach((e) => {
|
|
1284
|
-
|
|
1285
|
-
}), y(this, L, Array.from(
|
|
1285
|
+
i.set(e.name, e.type);
|
|
1286
|
+
}), y(this, L, Array.from(i, ([e, s]) => ({ name: e, type: s }))), y(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);
|
|
1286
1287
|
}, "#adjust"));
|
|
1287
1288
|
d(this, se, /* @__PURE__ */ h(() => {
|
|
1288
|
-
y(this, L, []), P.log(t(this,
|
|
1289
|
-
const
|
|
1290
|
-
if (!(!
|
|
1291
|
-
for (const e of
|
|
1292
|
-
P.log(e), $("[data-bind]", e).each((
|
|
1289
|
+
y(this, L, []), P.log(t(this, ut).querySelectorAll("table"));
|
|
1290
|
+
const i = Array.from(t(this, ut).querySelectorAll("table"));
|
|
1291
|
+
if (!(!i || i.length === 0)) {
|
|
1292
|
+
for (const e of i)
|
|
1293
|
+
P.log(e), $("[data-bind]", e).each((s, r) => {
|
|
1293
1294
|
const n = r.dataset.bind, o = r.getAttribute("data-type") || "string";
|
|
1294
1295
|
n && t(this, L).push({ name: n, type: o });
|
|
1295
|
-
}), ["data-expr", "background-color", "color", "tooltip", "visible", "readonly", "enable-button", "enable-check", "class-expr", "icon-color", "icon-src"].forEach((
|
|
1296
|
-
$(`[${
|
|
1297
|
-
var o = n.getAttribute(
|
|
1296
|
+
}), ["data-expr", "background-color", "color", "tooltip", "visible", "readonly", "enable-button", "enable-check", "class-expr", "icon-color", "icon-src"].forEach((s) => {
|
|
1297
|
+
$(`[${s}]`, e).each((r, n) => {
|
|
1298
|
+
var o = n.getAttribute(s);
|
|
1298
1299
|
if (o.indexOf("data.") < 0) {
|
|
1299
1300
|
const a = o.search(/[(]/g);
|
|
1300
1301
|
if (a > 0)
|
|
@@ -1306,39 +1307,39 @@ const Oe = class Oe {
|
|
|
1306
1307
|
}
|
|
1307
1308
|
o.split("data.").forEach((a) => {
|
|
1308
1309
|
if (a.trim() != "") {
|
|
1309
|
-
const
|
|
1310
|
-
let
|
|
1311
|
-
|
|
1310
|
+
const l = a.search(/[^_A-Za-z0-9]/g);
|
|
1311
|
+
let c = "";
|
|
1312
|
+
l >= 0 ? c = a.substring(0, l) : o.startsWith("data.") && (c = a.replace("data.", "")), c && t(this, L).push({ name: c, type: "string" });
|
|
1312
1313
|
}
|
|
1313
1314
|
});
|
|
1314
1315
|
});
|
|
1315
1316
|
});
|
|
1316
|
-
t(this,
|
|
1317
|
+
t(this, Lt).call(this);
|
|
1317
1318
|
}
|
|
1318
1319
|
}, "#init"));
|
|
1319
|
-
y(this,
|
|
1320
|
+
y(this, ut, i), t(this, se).call(this);
|
|
1320
1321
|
}
|
|
1321
1322
|
// 🎯 기존에 필드 이름만 쓰던 곳들과의 호환을 위해 이름 배열만 리턴하는 메서드 유지
|
|
1322
1323
|
get() {
|
|
1323
|
-
return t(this, L).map((
|
|
1324
|
+
return t(this, L).map((i) => i.name);
|
|
1324
1325
|
}
|
|
1325
1326
|
// 🎯 내부 객체 통째로 얻기
|
|
1326
1327
|
getFields() {
|
|
1327
1328
|
return t(this, L);
|
|
1328
1329
|
}
|
|
1329
1330
|
// 🎯 특정 필드의 데이터 타입 조회
|
|
1330
|
-
getType(
|
|
1331
|
-
const e = t(this, L).find((
|
|
1331
|
+
getType(i) {
|
|
1332
|
+
const e = t(this, L).find((s) => s.name === i);
|
|
1332
1333
|
return e ? e.type : "string";
|
|
1333
1334
|
}
|
|
1334
|
-
indexOf(
|
|
1335
|
-
return t(this, L).findIndex((e) => e.name ===
|
|
1335
|
+
indexOf(i) {
|
|
1336
|
+
return t(this, L).findIndex((e) => e.name === i);
|
|
1336
1337
|
}
|
|
1337
|
-
includes(
|
|
1338
|
-
return t(this, L).some((e) => e.name ===
|
|
1338
|
+
includes(i) {
|
|
1339
|
+
return t(this, L).some((e) => e.name === i);
|
|
1339
1340
|
}
|
|
1340
1341
|
};
|
|
1341
|
-
|
|
1342
|
+
ut = new WeakMap(), L = new WeakMap(), Lt = new WeakMap(), se = new WeakMap(), h(Oe, "ngFields");
|
|
1342
1343
|
let ye = Oe;
|
|
1343
1344
|
var rt, ie, re;
|
|
1344
1345
|
const Be = class Be extends HTMLElement {
|
|
@@ -1374,7 +1375,7 @@ const Be = class Be extends HTMLElement {
|
|
|
1374
1375
|
rt = new WeakMap(), ie = new WeakMap(), re = new WeakMap(), h(Be, "NineTable");
|
|
1375
1376
|
let pe = Be;
|
|
1376
1377
|
customElements.get("nine-table") || customElements.define("nine-table", pe);
|
|
1377
|
-
const
|
|
1378
|
+
const mt = class mt extends HTMLElement {
|
|
1378
1379
|
// 👈 커스텀 스타일용 캐시 추가
|
|
1379
1380
|
constructor() {
|
|
1380
1381
|
super();
|
|
@@ -1385,31 +1386,31 @@ const xt = class xt extends HTMLElement {
|
|
|
1385
1386
|
connectedCallback() {
|
|
1386
1387
|
}
|
|
1387
1388
|
};
|
|
1388
|
-
h(
|
|
1389
|
-
let me =
|
|
1390
|
-
var C,
|
|
1389
|
+
h(mt, "BasicCellElement"), A(mt, "_styleCache", /* @__PURE__ */ new Map()), A(mt, "_customStyleCache", /* @__PURE__ */ new Map());
|
|
1390
|
+
let me = mt;
|
|
1391
|
+
var C, Ht, p, Ae, Re, qe, ke, Te;
|
|
1391
1392
|
const ze = class ze extends me {
|
|
1392
1393
|
constructor() {
|
|
1393
1394
|
super();
|
|
1394
1395
|
d(this, C);
|
|
1395
|
-
d(this,
|
|
1396
|
+
d(this, Ht);
|
|
1396
1397
|
d(this, p);
|
|
1397
1398
|
d(this, Ae);
|
|
1398
|
-
d(this, qe);
|
|
1399
1399
|
d(this, Re);
|
|
1400
|
+
d(this, qe);
|
|
1400
1401
|
d(this, ke);
|
|
1401
1402
|
A(this, "getDisplayText", /* @__PURE__ */ h((e) => {
|
|
1402
1403
|
if (t(this, p))
|
|
1403
1404
|
if (t(this, p).closest("tbody")) {
|
|
1404
|
-
const
|
|
1405
|
-
if (!
|
|
1405
|
+
const s = t(this, p).closest("tr").data, r = parseInt(t(this, p).dataset.row);
|
|
1406
|
+
if (!s) return "";
|
|
1406
1407
|
if (ninegrid.isNull(t(this, p).dataset.expr)) {
|
|
1407
1408
|
if (!ninegrid.isNull(t(this, p).dataset.bind))
|
|
1408
|
-
return
|
|
1409
|
+
return s[t(this, p).dataset.bind] || ninegrid.nvl(e, "");
|
|
1409
1410
|
} else try {
|
|
1410
|
-
return this.getExprValue(t(this, p).dataset.expr,
|
|
1411
|
+
return this.getExprValue(t(this, p).dataset.expr, s, r, t(this, p));
|
|
1411
1412
|
} catch {
|
|
1412
|
-
console.error(t(this, p).dataset.expr,
|
|
1413
|
+
console.error(t(this, p).dataset.expr, s, t(this, p).dataset.row);
|
|
1413
1414
|
}
|
|
1414
1415
|
return ninegrid.nvl(e, "");
|
|
1415
1416
|
} else
|
|
@@ -1422,19 +1423,19 @@ const ze = class ze extends me {
|
|
|
1422
1423
|
if (!(!t(this, C) || !t(this, C).template || !t(this, p).closest("tbody.bindable"))) {
|
|
1423
1424
|
var e = ninegrid.j.querySelectorAll(t(this, p)).attr("suppress");
|
|
1424
1425
|
if (e && (e = parseInt(e)), e && !isNaN(e)) {
|
|
1425
|
-
var
|
|
1426
|
-
$("th,td",
|
|
1426
|
+
var s = t(this, p).closest("tr"), r = [];
|
|
1427
|
+
$("th,td", s).each((x, H) => {
|
|
1427
1428
|
var k = ninegrid.j.querySelectorAll(H).attr("suppress");
|
|
1428
1429
|
k && H.dataset.row && (k = parseInt(k), !isNaN(k) && k <= e && r.push(k));
|
|
1429
1430
|
}), r.sort();
|
|
1430
1431
|
var n = !1;
|
|
1431
|
-
if (parseInt(
|
|
1432
|
+
if (parseInt(s.sectionRowIndex / t(this, C).template.length) > 0)
|
|
1432
1433
|
for (var o of r) {
|
|
1433
1434
|
if (o > e) break;
|
|
1434
|
-
var a = parseInt(t(this, p).dataset.row),
|
|
1435
|
+
var a = parseInt(t(this, p).dataset.row), l = a - 1, c = t(this, p).closest("tr").data, f = t(this, C).data.get(l);
|
|
1435
1436
|
t(this, p).dataset.matrixRow;
|
|
1436
|
-
var u = t(this, C).body.querySelector(`tbody.bindable [suppress="${o}"][data-matrix-row="${t(this, p).dataset.matrixRow}"]`),
|
|
1437
|
-
if (
|
|
1437
|
+
var u = t(this, C).body.querySelector(`tbody.bindable [suppress="${o}"][data-matrix-row="${t(this, p).dataset.matrixRow}"]`), g = u.dataset.expr ? this.getExprValue(u.dataset.expr, c, a) : c[u.dataset.bind], b = u.dataset.expr ? this.getExprValue(u.dataset.expr, f, l) : f[u.dataset.bind];
|
|
1438
|
+
if (g != b) {
|
|
1438
1439
|
n = !0;
|
|
1439
1440
|
break;
|
|
1440
1441
|
}
|
|
@@ -1447,12 +1448,12 @@ const ze = class ze extends me {
|
|
|
1447
1448
|
}
|
|
1448
1449
|
}
|
|
1449
1450
|
}, "#resetSuppress"));
|
|
1450
|
-
A(this, "getExprValue", /* @__PURE__ */ h((e,
|
|
1451
|
+
A(this, "getExprValue", /* @__PURE__ */ h((e, s, r, n) => {
|
|
1451
1452
|
if (typeof e < "u")
|
|
1452
1453
|
try {
|
|
1453
1454
|
r = parseInt(r);
|
|
1454
1455
|
const o = e.replace("()", "");
|
|
1455
|
-
return t(this, C)[o] ? t(this, C)[o].call(this,
|
|
1456
|
+
return t(this, C)[o] ? t(this, C)[o].call(this, s, r, t(this, p)) : t(this, C).exprFunction(e).call(this, s, r, t(this, C).data);
|
|
1456
1457
|
} catch {
|
|
1457
1458
|
return ["NG-COMBO"].includes(this.tagName) ? "" : e;
|
|
1458
1459
|
}
|
|
@@ -1461,16 +1462,16 @@ const ze = class ze extends me {
|
|
|
1461
1462
|
}, "getExprValue"));
|
|
1462
1463
|
}
|
|
1463
1464
|
connectedCallback() {
|
|
1464
|
-
super.connectedCallback(), y(this, C, this.getRootNode().host), y(this, p, this.closest("th,td")), y(this,
|
|
1465
|
+
super.connectedCallback(), y(this, C, this.getRootNode().host), y(this, p, this.closest("th,td")), y(this, Ht, t(this, p).closest("tr"));
|
|
1465
1466
|
}
|
|
1466
1467
|
get value() {
|
|
1467
1468
|
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];
|
|
1468
1469
|
return e ?? "";
|
|
1469
1470
|
}
|
|
1470
1471
|
set value(e) {
|
|
1471
|
-
var
|
|
1472
|
+
var s = parseInt(t(this, p).dataset.row);
|
|
1472
1473
|
const r = this.getAttribute("update-row-state") != "false";
|
|
1473
|
-
|
|
1474
|
+
s < 0 ? t(this, C).data.setValueNF(parseInt(t(this, p).dataset.index), t(this, p).dataset.bind, e, r) : t(this, C).data.setValue(s, t(this, p).dataset.bind, e, r);
|
|
1474
1475
|
}
|
|
1475
1476
|
get row() {
|
|
1476
1477
|
return parseInt(t(this, p).dataset.row);
|
|
@@ -1479,10 +1480,10 @@ const ze = class ze extends me {
|
|
|
1479
1480
|
return t(this, p).closest("tr").data;
|
|
1480
1481
|
}
|
|
1481
1482
|
refresh() {
|
|
1482
|
-
return t(this, p).dataset.bind, parseInt(t(this, p).dataset.row), t(this,
|
|
1483
|
+
return t(this, p).dataset.bind, parseInt(t(this, p).dataset.row), t(this, Ht).data, t(this, p).dataset.row;
|
|
1483
1484
|
}
|
|
1484
1485
|
};
|
|
1485
|
-
C = new WeakMap(),
|
|
1486
|
+
C = new WeakMap(), Ht = new WeakMap(), p = new WeakMap(), Ae = new WeakMap(), Re = new WeakMap(), qe = new WeakMap(), ke = new WeakMap(), Te = new WeakMap(), h(ze, "CellElement");
|
|
1486
1487
|
let xe = ze;
|
|
1487
1488
|
const De = class De extends xe {
|
|
1488
1489
|
constructor() {
|
|
@@ -1497,19 +1498,19 @@ const De = class De extends xe {
|
|
|
1497
1498
|
};
|
|
1498
1499
|
h(De, "EditableCellElement");
|
|
1499
1500
|
let ve = De;
|
|
1500
|
-
var
|
|
1501
|
+
var Mt, nt, gt, bt, ne, U, Ce;
|
|
1501
1502
|
const Pe = class Pe extends ve {
|
|
1502
1503
|
constructor() {
|
|
1503
1504
|
super();
|
|
1504
|
-
d(this,
|
|
1505
|
+
d(this, Mt);
|
|
1505
1506
|
d(this, nt);
|
|
1507
|
+
d(this, gt);
|
|
1506
1508
|
d(this, bt);
|
|
1507
|
-
d(this, yt);
|
|
1508
1509
|
d(this, ne);
|
|
1509
1510
|
d(this, U);
|
|
1510
1511
|
A(this, "refresh", /* @__PURE__ */ h(() => {
|
|
1511
1512
|
const e = super.refresh();
|
|
1512
|
-
t(this,
|
|
1513
|
+
P.log("::", e), t(this, Mt).value = e;
|
|
1513
1514
|
}, "refresh"));
|
|
1514
1515
|
/**
|
|
1515
1516
|
dataRefresh = (v) => {
|
|
@@ -1545,31 +1546,31 @@ const Pe = class Pe extends ve {
|
|
|
1545
1546
|
if (!["Escape", "Enter", "Tab", "Home", "End", "ArrowLeft", "ArrowRight", "PageUp", "PageDown", "Backspace", "Delete"].includes(e.code)) {
|
|
1546
1547
|
if (t(this, nt) == "number") {
|
|
1547
1548
|
let n = [];
|
|
1548
|
-
if (t(this, U) && Number(t(this, U)) > 0 && n.push("."), t(this,
|
|
1549
|
-
var
|
|
1549
|
+
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) {
|
|
1550
|
+
var s = e.target.value, r = s.indexOf(".");
|
|
1550
1551
|
if (r >= 0) {
|
|
1551
|
-
var
|
|
1552
|
-
|
|
1552
|
+
var s = s.substr(r + 1, s.length);
|
|
1553
|
+
s.length >= Number(t(this, U)) && e.preventDefault();
|
|
1553
1554
|
}
|
|
1554
1555
|
}
|
|
1555
1556
|
}
|
|
1556
|
-
t(this,
|
|
1557
|
+
t(this, gt) && ninegrid.getByteLength(e.target.value) >= Number(t(this, gt)) && e.target.selectionStart == e.target.selectionEnd && e.preventDefault();
|
|
1557
1558
|
}
|
|
1558
1559
|
}, "#onKeyDown"));
|
|
1559
|
-
if (this.applyBaseStyle(), y(this, nt, this.getAttribute("type") || "text"), y(this,
|
|
1560
|
+
if (this.applyBaseStyle(), y(this, nt, this.getAttribute("type") || "text"), y(this, gt, this.getAttribute("maxbyte")), y(this, bt, this.getAttribute("min")), y(this, ne, this.getAttribute("max")), y(this, U, this.getAttribute("scale")), !["text", "number"].includes(t(this, nt))) throw `invalid type : ${t(this, nt)}`;
|
|
1560
1561
|
}
|
|
1561
1562
|
connectedCallback() {
|
|
1562
|
-
for (var e = [],
|
|
1563
|
-
["type", "maxlength", "maxbyte", "min", "max", "step", "scale", "text-align"].includes(this.attributes[
|
|
1563
|
+
for (var e = [], s = 0; s < this.attributes.length; s++)
|
|
1564
|
+
["type", "maxlength", "maxbyte", "min", "max", "step", "scale", "text-align"].includes(this.attributes[s].name) && e.push(`${this.attributes[s].name}="${this.attributes[s].value}"`);
|
|
1564
1565
|
this.innerHTML = `
|
|
1565
1566
|
<input type="text"
|
|
1566
1567
|
${e.join(" ")}
|
|
1567
1568
|
ondragstart="return false;"
|
|
1568
1569
|
>
|
|
1569
|
-
`, super.connectedCallback(), y(this,
|
|
1570
|
+
`, super.connectedCallback(), y(this, Mt, this.querySelector("input"));
|
|
1570
1571
|
}
|
|
1571
1572
|
};
|
|
1572
|
-
|
|
1573
|
+
Mt = new WeakMap(), nt = new WeakMap(), gt = new WeakMap(), bt = new WeakMap(), ne = new WeakMap(), U = new WeakMap(), Ce = new WeakMap(), h(Pe, "CellInputText");
|
|
1573
1574
|
let we = Pe;
|
|
1574
1575
|
customElements.get("cell-input-text");
|
|
1575
1576
|
customElements.get("cell-input") || customElements.define("cell-input", we);
|