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