@ninebone/table 0.0.185 β 0.0.186
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 +244 -242
- package/dist/nine-table.js.map +1 -1
- package/dist/nine-table.umd.js +6 -6
- 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
|
|
1
|
+
var Ie = Object.defineProperty;
|
|
2
|
+
var He = (w) => {
|
|
3
3
|
throw TypeError(w);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var l = (w, i) =>
|
|
7
|
-
var m = (w, i, t) =>
|
|
8
|
-
var e = (w, i, t) => (
|
|
9
|
-
var
|
|
5
|
+
var We = (w, i, t) => i in w ? Ie(w, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : w[i] = t;
|
|
6
|
+
var l = (w, i) => Ie(w, "name", { value: i, configurable: !0 });
|
|
7
|
+
var m = (w, i, t) => We(w, typeof i != "symbol" ? i + "" : i, t), $e = (w, i, t) => i.has(w) || He("Cannot " + t);
|
|
8
|
+
var e = (w, i, t) => ($e(w, i, "read from private field"), t ? t.call(w) : i.get(w)), u = (w, i, t) => i.has(w) ? He("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(w) : i.set(w, t), g = (w, i, t, s) => ($e(w, i, "write to private field"), s ? s.call(w, t) : i.set(w, t), t);
|
|
9
|
+
var ze = (w, i, t, s) => ({
|
|
10
10
|
set _(n) {
|
|
11
|
-
|
|
11
|
+
g(w, i, n, t);
|
|
12
12
|
},
|
|
13
13
|
get _() {
|
|
14
14
|
return e(w, i, s);
|
|
15
15
|
}
|
|
16
16
|
});
|
|
17
|
-
import { trace as
|
|
18
|
-
const
|
|
17
|
+
import { trace as Oe } from "@ninebone/util";
|
|
18
|
+
const Te = class Te extends Oe.constructor {
|
|
19
19
|
constructor() {
|
|
20
20
|
super(), this.init("nine-table", "green");
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
|
-
l(
|
|
24
|
-
let
|
|
25
|
-
const
|
|
26
|
-
var
|
|
27
|
-
const
|
|
23
|
+
l(Te, "Trace");
|
|
24
|
+
let pe = Te;
|
|
25
|
+
const G = new pe();
|
|
26
|
+
var L, O, y, B, D, N, ie, P, se;
|
|
27
|
+
const qe = class qe extends HTMLElement {
|
|
28
28
|
constructor() {
|
|
29
29
|
super();
|
|
30
|
-
u(this,
|
|
31
|
-
u(this,
|
|
30
|
+
u(this, L);
|
|
31
|
+
u(this, O, !1);
|
|
32
32
|
u(this, y);
|
|
33
|
+
u(this, B);
|
|
33
34
|
u(this, D);
|
|
34
35
|
u(this, N);
|
|
35
|
-
u(this, P);
|
|
36
36
|
u(this, ie, /* @__PURE__ */ l(() => {
|
|
37
|
-
if (!e(this,
|
|
38
|
-
const t = e(this,
|
|
39
|
-
t && (
|
|
37
|
+
if (!e(this, L)) return;
|
|
38
|
+
const t = e(this, L).querySelector(".ng-container-body");
|
|
39
|
+
t && (g(this, N, new ResizeObserver(() => {
|
|
40
40
|
this.refresh();
|
|
41
|
-
})), e(this,
|
|
41
|
+
})), e(this, N).observe(t));
|
|
42
42
|
}, "#observeResize"));
|
|
43
43
|
m(this, "refresh", /* @__PURE__ */ l(() => {
|
|
44
|
-
if (!e(this,
|
|
44
|
+
if (!e(this, L) || !e(this, y) || e(this, O)) return;
|
|
45
45
|
const t = e(this, y).container, s = t.querySelector("table");
|
|
46
46
|
if (!s) return;
|
|
47
|
-
const n = e(this, y).track, r = e(this, y).thumb, o = e(this,
|
|
48
|
-
if (h !== 0 &&
|
|
47
|
+
const n = e(this, y).track, r = e(this, y).thumb, o = e(this, L).querySelector(".ng-container-bottom"), h = t.clientWidth, p = s.scrollWidth;
|
|
48
|
+
if (h !== 0 && p > h)
|
|
49
49
|
o && (o.style.display = "flex");
|
|
50
50
|
else {
|
|
51
51
|
o && (o.style.display = "none");
|
|
52
52
|
return;
|
|
53
53
|
}
|
|
54
|
-
const
|
|
55
|
-
if (
|
|
56
|
-
const d = Math.max(Math.min(
|
|
54
|
+
const c = n.clientWidth;
|
|
55
|
+
if (c <= 0) return;
|
|
56
|
+
const d = Math.max(Math.min(c * (h / p), c), 20);
|
|
57
57
|
r.style.width = `${d}px`;
|
|
58
|
-
let
|
|
58
|
+
let a = 0;
|
|
59
59
|
const b = s.style.transform;
|
|
60
60
|
if (b && b.includes("translateX")) {
|
|
61
61
|
const x = b.match(/translateX\(([-\d.]+)px\)/);
|
|
62
|
-
x && x[1] && (
|
|
62
|
+
x && x[1] && (a = parseFloat(x[1]));
|
|
63
63
|
} else
|
|
64
|
-
|
|
65
|
-
let f = parseInt(Math.abs(
|
|
64
|
+
a = parseInt(s.style.left || 0, 10);
|
|
65
|
+
let f = parseInt(Math.abs(a) * c / p, 10);
|
|
66
66
|
f < 0 && (f = 0);
|
|
67
|
-
const S =
|
|
67
|
+
const S = c - d;
|
|
68
68
|
f > S && (f = S), r.style.left = `${f}px`, e(this, y).left.disabled = f === 0, e(this, y).right.disabled = f >= S - 1;
|
|
69
69
|
}, "refresh"));
|
|
70
|
-
u(this,
|
|
70
|
+
u(this, P, /* @__PURE__ */ l((t) => {
|
|
71
71
|
if (!e(this, y)) return !1;
|
|
72
72
|
const s = e(this, y).container, n = s.querySelector("table");
|
|
73
73
|
if (!n) return !1;
|
|
74
74
|
const r = e(this, y).track.getBoundingClientRect(), o = e(this, y).thumb.clientWidth;
|
|
75
75
|
let h = t;
|
|
76
76
|
h < 0 && (h = 0);
|
|
77
|
-
const
|
|
78
|
-
h >
|
|
79
|
-
const
|
|
80
|
-
let
|
|
81
|
-
return -
|
|
77
|
+
const p = r.width - o;
|
|
78
|
+
h > p && (h = p), h = parseInt(h, 10), e(this, y).thumb.style.left = `${h}px`, e(this, y).left.disabled = h === 0, e(this, y).right.disabled = h >= p - 1;
|
|
79
|
+
const c = s.clientWidth, d = n.scrollWidth;
|
|
80
|
+
let a = p > 0 ? -h * (d - c) / p : 0;
|
|
81
|
+
return -a > d - c && (a = -(d - c)), -a + 5 > d - c && (a = -(d - c)), c >= d && (a = 0), n.style.transform = `translateX(${a}px)`, h > 0 && h < p - 1;
|
|
82
82
|
}, "#thumbMoveTo"));
|
|
83
83
|
u(this, se, /* @__PURE__ */ l(() => {
|
|
84
84
|
const t = /* @__PURE__ */ l((n) => {
|
|
85
|
-
clearInterval(e(this,
|
|
85
|
+
clearInterval(e(this, B)), clearInterval(e(this, D));
|
|
86
86
|
const r = parseInt(e(this, y).thumb.style.left || 0, 10);
|
|
87
|
-
e(this,
|
|
88
|
-
clearInterval(e(this,
|
|
87
|
+
e(this, P).call(this, r + n), g(this, B, setInterval(() => {
|
|
88
|
+
clearInterval(e(this, B)), g(this, D, setInterval(() => {
|
|
89
89
|
const o = parseInt(e(this, y).thumb.style.left || 0, 10);
|
|
90
|
-
e(this,
|
|
90
|
+
e(this, P).call(this, o + n) || clearInterval(e(this, D));
|
|
91
91
|
}, 50));
|
|
92
92
|
}, 500));
|
|
93
93
|
}, "delayScroll"), s = /* @__PURE__ */ l(() => {
|
|
94
|
-
clearInterval(e(this,
|
|
94
|
+
clearInterval(e(this, B)), clearInterval(e(this, D));
|
|
95
95
|
}, "clearTimer");
|
|
96
96
|
["mouseup", "mouseleave", "touchend"].forEach((n) => {
|
|
97
97
|
e(this, y).left.addEventListener(n, s), e(this, y).right.addEventListener(n, s), e(this, y).track.addEventListener(n, s);
|
|
@@ -103,23 +103,23 @@ const Te = class Te extends HTMLElement {
|
|
|
103
103
|
if (n.button !== 0) return;
|
|
104
104
|
n.preventDefault();
|
|
105
105
|
const r = e(this, y).track.getBoundingClientRect(), o = e(this, y).thumb.clientWidth;
|
|
106
|
-
e(this,
|
|
106
|
+
e(this, P).call(this, n.clientX - r.left - o / 2);
|
|
107
107
|
}), e(this, y).thumb.addEventListener("mousedown", (n) => {
|
|
108
108
|
if (n.button !== 0) return;
|
|
109
|
-
n.stopPropagation(), n.preventDefault(),
|
|
109
|
+
n.stopPropagation(), n.preventDefault(), g(this, O, !0), this.shiftX = n.clientX - e(this, y).thumb.getBoundingClientRect().left;
|
|
110
110
|
const r = /* @__PURE__ */ l((h) => {
|
|
111
|
-
if (!e(this,
|
|
112
|
-
const
|
|
113
|
-
e(this,
|
|
111
|
+
if (!e(this, O)) return;
|
|
112
|
+
const p = e(this, y).track.getBoundingClientRect();
|
|
113
|
+
e(this, P).call(this, h.clientX - p.left - this.shiftX);
|
|
114
114
|
}, "onMouseMove"), o = /* @__PURE__ */ l(() => {
|
|
115
|
-
|
|
115
|
+
g(this, O, !1), s(), document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", o), this.refresh();
|
|
116
116
|
}, "onMouseUp");
|
|
117
117
|
document.addEventListener("mousemove", r), document.addEventListener("mouseup", o);
|
|
118
118
|
});
|
|
119
119
|
}, "#init"));
|
|
120
120
|
}
|
|
121
121
|
connectedCallback() {
|
|
122
|
-
if (
|
|
122
|
+
if (g(this, L, this.closest("nine-table-sheet") || this.getRootNode().host), !e(this, L)) return;
|
|
123
123
|
this.innerHTML = `
|
|
124
124
|
<style>
|
|
125
125
|
nine-table-hscrollbar {
|
|
@@ -184,12 +184,12 @@ const Te = class Te extends HTMLElement {
|
|
|
184
184
|
<button class='ng-scroll-right' disabled><div class='ng-scroll-icon'></div></button>
|
|
185
185
|
`;
|
|
186
186
|
const t = /* @__PURE__ */ l(() => {
|
|
187
|
-
const s = e(this,
|
|
187
|
+
const s = e(this, L).querySelector(".ng-container-body");
|
|
188
188
|
if (!s) {
|
|
189
189
|
setTimeout(t, 10);
|
|
190
190
|
return;
|
|
191
191
|
}
|
|
192
|
-
|
|
192
|
+
g(this, y, {
|
|
193
193
|
container: s,
|
|
194
194
|
track: this.querySelector(".ng-scroll-track"),
|
|
195
195
|
thumb: this.querySelector(".ng-scroll-thumb"),
|
|
@@ -200,21 +200,21 @@ const Te = class Te 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
|
-
|
|
207
|
-
let
|
|
208
|
-
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar",
|
|
209
|
-
var
|
|
210
|
-
const
|
|
206
|
+
L = new WeakMap(), O = new WeakMap(), y = new WeakMap(), B = new WeakMap(), D = new WeakMap(), N = new WeakMap(), ie = new WeakMap(), P = new WeakMap(), se = new WeakMap(), l(qe, "NineTableHScrollBar");
|
|
207
|
+
let ye = qe;
|
|
208
|
+
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", ye);
|
|
209
|
+
var V, _, R, $, M, I, ne, re;
|
|
210
|
+
const Ae = class Ae {
|
|
211
211
|
constructor(i) {
|
|
212
|
-
u(this,
|
|
213
|
-
u(this,
|
|
212
|
+
u(this, V);
|
|
213
|
+
u(this, _, []);
|
|
214
214
|
u(this, R, null);
|
|
215
|
-
u(this,
|
|
215
|
+
u(this, $, null);
|
|
216
216
|
u(this, M, 0);
|
|
217
|
-
u(this,
|
|
217
|
+
u(this, I, 0);
|
|
218
218
|
m(this, "getRowHeight", /* @__PURE__ */ l(() => e(this, R), "getRowHeight"));
|
|
219
219
|
u(this, ne, /* @__PURE__ */ l(() => {
|
|
220
220
|
e(this, re).call(this);
|
|
@@ -223,7 +223,7 @@ const qe = class qe {
|
|
|
223
223
|
* π― λ·°ν¬νΈ ν¬κΈ° λ³ν μμ μ λμ΄ κ³μ° λ° νμν ν κ°μ μ°μ Β·μΊμ±μ μκ²°
|
|
224
224
|
*/
|
|
225
225
|
u(this, re, /* @__PURE__ */ l(() => {
|
|
226
|
-
!e(this,
|
|
226
|
+
!e(this, V) || !(e(this, V) instanceof HTMLElement) || (g(this, $, new ResizeObserver((i) => {
|
|
227
227
|
for (const t of i) {
|
|
228
228
|
const s = t.target;
|
|
229
229
|
if (!s.classList.contains("active"))
|
|
@@ -232,50 +232,50 @@ const qe = class qe {
|
|
|
232
232
|
if (n > 0) {
|
|
233
233
|
const r = s.clientHeight || s.getBoundingClientRect().height || n;
|
|
234
234
|
let o = 0;
|
|
235
|
-
const h = s.querySelector(".ng-container-body") || s,
|
|
236
|
-
|
|
235
|
+
const h = s.querySelector(".ng-container-body") || s, p = h.querySelector("thead"), c = h.querySelector("tfoot");
|
|
236
|
+
p && (o += p.offsetHeight || p.getBoundingClientRect().height), c && (o += c.offsetHeight || c.getBoundingClientRect().height);
|
|
237
237
|
const d = Math.max(r - o, 100);
|
|
238
|
-
if (e(this, M) !== d && (
|
|
239
|
-
const
|
|
240
|
-
|
|
238
|
+
if (e(this, M) !== d && (g(this, M, d), e(this, R) !== null)) {
|
|
239
|
+
const a = Math.ceil(e(this, M) / e(this, R));
|
|
240
|
+
g(this, I, a + 20), G.log(`[RowManager] Resized. Height: ${e(this, M)}px | Target Rows: ${e(this, I)}`), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((b) => {
|
|
241
241
|
const f = s.querySelector(b);
|
|
242
242
|
f && f.querySelector("tbody") && this.renderRows(f);
|
|
243
243
|
});
|
|
244
244
|
}
|
|
245
245
|
}
|
|
246
246
|
}
|
|
247
|
-
})), e(this,
|
|
247
|
+
})), e(this, $).observe(e(this, V)));
|
|
248
248
|
}, "#initResizeObserver"));
|
|
249
249
|
m(this, "initTemplate", /* @__PURE__ */ l((i) => {
|
|
250
250
|
const t = i.querySelector("tbody.bindable") || i.querySelector("tbody");
|
|
251
251
|
if (!t) return;
|
|
252
252
|
const s = Array.from(t.querySelectorAll("tr")).filter((n) => !n.classList.contains("nodata"));
|
|
253
|
-
|
|
253
|
+
g(this, _, s.map((n) => n.cloneNode(!0))), g(this, R, null), console.log(`[RowManager] Template initialized with ${e(this, _).length} row(s).`);
|
|
254
254
|
}, "initTemplate"));
|
|
255
255
|
m(this, "measureAndCacheHeight", /* @__PURE__ */ l((i) => {
|
|
256
256
|
if (e(this, R) !== null && e(this, R) > 0)
|
|
257
257
|
return e(this, R);
|
|
258
|
-
if (e(this,
|
|
258
|
+
if (e(this, _).length === 0)
|
|
259
259
|
throw new Error("[RowManager] Template TRs are empty.");
|
|
260
260
|
const t = i.querySelector("tbody.bindable") || i.querySelector("tbody");
|
|
261
261
|
if (!t) return 24;
|
|
262
|
-
t.querySelectorAll("tr:not(.nodata)").forEach((
|
|
262
|
+
t.querySelectorAll("tr:not(.nodata)").forEach((a) => a.remove());
|
|
263
263
|
const s = t.querySelector("tr.nodata"), n = document.createDocumentFragment();
|
|
264
|
-
e(this,
|
|
265
|
-
n.appendChild(
|
|
264
|
+
e(this, _).forEach((a) => {
|
|
265
|
+
n.appendChild(a.cloneNode(!0));
|
|
266
266
|
}), s ? s.before(n) : t.appendChild(n);
|
|
267
|
-
const r = i.closest("nine-table-sheet"), o = r ? r.style.display : "", h = r ? r.style.visibility : "",
|
|
267
|
+
const r = i.closest("nine-table-sheet"), o = r ? r.style.display : "", h = r ? r.style.visibility : "", p = r ? r.style.position : "";
|
|
268
268
|
r && (r.style.display === "none" || window.getComputedStyle(r).display === "none") && (r.style.display = "block", r.style.visibility = "hidden", r.style.position = "absolute");
|
|
269
|
-
let
|
|
270
|
-
if (t.querySelectorAll("tr:not(.nodata)").forEach((
|
|
271
|
-
const f =
|
|
272
|
-
f === 0 ?
|
|
273
|
-
}), r && (r.style.display = o, r.style.visibility = h, r.style.position =
|
|
274
|
-
const
|
|
275
|
-
|
|
269
|
+
let c = 0;
|
|
270
|
+
if (t.querySelectorAll("tr:not(.nodata)").forEach((a, b) => {
|
|
271
|
+
const f = a.offsetHeight || a.getBoundingClientRect().height;
|
|
272
|
+
f === 0 ? c += 40 : c += f;
|
|
273
|
+
}), r && (r.style.display = o, r.style.visibility = h, r.style.position = p), g(this, R, c), e(this, M) > 0) {
|
|
274
|
+
const a = Math.ceil(e(this, M) / e(this, R));
|
|
275
|
+
g(this, I, a + 20);
|
|
276
276
|
} else
|
|
277
|
-
|
|
278
|
-
return console.log(`[RowManager] Template Height Cached: ${e(this, R)}px | RowCount: ${e(this,
|
|
277
|
+
g(this, I, 40);
|
|
278
|
+
return console.log(`[RowManager] Template Height Cached: ${e(this, R)}px | RowCount: ${e(this, I)}`), e(this, R);
|
|
279
279
|
}, "measureAndCacheHeight"));
|
|
280
280
|
/**
|
|
281
281
|
* π― μΊμλ ν κ°μ λ°ν (μμ λλ§ μ΅μνμ λ°©μ΄ μ°μ°)
|
|
@@ -294,103 +294,103 @@ const qe = class qe {
|
|
|
294
294
|
* π― μΊμλ ν κ°μλ₯Ό κ³§λ°λ‘ κ°μ Έμμ TR λΌλ μ£Όμ
(μ€λ³΅ κ³μ° μ κ±°)
|
|
295
295
|
*/
|
|
296
296
|
m(this, "renderRows", /* @__PURE__ */ l((i) => {
|
|
297
|
-
if (e(this,
|
|
297
|
+
if (e(this, _).length === 0) return;
|
|
298
298
|
const t = i.querySelector("tbody.bindable") || i.querySelector("tbody");
|
|
299
299
|
if (!t) return;
|
|
300
300
|
t.querySelectorAll("tr:not(.nodata)").forEach((o) => o.remove());
|
|
301
|
-
const s = t.querySelector("tr.nodata"), n = document.createDocumentFragment(), r = e(this,
|
|
301
|
+
const s = t.querySelector("tr.nodata"), n = document.createDocumentFragment(), r = e(this, I);
|
|
302
302
|
for (let o = 0; o < r; o++)
|
|
303
|
-
e(this,
|
|
303
|
+
e(this, _).forEach((h) => {
|
|
304
304
|
n.appendChild(h.cloneNode(!0));
|
|
305
305
|
});
|
|
306
306
|
s ? s.before(n) : t.appendChild(n), console.log(`[RowManager] Rendered ${r} sets into DOM.`);
|
|
307
307
|
}, "renderRows"));
|
|
308
308
|
m(this, "destroy", /* @__PURE__ */ l(() => {
|
|
309
|
-
e(this,
|
|
309
|
+
e(this, $) && (e(this, $).disconnect(), g(this, $, null));
|
|
310
310
|
}, "destroy"));
|
|
311
|
-
|
|
311
|
+
g(this, V, i), e(this, ne).call(this);
|
|
312
312
|
}
|
|
313
313
|
get templateLength() {
|
|
314
|
-
return e(this,
|
|
314
|
+
return e(this, _).length || 1;
|
|
315
315
|
}
|
|
316
316
|
};
|
|
317
|
-
|
|
318
|
-
let
|
|
319
|
-
var
|
|
320
|
-
const
|
|
317
|
+
V = new WeakMap(), _ = new WeakMap(), R = new WeakMap(), $ = new WeakMap(), M = new WeakMap(), I = new WeakMap(), ne = new WeakMap(), re = new WeakMap(), l(Ae, "RowManager");
|
|
318
|
+
let we = Ae;
|
|
319
|
+
var C, X, oe;
|
|
320
|
+
const j = class j extends HTMLElement {
|
|
321
321
|
constructor() {
|
|
322
322
|
super();
|
|
323
|
-
u(this,
|
|
324
|
-
u(this,
|
|
323
|
+
u(this, C, null);
|
|
324
|
+
u(this, X);
|
|
325
325
|
m(this, "init", /* @__PURE__ */ l((t) => {
|
|
326
326
|
if (!t) return;
|
|
327
|
-
const s = /* @__PURE__ */ l((
|
|
327
|
+
const s = /* @__PURE__ */ l((c) => {
|
|
328
328
|
const d = /* @__PURE__ */ l((b) => {
|
|
329
329
|
if (b.querySelector("colgroup")) return;
|
|
330
|
-
const f = b.querySelector("tbody tr") || b.querySelector("tr"), S = f ? f.querySelectorAll("th, td").length : 1, x = document.createElement("colgroup"),
|
|
330
|
+
const f = b.querySelector("tbody tr") || b.querySelector("tr"), S = f ? f.querySelectorAll("th, td").length : 1, x = document.createElement("colgroup"), H = Math.max(Math.floor((b.clientWidth || 600) / S), 100);
|
|
331
331
|
for (let q = 0; q < S; q++) {
|
|
332
|
-
const
|
|
333
|
-
|
|
332
|
+
const U = document.createElement("col");
|
|
333
|
+
U.setAttribute("width", H), x.appendChild(U);
|
|
334
334
|
}
|
|
335
335
|
b.prepend(x);
|
|
336
|
-
}, "ensureColgroup"),
|
|
336
|
+
}, "ensureColgroup"), a = /* @__PURE__ */ l((b) => {
|
|
337
337
|
if (b.querySelector("thead")) return;
|
|
338
338
|
const f = document.createElement("thead"), S = b.querySelector("colgroup");
|
|
339
339
|
S ? S.after(f) : b.prepend(f);
|
|
340
340
|
}, "ensureThead");
|
|
341
|
-
return d(
|
|
341
|
+
return d(c), a(c), c.classList.add("nine-table-element"), c;
|
|
342
342
|
}, "initializeTable"), n = t.cloneNode(!0);
|
|
343
|
-
|
|
344
|
-
const r = this.querySelector(".ng-container-left"), o = this.querySelector(".ng-container-body"), h = this.querySelector(".ng-container-right"),
|
|
345
|
-
const b =
|
|
346
|
-
return f.forEach((x,
|
|
343
|
+
g(this, C, s(n)), e(this, C).style.display = "table", e(this, X).initTemplate(e(this, C));
|
|
344
|
+
const r = this.querySelector(".ng-container-left"), o = this.querySelector(".ng-container-body"), h = this.querySelector(".ng-container-right"), p = /* @__PURE__ */ l((c, d, a = !1) => {
|
|
345
|
+
const b = c.cloneNode(!0), f = Array.from(b.querySelectorAll("colgroup col")), S = [];
|
|
346
|
+
return f.forEach((x, H) => {
|
|
347
347
|
const q = x.getAttribute("fixed");
|
|
348
|
-
(
|
|
348
|
+
(a ? q !== "left" && q !== "right" : q === d) || S.push(H);
|
|
349
349
|
}), S.reverse().forEach((x) => {
|
|
350
|
-
f[x] && f[x].remove(), b.querySelectorAll("tr").forEach((
|
|
351
|
-
const q =
|
|
350
|
+
f[x] && f[x].remove(), b.querySelectorAll("tr").forEach((H) => {
|
|
351
|
+
const q = H.querySelectorAll("th, td");
|
|
352
352
|
q[x] && q[x].remove();
|
|
353
353
|
});
|
|
354
354
|
}), b;
|
|
355
355
|
}, "filterTableByFixed");
|
|
356
356
|
if (o) {
|
|
357
|
-
const
|
|
358
|
-
o.innerHTML = "", o.appendChild(
|
|
357
|
+
const c = p(e(this, C), null, !0);
|
|
358
|
+
o.innerHTML = "", o.appendChild(c), e(this, X).measureAndCacheHeight(o);
|
|
359
359
|
}
|
|
360
360
|
if (r) {
|
|
361
|
-
const
|
|
361
|
+
const c = p(e(this, C), "left", !1);
|
|
362
362
|
let d = 0;
|
|
363
|
-
|
|
363
|
+
c.querySelectorAll("col").forEach((b) => {
|
|
364
364
|
const f = parseInt(b.getAttribute("width"), 10);
|
|
365
365
|
isNaN(f) || (d += f);
|
|
366
|
-
}), r.innerHTML = "", r.appendChild(
|
|
367
|
-
const
|
|
368
|
-
r.style.flex = `0 0 ${
|
|
366
|
+
}), r.innerHTML = "", r.appendChild(c);
|
|
367
|
+
const a = d > 0 ? d : 0;
|
|
368
|
+
r.style.flex = `0 0 ${a}px`, r.style.width = `${a}px`;
|
|
369
369
|
}
|
|
370
370
|
if (h) {
|
|
371
|
-
const
|
|
371
|
+
const c = p(e(this, C), "right", !1);
|
|
372
372
|
let d = 0;
|
|
373
|
-
|
|
373
|
+
c.querySelectorAll("col").forEach((b) => {
|
|
374
374
|
const f = parseInt(b.getAttribute("width"), 10);
|
|
375
375
|
isNaN(f) || (d += f);
|
|
376
|
-
}), h.innerHTML = "", h.appendChild(
|
|
377
|
-
const
|
|
378
|
-
h.style.flex = `0 0 ${
|
|
376
|
+
}), h.innerHTML = "", h.appendChild(c);
|
|
377
|
+
const a = d > 0 ? d : 0;
|
|
378
|
+
h.style.flex = `0 0 ${a}px`, h.style.width = `${a}px`;
|
|
379
379
|
}
|
|
380
380
|
if (o) {
|
|
381
|
-
const
|
|
382
|
-
o.style.overflowY =
|
|
381
|
+
const c = this.getRowCount();
|
|
382
|
+
o.style.overflowY = c > 10 ? "auto" : "hidden", o.addEventListener("scroll", () => {
|
|
383
383
|
const d = this.querySelector("nine-table-hscrollbar");
|
|
384
384
|
d && typeof d.refresh == "function" && d.refresh();
|
|
385
385
|
});
|
|
386
386
|
}
|
|
387
387
|
setTimeout(() => {
|
|
388
|
-
const
|
|
389
|
-
|
|
390
|
-
}, 0),
|
|
388
|
+
const c = this.querySelector("nine-table-hscrollbar");
|
|
389
|
+
c && typeof c.refresh == "function" && c.refresh();
|
|
390
|
+
}, 0), G.log(`NineTableSheet 3-split initialized with rows: ${this.getRowCount()}`);
|
|
391
391
|
}, "init"));
|
|
392
|
-
m(this, "getRowHeight", /* @__PURE__ */ l(() => e(this,
|
|
393
|
-
m(this, "getRowCount", /* @__PURE__ */ l(() => e(this,
|
|
392
|
+
m(this, "getRowHeight", /* @__PURE__ */ l(() => e(this, X).getRowHeight(), "getRowHeight"));
|
|
393
|
+
m(this, "getRowCount", /* @__PURE__ */ l(() => e(this, C) ? e(this, C).querySelectorAll("tbody tr").length : 0, "getRowCount"));
|
|
394
394
|
m(this, "scrollToX", /* @__PURE__ */ l((t) => {
|
|
395
395
|
const s = this.querySelector(".ng-container-body");
|
|
396
396
|
s && (s.scrollLeft = t);
|
|
@@ -400,7 +400,7 @@ const G = class G extends HTMLElement {
|
|
|
400
400
|
s && (s.scrollTop = t);
|
|
401
401
|
}, "scrollToY"));
|
|
402
402
|
u(this, oe, /* @__PURE__ */ l(() => {
|
|
403
|
-
const t =
|
|
403
|
+
const t = j.SCROLLBAR_SIZE;
|
|
404
404
|
this.innerHTML = `
|
|
405
405
|
<style>
|
|
406
406
|
nine-table-sheet {
|
|
@@ -516,20 +516,20 @@ const G = class G extends HTMLElement {
|
|
|
516
516
|
</div>
|
|
517
517
|
`;
|
|
518
518
|
}, "#render"));
|
|
519
|
-
|
|
519
|
+
g(this, X, new we(this));
|
|
520
520
|
}
|
|
521
521
|
connectedCallback() {
|
|
522
522
|
e(this, oe).call(this);
|
|
523
523
|
}
|
|
524
524
|
disconnectedCallback() {
|
|
525
|
-
this.innerHTML = "",
|
|
525
|
+
this.innerHTML = "", G.log("NineTableSheet destroyed.");
|
|
526
526
|
}
|
|
527
527
|
};
|
|
528
|
-
|
|
529
|
-
let te =
|
|
528
|
+
C = new WeakMap(), X = new WeakMap(), oe = new WeakMap(), l(j, "NineTableSheet"), m(j, "SCROLLBAR_SIZE", 16);
|
|
529
|
+
let te = j;
|
|
530
530
|
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", te);
|
|
531
531
|
var le;
|
|
532
|
-
const
|
|
532
|
+
const ke = class ke extends HTMLElement {
|
|
533
533
|
constructor() {
|
|
534
534
|
super();
|
|
535
535
|
u(this, le, /* @__PURE__ */ l(() => {
|
|
@@ -542,42 +542,42 @@ const Ae = class Ae extends HTMLElement {
|
|
|
542
542
|
}), this.switchSheet(0, !1));
|
|
543
543
|
}, "#init"));
|
|
544
544
|
m(this, "switchSheet", /* @__PURE__ */ l((t, s = !1) => {
|
|
545
|
-
const n = /* @__PURE__ */ l((
|
|
546
|
-
const b = Array.from(
|
|
547
|
-
Array.from(
|
|
545
|
+
const n = /* @__PURE__ */ l((a) => {
|
|
546
|
+
const b = Array.from(a.querySelectorAll("nine-table-sheet"));
|
|
547
|
+
Array.from(a.querySelectorAll("nine-splitter")).forEach((x) => x.style.setProperty("display", "none"));
|
|
548
548
|
const S = b.filter((x) => x.classList.contains("active"));
|
|
549
549
|
S.length < 2 || S.forEach((x) => {
|
|
550
|
-
const
|
|
551
|
-
q &&
|
|
550
|
+
const H = parseInt(x.getAttribute("data-index"), 10), q = a.querySelector(`nine-splitter[data-split-index="${H}"]`), U = b[H + 1];
|
|
551
|
+
q && U && U.classList.contains("active") && q.style.setProperty("display", "block");
|
|
552
552
|
});
|
|
553
|
-
}, "updateSplitters"), r = this.querySelector(".nine-tab-bar"), o = this.querySelector("nine-table-sheets-body"), h = r.querySelectorAll(".nine-tab-item"),
|
|
553
|
+
}, "updateSplitters"), r = this.querySelector(".nine-tab-bar"), o = this.querySelector("nine-table-sheets-body"), h = r.querySelectorAll(".nine-tab-item"), p = o.querySelectorAll("nine-table-sheet");
|
|
554
554
|
if (!h[t]) return;
|
|
555
555
|
if (!s)
|
|
556
|
-
h.forEach((
|
|
557
|
-
|
|
556
|
+
h.forEach((a, b) => {
|
|
557
|
+
a.classList.toggle("active", b === t);
|
|
558
558
|
const f = o.querySelector(`nine-table-sheet[data-index="${b}"]`);
|
|
559
559
|
f && (f.style.flex = "");
|
|
560
|
-
}),
|
|
561
|
-
|
|
560
|
+
}), p.forEach((a, b) => {
|
|
561
|
+
a.classList.toggle("active", b === t);
|
|
562
562
|
});
|
|
563
563
|
else {
|
|
564
|
-
const
|
|
565
|
-
if (
|
|
564
|
+
const a = h[t], b = r.querySelectorAll(".nine-tab-item.active");
|
|
565
|
+
if (a.classList.contains("active") && b.length <= 1)
|
|
566
566
|
return;
|
|
567
|
-
|
|
567
|
+
a.classList.toggle("active");
|
|
568
568
|
const f = o.querySelector(`nine-table-sheet[data-index="${t}"]`);
|
|
569
569
|
f && (f.classList.toggle("active"), f.classList.contains("active") || (f.style.flex = ""));
|
|
570
570
|
}
|
|
571
|
-
const
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
}) :
|
|
575
|
-
|
|
571
|
+
const c = Array.from(o.querySelectorAll("nine-table-sheet.active"));
|
|
572
|
+
c.length > 1 ? c.forEach((a) => {
|
|
573
|
+
a.style.flex = "1 1 0%";
|
|
574
|
+
}) : c.forEach((a) => {
|
|
575
|
+
a.style.flex = "1 1 100%";
|
|
576
576
|
}), n(o);
|
|
577
577
|
const d = o.querySelector("nine-table-sheet.active");
|
|
578
578
|
if (d && typeof d.getRowCount == "function") {
|
|
579
|
-
const
|
|
580
|
-
|
|
579
|
+
const a = this.querySelector("#row-count");
|
|
580
|
+
a && (a.textContent = d.getRowCount().toLocaleString());
|
|
581
581
|
}
|
|
582
582
|
}, "switchSheet"));
|
|
583
583
|
}
|
|
@@ -585,39 +585,41 @@ const Ae = class Ae extends HTMLElement {
|
|
|
585
585
|
e(this, le).call(this);
|
|
586
586
|
}
|
|
587
587
|
};
|
|
588
|
-
le = new WeakMap(), l(
|
|
589
|
-
let
|
|
590
|
-
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets",
|
|
591
|
-
var E, J,
|
|
592
|
-
const
|
|
588
|
+
le = new WeakMap(), l(ke, "NineTableSheets");
|
|
589
|
+
let me = ke;
|
|
590
|
+
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", me);
|
|
591
|
+
var E, ae, J, ce, Q, he;
|
|
592
|
+
const Ce = class Ce {
|
|
593
593
|
constructor(i) {
|
|
594
594
|
u(this, E);
|
|
595
|
+
u(this, ae);
|
|
595
596
|
u(this, J, null);
|
|
596
|
-
u(this,
|
|
597
|
-
const i = e(this, E).host;
|
|
598
|
-
i && (
|
|
597
|
+
u(this, ce, /* @__PURE__ */ l(() => {
|
|
598
|
+
const i = e(this, E).shadowRoot.host;
|
|
599
|
+
i && (g(this, J, new ResizeObserver((t) => {
|
|
599
600
|
for (let s of t)
|
|
600
601
|
i.getAttribute("auto-height") === "true" && e(this, Q).call(this, i);
|
|
601
602
|
})), e(this, J).observe(i));
|
|
602
603
|
}, "#observeResize"));
|
|
603
604
|
u(this, Q, /* @__PURE__ */ l((i) => {
|
|
604
|
-
var
|
|
605
|
-
const t = e(this, E).
|
|
606
|
-
if (
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
b && (b.style.overflowY = s > n ? "auto" : "hidden");
|
|
605
|
+
var a, b;
|
|
606
|
+
const t = Array.from(e(this, E).shadowRoot.querySelectorAll("nine-table-sheet.active"));
|
|
607
|
+
if (t.length === 0) return;
|
|
608
|
+
const s = parseInt(i.getAttribute("max-display-row"), 10) || 10, n = Math.max(...t.map((f) => f.getRowHeight())), r = (a = e(this, E).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : a.getBoundingClientRect().height, o = (b = e(this, E).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : b.getBoundingClientRect().height, h = te.SCROLLBAR_SIZE, p = s * n + r + o + h;
|
|
609
|
+
i.style.height = `${p}px`;
|
|
610
|
+
const c = Math.max(...t.map((f) => f.getRowCount())), d = e(this, E).shadowRoot.querySelector("nine-table-sheets-body");
|
|
611
|
+
if (!d)
|
|
612
|
+
throw new Error("[LayoutManager] sheetsBody element is missing from the DOM.");
|
|
613
|
+
d.style.overflowY = c > s ? "auto" : "hidden";
|
|
614
614
|
}, "#applyAutoHeight"));
|
|
615
|
-
u(this,
|
|
616
|
-
const i = e(this, E).host
|
|
615
|
+
u(this, he, /* @__PURE__ */ l(() => {
|
|
616
|
+
const i = e(this, E).shadowRoot.host;
|
|
617
|
+
console.log(i, e(this, E));
|
|
618
|
+
const s = Array.from(i.children).filter((c) => c.tagName === "TABLE"), n = i.getAttribute("auto-height") === "true", r = s.length, o = s.map((c, d) => {
|
|
617
619
|
const b = `<nine-table-sheet class="${d === 0 ? "active" : ""}" data-index="${d}"></nine-table-sheet>`, f = d < r - 1 ? `<nine-splitter class="h" data-split-index="${d}"></nine-splitter>` : "";
|
|
618
620
|
return b + f;
|
|
619
|
-
}).join(""), h = s.map((
|
|
620
|
-
e(this, E).innerHTML = `
|
|
621
|
+
}).join(""), h = s.map((c, d) => `<div class="nine-tab-item ${d === 0 ? "active" : ""}" data-index="${d}">Sheet ${d + 1}</div>`).join("");
|
|
622
|
+
e(this, E).shadowRoot.innerHTML = `
|
|
621
623
|
<style>
|
|
622
624
|
:host {
|
|
623
625
|
display: flex;
|
|
@@ -724,58 +726,58 @@ const ke = class ke {
|
|
|
724
726
|
</nine-table-body>
|
|
725
727
|
<nine-table-footer></nine-table-footer>
|
|
726
728
|
`;
|
|
727
|
-
const
|
|
728
|
-
|
|
729
|
+
const p = e(this, E).shadowRoot.querySelectorAll("nine-table-sheet");
|
|
730
|
+
p == null || p.forEach((c, d) => {
|
|
729
731
|
s[d] && setTimeout(() => {
|
|
730
|
-
|
|
732
|
+
c.init(s[d]), n && e(this, Q).call(this, i);
|
|
731
733
|
});
|
|
732
734
|
});
|
|
733
735
|
}, "#render"));
|
|
734
|
-
|
|
736
|
+
g(this, E, i), g(this, ae, e(this, E).shadowRoot), e(this, he).call(this), e(this, ce).call(this);
|
|
735
737
|
}
|
|
736
738
|
};
|
|
737
|
-
E = new WeakMap(), J = new WeakMap(),
|
|
738
|
-
let
|
|
739
|
-
var
|
|
740
|
-
const
|
|
739
|
+
E = new WeakMap(), ae = new WeakMap(), J = new WeakMap(), ce = new WeakMap(), Q = new WeakMap(), he = new WeakMap(), l(Ce, "LayoutManager");
|
|
740
|
+
let ve = Ce;
|
|
741
|
+
var z, Y;
|
|
742
|
+
const Le = class Le {
|
|
741
743
|
constructor(i) {
|
|
742
|
-
u(this,
|
|
743
|
-
u(this,
|
|
744
|
-
m(this, "count", /* @__PURE__ */ l(() => e(this,
|
|
745
|
-
|
|
744
|
+
u(this, z);
|
|
745
|
+
u(this, Y, -1);
|
|
746
|
+
m(this, "count", /* @__PURE__ */ l(() => e(this, z).rawRecords.length, "count"));
|
|
747
|
+
g(this, z, i);
|
|
746
748
|
}
|
|
747
749
|
get at() {
|
|
748
|
-
return e(this,
|
|
750
|
+
return e(this, Y);
|
|
749
751
|
}
|
|
750
752
|
set at(i) {
|
|
751
753
|
var s, n;
|
|
752
|
-
|
|
753
|
-
const t = ((n = (s = e(this,
|
|
754
|
-
t && !t.querySelector(`tbody.bindable tr[data-row="${e(this,
|
|
754
|
+
g(this, Y, parseInt(i, 10));
|
|
755
|
+
const t = ((n = (s = e(this, z).owner).querySelector) == null ? void 0 : n.call(s, ".ng-container-body")) || e(this, z).owner.body;
|
|
756
|
+
t && !t.querySelector(`tbody.bindable tr[data-row="${e(this, Y)}"]`) && setTimeout(() => {
|
|
755
757
|
var r, o;
|
|
756
|
-
(o = (r = e(this,
|
|
758
|
+
(o = (r = e(this, z).owner).scrollTo_V1) == null || o.call(r, e(this, Y));
|
|
757
759
|
});
|
|
758
760
|
}
|
|
759
761
|
};
|
|
760
|
-
|
|
761
|
-
let
|
|
762
|
-
var T, v, k,
|
|
762
|
+
z = new WeakMap(), Y = new WeakMap(), l(Le, "ngRow");
|
|
763
|
+
let xe = Le;
|
|
764
|
+
var T, v, k, K, de, W, fe, ee, ue, be, Z;
|
|
763
765
|
const A = class A {
|
|
764
766
|
constructor(i, t) {
|
|
765
767
|
u(this, T);
|
|
766
768
|
u(this, v);
|
|
767
769
|
u(this, k, []);
|
|
768
|
-
u(this,
|
|
769
|
-
u(this,
|
|
770
|
-
u(this,
|
|
771
|
-
u(this,
|
|
772
|
-
|
|
770
|
+
u(this, K, []);
|
|
771
|
+
u(this, de, 0);
|
|
772
|
+
u(this, W, []);
|
|
773
|
+
u(this, fe, /* @__PURE__ */ l(() => {
|
|
774
|
+
g(this, W, []);
|
|
773
775
|
const i = e(this, T).template || [];
|
|
774
776
|
Array.from(i).forEach((t) => {
|
|
775
777
|
var s;
|
|
776
|
-
e(this,
|
|
778
|
+
e(this, W).push(((s = t.getBoundingClientRect) == null ? void 0 : s.call(t).height) || 24);
|
|
777
779
|
}), (e(this, v).rawRecords || []).forEach((t) => {
|
|
778
|
-
t.__ng || (t.__ng = e(this, ee).call(this)), t.__ng.height = e(this,
|
|
780
|
+
t.__ng || (t.__ng = e(this, ee).call(this)), t.__ng.height = e(this, W).slice();
|
|
779
781
|
});
|
|
780
782
|
}, "#initialize"));
|
|
781
783
|
m(this, "set", /* @__PURE__ */ l((i) => {
|
|
@@ -785,19 +787,19 @@ const A = class A {
|
|
|
785
787
|
rowState: A.ROW_STATE.EMPTY,
|
|
786
788
|
deleted: !1,
|
|
787
789
|
filtered: !1,
|
|
788
|
-
height: e(this,
|
|
790
|
+
height: e(this, W).slice(),
|
|
789
791
|
o: {},
|
|
790
792
|
c: {},
|
|
791
|
-
_: [0, 0, 0, 0, A.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, e(this,
|
|
793
|
+
_: [0, 0, 0, 0, A.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, e(this, W).slice(), -1, {}, {}]
|
|
792
794
|
}), "#getDefaultMeta"));
|
|
793
795
|
m(this, "reset", /* @__PURE__ */ l(() => {
|
|
794
|
-
|
|
796
|
+
g(this, k, []), g(this, K, []);
|
|
795
797
|
}, "reset"));
|
|
796
798
|
m(this, "clear", /* @__PURE__ */ l(() => {
|
|
797
799
|
var i;
|
|
798
|
-
e(this, v).rawRecords = [],
|
|
800
|
+
e(this, v).rawRecords = [], g(this, k, []), g(this, K, []), (i = e(this, v).viewRecords) != null && i.reset && e(this, v).viewRecords.reset();
|
|
799
801
|
}, "clear"));
|
|
800
|
-
u(this,
|
|
802
|
+
u(this, ue, /* @__PURE__ */ l((i) => {
|
|
801
803
|
var n;
|
|
802
804
|
Array.isArray(i) || (i = [i]);
|
|
803
805
|
const t = typeof ((n = e(this, T).fields) == null ? void 0 : n.get) == "function" ? e(this, T).fields.get() : Object.keys(i[0] || {}), s = [];
|
|
@@ -808,18 +810,18 @@ const A = class A {
|
|
|
808
810
|
}), s.push(o);
|
|
809
811
|
}), s;
|
|
810
812
|
}, "#json2Array"));
|
|
811
|
-
u(this,
|
|
813
|
+
u(this, be, /* @__PURE__ */ l((i) => (Array.isArray(i) || (i = [i]), i.forEach((t) => {
|
|
812
814
|
t.__ng = e(this, ee).call(this), t.__ng.rowid = this.nextId, t.__ng.rowState = A.ROW_STATE.INSERT, t.__ng._[0] = t.__ng.rowid;
|
|
813
815
|
}), i), "#defaultInsert"));
|
|
814
816
|
m(this, "add", /* @__PURE__ */ l((i, t = !0) => {
|
|
815
817
|
var r;
|
|
816
818
|
i === void 0 && (i = {});
|
|
817
|
-
const s = e(this,
|
|
818
|
-
e(this, v).rawRecords = e(this, v).rawRecords.concat(e(this,
|
|
819
|
+
const s = e(this, ue).call(this, i);
|
|
820
|
+
e(this, v).rawRecords = e(this, v).rawRecords.concat(e(this, be).call(this, s)), this.resetRecords();
|
|
819
821
|
const n = this.count() - 1;
|
|
820
822
|
return t || s.forEach((o, h) => {
|
|
821
|
-
const
|
|
822
|
-
|
|
823
|
+
const p = e(this, v).rawRecords[n - h];
|
|
824
|
+
p && (p.__ng.rowState = A.ROW_STATE.EMPTY);
|
|
823
825
|
}), (r = e(this, v).viewRecords) != null && r.reset && e(this, v).viewRecords.reset(), n;
|
|
824
826
|
}, "add"));
|
|
825
827
|
m(this, "delete", /* @__PURE__ */ l((i) => {
|
|
@@ -835,9 +837,9 @@ const A = class A {
|
|
|
835
837
|
}), this.resetRecords(), (s = e(this, v).viewRecords) != null && s.reset && e(this, v).viewRecords.reset();
|
|
836
838
|
}, "delete"));
|
|
837
839
|
m(this, "setValue", /* @__PURE__ */ l((i, t, s) => {
|
|
838
|
-
var
|
|
840
|
+
var p;
|
|
839
841
|
i = parseInt(i, 10);
|
|
840
|
-
const r = (typeof ((
|
|
842
|
+
const r = (typeof ((p = e(this, T).fields) == null ? void 0 : p.get) == "function" ? e(this, T).fields.get() : []).indexOf(t);
|
|
841
843
|
if (r < 0) return;
|
|
842
844
|
const o = this.getValidData()[i];
|
|
843
845
|
if (!o) return;
|
|
@@ -845,14 +847,14 @@ const A = class A {
|
|
|
845
847
|
h !== s && o.__ng.rowState !== A.ROW_STATE.INSERT && (o.__ng.o.hasOwnProperty(t) || (o.__ng.o[t] = h), o.__ng.rowState = A.ROW_STATE.UPDATE), o.v[r] = s, e(this, v).owner.refreshData && e(this, v).owner.refreshData(i);
|
|
846
848
|
}, "setValue"));
|
|
847
849
|
m(this, "resetRecords", /* @__PURE__ */ l(() => {
|
|
848
|
-
|
|
850
|
+
g(this, K, e(this, v).rawRecords.filter((i) => !i.__ng.deleted)), g(this, k, e(this, v).rawRecords.filter((i) => !i.__ng.deleted && !i.__ng.filtered)), e(this, v).rawRecords.forEach((i, t) => {
|
|
849
851
|
i.__ng.rowidx = t;
|
|
850
852
|
}), e(this, k).forEach((i, t) => {
|
|
851
853
|
i.__ng.i = t;
|
|
852
854
|
});
|
|
853
855
|
}, "resetRecords"));
|
|
854
856
|
m(this, "getValidData", /* @__PURE__ */ l(() => (e(this, k).length === 0 && e(this, v).rawRecords.length > 0 && this.resetRecords(), e(this, k)), "getValidData"));
|
|
855
|
-
u(this,
|
|
857
|
+
u(this, Z, /* @__PURE__ */ l((i) => {
|
|
856
858
|
var s;
|
|
857
859
|
if (!i) return i;
|
|
858
860
|
const t = typeof ((s = e(this, T).fields) == null ? void 0 : s.get) == "function" ? e(this, T).fields.get() : [];
|
|
@@ -868,28 +870,28 @@ const A = class A {
|
|
|
868
870
|
var r;
|
|
869
871
|
const s = this.getValidData();
|
|
870
872
|
if (!s || s.length <= 0) return;
|
|
871
|
-
if (i == null) return e(this,
|
|
873
|
+
if (i == null) return e(this, Z).call(this, s);
|
|
872
874
|
if (i < 0 || i >= s.length) return null;
|
|
873
875
|
const n = typeof ((r = e(this, T).fields) == null ? void 0 : r.get) == "function" ? e(this, T).fields.get() : [];
|
|
874
876
|
if (t != null) {
|
|
875
877
|
const o = n.indexOf(t);
|
|
876
878
|
return o >= 0 ? s[i].v[o] : null;
|
|
877
879
|
}
|
|
878
|
-
return e(this,
|
|
880
|
+
return e(this, Z).call(this, s[i]);
|
|
879
881
|
}, "get"));
|
|
880
|
-
|
|
882
|
+
g(this, T, i), g(this, v, t), e(this, fe).call(this);
|
|
881
883
|
}
|
|
882
884
|
get source() {
|
|
883
|
-
return e(this,
|
|
885
|
+
return e(this, Z).call(this, e(this, v).rawRecords);
|
|
884
886
|
}
|
|
885
887
|
set source(i) {
|
|
886
888
|
this.clear(), this.add(i, !1);
|
|
887
889
|
}
|
|
888
890
|
get nextId() {
|
|
889
|
-
return
|
|
891
|
+
return ++ze(this, de)._;
|
|
890
892
|
}
|
|
891
893
|
};
|
|
892
|
-
T = new WeakMap(), v = new WeakMap(), k = new WeakMap(),
|
|
894
|
+
T = new WeakMap(), v = new WeakMap(), k = new WeakMap(), K = new WeakMap(), de = new WeakMap(), W = new WeakMap(), fe = new WeakMap(), ee = new WeakMap(), ue = new WeakMap(), be = new WeakMap(), Z = new WeakMap(), l(A, "ngData"), // π― ν μν μ μ μμλ₯Ό ν΄λμ€ λ΄λΆλ‘ λ΄μ¬ν
|
|
893
895
|
m(A, "ROW_STATE", {
|
|
894
896
|
EMPTY: "EMPTY",
|
|
895
897
|
NORMAL: "NORMAL",
|
|
@@ -897,10 +899,10 @@ m(A, "ROW_STATE", {
|
|
|
897
899
|
UPDATE: "UPDATE",
|
|
898
900
|
DELETE: "DELETE"
|
|
899
901
|
});
|
|
900
|
-
let
|
|
901
|
-
const
|
|
902
|
+
let Se = A;
|
|
903
|
+
const _e = class _e {
|
|
902
904
|
constructor(i) {
|
|
903
|
-
this.owner = i, this.row = new
|
|
905
|
+
this.owner = i, this.row = new xe(this), this.data = new Se(i, this), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.pageCnt = 25, this.viewRecords.reset = () => {
|
|
904
906
|
var t;
|
|
905
907
|
(t = this.owner.view) != null && t.redraw && this.owner.view.redraw();
|
|
906
908
|
}, this.setDataSource = (t) => {
|
|
@@ -917,37 +919,37 @@ const Le = class Le {
|
|
|
917
919
|
}, this.setDataSource([]);
|
|
918
920
|
}
|
|
919
921
|
};
|
|
920
|
-
l(
|
|
921
|
-
let
|
|
922
|
-
var
|
|
923
|
-
const
|
|
922
|
+
l(_e, "ngDataManager");
|
|
923
|
+
let Re = _e;
|
|
924
|
+
var F, ge;
|
|
925
|
+
const Me = class Me extends HTMLElement {
|
|
924
926
|
constructor() {
|
|
925
927
|
super();
|
|
926
928
|
//#created = false;
|
|
927
|
-
u(this,
|
|
928
|
-
u(this,
|
|
929
|
-
this.attachShadow({ mode: "open" }),
|
|
929
|
+
u(this, F);
|
|
930
|
+
u(this, ge);
|
|
931
|
+
this.attachShadow({ mode: "open" }), g(this, F, new Re(this));
|
|
930
932
|
}
|
|
931
933
|
connectedCallback() {
|
|
932
|
-
|
|
934
|
+
g(this, ge, new ve(this)), G.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
|
|
933
935
|
}
|
|
934
936
|
disconnectedCallback() {
|
|
935
|
-
|
|
937
|
+
G.log("NineTable disconnected.");
|
|
936
938
|
}
|
|
937
939
|
// π― μΈλΆμμ grid.data.set(...) ννλ‘ μ κ·Όν μ μλλ‘ λ°μ΄ν° λ§€λμ μ€ν
|
|
938
940
|
get data() {
|
|
939
|
-
return e(this,
|
|
941
|
+
return e(this, F).data;
|
|
940
942
|
}
|
|
941
943
|
// π― ν(row) κ΄λ ¨ μ μ΄ μ κ·Όμ μ€ν
|
|
942
944
|
get row() {
|
|
943
|
-
return e(this,
|
|
945
|
+
return e(this, F).row;
|
|
944
946
|
}
|
|
945
947
|
// π― μ 체 λ°μ΄ν° λ§€λμ μ κ·Ό νμν κ²½μ°
|
|
946
948
|
get dataManager() {
|
|
947
|
-
return e(this,
|
|
949
|
+
return e(this, F);
|
|
948
950
|
}
|
|
949
951
|
};
|
|
950
|
-
|
|
951
|
-
let
|
|
952
|
-
customElements.get("nine-table") || customElements.define("nine-table",
|
|
952
|
+
F = new WeakMap(), ge = new WeakMap(), l(Me, "NineTable");
|
|
953
|
+
let Ee = Me;
|
|
954
|
+
customElements.get("nine-table") || customElements.define("nine-table", Ee);
|
|
953
955
|
//# sourceMappingURL=nine-table.js.map
|