@ninebone/table 0.0.343 β 0.0.345
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 +425 -352
- 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,51 +1,51 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var he = Object.defineProperty;
|
|
2
|
+
var de = (m) => {
|
|
3
3
|
throw TypeError(m);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var x = (m, i, e) =>
|
|
8
|
-
var t = (m, i, e) => (
|
|
9
|
-
var
|
|
5
|
+
var be = (m, i, e) => i in m ? he(m, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : m[i] = e;
|
|
6
|
+
var a = (m, i) => he(m, "name", { value: i, configurable: !0 });
|
|
7
|
+
var x = (m, i, e) => be(m, typeof i != "symbol" ? i + "" : i, e), fe = (m, i, e) => i.has(m) || de("Cannot " + e);
|
|
8
|
+
var t = (m, i, e) => (fe(m, i, "read from private field"), e ? e.call(m) : i.get(m)), h = (m, i, e) => i.has(m) ? de("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(m) : i.set(m, e), b = (m, i, e, s) => (fe(m, i, "write to private field"), s ? s.call(m, e) : i.set(m, e), e);
|
|
9
|
+
var ue = (m, i, e, s) => ({
|
|
10
10
|
set _(o) {
|
|
11
|
-
|
|
11
|
+
b(m, i, o, e);
|
|
12
12
|
},
|
|
13
13
|
get _() {
|
|
14
14
|
return t(m, i, s);
|
|
15
15
|
}
|
|
16
16
|
});
|
|
17
|
-
import { trace as
|
|
18
|
-
const
|
|
17
|
+
import { trace as ge } from "@ninebone/util";
|
|
18
|
+
const te = class te extends ge.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
|
+
a(te, "Trace");
|
|
24
|
+
let Pt = te;
|
|
25
|
+
const M = new Pt();
|
|
26
|
+
var _, W, y, N, B, P, mt, Y, xt;
|
|
27
|
+
const ee = class ee extends HTMLElement {
|
|
28
28
|
constructor() {
|
|
29
29
|
super();
|
|
30
|
-
h(this,
|
|
31
|
-
h(this,
|
|
30
|
+
h(this, _);
|
|
31
|
+
h(this, W, !1);
|
|
32
32
|
h(this, y);
|
|
33
|
-
h(this, O);
|
|
34
|
-
h(this, D);
|
|
35
33
|
h(this, N);
|
|
36
|
-
h(this,
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
34
|
+
h(this, B);
|
|
35
|
+
h(this, P);
|
|
36
|
+
h(this, mt, /* @__PURE__ */ a(() => {
|
|
37
|
+
if (!t(this, _)) return;
|
|
38
|
+
const e = t(this, _).querySelector(".ng-container-body");
|
|
39
|
+
e && (b(this, P, new ResizeObserver(() => {
|
|
40
40
|
this.refresh();
|
|
41
|
-
})), t(this,
|
|
41
|
+
})), t(this, P).observe(e));
|
|
42
42
|
}, "#observeResize"));
|
|
43
|
-
x(this, "refresh", /* @__PURE__ */
|
|
44
|
-
if (!t(this,
|
|
43
|
+
x(this, "refresh", /* @__PURE__ */ a(() => {
|
|
44
|
+
if (!t(this, _) || !t(this, y) || t(this, W)) return;
|
|
45
45
|
const e = t(this, y).container, s = e.querySelector("table");
|
|
46
46
|
if (!s) return;
|
|
47
|
-
const o = t(this, y).track, r = t(this, y).thumb, n = t(this,
|
|
48
|
-
if (l !== 0 &&
|
|
47
|
+
const o = t(this, y).track, r = t(this, y).thumb, n = t(this, _).querySelector(".ng-container-bottom"), l = e.clientWidth, c = s.scrollWidth;
|
|
48
|
+
if (l !== 0 && c > l)
|
|
49
49
|
n && (n.style.display = "flex");
|
|
50
50
|
else {
|
|
51
51
|
n && (n.style.display = "none");
|
|
@@ -53,38 +53,38 @@ const jt = class jt extends HTMLElement {
|
|
|
53
53
|
}
|
|
54
54
|
const d = o.clientWidth;
|
|
55
55
|
if (d <= 0) return;
|
|
56
|
-
const f = Math.max(Math.min(d * (l /
|
|
56
|
+
const f = Math.max(Math.min(d * (l / c), d), 20);
|
|
57
57
|
r.style.width = `${f}px`;
|
|
58
|
-
const u = e.scrollLeft,
|
|
58
|
+
const u = e.scrollLeft, g = c - l;
|
|
59
59
|
let p = 0;
|
|
60
|
-
|
|
60
|
+
g > 0 && (p = parseInt(u / g * (d - f), 10)), p < 0 && (p = 0);
|
|
61
61
|
const E = d - f;
|
|
62
|
-
p > E && (p = E), r.style.left = `${p}px`,
|
|
62
|
+
p > E && (p = E), r.style.left = `${p}px`, M.log(p), t(this, y).left.disabled = p === 0, t(this, y).right.disabled = p >= E - 1;
|
|
63
63
|
}, "refresh"));
|
|
64
|
-
h(this,
|
|
64
|
+
h(this, Y, /* @__PURE__ */ a((e) => {
|
|
65
65
|
if (!t(this, y)) return !1;
|
|
66
66
|
const s = t(this, y).container, o = s.querySelector("table");
|
|
67
67
|
if (!o) return !1;
|
|
68
68
|
const r = t(this, y).track.getBoundingClientRect(), n = t(this, y).thumb.clientWidth;
|
|
69
69
|
let l = e;
|
|
70
70
|
l < 0 && (l = 0);
|
|
71
|
-
const
|
|
72
|
-
l >
|
|
71
|
+
const c = r.width - n;
|
|
72
|
+
l > c && (l = c), l = parseInt(l, 10), t(this, y).thumb.style.left = `${l}px`, t(this, y).left.disabled = l === 0, t(this, y).right.disabled = l >= c - 1;
|
|
73
73
|
const d = s.clientWidth, u = o.scrollWidth - d;
|
|
74
|
-
return
|
|
74
|
+
return c > 0 && u > 0 && (s.scrollLeft = l / c * u), l > 0 && l < c - 1;
|
|
75
75
|
}, "#thumbMoveTo"));
|
|
76
|
-
h(this,
|
|
77
|
-
const e = /* @__PURE__ */
|
|
78
|
-
clearInterval(t(this,
|
|
76
|
+
h(this, xt, /* @__PURE__ */ a(() => {
|
|
77
|
+
const e = /* @__PURE__ */ a((o) => {
|
|
78
|
+
clearInterval(t(this, N)), clearInterval(t(this, B));
|
|
79
79
|
const r = parseInt(t(this, y).thumb.style.left || 0, 10);
|
|
80
|
-
t(this,
|
|
81
|
-
clearInterval(t(this,
|
|
80
|
+
t(this, Y).call(this, r + o), b(this, N, setInterval(() => {
|
|
81
|
+
clearInterval(t(this, N)), b(this, B, setInterval(() => {
|
|
82
82
|
const n = parseInt(t(this, y).thumb.style.left || 0, 10);
|
|
83
|
-
t(this,
|
|
83
|
+
t(this, Y).call(this, n + o) || clearInterval(t(this, B));
|
|
84
84
|
}, 50));
|
|
85
85
|
}, 500));
|
|
86
|
-
}, "delayScroll"), s = /* @__PURE__ */
|
|
87
|
-
clearInterval(t(this,
|
|
86
|
+
}, "delayScroll"), s = /* @__PURE__ */ a(() => {
|
|
87
|
+
clearInterval(t(this, N)), clearInterval(t(this, B));
|
|
88
88
|
}, "clearTimer");
|
|
89
89
|
["mouseup", "mouseleave", "touchend"].forEach((o) => {
|
|
90
90
|
t(this, y).left.addEventListener(o, s), t(this, y).right.addEventListener(o, s), t(this, y).track.addEventListener(o, s);
|
|
@@ -96,23 +96,23 @@ const jt = class jt extends HTMLElement {
|
|
|
96
96
|
if (o.button !== 0) return;
|
|
97
97
|
o.preventDefault();
|
|
98
98
|
const r = t(this, y).track.getBoundingClientRect(), n = t(this, y).thumb.clientWidth;
|
|
99
|
-
t(this,
|
|
99
|
+
t(this, Y).call(this, o.clientX - r.left - n / 2);
|
|
100
100
|
}), t(this, y).thumb.addEventListener("mousedown", (o) => {
|
|
101
101
|
if (o.button !== 0) return;
|
|
102
|
-
o.stopPropagation(), o.preventDefault(),
|
|
103
|
-
const r = /* @__PURE__ */
|
|
104
|
-
if (!t(this,
|
|
105
|
-
const
|
|
106
|
-
t(this,
|
|
107
|
-
}, "onMouseMove"), n = /* @__PURE__ */
|
|
108
|
-
|
|
102
|
+
o.stopPropagation(), o.preventDefault(), b(this, W, !0), this.shiftX = o.clientX - t(this, y).thumb.getBoundingClientRect().left;
|
|
103
|
+
const r = /* @__PURE__ */ a((l) => {
|
|
104
|
+
if (!t(this, W)) return;
|
|
105
|
+
const c = t(this, y).track.getBoundingClientRect();
|
|
106
|
+
t(this, Y).call(this, l.clientX - c.left - this.shiftX);
|
|
107
|
+
}, "onMouseMove"), n = /* @__PURE__ */ a(() => {
|
|
108
|
+
b(this, W, !1), s(), document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", n), this.refresh();
|
|
109
109
|
}, "onMouseUp");
|
|
110
110
|
document.addEventListener("mousemove", r), document.addEventListener("mouseup", n);
|
|
111
111
|
});
|
|
112
112
|
}, "#init"));
|
|
113
113
|
}
|
|
114
114
|
connectedCallback() {
|
|
115
|
-
if (
|
|
115
|
+
if (b(this, _, this.closest("nine-table-sheet") || this.getRootNode().host), !t(this, _)) return;
|
|
116
116
|
this.innerHTML = `
|
|
117
117
|
<style>
|
|
118
118
|
nine-table-hscrollbar {
|
|
@@ -176,45 +176,45 @@ const jt = class jt extends HTMLElement {
|
|
|
176
176
|
<div class='ng-scroll-track'><div class='ng-scroll-thumb'></div></div>
|
|
177
177
|
<button class='ng-scroll-right' disabled><div class='ng-scroll-icon'></div></button>
|
|
178
178
|
`;
|
|
179
|
-
const e = /* @__PURE__ */
|
|
180
|
-
const s = t(this,
|
|
179
|
+
const e = /* @__PURE__ */ a(() => {
|
|
180
|
+
const s = t(this, _).querySelector(".ng-container-body");
|
|
181
181
|
if (!s) {
|
|
182
182
|
setTimeout(e, 10);
|
|
183
183
|
return;
|
|
184
184
|
}
|
|
185
|
-
|
|
185
|
+
b(this, y, {
|
|
186
186
|
container: s,
|
|
187
187
|
track: this.querySelector(".ng-scroll-track"),
|
|
188
188
|
thumb: this.querySelector(".ng-scroll-thumb"),
|
|
189
189
|
left: this.querySelector(".ng-scroll-left"),
|
|
190
190
|
right: this.querySelector(".ng-scroll-right")
|
|
191
191
|
}), s.addEventListener("scroll", () => {
|
|
192
|
-
t(this,
|
|
193
|
-
}), t(this,
|
|
192
|
+
t(this, W) || this.refresh();
|
|
193
|
+
}), t(this, xt).call(this), t(this, mt).call(this), this.refresh();
|
|
194
194
|
}, "initWhenReady");
|
|
195
195
|
e();
|
|
196
196
|
}
|
|
197
197
|
disconnectedCallback() {
|
|
198
|
-
t(this,
|
|
198
|
+
t(this, P) && t(this, P).disconnect();
|
|
199
199
|
}
|
|
200
200
|
};
|
|
201
|
-
|
|
202
|
-
let
|
|
203
|
-
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar",
|
|
204
|
-
var
|
|
205
|
-
const
|
|
201
|
+
_ = new WeakMap(), W = new WeakMap(), y = new WeakMap(), N = new WeakMap(), B = new WeakMap(), P = new WeakMap(), mt = new WeakMap(), Y = new WeakMap(), xt = new WeakMap(), a(ee, "NineTableHScrollBar");
|
|
202
|
+
let Yt = ee;
|
|
203
|
+
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", Yt);
|
|
204
|
+
var V, O, v, ot, rt, vt;
|
|
205
|
+
const ie = class ie extends HTMLElement {
|
|
206
206
|
constructor() {
|
|
207
207
|
super();
|
|
208
|
-
h(this,
|
|
209
|
-
h(this,
|
|
208
|
+
h(this, V);
|
|
209
|
+
h(this, O, !1);
|
|
210
210
|
h(this, v);
|
|
211
|
-
h(this,
|
|
212
|
-
h(this,
|
|
211
|
+
h(this, ot, 0);
|
|
212
|
+
h(this, rt, 0);
|
|
213
213
|
/**
|
|
214
214
|
* π― μ€ν¬λ‘€λ° μμΉ λ° μΈλΈ ν¬κΈ° κ°±μ
|
|
215
215
|
*/
|
|
216
|
-
x(this, "refresh", /* @__PURE__ */
|
|
217
|
-
if (!t(this,
|
|
216
|
+
x(this, "refresh", /* @__PURE__ */ a(() => {
|
|
217
|
+
if (!t(this, V) || !t(this, v) || t(this, O)) return;
|
|
218
218
|
const e = t(this, v).container, s = e.querySelector("table");
|
|
219
219
|
if (!s) return;
|
|
220
220
|
const o = t(this, v).track, r = t(this, v).thumb, n = e.clientHeight, l = s.scrollHeight;
|
|
@@ -223,43 +223,43 @@ const Zt = class Zt extends HTMLElement {
|
|
|
223
223
|
return;
|
|
224
224
|
} else
|
|
225
225
|
r.style.display = "block";
|
|
226
|
-
const
|
|
227
|
-
if (
|
|
228
|
-
const d = Math.max(Math.min(
|
|
226
|
+
const c = o.clientHeight;
|
|
227
|
+
if (c <= 0) return;
|
|
228
|
+
const d = Math.max(Math.min(c * (n / l), c), 20);
|
|
229
229
|
r.style.height = `${d}px`;
|
|
230
230
|
const f = e.scrollTop, u = l - n;
|
|
231
|
-
let
|
|
232
|
-
u > 0 && (
|
|
233
|
-
const p =
|
|
234
|
-
|
|
231
|
+
let g = 0;
|
|
232
|
+
u > 0 && (g = f / u * (c - d));
|
|
233
|
+
const p = c - d;
|
|
234
|
+
g < 0 && (g = 0), g > p && (g = p), r.style.top = `${g}px`, t(this, v).top.disabled = f <= 0, t(this, v).bottom.disabled = f >= u - 1;
|
|
235
235
|
}, "refresh"));
|
|
236
|
-
h(this,
|
|
236
|
+
h(this, vt, /* @__PURE__ */ a(() => {
|
|
237
237
|
const e = t(this, v).container;
|
|
238
238
|
e.addEventListener("scroll", () => {
|
|
239
|
-
t(this,
|
|
239
|
+
t(this, O) || this.refresh();
|
|
240
240
|
}), t(this, v).thumb.addEventListener("mousedown", (s) => {
|
|
241
241
|
if (s.button !== 0) return;
|
|
242
|
-
s.stopPropagation(), s.preventDefault(),
|
|
243
|
-
const o = /* @__PURE__ */
|
|
244
|
-
if (!t(this,
|
|
245
|
-
const l = t(this, v).track.getBoundingClientRect(),
|
|
246
|
-
|
|
247
|
-
const
|
|
248
|
-
if (f > 0 &&
|
|
249
|
-
const
|
|
250
|
-
e.scrollTop = t(this,
|
|
242
|
+
s.stopPropagation(), s.preventDefault(), b(this, O, !0), b(this, ot, s.clientY), b(this, rt, e.scrollTop);
|
|
243
|
+
const o = /* @__PURE__ */ a((n) => {
|
|
244
|
+
if (!t(this, O)) return;
|
|
245
|
+
const l = t(this, v).track.getBoundingClientRect(), c = t(this, v).thumb.clientHeight, f = l.height - c, u = n.clientY - t(this, ot), g = e.clientHeight, p = e.querySelector("table");
|
|
246
|
+
M.log(p), M.log(p.scrollHeight);
|
|
247
|
+
const H = p.scrollHeight - g;
|
|
248
|
+
if (f > 0 && H > 0) {
|
|
249
|
+
const yt = u / f * H;
|
|
250
|
+
e.scrollTop = t(this, rt) + yt;
|
|
251
251
|
}
|
|
252
252
|
this.refresh();
|
|
253
|
-
}, "onMouseMove"), r = /* @__PURE__ */
|
|
254
|
-
|
|
253
|
+
}, "onMouseMove"), r = /* @__PURE__ */ a(() => {
|
|
254
|
+
b(this, O, !1), document.removeEventListener("mousemove", o), document.removeEventListener("mouseup", r), this.refresh();
|
|
255
255
|
}, "onMouseUp");
|
|
256
256
|
document.addEventListener("mousemove", o), document.addEventListener("mouseup", r);
|
|
257
257
|
}), t(this, v).track.addEventListener("mousedown", (s) => {
|
|
258
258
|
if (s.button !== 0 || s.target === t(this, v).thumb) return;
|
|
259
|
-
const o = t(this, v).track.getBoundingClientRect(), r = t(this, v).thumb.clientHeight, n = s.clientY - o.top - r / 2,
|
|
260
|
-
if (
|
|
261
|
-
const
|
|
262
|
-
e.scrollTop =
|
|
259
|
+
const o = t(this, v).track.getBoundingClientRect(), r = t(this, v).thumb.clientHeight, n = s.clientY - o.top - r / 2, c = o.height - r, d = e.clientHeight, u = e.querySelector("table").scrollHeight - d;
|
|
260
|
+
if (c > 0 && u > 0) {
|
|
261
|
+
const g = Math.max(0, Math.min(1, n / c));
|
|
262
|
+
e.scrollTop = g * u;
|
|
263
263
|
}
|
|
264
264
|
this.refresh();
|
|
265
265
|
}), t(this, v).top.addEventListener("click", () => {
|
|
@@ -270,7 +270,7 @@ const Zt = class Zt extends HTMLElement {
|
|
|
270
270
|
}, "#init"));
|
|
271
271
|
}
|
|
272
272
|
connectedCallback() {
|
|
273
|
-
if (
|
|
273
|
+
if (b(this, V, this.closest("nine-table-sheet") || this.getRootNode().host), !t(this, V)) return;
|
|
274
274
|
this.innerHTML = `
|
|
275
275
|
<style>
|
|
276
276
|
nine-table-vscrollbar {
|
|
@@ -334,33 +334,33 @@ const Zt = class Zt extends HTMLElement {
|
|
|
334
334
|
<div class='ng-scroll-track'><div class='ng-scroll-thumb'></div></div>
|
|
335
335
|
<button class='ng-scroll-bottom' disabled><div class='ng-scroll-icon'></div></button>
|
|
336
336
|
`;
|
|
337
|
-
const e = /* @__PURE__ */
|
|
338
|
-
const s = t(this,
|
|
337
|
+
const e = /* @__PURE__ */ a(() => {
|
|
338
|
+
const s = t(this, V).querySelector(".ng-container-body");
|
|
339
339
|
if (!s) {
|
|
340
340
|
setTimeout(e, 10);
|
|
341
341
|
return;
|
|
342
342
|
}
|
|
343
|
-
|
|
343
|
+
b(this, v, {
|
|
344
344
|
container: s,
|
|
345
345
|
track: this.querySelector(".ng-scroll-track"),
|
|
346
346
|
thumb: this.querySelector(".ng-scroll-thumb"),
|
|
347
347
|
top: this.querySelector(".ng-scroll-top"),
|
|
348
348
|
bottom: this.querySelector(".ng-scroll-bottom")
|
|
349
|
-
}), t(this,
|
|
349
|
+
}), t(this, vt).call(this), this.refresh();
|
|
350
350
|
}, "initWhenReady");
|
|
351
351
|
e();
|
|
352
352
|
}
|
|
353
353
|
};
|
|
354
|
-
|
|
355
|
-
let
|
|
356
|
-
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar",
|
|
357
|
-
var
|
|
358
|
-
const
|
|
354
|
+
V = new WeakMap(), O = new WeakMap(), v = new WeakMap(), ot = new WeakMap(), rt = new WeakMap(), vt = new WeakMap(), a(ie, "NineTableVScrollBar");
|
|
355
|
+
let Vt = ie;
|
|
356
|
+
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar", Vt);
|
|
357
|
+
var wt, G;
|
|
358
|
+
const C = class C {
|
|
359
359
|
/**
|
|
360
360
|
* π― λ μ΄μμ λ΄μ μ¬λ¬ rawTables λ°°μ΄μ μΌκ΄λ‘ λ°μ λ¨μΌ λ§μ€ν° ν
νλ¦ΏμΌλ‘ μ¬μ μ»΄νμΌν©λλ€.
|
|
361
361
|
*/
|
|
362
362
|
static compileAll(i) {
|
|
363
|
-
return Array.isArray(i) ? i.map((e) =>
|
|
363
|
+
return Array.isArray(i) ? i.map((e) => C.compile(e)) : [];
|
|
364
364
|
}
|
|
365
365
|
/**
|
|
366
366
|
* π― λ¨μΌ μλ³Έ ν
μ΄λΈμ λ°μ κΈ°λ³Έ ꡬ쑰 보μ λ° 2μ°¨μ 격μ μΈλ±μ€ μ¬μ λΆμ¬ μλ£λ λ§μ€ν° ν
μ΄λΈ λ°ν
|
|
@@ -369,15 +369,15 @@ const H = class H {
|
|
|
369
369
|
var o, r, n, l;
|
|
370
370
|
if (!i) return null;
|
|
371
371
|
const e = i.cloneNode(!0);
|
|
372
|
-
return t(o =
|
|
373
|
-
const f =
|
|
372
|
+
return t(o = C, wt).call(o, e), t(r = C, G).call(r, e, "thead"), t(n = C, G).call(n, e, "tbody"), t(l = C, G).call(l, e, "tfoot"), Array.from(e.querySelectorAll("colgroup col")).forEach((c, d) => {
|
|
373
|
+
const f = c.getAttribute("fixed");
|
|
374
374
|
f && e.querySelectorAll(`thead [data-col="${d}"], tbody [data-col="${d}"], tfoot [data-col="${d}"]`).forEach((u) => {
|
|
375
375
|
u.setAttribute("fixed", f);
|
|
376
376
|
});
|
|
377
377
|
}), e;
|
|
378
378
|
}
|
|
379
379
|
};
|
|
380
|
-
|
|
380
|
+
wt = new WeakMap(), G = new WeakMap(), a(C, "TableCompiler"), h(C, wt, /* @__PURE__ */ a((i) => {
|
|
381
381
|
if (!i.querySelector("colgroup")) {
|
|
382
382
|
const e = i.querySelector("tbody tr") || i.querySelector("tr"), s = e ? e.querySelectorAll("th, td").length : 1, o = document.createElement("colgroup"), r = Math.max(Math.floor(i.clientWidth / s), 100);
|
|
383
383
|
for (let n = 0; n < s; n++) {
|
|
@@ -391,31 +391,31 @@ pt = new WeakMap(), j = new WeakMap(), c(H, "TableCompiler"), h(H, pt, /* @__PUR
|
|
|
391
391
|
s ? s.after(e) : i.prepend(e);
|
|
392
392
|
}
|
|
393
393
|
i.classList.add("nine-table-element"), i.style.display = "table";
|
|
394
|
-
}, "#ensureTableStructure")), h(
|
|
394
|
+
}, "#ensureTableStructure")), h(C, G, /* @__PURE__ */ a((i, e) => {
|
|
395
395
|
const s = Array.from(i.querySelectorAll(e + " tr")), o = Array.from(i.querySelectorAll(e + " th," + e + " td")), r = s.length;
|
|
396
396
|
if (r === 0 || o.length === 0) return;
|
|
397
397
|
let n = 0;
|
|
398
|
-
o.forEach((
|
|
399
|
-
n +=
|
|
398
|
+
o.forEach((c) => {
|
|
399
|
+
n += c.colSpan || 1;
|
|
400
400
|
});
|
|
401
401
|
const l = Array.from(Array(r), () => Array(n).fill(null));
|
|
402
|
-
s.forEach((
|
|
403
|
-
const d =
|
|
402
|
+
s.forEach((c) => {
|
|
403
|
+
const d = c.sectionRowIndex;
|
|
404
404
|
let f = 0;
|
|
405
|
-
Array.from(
|
|
405
|
+
Array.from(c.querySelectorAll("th,td")).forEach((u) => {
|
|
406
406
|
for (let E = 0; E < l[d].length; E++)
|
|
407
407
|
if (l[d][E] === null) {
|
|
408
408
|
f = E;
|
|
409
409
|
break;
|
|
410
410
|
}
|
|
411
|
-
const
|
|
412
|
-
for (let E = 0; E <
|
|
413
|
-
for (let
|
|
414
|
-
d + E < r && f +
|
|
411
|
+
const g = u.rowSpan || 1, p = u.colSpan || 1;
|
|
412
|
+
for (let E = 0; E < g; E++)
|
|
413
|
+
for (let H = 0; H < p; H++)
|
|
414
|
+
d + E < r && f + H < n && (l[d + E][f + H] = E === 0 && H === 0 ? "1" : "0");
|
|
415
415
|
});
|
|
416
|
-
}), s.forEach((
|
|
417
|
-
const d =
|
|
418
|
-
Array.from(
|
|
416
|
+
}), s.forEach((c) => {
|
|
417
|
+
const d = c.sectionRowIndex;
|
|
418
|
+
Array.from(c.querySelectorAll("th,td")).forEach((f) => {
|
|
419
419
|
for (let u = 0; u < l[d].length; u++)
|
|
420
420
|
if (l[d][u] === "1") {
|
|
421
421
|
f.dataset.col = u, l[d][u] = "0";
|
|
@@ -424,24 +424,24 @@ pt = new WeakMap(), j = new WeakMap(), c(H, "TableCompiler"), h(H, pt, /* @__PUR
|
|
|
424
424
|
});
|
|
425
425
|
});
|
|
426
426
|
}, "#resetColIndex"));
|
|
427
|
-
let
|
|
428
|
-
var
|
|
429
|
-
const
|
|
427
|
+
let Xt = C;
|
|
428
|
+
var X, w, I, A, z, U, J, St, Et, lt, at, Rt, At, ct, Q, kt;
|
|
429
|
+
const se = class se {
|
|
430
430
|
constructor(i) {
|
|
431
|
-
h(this,
|
|
431
|
+
h(this, X);
|
|
432
432
|
h(this, w);
|
|
433
|
-
h(this,
|
|
434
|
-
h(this,
|
|
435
|
-
h(this,
|
|
436
|
-
h(this,
|
|
437
|
-
h(this,
|
|
438
|
-
x(this, "refresh", /* @__PURE__ */
|
|
433
|
+
h(this, I, /* @__PURE__ */ new Map());
|
|
434
|
+
h(this, A, null);
|
|
435
|
+
h(this, z, null);
|
|
436
|
+
h(this, U, 0);
|
|
437
|
+
h(this, J, 40);
|
|
438
|
+
x(this, "refresh", /* @__PURE__ */ a(() => {
|
|
439
439
|
var e;
|
|
440
440
|
const i = t(this, w).querySelector(".ng-container-body");
|
|
441
|
-
i && (t(this,
|
|
441
|
+
i && (t(this, lt).call(this), t(this, Q).call(this, i.scrollTop), (e = t(this, w).querySelector("nine-table-vscrollbar")) == null || e.refresh());
|
|
442
442
|
}, "refresh"));
|
|
443
|
-
x(this, "initialize", /* @__PURE__ */
|
|
444
|
-
|
|
443
|
+
x(this, "initialize", /* @__PURE__ */ a(() => {
|
|
444
|
+
b(this, A, null), t(this, I).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((o) => {
|
|
445
445
|
const r = t(this, w).querySelector(o);
|
|
446
446
|
if (!r) return;
|
|
447
447
|
const n = r.querySelector("table");
|
|
@@ -449,15 +449,15 @@ const Gt = class Gt {
|
|
|
449
449
|
const l = n.querySelector("tbody.bindable-tbody");
|
|
450
450
|
if (!l) return;
|
|
451
451
|
const d = Array.from(l.querySelectorAll("tr")).map((f) => f.cloneNode(!0));
|
|
452
|
-
t(this,
|
|
452
|
+
t(this, I).set(o, d);
|
|
453
453
|
});
|
|
454
454
|
const i = t(this, w).querySelector(".ng-container-body"), e = t(this, w).querySelector(".ng-container-left"), s = t(this, w).querySelector(".ng-container-right");
|
|
455
455
|
if (i) {
|
|
456
|
-
t(this,
|
|
456
|
+
t(this, Et).call(this, i), t(this, ct).call(this), t(this, lt).call(this), t(this, Q).call(this, i.scrollTop);
|
|
457
457
|
let o = i.scrollTop;
|
|
458
|
-
const r = /* @__PURE__ */
|
|
458
|
+
const r = /* @__PURE__ */ a((n) => {
|
|
459
459
|
var l;
|
|
460
|
-
e && e.scrollTop !== n && (e.scrollTop = n), s && s.scrollTop !== n && (s.scrollTop = n), t(this,
|
|
460
|
+
e && e.scrollTop !== n && (e.scrollTop = n), s && s.scrollTop !== n && (s.scrollTop = n), t(this, Q).call(this, n), (l = t(this, w).querySelector("nine-table-vscrollbar")) == null || l.refresh();
|
|
461
461
|
}, "syncScroll");
|
|
462
462
|
i.addEventListener("scroll", () => {
|
|
463
463
|
const n = i.scrollTop;
|
|
@@ -465,70 +465,70 @@ const Gt = class Gt {
|
|
|
465
465
|
});
|
|
466
466
|
}
|
|
467
467
|
}, "initialize"));
|
|
468
|
-
h(this,
|
|
469
|
-
const s = t(this,
|
|
468
|
+
h(this, St, /* @__PURE__ */ a((i, e) => {
|
|
469
|
+
const s = t(this, I).get(e);
|
|
470
470
|
if (!s || s.length === 0) return;
|
|
471
471
|
const o = i.querySelector("tbody.bindable-tbody");
|
|
472
472
|
if (!o) return;
|
|
473
473
|
o.querySelectorAll("tr:not(.nodata)").forEach((l) => l.remove());
|
|
474
474
|
const r = o.querySelector("tr.nodata"), n = document.createDocumentFragment();
|
|
475
|
-
for (let l = 0; l < t(this,
|
|
476
|
-
s.forEach((
|
|
477
|
-
n.appendChild(
|
|
475
|
+
for (let l = 0; l < t(this, J); l++)
|
|
476
|
+
s.forEach((c) => {
|
|
477
|
+
n.appendChild(c.cloneNode(!0));
|
|
478
478
|
});
|
|
479
479
|
r ? r.before(n) : o.appendChild(n);
|
|
480
480
|
}, "#renderRows"));
|
|
481
|
-
h(this,
|
|
482
|
-
if (t(this,
|
|
483
|
-
return t(this,
|
|
484
|
-
const e = t(this,
|
|
481
|
+
h(this, Et, /* @__PURE__ */ a((i) => {
|
|
482
|
+
if (t(this, A) !== null && t(this, A) > 0)
|
|
483
|
+
return t(this, A);
|
|
484
|
+
const e = t(this, I).get(".ng-container-body");
|
|
485
485
|
if (!e || e.length === 0) return 24;
|
|
486
486
|
const s = i.querySelector("tbody.bindable-tbody") || i.querySelector("tbody.bindable-tbody:last-of-type");
|
|
487
487
|
if (!s) return 24;
|
|
488
|
-
s.querySelectorAll("tr:not(.nodata)").forEach((
|
|
488
|
+
s.querySelectorAll("tr:not(.nodata)").forEach((g) => g.remove());
|
|
489
489
|
const o = s.querySelector("tr.nodata"), r = document.createDocumentFragment();
|
|
490
|
-
e.forEach((
|
|
491
|
-
r.appendChild(
|
|
490
|
+
e.forEach((g) => {
|
|
491
|
+
r.appendChild(g.cloneNode(!0));
|
|
492
492
|
}), o ? o.before(r) : s.appendChild(r);
|
|
493
|
-
const n = t(this, w), l = n.style.display,
|
|
493
|
+
const n = t(this, w), l = n.style.display, c = n.style.visibility, d = n.style.position;
|
|
494
494
|
(l === "none" || window.getComputedStyle(n).display === "none") && (n.style.display = "block", n.style.visibility = "hidden", n.style.position = "absolute");
|
|
495
495
|
let f = 0;
|
|
496
496
|
const u = s.querySelectorAll("tr:not(.nodata)");
|
|
497
|
-
return u.forEach((
|
|
498
|
-
f +=
|
|
499
|
-
}), u.forEach((
|
|
497
|
+
return u.forEach((g) => {
|
|
498
|
+
f += g.offsetHeight || g.getBoundingClientRect().height;
|
|
499
|
+
}), u.forEach((g) => g.remove()), n.style.display = l, n.style.visibility = c, n.style.position = d, b(this, A, f > 0 ? f : 24), t(this, at).call(this), t(this, A);
|
|
500
500
|
}, "#measureAndCacheHeight"));
|
|
501
|
-
h(this,
|
|
501
|
+
h(this, lt, /* @__PURE__ */ a(() => {
|
|
502
502
|
if (!t(this, w).querySelector(".ng-container-body")) return;
|
|
503
|
-
const e = t(this,
|
|
503
|
+
const e = t(this, X).data.get() || [], s = e.length > 0 ? e.length : 100, o = t(this, A), r = s * o;
|
|
504
504
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((n) => {
|
|
505
|
-
const l = t(this, w).querySelector(n),
|
|
506
|
-
|
|
505
|
+
const l = t(this, w).querySelector(n), c = l == null ? void 0 : l.querySelector("table");
|
|
506
|
+
c && (c.style.height = `${r}px`);
|
|
507
507
|
});
|
|
508
508
|
}, "#updateVirtualScrollHeight"));
|
|
509
|
-
h(this,
|
|
510
|
-
if (t(this,
|
|
511
|
-
const i = Math.ceil(t(this,
|
|
512
|
-
|
|
509
|
+
h(this, at, /* @__PURE__ */ a(() => {
|
|
510
|
+
if (t(this, U) > 0 && t(this, A) > 0) {
|
|
511
|
+
const i = Math.ceil(t(this, U) / t(this, A));
|
|
512
|
+
b(this, J, i + 20);
|
|
513
513
|
} else
|
|
514
|
-
|
|
514
|
+
b(this, J, 40);
|
|
515
515
|
}, "#updateRowCount"));
|
|
516
|
-
h(this,
|
|
517
|
-
var
|
|
516
|
+
h(this, Rt, /* @__PURE__ */ a(() => {
|
|
517
|
+
var c, d, f;
|
|
518
518
|
const i = t(this, w).querySelector(".ng-container-left table"), e = t(this, w).querySelector(".ng-container-body table"), s = t(this, w).querySelector(".ng-container-right table");
|
|
519
519
|
if (!e) return;
|
|
520
520
|
const o = i ? Array.from(i.querySelectorAll("tr")) : [], r = Array.from(e.querySelectorAll("tr")), n = s ? Array.from(s.querySelectorAll("tr")) : [], l = Math.max(o.length, r.length, n.length);
|
|
521
521
|
for (let u = 0; u < l; u++) {
|
|
522
|
-
const
|
|
523
|
-
((
|
|
522
|
+
const g = [
|
|
523
|
+
((c = o[u]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
|
|
524
524
|
((d = r[u]) == null ? void 0 : d.getBoundingClientRect().height) || 0,
|
|
525
525
|
((f = n[u]) == null ? void 0 : f.getBoundingClientRect().height) || 0
|
|
526
|
-
], p = Math.max(...
|
|
526
|
+
], p = Math.max(...g);
|
|
527
527
|
p > 0 && (o[u] && (o[u].style.height = `${p}px`), r[u] && (r[u].style.height = `${p}px`), n[u] && (n[u].style.height = `${p}px`));
|
|
528
528
|
}
|
|
529
529
|
}, "#syncRowHeights"));
|
|
530
|
-
h(this,
|
|
531
|
-
!t(this, w) || !(t(this, w) instanceof HTMLElement) || (
|
|
530
|
+
h(this, At, /* @__PURE__ */ a(() => {
|
|
531
|
+
!t(this, w) || !(t(this, w) instanceof HTMLElement) || (b(this, z, new ResizeObserver((i) => {
|
|
532
532
|
for (const e of i) {
|
|
533
533
|
const s = e.target;
|
|
534
534
|
if (!s.classList.contains("active")) continue;
|
|
@@ -538,69 +538,69 @@ const Gt = class Gt {
|
|
|
538
538
|
const n = s.querySelector("thead");
|
|
539
539
|
n && (r += n.offsetHeight || n.getBoundingClientRect().height);
|
|
540
540
|
const l = Math.max(o - r, 100);
|
|
541
|
-
t(this,
|
|
541
|
+
t(this, U) !== l && (b(this, U, l), t(this, at).call(this), t(this, A) !== null && t(this, ct).call(this));
|
|
542
542
|
}
|
|
543
543
|
}
|
|
544
|
-
})), t(this,
|
|
544
|
+
})), t(this, z).observe(t(this, w)));
|
|
545
545
|
}, "#initResizeObserver"));
|
|
546
|
-
h(this,
|
|
546
|
+
h(this, ct, /* @__PURE__ */ a(() => {
|
|
547
547
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((i) => {
|
|
548
548
|
const e = t(this, w).querySelector(i);
|
|
549
|
-
e && e.querySelector("tbody.bindable-tbody") && t(this,
|
|
550
|
-
}), t(this,
|
|
549
|
+
e && e.querySelector("tbody.bindable-tbody") && t(this, St).call(this, e, i);
|
|
550
|
+
}), t(this, Rt).call(this);
|
|
551
551
|
}, "#renderAllContainers"));
|
|
552
|
-
h(this,
|
|
552
|
+
h(this, Q, /* @__PURE__ */ a((i) => {
|
|
553
553
|
var r;
|
|
554
|
-
const e = t(this,
|
|
554
|
+
const e = t(this, A);
|
|
555
555
|
if (!e || e <= 0) return;
|
|
556
|
-
const s = Math.max(0, Math.floor(i / e)), o = ((r = t(this,
|
|
556
|
+
const s = Math.max(0, Math.floor(i / e)), o = ((r = t(this, I).get(".ng-container-body")) == null ? void 0 : r.length) || 1;
|
|
557
557
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((n) => {
|
|
558
558
|
const l = t(this, w).querySelector(n);
|
|
559
559
|
if (!l) return;
|
|
560
|
-
const
|
|
561
|
-
if (!
|
|
562
|
-
Array.from(
|
|
563
|
-
const
|
|
564
|
-
|
|
560
|
+
const c = l.querySelector("tbody.bindable-tbody");
|
|
561
|
+
if (!c) return;
|
|
562
|
+
Array.from(c.querySelectorAll("tr:not(.nodata)")).forEach((f, u) => {
|
|
563
|
+
const g = s + Math.floor(u / o), p = t(this, X).data.get(g);
|
|
564
|
+
M.log("--", t(this, X).data.get(0)), f.style.display = "", t(this, kt).call(this, f, p, g);
|
|
565
565
|
});
|
|
566
566
|
});
|
|
567
567
|
}, "#handleScroll"));
|
|
568
|
-
h(this,
|
|
569
|
-
i.dataset.row = s,
|
|
568
|
+
h(this, kt, /* @__PURE__ */ a((i, e, s) => {
|
|
569
|
+
i.dataset.row = s, M.log(i, e, s), Array.from(i.cells).forEach((o, r) => {
|
|
570
570
|
const n = o.dataset.bind;
|
|
571
571
|
n && e && e[n] !== void 0 ? o.textContent = e[n] : o.textContent = e ? e[Object.keys(e)[r]] ?? `R${s}C${r}` : `ν ${s + 1}`, o.dataset.row = s;
|
|
572
572
|
});
|
|
573
573
|
}, "#bindRowData"));
|
|
574
|
-
x(this, "destroy", /* @__PURE__ */
|
|
575
|
-
t(this,
|
|
574
|
+
x(this, "destroy", /* @__PURE__ */ a(() => {
|
|
575
|
+
t(this, z) && (t(this, z).disconnect(), b(this, z, null));
|
|
576
576
|
}, "destroy"));
|
|
577
|
-
|
|
577
|
+
b(this, X, i.getRootNode().host), b(this, w, i), t(this, At).call(this);
|
|
578
578
|
}
|
|
579
579
|
getRowHeight() {
|
|
580
|
-
return t(this,
|
|
580
|
+
return t(this, A);
|
|
581
581
|
}
|
|
582
582
|
templateLength(i = ".ng-container-body") {
|
|
583
583
|
var e;
|
|
584
|
-
return ((e = t(this,
|
|
584
|
+
return ((e = t(this, I).get(i)) == null ? void 0 : e.length) || 1;
|
|
585
585
|
}
|
|
586
586
|
};
|
|
587
|
-
|
|
588
|
-
let
|
|
589
|
-
var
|
|
590
|
-
const
|
|
587
|
+
X = new WeakMap(), w = new WeakMap(), I = new WeakMap(), A = new WeakMap(), z = new WeakMap(), U = new WeakMap(), J = new WeakMap(), St = new WeakMap(), Et = new WeakMap(), lt = new WeakMap(), at = new WeakMap(), Rt = new WeakMap(), At = new WeakMap(), ct = new WeakMap(), Q = new WeakMap(), kt = new WeakMap(), a(se, "RowManager");
|
|
588
|
+
let Ut = se;
|
|
589
|
+
var Tt, tt, j, qt, Lt, Ht, Ct, _t;
|
|
590
|
+
const nt = class nt extends HTMLElement {
|
|
591
591
|
constructor() {
|
|
592
592
|
super();
|
|
593
|
-
h(this,
|
|
594
|
-
h(this,
|
|
595
|
-
h(this,
|
|
593
|
+
h(this, Tt);
|
|
594
|
+
h(this, tt, null);
|
|
595
|
+
h(this, j);
|
|
596
596
|
/**
|
|
597
597
|
* data.set, add, delete
|
|
598
598
|
* filter, sorting : κ³ λ €λμ
|
|
599
599
|
*/
|
|
600
|
-
x(this, "invalidate", /* @__PURE__ */
|
|
601
|
-
t(this,
|
|
600
|
+
x(this, "invalidate", /* @__PURE__ */ a(() => {
|
|
601
|
+
t(this, j).refresh();
|
|
602
602
|
}, "invalidate"));
|
|
603
|
-
h(this,
|
|
603
|
+
h(this, qt, /* @__PURE__ */ a(() => {
|
|
604
604
|
[
|
|
605
605
|
{ selector: ".ng-container-body", type: null },
|
|
606
606
|
{ selector: ".ng-container-left", type: "left" },
|
|
@@ -608,11 +608,11 @@ const it = class it extends HTMLElement {
|
|
|
608
608
|
].forEach(({ selector: s, type: o }) => {
|
|
609
609
|
const r = this.querySelector(s);
|
|
610
610
|
if (!r) return;
|
|
611
|
-
const n = t(this,
|
|
611
|
+
const n = t(this, Ht).call(this, t(this, tt), o);
|
|
612
612
|
r.innerHTML = "", r.appendChild(n);
|
|
613
613
|
});
|
|
614
614
|
}, "#renderSplitContainers"));
|
|
615
|
-
h(this,
|
|
615
|
+
h(this, Lt, /* @__PURE__ */ a(() => {
|
|
616
616
|
["left", "right"].forEach((e) => {
|
|
617
617
|
const s = this.querySelector(`.ng-container-${e}`), o = s == null ? void 0 : s.querySelector("table");
|
|
618
618
|
if (!s || !o) return;
|
|
@@ -623,14 +623,14 @@ const it = class it extends HTMLElement {
|
|
|
623
623
|
}), s.style.flex = `0 0 ${r}px`, s.style.width = `${r}px`;
|
|
624
624
|
});
|
|
625
625
|
}, "#updateContainerWidths"));
|
|
626
|
-
x(this, "generate", /* @__PURE__ */
|
|
627
|
-
e && (
|
|
626
|
+
x(this, "generate", /* @__PURE__ */ a((e) => {
|
|
627
|
+
e && (b(this, tt, Xt.compile(e)), t(this, tt).style.display = "table", t(this, qt).call(this), t(this, Lt).call(this), requestAnimationFrame(() => {
|
|
628
628
|
var o;
|
|
629
629
|
const s = (o = this.querySelector("thead")) == null ? void 0 : o.getBoundingClientRect().height;
|
|
630
630
|
this.querySelectorAll("tbody.fixed-tbody").forEach((r) => {
|
|
631
631
|
r.style.top = `${s}px`;
|
|
632
632
|
});
|
|
633
|
-
}), t(this,
|
|
633
|
+
}), t(this, j).initialize(), setTimeout(() => {
|
|
634
634
|
var s;
|
|
635
635
|
(s = this.querySelector("nine-table-hscrollbar")) == null || s.refresh();
|
|
636
636
|
}, 0));
|
|
@@ -638,7 +638,7 @@ const it = class it extends HTMLElement {
|
|
|
638
638
|
/**
|
|
639
639
|
* π― λ§μ€ν° ν
μ΄λΈμ κΈ°λ°μΌλ‘ νΉμ fixed νμ
μμλ§ λ¨κΈ°λ λΆν ν¬νΌ
|
|
640
640
|
*/
|
|
641
|
-
h(this,
|
|
641
|
+
h(this, Ht, /* @__PURE__ */ a((e, s) => {
|
|
642
642
|
const o = e.cloneNode(!0), r = o.querySelector("tbody");
|
|
643
643
|
if (r) {
|
|
644
644
|
const n = document.createElement("tbody");
|
|
@@ -652,20 +652,20 @@ const it = class it extends HTMLElement {
|
|
|
652
652
|
n.remove();
|
|
653
653
|
}), o;
|
|
654
654
|
}, "#createSplitTable"));
|
|
655
|
-
x(this, "getRowHeight", /* @__PURE__ */
|
|
656
|
-
x(this, "scrollToX", /* @__PURE__ */
|
|
655
|
+
x(this, "getRowHeight", /* @__PURE__ */ a(() => t(this, j).getRowHeight(), "getRowHeight"));
|
|
656
|
+
x(this, "scrollToX", /* @__PURE__ */ a((e) => {
|
|
657
657
|
const s = this.querySelector(".ng-container-body");
|
|
658
658
|
s && (s.scrollLeft = e);
|
|
659
659
|
}, "scrollToX"));
|
|
660
|
-
x(this, "scrollToY", /* @__PURE__ */
|
|
660
|
+
x(this, "scrollToY", /* @__PURE__ */ a((e) => {
|
|
661
661
|
const s = this.querySelector(".ng-container-body");
|
|
662
662
|
s && (s.scrollTop = e);
|
|
663
663
|
}, "scrollToY"));
|
|
664
|
-
h(this,
|
|
665
|
-
t(this,
|
|
664
|
+
h(this, Ct, /* @__PURE__ */ a(() => {
|
|
665
|
+
t(this, _t).call(this);
|
|
666
666
|
}, "#init"));
|
|
667
|
-
h(this,
|
|
668
|
-
const e =
|
|
667
|
+
h(this, _t, /* @__PURE__ */ a(() => {
|
|
668
|
+
const e = nt.SCROLLBAR_SIZE;
|
|
669
669
|
this.innerHTML = `
|
|
670
670
|
<style>
|
|
671
671
|
nine-table-sheet {
|
|
@@ -811,55 +811,55 @@ const it = class it extends HTMLElement {
|
|
|
811
811
|
</div>
|
|
812
812
|
`;
|
|
813
813
|
}, "#render"));
|
|
814
|
-
|
|
814
|
+
b(this, j, new Ut(this)), b(this, Tt, this.getRootNode().host);
|
|
815
815
|
}
|
|
816
816
|
connectedCallback() {
|
|
817
|
-
t(this,
|
|
817
|
+
t(this, Ct).call(this);
|
|
818
818
|
}
|
|
819
819
|
disconnectedCallback() {
|
|
820
|
-
this.innerHTML = "",
|
|
820
|
+
this.innerHTML = "", M.log("NineTableSheet destroyed.");
|
|
821
821
|
}
|
|
822
822
|
};
|
|
823
|
-
|
|
824
|
-
let
|
|
825
|
-
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet",
|
|
826
|
-
var
|
|
827
|
-
const
|
|
823
|
+
Tt = new WeakMap(), tt = new WeakMap(), j = new WeakMap(), qt = new WeakMap(), Lt = new WeakMap(), Ht = new WeakMap(), Ct = new WeakMap(), _t = new WeakMap(), a(nt, "NineTableSheet"), x(nt, "SCROLLBAR_SIZE", 16);
|
|
824
|
+
let pt = nt;
|
|
825
|
+
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", pt);
|
|
826
|
+
var Mt, ht;
|
|
827
|
+
const ne = class ne extends HTMLElement {
|
|
828
828
|
constructor() {
|
|
829
829
|
super();
|
|
830
|
-
h(this,
|
|
830
|
+
h(this, Mt, /* @__PURE__ */ a(() => {
|
|
831
831
|
var e;
|
|
832
832
|
(e = this.querySelector(".nine-tab-bar")) == null || e.addEventListener("click", (s) => {
|
|
833
833
|
var n;
|
|
834
834
|
const o = s.ctrlKey || s.metaKey || s.shiftKey, r = parseInt((n = s.target.closest(".nine-tab-item")) == null ? void 0 : n.dataset.index, 10);
|
|
835
|
-
t(this,
|
|
836
|
-
}), t(this,
|
|
835
|
+
t(this, ht).call(this, r, o);
|
|
836
|
+
}), t(this, ht).call(this, 0, !1);
|
|
837
837
|
}, "#init"));
|
|
838
|
-
h(this,
|
|
839
|
-
const o = /* @__PURE__ */
|
|
838
|
+
h(this, ht, /* @__PURE__ */ a((e, s = !1) => {
|
|
839
|
+
const o = /* @__PURE__ */ a(() => {
|
|
840
840
|
const f = Array.from(this.querySelectorAll("nine-table-sheet"));
|
|
841
841
|
Array.from(this.querySelectorAll("nine-splitter")).forEach((p) => p.style.setProperty("display", "none"));
|
|
842
|
-
const
|
|
843
|
-
|
|
844
|
-
const E = parseInt(p.getAttribute("data-index"), 10),
|
|
845
|
-
|
|
842
|
+
const g = f.filter((p) => p.classList.contains("active"));
|
|
843
|
+
g.length < 2 || g.forEach((p) => {
|
|
844
|
+
const E = parseInt(p.getAttribute("data-index"), 10), H = this.querySelector(`nine-splitter[data-split-index="${E}"]`), yt = f[E + 1];
|
|
845
|
+
H && yt && yt.classList.contains("active") && H.style.setProperty("display", "flex");
|
|
846
846
|
});
|
|
847
|
-
}, "updateSplitters"), r = this.querySelector(".nine-tab-bar"), n = this.querySelector("nine-table-sheets-body"), l = r.querySelectorAll(".nine-tab-item"),
|
|
847
|
+
}, "updateSplitters"), r = this.querySelector(".nine-tab-bar"), n = this.querySelector("nine-table-sheets-body"), l = r.querySelectorAll(".nine-tab-item"), c = n.querySelectorAll("nine-table-sheet");
|
|
848
848
|
if (!l[e]) return;
|
|
849
849
|
if (!s)
|
|
850
850
|
l.forEach((f, u) => {
|
|
851
851
|
f.classList.toggle("active", u === e);
|
|
852
|
-
}),
|
|
853
|
-
const
|
|
854
|
-
f.classList.toggle("active",
|
|
852
|
+
}), c.forEach((f, u) => {
|
|
853
|
+
const g = u === e;
|
|
854
|
+
f.classList.toggle("active", g), f.style.flex = g ? "1 1 100%" : "";
|
|
855
855
|
});
|
|
856
856
|
else {
|
|
857
857
|
const f = l[e], u = r.querySelectorAll(".nine-tab-item.active");
|
|
858
858
|
if (f.classList.contains("active") && u.length <= 1)
|
|
859
859
|
return;
|
|
860
860
|
f.classList.toggle("active");
|
|
861
|
-
const
|
|
862
|
-
|
|
861
|
+
const g = n.querySelector(`nine-table-sheet[data-index="${e}"]`);
|
|
862
|
+
g && (g.classList.toggle("active"), g.classList.contains("active") || (g.style.flex = ""));
|
|
863
863
|
}
|
|
864
864
|
const d = n.querySelectorAll("nine-table-sheet.active");
|
|
865
865
|
d == null || d.forEach((f) => {
|
|
@@ -868,34 +868,107 @@ const Jt = class Jt extends HTMLElement {
|
|
|
868
868
|
}, "#switchSheet"));
|
|
869
869
|
}
|
|
870
870
|
connectedCallback() {
|
|
871
|
-
t(this,
|
|
871
|
+
t(this, Mt).call(this);
|
|
872
872
|
}
|
|
873
873
|
};
|
|
874
|
-
|
|
875
|
-
let
|
|
876
|
-
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets",
|
|
877
|
-
var
|
|
878
|
-
const
|
|
874
|
+
Mt = new WeakMap(), ht = new WeakMap(), a(ne, "NineTableSheets");
|
|
875
|
+
let jt = ne;
|
|
876
|
+
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", jt);
|
|
877
|
+
var dt, R, ft, It;
|
|
878
|
+
const oe = class oe {
|
|
879
|
+
// π― μ΄μ { name: string, type: string } κ°μ²΄λ€μ λ°°μ΄λ‘ κ΄λ¦¬ν©λλ€.
|
|
880
|
+
constructor(i) {
|
|
881
|
+
h(this, dt);
|
|
882
|
+
h(this, R, []);
|
|
883
|
+
x(this, "add", /* @__PURE__ */ a((i, e = "string") => {
|
|
884
|
+
i.forEach((s) => {
|
|
885
|
+
t(this, R).some((o) => o.name === s) || t(this, R).push({ name: s, type: e });
|
|
886
|
+
}), t(this, ft).call(this);
|
|
887
|
+
}, "add"));
|
|
888
|
+
h(this, ft, /* @__PURE__ */ a(() => {
|
|
889
|
+
const i = /* @__PURE__ */ new Map();
|
|
890
|
+
t(this, R).forEach((e) => {
|
|
891
|
+
i.set(e.name, e.type);
|
|
892
|
+
}), b(this, R, Array.from(i, ([e, s]) => ({ name: e, type: s }))), b(this, R, t(this, R).filter((e) => e.name !== "" && e.name !== "__ng")), t(this, R).sort((e, s) => e.name.length < s.name.length ? 1 : -1);
|
|
893
|
+
}, "#adjust"));
|
|
894
|
+
h(this, It, /* @__PURE__ */ a(() => {
|
|
895
|
+
b(this, R, []);
|
|
896
|
+
const i = Array.from(t(this, dt).querySelectorAll("table"));
|
|
897
|
+
if (!(!i || i.length === 0)) {
|
|
898
|
+
for (const e of i)
|
|
899
|
+
M.log(e), $("[data-bind]", e).each((s, o) => {
|
|
900
|
+
const r = o.dataset.bind, n = o.getAttribute("data-type") || "string";
|
|
901
|
+
r && t(this, R).push({ name: r, type: n });
|
|
902
|
+
}), ["data-expr", "background-color", "color", "tooltip", "visible", "readonly", "enable-button", "enable-check", "class-expr", "icon-color", "icon-src"].forEach((s) => {
|
|
903
|
+
$(`[${s}]`, e).each((o, r) => {
|
|
904
|
+
var n = r.getAttribute(s);
|
|
905
|
+
if (n.indexOf("data.") < 0) {
|
|
906
|
+
const l = n.search(/[(]/g);
|
|
907
|
+
if (l > 0)
|
|
908
|
+
try {
|
|
909
|
+
n = String(window[n.substring(0, l).trim()]);
|
|
910
|
+
} catch {
|
|
911
|
+
n = "";
|
|
912
|
+
}
|
|
913
|
+
}
|
|
914
|
+
n.split("data.").forEach((l) => {
|
|
915
|
+
if (l.trim() != "") {
|
|
916
|
+
const c = l.search(/[^_A-Za-z0-9]/g);
|
|
917
|
+
let d = "";
|
|
918
|
+
c >= 0 ? d = l.substring(0, c) : n.startsWith("data.") && (d = l.replace("data.", "")), d && t(this, R).push({ name: d, type: "string" });
|
|
919
|
+
}
|
|
920
|
+
});
|
|
921
|
+
});
|
|
922
|
+
});
|
|
923
|
+
t(this, ft).call(this);
|
|
924
|
+
}
|
|
925
|
+
}, "#init"));
|
|
926
|
+
b(this, dt, i), t(this, It).call(this), M.log(this.get());
|
|
927
|
+
}
|
|
928
|
+
// π― κΈ°μ‘΄μ νλ μ΄λ¦λ§ μ°λ κ³³λ€κ³Όμ νΈνμ μν΄ μ΄λ¦ λ°°μ΄λ§ 리ν΄νλ λ©μλ μ μ§
|
|
929
|
+
get() {
|
|
930
|
+
return t(this, R).map((i) => i.name);
|
|
931
|
+
}
|
|
932
|
+
// π― λ΄λΆ κ°μ²΄ ν΅μ§Έλ‘ μ»κΈ°
|
|
933
|
+
getFields() {
|
|
934
|
+
return t(this, R);
|
|
935
|
+
}
|
|
936
|
+
// π― νΉμ νλμ λ°μ΄ν° νμ
μ‘°ν
|
|
937
|
+
getType(i) {
|
|
938
|
+
const e = t(this, R).find((s) => s.name === i);
|
|
939
|
+
return e ? e.type : "string";
|
|
940
|
+
}
|
|
941
|
+
indexOf(i) {
|
|
942
|
+
return t(this, R).findIndex((e) => e.name === i);
|
|
943
|
+
}
|
|
944
|
+
includes(i) {
|
|
945
|
+
return t(this, R).some((e) => e.name === i);
|
|
946
|
+
}
|
|
947
|
+
};
|
|
948
|
+
dt = new WeakMap(), R = new WeakMap(), ft = new WeakMap(), It = new WeakMap(), a(oe, "ngFields");
|
|
949
|
+
let Ft = oe;
|
|
950
|
+
var k, $t, ut, Wt;
|
|
951
|
+
const re = class re {
|
|
879
952
|
constructor(i) {
|
|
880
953
|
h(this, k);
|
|
881
|
-
h(this,
|
|
882
|
-
t(this,
|
|
954
|
+
h(this, $t, /* @__PURE__ */ a(() => {
|
|
955
|
+
t(this, Wt).call(this), new ResizeObserver((i) => {
|
|
883
956
|
for (let e of i)
|
|
884
|
-
t(this, k).getAttribute("auto-height") === "true" && t(this,
|
|
957
|
+
t(this, k).getAttribute("auto-height") === "true" && t(this, ut).call(this);
|
|
885
958
|
}).observe(t(this, k));
|
|
886
959
|
}, "#init"));
|
|
887
|
-
h(this,
|
|
888
|
-
var
|
|
960
|
+
h(this, ut, /* @__PURE__ */ a(() => {
|
|
961
|
+
var c, d;
|
|
889
962
|
const i = Array.from(t(this, k).shadowRoot.querySelectorAll("nine-table-sheet.active"));
|
|
890
963
|
if (i.length === 0) return;
|
|
891
|
-
const e = parseInt(t(this, k).getAttribute("max-display-row"), 10) || 10, s = Math.max(...i.map((f) => f.getRowHeight())), o = (
|
|
964
|
+
const e = parseInt(t(this, k).getAttribute("max-display-row"), 10) || 10, s = Math.max(...i.map((f) => f.getRowHeight())), o = (c = t(this, k).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : c.getBoundingClientRect().height, r = (d = t(this, k).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : d.getBoundingClientRect().height, n = pt.SCROLLBAR_SIZE, l = e * s + o + r + n;
|
|
892
965
|
t(this, k).style.height = `${l}px`;
|
|
893
966
|
}, "#applyAutoHeight"));
|
|
894
|
-
h(this,
|
|
895
|
-
const e = Array.from(t(this, k).children).filter((
|
|
896
|
-
const u = `<nine-table-sheet class="${d === 0 ? "active" : ""}" data-index="${d}"></nine-table-sheet>`,
|
|
897
|
-
return u +
|
|
898
|
-
}).join(""), n = e.map((
|
|
967
|
+
h(this, Wt, /* @__PURE__ */ a(() => {
|
|
968
|
+
const e = Array.from(t(this, k).children).filter((c) => c.tagName === "TABLE"), s = t(this, k).getAttribute("auto-height") === "true", o = e.length, r = e.map((c, d) => {
|
|
969
|
+
const u = `<nine-table-sheet class="${d === 0 ? "active" : ""}" data-index="${d}"></nine-table-sheet>`, g = d < o - 1 ? `<nine-splitter class="h" data-split-index="${d}"></nine-splitter>` : "";
|
|
970
|
+
return u + g;
|
|
971
|
+
}).join(""), n = e.map((c, d) => `<div class="nine-tab-item ${d === 0 ? "active" : ""}" data-index="${d}">Sheet ${d + 1}</div>`).join("");
|
|
899
972
|
t(this, k).shadowRoot.innerHTML = `
|
|
900
973
|
<style>
|
|
901
974
|
:host {
|
|
@@ -996,95 +1069,95 @@ const Qt = class Qt {
|
|
|
996
1069
|
<nine-table-footer></nine-table-footer>
|
|
997
1070
|
`;
|
|
998
1071
|
const l = t(this, k).shadowRoot.querySelectorAll("nine-table-sheet");
|
|
999
|
-
l == null || l.forEach((
|
|
1072
|
+
l == null || l.forEach((c, d) => {
|
|
1000
1073
|
e[d] && setTimeout(() => {
|
|
1001
|
-
|
|
1074
|
+
c.generate(e[d]), s && t(this, ut).call(this);
|
|
1002
1075
|
});
|
|
1003
1076
|
});
|
|
1004
1077
|
}, "#render"));
|
|
1005
|
-
|
|
1078
|
+
b(this, k, i), t(this, $t).call(this);
|
|
1006
1079
|
}
|
|
1007
1080
|
};
|
|
1008
|
-
k = new WeakMap(),
|
|
1009
|
-
let
|
|
1010
|
-
var
|
|
1011
|
-
const
|
|
1081
|
+
k = new WeakMap(), $t = new WeakMap(), ut = new WeakMap(), Wt = new WeakMap(), a(re, "LayoutManager");
|
|
1082
|
+
let Kt = re;
|
|
1083
|
+
var bt, et;
|
|
1084
|
+
const le = class le {
|
|
1012
1085
|
constructor(i) {
|
|
1013
|
-
h(this,
|
|
1014
|
-
h(this,
|
|
1015
|
-
x(this, "count", /* @__PURE__ */
|
|
1016
|
-
|
|
1086
|
+
h(this, bt);
|
|
1087
|
+
h(this, et, -1);
|
|
1088
|
+
x(this, "count", /* @__PURE__ */ a(() => t(this, bt).rawRecords.length, "count"));
|
|
1089
|
+
b(this, bt, i);
|
|
1017
1090
|
}
|
|
1018
1091
|
get at() {
|
|
1019
|
-
return t(this,
|
|
1092
|
+
return t(this, et);
|
|
1020
1093
|
}
|
|
1021
1094
|
set at(i) {
|
|
1022
|
-
|
|
1095
|
+
b(this, et, parseInt(i, 10)), body && !body.querySelector(`tbody.bindable tr[data-row="${t(this, et)}"]`) && setTimeout(() => {
|
|
1023
1096
|
});
|
|
1024
1097
|
}
|
|
1025
1098
|
};
|
|
1026
|
-
|
|
1027
|
-
let
|
|
1028
|
-
var
|
|
1029
|
-
const
|
|
1099
|
+
bt = new WeakMap(), et = new WeakMap(), a(le, "ngRow");
|
|
1100
|
+
let Zt = le;
|
|
1101
|
+
var T, S, q, it, Ot, D, zt, F, gt, Dt, Nt, st;
|
|
1102
|
+
const L = class L {
|
|
1030
1103
|
constructor(i, e) {
|
|
1031
|
-
h(this,
|
|
1104
|
+
h(this, T);
|
|
1032
1105
|
h(this, S);
|
|
1033
|
-
h(this,
|
|
1034
|
-
h(this,
|
|
1035
|
-
h(this,
|
|
1036
|
-
h(this,
|
|
1037
|
-
h(this,
|
|
1038
|
-
|
|
1039
|
-
const i = t(this,
|
|
1106
|
+
h(this, q, []);
|
|
1107
|
+
h(this, it, []);
|
|
1108
|
+
h(this, Ot, 0);
|
|
1109
|
+
h(this, D, []);
|
|
1110
|
+
h(this, zt, /* @__PURE__ */ a(() => {
|
|
1111
|
+
b(this, D, []);
|
|
1112
|
+
const i = t(this, T).template || [];
|
|
1040
1113
|
Array.from(i).forEach((e) => {
|
|
1041
1114
|
var s;
|
|
1042
|
-
t(this,
|
|
1115
|
+
t(this, D).push(((s = e.getBoundingClientRect) == null ? void 0 : s.call(e).height) || 24);
|
|
1043
1116
|
}), (t(this, S).rawRecords || []).forEach((e) => {
|
|
1044
|
-
e.__ng || (e.__ng = t(this,
|
|
1117
|
+
e.__ng || (e.__ng = t(this, gt).call(this)), e.__ng.height = t(this, D).slice();
|
|
1045
1118
|
});
|
|
1046
1119
|
}, "#initialize"));
|
|
1047
|
-
h(this,
|
|
1048
|
-
t(this,
|
|
1120
|
+
h(this, F, /* @__PURE__ */ a(() => {
|
|
1121
|
+
t(this, T).shadowRoot.querySelectorAll("nine-table-sheet").forEach((i) => {
|
|
1049
1122
|
i.invalidate();
|
|
1050
1123
|
});
|
|
1051
1124
|
}, "#invalidate"));
|
|
1052
|
-
x(this, "get", /* @__PURE__ */
|
|
1125
|
+
x(this, "get", /* @__PURE__ */ a((i, e) => {
|
|
1053
1126
|
var r;
|
|
1054
1127
|
const s = this.getValidData();
|
|
1055
1128
|
if (!s || s.length <= 0) return;
|
|
1056
|
-
if (i == null) return t(this,
|
|
1129
|
+
if (i == null) return t(this, st).call(this, s);
|
|
1057
1130
|
if (i < 0 || i >= s.length) return null;
|
|
1058
|
-
const o = typeof ((r = t(this,
|
|
1131
|
+
const o = typeof ((r = t(this, T).fields) == null ? void 0 : r.get) == "function" ? t(this, T).fields.get() : [];
|
|
1059
1132
|
if (e != null) {
|
|
1060
1133
|
const n = o.indexOf(e);
|
|
1061
1134
|
return n >= 0 ? s[i].v[n] : null;
|
|
1062
1135
|
}
|
|
1063
|
-
return t(this,
|
|
1136
|
+
return t(this, st).call(this, s[i]);
|
|
1064
1137
|
}, "get"));
|
|
1065
|
-
x(this, "set", /* @__PURE__ */
|
|
1066
|
-
this.clear(), this.add(i, !1), t(this,
|
|
1138
|
+
x(this, "set", /* @__PURE__ */ a((i) => {
|
|
1139
|
+
this.clear(), this.add(i, !1), t(this, F).call(this);
|
|
1067
1140
|
}, "set"));
|
|
1068
|
-
h(this,
|
|
1069
|
-
rowState:
|
|
1141
|
+
h(this, gt, /* @__PURE__ */ a(() => ({
|
|
1142
|
+
rowState: L.ROW_STATE.EMPTY,
|
|
1070
1143
|
deleted: !1,
|
|
1071
1144
|
filtered: !1,
|
|
1072
|
-
height: t(this,
|
|
1145
|
+
height: t(this, D).slice(),
|
|
1073
1146
|
o: {},
|
|
1074
1147
|
c: {},
|
|
1075
|
-
_: [0, 0, 0, 0,
|
|
1148
|
+
_: [0, 0, 0, 0, L.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this, D).slice(), -1, {}, {}]
|
|
1076
1149
|
}), "#getDefaultMeta"));
|
|
1077
|
-
x(this, "reset", /* @__PURE__ */
|
|
1078
|
-
|
|
1150
|
+
x(this, "reset", /* @__PURE__ */ a(() => {
|
|
1151
|
+
b(this, q, []), b(this, it, []), t(this, F).call(this);
|
|
1079
1152
|
}, "reset"));
|
|
1080
|
-
x(this, "clear", /* @__PURE__ */
|
|
1153
|
+
x(this, "clear", /* @__PURE__ */ a(() => {
|
|
1081
1154
|
var i;
|
|
1082
|
-
t(this, S).rawRecords = [],
|
|
1155
|
+
t(this, S).rawRecords = [], b(this, q, []), b(this, it, []), (i = t(this, S).viewRecords) != null && i.reset && t(this, S).viewRecords.reset();
|
|
1083
1156
|
}, "clear"));
|
|
1084
|
-
h(this,
|
|
1157
|
+
h(this, Dt, /* @__PURE__ */ a((i) => {
|
|
1085
1158
|
var o;
|
|
1086
1159
|
Array.isArray(i) || (i = [i]);
|
|
1087
|
-
const e = typeof ((o = t(this,
|
|
1160
|
+
const e = typeof ((o = t(this, T).fields) == null ? void 0 : o.get) == "function" ? t(this, T).fields.get() : Object.keys(i[0] || {}), s = [];
|
|
1088
1161
|
return i.forEach((r) => {
|
|
1089
1162
|
const n = { v: [] };
|
|
1090
1163
|
e.forEach((l) => {
|
|
@@ -1092,94 +1165,94 @@ const T = class T {
|
|
|
1092
1165
|
}), s.push(n);
|
|
1093
1166
|
}), s;
|
|
1094
1167
|
}, "#json2Array"));
|
|
1095
|
-
h(this,
|
|
1096
|
-
e.__ng = t(this,
|
|
1168
|
+
h(this, Nt, /* @__PURE__ */ a((i) => (Array.isArray(i) || (i = [i]), i.forEach((e) => {
|
|
1169
|
+
e.__ng = t(this, gt).call(this), e.__ng.rowid = this.nextId, e.__ng.rowState = L.ROW_STATE.INSERT, e.__ng._[0] = e.__ng.rowid;
|
|
1097
1170
|
}), i), "#defaultInsert"));
|
|
1098
|
-
x(this, "add", /* @__PURE__ */
|
|
1171
|
+
x(this, "add", /* @__PURE__ */ a((i, e = !0) => {
|
|
1099
1172
|
i === void 0 && (i = {});
|
|
1100
|
-
const s = t(this,
|
|
1101
|
-
t(this, S).rawRecords = t(this, S).rawRecords.concat(t(this,
|
|
1173
|
+
const s = t(this, Dt).call(this, i);
|
|
1174
|
+
t(this, S).rawRecords = t(this, S).rawRecords.concat(t(this, Nt).call(this, s)), this.resetRecords();
|
|
1102
1175
|
const o = this.count() - 1;
|
|
1103
1176
|
return e || s.forEach((r, n) => {
|
|
1104
1177
|
const l = t(this, S).rawRecords[o - n];
|
|
1105
|
-
l && (l.__ng.rowState =
|
|
1106
|
-
}), t(this,
|
|
1178
|
+
l && (l.__ng.rowState = L.ROW_STATE.EMPTY);
|
|
1179
|
+
}), t(this, F).call(this), o;
|
|
1107
1180
|
}, "add"));
|
|
1108
|
-
x(this, "delete", /* @__PURE__ */
|
|
1181
|
+
x(this, "delete", /* @__PURE__ */ a((i) => {
|
|
1109
1182
|
let e = [];
|
|
1110
1183
|
Array.isArray(i) ? e = i : typeof i > "u" ? e = [t(this, S).host.row.at] : e = [parseInt(i, 10)], e.sort((s, o) => o - s).forEach((s) => {
|
|
1111
|
-
if (t(this,
|
|
1112
|
-
const o = t(this,
|
|
1113
|
-
t(this,
|
|
1114
|
-
r.__ng.rowid === o && (r.__ng.deleted = !0, r.__ng.rowState =
|
|
1184
|
+
if (t(this, q)[s]) {
|
|
1185
|
+
const o = t(this, q)[s].__ng.rowid;
|
|
1186
|
+
t(this, q)[s].__ng.rowState === L.ROW_STATE.INSERT ? t(this, S).rawRecords = t(this, S).rawRecords.filter((r) => r.__ng.rowid !== o) : t(this, S).rawRecords.forEach((r) => {
|
|
1187
|
+
r.__ng.rowid === o && (r.__ng.deleted = !0, r.__ng.rowState = L.ROW_STATE.DELETE);
|
|
1115
1188
|
});
|
|
1116
1189
|
}
|
|
1117
|
-
}), this.resetRecords(), t(this,
|
|
1190
|
+
}), this.resetRecords(), t(this, F).call(this);
|
|
1118
1191
|
}, "delete"));
|
|
1119
|
-
x(this, "setValue", /* @__PURE__ */
|
|
1120
|
-
var
|
|
1192
|
+
x(this, "setValue", /* @__PURE__ */ a((i, e, s) => {
|
|
1193
|
+
var c;
|
|
1121
1194
|
i = parseInt(i, 10);
|
|
1122
|
-
const r = (typeof ((
|
|
1195
|
+
const r = (typeof ((c = t(this, T).fields) == null ? void 0 : c.get) == "function" ? t(this, T).fields.get() : []).indexOf(e);
|
|
1123
1196
|
if (r < 0) return;
|
|
1124
1197
|
const n = this.getValidData()[i];
|
|
1125
1198
|
if (!n) return;
|
|
1126
1199
|
const l = n.v[r];
|
|
1127
|
-
l !== s && n.__ng.rowState !==
|
|
1200
|
+
l !== s && n.__ng.rowState !== L.ROW_STATE.INSERT && (n.__ng.o.hasOwnProperty(e) || (n.__ng.o[e] = l), n.__ng.rowState = L.ROW_STATE.UPDATE), n.v[r] = s;
|
|
1128
1201
|
}, "setValue"));
|
|
1129
|
-
x(this, "resetRecords", /* @__PURE__ */
|
|
1130
|
-
|
|
1202
|
+
x(this, "resetRecords", /* @__PURE__ */ a(() => {
|
|
1203
|
+
b(this, it, t(this, S).rawRecords.filter((i) => !i.__ng.deleted)), b(this, q, t(this, S).rawRecords.filter((i) => !i.__ng.deleted && !i.__ng.filtered)), t(this, S).rawRecords.forEach((i, e) => {
|
|
1131
1204
|
i.__ng.rowidx = e;
|
|
1132
|
-
}), t(this,
|
|
1205
|
+
}), t(this, q).forEach((i, e) => {
|
|
1133
1206
|
i.__ng.i = e;
|
|
1134
1207
|
});
|
|
1135
1208
|
}, "resetRecords"));
|
|
1136
|
-
x(this, "getValidData", /* @__PURE__ */
|
|
1137
|
-
h(this,
|
|
1209
|
+
x(this, "getValidData", /* @__PURE__ */ a(() => (t(this, q).length === 0 && t(this, S).rawRecords.length > 0 && this.resetRecords(), t(this, q)), "getValidData"));
|
|
1210
|
+
h(this, st, /* @__PURE__ */ a((i) => {
|
|
1138
1211
|
var n;
|
|
1139
1212
|
if (!i) return i;
|
|
1140
|
-
const e = !Array.isArray(i), s = e ? [i] : i, o = typeof ((n = t(this,
|
|
1141
|
-
const
|
|
1213
|
+
const e = !Array.isArray(i), s = e ? [i] : i, o = typeof ((n = t(this, T).fields) == null ? void 0 : n.get) == "function" ? t(this, T).fields.get() : [], r = s.filter((l) => !l.__ng.deleted).map((l) => {
|
|
1214
|
+
const c = {};
|
|
1142
1215
|
return o.forEach((d, f) => {
|
|
1143
|
-
|
|
1144
|
-
}),
|
|
1216
|
+
c[d] = l.v ? l.v[f] : l[d];
|
|
1217
|
+
}), c.__ng = l.__ng, c;
|
|
1145
1218
|
});
|
|
1146
1219
|
return e ? r[0] : r;
|
|
1147
1220
|
}, "#conv"));
|
|
1148
|
-
x(this, "count", /* @__PURE__ */
|
|
1149
|
-
|
|
1221
|
+
x(this, "count", /* @__PURE__ */ a(() => this.getValidData().length, "count"));
|
|
1222
|
+
b(this, T, i), b(this, S, e), t(this, zt).call(this);
|
|
1150
1223
|
}
|
|
1151
1224
|
get source() {
|
|
1152
|
-
return t(this,
|
|
1225
|
+
return t(this, st).call(this, t(this, S).rawRecords);
|
|
1153
1226
|
}
|
|
1154
1227
|
set source(i) {
|
|
1155
1228
|
this.clear(), this.add(i, !1);
|
|
1156
1229
|
}
|
|
1157
1230
|
get nextId() {
|
|
1158
|
-
return ++
|
|
1231
|
+
return ++ue(this, Ot)._;
|
|
1159
1232
|
}
|
|
1160
1233
|
get length() {
|
|
1161
|
-
return t(this,
|
|
1234
|
+
return t(this, q).length;
|
|
1162
1235
|
}
|
|
1163
1236
|
getRowCount() {
|
|
1164
1237
|
return this.length;
|
|
1165
1238
|
}
|
|
1166
1239
|
};
|
|
1167
|
-
|
|
1168
|
-
x(
|
|
1240
|
+
T = new WeakMap(), S = new WeakMap(), q = new WeakMap(), it = new WeakMap(), Ot = new WeakMap(), D = new WeakMap(), zt = new WeakMap(), F = new WeakMap(), gt = new WeakMap(), Dt = new WeakMap(), Nt = new WeakMap(), st = new WeakMap(), a(L, "ngData"), // π― ν μν μ μ μμλ₯Ό ν΄λμ€ λ΄λΆλ‘ λ΄μ¬ν
|
|
1241
|
+
x(L, "ROW_STATE", {
|
|
1169
1242
|
EMPTY: "EMPTY",
|
|
1170
1243
|
NORMAL: "NORMAL",
|
|
1171
1244
|
INSERT: "INSERT",
|
|
1172
1245
|
UPDATE: "UPDATE",
|
|
1173
1246
|
DELETE: "DELETE"
|
|
1174
1247
|
});
|
|
1175
|
-
let
|
|
1176
|
-
var
|
|
1177
|
-
const
|
|
1248
|
+
let Gt = L;
|
|
1249
|
+
var K;
|
|
1250
|
+
const ae = class ae {
|
|
1178
1251
|
constructor(i) {
|
|
1179
|
-
h(this,
|
|
1180
|
-
|
|
1252
|
+
h(this, K);
|
|
1253
|
+
b(this, K, i), this.row = new Zt(this), this.data = new Gt(t(this, K), this), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.pageCnt = 25, this.viewRecords.reset = () => {
|
|
1181
1254
|
var e;
|
|
1182
|
-
(e = t(this,
|
|
1255
|
+
(e = t(this, K).view) != null && e.redraw && t(this, K).view.redraw();
|
|
1183
1256
|
}, this.setDataSource = (e) => {
|
|
1184
1257
|
this.data && this.data.reset(), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.data.set(e || []);
|
|
1185
1258
|
}, this.getRowState = (e) => {
|
|
@@ -1194,37 +1267,37 @@ const ee = class ee {
|
|
|
1194
1267
|
}, this.setDataSource([]);
|
|
1195
1268
|
}
|
|
1196
1269
|
};
|
|
1197
|
-
|
|
1198
|
-
let
|
|
1199
|
-
var
|
|
1200
|
-
const
|
|
1270
|
+
K = new WeakMap(), a(ae, "ngDataManager");
|
|
1271
|
+
let Jt = ae;
|
|
1272
|
+
var Z, Bt;
|
|
1273
|
+
const ce = class ce extends HTMLElement {
|
|
1201
1274
|
constructor() {
|
|
1202
1275
|
super();
|
|
1203
1276
|
//#created = false;
|
|
1204
|
-
h(this,
|
|
1205
|
-
h(this,
|
|
1206
|
-
this.attachShadow({ mode: "open" }),
|
|
1277
|
+
h(this, Z);
|
|
1278
|
+
h(this, Bt);
|
|
1279
|
+
this.attachShadow({ mode: "open" }), b(this, Z, new Jt(this)), this.fields = new Ft(this);
|
|
1207
1280
|
}
|
|
1208
1281
|
connectedCallback() {
|
|
1209
|
-
|
|
1282
|
+
b(this, Bt, new Kt(this)), M.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
|
|
1210
1283
|
}
|
|
1211
1284
|
disconnectedCallback() {
|
|
1212
|
-
|
|
1285
|
+
M.log("NineTable disconnected.");
|
|
1213
1286
|
}
|
|
1214
1287
|
// π― μΈλΆμμ grid.data.set(...) ννλ‘ μ κ·Όν μ μλλ‘ λ°μ΄ν° λ§€λμ μ€ν
|
|
1215
1288
|
get data() {
|
|
1216
|
-
return t(this,
|
|
1289
|
+
return t(this, Z).data;
|
|
1217
1290
|
}
|
|
1218
1291
|
// π― ν(row) κ΄λ ¨ μ μ΄ μ κ·Όμ μ€ν
|
|
1219
1292
|
get row() {
|
|
1220
|
-
return t(this,
|
|
1293
|
+
return t(this, Z).row;
|
|
1221
1294
|
}
|
|
1222
1295
|
// π― μ 체 λ°μ΄ν° λ§€λμ μ κ·Ό νμν κ²½μ°
|
|
1223
1296
|
get dataManager() {
|
|
1224
|
-
return t(this,
|
|
1297
|
+
return t(this, Z);
|
|
1225
1298
|
}
|
|
1226
1299
|
};
|
|
1227
|
-
|
|
1228
|
-
let
|
|
1229
|
-
customElements.get("nine-table") || customElements.define("nine-table",
|
|
1300
|
+
Z = new WeakMap(), Bt = new WeakMap(), a(ce, "NineTable");
|
|
1301
|
+
let Qt = ce;
|
|
1302
|
+
customElements.get("nine-table") || customElements.define("nine-table", Qt);
|
|
1230
1303
|
//# sourceMappingURL=nine-table.js.map
|