@ninebone/table 0.0.495 β 0.0.497
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 +369 -370
- package/dist/nine-table.js.map +1 -1
- package/dist/nine-table.umd.js +5 -5
- package/dist/nine-table.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/nine-table.js
CHANGED
|
@@ -2,16 +2,16 @@ var je = Object.defineProperty;
|
|
|
2
2
|
var Fe = (R) => {
|
|
3
3
|
throw TypeError(R);
|
|
4
4
|
};
|
|
5
|
-
var Ue = (R,
|
|
6
|
-
var h = (R,
|
|
7
|
-
var A = (R,
|
|
8
|
-
var t = (R,
|
|
9
|
-
var Ye = (R,
|
|
5
|
+
var Ue = (R, s, e) => s in R ? je(R, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : R[s] = e;
|
|
6
|
+
var h = (R, s) => je(R, "name", { value: s, configurable: !0 });
|
|
7
|
+
var A = (R, s, e) => Ue(R, typeof s != "symbol" ? s + "" : s, e), Ve = (R, s, e) => s.has(R) || Fe("Cannot " + e);
|
|
8
|
+
var t = (R, s, e) => (Ve(R, s, "read from private field"), e ? e.call(R) : s.get(R)), d = (R, s, e) => s.has(R) ? Fe("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(R) : s.set(R, e), y = (R, s, e, i) => (Ve(R, s, "write to private field"), i ? i.call(R, e) : s.set(R, e), e);
|
|
9
|
+
var Ye = (R, s, e, i) => ({
|
|
10
10
|
set _(r) {
|
|
11
|
-
y(R,
|
|
11
|
+
y(R, s, r, e);
|
|
12
12
|
},
|
|
13
13
|
get _() {
|
|
14
|
-
return t(R,
|
|
14
|
+
return t(R, s, i);
|
|
15
15
|
}
|
|
16
16
|
});
|
|
17
17
|
import { trace as Xe } from "@ninebone/util";
|
|
@@ -42,36 +42,36 @@ 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, i = e.querySelector("table");
|
|
46
|
+
if (!i) return;
|
|
47
|
+
const r = t(this, w).track, n = t(this, w).thumb, o = t(this, B).querySelector(".ng-container-bottom"), a = e.clientWidth, c = i.scrollWidth;
|
|
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
|
|
55
|
-
if (
|
|
56
|
-
const f = Math.max(Math.min(
|
|
54
|
+
const l = r.clientWidth;
|
|
55
|
+
if (l <= 0) return;
|
|
56
|
+
const f = Math.max(Math.min(l * (a / c), l), 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, b = c - a;
|
|
59
|
+
let g = 0;
|
|
60
|
+
b > 0 && (g = parseInt(u / b * (l - f), 10)), g < 0 && (g = 0);
|
|
61
|
+
const m = l - f;
|
|
62
|
+
g > m && (g = m), n.style.left = `${g}px`, t(this, w).left.disabled = g === 0, t(this, w).right.disabled = g >= 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 i = t(this, w).container, r = i.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 c = n.width - o;
|
|
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 = i.clientWidth, u = r.scrollWidth - l;
|
|
74
|
+
return c > 0 && u > 0 && (i.scrollLeft = a / c * u), a > 0 && a < c - 1;
|
|
75
75
|
}, "#thumbMoveTo"));
|
|
76
76
|
d(this, _t, /* @__PURE__ */ h(() => {
|
|
77
77
|
const e = /* @__PURE__ */ h((r) => {
|
|
@@ -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"), i = /* @__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, i), t(this, w).right.addEventListener(r, i), t(this, w).track.addEventListener(r, i);
|
|
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 c = t(this, w).track.getBoundingClientRect();
|
|
106
|
+
t(this, G).call(this, a.clientX - c.left - this.shiftX);
|
|
107
107
|
}, "onMouseMove"), o = /* @__PURE__ */ h(() => {
|
|
108
|
-
y(this, j, !1),
|
|
108
|
+
y(this, j, !1), i(), 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,18 +177,18 @@ 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 i = t(this, B).querySelector(".ng-container-body .ng-part-body");
|
|
181
|
+
if (!i) {
|
|
182
182
|
setTimeout(e, 10);
|
|
183
183
|
return;
|
|
184
184
|
}
|
|
185
185
|
y(this, w, {
|
|
186
|
-
container:
|
|
186
|
+
container: i,
|
|
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
|
+
}), i.addEventListener("scroll", () => {
|
|
192
192
|
t(this, j) || this.refresh();
|
|
193
193
|
}), t(this, _t).call(this), t(this, It).call(this), this.refresh();
|
|
194
194
|
}, "initWhenReady");
|
|
@@ -213,24 +213,24 @@ const Me = class Me extends HTMLElement {
|
|
|
213
213
|
d(this, vt, 0);
|
|
214
214
|
A(this, "refresh", /* @__PURE__ */ h(() => {
|
|
215
215
|
if (!t(this, F) || !t(this, q)) return;
|
|
216
|
-
const e = t(this, q).container,
|
|
217
|
-
if (
|
|
216
|
+
const e = t(this, q).container, i = t(this, q).track, r = t(this, q).thumb, n = e.clientHeight, a = (t(this, F).data.get() || []).length, c = t(this, ot).getRowHeight(), l = a * c;
|
|
217
|
+
if (l <= n) {
|
|
218
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 = i.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 / l), f), 20);
|
|
225
225
|
r.style.height = `${u}px`;
|
|
226
|
-
const
|
|
226
|
+
const b = e.scrollTop, g = Math.max(l - n, 1);
|
|
227
227
|
let m = 0;
|
|
228
|
-
|
|
228
|
+
g > 0 && (m = b / g * (f - u));
|
|
229
229
|
const v = f - u;
|
|
230
|
-
m < 0 && (m = 0), m > v && (m = v), r.style.top = `${m}px`, t(this, q).top.disabled =
|
|
230
|
+
m < 0 && (m = 0), m > v && (m = v), r.style.top = `${m}px`, t(this, q).top.disabled = b <= 0, t(this, q).bottom.disabled = b >= g - 1;
|
|
231
231
|
}, "refresh"));
|
|
232
232
|
d(this, Nt, /* @__PURE__ */ h(() => {
|
|
233
|
-
const e = t(this, q).container,
|
|
233
|
+
const e = t(this, q).container, i = /* @__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");
|
|
@@ -241,11 +241,11 @@ const Me = class Me extends HTMLElement {
|
|
|
241
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 c = t(this, q).track.getBoundingClientRect(), l = t(this, q).thumb.clientHeight, u = c.height - l, b = a.clientY - t(this, xt), g = e.clientHeight, m = i(), v = Math.max(m - g, 1);
|
|
245
245
|
if (u > 0 && v > 0) {
|
|
246
|
-
const
|
|
247
|
-
let x = t(this, vt) +
|
|
248
|
-
const H = Math.max(0, m -
|
|
246
|
+
const S = b / u * v;
|
|
247
|
+
let x = t(this, vt) + S;
|
|
248
|
+
const H = Math.max(0, m - g);
|
|
249
249
|
x < 0 && (x = 0), x > H && (x = H), e.scrollTop = x;
|
|
250
250
|
}
|
|
251
251
|
this.refresh();
|
|
@@ -255,10 +255,10 @@ const Me = class Me extends HTMLElement {
|
|
|
255
255
|
document.addEventListener("mousemove", n), document.addEventListener("mouseup", o);
|
|
256
256
|
}), t(this, q).track.addEventListener("mousedown", (r) => {
|
|
257
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,
|
|
259
|
-
if (
|
|
260
|
-
const
|
|
261
|
-
e.scrollTop =
|
|
258
|
+
const n = t(this, q).track.getBoundingClientRect(), o = t(this, q).thumb.clientHeight, a = r.clientY - n.top - o / 2, l = n.height - o, f = e.clientHeight, u = i(), b = Math.max(u - f, 1);
|
|
259
|
+
if (l > 0 && b > 0) {
|
|
260
|
+
const g = Math.max(0, Math.min(1, a / l));
|
|
261
|
+
e.scrollTop = g * b;
|
|
262
262
|
}
|
|
263
263
|
this.refresh();
|
|
264
264
|
}), t(this, q).top.addEventListener("click", () => {
|
|
@@ -334,13 +334,13 @@ 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 i = t(this, F).shadowRoot.querySelector(".ng-container-body .ng-part-body");
|
|
338
|
+
if (!i) {
|
|
339
339
|
setTimeout(e, 10);
|
|
340
340
|
return;
|
|
341
341
|
}
|
|
342
342
|
y(this, q, {
|
|
343
|
-
container:
|
|
343
|
+
container: i,
|
|
344
344
|
track: this.querySelector(".ng-scroll-track"),
|
|
345
345
|
thumb: this.querySelector(".ng-scroll-thumb"),
|
|
346
346
|
top: this.querySelector(".ng-scroll-top"),
|
|
@@ -353,11 +353,11 @@ const Me = class Me extends HTMLElement {
|
|
|
353
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,
|
|
356
|
+
var D, E, 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(s) {
|
|
359
359
|
d(this, D);
|
|
360
|
-
d(this,
|
|
360
|
+
d(this, E);
|
|
361
361
|
d(this, z, /* @__PURE__ */ new Map());
|
|
362
362
|
d(this, M, null);
|
|
363
363
|
d(this, V, null);
|
|
@@ -368,76 +368,75 @@ const $e = class $e {
|
|
|
368
368
|
d(this, Wt, 3);
|
|
369
369
|
A(this, "refresh", /* @__PURE__ */ h(() => {
|
|
370
370
|
P.log("rowManager.refresh");
|
|
371
|
-
const
|
|
372
|
-
|
|
371
|
+
const s = t(this, E).querySelector(".ng-container-body .ng-part-body");
|
|
372
|
+
s && (t(this, St).call(this), t(this, lt).call(this, s.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
|
-
const a = t(this,
|
|
376
|
+
const a = t(this, E).querySelector(o);
|
|
377
377
|
if (!a) return;
|
|
378
|
-
const
|
|
379
|
-
if (!l) return;
|
|
380
|
-
const c = l.querySelector("tbody.bindable-tbody");
|
|
378
|
+
const c = a.querySelector(".ng-part-body table");
|
|
381
379
|
if (!c) return;
|
|
382
|
-
const
|
|
380
|
+
const l = c.querySelector("tbody.bindable-tbody");
|
|
381
|
+
if (!l) return;
|
|
382
|
+
const u = Array.from(l.querySelectorAll("tr")).map((b) => b.cloneNode(!0));
|
|
383
383
|
t(this, z).set(o, u);
|
|
384
384
|
});
|
|
385
|
-
const
|
|
386
|
-
if (
|
|
387
|
-
t(this, Bt).call(this,
|
|
385
|
+
const s = t(this, E).querySelector(".ng-container-body .ng-part-body"), e = t(this, E).querySelector(".ng-container-left .ng-part-body"), i = t(this, E).querySelector(".ng-container-right .ng-part-body"), r = t(this, E).querySelector(".ng-container-body .ng-part-header"), n = t(this, E).querySelector(".ng-container-body .ng-part-footer");
|
|
386
|
+
if (s) {
|
|
387
|
+
t(this, Bt).call(this, s), t(this, At).call(this), t(this, St).call(this), t(this, lt).call(this, s.scrollTop);
|
|
388
388
|
let o = !1;
|
|
389
|
-
const a = /* @__PURE__ */ h((
|
|
389
|
+
const a = /* @__PURE__ */ h((c, l, f) => {
|
|
390
390
|
var u;
|
|
391
|
-
o || (o = !0,
|
|
391
|
+
o || (o = !0, s && s.scrollTop !== c && (s.scrollTop = c), e && e.scrollTop !== c && (e.scrollTop = c), i && i.scrollTop !== c && (i.scrollTop = c), r && r.scrollLeft !== l && (r.scrollLeft = l), n && n.scrollLeft !== l && (n.scrollLeft = l), t(this, lt).call(this, c), (u = t(this, E).querySelector("nine-table-vscrollbar")) == null || u.refresh(), o = !1);
|
|
392
392
|
}, "syncScroll");
|
|
393
|
-
[
|
|
394
|
-
|
|
393
|
+
[s, e, i].forEach((c) => {
|
|
394
|
+
c && c.addEventListener("scroll", () => {
|
|
395
395
|
t(this, at) || (y(this, at, !0), requestAnimationFrame(() => {
|
|
396
|
-
a(
|
|
396
|
+
a(c.scrollTop, c.scrollLeft), y(this, at, !1);
|
|
397
397
|
}));
|
|
398
398
|
});
|
|
399
399
|
});
|
|
400
400
|
}
|
|
401
401
|
}, "initialize"));
|
|
402
|
-
d(this, Ot, /* @__PURE__ */ h((
|
|
403
|
-
const
|
|
404
|
-
if (!
|
|
405
|
-
const r =
|
|
402
|
+
d(this, Ot, /* @__PURE__ */ h((s, e) => {
|
|
403
|
+
const i = t(this, z).get(e);
|
|
404
|
+
if (!i || i.length === 0) return;
|
|
405
|
+
const r = s.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
|
-
|
|
412
|
-
u.dataset.row = g, o.appendChild(u);
|
|
407
|
+
r.querySelectorAll("tr:not(.nodata)").forEach((a) => a.remove());
|
|
408
|
+
const n = r.querySelector("tr.nodata"), o = document.createDocumentFragment();
|
|
409
|
+
for (let a = 0; a < t(this, wt); a++)
|
|
410
|
+
i.forEach((c) => {
|
|
411
|
+
o.appendChild(c.cloneNode(!0));
|
|
413
412
|
});
|
|
414
413
|
n ? n.before(o) : r.appendChild(o);
|
|
415
414
|
}, "#renderRows"));
|
|
416
|
-
d(this, Bt, /* @__PURE__ */ h((
|
|
415
|
+
d(this, Bt, /* @__PURE__ */ h((s) => {
|
|
417
416
|
if (t(this, M) !== null && t(this, M) > 0)
|
|
418
417
|
return t(this, M);
|
|
419
418
|
P.log("#measureAndCacheHeight");
|
|
420
419
|
const e = t(this, z).get(".ng-container-body");
|
|
421
420
|
if (!e || e.length === 0) return 24;
|
|
422
|
-
const
|
|
423
|
-
if (!
|
|
424
|
-
|
|
425
|
-
const r =
|
|
426
|
-
e.forEach((
|
|
427
|
-
n.appendChild(
|
|
428
|
-
}), r ? r.before(n) :
|
|
429
|
-
const o = t(this,
|
|
421
|
+
const i = s.querySelector("tbody.bindable-tbody");
|
|
422
|
+
if (!i) return 24;
|
|
423
|
+
i.querySelectorAll("tr:not(.nodata)").forEach((b) => b.remove());
|
|
424
|
+
const r = i.querySelector("tr.nodata"), n = document.createDocumentFragment();
|
|
425
|
+
e.forEach((b) => {
|
|
426
|
+
n.appendChild(b.cloneNode(!0));
|
|
427
|
+
}), r ? r.before(n) : i.appendChild(n);
|
|
428
|
+
const o = t(this, E), a = o.style.display, c = o.style.visibility, l = o.style.position;
|
|
430
429
|
(a === "none" || window.getComputedStyle(o).display === "none") && (o.style.display = "block", o.style.visibility = "hidden", o.style.position = "absolute");
|
|
431
430
|
let f = 0;
|
|
432
|
-
const u =
|
|
433
|
-
return u.forEach((
|
|
434
|
-
f +=
|
|
435
|
-
}), u.forEach((
|
|
431
|
+
const u = i.querySelectorAll("tr:not(.nodata)");
|
|
432
|
+
return u.forEach((b) => {
|
|
433
|
+
f += b.offsetHeight || b.getBoundingClientRect().height;
|
|
434
|
+
}), u.forEach((b) => b.remove()), o.style.display = a, o.style.visibility = c, o.style.position = l, y(this, M, f > 0 ? f : 24), t(this, Et).call(this), t(this, M);
|
|
436
435
|
}, "#measureAndCacheHeight"));
|
|
437
436
|
d(this, St, /* @__PURE__ */ h(() => {
|
|
438
|
-
const e = (t(this, D).data.get() || []).length,
|
|
437
|
+
const e = (t(this, D).data.get() || []).length, i = t(this, M), r = e * i;
|
|
439
438
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((n) => {
|
|
440
|
-
const o = t(this,
|
|
439
|
+
const o = t(this, E).querySelector(n);
|
|
441
440
|
if (!o) return;
|
|
442
441
|
const a = o.querySelector(".ng-part-body .ng-virtual-spacer");
|
|
443
442
|
a && (a.style.height = `${r}px`);
|
|
@@ -445,101 +444,101 @@ const $e = class $e {
|
|
|
445
444
|
}, "#updateVirtualScrollHeight"));
|
|
446
445
|
d(this, Et, /* @__PURE__ */ h(() => {
|
|
447
446
|
if (t(this, Q) > 0 && t(this, M) > 0) {
|
|
448
|
-
const
|
|
449
|
-
y(this, wt,
|
|
447
|
+
const s = Math.ceil(t(this, Q) / t(this, M));
|
|
448
|
+
y(this, wt, s + t(this, Wt));
|
|
450
449
|
}
|
|
451
450
|
}, "#updateRowCount"));
|
|
452
451
|
d(this, zt, /* @__PURE__ */ h(() => {
|
|
453
|
-
var a,
|
|
454
|
-
const
|
|
452
|
+
var a, c, l, f, u, b;
|
|
453
|
+
const s = t(this, E).querySelector(".ng-container-left .ng-part-body table"), e = t(this, E).querySelector(".ng-container-body .ng-part-body table"), i = t(this, E).querySelector(".ng-container-right .ng-part-body table");
|
|
455
454
|
if (e) {
|
|
456
|
-
const
|
|
457
|
-
for (let x = 0; x <
|
|
455
|
+
const g = s ? Array.from(s.querySelectorAll("tbody tr")) : [], m = Array.from(e.querySelectorAll("tbody tr")), v = i ? Array.from(i.querySelectorAll("tbody tr")) : [], S = Math.max(g.length, m.length, v.length);
|
|
456
|
+
for (let x = 0; x < S; x++) {
|
|
458
457
|
const H = [
|
|
459
|
-
((a =
|
|
460
|
-
((
|
|
461
|
-
((
|
|
458
|
+
((a = g[x]) == null ? void 0 : a.getBoundingClientRect().height) || 0,
|
|
459
|
+
((c = m[x]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
|
|
460
|
+
((l = v[x]) == null ? void 0 : l.getBoundingClientRect().height) || 0
|
|
462
461
|
], k = Math.max(...H);
|
|
463
|
-
k > 0 && (
|
|
462
|
+
k > 0 && (g[x] && (g[x].style.height = `${k}px`), m[x] && (m[x].style.height = `${k}px`), v[x] && (v[x].style.height = `${k}px`));
|
|
464
463
|
}
|
|
465
464
|
}
|
|
466
|
-
const r = t(this,
|
|
465
|
+
const r = t(this, E).querySelector(".ng-container-left .ng-part-footer table"), n = t(this, E).querySelector(".ng-container-body .ng-part-footer table"), o = t(this, E).querySelector(".ng-container-right .ng-part-footer table");
|
|
467
466
|
if (n) {
|
|
468
|
-
const
|
|
469
|
-
for (let x = 0; x <
|
|
467
|
+
const g = r ? Array.from(r.querySelectorAll("tfoot tr")) : [], m = Array.from(n.querySelectorAll("tfoot tr")), v = o ? Array.from(o.querySelectorAll("tfoot tr")) : [], S = Math.max(g.length, m.length, v.length);
|
|
468
|
+
for (let x = 0; x < S; x++) {
|
|
470
469
|
const H = [
|
|
471
|
-
((f =
|
|
470
|
+
((f = g[x]) == null ? void 0 : f.getBoundingClientRect().height) || 0,
|
|
472
471
|
((u = m[x]) == null ? void 0 : u.getBoundingClientRect().height) || 0,
|
|
473
|
-
((
|
|
472
|
+
((b = v[x]) == null ? void 0 : b.getBoundingClientRect().height) || 0
|
|
474
473
|
], k = Math.max(...H);
|
|
475
|
-
k > 0 && (
|
|
474
|
+
k > 0 && (g[x] && (g[x].style.height = `${k}px`), m[x] && (m[x].style.height = `${k}px`), v[x] && (v[x].style.height = `${k}px`));
|
|
476
475
|
}
|
|
477
476
|
}
|
|
478
477
|
}, "#syncRowHeights"));
|
|
479
478
|
d(this, Dt, /* @__PURE__ */ h(() => {
|
|
480
|
-
!t(this,
|
|
481
|
-
for (const e of
|
|
482
|
-
const
|
|
483
|
-
if (!
|
|
479
|
+
!t(this, E) || !(t(this, E) instanceof HTMLElement) || (y(this, V, new ResizeObserver((s) => {
|
|
480
|
+
for (const e of s) {
|
|
481
|
+
const i = e.target;
|
|
482
|
+
if (!i.classList.contains("active")) continue;
|
|
484
483
|
const r = e.contentRect.height;
|
|
485
484
|
if (r > 0) {
|
|
486
485
|
let n = 0;
|
|
487
|
-
const o =
|
|
486
|
+
const o = i.querySelector(".ng-part-header"), a = i.querySelector(".ng-part-footer");
|
|
488
487
|
o && (n += o.offsetHeight), a && (n += a.offsetHeight);
|
|
489
|
-
const
|
|
490
|
-
t(this, Q) !==
|
|
488
|
+
const c = Math.max(r - n, 100);
|
|
489
|
+
t(this, Q) !== c && (y(this, Q, c), t(this, Et).call(this), t(this, M) !== null && t(this, At).call(this));
|
|
491
490
|
}
|
|
492
491
|
}
|
|
493
|
-
})), t(this, V).observe(t(this,
|
|
492
|
+
})), t(this, V).observe(t(this, E)));
|
|
494
493
|
}, "#initResizeObserver"));
|
|
495
494
|
d(this, At, /* @__PURE__ */ h(() => {
|
|
496
|
-
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((
|
|
497
|
-
const e = t(this,
|
|
498
|
-
e && e.querySelector(".ng-part-body tbody.bindable-tbody") && t(this, Ot).call(this, e,
|
|
495
|
+
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((s) => {
|
|
496
|
+
const e = t(this, E).querySelector(s);
|
|
497
|
+
e && e.querySelector(".ng-part-body tbody.bindable-tbody") && t(this, Ot).call(this, e, s);
|
|
499
498
|
}), t(this, Pt).call(this), t(this, zt).call(this);
|
|
500
499
|
}, "#renderAllContainers"));
|
|
501
|
-
d(this, Ee, /* @__PURE__ */ h((
|
|
500
|
+
d(this, Ee, /* @__PURE__ */ h((s) => {
|
|
502
501
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((e) => {
|
|
503
|
-
var
|
|
504
|
-
const
|
|
505
|
-
if (!
|
|
506
|
-
const r =
|
|
502
|
+
var l;
|
|
503
|
+
const i = t(this, E).querySelector(e);
|
|
504
|
+
if (!i) return;
|
|
505
|
+
const r = i.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
507
506
|
if (!r) return;
|
|
508
|
-
const n = Array.from(r.querySelectorAll("tr:not(.nodata)")), o = ((
|
|
507
|
+
const n = Array.from(r.querySelectorAll("tr:not(.nodata)")), o = ((l = t(this, z).get(e)) == null ? void 0 : l.length) || 1, c = (t(this, D).data.get() || []).length;
|
|
509
508
|
n.forEach((f, u) => {
|
|
510
|
-
const
|
|
511
|
-
if (
|
|
509
|
+
const b = s + Math.floor(u / o);
|
|
510
|
+
if (b >= c) {
|
|
512
511
|
f.style.display = "none";
|
|
513
512
|
return;
|
|
514
513
|
}
|
|
515
|
-
const
|
|
516
|
-
f.style.display = "", t(this, Rt).call(this, f,
|
|
514
|
+
const g = t(this, D).data.get(b);
|
|
515
|
+
f.style.display = "", t(this, Rt).call(this, f, g, b);
|
|
517
516
|
});
|
|
518
517
|
});
|
|
519
518
|
}, "#adjustBufferRows"));
|
|
520
|
-
d(this, lt, /* @__PURE__ */ h((
|
|
519
|
+
d(this, lt, /* @__PURE__ */ h((s) => {
|
|
521
520
|
var u;
|
|
522
521
|
const e = t(this, M);
|
|
523
522
|
if (!e || e <= 0) return;
|
|
524
|
-
const r = (t(this, D).data.get() || []).length, n = Math.max(0, Math.floor(
|
|
525
|
-
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((
|
|
526
|
-
const
|
|
527
|
-
if (!
|
|
528
|
-
const m =
|
|
523
|
+
const r = (t(this, D).data.get() || []).length, n = Math.max(0, Math.floor(s / e)), o = n * e, a = ((u = t(this, z).get(".ng-container-body")) == null ? void 0 : u.length) || 1, c = t(this, E).querySelector(".ng-container-body"), l = c == null ? void 0 : c.querySelector(".ng-part-body tbody.bindable-tbody tr:not(.nodata)"), f = l && l.dataset.row !== void 0 ? parseInt(l.dataset.row, 10) : -1;
|
|
524
|
+
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((b) => {
|
|
525
|
+
const g = t(this, E).querySelector(b);
|
|
526
|
+
if (!g) return;
|
|
527
|
+
const m = g.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
529
528
|
m && (m.style.transform = `translateY(${o}px)`);
|
|
530
|
-
}), P.log("#handleScroll", f, n), f !== n && [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((
|
|
531
|
-
const
|
|
532
|
-
if (!
|
|
533
|
-
const m =
|
|
529
|
+
}), P.log("#handleScroll", f, n), f !== n && [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((b) => {
|
|
530
|
+
const g = t(this, E).querySelector(b);
|
|
531
|
+
if (!g) return;
|
|
532
|
+
const m = g.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
534
533
|
if (!m) return;
|
|
535
|
-
Array.from(m.querySelectorAll("tr:not(.nodata)")).forEach((
|
|
534
|
+
Array.from(m.querySelectorAll("tr:not(.nodata)")).forEach((S, x) => {
|
|
536
535
|
const H = n + Math.floor(x / a);
|
|
537
536
|
if (H >= r) {
|
|
538
|
-
|
|
537
|
+
S.style.display = "none";
|
|
539
538
|
return;
|
|
540
539
|
}
|
|
541
540
|
const k = t(this, D).data.get(H);
|
|
542
|
-
|
|
541
|
+
S.data = k, S.style.display = "", t(this, Rt).call(this, S, k, H);
|
|
543
542
|
});
|
|
544
543
|
});
|
|
545
544
|
}, "#handleScroll"));
|
|
@@ -557,114 +556,114 @@ const $e = class $e {
|
|
|
557
556
|
cell.dataset.row = dataIndex;
|
|
558
557
|
});
|
|
559
558
|
}; */
|
|
560
|
-
d(this, Rt, /* @__PURE__ */ h((
|
|
561
|
-
|
|
562
|
-
r.dataset.row =
|
|
559
|
+
d(this, Rt, /* @__PURE__ */ h((s, e, i) => {
|
|
560
|
+
s.dataset.row = i, s.data = e, Array.from(s.cells).forEach((r, n) => {
|
|
561
|
+
r.dataset.row = i;
|
|
563
562
|
const o = Array.from(r.children).find((a) => a.tagName.toLowerCase().startsWith("cell-") || typeof a.refresh == "function");
|
|
564
563
|
o && typeof o.refresh == "function" && o.refresh();
|
|
565
564
|
});
|
|
566
565
|
}, "#bindRowData"));
|
|
567
566
|
d(this, Pt, /* @__PURE__ */ h(() => {
|
|
568
|
-
var
|
|
569
|
-
const
|
|
567
|
+
var c, l, f;
|
|
568
|
+
const s = t(this, E).querySelector(".ng-container-left .ng-part-header table"), e = t(this, E).querySelector(".ng-container-body .ng-part-header table"), i = t(this, E).querySelector(".ng-container-right .ng-part-header table");
|
|
570
569
|
if (!e) return;
|
|
571
|
-
const r =
|
|
570
|
+
const r = s ? Array.from(s.querySelectorAll("tr")) : [], n = Array.from(e.querySelectorAll("tr")), o = i ? Array.from(i.querySelectorAll("tr")) : [], a = Math.max(r.length, n.length, o.length);
|
|
572
571
|
for (let u = 0; u < a; u++) {
|
|
573
|
-
const
|
|
574
|
-
((
|
|
575
|
-
((
|
|
572
|
+
const b = [
|
|
573
|
+
((c = r[u]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
|
|
574
|
+
((l = n[u]) == null ? void 0 : l.getBoundingClientRect().height) || 0,
|
|
576
575
|
((f = o[u]) == null ? void 0 : f.getBoundingClientRect().height) || 0
|
|
577
|
-
],
|
|
578
|
-
|
|
576
|
+
], g = Math.max(...b);
|
|
577
|
+
g > 0 && (r[u] && (r[u].style.height = `${g}px`), n[u] && (n[u].style.height = `${g}px`), o[u] && (o[u].style.height = `${g}px`));
|
|
579
578
|
}
|
|
580
579
|
}, "#syncHeaderHeights"));
|
|
581
580
|
A(this, "destroy", /* @__PURE__ */ h(() => {
|
|
582
581
|
t(this, V) && (t(this, V).disconnect(), y(this, V, null));
|
|
583
582
|
}, "destroy"));
|
|
584
|
-
y(this, D,
|
|
583
|
+
y(this, D, s.getRootNode().host), y(this, E, s), t(this, Dt).call(this);
|
|
585
584
|
}
|
|
586
585
|
getRowHeight() {
|
|
587
586
|
return t(this, M);
|
|
588
587
|
}
|
|
589
|
-
templateLength(
|
|
588
|
+
templateLength(s = ".ng-container-body") {
|
|
590
589
|
var e;
|
|
591
|
-
return ((e = t(this, z).get(
|
|
590
|
+
return ((e = t(this, z).get(s)) == null ? void 0 : e.length) || 1;
|
|
592
591
|
}
|
|
593
592
|
};
|
|
594
|
-
D = new WeakMap(),
|
|
593
|
+
D = new WeakMap(), E = 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");
|
|
595
594
|
let ce = $e;
|
|
596
595
|
const jt = class jt {
|
|
597
596
|
/**
|
|
598
597
|
* π― λ μ΄μμ λ΄μ μ¬λ¬ rawTables λ°°μ΄μ μΌκ΄λ‘ λ°μ λ¨μΌ λ§μ€ν° ν
νλ¦ΏμΌλ‘ μ¬μ μ»΄νμΌν©λλ€.
|
|
599
598
|
*/
|
|
600
|
-
static compileAll(
|
|
601
|
-
return Array.isArray(
|
|
599
|
+
static compileAll(s) {
|
|
600
|
+
return Array.isArray(s) ? s.map((e) => jt.compile(e)) : [];
|
|
602
601
|
}
|
|
603
602
|
/**
|
|
604
603
|
* π― λ¨μΌ μλ³Έ ν
μ΄λΈμ λ°μ κΈ°λ³Έ ꡬ쑰 보μ λ° 2μ°¨μ 격μ μΈλ±μ€ μ¬μ λΆμ¬ μλ£λ λ§μ€ν° ν
μ΄λΈ λ°ν
|
|
605
604
|
*/
|
|
606
|
-
static compile(
|
|
607
|
-
if (!
|
|
605
|
+
static compile(s) {
|
|
606
|
+
if (!s) return null;
|
|
608
607
|
const e = /* @__PURE__ */ h((a) => {
|
|
609
|
-
a.querySelectorAll("tbody td, tbody th, tfoot td, tfoot th").forEach((
|
|
610
|
-
const f =
|
|
611
|
-
if (
|
|
608
|
+
a.querySelectorAll("tbody td, tbody th, tfoot td, tfoot th").forEach((l) => {
|
|
609
|
+
const f = l.getAttribute("cell-type") || "renderer";
|
|
610
|
+
if (l.children.length > 0 && l.firstElementChild.tagName.includes("-")) return;
|
|
612
611
|
let u = `cell-${f}`;
|
|
613
|
-
const
|
|
614
|
-
let
|
|
615
|
-
|
|
612
|
+
const b = l.getAttribute("data-bind"), g = l.getAttribute("data-expr"), m = l.getAttribute("maxbyte"), v = l.getAttribute("type");
|
|
613
|
+
let S = [];
|
|
614
|
+
b && S.push(`data-bind="${b}"`), g && S.push(`data-expr="${g}"`), m && S.push(`maxbyte="${m}"`), v && S.push(`type="${v}"`), l.innerHTML = `<${u} ${S.join(" ")}></${u}>`;
|
|
616
615
|
});
|
|
617
|
-
}, "processCellTypes"),
|
|
616
|
+
}, "processCellTypes"), i = /* @__PURE__ */ h((a) => {
|
|
618
617
|
if (!a.querySelector("colgroup")) {
|
|
619
|
-
const
|
|
620
|
-
for (let
|
|
621
|
-
const
|
|
622
|
-
|
|
618
|
+
const c = a.querySelector("tbody tr") || a.querySelector("tr"), l = c ? c.querySelectorAll("th, td").length : 1, f = document.createElement("colgroup"), u = Math.max(Math.floor(a.clientWidth / l), 100);
|
|
619
|
+
for (let b = 0; b < l; b++) {
|
|
620
|
+
const g = document.createElement("col");
|
|
621
|
+
g.setAttribute("width", u), f.appendChild(g);
|
|
623
622
|
}
|
|
624
623
|
a.prepend(f);
|
|
625
624
|
}
|
|
626
625
|
if (!a.querySelector("thead")) {
|
|
627
|
-
const
|
|
628
|
-
|
|
626
|
+
const c = document.createElement("thead"), l = a.querySelector("colgroup");
|
|
627
|
+
l ? l.after(c) : a.prepend(c);
|
|
629
628
|
}
|
|
630
629
|
a.classList.add("nine-table-element"), a.style.display = "table";
|
|
631
|
-
}, "ensureTableStructure"), r = /* @__PURE__ */ h((a,
|
|
632
|
-
const
|
|
630
|
+
}, "ensureTableStructure"), r = /* @__PURE__ */ h((a, c) => {
|
|
631
|
+
const l = Array.from(a.querySelectorAll(c + " tr")), f = Array.from(a.querySelectorAll(c + " th," + c + " td")), u = l.length;
|
|
633
632
|
if (u === 0 || f.length === 0) return;
|
|
634
|
-
let
|
|
633
|
+
let b = 0;
|
|
635
634
|
f.forEach((m) => {
|
|
636
|
-
|
|
635
|
+
b += m.colSpan || 1;
|
|
637
636
|
});
|
|
638
|
-
const
|
|
639
|
-
|
|
637
|
+
const g = Array.from(Array(u), () => Array(b).fill(null));
|
|
638
|
+
l.forEach((m) => {
|
|
640
639
|
const v = m.sectionRowIndex;
|
|
641
|
-
let
|
|
640
|
+
let S = 0;
|
|
642
641
|
Array.from(m.querySelectorAll("th,td")).forEach((x) => {
|
|
643
|
-
for (let O = 0; O <
|
|
644
|
-
if (
|
|
645
|
-
|
|
642
|
+
for (let O = 0; O < g[v].length; O++)
|
|
643
|
+
if (g[v][O] === null) {
|
|
644
|
+
S = O;
|
|
646
645
|
break;
|
|
647
646
|
}
|
|
648
647
|
const H = x.rowSpan || 1, k = x.colSpan || 1;
|
|
649
648
|
for (let O = 0; O < H; O++)
|
|
650
649
|
for (let yt = 0; yt < k; yt++)
|
|
651
|
-
v + O < u &&
|
|
650
|
+
v + O < u && S + yt < b && (g[v + O][S + yt] = O === 0 && yt === 0 ? "1" : "0");
|
|
652
651
|
});
|
|
653
|
-
}),
|
|
652
|
+
}), l.forEach((m) => {
|
|
654
653
|
const v = m.sectionRowIndex;
|
|
655
|
-
Array.from(m.querySelectorAll("th,td")).forEach((
|
|
656
|
-
for (let x = 0; x <
|
|
657
|
-
if (
|
|
658
|
-
|
|
654
|
+
Array.from(m.querySelectorAll("th,td")).forEach((S) => {
|
|
655
|
+
for (let x = 0; x < g[v].length; x++)
|
|
656
|
+
if (g[v][x] === "1") {
|
|
657
|
+
S.dataset.col = x, g[v][x] = "0";
|
|
659
658
|
break;
|
|
660
659
|
}
|
|
661
660
|
});
|
|
662
661
|
});
|
|
663
|
-
}, "resetColIndex"), n =
|
|
664
|
-
return
|
|
665
|
-
const
|
|
666
|
-
|
|
667
|
-
f.setAttribute("fixed",
|
|
662
|
+
}, "resetColIndex"), n = s.cloneNode(!0);
|
|
663
|
+
return i(n), e(n), r(n, "thead"), r(n, "tbody"), r(n, "tfoot"), Array.from(n.querySelectorAll("colgroup col")).forEach((a, c) => {
|
|
664
|
+
const l = a.getAttribute("fixed");
|
|
665
|
+
l && n.querySelectorAll(`thead [data-col="${c}"], tbody [data-col="${c}"], tfoot [data-col="${c}"]`).forEach((f) => {
|
|
666
|
+
f.setAttribute("fixed", l);
|
|
668
667
|
});
|
|
669
668
|
}), n;
|
|
670
669
|
}
|
|
@@ -687,63 +686,63 @@ const pt = class pt extends HTMLElement {
|
|
|
687
686
|
{ selector: ".ng-container-body", type: null },
|
|
688
687
|
{ selector: ".ng-container-left", type: "left" },
|
|
689
688
|
{ selector: ".ng-container-right", type: "right" }
|
|
690
|
-
].forEach(({ selector:
|
|
691
|
-
const n = this.querySelector(
|
|
689
|
+
].forEach(({ selector: i, type: r }) => {
|
|
690
|
+
const n = this.querySelector(i);
|
|
692
691
|
if (!n) return;
|
|
693
692
|
n.innerHTML = "";
|
|
694
693
|
const o = document.createElement("div");
|
|
695
694
|
o.className = "ng-part-header", o.appendChild(t(this, ct).call(this, t(this, tt), r, "header"));
|
|
696
695
|
const a = document.createElement("div");
|
|
697
696
|
a.className = "ng-part-body";
|
|
698
|
-
const l = document.createElement("div");
|
|
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
697
|
const c = document.createElement("div");
|
|
701
|
-
c.className = "ng-
|
|
698
|
+
c.className = "ng-scroll-content", c.style.position = "relative", c.style.width = "100%", c.appendChild(t(this, ct).call(this, t(this, tt), r, "body"));
|
|
699
|
+
const l = document.createElement("div");
|
|
700
|
+
l.className = "ng-virtual-spacer", l.style.width = "100%", l.style.pointerEvents = "none", c.appendChild(l), a.appendChild(c);
|
|
702
701
|
const f = document.createElement("div");
|
|
703
702
|
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);
|
|
704
703
|
});
|
|
705
704
|
}, "#renderSplitContainers"));
|
|
706
705
|
d(this, Yt, /* @__PURE__ */ h(() => {
|
|
707
706
|
["left", "right", "body"].forEach((e) => {
|
|
708
|
-
const
|
|
709
|
-
if (!
|
|
707
|
+
const i = this.querySelector(`.ng-container-${e}`), r = i == null ? void 0 : i.querySelectorAll("table");
|
|
708
|
+
if (!i || !r || r.length === 0) return;
|
|
710
709
|
let n = 0;
|
|
711
710
|
r[0].querySelectorAll("col").forEach((o) => {
|
|
712
711
|
const a = parseInt(o.getAttribute("width"), 10);
|
|
713
712
|
isNaN(n) || (n += a);
|
|
714
|
-
}), e === "body" ?
|
|
713
|
+
}), e === "body" ? i.style.flex = "1" : (i.style.flex = `0 0 ${n}px`, i.style.width = `${n}px`);
|
|
715
714
|
});
|
|
716
715
|
}, "#updateContainerWidths"));
|
|
717
716
|
A(this, "generate", /* @__PURE__ */ h((e) => {
|
|
718
717
|
e && (y(this, tt, he.compile(e)), t(this, Vt).call(this), t(this, Yt).call(this), t(this, et).initialize(), setTimeout(() => {
|
|
719
|
-
var
|
|
720
|
-
(
|
|
718
|
+
var i;
|
|
719
|
+
(i = this.querySelector("nine-table-hscrollbar")) == null || i.refresh();
|
|
721
720
|
}, 0));
|
|
722
721
|
}, "generate"));
|
|
723
|
-
d(this, ct, /* @__PURE__ */ h((e,
|
|
724
|
-
const n = e.cloneNode(!0), o = n.querySelector("thead"), a = n.querySelector("tbody"),
|
|
722
|
+
d(this, ct, /* @__PURE__ */ h((e, i, r) => {
|
|
723
|
+
const n = e.cloneNode(!0), o = n.querySelector("thead"), a = n.querySelector("tbody"), c = n.querySelector("tfoot");
|
|
725
724
|
if (r === "header") {
|
|
726
|
-
if (a && a.remove(),
|
|
725
|
+
if (a && a.remove(), c && c.remove(), e.querySelector("tbody")) {
|
|
727
726
|
const f = document.createElement("tbody");
|
|
728
727
|
f.className = "fixed-tbody", n.appendChild(f);
|
|
729
728
|
}
|
|
730
|
-
} else r === "body" ? (o && o.remove(),
|
|
731
|
-
return
|
|
732
|
-
|
|
733
|
-
}) :
|
|
734
|
-
|
|
735
|
-
}) : n.querySelectorAll("[fixed=left], [fixed=right]").forEach((
|
|
736
|
-
|
|
729
|
+
} else r === "body" ? (o && o.remove(), c && c.remove(), a && (a.className = "bindable-tbody")) : r === "footer" && (o && o.remove(), a && a.remove());
|
|
730
|
+
return i === "left" ? n.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((l) => {
|
|
731
|
+
l.getAttribute("fixed") !== "left" && l.remove();
|
|
732
|
+
}) : i === "right" ? n.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((l) => {
|
|
733
|
+
l.getAttribute("fixed") !== "right" && l.remove();
|
|
734
|
+
}) : n.querySelectorAll("[fixed=left], [fixed=right]").forEach((l) => {
|
|
735
|
+
l.remove();
|
|
737
736
|
}), n;
|
|
738
737
|
}, "#createSplitTable"));
|
|
739
738
|
A(this, "getRowHeight", /* @__PURE__ */ h(() => t(this, et).getRowHeight(), "getRowHeight"));
|
|
740
739
|
A(this, "scrollToX", /* @__PURE__ */ h((e) => {
|
|
741
|
-
const
|
|
742
|
-
|
|
740
|
+
const i = this.querySelector(".ng-container-body .ng-part-body");
|
|
741
|
+
i && (i.scrollLeft = e);
|
|
743
742
|
}, "scrollToX"));
|
|
744
743
|
A(this, "scrollToY", /* @__PURE__ */ h((e) => {
|
|
745
|
-
const
|
|
746
|
-
|
|
744
|
+
const i = this.querySelector(".ng-container-body .ng-part-body");
|
|
745
|
+
i && (i.scrollTop = e);
|
|
747
746
|
}, "scrollToY"));
|
|
748
747
|
d(this, Ut, /* @__PURE__ */ h(() => {
|
|
749
748
|
t(this, Xt).call(this);
|
|
@@ -909,41 +908,41 @@ const Ie = class Ie extends HTMLElement {
|
|
|
909
908
|
super();
|
|
910
909
|
d(this, Kt, /* @__PURE__ */ h(() => {
|
|
911
910
|
var e;
|
|
912
|
-
(e = this.querySelector(".nine-tab-bar")) == null || e.addEventListener("click", (
|
|
911
|
+
(e = this.querySelector(".nine-tab-bar")) == null || e.addEventListener("click", (i) => {
|
|
913
912
|
var o;
|
|
914
|
-
const r =
|
|
913
|
+
const r = i.ctrlKey || i.metaKey || i.shiftKey, n = parseInt((o = i.target.closest(".nine-tab-item")) == null ? void 0 : o.dataset.index, 10);
|
|
915
914
|
t(this, qt).call(this, n, r);
|
|
916
915
|
}), t(this, qt).call(this, 0, !1);
|
|
917
916
|
}, "#init"));
|
|
918
|
-
d(this, qt, /* @__PURE__ */ h((e,
|
|
917
|
+
d(this, qt, /* @__PURE__ */ h((e, i = !1) => {
|
|
919
918
|
const r = /* @__PURE__ */ h(() => {
|
|
920
919
|
const f = Array.from(this.querySelectorAll("nine-table-sheet"));
|
|
921
|
-
Array.from(this.querySelectorAll("nine-splitter")).forEach((
|
|
922
|
-
const
|
|
923
|
-
|
|
924
|
-
const m = parseInt(
|
|
925
|
-
v &&
|
|
920
|
+
Array.from(this.querySelectorAll("nine-splitter")).forEach((g) => g.style.setProperty("display", "none"));
|
|
921
|
+
const b = f.filter((g) => g.classList.contains("active"));
|
|
922
|
+
b.length < 2 || b.forEach((g) => {
|
|
923
|
+
const m = parseInt(g.getAttribute("data-index"), 10), v = this.querySelector(`nine-splitter[data-split-index="${m}"]`), S = f[m + 1];
|
|
924
|
+
v && S && S.classList.contains("active") && v.style.setProperty("display", "flex");
|
|
926
925
|
});
|
|
927
|
-
}, "updateSplitters"), n = this.querySelector(".nine-tab-bar"), o = this.querySelector("nine-table-sheets-body"), a = n.querySelectorAll(".nine-tab-item"),
|
|
926
|
+
}, "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");
|
|
928
927
|
if (!a[e]) return;
|
|
929
|
-
if (!
|
|
928
|
+
if (!i)
|
|
930
929
|
a.forEach((f, u) => {
|
|
931
930
|
f.classList.toggle("active", u === e);
|
|
932
|
-
}),
|
|
933
|
-
const
|
|
934
|
-
f.classList.toggle("active",
|
|
931
|
+
}), c.forEach((f, u) => {
|
|
932
|
+
const b = u === e;
|
|
933
|
+
f.classList.toggle("active", b), f.style.flex = b ? "1 1 100%" : "";
|
|
935
934
|
});
|
|
936
935
|
else {
|
|
937
936
|
const f = a[e], u = n.querySelectorAll(".nine-tab-item.active");
|
|
938
937
|
if (f.classList.contains("active") && u.length <= 1)
|
|
939
938
|
return;
|
|
940
939
|
f.classList.toggle("active");
|
|
941
|
-
const
|
|
942
|
-
|
|
940
|
+
const b = o.querySelector(`nine-table-sheet[data-index="${e}"]`);
|
|
941
|
+
b && (b.classList.toggle("active"), b.classList.contains("active") || (b.style.flex = ""));
|
|
943
942
|
}
|
|
944
|
-
const
|
|
945
|
-
|
|
946
|
-
f.style.flex =
|
|
943
|
+
const l = o.querySelectorAll("nine-table-sheet.active");
|
|
944
|
+
l == null || l.forEach((f) => {
|
|
945
|
+
f.style.flex = l.length > 1 ? "1 1 0%" : "1 1 100%";
|
|
947
946
|
}), r();
|
|
948
947
|
}, "#switchSheet"));
|
|
949
948
|
}
|
|
@@ -956,26 +955,26 @@ let de = Ie;
|
|
|
956
955
|
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", de);
|
|
957
956
|
var I, Zt, kt, Gt;
|
|
958
957
|
const _e = class _e {
|
|
959
|
-
constructor(
|
|
958
|
+
constructor(s) {
|
|
960
959
|
d(this, I);
|
|
961
960
|
d(this, Zt, /* @__PURE__ */ h(() => {
|
|
962
|
-
t(this, Gt).call(this), new ResizeObserver((
|
|
963
|
-
for (let e of
|
|
961
|
+
t(this, Gt).call(this), new ResizeObserver((s) => {
|
|
962
|
+
for (let e of s)
|
|
964
963
|
t(this, I).getAttribute("auto-height") === "true" && t(this, kt).call(this);
|
|
965
964
|
}).observe(t(this, I));
|
|
966
965
|
}, "#init"));
|
|
967
966
|
d(this, kt, /* @__PURE__ */ h(() => {
|
|
968
|
-
var
|
|
969
|
-
const
|
|
970
|
-
if (
|
|
971
|
-
const e = parseInt(t(this, I).getAttribute("max-display-row"), 10) || 10,
|
|
967
|
+
var c, l;
|
|
968
|
+
const s = Array.from(t(this, I).shadowRoot.querySelectorAll("nine-table-sheet.active"));
|
|
969
|
+
if (s.length === 0) return;
|
|
970
|
+
const e = parseInt(t(this, I).getAttribute("max-display-row"), 10) || 10, i = Math.max(...s.map((f) => f.getRowHeight())), r = (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 * i + r + n + o;
|
|
972
971
|
t(this, I).style.height = `${a}px`;
|
|
973
972
|
}, "#applyAutoHeight"));
|
|
974
973
|
d(this, Gt, /* @__PURE__ */ h(() => {
|
|
975
|
-
const e = Array.from(t(this, I).children).filter((
|
|
976
|
-
const u = `<nine-table-sheet class="${
|
|
977
|
-
return u +
|
|
978
|
-
}).join(""), o = e.map((
|
|
974
|
+
const e = Array.from(t(this, I).children).filter((c) => c.tagName === "TABLE"), i = t(this, I).getAttribute("auto-height") === "true", r = e.length, n = e.map((c, l) => {
|
|
975
|
+
const u = `<nine-table-sheet class="${l === 0 ? "active" : ""}" data-index="${l}"></nine-table-sheet>`, b = l < r - 1 ? `<nine-splitter class="h" data-split-index="${l}"></nine-splitter>` : "";
|
|
976
|
+
return u + b;
|
|
977
|
+
}).join(""), o = e.map((c, l) => `<div class="nine-tab-item ${l === 0 ? "active" : ""}" data-index="${l}">Sheet ${l + 1}</div>`).join("");
|
|
979
978
|
t(this, I).shadowRoot.innerHTML = `
|
|
980
979
|
<style>
|
|
981
980
|
:host {
|
|
@@ -983,7 +982,7 @@ const _e = class _e {
|
|
|
983
982
|
flex-direction: column;
|
|
984
983
|
position: relative;
|
|
985
984
|
overflow: hidden;
|
|
986
|
-
height: ${
|
|
985
|
+
height: ${i ? "auto" : "100%"};
|
|
987
986
|
background: #fff;
|
|
988
987
|
}
|
|
989
988
|
|
|
@@ -1068,30 +1067,30 @@ const _e = class _e {
|
|
|
1068
1067
|
<nine-table-footer></nine-table-footer>
|
|
1069
1068
|
`;
|
|
1070
1069
|
const a = t(this, I).shadowRoot.querySelectorAll("nine-table-sheet");
|
|
1071
|
-
a == null || a.forEach((
|
|
1072
|
-
e[
|
|
1073
|
-
|
|
1070
|
+
a == null || a.forEach((c, l) => {
|
|
1071
|
+
e[l] && setTimeout(() => {
|
|
1072
|
+
c.generate(e[l]), i && t(this, kt).call(this);
|
|
1074
1073
|
});
|
|
1075
1074
|
});
|
|
1076
1075
|
}, "#render"));
|
|
1077
|
-
y(this, I,
|
|
1076
|
+
y(this, I, s), t(this, Zt).call(this);
|
|
1078
1077
|
}
|
|
1079
1078
|
};
|
|
1080
1079
|
I = new WeakMap(), Zt = new WeakMap(), kt = new WeakMap(), Gt = new WeakMap(), h(_e, "LayoutManager");
|
|
1081
1080
|
let fe = _e;
|
|
1082
1081
|
var Tt, ht;
|
|
1083
1082
|
const Ne = class Ne {
|
|
1084
|
-
constructor(
|
|
1083
|
+
constructor(s) {
|
|
1085
1084
|
d(this, Tt);
|
|
1086
1085
|
d(this, ht, -1);
|
|
1087
1086
|
A(this, "count", /* @__PURE__ */ h(() => t(this, Tt).rawRecords.length, "count"));
|
|
1088
|
-
y(this, Tt,
|
|
1087
|
+
y(this, Tt, s);
|
|
1089
1088
|
}
|
|
1090
1089
|
get at() {
|
|
1091
1090
|
return t(this, ht);
|
|
1092
1091
|
}
|
|
1093
|
-
set at(
|
|
1094
|
-
y(this, ht, parseInt(
|
|
1092
|
+
set at(s) {
|
|
1093
|
+
y(this, ht, parseInt(s, 10)), body && !body.querySelector(`tbody.bindable tr[data-row="${t(this, ht)}"]`) && setTimeout(() => {
|
|
1095
1094
|
});
|
|
1096
1095
|
}
|
|
1097
1096
|
};
|
|
@@ -1099,7 +1098,7 @@ Tt = new WeakMap(), ht = new WeakMap(), h(Ne, "ngRow");
|
|
|
1099
1098
|
let ue = Ne;
|
|
1100
1099
|
var _, T, N, dt, Jt, Y, Qt, st, Ct, te, ee, ft;
|
|
1101
1100
|
const W = class W {
|
|
1102
|
-
constructor(
|
|
1101
|
+
constructor(s, e) {
|
|
1103
1102
|
d(this, _);
|
|
1104
1103
|
d(this, T);
|
|
1105
1104
|
d(this, N, []);
|
|
@@ -1108,34 +1107,34 @@ const W = class W {
|
|
|
1108
1107
|
d(this, Y, []);
|
|
1109
1108
|
d(this, Qt, /* @__PURE__ */ h(() => {
|
|
1110
1109
|
y(this, Y, []);
|
|
1111
|
-
const
|
|
1112
|
-
Array.from(
|
|
1113
|
-
var
|
|
1114
|
-
t(this, Y).push(((
|
|
1110
|
+
const s = t(this, _).template || [];
|
|
1111
|
+
Array.from(s).forEach((e) => {
|
|
1112
|
+
var i;
|
|
1113
|
+
t(this, Y).push(((i = e.getBoundingClientRect) == null ? void 0 : i.call(e).height) || 24);
|
|
1115
1114
|
}), (t(this, T).rawRecords || []).forEach((e) => {
|
|
1116
1115
|
e.__ng || (e.__ng = t(this, Ct).call(this)), e.__ng.height = t(this, Y).slice();
|
|
1117
1116
|
});
|
|
1118
1117
|
}, "#initialize"));
|
|
1119
1118
|
d(this, st, /* @__PURE__ */ h(() => {
|
|
1120
|
-
t(this, _).shadowRoot.querySelectorAll("nine-table-sheet").forEach((
|
|
1121
|
-
|
|
1119
|
+
t(this, _).shadowRoot.querySelectorAll("nine-table-sheet").forEach((s) => {
|
|
1120
|
+
s.invalidate();
|
|
1122
1121
|
});
|
|
1123
1122
|
}, "#invalidate"));
|
|
1124
|
-
A(this, "get", /* @__PURE__ */ h((
|
|
1123
|
+
A(this, "get", /* @__PURE__ */ h((s, e) => {
|
|
1125
1124
|
var n;
|
|
1126
|
-
const
|
|
1127
|
-
if (!
|
|
1128
|
-
if (
|
|
1129
|
-
if (
|
|
1125
|
+
const i = this.getValidData();
|
|
1126
|
+
if (!i || i.length <= 0) return;
|
|
1127
|
+
if (s == null) return t(this, ft).call(this, i);
|
|
1128
|
+
if (s < 0 || s >= i.length) return null;
|
|
1130
1129
|
const r = typeof ((n = t(this, _).fields) == null ? void 0 : n.get) == "function" ? t(this, _).fields.get() : [];
|
|
1131
1130
|
if (e != null) {
|
|
1132
1131
|
const o = r.indexOf(e);
|
|
1133
|
-
return o >= 0 ? s
|
|
1132
|
+
return o >= 0 ? i[s].v[o] : null;
|
|
1134
1133
|
}
|
|
1135
|
-
return t(this, ft).call(this, s
|
|
1134
|
+
return t(this, ft).call(this, i[s]);
|
|
1136
1135
|
}, "get"));
|
|
1137
|
-
A(this, "set", /* @__PURE__ */ h((
|
|
1138
|
-
this.clear(), this.add(
|
|
1136
|
+
A(this, "set", /* @__PURE__ */ h((s) => {
|
|
1137
|
+
this.clear(), this.add(s, !1), t(this, st).call(this);
|
|
1139
1138
|
}, "set"));
|
|
1140
1139
|
d(this, Ct, /* @__PURE__ */ h(() => ({
|
|
1141
1140
|
rowState: W.ROW_STATE.EMPTY,
|
|
@@ -1150,81 +1149,81 @@ const W = class W {
|
|
|
1150
1149
|
y(this, N, []), y(this, dt, []), t(this, st).call(this);
|
|
1151
1150
|
}, "reset"));
|
|
1152
1151
|
A(this, "clear", /* @__PURE__ */ h(() => {
|
|
1153
|
-
var
|
|
1154
|
-
t(this, T).rawRecords = [], y(this, N, []), y(this, dt, []), (
|
|
1152
|
+
var s;
|
|
1153
|
+
t(this, T).rawRecords = [], y(this, N, []), y(this, dt, []), (s = t(this, T).viewRecords) != null && s.reset && t(this, T).viewRecords.reset();
|
|
1155
1154
|
}, "clear"));
|
|
1156
|
-
d(this, te, /* @__PURE__ */ h((
|
|
1155
|
+
d(this, te, /* @__PURE__ */ h((s) => {
|
|
1157
1156
|
var r;
|
|
1158
|
-
Array.isArray(
|
|
1159
|
-
const e = typeof ((r = t(this, _).fields) == null ? void 0 : r.get) == "function" ? t(this, _).fields.get() : Object.keys(
|
|
1160
|
-
return
|
|
1157
|
+
Array.isArray(s) || (s = [s]);
|
|
1158
|
+
const e = typeof ((r = t(this, _).fields) == null ? void 0 : r.get) == "function" ? t(this, _).fields.get() : Object.keys(s[0] || {}), i = [];
|
|
1159
|
+
return s.forEach((n) => {
|
|
1161
1160
|
const o = { v: [] };
|
|
1162
1161
|
e.forEach((a) => {
|
|
1163
1162
|
o.v.push(n[a] !== void 0 && n[a] !== null ? n[a] : "");
|
|
1164
|
-
}),
|
|
1165
|
-
}),
|
|
1163
|
+
}), i.push(o);
|
|
1164
|
+
}), i;
|
|
1166
1165
|
}, "#json2Array"));
|
|
1167
|
-
d(this, ee, /* @__PURE__ */ h((
|
|
1166
|
+
d(this, ee, /* @__PURE__ */ h((s) => (Array.isArray(s) || (s = [s]), s.forEach((e) => {
|
|
1168
1167
|
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
|
-
}),
|
|
1170
|
-
A(this, "add", /* @__PURE__ */ h((
|
|
1171
|
-
|
|
1172
|
-
const
|
|
1173
|
-
t(this, T).rawRecords = t(this, T).rawRecords.concat(t(this, ee).call(this,
|
|
1168
|
+
}), s), "#defaultInsert"));
|
|
1169
|
+
A(this, "add", /* @__PURE__ */ h((s, e = !0) => {
|
|
1170
|
+
s === void 0 && (s = {});
|
|
1171
|
+
const i = t(this, te).call(this, s);
|
|
1172
|
+
t(this, T).rawRecords = t(this, T).rawRecords.concat(t(this, ee).call(this, i)), this.resetRecords();
|
|
1174
1173
|
const r = this.count() - 1;
|
|
1175
|
-
return e ||
|
|
1174
|
+
return e || i.forEach((n, o) => {
|
|
1176
1175
|
const a = t(this, T).rawRecords[r - o];
|
|
1177
1176
|
a && (a.__ng.rowState = W.ROW_STATE.EMPTY);
|
|
1178
1177
|
}), t(this, st).call(this), r;
|
|
1179
1178
|
}, "add"));
|
|
1180
|
-
A(this, "delete", /* @__PURE__ */ h((
|
|
1179
|
+
A(this, "delete", /* @__PURE__ */ h((s) => {
|
|
1181
1180
|
let e = [];
|
|
1182
|
-
Array.isArray(
|
|
1183
|
-
if (t(this, N)[
|
|
1184
|
-
const r = t(this, N)[
|
|
1185
|
-
t(this, N)[
|
|
1181
|
+
Array.isArray(s) ? e = s : typeof s > "u" ? e = [t(this, T).host.row.at] : e = [parseInt(s, 10)], e.sort((i, r) => r - i).forEach((i) => {
|
|
1182
|
+
if (t(this, N)[i]) {
|
|
1183
|
+
const r = t(this, N)[i].__ng.rowid;
|
|
1184
|
+
t(this, N)[i].__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) => {
|
|
1186
1185
|
n.__ng.rowid === r && (n.__ng.deleted = !0, n.__ng.rowState = W.ROW_STATE.DELETE);
|
|
1187
1186
|
});
|
|
1188
1187
|
}
|
|
1189
1188
|
}), this.resetRecords(), t(this, st).call(this);
|
|
1190
1189
|
}, "delete"));
|
|
1191
|
-
A(this, "setValue", /* @__PURE__ */ h((
|
|
1192
|
-
var
|
|
1193
|
-
|
|
1194
|
-
const n = (typeof ((
|
|
1190
|
+
A(this, "setValue", /* @__PURE__ */ h((s, e, i) => {
|
|
1191
|
+
var c;
|
|
1192
|
+
s = parseInt(s, 10);
|
|
1193
|
+
const n = (typeof ((c = t(this, _).fields) == null ? void 0 : c.get) == "function" ? t(this, _).fields.get() : []).indexOf(e);
|
|
1195
1194
|
if (n < 0) return;
|
|
1196
|
-
const o = this.getValidData()[
|
|
1195
|
+
const o = this.getValidData()[s];
|
|
1197
1196
|
if (!o) return;
|
|
1198
1197
|
const a = o.v[n];
|
|
1199
|
-
a !==
|
|
1198
|
+
a !== i && 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] = i;
|
|
1200
1199
|
}, "setValue"));
|
|
1201
1200
|
A(this, "resetRecords", /* @__PURE__ */ h(() => {
|
|
1202
|
-
y(this, dt, t(this, T).rawRecords.filter((
|
|
1203
|
-
|
|
1204
|
-
}), t(this, N).forEach((
|
|
1205
|
-
|
|
1201
|
+
y(this, dt, t(this, T).rawRecords.filter((s) => !s.__ng.deleted)), y(this, N, t(this, T).rawRecords.filter((s) => !s.__ng.deleted && !s.__ng.filtered)), t(this, T).rawRecords.forEach((s, e) => {
|
|
1202
|
+
s.__ng.rowidx = e;
|
|
1203
|
+
}), t(this, N).forEach((s, e) => {
|
|
1204
|
+
s.__ng.i = e;
|
|
1206
1205
|
});
|
|
1207
1206
|
}, "resetRecords"));
|
|
1208
1207
|
A(this, "getValidData", /* @__PURE__ */ h(() => (t(this, N).length === 0 && t(this, T).rawRecords.length > 0 && this.resetRecords(), t(this, N)), "getValidData"));
|
|
1209
|
-
d(this, ft, /* @__PURE__ */ h((
|
|
1208
|
+
d(this, ft, /* @__PURE__ */ h((s) => {
|
|
1210
1209
|
var o;
|
|
1211
|
-
if (!
|
|
1212
|
-
const e = !Array.isArray(
|
|
1213
|
-
const
|
|
1214
|
-
return r.forEach((
|
|
1215
|
-
l
|
|
1216
|
-
}),
|
|
1210
|
+
if (!s) return s;
|
|
1211
|
+
const e = !Array.isArray(s), i = e ? [s] : s, r = typeof ((o = t(this, _).fields) == null ? void 0 : o.get) == "function" ? t(this, _).fields.get() : [], n = i.filter((a) => !a.__ng.deleted).map((a) => {
|
|
1212
|
+
const c = {};
|
|
1213
|
+
return r.forEach((l, f) => {
|
|
1214
|
+
c[l] = a.v ? a.v[f] : a[l];
|
|
1215
|
+
}), c.__ng = a.__ng, c;
|
|
1217
1216
|
});
|
|
1218
1217
|
return e ? n[0] : n;
|
|
1219
1218
|
}, "#conv"));
|
|
1220
1219
|
A(this, "count", /* @__PURE__ */ h(() => this.getValidData().length, "count"));
|
|
1221
|
-
y(this, _,
|
|
1220
|
+
y(this, _, s), y(this, T, e), t(this, Qt).call(this);
|
|
1222
1221
|
}
|
|
1223
1222
|
get source() {
|
|
1224
1223
|
return t(this, ft).call(this, t(this, T).rawRecords);
|
|
1225
1224
|
}
|
|
1226
|
-
set source(
|
|
1227
|
-
this.clear(), this.add(
|
|
1225
|
+
set source(s) {
|
|
1226
|
+
this.clear(), this.add(s, !1);
|
|
1228
1227
|
}
|
|
1229
1228
|
get nextId() {
|
|
1230
1229
|
return ++Ye(this, Jt)._;
|
|
@@ -1247,22 +1246,22 @@ A(W, "ROW_STATE", {
|
|
|
1247
1246
|
let ge = W;
|
|
1248
1247
|
var it;
|
|
1249
1248
|
const We = class We {
|
|
1250
|
-
constructor(
|
|
1249
|
+
constructor(s) {
|
|
1251
1250
|
d(this, it);
|
|
1252
|
-
y(this, it,
|
|
1251
|
+
y(this, it, s), 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 = () => {
|
|
1253
1252
|
var e;
|
|
1254
1253
|
(e = t(this, it).view) != null && e.redraw && t(this, it).view.redraw();
|
|
1255
1254
|
}, this.setDataSource = (e) => {
|
|
1256
1255
|
this.data && this.data.reset(), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.data.set(e || []);
|
|
1257
1256
|
}, this.getRowState = (e) => {
|
|
1258
1257
|
var r, n;
|
|
1259
|
-
const
|
|
1260
|
-
if (!(
|
|
1261
|
-
return (n = (r = this.data.getValidData()[
|
|
1258
|
+
const i = parseInt(e, 10);
|
|
1259
|
+
if (!(i >= this.data.count()))
|
|
1260
|
+
return (n = (r = this.data.getValidData()[i]) == null ? void 0 : r.__ng) == null ? void 0 : n.rowState;
|
|
1262
1261
|
}, this.getRowPosition = () => this.row.at, this.setRowPosition = (e) => {
|
|
1263
1262
|
this.row.at = 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,
|
|
1265
|
-
e = parseInt(e, 10), this.data.setValue(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, i) => this.data.get(e, i), this.setColumn = (e, i, r) => {
|
|
1264
|
+
e = parseInt(e, 10), this.data.setValue(e, i, r);
|
|
1266
1265
|
}, this.setDataSource([]);
|
|
1267
1266
|
}
|
|
1268
1267
|
};
|
|
@@ -1271,31 +1270,31 @@ let be = We;
|
|
|
1271
1270
|
var ut, L, Lt, se;
|
|
1272
1271
|
const Oe = class Oe {
|
|
1273
1272
|
// π― μ΄μ { name: string, type: string } κ°μ²΄λ€μ λ°°μ΄λ‘ κ΄λ¦¬ν©λλ€.
|
|
1274
|
-
constructor(
|
|
1273
|
+
constructor(s) {
|
|
1275
1274
|
d(this, ut);
|
|
1276
1275
|
d(this, L, []);
|
|
1277
|
-
A(this, "add", /* @__PURE__ */ h((
|
|
1278
|
-
|
|
1279
|
-
t(this, L).some((r) => r.name ===
|
|
1276
|
+
A(this, "add", /* @__PURE__ */ h((s, e = "string") => {
|
|
1277
|
+
s.forEach((i) => {
|
|
1278
|
+
t(this, L).some((r) => r.name === i) || t(this, L).push({ name: i, type: e });
|
|
1280
1279
|
}), t(this, Lt).call(this);
|
|
1281
1280
|
}, "add"));
|
|
1282
1281
|
d(this, Lt, /* @__PURE__ */ h(() => {
|
|
1283
|
-
const
|
|
1282
|
+
const s = /* @__PURE__ */ new Map();
|
|
1284
1283
|
t(this, L).forEach((e) => {
|
|
1285
|
-
|
|
1286
|
-
}), y(this, L, Array.from(
|
|
1284
|
+
s.set(e.name, e.type);
|
|
1285
|
+
}), y(this, L, Array.from(s, ([e, i]) => ({ name: e, type: i }))), y(this, L, t(this, L).filter((e) => e.name !== "" && e.name !== "__ng")), t(this, L).sort((e, i) => e.name.length < i.name.length ? 1 : -1);
|
|
1287
1286
|
}, "#adjust"));
|
|
1288
1287
|
d(this, se, /* @__PURE__ */ h(() => {
|
|
1289
1288
|
y(this, L, []), P.log(t(this, ut).querySelectorAll("table"));
|
|
1290
|
-
const
|
|
1291
|
-
if (!(!
|
|
1292
|
-
for (const e of
|
|
1293
|
-
P.log(e), $("[data-bind]", e).each((
|
|
1289
|
+
const s = Array.from(t(this, ut).querySelectorAll("table"));
|
|
1290
|
+
if (!(!s || s.length === 0)) {
|
|
1291
|
+
for (const e of s)
|
|
1292
|
+
P.log(e), $("[data-bind]", e).each((i, r) => {
|
|
1294
1293
|
const n = r.dataset.bind, o = r.getAttribute("data-type") || "string";
|
|
1295
1294
|
n && t(this, L).push({ name: n, type: o });
|
|
1296
|
-
}), ["data-expr", "background-color", "color", "tooltip", "visible", "readonly", "enable-button", "enable-check", "class-expr", "icon-color", "icon-src"].forEach((
|
|
1297
|
-
$(`[${
|
|
1298
|
-
var o = n.getAttribute(
|
|
1295
|
+
}), ["data-expr", "background-color", "color", "tooltip", "visible", "readonly", "enable-button", "enable-check", "class-expr", "icon-color", "icon-src"].forEach((i) => {
|
|
1296
|
+
$(`[${i}]`, e).each((r, n) => {
|
|
1297
|
+
var o = n.getAttribute(i);
|
|
1299
1298
|
if (o.indexOf("data.") < 0) {
|
|
1300
1299
|
const a = o.search(/[(]/g);
|
|
1301
1300
|
if (a > 0)
|
|
@@ -1307,9 +1306,9 @@ const Oe = class Oe {
|
|
|
1307
1306
|
}
|
|
1308
1307
|
o.split("data.").forEach((a) => {
|
|
1309
1308
|
if (a.trim() != "") {
|
|
1310
|
-
const
|
|
1311
|
-
let
|
|
1312
|
-
|
|
1309
|
+
const c = a.search(/[^_A-Za-z0-9]/g);
|
|
1310
|
+
let l = "";
|
|
1311
|
+
c >= 0 ? l = a.substring(0, c) : o.startsWith("data.") && (l = a.replace("data.", "")), l && t(this, L).push({ name: l, type: "string" });
|
|
1313
1312
|
}
|
|
1314
1313
|
});
|
|
1315
1314
|
});
|
|
@@ -1317,26 +1316,26 @@ const Oe = class Oe {
|
|
|
1317
1316
|
t(this, Lt).call(this);
|
|
1318
1317
|
}
|
|
1319
1318
|
}, "#init"));
|
|
1320
|
-
y(this, ut,
|
|
1319
|
+
y(this, ut, s), t(this, se).call(this);
|
|
1321
1320
|
}
|
|
1322
1321
|
// π― κΈ°μ‘΄μ νλ μ΄λ¦λ§ μ°λ κ³³λ€κ³Όμ νΈνμ μν΄ μ΄λ¦ λ°°μ΄λ§ 리ν΄νλ λ©μλ μ μ§
|
|
1323
1322
|
get() {
|
|
1324
|
-
return t(this, L).map((
|
|
1323
|
+
return t(this, L).map((s) => s.name);
|
|
1325
1324
|
}
|
|
1326
1325
|
// π― λ΄λΆ κ°μ²΄ ν΅μ§Έλ‘ μ»κΈ°
|
|
1327
1326
|
getFields() {
|
|
1328
1327
|
return t(this, L);
|
|
1329
1328
|
}
|
|
1330
1329
|
// π― νΉμ νλμ λ°μ΄ν° νμ
μ‘°ν
|
|
1331
|
-
getType(
|
|
1332
|
-
const e = t(this, L).find((
|
|
1330
|
+
getType(s) {
|
|
1331
|
+
const e = t(this, L).find((i) => i.name === s);
|
|
1333
1332
|
return e ? e.type : "string";
|
|
1334
1333
|
}
|
|
1335
|
-
indexOf(
|
|
1336
|
-
return t(this, L).findIndex((e) => e.name ===
|
|
1334
|
+
indexOf(s) {
|
|
1335
|
+
return t(this, L).findIndex((e) => e.name === s);
|
|
1337
1336
|
}
|
|
1338
|
-
includes(
|
|
1339
|
-
return t(this, L).some((e) => e.name ===
|
|
1337
|
+
includes(s) {
|
|
1338
|
+
return t(this, L).some((e) => e.name === s);
|
|
1340
1339
|
}
|
|
1341
1340
|
};
|
|
1342
1341
|
ut = new WeakMap(), L = new WeakMap(), Lt = new WeakMap(), se = new WeakMap(), h(Oe, "ngFields");
|
|
@@ -1402,15 +1401,15 @@ const ze = class ze extends me {
|
|
|
1402
1401
|
A(this, "getDisplayText", /* @__PURE__ */ h((e) => {
|
|
1403
1402
|
if (t(this, p))
|
|
1404
1403
|
if (t(this, p).closest("tbody")) {
|
|
1405
|
-
const
|
|
1406
|
-
if (!
|
|
1404
|
+
const i = t(this, p).closest("tr").data, r = parseInt(t(this, p).dataset.row);
|
|
1405
|
+
if (!i) return "";
|
|
1407
1406
|
if (ninegrid.isNull(t(this, p).dataset.expr)) {
|
|
1408
1407
|
if (!ninegrid.isNull(t(this, p).dataset.bind))
|
|
1409
|
-
return
|
|
1408
|
+
return i[t(this, p).dataset.bind] || ninegrid.nvl(e, "");
|
|
1410
1409
|
} else try {
|
|
1411
|
-
return this.getExprValue(t(this, p).dataset.expr,
|
|
1410
|
+
return this.getExprValue(t(this, p).dataset.expr, i, r, t(this, p));
|
|
1412
1411
|
} catch {
|
|
1413
|
-
console.error(t(this, p).dataset.expr,
|
|
1412
|
+
console.error(t(this, p).dataset.expr, i, t(this, p).dataset.row);
|
|
1414
1413
|
}
|
|
1415
1414
|
return ninegrid.nvl(e, "");
|
|
1416
1415
|
} else
|
|
@@ -1423,19 +1422,19 @@ const ze = class ze extends me {
|
|
|
1423
1422
|
if (!(!t(this, C) || !t(this, C).template || !t(this, p).closest("tbody.bindable"))) {
|
|
1424
1423
|
var e = ninegrid.j.querySelectorAll(t(this, p)).attr("suppress");
|
|
1425
1424
|
if (e && (e = parseInt(e)), e && !isNaN(e)) {
|
|
1426
|
-
var
|
|
1427
|
-
$("th,td",
|
|
1425
|
+
var i = t(this, p).closest("tr"), r = [];
|
|
1426
|
+
$("th,td", i).each((x, H) => {
|
|
1428
1427
|
var k = ninegrid.j.querySelectorAll(H).attr("suppress");
|
|
1429
1428
|
k && H.dataset.row && (k = parseInt(k), !isNaN(k) && k <= e && r.push(k));
|
|
1430
1429
|
}), r.sort();
|
|
1431
1430
|
var n = !1;
|
|
1432
|
-
if (parseInt(
|
|
1431
|
+
if (parseInt(i.sectionRowIndex / t(this, C).template.length) > 0)
|
|
1433
1432
|
for (var o of r) {
|
|
1434
1433
|
if (o > e) break;
|
|
1435
|
-
var a = parseInt(t(this, p).dataset.row),
|
|
1434
|
+
var a = parseInt(t(this, p).dataset.row), c = a - 1, l = t(this, p).closest("tr").data, f = t(this, C).data.get(c);
|
|
1436
1435
|
t(this, p).dataset.matrixRow;
|
|
1437
|
-
var u = t(this, C).body.querySelector(`tbody.bindable [suppress="${o}"][data-matrix-row="${t(this, p).dataset.matrixRow}"]`),
|
|
1438
|
-
if (
|
|
1436
|
+
var u = t(this, C).body.querySelector(`tbody.bindable [suppress="${o}"][data-matrix-row="${t(this, p).dataset.matrixRow}"]`), b = u.dataset.expr ? this.getExprValue(u.dataset.expr, l, a) : l[u.dataset.bind], g = u.dataset.expr ? this.getExprValue(u.dataset.expr, f, c) : f[u.dataset.bind];
|
|
1437
|
+
if (b != g) {
|
|
1439
1438
|
n = !0;
|
|
1440
1439
|
break;
|
|
1441
1440
|
}
|
|
@@ -1443,17 +1442,17 @@ const ze = class ze extends me {
|
|
|
1443
1442
|
else
|
|
1444
1443
|
n = !0;
|
|
1445
1444
|
n ? ninegrid.j.querySelectorAll(t(this, p)).removeClass("suppress") : ninegrid.j.querySelectorAll(t(this, p)).addClass("suppress"), ninegrid.j.querySelectorAll(t(this, p)).hasClass("hidden") || (n ? ninegrid.j.querySelectorAll(t(this, p)).removeClass("hidden") : ninegrid.j.querySelectorAll(t(this, p)).addClass("hidden"));
|
|
1446
|
-
var m = parseInt(t(this, p).dataset.matrixRow), v = m - 1,
|
|
1447
|
-
$(
|
|
1445
|
+
var m = parseInt(t(this, p).dataset.matrixRow), v = m - 1, S = t(this, C).body.querySelector(`tbody.bindable [data-col="${t(this, p).dataset.col}"][data-matrix-row="${v}"]`);
|
|
1446
|
+
$(S).hasClass("suppress") && !ninegrid.j.querySelectorAll(t(this, p)).hasClass("suppress") ? ninegrid.j.querySelectorAll(S).removeClass("last-none-suppress").addClass("last-suppress") : !$(S).hasClass("suppress") && ninegrid.j.querySelectorAll(t(this, p)).hasClass("suppress") ? ninegrid.j.querySelectorAll(S).removeClass("last-suppress").addClass("last-none-suppress") : ninegrid.j.querySelectorAll(S).removeClass("last-none-suppress").removeClass("last-suppress");
|
|
1448
1447
|
}
|
|
1449
1448
|
}
|
|
1450
1449
|
}, "#resetSuppress"));
|
|
1451
|
-
A(this, "getExprValue", /* @__PURE__ */ h((e,
|
|
1450
|
+
A(this, "getExprValue", /* @__PURE__ */ h((e, i, r, n) => {
|
|
1452
1451
|
if (typeof e < "u")
|
|
1453
1452
|
try {
|
|
1454
1453
|
r = parseInt(r);
|
|
1455
1454
|
const o = e.replace("()", "");
|
|
1456
|
-
return t(this, C)[o] ? t(this, C)[o].call(this,
|
|
1455
|
+
return t(this, C)[o] ? t(this, C)[o].call(this, i, r, t(this, p)) : t(this, C).exprFunction(e).call(this, i, r, t(this, C).data);
|
|
1457
1456
|
} catch {
|
|
1458
1457
|
return ["NG-COMBO"].includes(this.tagName) ? "" : e;
|
|
1459
1458
|
}
|
|
@@ -1469,9 +1468,9 @@ const ze = class ze extends me {
|
|
|
1469
1468
|
return e ?? "";
|
|
1470
1469
|
}
|
|
1471
1470
|
set value(e) {
|
|
1472
|
-
var
|
|
1471
|
+
var i = parseInt(t(this, p).dataset.row);
|
|
1473
1472
|
const r = this.getAttribute("update-row-state") != "false";
|
|
1474
|
-
|
|
1473
|
+
i < 0 ? t(this, C).data.setValueNF(parseInt(t(this, p).dataset.index), t(this, p).dataset.bind, e, r) : t(this, C).data.setValue(i, t(this, p).dataset.bind, e, r);
|
|
1475
1474
|
}
|
|
1476
1475
|
get row() {
|
|
1477
1476
|
return parseInt(t(this, p).dataset.row);
|
|
@@ -1547,10 +1546,10 @@ const Pe = class Pe extends ve {
|
|
|
1547
1546
|
if (t(this, nt) == "number") {
|
|
1548
1547
|
let n = [];
|
|
1549
1548
|
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
|
|
1549
|
+
var i = e.target.value, r = i.indexOf(".");
|
|
1551
1550
|
if (r >= 0) {
|
|
1552
|
-
var
|
|
1553
|
-
|
|
1551
|
+
var i = i.substr(r + 1, i.length);
|
|
1552
|
+
i.length >= Number(t(this, U)) && e.preventDefault();
|
|
1554
1553
|
}
|
|
1555
1554
|
}
|
|
1556
1555
|
}
|
|
@@ -1560,8 +1559,8 @@ const Pe = class Pe extends ve {
|
|
|
1560
1559
|
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)}`;
|
|
1561
1560
|
}
|
|
1562
1561
|
connectedCallback() {
|
|
1563
|
-
for (var e = [],
|
|
1564
|
-
["type", "maxlength", "maxbyte", "min", "max", "step", "scale", "text-align"].includes(this.attributes[
|
|
1562
|
+
for (var e = [], i = 0; i < this.attributes.length; i++)
|
|
1563
|
+
["type", "maxlength", "maxbyte", "min", "max", "step", "scale", "text-align"].includes(this.attributes[i].name) && e.push(`${this.attributes[i].name}="${this.attributes[i].value}"`);
|
|
1565
1564
|
this.innerHTML = `
|
|
1566
1565
|
<input type="text"
|
|
1567
1566
|
${e.join(" ")}
|