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