@ninebone/table 0.0.291 β 0.0.292
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 +484 -333
- package/dist/nine-table.js.map +1 -1
- package/dist/nine-table.umd.js +72 -10
- 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
|
|
3
|
-
throw TypeError(
|
|
1
|
+
var Jt = Object.defineProperty;
|
|
2
|
+
var Qt = (m) => {
|
|
3
|
+
throw TypeError(m);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
var t = (
|
|
9
|
-
var
|
|
5
|
+
var ie = (m, i, e) => i in m ? Jt(m, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : m[i] = e;
|
|
6
|
+
var c = (m, i) => Jt(m, "name", { value: i, configurable: !0 });
|
|
7
|
+
var w = (m, i, e) => ie(m, typeof i != "symbol" ? i + "" : i, e), te = (m, i, e) => i.has(m) || Qt("Cannot " + e);
|
|
8
|
+
var t = (m, i, e) => (te(m, i, "read from private field"), e ? e.call(m) : i.get(m)), h = (m, i, e) => i.has(m) ? Qt("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(m) : i.set(m, e), g = (m, i, e, s) => (te(m, i, "write to private field"), s ? s.call(m, e) : i.set(m, e), e);
|
|
9
|
+
var ee = (m, i, e, s) => ({
|
|
10
10
|
set _(n) {
|
|
11
|
-
g(
|
|
11
|
+
g(m, i, n, e);
|
|
12
12
|
},
|
|
13
13
|
get _() {
|
|
14
|
-
return t(
|
|
14
|
+
return t(m, i, s);
|
|
15
15
|
}
|
|
16
16
|
});
|
|
17
|
-
import { trace as
|
|
18
|
-
const
|
|
17
|
+
import { trace as se } from "@ninebone/util";
|
|
18
|
+
const Nt = class Nt extends se.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
|
+
c(Nt, "Trace");
|
|
24
|
+
let Ct = Nt;
|
|
25
|
+
const G = new Ct();
|
|
26
|
+
var H, M, p, z, D, P, ct, B, at;
|
|
27
|
+
const Yt = class Yt extends HTMLElement {
|
|
28
28
|
constructor() {
|
|
29
29
|
super();
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
if (!t(this,
|
|
38
|
-
const e = t(this,
|
|
39
|
-
e && (g(this,
|
|
30
|
+
h(this, H);
|
|
31
|
+
h(this, M, !1);
|
|
32
|
+
h(this, p);
|
|
33
|
+
h(this, z);
|
|
34
|
+
h(this, D);
|
|
35
|
+
h(this, P);
|
|
36
|
+
h(this, ct, /* @__PURE__ */ c(() => {
|
|
37
|
+
if (!t(this, H)) return;
|
|
38
|
+
const e = t(this, H).querySelector(".ng-container-body");
|
|
39
|
+
e && (g(this, P, new ResizeObserver(() => {
|
|
40
40
|
this.refresh();
|
|
41
|
-
})), t(this,
|
|
41
|
+
})), t(this, P).observe(e));
|
|
42
42
|
}, "#observeResize"));
|
|
43
|
-
|
|
44
|
-
if (!t(this,
|
|
45
|
-
const e = t(this,
|
|
43
|
+
w(this, "refresh", /* @__PURE__ */ c(() => {
|
|
44
|
+
if (!t(this, H) || !t(this, p) || t(this, M)) return;
|
|
45
|
+
const e = t(this, p).container, s = e.querySelector("table");
|
|
46
46
|
if (!s) return;
|
|
47
|
-
const n = t(this,
|
|
48
|
-
if (l !== 0 &&
|
|
47
|
+
const n = t(this, p).track, r = t(this, p).thumb, o = t(this, H).querySelector(".ng-container-bottom"), l = e.clientWidth, a = s.scrollWidth;
|
|
48
|
+
if (l !== 0 && a > l)
|
|
49
49
|
o && (o.style.display = "flex");
|
|
50
50
|
else {
|
|
51
51
|
o && (o.style.display = "none");
|
|
@@ -53,66 +53,66 @@ const Wt = class Wt extends HTMLElement {
|
|
|
53
53
|
}
|
|
54
54
|
const d = n.clientWidth;
|
|
55
55
|
if (d <= 0) return;
|
|
56
|
-
const u = Math.max(Math.min(d * (l /
|
|
56
|
+
const u = Math.max(Math.min(d * (l / a), d), 20);
|
|
57
57
|
r.style.width = `${u}px`;
|
|
58
|
-
const f = e.scrollLeft,
|
|
59
|
-
let
|
|
60
|
-
|
|
61
|
-
const
|
|
62
|
-
|
|
58
|
+
const f = e.scrollLeft, b = a - l;
|
|
59
|
+
let y = 0;
|
|
60
|
+
b > 0 && (y = parseInt(f / b * (d - u), 10)), y < 0 && (y = 0);
|
|
61
|
+
const x = d - u;
|
|
62
|
+
y > x && (y = x), r.style.left = `${y}px`, G.log(y), t(this, p).left.disabled = y === 0, t(this, p).right.disabled = y >= x - 1;
|
|
63
63
|
}, "refresh"));
|
|
64
|
-
|
|
65
|
-
if (!t(this,
|
|
66
|
-
const s = t(this,
|
|
64
|
+
h(this, B, /* @__PURE__ */ c((e) => {
|
|
65
|
+
if (!t(this, p)) return !1;
|
|
66
|
+
const s = t(this, p).container, n = s.querySelector("table");
|
|
67
67
|
if (!n) return !1;
|
|
68
|
-
const r = t(this,
|
|
68
|
+
const r = t(this, p).track.getBoundingClientRect(), o = t(this, p).thumb.clientWidth;
|
|
69
69
|
let l = e;
|
|
70
70
|
l < 0 && (l = 0);
|
|
71
|
-
const
|
|
72
|
-
l >
|
|
71
|
+
const a = r.width - o;
|
|
72
|
+
l > a && (l = a), l = parseInt(l, 10), t(this, p).thumb.style.left = `${l}px`, t(this, p).left.disabled = l === 0, t(this, p).right.disabled = l >= a - 1;
|
|
73
73
|
const d = s.clientWidth, f = n.scrollWidth - d;
|
|
74
|
-
return
|
|
74
|
+
return a > 0 && f > 0 && (s.scrollLeft = l / a * f), l > 0 && l < a - 1;
|
|
75
75
|
}, "#thumbMoveTo"));
|
|
76
|
-
|
|
77
|
-
const e = /* @__PURE__ */
|
|
78
|
-
clearInterval(t(this,
|
|
79
|
-
const r = parseInt(t(this,
|
|
80
|
-
t(this,
|
|
81
|
-
clearInterval(t(this,
|
|
82
|
-
const o = parseInt(t(this,
|
|
83
|
-
t(this,
|
|
76
|
+
h(this, at, /* @__PURE__ */ c(() => {
|
|
77
|
+
const e = /* @__PURE__ */ c((n) => {
|
|
78
|
+
clearInterval(t(this, z)), clearInterval(t(this, D));
|
|
79
|
+
const r = parseInt(t(this, p).thumb.style.left || 0, 10);
|
|
80
|
+
t(this, B).call(this, r + n), g(this, z, setInterval(() => {
|
|
81
|
+
clearInterval(t(this, z)), g(this, D, setInterval(() => {
|
|
82
|
+
const o = parseInt(t(this, p).thumb.style.left || 0, 10);
|
|
83
|
+
t(this, B).call(this, o + n) || clearInterval(t(this, D));
|
|
84
84
|
}, 50));
|
|
85
85
|
}, 500));
|
|
86
|
-
}, "delayScroll"), s = /* @__PURE__ */
|
|
87
|
-
clearInterval(t(this,
|
|
86
|
+
}, "delayScroll"), s = /* @__PURE__ */ c(() => {
|
|
87
|
+
clearInterval(t(this, z)), clearInterval(t(this, D));
|
|
88
88
|
}, "clearTimer");
|
|
89
89
|
["mouseup", "mouseleave", "touchend"].forEach((n) => {
|
|
90
|
-
t(this,
|
|
91
|
-
}), t(this,
|
|
90
|
+
t(this, p).left.addEventListener(n, s), t(this, p).right.addEventListener(n, s), t(this, p).track.addEventListener(n, s);
|
|
91
|
+
}), t(this, p).left.addEventListener("mousedown", (n) => {
|
|
92
92
|
n.button === 0 && e(-20);
|
|
93
|
-
}), t(this,
|
|
93
|
+
}), t(this, p).right.addEventListener("mousedown", (n) => {
|
|
94
94
|
n.button === 0 && e(20);
|
|
95
|
-
}), t(this,
|
|
95
|
+
}), t(this, p).left.addEventListener("touchstart", () => e(-20)), t(this, p).right.addEventListener("touchstart", () => e(20)), t(this, p).track.addEventListener("mousedown", (n) => {
|
|
96
96
|
if (n.button !== 0) return;
|
|
97
97
|
n.preventDefault();
|
|
98
|
-
const r = t(this,
|
|
99
|
-
t(this,
|
|
100
|
-
}), t(this,
|
|
98
|
+
const r = t(this, p).track.getBoundingClientRect(), o = t(this, p).thumb.clientWidth;
|
|
99
|
+
t(this, B).call(this, n.clientX - r.left - o / 2);
|
|
100
|
+
}), t(this, p).thumb.addEventListener("mousedown", (n) => {
|
|
101
101
|
if (n.button !== 0) return;
|
|
102
|
-
n.stopPropagation(), n.preventDefault(), g(this,
|
|
103
|
-
const r = /* @__PURE__ */
|
|
104
|
-
if (!t(this,
|
|
105
|
-
const
|
|
106
|
-
t(this,
|
|
107
|
-
}, "onMouseMove"), o = /* @__PURE__ */
|
|
108
|
-
g(this,
|
|
102
|
+
n.stopPropagation(), n.preventDefault(), g(this, M, !0), this.shiftX = n.clientX - t(this, p).thumb.getBoundingClientRect().left;
|
|
103
|
+
const r = /* @__PURE__ */ c((l) => {
|
|
104
|
+
if (!t(this, M)) return;
|
|
105
|
+
const a = t(this, p).track.getBoundingClientRect();
|
|
106
|
+
t(this, B).call(this, l.clientX - a.left - this.shiftX);
|
|
107
|
+
}, "onMouseMove"), o = /* @__PURE__ */ c(() => {
|
|
108
|
+
g(this, M, !1), s(), document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", o), this.refresh();
|
|
109
109
|
}, "onMouseUp");
|
|
110
110
|
document.addEventListener("mousemove", r), document.addEventListener("mouseup", o);
|
|
111
111
|
});
|
|
112
112
|
}, "#init"));
|
|
113
113
|
}
|
|
114
114
|
connectedCallback() {
|
|
115
|
-
if (g(this,
|
|
115
|
+
if (g(this, H, this.closest("nine-table-sheet") || this.getRootNode().host), !t(this, H)) return;
|
|
116
116
|
this.innerHTML = `
|
|
117
117
|
<style>
|
|
118
118
|
nine-table-hscrollbar {
|
|
@@ -176,38 +176,189 @@ const Wt = class Wt 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__ */ c(() => {
|
|
180
|
+
const s = t(this, H).querySelector(".ng-container-body");
|
|
181
181
|
if (!s) {
|
|
182
182
|
setTimeout(e, 10);
|
|
183
183
|
return;
|
|
184
184
|
}
|
|
185
|
-
g(this,
|
|
185
|
+
g(this, p, {
|
|
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, M) || this.refresh();
|
|
193
|
+
}), t(this, at).call(this), t(this, ct).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
|
+
}
|
|
200
|
+
};
|
|
201
|
+
H = new WeakMap(), M = new WeakMap(), p = new WeakMap(), z = new WeakMap(), D = new WeakMap(), P = new WeakMap(), ct = new WeakMap(), B = new WeakMap(), at = new WeakMap(), c(Yt, "NineTableHScrollBar");
|
|
202
|
+
let _t = Yt;
|
|
203
|
+
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", _t);
|
|
204
|
+
var N, I, S, Q, tt, ht;
|
|
205
|
+
const Vt = class Vt extends HTMLElement {
|
|
206
|
+
constructor() {
|
|
207
|
+
super();
|
|
208
|
+
h(this, N);
|
|
209
|
+
h(this, I, !1);
|
|
210
|
+
h(this, S);
|
|
211
|
+
h(this, Q, 0);
|
|
212
|
+
h(this, tt, 0);
|
|
213
|
+
/**
|
|
214
|
+
* π― μ€ν¬λ‘€λ° μμΉ λ° μΈλΈ ν¬κΈ° κ°±μ
|
|
215
|
+
*/
|
|
216
|
+
w(this, "refresh", /* @__PURE__ */ c(() => {
|
|
217
|
+
if (!t(this, N) || !t(this, S) || t(this, I)) return;
|
|
218
|
+
const e = t(this, S).container, s = e.querySelector("table");
|
|
219
|
+
if (!s) return;
|
|
220
|
+
const n = t(this, S).track, r = t(this, S).thumb, o = e.clientHeight, l = s.scrollHeight;
|
|
221
|
+
if (l <= o) {
|
|
222
|
+
r.style.display = "none", t(this, S).top.disabled = !0, t(this, S).bottom.disabled = !0;
|
|
223
|
+
return;
|
|
224
|
+
} else
|
|
225
|
+
r.style.display = "block";
|
|
226
|
+
const a = n.clientHeight;
|
|
227
|
+
if (a <= 0) return;
|
|
228
|
+
const d = Math.max(Math.min(a * (o / l), a), 20);
|
|
229
|
+
r.style.height = `${d}px`;
|
|
230
|
+
const u = e.scrollTop, f = l - o;
|
|
231
|
+
let b = 0;
|
|
232
|
+
f > 0 && (b = u / f * (a - d));
|
|
233
|
+
const y = a - d;
|
|
234
|
+
b < 0 && (b = 0), b > y && (b = y), r.style.top = `${b}px`, t(this, S).top.disabled = u <= 0, t(this, S).bottom.disabled = u >= f - 1;
|
|
235
|
+
}, "refresh"));
|
|
236
|
+
h(this, ht, /* @__PURE__ */ c(() => {
|
|
237
|
+
const e = t(this, S).container;
|
|
238
|
+
e.addEventListener("scroll", () => {
|
|
239
|
+
t(this, I) || this.refresh();
|
|
240
|
+
}), t(this, S).thumb.addEventListener("mousedown", (s) => {
|
|
241
|
+
if (s.button !== 0) return;
|
|
242
|
+
s.stopPropagation(), s.preventDefault(), g(this, I, !0), g(this, Q, s.clientY), g(this, tt, e.scrollTop);
|
|
243
|
+
const n = /* @__PURE__ */ c((o) => {
|
|
244
|
+
if (!t(this, I)) return;
|
|
245
|
+
const l = t(this, S).track.getBoundingClientRect(), a = t(this, S).thumb.clientHeight, u = l.height - a, f = o.clientY - t(this, Q), b = e.clientHeight, x = table.scrollHeight - b;
|
|
246
|
+
if (u > 0 && x > 0) {
|
|
247
|
+
const L = f / u * x;
|
|
248
|
+
e.scrollTop = t(this, tt) + L;
|
|
249
|
+
}
|
|
250
|
+
this.refresh();
|
|
251
|
+
}, "onMouseMove"), r = /* @__PURE__ */ c(() => {
|
|
252
|
+
g(this, I, !1), document.removeEventListener("mousemove", n), document.removeEventListener("mouseup", r), this.refresh();
|
|
253
|
+
}, "onMouseUp");
|
|
254
|
+
document.addEventListener("mousemove", n), document.addEventListener("mouseup", r);
|
|
255
|
+
}), t(this, S).track.addEventListener("mousedown", (s) => {
|
|
256
|
+
if (s.button !== 0 || s.target === t(this, S).thumb) return;
|
|
257
|
+
const n = t(this, S).track.getBoundingClientRect(), r = t(this, S).thumb.clientHeight, o = s.clientY - n.top - r / 2, a = n.height - r, d = e.clientHeight, f = e.querySelector("table").scrollHeight - d;
|
|
258
|
+
if (a > 0 && f > 0) {
|
|
259
|
+
const b = Math.max(0, Math.min(1, o / a));
|
|
260
|
+
e.scrollTop = b * f;
|
|
261
|
+
}
|
|
262
|
+
this.refresh();
|
|
263
|
+
}), t(this, S).top.addEventListener("click", () => {
|
|
264
|
+
e.scrollTop -= 40;
|
|
265
|
+
}), t(this, S).bottom.addEventListener("click", () => {
|
|
266
|
+
e.scrollTop += 40;
|
|
267
|
+
});
|
|
268
|
+
}, "#init"));
|
|
269
|
+
}
|
|
270
|
+
connectedCallback() {
|
|
271
|
+
if (g(this, N, this.closest("nine-table-sheet") || this.getRootNode().host), !t(this, N)) return;
|
|
272
|
+
this.innerHTML = `
|
|
273
|
+
<style>
|
|
274
|
+
nine-table-vscrollbar {
|
|
275
|
+
display: flex;
|
|
276
|
+
flex-direction: column;
|
|
277
|
+
width: 16px;
|
|
278
|
+
height: 100%;
|
|
279
|
+
background: #f9fafb;
|
|
280
|
+
box-sizing: border-box;
|
|
281
|
+
user-select: none;
|
|
282
|
+
position: relative;
|
|
283
|
+
}
|
|
284
|
+
nine-table-vscrollbar button {
|
|
285
|
+
height: 16px;
|
|
286
|
+
width: 100%;
|
|
287
|
+
background: #f3f4f6;
|
|
288
|
+
border: none;
|
|
289
|
+
cursor: pointer;
|
|
290
|
+
display: flex;
|
|
291
|
+
align-items: center;
|
|
292
|
+
justify-content: center;
|
|
293
|
+
padding: 0;
|
|
294
|
+
flex-shrink: 0;
|
|
295
|
+
z-index: 2;
|
|
296
|
+
}
|
|
297
|
+
nine-table-vscrollbar button:disabled {
|
|
298
|
+
opacity: 0.4;
|
|
299
|
+
cursor: default;
|
|
300
|
+
}
|
|
301
|
+
nine-table-vscrollbar .ng-scroll-icon {
|
|
302
|
+
width: 6px;
|
|
303
|
+
height: 6px;
|
|
304
|
+
border-top: 2px solid #6b7280;
|
|
305
|
+
border-right: 2px solid #6b7280;
|
|
306
|
+
}
|
|
307
|
+
nine-table-vscrollbar .ng-scroll-top .ng-scroll-icon { transform: rotate(-45deg); margin-top: 2px; }
|
|
308
|
+
nine-table-vscrollbar .ng-scroll-bottom .ng-scroll-icon { transform: rotate(135deg); margin-bottom: 2px; }
|
|
309
|
+
nine-table-vscrollbar .ng-scroll-track {
|
|
310
|
+
flex: 1;
|
|
311
|
+
width: 100%;
|
|
312
|
+
position: relative;
|
|
313
|
+
background: #f3f4f6;
|
|
314
|
+
overflow: hidden;
|
|
315
|
+
}
|
|
316
|
+
nine-table-vscrollbar .ng-scroll-thumb {
|
|
317
|
+
position: absolute;
|
|
318
|
+
left: 2px;
|
|
319
|
+
right: 2px;
|
|
320
|
+
top: 0px;
|
|
321
|
+
height: 30px;
|
|
322
|
+
background: #9ca3af;
|
|
323
|
+
border-radius: 4px;
|
|
324
|
+
cursor: pointer;
|
|
325
|
+
z-index: 1;
|
|
326
|
+
}
|
|
327
|
+
nine-table-vscrollbar .ng-scroll-thumb:hover {
|
|
328
|
+
background: #6b7280;
|
|
329
|
+
}
|
|
330
|
+
</style>
|
|
331
|
+
<button class='ng-scroll-top' disabled><div class='ng-scroll-icon'></div></button>
|
|
332
|
+
<div class='ng-scroll-track'><div class='ng-scroll-thumb'></div></div>
|
|
333
|
+
<button class='ng-scroll-bottom' disabled><div class='ng-scroll-icon'></div></button>
|
|
334
|
+
`;
|
|
335
|
+
const e = /* @__PURE__ */ c(() => {
|
|
336
|
+
const s = t(this, N).querySelector(".ng-container-body");
|
|
337
|
+
if (!s) {
|
|
338
|
+
setTimeout(e, 10);
|
|
339
|
+
return;
|
|
340
|
+
}
|
|
341
|
+
g(this, S, {
|
|
342
|
+
container: s,
|
|
343
|
+
track: this.querySelector(".ng-scroll-track"),
|
|
344
|
+
thumb: this.querySelector(".ng-scroll-thumb"),
|
|
345
|
+
top: this.querySelector(".ng-scroll-top"),
|
|
346
|
+
bottom: this.querySelector(".ng-scroll-bottom")
|
|
347
|
+
}), t(this, ht).call(this), this.refresh();
|
|
348
|
+
}, "initWhenReady");
|
|
349
|
+
e();
|
|
199
350
|
}
|
|
200
351
|
};
|
|
201
|
-
|
|
202
|
-
let
|
|
203
|
-
customElements.get("nine-table-
|
|
204
|
-
var
|
|
205
|
-
const
|
|
352
|
+
N = new WeakMap(), I = new WeakMap(), S = new WeakMap(), Q = new WeakMap(), tt = new WeakMap(), ht = new WeakMap(), c(Vt, "NineTableVScrollBar");
|
|
353
|
+
let Mt = Vt;
|
|
354
|
+
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar", Mt);
|
|
355
|
+
var dt, et;
|
|
356
|
+
const C = class C {
|
|
206
357
|
/**
|
|
207
358
|
* π― λ μ΄μμ λ΄μ μ¬λ¬ rawTables λ°°μ΄μ μΌκ΄λ‘ λ°μ λ¨μΌ λ§μ€ν° ν
νλ¦ΏμΌλ‘ μ¬μ μ»΄νμΌν©λλ€.
|
|
208
359
|
*/
|
|
209
360
|
static compileAll(i) {
|
|
210
|
-
return Array.isArray(i) ? i.map((e) =>
|
|
361
|
+
return Array.isArray(i) ? i.map((e) => C.compile(e)) : [];
|
|
211
362
|
}
|
|
212
363
|
/**
|
|
213
364
|
* π― λ¨μΌ μλ³Έ ν
μ΄λΈμ λ°μ κΈ°λ³Έ ꡬ쑰 보μ λ° 2μ°¨μ 격μ μΈλ±μ€ μ¬μ λΆμ¬ μλ£λ λ§μ€ν° ν
μ΄λΈ λ°ν
|
|
@@ -216,15 +367,15 @@ const L = class L {
|
|
|
216
367
|
var n, r, o;
|
|
217
368
|
if (!i) return null;
|
|
218
369
|
const e = i.cloneNode(!0);
|
|
219
|
-
return t(n =
|
|
370
|
+
return t(n = C, dt).call(n, e), t(r = C, et).call(r, e, "thead"), t(o = C, et).call(o, e, "tbody"), Array.from(e.querySelectorAll("colgroup col")).forEach((l, a) => {
|
|
220
371
|
const d = l.getAttribute("fixed");
|
|
221
|
-
d && e.querySelectorAll(`[data-col="${
|
|
372
|
+
d && e.querySelectorAll(`[data-col="${a}"]`).forEach((u) => {
|
|
222
373
|
u.setAttribute("fixed", d);
|
|
223
374
|
});
|
|
224
375
|
}), e;
|
|
225
376
|
}
|
|
226
377
|
};
|
|
227
|
-
|
|
378
|
+
dt = new WeakMap(), et = new WeakMap(), c(C, "TableCompiler"), h(C, dt, /* @__PURE__ */ c((i) => {
|
|
228
379
|
if (!i.querySelector("colgroup")) {
|
|
229
380
|
const e = i.querySelector("tbody tr") || i.querySelector("tr"), s = e ? e.querySelectorAll("th, td").length : 1, n = document.createElement("colgroup"), r = Math.max(Math.floor(i.clientWidth / s), 100);
|
|
230
381
|
for (let o = 0; o < s; o++) {
|
|
@@ -238,31 +389,31 @@ rt = new WeakMap(), j = new WeakMap(), a(L, "TableCompiler"), c(L, rt, /* @__PUR
|
|
|
238
389
|
s ? s.after(e) : i.prepend(e);
|
|
239
390
|
}
|
|
240
391
|
i.classList.add("nine-table-element"), i.style.display = "table";
|
|
241
|
-
}, "#ensureTableStructure")),
|
|
392
|
+
}, "#ensureTableStructure")), h(C, et, /* @__PURE__ */ c((i, e) => {
|
|
242
393
|
const s = Array.from(i.querySelectorAll(e + " tr")), n = Array.from(i.querySelectorAll(e + " th," + e + " td")), r = s.length;
|
|
243
394
|
if (r === 0 || n.length === 0) return;
|
|
244
395
|
let o = 0;
|
|
245
|
-
n.forEach((
|
|
246
|
-
o +=
|
|
396
|
+
n.forEach((a) => {
|
|
397
|
+
o += a.colSpan || 1;
|
|
247
398
|
});
|
|
248
399
|
const l = Array.from(Array(r), () => Array(o).fill(null));
|
|
249
|
-
s.forEach((
|
|
250
|
-
const d =
|
|
400
|
+
s.forEach((a) => {
|
|
401
|
+
const d = a.sectionRowIndex;
|
|
251
402
|
let u = 0;
|
|
252
|
-
Array.from(
|
|
253
|
-
for (let
|
|
254
|
-
if (l[d][
|
|
255
|
-
u =
|
|
403
|
+
Array.from(a.querySelectorAll("th,td")).forEach((f) => {
|
|
404
|
+
for (let x = 0; x < l[d].length; x++)
|
|
405
|
+
if (l[d][x] === null) {
|
|
406
|
+
u = x;
|
|
256
407
|
break;
|
|
257
408
|
}
|
|
258
|
-
const
|
|
259
|
-
for (let
|
|
260
|
-
for (let
|
|
261
|
-
d +
|
|
409
|
+
const b = f.rowSpan || 1, y = f.colSpan || 1;
|
|
410
|
+
for (let x = 0; x < b; x++)
|
|
411
|
+
for (let L = 0; L < y; L++)
|
|
412
|
+
d + x < r && u + L < o && (l[d + x][u + L] = x === 0 && L === 0 ? "1" : "0");
|
|
262
413
|
});
|
|
263
|
-
}), s.forEach((
|
|
264
|
-
const d =
|
|
265
|
-
Array.from(
|
|
414
|
+
}), s.forEach((a) => {
|
|
415
|
+
const d = a.sectionRowIndex;
|
|
416
|
+
Array.from(a.querySelectorAll("th,td")).forEach((u) => {
|
|
266
417
|
for (let f = 0; f < l[d].length; f++)
|
|
267
418
|
if (l[d][f] === "1") {
|
|
268
419
|
u.dataset.col = f, l[d][f] = "0";
|
|
@@ -271,105 +422,105 @@ rt = new WeakMap(), j = new WeakMap(), a(L, "TableCompiler"), c(L, rt, /* @__PUR
|
|
|
271
422
|
});
|
|
272
423
|
});
|
|
273
424
|
}, "#resetColIndex"));
|
|
274
|
-
let
|
|
275
|
-
var
|
|
276
|
-
const
|
|
425
|
+
let It = C;
|
|
426
|
+
var E, _, R, $, Y, V, ft, ut, it, bt, gt, st, pt, yt;
|
|
427
|
+
const Xt = class Xt {
|
|
277
428
|
constructor(i) {
|
|
278
|
-
|
|
279
|
-
|
|
429
|
+
h(this, E);
|
|
430
|
+
h(this, _, /* @__PURE__ */ new Map());
|
|
280
431
|
// κ° μ»¨ν
μ΄λλ³ λ
립λ ν
νλ¦Ώ TR κ΄λ¦¬
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
432
|
+
h(this, R, null);
|
|
433
|
+
h(this, $, null);
|
|
434
|
+
h(this, Y, 0);
|
|
435
|
+
h(this, V, 40);
|
|
285
436
|
/**
|
|
286
437
|
* π― NineTableSheetμμ λ§μ€ν° ν
μ΄λΈμ μ λ¬λ°μ κ° μμλ³ ν
μ΄λΈ μμ± λ° ν
νλ¦Ώ μΆμΆ μΌμν
|
|
287
438
|
*/
|
|
288
439
|
// [RowManager.js μμ λ΄μ© λ°μ·]
|
|
289
|
-
|
|
290
|
-
g(this,
|
|
291
|
-
const s = t(this,
|
|
440
|
+
w(this, "initialize", /* @__PURE__ */ c(() => {
|
|
441
|
+
g(this, R, null), t(this, _).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((e) => {
|
|
442
|
+
const s = t(this, E).querySelector(e);
|
|
292
443
|
if (!s) return;
|
|
293
444
|
const n = s.querySelector("table");
|
|
294
445
|
if (!n) return;
|
|
295
446
|
const r = n.querySelector("tbody");
|
|
296
447
|
if (!r) return;
|
|
297
|
-
const l = Array.from(r.querySelectorAll("tr")).map((
|
|
298
|
-
t(this,
|
|
448
|
+
const l = Array.from(r.querySelectorAll("tr")).map((a) => a.cloneNode(!0));
|
|
449
|
+
t(this, _).set(e, l);
|
|
299
450
|
});
|
|
300
|
-
const i = t(this,
|
|
451
|
+
const i = t(this, E).querySelector(".ng-container-body");
|
|
301
452
|
if (i) {
|
|
302
|
-
t(this,
|
|
453
|
+
t(this, ut).call(this, i), t(this, st).call(this);
|
|
303
454
|
let e = i.scrollTop;
|
|
304
455
|
i.addEventListener("scroll", () => {
|
|
305
456
|
var n;
|
|
306
457
|
const s = i.scrollTop;
|
|
307
|
-
|
|
458
|
+
G.log(e, s), e !== s && (e = s, t(this, pt).call(this, s)), (n = t(this, E).querySelector("nine-table-vscrollbar")) == null || n.refresh();
|
|
308
459
|
});
|
|
309
460
|
}
|
|
310
461
|
}, "initialize"));
|
|
311
|
-
|
|
312
|
-
const s = t(this,
|
|
462
|
+
h(this, ft, /* @__PURE__ */ c((i, e) => {
|
|
463
|
+
const s = t(this, _).get(e);
|
|
313
464
|
if (!s || s.length === 0) return;
|
|
314
465
|
const n = i.querySelector("tbody");
|
|
315
466
|
if (!n) return;
|
|
316
467
|
n.querySelectorAll("tr:not(.nodata)").forEach((l) => l.remove());
|
|
317
468
|
const r = n.querySelector("tr.nodata"), o = document.createDocumentFragment();
|
|
318
|
-
for (let l = 0; l < t(this,
|
|
319
|
-
s.forEach((
|
|
320
|
-
o.appendChild(
|
|
469
|
+
for (let l = 0; l < t(this, V); l++)
|
|
470
|
+
s.forEach((a) => {
|
|
471
|
+
o.appendChild(a.cloneNode(!0));
|
|
321
472
|
});
|
|
322
473
|
r ? r.before(o) : n.appendChild(o);
|
|
323
474
|
}, "#renderRows"));
|
|
324
475
|
/**
|
|
325
476
|
* π― ν
νλ¦Ώ TRλ€μ μ΄ λμ΄λ₯Ό μΈ‘μ νκ³ μΊμ±
|
|
326
477
|
*/
|
|
327
|
-
|
|
328
|
-
if (t(this,
|
|
329
|
-
return t(this,
|
|
330
|
-
const e = t(this,
|
|
478
|
+
h(this, ut, /* @__PURE__ */ c((i) => {
|
|
479
|
+
if (t(this, R) !== null && t(this, R) > 0)
|
|
480
|
+
return t(this, R);
|
|
481
|
+
const e = t(this, _).get(".ng-container-body");
|
|
331
482
|
if (!e || e.length === 0) return 24;
|
|
332
483
|
const s = i.querySelector("tbody");
|
|
333
484
|
if (!s) return 24;
|
|
334
|
-
s.querySelectorAll("tr:not(.nodata)").forEach((
|
|
485
|
+
s.querySelectorAll("tr:not(.nodata)").forEach((b) => b.remove());
|
|
335
486
|
const n = s.querySelector("tr.nodata"), r = document.createDocumentFragment();
|
|
336
|
-
e.forEach((
|
|
337
|
-
r.appendChild(
|
|
487
|
+
e.forEach((b) => {
|
|
488
|
+
r.appendChild(b.cloneNode(!0));
|
|
338
489
|
}), n ? n.before(r) : s.appendChild(r);
|
|
339
|
-
const o = t(this,
|
|
490
|
+
const o = t(this, E), l = o.style.display, a = o.style.visibility, d = o.style.position;
|
|
340
491
|
(l === "none" || window.getComputedStyle(o).display === "none") && (o.style.display = "block", o.style.visibility = "hidden", o.style.position = "absolute");
|
|
341
492
|
let u = 0;
|
|
342
493
|
const f = s.querySelectorAll("tr:not(.nodata)");
|
|
343
|
-
return f.forEach((
|
|
344
|
-
u +=
|
|
345
|
-
}), f.forEach((
|
|
494
|
+
return f.forEach((b) => {
|
|
495
|
+
u += b.offsetHeight || b.getBoundingClientRect().height;
|
|
496
|
+
}), f.forEach((b) => b.remove()), o.style.display = l, o.style.visibility = a, o.style.position = d, g(this, R, u > 0 ? u : 24), t(this, it).call(this), G.log(`[RowManager] Height Cached: ${t(this, R)}px | RowCount: ${t(this, V)}`), t(this, R);
|
|
346
497
|
}, "#measureAndCacheHeight"));
|
|
347
|
-
|
|
348
|
-
if (t(this,
|
|
349
|
-
const i = Math.ceil(t(this,
|
|
350
|
-
g(this,
|
|
498
|
+
h(this, it, /* @__PURE__ */ c(() => {
|
|
499
|
+
if (t(this, Y) > 0 && t(this, R) > 0) {
|
|
500
|
+
const i = Math.ceil(t(this, Y) / t(this, R));
|
|
501
|
+
g(this, V, i + 20);
|
|
351
502
|
} else
|
|
352
|
-
g(this,
|
|
503
|
+
g(this, V, 40);
|
|
353
504
|
}, "#updateRowCount"));
|
|
354
|
-
|
|
355
|
-
var
|
|
356
|
-
const i = t(this,
|
|
505
|
+
h(this, bt, /* @__PURE__ */ c(() => {
|
|
506
|
+
var a, d, u;
|
|
507
|
+
const i = t(this, E).querySelector(".ng-container-left table"), e = t(this, E).querySelector(".ng-container-body table"), s = t(this, E).querySelector(".ng-container-right table");
|
|
357
508
|
if (!e) return;
|
|
358
509
|
const n = i ? Array.from(i.querySelectorAll("tr")) : [], r = Array.from(e.querySelectorAll("tr")), o = s ? Array.from(s.querySelectorAll("tr")) : [], l = Math.max(n.length, r.length, o.length);
|
|
359
510
|
for (let f = 0; f < l; f++) {
|
|
360
|
-
const
|
|
361
|
-
((
|
|
511
|
+
const b = [
|
|
512
|
+
((a = n[f]) == null ? void 0 : a.getBoundingClientRect().height) || 0,
|
|
362
513
|
((d = r[f]) == null ? void 0 : d.getBoundingClientRect().height) || 0,
|
|
363
514
|
((u = o[f]) == null ? void 0 : u.getBoundingClientRect().height) || 0
|
|
364
|
-
],
|
|
365
|
-
|
|
515
|
+
], y = Math.max(...b);
|
|
516
|
+
y > 0 && (n[f] && (n[f].style.height = `${y}px`), r[f] && (r[f].style.height = `${y}px`), o[f] && (o[f].style.height = `${y}px`));
|
|
366
517
|
}
|
|
367
518
|
}, "#syncRowHeights"));
|
|
368
519
|
/**
|
|
369
520
|
* π― ResizeObserver μ€μ : μνΈ ν¬κΈ° λ³κ²½ μ ν κ°μ μ¬μ°μ λ° μ¬λ λλ§
|
|
370
521
|
*/
|
|
371
|
-
|
|
372
|
-
!t(this,
|
|
522
|
+
h(this, gt, /* @__PURE__ */ c(() => {
|
|
523
|
+
!t(this, E) || !(t(this, E) instanceof HTMLElement) || (g(this, $, new ResizeObserver((i) => {
|
|
373
524
|
for (const e of i) {
|
|
374
525
|
const s = e.target;
|
|
375
526
|
if (!s.classList.contains("active")) continue;
|
|
@@ -379,70 +530,70 @@ const Ot = class Ot {
|
|
|
379
530
|
const o = s.querySelector("thead");
|
|
380
531
|
o && (r += o.offsetHeight || o.getBoundingClientRect().height);
|
|
381
532
|
const l = Math.max(n - r, 100);
|
|
382
|
-
t(this,
|
|
533
|
+
t(this, Y) !== l && (g(this, Y, l), t(this, it).call(this), t(this, R) !== null && t(this, st).call(this));
|
|
383
534
|
}
|
|
384
535
|
}
|
|
385
|
-
})), t(this,
|
|
536
|
+
})), t(this, $).observe(t(this, E)));
|
|
386
537
|
}, "#initResizeObserver"));
|
|
387
538
|
/**
|
|
388
539
|
* π― λ°λ λ° μ’μ° κ³ μ 컨ν
μ΄λ μ 체μ κ°κ°μ λ§λ ν
νλ¦Ώ ν λΌλ μ£Όμ
|
|
389
540
|
*/
|
|
390
|
-
|
|
541
|
+
h(this, st, /* @__PURE__ */ c(() => {
|
|
391
542
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((i) => {
|
|
392
|
-
const e = t(this,
|
|
393
|
-
e && e.querySelector("tbody") && t(this,
|
|
394
|
-
}), t(this,
|
|
543
|
+
const e = t(this, E).querySelector(i);
|
|
544
|
+
e && e.querySelector("tbody") && t(this, ft).call(this, e, i);
|
|
545
|
+
}), t(this, bt).call(this);
|
|
395
546
|
}, "#renderAllContainers"));
|
|
396
547
|
/**
|
|
397
548
|
* π― μ€ν¬λ‘€ μμΉμ λ°λ₯Έ λ°μ΄ν° λ°μΈλ© κ°±μ
|
|
398
549
|
*/
|
|
399
|
-
|
|
550
|
+
h(this, pt, /* @__PURE__ */ c((i) => {
|
|
400
551
|
var o;
|
|
401
|
-
const e = t(this,
|
|
552
|
+
const e = t(this, R);
|
|
402
553
|
if (!e || e <= 0) return;
|
|
403
|
-
const s = ((o = t(this,
|
|
554
|
+
const s = ((o = t(this, _).get(".ng-container-body")) == null ? void 0 : o.length) || 1, n = Math.floor(i / e), r = Math.max(0, n);
|
|
404
555
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((l) => {
|
|
405
|
-
const
|
|
406
|
-
if (!
|
|
407
|
-
const d =
|
|
556
|
+
const a = t(this, E).querySelector(l);
|
|
557
|
+
if (!a) return;
|
|
558
|
+
const d = a.querySelector("tbody");
|
|
408
559
|
if (!d) return;
|
|
409
|
-
Array.from(d.querySelectorAll("tr:not(.nodata)")).forEach((f,
|
|
410
|
-
const
|
|
411
|
-
|
|
560
|
+
Array.from(d.querySelectorAll("tr:not(.nodata)")).forEach((f, b) => {
|
|
561
|
+
const y = r + Math.floor(b / s), x = t(this, E).getData ? t(this, E).getData(y) : null;
|
|
562
|
+
x ? (f.style.display = "", t(this, yt).call(this, f, x, y)) : f.style.display = "none";
|
|
412
563
|
});
|
|
413
564
|
});
|
|
414
565
|
}, "#handleScroll"));
|
|
415
566
|
/**
|
|
416
567
|
* π― κ°λ³ TR μ리먼νΈμ μ€μ λ°μ΄ν° κ°μ κ½μμ£Όλ λ°μΈλ© λ©μλ
|
|
417
568
|
*/
|
|
418
|
-
|
|
569
|
+
h(this, yt, /* @__PURE__ */ c((i, e, s) => {
|
|
419
570
|
i.dataset.row = s, Array.from(i.cells).forEach((n) => {
|
|
420
571
|
const r = n.dataset.bind;
|
|
421
572
|
r && e[r] !== void 0 && (n.textContent = e[r]), n.dataset.row = s;
|
|
422
573
|
});
|
|
423
574
|
}, "#bindRowData"));
|
|
424
|
-
|
|
425
|
-
t(this,
|
|
575
|
+
w(this, "destroy", /* @__PURE__ */ c(() => {
|
|
576
|
+
t(this, $) && (t(this, $).disconnect(), g(this, $, null));
|
|
426
577
|
}, "destroy"));
|
|
427
|
-
g(this,
|
|
578
|
+
g(this, E, i), t(this, gt).call(this);
|
|
428
579
|
}
|
|
429
580
|
getRowHeight() {
|
|
430
|
-
return t(this,
|
|
581
|
+
return t(this, R);
|
|
431
582
|
}
|
|
432
583
|
templateLength(i = ".ng-container-body") {
|
|
433
584
|
var e;
|
|
434
|
-
return ((e = t(this,
|
|
585
|
+
return ((e = t(this, _).get(i)) == null ? void 0 : e.length) || 1;
|
|
435
586
|
}
|
|
436
587
|
};
|
|
437
|
-
|
|
438
|
-
let
|
|
439
|
-
var
|
|
440
|
-
const
|
|
588
|
+
E = new WeakMap(), _ = new WeakMap(), R = new WeakMap(), $ = new WeakMap(), Y = new WeakMap(), V = new WeakMap(), ft = new WeakMap(), ut = new WeakMap(), it = new WeakMap(), bt = new WeakMap(), gt = new WeakMap(), st = new WeakMap(), pt = new WeakMap(), yt = new WeakMap(), c(Xt, "RowManager");
|
|
589
|
+
let $t = Xt;
|
|
590
|
+
var K, F, mt, vt, xt, wt, St;
|
|
591
|
+
const J = class J extends HTMLElement {
|
|
441
592
|
constructor() {
|
|
442
593
|
super();
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
594
|
+
h(this, K, null);
|
|
595
|
+
h(this, F);
|
|
596
|
+
h(this, mt, /* @__PURE__ */ c(() => {
|
|
446
597
|
[
|
|
447
598
|
{ selector: ".ng-container-body", type: null },
|
|
448
599
|
{ selector: ".ng-container-left", type: "left" },
|
|
@@ -450,11 +601,11 @@ const Z = class Z extends HTMLElement {
|
|
|
450
601
|
].forEach(({ selector: s, type: n }) => {
|
|
451
602
|
const r = this.querySelector(s);
|
|
452
603
|
if (!r) return;
|
|
453
|
-
const o = t(this,
|
|
604
|
+
const o = t(this, xt).call(this, t(this, K), n);
|
|
454
605
|
r.innerHTML = "", r.appendChild(o);
|
|
455
606
|
});
|
|
456
607
|
}, "#renderSplitContainers"));
|
|
457
|
-
|
|
608
|
+
h(this, vt, /* @__PURE__ */ c(() => {
|
|
458
609
|
["left", "right"].forEach((e) => {
|
|
459
610
|
const s = this.querySelector(`.ng-container-${e}`), n = s == null ? void 0 : s.querySelector("table");
|
|
460
611
|
if (!s || !n) return;
|
|
@@ -465,8 +616,8 @@ const Z = class Z extends HTMLElement {
|
|
|
465
616
|
}), s.style.flex = `0 0 ${r}px`, s.style.width = `${r}px`;
|
|
466
617
|
});
|
|
467
618
|
}, "#updateContainerWidths"));
|
|
468
|
-
|
|
469
|
-
e && (g(this,
|
|
619
|
+
w(this, "generate", /* @__PURE__ */ c((e) => {
|
|
620
|
+
e && (g(this, K, It.compile(e)), t(this, K).style.display = "table", t(this, mt).call(this), t(this, F).initialize(), t(this, vt).call(this), setTimeout(() => {
|
|
470
621
|
var s;
|
|
471
622
|
(s = this.querySelector("nine-table-hscrollbar")) == null || s.refresh();
|
|
472
623
|
}, 0));
|
|
@@ -474,7 +625,7 @@ const Z = class Z extends HTMLElement {
|
|
|
474
625
|
/**
|
|
475
626
|
* π― λ§μ€ν° ν
μ΄λΈμ κΈ°λ°μΌλ‘ νΉμ fixed νμ
μμλ§ λ¨κΈ°λ λΆν ν¬νΌ
|
|
476
627
|
*/
|
|
477
|
-
|
|
628
|
+
h(this, xt, /* @__PURE__ */ c((e, s) => {
|
|
478
629
|
const n = e.cloneNode(!0);
|
|
479
630
|
return s === "left" ? n.querySelectorAll("col, th, td").forEach((r) => {
|
|
480
631
|
r.getAttribute("fixed") !== "left" && r.remove();
|
|
@@ -484,20 +635,20 @@ const Z = class Z extends HTMLElement {
|
|
|
484
635
|
r.remove();
|
|
485
636
|
}), n;
|
|
486
637
|
}, "#createSplitTable"));
|
|
487
|
-
|
|
488
|
-
|
|
638
|
+
w(this, "getRowHeight", /* @__PURE__ */ c(() => t(this, F).getRowHeight(), "getRowHeight"));
|
|
639
|
+
w(this, "scrollToX", /* @__PURE__ */ c((e) => {
|
|
489
640
|
const s = this.querySelector(".ng-container-body");
|
|
490
641
|
s && (s.scrollLeft = e);
|
|
491
642
|
}, "scrollToX"));
|
|
492
|
-
|
|
643
|
+
w(this, "scrollToY", /* @__PURE__ */ c((e) => {
|
|
493
644
|
const s = this.querySelector(".ng-container-body");
|
|
494
645
|
s && (s.scrollTop = e);
|
|
495
646
|
}, "scrollToY"));
|
|
496
|
-
|
|
497
|
-
t(this,
|
|
647
|
+
h(this, wt, /* @__PURE__ */ c(() => {
|
|
648
|
+
t(this, St).call(this);
|
|
498
649
|
}, "#init"));
|
|
499
|
-
|
|
500
|
-
const e =
|
|
650
|
+
h(this, St, /* @__PURE__ */ c(() => {
|
|
651
|
+
const e = J.SCROLLBAR_SIZE;
|
|
501
652
|
this.innerHTML = `
|
|
502
653
|
<style>
|
|
503
654
|
nine-table-sheet {
|
|
@@ -620,55 +771,55 @@ const Z = class Z extends HTMLElement {
|
|
|
620
771
|
</div>
|
|
621
772
|
`;
|
|
622
773
|
}, "#render"));
|
|
623
|
-
g(this,
|
|
774
|
+
g(this, F, new $t(this));
|
|
624
775
|
}
|
|
625
776
|
connectedCallback() {
|
|
626
|
-
t(this,
|
|
777
|
+
t(this, wt).call(this);
|
|
627
778
|
}
|
|
628
779
|
disconnectedCallback() {
|
|
629
|
-
this.innerHTML = "",
|
|
780
|
+
this.innerHTML = "", G.log("NineTableSheet destroyed.");
|
|
630
781
|
}
|
|
631
782
|
};
|
|
632
|
-
|
|
633
|
-
let
|
|
634
|
-
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet",
|
|
635
|
-
var
|
|
636
|
-
const
|
|
783
|
+
K = new WeakMap(), F = new WeakMap(), mt = new WeakMap(), vt = new WeakMap(), xt = new WeakMap(), wt = new WeakMap(), St = new WeakMap(), c(J, "NineTableSheet"), w(J, "SCROLLBAR_SIZE", 16);
|
|
784
|
+
let lt = J;
|
|
785
|
+
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", lt);
|
|
786
|
+
var Et, nt;
|
|
787
|
+
const Ut = class Ut extends HTMLElement {
|
|
637
788
|
constructor() {
|
|
638
789
|
super();
|
|
639
|
-
|
|
790
|
+
h(this, Et, /* @__PURE__ */ c(() => {
|
|
640
791
|
var e;
|
|
641
792
|
(e = this.querySelector(".nine-tab-bar")) == null || e.addEventListener("click", (s) => {
|
|
642
793
|
var o;
|
|
643
794
|
const n = s.ctrlKey || s.metaKey || s.shiftKey, r = parseInt((o = s.target.closest(".nine-tab-item")) == null ? void 0 : o.dataset.index, 10);
|
|
644
|
-
t(this,
|
|
645
|
-
}), t(this,
|
|
795
|
+
t(this, nt).call(this, r, n);
|
|
796
|
+
}), t(this, nt).call(this, 0, !1);
|
|
646
797
|
}, "#init"));
|
|
647
|
-
|
|
648
|
-
const n = /* @__PURE__ */
|
|
798
|
+
h(this, nt, /* @__PURE__ */ c((e, s = !1) => {
|
|
799
|
+
const n = /* @__PURE__ */ c(() => {
|
|
649
800
|
const u = Array.from(this.querySelectorAll("nine-table-sheet"));
|
|
650
|
-
Array.from(this.querySelectorAll("nine-splitter")).forEach((
|
|
651
|
-
const
|
|
652
|
-
|
|
653
|
-
const
|
|
654
|
-
|
|
801
|
+
Array.from(this.querySelectorAll("nine-splitter")).forEach((y) => y.style.setProperty("display", "none"));
|
|
802
|
+
const b = u.filter((y) => y.classList.contains("active"));
|
|
803
|
+
b.length < 2 || b.forEach((y) => {
|
|
804
|
+
const x = parseInt(y.getAttribute("data-index"), 10), L = this.querySelector(`nine-splitter[data-split-index="${x}"]`), Gt = u[x + 1];
|
|
805
|
+
L && Gt && Gt.classList.contains("active") && L.style.setProperty("display", "flex");
|
|
655
806
|
});
|
|
656
|
-
}, "updateSplitters"), r = this.querySelector(".nine-tab-bar"), o = this.querySelector("nine-table-sheets-body"), l = r.querySelectorAll(".nine-tab-item"),
|
|
807
|
+
}, "updateSplitters"), r = this.querySelector(".nine-tab-bar"), o = this.querySelector("nine-table-sheets-body"), l = r.querySelectorAll(".nine-tab-item"), a = o.querySelectorAll("nine-table-sheet");
|
|
657
808
|
if (!l[e]) return;
|
|
658
809
|
if (!s)
|
|
659
810
|
l.forEach((u, f) => {
|
|
660
811
|
u.classList.toggle("active", f === e);
|
|
661
|
-
}),
|
|
662
|
-
const
|
|
663
|
-
u.classList.toggle("active",
|
|
812
|
+
}), a.forEach((u, f) => {
|
|
813
|
+
const b = f === e;
|
|
814
|
+
u.classList.toggle("active", b), u.style.flex = b ? "1 1 100%" : "";
|
|
664
815
|
});
|
|
665
816
|
else {
|
|
666
817
|
const u = l[e], f = r.querySelectorAll(".nine-tab-item.active");
|
|
667
818
|
if (u.classList.contains("active") && f.length <= 1)
|
|
668
819
|
return;
|
|
669
820
|
u.classList.toggle("active");
|
|
670
|
-
const
|
|
671
|
-
|
|
821
|
+
const b = o.querySelector(`nine-table-sheet[data-index="${e}"]`);
|
|
822
|
+
b && (b.classList.toggle("active"), b.classList.contains("active") || (b.style.flex = ""));
|
|
672
823
|
}
|
|
673
824
|
const d = o.querySelectorAll("nine-table-sheet.active");
|
|
674
825
|
d == null || d.forEach((u) => {
|
|
@@ -677,35 +828,35 @@ const Dt = class Dt extends HTMLElement {
|
|
|
677
828
|
}, "#switchSheet"));
|
|
678
829
|
}
|
|
679
830
|
connectedCallback() {
|
|
680
|
-
t(this,
|
|
831
|
+
t(this, Et).call(this);
|
|
681
832
|
}
|
|
682
833
|
};
|
|
683
|
-
|
|
684
|
-
let
|
|
685
|
-
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets",
|
|
686
|
-
var
|
|
687
|
-
const
|
|
834
|
+
Et = new WeakMap(), nt = new WeakMap(), c(Ut, "NineTableSheets");
|
|
835
|
+
let Wt = Ut;
|
|
836
|
+
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", Wt);
|
|
837
|
+
var A, Rt, rt, At;
|
|
838
|
+
const Kt = class Kt {
|
|
688
839
|
constructor(i) {
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
t(this,
|
|
840
|
+
h(this, A);
|
|
841
|
+
h(this, Rt, /* @__PURE__ */ c(() => {
|
|
842
|
+
t(this, At).call(this), new ResizeObserver((i) => {
|
|
692
843
|
for (let e of i)
|
|
693
|
-
t(this,
|
|
694
|
-
}).observe(t(this,
|
|
844
|
+
t(this, A).getAttribute("auto-height") === "true" && t(this, rt).call(this);
|
|
845
|
+
}).observe(t(this, A));
|
|
695
846
|
}, "#init"));
|
|
696
|
-
|
|
697
|
-
var
|
|
698
|
-
const i = Array.from(t(this,
|
|
847
|
+
h(this, rt, /* @__PURE__ */ c(() => {
|
|
848
|
+
var a, d;
|
|
849
|
+
const i = Array.from(t(this, A).shadowRoot.querySelectorAll("nine-table-sheet.active"));
|
|
699
850
|
if (i.length === 0) return;
|
|
700
|
-
const e = parseInt(t(this,
|
|
701
|
-
t(this,
|
|
851
|
+
const e = parseInt(t(this, A).getAttribute("max-display-row"), 10) || 10, s = Math.max(...i.map((u) => u.getRowHeight())), n = (a = t(this, A).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : a.getBoundingClientRect().height, r = (d = t(this, A).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : d.getBoundingClientRect().height, o = lt.SCROLLBAR_SIZE, l = e * s + n + r + o;
|
|
852
|
+
t(this, A).style.height = `${l}px`;
|
|
702
853
|
}, "#applyAutoHeight"));
|
|
703
|
-
|
|
704
|
-
const e = Array.from(t(this,
|
|
705
|
-
const f = `<nine-table-sheet class="${d === 0 ? "active" : ""}" data-index="${d}"></nine-table-sheet>`,
|
|
706
|
-
return f +
|
|
707
|
-
}).join(""), o = e.map((
|
|
708
|
-
t(this,
|
|
854
|
+
h(this, At, /* @__PURE__ */ c(() => {
|
|
855
|
+
const e = Array.from(t(this, A).children).filter((a) => a.tagName === "TABLE"), s = t(this, A).getAttribute("auto-height") === "true", n = e.length, r = e.map((a, d) => {
|
|
856
|
+
const f = `<nine-table-sheet class="${d === 0 ? "active" : ""}" data-index="${d}"></nine-table-sheet>`, b = d < n - 1 ? `<nine-splitter class="h" data-split-index="${d}"></nine-splitter>` : "";
|
|
857
|
+
return f + b;
|
|
858
|
+
}).join(""), o = e.map((a, d) => `<div class="nine-tab-item ${d === 0 ? "active" : ""}" data-index="${d}">Sheet ${d + 1}</div>`).join("");
|
|
859
|
+
t(this, A).shadowRoot.innerHTML = `
|
|
709
860
|
<style>
|
|
710
861
|
:host {
|
|
711
862
|
display: flex;
|
|
@@ -804,83 +955,83 @@ const zt = class zt {
|
|
|
804
955
|
</nine-table-body>
|
|
805
956
|
<nine-table-footer></nine-table-footer>
|
|
806
957
|
`;
|
|
807
|
-
const l = t(this,
|
|
808
|
-
l == null || l.forEach((
|
|
958
|
+
const l = t(this, A).shadowRoot.querySelectorAll("nine-table-sheet");
|
|
959
|
+
l == null || l.forEach((a, d) => {
|
|
809
960
|
e[d] && setTimeout(() => {
|
|
810
|
-
|
|
961
|
+
a.generate(e[d]), s && t(this, rt).call(this);
|
|
811
962
|
});
|
|
812
963
|
});
|
|
813
964
|
}, "#render"));
|
|
814
|
-
g(this,
|
|
965
|
+
g(this, A, i), t(this, Rt).call(this);
|
|
815
966
|
}
|
|
816
967
|
};
|
|
817
|
-
|
|
818
|
-
let
|
|
819
|
-
var
|
|
820
|
-
const
|
|
968
|
+
A = new WeakMap(), Rt = new WeakMap(), rt = new WeakMap(), At = new WeakMap(), c(Kt, "LayoutManager");
|
|
969
|
+
let Ot = Kt;
|
|
970
|
+
var W, X;
|
|
971
|
+
const Ft = class Ft {
|
|
821
972
|
constructor(i) {
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
g(this,
|
|
973
|
+
h(this, W);
|
|
974
|
+
h(this, X, -1);
|
|
975
|
+
w(this, "count", /* @__PURE__ */ c(() => t(this, W).rawRecords.length, "count"));
|
|
976
|
+
g(this, W, i);
|
|
826
977
|
}
|
|
827
978
|
get at() {
|
|
828
|
-
return t(this,
|
|
979
|
+
return t(this, X);
|
|
829
980
|
}
|
|
830
981
|
set at(i) {
|
|
831
982
|
var s, n;
|
|
832
|
-
g(this,
|
|
833
|
-
const e = ((n = (s = t(this,
|
|
834
|
-
e && !e.querySelector(`tbody.bindable tr[data-row="${t(this,
|
|
983
|
+
g(this, X, parseInt(i, 10));
|
|
984
|
+
const e = ((n = (s = t(this, W).owner).querySelector) == null ? void 0 : n.call(s, ".ng-container-body")) || t(this, W).owner.body;
|
|
985
|
+
e && !e.querySelector(`tbody.bindable tr[data-row="${t(this, X)}"]`) && setTimeout(() => {
|
|
835
986
|
var r, o;
|
|
836
|
-
(o = (r = t(this,
|
|
987
|
+
(o = (r = t(this, W).owner).scrollTo_V1) == null || o.call(r, t(this, X));
|
|
837
988
|
});
|
|
838
989
|
}
|
|
839
990
|
};
|
|
840
|
-
|
|
841
|
-
let
|
|
842
|
-
var
|
|
843
|
-
const
|
|
991
|
+
W = new WeakMap(), X = new WeakMap(), c(Ft, "ngRow");
|
|
992
|
+
let zt = Ft;
|
|
993
|
+
var T, v, k, Z, Tt, O, kt, ot, qt, Lt, j;
|
|
994
|
+
const q = class q {
|
|
844
995
|
constructor(i, e) {
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
g(this,
|
|
853
|
-
const i = t(this,
|
|
996
|
+
h(this, T);
|
|
997
|
+
h(this, v);
|
|
998
|
+
h(this, k, []);
|
|
999
|
+
h(this, Z, []);
|
|
1000
|
+
h(this, Tt, 0);
|
|
1001
|
+
h(this, O, []);
|
|
1002
|
+
h(this, kt, /* @__PURE__ */ c(() => {
|
|
1003
|
+
g(this, O, []);
|
|
1004
|
+
const i = t(this, T).template || [];
|
|
854
1005
|
Array.from(i).forEach((e) => {
|
|
855
1006
|
var s;
|
|
856
|
-
t(this,
|
|
857
|
-
}), (t(this,
|
|
858
|
-
e.__ng || (e.__ng = t(this,
|
|
1007
|
+
t(this, O).push(((s = e.getBoundingClientRect) == null ? void 0 : s.call(e).height) || 24);
|
|
1008
|
+
}), (t(this, v).rawRecords || []).forEach((e) => {
|
|
1009
|
+
e.__ng || (e.__ng = t(this, ot).call(this)), e.__ng.height = t(this, O).slice();
|
|
859
1010
|
});
|
|
860
1011
|
}, "#initialize"));
|
|
861
|
-
|
|
1012
|
+
w(this, "set", /* @__PURE__ */ c((i) => {
|
|
862
1013
|
this.clear(), this.add(i, !1);
|
|
863
1014
|
}, "set"));
|
|
864
|
-
|
|
865
|
-
rowState:
|
|
1015
|
+
h(this, ot, /* @__PURE__ */ c(() => ({
|
|
1016
|
+
rowState: q.ROW_STATE.EMPTY,
|
|
866
1017
|
deleted: !1,
|
|
867
1018
|
filtered: !1,
|
|
868
|
-
height: t(this,
|
|
1019
|
+
height: t(this, O).slice(),
|
|
869
1020
|
o: {},
|
|
870
1021
|
c: {},
|
|
871
|
-
_: [0, 0, 0, 0,
|
|
1022
|
+
_: [0, 0, 0, 0, q.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this, O).slice(), -1, {}, {}]
|
|
872
1023
|
}), "#getDefaultMeta"));
|
|
873
|
-
|
|
874
|
-
g(this,
|
|
1024
|
+
w(this, "reset", /* @__PURE__ */ c(() => {
|
|
1025
|
+
g(this, k, []), g(this, Z, []);
|
|
875
1026
|
}, "reset"));
|
|
876
|
-
|
|
1027
|
+
w(this, "clear", /* @__PURE__ */ c(() => {
|
|
877
1028
|
var i;
|
|
878
|
-
t(this,
|
|
1029
|
+
t(this, v).rawRecords = [], g(this, k, []), g(this, Z, []), (i = t(this, v).viewRecords) != null && i.reset && t(this, v).viewRecords.reset();
|
|
879
1030
|
}, "clear"));
|
|
880
|
-
|
|
1031
|
+
h(this, qt, /* @__PURE__ */ c((i) => {
|
|
881
1032
|
var n;
|
|
882
1033
|
Array.isArray(i) || (i = [i]);
|
|
883
|
-
const e = typeof ((n = t(this,
|
|
1034
|
+
const e = typeof ((n = t(this, T).fields) == null ? void 0 : n.get) == "function" ? t(this, T).fields.get() : Object.keys(i[0] || {}), s = [];
|
|
884
1035
|
return i.forEach((r) => {
|
|
885
1036
|
const o = { v: [] };
|
|
886
1037
|
e.forEach((l) => {
|
|
@@ -888,54 +1039,54 @@ const T = class T {
|
|
|
888
1039
|
}), s.push(o);
|
|
889
1040
|
}), s;
|
|
890
1041
|
}, "#json2Array"));
|
|
891
|
-
|
|
892
|
-
e.__ng = t(this,
|
|
1042
|
+
h(this, Lt, /* @__PURE__ */ c((i) => (Array.isArray(i) || (i = [i]), i.forEach((e) => {
|
|
1043
|
+
e.__ng = t(this, ot).call(this), e.__ng.rowid = this.nextId, e.__ng.rowState = q.ROW_STATE.INSERT, e.__ng._[0] = e.__ng.rowid;
|
|
893
1044
|
}), i), "#defaultInsert"));
|
|
894
|
-
|
|
1045
|
+
w(this, "add", /* @__PURE__ */ c((i, e = !0) => {
|
|
895
1046
|
var r;
|
|
896
1047
|
i === void 0 && (i = {});
|
|
897
|
-
const s = t(this,
|
|
898
|
-
t(this,
|
|
1048
|
+
const s = t(this, qt).call(this, i);
|
|
1049
|
+
t(this, v).rawRecords = t(this, v).rawRecords.concat(t(this, Lt).call(this, s)), this.resetRecords();
|
|
899
1050
|
const n = this.count() - 1;
|
|
900
1051
|
return e || s.forEach((o, l) => {
|
|
901
|
-
const
|
|
902
|
-
|
|
903
|
-
}), (r = t(this,
|
|
1052
|
+
const a = t(this, v).rawRecords[n - l];
|
|
1053
|
+
a && (a.__ng.rowState = q.ROW_STATE.EMPTY);
|
|
1054
|
+
}), (r = t(this, v).viewRecords) != null && r.reset && t(this, v).viewRecords.reset(), n;
|
|
904
1055
|
}, "add"));
|
|
905
|
-
|
|
1056
|
+
w(this, "delete", /* @__PURE__ */ c((i) => {
|
|
906
1057
|
var s;
|
|
907
1058
|
let e = [];
|
|
908
|
-
Array.isArray(i) ? e = i : typeof i > "u" ? e = [t(this,
|
|
909
|
-
if (t(this,
|
|
910
|
-
const r = t(this,
|
|
911
|
-
t(this,
|
|
912
|
-
o.__ng.rowid === r && (o.__ng.deleted = !0, o.__ng.rowState =
|
|
1059
|
+
Array.isArray(i) ? e = i : typeof i > "u" ? e = [t(this, v).owner.row.at] : e = [parseInt(i, 10)], e.sort((n, r) => r - n).forEach((n) => {
|
|
1060
|
+
if (t(this, k)[n]) {
|
|
1061
|
+
const r = t(this, k)[n].__ng.rowid;
|
|
1062
|
+
t(this, k)[n].__ng.rowState === q.ROW_STATE.INSERT ? t(this, v).rawRecords = t(this, v).rawRecords.filter((o) => o.__ng.rowid !== r) : t(this, v).rawRecords.forEach((o) => {
|
|
1063
|
+
o.__ng.rowid === r && (o.__ng.deleted = !0, o.__ng.rowState = q.ROW_STATE.DELETE);
|
|
913
1064
|
});
|
|
914
1065
|
}
|
|
915
|
-
}), this.resetRecords(), (s = t(this,
|
|
1066
|
+
}), this.resetRecords(), (s = t(this, v).viewRecords) != null && s.reset && t(this, v).viewRecords.reset();
|
|
916
1067
|
}, "delete"));
|
|
917
|
-
|
|
918
|
-
var
|
|
1068
|
+
w(this, "setValue", /* @__PURE__ */ c((i, e, s) => {
|
|
1069
|
+
var a;
|
|
919
1070
|
i = parseInt(i, 10);
|
|
920
|
-
const r = (typeof ((
|
|
1071
|
+
const r = (typeof ((a = t(this, T).fields) == null ? void 0 : a.get) == "function" ? t(this, T).fields.get() : []).indexOf(e);
|
|
921
1072
|
if (r < 0) return;
|
|
922
1073
|
const o = this.getValidData()[i];
|
|
923
1074
|
if (!o) return;
|
|
924
1075
|
const l = o.v[r];
|
|
925
|
-
l !== s && o.__ng.rowState !==
|
|
1076
|
+
l !== s && o.__ng.rowState !== q.ROW_STATE.INSERT && (o.__ng.o.hasOwnProperty(e) || (o.__ng.o[e] = l), o.__ng.rowState = q.ROW_STATE.UPDATE), o.v[r] = s, t(this, v).owner.refreshData && t(this, v).owner.refreshData(i);
|
|
926
1077
|
}, "setValue"));
|
|
927
|
-
|
|
928
|
-
g(this,
|
|
1078
|
+
w(this, "resetRecords", /* @__PURE__ */ c(() => {
|
|
1079
|
+
g(this, Z, t(this, v).rawRecords.filter((i) => !i.__ng.deleted)), g(this, k, t(this, v).rawRecords.filter((i) => !i.__ng.deleted && !i.__ng.filtered)), t(this, v).rawRecords.forEach((i, e) => {
|
|
929
1080
|
i.__ng.rowidx = e;
|
|
930
|
-
}), t(this,
|
|
1081
|
+
}), t(this, k).forEach((i, e) => {
|
|
931
1082
|
i.__ng.i = e;
|
|
932
1083
|
});
|
|
933
1084
|
}, "resetRecords"));
|
|
934
|
-
|
|
935
|
-
|
|
1085
|
+
w(this, "getValidData", /* @__PURE__ */ c(() => (t(this, k).length === 0 && t(this, v).rawRecords.length > 0 && this.resetRecords(), t(this, k)), "getValidData"));
|
|
1086
|
+
h(this, j, /* @__PURE__ */ c((i) => {
|
|
936
1087
|
var s;
|
|
937
1088
|
if (!i) return i;
|
|
938
|
-
const e = typeof ((s = t(this,
|
|
1089
|
+
const e = typeof ((s = t(this, T).fields) == null ? void 0 : s.get) == "function" ? t(this, T).fields.get() : [];
|
|
939
1090
|
return Array.isArray(i) ? i.filter((n) => !n.__ng.deleted).map((n) => {
|
|
940
1091
|
const r = {};
|
|
941
1092
|
return e.forEach((o, l) => {
|
|
@@ -943,50 +1094,50 @@ const T = class T {
|
|
|
943
1094
|
}), r.__ng = n.__ng, r;
|
|
944
1095
|
}) : i;
|
|
945
1096
|
}, "#conv2"));
|
|
946
|
-
|
|
947
|
-
|
|
1097
|
+
w(this, "count", /* @__PURE__ */ c(() => this.getValidData().length, "count"));
|
|
1098
|
+
w(this, "get", /* @__PURE__ */ c((i, e) => {
|
|
948
1099
|
var r;
|
|
949
1100
|
const s = this.getValidData();
|
|
950
1101
|
if (!s || s.length <= 0) return;
|
|
951
|
-
if (i == null) return t(this,
|
|
1102
|
+
if (i == null) return t(this, j).call(this, s);
|
|
952
1103
|
if (i < 0 || i >= s.length) return null;
|
|
953
|
-
const n = typeof ((r = t(this,
|
|
1104
|
+
const n = typeof ((r = t(this, T).fields) == null ? void 0 : r.get) == "function" ? t(this, T).fields.get() : [];
|
|
954
1105
|
if (e != null) {
|
|
955
1106
|
const o = n.indexOf(e);
|
|
956
1107
|
return o >= 0 ? s[i].v[o] : null;
|
|
957
1108
|
}
|
|
958
|
-
return t(this,
|
|
1109
|
+
return t(this, j).call(this, s[i]);
|
|
959
1110
|
}, "get"));
|
|
960
|
-
g(this,
|
|
1111
|
+
g(this, T, i), g(this, v, e), t(this, kt).call(this);
|
|
961
1112
|
}
|
|
962
1113
|
get source() {
|
|
963
|
-
return t(this,
|
|
1114
|
+
return t(this, j).call(this, t(this, v).rawRecords);
|
|
964
1115
|
}
|
|
965
1116
|
set source(i) {
|
|
966
1117
|
this.clear(), this.add(i, !1);
|
|
967
1118
|
}
|
|
968
1119
|
get nextId() {
|
|
969
|
-
return ++
|
|
1120
|
+
return ++ee(this, Tt)._;
|
|
970
1121
|
}
|
|
971
1122
|
get length() {
|
|
972
|
-
return t(this,
|
|
1123
|
+
return t(this, k).length;
|
|
973
1124
|
}
|
|
974
1125
|
getRowCount() {
|
|
975
1126
|
return this.length;
|
|
976
1127
|
}
|
|
977
1128
|
};
|
|
978
|
-
|
|
979
|
-
|
|
1129
|
+
T = new WeakMap(), v = new WeakMap(), k = new WeakMap(), Z = new WeakMap(), Tt = new WeakMap(), O = new WeakMap(), kt = new WeakMap(), ot = new WeakMap(), qt = new WeakMap(), Lt = new WeakMap(), j = new WeakMap(), c(q, "ngData"), // π― ν μν μ μ μμλ₯Ό ν΄λμ€ λ΄λΆλ‘ λ΄μ¬ν
|
|
1130
|
+
w(q, "ROW_STATE", {
|
|
980
1131
|
EMPTY: "EMPTY",
|
|
981
1132
|
NORMAL: "NORMAL",
|
|
982
1133
|
INSERT: "INSERT",
|
|
983
1134
|
UPDATE: "UPDATE",
|
|
984
1135
|
DELETE: "DELETE"
|
|
985
1136
|
});
|
|
986
|
-
let
|
|
987
|
-
const
|
|
1137
|
+
let Dt = q;
|
|
1138
|
+
const Zt = class Zt {
|
|
988
1139
|
constructor(i) {
|
|
989
|
-
this.owner = i, this.row = new
|
|
1140
|
+
this.owner = i, this.row = new zt(this), this.data = new Dt(i, this), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.pageCnt = 25, this.viewRecords.reset = () => {
|
|
990
1141
|
var e;
|
|
991
1142
|
(e = this.owner.view) != null && e.redraw && this.owner.view.redraw();
|
|
992
1143
|
}, this.setDataSource = (e) => {
|
|
@@ -1003,37 +1154,37 @@ const Nt = class Nt {
|
|
|
1003
1154
|
}, this.setDataSource([]);
|
|
1004
1155
|
}
|
|
1005
1156
|
};
|
|
1006
|
-
|
|
1007
|
-
let
|
|
1008
|
-
var
|
|
1009
|
-
const
|
|
1157
|
+
c(Zt, "ngDataManager");
|
|
1158
|
+
let Pt = Zt;
|
|
1159
|
+
var U, Ht;
|
|
1160
|
+
const jt = class jt extends HTMLElement {
|
|
1010
1161
|
constructor() {
|
|
1011
1162
|
super();
|
|
1012
1163
|
//#created = false;
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
this.attachShadow({ mode: "open" }), g(this,
|
|
1164
|
+
h(this, U);
|
|
1165
|
+
h(this, Ht);
|
|
1166
|
+
this.attachShadow({ mode: "open" }), g(this, U, new Pt(this));
|
|
1016
1167
|
}
|
|
1017
1168
|
connectedCallback() {
|
|
1018
|
-
g(this,
|
|
1169
|
+
g(this, Ht, new Ot(this)), G.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
|
|
1019
1170
|
}
|
|
1020
1171
|
disconnectedCallback() {
|
|
1021
|
-
|
|
1172
|
+
G.log("NineTable disconnected.");
|
|
1022
1173
|
}
|
|
1023
1174
|
// π― μΈλΆμμ grid.data.set(...) ννλ‘ μ κ·Όν μ μλλ‘ λ°μ΄ν° λ§€λμ μ€ν
|
|
1024
1175
|
get data() {
|
|
1025
|
-
return t(this,
|
|
1176
|
+
return t(this, U).data;
|
|
1026
1177
|
}
|
|
1027
1178
|
// π― ν(row) κ΄λ ¨ μ μ΄ μ κ·Όμ μ€ν
|
|
1028
1179
|
get row() {
|
|
1029
|
-
return t(this,
|
|
1180
|
+
return t(this, U).row;
|
|
1030
1181
|
}
|
|
1031
1182
|
// π― μ 체 λ°μ΄ν° λ§€λμ μ κ·Ό νμν κ²½μ°
|
|
1032
1183
|
get dataManager() {
|
|
1033
|
-
return t(this,
|
|
1184
|
+
return t(this, U);
|
|
1034
1185
|
}
|
|
1035
1186
|
};
|
|
1036
|
-
|
|
1037
|
-
let
|
|
1038
|
-
customElements.get("nine-table") || customElements.define("nine-table",
|
|
1187
|
+
U = new WeakMap(), Ht = new WeakMap(), c(jt, "NineTable");
|
|
1188
|
+
let Bt = jt;
|
|
1189
|
+
customElements.get("nine-table") || customElements.define("nine-table", Bt);
|
|
1039
1190
|
//# sourceMappingURL=nine-table.js.map
|