@ninebone/table 0.0.156 β 0.0.157
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 +195 -199
- package/dist/nine-table.js.map +1 -1
- package/dist/nine-table.umd.js +6 -7
- package/dist/nine-table.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/nine-table.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
throw TypeError(
|
|
1
|
+
var $e = Object.defineProperty;
|
|
2
|
+
var Me = (m) => {
|
|
3
|
+
throw TypeError(m);
|
|
4
4
|
};
|
|
5
|
-
var ze = (
|
|
6
|
-
var
|
|
7
|
-
var v = (
|
|
8
|
-
var e = (
|
|
9
|
-
var He = (
|
|
5
|
+
var ze = (m, s, t) => s in m ? $e(m, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : m[s] = t;
|
|
6
|
+
var l = (m, s) => $e(m, "name", { value: s, configurable: !0 });
|
|
7
|
+
var v = (m, s, t) => ze(m, typeof s != "symbol" ? s + "" : s, t), Ie = (m, s, t) => s.has(m) || Me("Cannot " + t);
|
|
8
|
+
var e = (m, s, t) => (Ie(m, s, "read from private field"), t ? t.call(m) : s.get(m)), u = (m, s, t) => s.has(m) ? Me("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(m) : s.set(m, t), p = (m, s, t, i) => (Ie(m, s, "write to private field"), i ? i.call(m, t) : s.set(m, t), t);
|
|
9
|
+
var He = (m, s, t, i) => ({
|
|
10
10
|
set _(n) {
|
|
11
|
-
p(
|
|
11
|
+
p(m, s, n, t);
|
|
12
12
|
},
|
|
13
13
|
get _() {
|
|
14
|
-
return e(
|
|
14
|
+
return e(m, s, i);
|
|
15
15
|
}
|
|
16
16
|
});
|
|
17
17
|
import { trace as We } from "@ninebone/util";
|
|
@@ -20,32 +20,32 @@ const Re = class Re extends We.constructor {
|
|
|
20
20
|
super(), this.init("nine-table", "green");
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
|
-
|
|
23
|
+
l(Re, "Trace");
|
|
24
24
|
let be = Re;
|
|
25
|
-
const
|
|
26
|
-
var
|
|
25
|
+
const j = new be();
|
|
26
|
+
var L, O, y, B, D, N, ee, P, te;
|
|
27
27
|
const Te = class Te extends HTMLElement {
|
|
28
28
|
constructor() {
|
|
29
29
|
super();
|
|
30
|
-
u(this,
|
|
30
|
+
u(this, L);
|
|
31
31
|
u(this, O, !1);
|
|
32
32
|
u(this, y);
|
|
33
33
|
u(this, B);
|
|
34
34
|
u(this, D);
|
|
35
35
|
u(this, N);
|
|
36
|
-
u(this, ee, /* @__PURE__ */
|
|
37
|
-
if (!e(this,
|
|
38
|
-
const t = e(this,
|
|
36
|
+
u(this, ee, /* @__PURE__ */ l(() => {
|
|
37
|
+
if (!e(this, L)) return;
|
|
38
|
+
const t = e(this, L).querySelector(".ng-container-body");
|
|
39
39
|
t && (p(this, N, new ResizeObserver(() => {
|
|
40
40
|
this.refresh();
|
|
41
41
|
})), e(this, N).observe(t));
|
|
42
42
|
}, "#observeResize"));
|
|
43
|
-
v(this, "refresh", /* @__PURE__ */
|
|
44
|
-
if (!e(this,
|
|
43
|
+
v(this, "refresh", /* @__PURE__ */ l(() => {
|
|
44
|
+
if (!e(this, L) || !e(this, y) || e(this, O)) return;
|
|
45
45
|
const t = e(this, y).container, i = t.querySelector("table");
|
|
46
46
|
if (!i) return;
|
|
47
|
-
const n = e(this, y).track, o = e(this, y).thumb, r = e(this,
|
|
48
|
-
if (
|
|
47
|
+
const n = e(this, y).track, o = e(this, y).thumb, r = e(this, L).querySelector(".ng-container-bottom"), a = t.clientWidth, g = i.scrollWidth;
|
|
48
|
+
if (a !== 0 && g > a)
|
|
49
49
|
r && (r.style.display = "flex");
|
|
50
50
|
else {
|
|
51
51
|
r && (r.style.display = "none");
|
|
@@ -53,7 +53,7 @@ const Te = class Te extends HTMLElement {
|
|
|
53
53
|
}
|
|
54
54
|
const c = n.clientWidth;
|
|
55
55
|
if (c <= 0) return;
|
|
56
|
-
const h = Math.max(Math.min(c * (
|
|
56
|
+
const h = Math.max(Math.min(c * (a / g), c), 20);
|
|
57
57
|
o.style.width = `${h}px`;
|
|
58
58
|
let d = 0;
|
|
59
59
|
const b = i.style.transform;
|
|
@@ -67,21 +67,21 @@ const Te = class Te extends HTMLElement {
|
|
|
67
67
|
const S = c - h;
|
|
68
68
|
f > S && (f = S), o.style.left = `${f}px`, e(this, y).left.disabled = f === 0, e(this, y).right.disabled = f >= S - 1;
|
|
69
69
|
}, "refresh"));
|
|
70
|
-
u(this, P, /* @__PURE__ */
|
|
70
|
+
u(this, P, /* @__PURE__ */ l((t) => {
|
|
71
71
|
if (!e(this, y)) return !1;
|
|
72
72
|
const i = e(this, y).container, n = i.querySelector("table");
|
|
73
73
|
if (!n) return !1;
|
|
74
74
|
const o = e(this, y).track.getBoundingClientRect(), r = e(this, y).thumb.clientWidth;
|
|
75
|
-
let
|
|
76
|
-
|
|
75
|
+
let a = t;
|
|
76
|
+
a < 0 && (a = 0);
|
|
77
77
|
const g = o.width - r;
|
|
78
|
-
|
|
78
|
+
a > g && (a = g), a = parseInt(a, 10), e(this, y).thumb.style.left = `${a}px`, e(this, y).left.disabled = a === 0, e(this, y).right.disabled = a >= g - 1;
|
|
79
79
|
const c = i.clientWidth, h = n.scrollWidth;
|
|
80
|
-
let d = g > 0 ? -
|
|
81
|
-
return -d > h - c && (d = -(h - c)), -d + 5 > h - c && (d = -(h - c)), c >= h && (d = 0), n.style.transform = `translateX(${d}px)`,
|
|
80
|
+
let d = g > 0 ? -a * (h - c) / g : 0;
|
|
81
|
+
return -d > h - c && (d = -(h - c)), -d + 5 > h - c && (d = -(h - c)), c >= h && (d = 0), n.style.transform = `translateX(${d}px)`, a > 0 && a < g - 1;
|
|
82
82
|
}, "#thumbMoveTo"));
|
|
83
|
-
u(this, te, /* @__PURE__ */
|
|
84
|
-
const t = /* @__PURE__ */
|
|
83
|
+
u(this, te, /* @__PURE__ */ l(() => {
|
|
84
|
+
const t = /* @__PURE__ */ l((n) => {
|
|
85
85
|
clearInterval(e(this, B)), clearInterval(e(this, D));
|
|
86
86
|
const o = parseInt(e(this, y).thumb.style.left || 0, 10);
|
|
87
87
|
e(this, P).call(this, o + n), p(this, B, setInterval(() => {
|
|
@@ -90,7 +90,7 @@ const Te = class Te extends HTMLElement {
|
|
|
90
90
|
e(this, P).call(this, r + n) || clearInterval(e(this, D));
|
|
91
91
|
}, 50));
|
|
92
92
|
}, 500));
|
|
93
|
-
}, "delayScroll"), i = /* @__PURE__ */
|
|
93
|
+
}, "delayScroll"), i = /* @__PURE__ */ l(() => {
|
|
94
94
|
clearInterval(e(this, B)), clearInterval(e(this, D));
|
|
95
95
|
}, "clearTimer");
|
|
96
96
|
["mouseup", "mouseleave", "touchend"].forEach((n) => {
|
|
@@ -107,11 +107,11 @@ const Te = class Te extends HTMLElement {
|
|
|
107
107
|
}), e(this, y).thumb.addEventListener("mousedown", (n) => {
|
|
108
108
|
if (n.button !== 0) return;
|
|
109
109
|
n.stopPropagation(), n.preventDefault(), p(this, O, !0), this.shiftX = n.clientX - e(this, y).thumb.getBoundingClientRect().left;
|
|
110
|
-
const o = /* @__PURE__ */
|
|
110
|
+
const o = /* @__PURE__ */ l((a) => {
|
|
111
111
|
if (!e(this, O)) return;
|
|
112
112
|
const g = e(this, y).track.getBoundingClientRect();
|
|
113
|
-
e(this, P).call(this,
|
|
114
|
-
}, "onMouseMove"), r = /* @__PURE__ */
|
|
113
|
+
e(this, P).call(this, a.clientX - g.left - this.shiftX);
|
|
114
|
+
}, "onMouseMove"), r = /* @__PURE__ */ l(() => {
|
|
115
115
|
p(this, O, !1), i(), document.removeEventListener("mousemove", o), document.removeEventListener("mouseup", r), this.refresh();
|
|
116
116
|
}, "onMouseUp");
|
|
117
117
|
document.addEventListener("mousemove", o), document.addEventListener("mouseup", r);
|
|
@@ -119,7 +119,7 @@ const Te = class Te extends HTMLElement {
|
|
|
119
119
|
}, "#init"));
|
|
120
120
|
}
|
|
121
121
|
connectedCallback() {
|
|
122
|
-
if (p(this,
|
|
122
|
+
if (p(this, L, this.closest("nine-table-sheet") || this.getRootNode().host), !e(this, L)) return;
|
|
123
123
|
this.innerHTML = `
|
|
124
124
|
<style>
|
|
125
125
|
nine-table-hscrollbar {
|
|
@@ -183,8 +183,8 @@ const Te = class Te extends HTMLElement {
|
|
|
183
183
|
<div class='ng-scroll-track'><div class='ng-scroll-thumb'></div></div>
|
|
184
184
|
<button class='ng-scroll-right' disabled><div class='ng-scroll-icon'></div></button>
|
|
185
185
|
`;
|
|
186
|
-
const t = /* @__PURE__ */
|
|
187
|
-
const i = e(this,
|
|
186
|
+
const t = /* @__PURE__ */ l(() => {
|
|
187
|
+
const i = e(this, L).querySelector(".ng-container-body");
|
|
188
188
|
if (!i) {
|
|
189
189
|
setTimeout(t, 10);
|
|
190
190
|
return;
|
|
@@ -203,25 +203,25 @@ const Te = class Te extends HTMLElement {
|
|
|
203
203
|
e(this, N) && e(this, N).disconnect();
|
|
204
204
|
}
|
|
205
205
|
};
|
|
206
|
-
|
|
206
|
+
L = new WeakMap(), O = new WeakMap(), y = new WeakMap(), B = new WeakMap(), D = new WeakMap(), N = new WeakMap(), ee = new WeakMap(), P = new WeakMap(), te = new WeakMap(), l(Te, "NineTableHScrollBar");
|
|
207
207
|
let ge = Te;
|
|
208
208
|
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", ge);
|
|
209
|
-
var X,
|
|
209
|
+
var X, _, q, I, M, H, se, ie;
|
|
210
210
|
const qe = class qe {
|
|
211
211
|
constructor(s) {
|
|
212
212
|
u(this, X);
|
|
213
|
-
u(this,
|
|
213
|
+
u(this, _, []);
|
|
214
214
|
u(this, q, null);
|
|
215
215
|
u(this, I, null);
|
|
216
|
-
u(this,
|
|
216
|
+
u(this, M, 0);
|
|
217
217
|
u(this, H, 0);
|
|
218
|
-
u(this, se, /* @__PURE__ */
|
|
218
|
+
u(this, se, /* @__PURE__ */ l(() => {
|
|
219
219
|
e(this, ie).call(this);
|
|
220
220
|
}, "#init"));
|
|
221
221
|
/**
|
|
222
222
|
* π― λ·°ν¬νΈ ν¬κΈ° λ³ν μμ μ λμ΄ κ³μ° λ° νμν ν κ°μ μ°μ Β·μΊμ±μ μκ²°
|
|
223
223
|
*/
|
|
224
|
-
u(this, ie, /* @__PURE__ */
|
|
224
|
+
u(this, ie, /* @__PURE__ */ l(() => {
|
|
225
225
|
!e(this, X) || !(e(this, X) instanceof HTMLElement) || (p(this, I, new ResizeObserver((s) => {
|
|
226
226
|
for (const t of s) {
|
|
227
227
|
const i = t.target;
|
|
@@ -231,12 +231,12 @@ const qe = class qe {
|
|
|
231
231
|
if (n > 0) {
|
|
232
232
|
const o = i.clientHeight || i.getBoundingClientRect().height || n;
|
|
233
233
|
let r = 0;
|
|
234
|
-
const
|
|
234
|
+
const a = i.querySelector(".ng-container-body") || i, g = a.querySelector("thead"), c = a.querySelector("tfoot");
|
|
235
235
|
g && (r += g.offsetHeight || g.getBoundingClientRect().height), c && (r += c.offsetHeight || c.getBoundingClientRect().height);
|
|
236
236
|
const h = Math.max(o - r, 100);
|
|
237
|
-
if (e(this,
|
|
238
|
-
const d = Math.ceil(e(this,
|
|
239
|
-
p(this, H, d + 20),
|
|
237
|
+
if (e(this, M) !== h && (p(this, M, h), e(this, q) !== null)) {
|
|
238
|
+
const d = Math.ceil(e(this, M) / e(this, q));
|
|
239
|
+
p(this, H, d + 20), j.log(`[RowManager] Resized. Height: ${e(this, M)}px | Target Rows: ${e(this, H)}`), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((b) => {
|
|
240
240
|
const f = i.querySelector(b);
|
|
241
241
|
f && f.querySelector("tbody") && this.renderRows(f);
|
|
242
242
|
});
|
|
@@ -245,33 +245,33 @@ const qe = class qe {
|
|
|
245
245
|
}
|
|
246
246
|
})), e(this, I).observe(e(this, X)));
|
|
247
247
|
}, "#initResizeObserver"));
|
|
248
|
-
v(this, "initTemplate", /* @__PURE__ */
|
|
248
|
+
v(this, "initTemplate", /* @__PURE__ */ l((s) => {
|
|
249
249
|
const t = s.querySelector("tbody.bindable") || s.querySelector("tbody");
|
|
250
250
|
if (!t) return;
|
|
251
251
|
const i = Array.from(t.querySelectorAll("tr")).filter((n) => !n.classList.contains("nodata"));
|
|
252
|
-
p(this,
|
|
252
|
+
p(this, _, i.map((n) => n.cloneNode(!0))), p(this, q, null), console.log(`[RowManager] Template initialized with ${e(this, _).length} row(s).`);
|
|
253
253
|
}, "initTemplate"));
|
|
254
|
-
v(this, "measureAndCacheHeight", /* @__PURE__ */
|
|
254
|
+
v(this, "measureAndCacheHeight", /* @__PURE__ */ l((s) => {
|
|
255
255
|
if (e(this, q) !== null)
|
|
256
256
|
return e(this, q);
|
|
257
|
-
if (e(this,
|
|
257
|
+
if (e(this, _).length === 0)
|
|
258
258
|
throw new Error("[RowManager] Template TRs are empty.");
|
|
259
259
|
const t = s.querySelector("tbody.bindable") || s.querySelector("tbody");
|
|
260
260
|
if (!t) return 24;
|
|
261
|
-
t.querySelectorAll("tr:not(.nodata)").forEach((
|
|
261
|
+
t.querySelectorAll("tr:not(.nodata)").forEach((a) => a.remove());
|
|
262
262
|
const i = t.querySelector("tr.nodata"), n = document.createDocumentFragment();
|
|
263
|
-
e(this,
|
|
264
|
-
n.appendChild(
|
|
263
|
+
e(this, _).forEach((a) => {
|
|
264
|
+
n.appendChild(a.cloneNode(!0));
|
|
265
265
|
}), i ? i.before(n) : t.appendChild(n);
|
|
266
266
|
let o = 0;
|
|
267
|
-
if (t.querySelectorAll("tr:not(.nodata)").forEach((
|
|
268
|
-
const c =
|
|
267
|
+
if (t.querySelectorAll("tr:not(.nodata)").forEach((a, g) => {
|
|
268
|
+
const c = a.offsetHeight;
|
|
269
269
|
if (c === 0)
|
|
270
270
|
throw new Error(`[RowManager] Rendered TR[${g}] height is 0. Check CSS styles.`);
|
|
271
271
|
o += c;
|
|
272
|
-
}), p(this, q, o), e(this,
|
|
273
|
-
const
|
|
274
|
-
p(this, H,
|
|
272
|
+
}), p(this, q, o), e(this, M) > 0) {
|
|
273
|
+
const a = Math.ceil(e(this, M) / e(this, q));
|
|
274
|
+
p(this, H, a + 20);
|
|
275
275
|
}
|
|
276
276
|
return console.log(`[RowManager] Template Height Cached: ${e(this, q)}px | RowCount: ${e(this, H)}`), e(this, q);
|
|
277
277
|
}, "measureAndCacheHeight"));
|
|
@@ -291,72 +291,72 @@ const qe = class qe {
|
|
|
291
291
|
/**
|
|
292
292
|
* π― μΊμλ ν κ°μλ₯Ό κ³§λ°λ‘ κ°μ Έμμ TR λΌλ μ£Όμ
(μ€λ³΅ κ³μ° μ κ±°)
|
|
293
293
|
*/
|
|
294
|
-
v(this, "renderRows", /* @__PURE__ */
|
|
295
|
-
if (e(this,
|
|
294
|
+
v(this, "renderRows", /* @__PURE__ */ l((s) => {
|
|
295
|
+
if (e(this, _).length === 0) return;
|
|
296
296
|
const t = s.querySelector("tbody.bindable") || s.querySelector("tbody");
|
|
297
297
|
if (!t) return;
|
|
298
298
|
t.querySelectorAll("tr:not(.nodata)").forEach((r) => r.remove());
|
|
299
299
|
const i = t.querySelector("tr.nodata"), n = document.createDocumentFragment(), o = e(this, H);
|
|
300
300
|
for (let r = 0; r < o; r++)
|
|
301
|
-
e(this,
|
|
302
|
-
n.appendChild(
|
|
301
|
+
e(this, _).forEach((a) => {
|
|
302
|
+
n.appendChild(a.cloneNode(!0));
|
|
303
303
|
});
|
|
304
304
|
i ? i.before(n) : t.appendChild(n), console.log(`[RowManager] Rendered ${o} sets into DOM.`);
|
|
305
305
|
}, "renderRows"));
|
|
306
|
-
v(this, "destroy", /* @__PURE__ */
|
|
306
|
+
v(this, "destroy", /* @__PURE__ */ l(() => {
|
|
307
307
|
e(this, I) && (e(this, I).disconnect(), p(this, I, null));
|
|
308
308
|
}, "destroy"));
|
|
309
309
|
p(this, X, s), e(this, se).call(this);
|
|
310
310
|
}
|
|
311
311
|
get templateLength() {
|
|
312
|
-
return e(this,
|
|
312
|
+
return e(this, _).length || 1;
|
|
313
313
|
}
|
|
314
314
|
};
|
|
315
|
-
X = new WeakMap(),
|
|
315
|
+
X = new WeakMap(), _ = new WeakMap(), q = new WeakMap(), I = new WeakMap(), M = new WeakMap(), H = new WeakMap(), se = new WeakMap(), ie = new WeakMap(), l(qe, "RowManager");
|
|
316
316
|
let pe = qe;
|
|
317
|
-
var
|
|
317
|
+
var C, F, ne;
|
|
318
318
|
const Z = class Z extends HTMLElement {
|
|
319
319
|
constructor() {
|
|
320
320
|
super();
|
|
321
|
-
u(this,
|
|
321
|
+
u(this, C, null);
|
|
322
322
|
u(this, F);
|
|
323
|
-
v(this, "init", /* @__PURE__ */
|
|
323
|
+
v(this, "init", /* @__PURE__ */ l((t) => {
|
|
324
324
|
if (!t) return;
|
|
325
|
-
const i = /* @__PURE__ */
|
|
326
|
-
const h = /* @__PURE__ */
|
|
325
|
+
const i = /* @__PURE__ */ l((c) => {
|
|
326
|
+
const h = /* @__PURE__ */ l((b) => {
|
|
327
327
|
if (b.querySelector("colgroup")) return;
|
|
328
|
-
const f = b.querySelector("tbody tr") || b.querySelector("tr"), S = f ? f.querySelectorAll("th, td").length : 1, x = document.createElement("colgroup"),
|
|
329
|
-
for (let
|
|
328
|
+
const f = b.querySelector("tbody tr") || b.querySelector("tr"), S = f ? f.querySelectorAll("th, td").length : 1, x = document.createElement("colgroup"), A = Math.max(Math.floor((b.clientWidth || 600) / S), 100);
|
|
329
|
+
for (let $ = 0; $ < S; $++) {
|
|
330
330
|
const ue = document.createElement("col");
|
|
331
|
-
ue.setAttribute("width",
|
|
331
|
+
ue.setAttribute("width", A), x.appendChild(ue);
|
|
332
332
|
}
|
|
333
333
|
b.prepend(x);
|
|
334
|
-
}, "ensureColgroup"), d = /* @__PURE__ */
|
|
334
|
+
}, "ensureColgroup"), d = /* @__PURE__ */ l((b) => {
|
|
335
335
|
if (b.querySelector("thead")) return;
|
|
336
336
|
const f = document.createElement("thead"), S = b.querySelector("colgroup");
|
|
337
337
|
S ? S.after(f) : b.prepend(f);
|
|
338
338
|
}, "ensureThead");
|
|
339
339
|
return h(c), d(c), c.classList.add("nine-table-element"), c;
|
|
340
340
|
}, "initializeTable"), n = t.cloneNode(!0);
|
|
341
|
-
p(this,
|
|
342
|
-
const o = this.querySelector(".ng-container-left"), r = this.querySelector(".ng-container-body"),
|
|
341
|
+
p(this, C, i(n)), e(this, C).style.display = "table", e(this, F).initTemplate(e(this, C));
|
|
342
|
+
const o = this.querySelector(".ng-container-left"), r = this.querySelector(".ng-container-body"), a = this.querySelector(".ng-container-right"), g = /* @__PURE__ */ l((c, h, d = !1) => {
|
|
343
343
|
const b = c.cloneNode(!0), f = Array.from(b.querySelectorAll("colgroup col")), S = [];
|
|
344
|
-
return f.forEach((x,
|
|
345
|
-
const
|
|
346
|
-
(d ?
|
|
344
|
+
return f.forEach((x, A) => {
|
|
345
|
+
const $ = x.getAttribute("fixed");
|
|
346
|
+
(d ? !$ || $ === "" : $ === h) || S.push(A);
|
|
347
347
|
}), S.reverse().forEach((x) => {
|
|
348
|
-
f[x] && f[x].remove(), b.querySelectorAll("tr").forEach((
|
|
349
|
-
const
|
|
350
|
-
|
|
348
|
+
f[x] && f[x].remove(), b.querySelectorAll("tr").forEach((A) => {
|
|
349
|
+
const $ = A.querySelectorAll("th, td");
|
|
350
|
+
$[x] && $[x].remove();
|
|
351
351
|
});
|
|
352
352
|
}), b;
|
|
353
353
|
}, "filterTableByFixed");
|
|
354
354
|
if (r) {
|
|
355
|
-
const c = g(e(this,
|
|
355
|
+
const c = g(e(this, C), null, !0);
|
|
356
356
|
r.innerHTML = "", r.appendChild(c), e(this, F).measureAndCacheHeight(r);
|
|
357
357
|
}
|
|
358
358
|
if (o) {
|
|
359
|
-
const c = g(e(this,
|
|
359
|
+
const c = g(e(this, C), "left", !1);
|
|
360
360
|
let h = 0;
|
|
361
361
|
c.querySelectorAll("col").forEach((b) => {
|
|
362
362
|
const f = parseInt(b.getAttribute("width"), 10);
|
|
@@ -365,15 +365,15 @@ const Z = class Z extends HTMLElement {
|
|
|
365
365
|
const d = h > 0 ? h : 0;
|
|
366
366
|
o.style.flex = `0 0 ${d}px`, o.style.width = `${d}px`;
|
|
367
367
|
}
|
|
368
|
-
if (
|
|
369
|
-
const c = g(e(this,
|
|
368
|
+
if (a) {
|
|
369
|
+
const c = g(e(this, C), "right", !1);
|
|
370
370
|
let h = 0;
|
|
371
371
|
c.querySelectorAll("col").forEach((b) => {
|
|
372
372
|
const f = parseInt(b.getAttribute("width"), 10);
|
|
373
373
|
isNaN(f) || (h += f);
|
|
374
|
-
}),
|
|
374
|
+
}), a.innerHTML = "", a.appendChild(c);
|
|
375
375
|
const d = h > 0 ? h : 0;
|
|
376
|
-
|
|
376
|
+
a.style.flex = `0 0 ${d}px`, a.style.width = `${d}px`;
|
|
377
377
|
}
|
|
378
378
|
if (r) {
|
|
379
379
|
const c = this.getRowCount();
|
|
@@ -385,18 +385,18 @@ const Z = class Z extends HTMLElement {
|
|
|
385
385
|
setTimeout(() => {
|
|
386
386
|
const c = this.querySelector("nine-table-hscrollbar");
|
|
387
387
|
c && typeof c.refresh == "function" && c.refresh();
|
|
388
|
-
}, 0),
|
|
388
|
+
}, 0), j.log(`NineTableSheet 3-split initialized with rows: ${this.getRowCount()}`);
|
|
389
389
|
}, "init"));
|
|
390
|
-
v(this, "getRowCount", /* @__PURE__ */
|
|
391
|
-
v(this, "scrollToX", /* @__PURE__ */
|
|
390
|
+
v(this, "getRowCount", /* @__PURE__ */ l(() => e(this, C) ? e(this, C).querySelectorAll("tbody tr").length : 0, "getRowCount"));
|
|
391
|
+
v(this, "scrollToX", /* @__PURE__ */ l((t) => {
|
|
392
392
|
const i = this.querySelector(".ng-container-body");
|
|
393
393
|
i && (i.scrollLeft = t);
|
|
394
394
|
}, "scrollToX"));
|
|
395
|
-
v(this, "scrollToY", /* @__PURE__ */
|
|
395
|
+
v(this, "scrollToY", /* @__PURE__ */ l((t) => {
|
|
396
396
|
const i = this.querySelector(".ng-container-body");
|
|
397
397
|
i && (i.scrollTop = t);
|
|
398
398
|
}, "scrollToY"));
|
|
399
|
-
u(this, ne, /* @__PURE__ */
|
|
399
|
+
u(this, ne, /* @__PURE__ */ l(() => {
|
|
400
400
|
const t = Z.SCROLLBAR_SIZE;
|
|
401
401
|
this.innerHTML = `
|
|
402
402
|
<style>
|
|
@@ -519,17 +519,17 @@ const Z = class Z extends HTMLElement {
|
|
|
519
519
|
e(this, ne).call(this);
|
|
520
520
|
}
|
|
521
521
|
disconnectedCallback() {
|
|
522
|
-
this.innerHTML = "",
|
|
522
|
+
this.innerHTML = "", j.log("NineTableSheet destroyed.");
|
|
523
523
|
}
|
|
524
524
|
};
|
|
525
|
-
|
|
525
|
+
C = new WeakMap(), F = new WeakMap(), ne = new WeakMap(), l(Z, "NineTableSheet"), v(Z, "SCROLLBAR_SIZE", 16);
|
|
526
526
|
let ye = Z;
|
|
527
527
|
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", ye);
|
|
528
528
|
var re;
|
|
529
529
|
const ke = class ke extends HTMLElement {
|
|
530
530
|
constructor() {
|
|
531
531
|
super();
|
|
532
|
-
u(this, re, /* @__PURE__ */
|
|
532
|
+
u(this, re, /* @__PURE__ */ l(() => {
|
|
533
533
|
const t = this.querySelector(".nine-tab-bar");
|
|
534
534
|
t && (t.addEventListener("click", (i) => {
|
|
535
535
|
const n = i.target.closest(".nine-tab-item");
|
|
@@ -538,17 +538,17 @@ const ke = class ke extends HTMLElement {
|
|
|
538
538
|
this.switchSheet(r, o);
|
|
539
539
|
}), this.switchSheet(0, !1));
|
|
540
540
|
}, "#init"));
|
|
541
|
-
v(this, "switchSheet", /* @__PURE__ */
|
|
542
|
-
const n = /* @__PURE__ */
|
|
541
|
+
v(this, "switchSheet", /* @__PURE__ */ l((t, i = !1) => {
|
|
542
|
+
const n = /* @__PURE__ */ l(() => {
|
|
543
543
|
const d = this.querySelector("nine-table-sheets-body");
|
|
544
544
|
d.querySelectorAll("nine-splitter").forEach((f) => {
|
|
545
|
-
const S = parseInt(f.dataset.splitIndex, 10), x = d.querySelector(`nine-table-sheet[data-index="${S - 1}"]`),
|
|
546
|
-
x &&
|
|
545
|
+
const S = parseInt(f.dataset.splitIndex, 10), x = d.querySelector(`nine-table-sheet[data-index="${S - 1}"]`), A = d.querySelector(`nine-table-sheet[data-index="${S}"]`);
|
|
546
|
+
x && A && x.classList.contains("active") && A.classList.contains("active") ? f.classList.add("active") : f.classList.remove("active");
|
|
547
547
|
});
|
|
548
|
-
}, "updateSplitters"), o = this.querySelector(".nine-tab-bar"), r = this.querySelector("nine-table-sheets-body"),
|
|
549
|
-
if (!
|
|
548
|
+
}, "updateSplitters"), o = this.querySelector(".nine-tab-bar"), r = this.querySelector("nine-table-sheets-body"), a = o.querySelectorAll(".nine-tab-item"), g = r.querySelectorAll("nine-table-sheet");
|
|
549
|
+
if (!a[t]) return;
|
|
550
550
|
if (!i)
|
|
551
|
-
|
|
551
|
+
a.forEach((d, b) => {
|
|
552
552
|
d.classList.toggle("active", b === t);
|
|
553
553
|
const f = r.querySelector(`nine-table-sheet[data-index="${b}"]`);
|
|
554
554
|
f && (f.style.flex = "");
|
|
@@ -556,7 +556,7 @@ const ke = class ke extends HTMLElement {
|
|
|
556
556
|
d.classList.toggle("active", b === t);
|
|
557
557
|
});
|
|
558
558
|
else {
|
|
559
|
-
const d =
|
|
559
|
+
const d = a[t], b = o.querySelectorAll(".nine-tab-item.active");
|
|
560
560
|
if (d.classList.contains("active") && b.length <= 1)
|
|
561
561
|
return;
|
|
562
562
|
d.classList.toggle("active");
|
|
@@ -585,51 +585,48 @@ const ke = class ke extends HTMLElement {
|
|
|
585
585
|
e(this, re).call(this);
|
|
586
586
|
}
|
|
587
587
|
};
|
|
588
|
-
re = new WeakMap(),
|
|
589
|
-
let
|
|
590
|
-
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets",
|
|
591
|
-
var
|
|
588
|
+
re = new WeakMap(), l(ke, "NineTableSheets");
|
|
589
|
+
let me = ke;
|
|
590
|
+
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", me);
|
|
591
|
+
var E, G, oe, J, le;
|
|
592
592
|
const Ae = class Ae {
|
|
593
593
|
constructor(s) {
|
|
594
|
-
u(this,
|
|
595
|
-
u(this,
|
|
596
|
-
u(this, oe, /* @__PURE__ */
|
|
597
|
-
const s = e(this,
|
|
598
|
-
s && (p(this,
|
|
594
|
+
u(this, E);
|
|
595
|
+
u(this, G, null);
|
|
596
|
+
u(this, oe, /* @__PURE__ */ l(() => {
|
|
597
|
+
const s = e(this, E).host;
|
|
598
|
+
s && (p(this, G, new ResizeObserver((t) => {
|
|
599
599
|
for (let i of t)
|
|
600
|
-
s.getAttribute("auto-height") === "true" && e(this,
|
|
601
|
-
})), e(this,
|
|
600
|
+
s.getAttribute("auto-height") === "true" && e(this, J).call(this, s);
|
|
601
|
+
})), e(this, G).observe(s));
|
|
602
602
|
}, "#observeResize"));
|
|
603
|
-
u(this,
|
|
604
|
-
var
|
|
605
|
-
const t = (
|
|
603
|
+
u(this, J, /* @__PURE__ */ l((s) => {
|
|
604
|
+
var A;
|
|
605
|
+
const t = e(this, E).querySelector("nine-table-sheet.active");
|
|
606
606
|
if (!t) return;
|
|
607
|
-
const i = ((
|
|
608
|
-
s.style.height = `${S}px`, s.style.maxHeight = `${n *
|
|
609
|
-
const x = e(this,
|
|
607
|
+
const i = ((A = t.getRowCount) == null ? void 0 : A.call(t)) || 0, n = parseInt(s.getAttribute("max-display-row"), 10) || 10, o = Math.min(i, n), r = t.querySelector("tbody tr") || t.querySelector("tr"), a = r ? r.getBoundingClientRect().height : 32, g = e(this, E).querySelector("nine-table-header"), c = e(this, E).querySelector("nine-table-sheets-footer"), h = g ? g.getBoundingClientRect().height : 40, d = c ? c.getBoundingClientRect().height : 32, f = h + d + 16, S = o * a + f;
|
|
608
|
+
s.style.height = `${S}px`, s.style.maxHeight = `${n * a + f}px`;
|
|
609
|
+
const x = e(this, E).querySelector("nine-table-sheets-body");
|
|
610
610
|
x && (x.style.overflowY = i > n ? "auto" : "hidden");
|
|
611
611
|
}, "#applyAutoHeight"));
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
*/
|
|
615
|
-
/**
|
|
616
|
-
* π― 쑰건 λ°μ§μ§ μκ³ μνΈκ° 2κ° μ΄μμ΄λ©΄ μ€ν리ν°λ₯Ό 무쑰건 κ°μ λ‘ λμ°λ νμ€ν λκΈ°ν λ©μλ
|
|
617
|
-
*/
|
|
618
|
-
v(this, "updateSplitters", /* @__PURE__ */ a(() => {
|
|
619
|
-
const s = e(this, k).querySelector("nine-table-sheets-body");
|
|
612
|
+
v(this, "updateSplitters", /* @__PURE__ */ l(() => {
|
|
613
|
+
const s = e(this, E).querySelector("nine-table-sheets-body");
|
|
620
614
|
if (!s) return;
|
|
621
|
-
const t = Array.from(s.querySelectorAll("nine-table-sheet"));
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
615
|
+
const t = Array.from(s.querySelectorAll("nine-table-sheet")), i = Array.from(s.querySelectorAll("nine-splitter.h"));
|
|
616
|
+
if (t.length <= 1) {
|
|
617
|
+
i.forEach((n) => n.style.setProperty("display", "none", "important"));
|
|
618
|
+
return;
|
|
619
|
+
}
|
|
620
|
+
i.forEach((n) => {
|
|
621
|
+
n.style.setProperty("display", "block", "important");
|
|
625
622
|
});
|
|
626
623
|
}, "updateSplitters"));
|
|
627
|
-
u(this, le, /* @__PURE__ */
|
|
628
|
-
const s = e(this,
|
|
624
|
+
u(this, le, /* @__PURE__ */ l(() => {
|
|
625
|
+
const s = e(this, E).host, i = Array.from(s.children).filter((c) => c.tagName === "TABLE"), n = s.getAttribute("auto-height") === "true", o = i.length, r = i.map((c, h) => {
|
|
629
626
|
const b = `<nine-table-sheet class="${h === 0 ? "active" : ""}" data-index="${h}"></nine-table-sheet>`, f = h < o - 1 ? `<nine-splitter class="h" data-split-index="${h}"></nine-splitter>` : "";
|
|
630
627
|
return b + f;
|
|
631
|
-
}).join(""),
|
|
632
|
-
e(this,
|
|
628
|
+
}).join(""), a = i.map((c, h) => `<div class="nine-tab-item ${h === 0 ? "active" : ""}" data-index="${h}">Sheet ${h + 1}</div>`).join("");
|
|
629
|
+
e(this, E).innerHTML = `
|
|
633
630
|
<style>
|
|
634
631
|
:host {
|
|
635
632
|
display: flex;
|
|
@@ -672,13 +669,12 @@ const Ae = class Ae {
|
|
|
672
669
|
display: block !important;
|
|
673
670
|
}
|
|
674
671
|
|
|
675
|
-
/* π― μ€νλ¦¬ν° κΈ°λ³Έ μ€νμΌ (JSλ‘ μ§μ display μ‘°μ) */
|
|
676
672
|
nine-table-sheets-body nine-splitter.h {
|
|
677
673
|
width: 4px;
|
|
678
674
|
background: #e5e7eb;
|
|
679
675
|
cursor: col-resize;
|
|
680
676
|
flex-shrink: 0;
|
|
681
|
-
display: none;
|
|
677
|
+
display: ${o > 1 ? "block" : "none"};
|
|
682
678
|
}
|
|
683
679
|
|
|
684
680
|
nine-table-sheets-footer {
|
|
@@ -730,7 +726,7 @@ const Ae = class Ae {
|
|
|
730
726
|
<nine-table-sheets>
|
|
731
727
|
<nine-table-sheets-body>${r}</nine-table-sheets-body>
|
|
732
728
|
<nine-table-sheets-footer>
|
|
733
|
-
<div class="nine-tab-bar">${
|
|
729
|
+
<div class="nine-tab-bar">${a}</div>
|
|
734
730
|
<div class="sheets-counter">Total : <span id="row-count">0</span></div>
|
|
735
731
|
</nine-table-sheets-footer>
|
|
736
732
|
</nine-table-sheets>
|
|
@@ -738,24 +734,24 @@ const Ae = class Ae {
|
|
|
738
734
|
</nine-table-body>
|
|
739
735
|
<nine-table-footer></nine-table-footer>
|
|
740
736
|
`;
|
|
741
|
-
const g = e(this,
|
|
737
|
+
const g = e(this, E).querySelectorAll("nine-table-sheet");
|
|
742
738
|
g == null || g.forEach((c, h) => {
|
|
743
739
|
i[h] && setTimeout(() => {
|
|
744
|
-
c.init(i[h]), n && e(this,
|
|
740
|
+
c.init(i[h]), n && e(this, J).call(this, s), this.updateSplitters();
|
|
745
741
|
});
|
|
746
742
|
});
|
|
747
743
|
}, "#render"));
|
|
748
|
-
p(this,
|
|
744
|
+
p(this, E, s), e(this, le).call(this), e(this, oe).call(this);
|
|
749
745
|
}
|
|
750
746
|
};
|
|
751
|
-
|
|
752
|
-
let
|
|
747
|
+
E = new WeakMap(), G = new WeakMap(), oe = new WeakMap(), J = new WeakMap(), le = new WeakMap(), l(Ae, "LayoutManager");
|
|
748
|
+
let we = Ae;
|
|
753
749
|
var z, V;
|
|
754
750
|
const Ce = class Ce {
|
|
755
751
|
constructor(s) {
|
|
756
752
|
u(this, z);
|
|
757
753
|
u(this, V, -1);
|
|
758
|
-
v(this, "count", /* @__PURE__ */
|
|
754
|
+
v(this, "count", /* @__PURE__ */ l(() => e(this, z).rawRecords.length, "count"));
|
|
759
755
|
p(this, z, s);
|
|
760
756
|
}
|
|
761
757
|
get at() {
|
|
@@ -771,31 +767,31 @@ const Ce = class Ce {
|
|
|
771
767
|
});
|
|
772
768
|
}
|
|
773
769
|
};
|
|
774
|
-
z = new WeakMap(), V = new WeakMap(),
|
|
770
|
+
z = new WeakMap(), V = new WeakMap(), l(Ce, "ngRow");
|
|
775
771
|
let ve = Ce;
|
|
776
|
-
var
|
|
772
|
+
var R, w, k, U, ae, W, ce, Q, he, de, K;
|
|
777
773
|
const T = class T {
|
|
778
774
|
constructor(s, t) {
|
|
779
|
-
u(this,
|
|
780
|
-
u(this,
|
|
781
|
-
u(this,
|
|
775
|
+
u(this, R);
|
|
776
|
+
u(this, w);
|
|
777
|
+
u(this, k, []);
|
|
782
778
|
u(this, U, []);
|
|
783
779
|
u(this, ae, 0);
|
|
784
780
|
u(this, W, []);
|
|
785
|
-
u(this, ce, /* @__PURE__ */
|
|
781
|
+
u(this, ce, /* @__PURE__ */ l(() => {
|
|
786
782
|
p(this, W, []);
|
|
787
|
-
const s = e(this,
|
|
783
|
+
const s = e(this, R).template || [];
|
|
788
784
|
Array.from(s).forEach((t) => {
|
|
789
785
|
var i;
|
|
790
786
|
e(this, W).push(((i = t.getBoundingClientRect) == null ? void 0 : i.call(t).height) || 24);
|
|
791
|
-
}), (e(this,
|
|
787
|
+
}), (e(this, w).rawRecords || []).forEach((t) => {
|
|
792
788
|
t.__ng || (t.__ng = e(this, Q).call(this)), t.__ng.height = e(this, W).slice();
|
|
793
789
|
});
|
|
794
790
|
}, "#initialize"));
|
|
795
|
-
v(this, "set", /* @__PURE__ */
|
|
791
|
+
v(this, "set", /* @__PURE__ */ l((s) => {
|
|
796
792
|
this.clear(), this.add(s, !1);
|
|
797
793
|
}, "set"));
|
|
798
|
-
u(this, Q, /* @__PURE__ */
|
|
794
|
+
u(this, Q, /* @__PURE__ */ l(() => ({
|
|
799
795
|
rowState: T.ROW_STATE.EMPTY,
|
|
800
796
|
deleted: !1,
|
|
801
797
|
filtered: !1,
|
|
@@ -804,97 +800,97 @@ const T = class T {
|
|
|
804
800
|
c: {},
|
|
805
801
|
_: [0, 0, 0, 0, T.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, e(this, W).slice(), -1, {}, {}]
|
|
806
802
|
}), "#getDefaultMeta"));
|
|
807
|
-
v(this, "reset", /* @__PURE__ */
|
|
808
|
-
p(this,
|
|
803
|
+
v(this, "reset", /* @__PURE__ */ l(() => {
|
|
804
|
+
p(this, k, []), p(this, U, []);
|
|
809
805
|
}, "reset"));
|
|
810
|
-
v(this, "clear", /* @__PURE__ */
|
|
806
|
+
v(this, "clear", /* @__PURE__ */ l(() => {
|
|
811
807
|
var s;
|
|
812
|
-
e(this,
|
|
808
|
+
e(this, w).rawRecords = [], p(this, k, []), p(this, U, []), (s = e(this, w).viewRecords) != null && s.reset && e(this, w).viewRecords.reset();
|
|
813
809
|
}, "clear"));
|
|
814
|
-
u(this, he, /* @__PURE__ */
|
|
810
|
+
u(this, he, /* @__PURE__ */ l((s) => {
|
|
815
811
|
var n;
|
|
816
812
|
Array.isArray(s) || (s = [s]);
|
|
817
|
-
const t = typeof ((n = e(this,
|
|
813
|
+
const t = typeof ((n = e(this, R).fields) == null ? void 0 : n.get) == "function" ? e(this, R).fields.get() : Object.keys(s[0] || {}), i = [];
|
|
818
814
|
return s.forEach((o) => {
|
|
819
815
|
const r = { v: [] };
|
|
820
|
-
t.forEach((
|
|
821
|
-
r.v.push(o[
|
|
816
|
+
t.forEach((a) => {
|
|
817
|
+
r.v.push(o[a] !== void 0 && o[a] !== null ? o[a] : "");
|
|
822
818
|
}), i.push(r);
|
|
823
819
|
}), i;
|
|
824
820
|
}, "#json2Array"));
|
|
825
|
-
u(this, de, /* @__PURE__ */
|
|
821
|
+
u(this, de, /* @__PURE__ */ l((s) => (Array.isArray(s) || (s = [s]), s.forEach((t) => {
|
|
826
822
|
t.__ng = e(this, Q).call(this), t.__ng.rowid = this.nextId, t.__ng.rowState = T.ROW_STATE.INSERT, t.__ng._[0] = t.__ng.rowid;
|
|
827
823
|
}), s), "#defaultInsert"));
|
|
828
|
-
v(this, "add", /* @__PURE__ */
|
|
824
|
+
v(this, "add", /* @__PURE__ */ l((s, t = !0) => {
|
|
829
825
|
var o;
|
|
830
826
|
s === void 0 && (s = {});
|
|
831
827
|
const i = e(this, he).call(this, s);
|
|
832
|
-
e(this,
|
|
828
|
+
e(this, w).rawRecords = e(this, w).rawRecords.concat(e(this, de).call(this, i)), this.resetRecords();
|
|
833
829
|
const n = this.count() - 1;
|
|
834
|
-
return t || i.forEach((r,
|
|
835
|
-
const g = e(this,
|
|
830
|
+
return t || i.forEach((r, a) => {
|
|
831
|
+
const g = e(this, w).rawRecords[n - a];
|
|
836
832
|
g && (g.__ng.rowState = T.ROW_STATE.EMPTY);
|
|
837
|
-
}), (o = e(this,
|
|
833
|
+
}), (o = e(this, w).viewRecords) != null && o.reset && e(this, w).viewRecords.reset(), n;
|
|
838
834
|
}, "add"));
|
|
839
|
-
v(this, "delete", /* @__PURE__ */
|
|
835
|
+
v(this, "delete", /* @__PURE__ */ l((s) => {
|
|
840
836
|
var i;
|
|
841
837
|
let t = [];
|
|
842
|
-
Array.isArray(s) ? t = s : typeof s > "u" ? t = [e(this,
|
|
843
|
-
if (e(this,
|
|
844
|
-
const o = e(this,
|
|
845
|
-
e(this,
|
|
838
|
+
Array.isArray(s) ? t = s : typeof s > "u" ? t = [e(this, w).owner.row.at] : t = [parseInt(s, 10)], t.sort((n, o) => o - n).forEach((n) => {
|
|
839
|
+
if (e(this, k)[n]) {
|
|
840
|
+
const o = e(this, k)[n].__ng.rowid;
|
|
841
|
+
e(this, k)[n].__ng.rowState === T.ROW_STATE.INSERT ? e(this, w).rawRecords = e(this, w).rawRecords.filter((r) => r.__ng.rowid !== o) : e(this, w).rawRecords.forEach((r) => {
|
|
846
842
|
r.__ng.rowid === o && (r.__ng.deleted = !0, r.__ng.rowState = T.ROW_STATE.DELETE);
|
|
847
843
|
});
|
|
848
844
|
}
|
|
849
|
-
}), this.resetRecords(), (i = e(this,
|
|
845
|
+
}), this.resetRecords(), (i = e(this, w).viewRecords) != null && i.reset && e(this, w).viewRecords.reset();
|
|
850
846
|
}, "delete"));
|
|
851
|
-
v(this, "setValue", /* @__PURE__ */
|
|
847
|
+
v(this, "setValue", /* @__PURE__ */ l((s, t, i) => {
|
|
852
848
|
var g;
|
|
853
849
|
s = parseInt(s, 10);
|
|
854
|
-
const o = (typeof ((g = e(this,
|
|
850
|
+
const o = (typeof ((g = e(this, R).fields) == null ? void 0 : g.get) == "function" ? e(this, R).fields.get() : []).indexOf(t);
|
|
855
851
|
if (o < 0) return;
|
|
856
852
|
const r = this.getValidData()[s];
|
|
857
853
|
if (!r) return;
|
|
858
|
-
const
|
|
859
|
-
|
|
854
|
+
const a = r.v[o];
|
|
855
|
+
a !== i && r.__ng.rowState !== T.ROW_STATE.INSERT && (r.__ng.o.hasOwnProperty(t) || (r.__ng.o[t] = a), r.__ng.rowState = T.ROW_STATE.UPDATE), r.v[o] = i, e(this, w).owner.refreshData && e(this, w).owner.refreshData(s);
|
|
860
856
|
}, "setValue"));
|
|
861
|
-
v(this, "resetRecords", /* @__PURE__ */
|
|
862
|
-
p(this, U, e(this,
|
|
857
|
+
v(this, "resetRecords", /* @__PURE__ */ l(() => {
|
|
858
|
+
p(this, U, e(this, w).rawRecords.filter((s) => !s.__ng.deleted)), p(this, k, e(this, w).rawRecords.filter((s) => !s.__ng.deleted && !s.__ng.filtered)), e(this, w).rawRecords.forEach((s, t) => {
|
|
863
859
|
s.__ng.rowidx = t;
|
|
864
|
-
}), e(this,
|
|
860
|
+
}), e(this, k).forEach((s, t) => {
|
|
865
861
|
s.__ng.i = t;
|
|
866
862
|
});
|
|
867
863
|
}, "resetRecords"));
|
|
868
|
-
v(this, "getValidData", /* @__PURE__ */
|
|
869
|
-
u(this, K, /* @__PURE__ */
|
|
864
|
+
v(this, "getValidData", /* @__PURE__ */ l(() => (e(this, k).length === 0 && e(this, w).rawRecords.length > 0 && this.resetRecords(), e(this, k)), "getValidData"));
|
|
865
|
+
u(this, K, /* @__PURE__ */ l((s) => {
|
|
870
866
|
var i;
|
|
871
867
|
if (!s) return s;
|
|
872
|
-
const t = typeof ((i = e(this,
|
|
868
|
+
const t = typeof ((i = e(this, R).fields) == null ? void 0 : i.get) == "function" ? e(this, R).fields.get() : [];
|
|
873
869
|
return Array.isArray(s) ? s.filter((n) => !n.__ng.deleted).map((n) => {
|
|
874
870
|
const o = {};
|
|
875
|
-
return t.forEach((r,
|
|
876
|
-
o[r] = n.v ? n.v[
|
|
871
|
+
return t.forEach((r, a) => {
|
|
872
|
+
o[r] = n.v ? n.v[a] : n[r];
|
|
877
873
|
}), o.__ng = n.__ng, o;
|
|
878
874
|
}) : s;
|
|
879
875
|
}, "#conv2"));
|
|
880
|
-
v(this, "count", /* @__PURE__ */
|
|
881
|
-
v(this, "get", /* @__PURE__ */
|
|
876
|
+
v(this, "count", /* @__PURE__ */ l(() => this.getValidData().length, "count"));
|
|
877
|
+
v(this, "get", /* @__PURE__ */ l((s, t) => {
|
|
882
878
|
var o;
|
|
883
879
|
const i = this.getValidData();
|
|
884
880
|
if (!i || i.length <= 0) return;
|
|
885
881
|
if (s == null) return e(this, K).call(this, i);
|
|
886
882
|
if (s < 0 || s >= i.length) return null;
|
|
887
|
-
const n = typeof ((o = e(this,
|
|
883
|
+
const n = typeof ((o = e(this, R).fields) == null ? void 0 : o.get) == "function" ? e(this, R).fields.get() : [];
|
|
888
884
|
if (t != null) {
|
|
889
885
|
const r = n.indexOf(t);
|
|
890
886
|
return r >= 0 ? i[s].v[r] : null;
|
|
891
887
|
}
|
|
892
888
|
return e(this, K).call(this, i[s]);
|
|
893
889
|
}, "get"));
|
|
894
|
-
p(this,
|
|
890
|
+
p(this, R, s), p(this, w, t), e(this, ce).call(this);
|
|
895
891
|
}
|
|
896
892
|
get source() {
|
|
897
|
-
return e(this, K).call(this, e(this,
|
|
893
|
+
return e(this, K).call(this, e(this, w).rawRecords);
|
|
898
894
|
}
|
|
899
895
|
set source(s) {
|
|
900
896
|
this.clear(), this.add(s, !1);
|
|
@@ -903,7 +899,7 @@ const T = class T {
|
|
|
903
899
|
return ++He(this, ae)._;
|
|
904
900
|
}
|
|
905
901
|
};
|
|
906
|
-
|
|
902
|
+
R = new WeakMap(), w = new WeakMap(), k = new WeakMap(), U = new WeakMap(), ae = new WeakMap(), W = new WeakMap(), ce = new WeakMap(), Q = new WeakMap(), he = new WeakMap(), de = new WeakMap(), K = new WeakMap(), l(T, "ngData"), // π― ν μν μ μ μμλ₯Ό ν΄λμ€ λ΄λΆλ‘ λ΄μ¬ν
|
|
907
903
|
v(T, "ROW_STATE", {
|
|
908
904
|
EMPTY: "EMPTY",
|
|
909
905
|
NORMAL: "NORMAL",
|
|
@@ -931,7 +927,7 @@ const Le = class Le {
|
|
|
931
927
|
}, this.setDataSource([]);
|
|
932
928
|
}
|
|
933
929
|
};
|
|
934
|
-
|
|
930
|
+
l(Le, "ngDataManager");
|
|
935
931
|
let Se = Le;
|
|
936
932
|
var Y, fe;
|
|
937
933
|
const _e = class _e extends HTMLElement {
|
|
@@ -943,10 +939,10 @@ const _e = class _e extends HTMLElement {
|
|
|
943
939
|
this.attachShadow({ mode: "open" }), p(this, Y, new Se(this));
|
|
944
940
|
}
|
|
945
941
|
connectedCallback() {
|
|
946
|
-
p(this, fe, new
|
|
942
|
+
p(this, fe, new we(this.shadowRoot)), j.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
|
|
947
943
|
}
|
|
948
944
|
disconnectedCallback() {
|
|
949
|
-
|
|
945
|
+
j.log("NineTable disconnected.");
|
|
950
946
|
}
|
|
951
947
|
// π― μΈλΆμμ grid.data.set(...) ννλ‘ μ κ·Όν μ μλλ‘ λ°μ΄ν° λ§€λμ μ€ν
|
|
952
948
|
get data() {
|
|
@@ -961,7 +957,7 @@ const _e = class _e extends HTMLElement {
|
|
|
961
957
|
return e(this, Y);
|
|
962
958
|
}
|
|
963
959
|
};
|
|
964
|
-
Y = new WeakMap(), fe = new WeakMap(),
|
|
960
|
+
Y = new WeakMap(), fe = new WeakMap(), l(_e, "NineTable");
|
|
965
961
|
let Ee = _e;
|
|
966
962
|
customElements.get("nine-table") || customElements.define("nine-table", Ee);
|
|
967
963
|
//# sourceMappingURL=nine-table.js.map
|