@ninebone/table 0.0.443 β 0.0.445
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 +472 -443
- package/dist/nine-table.js.map +1 -1
- package/dist/nine-table.umd.js +8 -7
- package/dist/nine-table.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/nine-table.js
CHANGED
|
@@ -5,10 +5,10 @@ var ve = (S) => {
|
|
|
5
5
|
var Ee = (S, n, e) => n in S ? xe(S, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : S[n] = e;
|
|
6
6
|
var h = (S, n) => xe(S, "name", { value: n, configurable: !0 });
|
|
7
7
|
var E = (S, n, e) => Ee(S, typeof n != "symbol" ? n + "" : n, e), we = (S, n, e) => n.has(S) || ve("Cannot " + e);
|
|
8
|
-
var t = (S, n, e) => (we(S, n, "read from private field"), e ? e.call(S) : n.get(S)), d = (S, n, e) => n.has(S) ? ve("Cannot add the same private member more than once") : n instanceof WeakSet ? n.add(S) : n.set(S, e),
|
|
8
|
+
var t = (S, n, e) => (we(S, n, "read from private field"), e ? e.call(S) : n.get(S)), d = (S, n, e) => n.has(S) ? ve("Cannot add the same private member more than once") : n instanceof WeakSet ? n.add(S) : n.set(S, e), y = (S, n, e, i) => (we(S, n, "write to private field"), i ? i.call(S, e) : n.set(S, e), e);
|
|
9
9
|
var Se = (S, n, e, i) => ({
|
|
10
|
-
set _(
|
|
11
|
-
|
|
10
|
+
set _(o) {
|
|
11
|
+
y(S, n, o, e);
|
|
12
12
|
},
|
|
13
13
|
get _() {
|
|
14
14
|
return t(S, n, i);
|
|
@@ -23,96 +23,96 @@ const ce = class ce extends Re.constructor {
|
|
|
23
23
|
h(ce, "Trace");
|
|
24
24
|
let Gt = ce;
|
|
25
25
|
const dt = new Gt();
|
|
26
|
-
var
|
|
26
|
+
var W, N, v, F, V, X, At, U, qt;
|
|
27
27
|
const he = class he extends HTMLElement {
|
|
28
28
|
constructor() {
|
|
29
29
|
super();
|
|
30
|
-
d(this,
|
|
31
|
-
d(this,
|
|
32
|
-
d(this,
|
|
33
|
-
d(this, Y);
|
|
30
|
+
d(this, W);
|
|
31
|
+
d(this, N, !1);
|
|
32
|
+
d(this, v);
|
|
34
33
|
d(this, F);
|
|
35
34
|
d(this, V);
|
|
35
|
+
d(this, X);
|
|
36
36
|
d(this, At, /* @__PURE__ */ h(() => {
|
|
37
|
-
if (!t(this,
|
|
38
|
-
const e = t(this,
|
|
39
|
-
e && (
|
|
37
|
+
if (!t(this, W)) return;
|
|
38
|
+
const e = t(this, W).querySelector(".ng-container-body .ng-part-body");
|
|
39
|
+
e && (y(this, X, new ResizeObserver(() => {
|
|
40
40
|
this.refresh();
|
|
41
|
-
})), t(this,
|
|
41
|
+
})), t(this, X).observe(e));
|
|
42
42
|
}, "#observeResize"));
|
|
43
43
|
E(this, "refresh", /* @__PURE__ */ h(() => {
|
|
44
|
-
if (!t(this,
|
|
45
|
-
const e = t(this,
|
|
44
|
+
if (!t(this, W) || !t(this, v) || t(this, N)) return;
|
|
45
|
+
const e = t(this, v).container, i = e.querySelector("table");
|
|
46
46
|
if (!i) return;
|
|
47
|
-
const
|
|
47
|
+
const o = t(this, v).track, r = t(this, v).thumb, s = t(this, W).querySelector(".ng-container-bottom"), l = e.clientWidth, c = i.scrollWidth;
|
|
48
48
|
if (l !== 0 && c > l)
|
|
49
|
-
|
|
49
|
+
s && (s.style.display = "flex");
|
|
50
50
|
else {
|
|
51
|
-
|
|
51
|
+
s && (s.style.display = "none");
|
|
52
52
|
return;
|
|
53
53
|
}
|
|
54
|
-
const a =
|
|
54
|
+
const a = o.clientWidth;
|
|
55
55
|
if (a <= 0) return;
|
|
56
56
|
const f = Math.max(Math.min(a * (l / c), a), 20);
|
|
57
57
|
r.style.width = `${f}px`;
|
|
58
|
-
const
|
|
59
|
-
let
|
|
60
|
-
|
|
58
|
+
const u = e.scrollLeft, b = c - l;
|
|
59
|
+
let g = 0;
|
|
60
|
+
b > 0 && (g = parseInt(u / b * (a - f), 10)), g < 0 && (g = 0);
|
|
61
61
|
const p = a - f;
|
|
62
|
-
|
|
62
|
+
g > p && (g = p), r.style.left = `${g}px`, t(this, v).left.disabled = g === 0, t(this, v).right.disabled = g >= p - 1;
|
|
63
63
|
}, "refresh"));
|
|
64
|
-
d(this,
|
|
65
|
-
if (!t(this,
|
|
66
|
-
const i = t(this,
|
|
67
|
-
if (!
|
|
68
|
-
const r = t(this,
|
|
64
|
+
d(this, U, /* @__PURE__ */ h((e) => {
|
|
65
|
+
if (!t(this, v)) return !1;
|
|
66
|
+
const i = t(this, v).container, o = i.querySelector("table");
|
|
67
|
+
if (!o) return !1;
|
|
68
|
+
const r = t(this, v).track.getBoundingClientRect(), s = t(this, v).thumb.clientWidth;
|
|
69
69
|
let l = e;
|
|
70
70
|
l < 0 && (l = 0);
|
|
71
|
-
const c = r.width -
|
|
72
|
-
l > c && (l = c), l = parseInt(l, 10), t(this,
|
|
73
|
-
const a = i.clientWidth,
|
|
74
|
-
return c > 0 &&
|
|
71
|
+
const c = r.width - s;
|
|
72
|
+
l > c && (l = c), l = parseInt(l, 10), t(this, v).thumb.style.left = `${l}px`, t(this, v).left.disabled = l === 0, t(this, v).right.disabled = l >= c - 1;
|
|
73
|
+
const a = i.clientWidth, u = o.scrollWidth - a;
|
|
74
|
+
return c > 0 && u > 0 && (i.scrollLeft = l / c * u), l > 0 && l < c - 1;
|
|
75
75
|
}, "#thumbMoveTo"));
|
|
76
76
|
d(this, qt, /* @__PURE__ */ h(() => {
|
|
77
|
-
const e = /* @__PURE__ */ h((
|
|
78
|
-
clearInterval(t(this,
|
|
79
|
-
const r = parseInt(t(this,
|
|
80
|
-
t(this,
|
|
81
|
-
clearInterval(t(this,
|
|
82
|
-
const
|
|
83
|
-
t(this,
|
|
77
|
+
const e = /* @__PURE__ */ h((o) => {
|
|
78
|
+
clearInterval(t(this, F)), clearInterval(t(this, V));
|
|
79
|
+
const r = parseInt(t(this, v).thumb.style.left || 0, 10);
|
|
80
|
+
t(this, U).call(this, r + o), y(this, F, setInterval(() => {
|
|
81
|
+
clearInterval(t(this, F)), y(this, V, setInterval(() => {
|
|
82
|
+
const s = parseInt(t(this, v).thumb.style.left || 0, 10);
|
|
83
|
+
t(this, U).call(this, s + o) || clearInterval(t(this, V));
|
|
84
84
|
}, 50));
|
|
85
85
|
}, 500));
|
|
86
86
|
}, "delayScroll"), i = /* @__PURE__ */ h(() => {
|
|
87
|
-
clearInterval(t(this,
|
|
87
|
+
clearInterval(t(this, F)), clearInterval(t(this, V));
|
|
88
88
|
}, "clearTimer");
|
|
89
|
-
["mouseup", "mouseleave", "touchend"].forEach((
|
|
90
|
-
t(this,
|
|
91
|
-
}), t(this,
|
|
92
|
-
|
|
93
|
-
}), t(this,
|
|
94
|
-
|
|
95
|
-
}), t(this,
|
|
96
|
-
if (
|
|
97
|
-
|
|
98
|
-
const r = t(this,
|
|
99
|
-
t(this,
|
|
100
|
-
}), t(this,
|
|
101
|
-
if (
|
|
102
|
-
|
|
89
|
+
["mouseup", "mouseleave", "touchend"].forEach((o) => {
|
|
90
|
+
t(this, v).left.addEventListener(o, i), t(this, v).right.addEventListener(o, i), t(this, v).track.addEventListener(o, i);
|
|
91
|
+
}), t(this, v).left.addEventListener("mousedown", (o) => {
|
|
92
|
+
o.button === 0 && e(-20);
|
|
93
|
+
}), t(this, v).right.addEventListener("mousedown", (o) => {
|
|
94
|
+
o.button === 0 && e(20);
|
|
95
|
+
}), t(this, v).left.addEventListener("touchstart", () => e(-20)), t(this, v).right.addEventListener("touchstart", () => e(20)), t(this, v).track.addEventListener("mousedown", (o) => {
|
|
96
|
+
if (o.button !== 0) return;
|
|
97
|
+
o.preventDefault();
|
|
98
|
+
const r = t(this, v).track.getBoundingClientRect(), s = t(this, v).thumb.clientWidth;
|
|
99
|
+
t(this, U).call(this, o.clientX - r.left - s / 2);
|
|
100
|
+
}), t(this, v).thumb.addEventListener("mousedown", (o) => {
|
|
101
|
+
if (o.button !== 0) return;
|
|
102
|
+
o.stopPropagation(), o.preventDefault(), y(this, N, !0), this.shiftX = o.clientX - t(this, v).thumb.getBoundingClientRect().left;
|
|
103
103
|
const r = /* @__PURE__ */ h((l) => {
|
|
104
|
-
if (!t(this,
|
|
105
|
-
const c = t(this,
|
|
106
|
-
t(this,
|
|
107
|
-
}, "onMouseMove"),
|
|
108
|
-
|
|
104
|
+
if (!t(this, N)) return;
|
|
105
|
+
const c = t(this, v).track.getBoundingClientRect();
|
|
106
|
+
t(this, U).call(this, l.clientX - c.left - this.shiftX);
|
|
107
|
+
}, "onMouseMove"), s = /* @__PURE__ */ h(() => {
|
|
108
|
+
y(this, N, !1), i(), document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", s), this.refresh();
|
|
109
109
|
}, "onMouseUp");
|
|
110
|
-
document.addEventListener("mousemove", r), document.addEventListener("mouseup",
|
|
110
|
+
document.addEventListener("mousemove", r), document.addEventListener("mouseup", s);
|
|
111
111
|
});
|
|
112
112
|
}, "#init"));
|
|
113
113
|
}
|
|
114
114
|
connectedCallback() {
|
|
115
|
-
if (
|
|
115
|
+
if (y(this, W, this.closest("nine-table-sheet") || this.getRootNode().host), !t(this, W)) return;
|
|
116
116
|
this.innerHTML = `
|
|
117
117
|
<style>
|
|
118
118
|
nine-table-hscrollbar {
|
|
@@ -177,99 +177,99 @@ const he = class he extends HTMLElement {
|
|
|
177
177
|
<button class='ng-scroll-right' disabled><div class='ng-scroll-icon'></div></button>
|
|
178
178
|
`;
|
|
179
179
|
const e = /* @__PURE__ */ h(() => {
|
|
180
|
-
const i = t(this,
|
|
180
|
+
const i = t(this, W).querySelector(".ng-container-body .ng-part-body");
|
|
181
181
|
if (!i) {
|
|
182
182
|
setTimeout(e, 10);
|
|
183
183
|
return;
|
|
184
184
|
}
|
|
185
|
-
|
|
185
|
+
y(this, v, {
|
|
186
186
|
container: i,
|
|
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
|
}), i.addEventListener("scroll", () => {
|
|
192
|
-
t(this,
|
|
192
|
+
t(this, N) || this.refresh();
|
|
193
193
|
}), t(this, qt).call(this), t(this, At).call(this), this.refresh();
|
|
194
194
|
}, "initWhenReady");
|
|
195
195
|
e();
|
|
196
196
|
}
|
|
197
197
|
disconnectedCallback() {
|
|
198
|
-
t(this,
|
|
198
|
+
t(this, X) && t(this, X).disconnect();
|
|
199
199
|
}
|
|
200
200
|
};
|
|
201
|
-
|
|
201
|
+
W = new WeakMap(), N = new WeakMap(), v = new WeakMap(), F = new WeakMap(), V = new WeakMap(), X = new WeakMap(), At = new WeakMap(), U = new WeakMap(), qt = new WeakMap(), h(he, "NineTableHScrollBar");
|
|
202
202
|
let Jt = he;
|
|
203
203
|
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", Jt);
|
|
204
|
-
var
|
|
204
|
+
var P, et, j, A, ft, gt, Tt;
|
|
205
205
|
const de = class de extends HTMLElement {
|
|
206
206
|
constructor() {
|
|
207
207
|
super();
|
|
208
|
-
d(this,
|
|
208
|
+
d(this, P);
|
|
209
209
|
d(this, et);
|
|
210
|
-
d(this,
|
|
211
|
-
d(this,
|
|
210
|
+
d(this, j, !1);
|
|
211
|
+
d(this, A);
|
|
212
212
|
d(this, ft, 0);
|
|
213
213
|
d(this, gt, 0);
|
|
214
214
|
E(this, "refresh", /* @__PURE__ */ h(() => {
|
|
215
|
-
if (!t(this,
|
|
216
|
-
const e = t(this,
|
|
215
|
+
if (!t(this, P) || !t(this, A)) return;
|
|
216
|
+
const e = t(this, A).container, i = t(this, A).track, o = t(this, A).thumb, r = e.clientHeight, l = (t(this, P).data.get() || []).length, c = t(this, et).getRowHeight(), a = l * c;
|
|
217
217
|
if (a <= r) {
|
|
218
|
-
|
|
218
|
+
o.style.display = "none", t(this, A).top.disabled = !0, t(this, A).bottom.disabled = !0;
|
|
219
219
|
return;
|
|
220
220
|
} else
|
|
221
|
-
|
|
221
|
+
o.style.display = "block";
|
|
222
222
|
const f = i.clientHeight;
|
|
223
223
|
if (f <= 0) return;
|
|
224
|
-
const
|
|
225
|
-
|
|
226
|
-
const
|
|
224
|
+
const u = Math.max(Math.min(f * (r / a), f), 20);
|
|
225
|
+
o.style.height = `${u}px`;
|
|
226
|
+
const b = e.scrollTop, g = Math.max(a - r, 1);
|
|
227
227
|
let p = 0;
|
|
228
|
-
|
|
229
|
-
const
|
|
230
|
-
p < 0 && (p = 0), p >
|
|
228
|
+
g > 0 && (p = b / g * (f - u));
|
|
229
|
+
const x = f - u;
|
|
230
|
+
p < 0 && (p = 0), p > x && (p = x), o.style.top = `${p}px`, t(this, A).top.disabled = b <= 0, t(this, A).bottom.disabled = b >= g - 1;
|
|
231
231
|
}, "refresh"));
|
|
232
232
|
d(this, Tt, /* @__PURE__ */ h(() => {
|
|
233
|
-
const e = t(this,
|
|
234
|
-
const r = (t(this,
|
|
235
|
-
return r *
|
|
233
|
+
const e = t(this, A).container, i = /* @__PURE__ */ h(() => {
|
|
234
|
+
const r = (t(this, P).data.get() || []).length, s = t(this, et).getRowHeight();
|
|
235
|
+
return r * s;
|
|
236
236
|
}, "getContentHeight");
|
|
237
237
|
e.addEventListener("scroll", () => {
|
|
238
|
-
t(this,
|
|
239
|
-
}), t(this,
|
|
240
|
-
if (
|
|
241
|
-
|
|
238
|
+
t(this, j) || this.refresh();
|
|
239
|
+
}), t(this, A).thumb.addEventListener("mousedown", (o) => {
|
|
240
|
+
if (o.button !== 0) return;
|
|
241
|
+
o.stopPropagation(), o.preventDefault(), y(this, j, !0), y(this, ft, o.clientY), y(this, gt, e.scrollTop);
|
|
242
242
|
const r = /* @__PURE__ */ h((l) => {
|
|
243
|
-
if (!t(this,
|
|
244
|
-
const c = t(this,
|
|
245
|
-
if (
|
|
246
|
-
const
|
|
247
|
-
let
|
|
248
|
-
const
|
|
249
|
-
|
|
243
|
+
if (!t(this, j)) return;
|
|
244
|
+
const c = t(this, A).track.getBoundingClientRect(), a = t(this, A).thumb.clientHeight, u = c.height - a, b = l.clientY - t(this, ft), g = e.clientHeight, p = i(), x = Math.max(p - g, 1);
|
|
245
|
+
if (u > 0 && x > 0) {
|
|
246
|
+
const R = b / u * x;
|
|
247
|
+
let m = t(this, gt) + R;
|
|
248
|
+
const B = Math.max(0, p - g);
|
|
249
|
+
m < 0 && (m = 0), m > B && (m = B), e.scrollTop = m;
|
|
250
250
|
}
|
|
251
251
|
this.refresh();
|
|
252
|
-
}, "onMouseMove"),
|
|
253
|
-
|
|
252
|
+
}, "onMouseMove"), s = /* @__PURE__ */ h(() => {
|
|
253
|
+
y(this, j, !1), document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", s), this.refresh();
|
|
254
254
|
}, "onMouseUp");
|
|
255
|
-
document.addEventListener("mousemove", r), document.addEventListener("mouseup",
|
|
256
|
-
}), t(this,
|
|
257
|
-
if (
|
|
258
|
-
const r = t(this,
|
|
259
|
-
if (a > 0 &&
|
|
260
|
-
const
|
|
261
|
-
e.scrollTop =
|
|
255
|
+
document.addEventListener("mousemove", r), document.addEventListener("mouseup", s);
|
|
256
|
+
}), t(this, A).track.addEventListener("mousedown", (o) => {
|
|
257
|
+
if (o.button !== 0 || o.target === t(this, A).thumb) return;
|
|
258
|
+
const r = t(this, A).track.getBoundingClientRect(), s = t(this, A).thumb.clientHeight, l = o.clientY - r.top - s / 2, a = r.height - s, f = e.clientHeight, u = i(), b = Math.max(u - f, 1);
|
|
259
|
+
if (a > 0 && b > 0) {
|
|
260
|
+
const g = Math.max(0, Math.min(1, l / a));
|
|
261
|
+
e.scrollTop = g * b;
|
|
262
262
|
}
|
|
263
263
|
this.refresh();
|
|
264
|
-
}), t(this,
|
|
264
|
+
}), t(this, A).top.addEventListener("click", () => {
|
|
265
265
|
e.scrollTop -= 40;
|
|
266
|
-
}), t(this,
|
|
266
|
+
}), t(this, A).bottom.addEventListener("click", () => {
|
|
267
267
|
e.scrollTop += 40;
|
|
268
268
|
});
|
|
269
269
|
}, "#init"));
|
|
270
270
|
}
|
|
271
271
|
connectedCallback() {
|
|
272
|
-
|
|
272
|
+
y(this, P, this.getRootNode().host), y(this, et, this.closest("nine-table-sheet")), this.innerHTML = `
|
|
273
273
|
<style>
|
|
274
274
|
nine-table-vscrollbar {
|
|
275
275
|
display: flex;
|
|
@@ -334,12 +334,12 @@ const de = class de extends HTMLElement {
|
|
|
334
334
|
<button class='ng-scroll-bottom' disabled><div class='ng-scroll-icon'></div></button>
|
|
335
335
|
`;
|
|
336
336
|
const e = /* @__PURE__ */ h(() => {
|
|
337
|
-
const i = t(this,
|
|
337
|
+
const i = t(this, P).shadowRoot.querySelector(".ng-container-body .ng-part-body");
|
|
338
338
|
if (!i) {
|
|
339
339
|
setTimeout(e, 10);
|
|
340
340
|
return;
|
|
341
341
|
}
|
|
342
|
-
|
|
342
|
+
y(this, A, {
|
|
343
343
|
container: i,
|
|
344
344
|
track: this.querySelector(".ng-scroll-track"),
|
|
345
345
|
thumb: this.querySelector(".ng-scroll-thumb"),
|
|
@@ -350,18 +350,18 @@ const de = class de extends HTMLElement {
|
|
|
350
350
|
e();
|
|
351
351
|
}
|
|
352
352
|
};
|
|
353
|
-
|
|
353
|
+
P = new WeakMap(), et = new WeakMap(), j = new WeakMap(), A = new WeakMap(), ft = new WeakMap(), gt = new WeakMap(), Tt = new WeakMap(), h(de, "NineTableVScrollBar");
|
|
354
354
|
let Qt = de;
|
|
355
355
|
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar", Qt);
|
|
356
|
-
var z, w,
|
|
356
|
+
var z, w, O, k, D, K, ut, nt, kt, Lt, Ct, bt, yt, Ht, Mt, pt, _t, it, mt, $t;
|
|
357
357
|
const fe = class fe {
|
|
358
358
|
constructor(n) {
|
|
359
359
|
d(this, z);
|
|
360
360
|
d(this, w);
|
|
361
|
-
d(this,
|
|
362
|
-
d(this,
|
|
363
|
-
d(this,
|
|
364
|
-
d(this,
|
|
361
|
+
d(this, O, /* @__PURE__ */ new Map());
|
|
362
|
+
d(this, k, null);
|
|
363
|
+
d(this, D, null);
|
|
364
|
+
d(this, K, 0);
|
|
365
365
|
d(this, ut, 40);
|
|
366
366
|
d(this, nt, !1);
|
|
367
367
|
d(this, kt, 3);
|
|
@@ -371,121 +371,121 @@ const fe = class fe {
|
|
|
371
371
|
n && (t(this, bt).call(this), t(this, it).call(this, n.scrollTop), (e = t(this, w).querySelector("nine-table-vscrollbar")) == null || e.refresh());
|
|
372
372
|
}, "refresh"));
|
|
373
373
|
E(this, "initialize", /* @__PURE__ */ h(() => {
|
|
374
|
-
|
|
375
|
-
const r = t(this, w).querySelector(
|
|
374
|
+
y(this, k, null), t(this, O).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((o) => {
|
|
375
|
+
const r = t(this, w).querySelector(o);
|
|
376
376
|
if (!r) return;
|
|
377
|
-
const
|
|
378
|
-
if (!
|
|
379
|
-
const l =
|
|
377
|
+
const s = r.querySelector(".ng-part-body table");
|
|
378
|
+
if (!s) return;
|
|
379
|
+
const l = s.querySelector("tbody.bindable-tbody");
|
|
380
380
|
if (!l) return;
|
|
381
381
|
const a = Array.from(l.querySelectorAll("tr")).map((f) => f.cloneNode(!0));
|
|
382
|
-
t(this,
|
|
382
|
+
t(this, O).set(o, a);
|
|
383
383
|
});
|
|
384
384
|
const n = t(this, w).querySelector(".ng-container-body .ng-part-body"), e = t(this, w).querySelector(".ng-container-left .ng-part-body"), i = t(this, w).querySelector(".ng-container-right .ng-part-body");
|
|
385
385
|
if (n) {
|
|
386
386
|
t(this, Ct).call(this, n), t(this, pt).call(this), t(this, bt).call(this), t(this, it).call(this, n.scrollTop);
|
|
387
|
-
let
|
|
388
|
-
const r = /* @__PURE__ */ h((
|
|
387
|
+
let o = !1;
|
|
388
|
+
const r = /* @__PURE__ */ h((s, l) => {
|
|
389
389
|
var c;
|
|
390
|
-
|
|
390
|
+
o || (o = !0, n && n.scrollTop !== s && (n.scrollTop = s), e && e.scrollTop !== s && (e.scrollTop = s), i && i.scrollTop !== s && (i.scrollTop = s), t(this, it).call(this, s), (c = t(this, w).querySelector("nine-table-vscrollbar")) == null || c.refresh(), o = !1);
|
|
391
391
|
}, "syncScroll");
|
|
392
|
-
[n, e, i].forEach((
|
|
393
|
-
|
|
394
|
-
r(
|
|
392
|
+
[n, e, i].forEach((s) => {
|
|
393
|
+
s && s.addEventListener("scroll", () => {
|
|
394
|
+
r(s.scrollTop);
|
|
395
395
|
});
|
|
396
396
|
});
|
|
397
397
|
}
|
|
398
398
|
}, "initialize"));
|
|
399
399
|
d(this, Lt, /* @__PURE__ */ h((n, e) => {
|
|
400
|
-
const i = t(this,
|
|
400
|
+
const i = t(this, O).get(e);
|
|
401
401
|
if (!i || i.length === 0) return;
|
|
402
|
-
const
|
|
403
|
-
if (!
|
|
404
|
-
|
|
405
|
-
const r =
|
|
402
|
+
const o = n.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
403
|
+
if (!o) return;
|
|
404
|
+
o.querySelectorAll("tr:not(.nodata)").forEach((l) => l.remove());
|
|
405
|
+
const r = o.querySelector("tr.nodata"), s = document.createDocumentFragment();
|
|
406
406
|
for (let l = 0; l < t(this, ut); l++)
|
|
407
407
|
i.forEach((c) => {
|
|
408
|
-
|
|
408
|
+
s.appendChild(c.cloneNode(!0));
|
|
409
409
|
});
|
|
410
|
-
r ? r.before(
|
|
410
|
+
r ? r.before(s) : o.appendChild(s);
|
|
411
411
|
}, "#renderRows"));
|
|
412
412
|
d(this, Ct, /* @__PURE__ */ h((n) => {
|
|
413
|
-
if (t(this,
|
|
414
|
-
return t(this,
|
|
415
|
-
const e = t(this,
|
|
413
|
+
if (t(this, k) !== null && t(this, k) > 0)
|
|
414
|
+
return t(this, k);
|
|
415
|
+
const e = t(this, O).get(".ng-container-body");
|
|
416
416
|
if (!e || e.length === 0) return 24;
|
|
417
417
|
const i = n.querySelector("tbody.bindable-tbody");
|
|
418
418
|
if (!i) return 24;
|
|
419
|
-
i.querySelectorAll("tr:not(.nodata)").forEach((
|
|
420
|
-
const
|
|
421
|
-
e.forEach((
|
|
422
|
-
r.appendChild(
|
|
423
|
-
}),
|
|
424
|
-
const
|
|
425
|
-
(l === "none" || window.getComputedStyle(
|
|
419
|
+
i.querySelectorAll("tr:not(.nodata)").forEach((b) => b.remove());
|
|
420
|
+
const o = i.querySelector("tr.nodata"), r = document.createDocumentFragment();
|
|
421
|
+
e.forEach((b) => {
|
|
422
|
+
r.appendChild(b.cloneNode(!0));
|
|
423
|
+
}), o ? o.before(r) : i.appendChild(r);
|
|
424
|
+
const s = t(this, w), l = s.style.display, c = s.style.visibility, a = s.style.position;
|
|
425
|
+
(l === "none" || window.getComputedStyle(s).display === "none") && (s.style.display = "block", s.style.visibility = "hidden", s.style.position = "absolute");
|
|
426
426
|
let f = 0;
|
|
427
|
-
const
|
|
428
|
-
return
|
|
429
|
-
f +=
|
|
430
|
-
}),
|
|
427
|
+
const u = i.querySelectorAll("tr:not(.nodata)");
|
|
428
|
+
return u.forEach((b) => {
|
|
429
|
+
f += b.offsetHeight || b.getBoundingClientRect().height;
|
|
430
|
+
}), u.forEach((b) => b.remove()), s.style.display = l, s.style.visibility = c, s.style.position = a, y(this, k, f > 0 ? f : 24), t(this, yt).call(this), t(this, k);
|
|
431
431
|
}, "#measureAndCacheHeight"));
|
|
432
432
|
d(this, bt, /* @__PURE__ */ h(() => {
|
|
433
|
-
const e = (t(this, z).data.get() || []).length, i = t(this,
|
|
433
|
+
const e = (t(this, z).data.get() || []).length, i = t(this, k) || 24, o = e * i;
|
|
434
434
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((r) => {
|
|
435
|
-
const
|
|
436
|
-
if (!
|
|
437
|
-
const l =
|
|
438
|
-
l && (l.style.height = `${
|
|
435
|
+
const s = t(this, w).querySelector(r);
|
|
436
|
+
if (!s) return;
|
|
437
|
+
const l = s.querySelector(".ng-part-body .ng-virtual-spacer");
|
|
438
|
+
l && (l.style.height = `${o}px`);
|
|
439
439
|
});
|
|
440
440
|
}, "#updateVirtualScrollHeight"));
|
|
441
441
|
d(this, yt, /* @__PURE__ */ h(() => {
|
|
442
|
-
if (t(this,
|
|
443
|
-
const n = Math.ceil(t(this,
|
|
444
|
-
|
|
442
|
+
if (t(this, K) > 0 && t(this, k) > 0) {
|
|
443
|
+
const n = Math.ceil(t(this, K) / t(this, k));
|
|
444
|
+
y(this, ut, n + t(this, kt));
|
|
445
445
|
}
|
|
446
446
|
}, "#updateRowCount"));
|
|
447
447
|
d(this, Ht, /* @__PURE__ */ h(() => {
|
|
448
|
-
var l, c, a, f,
|
|
448
|
+
var l, c, a, f, u, b;
|
|
449
449
|
const n = t(this, w).querySelector(".ng-container-left .ng-part-body table"), e = t(this, w).querySelector(".ng-container-body .ng-part-body table"), i = t(this, w).querySelector(".ng-container-right .ng-part-body table");
|
|
450
450
|
if (e) {
|
|
451
|
-
const
|
|
452
|
-
for (let
|
|
453
|
-
const
|
|
454
|
-
((l =
|
|
455
|
-
((c = p[
|
|
456
|
-
((a =
|
|
457
|
-
],
|
|
458
|
-
|
|
451
|
+
const g = n ? Array.from(n.querySelectorAll("tbody tr")) : [], p = Array.from(e.querySelectorAll("tbody tr")), x = i ? Array.from(i.querySelectorAll("tbody tr")) : [], R = Math.max(g.length, p.length, x.length);
|
|
452
|
+
for (let m = 0; m < R; m++) {
|
|
453
|
+
const B = [
|
|
454
|
+
((l = g[m]) == null ? void 0 : l.getBoundingClientRect().height) || 0,
|
|
455
|
+
((c = p[m]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
|
|
456
|
+
((a = x[m]) == null ? void 0 : a.getBoundingClientRect().height) || 0
|
|
457
|
+
], _ = Math.max(...B);
|
|
458
|
+
_ > 0 && (g[m] && (g[m].style.height = `${_}px`), p[m] && (p[m].style.height = `${_}px`), x[m] && (x[m].style.height = `${_}px`));
|
|
459
459
|
}
|
|
460
460
|
}
|
|
461
|
-
const
|
|
461
|
+
const o = t(this, w).querySelector(".ng-container-left .ng-part-footer table"), r = t(this, w).querySelector(".ng-container-body .ng-part-footer table"), s = t(this, w).querySelector(".ng-container-right .ng-part-footer table");
|
|
462
462
|
if (r) {
|
|
463
|
-
const
|
|
464
|
-
for (let
|
|
465
|
-
const
|
|
466
|
-
((f =
|
|
467
|
-
((
|
|
468
|
-
((
|
|
469
|
-
],
|
|
470
|
-
|
|
463
|
+
const g = o ? Array.from(o.querySelectorAll("tfoot tr")) : [], p = Array.from(r.querySelectorAll("tfoot tr")), x = s ? Array.from(s.querySelectorAll("tfoot tr")) : [], R = Math.max(g.length, p.length, x.length);
|
|
464
|
+
for (let m = 0; m < R; m++) {
|
|
465
|
+
const B = [
|
|
466
|
+
((f = g[m]) == null ? void 0 : f.getBoundingClientRect().height) || 0,
|
|
467
|
+
((u = p[m]) == null ? void 0 : u.getBoundingClientRect().height) || 0,
|
|
468
|
+
((b = x[m]) == null ? void 0 : b.getBoundingClientRect().height) || 0
|
|
469
|
+
], _ = Math.max(...B);
|
|
470
|
+
_ > 0 && (g[m] && (g[m].style.height = `${_}px`), p[m] && (p[m].style.height = `${_}px`), x[m] && (x[m].style.height = `${_}px`));
|
|
471
471
|
}
|
|
472
472
|
}
|
|
473
473
|
}, "#syncRowHeights"));
|
|
474
474
|
d(this, Mt, /* @__PURE__ */ h(() => {
|
|
475
|
-
!t(this, w) || !(t(this, w) instanceof HTMLElement) || (
|
|
475
|
+
!t(this, w) || !(t(this, w) instanceof HTMLElement) || (y(this, D, new ResizeObserver((n) => {
|
|
476
476
|
for (const e of n) {
|
|
477
477
|
const i = e.target;
|
|
478
478
|
if (!i.classList.contains("active")) continue;
|
|
479
|
-
const
|
|
480
|
-
if (
|
|
479
|
+
const o = e.contentRect.height;
|
|
480
|
+
if (o > 0) {
|
|
481
481
|
let r = 0;
|
|
482
|
-
const
|
|
483
|
-
|
|
484
|
-
const c = Math.max(
|
|
485
|
-
t(this,
|
|
482
|
+
const s = i.querySelector(".ng-part-header"), l = i.querySelector(".ng-part-footer");
|
|
483
|
+
s && (r += s.offsetHeight), l && (r += l.offsetHeight);
|
|
484
|
+
const c = Math.max(o - r, 100);
|
|
485
|
+
t(this, K) !== c && (y(this, K, c), t(this, yt).call(this), t(this, k) !== null && t(this, pt).call(this));
|
|
486
486
|
}
|
|
487
487
|
}
|
|
488
|
-
})), t(this,
|
|
488
|
+
})), t(this, D).observe(t(this, w)));
|
|
489
489
|
}, "#initResizeObserver"));
|
|
490
490
|
d(this, pt, /* @__PURE__ */ h(() => {
|
|
491
491
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((n) => {
|
|
@@ -498,206 +498,234 @@ const fe = class fe {
|
|
|
498
498
|
var a;
|
|
499
499
|
const i = t(this, w).querySelector(e);
|
|
500
500
|
if (!i) return;
|
|
501
|
-
const
|
|
502
|
-
if (!
|
|
503
|
-
const r = Array.from(
|
|
504
|
-
r.forEach((f,
|
|
505
|
-
const
|
|
506
|
-
if (
|
|
501
|
+
const o = i.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
502
|
+
if (!o) return;
|
|
503
|
+
const r = Array.from(o.querySelectorAll("tr:not(.nodata)")), s = ((a = t(this, O).get(e)) == null ? void 0 : a.length) || 1, c = (t(this, z).data.get() || []).length;
|
|
504
|
+
r.forEach((f, u) => {
|
|
505
|
+
const b = n + Math.floor(u / s);
|
|
506
|
+
if (b >= c) {
|
|
507
507
|
f.style.display = "none";
|
|
508
508
|
return;
|
|
509
509
|
}
|
|
510
|
-
const
|
|
511
|
-
f.style.display = "", t(this, mt).call(this, f,
|
|
510
|
+
const g = t(this, z).data.get(b);
|
|
511
|
+
f.style.display = "", t(this, mt).call(this, f, g, b);
|
|
512
512
|
});
|
|
513
513
|
});
|
|
514
514
|
}, "#adjustBufferRows"));
|
|
515
515
|
d(this, it, /* @__PURE__ */ h((n) => {
|
|
516
516
|
var c;
|
|
517
|
-
const e = t(this,
|
|
517
|
+
const e = t(this, k);
|
|
518
518
|
if (!e || e <= 0) return;
|
|
519
|
-
const
|
|
519
|
+
const o = (t(this, z).data.get() || []).length, r = Math.max(0, Math.floor(n / e)), s = r * e, l = ((c = t(this, O).get(".ng-container-body")) == null ? void 0 : c.length) || 1;
|
|
520
520
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((a) => {
|
|
521
521
|
const f = t(this, w).querySelector(a);
|
|
522
522
|
if (!f) return;
|
|
523
|
-
const
|
|
524
|
-
if (!
|
|
525
|
-
|
|
526
|
-
const
|
|
527
|
-
if (
|
|
528
|
-
|
|
523
|
+
const u = f.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
524
|
+
if (!u) return;
|
|
525
|
+
u.style.transform = `translateY(${s}px)`, Array.from(u.querySelectorAll("tr:not(.nodata)")).forEach((g, p) => {
|
|
526
|
+
const x = r + Math.floor(p / l);
|
|
527
|
+
if (x >= o) {
|
|
528
|
+
g.style.display = "none";
|
|
529
529
|
return;
|
|
530
530
|
}
|
|
531
|
-
const
|
|
532
|
-
|
|
531
|
+
const R = t(this, z).data.get(x);
|
|
532
|
+
g.style.display = "", t(this, mt).call(this, g, R, x);
|
|
533
533
|
});
|
|
534
|
-
}), t(this, nt) || (
|
|
535
|
-
t(this, _t).call(this, r),
|
|
534
|
+
}), t(this, nt) || (y(this, nt, !0), setTimeout(() => {
|
|
535
|
+
t(this, _t).call(this, r), y(this, nt, !1);
|
|
536
536
|
}, 0));
|
|
537
537
|
}, "#handleScroll"));
|
|
538
|
+
/**
|
|
539
|
+
#bindRowData = (tr, record, dataIndex) => {
|
|
540
|
+
tr.dataset.row = dataIndex;
|
|
541
|
+
|
|
542
|
+
Array.from(tr.cells).forEach((cell, cellIndex) => {
|
|
543
|
+
const bindKey = cell.dataset.bind;
|
|
544
|
+
if (bindKey && record && record[bindKey] !== undefined) {
|
|
545
|
+
cell.textContent = record[bindKey];
|
|
546
|
+
} else {
|
|
547
|
+
cell.textContent = record ? (record[Object.keys(record)[cellIndex]] ?? `R${dataIndex}C${cellIndex}`) : `ν ${dataIndex + 1}`;
|
|
548
|
+
}
|
|
549
|
+
cell.dataset.row = dataIndex;
|
|
550
|
+
});
|
|
551
|
+
}; */
|
|
538
552
|
d(this, mt, /* @__PURE__ */ h((n, e, i) => {
|
|
539
|
-
n.dataset.row = i, Array.from(n.cells).forEach((
|
|
540
|
-
|
|
541
|
-
|
|
553
|
+
n.dataset.row = i, n.data = e, Array.from(n.cells).forEach((o, r) => {
|
|
554
|
+
o.dataset.row = i;
|
|
555
|
+
const s = o.querySelector('ng-input, ng-cell-ex, [is^="ng-"]');
|
|
556
|
+
if (s && typeof s.reset == "function")
|
|
557
|
+
s.reset();
|
|
558
|
+
else {
|
|
559
|
+
const l = o.dataset.bind;
|
|
560
|
+
l && e && e[l] !== void 0 ? o.textContent = e[l] : o.textContent = e ? e[Object.keys(e)[r]] ?? `R${i}C${r}` : `ν ${i + 1}`;
|
|
561
|
+
}
|
|
542
562
|
});
|
|
543
563
|
}, "#bindRowData"));
|
|
544
564
|
d(this, $t, /* @__PURE__ */ h(() => {
|
|
545
565
|
var c, a, f;
|
|
546
566
|
const n = t(this, w).querySelector(".ng-container-left .ng-part-header table"), e = t(this, w).querySelector(".ng-container-body .ng-part-header table"), i = t(this, w).querySelector(".ng-container-right .ng-part-header table");
|
|
547
567
|
if (!e) return;
|
|
548
|
-
const
|
|
549
|
-
for (let
|
|
550
|
-
const
|
|
551
|
-
((c =
|
|
552
|
-
((a = r[
|
|
553
|
-
((f =
|
|
554
|
-
],
|
|
555
|
-
|
|
568
|
+
const o = n ? Array.from(n.querySelectorAll("tr")) : [], r = Array.from(e.querySelectorAll("tr")), s = i ? Array.from(i.querySelectorAll("tr")) : [], l = Math.max(o.length, r.length, s.length);
|
|
569
|
+
for (let u = 0; u < l; u++) {
|
|
570
|
+
const b = [
|
|
571
|
+
((c = o[u]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
|
|
572
|
+
((a = r[u]) == null ? void 0 : a.getBoundingClientRect().height) || 0,
|
|
573
|
+
((f = s[u]) == null ? void 0 : f.getBoundingClientRect().height) || 0
|
|
574
|
+
], g = Math.max(...b);
|
|
575
|
+
g > 0 && (o[u] && (o[u].style.height = `${g}px`), r[u] && (r[u].style.height = `${g}px`), s[u] && (s[u].style.height = `${g}px`));
|
|
556
576
|
}
|
|
557
577
|
}, "#syncHeaderHeights"));
|
|
558
578
|
E(this, "destroy", /* @__PURE__ */ h(() => {
|
|
559
|
-
t(this,
|
|
579
|
+
t(this, D) && (t(this, D).disconnect(), y(this, D, null));
|
|
560
580
|
}, "destroy"));
|
|
561
|
-
|
|
581
|
+
y(this, z, n.getRootNode().host), y(this, w, n), t(this, Mt).call(this);
|
|
562
582
|
}
|
|
563
583
|
getRowHeight() {
|
|
564
|
-
return t(this,
|
|
584
|
+
return t(this, k);
|
|
565
585
|
}
|
|
566
586
|
templateLength(n = ".ng-container-body") {
|
|
567
587
|
var e;
|
|
568
|
-
return ((e = t(this,
|
|
588
|
+
return ((e = t(this, O).get(n)) == null ? void 0 : e.length) || 1;
|
|
569
589
|
}
|
|
570
590
|
};
|
|
571
|
-
z = new WeakMap(), w = new WeakMap(),
|
|
591
|
+
z = new WeakMap(), w = new WeakMap(), O = new WeakMap(), k = new WeakMap(), D = new WeakMap(), K = new WeakMap(), ut = new WeakMap(), nt = new WeakMap(), kt = new WeakMap(), Lt = new WeakMap(), Ct = new WeakMap(), bt = new WeakMap(), yt = new WeakMap(), Ht = new WeakMap(), Mt = new WeakMap(), pt = new WeakMap(), _t = new WeakMap(), it = new WeakMap(), mt = new WeakMap(), $t = new WeakMap(), h(fe, "RowManager");
|
|
572
592
|
let te = fe;
|
|
573
|
-
|
|
574
|
-
const _ = class _ {
|
|
593
|
+
const It = class It {
|
|
575
594
|
/**
|
|
576
595
|
* π― λ μ΄μμ λ΄μ μ¬λ¬ rawTables λ°°μ΄μ μΌκ΄λ‘ λ°μ λ¨μΌ λ§μ€ν° ν
νλ¦ΏμΌλ‘ μ¬μ μ»΄νμΌν©λλ€.
|
|
577
596
|
*/
|
|
578
597
|
static compileAll(n) {
|
|
579
|
-
return Array.isArray(n) ? n.map((e) =>
|
|
598
|
+
return Array.isArray(n) ? n.map((e) => It.compile(e)) : [];
|
|
580
599
|
}
|
|
581
600
|
/**
|
|
582
601
|
* π― λ¨μΌ μλ³Έ ν
μ΄λΈμ λ°μ κΈ°λ³Έ ꡬ쑰 보μ λ° 2μ°¨μ 격μ μΈλ±μ€ μ¬μ λΆμ¬ μλ£λ λ§μ€ν° ν
μ΄λΈ λ°ν
|
|
583
602
|
*/
|
|
584
603
|
static compile(n) {
|
|
585
|
-
var s, r, o, l;
|
|
586
604
|
if (!n) return null;
|
|
587
|
-
const e =
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
605
|
+
const e = /* @__PURE__ */ h((l) => {
|
|
606
|
+
l.querySelectorAll("tbody td, tbody th, tfoot td, tfoot th").forEach((a) => {
|
|
607
|
+
const f = a.getAttribute("cell-type") || "renderer";
|
|
608
|
+
if (a.children.length > 0 && a.firstElementChild.tagName.includes("-")) return;
|
|
609
|
+
let u = `cell-${f}`;
|
|
610
|
+
const b = a.getAttribute("data-bind"), g = a.getAttribute("data-expr"), p = a.getAttribute("maxbyte"), x = a.getAttribute("type");
|
|
611
|
+
let R = [];
|
|
612
|
+
b && R.push(`data-bind="${b}"`), g && R.push(`data-expr="${g}"`), p && R.push(`maxbyte="${p}"`), x && R.push(`type="${x}"`), a.innerHTML = `<${u} ${R.join(" ")}></${u}>`;
|
|
613
|
+
});
|
|
614
|
+
}, "processCellTypes"), i = /* @__PURE__ */ h((l) => {
|
|
615
|
+
if (!l.querySelector("colgroup")) {
|
|
616
|
+
const c = l.querySelector("tbody tr") || l.querySelector("tr"), a = c ? c.querySelectorAll("th, td").length : 1, f = document.createElement("colgroup"), u = Math.max(Math.floor(l.clientWidth / a), 100);
|
|
617
|
+
for (let b = 0; b < a; b++) {
|
|
618
|
+
const g = document.createElement("col");
|
|
619
|
+
g.setAttribute("width", u), f.appendChild(g);
|
|
620
|
+
}
|
|
621
|
+
l.prepend(f);
|
|
622
|
+
}
|
|
623
|
+
if (!l.querySelector("thead")) {
|
|
624
|
+
const c = document.createElement("thead"), a = l.querySelector("colgroup");
|
|
625
|
+
a ? a.after(c) : l.prepend(c);
|
|
626
|
+
}
|
|
627
|
+
l.classList.add("nine-table-element"), l.style.display = "table";
|
|
628
|
+
}, "ensureTableStructure"), o = /* @__PURE__ */ h((l, c) => {
|
|
629
|
+
const a = Array.from(l.querySelectorAll(c + " tr")), f = Array.from(l.querySelectorAll(c + " th," + c + " td")), u = a.length;
|
|
630
|
+
if (u === 0 || f.length === 0) return;
|
|
631
|
+
let b = 0;
|
|
632
|
+
f.forEach((p) => {
|
|
633
|
+
b += p.colSpan || 1;
|
|
634
|
+
});
|
|
635
|
+
const g = Array.from(Array(u), () => Array(b).fill(null));
|
|
636
|
+
a.forEach((p) => {
|
|
637
|
+
const x = p.sectionRowIndex;
|
|
638
|
+
let R = 0;
|
|
639
|
+
Array.from(p.querySelectorAll("th,td")).forEach((m) => {
|
|
640
|
+
for (let I = 0; I < g[x].length; I++)
|
|
641
|
+
if (g[x][I] === null) {
|
|
642
|
+
R = I;
|
|
643
|
+
break;
|
|
644
|
+
}
|
|
645
|
+
const B = m.rowSpan || 1, _ = m.colSpan || 1;
|
|
646
|
+
for (let I = 0; I < B; I++)
|
|
647
|
+
for (let ct = 0; ct < _; ct++)
|
|
648
|
+
x + I < u && R + ct < b && (g[x + I][R + ct] = I === 0 && ct === 0 ? "1" : "0");
|
|
649
|
+
});
|
|
650
|
+
}), a.forEach((p) => {
|
|
651
|
+
const x = p.sectionRowIndex;
|
|
652
|
+
Array.from(p.querySelectorAll("th,td")).forEach((R) => {
|
|
653
|
+
for (let m = 0; m < g[x].length; m++)
|
|
654
|
+
if (g[x][m] === "1") {
|
|
655
|
+
R.dataset.col = m, g[x][m] = "0";
|
|
656
|
+
break;
|
|
657
|
+
}
|
|
658
|
+
});
|
|
659
|
+
});
|
|
660
|
+
}, "resetColIndex"), r = n.cloneNode(!0);
|
|
661
|
+
return i(r), e(r), o(r, "thead"), o(r, "tbody"), o(r, "tfoot"), Array.from(r.querySelectorAll("colgroup col")).forEach((l, c) => {
|
|
662
|
+
const a = l.getAttribute("fixed");
|
|
663
|
+
a && r.querySelectorAll(`thead [data-col="${c}"], tbody [data-col="${c}"], tfoot [data-col="${c}"]`).forEach((f) => {
|
|
664
|
+
f.setAttribute("fixed", a);
|
|
592
665
|
});
|
|
593
|
-
}),
|
|
666
|
+
}), r;
|
|
594
667
|
}
|
|
668
|
+
// π― [μΆκ°] td/thμ μ μΈλ cell-type μμ±μ μ½μ΄ 컀μ€ν
νκ·Έλ‘ μλ κ°μΈκΈ°
|
|
595
669
|
};
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
for (let o = 0; o < i; o++) {
|
|
600
|
-
const l = document.createElement("col");
|
|
601
|
-
l.setAttribute("width", r), s.appendChild(l);
|
|
602
|
-
}
|
|
603
|
-
n.prepend(s);
|
|
604
|
-
}
|
|
605
|
-
if (!n.querySelector("thead")) {
|
|
606
|
-
const e = document.createElement("thead"), i = n.querySelector("colgroup");
|
|
607
|
-
i ? i.after(e) : n.prepend(e);
|
|
608
|
-
}
|
|
609
|
-
n.classList.add("nine-table-element"), n.style.display = "table";
|
|
610
|
-
}, "#ensureTableStructure")), d(_, st, /* @__PURE__ */ h((n, e) => {
|
|
611
|
-
const i = Array.from(n.querySelectorAll(e + " tr")), s = Array.from(n.querySelectorAll(e + " th," + e + " td")), r = i.length;
|
|
612
|
-
if (r === 0 || s.length === 0) return;
|
|
613
|
-
let o = 0;
|
|
614
|
-
s.forEach((c) => {
|
|
615
|
-
o += c.colSpan || 1;
|
|
616
|
-
});
|
|
617
|
-
const l = Array.from(Array(r), () => Array(o).fill(null));
|
|
618
|
-
i.forEach((c) => {
|
|
619
|
-
const a = c.sectionRowIndex;
|
|
620
|
-
let f = 0;
|
|
621
|
-
Array.from(c.querySelectorAll("th,td")).forEach((g) => {
|
|
622
|
-
for (let p = 0; p < l[a].length; p++)
|
|
623
|
-
if (l[a][p] === null) {
|
|
624
|
-
f = p;
|
|
625
|
-
break;
|
|
626
|
-
}
|
|
627
|
-
const y = g.rowSpan || 1, b = g.colSpan || 1;
|
|
628
|
-
for (let p = 0; p < y; p++)
|
|
629
|
-
for (let v = 0; v < b; v++)
|
|
630
|
-
a + p < r && f + v < o && (l[a + p][f + v] = p === 0 && v === 0 ? "1" : "0");
|
|
631
|
-
});
|
|
632
|
-
}), i.forEach((c) => {
|
|
633
|
-
const a = c.sectionRowIndex;
|
|
634
|
-
Array.from(c.querySelectorAll("th,td")).forEach((f) => {
|
|
635
|
-
for (let g = 0; g < l[a].length; g++)
|
|
636
|
-
if (l[a][g] === "1") {
|
|
637
|
-
f.dataset.col = g, l[a][g] = "0";
|
|
638
|
-
break;
|
|
639
|
-
}
|
|
640
|
-
});
|
|
641
|
-
});
|
|
642
|
-
}, "#resetColIndex"));
|
|
643
|
-
let ee = _;
|
|
644
|
-
var Wt, K, Z, Ot, zt, ot, Bt, Nt;
|
|
670
|
+
h(It, "TableCompiler");
|
|
671
|
+
let ee = It;
|
|
672
|
+
var Wt, Z, G, Ot, zt, ot, Bt, Nt;
|
|
645
673
|
const ht = class ht extends HTMLElement {
|
|
646
674
|
constructor() {
|
|
647
675
|
super();
|
|
648
676
|
d(this, Wt);
|
|
649
|
-
d(this,
|
|
650
|
-
d(this,
|
|
677
|
+
d(this, Z, null);
|
|
678
|
+
d(this, G);
|
|
651
679
|
E(this, "invalidate", /* @__PURE__ */ h(() => {
|
|
652
680
|
var e, i;
|
|
653
|
-
t(this,
|
|
681
|
+
t(this, G).refresh(), (e = this.querySelector("nine-table-hscrollbar")) == null || e.refresh(), (i = this.querySelector("nine-table-vscrollbar")) == null || i.refresh();
|
|
654
682
|
}, "invalidate"));
|
|
655
683
|
d(this, Ot, /* @__PURE__ */ h(() => {
|
|
656
684
|
[
|
|
657
685
|
{ selector: ".ng-container-body", type: null },
|
|
658
686
|
{ selector: ".ng-container-left", type: "left" },
|
|
659
687
|
{ selector: ".ng-container-right", type: "right" }
|
|
660
|
-
].forEach(({ selector: i, type:
|
|
688
|
+
].forEach(({ selector: i, type: o }) => {
|
|
661
689
|
const r = this.querySelector(i);
|
|
662
690
|
if (!r) return;
|
|
663
691
|
r.innerHTML = "";
|
|
664
|
-
const
|
|
665
|
-
|
|
692
|
+
const s = document.createElement("div");
|
|
693
|
+
s.className = "ng-part-header", s.appendChild(t(this, ot).call(this, t(this, Z), o, "header"));
|
|
666
694
|
const l = document.createElement("div");
|
|
667
695
|
l.className = "ng-part-body";
|
|
668
696
|
const c = document.createElement("div");
|
|
669
|
-
c.className = "ng-scroll-content", c.style.position = "relative", c.style.width = "100%", c.appendChild(t(this, ot).call(this, t(this,
|
|
697
|
+
c.className = "ng-scroll-content", c.style.position = "relative", c.style.width = "100%", c.appendChild(t(this, ot).call(this, t(this, Z), o, "body"));
|
|
670
698
|
const a = document.createElement("div");
|
|
671
699
|
a.className = "ng-virtual-spacer", a.style.width = "100%", a.style.pointerEvents = "none", c.appendChild(a), l.appendChild(c);
|
|
672
700
|
const f = document.createElement("div");
|
|
673
|
-
f.className = "ng-part-footer", f.appendChild(t(this, ot).call(this, t(this,
|
|
701
|
+
f.className = "ng-part-footer", f.appendChild(t(this, ot).call(this, t(this, Z), o, "footer")), r.appendChild(s), r.appendChild(l), r.appendChild(f);
|
|
674
702
|
});
|
|
675
703
|
}, "#renderSplitContainers"));
|
|
676
704
|
d(this, zt, /* @__PURE__ */ h(() => {
|
|
677
705
|
["left", "right", "body"].forEach((e) => {
|
|
678
|
-
const i = this.querySelector(`.ng-container-${e}`),
|
|
679
|
-
if (!i || !
|
|
706
|
+
const i = this.querySelector(`.ng-container-${e}`), o = i == null ? void 0 : i.querySelectorAll("table");
|
|
707
|
+
if (!i || !o || o.length === 0) return;
|
|
680
708
|
let r = 0;
|
|
681
|
-
|
|
682
|
-
const l = parseInt(
|
|
709
|
+
o[0].querySelectorAll("col").forEach((s) => {
|
|
710
|
+
const l = parseInt(s.getAttribute("width"), 10);
|
|
683
711
|
isNaN(r) || (r += l);
|
|
684
712
|
}), e === "body" ? i.style.flex = "1" : (i.style.flex = `0 0 ${r}px`, i.style.width = `${r}px`);
|
|
685
713
|
});
|
|
686
714
|
}, "#updateContainerWidths"));
|
|
687
715
|
E(this, "generate", /* @__PURE__ */ h((e) => {
|
|
688
|
-
e && (
|
|
716
|
+
e && (y(this, Z, ee.compile(e)), t(this, Ot).call(this), t(this, zt).call(this), t(this, G).initialize(), setTimeout(() => {
|
|
689
717
|
var i;
|
|
690
718
|
(i = this.querySelector("nine-table-hscrollbar")) == null || i.refresh();
|
|
691
719
|
}, 0));
|
|
692
720
|
}, "generate"));
|
|
693
|
-
d(this, ot, /* @__PURE__ */ h((e, i,
|
|
694
|
-
const r = e.cloneNode(!0),
|
|
695
|
-
if (
|
|
721
|
+
d(this, ot, /* @__PURE__ */ h((e, i, o) => {
|
|
722
|
+
const r = e.cloneNode(!0), s = r.querySelector("thead"), l = r.querySelector("tbody"), c = r.querySelector("tfoot");
|
|
723
|
+
if (o === "header") {
|
|
696
724
|
if (l && l.remove(), c && c.remove(), e.querySelector("tbody")) {
|
|
697
725
|
const f = document.createElement("tbody");
|
|
698
726
|
f.className = "fixed-tbody", r.appendChild(f);
|
|
699
727
|
}
|
|
700
|
-
} else
|
|
728
|
+
} else o === "body" ? (s && s.remove(), c && c.remove(), l && (l.className = "bindable-tbody")) : o === "footer" && (s && s.remove(), l && l.remove());
|
|
701
729
|
return i === "left" ? r.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((a) => {
|
|
702
730
|
a.getAttribute("fixed") !== "left" && a.remove();
|
|
703
731
|
}) : i === "right" ? r.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((a) => {
|
|
@@ -706,7 +734,7 @@ const ht = class ht extends HTMLElement {
|
|
|
706
734
|
a.remove();
|
|
707
735
|
}), r;
|
|
708
736
|
}, "#createSplitTable"));
|
|
709
|
-
E(this, "getRowHeight", /* @__PURE__ */ h(() => t(this,
|
|
737
|
+
E(this, "getRowHeight", /* @__PURE__ */ h(() => t(this, G).getRowHeight(), "getRowHeight"));
|
|
710
738
|
E(this, "scrollToX", /* @__PURE__ */ h((e) => {
|
|
711
739
|
const i = this.querySelector(".ng-container-body .ng-part-body");
|
|
712
740
|
i && (i.scrollLeft = e);
|
|
@@ -787,6 +815,7 @@ const ht = class ht extends HTMLElement {
|
|
|
787
815
|
overflow-x: auto;
|
|
788
816
|
position: relative;
|
|
789
817
|
scrollbar-width: none;
|
|
818
|
+
overscroll-behavior: none; /* π― μλμ λΏμμ λ λμ»₯거리며 λ°λ¦¬λ λ°μ΄μ€ νμ μ°¨λ¨ */
|
|
790
819
|
&::-webkit-scrollbar { display: none; height: 0px; }
|
|
791
820
|
}
|
|
792
821
|
|
|
@@ -860,7 +889,7 @@ const ht = class ht extends HTMLElement {
|
|
|
860
889
|
</div>
|
|
861
890
|
`;
|
|
862
891
|
}, "#render"));
|
|
863
|
-
|
|
892
|
+
y(this, G, new te(this)), y(this, Wt, this.getRootNode().host);
|
|
864
893
|
}
|
|
865
894
|
connectedCallback() {
|
|
866
895
|
t(this, Bt).call(this);
|
|
@@ -869,7 +898,7 @@ const ht = class ht extends HTMLElement {
|
|
|
869
898
|
this.innerHTML = "", dt.log("NineTableSheet destroyed.");
|
|
870
899
|
}
|
|
871
900
|
};
|
|
872
|
-
Wt = new WeakMap(),
|
|
901
|
+
Wt = new WeakMap(), Z = new WeakMap(), G = new WeakMap(), Ot = new WeakMap(), zt = new WeakMap(), ot = new WeakMap(), Bt = new WeakMap(), Nt = new WeakMap(), h(ht, "NineTableSheet"), E(ht, "SCROLLBAR_SIZE", 16);
|
|
873
902
|
let Rt = ht;
|
|
874
903
|
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", Rt);
|
|
875
904
|
var Pt, xt;
|
|
@@ -879,41 +908,41 @@ const ge = class ge extends HTMLElement {
|
|
|
879
908
|
d(this, Pt, /* @__PURE__ */ h(() => {
|
|
880
909
|
var e;
|
|
881
910
|
(e = this.querySelector(".nine-tab-bar")) == null || e.addEventListener("click", (i) => {
|
|
882
|
-
var
|
|
883
|
-
const
|
|
884
|
-
t(this, xt).call(this, r,
|
|
911
|
+
var s;
|
|
912
|
+
const o = i.ctrlKey || i.metaKey || i.shiftKey, r = parseInt((s = i.target.closest(".nine-tab-item")) == null ? void 0 : s.dataset.index, 10);
|
|
913
|
+
t(this, xt).call(this, r, o);
|
|
885
914
|
}), t(this, xt).call(this, 0, !1);
|
|
886
915
|
}, "#init"));
|
|
887
916
|
d(this, xt, /* @__PURE__ */ h((e, i = !1) => {
|
|
888
|
-
const
|
|
917
|
+
const o = /* @__PURE__ */ h(() => {
|
|
889
918
|
const f = Array.from(this.querySelectorAll("nine-table-sheet"));
|
|
890
|
-
Array.from(this.querySelectorAll("nine-splitter")).forEach((
|
|
891
|
-
const
|
|
892
|
-
|
|
893
|
-
const p = parseInt(
|
|
894
|
-
|
|
919
|
+
Array.from(this.querySelectorAll("nine-splitter")).forEach((g) => g.style.setProperty("display", "none"));
|
|
920
|
+
const b = f.filter((g) => g.classList.contains("active"));
|
|
921
|
+
b.length < 2 || b.forEach((g) => {
|
|
922
|
+
const p = parseInt(g.getAttribute("data-index"), 10), x = this.querySelector(`nine-splitter[data-split-index="${p}"]`), R = f[p + 1];
|
|
923
|
+
x && R && R.classList.contains("active") && x.style.setProperty("display", "flex");
|
|
895
924
|
});
|
|
896
|
-
}, "updateSplitters"), r = this.querySelector(".nine-tab-bar"),
|
|
925
|
+
}, "updateSplitters"), r = this.querySelector(".nine-tab-bar"), s = this.querySelector("nine-table-sheets-body"), l = r.querySelectorAll(".nine-tab-item"), c = s.querySelectorAll("nine-table-sheet");
|
|
897
926
|
if (!l[e]) return;
|
|
898
927
|
if (!i)
|
|
899
|
-
l.forEach((f,
|
|
900
|
-
f.classList.toggle("active",
|
|
901
|
-
}), c.forEach((f,
|
|
902
|
-
const
|
|
903
|
-
f.classList.toggle("active",
|
|
928
|
+
l.forEach((f, u) => {
|
|
929
|
+
f.classList.toggle("active", u === e);
|
|
930
|
+
}), c.forEach((f, u) => {
|
|
931
|
+
const b = u === e;
|
|
932
|
+
f.classList.toggle("active", b), f.style.flex = b ? "1 1 100%" : "";
|
|
904
933
|
});
|
|
905
934
|
else {
|
|
906
|
-
const f = l[e],
|
|
907
|
-
if (f.classList.contains("active") &&
|
|
935
|
+
const f = l[e], u = r.querySelectorAll(".nine-tab-item.active");
|
|
936
|
+
if (f.classList.contains("active") && u.length <= 1)
|
|
908
937
|
return;
|
|
909
938
|
f.classList.toggle("active");
|
|
910
|
-
const
|
|
911
|
-
|
|
939
|
+
const b = s.querySelector(`nine-table-sheet[data-index="${e}"]`);
|
|
940
|
+
b && (b.classList.toggle("active"), b.classList.contains("active") || (b.style.flex = ""));
|
|
912
941
|
}
|
|
913
|
-
const a =
|
|
942
|
+
const a = s.querySelectorAll("nine-table-sheet.active");
|
|
914
943
|
a == null || a.forEach((f) => {
|
|
915
944
|
f.style.flex = a.length > 1 ? "1 1 0%" : "1 1 100%";
|
|
916
|
-
}),
|
|
945
|
+
}), o();
|
|
917
946
|
}, "#switchSheet"));
|
|
918
947
|
}
|
|
919
948
|
connectedCallback() {
|
|
@@ -923,29 +952,29 @@ const ge = class ge extends HTMLElement {
|
|
|
923
952
|
Pt = new WeakMap(), xt = new WeakMap(), h(ge, "NineTableSheets");
|
|
924
953
|
let ne = ge;
|
|
925
954
|
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", ne);
|
|
926
|
-
var
|
|
955
|
+
var L, Dt, vt, Yt;
|
|
927
956
|
const ue = class ue {
|
|
928
957
|
constructor(n) {
|
|
929
|
-
d(this,
|
|
958
|
+
d(this, L);
|
|
930
959
|
d(this, Dt, /* @__PURE__ */ h(() => {
|
|
931
960
|
t(this, Yt).call(this), new ResizeObserver((n) => {
|
|
932
961
|
for (let e of n)
|
|
933
|
-
t(this,
|
|
934
|
-
}).observe(t(this,
|
|
962
|
+
t(this, L).getAttribute("auto-height") === "true" && t(this, vt).call(this);
|
|
963
|
+
}).observe(t(this, L));
|
|
935
964
|
}, "#init"));
|
|
936
965
|
d(this, vt, /* @__PURE__ */ h(() => {
|
|
937
966
|
var c, a;
|
|
938
|
-
const n = Array.from(t(this,
|
|
967
|
+
const n = Array.from(t(this, L).shadowRoot.querySelectorAll("nine-table-sheet.active"));
|
|
939
968
|
if (n.length === 0) return;
|
|
940
|
-
const e = parseInt(t(this,
|
|
941
|
-
t(this,
|
|
969
|
+
const e = parseInt(t(this, L).getAttribute("max-display-row"), 10) || 10, i = Math.max(...n.map((f) => f.getRowHeight())), o = (c = t(this, L).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : c.getBoundingClientRect().height, r = (a = t(this, L).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : a.getBoundingClientRect().height, s = Rt.SCROLLBAR_SIZE, l = e * i + o + r + s;
|
|
970
|
+
t(this, L).style.height = `${l}px`;
|
|
942
971
|
}, "#applyAutoHeight"));
|
|
943
972
|
d(this, Yt, /* @__PURE__ */ h(() => {
|
|
944
|
-
const e = Array.from(t(this,
|
|
945
|
-
const
|
|
946
|
-
return
|
|
947
|
-
}).join(""),
|
|
948
|
-
t(this,
|
|
973
|
+
const e = Array.from(t(this, L).children).filter((c) => c.tagName === "TABLE"), i = t(this, L).getAttribute("auto-height") === "true", o = e.length, r = e.map((c, a) => {
|
|
974
|
+
const u = `<nine-table-sheet class="${a === 0 ? "active" : ""}" data-index="${a}"></nine-table-sheet>`, b = a < o - 1 ? `<nine-splitter class="h" data-split-index="${a}"></nine-splitter>` : "";
|
|
975
|
+
return u + b;
|
|
976
|
+
}).join(""), s = e.map((c, a) => `<div class="nine-tab-item ${a === 0 ? "active" : ""}" data-index="${a}">Sheet ${a + 1}</div>`).join("");
|
|
977
|
+
t(this, L).shadowRoot.innerHTML = `
|
|
949
978
|
<style>
|
|
950
979
|
:host {
|
|
951
980
|
display: flex;
|
|
@@ -1028,7 +1057,7 @@ const ue = class ue {
|
|
|
1028
1057
|
<nine-table-sheets>
|
|
1029
1058
|
<nine-table-sheets-body>${r}</nine-table-sheets-body>
|
|
1030
1059
|
<nine-table-sheets-footer>
|
|
1031
|
-
<div class="nine-tab-bar">${
|
|
1060
|
+
<div class="nine-tab-bar">${s}</div>
|
|
1032
1061
|
<div class="sheets-counter">Total : <span id="row-count">0</span></div>
|
|
1033
1062
|
</nine-table-sheets-footer>
|
|
1034
1063
|
</nine-table-sheets>
|
|
@@ -1036,57 +1065,57 @@ const ue = class ue {
|
|
|
1036
1065
|
</nine-table-body>
|
|
1037
1066
|
<nine-table-footer></nine-table-footer>
|
|
1038
1067
|
`;
|
|
1039
|
-
const l = t(this,
|
|
1068
|
+
const l = t(this, L).shadowRoot.querySelectorAll("nine-table-sheet");
|
|
1040
1069
|
l == null || l.forEach((c, a) => {
|
|
1041
1070
|
e[a] && setTimeout(() => {
|
|
1042
1071
|
c.generate(e[a]), i && t(this, vt).call(this);
|
|
1043
1072
|
});
|
|
1044
1073
|
});
|
|
1045
1074
|
}, "#render"));
|
|
1046
|
-
|
|
1075
|
+
y(this, L, n), t(this, Dt).call(this);
|
|
1047
1076
|
}
|
|
1048
1077
|
};
|
|
1049
|
-
|
|
1078
|
+
L = new WeakMap(), Dt = new WeakMap(), vt = new WeakMap(), Yt = new WeakMap(), h(ue, "LayoutManager");
|
|
1050
1079
|
let ie = ue;
|
|
1051
|
-
var wt,
|
|
1080
|
+
var wt, st;
|
|
1052
1081
|
const be = class be {
|
|
1053
1082
|
constructor(n) {
|
|
1054
1083
|
d(this, wt);
|
|
1055
|
-
d(this,
|
|
1084
|
+
d(this, st, -1);
|
|
1056
1085
|
E(this, "count", /* @__PURE__ */ h(() => t(this, wt).rawRecords.length, "count"));
|
|
1057
|
-
|
|
1086
|
+
y(this, wt, n);
|
|
1058
1087
|
}
|
|
1059
1088
|
get at() {
|
|
1060
|
-
return t(this,
|
|
1089
|
+
return t(this, st);
|
|
1061
1090
|
}
|
|
1062
1091
|
set at(n) {
|
|
1063
|
-
|
|
1092
|
+
y(this, st, parseInt(n, 10)), body && !body.querySelector(`tbody.bindable tr[data-row="${t(this, st)}"]`) && setTimeout(() => {
|
|
1064
1093
|
});
|
|
1065
1094
|
}
|
|
1066
1095
|
};
|
|
1067
|
-
wt = new WeakMap(),
|
|
1068
|
-
let
|
|
1069
|
-
var
|
|
1070
|
-
const
|
|
1096
|
+
wt = new WeakMap(), st = new WeakMap(), h(be, "ngRow");
|
|
1097
|
+
let oe = be;
|
|
1098
|
+
var C, q, H, rt, Ft, Y, Vt, J, St, Xt, Ut, lt;
|
|
1099
|
+
const M = class M {
|
|
1071
1100
|
constructor(n, e) {
|
|
1072
|
-
d(this,
|
|
1073
|
-
d(this,
|
|
1074
|
-
d(this,
|
|
1075
|
-
d(this,
|
|
1101
|
+
d(this, C);
|
|
1102
|
+
d(this, q);
|
|
1103
|
+
d(this, H, []);
|
|
1104
|
+
d(this, rt, []);
|
|
1076
1105
|
d(this, Ft, 0);
|
|
1077
|
-
d(this,
|
|
1106
|
+
d(this, Y, []);
|
|
1078
1107
|
d(this, Vt, /* @__PURE__ */ h(() => {
|
|
1079
|
-
|
|
1080
|
-
const n = t(this,
|
|
1108
|
+
y(this, Y, []);
|
|
1109
|
+
const n = t(this, C).template || [];
|
|
1081
1110
|
Array.from(n).forEach((e) => {
|
|
1082
1111
|
var i;
|
|
1083
|
-
t(this,
|
|
1084
|
-
}), (t(this,
|
|
1085
|
-
e.__ng || (e.__ng = t(this, St).call(this)), e.__ng.height = t(this,
|
|
1112
|
+
t(this, Y).push(((i = e.getBoundingClientRect) == null ? void 0 : i.call(e).height) || 24);
|
|
1113
|
+
}), (t(this, q).rawRecords || []).forEach((e) => {
|
|
1114
|
+
e.__ng || (e.__ng = t(this, St).call(this)), e.__ng.height = t(this, Y).slice();
|
|
1086
1115
|
});
|
|
1087
1116
|
}, "#initialize"));
|
|
1088
|
-
d(this,
|
|
1089
|
-
t(this,
|
|
1117
|
+
d(this, J, /* @__PURE__ */ h(() => {
|
|
1118
|
+
t(this, C).shadowRoot.querySelectorAll("nine-table-sheet").forEach((n) => {
|
|
1090
1119
|
n.invalidate();
|
|
1091
1120
|
});
|
|
1092
1121
|
}, "#invalidate"));
|
|
@@ -1094,103 +1123,103 @@ const H = class H {
|
|
|
1094
1123
|
var r;
|
|
1095
1124
|
const i = this.getValidData();
|
|
1096
1125
|
if (!i || i.length <= 0) return;
|
|
1097
|
-
if (n == null) return t(this,
|
|
1126
|
+
if (n == null) return t(this, lt).call(this, i);
|
|
1098
1127
|
if (n < 0 || n >= i.length) return null;
|
|
1099
|
-
const
|
|
1128
|
+
const o = typeof ((r = t(this, C).fields) == null ? void 0 : r.get) == "function" ? t(this, C).fields.get() : [];
|
|
1100
1129
|
if (e != null) {
|
|
1101
|
-
const
|
|
1102
|
-
return
|
|
1130
|
+
const s = o.indexOf(e);
|
|
1131
|
+
return s >= 0 ? i[n].v[s] : null;
|
|
1103
1132
|
}
|
|
1104
|
-
return t(this,
|
|
1133
|
+
return t(this, lt).call(this, i[n]);
|
|
1105
1134
|
}, "get"));
|
|
1106
1135
|
E(this, "set", /* @__PURE__ */ h((n) => {
|
|
1107
|
-
this.clear(), this.add(n, !1), t(this,
|
|
1136
|
+
this.clear(), this.add(n, !1), t(this, J).call(this);
|
|
1108
1137
|
}, "set"));
|
|
1109
1138
|
d(this, St, /* @__PURE__ */ h(() => ({
|
|
1110
|
-
rowState:
|
|
1139
|
+
rowState: M.ROW_STATE.EMPTY,
|
|
1111
1140
|
deleted: !1,
|
|
1112
1141
|
filtered: !1,
|
|
1113
|
-
height: t(this,
|
|
1142
|
+
height: t(this, Y).slice(),
|
|
1114
1143
|
o: {},
|
|
1115
1144
|
c: {},
|
|
1116
|
-
_: [0, 0, 0, 0,
|
|
1145
|
+
_: [0, 0, 0, 0, M.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this, Y).slice(), -1, {}, {}]
|
|
1117
1146
|
}), "#getDefaultMeta"));
|
|
1118
1147
|
E(this, "reset", /* @__PURE__ */ h(() => {
|
|
1119
|
-
|
|
1148
|
+
y(this, H, []), y(this, rt, []), t(this, J).call(this);
|
|
1120
1149
|
}, "reset"));
|
|
1121
1150
|
E(this, "clear", /* @__PURE__ */ h(() => {
|
|
1122
1151
|
var n;
|
|
1123
|
-
t(this,
|
|
1152
|
+
t(this, q).rawRecords = [], y(this, H, []), y(this, rt, []), (n = t(this, q).viewRecords) != null && n.reset && t(this, q).viewRecords.reset();
|
|
1124
1153
|
}, "clear"));
|
|
1125
1154
|
d(this, Xt, /* @__PURE__ */ h((n) => {
|
|
1126
|
-
var
|
|
1155
|
+
var o;
|
|
1127
1156
|
Array.isArray(n) || (n = [n]);
|
|
1128
|
-
const e = typeof ((
|
|
1157
|
+
const e = typeof ((o = t(this, C).fields) == null ? void 0 : o.get) == "function" ? t(this, C).fields.get() : Object.keys(n[0] || {}), i = [];
|
|
1129
1158
|
return n.forEach((r) => {
|
|
1130
|
-
const
|
|
1159
|
+
const s = { v: [] };
|
|
1131
1160
|
e.forEach((l) => {
|
|
1132
|
-
|
|
1133
|
-
}), i.push(
|
|
1161
|
+
s.v.push(r[l] !== void 0 && r[l] !== null ? r[l] : "");
|
|
1162
|
+
}), i.push(s);
|
|
1134
1163
|
}), i;
|
|
1135
1164
|
}, "#json2Array"));
|
|
1136
1165
|
d(this, Ut, /* @__PURE__ */ h((n) => (Array.isArray(n) || (n = [n]), n.forEach((e) => {
|
|
1137
|
-
e.__ng = t(this, St).call(this), e.__ng.rowid = this.nextId, e.__ng.rowState =
|
|
1166
|
+
e.__ng = t(this, St).call(this), e.__ng.rowid = this.nextId, e.__ng.rowState = M.ROW_STATE.INSERT, e.__ng._[0] = e.__ng.rowid;
|
|
1138
1167
|
}), n), "#defaultInsert"));
|
|
1139
1168
|
E(this, "add", /* @__PURE__ */ h((n, e = !0) => {
|
|
1140
1169
|
n === void 0 && (n = {});
|
|
1141
1170
|
const i = t(this, Xt).call(this, n);
|
|
1142
|
-
t(this,
|
|
1143
|
-
const
|
|
1144
|
-
return e || i.forEach((r,
|
|
1145
|
-
const l = t(this,
|
|
1146
|
-
l && (l.__ng.rowState =
|
|
1147
|
-
}), t(this,
|
|
1171
|
+
t(this, q).rawRecords = t(this, q).rawRecords.concat(t(this, Ut).call(this, i)), this.resetRecords();
|
|
1172
|
+
const o = this.count() - 1;
|
|
1173
|
+
return e || i.forEach((r, s) => {
|
|
1174
|
+
const l = t(this, q).rawRecords[o - s];
|
|
1175
|
+
l && (l.__ng.rowState = M.ROW_STATE.EMPTY);
|
|
1176
|
+
}), t(this, J).call(this), o;
|
|
1148
1177
|
}, "add"));
|
|
1149
1178
|
E(this, "delete", /* @__PURE__ */ h((n) => {
|
|
1150
1179
|
let e = [];
|
|
1151
|
-
Array.isArray(n) ? e = n : typeof n > "u" ? e = [t(this,
|
|
1152
|
-
if (t(this,
|
|
1153
|
-
const
|
|
1154
|
-
t(this,
|
|
1155
|
-
r.__ng.rowid ===
|
|
1180
|
+
Array.isArray(n) ? e = n : typeof n > "u" ? e = [t(this, q).host.row.at] : e = [parseInt(n, 10)], e.sort((i, o) => o - i).forEach((i) => {
|
|
1181
|
+
if (t(this, H)[i]) {
|
|
1182
|
+
const o = t(this, H)[i].__ng.rowid;
|
|
1183
|
+
t(this, H)[i].__ng.rowState === M.ROW_STATE.INSERT ? t(this, q).rawRecords = t(this, q).rawRecords.filter((r) => r.__ng.rowid !== o) : t(this, q).rawRecords.forEach((r) => {
|
|
1184
|
+
r.__ng.rowid === o && (r.__ng.deleted = !0, r.__ng.rowState = M.ROW_STATE.DELETE);
|
|
1156
1185
|
});
|
|
1157
1186
|
}
|
|
1158
|
-
}), this.resetRecords(), t(this,
|
|
1187
|
+
}), this.resetRecords(), t(this, J).call(this);
|
|
1159
1188
|
}, "delete"));
|
|
1160
1189
|
E(this, "setValue", /* @__PURE__ */ h((n, e, i) => {
|
|
1161
1190
|
var c;
|
|
1162
1191
|
n = parseInt(n, 10);
|
|
1163
|
-
const r = (typeof ((c = t(this,
|
|
1192
|
+
const r = (typeof ((c = t(this, C).fields) == null ? void 0 : c.get) == "function" ? t(this, C).fields.get() : []).indexOf(e);
|
|
1164
1193
|
if (r < 0) return;
|
|
1165
|
-
const
|
|
1166
|
-
if (!
|
|
1167
|
-
const l =
|
|
1168
|
-
l !== i &&
|
|
1194
|
+
const s = this.getValidData()[n];
|
|
1195
|
+
if (!s) return;
|
|
1196
|
+
const l = s.v[r];
|
|
1197
|
+
l !== i && s.__ng.rowState !== M.ROW_STATE.INSERT && (s.__ng.o.hasOwnProperty(e) || (s.__ng.o[e] = l), s.__ng.rowState = M.ROW_STATE.UPDATE), s.v[r] = i;
|
|
1169
1198
|
}, "setValue"));
|
|
1170
1199
|
E(this, "resetRecords", /* @__PURE__ */ h(() => {
|
|
1171
|
-
|
|
1200
|
+
y(this, rt, t(this, q).rawRecords.filter((n) => !n.__ng.deleted)), y(this, H, t(this, q).rawRecords.filter((n) => !n.__ng.deleted && !n.__ng.filtered)), t(this, q).rawRecords.forEach((n, e) => {
|
|
1172
1201
|
n.__ng.rowidx = e;
|
|
1173
|
-
}), t(this,
|
|
1202
|
+
}), t(this, H).forEach((n, e) => {
|
|
1174
1203
|
n.__ng.i = e;
|
|
1175
1204
|
});
|
|
1176
1205
|
}, "resetRecords"));
|
|
1177
|
-
E(this, "getValidData", /* @__PURE__ */ h(() => (t(this,
|
|
1178
|
-
d(this,
|
|
1179
|
-
var
|
|
1206
|
+
E(this, "getValidData", /* @__PURE__ */ h(() => (t(this, H).length === 0 && t(this, q).rawRecords.length > 0 && this.resetRecords(), t(this, H)), "getValidData"));
|
|
1207
|
+
d(this, lt, /* @__PURE__ */ h((n) => {
|
|
1208
|
+
var s;
|
|
1180
1209
|
if (!n) return n;
|
|
1181
|
-
const e = !Array.isArray(n), i = e ? [n] : n,
|
|
1210
|
+
const e = !Array.isArray(n), i = e ? [n] : n, o = typeof ((s = t(this, C).fields) == null ? void 0 : s.get) == "function" ? t(this, C).fields.get() : [], r = i.filter((l) => !l.__ng.deleted).map((l) => {
|
|
1182
1211
|
const c = {};
|
|
1183
|
-
return
|
|
1212
|
+
return o.forEach((a, f) => {
|
|
1184
1213
|
c[a] = l.v ? l.v[f] : l[a];
|
|
1185
1214
|
}), c.__ng = l.__ng, c;
|
|
1186
1215
|
});
|
|
1187
1216
|
return e ? r[0] : r;
|
|
1188
1217
|
}, "#conv"));
|
|
1189
1218
|
E(this, "count", /* @__PURE__ */ h(() => this.getValidData().length, "count"));
|
|
1190
|
-
|
|
1219
|
+
y(this, C, n), y(this, q, e), t(this, Vt).call(this);
|
|
1191
1220
|
}
|
|
1192
1221
|
get source() {
|
|
1193
|
-
return t(this,
|
|
1222
|
+
return t(this, lt).call(this, t(this, q).rawRecords);
|
|
1194
1223
|
}
|
|
1195
1224
|
set source(n) {
|
|
1196
1225
|
this.clear(), this.add(n, !1);
|
|
@@ -1199,86 +1228,86 @@ const H = class H {
|
|
|
1199
1228
|
return ++Se(this, Ft)._;
|
|
1200
1229
|
}
|
|
1201
1230
|
get length() {
|
|
1202
|
-
return t(this,
|
|
1231
|
+
return t(this, H).length;
|
|
1203
1232
|
}
|
|
1204
1233
|
getRowCount() {
|
|
1205
1234
|
return this.length;
|
|
1206
1235
|
}
|
|
1207
1236
|
};
|
|
1208
|
-
|
|
1209
|
-
E(
|
|
1237
|
+
C = new WeakMap(), q = new WeakMap(), H = new WeakMap(), rt = new WeakMap(), Ft = new WeakMap(), Y = new WeakMap(), Vt = new WeakMap(), J = new WeakMap(), St = new WeakMap(), Xt = new WeakMap(), Ut = new WeakMap(), lt = new WeakMap(), h(M, "ngData"), // π― ν μν μ μ μμλ₯Ό ν΄λμ€ λ΄λΆλ‘ λ΄μ¬ν
|
|
1238
|
+
E(M, "ROW_STATE", {
|
|
1210
1239
|
EMPTY: "EMPTY",
|
|
1211
1240
|
NORMAL: "NORMAL",
|
|
1212
1241
|
INSERT: "INSERT",
|
|
1213
1242
|
UPDATE: "UPDATE",
|
|
1214
1243
|
DELETE: "DELETE"
|
|
1215
1244
|
});
|
|
1216
|
-
let
|
|
1217
|
-
var
|
|
1245
|
+
let se = M;
|
|
1246
|
+
var Q;
|
|
1218
1247
|
const ye = class ye {
|
|
1219
1248
|
constructor(n) {
|
|
1220
|
-
d(this,
|
|
1221
|
-
|
|
1249
|
+
d(this, Q);
|
|
1250
|
+
y(this, Q, n), this.row = new oe(this), this.data = new se(t(this, Q), this), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.pageCnt = 25, this.viewRecords.reset = () => {
|
|
1222
1251
|
var e;
|
|
1223
|
-
(e = t(this,
|
|
1252
|
+
(e = t(this, Q).view) != null && e.redraw && t(this, Q).view.redraw();
|
|
1224
1253
|
}, this.setDataSource = (e) => {
|
|
1225
1254
|
this.data && this.data.reset(), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.data.set(e || []);
|
|
1226
1255
|
}, this.getRowState = (e) => {
|
|
1227
|
-
var
|
|
1256
|
+
var o, r;
|
|
1228
1257
|
const i = parseInt(e, 10);
|
|
1229
1258
|
if (!(i >= this.data.count()))
|
|
1230
|
-
return (r = (
|
|
1259
|
+
return (r = (o = this.data.getValidData()[i]) == null ? void 0 : o.__ng) == null ? void 0 : r.rowState;
|
|
1231
1260
|
}, this.getRowPosition = () => this.row.at, this.setRowPosition = (e) => {
|
|
1232
1261
|
this.row.at = e;
|
|
1233
|
-
}, this.scrollTo_V1 = (e) => (e < 0 && (e = 0), e >= this.rawRecords.length && (e = this.rawRecords.length - 1), this.viewRecords.rawIndex = e, this.viewRecords.reset && this.viewRecords.reset(), !(e <= 0 || e >= this.rawRecords.length - 1)), this.getColumn = (e, i) => this.data.get(e, i), this.setColumn = (e, i,
|
|
1234
|
-
e = parseInt(e, 10), this.data.setValue(e, i,
|
|
1262
|
+
}, this.scrollTo_V1 = (e) => (e < 0 && (e = 0), e >= this.rawRecords.length && (e = this.rawRecords.length - 1), this.viewRecords.rawIndex = e, this.viewRecords.reset && this.viewRecords.reset(), !(e <= 0 || e >= this.rawRecords.length - 1)), this.getColumn = (e, i) => this.data.get(e, i), this.setColumn = (e, i, o) => {
|
|
1263
|
+
e = parseInt(e, 10), this.data.setValue(e, i, o);
|
|
1235
1264
|
}, this.setDataSource([]);
|
|
1236
1265
|
}
|
|
1237
1266
|
};
|
|
1238
|
-
|
|
1267
|
+
Q = new WeakMap(), h(ye, "ngDataManager");
|
|
1239
1268
|
let re = ye;
|
|
1240
|
-
var
|
|
1269
|
+
var at, T, Et, jt;
|
|
1241
1270
|
const pe = class pe {
|
|
1242
1271
|
// π― μ΄μ { name: string, type: string } κ°μ²΄λ€μ λ°°μ΄λ‘ κ΄λ¦¬ν©λλ€.
|
|
1243
1272
|
constructor(n) {
|
|
1244
|
-
d(this,
|
|
1245
|
-
d(this,
|
|
1273
|
+
d(this, at);
|
|
1274
|
+
d(this, T, []);
|
|
1246
1275
|
E(this, "add", /* @__PURE__ */ h((n, e = "string") => {
|
|
1247
1276
|
n.forEach((i) => {
|
|
1248
|
-
t(this,
|
|
1277
|
+
t(this, T).some((o) => o.name === i) || t(this, T).push({ name: i, type: e });
|
|
1249
1278
|
}), t(this, Et).call(this);
|
|
1250
1279
|
}, "add"));
|
|
1251
1280
|
d(this, Et, /* @__PURE__ */ h(() => {
|
|
1252
1281
|
const n = /* @__PURE__ */ new Map();
|
|
1253
|
-
t(this,
|
|
1282
|
+
t(this, T).forEach((e) => {
|
|
1254
1283
|
n.set(e.name, e.type);
|
|
1255
|
-
}),
|
|
1284
|
+
}), y(this, T, Array.from(n, ([e, i]) => ({ name: e, type: i }))), y(this, T, t(this, T).filter((e) => e.name !== "" && e.name !== "__ng")), t(this, T).sort((e, i) => e.name.length < i.name.length ? 1 : -1);
|
|
1256
1285
|
}, "#adjust"));
|
|
1257
1286
|
d(this, jt, /* @__PURE__ */ h(() => {
|
|
1258
|
-
|
|
1259
|
-
const n = Array.from(t(this,
|
|
1287
|
+
y(this, T, []), dt.log(t(this, at).querySelectorAll("table"));
|
|
1288
|
+
const n = Array.from(t(this, at).querySelectorAll("table"));
|
|
1260
1289
|
if (!(!n || n.length === 0)) {
|
|
1261
1290
|
for (const e of n)
|
|
1262
|
-
dt.log(e), $("[data-bind]", e).each((i,
|
|
1263
|
-
const r =
|
|
1264
|
-
r && t(this,
|
|
1291
|
+
dt.log(e), $("[data-bind]", e).each((i, o) => {
|
|
1292
|
+
const r = o.dataset.bind, s = o.getAttribute("data-type") || "string";
|
|
1293
|
+
r && t(this, T).push({ name: r, type: s });
|
|
1265
1294
|
}), ["data-expr", "background-color", "color", "tooltip", "visible", "readonly", "enable-button", "enable-check", "class-expr", "icon-color", "icon-src"].forEach((i) => {
|
|
1266
|
-
$(`[${i}]`, e).each((
|
|
1267
|
-
var
|
|
1268
|
-
if (
|
|
1269
|
-
const l =
|
|
1295
|
+
$(`[${i}]`, e).each((o, r) => {
|
|
1296
|
+
var s = r.getAttribute(i);
|
|
1297
|
+
if (s.indexOf("data.") < 0) {
|
|
1298
|
+
const l = s.search(/[(]/g);
|
|
1270
1299
|
if (l > 0)
|
|
1271
1300
|
try {
|
|
1272
|
-
|
|
1301
|
+
s = String(window[s.substring(0, l).trim()]);
|
|
1273
1302
|
} catch {
|
|
1274
|
-
|
|
1303
|
+
s = "";
|
|
1275
1304
|
}
|
|
1276
1305
|
}
|
|
1277
|
-
|
|
1306
|
+
s.split("data.").forEach((l) => {
|
|
1278
1307
|
if (l.trim() != "") {
|
|
1279
1308
|
const c = l.search(/[^_A-Za-z0-9]/g);
|
|
1280
1309
|
let a = "";
|
|
1281
|
-
c >= 0 ? a = l.substring(0, c) :
|
|
1310
|
+
c >= 0 ? a = l.substring(0, c) : s.startsWith("data.") && (a = l.replace("data.", "")), a && t(this, T).push({ name: a, type: "string" });
|
|
1282
1311
|
}
|
|
1283
1312
|
});
|
|
1284
1313
|
});
|
|
@@ -1286,41 +1315,41 @@ const pe = class pe {
|
|
|
1286
1315
|
t(this, Et).call(this);
|
|
1287
1316
|
}
|
|
1288
1317
|
}, "#init"));
|
|
1289
|
-
|
|
1318
|
+
y(this, at, n), t(this, jt).call(this);
|
|
1290
1319
|
}
|
|
1291
1320
|
// π― κΈ°μ‘΄μ νλ μ΄λ¦λ§ μ°λ κ³³λ€κ³Όμ νΈνμ μν΄ μ΄λ¦ λ°°μ΄λ§ 리ν΄νλ λ©μλ μ μ§
|
|
1292
1321
|
get() {
|
|
1293
|
-
return t(this,
|
|
1322
|
+
return t(this, T).map((n) => n.name);
|
|
1294
1323
|
}
|
|
1295
1324
|
// π― λ΄λΆ κ°μ²΄ ν΅μ§Έλ‘ μ»κΈ°
|
|
1296
1325
|
getFields() {
|
|
1297
|
-
return t(this,
|
|
1326
|
+
return t(this, T);
|
|
1298
1327
|
}
|
|
1299
1328
|
// π― νΉμ νλμ λ°μ΄ν° νμ
μ‘°ν
|
|
1300
1329
|
getType(n) {
|
|
1301
|
-
const e = t(this,
|
|
1330
|
+
const e = t(this, T).find((i) => i.name === n);
|
|
1302
1331
|
return e ? e.type : "string";
|
|
1303
1332
|
}
|
|
1304
1333
|
indexOf(n) {
|
|
1305
|
-
return t(this,
|
|
1334
|
+
return t(this, T).findIndex((e) => e.name === n);
|
|
1306
1335
|
}
|
|
1307
1336
|
includes(n) {
|
|
1308
|
-
return t(this,
|
|
1337
|
+
return t(this, T).some((e) => e.name === n);
|
|
1309
1338
|
}
|
|
1310
1339
|
};
|
|
1311
|
-
|
|
1340
|
+
at = new WeakMap(), T = new WeakMap(), Et = new WeakMap(), jt = new WeakMap(), h(pe, "ngFields");
|
|
1312
1341
|
let le = pe;
|
|
1313
|
-
var
|
|
1342
|
+
var tt, Kt, Zt;
|
|
1314
1343
|
const me = class me extends HTMLElement {
|
|
1315
1344
|
constructor() {
|
|
1316
1345
|
super();
|
|
1317
1346
|
//#created = false;
|
|
1318
|
-
d(this,
|
|
1347
|
+
d(this, tt);
|
|
1319
1348
|
d(this, Kt);
|
|
1320
1349
|
d(this, Zt, /* @__PURE__ */ h(() => {
|
|
1321
|
-
this.fields = new le(this),
|
|
1350
|
+
this.fields = new le(this), y(this, Kt, new ie(this)), dt.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
|
|
1322
1351
|
}, "#init"));
|
|
1323
|
-
this.attachShadow({ mode: "open" }),
|
|
1352
|
+
this.attachShadow({ mode: "open" }), y(this, tt, new re(this));
|
|
1324
1353
|
}
|
|
1325
1354
|
connectedCallback() {
|
|
1326
1355
|
t(this, Zt).call(this);
|
|
@@ -1330,18 +1359,18 @@ const me = class me extends HTMLElement {
|
|
|
1330
1359
|
}
|
|
1331
1360
|
// π― μΈλΆμμ grid.data.set(...) ννλ‘ μ κ·Όν μ μλλ‘ λ°μ΄ν° λ§€λμ μ€ν
|
|
1332
1361
|
get data() {
|
|
1333
|
-
return t(this,
|
|
1362
|
+
return t(this, tt).data;
|
|
1334
1363
|
}
|
|
1335
1364
|
// π― ν(row) κ΄λ ¨ μ μ΄ μ κ·Όμ μ€ν
|
|
1336
1365
|
get row() {
|
|
1337
|
-
return t(this,
|
|
1366
|
+
return t(this, tt).row;
|
|
1338
1367
|
}
|
|
1339
1368
|
// π― μ 체 λ°μ΄ν° λ§€λμ μ κ·Ό νμν κ²½μ°
|
|
1340
1369
|
get dataManager() {
|
|
1341
|
-
return t(this,
|
|
1370
|
+
return t(this, tt);
|
|
1342
1371
|
}
|
|
1343
1372
|
};
|
|
1344
|
-
|
|
1373
|
+
tt = new WeakMap(), Kt = new WeakMap(), Zt = new WeakMap(), h(me, "NineTable");
|
|
1345
1374
|
let ae = me;
|
|
1346
1375
|
customElements.get("nine-table") || customElements.define("nine-table", ae);
|
|
1347
1376
|
//# sourceMappingURL=nine-table.js.map
|