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