@ninebone/table 0.0.183 β 0.0.184
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 +225 -225
- 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
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var Ie = Object.defineProperty;
|
|
2
|
+
var Me = (w) => {
|
|
3
3
|
throw TypeError(w);
|
|
4
4
|
};
|
|
5
|
-
var ze = (w, i, t) => i in w ?
|
|
6
|
-
var l = (w, i) =>
|
|
7
|
-
var v = (w, i, t) => ze(w, typeof i != "symbol" ? i + "" : i, t), He = (w, i, t) => i.has(w) ||
|
|
8
|
-
var e = (w, i, t) => (He(w, i, "read from private field"), t ? t.call(w) : i.get(w)), u = (w, i, t) => i.has(w) ?
|
|
5
|
+
var ze = (w, i, t) => i in w ? Ie(w, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : w[i] = t;
|
|
6
|
+
var l = (w, i) => Ie(w, "name", { value: i, configurable: !0 });
|
|
7
|
+
var v = (w, i, t) => ze(w, typeof i != "symbol" ? i + "" : i, t), He = (w, i, t) => i.has(w) || Me("Cannot " + t);
|
|
8
|
+
var e = (w, i, t) => (He(w, i, "read from private field"), t ? t.call(w) : i.get(w)), u = (w, i, t) => i.has(w) ? Me("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(w) : i.set(w, t), y = (w, i, t, s) => (He(w, i, "write to private field"), s ? s.call(w, t) : i.set(w, t), t);
|
|
9
9
|
var $e = (w, i, t, s) => ({
|
|
10
10
|
set _(n) {
|
|
11
|
-
|
|
11
|
+
y(w, i, n, t);
|
|
12
12
|
},
|
|
13
13
|
get _() {
|
|
14
14
|
return e(w, i, s);
|
|
@@ -21,72 +21,72 @@ const Re = class Re extends We.constructor {
|
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
23
|
l(Re, "Trace");
|
|
24
|
-
let
|
|
25
|
-
const
|
|
26
|
-
var _, B,
|
|
24
|
+
let ge = Re;
|
|
25
|
+
const $ = new ge();
|
|
26
|
+
var _, B, p, D, N, P, ie, V, se;
|
|
27
27
|
const Te = class Te extends HTMLElement {
|
|
28
28
|
constructor() {
|
|
29
29
|
super();
|
|
30
30
|
u(this, _);
|
|
31
31
|
u(this, B, !1);
|
|
32
|
-
u(this,
|
|
32
|
+
u(this, p);
|
|
33
33
|
u(this, D);
|
|
34
34
|
u(this, N);
|
|
35
35
|
u(this, P);
|
|
36
|
-
u(this,
|
|
36
|
+
u(this, ie, /* @__PURE__ */ l(() => {
|
|
37
37
|
if (!e(this, _)) return;
|
|
38
38
|
const t = e(this, _).querySelector(".ng-container-body");
|
|
39
|
-
t && (
|
|
39
|
+
t && (y(this, P, new ResizeObserver(() => {
|
|
40
40
|
this.refresh();
|
|
41
41
|
})), e(this, P).observe(t));
|
|
42
42
|
}, "#observeResize"));
|
|
43
43
|
v(this, "refresh", /* @__PURE__ */ l(() => {
|
|
44
|
-
if (!e(this, _) || !e(this,
|
|
45
|
-
const t = e(this,
|
|
44
|
+
if (!e(this, _) || !e(this, p) || e(this, B)) return;
|
|
45
|
+
const t = e(this, p).container, s = t.querySelector("table");
|
|
46
46
|
if (!s) return;
|
|
47
|
-
const n = e(this,
|
|
48
|
-
if (h !== 0 &&
|
|
47
|
+
const n = e(this, p).track, r = e(this, p).thumb, o = e(this, _).querySelector(".ng-container-bottom"), h = t.clientWidth, g = s.scrollWidth;
|
|
48
|
+
if (h !== 0 && g > h)
|
|
49
49
|
o && (o.style.display = "flex");
|
|
50
50
|
else {
|
|
51
51
|
o && (o.style.display = "none");
|
|
52
52
|
return;
|
|
53
53
|
}
|
|
54
|
-
const
|
|
55
|
-
if (
|
|
56
|
-
const d = Math.max(Math.min(
|
|
54
|
+
const c = n.clientWidth;
|
|
55
|
+
if (c <= 0) return;
|
|
56
|
+
const d = Math.max(Math.min(c * (h / g), c), 20);
|
|
57
57
|
r.style.width = `${d}px`;
|
|
58
|
-
let
|
|
59
|
-
const
|
|
60
|
-
if (
|
|
61
|
-
const x =
|
|
62
|
-
x && x[1] && (
|
|
58
|
+
let a = 0;
|
|
59
|
+
const b = s.style.transform;
|
|
60
|
+
if (b && b.includes("translateX")) {
|
|
61
|
+
const x = b.match(/translateX\(([-\d.]+)px\)/);
|
|
62
|
+
x && x[1] && (a = parseFloat(x[1]));
|
|
63
63
|
} else
|
|
64
|
-
|
|
65
|
-
let f = parseInt(Math.abs(
|
|
64
|
+
a = parseInt(s.style.left || 0, 10);
|
|
65
|
+
let f = parseInt(Math.abs(a) * c / g, 10);
|
|
66
66
|
f < 0 && (f = 0);
|
|
67
|
-
const S =
|
|
68
|
-
f > S && (f = S), r.style.left = `${f}px`, e(this,
|
|
67
|
+
const S = c - d;
|
|
68
|
+
f > S && (f = S), r.style.left = `${f}px`, e(this, p).left.disabled = f === 0, e(this, p).right.disabled = f >= S - 1;
|
|
69
69
|
}, "refresh"));
|
|
70
70
|
u(this, V, /* @__PURE__ */ l((t) => {
|
|
71
|
-
if (!e(this,
|
|
72
|
-
const s = e(this,
|
|
71
|
+
if (!e(this, p)) return !1;
|
|
72
|
+
const s = e(this, p).container, n = s.querySelector("table");
|
|
73
73
|
if (!n) return !1;
|
|
74
|
-
const r = e(this,
|
|
74
|
+
const r = e(this, p).track.getBoundingClientRect(), o = e(this, p).thumb.clientWidth;
|
|
75
75
|
let h = t;
|
|
76
76
|
h < 0 && (h = 0);
|
|
77
|
-
const
|
|
78
|
-
h >
|
|
79
|
-
const
|
|
80
|
-
let
|
|
81
|
-
return -
|
|
77
|
+
const g = r.width - o;
|
|
78
|
+
h > g && (h = g), h = parseInt(h, 10), e(this, p).thumb.style.left = `${h}px`, e(this, p).left.disabled = h === 0, e(this, p).right.disabled = h >= g - 1;
|
|
79
|
+
const c = s.clientWidth, d = n.scrollWidth;
|
|
80
|
+
let a = g > 0 ? -h * (d - c) / g : 0;
|
|
81
|
+
return -a > d - c && (a = -(d - c)), -a + 5 > d - c && (a = -(d - c)), c >= d && (a = 0), n.style.transform = `translateX(${a}px)`, h > 0 && h < g - 1;
|
|
82
82
|
}, "#thumbMoveTo"));
|
|
83
|
-
u(this,
|
|
83
|
+
u(this, se, /* @__PURE__ */ l(() => {
|
|
84
84
|
const t = /* @__PURE__ */ l((n) => {
|
|
85
85
|
clearInterval(e(this, D)), clearInterval(e(this, N));
|
|
86
|
-
const r = parseInt(e(this,
|
|
87
|
-
e(this, V).call(this, r + n),
|
|
88
|
-
clearInterval(e(this, D)),
|
|
89
|
-
const o = parseInt(e(this,
|
|
86
|
+
const r = parseInt(e(this, p).thumb.style.left || 0, 10);
|
|
87
|
+
e(this, V).call(this, r + n), y(this, D, setInterval(() => {
|
|
88
|
+
clearInterval(e(this, D)), y(this, N, setInterval(() => {
|
|
89
|
+
const o = parseInt(e(this, p).thumb.style.left || 0, 10);
|
|
90
90
|
e(this, V).call(this, o + n) || clearInterval(e(this, N));
|
|
91
91
|
}, 50));
|
|
92
92
|
}, 500));
|
|
@@ -94,32 +94,32 @@ const Te = class Te extends HTMLElement {
|
|
|
94
94
|
clearInterval(e(this, D)), clearInterval(e(this, N));
|
|
95
95
|
}, "clearTimer");
|
|
96
96
|
["mouseup", "mouseleave", "touchend"].forEach((n) => {
|
|
97
|
-
e(this,
|
|
98
|
-
}), e(this,
|
|
97
|
+
e(this, p).left.addEventListener(n, s), e(this, p).right.addEventListener(n, s), e(this, p).track.addEventListener(n, s);
|
|
98
|
+
}), e(this, p).left.addEventListener("mousedown", (n) => {
|
|
99
99
|
n.button === 0 && t(-20);
|
|
100
|
-
}), e(this,
|
|
100
|
+
}), e(this, p).right.addEventListener("mousedown", (n) => {
|
|
101
101
|
n.button === 0 && t(20);
|
|
102
|
-
}), e(this,
|
|
102
|
+
}), e(this, p).left.addEventListener("touchstart", () => t(-20)), e(this, p).right.addEventListener("touchstart", () => t(20)), e(this, p).track.addEventListener("mousedown", (n) => {
|
|
103
103
|
if (n.button !== 0) return;
|
|
104
104
|
n.preventDefault();
|
|
105
|
-
const r = e(this,
|
|
105
|
+
const r = e(this, p).track.getBoundingClientRect(), o = e(this, p).thumb.clientWidth;
|
|
106
106
|
e(this, V).call(this, n.clientX - r.left - o / 2);
|
|
107
|
-
}), e(this,
|
|
107
|
+
}), e(this, p).thumb.addEventListener("mousedown", (n) => {
|
|
108
108
|
if (n.button !== 0) return;
|
|
109
|
-
n.stopPropagation(), n.preventDefault(),
|
|
109
|
+
n.stopPropagation(), n.preventDefault(), y(this, B, !0), this.shiftX = n.clientX - e(this, p).thumb.getBoundingClientRect().left;
|
|
110
110
|
const r = /* @__PURE__ */ l((h) => {
|
|
111
111
|
if (!e(this, B)) return;
|
|
112
|
-
const
|
|
113
|
-
e(this, V).call(this, h.clientX -
|
|
112
|
+
const g = e(this, p).track.getBoundingClientRect();
|
|
113
|
+
e(this, V).call(this, h.clientX - g.left - this.shiftX);
|
|
114
114
|
}, "onMouseMove"), o = /* @__PURE__ */ l(() => {
|
|
115
|
-
|
|
115
|
+
y(this, B, !1), s(), document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", o), this.refresh();
|
|
116
116
|
}, "onMouseUp");
|
|
117
117
|
document.addEventListener("mousemove", r), document.addEventListener("mouseup", o);
|
|
118
118
|
});
|
|
119
119
|
}, "#init"));
|
|
120
120
|
}
|
|
121
121
|
connectedCallback() {
|
|
122
|
-
if (
|
|
122
|
+
if (y(this, _, this.closest("nine-table-sheet") || this.getRootNode().host), !e(this, _)) return;
|
|
123
123
|
this.innerHTML = `
|
|
124
124
|
<style>
|
|
125
125
|
nine-table-hscrollbar {
|
|
@@ -189,13 +189,13 @@ const Te = class Te extends HTMLElement {
|
|
|
189
189
|
setTimeout(t, 10);
|
|
190
190
|
return;
|
|
191
191
|
}
|
|
192
|
-
|
|
192
|
+
y(this, p, {
|
|
193
193
|
container: s,
|
|
194
194
|
track: this.querySelector(".ng-scroll-track"),
|
|
195
195
|
thumb: this.querySelector(".ng-scroll-thumb"),
|
|
196
196
|
left: this.querySelector(".ng-scroll-left"),
|
|
197
197
|
right: this.querySelector(".ng-scroll-right")
|
|
198
|
-
}), e(this,
|
|
198
|
+
}), e(this, se).call(this), e(this, ie).call(this), this.refresh();
|
|
199
199
|
}, "initWhenReady");
|
|
200
200
|
t();
|
|
201
201
|
}
|
|
@@ -203,26 +203,26 @@ const Te = class Te extends HTMLElement {
|
|
|
203
203
|
e(this, P) && e(this, P).disconnect();
|
|
204
204
|
}
|
|
205
205
|
};
|
|
206
|
-
_ = new WeakMap(), B = new WeakMap(),
|
|
207
|
-
let
|
|
208
|
-
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar",
|
|
209
|
-
var X,
|
|
206
|
+
_ = new WeakMap(), B = new WeakMap(), p = new WeakMap(), D = new WeakMap(), N = new WeakMap(), P = new WeakMap(), ie = new WeakMap(), V = new WeakMap(), se = new WeakMap(), l(Te, "NineTableHScrollBar");
|
|
207
|
+
let ye = Te;
|
|
208
|
+
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", ye);
|
|
209
|
+
var X, I, E, z, M, H, ne, re;
|
|
210
210
|
const qe = class qe {
|
|
211
211
|
constructor(i) {
|
|
212
212
|
u(this, X);
|
|
213
|
-
u(this,
|
|
213
|
+
u(this, I, []);
|
|
214
214
|
u(this, E, null);
|
|
215
215
|
u(this, z, null);
|
|
216
|
+
u(this, M, 0);
|
|
216
217
|
u(this, H, 0);
|
|
217
|
-
u(this,
|
|
218
|
-
|
|
219
|
-
e(this, ne).call(this);
|
|
218
|
+
u(this, ne, /* @__PURE__ */ l(() => {
|
|
219
|
+
e(this, re).call(this);
|
|
220
220
|
}, "#init"));
|
|
221
221
|
/**
|
|
222
222
|
* π― λ·°ν¬νΈ ν¬κΈ° λ³ν μμ μ λμ΄ κ³μ° λ° νμν ν κ°μ μ°μ Β·μΊμ±μ μκ²°
|
|
223
223
|
*/
|
|
224
|
-
u(this,
|
|
225
|
-
!e(this, X) || !(e(this, X) instanceof HTMLElement) || (
|
|
224
|
+
u(this, re, /* @__PURE__ */ l(() => {
|
|
225
|
+
!e(this, X) || !(e(this, X) instanceof HTMLElement) || (y(this, z, new ResizeObserver((i) => {
|
|
226
226
|
for (const t of i) {
|
|
227
227
|
const s = t.target;
|
|
228
228
|
if (!s.classList.contains("active"))
|
|
@@ -231,13 +231,13 @@ const qe = class qe {
|
|
|
231
231
|
if (n > 0) {
|
|
232
232
|
const r = s.clientHeight || s.getBoundingClientRect().height || n;
|
|
233
233
|
let o = 0;
|
|
234
|
-
const h = s.querySelector(".ng-container-body") || s,
|
|
235
|
-
|
|
234
|
+
const h = s.querySelector(".ng-container-body") || s, g = h.querySelector("thead"), c = h.querySelector("tfoot");
|
|
235
|
+
g && (o += g.offsetHeight || g.getBoundingClientRect().height), c && (o += c.offsetHeight || c.getBoundingClientRect().height);
|
|
236
236
|
const d = Math.max(r - o, 100);
|
|
237
|
-
if (e(this,
|
|
238
|
-
const
|
|
239
|
-
|
|
240
|
-
const f = s.querySelector(
|
|
237
|
+
if (e(this, M) !== d && (y(this, M, d), e(this, E) !== null)) {
|
|
238
|
+
const a = Math.ceil(e(this, M) / e(this, E));
|
|
239
|
+
y(this, H, a + 20), $.log(`[RowManager] Resized. Height: ${e(this, M)}px | Target Rows: ${e(this, H)}`), [".ng-container-body", ".ng-container-left", ".ng-container-right"].forEach((b) => {
|
|
240
|
+
const f = s.querySelector(b);
|
|
241
241
|
f && f.querySelector("tbody") && this.renderRows(f);
|
|
242
242
|
});
|
|
243
243
|
}
|
|
@@ -249,32 +249,32 @@ const qe = class qe {
|
|
|
249
249
|
const t = i.querySelector("tbody.bindable") || i.querySelector("tbody");
|
|
250
250
|
if (!t) return;
|
|
251
251
|
const s = Array.from(t.querySelectorAll("tr")).filter((n) => !n.classList.contains("nodata"));
|
|
252
|
-
|
|
252
|
+
y(this, I, s.map((n) => n.cloneNode(!0))), y(this, E, null), console.log(`[RowManager] Template initialized with ${e(this, I).length} row(s).`);
|
|
253
253
|
}, "initTemplate"));
|
|
254
254
|
v(this, "measureAndCacheHeight", /* @__PURE__ */ l((i) => {
|
|
255
255
|
if (e(this, E) !== null && e(this, E) > 0)
|
|
256
256
|
return e(this, E);
|
|
257
|
-
if (e(this,
|
|
257
|
+
if (e(this, I).length === 0)
|
|
258
258
|
throw new Error("[RowManager] Template TRs are empty.");
|
|
259
259
|
const t = i.querySelector("tbody.bindable") || i.querySelector("tbody");
|
|
260
260
|
if (!t) return 24;
|
|
261
|
-
t.querySelectorAll("tr:not(.nodata)").forEach((
|
|
261
|
+
t.querySelectorAll("tr:not(.nodata)").forEach((a) => a.remove());
|
|
262
262
|
const s = t.querySelector("tr.nodata"), n = document.createDocumentFragment();
|
|
263
|
-
e(this,
|
|
264
|
-
n.appendChild(
|
|
263
|
+
e(this, I).forEach((a) => {
|
|
264
|
+
n.appendChild(a.cloneNode(!0));
|
|
265
265
|
}), s ? s.before(n) : t.appendChild(n);
|
|
266
|
-
const r = i.closest("nine-table-sheet"), o = r ? r.style.display : "", h = r ? r.style.visibility : "",
|
|
266
|
+
const r = i.closest("nine-table-sheet"), o = r ? r.style.display : "", h = r ? r.style.visibility : "", g = r ? r.style.position : "";
|
|
267
267
|
r && (r.style.display === "none" || window.getComputedStyle(r).display === "none") && (r.style.display = "block", r.style.visibility = "hidden", r.style.position = "absolute");
|
|
268
|
-
let
|
|
269
|
-
if (t.querySelectorAll("tr:not(.nodata)").forEach((
|
|
270
|
-
const f =
|
|
271
|
-
f === 0 ?
|
|
272
|
-
}), r && (r.style.display = o, r.style.visibility = h, r.style.position =
|
|
273
|
-
const
|
|
274
|
-
|
|
268
|
+
let c = 0;
|
|
269
|
+
if (t.querySelectorAll("tr:not(.nodata)").forEach((a, b) => {
|
|
270
|
+
const f = a.offsetHeight || a.getBoundingClientRect().height;
|
|
271
|
+
f === 0 ? c += 40 : c += f;
|
|
272
|
+
}), r && (r.style.display = o, r.style.visibility = h, r.style.position = g), y(this, E, c), e(this, M) > 0) {
|
|
273
|
+
const a = Math.ceil(e(this, M) / e(this, E));
|
|
274
|
+
y(this, H, a + 20);
|
|
275
275
|
} else
|
|
276
|
-
|
|
277
|
-
return console.log(`[RowManager] Template Height Cached: ${e(this, E)}px | RowCount: ${e(this,
|
|
276
|
+
y(this, H, 40);
|
|
277
|
+
return console.log(`[RowManager] Template Height Cached: ${e(this, E)}px | RowCount: ${e(this, H)}`), e(this, E);
|
|
278
278
|
}, "measureAndCacheHeight"));
|
|
279
279
|
/**
|
|
280
280
|
* π― μΊμλ ν κ°μ λ°ν (μμ λλ§ μ΅μνμ λ°©μ΄ μ°μ°)
|
|
@@ -293,29 +293,29 @@ const qe = class qe {
|
|
|
293
293
|
* π― μΊμλ ν κ°μλ₯Ό κ³§λ°λ‘ κ°μ Έμμ TR λΌλ μ£Όμ
(μ€λ³΅ κ³μ° μ κ±°)
|
|
294
294
|
*/
|
|
295
295
|
v(this, "renderRows", /* @__PURE__ */ l((i) => {
|
|
296
|
-
if (e(this,
|
|
296
|
+
if (e(this, I).length === 0) return;
|
|
297
297
|
const t = i.querySelector("tbody.bindable") || i.querySelector("tbody");
|
|
298
298
|
if (!t) return;
|
|
299
299
|
t.querySelectorAll("tr:not(.nodata)").forEach((o) => o.remove());
|
|
300
|
-
const s = t.querySelector("tr.nodata"), n = document.createDocumentFragment(), r = e(this,
|
|
300
|
+
const s = t.querySelector("tr.nodata"), n = document.createDocumentFragment(), r = e(this, H);
|
|
301
301
|
for (let o = 0; o < r; o++)
|
|
302
|
-
e(this,
|
|
302
|
+
e(this, I).forEach((h) => {
|
|
303
303
|
n.appendChild(h.cloneNode(!0));
|
|
304
304
|
});
|
|
305
305
|
s ? s.before(n) : t.appendChild(n), console.log(`[RowManager] Rendered ${r} sets into DOM.`);
|
|
306
306
|
}, "renderRows"));
|
|
307
307
|
v(this, "destroy", /* @__PURE__ */ l(() => {
|
|
308
|
-
e(this, z) && (e(this, z).disconnect(),
|
|
308
|
+
e(this, z) && (e(this, z).disconnect(), y(this, z, null));
|
|
309
309
|
}, "destroy"));
|
|
310
|
-
|
|
310
|
+
y(this, X, i), e(this, ne).call(this);
|
|
311
311
|
}
|
|
312
312
|
get templateLength() {
|
|
313
|
-
return e(this,
|
|
313
|
+
return e(this, I).length || 1;
|
|
314
314
|
}
|
|
315
315
|
};
|
|
316
|
-
X = new WeakMap(),
|
|
316
|
+
X = new WeakMap(), I = new WeakMap(), E = new WeakMap(), z = new WeakMap(), M = new WeakMap(), H = new WeakMap(), ne = new WeakMap(), re = new WeakMap(), l(qe, "RowManager");
|
|
317
317
|
let pe = qe;
|
|
318
|
-
var L, K,
|
|
318
|
+
var L, K, oe;
|
|
319
319
|
const G = class G extends HTMLElement {
|
|
320
320
|
constructor() {
|
|
321
321
|
super();
|
|
@@ -323,70 +323,70 @@ const G = class G extends HTMLElement {
|
|
|
323
323
|
u(this, K);
|
|
324
324
|
v(this, "init", /* @__PURE__ */ l((t) => {
|
|
325
325
|
if (!t) return;
|
|
326
|
-
const s = /* @__PURE__ */ l((
|
|
327
|
-
const d = /* @__PURE__ */ l((
|
|
328
|
-
if (
|
|
329
|
-
const f =
|
|
326
|
+
const s = /* @__PURE__ */ l((c) => {
|
|
327
|
+
const d = /* @__PURE__ */ l((b) => {
|
|
328
|
+
if (b.querySelector("colgroup")) return;
|
|
329
|
+
const f = b.querySelector("tbody tr") || b.querySelector("tr"), S = f ? f.querySelectorAll("th, td").length : 1, x = document.createElement("colgroup"), C = Math.max(Math.floor((b.clientWidth || 600) / S), 100);
|
|
330
330
|
for (let q = 0; q < S; q++) {
|
|
331
331
|
const U = document.createElement("col");
|
|
332
|
-
U.setAttribute("width",
|
|
332
|
+
U.setAttribute("width", C), x.appendChild(U);
|
|
333
333
|
}
|
|
334
|
-
|
|
335
|
-
}, "ensureColgroup"),
|
|
336
|
-
if (
|
|
337
|
-
const f = document.createElement("thead"), S =
|
|
338
|
-
S ? S.after(f) :
|
|
334
|
+
b.prepend(x);
|
|
335
|
+
}, "ensureColgroup"), a = /* @__PURE__ */ l((b) => {
|
|
336
|
+
if (b.querySelector("thead")) return;
|
|
337
|
+
const f = document.createElement("thead"), S = b.querySelector("colgroup");
|
|
338
|
+
S ? S.after(f) : b.prepend(f);
|
|
339
339
|
}, "ensureThead");
|
|
340
|
-
return d(
|
|
340
|
+
return d(c), a(c), c.classList.add("nine-table-element"), c;
|
|
341
341
|
}, "initializeTable"), n = t.cloneNode(!0);
|
|
342
|
-
|
|
343
|
-
const r = this.querySelector(".ng-container-left"), o = this.querySelector(".ng-container-body"), h = this.querySelector(".ng-container-right"),
|
|
344
|
-
const
|
|
345
|
-
return f.forEach((x,
|
|
342
|
+
y(this, L, s(n)), e(this, L).style.display = "table", e(this, K).initTemplate(e(this, L));
|
|
343
|
+
const r = this.querySelector(".ng-container-left"), o = this.querySelector(".ng-container-body"), h = this.querySelector(".ng-container-right"), g = /* @__PURE__ */ l((c, d, a = !1) => {
|
|
344
|
+
const b = c.cloneNode(!0), f = Array.from(b.querySelectorAll("colgroup col")), S = [];
|
|
345
|
+
return f.forEach((x, C) => {
|
|
346
346
|
const q = x.getAttribute("fixed");
|
|
347
|
-
(
|
|
347
|
+
(a ? q !== "left" && q !== "right" : q === d) || S.push(C);
|
|
348
348
|
}), S.reverse().forEach((x) => {
|
|
349
|
-
f[x] && f[x].remove(),
|
|
350
|
-
const q =
|
|
349
|
+
f[x] && f[x].remove(), b.querySelectorAll("tr").forEach((C) => {
|
|
350
|
+
const q = C.querySelectorAll("th, td");
|
|
351
351
|
q[x] && q[x].remove();
|
|
352
352
|
});
|
|
353
|
-
}),
|
|
353
|
+
}), b;
|
|
354
354
|
}, "filterTableByFixed");
|
|
355
355
|
if (o) {
|
|
356
|
-
const
|
|
357
|
-
o.innerHTML = "", o.appendChild(
|
|
356
|
+
const c = g(e(this, L), null, !0);
|
|
357
|
+
o.innerHTML = "", o.appendChild(c), e(this, K).measureAndCacheHeight(o);
|
|
358
358
|
}
|
|
359
359
|
if (r) {
|
|
360
|
-
const
|
|
360
|
+
const c = g(e(this, L), "left", !1);
|
|
361
361
|
let d = 0;
|
|
362
|
-
|
|
363
|
-
const f = parseInt(
|
|
362
|
+
c.querySelectorAll("col").forEach((b) => {
|
|
363
|
+
const f = parseInt(b.getAttribute("width"), 10);
|
|
364
364
|
isNaN(f) || (d += f);
|
|
365
|
-
}), r.innerHTML = "", r.appendChild(
|
|
366
|
-
const
|
|
367
|
-
r.style.flex = `0 0 ${
|
|
365
|
+
}), r.innerHTML = "", r.appendChild(c);
|
|
366
|
+
const a = d > 0 ? d : 0;
|
|
367
|
+
r.style.flex = `0 0 ${a}px`, r.style.width = `${a}px`;
|
|
368
368
|
}
|
|
369
369
|
if (h) {
|
|
370
|
-
const
|
|
370
|
+
const c = g(e(this, L), "right", !1);
|
|
371
371
|
let d = 0;
|
|
372
|
-
|
|
373
|
-
const f = parseInt(
|
|
372
|
+
c.querySelectorAll("col").forEach((b) => {
|
|
373
|
+
const f = parseInt(b.getAttribute("width"), 10);
|
|
374
374
|
isNaN(f) || (d += f);
|
|
375
|
-
}), h.innerHTML = "", h.appendChild(
|
|
376
|
-
const
|
|
377
|
-
h.style.flex = `0 0 ${
|
|
375
|
+
}), h.innerHTML = "", h.appendChild(c);
|
|
376
|
+
const a = d > 0 ? d : 0;
|
|
377
|
+
h.style.flex = `0 0 ${a}px`, h.style.width = `${a}px`;
|
|
378
378
|
}
|
|
379
379
|
if (o) {
|
|
380
|
-
const
|
|
381
|
-
o.style.overflowY =
|
|
380
|
+
const c = this.getRowCount();
|
|
381
|
+
o.style.overflowY = c > 10 ? "auto" : "hidden", o.addEventListener("scroll", () => {
|
|
382
382
|
const d = this.querySelector("nine-table-hscrollbar");
|
|
383
383
|
d && typeof d.refresh == "function" && d.refresh();
|
|
384
384
|
});
|
|
385
385
|
}
|
|
386
386
|
setTimeout(() => {
|
|
387
|
-
const
|
|
388
|
-
|
|
389
|
-
}, 0),
|
|
387
|
+
const c = this.querySelector("nine-table-hscrollbar");
|
|
388
|
+
c && typeof c.refresh == "function" && c.refresh();
|
|
389
|
+
}, 0), $.log(`NineTableSheet 3-split initialized with rows: ${this.getRowCount()}`);
|
|
390
390
|
}, "init"));
|
|
391
391
|
v(this, "getRowCount", /* @__PURE__ */ l(() => e(this, L) ? e(this, L).querySelectorAll("tbody tr").length : 0, "getRowCount"));
|
|
392
392
|
v(this, "scrollToX", /* @__PURE__ */ l((t) => {
|
|
@@ -397,7 +397,7 @@ const G = class G extends HTMLElement {
|
|
|
397
397
|
const s = this.querySelector(".ng-container-body");
|
|
398
398
|
s && (s.scrollTop = t);
|
|
399
399
|
}, "scrollToY"));
|
|
400
|
-
u(this,
|
|
400
|
+
u(this, oe, /* @__PURE__ */ l(() => {
|
|
401
401
|
const t = G.SCROLLBAR_SIZE;
|
|
402
402
|
this.innerHTML = `
|
|
403
403
|
<style>
|
|
@@ -514,23 +514,23 @@ const G = class G extends HTMLElement {
|
|
|
514
514
|
</div>
|
|
515
515
|
`;
|
|
516
516
|
}, "#render"));
|
|
517
|
-
|
|
517
|
+
y(this, K, new pe(this));
|
|
518
518
|
}
|
|
519
519
|
connectedCallback() {
|
|
520
|
-
e(this,
|
|
520
|
+
e(this, oe).call(this);
|
|
521
521
|
}
|
|
522
522
|
disconnectedCallback() {
|
|
523
|
-
this.innerHTML = "",
|
|
523
|
+
this.innerHTML = "", $.log("NineTableSheet destroyed.");
|
|
524
524
|
}
|
|
525
525
|
};
|
|
526
|
-
L = new WeakMap(), K = new WeakMap(),
|
|
527
|
-
let
|
|
528
|
-
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet",
|
|
529
|
-
var
|
|
530
|
-
const
|
|
526
|
+
L = new WeakMap(), K = new WeakMap(), oe = new WeakMap(), l(G, "NineTableSheet"), v(G, "SCROLLBAR_SIZE", 16);
|
|
527
|
+
let te = G;
|
|
528
|
+
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", te);
|
|
529
|
+
var le;
|
|
530
|
+
const Ae = class Ae extends HTMLElement {
|
|
531
531
|
constructor() {
|
|
532
532
|
super();
|
|
533
|
-
u(this,
|
|
533
|
+
u(this, le, /* @__PURE__ */ l(() => {
|
|
534
534
|
const t = this.querySelector(".nine-tab-bar");
|
|
535
535
|
t && (t.addEventListener("click", (s) => {
|
|
536
536
|
const n = s.target.closest(".nine-tab-item");
|
|
@@ -540,80 +540,80 @@ const Ce = class Ce extends HTMLElement {
|
|
|
540
540
|
}), this.switchSheet(0, !1));
|
|
541
541
|
}, "#init"));
|
|
542
542
|
v(this, "switchSheet", /* @__PURE__ */ l((t, s = !1) => {
|
|
543
|
-
const n = /* @__PURE__ */ l((
|
|
544
|
-
const
|
|
545
|
-
Array.from(
|
|
546
|
-
const S =
|
|
543
|
+
const n = /* @__PURE__ */ l((a) => {
|
|
544
|
+
const b = Array.from(a.querySelectorAll("nine-table-sheet"));
|
|
545
|
+
Array.from(a.querySelectorAll("nine-splitter")).forEach((x) => x.style.setProperty("display", "none"));
|
|
546
|
+
const S = b.filter((x) => x.classList.contains("active"));
|
|
547
547
|
S.length < 2 || S.forEach((x) => {
|
|
548
|
-
const
|
|
548
|
+
const C = parseInt(x.getAttribute("data-index"), 10), q = a.querySelector(`nine-splitter[data-split-index="${C}"]`), U = b[C + 1];
|
|
549
549
|
q && U && U.classList.contains("active") && q.style.setProperty("display", "block");
|
|
550
550
|
});
|
|
551
|
-
}, "updateSplitters"), r = this.querySelector(".nine-tab-bar"), o = this.querySelector("nine-table-sheets-body"), h = r.querySelectorAll(".nine-tab-item"),
|
|
551
|
+
}, "updateSplitters"), r = this.querySelector(".nine-tab-bar"), o = this.querySelector("nine-table-sheets-body"), h = r.querySelectorAll(".nine-tab-item"), g = o.querySelectorAll("nine-table-sheet");
|
|
552
552
|
if (!h[t]) return;
|
|
553
553
|
if (!s)
|
|
554
|
-
h.forEach((
|
|
555
|
-
|
|
556
|
-
const f = o.querySelector(`nine-table-sheet[data-index="${
|
|
554
|
+
h.forEach((a, b) => {
|
|
555
|
+
a.classList.toggle("active", b === t);
|
|
556
|
+
const f = o.querySelector(`nine-table-sheet[data-index="${b}"]`);
|
|
557
557
|
f && (f.style.flex = "");
|
|
558
|
-
}),
|
|
559
|
-
|
|
558
|
+
}), g.forEach((a, b) => {
|
|
559
|
+
a.classList.toggle("active", b === t);
|
|
560
560
|
});
|
|
561
561
|
else {
|
|
562
|
-
const
|
|
563
|
-
if (
|
|
562
|
+
const a = h[t], b = r.querySelectorAll(".nine-tab-item.active");
|
|
563
|
+
if (a.classList.contains("active") && b.length <= 1)
|
|
564
564
|
return;
|
|
565
|
-
|
|
565
|
+
a.classList.toggle("active");
|
|
566
566
|
const f = o.querySelector(`nine-table-sheet[data-index="${t}"]`);
|
|
567
567
|
f && (f.classList.toggle("active"), f.classList.contains("active") || (f.style.flex = ""));
|
|
568
568
|
}
|
|
569
|
-
const
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
}) :
|
|
573
|
-
|
|
569
|
+
const c = Array.from(o.querySelectorAll("nine-table-sheet.active"));
|
|
570
|
+
c.length > 1 ? c.forEach((a) => {
|
|
571
|
+
a.style.flex = "1 1 0%";
|
|
572
|
+
}) : c.forEach((a) => {
|
|
573
|
+
a.style.flex = "1 1 100%";
|
|
574
574
|
}), n(o);
|
|
575
575
|
const d = o.querySelector("nine-table-sheet.active");
|
|
576
576
|
if (d && typeof d.getRowCount == "function") {
|
|
577
|
-
const
|
|
578
|
-
|
|
577
|
+
const a = this.querySelector("#row-count");
|
|
578
|
+
a && (a.textContent = d.getRowCount().toLocaleString());
|
|
579
579
|
}
|
|
580
580
|
}, "switchSheet"));
|
|
581
581
|
}
|
|
582
582
|
connectedCallback() {
|
|
583
|
-
e(this,
|
|
583
|
+
e(this, le).call(this);
|
|
584
584
|
}
|
|
585
585
|
};
|
|
586
|
-
|
|
587
|
-
let we =
|
|
586
|
+
le = new WeakMap(), l(Ae, "NineTableSheets");
|
|
587
|
+
let we = Ae;
|
|
588
588
|
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", we);
|
|
589
|
-
var R, J,
|
|
589
|
+
var R, J, ae, Q, ce;
|
|
590
590
|
const ke = class ke {
|
|
591
591
|
constructor(i) {
|
|
592
592
|
u(this, R);
|
|
593
593
|
u(this, J, null);
|
|
594
|
-
u(this,
|
|
594
|
+
u(this, ae, /* @__PURE__ */ l(() => {
|
|
595
595
|
const i = e(this, R).host;
|
|
596
|
-
i && (
|
|
596
|
+
i && (y(this, J, new ResizeObserver((t) => {
|
|
597
597
|
for (let s of t)
|
|
598
598
|
i.getAttribute("auto-height") === "true" && e(this, Q).call(this, i);
|
|
599
599
|
})), e(this, J).observe(i));
|
|
600
600
|
}, "#observeResize"));
|
|
601
601
|
u(this, Q, /* @__PURE__ */ l((i) => {
|
|
602
|
-
var
|
|
602
|
+
var S, x, C;
|
|
603
603
|
const t = e(this, R).querySelector("nine-table-sheet.active");
|
|
604
|
-
if (
|
|
605
|
-
const s = ((
|
|
606
|
-
|
|
607
|
-
const
|
|
608
|
-
i.style.height = `${
|
|
609
|
-
const
|
|
610
|
-
|
|
604
|
+
if ($.log(i), $.log(e(this, R)), $.log(t), !t) return;
|
|
605
|
+
const s = ((S = t.getRowCount) == null ? void 0 : S.call(t)) || 0, n = parseInt(i.getAttribute("max-display-row"), 10) || 10, r = Math.min(s, n), o = t.querySelector("tbody tr") || t.querySelector("tr"), h = o == null ? void 0 : o.getBoundingClientRect().height, g = (x = e(this, R).querySelector("nine-table-header")) == null ? void 0 : x.getBoundingClientRect().height, c = (C = e(this, R).querySelector("nine-table-sheets-footer")) == null ? void 0 : C.getBoundingClientRect().height, d = te.SCROLLBAR_SIZE;
|
|
606
|
+
$.log("rowHeight", h);
|
|
607
|
+
const a = g + c + d, b = r * h + a;
|
|
608
|
+
i.style.height = `${b}px`, i.style.maxHeight = `${n * h + a}px`;
|
|
609
|
+
const f = e(this, R).querySelector("nine-table-sheets-body");
|
|
610
|
+
f && (f.style.overflowY = s > n ? "auto" : "hidden");
|
|
611
611
|
}, "#applyAutoHeight"));
|
|
612
|
-
u(this,
|
|
613
|
-
const i = e(this, R).host, s = Array.from(i.children).filter((
|
|
614
|
-
const
|
|
615
|
-
return
|
|
616
|
-
}).join(""), h = s.map((
|
|
612
|
+
u(this, ce, /* @__PURE__ */ l(() => {
|
|
613
|
+
const i = e(this, R).host, s = Array.from(i.children).filter((c) => c.tagName === "TABLE"), n = i.getAttribute("auto-height") === "true", r = s.length, o = s.map((c, d) => {
|
|
614
|
+
const b = `<nine-table-sheet class="${d === 0 ? "active" : ""}" data-index="${d}"></nine-table-sheet>`, f = d < r - 1 ? `<nine-splitter class="h" data-split-index="${d}"></nine-splitter>` : "";
|
|
615
|
+
return b + f;
|
|
616
|
+
}).join(""), h = s.map((c, d) => `<div class="nine-tab-item ${d === 0 ? "active" : ""}" data-index="${d}">Sheet ${d + 1}</div>`).join("");
|
|
617
617
|
e(this, R).innerHTML = `
|
|
618
618
|
<style>
|
|
619
619
|
:host {
|
|
@@ -721,32 +721,32 @@ const ke = class ke {
|
|
|
721
721
|
</nine-table-body>
|
|
722
722
|
<nine-table-footer></nine-table-footer>
|
|
723
723
|
`;
|
|
724
|
-
const
|
|
725
|
-
|
|
724
|
+
const g = e(this, R).querySelectorAll("nine-table-sheet");
|
|
725
|
+
g == null || g.forEach((c, d) => {
|
|
726
726
|
s[d] && setTimeout(() => {
|
|
727
|
-
|
|
727
|
+
c.init(s[d]), n && e(this, Q).call(this, i);
|
|
728
728
|
});
|
|
729
729
|
});
|
|
730
730
|
}, "#render"));
|
|
731
|
-
|
|
731
|
+
y(this, R, i), e(this, ce).call(this), e(this, ae).call(this);
|
|
732
732
|
}
|
|
733
733
|
};
|
|
734
|
-
R = new WeakMap(), J = new WeakMap(),
|
|
734
|
+
R = new WeakMap(), J = new WeakMap(), ae = new WeakMap(), Q = new WeakMap(), ce = new WeakMap(), l(ke, "LayoutManager");
|
|
735
735
|
let me = ke;
|
|
736
736
|
var W, Y;
|
|
737
|
-
const
|
|
737
|
+
const Ce = class Ce {
|
|
738
738
|
constructor(i) {
|
|
739
739
|
u(this, W);
|
|
740
740
|
u(this, Y, -1);
|
|
741
741
|
v(this, "count", /* @__PURE__ */ l(() => e(this, W).rawRecords.length, "count"));
|
|
742
|
-
|
|
742
|
+
y(this, W, i);
|
|
743
743
|
}
|
|
744
744
|
get at() {
|
|
745
745
|
return e(this, Y);
|
|
746
746
|
}
|
|
747
747
|
set at(i) {
|
|
748
748
|
var s, n;
|
|
749
|
-
|
|
749
|
+
y(this, Y, parseInt(i, 10));
|
|
750
750
|
const t = ((n = (s = e(this, W).owner).querySelector) == null ? void 0 : n.call(s, ".ng-container-body")) || e(this, W).owner.body;
|
|
751
751
|
t && !t.querySelector(`tbody.bindable tr[data-row="${e(this, Y)}"]`) && setTimeout(() => {
|
|
752
752
|
var r, o;
|
|
@@ -754,19 +754,19 @@ const Ae = class Ae {
|
|
|
754
754
|
});
|
|
755
755
|
}
|
|
756
756
|
};
|
|
757
|
-
W = new WeakMap(), Y = new WeakMap(), l(
|
|
758
|
-
let ve =
|
|
759
|
-
var T, m, k, Z,
|
|
760
|
-
const
|
|
757
|
+
W = new WeakMap(), Y = new WeakMap(), l(Ce, "ngRow");
|
|
758
|
+
let ve = Ce;
|
|
759
|
+
var T, m, k, Z, he, O, de, ee, fe, ue, j;
|
|
760
|
+
const A = class A {
|
|
761
761
|
constructor(i, t) {
|
|
762
762
|
u(this, T);
|
|
763
763
|
u(this, m);
|
|
764
764
|
u(this, k, []);
|
|
765
765
|
u(this, Z, []);
|
|
766
|
-
u(this,
|
|
766
|
+
u(this, he, 0);
|
|
767
767
|
u(this, O, []);
|
|
768
|
-
u(this,
|
|
769
|
-
|
|
768
|
+
u(this, de, /* @__PURE__ */ l(() => {
|
|
769
|
+
y(this, O, []);
|
|
770
770
|
const i = e(this, T).template || [];
|
|
771
771
|
Array.from(i).forEach((t) => {
|
|
772
772
|
var s;
|
|
@@ -779,22 +779,22 @@ const C = class C {
|
|
|
779
779
|
this.clear(), this.add(i, !1);
|
|
780
780
|
}, "set"));
|
|
781
781
|
u(this, ee, /* @__PURE__ */ l(() => ({
|
|
782
|
-
rowState:
|
|
782
|
+
rowState: A.ROW_STATE.EMPTY,
|
|
783
783
|
deleted: !1,
|
|
784
784
|
filtered: !1,
|
|
785
785
|
height: e(this, O).slice(),
|
|
786
786
|
o: {},
|
|
787
787
|
c: {},
|
|
788
|
-
_: [0, 0, 0, 0,
|
|
788
|
+
_: [0, 0, 0, 0, A.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, e(this, O).slice(), -1, {}, {}]
|
|
789
789
|
}), "#getDefaultMeta"));
|
|
790
790
|
v(this, "reset", /* @__PURE__ */ l(() => {
|
|
791
|
-
|
|
791
|
+
y(this, k, []), y(this, Z, []);
|
|
792
792
|
}, "reset"));
|
|
793
793
|
v(this, "clear", /* @__PURE__ */ l(() => {
|
|
794
794
|
var i;
|
|
795
|
-
e(this, m).rawRecords = [],
|
|
795
|
+
e(this, m).rawRecords = [], y(this, k, []), y(this, Z, []), (i = e(this, m).viewRecords) != null && i.reset && e(this, m).viewRecords.reset();
|
|
796
796
|
}, "clear"));
|
|
797
|
-
u(this,
|
|
797
|
+
u(this, fe, /* @__PURE__ */ l((i) => {
|
|
798
798
|
var n;
|
|
799
799
|
Array.isArray(i) || (i = [i]);
|
|
800
800
|
const t = typeof ((n = e(this, T).fields) == null ? void 0 : n.get) == "function" ? e(this, T).fields.get() : Object.keys(i[0] || {}), s = [];
|
|
@@ -805,18 +805,18 @@ const C = class C {
|
|
|
805
805
|
}), s.push(o);
|
|
806
806
|
}), s;
|
|
807
807
|
}, "#json2Array"));
|
|
808
|
-
u(this,
|
|
809
|
-
t.__ng = e(this, ee).call(this), t.__ng.rowid = this.nextId, t.__ng.rowState =
|
|
808
|
+
u(this, ue, /* @__PURE__ */ l((i) => (Array.isArray(i) || (i = [i]), i.forEach((t) => {
|
|
809
|
+
t.__ng = e(this, ee).call(this), t.__ng.rowid = this.nextId, t.__ng.rowState = A.ROW_STATE.INSERT, t.__ng._[0] = t.__ng.rowid;
|
|
810
810
|
}), i), "#defaultInsert"));
|
|
811
811
|
v(this, "add", /* @__PURE__ */ l((i, t = !0) => {
|
|
812
812
|
var r;
|
|
813
813
|
i === void 0 && (i = {});
|
|
814
|
-
const s = e(this,
|
|
815
|
-
e(this, m).rawRecords = e(this, m).rawRecords.concat(e(this,
|
|
814
|
+
const s = e(this, fe).call(this, i);
|
|
815
|
+
e(this, m).rawRecords = e(this, m).rawRecords.concat(e(this, ue).call(this, s)), this.resetRecords();
|
|
816
816
|
const n = this.count() - 1;
|
|
817
817
|
return t || s.forEach((o, h) => {
|
|
818
|
-
const
|
|
819
|
-
|
|
818
|
+
const g = e(this, m).rawRecords[n - h];
|
|
819
|
+
g && (g.__ng.rowState = A.ROW_STATE.EMPTY);
|
|
820
820
|
}), (r = e(this, m).viewRecords) != null && r.reset && e(this, m).viewRecords.reset(), n;
|
|
821
821
|
}, "add"));
|
|
822
822
|
v(this, "delete", /* @__PURE__ */ l((i) => {
|
|
@@ -825,24 +825,24 @@ const C = class C {
|
|
|
825
825
|
Array.isArray(i) ? t = i : typeof i > "u" ? t = [e(this, m).owner.row.at] : t = [parseInt(i, 10)], t.sort((n, r) => r - n).forEach((n) => {
|
|
826
826
|
if (e(this, k)[n]) {
|
|
827
827
|
const r = e(this, k)[n].__ng.rowid;
|
|
828
|
-
e(this, k)[n].__ng.rowState ===
|
|
829
|
-
o.__ng.rowid === r && (o.__ng.deleted = !0, o.__ng.rowState =
|
|
828
|
+
e(this, k)[n].__ng.rowState === A.ROW_STATE.INSERT ? e(this, m).rawRecords = e(this, m).rawRecords.filter((o) => o.__ng.rowid !== r) : e(this, m).rawRecords.forEach((o) => {
|
|
829
|
+
o.__ng.rowid === r && (o.__ng.deleted = !0, o.__ng.rowState = A.ROW_STATE.DELETE);
|
|
830
830
|
});
|
|
831
831
|
}
|
|
832
832
|
}), this.resetRecords(), (s = e(this, m).viewRecords) != null && s.reset && e(this, m).viewRecords.reset();
|
|
833
833
|
}, "delete"));
|
|
834
834
|
v(this, "setValue", /* @__PURE__ */ l((i, t, s) => {
|
|
835
|
-
var
|
|
835
|
+
var g;
|
|
836
836
|
i = parseInt(i, 10);
|
|
837
|
-
const r = (typeof ((
|
|
837
|
+
const r = (typeof ((g = e(this, T).fields) == null ? void 0 : g.get) == "function" ? e(this, T).fields.get() : []).indexOf(t);
|
|
838
838
|
if (r < 0) return;
|
|
839
839
|
const o = this.getValidData()[i];
|
|
840
840
|
if (!o) return;
|
|
841
841
|
const h = o.v[r];
|
|
842
|
-
h !== s && o.__ng.rowState !==
|
|
842
|
+
h !== s && o.__ng.rowState !== A.ROW_STATE.INSERT && (o.__ng.o.hasOwnProperty(t) || (o.__ng.o[t] = h), o.__ng.rowState = A.ROW_STATE.UPDATE), o.v[r] = s, e(this, m).owner.refreshData && e(this, m).owner.refreshData(i);
|
|
843
843
|
}, "setValue"));
|
|
844
844
|
v(this, "resetRecords", /* @__PURE__ */ l(() => {
|
|
845
|
-
|
|
845
|
+
y(this, Z, e(this, m).rawRecords.filter((i) => !i.__ng.deleted)), y(this, k, e(this, m).rawRecords.filter((i) => !i.__ng.deleted && !i.__ng.filtered)), e(this, m).rawRecords.forEach((i, t) => {
|
|
846
846
|
i.__ng.rowidx = t;
|
|
847
847
|
}), e(this, k).forEach((i, t) => {
|
|
848
848
|
i.__ng.i = t;
|
|
@@ -874,7 +874,7 @@ const C = class C {
|
|
|
874
874
|
}
|
|
875
875
|
return e(this, j).call(this, s[i]);
|
|
876
876
|
}, "get"));
|
|
877
|
-
|
|
877
|
+
y(this, T, i), y(this, m, t), e(this, de).call(this);
|
|
878
878
|
}
|
|
879
879
|
get source() {
|
|
880
880
|
return e(this, j).call(this, e(this, m).rawRecords);
|
|
@@ -883,18 +883,18 @@ const C = class C {
|
|
|
883
883
|
this.clear(), this.add(i, !1);
|
|
884
884
|
}
|
|
885
885
|
get nextId() {
|
|
886
|
-
return ++$e(this,
|
|
886
|
+
return ++$e(this, he)._;
|
|
887
887
|
}
|
|
888
888
|
};
|
|
889
|
-
T = new WeakMap(), m = new WeakMap(), k = new WeakMap(), Z = new WeakMap(),
|
|
890
|
-
v(
|
|
889
|
+
T = new WeakMap(), m = new WeakMap(), k = new WeakMap(), Z = new WeakMap(), he = new WeakMap(), O = new WeakMap(), de = new WeakMap(), ee = new WeakMap(), fe = new WeakMap(), ue = new WeakMap(), j = new WeakMap(), l(A, "ngData"), // π― ν μν μ μ μμλ₯Ό ν΄λμ€ λ΄λΆλ‘ λ΄μ¬ν
|
|
890
|
+
v(A, "ROW_STATE", {
|
|
891
891
|
EMPTY: "EMPTY",
|
|
892
892
|
NORMAL: "NORMAL",
|
|
893
893
|
INSERT: "INSERT",
|
|
894
894
|
UPDATE: "UPDATE",
|
|
895
895
|
DELETE: "DELETE"
|
|
896
896
|
});
|
|
897
|
-
let xe =
|
|
897
|
+
let xe = A;
|
|
898
898
|
const Le = class Le {
|
|
899
899
|
constructor(i) {
|
|
900
900
|
this.owner = i, this.row = new ve(this), this.data = new xe(i, this), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.pageCnt = 25, this.viewRecords.reset = () => {
|
|
@@ -916,20 +916,20 @@ const Le = class Le {
|
|
|
916
916
|
};
|
|
917
917
|
l(Le, "ngDataManager");
|
|
918
918
|
let Se = Le;
|
|
919
|
-
var F,
|
|
919
|
+
var F, be;
|
|
920
920
|
const _e = class _e extends HTMLElement {
|
|
921
921
|
constructor() {
|
|
922
922
|
super();
|
|
923
923
|
//#created = false;
|
|
924
924
|
u(this, F);
|
|
925
|
-
u(this,
|
|
926
|
-
this.attachShadow({ mode: "open" }),
|
|
925
|
+
u(this, be);
|
|
926
|
+
this.attachShadow({ mode: "open" }), y(this, F, new Se(this));
|
|
927
927
|
}
|
|
928
928
|
connectedCallback() {
|
|
929
|
-
|
|
929
|
+
y(this, be, new me(this.shadowRoot)), $.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
|
|
930
930
|
}
|
|
931
931
|
disconnectedCallback() {
|
|
932
|
-
|
|
932
|
+
$.log("NineTable disconnected.");
|
|
933
933
|
}
|
|
934
934
|
// π― μΈλΆμμ grid.data.set(...) ννλ‘ μ κ·Όν μ μλλ‘ λ°μ΄ν° λ§€λμ μ€ν
|
|
935
935
|
get data() {
|
|
@@ -944,7 +944,7 @@ const _e = class _e extends HTMLElement {
|
|
|
944
944
|
return e(this, F);
|
|
945
945
|
}
|
|
946
946
|
};
|
|
947
|
-
F = new WeakMap(),
|
|
947
|
+
F = new WeakMap(), be = new WeakMap(), l(_e, "NineTable");
|
|
948
948
|
let Ee = _e;
|
|
949
949
|
customElements.get("nine-table") || customElements.define("nine-table", Ee);
|
|
950
950
|
//# sourceMappingURL=nine-table.js.map
|