@ninebone/table 0.0.210 β 0.0.211
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 +237 -238
- 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,17 +1,17 @@
|
|
|
1
1
|
var He = Object.defineProperty;
|
|
2
|
-
var Ie = (
|
|
3
|
-
throw TypeError(
|
|
2
|
+
var Ie = (w) => {
|
|
3
|
+
throw TypeError(w);
|
|
4
4
|
};
|
|
5
|
-
var Oe = (
|
|
6
|
-
var a = (
|
|
7
|
-
var
|
|
8
|
-
var e = (
|
|
9
|
-
var We = (
|
|
5
|
+
var Oe = (w, i, t) => i in w ? He(w, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : w[i] = t;
|
|
6
|
+
var a = (w, i) => He(w, "name", { value: i, configurable: !0 });
|
|
7
|
+
var x = (w, i, t) => Oe(w, typeof i != "symbol" ? i + "" : i, t), $e = (w, i, t) => i.has(w) || Ie("Cannot " + t);
|
|
8
|
+
var e = (w, i, t) => ($e(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) => ($e(w, i, "write to private field"), s ? s.call(w, t) : i.set(w, t), t);
|
|
9
|
+
var We = (w, i, t, s) => ({
|
|
10
10
|
set _(n) {
|
|
11
|
-
p(
|
|
11
|
+
p(w, i, n, t);
|
|
12
12
|
},
|
|
13
13
|
get _() {
|
|
14
|
-
return e(
|
|
14
|
+
return e(w, i, s);
|
|
15
15
|
}
|
|
16
16
|
});
|
|
17
17
|
import { trace as ze } from "@ninebone/util";
|
|
@@ -23,29 +23,29 @@ const Te = class Te extends ze.constructor {
|
|
|
23
23
|
a(Te, "Trace");
|
|
24
24
|
let pe = Te;
|
|
25
25
|
const Q = new pe();
|
|
26
|
-
var
|
|
26
|
+
var L, z, y, B, D, N, te, P, ie;
|
|
27
27
|
const Ae = class Ae extends HTMLElement {
|
|
28
28
|
constructor() {
|
|
29
29
|
super();
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
if (!e(this,
|
|
38
|
-
const t = e(this,
|
|
30
|
+
u(this, L);
|
|
31
|
+
u(this, z, !1);
|
|
32
|
+
u(this, y);
|
|
33
|
+
u(this, B);
|
|
34
|
+
u(this, D);
|
|
35
|
+
u(this, N);
|
|
36
|
+
u(this, te, /* @__PURE__ */ a(() => {
|
|
37
|
+
if (!e(this, L)) return;
|
|
38
|
+
const t = e(this, L).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
|
-
|
|
44
|
-
if (!e(this,
|
|
43
|
+
x(this, "refresh", /* @__PURE__ */ a(() => {
|
|
44
|
+
if (!e(this, L) || !e(this, y) || e(this, z)) 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,
|
|
48
|
-
if (c !== 0 &&
|
|
47
|
+
const n = e(this, y).track, r = e(this, y).thumb, o = e(this, L).querySelector(".ng-container-bottom"), c = t.clientWidth, h = s.scrollWidth;
|
|
48
|
+
if (c !== 0 && h > c)
|
|
49
49
|
o && (o.style.display = "flex");
|
|
50
50
|
else {
|
|
51
51
|
o && (o.style.display = "none");
|
|
@@ -53,34 +53,34 @@ const Ae = class Ae extends HTMLElement {
|
|
|
53
53
|
}
|
|
54
54
|
const l = n.clientWidth;
|
|
55
55
|
if (l <= 0) return;
|
|
56
|
-
const d = Math.max(Math.min(l * (c /
|
|
56
|
+
const d = Math.max(Math.min(l * (c / h), l), 20);
|
|
57
57
|
r.style.width = `${d}px`;
|
|
58
|
-
let
|
|
59
|
-
const
|
|
60
|
-
if (
|
|
61
|
-
const
|
|
62
|
-
|
|
58
|
+
let f = 0;
|
|
59
|
+
const g = s.style.transform;
|
|
60
|
+
if (g && g.includes("translateX")) {
|
|
61
|
+
const S = g.match(/translateX\(([-\d.]+)px\)/);
|
|
62
|
+
S && S[1] && (f = parseFloat(S[1]));
|
|
63
63
|
} else
|
|
64
|
-
|
|
65
|
-
let
|
|
66
|
-
|
|
67
|
-
const
|
|
68
|
-
|
|
64
|
+
f = parseInt(s.style.left || 0, 10);
|
|
65
|
+
let b = parseInt(Math.abs(f) * l / h, 10);
|
|
66
|
+
b < 0 && (b = 0);
|
|
67
|
+
const m = l - d;
|
|
68
|
+
b > m && (b = m), r.style.left = `${b}px`, e(this, y).left.disabled = b === 0, e(this, y).right.disabled = b >= m - 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 r = e(this, y).track.getBoundingClientRect(), o = e(this, y).thumb.clientWidth;
|
|
75
75
|
let c = t;
|
|
76
76
|
c < 0 && (c = 0);
|
|
77
|
-
const
|
|
78
|
-
c >
|
|
77
|
+
const h = r.width - o;
|
|
78
|
+
c > h && (c = h), 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 >= h - 1;
|
|
79
79
|
const l = s.clientWidth, d = n.scrollWidth;
|
|
80
|
-
let
|
|
81
|
-
return -
|
|
80
|
+
let f = h > 0 ? -c * (d - l) / h : 0;
|
|
81
|
+
return -f > d - l && (f = -(d - l)), -f + 5 > d - l && (f = -(d - l)), l >= d && (f = 0), n.style.transform = `translateX(${f}px)`, c > 0 && c < h - 1;
|
|
82
82
|
}, "#thumbMoveTo"));
|
|
83
|
-
|
|
83
|
+
u(this, ie, /* @__PURE__ */ a(() => {
|
|
84
84
|
const t = /* @__PURE__ */ a((n) => {
|
|
85
85
|
clearInterval(e(this, B)), clearInterval(e(this, D));
|
|
86
86
|
const r = parseInt(e(this, y).thumb.style.left || 0, 10);
|
|
@@ -109,8 +109,8 @@ const Ae = class Ae extends HTMLElement {
|
|
|
109
109
|
n.stopPropagation(), n.preventDefault(), p(this, z, !0), this.shiftX = n.clientX - e(this, y).thumb.getBoundingClientRect().left;
|
|
110
110
|
const r = /* @__PURE__ */ a((c) => {
|
|
111
111
|
if (!e(this, z)) return;
|
|
112
|
-
const
|
|
113
|
-
e(this, P).call(this, c.clientX -
|
|
112
|
+
const h = e(this, y).track.getBoundingClientRect();
|
|
113
|
+
e(this, P).call(this, c.clientX - h.left - this.shiftX);
|
|
114
114
|
}, "onMouseMove"), o = /* @__PURE__ */ a(() => {
|
|
115
115
|
p(this, z, !1), s(), document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", o), this.refresh();
|
|
116
116
|
}, "onMouseUp");
|
|
@@ -119,7 +119,7 @@ const Ae = class Ae extends HTMLElement {
|
|
|
119
119
|
}, "#init"));
|
|
120
120
|
}
|
|
121
121
|
connectedCallback() {
|
|
122
|
-
if (p(this,
|
|
122
|
+
if (p(this, L, this.closest("nine-table-sheet") || this.getRootNode().host), !e(this, L)) return;
|
|
123
123
|
this.innerHTML = `
|
|
124
124
|
<style>
|
|
125
125
|
nine-table-hscrollbar {
|
|
@@ -184,7 +184,7 @@ const Ae = class Ae extends HTMLElement {
|
|
|
184
184
|
<button class='ng-scroll-right' disabled><div class='ng-scroll-icon'></div></button>
|
|
185
185
|
`;
|
|
186
186
|
const t = /* @__PURE__ */ a(() => {
|
|
187
|
-
const s = e(this,
|
|
187
|
+
const s = e(this, L).querySelector(".ng-container-body");
|
|
188
188
|
if (!s) {
|
|
189
189
|
setTimeout(t, 10);
|
|
190
190
|
return;
|
|
@@ -203,26 +203,26 @@ const Ae = class Ae extends HTMLElement {
|
|
|
203
203
|
e(this, N) && e(this, N).disconnect();
|
|
204
204
|
}
|
|
205
205
|
};
|
|
206
|
-
|
|
206
|
+
L = new WeakMap(), z = new WeakMap(), y = new WeakMap(), B = new WeakMap(), D = new WeakMap(), N = new WeakMap(), te = new WeakMap(), P = new WeakMap(), ie = new WeakMap(), a(Ae, "NineTableHScrollBar");
|
|
207
207
|
let ye = Ae;
|
|
208
208
|
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", ye);
|
|
209
|
-
var V,
|
|
209
|
+
var V, C, E, $, M, H, se, ne;
|
|
210
210
|
const qe = class qe {
|
|
211
211
|
constructor(i) {
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
212
|
+
u(this, V);
|
|
213
|
+
u(this, C, []);
|
|
214
|
+
u(this, E, null);
|
|
215
|
+
u(this, $, null);
|
|
216
|
+
u(this, M, 0);
|
|
217
|
+
u(this, H, 0);
|
|
218
|
+
x(this, "getRowHeight", /* @__PURE__ */ a(() => e(this, E), "getRowHeight"));
|
|
219
|
+
u(this, se, /* @__PURE__ */ a(() => {
|
|
220
220
|
e(this, ne).call(this);
|
|
221
221
|
}, "#init"));
|
|
222
222
|
/**
|
|
223
223
|
* π― λ·°ν¬νΈ ν¬κΈ° λ³ν μμ μ λμ΄ κ³μ° λ° νμν ν κ°μ μ°μ Β·μΊμ±μ μκ²°
|
|
224
224
|
*/
|
|
225
|
-
|
|
225
|
+
u(this, ne, /* @__PURE__ */ a(() => {
|
|
226
226
|
!e(this, V) || !(e(this, V) instanceof HTMLElement) || (p(this, $, new ResizeObserver((i) => {
|
|
227
227
|
for (const t of i) {
|
|
228
228
|
const s = t.target;
|
|
@@ -232,50 +232,50 @@ const qe = class qe {
|
|
|
232
232
|
if (n > 0) {
|
|
233
233
|
const r = s.clientHeight || s.getBoundingClientRect().height || n;
|
|
234
234
|
let o = 0;
|
|
235
|
-
const c = s.querySelector(".ng-container-body") || s,
|
|
236
|
-
|
|
235
|
+
const c = s.querySelector(".ng-container-body") || s, h = c.querySelector("thead"), l = c.querySelector("tfoot");
|
|
236
|
+
h && (o += h.offsetHeight || h.getBoundingClientRect().height), l && (o += l.offsetHeight || l.getBoundingClientRect().height);
|
|
237
237
|
const d = Math.max(r - o, 100);
|
|
238
|
-
if (e(this,
|
|
239
|
-
const
|
|
240
|
-
p(this,
|
|
241
|
-
const
|
|
242
|
-
|
|
238
|
+
if (e(this, M) !== d && (p(this, M, d), e(this, E) !== null)) {
|
|
239
|
+
const f = Math.ceil(e(this, M) / e(this, E));
|
|
240
|
+
p(this, H, f + 20), Q.log(`[RowManager] Resized. Height: ${e(this, M)}px | Target Rows: ${e(this, H)}`), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((g) => {
|
|
241
|
+
const b = s.querySelector(g);
|
|
242
|
+
b && b.querySelector("tbody") && this.renderRows(b);
|
|
243
243
|
});
|
|
244
244
|
}
|
|
245
245
|
}
|
|
246
246
|
}
|
|
247
247
|
})), e(this, $).observe(e(this, V)));
|
|
248
248
|
}, "#initResizeObserver"));
|
|
249
|
-
|
|
249
|
+
x(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
|
+
x(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 : "", c = r ? r.style.visibility : "",
|
|
267
|
+
const r = i.closest("nine-table-sheet"), o = r ? r.style.display : "", c = r ? r.style.visibility : "", h = 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 = c, r.style.position =
|
|
274
|
-
const
|
|
275
|
-
p(this,
|
|
270
|
+
if (t.querySelectorAll("tr:not(.nodata)").forEach((f, g) => {
|
|
271
|
+
const b = f.offsetHeight || f.getBoundingClientRect().height;
|
|
272
|
+
b === 0 ? l += 40 : l += b;
|
|
273
|
+
}), r && (r.style.display = o, r.style.visibility = c, r.style.position = h), 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,89 +293,89 @@ const qe = class qe {
|
|
|
293
293
|
/**
|
|
294
294
|
* π― μΊμλ ν κ°μλ₯Ό κ³§λ°λ‘ κ°μ Έμμ TR λΌλ μ£Όμ
(μ€λ³΅ κ³μ° μ κ±°)
|
|
295
295
|
*/
|
|
296
|
-
|
|
297
|
-
if (e(this,
|
|
296
|
+
x(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,
|
|
303
|
+
e(this, C).forEach((c) => {
|
|
304
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
|
+
x(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(),
|
|
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(qe, "RowManager");
|
|
318
318
|
let me = qe;
|
|
319
|
-
var
|
|
319
|
+
var I, X, re, oe;
|
|
320
320
|
const Z = class Z extends HTMLElement {
|
|
321
321
|
constructor() {
|
|
322
322
|
super();
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
323
|
+
u(this, I, null);
|
|
324
|
+
u(this, X);
|
|
325
|
+
x(this, "generate", /* @__PURE__ */ a((t) => {
|
|
326
326
|
if (!t) return;
|
|
327
327
|
const s = /* @__PURE__ */ a((l) => {
|
|
328
|
-
const d = /* @__PURE__ */ a((
|
|
329
|
-
if (
|
|
330
|
-
const
|
|
331
|
-
for (let
|
|
328
|
+
const d = /* @__PURE__ */ a((g) => {
|
|
329
|
+
if (g.querySelector("colgroup")) return;
|
|
330
|
+
const b = g.querySelector("tbody tr") || g.querySelector("tr"), m = b ? b.querySelectorAll("th, td").length : 1, S = document.createElement("colgroup"), T = Math.max(Math.floor((g.clientWidth || 600) / m), 100);
|
|
331
|
+
for (let _ = 0; _ < m; _++) {
|
|
332
332
|
const be = document.createElement("col");
|
|
333
|
-
be.setAttribute("width",
|
|
333
|
+
be.setAttribute("width", T), S.appendChild(be);
|
|
334
334
|
}
|
|
335
|
-
|
|
336
|
-
}, "ensureColgroup"),
|
|
337
|
-
if (
|
|
338
|
-
const
|
|
339
|
-
|
|
335
|
+
g.prepend(S);
|
|
336
|
+
}, "ensureColgroup"), f = /* @__PURE__ */ a((g) => {
|
|
337
|
+
if (g.querySelector("thead")) return;
|
|
338
|
+
const b = document.createElement("thead"), m = g.querySelector("colgroup");
|
|
339
|
+
m ? m.after(b) : g.prepend(b);
|
|
340
340
|
}, "ensureThead");
|
|
341
|
-
return d(l),
|
|
341
|
+
return d(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"), c = this.querySelector(".ng-container-right"),
|
|
345
|
-
const
|
|
346
|
-
return
|
|
347
|
-
const
|
|
348
|
-
(
|
|
349
|
-
}),
|
|
350
|
-
|
|
351
|
-
const
|
|
352
|
-
|
|
343
|
+
p(this, I, s(n)), e(this, I).style.display = "table", e(this, X).initTemplate(e(this, I));
|
|
344
|
+
const r = this.querySelector(".ng-container-left"), o = this.querySelector(".ng-container-body"), c = this.querySelector(".ng-container-right"), h = /* @__PURE__ */ a((l, d, f = !1) => {
|
|
345
|
+
const g = l.cloneNode(!0), b = Array.from(g.querySelectorAll("colgroup col")), m = [];
|
|
346
|
+
return b.forEach((S, T) => {
|
|
347
|
+
const _ = S.getAttribute("fixed");
|
|
348
|
+
(f ? _ !== "left" && _ !== "right" : _ === d) || m.push(T);
|
|
349
|
+
}), m.reverse().forEach((S) => {
|
|
350
|
+
b[S] && b[S].remove(), g.querySelectorAll("tr").forEach((T) => {
|
|
351
|
+
const _ = T.querySelectorAll("th, td");
|
|
352
|
+
_[S] && _[S].remove();
|
|
353
353
|
});
|
|
354
|
-
}),
|
|
354
|
+
}), g;
|
|
355
355
|
}, "filterTableByFixed");
|
|
356
356
|
if (o) {
|
|
357
|
-
const l =
|
|
357
|
+
const l = h(e(this, I), null, !0);
|
|
358
358
|
o.innerHTML = "", o.appendChild(l), e(this, X).measureAndCacheHeight(o);
|
|
359
359
|
}
|
|
360
360
|
if (r) {
|
|
361
|
-
const l =
|
|
361
|
+
const l = h(e(this, I), "left", !1);
|
|
362
362
|
let d = 0;
|
|
363
|
-
l.querySelectorAll("col").forEach((
|
|
364
|
-
const
|
|
365
|
-
isNaN(
|
|
363
|
+
l.querySelectorAll("col").forEach((g) => {
|
|
364
|
+
const b = parseInt(g.getAttribute("width"), 10);
|
|
365
|
+
isNaN(b) || (d += b);
|
|
366
366
|
}), r.innerHTML = "", r.appendChild(l);
|
|
367
|
-
const
|
|
368
|
-
r.style.flex = `0 0 ${
|
|
367
|
+
const f = d > 0 ? d : 0;
|
|
368
|
+
r.style.flex = `0 0 ${f}px`, r.style.width = `${f}px`;
|
|
369
369
|
}
|
|
370
370
|
if (c) {
|
|
371
|
-
const l =
|
|
371
|
+
const l = h(e(this, I), "right", !1);
|
|
372
372
|
let d = 0;
|
|
373
|
-
l.querySelectorAll("col").forEach((
|
|
374
|
-
const
|
|
375
|
-
isNaN(
|
|
373
|
+
l.querySelectorAll("col").forEach((g) => {
|
|
374
|
+
const b = parseInt(g.getAttribute("width"), 10);
|
|
375
|
+
isNaN(b) || (d += b);
|
|
376
376
|
}), c.innerHTML = "", c.appendChild(l);
|
|
377
|
-
const
|
|
378
|
-
c.style.flex = `0 0 ${
|
|
377
|
+
const f = d > 0 ? d : 0;
|
|
378
|
+
c.style.flex = `0 0 ${f}px`, c.style.width = `${f}px`;
|
|
379
379
|
}
|
|
380
380
|
o && o.addEventListener("scroll", () => {
|
|
381
381
|
var l;
|
|
@@ -385,44 +385,43 @@ const Z = class Z extends HTMLElement {
|
|
|
385
385
|
l && typeof l.refresh == "function" && l.refresh();
|
|
386
386
|
}, 0);
|
|
387
387
|
}, "generate"));
|
|
388
|
-
|
|
388
|
+
x(this, "getRowHeight", /* @__PURE__ */ a(() => e(this, X).getRowHeight(), "getRowHeight"));
|
|
389
389
|
/**
|
|
390
390
|
getRowCount = () => {
|
|
391
391
|
if (!this.#tableElement) return 0;
|
|
392
392
|
return this.#tableElement.querySelectorAll('tbody tr').length;
|
|
393
393
|
}; */
|
|
394
|
-
|
|
394
|
+
x(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
|
+
x(this, "scrollToY", /* @__PURE__ */ a((t) => {
|
|
399
399
|
const s = this.querySelector(".ng-container-body");
|
|
400
400
|
s && (s.scrollTop = t);
|
|
401
401
|
}, "scrollToY"));
|
|
402
|
-
|
|
403
|
-
e(this, oe).call(this)
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
n.attributeName === "class" && this.classList.contains("active") && t();
|
|
402
|
+
u(this, re, /* @__PURE__ */ a(() => {
|
|
403
|
+
e(this, oe).call(this), new MutationObserver((t) => {
|
|
404
|
+
const s = /* @__PURE__ */ a(() => {
|
|
405
|
+
requestAnimationFrame(() => {
|
|
406
|
+
var f, g, b;
|
|
407
|
+
const n = this.querySelector(".ng-container-left table"), r = this.querySelector(".ng-container-body table"), o = this.querySelector(".ng-container-right table");
|
|
408
|
+
if (!r) return;
|
|
409
|
+
const c = n ? Array.from(n.querySelectorAll("tr")) : [], h = Array.from(r.querySelectorAll("tr")), l = o ? Array.from(o.querySelectorAll("tr")) : [], d = Math.max(c.length, h.length, l.length);
|
|
410
|
+
for (let m = 0; m < d; m++) {
|
|
411
|
+
const S = [
|
|
412
|
+
((f = c[m]) == null ? void 0 : f.getBoundingClientRect().height) || 0,
|
|
413
|
+
((g = h[m]) == null ? void 0 : g.getBoundingClientRect().height) || 0,
|
|
414
|
+
((b = l[m]) == null ? void 0 : b.getBoundingClientRect().height) || 0
|
|
415
|
+
], T = Math.max(...S);
|
|
416
|
+
T > 0 && (c[m] && (c[m].style.height = `${T}px`), h[m] && (h[m].style.height = `${T}px`), l[m] && (l[m].style.height = `${T}px`));
|
|
417
|
+
}
|
|
418
|
+
});
|
|
419
|
+
}, "syncRowHeights");
|
|
420
|
+
for (const n of t)
|
|
421
|
+
n.attributeName === "class" && this.classList.contains("active") && s();
|
|
423
422
|
}).observe(this, { attributes: !0 });
|
|
424
423
|
}, "#init"));
|
|
425
|
-
|
|
424
|
+
u(this, oe, /* @__PURE__ */ a(() => {
|
|
426
425
|
const t = Z.SCROLLBAR_SIZE;
|
|
427
426
|
this.innerHTML = `
|
|
428
427
|
<style>
|
|
@@ -547,14 +546,14 @@ const Z = class Z extends HTMLElement {
|
|
|
547
546
|
this.innerHTML = "", Q.log("NineTableSheet destroyed.");
|
|
548
547
|
}
|
|
549
548
|
};
|
|
550
|
-
|
|
549
|
+
I = new WeakMap(), X = new WeakMap(), re = new WeakMap(), oe = new WeakMap(), a(Z, "NineTableSheet"), x(Z, "SCROLLBAR_SIZE", 16);
|
|
551
550
|
let ee = Z;
|
|
552
551
|
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", ee);
|
|
553
552
|
var le, j;
|
|
554
553
|
const ke = class ke extends HTMLElement {
|
|
555
554
|
constructor() {
|
|
556
555
|
super();
|
|
557
|
-
|
|
556
|
+
u(this, le, /* @__PURE__ */ a(() => {
|
|
558
557
|
var t;
|
|
559
558
|
(t = this.querySelector(".nine-tab-bar")) == null || t.addEventListener("click", (s) => {
|
|
560
559
|
var o;
|
|
@@ -562,31 +561,31 @@ const ke = class ke extends HTMLElement {
|
|
|
562
561
|
e(this, j).call(this, r, n);
|
|
563
562
|
}), e(this, j).call(this, 0, !1);
|
|
564
563
|
}, "#init"));
|
|
565
|
-
|
|
564
|
+
u(this, j, /* @__PURE__ */ a((t, s = !1) => {
|
|
566
565
|
const n = /* @__PURE__ */ a(() => {
|
|
567
566
|
const d = Array.from(this.querySelectorAll("nine-table-sheet"));
|
|
568
|
-
Array.from(this.querySelectorAll("nine-splitter")).forEach((
|
|
569
|
-
const
|
|
570
|
-
|
|
571
|
-
const
|
|
572
|
-
|
|
567
|
+
Array.from(this.querySelectorAll("nine-splitter")).forEach((b) => b.style.setProperty("display", "none"));
|
|
568
|
+
const g = d.filter((b) => b.classList.contains("active"));
|
|
569
|
+
g.length < 2 || g.forEach((b) => {
|
|
570
|
+
const m = parseInt(b.getAttribute("data-index"), 10), S = this.querySelector(`nine-splitter[data-split-index="${m}"]`), T = d[m + 1];
|
|
571
|
+
S && T && T.classList.contains("active") && S.style.setProperty("display", "flex");
|
|
573
572
|
});
|
|
574
|
-
}, "updateSplitters"), r = this.querySelector(".nine-tab-bar"), o = this.querySelector("nine-table-sheets-body"), c = r.querySelectorAll(".nine-tab-item"),
|
|
573
|
+
}, "updateSplitters"), r = this.querySelector(".nine-tab-bar"), o = this.querySelector("nine-table-sheets-body"), c = r.querySelectorAll(".nine-tab-item"), h = o.querySelectorAll("nine-table-sheet");
|
|
575
574
|
if (!c[t]) return;
|
|
576
575
|
if (!s)
|
|
577
|
-
c.forEach((d,
|
|
578
|
-
d.classList.toggle("active",
|
|
579
|
-
}),
|
|
580
|
-
const
|
|
581
|
-
d.classList.toggle("active",
|
|
576
|
+
c.forEach((d, f) => {
|
|
577
|
+
d.classList.toggle("active", f === t);
|
|
578
|
+
}), h.forEach((d, f) => {
|
|
579
|
+
const g = f === t;
|
|
580
|
+
d.classList.toggle("active", g), d.style.flex = g ? "1 1 100%" : "";
|
|
582
581
|
});
|
|
583
582
|
else {
|
|
584
|
-
const d = c[t],
|
|
585
|
-
if (d.classList.contains("active") &&
|
|
583
|
+
const d = c[t], f = r.querySelectorAll(".nine-tab-item.active");
|
|
584
|
+
if (d.classList.contains("active") && f.length <= 1)
|
|
586
585
|
return;
|
|
587
586
|
d.classList.toggle("active");
|
|
588
|
-
const
|
|
589
|
-
|
|
587
|
+
const g = o.querySelector(`nine-table-sheet[data-index="${t}"]`);
|
|
588
|
+
g && (g.classList.toggle("active"), g.classList.contains("active") || (g.style.flex = ""));
|
|
590
589
|
}
|
|
591
590
|
const l = o.querySelectorAll("nine-table-sheet.active");
|
|
592
591
|
l == null || l.forEach((d) => {
|
|
@@ -604,25 +603,25 @@ customElements.get("nine-table-sheets") || customElements.define("nine-table-she
|
|
|
604
603
|
var R, ae, G, ce;
|
|
605
604
|
const Le = class Le {
|
|
606
605
|
constructor(i) {
|
|
607
|
-
|
|
608
|
-
|
|
606
|
+
u(this, R);
|
|
607
|
+
u(this, ae, /* @__PURE__ */ a(() => {
|
|
609
608
|
e(this, ce).call(this), new ResizeObserver((i) => {
|
|
610
609
|
for (let t of i)
|
|
611
610
|
e(this, R).getAttribute("auto-height") === "true" && e(this, G).call(this);
|
|
612
611
|
}).observe(e(this, R));
|
|
613
612
|
}, "#init"));
|
|
614
|
-
|
|
615
|
-
var
|
|
613
|
+
u(this, G, /* @__PURE__ */ a(() => {
|
|
614
|
+
var h, l;
|
|
616
615
|
const i = Array.from(e(this, R).shadowRoot.querySelectorAll("nine-table-sheet.active"));
|
|
617
616
|
if (i.length === 0) return;
|
|
618
|
-
const t = parseInt(e(this, R).getAttribute("max-display-row"), 10) || 10, s = Math.max(...i.map((d) => d.getRowHeight())), n = (
|
|
617
|
+
const t = parseInt(e(this, R).getAttribute("max-display-row"), 10) || 10, s = Math.max(...i.map((d) => d.getRowHeight())), n = (h = e(this, R).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : h.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;
|
|
619
618
|
e(this, R).style.height = `${c}px`;
|
|
620
619
|
}, "#applyAutoHeight"));
|
|
621
|
-
|
|
622
|
-
const t = Array.from(e(this, R).children).filter((
|
|
623
|
-
const
|
|
624
|
-
return
|
|
625
|
-
}).join(""), o = t.map((
|
|
620
|
+
u(this, ce, /* @__PURE__ */ a(() => {
|
|
621
|
+
const t = Array.from(e(this, R).children).filter((h) => h.tagName === "TABLE"), s = e(this, R).getAttribute("auto-height") === "true", n = t.length, r = t.map((h, l) => {
|
|
622
|
+
const f = `<nine-table-sheet class="${l === 0 ? "active" : ""}" data-index="${l}"></nine-table-sheet>`, g = l < n - 1 ? `<nine-splitter class="h" data-split-index="${l}"></nine-splitter>` : "";
|
|
623
|
+
return f + g;
|
|
624
|
+
}).join(""), o = t.map((h, l) => `<div class="nine-tab-item ${l === 0 ? "active" : ""}" data-index="${l}">Sheet ${l + 1}</div>`).join("");
|
|
626
625
|
e(this, R).shadowRoot.innerHTML = `
|
|
627
626
|
<style>
|
|
628
627
|
:host {
|
|
@@ -723,9 +722,9 @@ const Le = class Le {
|
|
|
723
722
|
<nine-table-footer></nine-table-footer>
|
|
724
723
|
`;
|
|
725
724
|
const c = e(this, R).shadowRoot.querySelectorAll("nine-table-sheet");
|
|
726
|
-
c == null || c.forEach((
|
|
725
|
+
c == null || c.forEach((h, l) => {
|
|
727
726
|
t[l] && setTimeout(() => {
|
|
728
|
-
|
|
727
|
+
h.generate(t[l]), s && e(this, G).call(this);
|
|
729
728
|
});
|
|
730
729
|
});
|
|
731
730
|
}, "#render"));
|
|
@@ -737,9 +736,9 @@ let ve = Le;
|
|
|
737
736
|
var W, F;
|
|
738
737
|
const Ce = class Ce {
|
|
739
738
|
constructor(i) {
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
739
|
+
u(this, W);
|
|
740
|
+
u(this, F, -1);
|
|
741
|
+
x(this, "count", /* @__PURE__ */ a(() => e(this, W).rawRecords.length, "count"));
|
|
743
742
|
p(this, W, i);
|
|
744
743
|
}
|
|
745
744
|
get at() {
|
|
@@ -757,48 +756,48 @@ const Ce = class Ce {
|
|
|
757
756
|
};
|
|
758
757
|
W = new WeakMap(), F = new WeakMap(), a(Ce, "ngRow");
|
|
759
758
|
let xe = Ce;
|
|
760
|
-
var
|
|
761
|
-
const
|
|
759
|
+
var A, v, q, U, he, O, de, J, fe, ue, K;
|
|
760
|
+
const k = class k {
|
|
762
761
|
constructor(i, t) {
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
762
|
+
u(this, A);
|
|
763
|
+
u(this, v);
|
|
764
|
+
u(this, q, []);
|
|
765
|
+
u(this, U, []);
|
|
766
|
+
u(this, he, 0);
|
|
767
|
+
u(this, O, []);
|
|
768
|
+
u(this, de, /* @__PURE__ */ a(() => {
|
|
770
769
|
p(this, O, []);
|
|
771
|
-
const i = e(this,
|
|
770
|
+
const i = e(this, A).template || [];
|
|
772
771
|
Array.from(i).forEach((t) => {
|
|
773
772
|
var s;
|
|
774
773
|
e(this, O).push(((s = t.getBoundingClientRect) == null ? void 0 : s.call(t).height) || 24);
|
|
775
|
-
}), (e(this,
|
|
774
|
+
}), (e(this, v).rawRecords || []).forEach((t) => {
|
|
776
775
|
t.__ng || (t.__ng = e(this, J).call(this)), t.__ng.height = e(this, O).slice();
|
|
777
776
|
});
|
|
778
777
|
}, "#initialize"));
|
|
779
|
-
|
|
778
|
+
x(this, "set", /* @__PURE__ */ a((i) => {
|
|
780
779
|
this.clear(), this.add(i, !1);
|
|
781
780
|
}, "set"));
|
|
782
|
-
|
|
783
|
-
rowState:
|
|
781
|
+
u(this, J, /* @__PURE__ */ a(() => ({
|
|
782
|
+
rowState: k.ROW_STATE.EMPTY,
|
|
784
783
|
deleted: !1,
|
|
785
784
|
filtered: !1,
|
|
786
785
|
height: e(this, O).slice(),
|
|
787
786
|
o: {},
|
|
788
787
|
c: {},
|
|
789
|
-
_: [0, 0, 0, 0,
|
|
788
|
+
_: [0, 0, 0, 0, k.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, e(this, O).slice(), -1, {}, {}]
|
|
790
789
|
}), "#getDefaultMeta"));
|
|
791
|
-
|
|
792
|
-
p(this,
|
|
790
|
+
x(this, "reset", /* @__PURE__ */ a(() => {
|
|
791
|
+
p(this, q, []), p(this, U, []);
|
|
793
792
|
}, "reset"));
|
|
794
|
-
|
|
793
|
+
x(this, "clear", /* @__PURE__ */ a(() => {
|
|
795
794
|
var i;
|
|
796
|
-
e(this,
|
|
795
|
+
e(this, v).rawRecords = [], p(this, q, []), p(this, U, []), (i = e(this, v).viewRecords) != null && i.reset && e(this, v).viewRecords.reset();
|
|
797
796
|
}, "clear"));
|
|
798
|
-
|
|
797
|
+
u(this, fe, /* @__PURE__ */ a((i) => {
|
|
799
798
|
var n;
|
|
800
799
|
Array.isArray(i) || (i = [i]);
|
|
801
|
-
const t = typeof ((n = e(this,
|
|
800
|
+
const t = typeof ((n = e(this, A).fields) == null ? void 0 : n.get) == "function" ? e(this, A).fields.get() : Object.keys(i[0] || {}), s = [];
|
|
802
801
|
return i.forEach((r) => {
|
|
803
802
|
const o = { v: [] };
|
|
804
803
|
t.forEach((c) => {
|
|
@@ -806,54 +805,54 @@ const q = class q {
|
|
|
806
805
|
}), s.push(o);
|
|
807
806
|
}), s;
|
|
808
807
|
}, "#json2Array"));
|
|
809
|
-
|
|
810
|
-
t.__ng = e(this, J).call(this), t.__ng.rowid = this.nextId, t.__ng.rowState =
|
|
808
|
+
u(this, ue, /* @__PURE__ */ a((i) => (Array.isArray(i) || (i = [i]), i.forEach((t) => {
|
|
809
|
+
t.__ng = e(this, J).call(this), t.__ng.rowid = this.nextId, t.__ng.rowState = k.ROW_STATE.INSERT, t.__ng._[0] = t.__ng.rowid;
|
|
811
810
|
}), i), "#defaultInsert"));
|
|
812
|
-
|
|
811
|
+
x(this, "add", /* @__PURE__ */ a((i, t = !0) => {
|
|
813
812
|
var r;
|
|
814
813
|
i === void 0 && (i = {});
|
|
815
814
|
const s = e(this, fe).call(this, i);
|
|
816
|
-
e(this,
|
|
815
|
+
e(this, v).rawRecords = e(this, v).rawRecords.concat(e(this, ue).call(this, s)), this.resetRecords();
|
|
817
816
|
const n = this.count() - 1;
|
|
818
817
|
return t || s.forEach((o, c) => {
|
|
819
|
-
const
|
|
820
|
-
|
|
821
|
-
}), (r = e(this,
|
|
818
|
+
const h = e(this, v).rawRecords[n - c];
|
|
819
|
+
h && (h.__ng.rowState = k.ROW_STATE.EMPTY);
|
|
820
|
+
}), (r = e(this, v).viewRecords) != null && r.reset && e(this, v).viewRecords.reset(), n;
|
|
822
821
|
}, "add"));
|
|
823
|
-
|
|
822
|
+
x(this, "delete", /* @__PURE__ */ a((i) => {
|
|
824
823
|
var s;
|
|
825
824
|
let t = [];
|
|
826
|
-
Array.isArray(i) ? t = i : typeof i > "u" ? t = [e(this,
|
|
827
|
-
if (e(this,
|
|
828
|
-
const r = e(this,
|
|
829
|
-
e(this,
|
|
830
|
-
o.__ng.rowid === r && (o.__ng.deleted = !0, o.__ng.rowState =
|
|
825
|
+
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
|
+
if (e(this, q)[n]) {
|
|
827
|
+
const r = e(this, q)[n].__ng.rowid;
|
|
828
|
+
e(this, q)[n].__ng.rowState === k.ROW_STATE.INSERT ? e(this, v).rawRecords = e(this, v).rawRecords.filter((o) => o.__ng.rowid !== r) : e(this, v).rawRecords.forEach((o) => {
|
|
829
|
+
o.__ng.rowid === r && (o.__ng.deleted = !0, o.__ng.rowState = k.ROW_STATE.DELETE);
|
|
831
830
|
});
|
|
832
831
|
}
|
|
833
|
-
}), this.resetRecords(), (s = e(this,
|
|
832
|
+
}), this.resetRecords(), (s = e(this, v).viewRecords) != null && s.reset && e(this, v).viewRecords.reset();
|
|
834
833
|
}, "delete"));
|
|
835
|
-
|
|
836
|
-
var
|
|
834
|
+
x(this, "setValue", /* @__PURE__ */ a((i, t, s) => {
|
|
835
|
+
var h;
|
|
837
836
|
i = parseInt(i, 10);
|
|
838
|
-
const r = (typeof ((
|
|
837
|
+
const r = (typeof ((h = e(this, A).fields) == null ? void 0 : h.get) == "function" ? e(this, A).fields.get() : []).indexOf(t);
|
|
839
838
|
if (r < 0) return;
|
|
840
839
|
const o = this.getValidData()[i];
|
|
841
840
|
if (!o) return;
|
|
842
841
|
const c = o.v[r];
|
|
843
|
-
c !== s && o.__ng.rowState !==
|
|
842
|
+
c !== s && o.__ng.rowState !== k.ROW_STATE.INSERT && (o.__ng.o.hasOwnProperty(t) || (o.__ng.o[t] = c), o.__ng.rowState = k.ROW_STATE.UPDATE), o.v[r] = s, e(this, v).owner.refreshData && e(this, v).owner.refreshData(i);
|
|
844
843
|
}, "setValue"));
|
|
845
|
-
|
|
846
|
-
p(this, U, e(this,
|
|
844
|
+
x(this, "resetRecords", /* @__PURE__ */ a(() => {
|
|
845
|
+
p(this, U, e(this, v).rawRecords.filter((i) => !i.__ng.deleted)), p(this, q, e(this, v).rawRecords.filter((i) => !i.__ng.deleted && !i.__ng.filtered)), e(this, v).rawRecords.forEach((i, t) => {
|
|
847
846
|
i.__ng.rowidx = t;
|
|
848
|
-
}), e(this,
|
|
847
|
+
}), e(this, q).forEach((i, t) => {
|
|
849
848
|
i.__ng.i = t;
|
|
850
849
|
});
|
|
851
850
|
}, "resetRecords"));
|
|
852
|
-
|
|
853
|
-
|
|
851
|
+
x(this, "getValidData", /* @__PURE__ */ a(() => (e(this, q).length === 0 && e(this, v).rawRecords.length > 0 && this.resetRecords(), e(this, q)), "getValidData"));
|
|
852
|
+
u(this, K, /* @__PURE__ */ a((i) => {
|
|
854
853
|
var s;
|
|
855
854
|
if (!i) return i;
|
|
856
|
-
const t = typeof ((s = e(this,
|
|
855
|
+
const t = typeof ((s = e(this, A).fields) == null ? void 0 : s.get) == "function" ? e(this, A).fields.get() : [];
|
|
857
856
|
return Array.isArray(i) ? i.filter((n) => !n.__ng.deleted).map((n) => {
|
|
858
857
|
const r = {};
|
|
859
858
|
return t.forEach((o, c) => {
|
|
@@ -861,24 +860,24 @@ const q = class q {
|
|
|
861
860
|
}), r.__ng = n.__ng, r;
|
|
862
861
|
}) : i;
|
|
863
862
|
}, "#conv2"));
|
|
864
|
-
|
|
865
|
-
|
|
863
|
+
x(this, "count", /* @__PURE__ */ a(() => this.getValidData().length, "count"));
|
|
864
|
+
x(this, "get", /* @__PURE__ */ a((i, t) => {
|
|
866
865
|
var r;
|
|
867
866
|
const s = this.getValidData();
|
|
868
867
|
if (!s || s.length <= 0) return;
|
|
869
868
|
if (i == null) return e(this, K).call(this, s);
|
|
870
869
|
if (i < 0 || i >= s.length) return null;
|
|
871
|
-
const n = typeof ((r = e(this,
|
|
870
|
+
const n = typeof ((r = e(this, A).fields) == null ? void 0 : r.get) == "function" ? e(this, A).fields.get() : [];
|
|
872
871
|
if (t != null) {
|
|
873
872
|
const o = n.indexOf(t);
|
|
874
873
|
return o >= 0 ? s[i].v[o] : null;
|
|
875
874
|
}
|
|
876
875
|
return e(this, K).call(this, s[i]);
|
|
877
876
|
}, "get"));
|
|
878
|
-
p(this,
|
|
877
|
+
p(this, A, i), p(this, v, t), e(this, de).call(this);
|
|
879
878
|
}
|
|
880
879
|
get source() {
|
|
881
|
-
return e(this, K).call(this, e(this,
|
|
880
|
+
return e(this, K).call(this, e(this, v).rawRecords);
|
|
882
881
|
}
|
|
883
882
|
set source(i) {
|
|
884
883
|
this.clear(), this.add(i, !1);
|
|
@@ -887,21 +886,21 @@ const q = class q {
|
|
|
887
886
|
return ++We(this, he)._;
|
|
888
887
|
}
|
|
889
888
|
get length() {
|
|
890
|
-
return e(this,
|
|
889
|
+
return e(this, q).length;
|
|
891
890
|
}
|
|
892
891
|
getRowCount() {
|
|
893
892
|
return this.length;
|
|
894
893
|
}
|
|
895
894
|
};
|
|
896
|
-
|
|
897
|
-
|
|
895
|
+
A = new WeakMap(), v = new WeakMap(), q = new WeakMap(), U = new WeakMap(), he = new WeakMap(), O = new WeakMap(), de = new WeakMap(), J = new WeakMap(), fe = new WeakMap(), ue = new WeakMap(), K = new WeakMap(), a(k, "ngData"), // π― ν μν μ μ μμλ₯Ό ν΄λμ€ λ΄λΆλ‘ λ΄μ¬ν
|
|
896
|
+
x(k, "ROW_STATE", {
|
|
898
897
|
EMPTY: "EMPTY",
|
|
899
898
|
NORMAL: "NORMAL",
|
|
900
899
|
INSERT: "INSERT",
|
|
901
900
|
UPDATE: "UPDATE",
|
|
902
901
|
DELETE: "DELETE"
|
|
903
902
|
});
|
|
904
|
-
let Se =
|
|
903
|
+
let Se = k;
|
|
905
904
|
const _e = class _e {
|
|
906
905
|
constructor(i) {
|
|
907
906
|
this.owner = i, this.row = new xe(this), this.data = new Se(i, this), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.pageCnt = 25, this.viewRecords.reset = () => {
|
|
@@ -928,8 +927,8 @@ const Me = class Me extends HTMLElement {
|
|
|
928
927
|
constructor() {
|
|
929
928
|
super();
|
|
930
929
|
//#created = false;
|
|
931
|
-
|
|
932
|
-
|
|
930
|
+
u(this, Y);
|
|
931
|
+
u(this, ge);
|
|
933
932
|
this.attachShadow({ mode: "open" }), p(this, Y, new Re(this));
|
|
934
933
|
}
|
|
935
934
|
connectedCallback() {
|