@ninebone/table 0.0.469 → 0.0.470
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 +476 -450
- package/dist/nine-table.js.map +1 -1
- package/dist/nine-table.umd.js +6 -6
- package/dist/nine-table.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/nine-table.js
CHANGED
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
throw TypeError(
|
|
1
|
+
var je = Object.defineProperty;
|
|
2
|
+
var Fe = (q) => {
|
|
3
|
+
throw TypeError(q);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
var t = (
|
|
9
|
-
var Ve = (
|
|
5
|
+
var Ke = (q, i, e) => i in q ? je(q, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : q[i] = e;
|
|
6
|
+
var h = (q, i) => je(q, "name", { value: i, configurable: !0 });
|
|
7
|
+
var A = (q, i, e) => Ke(q, typeof i != "symbol" ? i + "" : i, e), Ye = (q, i, e) => i.has(q) || Fe("Cannot " + e);
|
|
8
|
+
var t = (q, i, e) => (Ye(q, i, "read from private field"), e ? e.call(q) : i.get(q)), d = (q, i, e) => i.has(q) ? Fe("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(q) : i.set(q, e), y = (q, i, e, s) => (Ye(q, i, "write to private field"), s ? s.call(q, e) : i.set(q, e), e);
|
|
9
|
+
var Ve = (q, i, e, s) => ({
|
|
10
10
|
set _(r) {
|
|
11
|
-
|
|
11
|
+
y(q, i, r, e);
|
|
12
12
|
},
|
|
13
13
|
get _() {
|
|
14
|
-
return t(
|
|
14
|
+
return t(q, i, s);
|
|
15
15
|
}
|
|
16
16
|
});
|
|
17
17
|
import { trace as Ue } from "@ninebone/util";
|
|
18
|
-
const
|
|
18
|
+
const Le = class Le extends Ue.constructor {
|
|
19
19
|
constructor() {
|
|
20
20
|
super(), this.init("nine-table", "green");
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
|
-
|
|
24
|
-
let ae =
|
|
25
|
-
const
|
|
26
|
-
var
|
|
27
|
-
const
|
|
23
|
+
h(Le, "Trace");
|
|
24
|
+
let ae = Le;
|
|
25
|
+
const yt = new ae();
|
|
26
|
+
var D, P, S, K, U, X, It, Z, _t;
|
|
27
|
+
const He = class He extends HTMLElement {
|
|
28
28
|
constructor() {
|
|
29
29
|
super();
|
|
30
|
-
d(this,
|
|
30
|
+
d(this, D);
|
|
31
31
|
d(this, P, !1);
|
|
32
|
-
d(this,
|
|
32
|
+
d(this, S);
|
|
33
|
+
d(this, K);
|
|
33
34
|
d(this, U);
|
|
34
35
|
d(this, X);
|
|
35
|
-
d(this,
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
e && (b(this, K, new ResizeObserver(() => {
|
|
36
|
+
d(this, It, /* @__PURE__ */ h(() => {
|
|
37
|
+
if (!t(this, D)) return;
|
|
38
|
+
const e = t(this, D).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
|
-
|
|
44
|
-
if (!t(this,
|
|
45
|
-
const e = t(this,
|
|
43
|
+
A(this, "refresh", /* @__PURE__ */ h(() => {
|
|
44
|
+
if (!t(this, D) || !t(this, S) || t(this, P)) return;
|
|
45
|
+
const e = t(this, S).container, s = e.querySelector("table");
|
|
46
46
|
if (!s) return;
|
|
47
|
-
const r = t(this,
|
|
48
|
-
if (a !== 0 &&
|
|
47
|
+
const r = t(this, S).track, n = t(this, S).thumb, o = t(this, D).querySelector(".ng-container-bottom"), a = e.clientWidth, c = s.scrollWidth;
|
|
48
|
+
if (a !== 0 && c > a)
|
|
49
49
|
o && (o.style.display = "flex");
|
|
50
50
|
else {
|
|
51
51
|
o && (o.style.display = "none");
|
|
@@ -53,66 +53,66 @@ const Le = class Le extends HTMLElement {
|
|
|
53
53
|
}
|
|
54
54
|
const l = r.clientWidth;
|
|
55
55
|
if (l <= 0) return;
|
|
56
|
-
const f = Math.max(Math.min(l * (a /
|
|
56
|
+
const f = Math.max(Math.min(l * (a / c), l), 20);
|
|
57
57
|
n.style.width = `${f}px`;
|
|
58
|
-
const u = e.scrollLeft,
|
|
58
|
+
const u = e.scrollLeft, b = c - a;
|
|
59
59
|
let g = 0;
|
|
60
|
-
|
|
60
|
+
b > 0 && (g = parseInt(u / b * (l - f), 10)), g < 0 && (g = 0);
|
|
61
61
|
const m = l - f;
|
|
62
|
-
g > m && (g = m), n.style.left = `${g}px`, t(this,
|
|
62
|
+
g > m && (g = m), n.style.left = `${g}px`, t(this, S).left.disabled = g === 0, t(this, S).right.disabled = g >= m - 1;
|
|
63
63
|
}, "refresh"));
|
|
64
|
-
d(this, Z, /* @__PURE__ */
|
|
65
|
-
if (!t(this,
|
|
66
|
-
const s = t(this,
|
|
64
|
+
d(this, Z, /* @__PURE__ */ h((e) => {
|
|
65
|
+
if (!t(this, S)) return !1;
|
|
66
|
+
const s = t(this, S).container, r = s.querySelector("table");
|
|
67
67
|
if (!r) return !1;
|
|
68
|
-
const n = t(this,
|
|
68
|
+
const n = t(this, S).track.getBoundingClientRect(), o = t(this, S).thumb.clientWidth;
|
|
69
69
|
let a = e;
|
|
70
70
|
a < 0 && (a = 0);
|
|
71
|
-
const
|
|
72
|
-
a >
|
|
71
|
+
const c = n.width - o;
|
|
72
|
+
a > c && (a = c), a = parseInt(a, 10), t(this, S).thumb.style.left = `${a}px`, t(this, S).left.disabled = a === 0, t(this, S).right.disabled = a >= c - 1;
|
|
73
73
|
const l = s.clientWidth, u = r.scrollWidth - l;
|
|
74
|
-
return
|
|
74
|
+
return c > 0 && u > 0 && (s.scrollLeft = a / c * u), a > 0 && a < c - 1;
|
|
75
75
|
}, "#thumbMoveTo"));
|
|
76
|
-
d(this, _t, /* @__PURE__ */
|
|
77
|
-
const e = /* @__PURE__ */
|
|
78
|
-
clearInterval(t(this,
|
|
79
|
-
const n = parseInt(t(this,
|
|
80
|
-
t(this, Z).call(this, n + r),
|
|
81
|
-
clearInterval(t(this,
|
|
82
|
-
const o = parseInt(t(this,
|
|
83
|
-
t(this, Z).call(this, o + r) || clearInterval(t(this,
|
|
76
|
+
d(this, _t, /* @__PURE__ */ h(() => {
|
|
77
|
+
const e = /* @__PURE__ */ h((r) => {
|
|
78
|
+
clearInterval(t(this, K)), clearInterval(t(this, U));
|
|
79
|
+
const n = parseInt(t(this, S).thumb.style.left || 0, 10);
|
|
80
|
+
t(this, Z).call(this, n + r), y(this, K, setInterval(() => {
|
|
81
|
+
clearInterval(t(this, K)), y(this, U, setInterval(() => {
|
|
82
|
+
const o = parseInt(t(this, S).thumb.style.left || 0, 10);
|
|
83
|
+
t(this, Z).call(this, o + r) || clearInterval(t(this, U));
|
|
84
84
|
}, 50));
|
|
85
85
|
}, 500));
|
|
86
|
-
}, "delayScroll"), s = /* @__PURE__ */
|
|
87
|
-
clearInterval(t(this,
|
|
86
|
+
}, "delayScroll"), s = /* @__PURE__ */ h(() => {
|
|
87
|
+
clearInterval(t(this, K)), clearInterval(t(this, U));
|
|
88
88
|
}, "clearTimer");
|
|
89
89
|
["mouseup", "mouseleave", "touchend"].forEach((r) => {
|
|
90
|
-
t(this,
|
|
91
|
-
}), t(this,
|
|
90
|
+
t(this, S).left.addEventListener(r, s), t(this, S).right.addEventListener(r, s), t(this, S).track.addEventListener(r, s);
|
|
91
|
+
}), t(this, S).left.addEventListener("mousedown", (r) => {
|
|
92
92
|
r.button === 0 && e(-20);
|
|
93
|
-
}), t(this,
|
|
93
|
+
}), t(this, S).right.addEventListener("mousedown", (r) => {
|
|
94
94
|
r.button === 0 && e(20);
|
|
95
|
-
}), t(this,
|
|
95
|
+
}), t(this, S).left.addEventListener("touchstart", () => e(-20)), t(this, S).right.addEventListener("touchstart", () => e(20)), t(this, S).track.addEventListener("mousedown", (r) => {
|
|
96
96
|
if (r.button !== 0) return;
|
|
97
97
|
r.preventDefault();
|
|
98
|
-
const n = t(this,
|
|
98
|
+
const n = t(this, S).track.getBoundingClientRect(), o = t(this, S).thumb.clientWidth;
|
|
99
99
|
t(this, Z).call(this, r.clientX - n.left - o / 2);
|
|
100
|
-
}), t(this,
|
|
100
|
+
}), t(this, S).thumb.addEventListener("mousedown", (r) => {
|
|
101
101
|
if (r.button !== 0) return;
|
|
102
|
-
r.stopPropagation(), r.preventDefault(),
|
|
103
|
-
const n = /* @__PURE__ */
|
|
102
|
+
r.stopPropagation(), r.preventDefault(), y(this, P, !0), this.shiftX = r.clientX - t(this, S).thumb.getBoundingClientRect().left;
|
|
103
|
+
const n = /* @__PURE__ */ h((a) => {
|
|
104
104
|
if (!t(this, P)) return;
|
|
105
|
-
const
|
|
106
|
-
t(this, Z).call(this, a.clientX -
|
|
107
|
-
}, "onMouseMove"), o = /* @__PURE__ */
|
|
108
|
-
|
|
105
|
+
const c = t(this, S).track.getBoundingClientRect();
|
|
106
|
+
t(this, Z).call(this, a.clientX - c.left - this.shiftX);
|
|
107
|
+
}, "onMouseMove"), o = /* @__PURE__ */ h(() => {
|
|
108
|
+
y(this, P, !1), s(), document.removeEventListener("mousemove", n), document.removeEventListener("mouseup", o), this.refresh();
|
|
109
109
|
}, "onMouseUp");
|
|
110
110
|
document.addEventListener("mousemove", n), document.addEventListener("mouseup", o);
|
|
111
111
|
});
|
|
112
112
|
}, "#init"));
|
|
113
113
|
}
|
|
114
114
|
connectedCallback() {
|
|
115
|
-
if (
|
|
115
|
+
if (y(this, D, this.closest("nine-table-sheet") || this.getRootNode().host), !t(this, D)) return;
|
|
116
116
|
this.innerHTML = `
|
|
117
117
|
<style>
|
|
118
118
|
nine-table-hscrollbar {
|
|
@@ -176,13 +176,13 @@ const Le = class Le 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__ */ h(() => {
|
|
180
|
+
const s = t(this, D).querySelector(".ng-container-body .ng-part-body");
|
|
181
181
|
if (!s) {
|
|
182
182
|
setTimeout(e, 10);
|
|
183
183
|
return;
|
|
184
184
|
}
|
|
185
|
-
|
|
185
|
+
y(this, S, {
|
|
186
186
|
container: s,
|
|
187
187
|
track: this.querySelector(".ng-scroll-track"),
|
|
188
188
|
thumb: this.querySelector(".ng-scroll-thumb"),
|
|
@@ -195,27 +195,27 @@ const Le = class Le extends HTMLElement {
|
|
|
195
195
|
e();
|
|
196
196
|
}
|
|
197
197
|
disconnectedCallback() {
|
|
198
|
-
t(this,
|
|
198
|
+
t(this, X) && t(this, X).disconnect();
|
|
199
199
|
}
|
|
200
200
|
};
|
|
201
|
-
|
|
202
|
-
let le =
|
|
201
|
+
D = new WeakMap(), P = new WeakMap(), S = new WeakMap(), K = new WeakMap(), U = new WeakMap(), X = new WeakMap(), It = new WeakMap(), Z = new WeakMap(), _t = new WeakMap(), h(He, "NineTableHScrollBar");
|
|
202
|
+
let le = He;
|
|
203
203
|
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", le);
|
|
204
|
-
var j, nt, G,
|
|
205
|
-
const
|
|
204
|
+
var j, nt, G, R, vt, wt, Nt;
|
|
205
|
+
const Me = class Me extends HTMLElement {
|
|
206
206
|
constructor() {
|
|
207
207
|
super();
|
|
208
208
|
d(this, j);
|
|
209
209
|
d(this, nt);
|
|
210
210
|
d(this, G, !1);
|
|
211
|
-
d(this,
|
|
212
|
-
d(this, xt, 0);
|
|
211
|
+
d(this, R);
|
|
213
212
|
d(this, vt, 0);
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
213
|
+
d(this, wt, 0);
|
|
214
|
+
A(this, "refresh", /* @__PURE__ */ h(() => {
|
|
215
|
+
if (!t(this, j) || !t(this, R)) return;
|
|
216
|
+
const e = t(this, R).container, s = t(this, R).track, r = t(this, R).thumb, n = e.clientHeight, a = (t(this, j).data.get() || []).length, c = t(this, nt).getRowHeight(), l = a * c;
|
|
217
217
|
if (l <= n) {
|
|
218
|
-
r.style.display = "none", t(this,
|
|
218
|
+
r.style.display = "none", t(this, R).top.disabled = !0, t(this, R).bottom.disabled = !0;
|
|
219
219
|
return;
|
|
220
220
|
} else
|
|
221
221
|
r.style.display = "block";
|
|
@@ -223,53 +223,53 @@ const He = class He extends HTMLElement {
|
|
|
223
223
|
if (f <= 0) return;
|
|
224
224
|
const u = Math.max(Math.min(f * (n / l), f), 20);
|
|
225
225
|
r.style.height = `${u}px`;
|
|
226
|
-
const
|
|
226
|
+
const b = e.scrollTop, g = Math.max(l - n, 1);
|
|
227
227
|
let m = 0;
|
|
228
|
-
g > 0 && (m =
|
|
228
|
+
g > 0 && (m = b / g * (f - u));
|
|
229
229
|
const v = f - u;
|
|
230
|
-
m < 0 && (m = 0), m > v && (m = v), r.style.top = `${m}px`, t(this,
|
|
230
|
+
m < 0 && (m = 0), m > v && (m = v), r.style.top = `${m}px`, t(this, R).top.disabled = b <= 0, t(this, R).bottom.disabled = b >= g - 1;
|
|
231
231
|
}, "refresh"));
|
|
232
|
-
d(this, Nt, /* @__PURE__ */
|
|
233
|
-
const e = t(this,
|
|
232
|
+
d(this, Nt, /* @__PURE__ */ h(() => {
|
|
233
|
+
const e = t(this, R).container, s = /* @__PURE__ */ h(() => {
|
|
234
234
|
const n = (t(this, j).data.get() || []).length, o = t(this, nt).getRowHeight();
|
|
235
235
|
return n * o;
|
|
236
236
|
}, "getContentHeight");
|
|
237
237
|
e.addEventListener("scroll", () => {
|
|
238
238
|
t(this, G) || this.refresh();
|
|
239
|
-
}), t(this,
|
|
239
|
+
}), t(this, R).thumb.addEventListener("mousedown", (r) => {
|
|
240
240
|
if (r.button !== 0) return;
|
|
241
|
-
r.stopPropagation(), r.preventDefault(),
|
|
242
|
-
const n = /* @__PURE__ */
|
|
241
|
+
r.stopPropagation(), r.preventDefault(), y(this, G, !0), y(this, vt, r.clientY), y(this, wt, e.scrollTop);
|
|
242
|
+
const n = /* @__PURE__ */ h((a) => {
|
|
243
243
|
if (!t(this, G)) return;
|
|
244
|
-
const
|
|
244
|
+
const c = t(this, R).track.getBoundingClientRect(), l = t(this, R).thumb.clientHeight, u = c.height - l, b = a.clientY - t(this, vt), g = e.clientHeight, m = s(), v = Math.max(m - g, 1);
|
|
245
245
|
if (u > 0 && v > 0) {
|
|
246
|
-
const
|
|
247
|
-
let x = t(this,
|
|
248
|
-
const
|
|
249
|
-
x < 0 && (x = 0), x >
|
|
246
|
+
const w = b / u * v;
|
|
247
|
+
let x = t(this, wt) + w;
|
|
248
|
+
const M = Math.max(0, m - g);
|
|
249
|
+
x < 0 && (x = 0), x > M && (x = M), e.scrollTop = x;
|
|
250
250
|
}
|
|
251
251
|
this.refresh();
|
|
252
|
-
}, "onMouseMove"), o = /* @__PURE__ */
|
|
253
|
-
|
|
252
|
+
}, "onMouseMove"), o = /* @__PURE__ */ h(() => {
|
|
253
|
+
y(this, G, !1), document.removeEventListener("mousemove", n), document.removeEventListener("mouseup", o), this.refresh();
|
|
254
254
|
}, "onMouseUp");
|
|
255
255
|
document.addEventListener("mousemove", n), document.addEventListener("mouseup", o);
|
|
256
|
-
}), t(this,
|
|
257
|
-
if (r.button !== 0 || r.target === t(this,
|
|
258
|
-
const n = t(this,
|
|
259
|
-
if (l > 0 &&
|
|
256
|
+
}), t(this, R).track.addEventListener("mousedown", (r) => {
|
|
257
|
+
if (r.button !== 0 || r.target === t(this, R).thumb) return;
|
|
258
|
+
const n = t(this, R).track.getBoundingClientRect(), o = t(this, R).thumb.clientHeight, a = r.clientY - n.top - o / 2, l = n.height - o, f = e.clientHeight, u = s(), b = Math.max(u - f, 1);
|
|
259
|
+
if (l > 0 && b > 0) {
|
|
260
260
|
const g = Math.max(0, Math.min(1, a / l));
|
|
261
|
-
e.scrollTop = g *
|
|
261
|
+
e.scrollTop = g * b;
|
|
262
262
|
}
|
|
263
263
|
this.refresh();
|
|
264
|
-
}), t(this,
|
|
264
|
+
}), t(this, R).top.addEventListener("click", () => {
|
|
265
265
|
e.scrollTop -= 40;
|
|
266
|
-
}), t(this,
|
|
266
|
+
}), t(this, R).bottom.addEventListener("click", () => {
|
|
267
267
|
e.scrollTop += 40;
|
|
268
268
|
});
|
|
269
269
|
}, "#init"));
|
|
270
270
|
}
|
|
271
271
|
connectedCallback() {
|
|
272
|
-
|
|
272
|
+
y(this, j, this.getRootNode().host), y(this, nt, this.closest("nine-table-sheet")), this.innerHTML = `
|
|
273
273
|
<style>
|
|
274
274
|
nine-table-vscrollbar {
|
|
275
275
|
display: flex;
|
|
@@ -333,13 +333,13 @@ const He = class He extends HTMLElement {
|
|
|
333
333
|
<div class='ng-scroll-track'><div class='ng-scroll-thumb'></div></div>
|
|
334
334
|
<button class='ng-scroll-bottom' disabled><div class='ng-scroll-icon'></div></button>
|
|
335
335
|
`;
|
|
336
|
-
const e = /* @__PURE__ */
|
|
336
|
+
const e = /* @__PURE__ */ h(() => {
|
|
337
337
|
const s = t(this, j).shadowRoot.querySelector(".ng-container-body .ng-part-body");
|
|
338
338
|
if (!s) {
|
|
339
339
|
setTimeout(e, 10);
|
|
340
340
|
return;
|
|
341
341
|
}
|
|
342
|
-
|
|
342
|
+
y(this, R, {
|
|
343
343
|
container: s,
|
|
344
344
|
track: this.querySelector(".ng-scroll-track"),
|
|
345
345
|
thumb: this.querySelector(".ng-scroll-thumb"),
|
|
@@ -350,44 +350,44 @@ const He = class He extends HTMLElement {
|
|
|
350
350
|
e();
|
|
351
351
|
}
|
|
352
352
|
};
|
|
353
|
-
j = new WeakMap(), nt = new WeakMap(), G = new WeakMap(),
|
|
354
|
-
let ce =
|
|
353
|
+
j = new WeakMap(), nt = new WeakMap(), G = new WeakMap(), R = new WeakMap(), vt = new WeakMap(), wt = new WeakMap(), Nt = new WeakMap(), h(Me, "NineTableVScrollBar");
|
|
354
|
+
let ce = Me;
|
|
355
355
|
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar", ce);
|
|
356
|
-
var
|
|
356
|
+
var O, E, B, H, F, J, St, ot, Wt, Ot, Bt, Et, At, zt, Dt, qt, Pt, Ee, at, lt, jt;
|
|
357
357
|
const $e = class $e {
|
|
358
358
|
constructor(i) {
|
|
359
|
-
d(this,
|
|
360
|
-
d(this,
|
|
361
|
-
d(this,
|
|
359
|
+
d(this, O);
|
|
360
|
+
d(this, E);
|
|
361
|
+
d(this, B, /* @__PURE__ */ new Map());
|
|
362
362
|
d(this, H, null);
|
|
363
363
|
d(this, F, null);
|
|
364
364
|
d(this, J, 0);
|
|
365
|
-
d(this,
|
|
365
|
+
d(this, St, 40);
|
|
366
366
|
d(this, ot, !1);
|
|
367
367
|
d(this, Wt, 3);
|
|
368
|
-
|
|
368
|
+
A(this, "refresh", /* @__PURE__ */ h(() => {
|
|
369
369
|
var e;
|
|
370
|
-
const i = t(this,
|
|
371
|
-
i && (t(this,
|
|
370
|
+
const i = t(this, E).querySelector(".ng-container-body .ng-part-body");
|
|
371
|
+
i && (t(this, Et).call(this), t(this, at).call(this, i.scrollTop), (e = t(this, E).querySelector("nine-table-vscrollbar")) == null || e.refresh());
|
|
372
372
|
}, "refresh"));
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
const n = t(this,
|
|
373
|
+
A(this, "initialize", /* @__PURE__ */ h(() => {
|
|
374
|
+
y(this, H, null), t(this, B).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((r) => {
|
|
375
|
+
const n = t(this, E).querySelector(r);
|
|
376
376
|
if (!n) return;
|
|
377
377
|
const o = n.querySelector(".ng-part-body table");
|
|
378
378
|
if (!o) return;
|
|
379
379
|
const a = o.querySelector("tbody.bindable-tbody");
|
|
380
380
|
if (!a) return;
|
|
381
381
|
const l = Array.from(a.querySelectorAll("tr")).map((f) => f.cloneNode(!0));
|
|
382
|
-
t(this,
|
|
382
|
+
t(this, B).set(r, l);
|
|
383
383
|
});
|
|
384
|
-
const i = t(this,
|
|
384
|
+
const i = t(this, E).querySelector(".ng-container-body .ng-part-body"), e = t(this, E).querySelector(".ng-container-left .ng-part-body"), s = t(this, E).querySelector(".ng-container-right .ng-part-body");
|
|
385
385
|
if (i) {
|
|
386
|
-
t(this, Bt).call(this, i), t(this,
|
|
386
|
+
t(this, Bt).call(this, i), t(this, qt).call(this), t(this, Et).call(this), t(this, at).call(this, i.scrollTop);
|
|
387
387
|
let r = !1;
|
|
388
|
-
const n = /* @__PURE__ */
|
|
389
|
-
var
|
|
390
|
-
r || (r = !0, i && i.scrollTop !== o && (i.scrollTop = o), e && e.scrollTop !== o && (e.scrollTop = o), s && s.scrollTop !== o && (s.scrollTop = o), t(this, at).call(this, o), (
|
|
388
|
+
const n = /* @__PURE__ */ h((o, a) => {
|
|
389
|
+
var c;
|
|
390
|
+
r || (r = !0, i && i.scrollTop !== o && (i.scrollTop = o), e && e.scrollTop !== o && (e.scrollTop = o), s && s.scrollTop !== o && (s.scrollTop = o), t(this, at).call(this, o), (c = t(this, E).querySelector("nine-table-vscrollbar")) == null || c.refresh(), r = !1);
|
|
391
391
|
}, "syncScroll");
|
|
392
392
|
[i, e, s].forEach((o) => {
|
|
393
393
|
o && o.addEventListener("scroll", () => {
|
|
@@ -396,83 +396,83 @@ const $e = class $e {
|
|
|
396
396
|
});
|
|
397
397
|
}
|
|
398
398
|
}, "initialize"));
|
|
399
|
-
d(this, Ot, /* @__PURE__ */
|
|
400
|
-
const s = t(this,
|
|
399
|
+
d(this, Ot, /* @__PURE__ */ h((i, e) => {
|
|
400
|
+
const s = t(this, B).get(e);
|
|
401
401
|
if (!s || s.length === 0) return;
|
|
402
402
|
const r = i.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
403
403
|
if (!r) return;
|
|
404
404
|
r.querySelectorAll("tr:not(.nodata)").forEach((a) => a.remove());
|
|
405
405
|
const n = r.querySelector("tr.nodata"), o = document.createDocumentFragment();
|
|
406
|
-
for (let a = 0; a < t(this,
|
|
407
|
-
s.forEach((
|
|
408
|
-
o.appendChild(
|
|
406
|
+
for (let a = 0; a < t(this, St); a++)
|
|
407
|
+
s.forEach((c) => {
|
|
408
|
+
o.appendChild(c.cloneNode(!0));
|
|
409
409
|
});
|
|
410
410
|
n ? n.before(o) : r.appendChild(o);
|
|
411
411
|
}, "#renderRows"));
|
|
412
|
-
d(this, Bt, /* @__PURE__ */
|
|
412
|
+
d(this, Bt, /* @__PURE__ */ h((i) => {
|
|
413
413
|
if (t(this, H) !== null && t(this, H) > 0)
|
|
414
414
|
return t(this, H);
|
|
415
|
-
const e = t(this,
|
|
415
|
+
const e = t(this, B).get(".ng-container-body");
|
|
416
416
|
if (!e || e.length === 0) return 24;
|
|
417
417
|
const s = i.querySelector("tbody.bindable-tbody");
|
|
418
418
|
if (!s) return 24;
|
|
419
|
-
s.querySelectorAll("tr:not(.nodata)").forEach((
|
|
419
|
+
s.querySelectorAll("tr:not(.nodata)").forEach((b) => b.remove());
|
|
420
420
|
const r = s.querySelector("tr.nodata"), n = document.createDocumentFragment();
|
|
421
|
-
e.forEach((
|
|
422
|
-
n.appendChild(
|
|
421
|
+
e.forEach((b) => {
|
|
422
|
+
n.appendChild(b.cloneNode(!0));
|
|
423
423
|
}), r ? r.before(n) : s.appendChild(n);
|
|
424
|
-
const o = t(this,
|
|
424
|
+
const o = t(this, E), a = o.style.display, c = o.style.visibility, l = o.style.position;
|
|
425
425
|
(a === "none" || window.getComputedStyle(o).display === "none") && (o.style.display = "block", o.style.visibility = "hidden", o.style.position = "absolute");
|
|
426
426
|
let f = 0;
|
|
427
427
|
const u = s.querySelectorAll("tr:not(.nodata)");
|
|
428
|
-
return u.forEach((
|
|
429
|
-
f +=
|
|
430
|
-
}), u.forEach((
|
|
428
|
+
return u.forEach((b) => {
|
|
429
|
+
f += b.offsetHeight || b.getBoundingClientRect().height;
|
|
430
|
+
}), u.forEach((b) => b.remove()), o.style.display = a, o.style.visibility = c, o.style.position = l, y(this, H, f > 0 ? f : 24), t(this, At).call(this), t(this, H);
|
|
431
431
|
}, "#measureAndCacheHeight"));
|
|
432
|
-
d(this,
|
|
433
|
-
const e = (t(this,
|
|
432
|
+
d(this, Et, /* @__PURE__ */ h(() => {
|
|
433
|
+
const e = (t(this, O).data.get() || []).length, s = t(this, H) || 24, r = e * s;
|
|
434
434
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((n) => {
|
|
435
|
-
const o = t(this,
|
|
435
|
+
const o = t(this, E).querySelector(n);
|
|
436
436
|
if (!o) return;
|
|
437
437
|
const a = o.querySelector(".ng-part-body .ng-virtual-spacer");
|
|
438
438
|
a && (a.style.height = `${r}px`);
|
|
439
439
|
});
|
|
440
440
|
}, "#updateVirtualScrollHeight"));
|
|
441
|
-
d(this,
|
|
441
|
+
d(this, At, /* @__PURE__ */ h(() => {
|
|
442
442
|
if (t(this, J) > 0 && t(this, H) > 0) {
|
|
443
443
|
const i = Math.ceil(t(this, J) / t(this, H));
|
|
444
|
-
|
|
444
|
+
y(this, St, i + t(this, Wt));
|
|
445
445
|
}
|
|
446
446
|
}, "#updateRowCount"));
|
|
447
|
-
d(this, zt, /* @__PURE__ */
|
|
448
|
-
var a,
|
|
449
|
-
const i = t(this,
|
|
447
|
+
d(this, zt, /* @__PURE__ */ h(() => {
|
|
448
|
+
var a, c, l, f, u, b;
|
|
449
|
+
const i = t(this, E).querySelector(".ng-container-left .ng-part-body table"), e = t(this, E).querySelector(".ng-container-body .ng-part-body table"), s = t(this, E).querySelector(".ng-container-right .ng-part-body table");
|
|
450
450
|
if (e) {
|
|
451
|
-
const g = i ? Array.from(i.querySelectorAll("tbody tr")) : [], m = Array.from(e.querySelectorAll("tbody tr")), v = s ? Array.from(s.querySelectorAll("tbody tr")) : [],
|
|
452
|
-
for (let x = 0; x <
|
|
453
|
-
const
|
|
451
|
+
const g = i ? Array.from(i.querySelectorAll("tbody tr")) : [], m = Array.from(e.querySelectorAll("tbody tr")), v = s ? Array.from(s.querySelectorAll("tbody tr")) : [], w = Math.max(g.length, m.length, v.length);
|
|
452
|
+
for (let x = 0; x < w; x++) {
|
|
453
|
+
const M = [
|
|
454
454
|
((a = g[x]) == null ? void 0 : a.getBoundingClientRect().height) || 0,
|
|
455
|
-
((
|
|
455
|
+
((c = m[x]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
|
|
456
456
|
((l = v[x]) == null ? void 0 : l.getBoundingClientRect().height) || 0
|
|
457
|
-
],
|
|
458
|
-
|
|
457
|
+
], k = Math.max(...M);
|
|
458
|
+
k > 0 && (g[x] && (g[x].style.height = `${k}px`), m[x] && (m[x].style.height = `${k}px`), v[x] && (v[x].style.height = `${k}px`));
|
|
459
459
|
}
|
|
460
460
|
}
|
|
461
|
-
const r = t(this,
|
|
461
|
+
const r = t(this, E).querySelector(".ng-container-left .ng-part-footer table"), n = t(this, E).querySelector(".ng-container-body .ng-part-footer table"), o = t(this, E).querySelector(".ng-container-right .ng-part-footer table");
|
|
462
462
|
if (n) {
|
|
463
|
-
const g = r ? Array.from(r.querySelectorAll("tfoot tr")) : [], m = Array.from(n.querySelectorAll("tfoot tr")), v = o ? Array.from(o.querySelectorAll("tfoot tr")) : [],
|
|
464
|
-
for (let x = 0; x <
|
|
465
|
-
const
|
|
463
|
+
const g = r ? Array.from(r.querySelectorAll("tfoot tr")) : [], m = Array.from(n.querySelectorAll("tfoot tr")), v = o ? Array.from(o.querySelectorAll("tfoot tr")) : [], w = Math.max(g.length, m.length, v.length);
|
|
464
|
+
for (let x = 0; x < w; x++) {
|
|
465
|
+
const M = [
|
|
466
466
|
((f = g[x]) == null ? void 0 : f.getBoundingClientRect().height) || 0,
|
|
467
467
|
((u = m[x]) == null ? void 0 : u.getBoundingClientRect().height) || 0,
|
|
468
|
-
((
|
|
469
|
-
],
|
|
470
|
-
|
|
468
|
+
((b = v[x]) == null ? void 0 : b.getBoundingClientRect().height) || 0
|
|
469
|
+
], k = Math.max(...M);
|
|
470
|
+
k > 0 && (g[x] && (g[x].style.height = `${k}px`), m[x] && (m[x].style.height = `${k}px`), v[x] && (v[x].style.height = `${k}px`));
|
|
471
471
|
}
|
|
472
472
|
}
|
|
473
473
|
}, "#syncRowHeights"));
|
|
474
|
-
d(this, Dt, /* @__PURE__ */
|
|
475
|
-
!t(this,
|
|
474
|
+
d(this, Dt, /* @__PURE__ */ h(() => {
|
|
475
|
+
!t(this, E) || !(t(this, E) instanceof HTMLElement) || (y(this, F, new ResizeObserver((i) => {
|
|
476
476
|
for (const e of i) {
|
|
477
477
|
const s = e.target;
|
|
478
478
|
if (!s.classList.contains("active")) continue;
|
|
@@ -481,44 +481,44 @@ const $e = class $e {
|
|
|
481
481
|
let n = 0;
|
|
482
482
|
const o = s.querySelector(".ng-part-header"), a = s.querySelector(".ng-part-footer");
|
|
483
483
|
o && (n += o.offsetHeight), a && (n += a.offsetHeight);
|
|
484
|
-
const
|
|
485
|
-
t(this, J) !==
|
|
484
|
+
const c = Math.max(r - n, 100);
|
|
485
|
+
t(this, J) !== c && (y(this, J, c), t(this, At).call(this), t(this, H) !== null && t(this, qt).call(this));
|
|
486
486
|
}
|
|
487
487
|
}
|
|
488
|
-
})), t(this, F).observe(t(this,
|
|
488
|
+
})), t(this, F).observe(t(this, E)));
|
|
489
489
|
}, "#initResizeObserver"));
|
|
490
|
-
d(this,
|
|
490
|
+
d(this, qt, /* @__PURE__ */ h(() => {
|
|
491
491
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((i) => {
|
|
492
|
-
const e = t(this,
|
|
492
|
+
const e = t(this, E).querySelector(i);
|
|
493
493
|
e && e.querySelector(".ng-part-body tbody.bindable-tbody") && t(this, Ot).call(this, e, i);
|
|
494
494
|
}), t(this, jt).call(this), t(this, zt).call(this);
|
|
495
495
|
}, "#renderAllContainers"));
|
|
496
|
-
d(this, Pt, /* @__PURE__ */
|
|
496
|
+
d(this, Pt, /* @__PURE__ */ h((i) => {
|
|
497
497
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((e) => {
|
|
498
498
|
var l;
|
|
499
|
-
const s = t(this,
|
|
499
|
+
const s = t(this, E).querySelector(e);
|
|
500
500
|
if (!s) return;
|
|
501
501
|
const r = s.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
502
502
|
if (!r) return;
|
|
503
|
-
const n = Array.from(r.querySelectorAll("tr:not(.nodata)")), o = ((l = t(this,
|
|
503
|
+
const n = Array.from(r.querySelectorAll("tr:not(.nodata)")), o = ((l = t(this, B).get(e)) == null ? void 0 : l.length) || 1, c = (t(this, O).data.get() || []).length;
|
|
504
504
|
n.forEach((f, u) => {
|
|
505
|
-
const
|
|
506
|
-
if (
|
|
505
|
+
const b = i + Math.floor(u / o);
|
|
506
|
+
if (b >= c) {
|
|
507
507
|
f.style.display = "none";
|
|
508
508
|
return;
|
|
509
509
|
}
|
|
510
|
-
const g = t(this,
|
|
511
|
-
f.style.display = "", t(this,
|
|
510
|
+
const g = t(this, O).data.get(b);
|
|
511
|
+
f.style.display = "", t(this, lt).call(this, f, g, b);
|
|
512
512
|
});
|
|
513
513
|
});
|
|
514
514
|
}, "#adjustBufferRows"));
|
|
515
|
-
d(this,
|
|
516
|
-
var
|
|
515
|
+
d(this, Ee, /* @__PURE__ */ h((i) => {
|
|
516
|
+
var c;
|
|
517
517
|
const e = t(this, H);
|
|
518
518
|
if (!e || e <= 0) return;
|
|
519
|
-
const r = (t(this,
|
|
519
|
+
const r = (t(this, O).data.get() || []).length, n = Math.max(0, Math.floor(i / e)), o = n * e, a = ((c = t(this, B).get(".ng-container-body")) == null ? void 0 : c.length) || 1;
|
|
520
520
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((l) => {
|
|
521
|
-
const f = t(this,
|
|
521
|
+
const f = t(this, E).querySelector(l);
|
|
522
522
|
if (!f) return;
|
|
523
523
|
const u = f.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
524
524
|
if (!u) return;
|
|
@@ -528,12 +528,38 @@ const $e = class $e {
|
|
|
528
528
|
g.style.display = "none";
|
|
529
529
|
return;
|
|
530
530
|
}
|
|
531
|
-
const
|
|
532
|
-
g.style.display = "", t(this,
|
|
531
|
+
const w = t(this, O).data.get(v);
|
|
532
|
+
g.style.display = "", t(this, lt).call(this, g, w, v);
|
|
533
533
|
});
|
|
534
|
-
}), t(this, ot) || (
|
|
535
|
-
t(this, Pt).call(this, n),
|
|
534
|
+
}), t(this, ot) || (y(this, ot, !0), setTimeout(() => {
|
|
535
|
+
t(this, Pt).call(this, n), y(this, ot, !1);
|
|
536
536
|
}, 0));
|
|
537
|
+
}, "#handleScroll_BAK"));
|
|
538
|
+
d(this, at, /* @__PURE__ */ h((i) => {
|
|
539
|
+
var u;
|
|
540
|
+
const e = t(this, H);
|
|
541
|
+
if (!e || e <= 0) return;
|
|
542
|
+
const r = (t(this, O).data.get() || []).length, n = Math.max(0, Math.floor(i / e)), o = n * e, a = ((u = t(this, B).get(".ng-container-body")) == null ? void 0 : u.length) || 1, c = t(this, E).querySelector(".ng-container-body"), l = c == null ? void 0 : c.querySelector(".ng-part-body tbody.bindable-tbody tr:not(.nodata)"), f = l && l.dataset.row !== void 0 ? parseInt(l.dataset.row, 10) : -1;
|
|
543
|
+
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((b) => {
|
|
544
|
+
const g = t(this, E).querySelector(b);
|
|
545
|
+
if (!g) return;
|
|
546
|
+
const m = g.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
547
|
+
m && (m.style.transform = `translateY(${o}px)`);
|
|
548
|
+
}), f !== n && [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((b) => {
|
|
549
|
+
const g = t(this, E).querySelector(b);
|
|
550
|
+
if (!g) return;
|
|
551
|
+
const m = g.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
552
|
+
if (!m) return;
|
|
553
|
+
Array.from(m.querySelectorAll("tr:not(.nodata)")).forEach((w, x) => {
|
|
554
|
+
const M = n + Math.floor(x / a);
|
|
555
|
+
if (M >= r) {
|
|
556
|
+
w.style.display = "none";
|
|
557
|
+
return;
|
|
558
|
+
}
|
|
559
|
+
const k = t(this, O).data.get(M);
|
|
560
|
+
w.style.display = "", t(this, lt).call(this, w, k, M);
|
|
561
|
+
});
|
|
562
|
+
});
|
|
537
563
|
}, "#handleScroll"));
|
|
538
564
|
/**
|
|
539
565
|
#bindRowData = (tr, record, dataIndex) => {
|
|
@@ -549,41 +575,41 @@ const $e = class $e {
|
|
|
549
575
|
cell.dataset.row = dataIndex;
|
|
550
576
|
});
|
|
551
577
|
}; */
|
|
552
|
-
d(this,
|
|
553
|
-
i.dataset.row = s, i.data = e,
|
|
578
|
+
d(this, lt, /* @__PURE__ */ h((i, e, s) => {
|
|
579
|
+
i.dataset.row = s, i.data = e, yt.log(s), Array.from(i.cells).forEach((r, n) => {
|
|
554
580
|
r.dataset.row = s, r.querySelector(':scope > [is^="cell-"], :scope > [class*="cell-"], :scope > cell-');
|
|
555
581
|
const o = Array.from(r.children).find((a) => a.tagName.toLowerCase().startsWith("cell-") || typeof a.refresh == "function");
|
|
556
582
|
o && typeof o.refresh == "function" && o.refresh();
|
|
557
583
|
});
|
|
558
584
|
}, "#bindRowData"));
|
|
559
|
-
d(this, jt, /* @__PURE__ */
|
|
560
|
-
var
|
|
561
|
-
const i = t(this,
|
|
585
|
+
d(this, jt, /* @__PURE__ */ h(() => {
|
|
586
|
+
var c, l, f;
|
|
587
|
+
const i = t(this, E).querySelector(".ng-container-left .ng-part-header table"), e = t(this, E).querySelector(".ng-container-body .ng-part-header table"), s = t(this, E).querySelector(".ng-container-right .ng-part-header table");
|
|
562
588
|
if (!e) return;
|
|
563
589
|
const r = i ? Array.from(i.querySelectorAll("tr")) : [], n = Array.from(e.querySelectorAll("tr")), o = s ? Array.from(s.querySelectorAll("tr")) : [], a = Math.max(r.length, n.length, o.length);
|
|
564
590
|
for (let u = 0; u < a; u++) {
|
|
565
|
-
const
|
|
566
|
-
((
|
|
591
|
+
const b = [
|
|
592
|
+
((c = r[u]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
|
|
567
593
|
((l = n[u]) == null ? void 0 : l.getBoundingClientRect().height) || 0,
|
|
568
594
|
((f = o[u]) == null ? void 0 : f.getBoundingClientRect().height) || 0
|
|
569
|
-
], g = Math.max(...
|
|
595
|
+
], g = Math.max(...b);
|
|
570
596
|
g > 0 && (r[u] && (r[u].style.height = `${g}px`), n[u] && (n[u].style.height = `${g}px`), o[u] && (o[u].style.height = `${g}px`));
|
|
571
597
|
}
|
|
572
598
|
}, "#syncHeaderHeights"));
|
|
573
|
-
|
|
574
|
-
t(this, F) && (t(this, F).disconnect(),
|
|
599
|
+
A(this, "destroy", /* @__PURE__ */ h(() => {
|
|
600
|
+
t(this, F) && (t(this, F).disconnect(), y(this, F, null));
|
|
575
601
|
}, "destroy"));
|
|
576
|
-
|
|
602
|
+
y(this, O, i.getRootNode().host), y(this, E, i), t(this, Dt).call(this);
|
|
577
603
|
}
|
|
578
604
|
getRowHeight() {
|
|
579
605
|
return t(this, H);
|
|
580
606
|
}
|
|
581
607
|
templateLength(i = ".ng-container-body") {
|
|
582
608
|
var e;
|
|
583
|
-
return ((e = t(this,
|
|
609
|
+
return ((e = t(this, B).get(i)) == null ? void 0 : e.length) || 1;
|
|
584
610
|
}
|
|
585
611
|
};
|
|
586
|
-
|
|
612
|
+
O = new WeakMap(), E = new WeakMap(), B = new WeakMap(), H = new WeakMap(), F = new WeakMap(), J = new WeakMap(), St = new WeakMap(), ot = new WeakMap(), Wt = new WeakMap(), Ot = new WeakMap(), Bt = new WeakMap(), Et = new WeakMap(), At = new WeakMap(), zt = new WeakMap(), Dt = new WeakMap(), qt = new WeakMap(), Pt = new WeakMap(), Ee = new WeakMap(), at = new WeakMap(), lt = new WeakMap(), jt = new WeakMap(), h($e, "RowManager");
|
|
587
613
|
let he = $e;
|
|
588
614
|
const Ft = class Ft {
|
|
589
615
|
/**
|
|
@@ -597,85 +623,85 @@ const Ft = class Ft {
|
|
|
597
623
|
*/
|
|
598
624
|
static compile(i) {
|
|
599
625
|
if (!i) return null;
|
|
600
|
-
const e = /* @__PURE__ */
|
|
626
|
+
const e = /* @__PURE__ */ h((a) => {
|
|
601
627
|
a.querySelectorAll("tbody td, tbody th, tfoot td, tfoot th").forEach((l) => {
|
|
602
628
|
const f = l.getAttribute("cell-type") || "renderer";
|
|
603
629
|
if (l.children.length > 0 && l.firstElementChild.tagName.includes("-")) return;
|
|
604
630
|
let u = `cell-${f}`;
|
|
605
|
-
const
|
|
606
|
-
let
|
|
607
|
-
|
|
631
|
+
const b = l.getAttribute("data-bind"), g = l.getAttribute("data-expr"), m = l.getAttribute("maxbyte"), v = l.getAttribute("type");
|
|
632
|
+
let w = [];
|
|
633
|
+
b && w.push(`data-bind="${b}"`), g && w.push(`data-expr="${g}"`), m && w.push(`maxbyte="${m}"`), v && w.push(`type="${v}"`), l.innerHTML = `<${u} ${w.join(" ")}></${u}>`;
|
|
608
634
|
});
|
|
609
|
-
}, "processCellTypes"), s = /* @__PURE__ */
|
|
635
|
+
}, "processCellTypes"), s = /* @__PURE__ */ h((a) => {
|
|
610
636
|
if (!a.querySelector("colgroup")) {
|
|
611
|
-
const
|
|
612
|
-
for (let
|
|
637
|
+
const c = a.querySelector("tbody tr") || a.querySelector("tr"), l = c ? c.querySelectorAll("th, td").length : 1, f = document.createElement("colgroup"), u = Math.max(Math.floor(a.clientWidth / l), 100);
|
|
638
|
+
for (let b = 0; b < l; b++) {
|
|
613
639
|
const g = document.createElement("col");
|
|
614
640
|
g.setAttribute("width", u), f.appendChild(g);
|
|
615
641
|
}
|
|
616
642
|
a.prepend(f);
|
|
617
643
|
}
|
|
618
644
|
if (!a.querySelector("thead")) {
|
|
619
|
-
const
|
|
620
|
-
l ? l.after(
|
|
645
|
+
const c = document.createElement("thead"), l = a.querySelector("colgroup");
|
|
646
|
+
l ? l.after(c) : a.prepend(c);
|
|
621
647
|
}
|
|
622
648
|
a.classList.add("nine-table-element"), a.style.display = "table";
|
|
623
|
-
}, "ensureTableStructure"), r = /* @__PURE__ */
|
|
624
|
-
const l = Array.from(a.querySelectorAll(
|
|
649
|
+
}, "ensureTableStructure"), r = /* @__PURE__ */ h((a, c) => {
|
|
650
|
+
const l = Array.from(a.querySelectorAll(c + " tr")), f = Array.from(a.querySelectorAll(c + " th," + c + " td")), u = l.length;
|
|
625
651
|
if (u === 0 || f.length === 0) return;
|
|
626
|
-
let
|
|
652
|
+
let b = 0;
|
|
627
653
|
f.forEach((m) => {
|
|
628
|
-
|
|
654
|
+
b += m.colSpan || 1;
|
|
629
655
|
});
|
|
630
|
-
const g = Array.from(Array(u), () => Array(
|
|
656
|
+
const g = Array.from(Array(u), () => Array(b).fill(null));
|
|
631
657
|
l.forEach((m) => {
|
|
632
658
|
const v = m.sectionRowIndex;
|
|
633
|
-
let
|
|
659
|
+
let w = 0;
|
|
634
660
|
Array.from(m.querySelectorAll("th,td")).forEach((x) => {
|
|
635
|
-
for (let
|
|
636
|
-
if (g[v][
|
|
637
|
-
|
|
661
|
+
for (let z = 0; z < g[v].length; z++)
|
|
662
|
+
if (g[v][z] === null) {
|
|
663
|
+
w = z;
|
|
638
664
|
break;
|
|
639
665
|
}
|
|
640
|
-
const
|
|
641
|
-
for (let
|
|
642
|
-
for (let pt = 0; pt <
|
|
643
|
-
v +
|
|
666
|
+
const M = x.rowSpan || 1, k = x.colSpan || 1;
|
|
667
|
+
for (let z = 0; z < M; z++)
|
|
668
|
+
for (let pt = 0; pt < k; pt++)
|
|
669
|
+
v + z < u && w + pt < b && (g[v + z][w + pt] = z === 0 && pt === 0 ? "1" : "0");
|
|
644
670
|
});
|
|
645
671
|
}), l.forEach((m) => {
|
|
646
672
|
const v = m.sectionRowIndex;
|
|
647
|
-
Array.from(m.querySelectorAll("th,td")).forEach((
|
|
673
|
+
Array.from(m.querySelectorAll("th,td")).forEach((w) => {
|
|
648
674
|
for (let x = 0; x < g[v].length; x++)
|
|
649
675
|
if (g[v][x] === "1") {
|
|
650
|
-
|
|
676
|
+
w.dataset.col = x, g[v][x] = "0";
|
|
651
677
|
break;
|
|
652
678
|
}
|
|
653
679
|
});
|
|
654
680
|
});
|
|
655
681
|
}, "resetColIndex"), n = i.cloneNode(!0);
|
|
656
|
-
return s(n), e(n), r(n, "thead"), r(n, "tbody"), r(n, "tfoot"), Array.from(n.querySelectorAll("colgroup col")).forEach((a,
|
|
682
|
+
return s(n), e(n), r(n, "thead"), r(n, "tbody"), r(n, "tfoot"), Array.from(n.querySelectorAll("colgroup col")).forEach((a, c) => {
|
|
657
683
|
const l = a.getAttribute("fixed");
|
|
658
|
-
l && n.querySelectorAll(`thead [data-col="${
|
|
684
|
+
l && n.querySelectorAll(`thead [data-col="${c}"], tbody [data-col="${c}"], tfoot [data-col="${c}"]`).forEach((f) => {
|
|
659
685
|
f.setAttribute("fixed", l);
|
|
660
686
|
});
|
|
661
687
|
}), n;
|
|
662
688
|
}
|
|
663
689
|
// 🎯 [추가] td/th에 선언된 cell-type 속성을 읽어 커스텀 태그로 자동 감싸기
|
|
664
690
|
};
|
|
665
|
-
|
|
691
|
+
h(Ft, "TableCompiler");
|
|
666
692
|
let de = Ft;
|
|
667
|
-
var
|
|
668
|
-
const
|
|
693
|
+
var Yt, Q, tt, Vt, Kt, ct, Ut, Xt;
|
|
694
|
+
const mt = class mt extends HTMLElement {
|
|
669
695
|
constructor() {
|
|
670
696
|
super();
|
|
671
|
-
d(this,
|
|
697
|
+
d(this, Yt);
|
|
672
698
|
d(this, Q, null);
|
|
673
699
|
d(this, tt);
|
|
674
|
-
|
|
700
|
+
A(this, "invalidate", /* @__PURE__ */ h(() => {
|
|
675
701
|
var e, s;
|
|
676
702
|
t(this, tt).refresh(), (e = this.querySelector("nine-table-hscrollbar")) == null || e.refresh(), (s = this.querySelector("nine-table-vscrollbar")) == null || s.refresh();
|
|
677
703
|
}, "invalidate"));
|
|
678
|
-
d(this,
|
|
704
|
+
d(this, Vt, /* @__PURE__ */ h(() => {
|
|
679
705
|
[
|
|
680
706
|
{ selector: ".ng-container-body", type: null },
|
|
681
707
|
{ selector: ".ng-container-left", type: "left" },
|
|
@@ -685,18 +711,18 @@ const yt = class yt extends HTMLElement {
|
|
|
685
711
|
if (!n) return;
|
|
686
712
|
n.innerHTML = "";
|
|
687
713
|
const o = document.createElement("div");
|
|
688
|
-
o.className = "ng-part-header", o.appendChild(t(this,
|
|
714
|
+
o.className = "ng-part-header", o.appendChild(t(this, ct).call(this, t(this, Q), r, "header"));
|
|
689
715
|
const a = document.createElement("div");
|
|
690
716
|
a.className = "ng-part-body";
|
|
691
|
-
const
|
|
692
|
-
|
|
717
|
+
const c = document.createElement("div");
|
|
718
|
+
c.className = "ng-scroll-content", c.style.position = "relative", c.style.width = "100%", c.appendChild(t(this, ct).call(this, t(this, Q), r, "body"));
|
|
693
719
|
const l = document.createElement("div");
|
|
694
|
-
l.className = "ng-virtual-spacer", l.style.width = "100%", l.style.pointerEvents = "none",
|
|
720
|
+
l.className = "ng-virtual-spacer", l.style.width = "100%", l.style.pointerEvents = "none", c.appendChild(l), a.appendChild(c);
|
|
695
721
|
const f = document.createElement("div");
|
|
696
|
-
f.className = "ng-part-footer", f.appendChild(t(this,
|
|
722
|
+
f.className = "ng-part-footer", f.appendChild(t(this, ct).call(this, t(this, Q), r, "footer")), n.appendChild(o), n.appendChild(a), n.appendChild(f);
|
|
697
723
|
});
|
|
698
724
|
}, "#renderSplitContainers"));
|
|
699
|
-
d(this,
|
|
725
|
+
d(this, Kt, /* @__PURE__ */ h(() => {
|
|
700
726
|
["left", "right", "body"].forEach((e) => {
|
|
701
727
|
const s = this.querySelector(`.ng-container-${e}`), r = s == null ? void 0 : s.querySelectorAll("table");
|
|
702
728
|
if (!s || !r || r.length === 0) return;
|
|
@@ -707,20 +733,20 @@ const yt = class yt extends HTMLElement {
|
|
|
707
733
|
}), e === "body" ? s.style.flex = "1" : (s.style.flex = `0 0 ${n}px`, s.style.width = `${n}px`);
|
|
708
734
|
});
|
|
709
735
|
}, "#updateContainerWidths"));
|
|
710
|
-
|
|
711
|
-
e && (
|
|
736
|
+
A(this, "generate", /* @__PURE__ */ h((e) => {
|
|
737
|
+
e && (y(this, Q, de.compile(e)), t(this, Vt).call(this), t(this, Kt).call(this), t(this, tt).initialize(), setTimeout(() => {
|
|
712
738
|
var s;
|
|
713
739
|
(s = this.querySelector("nine-table-hscrollbar")) == null || s.refresh();
|
|
714
740
|
}, 0));
|
|
715
741
|
}, "generate"));
|
|
716
|
-
d(this,
|
|
717
|
-
const n = e.cloneNode(!0), o = n.querySelector("thead"), a = n.querySelector("tbody"),
|
|
742
|
+
d(this, ct, /* @__PURE__ */ h((e, s, r) => {
|
|
743
|
+
const n = e.cloneNode(!0), o = n.querySelector("thead"), a = n.querySelector("tbody"), c = n.querySelector("tfoot");
|
|
718
744
|
if (r === "header") {
|
|
719
|
-
if (a && a.remove(),
|
|
745
|
+
if (a && a.remove(), c && c.remove(), e.querySelector("tbody")) {
|
|
720
746
|
const f = document.createElement("tbody");
|
|
721
747
|
f.className = "fixed-tbody", n.appendChild(f);
|
|
722
748
|
}
|
|
723
|
-
} else r === "body" ? (o && o.remove(),
|
|
749
|
+
} else r === "body" ? (o && o.remove(), c && c.remove(), a && (a.className = "bindable-tbody")) : r === "footer" && (o && o.remove(), a && a.remove());
|
|
724
750
|
return s === "left" ? n.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((l) => {
|
|
725
751
|
l.getAttribute("fixed") !== "left" && l.remove();
|
|
726
752
|
}) : s === "right" ? n.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((l) => {
|
|
@@ -729,20 +755,20 @@ const yt = class yt extends HTMLElement {
|
|
|
729
755
|
l.remove();
|
|
730
756
|
}), n;
|
|
731
757
|
}, "#createSplitTable"));
|
|
732
|
-
|
|
733
|
-
|
|
758
|
+
A(this, "getRowHeight", /* @__PURE__ */ h(() => t(this, tt).getRowHeight(), "getRowHeight"));
|
|
759
|
+
A(this, "scrollToX", /* @__PURE__ */ h((e) => {
|
|
734
760
|
const s = this.querySelector(".ng-container-body .ng-part-body");
|
|
735
761
|
s && (s.scrollLeft = e);
|
|
736
762
|
}, "scrollToX"));
|
|
737
|
-
|
|
763
|
+
A(this, "scrollToY", /* @__PURE__ */ h((e) => {
|
|
738
764
|
const s = this.querySelector(".ng-container-body .ng-part-body");
|
|
739
765
|
s && (s.scrollTop = e);
|
|
740
766
|
}, "scrollToY"));
|
|
741
|
-
d(this,
|
|
742
|
-
t(this,
|
|
767
|
+
d(this, Ut, /* @__PURE__ */ h(() => {
|
|
768
|
+
t(this, Xt).call(this);
|
|
743
769
|
}, "#init"));
|
|
744
|
-
d(this,
|
|
745
|
-
const e =
|
|
770
|
+
d(this, Xt, /* @__PURE__ */ h(() => {
|
|
771
|
+
const e = mt.SCROLLBAR_SIZE;
|
|
746
772
|
this.innerHTML = `
|
|
747
773
|
<style>
|
|
748
774
|
nine-table-sheet {
|
|
@@ -884,55 +910,55 @@ const yt = class yt extends HTMLElement {
|
|
|
884
910
|
</div>
|
|
885
911
|
`;
|
|
886
912
|
}, "#render"));
|
|
887
|
-
|
|
913
|
+
y(this, tt, new he(this)), y(this, Yt, this.getRootNode().host);
|
|
888
914
|
}
|
|
889
915
|
connectedCallback() {
|
|
890
|
-
t(this,
|
|
916
|
+
t(this, Ut).call(this);
|
|
891
917
|
}
|
|
892
918
|
disconnectedCallback() {
|
|
893
|
-
this.innerHTML = "",
|
|
919
|
+
this.innerHTML = "", yt.log("NineTableSheet destroyed.");
|
|
894
920
|
}
|
|
895
921
|
};
|
|
896
|
-
|
|
897
|
-
let
|
|
898
|
-
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet",
|
|
899
|
-
var Zt,
|
|
900
|
-
const
|
|
922
|
+
Yt = new WeakMap(), Q = new WeakMap(), tt = new WeakMap(), Vt = new WeakMap(), Kt = new WeakMap(), ct = new WeakMap(), Ut = new WeakMap(), Xt = new WeakMap(), h(mt, "NineTableSheet"), A(mt, "SCROLLBAR_SIZE", 16);
|
|
923
|
+
let $t = mt;
|
|
924
|
+
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", $t);
|
|
925
|
+
var Zt, Rt;
|
|
926
|
+
const Ie = class Ie extends HTMLElement {
|
|
901
927
|
constructor() {
|
|
902
928
|
super();
|
|
903
|
-
d(this, Zt, /* @__PURE__ */
|
|
929
|
+
d(this, Zt, /* @__PURE__ */ h(() => {
|
|
904
930
|
var e;
|
|
905
931
|
(e = this.querySelector(".nine-tab-bar")) == null || e.addEventListener("click", (s) => {
|
|
906
932
|
var o;
|
|
907
933
|
const r = s.ctrlKey || s.metaKey || s.shiftKey, n = parseInt((o = s.target.closest(".nine-tab-item")) == null ? void 0 : o.dataset.index, 10);
|
|
908
|
-
t(this,
|
|
909
|
-
}), t(this,
|
|
934
|
+
t(this, Rt).call(this, n, r);
|
|
935
|
+
}), t(this, Rt).call(this, 0, !1);
|
|
910
936
|
}, "#init"));
|
|
911
|
-
d(this,
|
|
912
|
-
const r = /* @__PURE__ */
|
|
937
|
+
d(this, Rt, /* @__PURE__ */ h((e, s = !1) => {
|
|
938
|
+
const r = /* @__PURE__ */ h(() => {
|
|
913
939
|
const f = Array.from(this.querySelectorAll("nine-table-sheet"));
|
|
914
940
|
Array.from(this.querySelectorAll("nine-splitter")).forEach((g) => g.style.setProperty("display", "none"));
|
|
915
|
-
const
|
|
916
|
-
|
|
917
|
-
const m = parseInt(g.getAttribute("data-index"), 10), v = this.querySelector(`nine-splitter[data-split-index="${m}"]`),
|
|
918
|
-
v &&
|
|
941
|
+
const b = f.filter((g) => g.classList.contains("active"));
|
|
942
|
+
b.length < 2 || b.forEach((g) => {
|
|
943
|
+
const m = parseInt(g.getAttribute("data-index"), 10), v = this.querySelector(`nine-splitter[data-split-index="${m}"]`), w = f[m + 1];
|
|
944
|
+
v && w && w.classList.contains("active") && v.style.setProperty("display", "flex");
|
|
919
945
|
});
|
|
920
|
-
}, "updateSplitters"), n = this.querySelector(".nine-tab-bar"), o = this.querySelector("nine-table-sheets-body"), a = n.querySelectorAll(".nine-tab-item"),
|
|
946
|
+
}, "updateSplitters"), n = this.querySelector(".nine-tab-bar"), o = this.querySelector("nine-table-sheets-body"), a = n.querySelectorAll(".nine-tab-item"), c = o.querySelectorAll("nine-table-sheet");
|
|
921
947
|
if (!a[e]) return;
|
|
922
948
|
if (!s)
|
|
923
949
|
a.forEach((f, u) => {
|
|
924
950
|
f.classList.toggle("active", u === e);
|
|
925
|
-
}),
|
|
926
|
-
const
|
|
927
|
-
f.classList.toggle("active",
|
|
951
|
+
}), c.forEach((f, u) => {
|
|
952
|
+
const b = u === e;
|
|
953
|
+
f.classList.toggle("active", b), f.style.flex = b ? "1 1 100%" : "";
|
|
928
954
|
});
|
|
929
955
|
else {
|
|
930
956
|
const f = a[e], u = n.querySelectorAll(".nine-tab-item.active");
|
|
931
957
|
if (f.classList.contains("active") && u.length <= 1)
|
|
932
958
|
return;
|
|
933
959
|
f.classList.toggle("active");
|
|
934
|
-
const
|
|
935
|
-
|
|
960
|
+
const b = o.querySelector(`nine-table-sheet[data-index="${e}"]`);
|
|
961
|
+
b && (b.classList.toggle("active"), b.classList.contains("active") || (b.style.flex = ""));
|
|
936
962
|
}
|
|
937
963
|
const l = o.querySelectorAll("nine-table-sheet.active");
|
|
938
964
|
l == null || l.forEach((f) => {
|
|
@@ -944,32 +970,32 @@ const Me = class Me extends HTMLElement {
|
|
|
944
970
|
t(this, Zt).call(this);
|
|
945
971
|
}
|
|
946
972
|
};
|
|
947
|
-
Zt = new WeakMap(),
|
|
948
|
-
let fe =
|
|
973
|
+
Zt = new WeakMap(), Rt = new WeakMap(), h(Ie, "NineTableSheets");
|
|
974
|
+
let fe = Ie;
|
|
949
975
|
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", fe);
|
|
950
|
-
var
|
|
951
|
-
const
|
|
976
|
+
var I, Gt, kt, Jt;
|
|
977
|
+
const _e = class _e {
|
|
952
978
|
constructor(i) {
|
|
953
|
-
d(this,
|
|
954
|
-
d(this, Gt, /* @__PURE__ */
|
|
979
|
+
d(this, I);
|
|
980
|
+
d(this, Gt, /* @__PURE__ */ h(() => {
|
|
955
981
|
t(this, Jt).call(this), new ResizeObserver((i) => {
|
|
956
982
|
for (let e of i)
|
|
957
|
-
t(this,
|
|
958
|
-
}).observe(t(this,
|
|
983
|
+
t(this, I).getAttribute("auto-height") === "true" && t(this, kt).call(this);
|
|
984
|
+
}).observe(t(this, I));
|
|
959
985
|
}, "#init"));
|
|
960
|
-
d(this, kt, /* @__PURE__ */
|
|
961
|
-
var
|
|
962
|
-
const i = Array.from(t(this,
|
|
986
|
+
d(this, kt, /* @__PURE__ */ h(() => {
|
|
987
|
+
var c, l;
|
|
988
|
+
const i = Array.from(t(this, I).shadowRoot.querySelectorAll("nine-table-sheet.active"));
|
|
963
989
|
if (i.length === 0) return;
|
|
964
|
-
const e = parseInt(t(this,
|
|
965
|
-
t(this,
|
|
990
|
+
const e = parseInt(t(this, I).getAttribute("max-display-row"), 10) || 10, s = Math.max(...i.map((f) => f.getRowHeight())), r = (c = t(this, I).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : c.getBoundingClientRect().height, n = (l = t(this, I).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : l.getBoundingClientRect().height, o = $t.SCROLLBAR_SIZE, a = e * s + r + n + o;
|
|
991
|
+
t(this, I).style.height = `${a}px`;
|
|
966
992
|
}, "#applyAutoHeight"));
|
|
967
|
-
d(this, Jt, /* @__PURE__ */
|
|
968
|
-
const e = Array.from(t(this,
|
|
969
|
-
const u = `<nine-table-sheet class="${l === 0 ? "active" : ""}" data-index="${l}"></nine-table-sheet>`,
|
|
970
|
-
return u +
|
|
971
|
-
}).join(""), o = e.map((
|
|
972
|
-
t(this,
|
|
993
|
+
d(this, Jt, /* @__PURE__ */ h(() => {
|
|
994
|
+
const e = Array.from(t(this, I).children).filter((c) => c.tagName === "TABLE"), s = t(this, I).getAttribute("auto-height") === "true", r = e.length, n = e.map((c, l) => {
|
|
995
|
+
const u = `<nine-table-sheet class="${l === 0 ? "active" : ""}" data-index="${l}"></nine-table-sheet>`, b = l < r - 1 ? `<nine-splitter class="h" data-split-index="${l}"></nine-splitter>` : "";
|
|
996
|
+
return u + b;
|
|
997
|
+
}).join(""), o = e.map((c, l) => `<div class="nine-tab-item ${l === 0 ? "active" : ""}" data-index="${l}">Sheet ${l + 1}</div>`).join("");
|
|
998
|
+
t(this, I).shadowRoot.innerHTML = `
|
|
973
999
|
<style>
|
|
974
1000
|
:host {
|
|
975
1001
|
display: flex;
|
|
@@ -1060,96 +1086,96 @@ const Ie = class Ie {
|
|
|
1060
1086
|
</nine-table-body>
|
|
1061
1087
|
<nine-table-footer></nine-table-footer>
|
|
1062
1088
|
`;
|
|
1063
|
-
const a = t(this,
|
|
1064
|
-
a == null || a.forEach((
|
|
1089
|
+
const a = t(this, I).shadowRoot.querySelectorAll("nine-table-sheet");
|
|
1090
|
+
a == null || a.forEach((c, l) => {
|
|
1065
1091
|
e[l] && setTimeout(() => {
|
|
1066
|
-
|
|
1092
|
+
c.generate(e[l]), s && t(this, kt).call(this);
|
|
1067
1093
|
});
|
|
1068
1094
|
});
|
|
1069
1095
|
}, "#render"));
|
|
1070
|
-
|
|
1096
|
+
y(this, I, i), t(this, Gt).call(this);
|
|
1071
1097
|
}
|
|
1072
1098
|
};
|
|
1073
|
-
|
|
1074
|
-
let ue =
|
|
1075
|
-
var Tt,
|
|
1076
|
-
const
|
|
1099
|
+
I = new WeakMap(), Gt = new WeakMap(), kt = new WeakMap(), Jt = new WeakMap(), h(_e, "LayoutManager");
|
|
1100
|
+
let ue = _e;
|
|
1101
|
+
var Tt, ht;
|
|
1102
|
+
const Ne = class Ne {
|
|
1077
1103
|
constructor(i) {
|
|
1078
1104
|
d(this, Tt);
|
|
1079
|
-
d(this,
|
|
1080
|
-
|
|
1081
|
-
|
|
1105
|
+
d(this, ht, -1);
|
|
1106
|
+
A(this, "count", /* @__PURE__ */ h(() => t(this, Tt).rawRecords.length, "count"));
|
|
1107
|
+
y(this, Tt, i);
|
|
1082
1108
|
}
|
|
1083
1109
|
get at() {
|
|
1084
|
-
return t(this,
|
|
1110
|
+
return t(this, ht);
|
|
1085
1111
|
}
|
|
1086
1112
|
set at(i) {
|
|
1087
|
-
|
|
1113
|
+
y(this, ht, parseInt(i, 10)), body && !body.querySelector(`tbody.bindable tr[data-row="${t(this, ht)}"]`) && setTimeout(() => {
|
|
1088
1114
|
});
|
|
1089
1115
|
}
|
|
1090
1116
|
};
|
|
1091
|
-
Tt = new WeakMap(),
|
|
1092
|
-
let ge =
|
|
1093
|
-
var
|
|
1094
|
-
const
|
|
1117
|
+
Tt = new WeakMap(), ht = new WeakMap(), h(Ne, "ngRow");
|
|
1118
|
+
let ge = Ne;
|
|
1119
|
+
var _, T, N, dt, Qt, Y, te, et, Ct, ee, se, ft;
|
|
1120
|
+
const W = class W {
|
|
1095
1121
|
constructor(i, e) {
|
|
1096
|
-
d(this,
|
|
1097
|
-
d(this,
|
|
1098
|
-
d(this,
|
|
1099
|
-
d(this,
|
|
1122
|
+
d(this, _);
|
|
1123
|
+
d(this, T);
|
|
1124
|
+
d(this, N, []);
|
|
1125
|
+
d(this, dt, []);
|
|
1100
1126
|
d(this, Qt, 0);
|
|
1101
|
-
d(this,
|
|
1102
|
-
d(this, te, /* @__PURE__ */
|
|
1103
|
-
|
|
1104
|
-
const i = t(this,
|
|
1127
|
+
d(this, Y, []);
|
|
1128
|
+
d(this, te, /* @__PURE__ */ h(() => {
|
|
1129
|
+
y(this, Y, []);
|
|
1130
|
+
const i = t(this, _).template || [];
|
|
1105
1131
|
Array.from(i).forEach((e) => {
|
|
1106
1132
|
var s;
|
|
1107
|
-
t(this,
|
|
1108
|
-
}), (t(this,
|
|
1109
|
-
e.__ng || (e.__ng = t(this, Ct).call(this)), e.__ng.height = t(this,
|
|
1133
|
+
t(this, Y).push(((s = e.getBoundingClientRect) == null ? void 0 : s.call(e).height) || 24);
|
|
1134
|
+
}), (t(this, T).rawRecords || []).forEach((e) => {
|
|
1135
|
+
e.__ng || (e.__ng = t(this, Ct).call(this)), e.__ng.height = t(this, Y).slice();
|
|
1110
1136
|
});
|
|
1111
1137
|
}, "#initialize"));
|
|
1112
|
-
d(this, et, /* @__PURE__ */
|
|
1113
|
-
t(this,
|
|
1138
|
+
d(this, et, /* @__PURE__ */ h(() => {
|
|
1139
|
+
t(this, _).shadowRoot.querySelectorAll("nine-table-sheet").forEach((i) => {
|
|
1114
1140
|
i.invalidate();
|
|
1115
1141
|
});
|
|
1116
1142
|
}, "#invalidate"));
|
|
1117
|
-
|
|
1143
|
+
A(this, "get", /* @__PURE__ */ h((i, e) => {
|
|
1118
1144
|
var n;
|
|
1119
1145
|
const s = this.getValidData();
|
|
1120
1146
|
if (!s || s.length <= 0) return;
|
|
1121
|
-
if (i == null) return t(this,
|
|
1147
|
+
if (i == null) return t(this, ft).call(this, s);
|
|
1122
1148
|
if (i < 0 || i >= s.length) return null;
|
|
1123
|
-
const r = typeof ((n = t(this,
|
|
1149
|
+
const r = typeof ((n = t(this, _).fields) == null ? void 0 : n.get) == "function" ? t(this, _).fields.get() : [];
|
|
1124
1150
|
if (e != null) {
|
|
1125
1151
|
const o = r.indexOf(e);
|
|
1126
1152
|
return o >= 0 ? s[i].v[o] : null;
|
|
1127
1153
|
}
|
|
1128
|
-
return t(this,
|
|
1154
|
+
return t(this, ft).call(this, s[i]);
|
|
1129
1155
|
}, "get"));
|
|
1130
|
-
|
|
1156
|
+
A(this, "set", /* @__PURE__ */ h((i) => {
|
|
1131
1157
|
this.clear(), this.add(i, !1), t(this, et).call(this);
|
|
1132
1158
|
}, "set"));
|
|
1133
|
-
d(this, Ct, /* @__PURE__ */
|
|
1134
|
-
rowState:
|
|
1159
|
+
d(this, Ct, /* @__PURE__ */ h(() => ({
|
|
1160
|
+
rowState: W.ROW_STATE.EMPTY,
|
|
1135
1161
|
deleted: !1,
|
|
1136
1162
|
filtered: !1,
|
|
1137
|
-
height: t(this,
|
|
1163
|
+
height: t(this, Y).slice(),
|
|
1138
1164
|
o: {},
|
|
1139
1165
|
c: {},
|
|
1140
|
-
_: [0, 0, 0, 0,
|
|
1166
|
+
_: [0, 0, 0, 0, W.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this, Y).slice(), -1, {}, {}]
|
|
1141
1167
|
}), "#getDefaultMeta"));
|
|
1142
|
-
|
|
1143
|
-
|
|
1168
|
+
A(this, "reset", /* @__PURE__ */ h(() => {
|
|
1169
|
+
y(this, N, []), y(this, dt, []), t(this, et).call(this);
|
|
1144
1170
|
}, "reset"));
|
|
1145
|
-
|
|
1171
|
+
A(this, "clear", /* @__PURE__ */ h(() => {
|
|
1146
1172
|
var i;
|
|
1147
|
-
t(this,
|
|
1173
|
+
t(this, T).rawRecords = [], y(this, N, []), y(this, dt, []), (i = t(this, T).viewRecords) != null && i.reset && t(this, T).viewRecords.reset();
|
|
1148
1174
|
}, "clear"));
|
|
1149
|
-
d(this, ee, /* @__PURE__ */
|
|
1175
|
+
d(this, ee, /* @__PURE__ */ h((i) => {
|
|
1150
1176
|
var r;
|
|
1151
1177
|
Array.isArray(i) || (i = [i]);
|
|
1152
|
-
const e = typeof ((r = t(this,
|
|
1178
|
+
const e = typeof ((r = t(this, _).fields) == null ? void 0 : r.get) == "function" ? t(this, _).fields.get() : Object.keys(i[0] || {}), s = [];
|
|
1153
1179
|
return i.forEach((n) => {
|
|
1154
1180
|
const o = { v: [] };
|
|
1155
1181
|
e.forEach((a) => {
|
|
@@ -1157,64 +1183,64 @@ const N = class N {
|
|
|
1157
1183
|
}), s.push(o);
|
|
1158
1184
|
}), s;
|
|
1159
1185
|
}, "#json2Array"));
|
|
1160
|
-
d(this, se, /* @__PURE__ */
|
|
1161
|
-
e.__ng = t(this, Ct).call(this), e.__ng.rowid = this.nextId, e.__ng.rowState =
|
|
1186
|
+
d(this, se, /* @__PURE__ */ h((i) => (Array.isArray(i) || (i = [i]), i.forEach((e) => {
|
|
1187
|
+
e.__ng = t(this, Ct).call(this), e.__ng.rowid = this.nextId, e.__ng.rowState = W.ROW_STATE.INSERT, e.__ng._[0] = e.__ng.rowid;
|
|
1162
1188
|
}), i), "#defaultInsert"));
|
|
1163
|
-
|
|
1189
|
+
A(this, "add", /* @__PURE__ */ h((i, e = !0) => {
|
|
1164
1190
|
i === void 0 && (i = {});
|
|
1165
1191
|
const s = t(this, ee).call(this, i);
|
|
1166
|
-
t(this,
|
|
1192
|
+
t(this, T).rawRecords = t(this, T).rawRecords.concat(t(this, se).call(this, s)), this.resetRecords();
|
|
1167
1193
|
const r = this.count() - 1;
|
|
1168
1194
|
return e || s.forEach((n, o) => {
|
|
1169
|
-
const a = t(this,
|
|
1170
|
-
a && (a.__ng.rowState =
|
|
1195
|
+
const a = t(this, T).rawRecords[r - o];
|
|
1196
|
+
a && (a.__ng.rowState = W.ROW_STATE.EMPTY);
|
|
1171
1197
|
}), t(this, et).call(this), r;
|
|
1172
1198
|
}, "add"));
|
|
1173
|
-
|
|
1199
|
+
A(this, "delete", /* @__PURE__ */ h((i) => {
|
|
1174
1200
|
let e = [];
|
|
1175
|
-
Array.isArray(i) ? e = i : typeof i > "u" ? e = [t(this,
|
|
1176
|
-
if (t(this,
|
|
1177
|
-
const r = t(this,
|
|
1178
|
-
t(this,
|
|
1179
|
-
n.__ng.rowid === r && (n.__ng.deleted = !0, n.__ng.rowState =
|
|
1201
|
+
Array.isArray(i) ? e = i : typeof i > "u" ? e = [t(this, T).host.row.at] : e = [parseInt(i, 10)], e.sort((s, r) => r - s).forEach((s) => {
|
|
1202
|
+
if (t(this, N)[s]) {
|
|
1203
|
+
const r = t(this, N)[s].__ng.rowid;
|
|
1204
|
+
t(this, N)[s].__ng.rowState === W.ROW_STATE.INSERT ? t(this, T).rawRecords = t(this, T).rawRecords.filter((n) => n.__ng.rowid !== r) : t(this, T).rawRecords.forEach((n) => {
|
|
1205
|
+
n.__ng.rowid === r && (n.__ng.deleted = !0, n.__ng.rowState = W.ROW_STATE.DELETE);
|
|
1180
1206
|
});
|
|
1181
1207
|
}
|
|
1182
1208
|
}), this.resetRecords(), t(this, et).call(this);
|
|
1183
1209
|
}, "delete"));
|
|
1184
|
-
|
|
1185
|
-
var
|
|
1210
|
+
A(this, "setValue", /* @__PURE__ */ h((i, e, s) => {
|
|
1211
|
+
var c;
|
|
1186
1212
|
i = parseInt(i, 10);
|
|
1187
|
-
const n = (typeof ((
|
|
1213
|
+
const n = (typeof ((c = t(this, _).fields) == null ? void 0 : c.get) == "function" ? t(this, _).fields.get() : []).indexOf(e);
|
|
1188
1214
|
if (n < 0) return;
|
|
1189
1215
|
const o = this.getValidData()[i];
|
|
1190
1216
|
if (!o) return;
|
|
1191
1217
|
const a = o.v[n];
|
|
1192
|
-
a !== s && o.__ng.rowState !==
|
|
1218
|
+
a !== s && o.__ng.rowState !== W.ROW_STATE.INSERT && (o.__ng.o.hasOwnProperty(e) || (o.__ng.o[e] = a), o.__ng.rowState = W.ROW_STATE.UPDATE), o.v[n] = s;
|
|
1193
1219
|
}, "setValue"));
|
|
1194
|
-
|
|
1195
|
-
|
|
1220
|
+
A(this, "resetRecords", /* @__PURE__ */ h(() => {
|
|
1221
|
+
y(this, dt, t(this, T).rawRecords.filter((i) => !i.__ng.deleted)), y(this, N, t(this, T).rawRecords.filter((i) => !i.__ng.deleted && !i.__ng.filtered)), t(this, T).rawRecords.forEach((i, e) => {
|
|
1196
1222
|
i.__ng.rowidx = e;
|
|
1197
|
-
}), t(this,
|
|
1223
|
+
}), t(this, N).forEach((i, e) => {
|
|
1198
1224
|
i.__ng.i = e;
|
|
1199
1225
|
});
|
|
1200
1226
|
}, "resetRecords"));
|
|
1201
|
-
|
|
1202
|
-
d(this,
|
|
1227
|
+
A(this, "getValidData", /* @__PURE__ */ h(() => (t(this, N).length === 0 && t(this, T).rawRecords.length > 0 && this.resetRecords(), t(this, N)), "getValidData"));
|
|
1228
|
+
d(this, ft, /* @__PURE__ */ h((i) => {
|
|
1203
1229
|
var o;
|
|
1204
1230
|
if (!i) return i;
|
|
1205
|
-
const e = !Array.isArray(i), s = e ? [i] : i, r = typeof ((o = t(this,
|
|
1206
|
-
const
|
|
1231
|
+
const e = !Array.isArray(i), s = e ? [i] : i, r = typeof ((o = t(this, _).fields) == null ? void 0 : o.get) == "function" ? t(this, _).fields.get() : [], n = s.filter((a) => !a.__ng.deleted).map((a) => {
|
|
1232
|
+
const c = {};
|
|
1207
1233
|
return r.forEach((l, f) => {
|
|
1208
|
-
|
|
1209
|
-
}),
|
|
1234
|
+
c[l] = a.v ? a.v[f] : a[l];
|
|
1235
|
+
}), c.__ng = a.__ng, c;
|
|
1210
1236
|
});
|
|
1211
1237
|
return e ? n[0] : n;
|
|
1212
1238
|
}, "#conv"));
|
|
1213
|
-
|
|
1214
|
-
|
|
1239
|
+
A(this, "count", /* @__PURE__ */ h(() => this.getValidData().length, "count"));
|
|
1240
|
+
y(this, _, i), y(this, T, e), t(this, te).call(this);
|
|
1215
1241
|
}
|
|
1216
1242
|
get source() {
|
|
1217
|
-
return t(this,
|
|
1243
|
+
return t(this, ft).call(this, t(this, T).rawRecords);
|
|
1218
1244
|
}
|
|
1219
1245
|
set source(i) {
|
|
1220
1246
|
this.clear(), this.add(i, !1);
|
|
@@ -1223,26 +1249,26 @@ const N = class N {
|
|
|
1223
1249
|
return ++Ve(this, Qt)._;
|
|
1224
1250
|
}
|
|
1225
1251
|
get length() {
|
|
1226
|
-
return t(this,
|
|
1252
|
+
return t(this, N).length;
|
|
1227
1253
|
}
|
|
1228
1254
|
getRowCount() {
|
|
1229
1255
|
return this.length;
|
|
1230
1256
|
}
|
|
1231
1257
|
};
|
|
1232
|
-
|
|
1233
|
-
|
|
1258
|
+
_ = new WeakMap(), T = new WeakMap(), N = new WeakMap(), dt = new WeakMap(), Qt = new WeakMap(), Y = new WeakMap(), te = new WeakMap(), et = new WeakMap(), Ct = new WeakMap(), ee = new WeakMap(), se = new WeakMap(), ft = new WeakMap(), h(W, "ngData"), // 🎯 행 상태 정의 상수를 클래스 내부로 내재화
|
|
1259
|
+
A(W, "ROW_STATE", {
|
|
1234
1260
|
EMPTY: "EMPTY",
|
|
1235
1261
|
NORMAL: "NORMAL",
|
|
1236
1262
|
INSERT: "INSERT",
|
|
1237
1263
|
UPDATE: "UPDATE",
|
|
1238
1264
|
DELETE: "DELETE"
|
|
1239
1265
|
});
|
|
1240
|
-
let be =
|
|
1266
|
+
let be = W;
|
|
1241
1267
|
var st;
|
|
1242
|
-
const
|
|
1268
|
+
const We = class We {
|
|
1243
1269
|
constructor(i) {
|
|
1244
1270
|
d(this, st);
|
|
1245
|
-
|
|
1271
|
+
y(this, st, i), this.row = new ge(this), this.data = new be(t(this, st), this), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.pageCnt = 25, this.viewRecords.reset = () => {
|
|
1246
1272
|
var e;
|
|
1247
1273
|
(e = t(this, st).view) != null && e.redraw && t(this, st).view.redraw();
|
|
1248
1274
|
}, this.setDataSource = (e) => {
|
|
@@ -1259,31 +1285,31 @@ const Ne = class Ne {
|
|
|
1259
1285
|
}, this.setDataSource([]);
|
|
1260
1286
|
}
|
|
1261
1287
|
};
|
|
1262
|
-
st = new WeakMap(),
|
|
1263
|
-
let
|
|
1264
|
-
var
|
|
1265
|
-
const
|
|
1288
|
+
st = new WeakMap(), h(We, "ngDataManager");
|
|
1289
|
+
let ye = We;
|
|
1290
|
+
var ut, L, Lt, ie;
|
|
1291
|
+
const Oe = class Oe {
|
|
1266
1292
|
// 🎯 이제 { name: string, type: string } 객체들의 배열로 관리합니다.
|
|
1267
1293
|
constructor(i) {
|
|
1268
|
-
d(this,
|
|
1294
|
+
d(this, ut);
|
|
1269
1295
|
d(this, L, []);
|
|
1270
|
-
|
|
1296
|
+
A(this, "add", /* @__PURE__ */ h((i, e = "string") => {
|
|
1271
1297
|
i.forEach((s) => {
|
|
1272
1298
|
t(this, L).some((r) => r.name === s) || t(this, L).push({ name: s, type: e });
|
|
1273
1299
|
}), t(this, Lt).call(this);
|
|
1274
1300
|
}, "add"));
|
|
1275
|
-
d(this, Lt, /* @__PURE__ */
|
|
1301
|
+
d(this, Lt, /* @__PURE__ */ h(() => {
|
|
1276
1302
|
const i = /* @__PURE__ */ new Map();
|
|
1277
1303
|
t(this, L).forEach((e) => {
|
|
1278
1304
|
i.set(e.name, e.type);
|
|
1279
|
-
}),
|
|
1305
|
+
}), y(this, L, Array.from(i, ([e, s]) => ({ name: e, type: s }))), y(this, L, t(this, L).filter((e) => e.name !== "" && e.name !== "__ng")), t(this, L).sort((e, s) => e.name.length < s.name.length ? 1 : -1);
|
|
1280
1306
|
}, "#adjust"));
|
|
1281
|
-
d(this, ie, /* @__PURE__ */
|
|
1282
|
-
|
|
1283
|
-
const i = Array.from(t(this,
|
|
1307
|
+
d(this, ie, /* @__PURE__ */ h(() => {
|
|
1308
|
+
y(this, L, []), yt.log(t(this, ut).querySelectorAll("table"));
|
|
1309
|
+
const i = Array.from(t(this, ut).querySelectorAll("table"));
|
|
1284
1310
|
if (!(!i || i.length === 0)) {
|
|
1285
1311
|
for (const e of i)
|
|
1286
|
-
|
|
1312
|
+
yt.log(e), $("[data-bind]", e).each((s, r) => {
|
|
1287
1313
|
const n = r.dataset.bind, o = r.getAttribute("data-type") || "string";
|
|
1288
1314
|
n && t(this, L).push({ name: n, type: o });
|
|
1289
1315
|
}), ["data-expr", "background-color", "color", "tooltip", "visible", "readonly", "enable-button", "enable-check", "class-expr", "icon-color", "icon-src"].forEach((s) => {
|
|
@@ -1300,9 +1326,9 @@ const We = class We {
|
|
|
1300
1326
|
}
|
|
1301
1327
|
o.split("data.").forEach((a) => {
|
|
1302
1328
|
if (a.trim() != "") {
|
|
1303
|
-
const
|
|
1329
|
+
const c = a.search(/[^_A-Za-z0-9]/g);
|
|
1304
1330
|
let l = "";
|
|
1305
|
-
|
|
1331
|
+
c >= 0 ? l = a.substring(0, c) : o.startsWith("data.") && (l = a.replace("data.", "")), l && t(this, L).push({ name: l, type: "string" });
|
|
1306
1332
|
}
|
|
1307
1333
|
});
|
|
1308
1334
|
});
|
|
@@ -1310,7 +1336,7 @@ const We = class We {
|
|
|
1310
1336
|
t(this, Lt).call(this);
|
|
1311
1337
|
}
|
|
1312
1338
|
}, "#init"));
|
|
1313
|
-
|
|
1339
|
+
y(this, ut, i), t(this, ie).call(this);
|
|
1314
1340
|
}
|
|
1315
1341
|
// 🎯 기존에 필드 이름만 쓰던 곳들과의 호환을 위해 이름 배열만 리턴하는 메서드 유지
|
|
1316
1342
|
get() {
|
|
@@ -1332,25 +1358,25 @@ const We = class We {
|
|
|
1332
1358
|
return t(this, L).some((e) => e.name === i);
|
|
1333
1359
|
}
|
|
1334
1360
|
};
|
|
1335
|
-
|
|
1336
|
-
let
|
|
1361
|
+
ut = new WeakMap(), L = new WeakMap(), Lt = new WeakMap(), ie = new WeakMap(), h(Oe, "ngFields");
|
|
1362
|
+
let pe = Oe;
|
|
1337
1363
|
var it, re, ne;
|
|
1338
|
-
const
|
|
1364
|
+
const Be = class Be extends HTMLElement {
|
|
1339
1365
|
constructor() {
|
|
1340
1366
|
super();
|
|
1341
1367
|
//#created = false;
|
|
1342
1368
|
d(this, it);
|
|
1343
1369
|
d(this, re);
|
|
1344
|
-
d(this, ne, /* @__PURE__ */
|
|
1345
|
-
this.fields = new
|
|
1370
|
+
d(this, ne, /* @__PURE__ */ h(() => {
|
|
1371
|
+
this.fields = new pe(this), y(this, re, new ue(this)), yt.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
|
|
1346
1372
|
}, "#init"));
|
|
1347
|
-
this.attachShadow({ mode: "open" }),
|
|
1373
|
+
this.attachShadow({ mode: "open" }), y(this, it, new ye(this));
|
|
1348
1374
|
}
|
|
1349
1375
|
connectedCallback() {
|
|
1350
1376
|
t(this, ne).call(this);
|
|
1351
1377
|
}
|
|
1352
1378
|
disconnectedCallback() {
|
|
1353
|
-
|
|
1379
|
+
yt.log("NineTable disconnected.");
|
|
1354
1380
|
}
|
|
1355
1381
|
// 🎯 외부에서 grid.data.set(...) 형태로 접근할 수 있도록 데이터 매니저 오픈
|
|
1356
1382
|
get data() {
|
|
@@ -1365,10 +1391,10 @@ const Oe = class Oe extends HTMLElement {
|
|
|
1365
1391
|
return t(this, it);
|
|
1366
1392
|
}
|
|
1367
1393
|
};
|
|
1368
|
-
it = new WeakMap(), re = new WeakMap(), ne = new WeakMap(),
|
|
1369
|
-
let me =
|
|
1394
|
+
it = new WeakMap(), re = new WeakMap(), ne = new WeakMap(), h(Be, "NineTable");
|
|
1395
|
+
let me = Be;
|
|
1370
1396
|
customElements.get("nine-table") || customElements.define("nine-table", me);
|
|
1371
|
-
const
|
|
1397
|
+
const xt = class xt extends HTMLElement {
|
|
1372
1398
|
// 👈 커스텀 스타일용 캐시 추가
|
|
1373
1399
|
constructor() {
|
|
1374
1400
|
super();
|
|
@@ -1379,74 +1405,74 @@ const mt = class mt extends HTMLElement {
|
|
|
1379
1405
|
connectedCallback() {
|
|
1380
1406
|
}
|
|
1381
1407
|
};
|
|
1382
|
-
|
|
1383
|
-
let xe =
|
|
1384
|
-
var
|
|
1385
|
-
const
|
|
1408
|
+
h(xt, "BasicCellElement"), A(xt, "_styleCache", /* @__PURE__ */ new Map()), A(xt, "_customStyleCache", /* @__PURE__ */ new Map());
|
|
1409
|
+
let xe = xt;
|
|
1410
|
+
var C, Ht, p, Ae, qe, Re, ke, Te;
|
|
1411
|
+
const ze = class ze extends xe {
|
|
1386
1412
|
constructor() {
|
|
1387
1413
|
super();
|
|
1388
|
-
d(this,
|
|
1414
|
+
d(this, C);
|
|
1389
1415
|
d(this, Ht);
|
|
1390
|
-
d(this,
|
|
1391
|
-
d(this, Ee);
|
|
1416
|
+
d(this, p);
|
|
1392
1417
|
d(this, Ae);
|
|
1393
|
-
d(this, Re);
|
|
1394
1418
|
d(this, qe);
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1419
|
+
d(this, Re);
|
|
1420
|
+
d(this, ke);
|
|
1421
|
+
A(this, "getDisplayText", /* @__PURE__ */ h((e) => {
|
|
1422
|
+
if (t(this, p))
|
|
1423
|
+
if (t(this, p).closest("tbody")) {
|
|
1424
|
+
const s = t(this, p).closest("tr").data, r = parseInt(t(this, p).dataset.row);
|
|
1399
1425
|
if (!s) return "";
|
|
1400
|
-
if (ninegrid.isNull(t(this,
|
|
1401
|
-
if (!ninegrid.isNull(t(this,
|
|
1402
|
-
return s[t(this,
|
|
1426
|
+
if (ninegrid.isNull(t(this, p).dataset.expr)) {
|
|
1427
|
+
if (!ninegrid.isNull(t(this, p).dataset.bind))
|
|
1428
|
+
return s[t(this, p).dataset.bind] || ninegrid.nvl(e, "");
|
|
1403
1429
|
} else try {
|
|
1404
|
-
return this.getExprValue(t(this,
|
|
1430
|
+
return this.getExprValue(t(this, p).dataset.expr, s, r, t(this, p));
|
|
1405
1431
|
} catch {
|
|
1406
|
-
console.error(t(this,
|
|
1432
|
+
console.error(t(this, p).dataset.expr, s, t(this, p).dataset.row);
|
|
1407
1433
|
}
|
|
1408
1434
|
return ninegrid.nvl(e, "");
|
|
1409
1435
|
} else
|
|
1410
1436
|
try {
|
|
1411
|
-
return t(this,
|
|
1437
|
+
return t(this, C).exprFunction(t(this, p).dataset.expr).call(this, null, -1, t(this, C).data);
|
|
1412
1438
|
} catch {
|
|
1413
1439
|
}
|
|
1414
1440
|
}, "getDisplayText"));
|
|
1415
|
-
d(this,
|
|
1416
|
-
if (!(!t(this,
|
|
1417
|
-
var e = ninegrid.j.querySelectorAll(t(this,
|
|
1441
|
+
d(this, Te, /* @__PURE__ */ h(() => {
|
|
1442
|
+
if (!(!t(this, C) || !t(this, C).template || !t(this, p).closest("tbody.bindable"))) {
|
|
1443
|
+
var e = ninegrid.j.querySelectorAll(t(this, p)).attr("suppress");
|
|
1418
1444
|
if (e && (e = parseInt(e)), e && !isNaN(e)) {
|
|
1419
|
-
var s = t(this,
|
|
1420
|
-
$("th,td", s).each((x,
|
|
1421
|
-
var
|
|
1422
|
-
|
|
1445
|
+
var s = t(this, p).closest("tr"), r = [];
|
|
1446
|
+
$("th,td", s).each((x, M) => {
|
|
1447
|
+
var k = ninegrid.j.querySelectorAll(M).attr("suppress");
|
|
1448
|
+
k && M.dataset.row && (k = parseInt(k), !isNaN(k) && k <= e && r.push(k));
|
|
1423
1449
|
}), r.sort();
|
|
1424
1450
|
var n = !1;
|
|
1425
|
-
if (parseInt(s.sectionRowIndex / t(this,
|
|
1451
|
+
if (parseInt(s.sectionRowIndex / t(this, C).template.length) > 0)
|
|
1426
1452
|
for (var o of r) {
|
|
1427
1453
|
if (o > e) break;
|
|
1428
|
-
var a = parseInt(t(this,
|
|
1429
|
-
t(this,
|
|
1430
|
-
var u = t(this,
|
|
1431
|
-
if (
|
|
1454
|
+
var a = parseInt(t(this, p).dataset.row), c = a - 1, l = t(this, p).closest("tr").data, f = t(this, C).data.get(c);
|
|
1455
|
+
t(this, p).dataset.matrixRow;
|
|
1456
|
+
var u = t(this, C).body.querySelector(`tbody.bindable [suppress="${o}"][data-matrix-row="${t(this, p).dataset.matrixRow}"]`), b = u.dataset.expr ? this.getExprValue(u.dataset.expr, l, a) : l[u.dataset.bind], g = u.dataset.expr ? this.getExprValue(u.dataset.expr, f, c) : f[u.dataset.bind];
|
|
1457
|
+
if (b != g) {
|
|
1432
1458
|
n = !0;
|
|
1433
1459
|
break;
|
|
1434
1460
|
}
|
|
1435
1461
|
}
|
|
1436
1462
|
else
|
|
1437
1463
|
n = !0;
|
|
1438
|
-
n ? ninegrid.j.querySelectorAll(t(this,
|
|
1439
|
-
var m = parseInt(t(this,
|
|
1440
|
-
$(
|
|
1464
|
+
n ? ninegrid.j.querySelectorAll(t(this, p)).removeClass("suppress") : ninegrid.j.querySelectorAll(t(this, p)).addClass("suppress"), ninegrid.j.querySelectorAll(t(this, p)).hasClass("hidden") || (n ? ninegrid.j.querySelectorAll(t(this, p)).removeClass("hidden") : ninegrid.j.querySelectorAll(t(this, p)).addClass("hidden"));
|
|
1465
|
+
var m = parseInt(t(this, p).dataset.matrixRow), v = m - 1, w = t(this, C).body.querySelector(`tbody.bindable [data-col="${t(this, p).dataset.col}"][data-matrix-row="${v}"]`);
|
|
1466
|
+
$(w).hasClass("suppress") && !ninegrid.j.querySelectorAll(t(this, p)).hasClass("suppress") ? ninegrid.j.querySelectorAll(w).removeClass("last-none-suppress").addClass("last-suppress") : !$(w).hasClass("suppress") && ninegrid.j.querySelectorAll(t(this, p)).hasClass("suppress") ? ninegrid.j.querySelectorAll(w).removeClass("last-suppress").addClass("last-none-suppress") : ninegrid.j.querySelectorAll(w).removeClass("last-none-suppress").removeClass("last-suppress");
|
|
1441
1467
|
}
|
|
1442
1468
|
}
|
|
1443
1469
|
}, "#resetSuppress"));
|
|
1444
|
-
|
|
1470
|
+
A(this, "getExprValue", /* @__PURE__ */ h((e, s, r, n) => {
|
|
1445
1471
|
if (typeof e < "u")
|
|
1446
1472
|
try {
|
|
1447
1473
|
r = parseInt(r);
|
|
1448
1474
|
const o = e.replace("()", "");
|
|
1449
|
-
return t(this,
|
|
1475
|
+
return t(this, C)[o] ? t(this, C)[o].call(this, s, r, t(this, p)) : t(this, C).exprFunction(e).call(this, s, r, t(this, C).data);
|
|
1450
1476
|
} catch {
|
|
1451
1477
|
return ["NG-COMBO"].includes(this.tagName) ? "" : e;
|
|
1452
1478
|
}
|
|
@@ -1455,30 +1481,30 @@ const Be = class Be extends xe {
|
|
|
1455
1481
|
}, "getExprValue"));
|
|
1456
1482
|
}
|
|
1457
1483
|
connectedCallback() {
|
|
1458
|
-
super.connectedCallback(),
|
|
1484
|
+
super.connectedCallback(), y(this, C, this.getRootNode().host), y(this, p, this.closest("th,td")), y(this, Ht, t(this, p).closest("tr"));
|
|
1459
1485
|
}
|
|
1460
1486
|
get value() {
|
|
1461
|
-
var e = !t(this,
|
|
1487
|
+
var e = !t(this, C) || !t(this, C).dataManager || !t(this, p) || !t(this, p).dataset || !t(this, p).dataset.row || !t(this, p).dataset.bind ? "" : t(this, p).closest("tr").data[t(this, p).dataset.bind];
|
|
1462
1488
|
return e ?? "";
|
|
1463
1489
|
}
|
|
1464
1490
|
set value(e) {
|
|
1465
|
-
var s = parseInt(t(this,
|
|
1491
|
+
var s = parseInt(t(this, p).dataset.row);
|
|
1466
1492
|
const r = this.getAttribute("update-row-state") != "false";
|
|
1467
|
-
s < 0 ? t(this,
|
|
1493
|
+
s < 0 ? t(this, C).data.setValueNF(parseInt(t(this, p).dataset.index), t(this, p).dataset.bind, e, r) : t(this, C).data.setValue(s, t(this, p).dataset.bind, e, r);
|
|
1468
1494
|
}
|
|
1469
1495
|
get row() {
|
|
1470
|
-
return parseInt(t(this,
|
|
1496
|
+
return parseInt(t(this, p).dataset.row);
|
|
1471
1497
|
}
|
|
1472
1498
|
get data() {
|
|
1473
|
-
return t(this,
|
|
1499
|
+
return t(this, p).closest("tr").data;
|
|
1474
1500
|
}
|
|
1475
1501
|
refresh() {
|
|
1476
|
-
return t(this,
|
|
1502
|
+
return t(this, p).dataset.bind, parseInt(t(this, p).dataset.row), t(this, Ht).data, t(this, p).dataset.row;
|
|
1477
1503
|
}
|
|
1478
1504
|
};
|
|
1479
|
-
|
|
1480
|
-
let ve =
|
|
1481
|
-
const
|
|
1505
|
+
C = new WeakMap(), Ht = new WeakMap(), p = new WeakMap(), Ae = new WeakMap(), qe = new WeakMap(), Re = new WeakMap(), ke = new WeakMap(), Te = new WeakMap(), h(ze, "CellElement");
|
|
1506
|
+
let ve = ze;
|
|
1507
|
+
const De = class De extends ve {
|
|
1482
1508
|
constructor() {
|
|
1483
1509
|
super();
|
|
1484
1510
|
}
|
|
@@ -1489,21 +1515,21 @@ const ze = class ze extends ve {
|
|
|
1489
1515
|
return super.refresh();
|
|
1490
1516
|
}
|
|
1491
1517
|
};
|
|
1492
|
-
|
|
1493
|
-
let we =
|
|
1494
|
-
var
|
|
1495
|
-
const
|
|
1518
|
+
h(De, "EditableCellElement");
|
|
1519
|
+
let we = De;
|
|
1520
|
+
var Mt, rt, gt, bt, oe, V, Ce;
|
|
1521
|
+
const Pe = class Pe extends we {
|
|
1496
1522
|
constructor() {
|
|
1497
1523
|
super();
|
|
1498
|
-
d(this,
|
|
1524
|
+
d(this, Mt);
|
|
1499
1525
|
d(this, rt);
|
|
1500
|
-
d(this, ut);
|
|
1501
1526
|
d(this, gt);
|
|
1527
|
+
d(this, bt);
|
|
1502
1528
|
d(this, oe);
|
|
1503
|
-
d(this,
|
|
1504
|
-
|
|
1529
|
+
d(this, V);
|
|
1530
|
+
A(this, "refresh", /* @__PURE__ */ h(() => {
|
|
1505
1531
|
const e = super.refresh();
|
|
1506
|
-
t(this,
|
|
1532
|
+
t(this, Mt).value = e;
|
|
1507
1533
|
}, "refresh"));
|
|
1508
1534
|
/**
|
|
1509
1535
|
dataRefresh = (v) => {
|
|
@@ -1535,22 +1561,22 @@ const De = class De extends we {
|
|
|
1535
1561
|
if (!v) this.reset();
|
|
1536
1562
|
};
|
|
1537
1563
|
*/
|
|
1538
|
-
d(this,
|
|
1564
|
+
d(this, Ce, /* @__PURE__ */ h((e) => {
|
|
1539
1565
|
if (!["Escape", "Enter", "Tab", "Home", "End", "ArrowLeft", "ArrowRight", "PageUp", "PageDown", "Backspace", "Delete"].includes(e.code)) {
|
|
1540
1566
|
if (t(this, rt) == "number") {
|
|
1541
1567
|
let n = [];
|
|
1542
|
-
if (t(this,
|
|
1568
|
+
if (t(this, V) && Number(t(this, V)) > 0 && n.push("."), t(this, bt) && Number(t(this, bt)) >= 0 && n.push("-"), !(e.keyCode >= 48 && e.keyCode <= 57 || e.keyCode >= 96 && e.keyCode <= 105) && !n.includes(e.key) && e.preventDefault(), t(this, V) && (e.keyCode >= 48 && e.keyCode <= 57 || e.keyCode >= 96 && e.keyCode <= 105) && e.target.selectionStart == e.target.selectionEnd) {
|
|
1543
1569
|
var s = e.target.value, r = s.indexOf(".");
|
|
1544
1570
|
if (r >= 0) {
|
|
1545
1571
|
var s = s.substr(r + 1, s.length);
|
|
1546
|
-
s.length >= Number(t(this,
|
|
1572
|
+
s.length >= Number(t(this, V)) && e.preventDefault();
|
|
1547
1573
|
}
|
|
1548
1574
|
}
|
|
1549
1575
|
}
|
|
1550
|
-
t(this,
|
|
1576
|
+
t(this, gt) && ninegrid.getByteLength(e.target.value) >= Number(t(this, gt)) && e.target.selectionStart == e.target.selectionEnd && e.preventDefault();
|
|
1551
1577
|
}
|
|
1552
1578
|
}, "#onKeyDown"));
|
|
1553
|
-
if (this.applyBaseStyle(),
|
|
1579
|
+
if (this.applyBaseStyle(), y(this, rt, this.getAttribute("type") || "text"), y(this, gt, this.getAttribute("maxbyte")), y(this, bt, this.getAttribute("min")), y(this, oe, this.getAttribute("max")), y(this, V, this.getAttribute("scale")), !["text", "number"].includes(t(this, rt))) throw `invalid type : ${t(this, rt)}`;
|
|
1554
1580
|
}
|
|
1555
1581
|
connectedCallback() {
|
|
1556
1582
|
for (var e = [], s = 0; s < this.attributes.length; s++)
|
|
@@ -1560,11 +1586,11 @@ const De = class De extends we {
|
|
|
1560
1586
|
${e.join(" ")}
|
|
1561
1587
|
ondragstart="return false;"
|
|
1562
1588
|
>
|
|
1563
|
-
`, super.connectedCallback(),
|
|
1589
|
+
`, super.connectedCallback(), y(this, Mt, this.querySelector("input"));
|
|
1564
1590
|
}
|
|
1565
1591
|
};
|
|
1566
|
-
|
|
1567
|
-
let Se =
|
|
1592
|
+
Mt = new WeakMap(), rt = new WeakMap(), gt = new WeakMap(), bt = new WeakMap(), oe = new WeakMap(), V = new WeakMap(), Ce = new WeakMap(), h(Pe, "CellInputText");
|
|
1593
|
+
let Se = Pe;
|
|
1568
1594
|
customElements.get("cell-input-text");
|
|
1569
1595
|
customElements.get("cell-input") || customElements.define("cell-input", Se);
|
|
1570
1596
|
//# sourceMappingURL=nine-table.js.map
|