@ninebone/table 0.0.273 β 0.0.274
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 +209 -209
- 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 De = (p) => {
|
|
|
3
3
|
throw TypeError(p);
|
|
4
4
|
};
|
|
5
5
|
var Ve = (p, i, t) => i in p ? Be(p, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : p[i] = t;
|
|
6
|
-
var
|
|
6
|
+
var a = (p, i) => Be(p, "name", { value: i, configurable: !0 });
|
|
7
7
|
var v = (p, i, t) => Ve(p, typeof i != "symbol" ? i + "" : i, t), Ne = (p, i, t) => i.has(p) || De("Cannot " + t);
|
|
8
8
|
var e = (p, i, t) => (Ne(p, i, "read from private field"), t ? t.call(p) : i.get(p)), f = (p, i, t) => i.has(p) ? De("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(p) : i.set(p, t), g = (p, i, t, s) => (Ne(p, i, "write to private field"), s ? s.call(p, t) : i.set(p, t), t);
|
|
9
9
|
var Pe = (p, i, t, s) => ({
|
|
@@ -20,7 +20,7 @@ const Ce = class Ce extends Xe.constructor {
|
|
|
20
20
|
super(), this.init("nine-table", "green");
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
|
-
|
|
23
|
+
a(Ce, "Trace");
|
|
24
24
|
let xe = Ce;
|
|
25
25
|
const Z = new xe();
|
|
26
26
|
var T, z, y, B, D, N, se, P, ne;
|
|
@@ -33,49 +33,49 @@ const _e = class _e extends HTMLElement {
|
|
|
33
33
|
f(this, B);
|
|
34
34
|
f(this, D);
|
|
35
35
|
f(this, N);
|
|
36
|
-
f(this, se, /* @__PURE__ */
|
|
36
|
+
f(this, se, /* @__PURE__ */ a(() => {
|
|
37
37
|
if (!e(this, T)) return;
|
|
38
38
|
const t = e(this, T).querySelector(".ng-container-body");
|
|
39
39
|
t && (g(this, N, new ResizeObserver(() => {
|
|
40
40
|
this.refresh();
|
|
41
41
|
})), e(this, N).observe(t));
|
|
42
42
|
}, "#observeResize"));
|
|
43
|
-
v(this, "refresh", /* @__PURE__ */
|
|
43
|
+
v(this, "refresh", /* @__PURE__ */ a(() => {
|
|
44
44
|
if (!e(this, T) || !e(this, y) || e(this, z)) return;
|
|
45
45
|
const t = e(this, y).container, s = t.querySelector("table");
|
|
46
46
|
if (!s) return;
|
|
47
|
-
const n = e(this, y).track, r = e(this, y).thumb, o = e(this, T).querySelector(".ng-container-bottom"), l = t.clientWidth,
|
|
48
|
-
if (l !== 0 &&
|
|
47
|
+
const n = e(this, y).track, r = e(this, y).thumb, o = e(this, T).querySelector(".ng-container-bottom"), l = t.clientWidth, h = s.scrollWidth;
|
|
48
|
+
if (l !== 0 && h > l)
|
|
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
|
|
57
|
-
r.style.width = `${
|
|
58
|
-
const u = t.scrollLeft, b =
|
|
54
|
+
const c = n.clientWidth;
|
|
55
|
+
if (c <= 0) return;
|
|
56
|
+
const d = Math.max(Math.min(c * (l / h), c), 20);
|
|
57
|
+
r.style.width = `${d}px`;
|
|
58
|
+
const u = t.scrollLeft, b = h - l;
|
|
59
59
|
let w = 0;
|
|
60
|
-
b > 0 && (w = parseInt(u / b * (
|
|
61
|
-
const x =
|
|
60
|
+
b > 0 && (w = parseInt(u / b * (c - d), 10)), w < 0 && (w = 0);
|
|
61
|
+
const x = c - d;
|
|
62
62
|
w > x && (w = x), r.style.left = `${w}px`, Z.log(w), e(this, y).left.disabled = w === 0, e(this, y).right.disabled = w >= x - 1;
|
|
63
63
|
}, "refresh"));
|
|
64
|
-
f(this, P, /* @__PURE__ */
|
|
64
|
+
f(this, P, /* @__PURE__ */ a((t) => {
|
|
65
65
|
if (!e(this, y)) return !1;
|
|
66
66
|
const s = e(this, y).container, n = s.querySelector("table");
|
|
67
67
|
if (!n) return !1;
|
|
68
68
|
const r = e(this, y).track.getBoundingClientRect(), o = e(this, y).thumb.clientWidth;
|
|
69
69
|
let l = t;
|
|
70
70
|
l < 0 && (l = 0);
|
|
71
|
-
const
|
|
72
|
-
l >
|
|
73
|
-
const
|
|
74
|
-
let u =
|
|
75
|
-
return -u >
|
|
71
|
+
const h = r.width - o;
|
|
72
|
+
l > h && (l = h), l = parseInt(l, 10), e(this, y).thumb.style.left = `${l}px`, e(this, y).left.disabled = l === 0, e(this, y).right.disabled = l >= h - 1;
|
|
73
|
+
const c = s.clientWidth, d = n.scrollWidth;
|
|
74
|
+
let u = h > 0 ? -l * (d - c) / h : 0;
|
|
75
|
+
return -u > d - c && (u = -(d - c)), -u + 5 > d - c && (u = -(d - c)), c >= d && (u = 0), n.style.transform = `translateX(${u}px)`, l > 0 && l < h - 1;
|
|
76
76
|
}, "#thumbMoveTo"));
|
|
77
|
-
f(this, ne, /* @__PURE__ */
|
|
78
|
-
const t = /* @__PURE__ */
|
|
77
|
+
f(this, ne, /* @__PURE__ */ a(() => {
|
|
78
|
+
const t = /* @__PURE__ */ a((n) => {
|
|
79
79
|
clearInterval(e(this, B)), clearInterval(e(this, D));
|
|
80
80
|
const r = parseInt(e(this, y).thumb.style.left || 0, 10);
|
|
81
81
|
e(this, P).call(this, r + n), g(this, B, setInterval(() => {
|
|
@@ -84,7 +84,7 @@ const _e = class _e extends HTMLElement {
|
|
|
84
84
|
e(this, P).call(this, o + n) || clearInterval(e(this, D));
|
|
85
85
|
}, 50));
|
|
86
86
|
}, 500));
|
|
87
|
-
}, "delayScroll"), s = /* @__PURE__ */
|
|
87
|
+
}, "delayScroll"), s = /* @__PURE__ */ a(() => {
|
|
88
88
|
clearInterval(e(this, B)), clearInterval(e(this, D));
|
|
89
89
|
}, "clearTimer");
|
|
90
90
|
["mouseup", "mouseleave", "touchend"].forEach((n) => {
|
|
@@ -101,11 +101,11 @@ const _e = class _e extends HTMLElement {
|
|
|
101
101
|
}), e(this, y).thumb.addEventListener("mousedown", (n) => {
|
|
102
102
|
if (n.button !== 0) return;
|
|
103
103
|
n.stopPropagation(), n.preventDefault(), g(this, z, !0), this.shiftX = n.clientX - e(this, y).thumb.getBoundingClientRect().left;
|
|
104
|
-
const r = /* @__PURE__ */
|
|
104
|
+
const r = /* @__PURE__ */ a((l) => {
|
|
105
105
|
if (!e(this, z)) return;
|
|
106
|
-
const
|
|
107
|
-
e(this, P).call(this, l.clientX -
|
|
108
|
-
}, "onMouseMove"), o = /* @__PURE__ */
|
|
106
|
+
const h = e(this, y).track.getBoundingClientRect();
|
|
107
|
+
e(this, P).call(this, l.clientX - h.left - this.shiftX);
|
|
108
|
+
}, "onMouseMove"), o = /* @__PURE__ */ a(() => {
|
|
109
109
|
g(this, z, !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 _e = class _e 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, T).querySelector(".ng-container-body");
|
|
182
182
|
if (!s) {
|
|
183
183
|
setTimeout(t, 10);
|
|
@@ -197,7 +197,7 @@ const _e = class _e extends HTMLElement {
|
|
|
197
197
|
e(this, N) && e(this, N).disconnect();
|
|
198
198
|
}
|
|
199
199
|
};
|
|
200
|
-
T = new WeakMap(), z = new WeakMap(), y = new WeakMap(), B = new WeakMap(), D = new WeakMap(), N = new WeakMap(), se = new WeakMap(), P = new WeakMap(), ne = new WeakMap(),
|
|
200
|
+
T = new WeakMap(), z = new WeakMap(), y = new WeakMap(), B = new WeakMap(), D = new WeakMap(), N = new WeakMap(), se = new WeakMap(), P = new WeakMap(), ne = new WeakMap(), a(_e, "NineTableHScrollBar");
|
|
201
201
|
let ve = _e;
|
|
202
202
|
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", ve);
|
|
203
203
|
var M, L, R, $, C, _, re, oe, le, ae;
|
|
@@ -209,14 +209,14 @@ const He = class He {
|
|
|
209
209
|
f(this, $, null);
|
|
210
210
|
f(this, C, 0);
|
|
211
211
|
f(this, _, 0);
|
|
212
|
-
v(this, "getRowHeight", /* @__PURE__ */
|
|
213
|
-
f(this, re, /* @__PURE__ */
|
|
212
|
+
v(this, "getRowHeight", /* @__PURE__ */ a(() => e(this, R), "getRowHeight"));
|
|
213
|
+
f(this, re, /* @__PURE__ */ a(() => {
|
|
214
214
|
e(this, oe).call(this);
|
|
215
215
|
}, "#init"));
|
|
216
216
|
/**
|
|
217
217
|
* π― λ·°ν¬νΈ ν¬κΈ° λ³ν μμ μ λμ΄ κ³μ° λ° νμν ν κ°μ μ°μ Β·μΊμ±μ μκ²°
|
|
218
218
|
*/
|
|
219
|
-
f(this, oe, /* @__PURE__ */
|
|
219
|
+
f(this, oe, /* @__PURE__ */ a(() => {
|
|
220
220
|
!e(this, M) || !(e(this, M) instanceof HTMLElement) || (g(this, $, new ResizeObserver((i) => {
|
|
221
221
|
for (const t of i) {
|
|
222
222
|
const s = t.target;
|
|
@@ -226,10 +226,10 @@ const He = class He {
|
|
|
226
226
|
if (n > 0) {
|
|
227
227
|
const r = s.clientHeight || s.getBoundingClientRect().height || n;
|
|
228
228
|
let o = 0;
|
|
229
|
-
const l = s.querySelector(".ng-container-body") || s,
|
|
230
|
-
|
|
231
|
-
const
|
|
232
|
-
if (e(this, C) !==
|
|
229
|
+
const l = s.querySelector(".ng-container-body") || s, h = l.querySelector("thead"), c = l.querySelector("tfoot");
|
|
230
|
+
h && (o += h.offsetHeight || h.getBoundingClientRect().height), c && (o += c.offsetHeight || c.getBoundingClientRect().height);
|
|
231
|
+
const d = Math.max(r - o, 100);
|
|
232
|
+
if (e(this, C) !== d && (g(this, C, d), e(this, R) !== null)) {
|
|
233
233
|
const u = Math.ceil(e(this, C) / e(this, R));
|
|
234
234
|
g(this, _, u + 20), Z.log(`[RowManager] Resized. Height: ${e(this, C)}px | Target Rows: ${e(this, _)}`), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((b) => {
|
|
235
235
|
const w = s.querySelector(b);
|
|
@@ -241,12 +241,12 @@ const He = class He {
|
|
|
241
241
|
})), e(this, $).observe(e(this, M)));
|
|
242
242
|
}, "#initResizeObserver"));
|
|
243
243
|
// π― ν
νλ¦Ώ μΆμΆ, λμ΄ μΈ‘μ , μ΄κΈ° λ λλ§μ μμμ λ§κ² λ΄λΆμμ μΌκ΄ μ²λ¦¬
|
|
244
|
-
v(this, "initialize", /* @__PURE__ */
|
|
244
|
+
v(this, "initialize", /* @__PURE__ */ a((i) => {
|
|
245
245
|
Z.log(i);
|
|
246
246
|
const t = e(this, M).querySelector(".ng-container-body"), s = i.querySelector("tbody"), n = Array.from(s.querySelectorAll("tr"));
|
|
247
247
|
g(this, L, n.map((r) => r.cloneNode(!0))), g(this, R, null), e(this, le).call(this, t);
|
|
248
248
|
}, "initialize"));
|
|
249
|
-
f(this, le, /* @__PURE__ */
|
|
249
|
+
f(this, le, /* @__PURE__ */ a((i) => {
|
|
250
250
|
if (e(this, R) !== null && e(this, R) > 0)
|
|
251
251
|
return e(this, R);
|
|
252
252
|
if (e(this, L).length === 0)
|
|
@@ -258,13 +258,13 @@ const He = class He {
|
|
|
258
258
|
e(this, L).forEach((u) => {
|
|
259
259
|
n.appendChild(u.cloneNode(!0));
|
|
260
260
|
}), s ? s.before(n) : t.appendChild(n);
|
|
261
|
-
const r = i.closest("nine-table-sheet"), o = r ? r.style.display : "", l = r ? r.style.visibility : "",
|
|
261
|
+
const r = i.closest("nine-table-sheet"), o = r ? r.style.display : "", l = r ? r.style.visibility : "", h = r ? r.style.position : "";
|
|
262
262
|
r && (r.style.display === "none" || window.getComputedStyle(r).display === "none") && (r.style.display = "block", r.style.visibility = "hidden", r.style.position = "absolute");
|
|
263
|
-
let
|
|
264
|
-
const
|
|
265
|
-
if (
|
|
266
|
-
|
|
267
|
-
}),
|
|
263
|
+
let c = 0;
|
|
264
|
+
const d = t.querySelectorAll("tr:not(.nodata)");
|
|
265
|
+
if (d.forEach((u, b) => {
|
|
266
|
+
c += u.offsetHeight || u.getBoundingClientRect().height;
|
|
267
|
+
}), d.forEach((u) => u.remove()), r && (r.style.display = o, r.style.visibility = l, r.style.position = h), g(this, R, c), e(this, C) > 0) {
|
|
268
268
|
const u = Math.ceil(e(this, C) / e(this, R));
|
|
269
269
|
g(this, _, u + 20);
|
|
270
270
|
} else
|
|
@@ -287,7 +287,7 @@ const He = class He {
|
|
|
287
287
|
/**
|
|
288
288
|
* π― μΊμλ ν κ°μλ₯Ό κ³§λ°λ‘ κ°μ Έμμ TR λΌλ μ£Όμ
(μ€λ³΅ κ³μ° μ κ±°)
|
|
289
289
|
*/
|
|
290
|
-
f(this, ae, /* @__PURE__ */
|
|
290
|
+
f(this, ae, /* @__PURE__ */ a((i) => {
|
|
291
291
|
if (e(this, L).length === 0) return;
|
|
292
292
|
const t = i.querySelector("tbody.bindable") || i.querySelector("tbody");
|
|
293
293
|
if (!t) return;
|
|
@@ -299,7 +299,7 @@ const He = class He {
|
|
|
299
299
|
});
|
|
300
300
|
s ? s.before(n) : t.appendChild(n), console.log(`[RowManager] Rendered ${r} sets into DOM.`);
|
|
301
301
|
}, "#renderRows"));
|
|
302
|
-
v(this, "destroy", /* @__PURE__ */
|
|
302
|
+
v(this, "destroy", /* @__PURE__ */ a(() => {
|
|
303
303
|
e(this, $) && (e(this, $).disconnect(), g(this, $, null));
|
|
304
304
|
}, "destroy"));
|
|
305
305
|
g(this, M, i), e(this, re).call(this);
|
|
@@ -308,17 +308,88 @@ const He = class He {
|
|
|
308
308
|
return e(this, L).length || 1;
|
|
309
309
|
}
|
|
310
310
|
};
|
|
311
|
-
M = new WeakMap(), L = new WeakMap(), R = new WeakMap(), $ = new WeakMap(), C = new WeakMap(), _ = new WeakMap(), re = new WeakMap(), oe = new WeakMap(), le = new WeakMap(), ae = new WeakMap(),
|
|
311
|
+
M = new WeakMap(), L = new WeakMap(), R = new WeakMap(), $ = new WeakMap(), C = new WeakMap(), _ = new WeakMap(), re = new WeakMap(), oe = new WeakMap(), le = new WeakMap(), ae = new WeakMap(), a(He, "RowManager");
|
|
312
312
|
let Se = He;
|
|
313
|
-
var
|
|
313
|
+
var ce, G;
|
|
314
|
+
const k = class k {
|
|
315
|
+
/**
|
|
316
|
+
* π― λ μ΄μμ λ΄μ μ¬λ¬ rawTables λ°°μ΄μ μΌκ΄λ‘ λ°μ λ¨μΌ λ§μ€ν° ν
νλ¦ΏμΌλ‘ μ¬μ μ»΄νμΌν©λλ€.
|
|
317
|
+
*/
|
|
318
|
+
static compileAll(i) {
|
|
319
|
+
return Array.isArray(i) ? i.map((t) => k.compile(t)) : [];
|
|
320
|
+
}
|
|
321
|
+
/**
|
|
322
|
+
* π― λ¨μΌ μλ³Έ ν
μ΄λΈμ λ°μ κΈ°λ³Έ ꡬ쑰 보μ λ° 2μ°¨μ 격μ μΈλ±μ€ μ¬μ λΆμ¬ μλ£λ λ§μ€ν° ν
μ΄λΈ λ°ν
|
|
323
|
+
*/
|
|
324
|
+
static compile(i) {
|
|
325
|
+
var n, r, o;
|
|
326
|
+
if (!i) return null;
|
|
327
|
+
const t = i.cloneNode(!0);
|
|
328
|
+
return e(n = k, ce).call(n, t), e(r = k, G).call(r, t, "thead"), e(o = k, G).call(o, t, "tbody"), Array.from(t.querySelectorAll("colgroup col")).forEach((l, h) => {
|
|
329
|
+
const c = l.getAttribute("fixed");
|
|
330
|
+
c && t.querySelectorAll(`[data-col="${h}"]`).forEach((d) => {
|
|
331
|
+
d.setAttribute("fixed", c);
|
|
332
|
+
});
|
|
333
|
+
}), t;
|
|
334
|
+
}
|
|
335
|
+
};
|
|
336
|
+
ce = new WeakMap(), G = new WeakMap(), a(k, "TableCompiler"), f(k, ce, /* @__PURE__ */ a((i) => {
|
|
337
|
+
if (!i.querySelector("colgroup")) {
|
|
338
|
+
const t = i.querySelector("tbody tr") || i.querySelector("tr"), s = t ? t.querySelectorAll("th, td").length : 1, n = document.createElement("colgroup"), r = Math.max(Math.floor(i.clientWidth / s), 100);
|
|
339
|
+
for (let o = 0; o < s; o++) {
|
|
340
|
+
const l = document.createElement("col");
|
|
341
|
+
l.setAttribute("width", r), n.appendChild(l);
|
|
342
|
+
}
|
|
343
|
+
i.prepend(n);
|
|
344
|
+
}
|
|
345
|
+
if (!i.querySelector("thead")) {
|
|
346
|
+
const t = document.createElement("thead"), s = i.querySelector("colgroup");
|
|
347
|
+
s ? s.after(t) : i.prepend(t);
|
|
348
|
+
}
|
|
349
|
+
i.classList.add("nine-table-element"), i.style.display = "table";
|
|
350
|
+
}, "#ensureTableStructure")), f(k, G, /* @__PURE__ */ a((i, t) => {
|
|
351
|
+
const s = Array.from(i.querySelectorAll(t + " tr")), n = Array.from(i.querySelectorAll(t + " th," + t + " td")), r = s.length;
|
|
352
|
+
if (r === 0 || n.length === 0) return;
|
|
353
|
+
let o = 0;
|
|
354
|
+
n.forEach((h) => {
|
|
355
|
+
o += h.colSpan || 1;
|
|
356
|
+
});
|
|
357
|
+
const l = Array.from(Array(r), () => Array(o).fill(null));
|
|
358
|
+
s.forEach((h) => {
|
|
359
|
+
const c = h.sectionRowIndex;
|
|
360
|
+
let d = 0;
|
|
361
|
+
Array.from(h.querySelectorAll("th,td")).forEach((u) => {
|
|
362
|
+
for (let x = 0; x < l[c].length; x++)
|
|
363
|
+
if (l[c][x] === null) {
|
|
364
|
+
d = x;
|
|
365
|
+
break;
|
|
366
|
+
}
|
|
367
|
+
const b = u.rowSpan || 1, w = u.colSpan || 1;
|
|
368
|
+
for (let x = 0; x < b; x++)
|
|
369
|
+
for (let I = 0; I < w; I++)
|
|
370
|
+
c + x < r && d + I < o && (l[c + x][d + I] = x === 0 && I === 0 ? "1" : "0");
|
|
371
|
+
});
|
|
372
|
+
}), s.forEach((h) => {
|
|
373
|
+
const c = h.sectionRowIndex;
|
|
374
|
+
Array.from(h.querySelectorAll("th,td")).forEach((d) => {
|
|
375
|
+
for (let u = 0; u < l[c].length; u++)
|
|
376
|
+
if (l[c][u] === "1") {
|
|
377
|
+
d.dataset.col = u, l[c][u] = "0";
|
|
378
|
+
break;
|
|
379
|
+
}
|
|
380
|
+
});
|
|
381
|
+
});
|
|
382
|
+
}, "#resetColIndex"));
|
|
383
|
+
let Re = k;
|
|
384
|
+
var H, Y, U, J, he, de;
|
|
314
385
|
const j = class j extends HTMLElement {
|
|
315
386
|
constructor() {
|
|
316
387
|
super();
|
|
317
388
|
f(this, H, null);
|
|
318
389
|
f(this, Y);
|
|
319
|
-
v(this, "generate", /* @__PURE__ */
|
|
390
|
+
v(this, "generate", /* @__PURE__ */ a((t) => {
|
|
320
391
|
if (!t) return;
|
|
321
|
-
g(this, H, t), e(this, H).style.display = "table";
|
|
392
|
+
g(this, H, Re.compile(t)), e(this, H).style.display = "table";
|
|
322
393
|
const s = this.querySelector(".ng-container-left"), n = this.querySelector(".ng-container-body"), r = this.querySelector(".ng-container-right");
|
|
323
394
|
if (n) {
|
|
324
395
|
const o = e(this, U).call(this, e(this, H), null);
|
|
@@ -327,35 +398,35 @@ const j = class j extends HTMLElement {
|
|
|
327
398
|
if (s) {
|
|
328
399
|
const o = e(this, U).call(this, e(this, H), "left");
|
|
329
400
|
let l = 0;
|
|
330
|
-
o.querySelectorAll("col").forEach((
|
|
331
|
-
const
|
|
332
|
-
isNaN(
|
|
401
|
+
o.querySelectorAll("col").forEach((c) => {
|
|
402
|
+
const d = parseInt(c.getAttribute("width"), 10);
|
|
403
|
+
isNaN(d) || (l += d);
|
|
333
404
|
}), s.innerHTML = "", s.appendChild(o);
|
|
334
|
-
const
|
|
335
|
-
s.style.flex = `0 0 ${
|
|
405
|
+
const h = l > 0 ? l : 0;
|
|
406
|
+
s.style.flex = `0 0 ${h}px`, s.style.width = `${h}px`;
|
|
336
407
|
}
|
|
337
408
|
if (r) {
|
|
338
409
|
const o = e(this, U).call(this, e(this, H), "right");
|
|
339
410
|
let l = 0;
|
|
340
|
-
o.querySelectorAll("col").forEach((
|
|
341
|
-
const
|
|
342
|
-
isNaN(
|
|
411
|
+
o.querySelectorAll("col").forEach((c) => {
|
|
412
|
+
const d = parseInt(c.getAttribute("width"), 10);
|
|
413
|
+
isNaN(d) || (l += d);
|
|
343
414
|
}), r.innerHTML = "", r.appendChild(o);
|
|
344
|
-
const
|
|
345
|
-
r.style.flex = `0 0 ${
|
|
415
|
+
const h = l > 0 ? l : 0;
|
|
416
|
+
r.style.flex = `0 0 ${h}px`, r.style.width = `${h}px`;
|
|
346
417
|
}
|
|
347
418
|
n && n.addEventListener("scroll", () => {
|
|
348
419
|
var o;
|
|
349
420
|
(o = this.querySelector("nine-table-hscrollbar")) == null || o.refresh();
|
|
350
421
|
}), setTimeout(() => {
|
|
351
422
|
var o;
|
|
352
|
-
e(this,
|
|
423
|
+
e(this, J).call(this), (o = this.querySelector("nine-table-hscrollbar")) == null || o.refresh();
|
|
353
424
|
}, 0);
|
|
354
425
|
}, "generate"));
|
|
355
426
|
/**
|
|
356
427
|
* π― λ§μ€ν° ν
μ΄λΈμ κΈ°λ°μΌλ‘ νΉμ fixed νμ
μμλ§ λ¨κΈ°λ λΆν ν¬νΌ
|
|
357
428
|
*/
|
|
358
|
-
f(this, U, /* @__PURE__ */
|
|
429
|
+
f(this, U, /* @__PURE__ */ a((t, s) => {
|
|
359
430
|
const n = t.cloneNode(!0);
|
|
360
431
|
return s === "left" ? n.querySelectorAll("col, th, td").forEach((r) => {
|
|
361
432
|
r.getAttribute("fixed") !== "left" && r.remove();
|
|
@@ -365,36 +436,36 @@ const j = class j extends HTMLElement {
|
|
|
365
436
|
r.remove();
|
|
366
437
|
}), n;
|
|
367
438
|
}, "#createSplitTable"));
|
|
368
|
-
v(this, "getRowHeight", /* @__PURE__ */
|
|
369
|
-
v(this, "scrollToX", /* @__PURE__ */
|
|
439
|
+
v(this, "getRowHeight", /* @__PURE__ */ a(() => e(this, Y).getRowHeight(), "getRowHeight"));
|
|
440
|
+
v(this, "scrollToX", /* @__PURE__ */ a((t) => {
|
|
370
441
|
const s = this.querySelector(".ng-container-body");
|
|
371
442
|
s && (s.scrollLeft = t);
|
|
372
443
|
}, "scrollToX"));
|
|
373
|
-
v(this, "scrollToY", /* @__PURE__ */
|
|
444
|
+
v(this, "scrollToY", /* @__PURE__ */ a((t) => {
|
|
374
445
|
const s = this.querySelector(".ng-container-body");
|
|
375
446
|
s && (s.scrollTop = t);
|
|
376
447
|
}, "scrollToY"));
|
|
377
|
-
f(this,
|
|
378
|
-
var
|
|
448
|
+
f(this, J, /* @__PURE__ */ a(() => {
|
|
449
|
+
var c, d, u;
|
|
379
450
|
const t = this.querySelector(".ng-container-left table"), s = this.querySelector(".ng-container-body table"), n = this.querySelector(".ng-container-right table");
|
|
380
451
|
if (!s) return;
|
|
381
|
-
const r = t ? Array.from(t.querySelectorAll("tr")) : [], o = Array.from(s.querySelectorAll("tr")), l = n ? Array.from(n.querySelectorAll("tr")) : [],
|
|
382
|
-
for (let b = 0; b <
|
|
452
|
+
const r = t ? Array.from(t.querySelectorAll("tr")) : [], o = Array.from(s.querySelectorAll("tr")), l = n ? Array.from(n.querySelectorAll("tr")) : [], h = Math.max(r.length, o.length, l.length);
|
|
453
|
+
for (let b = 0; b < h; b++) {
|
|
383
454
|
const w = [
|
|
384
|
-
((
|
|
385
|
-
((
|
|
455
|
+
((c = r[b]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
|
|
456
|
+
((d = o[b]) == null ? void 0 : d.getBoundingClientRect().height) || 0,
|
|
386
457
|
((u = l[b]) == null ? void 0 : u.getBoundingClientRect().height) || 0
|
|
387
458
|
], x = Math.max(...w);
|
|
388
459
|
x > 0 && (r[b] && (r[b].style.height = `${x}px`), o[b] && (o[b].style.height = `${x}px`), l[b] && (l[b].style.height = `${x}px`));
|
|
389
460
|
}
|
|
390
461
|
}, "#syncRowHeights"));
|
|
391
|
-
f(this,
|
|
392
|
-
e(this,
|
|
462
|
+
f(this, he, /* @__PURE__ */ a(() => {
|
|
463
|
+
e(this, de).call(this), new MutationObserver((t) => {
|
|
393
464
|
for (const s of t)
|
|
394
|
-
s.attributeName === "class" && this.classList.contains("active") && e(this,
|
|
465
|
+
s.attributeName === "class" && this.classList.contains("active") && e(this, J).call(this);
|
|
395
466
|
}).observe(this, { attributes: !0 });
|
|
396
467
|
}, "#init"));
|
|
397
|
-
f(this,
|
|
468
|
+
f(this, de, /* @__PURE__ */ a(() => {
|
|
398
469
|
const t = j.SCROLLBAR_SIZE;
|
|
399
470
|
this.innerHTML = `
|
|
400
471
|
<style>
|
|
@@ -521,159 +592,88 @@ const j = class j extends HTMLElement {
|
|
|
521
592
|
g(this, Y, new Se(this));
|
|
522
593
|
}
|
|
523
594
|
connectedCallback() {
|
|
524
|
-
e(this,
|
|
595
|
+
e(this, he).call(this);
|
|
525
596
|
}
|
|
526
597
|
disconnectedCallback() {
|
|
527
598
|
this.innerHTML = "", Z.log("NineTableSheet destroyed.");
|
|
528
599
|
}
|
|
529
600
|
};
|
|
530
|
-
H = new WeakMap(), Y = new WeakMap(), U = new WeakMap(),
|
|
601
|
+
H = new WeakMap(), Y = new WeakMap(), U = new WeakMap(), J = new WeakMap(), he = new WeakMap(), de = new WeakMap(), a(j, "NineTableSheet"), v(j, "SCROLLBAR_SIZE", 16);
|
|
531
602
|
let ie = j;
|
|
532
603
|
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", ie);
|
|
533
|
-
var
|
|
604
|
+
var fe, Q;
|
|
534
605
|
const Ie = class Ie extends HTMLElement {
|
|
535
606
|
constructor() {
|
|
536
607
|
super();
|
|
537
|
-
f(this,
|
|
608
|
+
f(this, fe, /* @__PURE__ */ a(() => {
|
|
538
609
|
var t;
|
|
539
610
|
(t = this.querySelector(".nine-tab-bar")) == null || t.addEventListener("click", (s) => {
|
|
540
611
|
var o;
|
|
541
612
|
const n = s.ctrlKey || s.metaKey || s.shiftKey, r = parseInt((o = s.target.closest(".nine-tab-item")) == null ? void 0 : o.dataset.index, 10);
|
|
542
|
-
e(this,
|
|
543
|
-
}), e(this,
|
|
613
|
+
e(this, Q).call(this, r, n);
|
|
614
|
+
}), e(this, Q).call(this, 0, !1);
|
|
544
615
|
}, "#init"));
|
|
545
|
-
f(this,
|
|
546
|
-
const n = /* @__PURE__ */
|
|
547
|
-
const
|
|
616
|
+
f(this, Q, /* @__PURE__ */ a((t, s = !1) => {
|
|
617
|
+
const n = /* @__PURE__ */ a(() => {
|
|
618
|
+
const d = Array.from(this.querySelectorAll("nine-table-sheet"));
|
|
548
619
|
Array.from(this.querySelectorAll("nine-splitter")).forEach((w) => w.style.setProperty("display", "none"));
|
|
549
|
-
const b =
|
|
620
|
+
const b = d.filter((w) => w.classList.contains("active"));
|
|
550
621
|
b.length < 2 || b.forEach((w) => {
|
|
551
|
-
const x = parseInt(w.getAttribute("data-index"), 10), I = this.querySelector(`nine-splitter[data-split-index="${x}"]`), ze =
|
|
622
|
+
const x = parseInt(w.getAttribute("data-index"), 10), I = this.querySelector(`nine-splitter[data-split-index="${x}"]`), ze = d[x + 1];
|
|
552
623
|
I && ze && ze.classList.contains("active") && I.style.setProperty("display", "flex");
|
|
553
624
|
});
|
|
554
|
-
}, "updateSplitters"), r = this.querySelector(".nine-tab-bar"), o = this.querySelector("nine-table-sheets-body"), l = r.querySelectorAll(".nine-tab-item"),
|
|
625
|
+
}, "updateSplitters"), r = this.querySelector(".nine-tab-bar"), o = this.querySelector("nine-table-sheets-body"), l = r.querySelectorAll(".nine-tab-item"), h = o.querySelectorAll("nine-table-sheet");
|
|
555
626
|
if (!l[t]) return;
|
|
556
627
|
if (!s)
|
|
557
|
-
l.forEach((
|
|
558
|
-
|
|
559
|
-
}),
|
|
628
|
+
l.forEach((d, u) => {
|
|
629
|
+
d.classList.toggle("active", u === t);
|
|
630
|
+
}), h.forEach((d, u) => {
|
|
560
631
|
const b = u === t;
|
|
561
|
-
|
|
632
|
+
d.classList.toggle("active", b), d.style.flex = b ? "1 1 100%" : "";
|
|
562
633
|
});
|
|
563
634
|
else {
|
|
564
|
-
const
|
|
565
|
-
if (
|
|
635
|
+
const d = l[t], u = r.querySelectorAll(".nine-tab-item.active");
|
|
636
|
+
if (d.classList.contains("active") && u.length <= 1)
|
|
566
637
|
return;
|
|
567
|
-
|
|
638
|
+
d.classList.toggle("active");
|
|
568
639
|
const b = o.querySelector(`nine-table-sheet[data-index="${t}"]`);
|
|
569
640
|
b && (b.classList.toggle("active"), b.classList.contains("active") || (b.style.flex = ""));
|
|
570
641
|
}
|
|
571
|
-
const
|
|
572
|
-
|
|
573
|
-
|
|
642
|
+
const c = o.querySelectorAll("nine-table-sheet.active");
|
|
643
|
+
c == null || c.forEach((d) => {
|
|
644
|
+
d.style.flex = c.length > 1 ? "1 1 0%" : "1 1 100%";
|
|
574
645
|
}), n();
|
|
575
646
|
}, "#switchSheet"));
|
|
576
647
|
}
|
|
577
648
|
connectedCallback() {
|
|
578
|
-
e(this,
|
|
649
|
+
e(this, fe).call(this);
|
|
579
650
|
}
|
|
580
651
|
};
|
|
581
|
-
|
|
582
|
-
let
|
|
583
|
-
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets",
|
|
584
|
-
var fe, Q;
|
|
585
|
-
const k = class k {
|
|
586
|
-
/**
|
|
587
|
-
* π― λ μ΄μμ λ΄μ μ¬λ¬ rawTables λ°°μ΄μ μΌκ΄λ‘ λ°μ λ¨μΌ λ§μ€ν° ν
νλ¦ΏμΌλ‘ μ¬μ μ»΄νμΌν©λλ€.
|
|
588
|
-
*/
|
|
589
|
-
static compileAll(i) {
|
|
590
|
-
return Array.isArray(i) ? i.map((t) => k.compile(t)) : [];
|
|
591
|
-
}
|
|
592
|
-
/**
|
|
593
|
-
* π― λ¨μΌ μλ³Έ ν
μ΄λΈμ λ°μ κΈ°λ³Έ ꡬ쑰 보μ λ° 2μ°¨μ 격μ μΈλ±μ€ μ¬μ λΆμ¬ μλ£λ λ§μ€ν° ν
μ΄λΈ λ°ν
|
|
594
|
-
*/
|
|
595
|
-
static compile(i) {
|
|
596
|
-
var n, r, o;
|
|
597
|
-
if (!i) return null;
|
|
598
|
-
const t = i.cloneNode(!0);
|
|
599
|
-
return e(n = k, fe).call(n, t), e(r = k, Q).call(r, t, "thead"), e(o = k, Q).call(o, t, "tbody"), Array.from(t.querySelectorAll("colgroup col")).forEach((l, d) => {
|
|
600
|
-
const h = l.getAttribute("fixed");
|
|
601
|
-
h && t.querySelectorAll(`[data-col="${d}"]`).forEach((a) => {
|
|
602
|
-
a.setAttribute("fixed", h);
|
|
603
|
-
});
|
|
604
|
-
}), t;
|
|
605
|
-
}
|
|
606
|
-
};
|
|
607
|
-
fe = new WeakMap(), Q = new WeakMap(), c(k, "TableCompiler"), f(k, fe, /* @__PURE__ */ c((i) => {
|
|
608
|
-
if (!i.querySelector("colgroup")) {
|
|
609
|
-
const t = i.querySelector("tbody tr") || i.querySelector("tr"), s = t ? t.querySelectorAll("th, td").length : 1, n = document.createElement("colgroup"), r = Math.max(Math.floor(i.clientWidth / s), 100);
|
|
610
|
-
for (let o = 0; o < s; o++) {
|
|
611
|
-
const l = document.createElement("col");
|
|
612
|
-
l.setAttribute("width", r), n.appendChild(l);
|
|
613
|
-
}
|
|
614
|
-
i.prepend(n);
|
|
615
|
-
}
|
|
616
|
-
if (!i.querySelector("thead")) {
|
|
617
|
-
const t = document.createElement("thead"), s = i.querySelector("colgroup");
|
|
618
|
-
s ? s.after(t) : i.prepend(t);
|
|
619
|
-
}
|
|
620
|
-
i.classList.add("nine-table-element"), i.style.display = "table";
|
|
621
|
-
}, "#ensureTableStructure")), f(k, Q, /* @__PURE__ */ c((i, t) => {
|
|
622
|
-
const s = Array.from(i.querySelectorAll(t + " tr")), n = Array.from(i.querySelectorAll(t + " th," + t + " td")), r = s.length;
|
|
623
|
-
if (r === 0 || n.length === 0) return;
|
|
624
|
-
let o = 0;
|
|
625
|
-
n.forEach((d) => {
|
|
626
|
-
o += d.colSpan || 1;
|
|
627
|
-
});
|
|
628
|
-
const l = Array.from(Array(r), () => Array(o).fill(null));
|
|
629
|
-
s.forEach((d) => {
|
|
630
|
-
const h = d.sectionRowIndex;
|
|
631
|
-
let a = 0;
|
|
632
|
-
Array.from(d.querySelectorAll("th,td")).forEach((u) => {
|
|
633
|
-
for (let x = 0; x < l[h].length; x++)
|
|
634
|
-
if (l[h][x] === null) {
|
|
635
|
-
a = x;
|
|
636
|
-
break;
|
|
637
|
-
}
|
|
638
|
-
const b = u.rowSpan || 1, w = u.colSpan || 1;
|
|
639
|
-
for (let x = 0; x < b; x++)
|
|
640
|
-
for (let I = 0; I < w; I++)
|
|
641
|
-
h + x < r && a + I < o && (l[h + x][a + I] = x === 0 && I === 0 ? "1" : "0");
|
|
642
|
-
});
|
|
643
|
-
}), s.forEach((d) => {
|
|
644
|
-
const h = d.sectionRowIndex;
|
|
645
|
-
Array.from(d.querySelectorAll("th,td")).forEach((a) => {
|
|
646
|
-
for (let u = 0; u < l[h].length; u++)
|
|
647
|
-
if (l[h][u] === "1") {
|
|
648
|
-
a.dataset.col = u, l[h][u] = "0";
|
|
649
|
-
break;
|
|
650
|
-
}
|
|
651
|
-
});
|
|
652
|
-
});
|
|
653
|
-
}, "#resetColIndex"));
|
|
654
|
-
let Ee = k;
|
|
652
|
+
fe = new WeakMap(), Q = new WeakMap(), a(Ie, "NineTableSheets");
|
|
653
|
+
let Ee = Ie;
|
|
654
|
+
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", Ee);
|
|
655
655
|
var S, ue, ee, ge;
|
|
656
656
|
const Me = class Me {
|
|
657
657
|
constructor(i) {
|
|
658
658
|
f(this, S);
|
|
659
|
-
f(this, ue, /* @__PURE__ */
|
|
659
|
+
f(this, ue, /* @__PURE__ */ a(() => {
|
|
660
660
|
e(this, ge).call(this), new ResizeObserver((i) => {
|
|
661
661
|
for (let t of i)
|
|
662
662
|
e(this, S).getAttribute("auto-height") === "true" && e(this, ee).call(this);
|
|
663
663
|
}).observe(e(this, S));
|
|
664
664
|
}, "#init"));
|
|
665
|
-
f(this, ee, /* @__PURE__ */
|
|
666
|
-
var
|
|
665
|
+
f(this, ee, /* @__PURE__ */ a(() => {
|
|
666
|
+
var h, c;
|
|
667
667
|
const i = Array.from(e(this, S).shadowRoot.querySelectorAll("nine-table-sheet.active"));
|
|
668
668
|
if (i.length === 0) return;
|
|
669
|
-
const t = parseInt(e(this, S).getAttribute("max-display-row"), 10) || 10, s = Math.max(...i.map((
|
|
669
|
+
const t = parseInt(e(this, S).getAttribute("max-display-row"), 10) || 10, s = Math.max(...i.map((d) => d.getRowHeight())), n = (h = e(this, S).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : h.getBoundingClientRect().height, r = (c = e(this, S).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : c.getBoundingClientRect().height, o = ie.SCROLLBAR_SIZE, l = t * s + n + r + o;
|
|
670
670
|
e(this, S).style.height = `${l}px`;
|
|
671
671
|
}, "#applyAutoHeight"));
|
|
672
|
-
f(this, ge, /* @__PURE__ */
|
|
673
|
-
const t = Array.from(e(this, S).children).filter((h) => h.tagName === "TABLE"), s = e(this, S).getAttribute("auto-height") === "true", n = t.length, r = t.map((h,
|
|
674
|
-
const
|
|
675
|
-
return
|
|
676
|
-
}).join(""), o = t.map((h,
|
|
672
|
+
f(this, ge, /* @__PURE__ */ a(() => {
|
|
673
|
+
const t = Array.from(e(this, S).children).filter((h) => h.tagName === "TABLE"), s = e(this, S).getAttribute("auto-height") === "true", n = t.length, r = t.map((h, c) => {
|
|
674
|
+
const u = `<nine-table-sheet class="${c === 0 ? "active" : ""}" data-index="${c}"></nine-table-sheet>`, b = c < n - 1 ? `<nine-splitter class="h" data-split-index="${c}"></nine-splitter>` : "";
|
|
675
|
+
return u + b;
|
|
676
|
+
}).join(""), o = t.map((h, c) => `<div class="nine-tab-item ${c === 0 ? "active" : ""}" data-index="${c}">Sheet ${c + 1}</div>`).join("");
|
|
677
677
|
e(this, S).shadowRoot.innerHTML = `
|
|
678
678
|
<style>
|
|
679
679
|
:host {
|
|
@@ -773,24 +773,24 @@ const Me = class Me {
|
|
|
773
773
|
</nine-table-body>
|
|
774
774
|
<nine-table-footer></nine-table-footer>
|
|
775
775
|
`;
|
|
776
|
-
const l = e(this, S).shadowRoot.querySelectorAll("nine-table-sheet")
|
|
777
|
-
l == null || l.forEach((h,
|
|
778
|
-
|
|
779
|
-
h.generate(
|
|
776
|
+
const l = e(this, S).shadowRoot.querySelectorAll("nine-table-sheet");
|
|
777
|
+
l == null || l.forEach((h, c) => {
|
|
778
|
+
t[c] && setTimeout(() => {
|
|
779
|
+
h.generate(t[c]), s && e(this, ee).call(this);
|
|
780
780
|
});
|
|
781
781
|
});
|
|
782
782
|
}, "#render"));
|
|
783
783
|
g(this, S, i), e(this, ue).call(this);
|
|
784
784
|
}
|
|
785
785
|
};
|
|
786
|
-
S = new WeakMap(), ue = new WeakMap(), ee = new WeakMap(), ge = new WeakMap(),
|
|
786
|
+
S = new WeakMap(), ue = new WeakMap(), ee = new WeakMap(), ge = new WeakMap(), a(Me, "LayoutManager");
|
|
787
787
|
let Ae = Me;
|
|
788
788
|
var W, V;
|
|
789
789
|
const $e = class $e {
|
|
790
790
|
constructor(i) {
|
|
791
791
|
f(this, W);
|
|
792
792
|
f(this, V, -1);
|
|
793
|
-
v(this, "count", /* @__PURE__ */
|
|
793
|
+
v(this, "count", /* @__PURE__ */ a(() => e(this, W).rawRecords.length, "count"));
|
|
794
794
|
g(this, W, i);
|
|
795
795
|
}
|
|
796
796
|
get at() {
|
|
@@ -806,7 +806,7 @@ const $e = class $e {
|
|
|
806
806
|
});
|
|
807
807
|
}
|
|
808
808
|
};
|
|
809
|
-
W = new WeakMap(), V = new WeakMap(),
|
|
809
|
+
W = new WeakMap(), V = new WeakMap(), a($e, "ngRow");
|
|
810
810
|
let qe = $e;
|
|
811
811
|
var E, m, A, F, be, O, ye, te, pe, me, K;
|
|
812
812
|
const q = class q {
|
|
@@ -817,7 +817,7 @@ const q = class q {
|
|
|
817
817
|
f(this, F, []);
|
|
818
818
|
f(this, be, 0);
|
|
819
819
|
f(this, O, []);
|
|
820
|
-
f(this, ye, /* @__PURE__ */
|
|
820
|
+
f(this, ye, /* @__PURE__ */ a(() => {
|
|
821
821
|
g(this, O, []);
|
|
822
822
|
const i = e(this, E).template || [];
|
|
823
823
|
Array.from(i).forEach((t) => {
|
|
@@ -827,10 +827,10 @@ const q = class q {
|
|
|
827
827
|
t.__ng || (t.__ng = e(this, te).call(this)), t.__ng.height = e(this, O).slice();
|
|
828
828
|
});
|
|
829
829
|
}, "#initialize"));
|
|
830
|
-
v(this, "set", /* @__PURE__ */
|
|
830
|
+
v(this, "set", /* @__PURE__ */ a((i) => {
|
|
831
831
|
this.clear(), this.add(i, !1);
|
|
832
832
|
}, "set"));
|
|
833
|
-
f(this, te, /* @__PURE__ */
|
|
833
|
+
f(this, te, /* @__PURE__ */ a(() => ({
|
|
834
834
|
rowState: q.ROW_STATE.EMPTY,
|
|
835
835
|
deleted: !1,
|
|
836
836
|
filtered: !1,
|
|
@@ -839,14 +839,14 @@ const q = class q {
|
|
|
839
839
|
c: {},
|
|
840
840
|
_: [0, 0, 0, 0, q.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, e(this, O).slice(), -1, {}, {}]
|
|
841
841
|
}), "#getDefaultMeta"));
|
|
842
|
-
v(this, "reset", /* @__PURE__ */
|
|
842
|
+
v(this, "reset", /* @__PURE__ */ a(() => {
|
|
843
843
|
g(this, A, []), g(this, F, []);
|
|
844
844
|
}, "reset"));
|
|
845
|
-
v(this, "clear", /* @__PURE__ */
|
|
845
|
+
v(this, "clear", /* @__PURE__ */ a(() => {
|
|
846
846
|
var i;
|
|
847
847
|
e(this, m).rawRecords = [], g(this, A, []), g(this, F, []), (i = e(this, m).viewRecords) != null && i.reset && e(this, m).viewRecords.reset();
|
|
848
848
|
}, "clear"));
|
|
849
|
-
f(this, pe, /* @__PURE__ */
|
|
849
|
+
f(this, pe, /* @__PURE__ */ a((i) => {
|
|
850
850
|
var n;
|
|
851
851
|
Array.isArray(i) || (i = [i]);
|
|
852
852
|
const t = typeof ((n = e(this, E).fields) == null ? void 0 : n.get) == "function" ? e(this, E).fields.get() : Object.keys(i[0] || {}), s = [];
|
|
@@ -857,21 +857,21 @@ const q = class q {
|
|
|
857
857
|
}), s.push(o);
|
|
858
858
|
}), s;
|
|
859
859
|
}, "#json2Array"));
|
|
860
|
-
f(this, me, /* @__PURE__ */
|
|
860
|
+
f(this, me, /* @__PURE__ */ a((i) => (Array.isArray(i) || (i = [i]), i.forEach((t) => {
|
|
861
861
|
t.__ng = e(this, te).call(this), t.__ng.rowid = this.nextId, t.__ng.rowState = q.ROW_STATE.INSERT, t.__ng._[0] = t.__ng.rowid;
|
|
862
862
|
}), i), "#defaultInsert"));
|
|
863
|
-
v(this, "add", /* @__PURE__ */
|
|
863
|
+
v(this, "add", /* @__PURE__ */ a((i, t = !0) => {
|
|
864
864
|
var r;
|
|
865
865
|
i === void 0 && (i = {});
|
|
866
866
|
const s = e(this, pe).call(this, i);
|
|
867
867
|
e(this, m).rawRecords = e(this, m).rawRecords.concat(e(this, me).call(this, s)), this.resetRecords();
|
|
868
868
|
const n = this.count() - 1;
|
|
869
869
|
return t || s.forEach((o, l) => {
|
|
870
|
-
const
|
|
871
|
-
|
|
870
|
+
const h = e(this, m).rawRecords[n - l];
|
|
871
|
+
h && (h.__ng.rowState = q.ROW_STATE.EMPTY);
|
|
872
872
|
}), (r = e(this, m).viewRecords) != null && r.reset && e(this, m).viewRecords.reset(), n;
|
|
873
873
|
}, "add"));
|
|
874
|
-
v(this, "delete", /* @__PURE__ */
|
|
874
|
+
v(this, "delete", /* @__PURE__ */ a((i) => {
|
|
875
875
|
var s;
|
|
876
876
|
let t = [];
|
|
877
877
|
Array.isArray(i) ? t = i : typeof i > "u" ? t = [e(this, m).owner.row.at] : t = [parseInt(i, 10)], t.sort((n, r) => r - n).forEach((n) => {
|
|
@@ -883,25 +883,25 @@ const q = class q {
|
|
|
883
883
|
}
|
|
884
884
|
}), this.resetRecords(), (s = e(this, m).viewRecords) != null && s.reset && e(this, m).viewRecords.reset();
|
|
885
885
|
}, "delete"));
|
|
886
|
-
v(this, "setValue", /* @__PURE__ */
|
|
887
|
-
var
|
|
886
|
+
v(this, "setValue", /* @__PURE__ */ a((i, t, s) => {
|
|
887
|
+
var h;
|
|
888
888
|
i = parseInt(i, 10);
|
|
889
|
-
const r = (typeof ((
|
|
889
|
+
const r = (typeof ((h = e(this, E).fields) == null ? void 0 : h.get) == "function" ? e(this, E).fields.get() : []).indexOf(t);
|
|
890
890
|
if (r < 0) return;
|
|
891
891
|
const o = this.getValidData()[i];
|
|
892
892
|
if (!o) return;
|
|
893
893
|
const l = o.v[r];
|
|
894
894
|
l !== s && o.__ng.rowState !== q.ROW_STATE.INSERT && (o.__ng.o.hasOwnProperty(t) || (o.__ng.o[t] = l), o.__ng.rowState = q.ROW_STATE.UPDATE), o.v[r] = s, e(this, m).owner.refreshData && e(this, m).owner.refreshData(i);
|
|
895
895
|
}, "setValue"));
|
|
896
|
-
v(this, "resetRecords", /* @__PURE__ */
|
|
896
|
+
v(this, "resetRecords", /* @__PURE__ */ a(() => {
|
|
897
897
|
g(this, F, e(this, m).rawRecords.filter((i) => !i.__ng.deleted)), g(this, A, e(this, m).rawRecords.filter((i) => !i.__ng.deleted && !i.__ng.filtered)), e(this, m).rawRecords.forEach((i, t) => {
|
|
898
898
|
i.__ng.rowidx = t;
|
|
899
899
|
}), e(this, A).forEach((i, t) => {
|
|
900
900
|
i.__ng.i = t;
|
|
901
901
|
});
|
|
902
902
|
}, "resetRecords"));
|
|
903
|
-
v(this, "getValidData", /* @__PURE__ */
|
|
904
|
-
f(this, K, /* @__PURE__ */
|
|
903
|
+
v(this, "getValidData", /* @__PURE__ */ a(() => (e(this, A).length === 0 && e(this, m).rawRecords.length > 0 && this.resetRecords(), e(this, A)), "getValidData"));
|
|
904
|
+
f(this, K, /* @__PURE__ */ a((i) => {
|
|
905
905
|
var s;
|
|
906
906
|
if (!i) return i;
|
|
907
907
|
const t = typeof ((s = e(this, E).fields) == null ? void 0 : s.get) == "function" ? e(this, E).fields.get() : [];
|
|
@@ -912,8 +912,8 @@ const q = class q {
|
|
|
912
912
|
}), r.__ng = n.__ng, r;
|
|
913
913
|
}) : i;
|
|
914
914
|
}, "#conv2"));
|
|
915
|
-
v(this, "count", /* @__PURE__ */
|
|
916
|
-
v(this, "get", /* @__PURE__ */
|
|
915
|
+
v(this, "count", /* @__PURE__ */ a(() => this.getValidData().length, "count"));
|
|
916
|
+
v(this, "get", /* @__PURE__ */ a((i, t) => {
|
|
917
917
|
var r;
|
|
918
918
|
const s = this.getValidData();
|
|
919
919
|
if (!s || s.length <= 0) return;
|
|
@@ -944,7 +944,7 @@ const q = class q {
|
|
|
944
944
|
return this.length;
|
|
945
945
|
}
|
|
946
946
|
};
|
|
947
|
-
E = new WeakMap(), m = new WeakMap(), A = new WeakMap(), F = new WeakMap(), be = new WeakMap(), O = new WeakMap(), ye = new WeakMap(), te = new WeakMap(), pe = new WeakMap(), me = new WeakMap(), K = new WeakMap(),
|
|
947
|
+
E = new WeakMap(), m = new WeakMap(), A = new WeakMap(), F = new WeakMap(), be = new WeakMap(), O = new WeakMap(), ye = new WeakMap(), te = new WeakMap(), pe = new WeakMap(), me = new WeakMap(), K = new WeakMap(), a(q, "ngData"), // π― ν μν μ μ μμλ₯Ό ν΄λμ€ λ΄λΆλ‘ λ΄μ¬ν
|
|
948
948
|
v(q, "ROW_STATE", {
|
|
949
949
|
EMPTY: "EMPTY",
|
|
950
950
|
NORMAL: "NORMAL",
|
|
@@ -972,7 +972,7 @@ const We = class We {
|
|
|
972
972
|
}, this.setDataSource([]);
|
|
973
973
|
}
|
|
974
974
|
};
|
|
975
|
-
|
|
975
|
+
a(We, "ngDataManager");
|
|
976
976
|
let ke = We;
|
|
977
977
|
var X, we;
|
|
978
978
|
const Oe = class Oe extends HTMLElement {
|
|
@@ -1002,7 +1002,7 @@ const Oe = class Oe extends HTMLElement {
|
|
|
1002
1002
|
return e(this, X);
|
|
1003
1003
|
}
|
|
1004
1004
|
};
|
|
1005
|
-
X = new WeakMap(), we = new WeakMap(),
|
|
1005
|
+
X = new WeakMap(), we = new WeakMap(), a(Oe, "NineTable");
|
|
1006
1006
|
let Le = Oe;
|
|
1007
1007
|
customElements.get("nine-table") || customElements.define("nine-table", Le);
|
|
1008
1008
|
//# sourceMappingURL=nine-table.js.map
|