@ninebone/table 0.0.591 β 0.0.592
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 +338 -331
- package/dist/nine-table.js.map +1 -1
- package/dist/nine-table.umd.js +22 -11
- package/dist/nine-table.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/nine-table.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
var Fe = Object.defineProperty;
|
|
2
|
-
var Ve = (
|
|
3
|
-
throw TypeError(
|
|
2
|
+
var Ve = (R) => {
|
|
3
|
+
throw TypeError(R);
|
|
4
4
|
};
|
|
5
|
-
var Xe = (
|
|
6
|
-
var h = (
|
|
7
|
-
var
|
|
8
|
-
var t = (
|
|
9
|
-
var Ue = (
|
|
10
|
-
set _(
|
|
11
|
-
p(
|
|
5
|
+
var Xe = (R, i, e) => i in R ? Fe(R, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : R[i] = e;
|
|
6
|
+
var h = (R, i) => Fe(R, "name", { value: i, configurable: !0 });
|
|
7
|
+
var E = (R, i, e) => Xe(R, typeof i != "symbol" ? i + "" : i, e), Ye = (R, i, e) => i.has(R) || Ve("Cannot " + e);
|
|
8
|
+
var t = (R, i, e) => (Ye(R, i, "read from private field"), e ? e.call(R) : i.get(R)), d = (R, i, e) => i.has(R) ? Ve("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(R) : i.set(R, e), p = (R, i, e, s) => (Ye(R, i, "write to private field"), s ? s.call(R, e) : i.set(R, e), e);
|
|
9
|
+
var Ue = (R, i, e, s) => ({
|
|
10
|
+
set _(r) {
|
|
11
|
+
p(R, i, r, e);
|
|
12
12
|
},
|
|
13
13
|
get _() {
|
|
14
|
-
return t(
|
|
14
|
+
return t(R, i, s);
|
|
15
15
|
}
|
|
16
16
|
});
|
|
17
17
|
import { trace as Ke } from "@ninebone/util";
|
|
@@ -23,35 +23,35 @@ const He = class He extends Ke.constructor {
|
|
|
23
23
|
h(He, "Trace");
|
|
24
24
|
let oe = He;
|
|
25
25
|
const W = new oe();
|
|
26
|
-
var
|
|
26
|
+
var z, j, w, X, K, Z, It, G, _t;
|
|
27
27
|
const Me = class Me extends HTMLElement {
|
|
28
28
|
constructor() {
|
|
29
29
|
super();
|
|
30
|
-
d(this,
|
|
30
|
+
d(this, z);
|
|
31
31
|
d(this, j, !1);
|
|
32
32
|
d(this, w);
|
|
33
33
|
d(this, X);
|
|
34
34
|
d(this, K);
|
|
35
35
|
d(this, Z);
|
|
36
36
|
d(this, It, /* @__PURE__ */ h(() => {
|
|
37
|
-
if (!t(this,
|
|
38
|
-
const e = t(this,
|
|
37
|
+
if (!t(this, z)) return;
|
|
38
|
+
const e = t(this, z).querySelector(".ng-container-body .ng-part-body");
|
|
39
39
|
e && (p(this, Z, new ResizeObserver(() => {
|
|
40
40
|
this.refresh();
|
|
41
41
|
})), t(this, Z).observe(e));
|
|
42
42
|
}, "#observeResize"));
|
|
43
|
-
|
|
44
|
-
if (!t(this,
|
|
43
|
+
E(this, "refresh", /* @__PURE__ */ h(() => {
|
|
44
|
+
if (!t(this, z) || !t(this, w) || t(this, j)) return;
|
|
45
45
|
const e = t(this, w).container, s = e.querySelector("table");
|
|
46
46
|
if (!s) return;
|
|
47
|
-
const
|
|
47
|
+
const r = t(this, w).track, n = t(this, w).thumb, o = t(this, z).querySelector(".ng-container-bottom"), a = e.clientWidth, c = s.scrollWidth;
|
|
48
48
|
if (a !== 0 && c > a)
|
|
49
49
|
o && (o.style.display = "flex");
|
|
50
50
|
else {
|
|
51
51
|
o && (o.style.display = "none");
|
|
52
52
|
return;
|
|
53
53
|
}
|
|
54
|
-
const l =
|
|
54
|
+
const l = r.clientWidth;
|
|
55
55
|
if (l <= 0) return;
|
|
56
56
|
const f = Math.max(Math.min(l * (a / c), l), 20);
|
|
57
57
|
n.style.width = `${f}px`;
|
|
@@ -63,43 +63,43 @@ const Me = class Me extends HTMLElement {
|
|
|
63
63
|
}, "refresh"));
|
|
64
64
|
d(this, G, /* @__PURE__ */ h((e) => {
|
|
65
65
|
if (!t(this, w)) return !1;
|
|
66
|
-
const s = t(this, w).container,
|
|
67
|
-
if (!
|
|
66
|
+
const s = t(this, w).container, r = s.querySelector("table");
|
|
67
|
+
if (!r) return !1;
|
|
68
68
|
const n = t(this, w).track.getBoundingClientRect(), o = t(this, w).thumb.clientWidth;
|
|
69
69
|
let a = e;
|
|
70
70
|
a < 0 && (a = 0);
|
|
71
71
|
const c = n.width - o;
|
|
72
72
|
a > c && (a = c), a = parseInt(a, 10), t(this, w).thumb.style.left = `${a}px`, t(this, w).left.disabled = a === 0, t(this, w).right.disabled = a >= c - 1;
|
|
73
|
-
const l = s.clientWidth, u =
|
|
73
|
+
const l = s.clientWidth, u = r.scrollWidth - l;
|
|
74
74
|
return c > 0 && u > 0 && (s.scrollLeft = a / c * u), a > 0 && a < c - 1;
|
|
75
75
|
}, "#thumbMoveTo"));
|
|
76
76
|
d(this, _t, /* @__PURE__ */ h(() => {
|
|
77
|
-
const e = /* @__PURE__ */ h((
|
|
77
|
+
const e = /* @__PURE__ */ h((r) => {
|
|
78
78
|
clearInterval(t(this, X)), clearInterval(t(this, K));
|
|
79
79
|
const n = parseInt(t(this, w).thumb.style.left || 0, 10);
|
|
80
|
-
t(this, G).call(this, n +
|
|
80
|
+
t(this, G).call(this, n + r), p(this, X, setInterval(() => {
|
|
81
81
|
clearInterval(t(this, X)), p(this, K, setInterval(() => {
|
|
82
82
|
const o = parseInt(t(this, w).thumb.style.left || 0, 10);
|
|
83
|
-
t(this, G).call(this, o +
|
|
83
|
+
t(this, G).call(this, o + r) || clearInterval(t(this, K));
|
|
84
84
|
}, 50));
|
|
85
85
|
}, 500));
|
|
86
86
|
}, "delayScroll"), s = /* @__PURE__ */ h(() => {
|
|
87
87
|
clearInterval(t(this, X)), clearInterval(t(this, K));
|
|
88
88
|
}, "clearTimer");
|
|
89
|
-
["mouseup", "mouseleave", "touchend"].forEach((
|
|
90
|
-
t(this, w).left.addEventListener(
|
|
91
|
-
}), t(this, w).left.addEventListener("mousedown", (
|
|
92
|
-
|
|
93
|
-
}), t(this, w).right.addEventListener("mousedown", (
|
|
94
|
-
|
|
95
|
-
}), t(this, w).left.addEventListener("touchstart", () => e(-20)), t(this, w).right.addEventListener("touchstart", () => e(20)), t(this, w).track.addEventListener("mousedown", (
|
|
96
|
-
if (
|
|
97
|
-
|
|
89
|
+
["mouseup", "mouseleave", "touchend"].forEach((r) => {
|
|
90
|
+
t(this, w).left.addEventListener(r, s), t(this, w).right.addEventListener(r, s), t(this, w).track.addEventListener(r, s);
|
|
91
|
+
}), t(this, w).left.addEventListener("mousedown", (r) => {
|
|
92
|
+
r.button === 0 && e(-20);
|
|
93
|
+
}), t(this, w).right.addEventListener("mousedown", (r) => {
|
|
94
|
+
r.button === 0 && e(20);
|
|
95
|
+
}), t(this, w).left.addEventListener("touchstart", () => e(-20)), t(this, w).right.addEventListener("touchstart", () => e(20)), t(this, w).track.addEventListener("mousedown", (r) => {
|
|
96
|
+
if (r.button !== 0) return;
|
|
97
|
+
r.preventDefault();
|
|
98
98
|
const n = t(this, w).track.getBoundingClientRect(), o = t(this, w).thumb.clientWidth;
|
|
99
|
-
t(this, G).call(this,
|
|
100
|
-
}), t(this, w).thumb.addEventListener("mousedown", (
|
|
101
|
-
if (
|
|
102
|
-
|
|
99
|
+
t(this, G).call(this, r.clientX - n.left - o / 2);
|
|
100
|
+
}), t(this, w).thumb.addEventListener("mousedown", (r) => {
|
|
101
|
+
if (r.button !== 0) return;
|
|
102
|
+
r.stopPropagation(), r.preventDefault(), p(this, j, !0), this.shiftX = r.clientX - t(this, w).thumb.getBoundingClientRect().left;
|
|
103
103
|
const n = /* @__PURE__ */ h((a) => {
|
|
104
104
|
if (!t(this, j)) return;
|
|
105
105
|
const c = t(this, w).track.getBoundingClientRect();
|
|
@@ -112,7 +112,7 @@ const Me = class Me extends HTMLElement {
|
|
|
112
112
|
}, "#init"));
|
|
113
113
|
}
|
|
114
114
|
connectedCallback() {
|
|
115
|
-
if (p(this,
|
|
115
|
+
if (p(this, z, this.closest("nine-table-sheet") || this.getRootNode().host), !t(this, z)) return;
|
|
116
116
|
this.innerHTML = `
|
|
117
117
|
<style>
|
|
118
118
|
nine-table-hscrollbar {
|
|
@@ -177,7 +177,7 @@ const Me = class Me 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 s = t(this,
|
|
180
|
+
const s = t(this, z).querySelector(".ng-container-body .ng-part-body");
|
|
181
181
|
if (!s) {
|
|
182
182
|
setTimeout(e, 10);
|
|
183
183
|
return;
|
|
@@ -198,54 +198,54 @@ const Me = class Me extends HTMLElement {
|
|
|
198
198
|
t(this, Z) && t(this, Z).disconnect();
|
|
199
199
|
}
|
|
200
200
|
};
|
|
201
|
-
|
|
201
|
+
z = new WeakMap(), j = new WeakMap(), w = new WeakMap(), X = new WeakMap(), K = new WeakMap(), Z = new WeakMap(), It = new WeakMap(), G = new WeakMap(), _t = new WeakMap(), h(Me, "NineTableHScrollBar");
|
|
202
202
|
let ae = Me;
|
|
203
203
|
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", ae);
|
|
204
|
-
var F, at, J,
|
|
204
|
+
var F, at, J, q, vt, xt, Nt;
|
|
205
205
|
const $e = class $e extends HTMLElement {
|
|
206
206
|
constructor() {
|
|
207
207
|
super();
|
|
208
208
|
d(this, F);
|
|
209
209
|
d(this, at);
|
|
210
210
|
d(this, J, !1);
|
|
211
|
-
d(this,
|
|
211
|
+
d(this, q);
|
|
212
212
|
d(this, vt, 0);
|
|
213
213
|
d(this, xt, 0);
|
|
214
|
-
|
|
215
|
-
if (!t(this, F) || !t(this,
|
|
216
|
-
const e = t(this,
|
|
214
|
+
E(this, "refresh", /* @__PURE__ */ h(() => {
|
|
215
|
+
if (!t(this, F) || !t(this, q)) return;
|
|
216
|
+
const e = t(this, q).container, s = t(this, q).track, r = t(this, q).thumb, n = e.clientHeight, a = (t(this, F).data.get() || []).length, c = t(this, at).getRowHeight(), l = a * c;
|
|
217
217
|
if (l <= n) {
|
|
218
|
-
|
|
218
|
+
r.style.display = "none", t(this, q).top.disabled = !0, t(this, q).bottom.disabled = !0;
|
|
219
219
|
return;
|
|
220
220
|
} else
|
|
221
|
-
|
|
221
|
+
r.style.display = "block";
|
|
222
222
|
const f = s.clientHeight;
|
|
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
226
|
const g = e.scrollTop, b = Math.max(l - n, 1);
|
|
227
227
|
let m = 0;
|
|
228
228
|
b > 0 && (m = g / b * (f - u));
|
|
229
229
|
const x = f - u;
|
|
230
|
-
m < 0 && (m = 0), m > x && (m = x),
|
|
230
|
+
m < 0 && (m = 0), m > x && (m = x), r.style.top = `${m}px`, t(this, q).top.disabled = g <= 0, t(this, q).bottom.disabled = g >= b - 1;
|
|
231
231
|
}, "refresh"));
|
|
232
232
|
d(this, Nt, /* @__PURE__ */ h(() => {
|
|
233
233
|
W.log("nine-table-vscrollbar.#init");
|
|
234
|
-
const e = t(this,
|
|
234
|
+
const e = t(this, q).container, s = /* @__PURE__ */ h(() => {
|
|
235
235
|
const n = (t(this, F).data.get() || []).length, o = t(this, at).getRowHeight();
|
|
236
236
|
return n * o;
|
|
237
237
|
}, "getContentHeight");
|
|
238
238
|
e.addEventListener("scroll", () => {
|
|
239
239
|
t(this, J) || this.refresh();
|
|
240
|
-
}), t(this,
|
|
241
|
-
if (
|
|
242
|
-
|
|
240
|
+
}), t(this, q).thumb.addEventListener("mousedown", (r) => {
|
|
241
|
+
if (r.button !== 0) return;
|
|
242
|
+
r.stopPropagation(), r.preventDefault(), p(this, J, !0), p(this, vt, r.clientY), p(this, xt, e.scrollTop);
|
|
243
243
|
const n = /* @__PURE__ */ h((a) => {
|
|
244
244
|
if (!t(this, J)) return;
|
|
245
|
-
const c = t(this,
|
|
245
|
+
const c = t(this, q).track.getBoundingClientRect(), l = t(this, q).thumb.clientHeight, u = c.height - l, g = a.clientY - t(this, vt), b = e.clientHeight, m = s(), x = Math.max(m - b, 1);
|
|
246
246
|
if (u > 0 && x > 0) {
|
|
247
|
-
const
|
|
248
|
-
let v = t(this, xt) +
|
|
247
|
+
const A = g / u * x;
|
|
248
|
+
let v = t(this, xt) + A;
|
|
249
249
|
const M = Math.max(0, m - b);
|
|
250
250
|
v < 0 && (v = 0), v > M && (v = M), e.scrollTop = v;
|
|
251
251
|
}
|
|
@@ -254,17 +254,17 @@ const $e = class $e extends HTMLElement {
|
|
|
254
254
|
p(this, J, !1), document.removeEventListener("mousemove", n), document.removeEventListener("mouseup", o), this.refresh();
|
|
255
255
|
}, "onMouseUp");
|
|
256
256
|
document.addEventListener("mousemove", n), document.addEventListener("mouseup", o);
|
|
257
|
-
}), t(this,
|
|
258
|
-
if (
|
|
259
|
-
const n = t(this,
|
|
257
|
+
}), t(this, q).track.addEventListener("mousedown", (r) => {
|
|
258
|
+
if (r.button !== 0 || r.target === t(this, q).thumb) return;
|
|
259
|
+
const n = t(this, q).track.getBoundingClientRect(), o = t(this, q).thumb.clientHeight, a = r.clientY - n.top - o / 2, l = n.height - o, f = e.clientHeight, u = s(), g = Math.max(u - f, 1);
|
|
260
260
|
if (l > 0 && g > 0) {
|
|
261
261
|
const b = Math.max(0, Math.min(1, a / l));
|
|
262
262
|
e.scrollTop = b * g;
|
|
263
263
|
}
|
|
264
264
|
this.refresh();
|
|
265
|
-
}), t(this,
|
|
265
|
+
}), t(this, q).top.addEventListener("click", () => {
|
|
266
266
|
e.scrollTop -= 40;
|
|
267
|
-
}), t(this,
|
|
267
|
+
}), t(this, q).bottom.addEventListener("click", () => {
|
|
268
268
|
e.scrollTop += 40;
|
|
269
269
|
});
|
|
270
270
|
}, "#init"));
|
|
@@ -340,7 +340,7 @@ const $e = class $e extends HTMLElement {
|
|
|
340
340
|
setTimeout(e, 10);
|
|
341
341
|
return;
|
|
342
342
|
}
|
|
343
|
-
p(this,
|
|
343
|
+
p(this, q, {
|
|
344
344
|
container: s,
|
|
345
345
|
track: this.querySelector(".ng-scroll-track"),
|
|
346
346
|
thumb: this.querySelector(".ng-scroll-thumb"),
|
|
@@ -351,35 +351,35 @@ const $e = class $e extends HTMLElement {
|
|
|
351
351
|
e();
|
|
352
352
|
}
|
|
353
353
|
};
|
|
354
|
-
F = new WeakMap(), at = new WeakMap(), J = new WeakMap(),
|
|
354
|
+
F = new WeakMap(), at = new WeakMap(), J = new WeakMap(), q = new WeakMap(), vt = new WeakMap(), xt = new WeakMap(), Nt = new WeakMap(), h($e, "NineTableVScrollBar");
|
|
355
355
|
let le = $e;
|
|
356
356
|
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar", le);
|
|
357
|
-
var
|
|
357
|
+
var P, S, Q, D, I, V, tt, wt, Se, Ae, Wt, Ot, Bt, St, At, zt, Dt, Et, Ee, lt, Rt, Pt;
|
|
358
358
|
const Ie = class Ie {
|
|
359
|
-
constructor(
|
|
360
|
-
d(this,
|
|
359
|
+
constructor(i) {
|
|
360
|
+
d(this, P);
|
|
361
361
|
d(this, S);
|
|
362
362
|
d(this, Q);
|
|
363
|
-
d(this,
|
|
363
|
+
d(this, D, /* @__PURE__ */ new Map());
|
|
364
364
|
d(this, I, null);
|
|
365
365
|
d(this, V, null);
|
|
366
366
|
d(this, tt, 0);
|
|
367
367
|
d(this, wt, 40);
|
|
368
368
|
d(this, Se, !1);
|
|
369
|
-
d(this,
|
|
369
|
+
d(this, Ae, !1);
|
|
370
370
|
//#ticking = false; // π― κ³ μ μ€ν¬λ‘€ μ€λ‘νλ§μ© νλκ·Έ
|
|
371
371
|
d(this, Wt, 3);
|
|
372
|
-
|
|
372
|
+
E(this, "refresh", /* @__PURE__ */ h(() => {
|
|
373
373
|
var e;
|
|
374
374
|
W.log("rowManager.refresh");
|
|
375
|
-
const
|
|
376
|
-
|
|
375
|
+
const i = t(this, S).querySelector(".ng-container-body .ng-part-body");
|
|
376
|
+
i && (t(this, St).call(this), t(this, lt).call(this, i.scrollTop), (e = t(this, S).querySelector("nine-table-vscrollbar")) == null || e.refresh());
|
|
377
377
|
}, "refresh"));
|
|
378
|
-
|
|
378
|
+
E(this, "initialize", /* @__PURE__ */ h(() => {
|
|
379
379
|
W.log("rowManager.initialize"), p(this, Q, {
|
|
380
380
|
scrollTables: t(this, S).querySelectorAll(".ng-part-body table"),
|
|
381
381
|
firstTr: t(this, S).querySelector(".ng-container-body .ng-part-body tbody.bindable-tbody tr:not(.nodata)")
|
|
382
|
-
}), p(this, I, null), t(this,
|
|
382
|
+
}), p(this, I, null), t(this, D).clear(), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((o) => {
|
|
383
383
|
const a = t(this, S).querySelector(o);
|
|
384
384
|
if (!a) return;
|
|
385
385
|
const c = a.querySelector(".ng-part-body table");
|
|
@@ -387,82 +387,82 @@ const Ie = class Ie {
|
|
|
387
387
|
const l = c.querySelector("tbody.bindable-tbody");
|
|
388
388
|
if (!l) return;
|
|
389
389
|
const u = Array.from(l.querySelectorAll("tr")).map((g) => g.cloneNode(!0));
|
|
390
|
-
t(this,
|
|
390
|
+
t(this, D).set(o, u);
|
|
391
391
|
});
|
|
392
|
-
const
|
|
393
|
-
if (
|
|
394
|
-
t(this, Bt).call(this,
|
|
392
|
+
const i = t(this, S).querySelector(".ng-container-body .ng-part-body"), e = t(this, S).querySelector(".ng-container-left .ng-part-body"), s = t(this, S).querySelector(".ng-container-right .ng-part-body"), r = t(this, S).querySelector(".ng-container-body .ng-part-header"), n = t(this, S).querySelector(".ng-container-body .ng-part-footer");
|
|
393
|
+
if (i) {
|
|
394
|
+
t(this, Bt).call(this, i), t(this, Et).call(this), t(this, St).call(this), t(this, lt).call(this, i.scrollTop);
|
|
395
395
|
let o = !1;
|
|
396
396
|
const a = /* @__PURE__ */ h((c) => {
|
|
397
397
|
if (o) return;
|
|
398
398
|
o = !0;
|
|
399
399
|
const l = c.scrollTop, f = c.scrollLeft;
|
|
400
|
-
|
|
400
|
+
i && i.scrollTop !== l && (i.scrollTop = l), e && e.scrollTop !== l && (e.scrollTop = l), s && s.scrollTop !== l && (s.scrollTop = l), r && r.scrollLeft !== f && (r.scrollLeft = f), n && n.scrollLeft !== f && (n.scrollLeft = f), t(this, lt).call(this, l), o = !1;
|
|
401
401
|
}, "handleContainerScroll");
|
|
402
|
-
[
|
|
402
|
+
[i, e, s].forEach((c) => {
|
|
403
403
|
c && c.addEventListener("scroll", () => {
|
|
404
404
|
a(c);
|
|
405
405
|
}, { passive: !0 });
|
|
406
406
|
});
|
|
407
407
|
}
|
|
408
408
|
}, "initialize"));
|
|
409
|
-
d(this, Ot, /* @__PURE__ */ h((
|
|
409
|
+
d(this, Ot, /* @__PURE__ */ h((i, e) => {
|
|
410
410
|
W.log("rowManager.#renderRows");
|
|
411
|
-
const s = t(this,
|
|
411
|
+
const s = t(this, D).get(e);
|
|
412
412
|
if (!s || s.length === 0) return;
|
|
413
|
-
const
|
|
414
|
-
if (!
|
|
415
|
-
|
|
416
|
-
const n =
|
|
413
|
+
const r = i.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
414
|
+
if (!r) return;
|
|
415
|
+
r.querySelectorAll("tr:not(.nodata)").forEach((a) => a.remove());
|
|
416
|
+
const n = r.querySelector("tr.nodata"), o = document.createDocumentFragment();
|
|
417
417
|
for (let a = 0; a < t(this, wt); a++)
|
|
418
418
|
s.forEach((c) => {
|
|
419
419
|
o.appendChild(c.cloneNode(!0));
|
|
420
420
|
});
|
|
421
|
-
n ? n.before(o) :
|
|
421
|
+
n ? n.before(o) : r.appendChild(o), e === ".ng-container-body" && (t(this, Q).firstTr = r.querySelector("tr:not(.nodata)"));
|
|
422
422
|
}, "#renderRows"));
|
|
423
|
-
d(this, Bt, /* @__PURE__ */ h((
|
|
423
|
+
d(this, Bt, /* @__PURE__ */ h((i) => {
|
|
424
424
|
if (W.log("rowManager.#measureAndCacheHeight"), t(this, I) !== null && t(this, I) > 0)
|
|
425
425
|
return t(this, I);
|
|
426
426
|
W.log("#measureAndCacheHeight");
|
|
427
|
-
const e = t(this,
|
|
427
|
+
const e = t(this, D).get(".ng-container-body");
|
|
428
428
|
if (!e || e.length === 0) return 24;
|
|
429
|
-
const s =
|
|
429
|
+
const s = i.querySelector("tbody.bindable-tbody");
|
|
430
430
|
if (!s) return 24;
|
|
431
431
|
s.querySelectorAll("tr:not(.nodata)").forEach((g) => g.remove());
|
|
432
|
-
const
|
|
432
|
+
const r = s.querySelector("tr.nodata"), n = document.createDocumentFragment();
|
|
433
433
|
e.forEach((g) => {
|
|
434
434
|
n.appendChild(g.cloneNode(!0));
|
|
435
|
-
}),
|
|
435
|
+
}), r ? r.before(n) : s.appendChild(n);
|
|
436
436
|
const o = t(this, S), a = o.style.display, c = o.style.visibility, l = o.style.position;
|
|
437
437
|
(a === "none" || window.getComputedStyle(o).display === "none") && (o.style.display = "block", o.style.visibility = "hidden", o.style.position = "absolute");
|
|
438
438
|
let f = 0;
|
|
439
439
|
const u = s.querySelectorAll("tr:not(.nodata)");
|
|
440
440
|
return u.forEach((g) => {
|
|
441
441
|
f += g.offsetHeight || g.getBoundingClientRect().height;
|
|
442
|
-
}), u.forEach((g) => g.remove()), o.style.display = a, o.style.visibility = c, o.style.position = l, p(this, I, f > 0 ? f : 24), t(this,
|
|
442
|
+
}), u.forEach((g) => g.remove()), o.style.display = a, o.style.visibility = c, o.style.position = l, p(this, I, f > 0 ? f : 24), t(this, At).call(this), t(this, I);
|
|
443
443
|
}, "#measureAndCacheHeight"));
|
|
444
444
|
d(this, St, /* @__PURE__ */ h(() => {
|
|
445
445
|
W.log("rowManager.#updateVirtualScrollHeight");
|
|
446
|
-
const e = (t(this,
|
|
446
|
+
const e = (t(this, P).data.get() || []).length, s = t(this, I), r = e * s;
|
|
447
447
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((n) => {
|
|
448
448
|
const o = t(this, S).querySelector(n);
|
|
449
449
|
if (!o) return;
|
|
450
450
|
const a = o.querySelector(".ng-part-body .ng-virtual-spacer");
|
|
451
|
-
a && (a.style.height = `${
|
|
451
|
+
a && (a.style.height = `${r}px`);
|
|
452
452
|
});
|
|
453
453
|
}, "#updateVirtualScrollHeight"));
|
|
454
|
-
d(this,
|
|
454
|
+
d(this, At, /* @__PURE__ */ h(() => {
|
|
455
455
|
if (t(this, tt) > 0 && t(this, I) > 0) {
|
|
456
|
-
const
|
|
457
|
-
p(this, wt,
|
|
456
|
+
const i = Math.ceil(t(this, tt) / t(this, I));
|
|
457
|
+
p(this, wt, i + t(this, Wt));
|
|
458
458
|
}
|
|
459
459
|
}, "#updateRowCount"));
|
|
460
|
-
d(this,
|
|
460
|
+
d(this, zt, /* @__PURE__ */ h(() => {
|
|
461
461
|
var a, c, l, f, u, g;
|
|
462
|
-
const
|
|
462
|
+
const i = t(this, S).querySelector(".ng-container-left .ng-part-body table"), e = t(this, S).querySelector(".ng-container-body .ng-part-body table"), s = t(this, S).querySelector(".ng-container-right .ng-part-body table");
|
|
463
463
|
if (e) {
|
|
464
|
-
const b =
|
|
465
|
-
for (let v = 0; v <
|
|
464
|
+
const b = i ? Array.from(i.querySelectorAll("tbody tr")) : [], m = Array.from(e.querySelectorAll("tbody tr")), x = s ? Array.from(s.querySelectorAll("tbody tr")) : [], A = Math.max(b.length, m.length, x.length);
|
|
465
|
+
for (let v = 0; v < A; v++) {
|
|
466
466
|
const M = [
|
|
467
467
|
((a = b[v]) == null ? void 0 : a.getBoundingClientRect().height) || 0,
|
|
468
468
|
((c = m[v]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
|
|
@@ -471,10 +471,10 @@ const Ie = class Ie {
|
|
|
471
471
|
T > 0 && (b[v] && (b[v].style.height = `${T}px`), m[v] && (m[v].style.height = `${T}px`), x[v] && (x[v].style.height = `${T}px`));
|
|
472
472
|
}
|
|
473
473
|
}
|
|
474
|
-
const
|
|
474
|
+
const r = t(this, S).querySelector(".ng-container-left .ng-part-footer table"), n = t(this, S).querySelector(".ng-container-body .ng-part-footer table"), o = t(this, S).querySelector(".ng-container-right .ng-part-footer table");
|
|
475
475
|
if (n) {
|
|
476
|
-
const b =
|
|
477
|
-
for (let v = 0; v <
|
|
476
|
+
const b = r ? Array.from(r.querySelectorAll("tfoot tr")) : [], m = Array.from(n.querySelectorAll("tfoot tr")), x = o ? Array.from(o.querySelectorAll("tfoot tr")) : [], A = Math.max(b.length, m.length, x.length);
|
|
477
|
+
for (let v = 0; v < A; v++) {
|
|
478
478
|
const M = [
|
|
479
479
|
((f = b[v]) == null ? void 0 : f.getBoundingClientRect().height) || 0,
|
|
480
480
|
((u = m[v]) == null ? void 0 : u.getBoundingClientRect().height) || 0,
|
|
@@ -484,54 +484,54 @@ const Ie = class Ie {
|
|
|
484
484
|
}
|
|
485
485
|
}
|
|
486
486
|
}, "#syncRowHeights"));
|
|
487
|
-
d(this,
|
|
488
|
-
!t(this, S) || !(t(this, S) instanceof HTMLElement) || (p(this, V, new ResizeObserver((
|
|
489
|
-
for (const e of
|
|
487
|
+
d(this, Dt, /* @__PURE__ */ h(() => {
|
|
488
|
+
!t(this, S) || !(t(this, S) instanceof HTMLElement) || (p(this, V, new ResizeObserver((i) => {
|
|
489
|
+
for (const e of i) {
|
|
490
490
|
const s = e.target;
|
|
491
491
|
if (!s.classList.contains("active")) continue;
|
|
492
|
-
const
|
|
493
|
-
if (
|
|
492
|
+
const r = e.contentRect.height;
|
|
493
|
+
if (r > 0) {
|
|
494
494
|
let n = 0;
|
|
495
495
|
const o = s.querySelector(".ng-part-header"), a = s.querySelector(".ng-part-footer");
|
|
496
496
|
o && (n += o.offsetHeight), a && (n += a.offsetHeight);
|
|
497
|
-
const c = Math.max(
|
|
498
|
-
t(this, tt) !== c && (p(this, tt, c), t(this,
|
|
497
|
+
const c = Math.max(r - n, 100);
|
|
498
|
+
t(this, tt) !== c && (p(this, tt, c), t(this, At).call(this), t(this, I) !== null && (t(this, Et).call(this), this.refresh()));
|
|
499
499
|
}
|
|
500
500
|
}
|
|
501
501
|
})), t(this, V).observe(t(this, S)));
|
|
502
502
|
}, "#initResizeObserver"));
|
|
503
|
-
d(this,
|
|
504
|
-
W.log("rowManager.#renderAllContainers"), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((
|
|
505
|
-
const e = t(this, S).querySelector(
|
|
506
|
-
e && e.querySelector(".ng-part-body tbody.bindable-tbody") && t(this, Ot).call(this, e,
|
|
507
|
-
}), t(this,
|
|
503
|
+
d(this, Et, /* @__PURE__ */ h(() => {
|
|
504
|
+
W.log("rowManager.#renderAllContainers"), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((i) => {
|
|
505
|
+
const e = t(this, S).querySelector(i);
|
|
506
|
+
e && e.querySelector(".ng-part-body tbody.bindable-tbody") && t(this, Ot).call(this, e, i);
|
|
507
|
+
}), t(this, Pt).call(this), t(this, zt).call(this);
|
|
508
508
|
}, "#renderAllContainers"));
|
|
509
|
-
d(this,
|
|
509
|
+
d(this, Ee, /* @__PURE__ */ h((i) => {
|
|
510
510
|
[".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((e) => {
|
|
511
511
|
var l;
|
|
512
512
|
const s = t(this, S).querySelector(e);
|
|
513
513
|
if (!s) return;
|
|
514
|
-
const
|
|
515
|
-
if (!
|
|
516
|
-
const n = Array.from(
|
|
514
|
+
const r = s.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
515
|
+
if (!r) return;
|
|
516
|
+
const n = Array.from(r.querySelectorAll("tr:not(.nodata)")), o = ((l = t(this, D).get(e)) == null ? void 0 : l.length) || 1, c = (t(this, P).data.get() || []).length;
|
|
517
517
|
n.forEach((f, u) => {
|
|
518
|
-
const g =
|
|
518
|
+
const g = i + Math.floor(u / o);
|
|
519
519
|
if (g >= c) {
|
|
520
520
|
f.style.display = "none";
|
|
521
521
|
return;
|
|
522
522
|
}
|
|
523
|
-
const b = t(this,
|
|
524
|
-
f.style.display = "", t(this,
|
|
523
|
+
const b = t(this, P).data.get(g);
|
|
524
|
+
f.style.display = "", t(this, Rt).call(this, f, b, g);
|
|
525
525
|
});
|
|
526
526
|
});
|
|
527
527
|
}, "#adjustBufferRows"));
|
|
528
|
-
d(this, lt, /* @__PURE__ */ h((
|
|
528
|
+
d(this, lt, /* @__PURE__ */ h((i) => {
|
|
529
529
|
var f, u;
|
|
530
530
|
const e = t(this, I);
|
|
531
531
|
if (!e || e <= 0) return;
|
|
532
|
-
const s = t(this,
|
|
532
|
+
const s = t(this, P).data.length;
|
|
533
533
|
if (s === 0) return;
|
|
534
|
-
const
|
|
534
|
+
const r = ((f = t(this, D).get(".ng-container-body")) == null ? void 0 : f.length) || 1, n = Math.max(0, s - 1), o = Math.min(n, Math.max(0, Math.floor(i / e))), a = Math.floor(o * e), c = t(this, Q).firstTr, l = c && c.dataset.row !== void 0 ? parseInt(c.dataset.row, 10) : -1;
|
|
535
535
|
(u = t(this, Q)) == null || u.scrollTables.forEach((g) => {
|
|
536
536
|
g.style.transform = `translate3d(0, ${a}px, 0)`;
|
|
537
537
|
}), l !== o && [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((g) => {
|
|
@@ -539,14 +539,14 @@ const Ie = class Ie {
|
|
|
539
539
|
if (!b) return;
|
|
540
540
|
const m = b.querySelector(".ng-part-body tbody.bindable-tbody");
|
|
541
541
|
if (!m) return;
|
|
542
|
-
Array.from(m.querySelectorAll("tr:not(.nodata)")).forEach((
|
|
543
|
-
const M = o + Math.floor(v /
|
|
542
|
+
Array.from(m.querySelectorAll("tr:not(.nodata)")).forEach((A, v) => {
|
|
543
|
+
const M = o + Math.floor(v / r);
|
|
544
544
|
if (M >= s) {
|
|
545
|
-
|
|
545
|
+
A.style.display = "none";
|
|
546
546
|
return;
|
|
547
547
|
}
|
|
548
|
-
const T = t(this,
|
|
549
|
-
|
|
548
|
+
const T = t(this, P).data.get(M);
|
|
549
|
+
A.style.display = "", t(this, Rt).call(this, A, T, M);
|
|
550
550
|
});
|
|
551
551
|
});
|
|
552
552
|
}, "#handleScroll"));
|
|
@@ -564,63 +564,63 @@ const Ie = class Ie {
|
|
|
564
564
|
cell.dataset.row = dataIndex;
|
|
565
565
|
});
|
|
566
566
|
}; */
|
|
567
|
-
d(this,
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
const o = Array.from(
|
|
567
|
+
d(this, Rt, /* @__PURE__ */ h((i, e, s) => {
|
|
568
|
+
i.dataset.row = s, i.data = e, Array.from(i.cells).forEach((r, n) => {
|
|
569
|
+
r.dataset.row = s;
|
|
570
|
+
const o = Array.from(r.children).find((a) => a.tagName.toLowerCase().startsWith("cell-") || typeof a.refresh == "function");
|
|
571
571
|
o && typeof o.refresh == "function" && o.refresh();
|
|
572
572
|
});
|
|
573
573
|
}, "#bindRowData"));
|
|
574
|
-
d(this,
|
|
574
|
+
d(this, Pt, /* @__PURE__ */ h(() => {
|
|
575
575
|
var c, l, f;
|
|
576
576
|
W.log("rowManager.#syncHeaderHeights");
|
|
577
|
-
const
|
|
577
|
+
const i = t(this, S).querySelector(".ng-container-left .ng-part-header table"), e = t(this, S).querySelector(".ng-container-body .ng-part-header table"), s = t(this, S).querySelector(".ng-container-right .ng-part-header table");
|
|
578
578
|
if (!e) return;
|
|
579
|
-
const
|
|
579
|
+
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);
|
|
580
580
|
for (let u = 0; u < a; u++) {
|
|
581
581
|
const g = [
|
|
582
|
-
((c =
|
|
582
|
+
((c = r[u]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
|
|
583
583
|
((l = n[u]) == null ? void 0 : l.getBoundingClientRect().height) || 0,
|
|
584
584
|
((f = o[u]) == null ? void 0 : f.getBoundingClientRect().height) || 0
|
|
585
585
|
], b = Math.max(...g);
|
|
586
|
-
b > 0 && (
|
|
586
|
+
b > 0 && (r[u] && (r[u].style.height = `${b}px`), n[u] && (n[u].style.height = `${b}px`), o[u] && (o[u].style.height = `${b}px`));
|
|
587
587
|
}
|
|
588
588
|
}, "#syncHeaderHeights"));
|
|
589
|
-
|
|
589
|
+
E(this, "destroy", /* @__PURE__ */ h(() => {
|
|
590
590
|
t(this, V) && (t(this, V).disconnect(), p(this, V, null));
|
|
591
591
|
}, "destroy"));
|
|
592
|
-
p(this,
|
|
592
|
+
p(this, P, i.getRootNode().host), p(this, S, i), t(this, Dt).call(this);
|
|
593
593
|
}
|
|
594
594
|
getRowHeight() {
|
|
595
595
|
return t(this, I);
|
|
596
596
|
}
|
|
597
|
-
templateLength(
|
|
597
|
+
templateLength(i = ".ng-container-body") {
|
|
598
598
|
var e;
|
|
599
|
-
return ((e = t(this,
|
|
599
|
+
return ((e = t(this, D).get(i)) == null ? void 0 : e.length) || 1;
|
|
600
600
|
}
|
|
601
601
|
};
|
|
602
|
-
|
|
602
|
+
P = new WeakMap(), S = new WeakMap(), Q = new WeakMap(), D = new WeakMap(), I = new WeakMap(), V = new WeakMap(), tt = new WeakMap(), wt = new WeakMap(), Se = new WeakMap(), Ae = new WeakMap(), Wt = new WeakMap(), Ot = new WeakMap(), Bt = new WeakMap(), St = new WeakMap(), At = new WeakMap(), zt = new WeakMap(), Dt = new WeakMap(), Et = new WeakMap(), Ee = new WeakMap(), lt = new WeakMap(), Rt = new WeakMap(), Pt = new WeakMap(), h(Ie, "RowManager");
|
|
603
603
|
let ce = Ie;
|
|
604
604
|
const jt = class jt {
|
|
605
605
|
/**
|
|
606
606
|
* π― λ μ΄μμ λ΄μ μ¬λ¬ rawTables λ°°μ΄μ μΌκ΄λ‘ λ°μ λ¨μΌ λ§μ€ν° ν
νλ¦ΏμΌλ‘ μ¬μ μ»΄νμΌν©λλ€.
|
|
607
607
|
*/
|
|
608
|
-
static compileAll(
|
|
609
|
-
return Array.isArray(
|
|
608
|
+
static compileAll(i) {
|
|
609
|
+
return Array.isArray(i) ? i.map((e) => jt.compile(e)) : [];
|
|
610
610
|
}
|
|
611
611
|
/**
|
|
612
612
|
* π― λ¨μΌ μλ³Έ ν
μ΄λΈμ λ°μ κΈ°λ³Έ ꡬ쑰 보μ λ° 2μ°¨μ 격μ μΈλ±μ€ μ¬μ λΆμ¬ μλ£λ λ§μ€ν° ν
μ΄λΈ λ°ν
|
|
613
613
|
*/
|
|
614
|
-
static compile(
|
|
615
|
-
if (!
|
|
614
|
+
static compile(i) {
|
|
615
|
+
if (!i) return null;
|
|
616
616
|
const e = /* @__PURE__ */ h((a) => {
|
|
617
617
|
a.querySelectorAll("tbody td, tbody th, tfoot td, tfoot th").forEach((l) => {
|
|
618
618
|
const f = l.getAttribute("cell-type") || "renderer";
|
|
619
619
|
if (l.children.length > 0 && l.firstElementChild.tagName.includes("-")) return;
|
|
620
620
|
let u = `cell-${f}`;
|
|
621
621
|
const g = l.getAttribute("data-bind"), b = l.getAttribute("data-expr"), m = l.getAttribute("maxbyte"), x = l.getAttribute("type");
|
|
622
|
-
let
|
|
623
|
-
g &&
|
|
622
|
+
let A = [];
|
|
623
|
+
g && A.push(`data-bind="${g}"`), b && A.push(`data-expr="${b}"`), m && A.push(`maxbyte="${m}"`), x && A.push(`type="${x}"`), l.innerHTML = `<${u} ${A.join(" ")}></${u}>`;
|
|
624
624
|
});
|
|
625
625
|
}, "processCellTypes"), s = /* @__PURE__ */ h((a) => {
|
|
626
626
|
if (!a.querySelector("colgroup")) {
|
|
@@ -636,7 +636,7 @@ const jt = class jt {
|
|
|
636
636
|
l ? l.after(c) : a.prepend(c);
|
|
637
637
|
}
|
|
638
638
|
a.classList.add("nine-table-element"), a.style.display = "table";
|
|
639
|
-
}, "ensureTableStructure"),
|
|
639
|
+
}, "ensureTableStructure"), r = /* @__PURE__ */ h((a, c) => {
|
|
640
640
|
const l = Array.from(a.querySelectorAll(c + " tr")), f = Array.from(a.querySelectorAll(c + " th," + c + " td")), u = l.length;
|
|
641
641
|
if (u === 0 || f.length === 0) return;
|
|
642
642
|
let g = 0;
|
|
@@ -646,30 +646,30 @@ const jt = class jt {
|
|
|
646
646
|
const b = Array.from(Array(u), () => Array(g).fill(null));
|
|
647
647
|
l.forEach((m) => {
|
|
648
648
|
const x = m.sectionRowIndex;
|
|
649
|
-
let
|
|
649
|
+
let A = 0;
|
|
650
650
|
Array.from(m.querySelectorAll("th,td")).forEach((v) => {
|
|
651
651
|
for (let B = 0; B < b[x].length; B++)
|
|
652
652
|
if (b[x][B] === null) {
|
|
653
|
-
|
|
653
|
+
A = B;
|
|
654
654
|
break;
|
|
655
655
|
}
|
|
656
656
|
const M = v.rowSpan || 1, T = v.colSpan || 1;
|
|
657
657
|
for (let B = 0; B < M; B++)
|
|
658
658
|
for (let pt = 0; pt < T; pt++)
|
|
659
|
-
x + B < u &&
|
|
659
|
+
x + B < u && A + pt < g && (b[x + B][A + pt] = B === 0 && pt === 0 ? "1" : "0");
|
|
660
660
|
});
|
|
661
661
|
}), l.forEach((m) => {
|
|
662
662
|
const x = m.sectionRowIndex;
|
|
663
|
-
Array.from(m.querySelectorAll("th,td")).forEach((
|
|
663
|
+
Array.from(m.querySelectorAll("th,td")).forEach((A) => {
|
|
664
664
|
for (let v = 0; v < b[x].length; v++)
|
|
665
665
|
if (b[x][v] === "1") {
|
|
666
|
-
|
|
666
|
+
A.dataset.col = v, b[x][v] = "0";
|
|
667
667
|
break;
|
|
668
668
|
}
|
|
669
669
|
});
|
|
670
670
|
});
|
|
671
|
-
}, "resetColIndex"), n =
|
|
672
|
-
return s(n), e(n),
|
|
671
|
+
}, "resetColIndex"), n = i.cloneNode(!0);
|
|
672
|
+
return s(n), e(n), r(n, "thead"), r(n, "tbody"), r(n, "tfoot"), Array.from(n.querySelectorAll("colgroup col")).forEach((a, c) => {
|
|
673
673
|
const l = a.getAttribute("fixed");
|
|
674
674
|
l && n.querySelectorAll(`thead [data-col="${c}"], tbody [data-col="${c}"], tfoot [data-col="${c}"]`).forEach((f) => {
|
|
675
675
|
f.setAttribute("fixed", l);
|
|
@@ -687,7 +687,7 @@ const yt = class yt extends HTMLElement {
|
|
|
687
687
|
d(this, Ft);
|
|
688
688
|
d(this, et, null);
|
|
689
689
|
d(this, st);
|
|
690
|
-
|
|
690
|
+
E(this, "invalidate", /* @__PURE__ */ h(() => {
|
|
691
691
|
t(this, st).refresh();
|
|
692
692
|
}, "invalidate"));
|
|
693
693
|
d(this, Vt, /* @__PURE__ */ h(() => {
|
|
@@ -695,41 +695,37 @@ const yt = class yt extends HTMLElement {
|
|
|
695
695
|
{ selector: ".ng-container-body", type: null },
|
|
696
696
|
{ selector: ".ng-container-left", type: "left" },
|
|
697
697
|
{ selector: ".ng-container-right", type: "right" }
|
|
698
|
-
].forEach(({ selector: s, type:
|
|
698
|
+
].forEach(({ selector: s, type: r }) => {
|
|
699
|
+
var o, a, c;
|
|
699
700
|
const n = this.querySelector(s);
|
|
700
|
-
|
|
701
|
-
n.querySelector(".ng-part-header").appendChild(t(this, ct).call(this, t(this, et), i, "header"));
|
|
702
|
-
const a = n.querySelector(".ng-part-body"), c = n.querySelector(".ng-scroll-content");
|
|
703
|
-
c.appendChild(t(this, ct).call(this, t(this, et), i, "body"));
|
|
704
|
-
const l = document.createElement("div");
|
|
705
|
-
l.className = "ng-virtual-spacer", l.style.width = "100%", l.style.pointerEvents = "none", c.appendChild(l), a.appendChild(c), n.querySelector(".ng-part-footer").appendChild(t(this, ct).call(this, t(this, et), i, "footer"));
|
|
701
|
+
(o = n == null ? void 0 : n.querySelector(".ng-part-header")) == null || o.appendChild(t(this, ct).call(this, t(this, et), r, "header")), (a = n == null ? void 0 : n.querySelector(".ng-scroll-content")) == null || a.insertBefore(t(this, ct).call(this, t(this, et), r, "body")), (c = n == null ? void 0 : n.querySelector(".ng-part-footer")) == null || c.appendChild(t(this, ct).call(this, t(this, et), r, "footer"));
|
|
706
702
|
});
|
|
707
703
|
}, "#renderSplitContainers"));
|
|
708
704
|
d(this, Yt, /* @__PURE__ */ h(() => {
|
|
709
705
|
["left", "right", "body"].forEach((e) => {
|
|
710
|
-
const s = this.querySelector(`.ng-container-${e}`),
|
|
711
|
-
if (!s || !
|
|
706
|
+
const s = this.querySelector(`.ng-container-${e}`), r = s == null ? void 0 : s.querySelectorAll("table");
|
|
707
|
+
if (!s || !r || r.length === 0) return;
|
|
712
708
|
let n = 0;
|
|
713
|
-
|
|
709
|
+
r[0].querySelectorAll("col").forEach((o) => {
|
|
714
710
|
const a = parseInt(o.getAttribute("width"), 10);
|
|
715
711
|
isNaN(n) || (n += a);
|
|
716
712
|
}), e === "body" ? s.style.flex = "1" : (s.style.flex = `0 0 ${n}px`, s.style.width = `${n}px`);
|
|
717
713
|
});
|
|
718
714
|
}, "#updateContainerWidths"));
|
|
719
|
-
|
|
715
|
+
E(this, "generate", /* @__PURE__ */ h((e) => {
|
|
720
716
|
e && (p(this, et, he.compile(e)), t(this, Vt).call(this), t(this, Yt).call(this), t(this, st).initialize(), setTimeout(() => {
|
|
721
717
|
var s;
|
|
722
718
|
(s = this.querySelector("nine-table-hscrollbar")) == null || s.refresh();
|
|
723
719
|
}, 0));
|
|
724
720
|
}, "generate"));
|
|
725
|
-
d(this, ct, /* @__PURE__ */ h((e, s,
|
|
721
|
+
d(this, ct, /* @__PURE__ */ h((e, s, r) => {
|
|
726
722
|
const n = e.cloneNode(!0), o = n.querySelector("thead"), a = n.querySelector("tbody"), c = n.querySelector("tfoot");
|
|
727
|
-
if (
|
|
723
|
+
if (r === "header") {
|
|
728
724
|
if (a && a.remove(), c && c.remove(), e.querySelector("tbody")) {
|
|
729
725
|
const f = document.createElement("tbody");
|
|
730
726
|
f.className = "fixed-tbody", n.appendChild(f);
|
|
731
727
|
}
|
|
732
|
-
} else
|
|
728
|
+
} else r === "body" ? (o && o.remove(), c && c.remove(), a && (a.className = "bindable-tbody")) : r === "footer" && (o && o.remove(), a && a.remove());
|
|
733
729
|
return s === "left" ? n.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((l) => {
|
|
734
730
|
l.getAttribute("fixed") !== "left" && l.remove();
|
|
735
731
|
}) : s === "right" ? n.querySelectorAll("col, th, td, tfoot td, tfoot th").forEach((l) => {
|
|
@@ -738,12 +734,12 @@ const yt = class yt extends HTMLElement {
|
|
|
738
734
|
l.remove();
|
|
739
735
|
}), n;
|
|
740
736
|
}, "#createSplitTable"));
|
|
741
|
-
|
|
742
|
-
|
|
737
|
+
E(this, "getRowHeight", /* @__PURE__ */ h(() => t(this, st).getRowHeight(), "getRowHeight"));
|
|
738
|
+
E(this, "scrollToX", /* @__PURE__ */ h((e) => {
|
|
743
739
|
const s = this.querySelector(".ng-container-body .ng-part-body");
|
|
744
740
|
s && (s.scrollLeft = e);
|
|
745
741
|
}, "scrollToX"));
|
|
746
|
-
|
|
742
|
+
E(this, "scrollToY", /* @__PURE__ */ h((e) => {
|
|
747
743
|
const s = this.querySelector(".ng-container-body .ng-part-body");
|
|
748
744
|
s && (s.scrollTop = e);
|
|
749
745
|
}, "scrollToY"));
|
|
@@ -888,8 +884,13 @@ const yt = class yt extends HTMLElement {
|
|
|
888
884
|
}
|
|
889
885
|
|
|
890
886
|
.ng-scroll-content {
|
|
891
|
-
position:
|
|
887
|
+
position: relative;
|
|
888
|
+
width: 100%;
|
|
889
|
+
}
|
|
890
|
+
|
|
891
|
+
.ng-virtual-spacer {
|
|
892
892
|
width: 100%;
|
|
893
|
+
pointer-events: none;
|
|
893
894
|
}
|
|
894
895
|
</style>
|
|
895
896
|
|
|
@@ -897,21 +898,27 @@ const yt = class yt extends HTMLElement {
|
|
|
897
898
|
<div class='ng-container-left'>
|
|
898
899
|
<div class="ng-part-header"></div>
|
|
899
900
|
<div class="ng-part-body">
|
|
900
|
-
<div class="ng-scroll-content"
|
|
901
|
+
<div class="ng-scroll-content">
|
|
902
|
+
<div class="ng-virtual-spacer"></div>
|
|
903
|
+
</div>
|
|
901
904
|
</div>
|
|
902
905
|
<div class="ng-part-footer"></div>
|
|
903
906
|
</div>
|
|
904
907
|
<div class='ng-container-body'>
|
|
905
908
|
<div class="ng-part-header"></div>
|
|
906
909
|
<div class="ng-part-body">
|
|
907
|
-
<div class="ng-scroll-content"
|
|
910
|
+
<div class="ng-scroll-content">
|
|
911
|
+
<div class="ng-virtual-spacer"></div>
|
|
912
|
+
</div>
|
|
908
913
|
</div>
|
|
909
914
|
<div class="ng-part-footer"></div>
|
|
910
915
|
</div>
|
|
911
916
|
<div class='ng-container-right'>
|
|
912
917
|
<div class="ng-part-header"></div>
|
|
913
918
|
<div class="ng-part-body">
|
|
914
|
-
<div class="ng-scroll-content"
|
|
919
|
+
<div class="ng-scroll-content">
|
|
920
|
+
<div class="ng-virtual-spacer"></div>
|
|
921
|
+
</div>
|
|
915
922
|
</div>
|
|
916
923
|
<div class="ng-part-footer"></div>
|
|
917
924
|
</div>
|
|
@@ -932,10 +939,10 @@ const yt = class yt extends HTMLElement {
|
|
|
932
939
|
this.innerHTML = "", W.log("NineTableSheet destroyed.");
|
|
933
940
|
}
|
|
934
941
|
};
|
|
935
|
-
Ft = new WeakMap(), et = new WeakMap(), st = new WeakMap(), Vt = new WeakMap(), Yt = new WeakMap(), ct = new WeakMap(), Ut = new WeakMap(), Xt = new WeakMap(), h(yt, "NineTableSheet"),
|
|
942
|
+
Ft = new WeakMap(), et = new WeakMap(), st = new WeakMap(), Vt = new WeakMap(), Yt = new WeakMap(), ct = new WeakMap(), Ut = new WeakMap(), Xt = new WeakMap(), h(yt, "NineTableSheet"), E(yt, "SCROLLBAR_SIZE", 16);
|
|
936
943
|
let $t = yt;
|
|
937
944
|
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", $t);
|
|
938
|
-
var Kt,
|
|
945
|
+
var Kt, qt;
|
|
939
946
|
const _e = class _e extends HTMLElement {
|
|
940
947
|
constructor() {
|
|
941
948
|
super();
|
|
@@ -943,18 +950,18 @@ const _e = class _e extends HTMLElement {
|
|
|
943
950
|
var e;
|
|
944
951
|
(e = this.querySelector(".nine-tab-bar")) == null || e.addEventListener("click", (s) => {
|
|
945
952
|
var o;
|
|
946
|
-
const
|
|
947
|
-
t(this,
|
|
948
|
-
}), t(this,
|
|
953
|
+
const r = s.ctrlKey || s.metaKey || s.shiftKey, n = parseInt((o = s.target.closest(".nine-tab-item")) == null ? void 0 : o.dataset.index, 10);
|
|
954
|
+
t(this, qt).call(this, n, r);
|
|
955
|
+
}), t(this, qt).call(this, 0, !1);
|
|
949
956
|
}, "#init"));
|
|
950
|
-
d(this,
|
|
951
|
-
const
|
|
957
|
+
d(this, qt, /* @__PURE__ */ h((e, s = !1) => {
|
|
958
|
+
const r = /* @__PURE__ */ h(() => {
|
|
952
959
|
const f = Array.from(this.querySelectorAll("nine-table-sheet"));
|
|
953
960
|
Array.from(this.querySelectorAll("nine-splitter")).forEach((b) => b.style.setProperty("display", "none"));
|
|
954
961
|
const g = f.filter((b) => b.classList.contains("active"));
|
|
955
962
|
g.length < 2 || g.forEach((b) => {
|
|
956
|
-
const m = parseInt(b.getAttribute("data-index"), 10), x = this.querySelector(`nine-splitter[data-split-index="${m}"]`),
|
|
957
|
-
x &&
|
|
963
|
+
const m = parseInt(b.getAttribute("data-index"), 10), x = this.querySelector(`nine-splitter[data-split-index="${m}"]`), A = f[m + 1];
|
|
964
|
+
x && A && A.classList.contains("active") && x.style.setProperty("display", "flex");
|
|
958
965
|
});
|
|
959
966
|
}, "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");
|
|
960
967
|
if (!a[e]) return;
|
|
@@ -976,36 +983,36 @@ const _e = class _e extends HTMLElement {
|
|
|
976
983
|
const l = o.querySelectorAll("nine-table-sheet.active");
|
|
977
984
|
l == null || l.forEach((f) => {
|
|
978
985
|
f.style.flex = l.length > 1 ? "1 1 0%" : "1 1 100%";
|
|
979
|
-
}),
|
|
986
|
+
}), r();
|
|
980
987
|
}, "#switchSheet"));
|
|
981
988
|
}
|
|
982
989
|
connectedCallback() {
|
|
983
990
|
t(this, Kt).call(this);
|
|
984
991
|
}
|
|
985
992
|
};
|
|
986
|
-
Kt = new WeakMap(),
|
|
993
|
+
Kt = new WeakMap(), qt = new WeakMap(), h(_e, "NineTableSheets");
|
|
987
994
|
let de = _e;
|
|
988
995
|
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", de);
|
|
989
996
|
var H, Zt, Tt, Gt;
|
|
990
997
|
const Ne = class Ne {
|
|
991
|
-
constructor(
|
|
998
|
+
constructor(i) {
|
|
992
999
|
d(this, H);
|
|
993
1000
|
d(this, Zt, /* @__PURE__ */ h(() => {
|
|
994
|
-
t(this, Gt).call(this), new ResizeObserver((
|
|
995
|
-
for (let e of
|
|
1001
|
+
t(this, Gt).call(this), new ResizeObserver((i) => {
|
|
1002
|
+
for (let e of i)
|
|
996
1003
|
t(this, H).getAttribute("auto-height") === "true" && t(this, Tt).call(this);
|
|
997
1004
|
}).observe(t(this, H));
|
|
998
1005
|
}, "#init"));
|
|
999
1006
|
d(this, Tt, /* @__PURE__ */ h(() => {
|
|
1000
1007
|
var c, l;
|
|
1001
|
-
const
|
|
1002
|
-
if (
|
|
1003
|
-
const e = parseInt(t(this, H).getAttribute("max-display-row"), 10) || 10, s = Math.max(...
|
|
1008
|
+
const i = Array.from(t(this, H).shadowRoot.querySelectorAll("nine-table-sheet.active"));
|
|
1009
|
+
if (i.length === 0) return;
|
|
1010
|
+
const e = parseInt(t(this, H).getAttribute("max-display-row"), 10) || 10, s = Math.max(...i.map((f) => f.getRowHeight())), r = (c = t(this, H).shadowRoot.querySelector("nine-table-header")) == null ? void 0 : c.getBoundingClientRect().height, n = (l = t(this, H).shadowRoot.querySelector("nine-table-sheets-footer")) == null ? void 0 : l.getBoundingClientRect().height, o = $t.SCROLLBAR_SIZE, a = e * s + r + n + o;
|
|
1004
1011
|
t(this, H).style.height = `${a}px`;
|
|
1005
1012
|
}, "#applyAutoHeight"));
|
|
1006
1013
|
d(this, Gt, /* @__PURE__ */ h(() => {
|
|
1007
|
-
const e = Array.from(t(this, H).children).filter((c) => c.tagName === "TABLE"), s = t(this, H).getAttribute("auto-height") === "true",
|
|
1008
|
-
const u = `<nine-table-sheet class="${l === 0 ? "active" : ""}" data-index="${l}"></nine-table-sheet>`, g = l <
|
|
1014
|
+
const e = Array.from(t(this, H).children).filter((c) => c.tagName === "TABLE"), s = t(this, H).getAttribute("auto-height") === "true", r = e.length, n = e.map((c, l) => {
|
|
1015
|
+
const u = `<nine-table-sheet class="${l === 0 ? "active" : ""}" data-index="${l}"></nine-table-sheet>`, g = l < r - 1 ? `<nine-splitter class="h" data-split-index="${l}"></nine-splitter>` : "";
|
|
1009
1016
|
return u + g;
|
|
1010
1017
|
}).join(""), o = e.map((c, l) => `<div class="nine-tab-item ${l === 0 ? "active" : ""}" data-index="${l}">Sheet ${l + 1}</div>`).join("");
|
|
1011
1018
|
t(this, H).shadowRoot.innerHTML = `
|
|
@@ -1123,32 +1130,32 @@ const Ne = class Ne {
|
|
|
1123
1130
|
});
|
|
1124
1131
|
});
|
|
1125
1132
|
}, "#render"));
|
|
1126
|
-
p(this, H,
|
|
1133
|
+
p(this, H, i), t(this, Zt).call(this);
|
|
1127
1134
|
}
|
|
1128
1135
|
};
|
|
1129
1136
|
H = new WeakMap(), Zt = new WeakMap(), Tt = new WeakMap(), Gt = new WeakMap(), h(Ne, "LayoutManager");
|
|
1130
1137
|
let fe = Ne;
|
|
1131
1138
|
var kt, ht;
|
|
1132
1139
|
const We = class We {
|
|
1133
|
-
constructor(
|
|
1140
|
+
constructor(i) {
|
|
1134
1141
|
d(this, kt);
|
|
1135
1142
|
d(this, ht, -1);
|
|
1136
|
-
|
|
1137
|
-
p(this, kt,
|
|
1143
|
+
E(this, "count", /* @__PURE__ */ h(() => t(this, kt).rawRecords.length, "count"));
|
|
1144
|
+
p(this, kt, i);
|
|
1138
1145
|
}
|
|
1139
1146
|
get at() {
|
|
1140
1147
|
return t(this, ht);
|
|
1141
1148
|
}
|
|
1142
|
-
set at(
|
|
1143
|
-
p(this, ht, parseInt(
|
|
1149
|
+
set at(i) {
|
|
1150
|
+
p(this, ht, parseInt(i, 10)), body && !body.querySelector(`tbody.bindable tr[data-row="${t(this, ht)}"]`) && setTimeout(() => {
|
|
1144
1151
|
});
|
|
1145
1152
|
}
|
|
1146
1153
|
};
|
|
1147
1154
|
kt = new WeakMap(), ht = new WeakMap(), h(We, "ngRow");
|
|
1148
1155
|
let ue = We;
|
|
1149
|
-
var _, k, N, dt, Jt, Y, Qt,
|
|
1156
|
+
var _, k, N, dt, Jt, Y, Qt, it, Ct, te, ee, ft;
|
|
1150
1157
|
const O = class O {
|
|
1151
|
-
constructor(
|
|
1158
|
+
constructor(i, e) {
|
|
1152
1159
|
d(this, _);
|
|
1153
1160
|
d(this, k);
|
|
1154
1161
|
d(this, N, []);
|
|
@@ -1157,34 +1164,34 @@ const O = class O {
|
|
|
1157
1164
|
d(this, Y, []);
|
|
1158
1165
|
d(this, Qt, /* @__PURE__ */ h(() => {
|
|
1159
1166
|
p(this, Y, []);
|
|
1160
|
-
const
|
|
1161
|
-
Array.from(
|
|
1167
|
+
const i = t(this, _).template || [];
|
|
1168
|
+
Array.from(i).forEach((e) => {
|
|
1162
1169
|
var s;
|
|
1163
1170
|
t(this, Y).push(((s = e.getBoundingClientRect) == null ? void 0 : s.call(e).height) || 24);
|
|
1164
1171
|
}), (t(this, k).rawRecords || []).forEach((e) => {
|
|
1165
1172
|
e.__ng || (e.__ng = t(this, Ct).call(this)), e.__ng.height = t(this, Y).slice();
|
|
1166
1173
|
});
|
|
1167
1174
|
}, "#initialize"));
|
|
1168
|
-
d(this,
|
|
1169
|
-
t(this, _).shadowRoot.querySelectorAll("nine-table-sheet").forEach((
|
|
1170
|
-
|
|
1175
|
+
d(this, it, /* @__PURE__ */ h(() => {
|
|
1176
|
+
t(this, _).shadowRoot.querySelectorAll("nine-table-sheet").forEach((i) => {
|
|
1177
|
+
i.invalidate();
|
|
1171
1178
|
});
|
|
1172
1179
|
}, "#invalidate"));
|
|
1173
|
-
|
|
1180
|
+
E(this, "get", /* @__PURE__ */ h((i, e) => {
|
|
1174
1181
|
var n;
|
|
1175
1182
|
const s = this.getValidData();
|
|
1176
1183
|
if (!s || s.length <= 0) return;
|
|
1177
|
-
if (
|
|
1178
|
-
if (
|
|
1179
|
-
const
|
|
1184
|
+
if (i == null) return t(this, ft).call(this, s);
|
|
1185
|
+
if (i < 0 || i >= s.length) return null;
|
|
1186
|
+
const r = typeof ((n = t(this, _).fields) == null ? void 0 : n.get) == "function" ? t(this, _).fields.get() : [];
|
|
1180
1187
|
if (e != null) {
|
|
1181
|
-
const o =
|
|
1182
|
-
return o >= 0 ? s[
|
|
1188
|
+
const o = r.indexOf(e);
|
|
1189
|
+
return o >= 0 ? s[i].v[o] : null;
|
|
1183
1190
|
}
|
|
1184
|
-
return t(this, ft).call(this, s[
|
|
1191
|
+
return t(this, ft).call(this, s[i]);
|
|
1185
1192
|
}, "get"));
|
|
1186
|
-
|
|
1187
|
-
this.clear(), this.add(
|
|
1193
|
+
E(this, "set", /* @__PURE__ */ h((i) => {
|
|
1194
|
+
this.clear(), this.add(i, !1), t(this, it).call(this);
|
|
1188
1195
|
}, "set"));
|
|
1189
1196
|
d(this, Ct, /* @__PURE__ */ h(() => ({
|
|
1190
1197
|
rowState: O.ROW_STATE.EMPTY,
|
|
@@ -1195,85 +1202,85 @@ const O = class O {
|
|
|
1195
1202
|
c: {},
|
|
1196
1203
|
_: [0, 0, 0, 0, O.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, t(this, Y).slice(), -1, {}, {}]
|
|
1197
1204
|
}), "#getDefaultMeta"));
|
|
1198
|
-
|
|
1199
|
-
p(this, N, []), p(this, dt, []), t(this,
|
|
1205
|
+
E(this, "reset", /* @__PURE__ */ h(() => {
|
|
1206
|
+
p(this, N, []), p(this, dt, []), t(this, it).call(this);
|
|
1200
1207
|
}, "reset"));
|
|
1201
|
-
|
|
1202
|
-
var r;
|
|
1203
|
-
t(this, k).rawRecords = [], p(this, N, []), p(this, dt, []), (r = t(this, k).viewRecords) != null && r.reset && t(this, k).viewRecords.reset();
|
|
1204
|
-
}, "clear"));
|
|
1205
|
-
d(this, te, /* @__PURE__ */ h((r) => {
|
|
1208
|
+
E(this, "clear", /* @__PURE__ */ h(() => {
|
|
1206
1209
|
var i;
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
+
t(this, k).rawRecords = [], p(this, N, []), p(this, dt, []), (i = t(this, k).viewRecords) != null && i.reset && t(this, k).viewRecords.reset();
|
|
1211
|
+
}, "clear"));
|
|
1212
|
+
d(this, te, /* @__PURE__ */ h((i) => {
|
|
1213
|
+
var r;
|
|
1214
|
+
Array.isArray(i) || (i = [i]);
|
|
1215
|
+
const e = typeof ((r = t(this, _).fields) == null ? void 0 : r.get) == "function" ? t(this, _).fields.get() : Object.keys(i[0] || {}), s = [];
|
|
1216
|
+
return i.forEach((n) => {
|
|
1210
1217
|
const o = { v: [] };
|
|
1211
1218
|
e.forEach((a) => {
|
|
1212
1219
|
o.v.push(n[a] !== void 0 && n[a] !== null ? n[a] : "");
|
|
1213
1220
|
}), s.push(o);
|
|
1214
1221
|
}), s;
|
|
1215
1222
|
}, "#json2Array"));
|
|
1216
|
-
d(this, ee, /* @__PURE__ */ h((
|
|
1223
|
+
d(this, ee, /* @__PURE__ */ h((i) => (Array.isArray(i) || (i = [i]), i.forEach((e) => {
|
|
1217
1224
|
e.__ng = t(this, Ct).call(this), e.__ng.rowid = this.nextId, e.__ng.rowState = O.ROW_STATE.INSERT, e.__ng._[0] = e.__ng.rowid;
|
|
1218
|
-
}),
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
const s = t(this, te).call(this,
|
|
1225
|
+
}), i), "#defaultInsert"));
|
|
1226
|
+
E(this, "add", /* @__PURE__ */ h((i, e = !0) => {
|
|
1227
|
+
i === void 0 && (i = {});
|
|
1228
|
+
const s = t(this, te).call(this, i);
|
|
1222
1229
|
t(this, k).rawRecords = t(this, k).rawRecords.concat(t(this, ee).call(this, s)), this.resetRecords();
|
|
1223
|
-
const
|
|
1230
|
+
const r = this.count() - 1;
|
|
1224
1231
|
return e || s.forEach((n, o) => {
|
|
1225
|
-
const a = t(this, k).rawRecords[
|
|
1232
|
+
const a = t(this, k).rawRecords[r - o];
|
|
1226
1233
|
a && (a.__ng.rowState = O.ROW_STATE.EMPTY);
|
|
1227
|
-
}), t(this,
|
|
1234
|
+
}), t(this, it).call(this), r;
|
|
1228
1235
|
}, "add"));
|
|
1229
|
-
|
|
1236
|
+
E(this, "delete", /* @__PURE__ */ h((i) => {
|
|
1230
1237
|
let e = [];
|
|
1231
|
-
Array.isArray(
|
|
1238
|
+
Array.isArray(i) ? e = i : typeof i > "u" ? e = [t(this, k).host.row.at] : e = [parseInt(i, 10)], e.sort((s, r) => r - s).forEach((s) => {
|
|
1232
1239
|
if (t(this, N)[s]) {
|
|
1233
|
-
const
|
|
1234
|
-
t(this, N)[s].__ng.rowState === O.ROW_STATE.INSERT ? t(this, k).rawRecords = t(this, k).rawRecords.filter((n) => n.__ng.rowid !==
|
|
1235
|
-
n.__ng.rowid ===
|
|
1240
|
+
const r = t(this, N)[s].__ng.rowid;
|
|
1241
|
+
t(this, N)[s].__ng.rowState === O.ROW_STATE.INSERT ? t(this, k).rawRecords = t(this, k).rawRecords.filter((n) => n.__ng.rowid !== r) : t(this, k).rawRecords.forEach((n) => {
|
|
1242
|
+
n.__ng.rowid === r && (n.__ng.deleted = !0, n.__ng.rowState = O.ROW_STATE.DELETE);
|
|
1236
1243
|
});
|
|
1237
1244
|
}
|
|
1238
|
-
}), this.resetRecords(), t(this,
|
|
1245
|
+
}), this.resetRecords(), t(this, it).call(this);
|
|
1239
1246
|
}, "delete"));
|
|
1240
|
-
|
|
1247
|
+
E(this, "setValue", /* @__PURE__ */ h((i, e, s) => {
|
|
1241
1248
|
var c;
|
|
1242
|
-
|
|
1249
|
+
i = parseInt(i, 10);
|
|
1243
1250
|
const n = (typeof ((c = t(this, _).fields) == null ? void 0 : c.get) == "function" ? t(this, _).fields.get() : []).indexOf(e);
|
|
1244
1251
|
if (n < 0) return;
|
|
1245
|
-
const o = this.getValidData()[
|
|
1252
|
+
const o = this.getValidData()[i];
|
|
1246
1253
|
if (!o) return;
|
|
1247
1254
|
const a = o.v[n];
|
|
1248
1255
|
a !== s && o.__ng.rowState !== O.ROW_STATE.INSERT && (o.__ng.o.hasOwnProperty(e) || (o.__ng.o[e] = a), o.__ng.rowState = O.ROW_STATE.UPDATE), o.v[n] = s;
|
|
1249
1256
|
}, "setValue"));
|
|
1250
|
-
|
|
1251
|
-
p(this, dt, t(this, k).rawRecords.filter((
|
|
1252
|
-
|
|
1253
|
-
}), t(this, N).forEach((
|
|
1254
|
-
|
|
1257
|
+
E(this, "resetRecords", /* @__PURE__ */ h(() => {
|
|
1258
|
+
p(this, dt, t(this, k).rawRecords.filter((i) => !i.__ng.deleted)), p(this, N, t(this, k).rawRecords.filter((i) => !i.__ng.deleted && !i.__ng.filtered)), t(this, k).rawRecords.forEach((i, e) => {
|
|
1259
|
+
i.__ng.rowidx = e;
|
|
1260
|
+
}), t(this, N).forEach((i, e) => {
|
|
1261
|
+
i.__ng.i = e;
|
|
1255
1262
|
});
|
|
1256
1263
|
}, "resetRecords"));
|
|
1257
|
-
|
|
1258
|
-
d(this, ft, /* @__PURE__ */ h((
|
|
1264
|
+
E(this, "getValidData", /* @__PURE__ */ h(() => (t(this, N).length === 0 && t(this, k).rawRecords.length > 0 && this.resetRecords(), t(this, N)), "getValidData"));
|
|
1265
|
+
d(this, ft, /* @__PURE__ */ h((i) => {
|
|
1259
1266
|
var o;
|
|
1260
|
-
if (!
|
|
1261
|
-
const e = !Array.isArray(
|
|
1267
|
+
if (!i) return i;
|
|
1268
|
+
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) => {
|
|
1262
1269
|
const c = {};
|
|
1263
|
-
return
|
|
1270
|
+
return r.forEach((l, f) => {
|
|
1264
1271
|
c[l] = a.v ? a.v[f] : a[l];
|
|
1265
1272
|
}), c.__ng = a.__ng, c;
|
|
1266
1273
|
});
|
|
1267
1274
|
return e ? n[0] : n;
|
|
1268
1275
|
}, "#conv"));
|
|
1269
|
-
|
|
1270
|
-
p(this, _,
|
|
1276
|
+
E(this, "count", /* @__PURE__ */ h(() => this.getValidData().length, "count"));
|
|
1277
|
+
p(this, _, i), p(this, k, e), t(this, Qt).call(this);
|
|
1271
1278
|
}
|
|
1272
1279
|
get source() {
|
|
1273
1280
|
return t(this, ft).call(this, t(this, k).rawRecords);
|
|
1274
1281
|
}
|
|
1275
|
-
set source(
|
|
1276
|
-
this.clear(), this.add(
|
|
1282
|
+
set source(i) {
|
|
1283
|
+
this.clear(), this.add(i, !1);
|
|
1277
1284
|
}
|
|
1278
1285
|
get nextId() {
|
|
1279
1286
|
return ++Ue(this, Jt)._;
|
|
@@ -1288,8 +1295,8 @@ const O = class O {
|
|
|
1288
1295
|
return this.length;
|
|
1289
1296
|
}
|
|
1290
1297
|
};
|
|
1291
|
-
_ = new WeakMap(), k = new WeakMap(), N = new WeakMap(), dt = new WeakMap(), Jt = new WeakMap(), Y = new WeakMap(), Qt = new WeakMap(),
|
|
1292
|
-
|
|
1298
|
+
_ = new WeakMap(), k = new WeakMap(), N = new WeakMap(), dt = new WeakMap(), Jt = new WeakMap(), Y = new WeakMap(), Qt = new WeakMap(), it = new WeakMap(), Ct = new WeakMap(), te = new WeakMap(), ee = new WeakMap(), ft = new WeakMap(), h(O, "ngData"), // π― ν μν μ μ μμλ₯Ό ν΄λμ€ λ΄λΆλ‘ λ΄μ¬ν
|
|
1299
|
+
E(O, "ROW_STATE", {
|
|
1293
1300
|
EMPTY: "EMPTY",
|
|
1294
1301
|
NORMAL: "NORMAL",
|
|
1295
1302
|
INSERT: "INSERT",
|
|
@@ -1297,56 +1304,56 @@ A(O, "ROW_STATE", {
|
|
|
1297
1304
|
DELETE: "DELETE"
|
|
1298
1305
|
});
|
|
1299
1306
|
let ge = O;
|
|
1300
|
-
var
|
|
1307
|
+
var rt;
|
|
1301
1308
|
const Oe = class Oe {
|
|
1302
|
-
constructor(
|
|
1303
|
-
d(this,
|
|
1304
|
-
p(this,
|
|
1309
|
+
constructor(i) {
|
|
1310
|
+
d(this, rt);
|
|
1311
|
+
p(this, rt, i), this.row = new ue(this), this.data = new ge(t(this, rt), this), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.pageCnt = 25, this.viewRecords.reset = () => {
|
|
1305
1312
|
var e;
|
|
1306
|
-
(e = t(this,
|
|
1313
|
+
(e = t(this, rt).view) != null && e.redraw && t(this, rt).view.redraw();
|
|
1307
1314
|
}, this.setDataSource = (e) => {
|
|
1308
1315
|
this.data && this.data.reset(), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.data.set(e || []);
|
|
1309
1316
|
}, this.getRowState = (e) => {
|
|
1310
|
-
var
|
|
1317
|
+
var r, n;
|
|
1311
1318
|
const s = parseInt(e, 10);
|
|
1312
1319
|
if (!(s >= this.data.count()))
|
|
1313
|
-
return (n = (
|
|
1320
|
+
return (n = (r = this.data.getValidData()[s]) == null ? void 0 : r.__ng) == null ? void 0 : n.rowState;
|
|
1314
1321
|
}, this.getRowPosition = () => this.row.at, this.setRowPosition = (e) => {
|
|
1315
1322
|
this.row.at = e;
|
|
1316
|
-
}, 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, s) => this.data.get(e, s), this.setColumn = (e, s,
|
|
1317
|
-
e = parseInt(e, 10), this.data.setValue(e, s,
|
|
1323
|
+
}, 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, s) => this.data.get(e, s), this.setColumn = (e, s, r) => {
|
|
1324
|
+
e = parseInt(e, 10), this.data.setValue(e, s, r);
|
|
1318
1325
|
}, this.setDataSource([]);
|
|
1319
1326
|
}
|
|
1320
1327
|
};
|
|
1321
|
-
|
|
1328
|
+
rt = new WeakMap(), h(Oe, "ngDataManager");
|
|
1322
1329
|
let be = Oe;
|
|
1323
1330
|
var ut, L, Lt, se;
|
|
1324
1331
|
const Be = class Be {
|
|
1325
1332
|
// π― μ΄μ { name: string, type: string } κ°μ²΄λ€μ λ°°μ΄λ‘ κ΄λ¦¬ν©λλ€.
|
|
1326
|
-
constructor(
|
|
1333
|
+
constructor(i) {
|
|
1327
1334
|
d(this, ut);
|
|
1328
1335
|
d(this, L, []);
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
t(this, L).some((
|
|
1336
|
+
E(this, "add", /* @__PURE__ */ h((i, e = "string") => {
|
|
1337
|
+
i.forEach((s) => {
|
|
1338
|
+
t(this, L).some((r) => r.name === s) || t(this, L).push({ name: s, type: e });
|
|
1332
1339
|
}), t(this, Lt).call(this);
|
|
1333
1340
|
}, "add"));
|
|
1334
1341
|
d(this, Lt, /* @__PURE__ */ h(() => {
|
|
1335
|
-
const
|
|
1342
|
+
const i = /* @__PURE__ */ new Map();
|
|
1336
1343
|
t(this, L).forEach((e) => {
|
|
1337
|
-
|
|
1338
|
-
}), p(this, L, Array.from(
|
|
1344
|
+
i.set(e.name, e.type);
|
|
1345
|
+
}), p(this, L, Array.from(i, ([e, s]) => ({ name: e, type: s }))), p(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);
|
|
1339
1346
|
}, "#adjust"));
|
|
1340
1347
|
d(this, se, /* @__PURE__ */ h(() => {
|
|
1341
1348
|
p(this, L, []), W.log(t(this, ut).querySelectorAll("table"));
|
|
1342
|
-
const
|
|
1343
|
-
if (!(!
|
|
1344
|
-
for (const e of
|
|
1345
|
-
W.log(e), $("[data-bind]", e).each((s,
|
|
1346
|
-
const n =
|
|
1349
|
+
const i = Array.from(t(this, ut).querySelectorAll("table"));
|
|
1350
|
+
if (!(!i || i.length === 0)) {
|
|
1351
|
+
for (const e of i)
|
|
1352
|
+
W.log(e), $("[data-bind]", e).each((s, r) => {
|
|
1353
|
+
const n = r.dataset.bind, o = r.getAttribute("data-type") || "string";
|
|
1347
1354
|
n && t(this, L).push({ name: n, type: o });
|
|
1348
1355
|
}), ["data-expr", "background-color", "color", "tooltip", "visible", "readonly", "enable-button", "enable-check", "class-expr", "icon-color", "icon-src"].forEach((s) => {
|
|
1349
|
-
$(`[${s}]`, e).each((
|
|
1356
|
+
$(`[${s}]`, e).each((r, n) => {
|
|
1350
1357
|
var o = n.getAttribute(s);
|
|
1351
1358
|
if (o.indexOf("data.") < 0) {
|
|
1352
1359
|
const a = o.search(/[(]/g);
|
|
@@ -1369,44 +1376,44 @@ const Be = class Be {
|
|
|
1369
1376
|
t(this, Lt).call(this);
|
|
1370
1377
|
}
|
|
1371
1378
|
}, "#init"));
|
|
1372
|
-
p(this, ut,
|
|
1379
|
+
p(this, ut, i), t(this, se).call(this);
|
|
1373
1380
|
}
|
|
1374
1381
|
// π― κΈ°μ‘΄μ νλ μ΄λ¦λ§ μ°λ κ³³λ€κ³Όμ νΈνμ μν΄ μ΄λ¦ λ°°μ΄λ§ 리ν΄νλ λ©μλ μ μ§
|
|
1375
1382
|
get() {
|
|
1376
|
-
return t(this, L).map((
|
|
1383
|
+
return t(this, L).map((i) => i.name);
|
|
1377
1384
|
}
|
|
1378
1385
|
// π― λ΄λΆ κ°μ²΄ ν΅μ§Έλ‘ μ»κΈ°
|
|
1379
1386
|
getFields() {
|
|
1380
1387
|
return t(this, L);
|
|
1381
1388
|
}
|
|
1382
1389
|
// π― νΉμ νλμ λ°μ΄ν° νμ
μ‘°ν
|
|
1383
|
-
getType(
|
|
1384
|
-
const e = t(this, L).find((s) => s.name ===
|
|
1390
|
+
getType(i) {
|
|
1391
|
+
const e = t(this, L).find((s) => s.name === i);
|
|
1385
1392
|
return e ? e.type : "string";
|
|
1386
1393
|
}
|
|
1387
|
-
indexOf(
|
|
1388
|
-
return t(this, L).findIndex((e) => e.name ===
|
|
1394
|
+
indexOf(i) {
|
|
1395
|
+
return t(this, L).findIndex((e) => e.name === i);
|
|
1389
1396
|
}
|
|
1390
|
-
includes(
|
|
1391
|
-
return t(this, L).some((e) => e.name ===
|
|
1397
|
+
includes(i) {
|
|
1398
|
+
return t(this, L).some((e) => e.name === i);
|
|
1392
1399
|
}
|
|
1393
1400
|
};
|
|
1394
1401
|
ut = new WeakMap(), L = new WeakMap(), Lt = new WeakMap(), se = new WeakMap(), h(Be, "ngFields");
|
|
1395
1402
|
let pe = Be;
|
|
1396
|
-
var nt,
|
|
1397
|
-
const
|
|
1403
|
+
var nt, ie, re;
|
|
1404
|
+
const ze = class ze extends HTMLElement {
|
|
1398
1405
|
constructor() {
|
|
1399
1406
|
super();
|
|
1400
1407
|
//#created = false;
|
|
1401
1408
|
d(this, nt);
|
|
1402
|
-
d(this,
|
|
1403
|
-
d(this,
|
|
1404
|
-
this.fields = new pe(this), p(this,
|
|
1409
|
+
d(this, ie);
|
|
1410
|
+
d(this, re, /* @__PURE__ */ h(() => {
|
|
1411
|
+
this.fields = new pe(this), p(this, ie, new fe(this)), W.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
|
|
1405
1412
|
}, "#init"));
|
|
1406
1413
|
this.attachShadow({ mode: "open" }), p(this, nt, new be(this));
|
|
1407
1414
|
}
|
|
1408
1415
|
connectedCallback() {
|
|
1409
|
-
t(this,
|
|
1416
|
+
t(this, re).call(this);
|
|
1410
1417
|
}
|
|
1411
1418
|
disconnectedCallback() {
|
|
1412
1419
|
W.log("NineTable disconnected.");
|
|
@@ -1424,8 +1431,8 @@ const Pe = class Pe extends HTMLElement {
|
|
|
1424
1431
|
return t(this, nt);
|
|
1425
1432
|
}
|
|
1426
1433
|
};
|
|
1427
|
-
nt = new WeakMap(),
|
|
1428
|
-
let ye =
|
|
1434
|
+
nt = new WeakMap(), ie = new WeakMap(), re = new WeakMap(), h(ze, "NineTable");
|
|
1435
|
+
let ye = ze;
|
|
1429
1436
|
customElements.get("nine-table") || customElements.define("nine-table", ye);
|
|
1430
1437
|
const mt = class mt extends HTMLElement {
|
|
1431
1438
|
// π 컀μ€ν
μ€νμΌμ© μΊμ μΆκ°
|
|
@@ -1438,29 +1445,29 @@ const mt = class mt extends HTMLElement {
|
|
|
1438
1445
|
connectedCallback() {
|
|
1439
1446
|
}
|
|
1440
1447
|
};
|
|
1441
|
-
h(mt, "BasicCellElement"),
|
|
1448
|
+
h(mt, "BasicCellElement"), E(mt, "_styleCache", /* @__PURE__ */ new Map()), E(mt, "_customStyleCache", /* @__PURE__ */ new Map());
|
|
1442
1449
|
let me = mt;
|
|
1443
|
-
var C, Ht, y,
|
|
1444
|
-
const
|
|
1450
|
+
var C, Ht, y, Re, qe, Te, ke, Ce;
|
|
1451
|
+
const De = class De extends me {
|
|
1445
1452
|
constructor() {
|
|
1446
1453
|
super();
|
|
1447
1454
|
d(this, C);
|
|
1448
1455
|
d(this, Ht);
|
|
1449
1456
|
d(this, y);
|
|
1450
|
-
d(this, qe);
|
|
1451
1457
|
d(this, Re);
|
|
1458
|
+
d(this, qe);
|
|
1452
1459
|
d(this, Te);
|
|
1453
1460
|
d(this, ke);
|
|
1454
|
-
|
|
1461
|
+
E(this, "getDisplayText", /* @__PURE__ */ h((e) => {
|
|
1455
1462
|
if (t(this, y))
|
|
1456
1463
|
if (t(this, y).closest("tbody")) {
|
|
1457
|
-
const s = t(this, y).closest("tr").data,
|
|
1464
|
+
const s = t(this, y).closest("tr").data, r = parseInt(t(this, y).dataset.row);
|
|
1458
1465
|
if (!s) return "";
|
|
1459
1466
|
if (ninegrid.isNull(t(this, y).dataset.expr)) {
|
|
1460
1467
|
if (!ninegrid.isNull(t(this, y).dataset.bind))
|
|
1461
1468
|
return s[t(this, y).dataset.bind] || ninegrid.nvl(e, "");
|
|
1462
1469
|
} else try {
|
|
1463
|
-
return this.getExprValue(t(this, y).dataset.expr, s,
|
|
1470
|
+
return this.getExprValue(t(this, y).dataset.expr, s, r, t(this, y));
|
|
1464
1471
|
} catch {
|
|
1465
1472
|
console.error(t(this, y).dataset.expr, s, t(this, y).dataset.row);
|
|
1466
1473
|
}
|
|
@@ -1475,14 +1482,14 @@ const ze = class ze extends me {
|
|
|
1475
1482
|
if (!(!t(this, C) || !t(this, C).template || !t(this, y).closest("tbody.bindable"))) {
|
|
1476
1483
|
var e = ninegrid.j.querySelectorAll(t(this, y)).attr("suppress");
|
|
1477
1484
|
if (e && (e = parseInt(e)), e && !isNaN(e)) {
|
|
1478
|
-
var s = t(this, y).closest("tr"),
|
|
1485
|
+
var s = t(this, y).closest("tr"), r = [];
|
|
1479
1486
|
$("th,td", s).each((v, M) => {
|
|
1480
1487
|
var T = ninegrid.j.querySelectorAll(M).attr("suppress");
|
|
1481
|
-
T && M.dataset.row && (T = parseInt(T), !isNaN(T) && T <= e &&
|
|
1482
|
-
}),
|
|
1488
|
+
T && M.dataset.row && (T = parseInt(T), !isNaN(T) && T <= e && r.push(T));
|
|
1489
|
+
}), r.sort();
|
|
1483
1490
|
var n = !1;
|
|
1484
1491
|
if (parseInt(s.sectionRowIndex / t(this, C).template.length) > 0)
|
|
1485
|
-
for (var o of
|
|
1492
|
+
for (var o of r) {
|
|
1486
1493
|
if (o > e) break;
|
|
1487
1494
|
var a = parseInt(t(this, y).dataset.row), c = a - 1, l = t(this, y).closest("tr").data, f = t(this, C).data.get(c);
|
|
1488
1495
|
t(this, y).dataset.matrixRow;
|
|
@@ -1495,17 +1502,17 @@ const ze = class ze extends me {
|
|
|
1495
1502
|
else
|
|
1496
1503
|
n = !0;
|
|
1497
1504
|
n ? ninegrid.j.querySelectorAll(t(this, y)).removeClass("suppress") : ninegrid.j.querySelectorAll(t(this, y)).addClass("suppress"), ninegrid.j.querySelectorAll(t(this, y)).hasClass("hidden") || (n ? ninegrid.j.querySelectorAll(t(this, y)).removeClass("hidden") : ninegrid.j.querySelectorAll(t(this, y)).addClass("hidden"));
|
|
1498
|
-
var m = parseInt(t(this, y).dataset.matrixRow), x = m - 1,
|
|
1499
|
-
$(
|
|
1505
|
+
var m = parseInt(t(this, y).dataset.matrixRow), x = m - 1, A = t(this, C).body.querySelector(`tbody.bindable [data-col="${t(this, y).dataset.col}"][data-matrix-row="${x}"]`);
|
|
1506
|
+
$(A).hasClass("suppress") && !ninegrid.j.querySelectorAll(t(this, y)).hasClass("suppress") ? ninegrid.j.querySelectorAll(A).removeClass("last-none-suppress").addClass("last-suppress") : !$(A).hasClass("suppress") && ninegrid.j.querySelectorAll(t(this, y)).hasClass("suppress") ? ninegrid.j.querySelectorAll(A).removeClass("last-suppress").addClass("last-none-suppress") : ninegrid.j.querySelectorAll(A).removeClass("last-none-suppress").removeClass("last-suppress");
|
|
1500
1507
|
}
|
|
1501
1508
|
}
|
|
1502
1509
|
}, "#resetSuppress"));
|
|
1503
|
-
|
|
1510
|
+
E(this, "getExprValue", /* @__PURE__ */ h((e, s, r, n) => {
|
|
1504
1511
|
if (typeof e < "u")
|
|
1505
1512
|
try {
|
|
1506
|
-
|
|
1513
|
+
r = parseInt(r);
|
|
1507
1514
|
const o = e.replace("()", "");
|
|
1508
|
-
return t(this, C)[o] ? t(this, C)[o].call(this, s,
|
|
1515
|
+
return t(this, C)[o] ? t(this, C)[o].call(this, s, r, t(this, y)) : t(this, C).exprFunction(e).call(this, s, r, t(this, C).data);
|
|
1509
1516
|
} catch {
|
|
1510
1517
|
return ["NG-COMBO"].includes(this.tagName) ? "" : e;
|
|
1511
1518
|
}
|
|
@@ -1522,8 +1529,8 @@ const ze = class ze extends me {
|
|
|
1522
1529
|
}
|
|
1523
1530
|
set value(e) {
|
|
1524
1531
|
var s = parseInt(t(this, y).dataset.row);
|
|
1525
|
-
const
|
|
1526
|
-
s < 0 ? t(this, C).data.setValueNF(parseInt(t(this, y).dataset.index), t(this, y).dataset.bind, e,
|
|
1532
|
+
const r = this.getAttribute("update-row-state") != "false";
|
|
1533
|
+
s < 0 ? t(this, C).data.setValueNF(parseInt(t(this, y).dataset.index), t(this, y).dataset.bind, e, r) : t(this, C).data.setValue(s, t(this, y).dataset.bind, e, r);
|
|
1527
1534
|
}
|
|
1528
1535
|
get row() {
|
|
1529
1536
|
return parseInt(t(this, y).dataset.row);
|
|
@@ -1536,9 +1543,9 @@ const ze = class ze extends me {
|
|
|
1536
1543
|
return parseInt(t(this, y).dataset.row), t(this, Ht).data[e];
|
|
1537
1544
|
}
|
|
1538
1545
|
};
|
|
1539
|
-
C = new WeakMap(), Ht = new WeakMap(), y = new WeakMap(),
|
|
1540
|
-
let ve =
|
|
1541
|
-
const
|
|
1546
|
+
C = new WeakMap(), Ht = new WeakMap(), y = new WeakMap(), Re = new WeakMap(), qe = new WeakMap(), Te = new WeakMap(), ke = new WeakMap(), Ce = new WeakMap(), h(De, "CellElement");
|
|
1547
|
+
let ve = De;
|
|
1548
|
+
const Pe = class Pe extends ve {
|
|
1542
1549
|
constructor() {
|
|
1543
1550
|
super();
|
|
1544
1551
|
}
|
|
@@ -1549,8 +1556,8 @@ const De = class De extends ve {
|
|
|
1549
1556
|
return super.refresh();
|
|
1550
1557
|
}
|
|
1551
1558
|
};
|
|
1552
|
-
h(
|
|
1553
|
-
let xe =
|
|
1559
|
+
h(Pe, "EditableCellElement");
|
|
1560
|
+
let xe = Pe;
|
|
1554
1561
|
var Mt, ot, gt, bt, ne, U, Le;
|
|
1555
1562
|
const je = class je extends xe {
|
|
1556
1563
|
constructor() {
|
|
@@ -1561,7 +1568,7 @@ const je = class je extends xe {
|
|
|
1561
1568
|
d(this, bt);
|
|
1562
1569
|
d(this, ne);
|
|
1563
1570
|
d(this, U);
|
|
1564
|
-
|
|
1571
|
+
E(this, "refresh", /* @__PURE__ */ h(() => {
|
|
1565
1572
|
const e = super.refresh();
|
|
1566
1573
|
t(this, Mt).value = e;
|
|
1567
1574
|
}, "refresh"));
|
|
@@ -1600,9 +1607,9 @@ const je = class je extends xe {
|
|
|
1600
1607
|
if (t(this, ot) == "number") {
|
|
1601
1608
|
let n = [];
|
|
1602
1609
|
if (t(this, U) && Number(t(this, U)) > 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, U) && (e.keyCode >= 48 && e.keyCode <= 57 || e.keyCode >= 96 && e.keyCode <= 105) && e.target.selectionStart == e.target.selectionEnd) {
|
|
1603
|
-
var s = e.target.value,
|
|
1604
|
-
if (
|
|
1605
|
-
var s = s.substr(
|
|
1610
|
+
var s = e.target.value, r = s.indexOf(".");
|
|
1611
|
+
if (r >= 0) {
|
|
1612
|
+
var s = s.substr(r + 1, s.length);
|
|
1606
1613
|
s.length >= Number(t(this, U)) && e.preventDefault();
|
|
1607
1614
|
}
|
|
1608
1615
|
}
|