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