@ninebone/table 0.0.116 β 0.0.117
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 +242 -259
- 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,59 +1,59 @@
|
|
|
1
|
-
var
|
|
2
|
-
var Ae = (
|
|
3
|
-
throw TypeError(
|
|
1
|
+
var ke = Object.defineProperty;
|
|
2
|
+
var Ae = (w) => {
|
|
3
|
+
throw TypeError(w);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var a = (
|
|
7
|
-
var v = (
|
|
8
|
-
var e = (
|
|
9
|
-
var
|
|
5
|
+
var Ce = (w, s, t) => s in w ? ke(w, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : w[s] = t;
|
|
6
|
+
var a = (w, s) => ke(w, "name", { value: s, configurable: !0 });
|
|
7
|
+
var v = (w, s, t) => Ce(w, typeof s != "symbol" ? s + "" : s, t), Le = (w, s, t) => s.has(w) || Ae("Cannot " + t);
|
|
8
|
+
var e = (w, s, t) => (Le(w, s, "read from private field"), t ? t.call(w) : s.get(w)), f = (w, s, t) => s.has(w) ? Ae("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(w) : s.set(w, t), y = (w, s, t, i) => (Le(w, s, "write to private field"), i ? i.call(w, t) : s.set(w, t), t);
|
|
9
|
+
var _e = (w, s, t, i) => ({
|
|
10
10
|
set _(n) {
|
|
11
|
-
y(
|
|
11
|
+
y(w, s, n, t);
|
|
12
12
|
},
|
|
13
13
|
get _() {
|
|
14
|
-
return e(
|
|
14
|
+
return e(w, s, i);
|
|
15
15
|
}
|
|
16
16
|
});
|
|
17
17
|
import { trace as Ie } from "@ninebone/util";
|
|
18
|
-
const
|
|
18
|
+
const me = class me extends Ie.constructor {
|
|
19
19
|
constructor() {
|
|
20
20
|
super(), this.init("nine-table", "green");
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
|
-
a(
|
|
24
|
-
let
|
|
25
|
-
const
|
|
26
|
-
var
|
|
27
|
-
const
|
|
23
|
+
a(me, "Trace");
|
|
24
|
+
let ce = me;
|
|
25
|
+
const Y = new ce();
|
|
26
|
+
var C, W, p, O, z, B, j, N, G;
|
|
27
|
+
const ve = class ve extends HTMLElement {
|
|
28
28
|
constructor() {
|
|
29
29
|
super();
|
|
30
|
-
f(this,
|
|
30
|
+
f(this, C);
|
|
31
31
|
f(this, W, !1);
|
|
32
32
|
f(this, p);
|
|
33
33
|
f(this, O);
|
|
34
34
|
f(this, z);
|
|
35
|
-
f(this,
|
|
35
|
+
f(this, B);
|
|
36
36
|
f(this, j, /* @__PURE__ */ a(() => {
|
|
37
|
-
if (!e(this,
|
|
38
|
-
const t = e(this,
|
|
39
|
-
t && (y(this,
|
|
37
|
+
if (!e(this, C)) return;
|
|
38
|
+
const t = e(this, C).querySelector(".ng-container-body");
|
|
39
|
+
t && (y(this, B, new ResizeObserver(() => {
|
|
40
40
|
this.refresh();
|
|
41
|
-
})), e(this,
|
|
41
|
+
})), e(this, B).observe(t));
|
|
42
42
|
}, "#observeResize"));
|
|
43
43
|
v(this, "refresh", /* @__PURE__ */ a(() => {
|
|
44
|
-
if (!e(this,
|
|
44
|
+
if (!e(this, C) || !e(this, p) || e(this, W)) return;
|
|
45
45
|
const t = e(this, p).container, i = t.querySelector("table");
|
|
46
46
|
if (!i) return;
|
|
47
|
-
const n = e(this, p).track, o = e(this, p).thumb, r = e(this,
|
|
48
|
-
if (
|
|
47
|
+
const n = e(this, p).track, o = e(this, p).thumb, r = e(this, C).querySelector(".ng-container-bottom"), c = t.clientWidth, u = i.scrollWidth;
|
|
48
|
+
if (c !== 0 && u > c)
|
|
49
49
|
r && (r.style.display = "flex");
|
|
50
50
|
else {
|
|
51
51
|
r && (r.style.display = "none");
|
|
52
52
|
return;
|
|
53
53
|
}
|
|
54
|
-
const
|
|
55
|
-
if (
|
|
56
|
-
const g = Math.max(Math.min(
|
|
54
|
+
const l = n.clientWidth;
|
|
55
|
+
if (l <= 0) return;
|
|
56
|
+
const g = Math.max(Math.min(l * (c / u), l), 20);
|
|
57
57
|
o.style.width = `${g}px`;
|
|
58
58
|
let h = 0;
|
|
59
59
|
const b = i.style.transform;
|
|
@@ -62,32 +62,32 @@ const Se = class Se extends HTMLElement {
|
|
|
62
62
|
x && x[1] && (h = parseFloat(x[1]));
|
|
63
63
|
} else
|
|
64
64
|
h = parseInt(i.style.left || 0, 10);
|
|
65
|
-
let
|
|
66
|
-
|
|
67
|
-
const S =
|
|
68
|
-
|
|
65
|
+
let d = parseInt(Math.abs(h) * l / u, 10);
|
|
66
|
+
d < 0 && (d = 0);
|
|
67
|
+
const S = l - g;
|
|
68
|
+
d > S && (d = S), o.style.left = `${d}px`, e(this, p).left.disabled = d === 0, e(this, p).right.disabled = d >= S - 1;
|
|
69
69
|
}, "refresh"));
|
|
70
|
-
f(this,
|
|
70
|
+
f(this, N, /* @__PURE__ */ a((t) => {
|
|
71
71
|
if (!e(this, p)) return !1;
|
|
72
72
|
const i = e(this, p).container, n = i.querySelector("table");
|
|
73
73
|
if (!n) return !1;
|
|
74
74
|
const o = e(this, p).track.getBoundingClientRect(), r = e(this, p).thumb.clientWidth;
|
|
75
|
-
let
|
|
76
|
-
|
|
77
|
-
const
|
|
78
|
-
|
|
79
|
-
const
|
|
80
|
-
let h =
|
|
81
|
-
return -h > g -
|
|
75
|
+
let c = t;
|
|
76
|
+
c < 0 && (c = 0);
|
|
77
|
+
const u = o.width - r;
|
|
78
|
+
c > u && (c = u), c = parseInt(c, 10), e(this, p).thumb.style.left = `${c}px`, e(this, p).left.disabled = c === 0, e(this, p).right.disabled = c >= u - 1;
|
|
79
|
+
const l = i.clientWidth, g = n.scrollWidth;
|
|
80
|
+
let h = u > 0 ? -c * (g - l) / u : 0;
|
|
81
|
+
return -h > g - l && (h = -(g - l)), -h + 5 > g - l && (h = -(g - l)), l >= g && (h = 0), n.style.transform = `translateX(${h}px)`, c > 0 && c < u - 1;
|
|
82
82
|
}, "#thumbMoveTo"));
|
|
83
83
|
f(this, G, /* @__PURE__ */ a(() => {
|
|
84
84
|
const t = /* @__PURE__ */ a((n) => {
|
|
85
85
|
clearInterval(e(this, O)), clearInterval(e(this, z));
|
|
86
86
|
const o = parseInt(e(this, p).thumb.style.left || 0, 10);
|
|
87
|
-
e(this,
|
|
87
|
+
e(this, N).call(this, o + n), y(this, O, setInterval(() => {
|
|
88
88
|
clearInterval(e(this, O)), y(this, z, setInterval(() => {
|
|
89
89
|
const r = parseInt(e(this, p).thumb.style.left || 0, 10);
|
|
90
|
-
e(this,
|
|
90
|
+
e(this, N).call(this, r + n) || clearInterval(e(this, z));
|
|
91
91
|
}, 50));
|
|
92
92
|
}, 500));
|
|
93
93
|
}, "delayScroll"), i = /* @__PURE__ */ a(() => {
|
|
@@ -103,14 +103,14 @@ const Se = class Se extends HTMLElement {
|
|
|
103
103
|
if (n.button !== 0) return;
|
|
104
104
|
n.preventDefault();
|
|
105
105
|
const o = e(this, p).track.getBoundingClientRect(), r = e(this, p).thumb.clientWidth;
|
|
106
|
-
e(this,
|
|
106
|
+
e(this, N).call(this, n.clientX - o.left - r / 2);
|
|
107
107
|
}), e(this, p).thumb.addEventListener("mousedown", (n) => {
|
|
108
108
|
if (n.button !== 0) return;
|
|
109
109
|
n.stopPropagation(), n.preventDefault(), y(this, W, !0), this.shiftX = n.clientX - e(this, p).thumb.getBoundingClientRect().left;
|
|
110
|
-
const o = /* @__PURE__ */ a((
|
|
110
|
+
const o = /* @__PURE__ */ a((c) => {
|
|
111
111
|
if (!e(this, W)) return;
|
|
112
|
-
const
|
|
113
|
-
e(this,
|
|
112
|
+
const u = e(this, p).track.getBoundingClientRect();
|
|
113
|
+
e(this, N).call(this, c.clientX - u.left - this.shiftX);
|
|
114
114
|
}, "onMouseMove"), r = /* @__PURE__ */ a(() => {
|
|
115
115
|
y(this, W, !1), i(), document.removeEventListener("mousemove", o), document.removeEventListener("mouseup", r), this.refresh();
|
|
116
116
|
}, "onMouseUp");
|
|
@@ -119,7 +119,7 @@ const Se = class Se extends HTMLElement {
|
|
|
119
119
|
}, "#init"));
|
|
120
120
|
}
|
|
121
121
|
connectedCallback() {
|
|
122
|
-
if (y(this,
|
|
122
|
+
if (y(this, C, this.closest("nine-table-sheet") || this.getRootNode().host), !e(this, C)) return;
|
|
123
123
|
this.innerHTML = `
|
|
124
124
|
<style>
|
|
125
125
|
nine-table-hscrollbar {
|
|
@@ -184,7 +184,7 @@ const Se = class Se 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 i = e(this,
|
|
187
|
+
const i = e(this, C).querySelector(".ng-container-body");
|
|
188
188
|
if (!i) {
|
|
189
189
|
setTimeout(t, 10);
|
|
190
190
|
return;
|
|
@@ -200,153 +200,136 @@ const Se = class Se extends HTMLElement {
|
|
|
200
200
|
t();
|
|
201
201
|
}
|
|
202
202
|
disconnectedCallback() {
|
|
203
|
-
e(this,
|
|
203
|
+
e(this, B) && e(this, B).disconnect();
|
|
204
204
|
}
|
|
205
205
|
};
|
|
206
|
-
|
|
207
|
-
let
|
|
208
|
-
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar",
|
|
209
|
-
var J,
|
|
210
|
-
const
|
|
206
|
+
C = new WeakMap(), W = new WeakMap(), p = new WeakMap(), O = new WeakMap(), z = new WeakMap(), B = new WeakMap(), j = new WeakMap(), N = new WeakMap(), G = new WeakMap(), a(ve, "NineTableHScrollBar");
|
|
207
|
+
let he = ve;
|
|
208
|
+
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", he);
|
|
209
|
+
var J, I, A;
|
|
210
|
+
const xe = class xe {
|
|
211
211
|
constructor(s) {
|
|
212
212
|
f(this, J);
|
|
213
|
-
f(this,
|
|
214
|
-
f(this,
|
|
213
|
+
f(this, I, []);
|
|
214
|
+
f(this, A, null);
|
|
215
215
|
v(this, "initTemplate", /* @__PURE__ */ a((s) => {
|
|
216
216
|
const t = s.querySelector("tbody.bindable") || s.querySelector("tbody");
|
|
217
217
|
if (!t) return;
|
|
218
218
|
const i = Array.from(t.querySelectorAll("tr")).filter((n) => !n.classList.contains("nodata"));
|
|
219
|
-
y(this,
|
|
219
|
+
y(this, I, i.map((n) => n.cloneNode(!0))), y(this, A, null), console.log(`[RowManager] Template initialized with ${e(this, I).length} row(s).`);
|
|
220
220
|
}, "initTemplate"));
|
|
221
221
|
/**
|
|
222
|
-
* π―
|
|
222
|
+
* π― μ€μ ν
μ΄λΈμ ν
νλ¦Ώμ 1ν κ·Έλ¦° ν λμ΄λ₯Ό μΈ‘μ νκ³ μΊμ±ν©λλ€.
|
|
223
223
|
*/
|
|
224
|
-
|
|
225
|
-
if (e(this,
|
|
226
|
-
return e(this,
|
|
227
|
-
if (e(this,
|
|
228
|
-
throw new Error("[RowManager] Template TRs are empty.
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
t.
|
|
232
|
-
const i =
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
}, "#calculateRequiredRowCount"));
|
|
252
|
-
v(this, "renderRows", /* @__PURE__ */ a((s, t = null) => {
|
|
253
|
-
if (e(this, _).length === 0) {
|
|
254
|
-
console.warn("[RowManager] Cannot render rows because template is empty.");
|
|
255
|
-
return;
|
|
256
|
-
}
|
|
257
|
-
const i = s.querySelector("tbody.bindable") || s.querySelector("tbody");
|
|
258
|
-
if (!i) return;
|
|
259
|
-
i.querySelectorAll("tr:not(.nodata)").forEach((l) => l.remove());
|
|
260
|
-
const n = i.querySelector("tr.nodata"), o = document.createDocumentFragment(), r = t !== null ? t : e(this, ee).call(this, s);
|
|
261
|
-
console.log(`[RowManager] Rendering ${r} row sets into container...`);
|
|
262
|
-
for (let l = 0; l < r; l++)
|
|
263
|
-
e(this, _).forEach((d) => {
|
|
264
|
-
o.appendChild(d.cloneNode(!0));
|
|
265
|
-
});
|
|
266
|
-
n ? n.before(o) : i.appendChild(o), console.log(`[RowManager] Successfully rendered. Total DOM tr count in tbody: ${i.querySelectorAll("tr:not(.nodata)").length}`);
|
|
267
|
-
}, "renderRows"));
|
|
224
|
+
v(this, "measureAndCacheHeight", /* @__PURE__ */ a((s) => {
|
|
225
|
+
if (e(this, A) !== null)
|
|
226
|
+
return e(this, A);
|
|
227
|
+
if (e(this, I).length === 0)
|
|
228
|
+
throw new Error("[RowManager] Template TRs are empty.");
|
|
229
|
+
const t = s.querySelector("tbody.bindable") || s.querySelector("tbody");
|
|
230
|
+
if (!t) return 24;
|
|
231
|
+
t.querySelectorAll("tr:not(.nodata)").forEach((c) => c.remove());
|
|
232
|
+
const i = t.querySelector("tr.nodata"), n = document.createDocumentFragment();
|
|
233
|
+
e(this, I).forEach((c) => {
|
|
234
|
+
n.appendChild(c.cloneNode(!0));
|
|
235
|
+
}), i ? i.before(n) : t.appendChild(n);
|
|
236
|
+
let o = 0;
|
|
237
|
+
return t.querySelectorAll("tr:not(.nodata)").forEach((c, u) => {
|
|
238
|
+
const l = c.offsetHeight;
|
|
239
|
+
if (l === 0)
|
|
240
|
+
throw new Error(`[RowManager] Rendered TR[${u}] height is 0. Check CSS styles.`);
|
|
241
|
+
o += l, Y.log(`[RowManager] Measured TR[${u}] height: ${l}px`);
|
|
242
|
+
}), y(this, A, o), console.log(`[RowManager] Template Height Cached Successfully: ${e(this, A)}px`), e(this, A);
|
|
243
|
+
}, "measureAndCacheHeight"));
|
|
244
|
+
/**
|
|
245
|
+
* π― 컨ν
μ΄λ λμ΄ λλΉ νμν μ΄ ν κ°―μ μ°μ (λμ΄ μΈ‘μ μλ£ μ μ΄λ©΄ κΈ°λ³Έ 1μΈνΈ λμ΄ μ¬μ©)
|
|
246
|
+
*/
|
|
247
|
+
v(this, "calculateRequiredRowCount", /* @__PURE__ */ a((s) => {
|
|
248
|
+
const t = s.clientHeight || s.getBoundingClientRect().height || 400, i = e(this, A) !== null ? e(this, A) : this.measureAndCacheHeight(s), r = Math.ceil(t / i) + 20;
|
|
249
|
+
return console.log(`[RowManager] Container Height: ${t}px | Template Height: ${i}px | Target Rows: ${r}`), r;
|
|
250
|
+
}, "calculateRequiredRowCount"));
|
|
268
251
|
y(this, J, s);
|
|
269
252
|
}
|
|
270
253
|
get templateLength() {
|
|
271
|
-
return e(this,
|
|
254
|
+
return e(this, I).length || 1;
|
|
272
255
|
}
|
|
273
256
|
};
|
|
274
|
-
J = new WeakMap(),
|
|
275
|
-
let
|
|
276
|
-
var
|
|
277
|
-
const
|
|
257
|
+
J = new WeakMap(), I = new WeakMap(), A = new WeakMap(), a(xe, "RowManager");
|
|
258
|
+
let de = xe;
|
|
259
|
+
var L, $, Q;
|
|
260
|
+
const F = class F extends HTMLElement {
|
|
278
261
|
constructor() {
|
|
279
262
|
super();
|
|
280
|
-
f(this,
|
|
281
|
-
f(this,
|
|
263
|
+
f(this, L, null);
|
|
264
|
+
f(this, $);
|
|
282
265
|
v(this, "init", /* @__PURE__ */ a((t) => {
|
|
283
266
|
if (!t) return;
|
|
284
|
-
const i = /* @__PURE__ */ a((
|
|
267
|
+
const i = /* @__PURE__ */ a((l) => {
|
|
285
268
|
const g = /* @__PURE__ */ a((b) => {
|
|
286
269
|
if (b.querySelector("colgroup")) return;
|
|
287
|
-
const
|
|
270
|
+
const d = b.querySelector("tbody tr") || b.querySelector("tr"), S = d ? d.querySelectorAll("th, td").length : 1, x = document.createElement("colgroup"), k = Math.max(Math.floor((b.clientWidth || 600) / S), 100);
|
|
288
271
|
for (let R = 0; R < S; R++) {
|
|
289
|
-
const
|
|
290
|
-
|
|
272
|
+
const ae = document.createElement("col");
|
|
273
|
+
ae.setAttribute("width", k), x.appendChild(ae);
|
|
291
274
|
}
|
|
292
275
|
b.prepend(x);
|
|
293
276
|
}, "ensureColgroup"), h = /* @__PURE__ */ a((b) => {
|
|
294
277
|
if (b.querySelector("thead")) return;
|
|
295
|
-
const
|
|
296
|
-
S ? S.after(
|
|
278
|
+
const d = document.createElement("thead"), S = b.querySelector("colgroup");
|
|
279
|
+
S ? S.after(d) : b.prepend(d);
|
|
297
280
|
}, "ensureThead");
|
|
298
|
-
return g(
|
|
281
|
+
return g(l), h(l), l.classList.add("nine-table-element"), l;
|
|
299
282
|
}, "initializeTable"), n = t.cloneNode(!0);
|
|
300
|
-
y(this,
|
|
301
|
-
const o = this.querySelector(".ng-container-left"), r = this.querySelector(".ng-container-body"),
|
|
302
|
-
const b =
|
|
303
|
-
return
|
|
283
|
+
y(this, L, i(n)), e(this, L).style.display = "table", e(this, $).initTemplate(e(this, L));
|
|
284
|
+
const o = this.querySelector(".ng-container-left"), r = this.querySelector(".ng-container-body"), c = this.querySelector(".ng-container-right"), u = /* @__PURE__ */ a((l, g, h = !1) => {
|
|
285
|
+
const b = l.cloneNode(!0), d = Array.from(b.querySelectorAll("colgroup col")), S = [];
|
|
286
|
+
return d.forEach((x, k) => {
|
|
304
287
|
const R = x.getAttribute("fixed");
|
|
305
|
-
(h ? !R || R === "" : R === g) || S.push(
|
|
288
|
+
(h ? !R || R === "" : R === g) || S.push(k);
|
|
306
289
|
}), S.reverse().forEach((x) => {
|
|
307
|
-
|
|
308
|
-
const R =
|
|
290
|
+
d[x] && d[x].remove(), b.querySelectorAll("tr").forEach((k) => {
|
|
291
|
+
const R = k.querySelectorAll("th, td");
|
|
309
292
|
R[x] && R[x].remove();
|
|
310
293
|
});
|
|
311
294
|
}), b;
|
|
312
295
|
}, "filterTableByFixed");
|
|
313
296
|
if (r) {
|
|
314
|
-
const
|
|
315
|
-
r.innerHTML = "", r.appendChild(
|
|
297
|
+
const l = u(e(this, L), null, !0);
|
|
298
|
+
r.innerHTML = "", r.appendChild(l), e(this, $).renderRows(r);
|
|
316
299
|
}
|
|
317
300
|
if (o) {
|
|
318
|
-
const
|
|
301
|
+
const l = u(e(this, L), "left", !1);
|
|
319
302
|
let g = 0;
|
|
320
|
-
|
|
321
|
-
const
|
|
322
|
-
isNaN(
|
|
323
|
-
}), o.innerHTML = "", o.appendChild(
|
|
303
|
+
l.querySelectorAll("col").forEach((b) => {
|
|
304
|
+
const d = parseInt(b.getAttribute("width"), 10);
|
|
305
|
+
isNaN(d) || (g += d);
|
|
306
|
+
}), o.innerHTML = "", o.appendChild(l), e(this, $).renderRows(o);
|
|
324
307
|
const h = g > 0 ? g : 0;
|
|
325
308
|
o.style.flex = `0 0 ${h}px`, o.style.width = `${h}px`;
|
|
326
309
|
}
|
|
327
|
-
if (
|
|
328
|
-
const
|
|
310
|
+
if (c) {
|
|
311
|
+
const l = u(e(this, L), "right", !1);
|
|
329
312
|
let g = 0;
|
|
330
|
-
|
|
331
|
-
const
|
|
332
|
-
isNaN(
|
|
333
|
-
}),
|
|
313
|
+
l.querySelectorAll("col").forEach((b) => {
|
|
314
|
+
const d = parseInt(b.getAttribute("width"), 10);
|
|
315
|
+
isNaN(d) || (g += d);
|
|
316
|
+
}), c.innerHTML = "", c.appendChild(l), e(this, $).renderRows(c);
|
|
334
317
|
const h = g > 0 ? g : 0;
|
|
335
|
-
|
|
318
|
+
c.style.flex = `0 0 ${h}px`, c.style.width = `${h}px`;
|
|
336
319
|
}
|
|
337
320
|
if (r) {
|
|
338
|
-
const
|
|
339
|
-
r.style.overflowY =
|
|
321
|
+
const l = this.getRowCount();
|
|
322
|
+
r.style.overflowY = l > 10 ? "auto" : "hidden", r.addEventListener("scroll", () => {
|
|
340
323
|
const g = this.querySelector("nine-table-hscrollbar");
|
|
341
324
|
g && typeof g.refresh == "function" && g.refresh();
|
|
342
325
|
});
|
|
343
326
|
}
|
|
344
327
|
setTimeout(() => {
|
|
345
|
-
const
|
|
346
|
-
|
|
347
|
-
}, 0),
|
|
328
|
+
const l = this.querySelector("nine-table-hscrollbar");
|
|
329
|
+
l && typeof l.refresh == "function" && l.refresh();
|
|
330
|
+
}, 0), Y.log(`NineTableSheet 3-split initialized with rows: ${this.getRowCount()}`);
|
|
348
331
|
}, "init"));
|
|
349
|
-
v(this, "getRowCount", /* @__PURE__ */ a(() => e(this,
|
|
332
|
+
v(this, "getRowCount", /* @__PURE__ */ a(() => e(this, L) ? e(this, L).querySelectorAll("tbody tr").length : 0, "getRowCount"));
|
|
350
333
|
v(this, "scrollToX", /* @__PURE__ */ a((t) => {
|
|
351
334
|
const i = this.querySelector(".ng-container-body");
|
|
352
335
|
i && (i.scrollLeft = t);
|
|
@@ -355,8 +338,8 @@ const Y = class Y extends HTMLElement {
|
|
|
355
338
|
const i = this.querySelector(".ng-container-body");
|
|
356
339
|
i && (i.scrollTop = t);
|
|
357
340
|
}, "scrollToY"));
|
|
358
|
-
f(this,
|
|
359
|
-
const t =
|
|
341
|
+
f(this, Q, /* @__PURE__ */ a(() => {
|
|
342
|
+
const t = F.SCROLLBAR_SIZE;
|
|
360
343
|
this.innerHTML = `
|
|
361
344
|
<style>
|
|
362
345
|
nine-table-sheet {
|
|
@@ -472,23 +455,23 @@ const Y = class Y extends HTMLElement {
|
|
|
472
455
|
</div>
|
|
473
456
|
`;
|
|
474
457
|
}, "#render"));
|
|
475
|
-
y(this,
|
|
458
|
+
y(this, $, new de(this));
|
|
476
459
|
}
|
|
477
460
|
connectedCallback() {
|
|
478
|
-
e(this,
|
|
461
|
+
e(this, Q).call(this);
|
|
479
462
|
}
|
|
480
463
|
disconnectedCallback() {
|
|
481
|
-
this.innerHTML = "",
|
|
464
|
+
this.innerHTML = "", Y.log("NineTableSheet destroyed.");
|
|
482
465
|
}
|
|
483
466
|
};
|
|
484
|
-
|
|
485
|
-
let
|
|
486
|
-
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet",
|
|
487
|
-
var
|
|
488
|
-
const
|
|
467
|
+
L = new WeakMap(), $ = new WeakMap(), Q = new WeakMap(), a(F, "NineTableSheet"), v(F, "SCROLLBAR_SIZE", 16);
|
|
468
|
+
let fe = F;
|
|
469
|
+
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", fe);
|
|
470
|
+
var ee;
|
|
471
|
+
const Se = class Se extends HTMLElement {
|
|
489
472
|
constructor() {
|
|
490
473
|
super();
|
|
491
|
-
f(this,
|
|
474
|
+
f(this, ee, /* @__PURE__ */ a(() => {
|
|
492
475
|
const t = this.querySelector(".nine-tab-bar");
|
|
493
476
|
t && (t.addEventListener("click", (i) => {
|
|
494
477
|
const n = i.target.closest(".nine-tab-item");
|
|
@@ -500,36 +483,36 @@ const Re = class Re extends HTMLElement {
|
|
|
500
483
|
v(this, "switchSheet", /* @__PURE__ */ a((t, i = !1) => {
|
|
501
484
|
const n = /* @__PURE__ */ a(() => {
|
|
502
485
|
const h = this.querySelector("nine-table-sheets-body");
|
|
503
|
-
h.querySelectorAll("nine-splitter").forEach((
|
|
504
|
-
const S = parseInt(
|
|
505
|
-
x &&
|
|
486
|
+
h.querySelectorAll("nine-splitter").forEach((d) => {
|
|
487
|
+
const S = parseInt(d.dataset.splitIndex, 10), x = h.querySelector(`nine-table-sheet[data-index="${S - 1}"]`), k = h.querySelector(`nine-table-sheet[data-index="${S}"]`);
|
|
488
|
+
x && k && x.classList.contains("active") && k.classList.contains("active") ? d.classList.add("active") : d.classList.remove("active");
|
|
506
489
|
});
|
|
507
|
-
}, "updateSplitters"), o = this.querySelector(".nine-tab-bar"), r = this.querySelector("nine-table-sheets-body"),
|
|
508
|
-
if (!
|
|
490
|
+
}, "updateSplitters"), o = this.querySelector(".nine-tab-bar"), r = this.querySelector("nine-table-sheets-body"), c = o.querySelectorAll(".nine-tab-item"), u = r.querySelectorAll("nine-table-sheet");
|
|
491
|
+
if (!c[t]) return;
|
|
509
492
|
if (!i)
|
|
510
|
-
|
|
493
|
+
c.forEach((h, b) => {
|
|
511
494
|
h.classList.toggle("active", b === t);
|
|
512
|
-
const
|
|
513
|
-
|
|
514
|
-
}),
|
|
495
|
+
const d = r.querySelector(`nine-table-sheet[data-index="${b}"]`);
|
|
496
|
+
d && (d.style.flex = "");
|
|
497
|
+
}), u.forEach((h, b) => {
|
|
515
498
|
h.classList.toggle("active", b === t);
|
|
516
499
|
});
|
|
517
500
|
else {
|
|
518
|
-
const h =
|
|
501
|
+
const h = c[t], b = o.querySelectorAll(".nine-tab-item.active");
|
|
519
502
|
if (h.classList.contains("active") && b.length <= 1)
|
|
520
503
|
return;
|
|
521
504
|
h.classList.toggle("active");
|
|
522
|
-
const
|
|
523
|
-
|
|
505
|
+
const d = r.querySelector(`nine-table-sheet[data-index="${t}"]`);
|
|
506
|
+
d && (d.classList.toggle("active"), d.classList.contains("active") || (d.style.flex = ""));
|
|
524
507
|
}
|
|
525
|
-
const
|
|
526
|
-
if (
|
|
527
|
-
const h = 1 /
|
|
528
|
-
|
|
508
|
+
const l = Array.from(r.querySelectorAll("nine-table-sheet.active"));
|
|
509
|
+
if (l.length > 1) {
|
|
510
|
+
const h = 1 / l.length;
|
|
511
|
+
l.forEach((b) => {
|
|
529
512
|
(!b.style.flex || b.style.flex === "1 1 100%") && (b.style.flex = `${h} ${h} 0px`);
|
|
530
513
|
});
|
|
531
514
|
} else
|
|
532
|
-
|
|
515
|
+
l.forEach((h) => {
|
|
533
516
|
h.style.flex = "1 1 100%";
|
|
534
517
|
});
|
|
535
518
|
n();
|
|
@@ -541,36 +524,36 @@ const Re = class Re extends HTMLElement {
|
|
|
541
524
|
}, "switchSheet"));
|
|
542
525
|
}
|
|
543
526
|
connectedCallback() {
|
|
544
|
-
e(this,
|
|
527
|
+
e(this, ee).call(this);
|
|
545
528
|
}
|
|
546
529
|
};
|
|
547
|
-
|
|
548
|
-
let
|
|
549
|
-
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets",
|
|
550
|
-
var
|
|
551
|
-
const
|
|
530
|
+
ee = new WeakMap(), a(Se, "NineTableSheets");
|
|
531
|
+
let ue = Se;
|
|
532
|
+
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", ue);
|
|
533
|
+
var _, U, te, Z, se;
|
|
534
|
+
const Ee = class Ee {
|
|
552
535
|
constructor(s) {
|
|
553
|
-
f(this,
|
|
536
|
+
f(this, _);
|
|
554
537
|
f(this, U, null);
|
|
555
|
-
f(this,
|
|
556
|
-
const s = e(this,
|
|
538
|
+
f(this, te, /* @__PURE__ */ a(() => {
|
|
539
|
+
const s = e(this, _).host;
|
|
557
540
|
s && (y(this, U, new ResizeObserver((t) => {
|
|
558
541
|
for (let i of t)
|
|
559
|
-
s.getAttribute("auto-height") === "true" && e(this,
|
|
542
|
+
s.getAttribute("auto-height") === "true" && e(this, Z).call(this, s);
|
|
560
543
|
})), e(this, U).observe(s));
|
|
561
544
|
}, "#observeResize"));
|
|
562
|
-
f(this,
|
|
563
|
-
var
|
|
564
|
-
const t = (
|
|
545
|
+
f(this, Z, /* @__PURE__ */ a((s) => {
|
|
546
|
+
var k, R;
|
|
547
|
+
const t = (k = s.shadowRoot) == null ? void 0 : k.querySelector("nine-table-sheet.active");
|
|
565
548
|
if (!t) return;
|
|
566
|
-
const i = ((R = t.getRowCount) == null ? void 0 : R.call(t)) || 0, n = parseInt(s.getAttribute("max-display-row"), 10) || 10, o = Math.min(i, n), r = t.querySelector("tbody tr") || t.querySelector("tr"),
|
|
567
|
-
s.style.height = `${S}px`, s.style.maxHeight = `${n *
|
|
568
|
-
const x = e(this,
|
|
549
|
+
const i = ((R = t.getRowCount) == null ? void 0 : R.call(t)) || 0, n = parseInt(s.getAttribute("max-display-row"), 10) || 10, o = Math.min(i, n), r = t.querySelector("tbody tr") || t.querySelector("tr"), c = r ? r.getBoundingClientRect().height : 32, u = e(this, _).querySelector("nine-table-header"), l = e(this, _).querySelector("nine-table-sheets-footer"), g = u ? u.getBoundingClientRect().height : 40, h = l ? l.getBoundingClientRect().height : 32, d = g + h + 16, S = o * c + d;
|
|
550
|
+
s.style.height = `${S}px`, s.style.maxHeight = `${n * c + d}px`;
|
|
551
|
+
const x = e(this, _).querySelector("nine-table-sheets-body");
|
|
569
552
|
x && (x.style.overflowY = i > n ? "auto" : "hidden");
|
|
570
553
|
}, "#applyAutoHeight"));
|
|
571
|
-
f(this,
|
|
572
|
-
const s = e(this,
|
|
573
|
-
e(this,
|
|
554
|
+
f(this, se, /* @__PURE__ */ a(() => {
|
|
555
|
+
const s = e(this, _).host, i = Array.from(s.children).filter((u) => u.tagName === "TABLE"), n = s.getAttribute("auto-height") === "true", o = i.map((u, l) => `<nine-table-sheet class="${l === 0 ? "active" : ""}" data-index="${l}"></nine-table-sheet>`).join(""), r = i.map((u, l) => `<div class="nine-tab-item ${l === 0 ? "active" : ""}" data-index="${l}">Sheet ${l + 1}</div>`).join("");
|
|
556
|
+
e(this, _).innerHTML = `
|
|
574
557
|
<style>
|
|
575
558
|
:host {
|
|
576
559
|
display: flex;
|
|
@@ -668,25 +651,25 @@ const Te = class Te {
|
|
|
668
651
|
</nine-table-body>
|
|
669
652
|
<nine-table-footer></nine-table-footer>
|
|
670
653
|
`;
|
|
671
|
-
const
|
|
672
|
-
|
|
673
|
-
i[
|
|
674
|
-
|
|
654
|
+
const c = e(this, _).querySelectorAll("nine-table-sheet");
|
|
655
|
+
c == null || c.forEach((u, l) => {
|
|
656
|
+
i[l] && setTimeout(() => {
|
|
657
|
+
u.init(i[l]), n && e(this, Z).call(this, s);
|
|
675
658
|
});
|
|
676
659
|
});
|
|
677
660
|
}, "#render"));
|
|
678
|
-
y(this,
|
|
661
|
+
y(this, _, s), e(this, se).call(this), e(this, te).call(this);
|
|
679
662
|
}
|
|
680
663
|
};
|
|
681
|
-
|
|
682
|
-
let
|
|
683
|
-
var
|
|
684
|
-
const
|
|
664
|
+
_ = new WeakMap(), U = new WeakMap(), te = new WeakMap(), Z = new WeakMap(), se = new WeakMap(), a(Ee, "LayoutManager");
|
|
665
|
+
let be = Ee;
|
|
666
|
+
var M, D;
|
|
667
|
+
const Re = class Re {
|
|
685
668
|
constructor(s) {
|
|
686
|
-
f(this,
|
|
669
|
+
f(this, M);
|
|
687
670
|
f(this, D, -1);
|
|
688
|
-
v(this, "count", /* @__PURE__ */ a(() => e(this,
|
|
689
|
-
y(this,
|
|
671
|
+
v(this, "count", /* @__PURE__ */ a(() => e(this, M).rawRecords.length, "count"));
|
|
672
|
+
y(this, M, s);
|
|
690
673
|
}
|
|
691
674
|
get at() {
|
|
692
675
|
return e(this, D);
|
|
@@ -694,38 +677,38 @@ const qe = class qe {
|
|
|
694
677
|
set at(s) {
|
|
695
678
|
var i, n;
|
|
696
679
|
y(this, D, parseInt(s, 10));
|
|
697
|
-
const t = ((n = (i = e(this,
|
|
680
|
+
const t = ((n = (i = e(this, M).owner).querySelector) == null ? void 0 : n.call(i, ".ng-container-body")) || e(this, M).owner.body;
|
|
698
681
|
t && !t.querySelector(`tbody.bindable tr[data-row="${e(this, D)}"]`) && setTimeout(() => {
|
|
699
682
|
var o, r;
|
|
700
|
-
(r = (o = e(this,
|
|
683
|
+
(r = (o = e(this, M).owner).scrollTo_V1) == null || r.call(o, e(this, D));
|
|
701
684
|
});
|
|
702
685
|
}
|
|
703
686
|
};
|
|
704
|
-
|
|
705
|
-
let
|
|
706
|
-
var E,
|
|
687
|
+
M = new WeakMap(), D = new WeakMap(), a(Re, "ngRow");
|
|
688
|
+
let ge = Re;
|
|
689
|
+
var E, m, q, X, ie, H, ne, K, re, oe, V;
|
|
707
690
|
const T = class T {
|
|
708
691
|
constructor(s, t) {
|
|
709
692
|
f(this, E);
|
|
710
|
-
f(this,
|
|
693
|
+
f(this, m);
|
|
711
694
|
f(this, q, []);
|
|
712
|
-
f(this,
|
|
713
|
-
f(this,
|
|
695
|
+
f(this, X, []);
|
|
696
|
+
f(this, ie, 0);
|
|
714
697
|
f(this, H, []);
|
|
715
|
-
f(this,
|
|
698
|
+
f(this, ne, /* @__PURE__ */ a(() => {
|
|
716
699
|
y(this, H, []);
|
|
717
700
|
const s = e(this, E).template || [];
|
|
718
701
|
Array.from(s).forEach((t) => {
|
|
719
702
|
var i;
|
|
720
703
|
e(this, H).push(((i = t.getBoundingClientRect) == null ? void 0 : i.call(t).height) || 24);
|
|
721
|
-
}), (e(this,
|
|
722
|
-
t.__ng || (t.__ng = e(this,
|
|
704
|
+
}), (e(this, m).rawRecords || []).forEach((t) => {
|
|
705
|
+
t.__ng || (t.__ng = e(this, K).call(this)), t.__ng.height = e(this, H).slice();
|
|
723
706
|
});
|
|
724
707
|
}, "#initialize"));
|
|
725
708
|
v(this, "set", /* @__PURE__ */ a((s) => {
|
|
726
709
|
this.clear(), this.add(s, !1);
|
|
727
710
|
}, "set"));
|
|
728
|
-
f(this,
|
|
711
|
+
f(this, K, /* @__PURE__ */ a(() => ({
|
|
729
712
|
rowState: T.ROW_STATE.EMPTY,
|
|
730
713
|
deleted: !1,
|
|
731
714
|
filtered: !1,
|
|
@@ -735,75 +718,75 @@ const T = class T {
|
|
|
735
718
|
_: [0, 0, 0, 0, T.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, e(this, H).slice(), -1, {}, {}]
|
|
736
719
|
}), "#getDefaultMeta"));
|
|
737
720
|
v(this, "reset", /* @__PURE__ */ a(() => {
|
|
738
|
-
y(this, q, []), y(this,
|
|
721
|
+
y(this, q, []), y(this, X, []);
|
|
739
722
|
}, "reset"));
|
|
740
723
|
v(this, "clear", /* @__PURE__ */ a(() => {
|
|
741
724
|
var s;
|
|
742
|
-
e(this,
|
|
725
|
+
e(this, m).rawRecords = [], y(this, q, []), y(this, X, []), (s = e(this, m).viewRecords) != null && s.reset && e(this, m).viewRecords.reset();
|
|
743
726
|
}, "clear"));
|
|
744
|
-
f(this,
|
|
727
|
+
f(this, re, /* @__PURE__ */ a((s) => {
|
|
745
728
|
var n;
|
|
746
729
|
Array.isArray(s) || (s = [s]);
|
|
747
730
|
const t = typeof ((n = e(this, E).fields) == null ? void 0 : n.get) == "function" ? e(this, E).fields.get() : Object.keys(s[0] || {}), i = [];
|
|
748
731
|
return s.forEach((o) => {
|
|
749
732
|
const r = { v: [] };
|
|
750
|
-
t.forEach((
|
|
751
|
-
r.v.push(o[
|
|
733
|
+
t.forEach((c) => {
|
|
734
|
+
r.v.push(o[c] !== void 0 && o[c] !== null ? o[c] : "");
|
|
752
735
|
}), i.push(r);
|
|
753
736
|
}), i;
|
|
754
737
|
}, "#json2Array"));
|
|
755
|
-
f(this,
|
|
756
|
-
t.__ng = e(this,
|
|
738
|
+
f(this, oe, /* @__PURE__ */ a((s) => (Array.isArray(s) || (s = [s]), s.forEach((t) => {
|
|
739
|
+
t.__ng = e(this, K).call(this), t.__ng.rowid = this.nextId, t.__ng.rowState = T.ROW_STATE.INSERT, t.__ng._[0] = t.__ng.rowid;
|
|
757
740
|
}), s), "#defaultInsert"));
|
|
758
741
|
v(this, "add", /* @__PURE__ */ a((s, t = !0) => {
|
|
759
742
|
var o;
|
|
760
743
|
s === void 0 && (s = {});
|
|
761
|
-
const i = e(this,
|
|
762
|
-
e(this,
|
|
744
|
+
const i = e(this, re).call(this, s);
|
|
745
|
+
e(this, m).rawRecords = e(this, m).rawRecords.concat(e(this, oe).call(this, i)), this.resetRecords();
|
|
763
746
|
const n = this.count() - 1;
|
|
764
|
-
return t || i.forEach((r,
|
|
765
|
-
const
|
|
766
|
-
|
|
767
|
-
}), (o = e(this,
|
|
747
|
+
return t || i.forEach((r, c) => {
|
|
748
|
+
const u = e(this, m).rawRecords[n - c];
|
|
749
|
+
u && (u.__ng.rowState = T.ROW_STATE.EMPTY);
|
|
750
|
+
}), (o = e(this, m).viewRecords) != null && o.reset && e(this, m).viewRecords.reset(), n;
|
|
768
751
|
}, "add"));
|
|
769
752
|
v(this, "delete", /* @__PURE__ */ a((s) => {
|
|
770
753
|
var i;
|
|
771
754
|
let t = [];
|
|
772
|
-
Array.isArray(s) ? t = s : typeof s > "u" ? t = [e(this,
|
|
755
|
+
Array.isArray(s) ? t = s : typeof s > "u" ? t = [e(this, m).owner.row.at] : t = [parseInt(s, 10)], t.sort((n, o) => o - n).forEach((n) => {
|
|
773
756
|
if (e(this, q)[n]) {
|
|
774
757
|
const o = e(this, q)[n].__ng.rowid;
|
|
775
|
-
e(this, q)[n].__ng.rowState === T.ROW_STATE.INSERT ? e(this,
|
|
758
|
+
e(this, q)[n].__ng.rowState === T.ROW_STATE.INSERT ? e(this, m).rawRecords = e(this, m).rawRecords.filter((r) => r.__ng.rowid !== o) : e(this, m).rawRecords.forEach((r) => {
|
|
776
759
|
r.__ng.rowid === o && (r.__ng.deleted = !0, r.__ng.rowState = T.ROW_STATE.DELETE);
|
|
777
760
|
});
|
|
778
761
|
}
|
|
779
|
-
}), this.resetRecords(), (i = e(this,
|
|
762
|
+
}), this.resetRecords(), (i = e(this, m).viewRecords) != null && i.reset && e(this, m).viewRecords.reset();
|
|
780
763
|
}, "delete"));
|
|
781
764
|
v(this, "setValue", /* @__PURE__ */ a((s, t, i) => {
|
|
782
|
-
var
|
|
765
|
+
var u;
|
|
783
766
|
s = parseInt(s, 10);
|
|
784
|
-
const o = (typeof ((
|
|
767
|
+
const o = (typeof ((u = e(this, E).fields) == null ? void 0 : u.get) == "function" ? e(this, E).fields.get() : []).indexOf(t);
|
|
785
768
|
if (o < 0) return;
|
|
786
769
|
const r = this.getValidData()[s];
|
|
787
770
|
if (!r) return;
|
|
788
|
-
const
|
|
789
|
-
|
|
771
|
+
const c = r.v[o];
|
|
772
|
+
c !== i && r.__ng.rowState !== T.ROW_STATE.INSERT && (r.__ng.o.hasOwnProperty(t) || (r.__ng.o[t] = c), r.__ng.rowState = T.ROW_STATE.UPDATE), r.v[o] = i, e(this, m).owner.refreshData && e(this, m).owner.refreshData(s);
|
|
790
773
|
}, "setValue"));
|
|
791
774
|
v(this, "resetRecords", /* @__PURE__ */ a(() => {
|
|
792
|
-
y(this,
|
|
775
|
+
y(this, X, e(this, m).rawRecords.filter((s) => !s.__ng.deleted)), y(this, q, e(this, m).rawRecords.filter((s) => !s.__ng.deleted && !s.__ng.filtered)), e(this, m).rawRecords.forEach((s, t) => {
|
|
793
776
|
s.__ng.rowidx = t;
|
|
794
777
|
}), e(this, q).forEach((s, t) => {
|
|
795
778
|
s.__ng.i = t;
|
|
796
779
|
});
|
|
797
780
|
}, "resetRecords"));
|
|
798
|
-
v(this, "getValidData", /* @__PURE__ */ a(() => (e(this, q).length === 0 && e(this,
|
|
799
|
-
f(this,
|
|
781
|
+
v(this, "getValidData", /* @__PURE__ */ a(() => (e(this, q).length === 0 && e(this, m).rawRecords.length > 0 && this.resetRecords(), e(this, q)), "getValidData"));
|
|
782
|
+
f(this, V, /* @__PURE__ */ a((s) => {
|
|
800
783
|
var i;
|
|
801
784
|
if (!s) return s;
|
|
802
785
|
const t = typeof ((i = e(this, E).fields) == null ? void 0 : i.get) == "function" ? e(this, E).fields.get() : [];
|
|
803
786
|
return Array.isArray(s) ? s.filter((n) => !n.__ng.deleted).map((n) => {
|
|
804
787
|
const o = {};
|
|
805
|
-
return t.forEach((r,
|
|
806
|
-
o[r] = n.v ? n.v[
|
|
788
|
+
return t.forEach((r, c) => {
|
|
789
|
+
o[r] = n.v ? n.v[c] : n[r];
|
|
807
790
|
}), o.__ng = n.__ng, o;
|
|
808
791
|
}) : s;
|
|
809
792
|
}, "#conv2"));
|
|
@@ -812,28 +795,28 @@ const T = class T {
|
|
|
812
795
|
var o;
|
|
813
796
|
const i = this.getValidData();
|
|
814
797
|
if (!i || i.length <= 0) return;
|
|
815
|
-
if (s == null) return e(this,
|
|
798
|
+
if (s == null) return e(this, V).call(this, i);
|
|
816
799
|
if (s < 0 || s >= i.length) return null;
|
|
817
800
|
const n = typeof ((o = e(this, E).fields) == null ? void 0 : o.get) == "function" ? e(this, E).fields.get() : [];
|
|
818
801
|
if (t != null) {
|
|
819
802
|
const r = n.indexOf(t);
|
|
820
803
|
return r >= 0 ? i[s].v[r] : null;
|
|
821
804
|
}
|
|
822
|
-
return e(this,
|
|
805
|
+
return e(this, V).call(this, i[s]);
|
|
823
806
|
}, "get"));
|
|
824
|
-
y(this, E, s), y(this,
|
|
807
|
+
y(this, E, s), y(this, m, t), e(this, ne).call(this);
|
|
825
808
|
}
|
|
826
809
|
get source() {
|
|
827
|
-
return e(this,
|
|
810
|
+
return e(this, V).call(this, e(this, m).rawRecords);
|
|
828
811
|
}
|
|
829
812
|
set source(s) {
|
|
830
813
|
this.clear(), this.add(s, !1);
|
|
831
814
|
}
|
|
832
815
|
get nextId() {
|
|
833
|
-
return
|
|
816
|
+
return ++_e(this, ie)._;
|
|
834
817
|
}
|
|
835
818
|
};
|
|
836
|
-
E = new WeakMap(),
|
|
819
|
+
E = new WeakMap(), m = new WeakMap(), q = new WeakMap(), X = new WeakMap(), ie = new WeakMap(), H = new WeakMap(), ne = new WeakMap(), K = new WeakMap(), re = new WeakMap(), oe = new WeakMap(), V = new WeakMap(), a(T, "ngData"), // π― ν μν μ μ μμλ₯Ό ν΄λμ€ λ΄λΆλ‘ λ΄μ¬ν
|
|
837
820
|
v(T, "ROW_STATE", {
|
|
838
821
|
EMPTY: "EMPTY",
|
|
839
822
|
NORMAL: "NORMAL",
|
|
@@ -841,10 +824,10 @@ v(T, "ROW_STATE", {
|
|
|
841
824
|
UPDATE: "UPDATE",
|
|
842
825
|
DELETE: "DELETE"
|
|
843
826
|
});
|
|
844
|
-
let
|
|
845
|
-
const
|
|
827
|
+
let pe = T;
|
|
828
|
+
const Te = class Te {
|
|
846
829
|
constructor(s) {
|
|
847
|
-
this.owner = s, this.row = new
|
|
830
|
+
this.owner = s, this.row = new ge(this), this.data = new pe(s, this), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.pageCnt = 25, this.viewRecords.reset = () => {
|
|
848
831
|
var t;
|
|
849
832
|
(t = this.owner.view) != null && t.redraw && this.owner.view.redraw();
|
|
850
833
|
}, this.setDataSource = (t) => {
|
|
@@ -861,22 +844,22 @@ const Ce = class Ce {
|
|
|
861
844
|
}, this.setDataSource([]);
|
|
862
845
|
}
|
|
863
846
|
};
|
|
864
|
-
a(
|
|
865
|
-
let
|
|
866
|
-
var P,
|
|
867
|
-
const
|
|
847
|
+
a(Te, "ngDataManager");
|
|
848
|
+
let ye = Te;
|
|
849
|
+
var P, le;
|
|
850
|
+
const qe = class qe extends HTMLElement {
|
|
868
851
|
constructor() {
|
|
869
852
|
super();
|
|
870
853
|
//#created = false;
|
|
871
854
|
f(this, P);
|
|
872
|
-
f(this,
|
|
873
|
-
this.attachShadow({ mode: "open" }), y(this, P, new
|
|
855
|
+
f(this, le);
|
|
856
|
+
this.attachShadow({ mode: "open" }), y(this, P, new ye(this));
|
|
874
857
|
}
|
|
875
858
|
connectedCallback() {
|
|
876
|
-
y(this,
|
|
859
|
+
y(this, le, new be(this.shadowRoot)), Y.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
|
|
877
860
|
}
|
|
878
861
|
disconnectedCallback() {
|
|
879
|
-
|
|
862
|
+
Y.log("NineTable disconnected.");
|
|
880
863
|
}
|
|
881
864
|
// π― μΈλΆμμ grid.data.set(...) ννλ‘ μ κ·Όν μ μλλ‘ λ°μ΄ν° λ§€λμ μ€ν
|
|
882
865
|
get data() {
|
|
@@ -891,7 +874,7 @@ const ke = class ke extends HTMLElement {
|
|
|
891
874
|
return e(this, P);
|
|
892
875
|
}
|
|
893
876
|
};
|
|
894
|
-
P = new WeakMap(),
|
|
895
|
-
let
|
|
896
|
-
customElements.get("nine-table") || customElements.define("nine-table",
|
|
877
|
+
P = new WeakMap(), le = new WeakMap(), a(qe, "NineTable");
|
|
878
|
+
let we = qe;
|
|
879
|
+
customElements.get("nine-table") || customElements.define("nine-table", we);
|
|
897
880
|
//# sourceMappingURL=nine-table.js.map
|