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