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