@ninebone/table 0.0.252 β 0.0.254
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 +122 -122
- package/dist/nine-table.js.map +1 -1
- package/dist/nine-table.umd.js +4 -4
- package/dist/nine-table.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/nine-table.js
CHANGED
|
@@ -4,7 +4,7 @@ var Oe = (m) => {
|
|
|
4
4
|
};
|
|
5
5
|
var Ne = (m, i, t) => i in m ? ze(m, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : m[i] = t;
|
|
6
6
|
var h = (m, i) => ze(m, "name", { value: i, configurable: !0 });
|
|
7
|
-
var
|
|
7
|
+
var x = (m, i, t) => Ne(m, typeof i != "symbol" ? i + "" : i, t), Be = (m, i, t) => i.has(m) || Oe("Cannot " + t);
|
|
8
8
|
var e = (m, i, t) => (Be(m, i, "read from private field"), t ? t.call(m) : i.get(m)), u = (m, i, t) => i.has(m) ? Oe("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(m) : i.set(m, t), y = (m, i, t, s) => (Be(m, i, "write to private field"), s ? s.call(m, t) : i.set(m, t), t);
|
|
9
9
|
var De = (m, i, t, s) => ({
|
|
10
10
|
set _(n) {
|
|
@@ -22,26 +22,26 @@ const qe = class qe extends Pe.constructor {
|
|
|
22
22
|
};
|
|
23
23
|
h(qe, "Trace");
|
|
24
24
|
let me = qe;
|
|
25
|
-
const
|
|
26
|
-
var C,
|
|
25
|
+
const Y = new me();
|
|
26
|
+
var C, O, p, B, D, N, ie, P, se;
|
|
27
27
|
const ke = class ke extends HTMLElement {
|
|
28
28
|
constructor() {
|
|
29
29
|
super();
|
|
30
30
|
u(this, C);
|
|
31
|
-
u(this,
|
|
31
|
+
u(this, O, !1);
|
|
32
32
|
u(this, p);
|
|
33
|
+
u(this, B);
|
|
33
34
|
u(this, D);
|
|
34
35
|
u(this, N);
|
|
35
|
-
u(this, P);
|
|
36
36
|
u(this, ie, /* @__PURE__ */ h(() => {
|
|
37
37
|
if (!e(this, C)) return;
|
|
38
38
|
const t = e(this, C).querySelector(".ng-container-body");
|
|
39
|
-
t && (y(this,
|
|
39
|
+
t && (y(this, N, new ResizeObserver(() => {
|
|
40
40
|
this.refresh();
|
|
41
|
-
})), e(this,
|
|
41
|
+
})), e(this, N).observe(t));
|
|
42
42
|
}, "#observeResize"));
|
|
43
|
-
|
|
44
|
-
if (!e(this, C) || !e(this, p) || e(this,
|
|
43
|
+
x(this, "refresh", /* @__PURE__ */ h(() => {
|
|
44
|
+
if (!e(this, C) || !e(this, p) || e(this, O)) return;
|
|
45
45
|
const t = e(this, p).container, s = t.querySelector("table");
|
|
46
46
|
if (!s) return;
|
|
47
47
|
const n = e(this, p).track, r = e(this, p).thumb, o = e(this, C).querySelector(".ng-container-bottom"), a = t.clientWidth, d = s.scrollWidth;
|
|
@@ -59,9 +59,9 @@ const ke = class ke extends HTMLElement {
|
|
|
59
59
|
let b = 0;
|
|
60
60
|
g > 0 && (b = parseInt(f / g * (l - c), 10)), b < 0 && (b = 0);
|
|
61
61
|
const S = l - c;
|
|
62
|
-
b > S && (b = S), r.style.left = `${b}px`,
|
|
62
|
+
b > S && (b = S), r.style.left = `${b}px`, Y.log(b), e(this, p).left.disabled = b === 0, e(this, p).right.disabled = b >= S - 1;
|
|
63
63
|
}, "refresh"));
|
|
64
|
-
u(this,
|
|
64
|
+
u(this, P, /* @__PURE__ */ h((t) => {
|
|
65
65
|
if (!e(this, p)) return !1;
|
|
66
66
|
const s = e(this, p).container, n = s.querySelector("table");
|
|
67
67
|
if (!n) return !1;
|
|
@@ -76,16 +76,16 @@ const ke = class ke extends HTMLElement {
|
|
|
76
76
|
}, "#thumbMoveTo"));
|
|
77
77
|
u(this, se, /* @__PURE__ */ h(() => {
|
|
78
78
|
const t = /* @__PURE__ */ h((n) => {
|
|
79
|
-
clearInterval(e(this,
|
|
79
|
+
clearInterval(e(this, B)), clearInterval(e(this, D));
|
|
80
80
|
const r = parseInt(e(this, p).thumb.style.left || 0, 10);
|
|
81
|
-
e(this,
|
|
82
|
-
clearInterval(e(this,
|
|
81
|
+
e(this, P).call(this, r + n), y(this, B, setInterval(() => {
|
|
82
|
+
clearInterval(e(this, B)), y(this, D, setInterval(() => {
|
|
83
83
|
const o = parseInt(e(this, p).thumb.style.left || 0, 10);
|
|
84
|
-
e(this,
|
|
84
|
+
e(this, P).call(this, o + n) || clearInterval(e(this, D));
|
|
85
85
|
}, 50));
|
|
86
86
|
}, 500));
|
|
87
87
|
}, "delayScroll"), s = /* @__PURE__ */ h(() => {
|
|
88
|
-
clearInterval(e(this,
|
|
88
|
+
clearInterval(e(this, B)), clearInterval(e(this, D));
|
|
89
89
|
}, "clearTimer");
|
|
90
90
|
["mouseup", "mouseleave", "touchend"].forEach((n) => {
|
|
91
91
|
e(this, p).left.addEventListener(n, s), e(this, p).right.addEventListener(n, s), e(this, p).track.addEventListener(n, s);
|
|
@@ -97,16 +97,16 @@ const ke = class ke extends HTMLElement {
|
|
|
97
97
|
if (n.button !== 0) return;
|
|
98
98
|
n.preventDefault();
|
|
99
99
|
const r = e(this, p).track.getBoundingClientRect(), o = e(this, p).thumb.clientWidth;
|
|
100
|
-
e(this,
|
|
100
|
+
e(this, P).call(this, n.clientX - r.left - o / 2);
|
|
101
101
|
}), e(this, p).thumb.addEventListener("mousedown", (n) => {
|
|
102
102
|
if (n.button !== 0) return;
|
|
103
|
-
n.stopPropagation(), n.preventDefault(), y(this,
|
|
103
|
+
n.stopPropagation(), n.preventDefault(), y(this, O, !0), this.shiftX = n.clientX - e(this, p).thumb.getBoundingClientRect().left;
|
|
104
104
|
const r = /* @__PURE__ */ h((a) => {
|
|
105
|
-
if (!e(this,
|
|
105
|
+
if (!e(this, O)) return;
|
|
106
106
|
const d = e(this, p).track.getBoundingClientRect();
|
|
107
|
-
e(this,
|
|
107
|
+
e(this, P).call(this, a.clientX - d.left - this.shiftX);
|
|
108
108
|
}, "onMouseMove"), o = /* @__PURE__ */ h(() => {
|
|
109
|
-
y(this,
|
|
109
|
+
y(this, O, !1), s(), document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", o), this.refresh();
|
|
110
110
|
}, "onMouseUp");
|
|
111
111
|
document.addEventListener("mousemove", r), document.addEventListener("mouseup", o);
|
|
112
112
|
});
|
|
@@ -194,22 +194,22 @@ const ke = class ke extends HTMLElement {
|
|
|
194
194
|
t();
|
|
195
195
|
}
|
|
196
196
|
disconnectedCallback() {
|
|
197
|
-
e(this,
|
|
197
|
+
e(this, N) && e(this, N).disconnect();
|
|
198
198
|
}
|
|
199
199
|
};
|
|
200
|
-
C = new WeakMap(),
|
|
200
|
+
C = new WeakMap(), O = new WeakMap(), p = new WeakMap(), B = new WeakMap(), D = new WeakMap(), N = new WeakMap(), ie = new WeakMap(), P = new WeakMap(), se = new WeakMap(), h(ke, "NineTableHScrollBar");
|
|
201
201
|
let we = ke;
|
|
202
202
|
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", we);
|
|
203
|
-
var
|
|
203
|
+
var M, _, R, $, I, H, ne, re, oe, le;
|
|
204
204
|
const Le = class Le {
|
|
205
205
|
constructor(i) {
|
|
206
|
-
u(this,
|
|
207
|
-
u(this,
|
|
206
|
+
u(this, M);
|
|
207
|
+
u(this, _, []);
|
|
208
208
|
u(this, R, null);
|
|
209
|
-
u(this,
|
|
209
|
+
u(this, $, null);
|
|
210
|
+
u(this, I, 0);
|
|
210
211
|
u(this, H, 0);
|
|
211
|
-
|
|
212
|
-
v(this, "getRowHeight", /* @__PURE__ */ h(() => e(this, R), "getRowHeight"));
|
|
212
|
+
x(this, "getRowHeight", /* @__PURE__ */ h(() => e(this, R), "getRowHeight"));
|
|
213
213
|
u(this, ne, /* @__PURE__ */ h(() => {
|
|
214
214
|
e(this, re).call(this);
|
|
215
215
|
}, "#init"));
|
|
@@ -217,7 +217,7 @@ const Le = class Le {
|
|
|
217
217
|
* π― λ·°ν¬νΈ ν¬κΈ° λ³ν μμ μ λμ΄ κ³μ° λ° νμν ν κ°μ μ°μ Β·μΊμ±μ μκ²°
|
|
218
218
|
*/
|
|
219
219
|
u(this, re, /* @__PURE__ */ h(() => {
|
|
220
|
-
!e(this,
|
|
220
|
+
!e(this, M) || !(e(this, M) instanceof HTMLElement) || (y(this, $, new ResizeObserver((i) => {
|
|
221
221
|
for (const t of i) {
|
|
222
222
|
const s = t.target;
|
|
223
223
|
if (!s.classList.contains("active"))
|
|
@@ -229,33 +229,33 @@ const Le = class Le {
|
|
|
229
229
|
const a = s.querySelector(".ng-container-body") || s, d = a.querySelector("thead"), l = a.querySelector("tfoot");
|
|
230
230
|
d && (o += d.offsetHeight || d.getBoundingClientRect().height), l && (o += l.offsetHeight || l.getBoundingClientRect().height);
|
|
231
231
|
const c = Math.max(r - o, 100);
|
|
232
|
-
if (e(this,
|
|
233
|
-
const f = Math.ceil(e(this,
|
|
234
|
-
y(this,
|
|
232
|
+
if (e(this, I) !== c && (y(this, I, c), e(this, R) !== null)) {
|
|
233
|
+
const f = Math.ceil(e(this, I) / e(this, R));
|
|
234
|
+
y(this, H, f + 20), Y.log(`[RowManager] Resized. Height: ${e(this, I)}px | Target Rows: ${e(this, H)}`), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((g) => {
|
|
235
235
|
const b = s.querySelector(g);
|
|
236
236
|
b && b.querySelector("tbody") && e(this, le).call(this, b);
|
|
237
237
|
});
|
|
238
238
|
}
|
|
239
239
|
}
|
|
240
240
|
}
|
|
241
|
-
})), e(this,
|
|
241
|
+
})), e(this, $).observe(e(this, M)));
|
|
242
242
|
}, "#initResizeObserver"));
|
|
243
243
|
// π― ν
νλ¦Ώ μΆμΆ, λμ΄ μΈ‘μ , μ΄κΈ° λ λλ§μ μμμ λ§κ² λ΄λΆμμ μΌκ΄ μ²λ¦¬
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
const t = e(this,
|
|
247
|
-
y(this,
|
|
244
|
+
x(this, "initialize", /* @__PURE__ */ h((i) => {
|
|
245
|
+
Y.log(i);
|
|
246
|
+
const t = e(this, M).querySelector(".ng-container-body"), s = i.querySelector("tbody"), n = Array.from(s.querySelectorAll("tr"));
|
|
247
|
+
y(this, _, n.map((r) => r.cloneNode(!0))), y(this, R, null), e(this, oe).call(this, t);
|
|
248
248
|
}, "initialize"));
|
|
249
249
|
u(this, oe, /* @__PURE__ */ h((i) => {
|
|
250
250
|
if (e(this, R) !== null && e(this, R) > 0)
|
|
251
251
|
return e(this, R);
|
|
252
|
-
if (e(this,
|
|
252
|
+
if (e(this, _).length === 0)
|
|
253
253
|
throw new Error("[RowManager] Template TRs are empty.");
|
|
254
254
|
const t = i.querySelector("tbody.bindable") || i.querySelector("tbody");
|
|
255
255
|
if (!t) return 24;
|
|
256
256
|
t.querySelectorAll("tr:not(.nodata)").forEach((f) => f.remove());
|
|
257
257
|
const s = t.querySelector("tr.nodata"), n = document.createDocumentFragment();
|
|
258
|
-
e(this,
|
|
258
|
+
e(this, _).forEach((f) => {
|
|
259
259
|
n.appendChild(f.cloneNode(!0));
|
|
260
260
|
}), s ? s.before(n) : t.appendChild(n);
|
|
261
261
|
const r = i.closest("nine-table-sheet"), o = r ? r.style.display : "", a = r ? r.style.visibility : "", d = r ? r.style.position : "";
|
|
@@ -264,12 +264,12 @@ const Le = class Le {
|
|
|
264
264
|
const c = t.querySelectorAll("tr:not(.nodata)");
|
|
265
265
|
if (c.forEach((f, g) => {
|
|
266
266
|
l += f.offsetHeight || f.getBoundingClientRect().height;
|
|
267
|
-
}), c.forEach((f) => f.remove()), r && (r.style.display = o, r.style.visibility = a, r.style.position = d), y(this, R, l), e(this,
|
|
268
|
-
const f = Math.ceil(e(this,
|
|
269
|
-
y(this,
|
|
267
|
+
}), c.forEach((f) => f.remove()), r && (r.style.display = o, r.style.visibility = a, r.style.position = d), y(this, R, l), e(this, I) > 0) {
|
|
268
|
+
const f = Math.ceil(e(this, I) / e(this, R));
|
|
269
|
+
y(this, H, f + 20);
|
|
270
270
|
} else
|
|
271
|
-
y(this,
|
|
272
|
-
return console.log(`[RowManager] Template Height Cached: ${e(this, R)}px | RowCount: ${e(this,
|
|
271
|
+
y(this, H, 40);
|
|
272
|
+
return console.log(`[RowManager] Template Height Cached: ${e(this, R)}px | RowCount: ${e(this, H)}`), e(this, R);
|
|
273
273
|
}, "#measureAndCacheHeight"));
|
|
274
274
|
/**
|
|
275
275
|
* π― μΊμλ ν κ°μ λ°ν (μμ λλ§ μ΅μνμ λ°©μ΄ μ°μ°)
|
|
@@ -288,34 +288,34 @@ const Le = class Le {
|
|
|
288
288
|
* π― μΊμλ ν κ°μλ₯Ό κ³§λ°λ‘ κ°μ Έμμ TR λΌλ μ£Όμ
(μ€λ³΅ κ³μ° μ κ±°)
|
|
289
289
|
*/
|
|
290
290
|
u(this, le, /* @__PURE__ */ h((i) => {
|
|
291
|
-
if (e(this,
|
|
291
|
+
if (e(this, _).length === 0) return;
|
|
292
292
|
const t = i.querySelector("tbody.bindable") || i.querySelector("tbody");
|
|
293
293
|
if (!t) return;
|
|
294
294
|
t.querySelectorAll("tr:not(.nodata)").forEach((o) => o.remove());
|
|
295
|
-
const s = t.querySelector("tr.nodata"), n = document.createDocumentFragment(), r = e(this,
|
|
295
|
+
const s = t.querySelector("tr.nodata"), n = document.createDocumentFragment(), r = e(this, H);
|
|
296
296
|
for (let o = 0; o < r; o++)
|
|
297
|
-
e(this,
|
|
297
|
+
e(this, _).forEach((a) => {
|
|
298
298
|
n.appendChild(a.cloneNode(!0));
|
|
299
299
|
});
|
|
300
300
|
s ? s.before(n) : t.appendChild(n), console.log(`[RowManager] Rendered ${r} sets into DOM.`);
|
|
301
301
|
}, "#renderRows"));
|
|
302
|
-
|
|
303
|
-
e(this,
|
|
302
|
+
x(this, "destroy", /* @__PURE__ */ h(() => {
|
|
303
|
+
e(this, $) && (e(this, $).disconnect(), y(this, $, null));
|
|
304
304
|
}, "destroy"));
|
|
305
|
-
y(this,
|
|
305
|
+
y(this, M, i), e(this, ne).call(this);
|
|
306
306
|
}
|
|
307
307
|
get templateLength() {
|
|
308
|
-
return e(this,
|
|
308
|
+
return e(this, _).length || 1;
|
|
309
309
|
}
|
|
310
310
|
};
|
|
311
|
-
|
|
311
|
+
M = new WeakMap(), _ = new WeakMap(), R = new WeakMap(), $ = new WeakMap(), I = new WeakMap(), H = new WeakMap(), ne = new WeakMap(), re = new WeakMap(), oe = new WeakMap(), le = new WeakMap(), h(Le, "RowManager");
|
|
312
312
|
let xe = Le;
|
|
313
|
-
var A,
|
|
313
|
+
var A, F, G, U, ae, ce;
|
|
314
314
|
const j = class j extends HTMLElement {
|
|
315
315
|
constructor() {
|
|
316
316
|
super();
|
|
317
317
|
u(this, A, null);
|
|
318
|
-
u(this,
|
|
318
|
+
u(this, F);
|
|
319
319
|
/**
|
|
320
320
|
* π― 2μ°¨μ μ
격μ μΈλ±μ€λ₯Ό κ³μ°νμ¬ λ³ν©(`rowSpan`/`colSpan`) μ
μ μ λ μ»¬λΌ μμΉλ₯Ό λΆμ¬
|
|
321
321
|
*/
|
|
@@ -331,15 +331,15 @@ const j = class j extends HTMLElement {
|
|
|
331
331
|
const c = l.sectionRowIndex;
|
|
332
332
|
let f = 0;
|
|
333
333
|
Array.from(l.querySelectorAll("th,td")).forEach((g) => {
|
|
334
|
-
for (let
|
|
335
|
-
if (d[c][
|
|
336
|
-
f =
|
|
334
|
+
for (let v = 0; v < d[c].length; v++)
|
|
335
|
+
if (d[c][v] === null) {
|
|
336
|
+
f = v;
|
|
337
337
|
break;
|
|
338
338
|
}
|
|
339
339
|
const b = g.rowSpan || 1, S = g.colSpan || 1;
|
|
340
|
-
for (let
|
|
340
|
+
for (let v = 0; v < b; v++)
|
|
341
341
|
for (let L = 0; L < S; L++)
|
|
342
|
-
c +
|
|
342
|
+
c + v < o && f + L < a && (d[c + v][f + L] = v === 0 && L === 0 ? "1" : "0");
|
|
343
343
|
});
|
|
344
344
|
}), n.forEach((l) => {
|
|
345
345
|
const c = l.sectionRowIndex;
|
|
@@ -355,7 +355,7 @@ const j = class j extends HTMLElement {
|
|
|
355
355
|
/**
|
|
356
356
|
* π― μλ³Έ ν
μ΄λΈμ λΆμνμ¬ κ³ μ μ»¬λΌ μμλ³(left, body, right)λ‘ μλ²½νκ² μͺΌκ°μ§ ν
μ΄λΈ μμ±
|
|
357
357
|
*/
|
|
358
|
-
u(this,
|
|
358
|
+
u(this, U, /* @__PURE__ */ h((t, s) => {
|
|
359
359
|
const n = t.cloneNode(!0), r = n.querySelector("colgroup");
|
|
360
360
|
if (!r) return n;
|
|
361
361
|
const o = Array.from(r.querySelectorAll("col")), a = [];
|
|
@@ -371,17 +371,17 @@ const j = class j extends HTMLElement {
|
|
|
371
371
|
});
|
|
372
372
|
}), n;
|
|
373
373
|
}, "#createSplitTable"));
|
|
374
|
-
|
|
374
|
+
x(this, "generate", /* @__PURE__ */ h((t) => {
|
|
375
375
|
if (!t) return;
|
|
376
376
|
const s = /* @__PURE__ */ h((l) => {
|
|
377
377
|
const c = /* @__PURE__ */ h((g) => {
|
|
378
378
|
if (g.querySelector("colgroup")) return;
|
|
379
|
-
const b = g.querySelector("tbody tr") || g.querySelector("tr"), S = b ? b.querySelectorAll("th, td").length : 1,
|
|
379
|
+
const b = g.querySelector("tbody tr") || g.querySelector("tr"), S = b ? b.querySelectorAll("th, td").length : 1, v = document.createElement("colgroup"), L = Math.max(Math.floor(g.clientWidth / S), 100);
|
|
380
380
|
for (let $e = 0; $e < S; $e++) {
|
|
381
381
|
const We = document.createElement("col");
|
|
382
|
-
We.setAttribute("width", L),
|
|
382
|
+
We.setAttribute("width", L), v.appendChild(We);
|
|
383
383
|
}
|
|
384
|
-
g.prepend(
|
|
384
|
+
g.prepend(v);
|
|
385
385
|
}, "ensureColgroup"), f = /* @__PURE__ */ h((g) => {
|
|
386
386
|
if (g.querySelector("thead")) return;
|
|
387
387
|
const b = document.createElement("thead"), S = g.querySelector("colgroup");
|
|
@@ -394,14 +394,14 @@ const j = class j extends HTMLElement {
|
|
|
394
394
|
f && e(this, A).querySelectorAll(`[data-col="${c}"]`).forEach((g) => {
|
|
395
395
|
g.setAttribute("fixed", f);
|
|
396
396
|
});
|
|
397
|
-
}),
|
|
397
|
+
}), Y.log(e(this, A));
|
|
398
398
|
const o = this.querySelector(".ng-container-left"), a = this.querySelector(".ng-container-body"), d = this.querySelector(".ng-container-right");
|
|
399
399
|
if (a) {
|
|
400
|
-
const l = e(this,
|
|
401
|
-
a.innerHTML = "", a.appendChild(l), e(this,
|
|
400
|
+
const l = e(this, U).call(this, e(this, A), null);
|
|
401
|
+
a.innerHTML = "", a.appendChild(l), e(this, F).initialize(e(this, A));
|
|
402
402
|
}
|
|
403
403
|
if (o) {
|
|
404
|
-
const l = e(this,
|
|
404
|
+
const l = e(this, U).call(this, e(this, A), "left");
|
|
405
405
|
let c = 0;
|
|
406
406
|
l.querySelectorAll("col").forEach((g) => {
|
|
407
407
|
const b = parseInt(g.getAttribute("width"), 10);
|
|
@@ -411,7 +411,7 @@ const j = class j extends HTMLElement {
|
|
|
411
411
|
o.style.flex = `0 0 ${f}px`, o.style.width = `${f}px`;
|
|
412
412
|
}
|
|
413
413
|
if (d) {
|
|
414
|
-
const l = e(this,
|
|
414
|
+
const l = e(this, U).call(this, e(this, A), "right");
|
|
415
415
|
let c = 0;
|
|
416
416
|
l.querySelectorAll("col").forEach((g) => {
|
|
417
417
|
const b = parseInt(g.getAttribute("width"), 10);
|
|
@@ -428,33 +428,33 @@ const j = class j extends HTMLElement {
|
|
|
428
428
|
(l = this.querySelector("nine-table-hscrollbar")) == null || l.refresh();
|
|
429
429
|
}, 0);
|
|
430
430
|
}, "generate"));
|
|
431
|
-
|
|
432
|
-
|
|
431
|
+
x(this, "getRowHeight", /* @__PURE__ */ h(() => e(this, F).getRowHeight(), "getRowHeight"));
|
|
432
|
+
x(this, "scrollToX", /* @__PURE__ */ h((t) => {
|
|
433
433
|
const s = this.querySelector(".ng-container-body");
|
|
434
434
|
s && (s.scrollLeft = t);
|
|
435
435
|
}, "scrollToX"));
|
|
436
|
-
|
|
436
|
+
x(this, "scrollToY", /* @__PURE__ */ h((t) => {
|
|
437
437
|
const s = this.querySelector(".ng-container-body");
|
|
438
438
|
s && (s.scrollTop = t);
|
|
439
439
|
}, "scrollToY"));
|
|
440
440
|
u(this, ae, /* @__PURE__ */ h(() => {
|
|
441
441
|
const t = /* @__PURE__ */ h(() => {
|
|
442
442
|
var c, f, g;
|
|
443
|
-
_.log(":::::::::::::::");
|
|
444
443
|
const s = this.querySelector(".ng-container-left table"), n = this.querySelector(".ng-container-body table"), r = this.querySelector(".ng-container-right table");
|
|
445
444
|
if (!n) return;
|
|
446
|
-
_.log("22222");
|
|
447
445
|
const o = s ? Array.from(s.querySelectorAll("tr")) : [], a = Array.from(n.querySelectorAll("tr")), d = r ? Array.from(r.querySelectorAll("tr")) : [], l = Math.max(o.length, a.length, d.length);
|
|
448
446
|
for (let b = 0; b < l; b++) {
|
|
449
447
|
const S = [
|
|
450
448
|
((c = o[b]) == null ? void 0 : c.getBoundingClientRect().height) || 0,
|
|
451
449
|
((f = a[b]) == null ? void 0 : f.getBoundingClientRect().height) || 0,
|
|
452
450
|
((g = d[b]) == null ? void 0 : g.getBoundingClientRect().height) || 0
|
|
453
|
-
],
|
|
454
|
-
|
|
451
|
+
], v = Math.max(...S);
|
|
452
|
+
v > 0 && (o[b] && (o[b].style.height = `${v}px`), a[b] && (a[b].style.height = `${v}px`), d[b] && (d[b].style.height = `${v}px`));
|
|
455
453
|
}
|
|
456
454
|
}, "syncRowHeights");
|
|
457
|
-
e(this, ce).call(this),
|
|
455
|
+
e(this, ce).call(this), requestAnimationFrame(() => {
|
|
456
|
+
t();
|
|
457
|
+
}), new MutationObserver((s) => {
|
|
458
458
|
for (const n of s)
|
|
459
459
|
n.attributeName === "class" && this.classList.contains("active") && t();
|
|
460
460
|
}).observe(this, { attributes: !0 });
|
|
@@ -583,16 +583,16 @@ const j = class j extends HTMLElement {
|
|
|
583
583
|
</div>
|
|
584
584
|
`;
|
|
585
585
|
}, "#render"));
|
|
586
|
-
y(this,
|
|
586
|
+
y(this, F, new xe(this));
|
|
587
587
|
}
|
|
588
588
|
connectedCallback() {
|
|
589
589
|
e(this, ae).call(this);
|
|
590
590
|
}
|
|
591
591
|
disconnectedCallback() {
|
|
592
|
-
this.innerHTML = "",
|
|
592
|
+
this.innerHTML = "", Y.log("NineTableSheet destroyed.");
|
|
593
593
|
}
|
|
594
594
|
};
|
|
595
|
-
A = new WeakMap(),
|
|
595
|
+
A = new WeakMap(), F = new WeakMap(), G = new WeakMap(), U = new WeakMap(), ae = new WeakMap(), ce = new WeakMap(), h(j, "NineTableSheet"), x(j, "SCROLLBAR_SIZE", 16);
|
|
596
596
|
let te = j;
|
|
597
597
|
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", te);
|
|
598
598
|
var he, J;
|
|
@@ -613,8 +613,8 @@ const Ce = class Ce extends HTMLElement {
|
|
|
613
613
|
Array.from(this.querySelectorAll("nine-splitter")).forEach((b) => b.style.setProperty("display", "none"));
|
|
614
614
|
const g = c.filter((b) => b.classList.contains("active"));
|
|
615
615
|
g.length < 2 || g.forEach((b) => {
|
|
616
|
-
const S = parseInt(b.getAttribute("data-index"), 10),
|
|
617
|
-
|
|
616
|
+
const S = parseInt(b.getAttribute("data-index"), 10), v = this.querySelector(`nine-splitter[data-split-index="${S}"]`), L = c[S + 1];
|
|
617
|
+
v && L && L.classList.contains("active") && v.style.setProperty("display", "flex");
|
|
618
618
|
});
|
|
619
619
|
}, "updateSplitters"), r = this.querySelector(".nine-tab-bar"), o = this.querySelector("nine-table-sheets-body"), a = r.querySelectorAll(".nine-tab-item"), d = o.querySelectorAll("nine-table-sheet");
|
|
620
620
|
if (!a[t]) return;
|
|
@@ -779,30 +779,30 @@ const _e = class _e {
|
|
|
779
779
|
};
|
|
780
780
|
E = new WeakMap(), de = new WeakMap(), Q = new WeakMap(), fe = new WeakMap(), h(_e, "LayoutManager");
|
|
781
781
|
let Se = _e;
|
|
782
|
-
var
|
|
782
|
+
var W, V;
|
|
783
783
|
const Ie = class Ie {
|
|
784
784
|
constructor(i) {
|
|
785
|
-
u(this,
|
|
786
|
-
u(this,
|
|
787
|
-
|
|
788
|
-
y(this,
|
|
785
|
+
u(this, W);
|
|
786
|
+
u(this, V, -1);
|
|
787
|
+
x(this, "count", /* @__PURE__ */ h(() => e(this, W).rawRecords.length, "count"));
|
|
788
|
+
y(this, W, i);
|
|
789
789
|
}
|
|
790
790
|
get at() {
|
|
791
|
-
return e(this,
|
|
791
|
+
return e(this, V);
|
|
792
792
|
}
|
|
793
793
|
set at(i) {
|
|
794
794
|
var s, n;
|
|
795
|
-
y(this,
|
|
796
|
-
const t = ((n = (s = e(this,
|
|
797
|
-
t && !t.querySelector(`tbody.bindable tr[data-row="${e(this,
|
|
795
|
+
y(this, V, parseInt(i, 10));
|
|
796
|
+
const t = ((n = (s = e(this, W).owner).querySelector) == null ? void 0 : n.call(s, ".ng-container-body")) || e(this, W).owner.body;
|
|
797
|
+
t && !t.querySelector(`tbody.bindable tr[data-row="${e(this, V)}"]`) && setTimeout(() => {
|
|
798
798
|
var r, o;
|
|
799
|
-
(o = (r = e(this,
|
|
799
|
+
(o = (r = e(this, W).owner).scrollTo_V1) == null || o.call(r, e(this, V));
|
|
800
800
|
});
|
|
801
801
|
}
|
|
802
802
|
};
|
|
803
|
-
|
|
803
|
+
W = new WeakMap(), V = new WeakMap(), h(Ie, "ngRow");
|
|
804
804
|
let Ee = Ie;
|
|
805
|
-
var T, w, q, K, ue,
|
|
805
|
+
var T, w, q, K, ue, z, ge, ee, be, ye, Z;
|
|
806
806
|
const k = class k {
|
|
807
807
|
constructor(i, t) {
|
|
808
808
|
u(this, T);
|
|
@@ -810,33 +810,33 @@ const k = class k {
|
|
|
810
810
|
u(this, q, []);
|
|
811
811
|
u(this, K, []);
|
|
812
812
|
u(this, ue, 0);
|
|
813
|
-
u(this,
|
|
813
|
+
u(this, z, []);
|
|
814
814
|
u(this, ge, /* @__PURE__ */ h(() => {
|
|
815
|
-
y(this,
|
|
815
|
+
y(this, z, []);
|
|
816
816
|
const i = e(this, T).template || [];
|
|
817
817
|
Array.from(i).forEach((t) => {
|
|
818
818
|
var s;
|
|
819
|
-
e(this,
|
|
819
|
+
e(this, z).push(((s = t.getBoundingClientRect) == null ? void 0 : s.call(t).height) || 24);
|
|
820
820
|
}), (e(this, w).rawRecords || []).forEach((t) => {
|
|
821
|
-
t.__ng || (t.__ng = e(this, ee).call(this)), t.__ng.height = e(this,
|
|
821
|
+
t.__ng || (t.__ng = e(this, ee).call(this)), t.__ng.height = e(this, z).slice();
|
|
822
822
|
});
|
|
823
823
|
}, "#initialize"));
|
|
824
|
-
|
|
824
|
+
x(this, "set", /* @__PURE__ */ h((i) => {
|
|
825
825
|
this.clear(), this.add(i, !1);
|
|
826
826
|
}, "set"));
|
|
827
827
|
u(this, ee, /* @__PURE__ */ h(() => ({
|
|
828
828
|
rowState: k.ROW_STATE.EMPTY,
|
|
829
829
|
deleted: !1,
|
|
830
830
|
filtered: !1,
|
|
831
|
-
height: e(this,
|
|
831
|
+
height: e(this, z).slice(),
|
|
832
832
|
o: {},
|
|
833
833
|
c: {},
|
|
834
|
-
_: [0, 0, 0, 0, k.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, e(this,
|
|
834
|
+
_: [0, 0, 0, 0, k.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, e(this, z).slice(), -1, {}, {}]
|
|
835
835
|
}), "#getDefaultMeta"));
|
|
836
|
-
|
|
836
|
+
x(this, "reset", /* @__PURE__ */ h(() => {
|
|
837
837
|
y(this, q, []), y(this, K, []);
|
|
838
838
|
}, "reset"));
|
|
839
|
-
|
|
839
|
+
x(this, "clear", /* @__PURE__ */ h(() => {
|
|
840
840
|
var i;
|
|
841
841
|
e(this, w).rawRecords = [], y(this, q, []), y(this, K, []), (i = e(this, w).viewRecords) != null && i.reset && e(this, w).viewRecords.reset();
|
|
842
842
|
}, "clear"));
|
|
@@ -854,7 +854,7 @@ const k = class k {
|
|
|
854
854
|
u(this, ye, /* @__PURE__ */ h((i) => (Array.isArray(i) || (i = [i]), i.forEach((t) => {
|
|
855
855
|
t.__ng = e(this, ee).call(this), t.__ng.rowid = this.nextId, t.__ng.rowState = k.ROW_STATE.INSERT, t.__ng._[0] = t.__ng.rowid;
|
|
856
856
|
}), i), "#defaultInsert"));
|
|
857
|
-
|
|
857
|
+
x(this, "add", /* @__PURE__ */ h((i, t = !0) => {
|
|
858
858
|
var r;
|
|
859
859
|
i === void 0 && (i = {});
|
|
860
860
|
const s = e(this, be).call(this, i);
|
|
@@ -865,7 +865,7 @@ const k = class k {
|
|
|
865
865
|
d && (d.__ng.rowState = k.ROW_STATE.EMPTY);
|
|
866
866
|
}), (r = e(this, w).viewRecords) != null && r.reset && e(this, w).viewRecords.reset(), n;
|
|
867
867
|
}, "add"));
|
|
868
|
-
|
|
868
|
+
x(this, "delete", /* @__PURE__ */ h((i) => {
|
|
869
869
|
var s;
|
|
870
870
|
let t = [];
|
|
871
871
|
Array.isArray(i) ? t = i : typeof i > "u" ? t = [e(this, w).owner.row.at] : t = [parseInt(i, 10)], t.sort((n, r) => r - n).forEach((n) => {
|
|
@@ -877,7 +877,7 @@ const k = class k {
|
|
|
877
877
|
}
|
|
878
878
|
}), this.resetRecords(), (s = e(this, w).viewRecords) != null && s.reset && e(this, w).viewRecords.reset();
|
|
879
879
|
}, "delete"));
|
|
880
|
-
|
|
880
|
+
x(this, "setValue", /* @__PURE__ */ h((i, t, s) => {
|
|
881
881
|
var d;
|
|
882
882
|
i = parseInt(i, 10);
|
|
883
883
|
const r = (typeof ((d = e(this, T).fields) == null ? void 0 : d.get) == "function" ? e(this, T).fields.get() : []).indexOf(t);
|
|
@@ -887,14 +887,14 @@ const k = class k {
|
|
|
887
887
|
const a = o.v[r];
|
|
888
888
|
a !== s && o.__ng.rowState !== k.ROW_STATE.INSERT && (o.__ng.o.hasOwnProperty(t) || (o.__ng.o[t] = a), o.__ng.rowState = k.ROW_STATE.UPDATE), o.v[r] = s, e(this, w).owner.refreshData && e(this, w).owner.refreshData(i);
|
|
889
889
|
}, "setValue"));
|
|
890
|
-
|
|
890
|
+
x(this, "resetRecords", /* @__PURE__ */ h(() => {
|
|
891
891
|
y(this, K, e(this, w).rawRecords.filter((i) => !i.__ng.deleted)), y(this, q, e(this, w).rawRecords.filter((i) => !i.__ng.deleted && !i.__ng.filtered)), e(this, w).rawRecords.forEach((i, t) => {
|
|
892
892
|
i.__ng.rowidx = t;
|
|
893
893
|
}), e(this, q).forEach((i, t) => {
|
|
894
894
|
i.__ng.i = t;
|
|
895
895
|
});
|
|
896
896
|
}, "resetRecords"));
|
|
897
|
-
|
|
897
|
+
x(this, "getValidData", /* @__PURE__ */ h(() => (e(this, q).length === 0 && e(this, w).rawRecords.length > 0 && this.resetRecords(), e(this, q)), "getValidData"));
|
|
898
898
|
u(this, Z, /* @__PURE__ */ h((i) => {
|
|
899
899
|
var s;
|
|
900
900
|
if (!i) return i;
|
|
@@ -906,8 +906,8 @@ const k = class k {
|
|
|
906
906
|
}), r.__ng = n.__ng, r;
|
|
907
907
|
}) : i;
|
|
908
908
|
}, "#conv2"));
|
|
909
|
-
|
|
910
|
-
|
|
909
|
+
x(this, "count", /* @__PURE__ */ h(() => this.getValidData().length, "count"));
|
|
910
|
+
x(this, "get", /* @__PURE__ */ h((i, t) => {
|
|
911
911
|
var r;
|
|
912
912
|
const s = this.getValidData();
|
|
913
913
|
if (!s || s.length <= 0) return;
|
|
@@ -938,8 +938,8 @@ const k = class k {
|
|
|
938
938
|
return this.length;
|
|
939
939
|
}
|
|
940
940
|
};
|
|
941
|
-
T = new WeakMap(), w = new WeakMap(), q = new WeakMap(), K = new WeakMap(), ue = new WeakMap(),
|
|
942
|
-
|
|
941
|
+
T = new WeakMap(), w = new WeakMap(), q = new WeakMap(), K = new WeakMap(), ue = new WeakMap(), z = new WeakMap(), ge = new WeakMap(), ee = new WeakMap(), be = new WeakMap(), ye = new WeakMap(), Z = new WeakMap(), h(k, "ngData"), // π― ν μν μ μ μμλ₯Ό ν΄λμ€ λ΄λΆλ‘ λ΄μ¬ν
|
|
942
|
+
x(k, "ROW_STATE", {
|
|
943
943
|
EMPTY: "EMPTY",
|
|
944
944
|
NORMAL: "NORMAL",
|
|
945
945
|
INSERT: "INSERT",
|
|
@@ -968,35 +968,35 @@ const He = class He {
|
|
|
968
968
|
};
|
|
969
969
|
h(He, "ngDataManager");
|
|
970
970
|
let Ae = He;
|
|
971
|
-
var
|
|
971
|
+
var X, pe;
|
|
972
972
|
const Me = class Me extends HTMLElement {
|
|
973
973
|
constructor() {
|
|
974
974
|
super();
|
|
975
975
|
//#created = false;
|
|
976
|
-
u(this,
|
|
976
|
+
u(this, X);
|
|
977
977
|
u(this, pe);
|
|
978
|
-
this.attachShadow({ mode: "open" }), y(this,
|
|
978
|
+
this.attachShadow({ mode: "open" }), y(this, X, new Ae(this));
|
|
979
979
|
}
|
|
980
980
|
connectedCallback() {
|
|
981
|
-
y(this, pe, new Se(this)),
|
|
981
|
+
y(this, pe, new Se(this)), Y.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
|
|
982
982
|
}
|
|
983
983
|
disconnectedCallback() {
|
|
984
|
-
|
|
984
|
+
Y.log("NineTable disconnected.");
|
|
985
985
|
}
|
|
986
986
|
// π― μΈλΆμμ grid.data.set(...) ννλ‘ μ κ·Όν μ μλλ‘ λ°μ΄ν° λ§€λμ μ€ν
|
|
987
987
|
get data() {
|
|
988
|
-
return e(this,
|
|
988
|
+
return e(this, X).data;
|
|
989
989
|
}
|
|
990
990
|
// π― ν(row) κ΄λ ¨ μ μ΄ μ κ·Όμ μ€ν
|
|
991
991
|
get row() {
|
|
992
|
-
return e(this,
|
|
992
|
+
return e(this, X).row;
|
|
993
993
|
}
|
|
994
994
|
// π― μ 체 λ°μ΄ν° λ§€λμ μ κ·Ό νμν κ²½μ°
|
|
995
995
|
get dataManager() {
|
|
996
|
-
return e(this,
|
|
996
|
+
return e(this, X);
|
|
997
997
|
}
|
|
998
998
|
};
|
|
999
|
-
|
|
999
|
+
X = new WeakMap(), pe = new WeakMap(), h(Me, "NineTable");
|
|
1000
1000
|
let Te = Me;
|
|
1001
1001
|
customElements.get("nine-table") || customElements.define("nine-table", Te);
|
|
1002
1002
|
//# sourceMappingURL=nine-table.js.map
|