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