@ninebone/table 0.0.241 β 0.0.242
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 +168 -172
- package/dist/nine-table.js.map +1 -1
- package/dist/nine-table.umd.js +4 -4
- package/dist/nine-table.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/nine-table.js
CHANGED
|
@@ -3,7 +3,7 @@ var We = (w) => {
|
|
|
3
3
|
throw TypeError(w);
|
|
4
4
|
};
|
|
5
5
|
var Be = (w, i, t) => i in w ? $e(w, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : w[i] = t;
|
|
6
|
-
var
|
|
6
|
+
var a = (w, i) => $e(w, "name", { value: i, configurable: !0 });
|
|
7
7
|
var x = (w, i, t) => Be(w, typeof i != "symbol" ? i + "" : i, t), ze = (w, i, t) => i.has(w) || We("Cannot " + t);
|
|
8
8
|
var e = (w, i, t) => (ze(w, i, "read from private field"), t ? t.call(w) : i.get(w)), d = (w, i, t) => i.has(w) ? We("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(w) : i.set(w, t), y = (w, i, t, s) => (ze(w, i, "write to private field"), s ? s.call(w, t) : i.set(w, t), t);
|
|
9
9
|
var Oe = (w, i, t, s) => ({
|
|
@@ -15,15 +15,15 @@ var Oe = (w, i, t, s) => ({
|
|
|
15
15
|
}
|
|
16
16
|
});
|
|
17
17
|
import { trace as De } from "@ninebone/util";
|
|
18
|
-
const
|
|
18
|
+
const qe = class qe extends De.constructor {
|
|
19
19
|
constructor() {
|
|
20
20
|
super(), this.init("nine-table", "green");
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
|
-
|
|
24
|
-
let me =
|
|
25
|
-
const
|
|
26
|
-
var L, B, p, D, N, P,
|
|
23
|
+
a(qe, "Trace");
|
|
24
|
+
let me = qe;
|
|
25
|
+
const j = new me();
|
|
26
|
+
var L, B, p, D, N, P, ie, V, se;
|
|
27
27
|
const ke = class ke extends HTMLElement {
|
|
28
28
|
constructor() {
|
|
29
29
|
super();
|
|
@@ -33,19 +33,19 @@ const ke = class ke extends HTMLElement {
|
|
|
33
33
|
d(this, D);
|
|
34
34
|
d(this, N);
|
|
35
35
|
d(this, P);
|
|
36
|
-
d(this,
|
|
36
|
+
d(this, ie, /* @__PURE__ */ a(() => {
|
|
37
37
|
if (!e(this, L)) return;
|
|
38
38
|
const t = e(this, L).querySelector(".ng-container-body");
|
|
39
39
|
t && (y(this, P, new ResizeObserver(() => {
|
|
40
40
|
this.refresh();
|
|
41
41
|
})), e(this, P).observe(t));
|
|
42
42
|
}, "#observeResize"));
|
|
43
|
-
x(this, "refresh", /* @__PURE__ */
|
|
43
|
+
x(this, "refresh", /* @__PURE__ */ a(() => {
|
|
44
44
|
if (!e(this, L) || !e(this, p) || e(this, B)) return;
|
|
45
45
|
const t = e(this, p).container, s = t.querySelector("table");
|
|
46
46
|
if (!s) return;
|
|
47
|
-
const n = e(this, p).track, r = e(this, p).thumb, o = e(this, L).querySelector(".ng-container-bottom"),
|
|
48
|
-
if (
|
|
47
|
+
const n = e(this, p).track, r = e(this, p).thumb, o = e(this, L).querySelector(".ng-container-bottom"), c = t.clientWidth, f = s.scrollWidth;
|
|
48
|
+
if (c !== 0 && f > c)
|
|
49
49
|
o && (o.style.display = "flex");
|
|
50
50
|
else {
|
|
51
51
|
o && (o.style.display = "none");
|
|
@@ -53,29 +53,29 @@ const ke = class ke extends HTMLElement {
|
|
|
53
53
|
}
|
|
54
54
|
const l = n.clientWidth;
|
|
55
55
|
if (l <= 0) return;
|
|
56
|
-
const h = Math.max(Math.min(l * (
|
|
56
|
+
const h = Math.max(Math.min(l * (c / f), l), 20);
|
|
57
57
|
r.style.width = `${h}px`;
|
|
58
|
-
const u = t.scrollLeft, g = f -
|
|
58
|
+
const u = t.scrollLeft, g = f - c;
|
|
59
59
|
let b = 0;
|
|
60
60
|
g > 0 && (b = parseInt(u / g * (l - h), 10)), b < 0 && (b = 0);
|
|
61
61
|
const m = l - h;
|
|
62
|
-
b > m && (b = m), r.style.left = `${b}px`,
|
|
62
|
+
b > m && (b = m), r.style.left = `${b}px`, j.log(b), e(this, p).left.disabled = b === 0, e(this, p).right.disabled = b >= m - 1;
|
|
63
63
|
}, "refresh"));
|
|
64
|
-
d(this, V, /* @__PURE__ */
|
|
64
|
+
d(this, V, /* @__PURE__ */ a((t) => {
|
|
65
65
|
if (!e(this, p)) return !1;
|
|
66
66
|
const s = e(this, p).container, n = s.querySelector("table");
|
|
67
67
|
if (!n) return !1;
|
|
68
68
|
const r = e(this, p).track.getBoundingClientRect(), o = e(this, p).thumb.clientWidth;
|
|
69
|
-
let
|
|
70
|
-
|
|
69
|
+
let c = t;
|
|
70
|
+
c < 0 && (c = 0);
|
|
71
71
|
const f = r.width - o;
|
|
72
|
-
|
|
72
|
+
c > f && (c = f), c = parseInt(c, 10), e(this, p).thumb.style.left = `${c}px`, e(this, p).left.disabled = c === 0, e(this, p).right.disabled = c >= f - 1;
|
|
73
73
|
const l = s.clientWidth, h = n.scrollWidth;
|
|
74
|
-
let u = f > 0 ? -
|
|
75
|
-
return -u > h - l && (u = -(h - l)), -u + 5 > h - l && (u = -(h - l)), l >= h && (u = 0), n.style.transform = `translateX(${u}px)`,
|
|
74
|
+
let u = f > 0 ? -c * (h - l) / f : 0;
|
|
75
|
+
return -u > h - l && (u = -(h - l)), -u + 5 > h - l && (u = -(h - l)), l >= h && (u = 0), n.style.transform = `translateX(${u}px)`, c > 0 && c < f - 1;
|
|
76
76
|
}, "#thumbMoveTo"));
|
|
77
|
-
d(this,
|
|
78
|
-
const t = /* @__PURE__ */
|
|
77
|
+
d(this, se, /* @__PURE__ */ a(() => {
|
|
78
|
+
const t = /* @__PURE__ */ a((n) => {
|
|
79
79
|
clearInterval(e(this, D)), clearInterval(e(this, N));
|
|
80
80
|
const r = parseInt(e(this, p).thumb.style.left || 0, 10);
|
|
81
81
|
e(this, V).call(this, r + n), y(this, D, setInterval(() => {
|
|
@@ -84,7 +84,7 @@ const ke = class ke extends HTMLElement {
|
|
|
84
84
|
e(this, V).call(this, o + n) || clearInterval(e(this, N));
|
|
85
85
|
}, 50));
|
|
86
86
|
}, 500));
|
|
87
|
-
}, "delayScroll"), s = /* @__PURE__ */
|
|
87
|
+
}, "delayScroll"), s = /* @__PURE__ */ a(() => {
|
|
88
88
|
clearInterval(e(this, D)), clearInterval(e(this, N));
|
|
89
89
|
}, "clearTimer");
|
|
90
90
|
["mouseup", "mouseleave", "touchend"].forEach((n) => {
|
|
@@ -101,11 +101,11 @@ const ke = class ke extends HTMLElement {
|
|
|
101
101
|
}), e(this, p).thumb.addEventListener("mousedown", (n) => {
|
|
102
102
|
if (n.button !== 0) return;
|
|
103
103
|
n.stopPropagation(), n.preventDefault(), y(this, B, !0), this.shiftX = n.clientX - e(this, p).thumb.getBoundingClientRect().left;
|
|
104
|
-
const r = /* @__PURE__ */
|
|
104
|
+
const r = /* @__PURE__ */ a((c) => {
|
|
105
105
|
if (!e(this, B)) return;
|
|
106
106
|
const f = e(this, p).track.getBoundingClientRect();
|
|
107
|
-
e(this, V).call(this,
|
|
108
|
-
}, "onMouseMove"), o = /* @__PURE__ */
|
|
107
|
+
e(this, V).call(this, c.clientX - f.left - this.shiftX);
|
|
108
|
+
}, "onMouseMove"), o = /* @__PURE__ */ a(() => {
|
|
109
109
|
y(this, B, !1), s(), document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", o), this.refresh();
|
|
110
110
|
}, "onMouseUp");
|
|
111
111
|
document.addEventListener("mousemove", r), document.addEventListener("mouseup", o);
|
|
@@ -177,7 +177,7 @@ const ke = class ke extends HTMLElement {
|
|
|
177
177
|
<div class='ng-scroll-track'><div class='ng-scroll-thumb'></div></div>
|
|
178
178
|
<button class='ng-scroll-right' disabled><div class='ng-scroll-icon'></div></button>
|
|
179
179
|
`;
|
|
180
|
-
const t = /* @__PURE__ */
|
|
180
|
+
const t = /* @__PURE__ */ a(() => {
|
|
181
181
|
const s = e(this, L).querySelector(".ng-container-body");
|
|
182
182
|
if (!s) {
|
|
183
183
|
setTimeout(t, 10);
|
|
@@ -189,7 +189,7 @@ const ke = class ke extends HTMLElement {
|
|
|
189
189
|
thumb: this.querySelector(".ng-scroll-thumb"),
|
|
190
190
|
left: this.querySelector(".ng-scroll-left"),
|
|
191
191
|
right: this.querySelector(".ng-scroll-right")
|
|
192
|
-
}), e(this,
|
|
192
|
+
}), e(this, se).call(this), e(this, ie).call(this), this.refresh();
|
|
193
193
|
}, "initWhenReady");
|
|
194
194
|
t();
|
|
195
195
|
}
|
|
@@ -197,27 +197,27 @@ const ke = class ke extends HTMLElement {
|
|
|
197
197
|
e(this, P) && e(this, P).disconnect();
|
|
198
198
|
}
|
|
199
199
|
};
|
|
200
|
-
L = new WeakMap(), B = new WeakMap(), p = new WeakMap(), D = new WeakMap(), N = new WeakMap(), P = new WeakMap(),
|
|
200
|
+
L = new WeakMap(), B = new WeakMap(), p = new WeakMap(), D = new WeakMap(), N = new WeakMap(), P = new WeakMap(), ie = new WeakMap(), V = new WeakMap(), se = new WeakMap(), a(ke, "NineTableHScrollBar");
|
|
201
201
|
let we = ke;
|
|
202
202
|
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", we);
|
|
203
|
-
var _,
|
|
203
|
+
var $, _, E, W, H, M, ne, re, oe, le;
|
|
204
204
|
const Le = class Le {
|
|
205
205
|
constructor(i) {
|
|
206
|
-
d(this,
|
|
207
|
-
d(this,
|
|
206
|
+
d(this, $);
|
|
207
|
+
d(this, _, []);
|
|
208
208
|
d(this, E, null);
|
|
209
209
|
d(this, W, null);
|
|
210
|
+
d(this, H, 0);
|
|
210
211
|
d(this, M, 0);
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
e(this, oe).call(this);
|
|
212
|
+
x(this, "getRowHeight", /* @__PURE__ */ a(() => e(this, E), "getRowHeight"));
|
|
213
|
+
d(this, ne, /* @__PURE__ */ a(() => {
|
|
214
|
+
e(this, re).call(this);
|
|
215
215
|
}, "#init"));
|
|
216
216
|
/**
|
|
217
217
|
* π― λ·°ν¬νΈ ν¬κΈ° λ³ν μμ μ λμ΄ κ³μ° λ° νμν ν κ°μ μ°μ Β·μΊμ±μ μκ²°
|
|
218
218
|
*/
|
|
219
|
-
d(this,
|
|
220
|
-
!e(this,
|
|
219
|
+
d(this, re, /* @__PURE__ */ a(() => {
|
|
220
|
+
!e(this, $) || !(e(this, $) instanceof HTMLElement) || (y(this, W, new ResizeObserver((i) => {
|
|
221
221
|
for (const t of i) {
|
|
222
222
|
const s = t.target;
|
|
223
223
|
if (!s.classList.contains("active"))
|
|
@@ -226,54 +226,50 @@ const Le = class Le {
|
|
|
226
226
|
if (n > 0) {
|
|
227
227
|
const r = s.clientHeight || s.getBoundingClientRect().height || n;
|
|
228
228
|
let o = 0;
|
|
229
|
-
const
|
|
229
|
+
const c = s.querySelector(".ng-container-body") || s, f = c.querySelector("thead"), l = c.querySelector("tfoot");
|
|
230
230
|
f && (o += f.offsetHeight || f.getBoundingClientRect().height), l && (o += l.offsetHeight || l.getBoundingClientRect().height);
|
|
231
231
|
const h = Math.max(r - o, 100);
|
|
232
|
-
if (e(this,
|
|
233
|
-
const u = Math.ceil(e(this,
|
|
234
|
-
y(this,
|
|
232
|
+
if (e(this, H) !== h && (y(this, H, h), e(this, E) !== null)) {
|
|
233
|
+
const u = Math.ceil(e(this, H) / e(this, E));
|
|
234
|
+
y(this, M, u + 20), j.log(`[RowManager] Resized. Height: ${e(this, H)}px | Target Rows: ${e(this, M)}`), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((g) => {
|
|
235
235
|
const b = s.querySelector(g);
|
|
236
|
-
b && b.querySelector("tbody") && e(this,
|
|
236
|
+
b && b.querySelector("tbody") && e(this, le).call(this, b);
|
|
237
237
|
});
|
|
238
238
|
}
|
|
239
239
|
}
|
|
240
240
|
}
|
|
241
|
-
})), e(this, W).observe(e(this,
|
|
241
|
+
})), e(this, W).observe(e(this, $)));
|
|
242
242
|
}, "#initResizeObserver"));
|
|
243
243
|
// π― ν
νλ¦Ώ μΆμΆ, λμ΄ μΈ‘μ , μ΄κΈ° λ λλ§μ μμμ λ§κ² λ΄λΆμμ μΌκ΄ μ²λ¦¬
|
|
244
|
-
x(this, "initialize", /* @__PURE__ */
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((o) => {
|
|
249
|
-
const a = r.querySelector(o);
|
|
250
|
-
a && a.querySelector("tbody") && e(this, J).call(this, a);
|
|
251
|
-
});
|
|
244
|
+
x(this, "initialize", /* @__PURE__ */ a((i) => {
|
|
245
|
+
j.log(i);
|
|
246
|
+
const t = e(this, $).querySelector(".ng-container-body"), s = i.querySelector("tbody"), n = Array.from(s.querySelectorAll("tr"));
|
|
247
|
+
y(this, _, n.map((r) => r.cloneNode(!0))), y(this, E, null), e(this, oe).call(this, t);
|
|
252
248
|
}, "initialize"));
|
|
253
|
-
d(this,
|
|
249
|
+
d(this, oe, /* @__PURE__ */ a((i) => {
|
|
254
250
|
if (e(this, E) !== null && e(this, E) > 0)
|
|
255
251
|
return e(this, E);
|
|
256
|
-
if (e(this,
|
|
252
|
+
if (e(this, _).length === 0)
|
|
257
253
|
throw new Error("[RowManager] Template TRs are empty.");
|
|
258
254
|
const t = i.querySelector("tbody.bindable") || i.querySelector("tbody");
|
|
259
255
|
if (!t) return 24;
|
|
260
256
|
t.querySelectorAll("tr:not(.nodata)").forEach((u) => u.remove());
|
|
261
257
|
const s = t.querySelector("tr.nodata"), n = document.createDocumentFragment();
|
|
262
|
-
e(this,
|
|
258
|
+
e(this, _).forEach((u) => {
|
|
263
259
|
n.appendChild(u.cloneNode(!0));
|
|
264
260
|
}), s ? s.before(n) : t.appendChild(n);
|
|
265
|
-
const r = i.closest("nine-table-sheet"), o = r ? r.style.display : "",
|
|
261
|
+
const r = i.closest("nine-table-sheet"), o = r ? r.style.display : "", c = r ? r.style.visibility : "", f = r ? r.style.position : "";
|
|
266
262
|
r && (r.style.display === "none" || window.getComputedStyle(r).display === "none") && (r.style.display = "block", r.style.visibility = "hidden", r.style.position = "absolute");
|
|
267
263
|
let l = 0;
|
|
268
264
|
const h = t.querySelectorAll("tr:not(.nodata)");
|
|
269
265
|
if (h.forEach((u, g) => {
|
|
270
266
|
l += u.offsetHeight || u.getBoundingClientRect().height;
|
|
271
|
-
}), h.forEach((u) => u.remove()), r && (r.style.display = o, r.style.visibility =
|
|
272
|
-
const u = Math.ceil(e(this,
|
|
273
|
-
y(this,
|
|
267
|
+
}), h.forEach((u) => u.remove()), r && (r.style.display = o, r.style.visibility = c, r.style.position = f), y(this, E, l), e(this, H) > 0) {
|
|
268
|
+
const u = Math.ceil(e(this, H) / e(this, E));
|
|
269
|
+
y(this, M, u + 20);
|
|
274
270
|
} else
|
|
275
|
-
y(this,
|
|
276
|
-
return console.log(`[RowManager] Template Height Cached: ${e(this, E)}px | RowCount: ${e(this,
|
|
271
|
+
y(this, M, 40);
|
|
272
|
+
return console.log(`[RowManager] Template Height Cached: ${e(this, E)}px | RowCount: ${e(this, M)}`), e(this, E);
|
|
277
273
|
}, "#measureAndCacheHeight"));
|
|
278
274
|
/**
|
|
279
275
|
* π― μΊμλ ν κ°μ λ°ν (μμ λλ§ μ΅μνμ λ°©μ΄ μ°μ°)
|
|
@@ -291,39 +287,39 @@ const Le = class Le {
|
|
|
291
287
|
/**
|
|
292
288
|
* π― μΊμλ ν κ°μλ₯Ό κ³§λ°λ‘ κ°μ Έμμ TR λΌλ μ£Όμ
(μ€λ³΅ κ³μ° μ κ±°)
|
|
293
289
|
*/
|
|
294
|
-
d(this,
|
|
295
|
-
if (e(this,
|
|
290
|
+
d(this, le, /* @__PURE__ */ a((i) => {
|
|
291
|
+
if (e(this, _).length === 0) return;
|
|
296
292
|
const t = i.querySelector("tbody.bindable") || i.querySelector("tbody");
|
|
297
293
|
if (!t) return;
|
|
298
294
|
t.querySelectorAll("tr:not(.nodata)").forEach((o) => o.remove());
|
|
299
|
-
const s = t.querySelector("tr.nodata"), n = document.createDocumentFragment(), r = e(this,
|
|
295
|
+
const s = t.querySelector("tr.nodata"), n = document.createDocumentFragment(), r = e(this, M);
|
|
300
296
|
for (let o = 0; o < r; o++)
|
|
301
|
-
e(this,
|
|
302
|
-
n.appendChild(
|
|
297
|
+
e(this, _).forEach((c) => {
|
|
298
|
+
n.appendChild(c.cloneNode(!0));
|
|
303
299
|
});
|
|
304
300
|
s ? s.before(n) : t.appendChild(n), console.log(`[RowManager] Rendered ${r} sets into DOM.`);
|
|
305
301
|
}, "#renderRows"));
|
|
306
|
-
x(this, "destroy", /* @__PURE__ */
|
|
302
|
+
x(this, "destroy", /* @__PURE__ */ a(() => {
|
|
307
303
|
e(this, W) && (e(this, W).disconnect(), y(this, W, null));
|
|
308
304
|
}, "destroy"));
|
|
309
|
-
y(this,
|
|
305
|
+
y(this, $, i), e(this, ne).call(this);
|
|
310
306
|
}
|
|
311
307
|
get templateLength() {
|
|
312
|
-
return e(this,
|
|
308
|
+
return e(this, _).length || 1;
|
|
313
309
|
}
|
|
314
310
|
};
|
|
315
|
-
|
|
311
|
+
$ = new WeakMap(), _ = new WeakMap(), E = new WeakMap(), W = new WeakMap(), H = new WeakMap(), M = new WeakMap(), ne = new WeakMap(), re = new WeakMap(), oe = new WeakMap(), le = new WeakMap(), a(Le, "RowManager");
|
|
316
312
|
let ve = Le;
|
|
317
|
-
var
|
|
318
|
-
const
|
|
313
|
+
var I, U, ae, ce;
|
|
314
|
+
const G = class G extends HTMLElement {
|
|
319
315
|
constructor() {
|
|
320
316
|
super();
|
|
321
|
-
d(this,
|
|
317
|
+
d(this, I, null);
|
|
322
318
|
d(this, U);
|
|
323
|
-
x(this, "generate", /* @__PURE__ */
|
|
319
|
+
x(this, "generate", /* @__PURE__ */ a((t) => {
|
|
324
320
|
if (!t) return;
|
|
325
|
-
const s = /* @__PURE__ */
|
|
326
|
-
const h = /* @__PURE__ */
|
|
321
|
+
const s = /* @__PURE__ */ a((l) => {
|
|
322
|
+
const h = /* @__PURE__ */ a((g) => {
|
|
327
323
|
if (g.querySelector("colgroup")) return;
|
|
328
324
|
const b = g.querySelector("tbody tr") || g.querySelector("tr"), m = b ? b.querySelectorAll("th, td").length : 1, R = document.createElement("colgroup"), T = Math.max(Math.floor(g.clientWidth / m), 100);
|
|
329
325
|
for (let C = 0; C < m; C++) {
|
|
@@ -331,15 +327,15 @@ const j = class j extends HTMLElement {
|
|
|
331
327
|
Y.setAttribute("width", T), R.appendChild(Y);
|
|
332
328
|
}
|
|
333
329
|
g.prepend(R);
|
|
334
|
-
}, "ensureColgroup"), u = /* @__PURE__ */
|
|
330
|
+
}, "ensureColgroup"), u = /* @__PURE__ */ a((g) => {
|
|
335
331
|
if (g.querySelector("thead")) return;
|
|
336
332
|
const b = document.createElement("thead"), m = g.querySelector("colgroup");
|
|
337
333
|
m ? m.after(b) : g.prepend(b);
|
|
338
334
|
}, "ensureThead");
|
|
339
335
|
return h(l), u(l), l.classList.add("nine-table-element"), l;
|
|
340
336
|
}, "initializeTable"), n = t.cloneNode(!0);
|
|
341
|
-
y(this,
|
|
342
|
-
const r = this.querySelector(".ng-container-left"), o = this.querySelector(".ng-container-body"),
|
|
337
|
+
y(this, I, s(n)), e(this, I).style.display = "table";
|
|
338
|
+
const r = this.querySelector(".ng-container-left"), o = this.querySelector(".ng-container-body"), c = this.querySelector(".ng-container-right"), f = /* @__PURE__ */ a((l, h, u = !1) => {
|
|
343
339
|
const g = l.cloneNode(!0), b = Array.from(g.querySelectorAll("colgroup col")), m = [];
|
|
344
340
|
return b.forEach((R, T) => {
|
|
345
341
|
const C = R.getAttribute("fixed");
|
|
@@ -353,11 +349,11 @@ const j = class j extends HTMLElement {
|
|
|
353
349
|
}), g;
|
|
354
350
|
}, "filterTableByFixed");
|
|
355
351
|
if (o) {
|
|
356
|
-
const l = f(e(this,
|
|
357
|
-
o.innerHTML = "", o.appendChild(l), e(this, U).initialize(e(this,
|
|
352
|
+
const l = f(e(this, I), null, !0);
|
|
353
|
+
o.innerHTML = "", o.appendChild(l), e(this, U).initialize(e(this, I));
|
|
358
354
|
}
|
|
359
355
|
if (r) {
|
|
360
|
-
const l = f(e(this,
|
|
356
|
+
const l = f(e(this, I), "left", !1);
|
|
361
357
|
let h = 0;
|
|
362
358
|
l.querySelectorAll("col").forEach((g) => {
|
|
363
359
|
const b = parseInt(g.getAttribute("width"), 10);
|
|
@@ -366,15 +362,15 @@ const j = class j extends HTMLElement {
|
|
|
366
362
|
const u = h > 0 ? h : 0;
|
|
367
363
|
r.style.flex = `0 0 ${u}px`, r.style.width = `${u}px`;
|
|
368
364
|
}
|
|
369
|
-
if (
|
|
370
|
-
const l = f(e(this,
|
|
365
|
+
if (c) {
|
|
366
|
+
const l = f(e(this, I), "right", !1);
|
|
371
367
|
let h = 0;
|
|
372
368
|
l.querySelectorAll("col").forEach((g) => {
|
|
373
369
|
const b = parseInt(g.getAttribute("width"), 10);
|
|
374
370
|
isNaN(b) || (h += b);
|
|
375
|
-
}),
|
|
371
|
+
}), c.innerHTML = "", c.appendChild(l);
|
|
376
372
|
const u = h > 0 ? h : 0;
|
|
377
|
-
|
|
373
|
+
c.style.flex = `0 0 ${u}px`, c.style.width = `${u}px`;
|
|
378
374
|
}
|
|
379
375
|
o && o.addEventListener("scroll", () => {
|
|
380
376
|
var l;
|
|
@@ -384,35 +380,35 @@ const j = class j extends HTMLElement {
|
|
|
384
380
|
(l = this.querySelector("nine-table-hscrollbar")) == null || l.refresh();
|
|
385
381
|
}, 0);
|
|
386
382
|
}, "generate"));
|
|
387
|
-
x(this, "getRowHeight", /* @__PURE__ */
|
|
383
|
+
x(this, "getRowHeight", /* @__PURE__ */ a(() => e(this, U).getRowHeight(), "getRowHeight"));
|
|
388
384
|
/**
|
|
389
385
|
getRowCount = () => {
|
|
390
386
|
if (!this.#tableElement) return 0;
|
|
391
387
|
return this.#tableElement.querySelectorAll('tbody tr').length;
|
|
392
388
|
}; */
|
|
393
|
-
x(this, "scrollToX", /* @__PURE__ */
|
|
389
|
+
x(this, "scrollToX", /* @__PURE__ */ a((t) => {
|
|
394
390
|
const s = this.querySelector(".ng-container-body");
|
|
395
391
|
s && (s.scrollLeft = t);
|
|
396
392
|
}, "scrollToX"));
|
|
397
|
-
x(this, "scrollToY", /* @__PURE__ */
|
|
393
|
+
x(this, "scrollToY", /* @__PURE__ */ a((t) => {
|
|
398
394
|
const s = this.querySelector(".ng-container-body");
|
|
399
395
|
s && (s.scrollTop = t);
|
|
400
396
|
}, "scrollToY"));
|
|
401
|
-
d(this, ae, /* @__PURE__ */
|
|
397
|
+
d(this, ae, /* @__PURE__ */ a(() => {
|
|
402
398
|
e(this, ce).call(this), new MutationObserver((t) => {
|
|
403
|
-
const s = /* @__PURE__ */
|
|
399
|
+
const s = /* @__PURE__ */ a(() => {
|
|
404
400
|
requestAnimationFrame(() => {
|
|
405
401
|
var u, g, b;
|
|
406
402
|
const n = this.querySelector(".ng-container-left table"), r = this.querySelector(".ng-container-body table"), o = this.querySelector(".ng-container-right table");
|
|
407
403
|
if (!r) return;
|
|
408
|
-
const
|
|
404
|
+
const c = n ? Array.from(n.querySelectorAll("tr")) : [], f = Array.from(r.querySelectorAll("tr")), l = o ? Array.from(o.querySelectorAll("tr")) : [], h = Math.max(c.length, f.length, l.length);
|
|
409
405
|
for (let m = 0; m < h; m++) {
|
|
410
406
|
const R = [
|
|
411
|
-
((u =
|
|
407
|
+
((u = c[m]) == null ? void 0 : u.getBoundingClientRect().height) || 0,
|
|
412
408
|
((g = f[m]) == null ? void 0 : g.getBoundingClientRect().height) || 0,
|
|
413
409
|
((b = l[m]) == null ? void 0 : b.getBoundingClientRect().height) || 0
|
|
414
410
|
], T = Math.max(...R);
|
|
415
|
-
T > 0 && (
|
|
411
|
+
T > 0 && (c[m] && (c[m].style.height = `${T}px`), f[m] && (f[m].style.height = `${T}px`), l[m] && (l[m].style.height = `${T}px`));
|
|
416
412
|
}
|
|
417
413
|
});
|
|
418
414
|
}, "syncRowHeights");
|
|
@@ -420,8 +416,8 @@ const j = class j extends HTMLElement {
|
|
|
420
416
|
n.attributeName === "class" && this.classList.contains("active") && s();
|
|
421
417
|
}).observe(this, { attributes: !0 });
|
|
422
418
|
}, "#init"));
|
|
423
|
-
d(this, ce, /* @__PURE__ */
|
|
424
|
-
const t =
|
|
419
|
+
d(this, ce, /* @__PURE__ */ a(() => {
|
|
420
|
+
const t = G.SCROLLBAR_SIZE;
|
|
425
421
|
this.innerHTML = `
|
|
426
422
|
<style>
|
|
427
423
|
nine-table-sheet {
|
|
@@ -552,26 +548,26 @@ const j = class j extends HTMLElement {
|
|
|
552
548
|
e(this, ae).call(this);
|
|
553
549
|
}
|
|
554
550
|
disconnectedCallback() {
|
|
555
|
-
this.innerHTML = "",
|
|
551
|
+
this.innerHTML = "", j.log("NineTableSheet destroyed.");
|
|
556
552
|
}
|
|
557
553
|
};
|
|
558
|
-
|
|
559
|
-
let
|
|
560
|
-
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet",
|
|
561
|
-
var he,
|
|
554
|
+
I = new WeakMap(), U = new WeakMap(), ae = new WeakMap(), ce = new WeakMap(), a(G, "NineTableSheet"), x(G, "SCROLLBAR_SIZE", 16);
|
|
555
|
+
let te = G;
|
|
556
|
+
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", te);
|
|
557
|
+
var he, J;
|
|
562
558
|
const Ce = class Ce extends HTMLElement {
|
|
563
559
|
constructor() {
|
|
564
560
|
super();
|
|
565
|
-
d(this, he, /* @__PURE__ */
|
|
561
|
+
d(this, he, /* @__PURE__ */ a(() => {
|
|
566
562
|
var t;
|
|
567
563
|
(t = this.querySelector(".nine-tab-bar")) == null || t.addEventListener("click", (s) => {
|
|
568
564
|
var o;
|
|
569
565
|
const n = s.ctrlKey || s.metaKey || s.shiftKey, r = parseInt((o = s.target.closest(".nine-tab-item")) == null ? void 0 : o.dataset.index, 10);
|
|
570
|
-
e(this,
|
|
571
|
-
}), e(this,
|
|
566
|
+
e(this, J).call(this, r, n);
|
|
567
|
+
}), e(this, J).call(this, 0, !1);
|
|
572
568
|
}, "#init"));
|
|
573
|
-
d(this,
|
|
574
|
-
const n = /* @__PURE__ */
|
|
569
|
+
d(this, J, /* @__PURE__ */ a((t, s = !1) => {
|
|
570
|
+
const n = /* @__PURE__ */ a(() => {
|
|
575
571
|
const h = Array.from(this.querySelectorAll("nine-table-sheet"));
|
|
576
572
|
Array.from(this.querySelectorAll("nine-splitter")).forEach((b) => b.style.setProperty("display", "none"));
|
|
577
573
|
const g = h.filter((b) => b.classList.contains("active"));
|
|
@@ -579,17 +575,17 @@ const Ce = class Ce extends HTMLElement {
|
|
|
579
575
|
const m = parseInt(b.getAttribute("data-index"), 10), R = this.querySelector(`nine-splitter[data-split-index="${m}"]`), T = h[m + 1];
|
|
580
576
|
R && T && T.classList.contains("active") && R.style.setProperty("display", "flex");
|
|
581
577
|
});
|
|
582
|
-
}, "updateSplitters"), r = this.querySelector(".nine-tab-bar"), o = this.querySelector("nine-table-sheets-body"),
|
|
583
|
-
if (!
|
|
578
|
+
}, "updateSplitters"), r = this.querySelector(".nine-tab-bar"), o = this.querySelector("nine-table-sheets-body"), c = r.querySelectorAll(".nine-tab-item"), f = o.querySelectorAll("nine-table-sheet");
|
|
579
|
+
if (!c[t]) return;
|
|
584
580
|
if (!s)
|
|
585
|
-
|
|
581
|
+
c.forEach((h, u) => {
|
|
586
582
|
h.classList.toggle("active", u === t);
|
|
587
583
|
}), f.forEach((h, u) => {
|
|
588
584
|
const g = u === t;
|
|
589
585
|
h.classList.toggle("active", g), h.style.flex = g ? "1 1 100%" : "";
|
|
590
586
|
});
|
|
591
587
|
else {
|
|
592
|
-
const h =
|
|
588
|
+
const h = c[t], u = r.querySelectorAll(".nine-tab-item.active");
|
|
593
589
|
if (h.classList.contains("active") && u.length <= 1)
|
|
594
590
|
return;
|
|
595
591
|
h.classList.toggle("active");
|
|
@@ -606,27 +602,27 @@ const Ce = class Ce extends HTMLElement {
|
|
|
606
602
|
e(this, he).call(this);
|
|
607
603
|
}
|
|
608
604
|
};
|
|
609
|
-
he = new WeakMap(),
|
|
605
|
+
he = new WeakMap(), J = new WeakMap(), a(Ce, "NineTableSheets");
|
|
610
606
|
let xe = Ce;
|
|
611
607
|
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", xe);
|
|
612
|
-
var S, de,
|
|
608
|
+
var S, de, Q, fe;
|
|
613
609
|
const _e = class _e {
|
|
614
610
|
constructor(i) {
|
|
615
611
|
d(this, S);
|
|
616
|
-
d(this, de, /* @__PURE__ */
|
|
612
|
+
d(this, de, /* @__PURE__ */ a(() => {
|
|
617
613
|
e(this, fe).call(this), new ResizeObserver((i) => {
|
|
618
614
|
for (let t of i)
|
|
619
|
-
e(this, S).getAttribute("auto-height") === "true" && e(this,
|
|
615
|
+
e(this, S).getAttribute("auto-height") === "true" && e(this, Q).call(this);
|
|
620
616
|
}).observe(e(this, S));
|
|
621
617
|
}, "#init"));
|
|
622
|
-
d(this,
|
|
618
|
+
d(this, Q, /* @__PURE__ */ a(() => {
|
|
623
619
|
var f, l;
|
|
624
620
|
const i = Array.from(e(this, S).shadowRoot.querySelectorAll("nine-table-sheet.active"));
|
|
625
621
|
if (i.length === 0) return;
|
|
626
|
-
const t = parseInt(e(this, S).getAttribute("max-display-row"), 10) || 10, s = Math.max(...i.map((h) => h.getRowHeight())), n = (f = e(this, S).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : f.getBoundingClientRect().height, r = (l = e(this, S).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : l.getBoundingClientRect().height, o =
|
|
627
|
-
e(this, S).style.height = `${
|
|
622
|
+
const t = parseInt(e(this, S).getAttribute("max-display-row"), 10) || 10, s = Math.max(...i.map((h) => h.getRowHeight())), n = (f = e(this, S).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : f.getBoundingClientRect().height, r = (l = e(this, S).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : l.getBoundingClientRect().height, o = te.SCROLLBAR_SIZE, c = t * s + n + r + o;
|
|
623
|
+
e(this, S).style.height = `${c}px`;
|
|
628
624
|
}, "#applyAutoHeight"));
|
|
629
|
-
d(this, fe, /* @__PURE__ */
|
|
625
|
+
d(this, fe, /* @__PURE__ */ a(() => {
|
|
630
626
|
const t = Array.from(e(this, S).children).filter((f) => f.tagName === "TABLE"), s = e(this, S).getAttribute("auto-height") === "true", n = t.length, r = t.map((f, l) => {
|
|
631
627
|
const u = `<nine-table-sheet class="${l === 0 ? "active" : ""}" data-index="${l}"></nine-table-sheet>`, g = l < n - 1 ? `<nine-splitter class="h" data-split-index="${l}"></nine-splitter>` : "";
|
|
632
628
|
return u + g;
|
|
@@ -730,24 +726,24 @@ const _e = class _e {
|
|
|
730
726
|
</nine-table-body>
|
|
731
727
|
<nine-table-footer></nine-table-footer>
|
|
732
728
|
`;
|
|
733
|
-
const
|
|
734
|
-
|
|
729
|
+
const c = e(this, S).shadowRoot.querySelectorAll("nine-table-sheet");
|
|
730
|
+
c == null || c.forEach((f, l) => {
|
|
735
731
|
t[l] && setTimeout(() => {
|
|
736
|
-
f.generate(t[l]), s && e(this,
|
|
732
|
+
f.generate(t[l]), s && e(this, Q).call(this);
|
|
737
733
|
});
|
|
738
734
|
});
|
|
739
735
|
}, "#render"));
|
|
740
736
|
y(this, S, i), e(this, de).call(this);
|
|
741
737
|
}
|
|
742
738
|
};
|
|
743
|
-
S = new WeakMap(), de = new WeakMap(),
|
|
739
|
+
S = new WeakMap(), de = new WeakMap(), Q = new WeakMap(), fe = new WeakMap(), a(_e, "LayoutManager");
|
|
744
740
|
let Se = _e;
|
|
745
741
|
var z, X;
|
|
746
742
|
const He = class He {
|
|
747
743
|
constructor(i) {
|
|
748
744
|
d(this, z);
|
|
749
745
|
d(this, X, -1);
|
|
750
|
-
x(this, "count", /* @__PURE__ */
|
|
746
|
+
x(this, "count", /* @__PURE__ */ a(() => e(this, z).rawRecords.length, "count"));
|
|
751
747
|
y(this, z, i);
|
|
752
748
|
}
|
|
753
749
|
get at() {
|
|
@@ -763,31 +759,31 @@ const He = class He {
|
|
|
763
759
|
});
|
|
764
760
|
}
|
|
765
761
|
};
|
|
766
|
-
z = new WeakMap(), X = new WeakMap(),
|
|
762
|
+
z = new WeakMap(), X = new WeakMap(), a(He, "ngRow");
|
|
767
763
|
let Re = He;
|
|
768
|
-
var
|
|
764
|
+
var A, v, q, K, ue, O, ge, ee, be, ye, Z;
|
|
769
765
|
const k = class k {
|
|
770
766
|
constructor(i, t) {
|
|
771
|
-
d(this,
|
|
767
|
+
d(this, A);
|
|
772
768
|
d(this, v);
|
|
773
|
-
d(this,
|
|
769
|
+
d(this, q, []);
|
|
774
770
|
d(this, K, []);
|
|
775
771
|
d(this, ue, 0);
|
|
776
772
|
d(this, O, []);
|
|
777
|
-
d(this, ge, /* @__PURE__ */
|
|
773
|
+
d(this, ge, /* @__PURE__ */ a(() => {
|
|
778
774
|
y(this, O, []);
|
|
779
|
-
const i = e(this,
|
|
775
|
+
const i = e(this, A).template || [];
|
|
780
776
|
Array.from(i).forEach((t) => {
|
|
781
777
|
var s;
|
|
782
778
|
e(this, O).push(((s = t.getBoundingClientRect) == null ? void 0 : s.call(t).height) || 24);
|
|
783
779
|
}), (e(this, v).rawRecords || []).forEach((t) => {
|
|
784
|
-
t.__ng || (t.__ng = e(this,
|
|
780
|
+
t.__ng || (t.__ng = e(this, ee).call(this)), t.__ng.height = e(this, O).slice();
|
|
785
781
|
});
|
|
786
782
|
}, "#initialize"));
|
|
787
|
-
x(this, "set", /* @__PURE__ */
|
|
783
|
+
x(this, "set", /* @__PURE__ */ a((i) => {
|
|
788
784
|
this.clear(), this.add(i, !1);
|
|
789
785
|
}, "set"));
|
|
790
|
-
d(this,
|
|
786
|
+
d(this, ee, /* @__PURE__ */ a(() => ({
|
|
791
787
|
rowState: k.ROW_STATE.EMPTY,
|
|
792
788
|
deleted: !1,
|
|
793
789
|
filtered: !1,
|
|
@@ -796,94 +792,94 @@ const k = class k {
|
|
|
796
792
|
c: {},
|
|
797
793
|
_: [0, 0, 0, 0, k.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, e(this, O).slice(), -1, {}, {}]
|
|
798
794
|
}), "#getDefaultMeta"));
|
|
799
|
-
x(this, "reset", /* @__PURE__ */
|
|
800
|
-
y(this,
|
|
795
|
+
x(this, "reset", /* @__PURE__ */ a(() => {
|
|
796
|
+
y(this, q, []), y(this, K, []);
|
|
801
797
|
}, "reset"));
|
|
802
|
-
x(this, "clear", /* @__PURE__ */
|
|
798
|
+
x(this, "clear", /* @__PURE__ */ a(() => {
|
|
803
799
|
var i;
|
|
804
|
-
e(this, v).rawRecords = [], y(this,
|
|
800
|
+
e(this, v).rawRecords = [], y(this, q, []), y(this, K, []), (i = e(this, v).viewRecords) != null && i.reset && e(this, v).viewRecords.reset();
|
|
805
801
|
}, "clear"));
|
|
806
|
-
d(this, be, /* @__PURE__ */
|
|
802
|
+
d(this, be, /* @__PURE__ */ a((i) => {
|
|
807
803
|
var n;
|
|
808
804
|
Array.isArray(i) || (i = [i]);
|
|
809
|
-
const t = typeof ((n = e(this,
|
|
805
|
+
const t = typeof ((n = e(this, A).fields) == null ? void 0 : n.get) == "function" ? e(this, A).fields.get() : Object.keys(i[0] || {}), s = [];
|
|
810
806
|
return i.forEach((r) => {
|
|
811
807
|
const o = { v: [] };
|
|
812
|
-
t.forEach((
|
|
813
|
-
o.v.push(r[
|
|
808
|
+
t.forEach((c) => {
|
|
809
|
+
o.v.push(r[c] !== void 0 && r[c] !== null ? r[c] : "");
|
|
814
810
|
}), s.push(o);
|
|
815
811
|
}), s;
|
|
816
812
|
}, "#json2Array"));
|
|
817
|
-
d(this, ye, /* @__PURE__ */
|
|
818
|
-
t.__ng = e(this,
|
|
813
|
+
d(this, ye, /* @__PURE__ */ a((i) => (Array.isArray(i) || (i = [i]), i.forEach((t) => {
|
|
814
|
+
t.__ng = e(this, ee).call(this), t.__ng.rowid = this.nextId, t.__ng.rowState = k.ROW_STATE.INSERT, t.__ng._[0] = t.__ng.rowid;
|
|
819
815
|
}), i), "#defaultInsert"));
|
|
820
|
-
x(this, "add", /* @__PURE__ */
|
|
816
|
+
x(this, "add", /* @__PURE__ */ a((i, t = !0) => {
|
|
821
817
|
var r;
|
|
822
818
|
i === void 0 && (i = {});
|
|
823
819
|
const s = e(this, be).call(this, i);
|
|
824
820
|
e(this, v).rawRecords = e(this, v).rawRecords.concat(e(this, ye).call(this, s)), this.resetRecords();
|
|
825
821
|
const n = this.count() - 1;
|
|
826
|
-
return t || s.forEach((o,
|
|
827
|
-
const f = e(this, v).rawRecords[n -
|
|
822
|
+
return t || s.forEach((o, c) => {
|
|
823
|
+
const f = e(this, v).rawRecords[n - c];
|
|
828
824
|
f && (f.__ng.rowState = k.ROW_STATE.EMPTY);
|
|
829
825
|
}), (r = e(this, v).viewRecords) != null && r.reset && e(this, v).viewRecords.reset(), n;
|
|
830
826
|
}, "add"));
|
|
831
|
-
x(this, "delete", /* @__PURE__ */
|
|
827
|
+
x(this, "delete", /* @__PURE__ */ a((i) => {
|
|
832
828
|
var s;
|
|
833
829
|
let t = [];
|
|
834
830
|
Array.isArray(i) ? t = i : typeof i > "u" ? t = [e(this, v).owner.row.at] : t = [parseInt(i, 10)], t.sort((n, r) => r - n).forEach((n) => {
|
|
835
|
-
if (e(this,
|
|
836
|
-
const r = e(this,
|
|
837
|
-
e(this,
|
|
831
|
+
if (e(this, q)[n]) {
|
|
832
|
+
const r = e(this, q)[n].__ng.rowid;
|
|
833
|
+
e(this, q)[n].__ng.rowState === k.ROW_STATE.INSERT ? e(this, v).rawRecords = e(this, v).rawRecords.filter((o) => o.__ng.rowid !== r) : e(this, v).rawRecords.forEach((o) => {
|
|
838
834
|
o.__ng.rowid === r && (o.__ng.deleted = !0, o.__ng.rowState = k.ROW_STATE.DELETE);
|
|
839
835
|
});
|
|
840
836
|
}
|
|
841
837
|
}), this.resetRecords(), (s = e(this, v).viewRecords) != null && s.reset && e(this, v).viewRecords.reset();
|
|
842
838
|
}, "delete"));
|
|
843
|
-
x(this, "setValue", /* @__PURE__ */
|
|
839
|
+
x(this, "setValue", /* @__PURE__ */ a((i, t, s) => {
|
|
844
840
|
var f;
|
|
845
841
|
i = parseInt(i, 10);
|
|
846
|
-
const r = (typeof ((f = e(this,
|
|
842
|
+
const r = (typeof ((f = e(this, A).fields) == null ? void 0 : f.get) == "function" ? e(this, A).fields.get() : []).indexOf(t);
|
|
847
843
|
if (r < 0) return;
|
|
848
844
|
const o = this.getValidData()[i];
|
|
849
845
|
if (!o) return;
|
|
850
|
-
const
|
|
851
|
-
|
|
846
|
+
const c = o.v[r];
|
|
847
|
+
c !== s && o.__ng.rowState !== k.ROW_STATE.INSERT && (o.__ng.o.hasOwnProperty(t) || (o.__ng.o[t] = c), o.__ng.rowState = k.ROW_STATE.UPDATE), o.v[r] = s, e(this, v).owner.refreshData && e(this, v).owner.refreshData(i);
|
|
852
848
|
}, "setValue"));
|
|
853
|
-
x(this, "resetRecords", /* @__PURE__ */
|
|
854
|
-
y(this, K, e(this, v).rawRecords.filter((i) => !i.__ng.deleted)), y(this,
|
|
849
|
+
x(this, "resetRecords", /* @__PURE__ */ a(() => {
|
|
850
|
+
y(this, K, e(this, v).rawRecords.filter((i) => !i.__ng.deleted)), y(this, q, e(this, v).rawRecords.filter((i) => !i.__ng.deleted && !i.__ng.filtered)), e(this, v).rawRecords.forEach((i, t) => {
|
|
855
851
|
i.__ng.rowidx = t;
|
|
856
|
-
}), e(this,
|
|
852
|
+
}), e(this, q).forEach((i, t) => {
|
|
857
853
|
i.__ng.i = t;
|
|
858
854
|
});
|
|
859
855
|
}, "resetRecords"));
|
|
860
|
-
x(this, "getValidData", /* @__PURE__ */
|
|
861
|
-
d(this, Z, /* @__PURE__ */
|
|
856
|
+
x(this, "getValidData", /* @__PURE__ */ a(() => (e(this, q).length === 0 && e(this, v).rawRecords.length > 0 && this.resetRecords(), e(this, q)), "getValidData"));
|
|
857
|
+
d(this, Z, /* @__PURE__ */ a((i) => {
|
|
862
858
|
var s;
|
|
863
859
|
if (!i) return i;
|
|
864
|
-
const t = typeof ((s = e(this,
|
|
860
|
+
const t = typeof ((s = e(this, A).fields) == null ? void 0 : s.get) == "function" ? e(this, A).fields.get() : [];
|
|
865
861
|
return Array.isArray(i) ? i.filter((n) => !n.__ng.deleted).map((n) => {
|
|
866
862
|
const r = {};
|
|
867
|
-
return t.forEach((o,
|
|
868
|
-
r[o] = n.v ? n.v[
|
|
863
|
+
return t.forEach((o, c) => {
|
|
864
|
+
r[o] = n.v ? n.v[c] : n[o];
|
|
869
865
|
}), r.__ng = n.__ng, r;
|
|
870
866
|
}) : i;
|
|
871
867
|
}, "#conv2"));
|
|
872
|
-
x(this, "count", /* @__PURE__ */
|
|
873
|
-
x(this, "get", /* @__PURE__ */
|
|
868
|
+
x(this, "count", /* @__PURE__ */ a(() => this.getValidData().length, "count"));
|
|
869
|
+
x(this, "get", /* @__PURE__ */ a((i, t) => {
|
|
874
870
|
var r;
|
|
875
871
|
const s = this.getValidData();
|
|
876
872
|
if (!s || s.length <= 0) return;
|
|
877
873
|
if (i == null) return e(this, Z).call(this, s);
|
|
878
874
|
if (i < 0 || i >= s.length) return null;
|
|
879
|
-
const n = typeof ((r = e(this,
|
|
875
|
+
const n = typeof ((r = e(this, A).fields) == null ? void 0 : r.get) == "function" ? e(this, A).fields.get() : [];
|
|
880
876
|
if (t != null) {
|
|
881
877
|
const o = n.indexOf(t);
|
|
882
878
|
return o >= 0 ? s[i].v[o] : null;
|
|
883
879
|
}
|
|
884
880
|
return e(this, Z).call(this, s[i]);
|
|
885
881
|
}, "get"));
|
|
886
|
-
y(this,
|
|
882
|
+
y(this, A, i), y(this, v, t), e(this, ge).call(this);
|
|
887
883
|
}
|
|
888
884
|
get source() {
|
|
889
885
|
return e(this, Z).call(this, e(this, v).rawRecords);
|
|
@@ -895,13 +891,13 @@ const k = class k {
|
|
|
895
891
|
return ++Oe(this, ue)._;
|
|
896
892
|
}
|
|
897
893
|
get length() {
|
|
898
|
-
return e(this,
|
|
894
|
+
return e(this, q).length;
|
|
899
895
|
}
|
|
900
896
|
getRowCount() {
|
|
901
897
|
return this.length;
|
|
902
898
|
}
|
|
903
899
|
};
|
|
904
|
-
|
|
900
|
+
A = new WeakMap(), v = new WeakMap(), q = new WeakMap(), K = new WeakMap(), ue = new WeakMap(), O = new WeakMap(), ge = new WeakMap(), ee = new WeakMap(), be = new WeakMap(), ye = new WeakMap(), Z = new WeakMap(), a(k, "ngData"), // π― ν μν μ μ μμλ₯Ό ν΄λμ€ λ΄λΆλ‘ λ΄μ¬ν
|
|
905
901
|
x(k, "ROW_STATE", {
|
|
906
902
|
EMPTY: "EMPTY",
|
|
907
903
|
NORMAL: "NORMAL",
|
|
@@ -929,7 +925,7 @@ const Me = class Me {
|
|
|
929
925
|
}, this.setDataSource([]);
|
|
930
926
|
}
|
|
931
927
|
};
|
|
932
|
-
|
|
928
|
+
a(Me, "ngDataManager");
|
|
933
929
|
let Te = Me;
|
|
934
930
|
var F, pe;
|
|
935
931
|
const Ie = class Ie extends HTMLElement {
|
|
@@ -941,10 +937,10 @@ const Ie = class Ie extends HTMLElement {
|
|
|
941
937
|
this.attachShadow({ mode: "open" }), y(this, F, new Te(this));
|
|
942
938
|
}
|
|
943
939
|
connectedCallback() {
|
|
944
|
-
y(this, pe, new Se(this)),
|
|
940
|
+
y(this, pe, new Se(this)), j.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
|
|
945
941
|
}
|
|
946
942
|
disconnectedCallback() {
|
|
947
|
-
|
|
943
|
+
j.log("NineTable disconnected.");
|
|
948
944
|
}
|
|
949
945
|
// π― μΈλΆμμ grid.data.set(...) ννλ‘ μ κ·Όν μ μλλ‘ λ°μ΄ν° λ§€λμ μ€ν
|
|
950
946
|
get data() {
|
|
@@ -959,7 +955,7 @@ const Ie = class Ie extends HTMLElement {
|
|
|
959
955
|
return e(this, F);
|
|
960
956
|
}
|
|
961
957
|
};
|
|
962
|
-
F = new WeakMap(), pe = new WeakMap(),
|
|
963
|
-
let
|
|
964
|
-
customElements.get("nine-table") || customElements.define("nine-table",
|
|
958
|
+
F = new WeakMap(), pe = new WeakMap(), a(Ie, "NineTable");
|
|
959
|
+
let Ae = Ie;
|
|
960
|
+
customElements.get("nine-table") || customElements.define("nine-table", Ae);
|
|
965
961
|
//# sourceMappingURL=nine-table.js.map
|