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