@ninebone/table 0.0.283 β 0.0.285
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 +231 -246
- package/dist/nine-table.js.map +1 -1
- package/dist/nine-table.umd.js +5 -5
- package/dist/nine-table.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/nine-table.js
CHANGED
|
@@ -4,7 +4,7 @@ var Ve = (p) => {
|
|
|
4
4
|
};
|
|
5
5
|
var Ue = (p, i, t) => i in p ? Pe(p, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : p[i] = t;
|
|
6
6
|
var a = (p, i) => Pe(p, "name", { value: i, configurable: !0 });
|
|
7
|
-
var
|
|
7
|
+
var x = (p, i, t) => Ue(p, typeof i != "symbol" ? i + "" : i, t), Xe = (p, i, t) => i.has(p) || Ve("Cannot " + t);
|
|
8
8
|
var e = (p, i, t) => (Xe(p, i, "read from private field"), t ? t.call(p) : i.get(p)), c = (p, i, t) => i.has(p) ? Ve("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(p) : i.set(p, t), g = (p, i, t, s) => (Xe(p, i, "write to private field"), s ? s.call(p, t) : i.set(p, t), t);
|
|
9
9
|
var Ye = (p, i, t, s) => ({
|
|
10
10
|
set _(n) {
|
|
@@ -14,24 +14,24 @@ var Ye = (p, i, t, s) => ({
|
|
|
14
14
|
return e(p, i, s);
|
|
15
15
|
}
|
|
16
16
|
});
|
|
17
|
-
import { trace as
|
|
18
|
-
const He = class He extends
|
|
17
|
+
import { trace as Fe } from "@ninebone/util";
|
|
18
|
+
const He = class He extends Fe.constructor {
|
|
19
19
|
constructor() {
|
|
20
20
|
super(), this.init("nine-table", "green");
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
23
|
a(He, "Trace");
|
|
24
|
-
let
|
|
25
|
-
const
|
|
26
|
-
var k, $,
|
|
24
|
+
let Ee = He;
|
|
25
|
+
const Z = new Ee();
|
|
26
|
+
var k, $, b, W, O, z, se, D, ne;
|
|
27
27
|
const Me = class Me extends HTMLElement {
|
|
28
28
|
constructor() {
|
|
29
29
|
super();
|
|
30
30
|
c(this, k);
|
|
31
31
|
c(this, $, !1);
|
|
32
|
-
c(this,
|
|
33
|
-
c(this, O);
|
|
32
|
+
c(this, b);
|
|
34
33
|
c(this, W);
|
|
34
|
+
c(this, O);
|
|
35
35
|
c(this, z);
|
|
36
36
|
c(this, se, /* @__PURE__ */ a(() => {
|
|
37
37
|
if (!e(this, k)) return;
|
|
@@ -40,71 +40,70 @@ const Me = class Me extends HTMLElement {
|
|
|
40
40
|
this.refresh();
|
|
41
41
|
})), e(this, z).observe(t));
|
|
42
42
|
}, "#observeResize"));
|
|
43
|
-
|
|
44
|
-
if (!e(this, k) || !e(this,
|
|
45
|
-
const t = e(this,
|
|
43
|
+
x(this, "refresh", /* @__PURE__ */ a(() => {
|
|
44
|
+
if (!e(this, k) || !e(this, b) || e(this, $)) return;
|
|
45
|
+
const t = e(this, b).container, s = t.querySelector("table");
|
|
46
46
|
if (!s) return;
|
|
47
|
-
const n = e(this,
|
|
48
|
-
if (l !== 0 &&
|
|
47
|
+
const n = e(this, b).track, r = e(this, b).thumb, o = e(this, k).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
|
|
59
|
-
let
|
|
60
|
-
|
|
61
|
-
const
|
|
62
|
-
|
|
54
|
+
const d = n.clientWidth;
|
|
55
|
+
if (d <= 0) return;
|
|
56
|
+
const u = Math.max(Math.min(d * (l / h), d), 20);
|
|
57
|
+
r.style.width = `${u}px`;
|
|
58
|
+
const f = t.scrollLeft, y = h - l;
|
|
59
|
+
let w = 0;
|
|
60
|
+
y > 0 && (w = parseInt(f / y * (d - u), 10)), w < 0 && (w = 0);
|
|
61
|
+
const v = d - u;
|
|
62
|
+
w > v && (w = v), r.style.left = `${w}px`, Z.log(w), e(this, b).left.disabled = w === 0, e(this, b).right.disabled = w >= v - 1;
|
|
63
63
|
}, "refresh"));
|
|
64
64
|
c(this, D, /* @__PURE__ */ a((t) => {
|
|
65
|
-
if (!e(this,
|
|
66
|
-
const s = e(this,
|
|
65
|
+
if (!e(this, b)) return !1;
|
|
66
|
+
const s = e(this, b).container, n = s.querySelector("table");
|
|
67
67
|
if (!n) return !1;
|
|
68
|
-
const r = e(this,
|
|
68
|
+
const r = e(this, b).track.getBoundingClientRect(), o = e(this, b).thumb.clientWidth;
|
|
69
69
|
let l = t;
|
|
70
70
|
l < 0 && (l = 0);
|
|
71
|
-
const
|
|
72
|
-
l >
|
|
73
|
-
const
|
|
74
|
-
|
|
75
|
-
return -b > f - h && (b = -(f - h)), -b + 5 > f - h && (b = -(f - h)), h >= f && (b = 0), n.style.transform = `translateX(${b}px)`, l > 0 && l < d - 1;
|
|
71
|
+
const h = r.width - o;
|
|
72
|
+
l > h && (l = h), l = parseInt(l, 10), e(this, b).thumb.style.left = `${l}px`, e(this, b).left.disabled = l === 0, e(this, b).right.disabled = l >= h - 1;
|
|
73
|
+
const d = s.clientWidth, f = n.scrollWidth - d;
|
|
74
|
+
return h > 0 && f > 0 && (s.scrollLeft = l / h * f), l > 0 && l < h - 1;
|
|
76
75
|
}, "#thumbMoveTo"));
|
|
77
76
|
c(this, ne, /* @__PURE__ */ a(() => {
|
|
78
77
|
const t = /* @__PURE__ */ a((n) => {
|
|
79
|
-
clearInterval(e(this,
|
|
80
|
-
const r = parseInt(e(this,
|
|
81
|
-
e(this, D).call(this, r + n), g(this,
|
|
82
|
-
clearInterval(e(this,
|
|
83
|
-
const o = parseInt(e(this,
|
|
84
|
-
e(this, D).call(this, o + n) || clearInterval(e(this,
|
|
78
|
+
clearInterval(e(this, W)), clearInterval(e(this, O));
|
|
79
|
+
const r = parseInt(e(this, b).thumb.style.left || 0, 10);
|
|
80
|
+
e(this, D).call(this, r + n), g(this, W, setInterval(() => {
|
|
81
|
+
clearInterval(e(this, W)), g(this, O, setInterval(() => {
|
|
82
|
+
const o = parseInt(e(this, b).thumb.style.left || 0, 10);
|
|
83
|
+
e(this, D).call(this, o + n) || clearInterval(e(this, O));
|
|
85
84
|
}, 50));
|
|
86
85
|
}, 500));
|
|
87
86
|
}, "delayScroll"), s = /* @__PURE__ */ a(() => {
|
|
88
|
-
clearInterval(e(this,
|
|
87
|
+
clearInterval(e(this, W)), clearInterval(e(this, O));
|
|
89
88
|
}, "clearTimer");
|
|
90
89
|
["mouseup", "mouseleave", "touchend"].forEach((n) => {
|
|
91
|
-
e(this,
|
|
92
|
-
}), e(this,
|
|
90
|
+
e(this, b).left.addEventListener(n, s), e(this, b).right.addEventListener(n, s), e(this, b).track.addEventListener(n, s);
|
|
91
|
+
}), e(this, b).left.addEventListener("mousedown", (n) => {
|
|
93
92
|
n.button === 0 && t(-20);
|
|
94
|
-
}), e(this,
|
|
93
|
+
}), e(this, b).right.addEventListener("mousedown", (n) => {
|
|
95
94
|
n.button === 0 && t(20);
|
|
96
|
-
}), e(this,
|
|
95
|
+
}), e(this, b).left.addEventListener("touchstart", () => t(-20)), e(this, b).right.addEventListener("touchstart", () => t(20)), e(this, b).track.addEventListener("mousedown", (n) => {
|
|
97
96
|
if (n.button !== 0) return;
|
|
98
97
|
n.preventDefault();
|
|
99
|
-
const r = e(this,
|
|
98
|
+
const r = e(this, b).track.getBoundingClientRect(), o = e(this, b).thumb.clientWidth;
|
|
100
99
|
e(this, D).call(this, n.clientX - r.left - o / 2);
|
|
101
|
-
}), e(this,
|
|
100
|
+
}), e(this, b).thumb.addEventListener("mousedown", (n) => {
|
|
102
101
|
if (n.button !== 0) return;
|
|
103
|
-
n.stopPropagation(), n.preventDefault(), g(this, $, !0), this.shiftX = n.clientX - e(this,
|
|
102
|
+
n.stopPropagation(), n.preventDefault(), g(this, $, !0), this.shiftX = n.clientX - e(this, b).thumb.getBoundingClientRect().left;
|
|
104
103
|
const r = /* @__PURE__ */ a((l) => {
|
|
105
104
|
if (!e(this, $)) return;
|
|
106
|
-
const
|
|
107
|
-
e(this, D).call(this, l.clientX -
|
|
105
|
+
const h = e(this, b).track.getBoundingClientRect();
|
|
106
|
+
e(this, D).call(this, l.clientX - h.left - this.shiftX);
|
|
108
107
|
}, "onMouseMove"), o = /* @__PURE__ */ a(() => {
|
|
109
108
|
g(this, $, !1), s(), document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", o), this.refresh();
|
|
110
109
|
}, "onMouseUp");
|
|
@@ -183,7 +182,7 @@ const Me = class Me extends HTMLElement {
|
|
|
183
182
|
setTimeout(t, 10);
|
|
184
183
|
return;
|
|
185
184
|
}
|
|
186
|
-
g(this,
|
|
185
|
+
g(this, b, {
|
|
187
186
|
container: s,
|
|
188
187
|
track: this.querySelector(".ng-scroll-track"),
|
|
189
188
|
thumb: this.querySelector(".ng-scroll-thumb"),
|
|
@@ -197,9 +196,9 @@ const Me = class Me extends HTMLElement {
|
|
|
197
196
|
e(this, z) && e(this, z).disconnect();
|
|
198
197
|
}
|
|
199
198
|
};
|
|
200
|
-
k = new WeakMap(), $ = new WeakMap(),
|
|
201
|
-
let
|
|
202
|
-
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar",
|
|
199
|
+
k = new WeakMap(), $ = new WeakMap(), b = new WeakMap(), W = new WeakMap(), O = new WeakMap(), z = new WeakMap(), se = new WeakMap(), D = new WeakMap(), ne = new WeakMap(), a(Me, "NineTableHScrollBar");
|
|
200
|
+
let Re = Me;
|
|
201
|
+
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", Re);
|
|
203
202
|
var re, j;
|
|
204
203
|
const L = class L {
|
|
205
204
|
/**
|
|
@@ -215,10 +214,10 @@ const L = class L {
|
|
|
215
214
|
var n, r, o;
|
|
216
215
|
if (!i) return null;
|
|
217
216
|
const t = i.cloneNode(!0);
|
|
218
|
-
return e(n = L, re).call(n, t), e(r = L, j).call(r, t, "thead"), e(o = L, j).call(o, t, "tbody"), Array.from(t.querySelectorAll("colgroup col")).forEach((l,
|
|
219
|
-
const
|
|
220
|
-
|
|
221
|
-
|
|
217
|
+
return e(n = L, re).call(n, t), e(r = L, j).call(r, t, "thead"), e(o = L, j).call(o, t, "tbody"), Array.from(t.querySelectorAll("colgroup col")).forEach((l, h) => {
|
|
218
|
+
const d = l.getAttribute("fixed");
|
|
219
|
+
d && t.querySelectorAll(`[data-col="${h}"]`).forEach((u) => {
|
|
220
|
+
u.setAttribute("fixed", d);
|
|
222
221
|
});
|
|
223
222
|
}), t;
|
|
224
223
|
}
|
|
@@ -241,62 +240,62 @@ re = new WeakMap(), j = new WeakMap(), a(L, "TableCompiler"), c(L, re, /* @__PUR
|
|
|
241
240
|
const s = Array.from(i.querySelectorAll(t + " tr")), n = Array.from(i.querySelectorAll(t + " th," + t + " td")), r = s.length;
|
|
242
241
|
if (r === 0 || n.length === 0) return;
|
|
243
242
|
let o = 0;
|
|
244
|
-
n.forEach((
|
|
245
|
-
o +=
|
|
243
|
+
n.forEach((h) => {
|
|
244
|
+
o += h.colSpan || 1;
|
|
246
245
|
});
|
|
247
246
|
const l = Array.from(Array(r), () => Array(o).fill(null));
|
|
248
|
-
s.forEach((
|
|
249
|
-
const
|
|
250
|
-
let
|
|
251
|
-
Array.from(
|
|
252
|
-
for (let
|
|
253
|
-
if (l[
|
|
254
|
-
|
|
247
|
+
s.forEach((h) => {
|
|
248
|
+
const d = h.sectionRowIndex;
|
|
249
|
+
let u = 0;
|
|
250
|
+
Array.from(h.querySelectorAll("th,td")).forEach((f) => {
|
|
251
|
+
for (let v = 0; v < l[d].length; v++)
|
|
252
|
+
if (l[d][v] === null) {
|
|
253
|
+
u = v;
|
|
255
254
|
break;
|
|
256
255
|
}
|
|
257
|
-
const
|
|
258
|
-
for (let
|
|
259
|
-
for (let C = 0; C <
|
|
260
|
-
|
|
256
|
+
const y = f.rowSpan || 1, w = f.colSpan || 1;
|
|
257
|
+
for (let v = 0; v < y; v++)
|
|
258
|
+
for (let C = 0; C < w; C++)
|
|
259
|
+
d + v < r && u + C < o && (l[d + v][u + C] = v === 0 && C === 0 ? "1" : "0");
|
|
261
260
|
});
|
|
262
|
-
}), s.forEach((
|
|
263
|
-
const
|
|
264
|
-
Array.from(
|
|
265
|
-
for (let
|
|
266
|
-
if (l[
|
|
267
|
-
|
|
261
|
+
}), s.forEach((h) => {
|
|
262
|
+
const d = h.sectionRowIndex;
|
|
263
|
+
Array.from(h.querySelectorAll("th,td")).forEach((u) => {
|
|
264
|
+
for (let f = 0; f < l[d].length; f++)
|
|
265
|
+
if (l[d][f] === "1") {
|
|
266
|
+
u.dataset.col = f, l[d][f] = "0";
|
|
268
267
|
break;
|
|
269
268
|
}
|
|
270
269
|
});
|
|
271
270
|
});
|
|
272
271
|
}, "#resetColIndex"));
|
|
273
|
-
let
|
|
274
|
-
var
|
|
272
|
+
let Ae = L;
|
|
273
|
+
var E, _, R, I, B, N, oe, le, G, ae, ce, J;
|
|
275
274
|
const $e = class $e {
|
|
276
275
|
constructor(i) {
|
|
277
|
-
c(this,
|
|
276
|
+
c(this, E);
|
|
278
277
|
c(this, _, /* @__PURE__ */ new Map());
|
|
279
278
|
// κ° μ»¨ν
μ΄λλ³ λ
립λ ν
νλ¦Ώ TR κ΄λ¦¬
|
|
280
|
-
c(this,
|
|
279
|
+
c(this, R, null);
|
|
281
280
|
c(this, I, null);
|
|
282
|
-
c(this,
|
|
283
|
-
c(this,
|
|
281
|
+
c(this, B, 0);
|
|
282
|
+
c(this, N, 40);
|
|
284
283
|
/**
|
|
285
284
|
* π― NineTableSheetμμ λ§μ€ν° ν
μ΄λΈμ μ λ¬λ°μ κ° μμλ³ ν
μ΄λΈ μμ± λ° ν
νλ¦Ώ μΆμΆ μΌμν
|
|
286
285
|
*/
|
|
287
286
|
// [RowManager.js μμ λ΄μ© λ°μ·]
|
|
288
|
-
|
|
289
|
-
g(this,
|
|
290
|
-
const s = e(this,
|
|
287
|
+
x(this, "initialize", /* @__PURE__ */ a(() => {
|
|
288
|
+
g(this, R, null), e(this, _).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((t) => {
|
|
289
|
+
const s = e(this, E).querySelector(t);
|
|
291
290
|
if (!s) return;
|
|
292
291
|
const n = s.querySelector("table");
|
|
293
292
|
if (!n) return;
|
|
294
293
|
const r = n.querySelector("tbody");
|
|
295
294
|
if (!r) return;
|
|
296
|
-
const l = Array.from(r.querySelectorAll("tr")).map((
|
|
295
|
+
const l = Array.from(r.querySelectorAll("tr")).map((h) => h.cloneNode(!0));
|
|
297
296
|
e(this, _).set(t, l);
|
|
298
297
|
});
|
|
299
|
-
const i = e(this,
|
|
298
|
+
const i = e(this, E).querySelector(".ng-container-body");
|
|
300
299
|
i && (e(this, le).call(this, i), e(this, J).call(this));
|
|
301
300
|
}, "initialize"));
|
|
302
301
|
c(this, oe, /* @__PURE__ */ a((i, t) => {
|
|
@@ -306,58 +305,61 @@ const $e = class $e {
|
|
|
306
305
|
if (!n) return;
|
|
307
306
|
n.querySelectorAll("tr:not(.nodata)").forEach((l) => l.remove());
|
|
308
307
|
const r = n.querySelector("tr.nodata"), o = document.createDocumentFragment();
|
|
309
|
-
for (let l = 0; l < e(this,
|
|
310
|
-
s.forEach((
|
|
311
|
-
o.appendChild(
|
|
308
|
+
for (let l = 0; l < e(this, N); l++)
|
|
309
|
+
s.forEach((h) => {
|
|
310
|
+
o.appendChild(h.cloneNode(!0));
|
|
312
311
|
});
|
|
313
312
|
r ? r.before(o) : n.appendChild(o);
|
|
314
313
|
}, "#renderRows"));
|
|
315
|
-
/**
|
|
316
|
-
* π― λ§μ€ν° ν
μ΄λΈμ κΈ°λ°μΌλ‘ νΉμ fixed νμ
μμλ§ λ¨κΈ°κ±°λ μ κ±°νλ λΆν ν¬νΌ
|
|
317
|
-
*/
|
|
318
|
-
c(this, Ie, /* @__PURE__ */ a((i, t) => {
|
|
319
|
-
const s = i.cloneNode(!0);
|
|
320
|
-
return t === "left" ? s.querySelectorAll("col, th, td").forEach((n) => {
|
|
321
|
-
n.getAttribute("fixed") !== "left" && n.remove();
|
|
322
|
-
}) : t === "right" ? s.querySelectorAll("col, th, td").forEach((n) => {
|
|
323
|
-
n.getAttribute("fixed") !== "right" && n.remove();
|
|
324
|
-
}) : s.querySelectorAll("[fixed='left'], [fixed='right']").forEach((n) => n.remove()), s;
|
|
325
|
-
}, "#createSplitTable"));
|
|
326
314
|
/**
|
|
327
315
|
* π― ν
νλ¦Ώ TRλ€μ μ΄ λμ΄λ₯Ό μΈ‘μ νκ³ μΊμ±
|
|
328
316
|
*/
|
|
329
317
|
c(this, le, /* @__PURE__ */ a((i) => {
|
|
330
|
-
if (e(this,
|
|
331
|
-
return e(this,
|
|
318
|
+
if (e(this, R) !== null && e(this, R) > 0)
|
|
319
|
+
return e(this, R);
|
|
332
320
|
const t = e(this, _).get(".ng-container-body");
|
|
333
321
|
if (!t || t.length === 0) return 24;
|
|
334
322
|
const s = i.querySelector("tbody");
|
|
335
323
|
if (!s) return 24;
|
|
336
|
-
s.querySelectorAll("tr:not(.nodata)").forEach((
|
|
324
|
+
s.querySelectorAll("tr:not(.nodata)").forEach((y) => y.remove());
|
|
337
325
|
const n = s.querySelector("tr.nodata"), r = document.createDocumentFragment();
|
|
338
|
-
t.forEach((
|
|
339
|
-
r.appendChild(
|
|
326
|
+
t.forEach((y) => {
|
|
327
|
+
r.appendChild(y.cloneNode(!0));
|
|
340
328
|
}), n ? n.before(r) : s.appendChild(r);
|
|
341
|
-
const o = e(this,
|
|
329
|
+
const o = e(this, E), l = o.style.display, h = o.style.visibility, d = o.style.position;
|
|
342
330
|
(l === "none" || window.getComputedStyle(o).display === "none") && (o.style.display = "block", o.style.visibility = "hidden", o.style.position = "absolute");
|
|
343
|
-
let
|
|
344
|
-
const
|
|
345
|
-
return
|
|
346
|
-
|
|
347
|
-
}),
|
|
331
|
+
let u = 0;
|
|
332
|
+
const f = s.querySelectorAll("tr:not(.nodata)");
|
|
333
|
+
return f.forEach((y) => {
|
|
334
|
+
u += y.offsetHeight || y.getBoundingClientRect().height;
|
|
335
|
+
}), f.forEach((y) => y.remove()), o.style.display = l, o.style.visibility = h, o.style.position = d, g(this, R, u > 0 ? u : 24), e(this, G).call(this), Z.log(`[RowManager] Height Cached: ${e(this, R)}px | RowCount: ${e(this, N)}`), e(this, R);
|
|
348
336
|
}, "#measureAndCacheHeight"));
|
|
349
337
|
c(this, G, /* @__PURE__ */ a(() => {
|
|
350
|
-
if (e(this,
|
|
351
|
-
const i = Math.ceil(e(this,
|
|
352
|
-
g(this,
|
|
338
|
+
if (e(this, B) > 0 && e(this, R) > 0) {
|
|
339
|
+
const i = Math.ceil(e(this, B) / e(this, R));
|
|
340
|
+
g(this, N, i + 20);
|
|
353
341
|
} else
|
|
354
|
-
g(this,
|
|
342
|
+
g(this, N, 40);
|
|
355
343
|
}, "#updateRowCount"));
|
|
344
|
+
c(this, ae, /* @__PURE__ */ a(() => {
|
|
345
|
+
var h, d, u;
|
|
346
|
+
const i = e(this, E).querySelector(".ng-container-left table"), t = e(this, E).querySelector(".ng-container-body table"), s = e(this, E).querySelector(".ng-container-right table");
|
|
347
|
+
if (!t) return;
|
|
348
|
+
const n = i ? Array.from(i.querySelectorAll("tr")) : [], r = Array.from(t.querySelectorAll("tr")), o = s ? Array.from(s.querySelectorAll("tr")) : [], l = Math.max(n.length, r.length, o.length);
|
|
349
|
+
for (let f = 0; f < l; f++) {
|
|
350
|
+
const y = [
|
|
351
|
+
((h = n[f]) == null ? void 0 : h.getBoundingClientRect().height) || 0,
|
|
352
|
+
((d = r[f]) == null ? void 0 : d.getBoundingClientRect().height) || 0,
|
|
353
|
+
((u = o[f]) == null ? void 0 : u.getBoundingClientRect().height) || 0
|
|
354
|
+
], w = Math.max(...y);
|
|
355
|
+
w > 0 && (n[f] && (n[f].style.height = `${w}px`), r[f] && (r[f].style.height = `${w}px`), o[f] && (o[f].style.height = `${w}px`));
|
|
356
|
+
}
|
|
357
|
+
}, "#syncRowHeights"));
|
|
356
358
|
/**
|
|
357
359
|
* π― ResizeObserver μ€μ : μνΈ ν¬κΈ° λ³κ²½ μ ν κ°μ μ¬μ°μ λ° μ¬λ λλ§
|
|
358
360
|
*/
|
|
359
|
-
c(this,
|
|
360
|
-
!e(this,
|
|
361
|
+
c(this, ce, /* @__PURE__ */ a(() => {
|
|
362
|
+
!e(this, E) || !(e(this, E) instanceof HTMLElement) || (g(this, I, new ResizeObserver((i) => {
|
|
361
363
|
for (const t of i) {
|
|
362
364
|
const s = t.target;
|
|
363
365
|
if (!s.classList.contains("active")) continue;
|
|
@@ -367,42 +369,42 @@ const $e = class $e {
|
|
|
367
369
|
const o = s.querySelector("thead");
|
|
368
370
|
o && (r += o.offsetHeight || o.getBoundingClientRect().height);
|
|
369
371
|
const l = Math.max(n - r, 100);
|
|
370
|
-
e(this,
|
|
372
|
+
e(this, B) !== l && (g(this, B, l), e(this, G).call(this), e(this, R) !== null && e(this, J).call(this));
|
|
371
373
|
}
|
|
372
374
|
}
|
|
373
|
-
})), e(this, I).observe(e(this,
|
|
375
|
+
})), e(this, I).observe(e(this, E)));
|
|
374
376
|
}, "#initResizeObserver"));
|
|
375
377
|
/**
|
|
376
378
|
* π― λ°λ λ° μ’μ° κ³ μ 컨ν
μ΄λ μ 체μ κ°κ°μ λ§λ ν
νλ¦Ώ ν λΌλ μ£Όμ
|
|
377
379
|
*/
|
|
378
380
|
c(this, J, /* @__PURE__ */ a(() => {
|
|
379
381
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((i) => {
|
|
380
|
-
const t = e(this,
|
|
382
|
+
const t = e(this, E).querySelector(i);
|
|
381
383
|
t && t.querySelector("tbody") && e(this, oe).call(this, t, i);
|
|
382
|
-
}),
|
|
384
|
+
}), e(this, ae).call(this);
|
|
383
385
|
}, "#renderAllContainers"));
|
|
384
|
-
|
|
386
|
+
x(this, "destroy", /* @__PURE__ */ a(() => {
|
|
385
387
|
e(this, I) && (e(this, I).disconnect(), g(this, I, null));
|
|
386
388
|
}, "destroy"));
|
|
387
|
-
g(this,
|
|
389
|
+
g(this, E, i), e(this, ce).call(this);
|
|
388
390
|
}
|
|
389
391
|
getRowHeight() {
|
|
390
|
-
return e(this,
|
|
392
|
+
return e(this, R);
|
|
391
393
|
}
|
|
392
394
|
templateLength(i = ".ng-container-body") {
|
|
393
395
|
var t;
|
|
394
396
|
return ((t = e(this, _).get(i)) == null ? void 0 : t.length) || 1;
|
|
395
397
|
}
|
|
396
398
|
};
|
|
397
|
-
|
|
398
|
-
let
|
|
399
|
-
var X, Y,
|
|
400
|
-
const
|
|
399
|
+
E = new WeakMap(), _ = new WeakMap(), R = new WeakMap(), I = new WeakMap(), B = new WeakMap(), N = new WeakMap(), oe = new WeakMap(), le = new WeakMap(), G = new WeakMap(), ae = new WeakMap(), ce = new WeakMap(), J = new WeakMap(), a($e, "RowManager");
|
|
400
|
+
let qe = $e;
|
|
401
|
+
var X, Y, he, de, fe, ue, ge;
|
|
402
|
+
const K = class K extends HTMLElement {
|
|
401
403
|
constructor() {
|
|
402
404
|
super();
|
|
403
405
|
c(this, X, null);
|
|
404
406
|
c(this, Y);
|
|
405
|
-
c(this,
|
|
407
|
+
c(this, he, /* @__PURE__ */ a(() => {
|
|
406
408
|
[
|
|
407
409
|
{ selector: ".ng-container-body", type: null },
|
|
408
410
|
{ selector: ".ng-container-left", type: "left" },
|
|
@@ -410,11 +412,11 @@ const Z = class Z extends HTMLElement {
|
|
|
410
412
|
].forEach(({ selector: s, type: n }) => {
|
|
411
413
|
const r = this.querySelector(s);
|
|
412
414
|
if (!r) return;
|
|
413
|
-
const o = e(this,
|
|
415
|
+
const o = e(this, fe).call(this, e(this, X), n);
|
|
414
416
|
r.innerHTML = "", r.appendChild(o);
|
|
415
417
|
});
|
|
416
418
|
}, "#renderSplitContainers"));
|
|
417
|
-
c(this,
|
|
419
|
+
c(this, de, /* @__PURE__ */ a(() => {
|
|
418
420
|
["left", "right"].forEach((t) => {
|
|
419
421
|
const s = this.querySelector(`.ng-container-${t}`), n = s == null ? void 0 : s.querySelector("table");
|
|
420
422
|
if (!s || !n) return;
|
|
@@ -425,9 +427,9 @@ const Z = class Z extends HTMLElement {
|
|
|
425
427
|
}), s.style.flex = `0 0 ${r}px`, s.style.width = `${r}px`;
|
|
426
428
|
});
|
|
427
429
|
}, "#updateContainerWidths"));
|
|
428
|
-
|
|
430
|
+
x(this, "generate", /* @__PURE__ */ a((t) => {
|
|
429
431
|
if (!t) return;
|
|
430
|
-
g(this, X,
|
|
432
|
+
g(this, X, Ae.compile(t)), e(this, X).style.display = "table", e(this, he).call(this), e(this, Y).initialize(), e(this, de).call(this);
|
|
431
433
|
const s = this.querySelector(".ng-container-body");
|
|
432
434
|
s && s.addEventListener("scroll", () => {
|
|
433
435
|
var n;
|
|
@@ -440,7 +442,7 @@ const Z = class Z extends HTMLElement {
|
|
|
440
442
|
/**
|
|
441
443
|
* π― λ§μ€ν° ν
μ΄λΈμ κΈ°λ°μΌλ‘ νΉμ fixed νμ
μμλ§ λ¨κΈ°λ λΆν ν¬νΌ
|
|
442
444
|
*/
|
|
443
|
-
c(this,
|
|
445
|
+
c(this, fe, /* @__PURE__ */ a((t, s) => {
|
|
444
446
|
const n = t.cloneNode(!0);
|
|
445
447
|
return s === "left" ? n.querySelectorAll("col, th, td").forEach((r) => {
|
|
446
448
|
r.getAttribute("fixed") !== "left" && r.remove();
|
|
@@ -450,37 +452,20 @@ const Z = class Z extends HTMLElement {
|
|
|
450
452
|
r.remove();
|
|
451
453
|
}), n;
|
|
452
454
|
}, "#createSplitTable"));
|
|
453
|
-
|
|
454
|
-
|
|
455
|
+
x(this, "getRowHeight", /* @__PURE__ */ a(() => e(this, Y).getRowHeight(), "getRowHeight"));
|
|
456
|
+
x(this, "scrollToX", /* @__PURE__ */ a((t) => {
|
|
455
457
|
const s = this.querySelector(".ng-container-body");
|
|
456
458
|
s && (s.scrollLeft = t);
|
|
457
459
|
}, "scrollToX"));
|
|
458
|
-
|
|
460
|
+
x(this, "scrollToY", /* @__PURE__ */ a((t) => {
|
|
459
461
|
const s = this.querySelector(".ng-container-body");
|
|
460
462
|
s && (s.scrollTop = t);
|
|
461
463
|
}, "scrollToY"));
|
|
462
|
-
v(this, "syncRowHeights", /* @__PURE__ */ a(() => {
|
|
463
|
-
var h, f, b;
|
|
464
|
-
const t = this.querySelector(".ng-container-left table"), s = this.querySelector(".ng-container-body table"), n = this.querySelector(".ng-container-right table");
|
|
465
|
-
if (!s) return;
|
|
466
|
-
const r = t ? Array.from(t.querySelectorAll("tr")) : [], o = Array.from(s.querySelectorAll("tr")), l = n ? Array.from(n.querySelectorAll("tr")) : [], d = Math.max(r.length, o.length, l.length);
|
|
467
|
-
for (let u = 0; u < d; u++) {
|
|
468
|
-
const x = [
|
|
469
|
-
((h = r[u]) == null ? void 0 : h.getBoundingClientRect().height) || 0,
|
|
470
|
-
((f = o[u]) == null ? void 0 : f.getBoundingClientRect().height) || 0,
|
|
471
|
-
((b = l[u]) == null ? void 0 : b.getBoundingClientRect().height) || 0
|
|
472
|
-
], w = Math.max(...x);
|
|
473
|
-
w > 0 && (r[u] && (r[u].style.height = `${w}px`), o[u] && (o[u].style.height = `${w}px`), l[u] && (l[u].style.height = `${w}px`));
|
|
474
|
-
}
|
|
475
|
-
}, "syncRowHeights"));
|
|
476
|
-
c(this, fe, /* @__PURE__ */ a(() => {
|
|
477
|
-
e(this, ue).call(this), new MutationObserver((t) => {
|
|
478
|
-
for (const s of t)
|
|
479
|
-
s.attributeName === "class" && this.classList.contains("active");
|
|
480
|
-
}).observe(this, { attributes: !0 });
|
|
481
|
-
}, "#init"));
|
|
482
464
|
c(this, ue, /* @__PURE__ */ a(() => {
|
|
483
|
-
|
|
465
|
+
e(this, ge).call(this);
|
|
466
|
+
}, "#init"));
|
|
467
|
+
c(this, ge, /* @__PURE__ */ a(() => {
|
|
468
|
+
const t = K.SCROLLBAR_SIZE;
|
|
484
469
|
this.innerHTML = `
|
|
485
470
|
<style>
|
|
486
471
|
nine-table-sheet {
|
|
@@ -603,23 +588,23 @@ const Z = class Z extends HTMLElement {
|
|
|
603
588
|
</div>
|
|
604
589
|
`;
|
|
605
590
|
}, "#render"));
|
|
606
|
-
g(this, Y, new
|
|
591
|
+
g(this, Y, new qe(this));
|
|
607
592
|
}
|
|
608
593
|
connectedCallback() {
|
|
609
|
-
e(this,
|
|
594
|
+
e(this, ue).call(this);
|
|
610
595
|
}
|
|
611
596
|
disconnectedCallback() {
|
|
612
|
-
this.innerHTML = "",
|
|
597
|
+
this.innerHTML = "", Z.log("NineTableSheet destroyed.");
|
|
613
598
|
}
|
|
614
599
|
};
|
|
615
|
-
X = new WeakMap(), Y = new WeakMap(),
|
|
616
|
-
let ie =
|
|
600
|
+
X = new WeakMap(), Y = new WeakMap(), he = new WeakMap(), de = new WeakMap(), fe = new WeakMap(), ue = new WeakMap(), ge = new WeakMap(), a(K, "NineTableSheet"), x(K, "SCROLLBAR_SIZE", 16);
|
|
601
|
+
let ie = K;
|
|
617
602
|
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", ie);
|
|
618
|
-
var
|
|
619
|
-
const
|
|
603
|
+
var be, Q;
|
|
604
|
+
const We = class We extends HTMLElement {
|
|
620
605
|
constructor() {
|
|
621
606
|
super();
|
|
622
|
-
c(this,
|
|
607
|
+
c(this, be, /* @__PURE__ */ a(() => {
|
|
623
608
|
var t;
|
|
624
609
|
(t = this.querySelector(".nine-tab-bar")) == null || t.addEventListener("click", (s) => {
|
|
625
610
|
var o;
|
|
@@ -629,65 +614,65 @@ const Oe = class Oe extends HTMLElement {
|
|
|
629
614
|
}, "#init"));
|
|
630
615
|
c(this, Q, /* @__PURE__ */ a((t, s = !1) => {
|
|
631
616
|
const n = /* @__PURE__ */ a(() => {
|
|
632
|
-
const
|
|
633
|
-
Array.from(this.querySelectorAll("nine-splitter")).forEach((
|
|
634
|
-
const
|
|
635
|
-
|
|
636
|
-
const
|
|
637
|
-
C &&
|
|
617
|
+
const u = Array.from(this.querySelectorAll("nine-table-sheet"));
|
|
618
|
+
Array.from(this.querySelectorAll("nine-splitter")).forEach((w) => w.style.setProperty("display", "none"));
|
|
619
|
+
const y = u.filter((w) => w.classList.contains("active"));
|
|
620
|
+
y.length < 2 || y.forEach((w) => {
|
|
621
|
+
const v = parseInt(w.getAttribute("data-index"), 10), C = this.querySelector(`nine-splitter[data-split-index="${v}"]`), Ne = u[v + 1];
|
|
622
|
+
C && Ne && Ne.classList.contains("active") && C.style.setProperty("display", "flex");
|
|
638
623
|
});
|
|
639
|
-
}, "updateSplitters"), r = this.querySelector(".nine-tab-bar"), o = this.querySelector("nine-table-sheets-body"), l = r.querySelectorAll(".nine-tab-item"),
|
|
624
|
+
}, "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");
|
|
640
625
|
if (!l[t]) return;
|
|
641
626
|
if (!s)
|
|
642
|
-
l.forEach((
|
|
643
|
-
|
|
644
|
-
}),
|
|
645
|
-
const
|
|
646
|
-
|
|
627
|
+
l.forEach((u, f) => {
|
|
628
|
+
u.classList.toggle("active", f === t);
|
|
629
|
+
}), h.forEach((u, f) => {
|
|
630
|
+
const y = f === t;
|
|
631
|
+
u.classList.toggle("active", y), u.style.flex = y ? "1 1 100%" : "";
|
|
647
632
|
});
|
|
648
633
|
else {
|
|
649
|
-
const
|
|
650
|
-
if (
|
|
634
|
+
const u = l[t], f = r.querySelectorAll(".nine-tab-item.active");
|
|
635
|
+
if (u.classList.contains("active") && f.length <= 1)
|
|
651
636
|
return;
|
|
652
|
-
|
|
653
|
-
const
|
|
654
|
-
|
|
637
|
+
u.classList.toggle("active");
|
|
638
|
+
const y = o.querySelector(`nine-table-sheet[data-index="${t}"]`);
|
|
639
|
+
y && (y.classList.toggle("active"), y.classList.contains("active") || (y.style.flex = ""));
|
|
655
640
|
}
|
|
656
|
-
const
|
|
657
|
-
|
|
658
|
-
|
|
641
|
+
const d = o.querySelectorAll("nine-table-sheet.active");
|
|
642
|
+
d == null || d.forEach((u) => {
|
|
643
|
+
u.style.flex = d.length > 1 ? "1 1 0%" : "1 1 100%";
|
|
659
644
|
}), n();
|
|
660
645
|
}, "#switchSheet"));
|
|
661
646
|
}
|
|
662
647
|
connectedCallback() {
|
|
663
|
-
e(this,
|
|
648
|
+
e(this, be).call(this);
|
|
664
649
|
}
|
|
665
650
|
};
|
|
666
|
-
|
|
667
|
-
let
|
|
668
|
-
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets",
|
|
669
|
-
var S,
|
|
670
|
-
const
|
|
651
|
+
be = new WeakMap(), Q = new WeakMap(), a(We, "NineTableSheets");
|
|
652
|
+
let Te = We;
|
|
653
|
+
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", Te);
|
|
654
|
+
var S, ye, ee, pe;
|
|
655
|
+
const Oe = class Oe {
|
|
671
656
|
constructor(i) {
|
|
672
657
|
c(this, S);
|
|
673
|
-
c(this,
|
|
674
|
-
e(this,
|
|
658
|
+
c(this, ye, /* @__PURE__ */ a(() => {
|
|
659
|
+
e(this, pe).call(this), new ResizeObserver((i) => {
|
|
675
660
|
for (let t of i)
|
|
676
661
|
e(this, S).getAttribute("auto-height") === "true" && e(this, ee).call(this);
|
|
677
662
|
}).observe(e(this, S));
|
|
678
663
|
}, "#init"));
|
|
679
664
|
c(this, ee, /* @__PURE__ */ a(() => {
|
|
680
|
-
var
|
|
665
|
+
var h, d;
|
|
681
666
|
const i = Array.from(e(this, S).shadowRoot.querySelectorAll("nine-table-sheet.active"));
|
|
682
667
|
if (i.length === 0) return;
|
|
683
|
-
const t = parseInt(e(this, S).getAttribute("max-display-row"), 10) || 10, s = Math.max(...i.map((
|
|
668
|
+
const t = parseInt(e(this, S).getAttribute("max-display-row"), 10) || 10, s = Math.max(...i.map((u) => u.getRowHeight())), n = (h = e(this, S).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : h.getBoundingClientRect().height, r = (d = e(this, S).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : d.getBoundingClientRect().height, o = ie.SCROLLBAR_SIZE, l = t * s + n + r + o;
|
|
684
669
|
e(this, S).style.height = `${l}px`;
|
|
685
670
|
}, "#applyAutoHeight"));
|
|
686
|
-
c(this,
|
|
687
|
-
const t = Array.from(e(this, S).children).filter((
|
|
688
|
-
const
|
|
689
|
-
return
|
|
690
|
-
}).join(""), o = t.map((
|
|
671
|
+
c(this, pe, /* @__PURE__ */ a(() => {
|
|
672
|
+
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, d) => {
|
|
673
|
+
const f = `<nine-table-sheet class="${d === 0 ? "active" : ""}" data-index="${d}"></nine-table-sheet>`, y = d < n - 1 ? `<nine-splitter class="h" data-split-index="${d}"></nine-splitter>` : "";
|
|
674
|
+
return f + y;
|
|
675
|
+
}).join(""), o = t.map((h, d) => `<div class="nine-tab-item ${d === 0 ? "active" : ""}" data-index="${d}">Sheet ${d + 1}</div>`).join("");
|
|
691
676
|
e(this, S).shadowRoot.innerHTML = `
|
|
692
677
|
<style>
|
|
693
678
|
:host {
|
|
@@ -788,23 +773,23 @@ const We = class We {
|
|
|
788
773
|
<nine-table-footer></nine-table-footer>
|
|
789
774
|
`;
|
|
790
775
|
const l = e(this, S).shadowRoot.querySelectorAll("nine-table-sheet");
|
|
791
|
-
l == null || l.forEach((
|
|
792
|
-
t[
|
|
793
|
-
|
|
776
|
+
l == null || l.forEach((h, d) => {
|
|
777
|
+
t[d] && setTimeout(() => {
|
|
778
|
+
h.generate(t[d]), s && e(this, ee).call(this);
|
|
794
779
|
});
|
|
795
780
|
});
|
|
796
781
|
}, "#render"));
|
|
797
|
-
g(this, S, i), e(this,
|
|
782
|
+
g(this, S, i), e(this, ye).call(this);
|
|
798
783
|
}
|
|
799
784
|
};
|
|
800
|
-
S = new WeakMap(),
|
|
801
|
-
let
|
|
785
|
+
S = new WeakMap(), ye = new WeakMap(), ee = new WeakMap(), pe = new WeakMap(), a(Oe, "LayoutManager");
|
|
786
|
+
let ke = Oe;
|
|
802
787
|
var H, P;
|
|
803
788
|
const ze = class ze {
|
|
804
789
|
constructor(i) {
|
|
805
790
|
c(this, H);
|
|
806
791
|
c(this, P, -1);
|
|
807
|
-
|
|
792
|
+
x(this, "count", /* @__PURE__ */ a(() => e(this, H).rawRecords.length, "count"));
|
|
808
793
|
g(this, H, i);
|
|
809
794
|
}
|
|
810
795
|
get at() {
|
|
@@ -821,17 +806,17 @@ const ze = class ze {
|
|
|
821
806
|
}
|
|
822
807
|
};
|
|
823
808
|
H = new WeakMap(), P = new WeakMap(), a(ze, "ngRow");
|
|
824
|
-
let
|
|
825
|
-
var A, m, q, U,
|
|
809
|
+
let Le = ze;
|
|
810
|
+
var A, m, q, U, me, M, we, te, xe, ve, F;
|
|
826
811
|
const T = class T {
|
|
827
812
|
constructor(i, t) {
|
|
828
813
|
c(this, A);
|
|
829
814
|
c(this, m);
|
|
830
815
|
c(this, q, []);
|
|
831
816
|
c(this, U, []);
|
|
832
|
-
c(this,
|
|
817
|
+
c(this, me, 0);
|
|
833
818
|
c(this, M, []);
|
|
834
|
-
c(this,
|
|
819
|
+
c(this, we, /* @__PURE__ */ a(() => {
|
|
835
820
|
g(this, M, []);
|
|
836
821
|
const i = e(this, A).template || [];
|
|
837
822
|
Array.from(i).forEach((t) => {
|
|
@@ -841,7 +826,7 @@ const T = class T {
|
|
|
841
826
|
t.__ng || (t.__ng = e(this, te).call(this)), t.__ng.height = e(this, M).slice();
|
|
842
827
|
});
|
|
843
828
|
}, "#initialize"));
|
|
844
|
-
|
|
829
|
+
x(this, "set", /* @__PURE__ */ a((i) => {
|
|
845
830
|
this.clear(), this.add(i, !1);
|
|
846
831
|
}, "set"));
|
|
847
832
|
c(this, te, /* @__PURE__ */ a(() => ({
|
|
@@ -853,14 +838,14 @@ const T = class T {
|
|
|
853
838
|
c: {},
|
|
854
839
|
_: [0, 0, 0, 0, T.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, e(this, M).slice(), -1, {}, {}]
|
|
855
840
|
}), "#getDefaultMeta"));
|
|
856
|
-
|
|
841
|
+
x(this, "reset", /* @__PURE__ */ a(() => {
|
|
857
842
|
g(this, q, []), g(this, U, []);
|
|
858
843
|
}, "reset"));
|
|
859
|
-
|
|
844
|
+
x(this, "clear", /* @__PURE__ */ a(() => {
|
|
860
845
|
var i;
|
|
861
846
|
e(this, m).rawRecords = [], g(this, q, []), g(this, U, []), (i = e(this, m).viewRecords) != null && i.reset && e(this, m).viewRecords.reset();
|
|
862
847
|
}, "clear"));
|
|
863
|
-
c(this,
|
|
848
|
+
c(this, xe, /* @__PURE__ */ a((i) => {
|
|
864
849
|
var n;
|
|
865
850
|
Array.isArray(i) || (i = [i]);
|
|
866
851
|
const t = typeof ((n = e(this, A).fields) == null ? void 0 : n.get) == "function" ? e(this, A).fields.get() : Object.keys(i[0] || {}), s = [];
|
|
@@ -874,18 +859,18 @@ const T = class T {
|
|
|
874
859
|
c(this, ve, /* @__PURE__ */ a((i) => (Array.isArray(i) || (i = [i]), i.forEach((t) => {
|
|
875
860
|
t.__ng = e(this, te).call(this), t.__ng.rowid = this.nextId, t.__ng.rowState = T.ROW_STATE.INSERT, t.__ng._[0] = t.__ng.rowid;
|
|
876
861
|
}), i), "#defaultInsert"));
|
|
877
|
-
|
|
862
|
+
x(this, "add", /* @__PURE__ */ a((i, t = !0) => {
|
|
878
863
|
var r;
|
|
879
864
|
i === void 0 && (i = {});
|
|
880
|
-
const s = e(this,
|
|
865
|
+
const s = e(this, xe).call(this, i);
|
|
881
866
|
e(this, m).rawRecords = e(this, m).rawRecords.concat(e(this, ve).call(this, s)), this.resetRecords();
|
|
882
867
|
const n = this.count() - 1;
|
|
883
868
|
return t || s.forEach((o, l) => {
|
|
884
|
-
const
|
|
885
|
-
|
|
869
|
+
const h = e(this, m).rawRecords[n - l];
|
|
870
|
+
h && (h.__ng.rowState = T.ROW_STATE.EMPTY);
|
|
886
871
|
}), (r = e(this, m).viewRecords) != null && r.reset && e(this, m).viewRecords.reset(), n;
|
|
887
872
|
}, "add"));
|
|
888
|
-
|
|
873
|
+
x(this, "delete", /* @__PURE__ */ a((i) => {
|
|
889
874
|
var s;
|
|
890
875
|
let t = [];
|
|
891
876
|
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) => {
|
|
@@ -897,25 +882,25 @@ const T = class T {
|
|
|
897
882
|
}
|
|
898
883
|
}), this.resetRecords(), (s = e(this, m).viewRecords) != null && s.reset && e(this, m).viewRecords.reset();
|
|
899
884
|
}, "delete"));
|
|
900
|
-
|
|
901
|
-
var
|
|
885
|
+
x(this, "setValue", /* @__PURE__ */ a((i, t, s) => {
|
|
886
|
+
var h;
|
|
902
887
|
i = parseInt(i, 10);
|
|
903
|
-
const r = (typeof ((
|
|
888
|
+
const r = (typeof ((h = e(this, A).fields) == null ? void 0 : h.get) == "function" ? e(this, A).fields.get() : []).indexOf(t);
|
|
904
889
|
if (r < 0) return;
|
|
905
890
|
const o = this.getValidData()[i];
|
|
906
891
|
if (!o) return;
|
|
907
892
|
const l = o.v[r];
|
|
908
893
|
l !== s && o.__ng.rowState !== T.ROW_STATE.INSERT && (o.__ng.o.hasOwnProperty(t) || (o.__ng.o[t] = l), o.__ng.rowState = T.ROW_STATE.UPDATE), o.v[r] = s, e(this, m).owner.refreshData && e(this, m).owner.refreshData(i);
|
|
909
894
|
}, "setValue"));
|
|
910
|
-
|
|
895
|
+
x(this, "resetRecords", /* @__PURE__ */ a(() => {
|
|
911
896
|
g(this, U, e(this, m).rawRecords.filter((i) => !i.__ng.deleted)), g(this, q, e(this, m).rawRecords.filter((i) => !i.__ng.deleted && !i.__ng.filtered)), e(this, m).rawRecords.forEach((i, t) => {
|
|
912
897
|
i.__ng.rowidx = t;
|
|
913
898
|
}), e(this, q).forEach((i, t) => {
|
|
914
899
|
i.__ng.i = t;
|
|
915
900
|
});
|
|
916
901
|
}, "resetRecords"));
|
|
917
|
-
|
|
918
|
-
c(this,
|
|
902
|
+
x(this, "getValidData", /* @__PURE__ */ a(() => (e(this, q).length === 0 && e(this, m).rawRecords.length > 0 && this.resetRecords(), e(this, q)), "getValidData"));
|
|
903
|
+
c(this, F, /* @__PURE__ */ a((i) => {
|
|
919
904
|
var s;
|
|
920
905
|
if (!i) return i;
|
|
921
906
|
const t = typeof ((s = e(this, A).fields) == null ? void 0 : s.get) == "function" ? e(this, A).fields.get() : [];
|
|
@@ -926,30 +911,30 @@ const T = class T {
|
|
|
926
911
|
}), r.__ng = n.__ng, r;
|
|
927
912
|
}) : i;
|
|
928
913
|
}, "#conv2"));
|
|
929
|
-
|
|
930
|
-
|
|
914
|
+
x(this, "count", /* @__PURE__ */ a(() => this.getValidData().length, "count"));
|
|
915
|
+
x(this, "get", /* @__PURE__ */ a((i, t) => {
|
|
931
916
|
var r;
|
|
932
917
|
const s = this.getValidData();
|
|
933
918
|
if (!s || s.length <= 0) return;
|
|
934
|
-
if (i == null) return e(this,
|
|
919
|
+
if (i == null) return e(this, F).call(this, s);
|
|
935
920
|
if (i < 0 || i >= s.length) return null;
|
|
936
921
|
const n = typeof ((r = e(this, A).fields) == null ? void 0 : r.get) == "function" ? e(this, A).fields.get() : [];
|
|
937
922
|
if (t != null) {
|
|
938
923
|
const o = n.indexOf(t);
|
|
939
924
|
return o >= 0 ? s[i].v[o] : null;
|
|
940
925
|
}
|
|
941
|
-
return e(this,
|
|
926
|
+
return e(this, F).call(this, s[i]);
|
|
942
927
|
}, "get"));
|
|
943
|
-
g(this, A, i), g(this, m, t), e(this,
|
|
928
|
+
g(this, A, i), g(this, m, t), e(this, we).call(this);
|
|
944
929
|
}
|
|
945
930
|
get source() {
|
|
946
|
-
return e(this,
|
|
931
|
+
return e(this, F).call(this, e(this, m).rawRecords);
|
|
947
932
|
}
|
|
948
933
|
set source(i) {
|
|
949
934
|
this.clear(), this.add(i, !1);
|
|
950
935
|
}
|
|
951
936
|
get nextId() {
|
|
952
|
-
return ++Ye(this,
|
|
937
|
+
return ++Ye(this, me)._;
|
|
953
938
|
}
|
|
954
939
|
get length() {
|
|
955
940
|
return e(this, q).length;
|
|
@@ -958,18 +943,18 @@ const T = class T {
|
|
|
958
943
|
return this.length;
|
|
959
944
|
}
|
|
960
945
|
};
|
|
961
|
-
A = new WeakMap(), m = new WeakMap(), q = new WeakMap(), U = new WeakMap(),
|
|
962
|
-
|
|
946
|
+
A = new WeakMap(), m = new WeakMap(), q = new WeakMap(), U = new WeakMap(), me = new WeakMap(), M = new WeakMap(), we = new WeakMap(), te = new WeakMap(), xe = new WeakMap(), ve = new WeakMap(), F = new WeakMap(), a(T, "ngData"), // π― ν μν μ μ μμλ₯Ό ν΄λμ€ λ΄λΆλ‘ λ΄μ¬ν
|
|
947
|
+
x(T, "ROW_STATE", {
|
|
963
948
|
EMPTY: "EMPTY",
|
|
964
949
|
NORMAL: "NORMAL",
|
|
965
950
|
INSERT: "INSERT",
|
|
966
951
|
UPDATE: "UPDATE",
|
|
967
952
|
DELETE: "DELETE"
|
|
968
953
|
});
|
|
969
|
-
let
|
|
954
|
+
let Ce = T;
|
|
970
955
|
const De = class De {
|
|
971
956
|
constructor(i) {
|
|
972
|
-
this.owner = i, this.row = new
|
|
957
|
+
this.owner = i, this.row = new Le(this), this.data = new Ce(i, this), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.pageCnt = 25, this.viewRecords.reset = () => {
|
|
973
958
|
var t;
|
|
974
959
|
(t = this.owner.view) != null && t.redraw && this.owner.view.redraw();
|
|
975
960
|
}, this.setDataSource = (t) => {
|
|
@@ -987,21 +972,21 @@ const De = class De {
|
|
|
987
972
|
}
|
|
988
973
|
};
|
|
989
974
|
a(De, "ngDataManager");
|
|
990
|
-
let
|
|
991
|
-
var V,
|
|
992
|
-
const
|
|
975
|
+
let _e = De;
|
|
976
|
+
var V, Se;
|
|
977
|
+
const Be = class Be extends HTMLElement {
|
|
993
978
|
constructor() {
|
|
994
979
|
super();
|
|
995
980
|
//#created = false;
|
|
996
981
|
c(this, V);
|
|
997
|
-
c(this,
|
|
998
|
-
this.attachShadow({ mode: "open" }), g(this, V, new
|
|
982
|
+
c(this, Se);
|
|
983
|
+
this.attachShadow({ mode: "open" }), g(this, V, new _e(this));
|
|
999
984
|
}
|
|
1000
985
|
connectedCallback() {
|
|
1001
|
-
g(this,
|
|
986
|
+
g(this, Se, new ke(this)), Z.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
|
|
1002
987
|
}
|
|
1003
988
|
disconnectedCallback() {
|
|
1004
|
-
|
|
989
|
+
Z.log("NineTable disconnected.");
|
|
1005
990
|
}
|
|
1006
991
|
// π― μΈλΆμμ grid.data.set(...) ννλ‘ μ κ·Όν μ μλλ‘ λ°μ΄ν° λ§€λμ μ€ν
|
|
1007
992
|
get data() {
|
|
@@ -1016,7 +1001,7 @@ const Ne = class Ne extends HTMLElement {
|
|
|
1016
1001
|
return e(this, V);
|
|
1017
1002
|
}
|
|
1018
1003
|
};
|
|
1019
|
-
V = new WeakMap(),
|
|
1020
|
-
let
|
|
1021
|
-
customElements.get("nine-table") || customElements.define("nine-table",
|
|
1004
|
+
V = new WeakMap(), Se = new WeakMap(), a(Be, "NineTable");
|
|
1005
|
+
let Ie = Be;
|
|
1006
|
+
customElements.get("nine-table") || customElements.define("nine-table", Ie);
|
|
1022
1007
|
//# sourceMappingURL=nine-table.js.map
|