@ninebone/table 0.0.256 β 0.0.257
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 +218 -226
- 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,9 +3,9 @@ var Oe = (m) => {
|
|
|
3
3
|
throw TypeError(m);
|
|
4
4
|
};
|
|
5
5
|
var Ne = (m, i, t) => i in m ? ze(m, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : m[i] = t;
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
var e = (m, i, t) => (Be(m, i, "read from private field"), t ? t.call(m) : i.get(m)),
|
|
6
|
+
var c = (m, i) => ze(m, "name", { value: i, configurable: !0 });
|
|
7
|
+
var x = (m, i, t) => Ne(m, typeof i != "symbol" ? i + "" : i, t), Be = (m, i, t) => i.has(m) || Oe("Cannot " + t);
|
|
8
|
+
var e = (m, i, t) => (Be(m, i, "read from private field"), t ? t.call(m) : i.get(m)), u = (m, i, t) => i.has(m) ? Oe("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(m) : i.set(m, t), y = (m, i, t, s) => (Be(m, i, "write to private field"), s ? s.call(m, t) : i.set(m, t), t);
|
|
9
9
|
var De = (m, i, t, s) => ({
|
|
10
10
|
set _(n) {
|
|
11
11
|
y(m, i, n, t);
|
|
@@ -20,32 +20,32 @@ const qe = class qe extends Pe.constructor {
|
|
|
20
20
|
super(), this.init("nine-table", "green");
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
|
-
|
|
23
|
+
c(qe, "Trace");
|
|
24
24
|
let me = qe;
|
|
25
25
|
const Y = new me();
|
|
26
26
|
var C, O, p, B, D, N, ie, P, se;
|
|
27
27
|
const ke = class ke extends HTMLElement {
|
|
28
28
|
constructor() {
|
|
29
29
|
super();
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
30
|
+
u(this, C);
|
|
31
|
+
u(this, O, !1);
|
|
32
|
+
u(this, p);
|
|
33
|
+
u(this, B);
|
|
34
|
+
u(this, D);
|
|
35
|
+
u(this, N);
|
|
36
|
+
u(this, ie, /* @__PURE__ */ c(() => {
|
|
37
37
|
if (!e(this, C)) return;
|
|
38
38
|
const t = e(this, C).querySelector(".ng-container-body");
|
|
39
39
|
t && (y(this, N, new ResizeObserver(() => {
|
|
40
40
|
this.refresh();
|
|
41
41
|
})), e(this, N).observe(t));
|
|
42
42
|
}, "#observeResize"));
|
|
43
|
-
|
|
43
|
+
x(this, "refresh", /* @__PURE__ */ c(() => {
|
|
44
44
|
if (!e(this, C) || !e(this, p) || e(this, O)) 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, C).querySelector(".ng-container-bottom"),
|
|
48
|
-
if (
|
|
47
|
+
const n = e(this, p).track, r = e(this, p).thumb, o = e(this, C).querySelector(".ng-container-bottom"), a = t.clientWidth, d = s.scrollWidth;
|
|
48
|
+
if (a !== 0 && d > a)
|
|
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
|
|
57
|
-
r.style.width = `${
|
|
58
|
-
const f = t.scrollLeft,
|
|
59
|
-
let
|
|
60
|
-
|
|
61
|
-
const S = l -
|
|
62
|
-
|
|
56
|
+
const h = Math.max(Math.min(l * (a / d), l), 20);
|
|
57
|
+
r.style.width = `${h}px`;
|
|
58
|
+
const f = t.scrollLeft, g = d - a;
|
|
59
|
+
let b = 0;
|
|
60
|
+
g > 0 && (b = parseInt(f / g * (l - h), 10)), b < 0 && (b = 0);
|
|
61
|
+
const S = l - h;
|
|
62
|
+
b > S && (b = S), r.style.left = `${b}px`, Y.log(b), e(this, p).left.disabled = b === 0, e(this, p).right.disabled = b >= S - 1;
|
|
63
63
|
}, "refresh"));
|
|
64
|
-
|
|
64
|
+
u(this, P, /* @__PURE__ */ c((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 a = t;
|
|
70
|
+
a < 0 && (a = 0);
|
|
71
71
|
const d = r.width - o;
|
|
72
|
-
|
|
73
|
-
const l = s.clientWidth,
|
|
74
|
-
let f = d > 0 ? -
|
|
75
|
-
return -f >
|
|
72
|
+
a > d && (a = d), a = parseInt(a, 10), e(this, p).thumb.style.left = `${a}px`, e(this, p).left.disabled = a === 0, e(this, p).right.disabled = a >= d - 1;
|
|
73
|
+
const l = s.clientWidth, h = n.scrollWidth;
|
|
74
|
+
let f = d > 0 ? -a * (h - l) / d : 0;
|
|
75
|
+
return -f > h - l && (f = -(h - l)), -f + 5 > h - l && (f = -(h - l)), l >= h && (f = 0), n.style.transform = `translateX(${f}px)`, a > 0 && a < d - 1;
|
|
76
76
|
}, "#thumbMoveTo"));
|
|
77
|
-
|
|
78
|
-
const t = /* @__PURE__ */
|
|
77
|
+
u(this, se, /* @__PURE__ */ c(() => {
|
|
78
|
+
const t = /* @__PURE__ */ c((n) => {
|
|
79
79
|
clearInterval(e(this, B)), clearInterval(e(this, D));
|
|
80
80
|
const r = parseInt(e(this, p).thumb.style.left || 0, 10);
|
|
81
81
|
e(this, P).call(this, r + n), y(this, B, setInterval(() => {
|
|
@@ -84,7 +84,7 @@ const ke = class ke 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__ */ c(() => {
|
|
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 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, O, !0), this.shiftX = n.clientX - e(this, p).thumb.getBoundingClientRect().left;
|
|
104
|
-
const r = /* @__PURE__ */
|
|
104
|
+
const r = /* @__PURE__ */ c((a) => {
|
|
105
105
|
if (!e(this, O)) return;
|
|
106
106
|
const d = e(this, p).track.getBoundingClientRect();
|
|
107
|
-
e(this, P).call(this,
|
|
108
|
-
}, "onMouseMove"), o = /* @__PURE__ */
|
|
107
|
+
e(this, P).call(this, a.clientX - d.left - this.shiftX);
|
|
108
|
+
}, "onMouseMove"), o = /* @__PURE__ */ c(() => {
|
|
109
109
|
y(this, O, !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__ */ c(() => {
|
|
181
181
|
const s = e(this, C).querySelector(".ng-container-body");
|
|
182
182
|
if (!s) {
|
|
183
183
|
setTimeout(t, 10);
|
|
@@ -197,26 +197,26 @@ const ke = class ke extends HTMLElement {
|
|
|
197
197
|
e(this, N) && e(this, N).disconnect();
|
|
198
198
|
}
|
|
199
199
|
};
|
|
200
|
-
C = new WeakMap(), O = new WeakMap(), p = new WeakMap(), B = new WeakMap(), D = new WeakMap(), N = new WeakMap(), ie = new WeakMap(), P = new WeakMap(), se = new WeakMap(),
|
|
200
|
+
C = new WeakMap(), O = new WeakMap(), p = new WeakMap(), B = new WeakMap(), D = new WeakMap(), N = new WeakMap(), ie = new WeakMap(), P = new WeakMap(), se = new WeakMap(), c(ke, "NineTableHScrollBar");
|
|
201
201
|
let we = ke;
|
|
202
202
|
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", we);
|
|
203
|
-
var M, _, R, $,
|
|
203
|
+
var M, _, R, $, H, I, ne, re, oe, le;
|
|
204
204
|
const Le = class Le {
|
|
205
205
|
constructor(i) {
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
206
|
+
u(this, M);
|
|
207
|
+
u(this, _, []);
|
|
208
|
+
u(this, R, null);
|
|
209
|
+
u(this, $, null);
|
|
210
|
+
u(this, H, 0);
|
|
211
|
+
u(this, I, 0);
|
|
212
|
+
x(this, "getRowHeight", /* @__PURE__ */ c(() => e(this, R), "getRowHeight"));
|
|
213
|
+
u(this, ne, /* @__PURE__ */ c(() => {
|
|
214
214
|
e(this, re).call(this);
|
|
215
215
|
}, "#init"));
|
|
216
216
|
/**
|
|
217
217
|
* π― λ·°ν¬νΈ ν¬κΈ° λ³ν μμ μ λμ΄ κ³μ° λ° νμν ν κ°μ μ°μ Β·μΊμ±μ μκ²°
|
|
218
218
|
*/
|
|
219
|
-
|
|
219
|
+
u(this, re, /* @__PURE__ */ c(() => {
|
|
220
220
|
!e(this, M) || !(e(this, M) instanceof HTMLElement) || (y(this, $, new ResizeObserver((i) => {
|
|
221
221
|
for (const t of i) {
|
|
222
222
|
const s = t.target;
|
|
@@ -226,14 +226,14 @@ 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 a = s.querySelector(".ng-container-body") || s, d = a.querySelector("thead"), l = a.querySelector("tfoot");
|
|
230
230
|
d && (o += d.offsetHeight || d.getBoundingClientRect().height), l && (o += l.offsetHeight || l.getBoundingClientRect().height);
|
|
231
|
-
const
|
|
232
|
-
if (e(this,
|
|
233
|
-
const f = Math.ceil(e(this,
|
|
234
|
-
y(this,
|
|
235
|
-
const
|
|
236
|
-
|
|
231
|
+
const h = Math.max(r - o, 100);
|
|
232
|
+
if (e(this, H) !== h && (y(this, H, h), e(this, R) !== null)) {
|
|
233
|
+
const f = Math.ceil(e(this, H) / e(this, R));
|
|
234
|
+
y(this, I, f + 20), Y.log(`[RowManager] Resized. Height: ${e(this, H)}px | Target Rows: ${e(this, I)}`), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((g) => {
|
|
235
|
+
const b = s.querySelector(g);
|
|
236
|
+
b && b.querySelector("tbody") && e(this, le).call(this, b);
|
|
237
237
|
});
|
|
238
238
|
}
|
|
239
239
|
}
|
|
@@ -241,12 +241,12 @@ const Le = class Le {
|
|
|
241
241
|
})), e(this, $).observe(e(this, M)));
|
|
242
242
|
}, "#initResizeObserver"));
|
|
243
243
|
// π― ν
νλ¦Ώ μΆμΆ, λμ΄ μΈ‘μ , μ΄κΈ° λ λλ§μ μμμ λ§κ² λ΄λΆμμ μΌκ΄ μ²λ¦¬
|
|
244
|
-
|
|
244
|
+
x(this, "initialize", /* @__PURE__ */ c((i) => {
|
|
245
245
|
Y.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
|
y(this, _, n.map((r) => r.cloneNode(!0))), y(this, R, null), e(this, oe).call(this, t);
|
|
248
248
|
}, "initialize"));
|
|
249
|
-
|
|
249
|
+
u(this, oe, /* @__PURE__ */ c((i) => {
|
|
250
250
|
if (e(this, R) !== null && e(this, R) > 0)
|
|
251
251
|
return e(this, R);
|
|
252
252
|
if (e(this, _).length === 0)
|
|
@@ -258,18 +258,18 @@ const Le = class Le {
|
|
|
258
258
|
e(this, _).forEach((f) => {
|
|
259
259
|
n.appendChild(f.cloneNode(!0));
|
|
260
260
|
}), s ? s.before(n) : t.appendChild(n);
|
|
261
|
-
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 : "", a = r ? r.style.visibility : "", d = 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
263
|
let l = 0;
|
|
264
|
-
const
|
|
265
|
-
if (
|
|
264
|
+
const h = t.querySelectorAll("tr:not(.nodata)");
|
|
265
|
+
if (h.forEach((f, g) => {
|
|
266
266
|
l += f.offsetHeight || f.getBoundingClientRect().height;
|
|
267
|
-
}),
|
|
268
|
-
const f = Math.ceil(e(this,
|
|
269
|
-
y(this,
|
|
267
|
+
}), h.forEach((f) => f.remove()), r && (r.style.display = o, r.style.visibility = a, r.style.position = d), y(this, R, l), e(this, H) > 0) {
|
|
268
|
+
const f = Math.ceil(e(this, H) / e(this, R));
|
|
269
|
+
y(this, I, f + 20);
|
|
270
270
|
} else
|
|
271
|
-
y(this,
|
|
272
|
-
return console.log(`[RowManager] Template Height Cached: ${e(this, R)}px | RowCount: ${e(this,
|
|
271
|
+
y(this, I, 40);
|
|
272
|
+
return console.log(`[RowManager] Template Height Cached: ${e(this, R)}px | RowCount: ${e(this, I)}`), e(this, R);
|
|
273
273
|
}, "#measureAndCacheHeight"));
|
|
274
274
|
/**
|
|
275
275
|
* π― μΊμλ ν κ°μ λ°ν (μμ λλ§ μ΅μνμ λ°©μ΄ μ°μ°)
|
|
@@ -287,19 +287,19 @@ const Le = class Le {
|
|
|
287
287
|
/**
|
|
288
288
|
* π― μΊμλ ν κ°μλ₯Ό κ³§λ°λ‘ κ°μ Έμμ TR λΌλ μ£Όμ
(μ€λ³΅ κ³μ° μ κ±°)
|
|
289
289
|
*/
|
|
290
|
-
|
|
290
|
+
u(this, le, /* @__PURE__ */ c((i) => {
|
|
291
291
|
if (e(this, _).length === 0) return;
|
|
292
292
|
const t = i.querySelector("tbody.bindable") || i.querySelector("tbody");
|
|
293
293
|
if (!t) return;
|
|
294
294
|
t.querySelectorAll("tr:not(.nodata)").forEach((o) => o.remove());
|
|
295
|
-
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, I);
|
|
296
296
|
for (let o = 0; o < r; o++)
|
|
297
|
-
e(this, _).forEach((
|
|
298
|
-
n.appendChild(
|
|
297
|
+
e(this, _).forEach((a) => {
|
|
298
|
+
n.appendChild(a.cloneNode(!0));
|
|
299
299
|
});
|
|
300
300
|
s ? s.before(n) : t.appendChild(n), console.log(`[RowManager] Rendered ${r} sets into DOM.`);
|
|
301
301
|
}, "#renderRows"));
|
|
302
|
-
|
|
302
|
+
x(this, "destroy", /* @__PURE__ */ c(() => {
|
|
303
303
|
e(this, $) && (e(this, $).disconnect(), y(this, $, null));
|
|
304
304
|
}, "destroy"));
|
|
305
305
|
y(this, M, i), e(this, ne).call(this);
|
|
@@ -308,121 +308,113 @@ const Le = class Le {
|
|
|
308
308
|
return e(this, _).length || 1;
|
|
309
309
|
}
|
|
310
310
|
};
|
|
311
|
-
M = new WeakMap(), _ = new WeakMap(), R = new WeakMap(), $ = new WeakMap(),
|
|
311
|
+
M = new WeakMap(), _ = new WeakMap(), R = new WeakMap(), $ = new WeakMap(), H = new WeakMap(), I = new WeakMap(), ne = new WeakMap(), re = new WeakMap(), oe = new WeakMap(), le = new WeakMap(), c(Le, "RowManager");
|
|
312
312
|
let xe = Le;
|
|
313
313
|
var A, F, G, U, ae, ce;
|
|
314
314
|
const j = class j extends HTMLElement {
|
|
315
315
|
constructor() {
|
|
316
316
|
super();
|
|
317
|
-
|
|
318
|
-
|
|
317
|
+
u(this, A, null);
|
|
318
|
+
u(this, F);
|
|
319
319
|
/**
|
|
320
320
|
* π― 2μ°¨μ μ
격μ μΈλ±μ€λ₯Ό κ³μ°νμ¬ λ³ν©(`rowSpan`/`colSpan`) μ
μ μ λ μ»¬λΌ μμΉλ₯Ό λΆμ¬
|
|
321
321
|
*/
|
|
322
|
-
|
|
322
|
+
u(this, G, /* @__PURE__ */ c((t, s) => {
|
|
323
323
|
const n = Array.from(t.querySelectorAll(s + " tr")), r = Array.from(t.querySelectorAll(s + " th," + s + " td")), o = n.length;
|
|
324
324
|
if (o === 0 || r.length === 0) return;
|
|
325
|
-
let
|
|
325
|
+
let a = 0;
|
|
326
326
|
r.forEach((l) => {
|
|
327
|
-
|
|
327
|
+
a += l.colSpan || 1;
|
|
328
328
|
});
|
|
329
|
-
const d = Array.from(Array(o), () => Array(
|
|
329
|
+
const d = Array.from(Array(o), () => Array(a).fill(null));
|
|
330
330
|
n.forEach((l) => {
|
|
331
|
-
const
|
|
331
|
+
const h = l.sectionRowIndex;
|
|
332
332
|
let f = 0;
|
|
333
|
-
Array.from(l.querySelectorAll("th,td")).forEach((
|
|
334
|
-
for (let
|
|
335
|
-
if (d[
|
|
336
|
-
f =
|
|
333
|
+
Array.from(l.querySelectorAll("th,td")).forEach((g) => {
|
|
334
|
+
for (let v = 0; v < d[h].length; v++)
|
|
335
|
+
if (d[h][v] === null) {
|
|
336
|
+
f = v;
|
|
337
337
|
break;
|
|
338
338
|
}
|
|
339
|
-
const
|
|
340
|
-
for (let
|
|
339
|
+
const b = g.rowSpan || 1, S = g.colSpan || 1;
|
|
340
|
+
for (let v = 0; v < b; v++)
|
|
341
341
|
for (let L = 0; L < S; L++)
|
|
342
|
-
|
|
342
|
+
h + v < o && f + L < a && (d[h + v][f + L] = v === 0 && L === 0 ? "1" : "0");
|
|
343
343
|
});
|
|
344
344
|
}), n.forEach((l) => {
|
|
345
|
-
const
|
|
345
|
+
const h = l.sectionRowIndex;
|
|
346
346
|
Array.from(l.querySelectorAll("th,td")).forEach((f) => {
|
|
347
|
-
for (let
|
|
348
|
-
if (d[
|
|
349
|
-
f.dataset.col =
|
|
347
|
+
for (let g = 0; g < d[h].length; g++)
|
|
348
|
+
if (d[h][g] === "1") {
|
|
349
|
+
f.dataset.col = g, d[h][g] = "0";
|
|
350
350
|
break;
|
|
351
351
|
}
|
|
352
352
|
});
|
|
353
353
|
});
|
|
354
354
|
}, "#resetColIndex"));
|
|
355
355
|
/**
|
|
356
|
-
* π―
|
|
356
|
+
* π― μμ λ°λλΌ μλ°μ€ν¬λ¦½νΈ(Vanilla JS) κΈ°λ°μ κΉλν #createSplitTable
|
|
357
357
|
*/
|
|
358
|
-
|
|
359
|
-
const n = t.cloneNode(!0)
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
}), c.reverse().forEach((d) => {
|
|
367
|
-
o[d] && o[d].remove(), n.querySelectorAll("tr").forEach((l) => {
|
|
368
|
-
let a = 0;
|
|
369
|
-
Array.from(l.querySelectorAll("th, td")).forEach((u) => {
|
|
370
|
-
const g = u.colSpan || 1, S = a, x = a + g - 1;
|
|
371
|
-
d >= S && d <= x && (g === 1 ? u.remove() : u.colSpan = g - 1), a += g;
|
|
372
|
-
});
|
|
373
|
-
});
|
|
358
|
+
u(this, U, /* @__PURE__ */ c((t, s) => {
|
|
359
|
+
const n = t.cloneNode(!0);
|
|
360
|
+
return s === "left" ? n.querySelectorAll("col, th, td").forEach((r) => {
|
|
361
|
+
r.getAttribute("fixed") !== "left" && r.remove();
|
|
362
|
+
}) : s === "right" ? n.querySelectorAll("col, th, td").forEach((r) => {
|
|
363
|
+
r.getAttribute("fixed") !== "right" && r.remove();
|
|
364
|
+
}) : n.querySelectorAll("[fixed=left], [fixed=right]").forEach((r) => {
|
|
365
|
+
r.remove();
|
|
374
366
|
}), n;
|
|
375
367
|
}, "#createSplitTable"));
|
|
376
|
-
|
|
368
|
+
x(this, "generate", /* @__PURE__ */ c((t) => {
|
|
377
369
|
if (!t) return;
|
|
378
|
-
const s = /* @__PURE__ */
|
|
379
|
-
const
|
|
380
|
-
if (
|
|
381
|
-
const
|
|
370
|
+
const s = /* @__PURE__ */ c((l) => {
|
|
371
|
+
const h = /* @__PURE__ */ c((g) => {
|
|
372
|
+
if (g.querySelector("colgroup")) return;
|
|
373
|
+
const b = g.querySelector("tbody tr") || g.querySelector("tr"), S = b ? b.querySelectorAll("th, td").length : 1, v = document.createElement("colgroup"), L = Math.max(Math.floor(g.clientWidth / S), 100);
|
|
382
374
|
for (let $e = 0; $e < S; $e++) {
|
|
383
375
|
const We = document.createElement("col");
|
|
384
|
-
We.setAttribute("width", L),
|
|
376
|
+
We.setAttribute("width", L), v.appendChild(We);
|
|
385
377
|
}
|
|
386
|
-
|
|
387
|
-
}, "ensureColgroup"), f = /* @__PURE__ */
|
|
388
|
-
if (
|
|
389
|
-
const
|
|
390
|
-
S ? S.after(
|
|
378
|
+
g.prepend(v);
|
|
379
|
+
}, "ensureColgroup"), f = /* @__PURE__ */ c((g) => {
|
|
380
|
+
if (g.querySelector("thead")) return;
|
|
381
|
+
const b = document.createElement("thead"), S = g.querySelector("colgroup");
|
|
382
|
+
S ? S.after(b) : g.prepend(b);
|
|
391
383
|
}, "ensureThead");
|
|
392
|
-
return
|
|
384
|
+
return h(l), f(l), l.classList.add("nine-table-element"), l;
|
|
393
385
|
}, "initializeTable"), n = t.cloneNode(!0);
|
|
394
|
-
y(this, A, s(n)), e(this, A).style.display = "table", e(this, G).call(this, e(this, A), "thead"), e(this, G).call(this, e(this, A), "tbody"), Array.from(e(this, A).querySelectorAll("colgroup col")).forEach((l,
|
|
386
|
+
y(this, A, s(n)), e(this, A).style.display = "table", e(this, G).call(this, e(this, A), "thead"), e(this, G).call(this, e(this, A), "tbody"), Array.from(e(this, A).querySelectorAll("colgroup col")).forEach((l, h) => {
|
|
395
387
|
const f = l.getAttribute("fixed");
|
|
396
|
-
f && e(this, A).querySelectorAll(`[data-col="${
|
|
397
|
-
|
|
388
|
+
f && e(this, A).querySelectorAll(`[data-col="${h}"]`).forEach((g) => {
|
|
389
|
+
g.setAttribute("fixed", f);
|
|
398
390
|
});
|
|
399
391
|
}), Y.log(e(this, A));
|
|
400
|
-
const o = this.querySelector(".ng-container-left"),
|
|
401
|
-
if (
|
|
392
|
+
const o = this.querySelector(".ng-container-left"), a = this.querySelector(".ng-container-body"), d = this.querySelector(".ng-container-right");
|
|
393
|
+
if (a) {
|
|
402
394
|
const l = e(this, U).call(this, e(this, A), null);
|
|
403
|
-
|
|
395
|
+
a.innerHTML = "", a.appendChild(l), e(this, F).initialize(e(this, A));
|
|
404
396
|
}
|
|
405
397
|
if (o) {
|
|
406
398
|
const l = e(this, U).call(this, e(this, A), "left");
|
|
407
|
-
let
|
|
408
|
-
l.querySelectorAll("col").forEach((
|
|
409
|
-
const
|
|
410
|
-
isNaN(
|
|
399
|
+
let h = 0;
|
|
400
|
+
l.querySelectorAll("col").forEach((g) => {
|
|
401
|
+
const b = parseInt(g.getAttribute("width"), 10);
|
|
402
|
+
isNaN(b) || (h += b);
|
|
411
403
|
}), o.innerHTML = "", o.appendChild(l);
|
|
412
|
-
const f =
|
|
404
|
+
const f = h > 0 ? h : 0;
|
|
413
405
|
o.style.flex = `0 0 ${f}px`, o.style.width = `${f}px`;
|
|
414
406
|
}
|
|
415
407
|
if (d) {
|
|
416
408
|
const l = e(this, U).call(this, e(this, A), "right");
|
|
417
|
-
let
|
|
418
|
-
l.querySelectorAll("col").forEach((
|
|
419
|
-
const
|
|
420
|
-
isNaN(
|
|
409
|
+
let h = 0;
|
|
410
|
+
l.querySelectorAll("col").forEach((g) => {
|
|
411
|
+
const b = parseInt(g.getAttribute("width"), 10);
|
|
412
|
+
isNaN(b) || (h += b);
|
|
421
413
|
}), d.innerHTML = "", d.appendChild(l);
|
|
422
|
-
const f =
|
|
414
|
+
const f = h > 0 ? h : 0;
|
|
423
415
|
d.style.flex = `0 0 ${f}px`, d.style.width = `${f}px`;
|
|
424
416
|
}
|
|
425
|
-
|
|
417
|
+
a && a.addEventListener("scroll", () => {
|
|
426
418
|
var l;
|
|
427
419
|
(l = this.querySelector("nine-table-hscrollbar")) == null || l.refresh();
|
|
428
420
|
}), setTimeout(() => {
|
|
@@ -430,28 +422,28 @@ const j = class j extends HTMLElement {
|
|
|
430
422
|
(l = this.querySelector("nine-table-hscrollbar")) == null || l.refresh();
|
|
431
423
|
}, 0);
|
|
432
424
|
}, "generate"));
|
|
433
|
-
|
|
434
|
-
|
|
425
|
+
x(this, "getRowHeight", /* @__PURE__ */ c(() => e(this, F).getRowHeight(), "getRowHeight"));
|
|
426
|
+
x(this, "scrollToX", /* @__PURE__ */ c((t) => {
|
|
435
427
|
const s = this.querySelector(".ng-container-body");
|
|
436
428
|
s && (s.scrollLeft = t);
|
|
437
429
|
}, "scrollToX"));
|
|
438
|
-
|
|
430
|
+
x(this, "scrollToY", /* @__PURE__ */ c((t) => {
|
|
439
431
|
const s = this.querySelector(".ng-container-body");
|
|
440
432
|
s && (s.scrollTop = t);
|
|
441
433
|
}, "scrollToY"));
|
|
442
|
-
|
|
443
|
-
const t = /* @__PURE__ */
|
|
444
|
-
var
|
|
434
|
+
u(this, ae, /* @__PURE__ */ c(() => {
|
|
435
|
+
const t = /* @__PURE__ */ c(() => {
|
|
436
|
+
var h, f, g;
|
|
445
437
|
const s = this.querySelector(".ng-container-left table"), n = this.querySelector(".ng-container-body table"), r = this.querySelector(".ng-container-right table");
|
|
446
438
|
if (!n) return;
|
|
447
|
-
const o = s ? Array.from(s.querySelectorAll("tr")) : [],
|
|
448
|
-
for (let
|
|
439
|
+
const o = s ? Array.from(s.querySelectorAll("tr")) : [], a = Array.from(n.querySelectorAll("tr")), d = r ? Array.from(r.querySelectorAll("tr")) : [], l = Math.max(o.length, a.length, d.length);
|
|
440
|
+
for (let b = 0; b < l; b++) {
|
|
449
441
|
const S = [
|
|
450
|
-
((
|
|
451
|
-
((f =
|
|
452
|
-
((
|
|
453
|
-
],
|
|
454
|
-
|
|
442
|
+
((h = o[b]) == null ? void 0 : h.getBoundingClientRect().height) || 0,
|
|
443
|
+
((f = a[b]) == null ? void 0 : f.getBoundingClientRect().height) || 0,
|
|
444
|
+
((g = d[b]) == null ? void 0 : g.getBoundingClientRect().height) || 0
|
|
445
|
+
], v = Math.max(...S);
|
|
446
|
+
v > 0 && (o[b] && (o[b].style.height = `${v}px`), a[b] && (a[b].style.height = `${v}px`), d[b] && (d[b].style.height = `${v}px`));
|
|
455
447
|
}
|
|
456
448
|
}, "syncRowHeights");
|
|
457
449
|
e(this, ce).call(this), requestAnimationFrame(() => {
|
|
@@ -461,7 +453,7 @@ const j = class j extends HTMLElement {
|
|
|
461
453
|
n.attributeName === "class" && this.classList.contains("active") && t();
|
|
462
454
|
}).observe(this, { attributes: !0 });
|
|
463
455
|
}, "#init"));
|
|
464
|
-
|
|
456
|
+
u(this, ce, /* @__PURE__ */ c(() => {
|
|
465
457
|
const t = j.SCROLLBAR_SIZE;
|
|
466
458
|
this.innerHTML = `
|
|
467
459
|
<style>
|
|
@@ -594,14 +586,14 @@ const j = class j extends HTMLElement {
|
|
|
594
586
|
this.innerHTML = "", Y.log("NineTableSheet destroyed.");
|
|
595
587
|
}
|
|
596
588
|
};
|
|
597
|
-
A = new WeakMap(), F = new WeakMap(), G = new WeakMap(), U = new WeakMap(), ae = new WeakMap(), ce = new WeakMap(),
|
|
589
|
+
A = new WeakMap(), F = new WeakMap(), G = new WeakMap(), U = new WeakMap(), ae = new WeakMap(), ce = new WeakMap(), c(j, "NineTableSheet"), x(j, "SCROLLBAR_SIZE", 16);
|
|
598
590
|
let te = j;
|
|
599
591
|
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", te);
|
|
600
592
|
var he, J;
|
|
601
593
|
const Ce = class Ce extends HTMLElement {
|
|
602
594
|
constructor() {
|
|
603
595
|
super();
|
|
604
|
-
|
|
596
|
+
u(this, he, /* @__PURE__ */ c(() => {
|
|
605
597
|
var t;
|
|
606
598
|
(t = this.querySelector(".nine-tab-bar")) == null || t.addEventListener("click", (s) => {
|
|
607
599
|
var o;
|
|
@@ -609,35 +601,35 @@ const Ce = class Ce extends HTMLElement {
|
|
|
609
601
|
e(this, J).call(this, r, n);
|
|
610
602
|
}), e(this, J).call(this, 0, !1);
|
|
611
603
|
}, "#init"));
|
|
612
|
-
|
|
613
|
-
const n = /* @__PURE__ */
|
|
614
|
-
const
|
|
615
|
-
Array.from(this.querySelectorAll("nine-splitter")).forEach((
|
|
616
|
-
const
|
|
617
|
-
|
|
618
|
-
const S = parseInt(
|
|
619
|
-
|
|
604
|
+
u(this, J, /* @__PURE__ */ c((t, s = !1) => {
|
|
605
|
+
const n = /* @__PURE__ */ c(() => {
|
|
606
|
+
const h = Array.from(this.querySelectorAll("nine-table-sheet"));
|
|
607
|
+
Array.from(this.querySelectorAll("nine-splitter")).forEach((b) => b.style.setProperty("display", "none"));
|
|
608
|
+
const g = h.filter((b) => b.classList.contains("active"));
|
|
609
|
+
g.length < 2 || g.forEach((b) => {
|
|
610
|
+
const S = parseInt(b.getAttribute("data-index"), 10), v = this.querySelector(`nine-splitter[data-split-index="${S}"]`), L = h[S + 1];
|
|
611
|
+
v && L && L.classList.contains("active") && v.style.setProperty("display", "flex");
|
|
620
612
|
});
|
|
621
|
-
}, "updateSplitters"), r = this.querySelector(".nine-tab-bar"), o = this.querySelector("nine-table-sheets-body"),
|
|
622
|
-
if (!
|
|
613
|
+
}, "updateSplitters"), r = this.querySelector(".nine-tab-bar"), o = this.querySelector("nine-table-sheets-body"), a = r.querySelectorAll(".nine-tab-item"), d = o.querySelectorAll("nine-table-sheet");
|
|
614
|
+
if (!a[t]) return;
|
|
623
615
|
if (!s)
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
}), d.forEach((
|
|
627
|
-
const
|
|
628
|
-
|
|
616
|
+
a.forEach((h, f) => {
|
|
617
|
+
h.classList.toggle("active", f === t);
|
|
618
|
+
}), d.forEach((h, f) => {
|
|
619
|
+
const g = f === t;
|
|
620
|
+
h.classList.toggle("active", g), h.style.flex = g ? "1 1 100%" : "";
|
|
629
621
|
});
|
|
630
622
|
else {
|
|
631
|
-
const
|
|
632
|
-
if (
|
|
623
|
+
const h = a[t], f = r.querySelectorAll(".nine-tab-item.active");
|
|
624
|
+
if (h.classList.contains("active") && f.length <= 1)
|
|
633
625
|
return;
|
|
634
|
-
|
|
635
|
-
const
|
|
636
|
-
|
|
626
|
+
h.classList.toggle("active");
|
|
627
|
+
const g = o.querySelector(`nine-table-sheet[data-index="${t}"]`);
|
|
628
|
+
g && (g.classList.toggle("active"), g.classList.contains("active") || (g.style.flex = ""));
|
|
637
629
|
}
|
|
638
630
|
const l = o.querySelectorAll("nine-table-sheet.active");
|
|
639
|
-
l == null || l.forEach((
|
|
640
|
-
|
|
631
|
+
l == null || l.forEach((h) => {
|
|
632
|
+
h.style.flex = l.length > 1 ? "1 1 0%" : "1 1 100%";
|
|
641
633
|
}), n();
|
|
642
634
|
}, "#switchSheet"));
|
|
643
635
|
}
|
|
@@ -645,30 +637,30 @@ const Ce = class Ce extends HTMLElement {
|
|
|
645
637
|
e(this, he).call(this);
|
|
646
638
|
}
|
|
647
639
|
};
|
|
648
|
-
he = new WeakMap(), J = new WeakMap(),
|
|
640
|
+
he = new WeakMap(), J = new WeakMap(), c(Ce, "NineTableSheets");
|
|
649
641
|
let ve = Ce;
|
|
650
642
|
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", ve);
|
|
651
643
|
var E, de, Q, fe;
|
|
652
644
|
const _e = class _e {
|
|
653
645
|
constructor(i) {
|
|
654
|
-
|
|
655
|
-
|
|
646
|
+
u(this, E);
|
|
647
|
+
u(this, de, /* @__PURE__ */ c(() => {
|
|
656
648
|
e(this, fe).call(this), new ResizeObserver((i) => {
|
|
657
649
|
for (let t of i)
|
|
658
650
|
e(this, E).getAttribute("auto-height") === "true" && e(this, Q).call(this);
|
|
659
651
|
}).observe(e(this, E));
|
|
660
652
|
}, "#init"));
|
|
661
|
-
|
|
653
|
+
u(this, Q, /* @__PURE__ */ c(() => {
|
|
662
654
|
var d, l;
|
|
663
655
|
const i = Array.from(e(this, E).shadowRoot.querySelectorAll("nine-table-sheet.active"));
|
|
664
656
|
if (i.length === 0) return;
|
|
665
|
-
const t = parseInt(e(this, E).getAttribute("max-display-row"), 10) || 10, s = Math.max(...i.map((
|
|
666
|
-
e(this, E).style.height = `${
|
|
657
|
+
const t = parseInt(e(this, E).getAttribute("max-display-row"), 10) || 10, s = Math.max(...i.map((h) => h.getRowHeight())), n = (d = e(this, E).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : d.getBoundingClientRect().height, r = (l = e(this, E).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : l.getBoundingClientRect().height, o = te.SCROLLBAR_SIZE, a = t * s + n + r + o;
|
|
658
|
+
e(this, E).style.height = `${a}px`;
|
|
667
659
|
}, "#applyAutoHeight"));
|
|
668
|
-
|
|
660
|
+
u(this, fe, /* @__PURE__ */ c(() => {
|
|
669
661
|
const t = Array.from(e(this, E).children).filter((d) => d.tagName === "TABLE"), s = e(this, E).getAttribute("auto-height") === "true", n = t.length, r = t.map((d, l) => {
|
|
670
|
-
const f = `<nine-table-sheet class="${l === 0 ? "active" : ""}" data-index="${l}"></nine-table-sheet>`,
|
|
671
|
-
return f +
|
|
662
|
+
const f = `<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>` : "";
|
|
663
|
+
return f + g;
|
|
672
664
|
}).join(""), o = t.map((d, l) => `<div class="nine-tab-item ${l === 0 ? "active" : ""}" data-index="${l}">Sheet ${l + 1}</div>`).join("");
|
|
673
665
|
e(this, E).shadowRoot.innerHTML = `
|
|
674
666
|
<style>
|
|
@@ -769,8 +761,8 @@ const _e = class _e {
|
|
|
769
761
|
</nine-table-body>
|
|
770
762
|
<nine-table-footer></nine-table-footer>
|
|
771
763
|
`;
|
|
772
|
-
const
|
|
773
|
-
|
|
764
|
+
const a = e(this, E).shadowRoot.querySelectorAll("nine-table-sheet");
|
|
765
|
+
a == null || a.forEach((d, l) => {
|
|
774
766
|
t[l] && setTimeout(() => {
|
|
775
767
|
d.generate(t[l]), s && e(this, Q).call(this);
|
|
776
768
|
});
|
|
@@ -779,14 +771,14 @@ const _e = class _e {
|
|
|
779
771
|
y(this, E, i), e(this, de).call(this);
|
|
780
772
|
}
|
|
781
773
|
};
|
|
782
|
-
E = new WeakMap(), de = new WeakMap(), Q = new WeakMap(), fe = new WeakMap(),
|
|
774
|
+
E = new WeakMap(), de = new WeakMap(), Q = new WeakMap(), fe = new WeakMap(), c(_e, "LayoutManager");
|
|
783
775
|
let Se = _e;
|
|
784
776
|
var W, V;
|
|
785
|
-
const
|
|
777
|
+
const He = class He {
|
|
786
778
|
constructor(i) {
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
779
|
+
u(this, W);
|
|
780
|
+
u(this, V, -1);
|
|
781
|
+
x(this, "count", /* @__PURE__ */ c(() => e(this, W).rawRecords.length, "count"));
|
|
790
782
|
y(this, W, i);
|
|
791
783
|
}
|
|
792
784
|
get at() {
|
|
@@ -802,18 +794,18 @@ const Ie = class Ie {
|
|
|
802
794
|
});
|
|
803
795
|
}
|
|
804
796
|
};
|
|
805
|
-
W = new WeakMap(), V = new WeakMap(),
|
|
806
|
-
let Ee =
|
|
797
|
+
W = new WeakMap(), V = new WeakMap(), c(He, "ngRow");
|
|
798
|
+
let Ee = He;
|
|
807
799
|
var T, w, q, K, ue, z, ge, ee, be, ye, Z;
|
|
808
800
|
const k = class k {
|
|
809
801
|
constructor(i, t) {
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
802
|
+
u(this, T);
|
|
803
|
+
u(this, w);
|
|
804
|
+
u(this, q, []);
|
|
805
|
+
u(this, K, []);
|
|
806
|
+
u(this, ue, 0);
|
|
807
|
+
u(this, z, []);
|
|
808
|
+
u(this, ge, /* @__PURE__ */ c(() => {
|
|
817
809
|
y(this, z, []);
|
|
818
810
|
const i = e(this, T).template || [];
|
|
819
811
|
Array.from(i).forEach((t) => {
|
|
@@ -823,10 +815,10 @@ const k = class k {
|
|
|
823
815
|
t.__ng || (t.__ng = e(this, ee).call(this)), t.__ng.height = e(this, z).slice();
|
|
824
816
|
});
|
|
825
817
|
}, "#initialize"));
|
|
826
|
-
|
|
818
|
+
x(this, "set", /* @__PURE__ */ c((i) => {
|
|
827
819
|
this.clear(), this.add(i, !1);
|
|
828
820
|
}, "set"));
|
|
829
|
-
|
|
821
|
+
u(this, ee, /* @__PURE__ */ c(() => ({
|
|
830
822
|
rowState: k.ROW_STATE.EMPTY,
|
|
831
823
|
deleted: !1,
|
|
832
824
|
filtered: !1,
|
|
@@ -835,39 +827,39 @@ const k = class k {
|
|
|
835
827
|
c: {},
|
|
836
828
|
_: [0, 0, 0, 0, k.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, e(this, z).slice(), -1, {}, {}]
|
|
837
829
|
}), "#getDefaultMeta"));
|
|
838
|
-
|
|
830
|
+
x(this, "reset", /* @__PURE__ */ c(() => {
|
|
839
831
|
y(this, q, []), y(this, K, []);
|
|
840
832
|
}, "reset"));
|
|
841
|
-
|
|
833
|
+
x(this, "clear", /* @__PURE__ */ c(() => {
|
|
842
834
|
var i;
|
|
843
835
|
e(this, w).rawRecords = [], y(this, q, []), y(this, K, []), (i = e(this, w).viewRecords) != null && i.reset && e(this, w).viewRecords.reset();
|
|
844
836
|
}, "clear"));
|
|
845
|
-
|
|
837
|
+
u(this, be, /* @__PURE__ */ c((i) => {
|
|
846
838
|
var n;
|
|
847
839
|
Array.isArray(i) || (i = [i]);
|
|
848
840
|
const t = typeof ((n = e(this, T).fields) == null ? void 0 : n.get) == "function" ? e(this, T).fields.get() : Object.keys(i[0] || {}), s = [];
|
|
849
841
|
return i.forEach((r) => {
|
|
850
842
|
const o = { v: [] };
|
|
851
|
-
t.forEach((
|
|
852
|
-
o.v.push(r[
|
|
843
|
+
t.forEach((a) => {
|
|
844
|
+
o.v.push(r[a] !== void 0 && r[a] !== null ? r[a] : "");
|
|
853
845
|
}), s.push(o);
|
|
854
846
|
}), s;
|
|
855
847
|
}, "#json2Array"));
|
|
856
|
-
|
|
848
|
+
u(this, ye, /* @__PURE__ */ c((i) => (Array.isArray(i) || (i = [i]), i.forEach((t) => {
|
|
857
849
|
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;
|
|
858
850
|
}), i), "#defaultInsert"));
|
|
859
|
-
|
|
851
|
+
x(this, "add", /* @__PURE__ */ c((i, t = !0) => {
|
|
860
852
|
var r;
|
|
861
853
|
i === void 0 && (i = {});
|
|
862
854
|
const s = e(this, be).call(this, i);
|
|
863
855
|
e(this, w).rawRecords = e(this, w).rawRecords.concat(e(this, ye).call(this, s)), this.resetRecords();
|
|
864
856
|
const n = this.count() - 1;
|
|
865
|
-
return t || s.forEach((o,
|
|
866
|
-
const d = e(this, w).rawRecords[n -
|
|
857
|
+
return t || s.forEach((o, a) => {
|
|
858
|
+
const d = e(this, w).rawRecords[n - a];
|
|
867
859
|
d && (d.__ng.rowState = k.ROW_STATE.EMPTY);
|
|
868
860
|
}), (r = e(this, w).viewRecords) != null && r.reset && e(this, w).viewRecords.reset(), n;
|
|
869
861
|
}, "add"));
|
|
870
|
-
|
|
862
|
+
x(this, "delete", /* @__PURE__ */ c((i) => {
|
|
871
863
|
var s;
|
|
872
864
|
let t = [];
|
|
873
865
|
Array.isArray(i) ? t = i : typeof i > "u" ? t = [e(this, w).owner.row.at] : t = [parseInt(i, 10)], t.sort((n, r) => r - n).forEach((n) => {
|
|
@@ -879,37 +871,37 @@ const k = class k {
|
|
|
879
871
|
}
|
|
880
872
|
}), this.resetRecords(), (s = e(this, w).viewRecords) != null && s.reset && e(this, w).viewRecords.reset();
|
|
881
873
|
}, "delete"));
|
|
882
|
-
|
|
874
|
+
x(this, "setValue", /* @__PURE__ */ c((i, t, s) => {
|
|
883
875
|
var d;
|
|
884
876
|
i = parseInt(i, 10);
|
|
885
877
|
const r = (typeof ((d = e(this, T).fields) == null ? void 0 : d.get) == "function" ? e(this, T).fields.get() : []).indexOf(t);
|
|
886
878
|
if (r < 0) return;
|
|
887
879
|
const o = this.getValidData()[i];
|
|
888
880
|
if (!o) return;
|
|
889
|
-
const
|
|
890
|
-
|
|
881
|
+
const a = o.v[r];
|
|
882
|
+
a !== s && o.__ng.rowState !== k.ROW_STATE.INSERT && (o.__ng.o.hasOwnProperty(t) || (o.__ng.o[t] = a), o.__ng.rowState = k.ROW_STATE.UPDATE), o.v[r] = s, e(this, w).owner.refreshData && e(this, w).owner.refreshData(i);
|
|
891
883
|
}, "setValue"));
|
|
892
|
-
|
|
884
|
+
x(this, "resetRecords", /* @__PURE__ */ c(() => {
|
|
893
885
|
y(this, K, e(this, w).rawRecords.filter((i) => !i.__ng.deleted)), y(this, q, e(this, w).rawRecords.filter((i) => !i.__ng.deleted && !i.__ng.filtered)), e(this, w).rawRecords.forEach((i, t) => {
|
|
894
886
|
i.__ng.rowidx = t;
|
|
895
887
|
}), e(this, q).forEach((i, t) => {
|
|
896
888
|
i.__ng.i = t;
|
|
897
889
|
});
|
|
898
890
|
}, "resetRecords"));
|
|
899
|
-
|
|
900
|
-
|
|
891
|
+
x(this, "getValidData", /* @__PURE__ */ c(() => (e(this, q).length === 0 && e(this, w).rawRecords.length > 0 && this.resetRecords(), e(this, q)), "getValidData"));
|
|
892
|
+
u(this, Z, /* @__PURE__ */ c((i) => {
|
|
901
893
|
var s;
|
|
902
894
|
if (!i) return i;
|
|
903
895
|
const t = typeof ((s = e(this, T).fields) == null ? void 0 : s.get) == "function" ? e(this, T).fields.get() : [];
|
|
904
896
|
return Array.isArray(i) ? i.filter((n) => !n.__ng.deleted).map((n) => {
|
|
905
897
|
const r = {};
|
|
906
|
-
return t.forEach((o,
|
|
907
|
-
r[o] = n.v ? n.v[
|
|
898
|
+
return t.forEach((o, a) => {
|
|
899
|
+
r[o] = n.v ? n.v[a] : n[o];
|
|
908
900
|
}), r.__ng = n.__ng, r;
|
|
909
901
|
}) : i;
|
|
910
902
|
}, "#conv2"));
|
|
911
|
-
|
|
912
|
-
|
|
903
|
+
x(this, "count", /* @__PURE__ */ c(() => this.getValidData().length, "count"));
|
|
904
|
+
x(this, "get", /* @__PURE__ */ c((i, t) => {
|
|
913
905
|
var r;
|
|
914
906
|
const s = this.getValidData();
|
|
915
907
|
if (!s || s.length <= 0) return;
|
|
@@ -940,8 +932,8 @@ const k = class k {
|
|
|
940
932
|
return this.length;
|
|
941
933
|
}
|
|
942
934
|
};
|
|
943
|
-
T = new WeakMap(), w = new WeakMap(), q = new WeakMap(), K = new WeakMap(), ue = new WeakMap(), z = new WeakMap(), ge = new WeakMap(), ee = new WeakMap(), be = new WeakMap(), ye = new WeakMap(), Z = new WeakMap(),
|
|
944
|
-
|
|
935
|
+
T = new WeakMap(), w = new WeakMap(), q = new WeakMap(), K = new WeakMap(), ue = new WeakMap(), z = new WeakMap(), ge = new WeakMap(), ee = new WeakMap(), be = new WeakMap(), ye = new WeakMap(), Z = new WeakMap(), c(k, "ngData"), // π― ν μν μ μ μμλ₯Ό ν΄λμ€ λ΄λΆλ‘ λ΄μ¬ν
|
|
936
|
+
x(k, "ROW_STATE", {
|
|
945
937
|
EMPTY: "EMPTY",
|
|
946
938
|
NORMAL: "NORMAL",
|
|
947
939
|
INSERT: "INSERT",
|
|
@@ -949,7 +941,7 @@ v(k, "ROW_STATE", {
|
|
|
949
941
|
DELETE: "DELETE"
|
|
950
942
|
});
|
|
951
943
|
let Re = k;
|
|
952
|
-
const
|
|
944
|
+
const Ie = class Ie {
|
|
953
945
|
constructor(i) {
|
|
954
946
|
this.owner = i, this.row = new Ee(this), this.data = new Re(i, this), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.pageCnt = 25, this.viewRecords.reset = () => {
|
|
955
947
|
var t;
|
|
@@ -968,15 +960,15 @@ const He = class He {
|
|
|
968
960
|
}, this.setDataSource([]);
|
|
969
961
|
}
|
|
970
962
|
};
|
|
971
|
-
|
|
972
|
-
let Ae =
|
|
963
|
+
c(Ie, "ngDataManager");
|
|
964
|
+
let Ae = Ie;
|
|
973
965
|
var X, pe;
|
|
974
966
|
const Me = class Me extends HTMLElement {
|
|
975
967
|
constructor() {
|
|
976
968
|
super();
|
|
977
969
|
//#created = false;
|
|
978
|
-
|
|
979
|
-
|
|
970
|
+
u(this, X);
|
|
971
|
+
u(this, pe);
|
|
980
972
|
this.attachShadow({ mode: "open" }), y(this, X, new Ae(this));
|
|
981
973
|
}
|
|
982
974
|
connectedCallback() {
|
|
@@ -998,7 +990,7 @@ const Me = class Me extends HTMLElement {
|
|
|
998
990
|
return e(this, X);
|
|
999
991
|
}
|
|
1000
992
|
};
|
|
1001
|
-
X = new WeakMap(), pe = new WeakMap(),
|
|
993
|
+
X = new WeakMap(), pe = new WeakMap(), c(Me, "NineTable");
|
|
1002
994
|
let Te = Me;
|
|
1003
995
|
customElements.get("nine-table") || customElements.define("nine-table", Te);
|
|
1004
996
|
//# sourceMappingURL=nine-table.js.map
|