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