@ninebone/table 0.0.105 β 0.0.107
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 +341 -301
- package/dist/nine-table.js.map +1 -1
- package/dist/nine-table.umd.js +5 -5
- package/dist/nine-table.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/nine-table.js
CHANGED
|
@@ -1,97 +1,97 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
throw TypeError(
|
|
1
|
+
var qe = Object.defineProperty;
|
|
2
|
+
var ke = (m) => {
|
|
3
|
+
throw TypeError(m);
|
|
4
4
|
};
|
|
5
|
-
var _e = (
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
var e = (
|
|
9
|
-
var
|
|
5
|
+
var _e = (m, s, t) => s in m ? qe(m, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : m[s] = t;
|
|
6
|
+
var l = (m, s) => qe(m, "name", { value: s, configurable: !0 });
|
|
7
|
+
var v = (m, s, t) => _e(m, typeof s != "symbol" ? s + "" : s, t), Le = (m, s, t) => s.has(m) || ke("Cannot " + t);
|
|
8
|
+
var e = (m, s, t) => (Le(m, s, "read from private field"), t ? t.call(m) : s.get(m)), f = (m, s, t) => s.has(m) ? ke("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(m) : s.set(m, t), y = (m, s, t, i) => (Le(m, s, "write to private field"), i ? i.call(m, t) : s.set(m, t), t);
|
|
9
|
+
var Ae = (m, s, t, i) => ({
|
|
10
10
|
set _(n) {
|
|
11
|
-
m
|
|
11
|
+
y(m, s, n, t);
|
|
12
12
|
},
|
|
13
13
|
get _() {
|
|
14
|
-
return e(
|
|
14
|
+
return e(m, s, i);
|
|
15
15
|
}
|
|
16
16
|
});
|
|
17
|
-
import { trace as
|
|
18
|
-
const
|
|
17
|
+
import { trace as Ce } from "@ninebone/util";
|
|
18
|
+
const me = class me extends Ce.constructor {
|
|
19
19
|
constructor() {
|
|
20
20
|
super(), this.init("nine-table", "green");
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
|
-
|
|
24
|
-
let
|
|
25
|
-
const
|
|
26
|
-
var
|
|
27
|
-
const
|
|
23
|
+
l(me, "Trace");
|
|
24
|
+
let ae = me;
|
|
25
|
+
const K = new ae();
|
|
26
|
+
var _, M, p, W, H, O, Z, z, j;
|
|
27
|
+
const we = class we extends HTMLElement {
|
|
28
28
|
constructor() {
|
|
29
29
|
super();
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
if (!e(this,
|
|
38
|
-
const t = e(this,
|
|
39
|
-
t && (
|
|
30
|
+
f(this, _);
|
|
31
|
+
f(this, M, !1);
|
|
32
|
+
f(this, p);
|
|
33
|
+
f(this, W);
|
|
34
|
+
f(this, H);
|
|
35
|
+
f(this, O);
|
|
36
|
+
f(this, Z, /* @__PURE__ */ l(() => {
|
|
37
|
+
if (!e(this, _)) return;
|
|
38
|
+
const t = e(this, _).querySelector(".ng-container-body");
|
|
39
|
+
t && (y(this, O, new ResizeObserver(() => {
|
|
40
40
|
this.refresh();
|
|
41
|
-
})), e(this,
|
|
41
|
+
})), e(this, O).observe(t));
|
|
42
42
|
}, "#observeResize"));
|
|
43
|
-
|
|
44
|
-
if (!e(this,
|
|
43
|
+
v(this, "refresh", /* @__PURE__ */ l(() => {
|
|
44
|
+
if (!e(this, _) || !e(this, p) || e(this, M)) return;
|
|
45
45
|
const t = e(this, p).container, i = t.querySelector("table");
|
|
46
46
|
if (!i) return;
|
|
47
|
-
const n = e(this, p).track,
|
|
48
|
-
if (c !== 0 &&
|
|
47
|
+
const n = e(this, p).track, o = e(this, p).thumb, r = e(this, _).querySelector(".ng-container-bottom"), c = t.clientWidth, b = i.scrollWidth;
|
|
48
|
+
if (c !== 0 && b > c)
|
|
49
49
|
r && (r.style.display = "flex");
|
|
50
50
|
else {
|
|
51
51
|
r && (r.style.display = "none");
|
|
52
52
|
return;
|
|
53
53
|
}
|
|
54
|
-
const
|
|
55
|
-
if (
|
|
56
|
-
const
|
|
57
|
-
|
|
54
|
+
const a = n.clientWidth;
|
|
55
|
+
if (a <= 0) return;
|
|
56
|
+
const g = Math.max(Math.min(a * (c / b), a), 20);
|
|
57
|
+
o.style.width = `${g}px`;
|
|
58
58
|
let h = 0;
|
|
59
|
-
const
|
|
60
|
-
if (
|
|
61
|
-
const
|
|
62
|
-
|
|
59
|
+
const u = i.style.transform;
|
|
60
|
+
if (u && u.includes("translateX")) {
|
|
61
|
+
const x = u.match(/translateX\(([-\d.]+)px\)/);
|
|
62
|
+
x && x[1] && (h = parseFloat(x[1]));
|
|
63
63
|
} else
|
|
64
64
|
h = parseInt(i.style.left || 0, 10);
|
|
65
|
-
let d = parseInt(Math.abs(h) *
|
|
65
|
+
let d = parseInt(Math.abs(h) * a / b, 10);
|
|
66
66
|
d < 0 && (d = 0);
|
|
67
|
-
const S =
|
|
68
|
-
d > S && (d = S),
|
|
67
|
+
const S = a - g;
|
|
68
|
+
d > S && (d = S), o.style.left = `${d}px`, e(this, p).left.disabled = d === 0, e(this, p).right.disabled = d >= S - 1;
|
|
69
69
|
}, "refresh"));
|
|
70
|
-
|
|
70
|
+
f(this, z, /* @__PURE__ */ l((t) => {
|
|
71
71
|
if (!e(this, p)) return !1;
|
|
72
72
|
const i = e(this, p).container, n = i.querySelector("table");
|
|
73
73
|
if (!n) return !1;
|
|
74
|
-
const
|
|
74
|
+
const o = e(this, p).track.getBoundingClientRect(), r = e(this, p).thumb.clientWidth;
|
|
75
75
|
let c = t;
|
|
76
76
|
c < 0 && (c = 0);
|
|
77
|
-
const
|
|
78
|
-
c >
|
|
79
|
-
const
|
|
80
|
-
let h =
|
|
81
|
-
return -h >
|
|
77
|
+
const b = o.width - r;
|
|
78
|
+
c > b && (c = b), c = parseInt(c, 10), e(this, p).thumb.style.left = `${c}px`, e(this, p).left.disabled = c === 0, e(this, p).right.disabled = c >= b - 1;
|
|
79
|
+
const a = i.clientWidth, g = n.scrollWidth;
|
|
80
|
+
let h = b > 0 ? -c * (g - a) / b : 0;
|
|
81
|
+
return -h > g - a && (h = -(g - a)), -h + 5 > g - a && (h = -(g - a)), a >= g && (h = 0), n.style.transform = `translateX(${h}px)`, c > 0 && c < b - 1;
|
|
82
82
|
}, "#thumbMoveTo"));
|
|
83
|
-
|
|
84
|
-
const t = /* @__PURE__ */
|
|
85
|
-
clearInterval(e(this,
|
|
86
|
-
const
|
|
87
|
-
e(this,
|
|
88
|
-
clearInterval(e(this,
|
|
83
|
+
f(this, j, /* @__PURE__ */ l(() => {
|
|
84
|
+
const t = /* @__PURE__ */ l((n) => {
|
|
85
|
+
clearInterval(e(this, W)), clearInterval(e(this, H));
|
|
86
|
+
const o = parseInt(e(this, p).thumb.style.left || 0, 10);
|
|
87
|
+
e(this, z).call(this, o + n), y(this, W, setInterval(() => {
|
|
88
|
+
clearInterval(e(this, W)), y(this, H, setInterval(() => {
|
|
89
89
|
const r = parseInt(e(this, p).thumb.style.left || 0, 10);
|
|
90
|
-
e(this,
|
|
90
|
+
e(this, z).call(this, r + n) || clearInterval(e(this, H));
|
|
91
91
|
}, 50));
|
|
92
92
|
}, 500));
|
|
93
|
-
}, "delayScroll"), i = /* @__PURE__ */
|
|
94
|
-
clearInterval(e(this,
|
|
93
|
+
}, "delayScroll"), i = /* @__PURE__ */ l(() => {
|
|
94
|
+
clearInterval(e(this, W)), clearInterval(e(this, H));
|
|
95
95
|
}, "clearTimer");
|
|
96
96
|
["mouseup", "mouseleave", "touchend"].forEach((n) => {
|
|
97
97
|
e(this, p).left.addEventListener(n, i), e(this, p).right.addEventListener(n, i), e(this, p).track.addEventListener(n, i);
|
|
@@ -102,24 +102,24 @@ const be = class be extends HTMLElement {
|
|
|
102
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
|
|
106
|
-
e(this,
|
|
105
|
+
const o = e(this, p).track.getBoundingClientRect(), r = e(this, p).thumb.clientWidth;
|
|
106
|
+
e(this, z).call(this, n.clientX - o.left - r / 2);
|
|
107
107
|
}), e(this, p).thumb.addEventListener("mousedown", (n) => {
|
|
108
108
|
if (n.button !== 0) return;
|
|
109
|
-
n.stopPropagation(), n.preventDefault(),
|
|
110
|
-
const
|
|
111
|
-
if (!e(this,
|
|
112
|
-
const
|
|
113
|
-
e(this,
|
|
114
|
-
}, "onMouseMove"), r = /* @__PURE__ */
|
|
115
|
-
|
|
109
|
+
n.stopPropagation(), n.preventDefault(), y(this, M, !0), this.shiftX = n.clientX - e(this, p).thumb.getBoundingClientRect().left;
|
|
110
|
+
const o = /* @__PURE__ */ l((c) => {
|
|
111
|
+
if (!e(this, M)) return;
|
|
112
|
+
const b = e(this, p).track.getBoundingClientRect();
|
|
113
|
+
e(this, z).call(this, c.clientX - b.left - this.shiftX);
|
|
114
|
+
}, "onMouseMove"), r = /* @__PURE__ */ l(() => {
|
|
115
|
+
y(this, M, !1), i(), document.removeEventListener("mousemove", o), document.removeEventListener("mouseup", r), this.refresh();
|
|
116
116
|
}, "onMouseUp");
|
|
117
|
-
document.addEventListener("mousemove",
|
|
117
|
+
document.addEventListener("mousemove", o), document.addEventListener("mouseup", r);
|
|
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 {
|
|
@@ -183,112 +183,150 @@ const be = class be extends HTMLElement {
|
|
|
183
183
|
<div class='ng-scroll-track'><div class='ng-scroll-thumb'></div></div>
|
|
184
184
|
<button class='ng-scroll-right' disabled><div class='ng-scroll-icon'></div></button>
|
|
185
185
|
`;
|
|
186
|
-
const t = /* @__PURE__ */
|
|
187
|
-
const i = e(this,
|
|
186
|
+
const t = /* @__PURE__ */ l(() => {
|
|
187
|
+
const i = e(this, _).querySelector(".ng-container-body");
|
|
188
188
|
if (!i) {
|
|
189
189
|
setTimeout(t, 10);
|
|
190
190
|
return;
|
|
191
191
|
}
|
|
192
|
-
|
|
192
|
+
y(this, p, {
|
|
193
193
|
container: i,
|
|
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, j).call(this), e(this, Z).call(this), this.refresh();
|
|
199
199
|
}, "initWhenReady");
|
|
200
200
|
t();
|
|
201
201
|
}
|
|
202
202
|
disconnectedCallback() {
|
|
203
|
-
e(this,
|
|
203
|
+
e(this, O) && e(this, O).disconnect();
|
|
204
204
|
}
|
|
205
205
|
};
|
|
206
|
-
|
|
207
|
-
let
|
|
208
|
-
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar",
|
|
209
|
-
var
|
|
210
|
-
const
|
|
206
|
+
_ = new WeakMap(), M = new WeakMap(), p = new WeakMap(), W = new WeakMap(), H = new WeakMap(), O = new WeakMap(), Z = new WeakMap(), z = new WeakMap(), j = new WeakMap(), l(we, "NineTableHScrollBar");
|
|
207
|
+
let ce = we;
|
|
208
|
+
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", ce);
|
|
209
|
+
var G, N;
|
|
210
|
+
const ve = class ve {
|
|
211
|
+
constructor(s) {
|
|
212
|
+
f(this, G);
|
|
213
|
+
f(this, N, []);
|
|
214
|
+
/**
|
|
215
|
+
* μ΄κΈ° ν
νλ¦Ώ TR ꡬ쑰λ₯Ό μΆμΆν©λλ€ (λ€μ€ tr μ§μ)
|
|
216
|
+
*/
|
|
217
|
+
v(this, "initTemplate", /* @__PURE__ */ l((s) => {
|
|
218
|
+
const t = s.querySelector("tbody.bindable") || s.querySelector("tbody");
|
|
219
|
+
if (!t) return;
|
|
220
|
+
const i = Array.from(t.querySelectorAll("tr")).filter((n) => !n.classList.contains("nodata"));
|
|
221
|
+
y(this, N, i.map((n) => n.cloneNode(!0)));
|
|
222
|
+
}, "initTemplate"));
|
|
223
|
+
/**
|
|
224
|
+
* λ²νΌμ λ·°ν¬νΈ ν¬κΈ°μ λ§μΆ° νμν μ΄ TR λΌλλ₯Ό μμ±νμ¬ μ»¨ν
μ΄λμ μ±μλλ€.
|
|
225
|
+
*/
|
|
226
|
+
v(this, "renderRows", /* @__PURE__ */ l((s, t) => {
|
|
227
|
+
if (e(this, N).length === 0) return;
|
|
228
|
+
const i = s.querySelector("tbody.bindable") || s.querySelector("tbody");
|
|
229
|
+
if (!i) return;
|
|
230
|
+
i.querySelectorAll("tr:not(.nodata)").forEach((r) => r.remove());
|
|
231
|
+
const n = i.querySelector("tr.nodata"), o = document.createDocumentFragment();
|
|
232
|
+
for (let r = 0; r < t; r++)
|
|
233
|
+
e(this, N).forEach((c) => {
|
|
234
|
+
o.appendChild(c.cloneNode(!0));
|
|
235
|
+
});
|
|
236
|
+
n ? n.before(o) : i.appendChild(o);
|
|
237
|
+
}, "renderRows"));
|
|
238
|
+
y(this, G, s);
|
|
239
|
+
}
|
|
240
|
+
get templateLength() {
|
|
241
|
+
return e(this, N).length || 1;
|
|
242
|
+
}
|
|
243
|
+
};
|
|
244
|
+
G = new WeakMap(), N = new WeakMap(), l(ve, "RowManager");
|
|
245
|
+
let he = ve;
|
|
246
|
+
var L, C, J;
|
|
247
|
+
const V = class V extends HTMLElement {
|
|
211
248
|
constructor() {
|
|
212
249
|
super();
|
|
213
|
-
|
|
214
|
-
|
|
250
|
+
f(this, L, null);
|
|
251
|
+
f(this, C);
|
|
252
|
+
v(this, "init", /* @__PURE__ */ l((t) => {
|
|
215
253
|
if (!t) return;
|
|
216
|
-
const i = /* @__PURE__ */
|
|
217
|
-
const
|
|
218
|
-
if (
|
|
219
|
-
const d =
|
|
254
|
+
const i = /* @__PURE__ */ l((a) => {
|
|
255
|
+
const g = /* @__PURE__ */ l((u) => {
|
|
256
|
+
if (u.querySelector("colgroup")) return;
|
|
257
|
+
const d = u.querySelector("tbody tr") || u.querySelector("tr"), S = d ? d.querySelectorAll("th, td").length : 1, x = document.createElement("colgroup"), k = Math.max(Math.floor((u.clientWidth || 600) / S), 100);
|
|
220
258
|
for (let R = 0; R < S; R++) {
|
|
221
|
-
const
|
|
222
|
-
|
|
259
|
+
const le = document.createElement("col");
|
|
260
|
+
le.setAttribute("width", k), x.appendChild(le);
|
|
223
261
|
}
|
|
224
|
-
|
|
225
|
-
}, "ensureColgroup"), h = /* @__PURE__ */
|
|
226
|
-
if (
|
|
227
|
-
const d = document.createElement("thead"), S =
|
|
228
|
-
S ? S.after(d) :
|
|
262
|
+
u.prepend(x);
|
|
263
|
+
}, "ensureColgroup"), h = /* @__PURE__ */ l((u) => {
|
|
264
|
+
if (u.querySelector("thead")) return;
|
|
265
|
+
const d = document.createElement("thead"), S = u.querySelector("colgroup");
|
|
266
|
+
S ? S.after(d) : u.prepend(d);
|
|
229
267
|
}, "ensureThead");
|
|
230
|
-
return
|
|
268
|
+
return g(a), h(a), a.classList.add("nine-table-element"), a;
|
|
231
269
|
}, "initializeTable"), n = t.cloneNode(!0);
|
|
232
|
-
|
|
233
|
-
const
|
|
234
|
-
const
|
|
235
|
-
return d.forEach((
|
|
236
|
-
const R =
|
|
237
|
-
(h ? !R || R === "" : R ===
|
|
238
|
-
}), S.reverse().forEach((
|
|
239
|
-
d[
|
|
270
|
+
y(this, L, i(n)), e(this, L).style.display = "table", e(this, C).initTemplate(e(this, L));
|
|
271
|
+
const o = this.querySelector(".ng-container-left"), r = this.querySelector(".ng-container-body"), c = this.querySelector(".ng-container-right"), b = /* @__PURE__ */ l((a, g, h = !1) => {
|
|
272
|
+
const u = a.cloneNode(!0), d = Array.from(u.querySelectorAll("colgroup col")), S = [];
|
|
273
|
+
return d.forEach((x, k) => {
|
|
274
|
+
const R = x.getAttribute("fixed");
|
|
275
|
+
(h ? !R || R === "" : R === g) || S.push(k);
|
|
276
|
+
}), S.reverse().forEach((x) => {
|
|
277
|
+
d[x] && d[x].remove(), u.querySelectorAll("tr").forEach((k) => {
|
|
240
278
|
const R = k.querySelectorAll("th, td");
|
|
241
|
-
R[
|
|
279
|
+
R[x] && R[x].remove();
|
|
242
280
|
});
|
|
243
|
-
}),
|
|
281
|
+
}), u;
|
|
244
282
|
}, "filterTableByFixed");
|
|
245
283
|
if (r) {
|
|
246
|
-
const
|
|
247
|
-
r.innerHTML = "", r.appendChild(
|
|
284
|
+
const a = b(e(this, L), null, !0);
|
|
285
|
+
r.innerHTML = "", r.appendChild(a), e(this, C).renderRows(r, 45);
|
|
248
286
|
}
|
|
249
|
-
if (
|
|
250
|
-
const
|
|
251
|
-
let
|
|
252
|
-
|
|
253
|
-
const d = parseInt(
|
|
254
|
-
isNaN(d) || (
|
|
255
|
-
}),
|
|
256
|
-
const h =
|
|
257
|
-
|
|
287
|
+
if (o) {
|
|
288
|
+
const a = b(e(this, L), "left", !1);
|
|
289
|
+
let g = 0;
|
|
290
|
+
a.querySelectorAll("col").forEach((u) => {
|
|
291
|
+
const d = parseInt(u.getAttribute("width"), 10);
|
|
292
|
+
isNaN(d) || (g += d);
|
|
293
|
+
}), o.innerHTML = "", o.appendChild(a), e(this, C).renderRows(o, 45);
|
|
294
|
+
const h = g > 0 ? g : 0;
|
|
295
|
+
o.style.flex = `0 0 ${h}px`, o.style.width = `${h}px`;
|
|
258
296
|
}
|
|
259
297
|
if (c) {
|
|
260
|
-
const
|
|
261
|
-
let
|
|
262
|
-
|
|
263
|
-
const d = parseInt(
|
|
264
|
-
isNaN(d) || (
|
|
265
|
-
}), c.innerHTML = "", c.appendChild(
|
|
266
|
-
const h =
|
|
298
|
+
const a = b(e(this, L), "right", !1);
|
|
299
|
+
let g = 0;
|
|
300
|
+
a.querySelectorAll("col").forEach((u) => {
|
|
301
|
+
const d = parseInt(u.getAttribute("width"), 10);
|
|
302
|
+
isNaN(d) || (g += d);
|
|
303
|
+
}), c.innerHTML = "", c.appendChild(a), e(this, C).renderRows(c, 45);
|
|
304
|
+
const h = g > 0 ? g : 0;
|
|
267
305
|
c.style.flex = `0 0 ${h}px`, c.style.width = `${h}px`;
|
|
268
306
|
}
|
|
269
307
|
if (r) {
|
|
270
|
-
const
|
|
271
|
-
r.style.overflowY =
|
|
272
|
-
const
|
|
273
|
-
|
|
308
|
+
const a = this.getRowCount();
|
|
309
|
+
r.style.overflowY = a > 10 ? "auto" : "hidden", r.addEventListener("scroll", () => {
|
|
310
|
+
const g = this.querySelector("nine-table-hscrollbar");
|
|
311
|
+
g && typeof g.refresh == "function" && g.refresh();
|
|
274
312
|
});
|
|
275
313
|
}
|
|
276
314
|
setTimeout(() => {
|
|
277
|
-
const
|
|
278
|
-
|
|
279
|
-
}, 0),
|
|
315
|
+
const a = this.querySelector("nine-table-hscrollbar");
|
|
316
|
+
a && typeof a.refresh == "function" && a.refresh();
|
|
317
|
+
}, 0), K.log(`NineTableSheet 3-split initialized with rows: ${this.getRowCount()}`);
|
|
280
318
|
}, "init"));
|
|
281
|
-
|
|
282
|
-
|
|
319
|
+
v(this, "getRowCount", /* @__PURE__ */ l(() => e(this, L) ? e(this, L).querySelectorAll("tbody tr").length : 0, "getRowCount"));
|
|
320
|
+
v(this, "scrollToX", /* @__PURE__ */ l((t) => {
|
|
283
321
|
const i = this.querySelector(".ng-container-body");
|
|
284
322
|
i && (i.scrollLeft = t);
|
|
285
323
|
}, "scrollToX"));
|
|
286
|
-
|
|
324
|
+
v(this, "scrollToY", /* @__PURE__ */ l((t) => {
|
|
287
325
|
const i = this.querySelector(".ng-container-body");
|
|
288
326
|
i && (i.scrollTop = t);
|
|
289
327
|
}, "scrollToY"));
|
|
290
|
-
|
|
291
|
-
const t =
|
|
328
|
+
f(this, J, /* @__PURE__ */ l(() => {
|
|
329
|
+
const t = V.SCROLLBAR_SIZE;
|
|
292
330
|
this.innerHTML = `
|
|
293
331
|
<style>
|
|
294
332
|
nine-table-sheet {
|
|
@@ -404,104 +442,105 @@ const P = class P extends HTMLElement {
|
|
|
404
442
|
</div>
|
|
405
443
|
`;
|
|
406
444
|
}, "#render"));
|
|
445
|
+
y(this, C, new he(this));
|
|
407
446
|
}
|
|
408
447
|
connectedCallback() {
|
|
409
|
-
e(this,
|
|
448
|
+
e(this, J).call(this);
|
|
410
449
|
}
|
|
411
450
|
disconnectedCallback() {
|
|
412
|
-
this.innerHTML = "",
|
|
451
|
+
this.innerHTML = "", K.log("NineTableSheet destroyed.");
|
|
413
452
|
}
|
|
414
453
|
};
|
|
415
|
-
L = new WeakMap(),
|
|
416
|
-
let
|
|
417
|
-
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet",
|
|
418
|
-
var
|
|
419
|
-
const
|
|
454
|
+
L = new WeakMap(), C = new WeakMap(), J = new WeakMap(), l(V, "NineTableSheet"), v(V, "SCROLLBAR_SIZE", 16);
|
|
455
|
+
let de = V;
|
|
456
|
+
customElements.get("nine-table-sheet") || customElements.define("nine-table-sheet", de);
|
|
457
|
+
var Q;
|
|
458
|
+
const xe = class xe extends HTMLElement {
|
|
420
459
|
constructor() {
|
|
421
460
|
super();
|
|
422
|
-
|
|
461
|
+
f(this, Q, /* @__PURE__ */ l(() => {
|
|
423
462
|
const t = this.querySelector(".nine-tab-bar");
|
|
424
463
|
t && (t.addEventListener("click", (i) => {
|
|
425
464
|
const n = i.target.closest(".nine-tab-item");
|
|
426
465
|
if (!n) return;
|
|
427
|
-
const
|
|
428
|
-
this.switchSheet(r,
|
|
466
|
+
const o = i.ctrlKey || i.metaKey || i.shiftKey, r = parseInt(n.dataset.index, 10);
|
|
467
|
+
this.switchSheet(r, o);
|
|
429
468
|
}), this.switchSheet(0, !1));
|
|
430
469
|
}, "#init"));
|
|
431
|
-
|
|
432
|
-
const n = /* @__PURE__ */
|
|
470
|
+
v(this, "switchSheet", /* @__PURE__ */ l((t, i = !1) => {
|
|
471
|
+
const n = /* @__PURE__ */ l(() => {
|
|
433
472
|
const h = this.querySelector("nine-table-sheets-body");
|
|
434
473
|
h.querySelectorAll("nine-splitter").forEach((d) => {
|
|
435
|
-
const S = parseInt(d.dataset.splitIndex, 10),
|
|
436
|
-
|
|
474
|
+
const S = parseInt(d.dataset.splitIndex, 10), x = h.querySelector(`nine-table-sheet[data-index="${S - 1}"]`), k = h.querySelector(`nine-table-sheet[data-index="${S}"]`);
|
|
475
|
+
x && k && x.classList.contains("active") && k.classList.contains("active") ? d.classList.add("active") : d.classList.remove("active");
|
|
437
476
|
});
|
|
438
|
-
}, "updateSplitters"),
|
|
477
|
+
}, "updateSplitters"), o = this.querySelector(".nine-tab-bar"), r = this.querySelector("nine-table-sheets-body"), c = o.querySelectorAll(".nine-tab-item"), b = r.querySelectorAll("nine-table-sheet");
|
|
439
478
|
if (!c[t]) return;
|
|
440
479
|
if (!i)
|
|
441
|
-
c.forEach((h,
|
|
442
|
-
h.classList.toggle("active",
|
|
443
|
-
const d = r.querySelector(`nine-table-sheet[data-index="${
|
|
480
|
+
c.forEach((h, u) => {
|
|
481
|
+
h.classList.toggle("active", u === t);
|
|
482
|
+
const d = r.querySelector(`nine-table-sheet[data-index="${u}"]`);
|
|
444
483
|
d && (d.style.flex = "");
|
|
445
|
-
}),
|
|
446
|
-
h.classList.toggle("active",
|
|
484
|
+
}), b.forEach((h, u) => {
|
|
485
|
+
h.classList.toggle("active", u === t);
|
|
447
486
|
});
|
|
448
487
|
else {
|
|
449
|
-
const h = c[t],
|
|
450
|
-
if (h.classList.contains("active") &&
|
|
488
|
+
const h = c[t], u = o.querySelectorAll(".nine-tab-item.active");
|
|
489
|
+
if (h.classList.contains("active") && u.length <= 1)
|
|
451
490
|
return;
|
|
452
491
|
h.classList.toggle("active");
|
|
453
492
|
const d = r.querySelector(`nine-table-sheet[data-index="${t}"]`);
|
|
454
493
|
d && (d.classList.toggle("active"), d.classList.contains("active") || (d.style.flex = ""));
|
|
455
494
|
}
|
|
456
|
-
const
|
|
457
|
-
if (
|
|
458
|
-
const h = 1 /
|
|
459
|
-
|
|
460
|
-
(!
|
|
495
|
+
const a = Array.from(r.querySelectorAll("nine-table-sheet.active"));
|
|
496
|
+
if (a.length > 1) {
|
|
497
|
+
const h = 1 / a.length;
|
|
498
|
+
a.forEach((u) => {
|
|
499
|
+
(!u.style.flex || u.style.flex === "1 1 100%") && (u.style.flex = `${h} ${h} 0px`);
|
|
461
500
|
});
|
|
462
501
|
} else
|
|
463
|
-
|
|
502
|
+
a.forEach((h) => {
|
|
464
503
|
h.style.flex = "1 1 100%";
|
|
465
504
|
});
|
|
466
505
|
n();
|
|
467
|
-
const
|
|
468
|
-
if (
|
|
506
|
+
const g = r.querySelector("nine-table-sheet.active");
|
|
507
|
+
if (g && typeof g.getRowCount == "function") {
|
|
469
508
|
const h = this.querySelector("#row-count");
|
|
470
|
-
h && (h.textContent =
|
|
509
|
+
h && (h.textContent = g.getRowCount().toLocaleString());
|
|
471
510
|
}
|
|
472
511
|
}, "switchSheet"));
|
|
473
512
|
}
|
|
474
513
|
connectedCallback() {
|
|
475
|
-
e(this,
|
|
514
|
+
e(this, Q).call(this);
|
|
476
515
|
}
|
|
477
516
|
};
|
|
478
|
-
|
|
479
|
-
let
|
|
480
|
-
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets",
|
|
481
|
-
var
|
|
482
|
-
const
|
|
517
|
+
Q = new WeakMap(), l(xe, "NineTableSheets");
|
|
518
|
+
let fe = xe;
|
|
519
|
+
customElements.get("nine-table-sheets") || customElements.define("nine-table-sheets", fe);
|
|
520
|
+
var A, Y, ee, F, te;
|
|
521
|
+
const Se = class Se {
|
|
483
522
|
constructor(s) {
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
const s = e(this,
|
|
488
|
-
s && (
|
|
523
|
+
f(this, A);
|
|
524
|
+
f(this, Y, null);
|
|
525
|
+
f(this, ee, /* @__PURE__ */ l(() => {
|
|
526
|
+
const s = e(this, A).host;
|
|
527
|
+
s && (y(this, Y, new ResizeObserver((t) => {
|
|
489
528
|
for (let i of t)
|
|
490
|
-
s.getAttribute("auto-height") === "true" && e(this,
|
|
491
|
-
})), e(this,
|
|
529
|
+
s.getAttribute("auto-height") === "true" && e(this, F).call(this, s);
|
|
530
|
+
})), e(this, Y).observe(s));
|
|
492
531
|
}, "#observeResize"));
|
|
493
|
-
|
|
532
|
+
f(this, F, /* @__PURE__ */ l((s) => {
|
|
494
533
|
var k, R;
|
|
495
534
|
const t = (k = s.shadowRoot) == null ? void 0 : k.querySelector("nine-table-sheet.active");
|
|
496
535
|
if (!t) return;
|
|
497
|
-
const i = ((R = t.getRowCount) == null ? void 0 : R.call(t)) || 0, n = parseInt(s.getAttribute("max-display-row"), 10) || 10,
|
|
536
|
+
const i = ((R = t.getRowCount) == null ? void 0 : R.call(t)) || 0, n = parseInt(s.getAttribute("max-display-row"), 10) || 10, o = Math.min(i, n), r = t.querySelector("tbody tr") || t.querySelector("tr"), c = r ? r.getBoundingClientRect().height : 32, b = e(this, A).querySelector("nine-table-header"), a = e(this, A).querySelector("nine-table-sheets-footer"), g = b ? b.getBoundingClientRect().height : 40, h = a ? a.getBoundingClientRect().height : 32, d = g + h + 16, S = o * c + d;
|
|
498
537
|
s.style.height = `${S}px`, s.style.maxHeight = `${n * c + d}px`;
|
|
499
|
-
const
|
|
500
|
-
|
|
538
|
+
const x = e(this, A).querySelector("nine-table-sheets-body");
|
|
539
|
+
x && (x.style.overflowY = i > n ? "auto" : "hidden");
|
|
501
540
|
}, "#applyAutoHeight"));
|
|
502
|
-
|
|
503
|
-
const s = e(this,
|
|
504
|
-
e(this,
|
|
541
|
+
f(this, te, /* @__PURE__ */ l(() => {
|
|
542
|
+
const s = e(this, A).host, i = Array.from(s.children).filter((b) => b.tagName === "TABLE"), n = s.getAttribute("auto-height") === "true", o = i.map((b, a) => `<nine-table-sheet class="${a === 0 ? "active" : ""}" data-index="${a}"></nine-table-sheet>`).join(""), r = i.map((b, a) => `<div class="nine-tab-item ${a === 0 ? "active" : ""}" data-index="${a}">Sheet ${a + 1}</div>`).join("");
|
|
543
|
+
e(this, A).innerHTML = `
|
|
505
544
|
<style>
|
|
506
545
|
:host {
|
|
507
546
|
display: flex;
|
|
@@ -589,7 +628,7 @@ const pe = class pe {
|
|
|
589
628
|
<nine-table-body>
|
|
590
629
|
<nine-table-summary></nine-table-summary>
|
|
591
630
|
<nine-table-sheets>
|
|
592
|
-
<nine-table-sheets-body>${
|
|
631
|
+
<nine-table-sheets-body>${o}</nine-table-sheets-body>
|
|
593
632
|
<nine-table-sheets-footer>
|
|
594
633
|
<div class="nine-tab-bar">${r}</div>
|
|
595
634
|
<div class="sheets-counter">Total : <span id="row-count">0</span></div>
|
|
@@ -599,191 +638,192 @@ const pe = class pe {
|
|
|
599
638
|
</nine-table-body>
|
|
600
639
|
<nine-table-footer></nine-table-footer>
|
|
601
640
|
`;
|
|
602
|
-
const c = e(this,
|
|
603
|
-
c == null || c.forEach((
|
|
604
|
-
i[
|
|
605
|
-
|
|
641
|
+
const c = e(this, A).querySelectorAll("nine-table-sheet");
|
|
642
|
+
c == null || c.forEach((b, a) => {
|
|
643
|
+
i[a] && setTimeout(() => {
|
|
644
|
+
b.init(i[a]), n && e(this, F).call(this, s);
|
|
606
645
|
});
|
|
607
646
|
});
|
|
608
647
|
}, "#render"));
|
|
609
|
-
|
|
648
|
+
y(this, A, s), e(this, te).call(this), e(this, ee).call(this);
|
|
610
649
|
}
|
|
611
650
|
};
|
|
612
|
-
|
|
613
|
-
let
|
|
614
|
-
var
|
|
615
|
-
const
|
|
651
|
+
A = new WeakMap(), Y = new WeakMap(), ee = new WeakMap(), F = new WeakMap(), te = new WeakMap(), l(Se, "LayoutManager");
|
|
652
|
+
let ue = Se;
|
|
653
|
+
var I, D;
|
|
654
|
+
const Ee = class Ee {
|
|
616
655
|
constructor(s) {
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
656
|
+
f(this, I);
|
|
657
|
+
f(this, D, -1);
|
|
658
|
+
v(this, "count", /* @__PURE__ */ l(() => e(this, I).rawRecords.length, "count"));
|
|
659
|
+
y(this, I, s);
|
|
621
660
|
}
|
|
622
661
|
get at() {
|
|
623
|
-
return e(this,
|
|
662
|
+
return e(this, D);
|
|
624
663
|
}
|
|
625
664
|
set at(s) {
|
|
626
665
|
var i, n;
|
|
627
|
-
|
|
628
|
-
const t = ((n = (i = e(this,
|
|
629
|
-
t && !t.querySelector(`tbody.bindable tr[data-row="${e(this,
|
|
630
|
-
var
|
|
631
|
-
(r = (
|
|
666
|
+
y(this, D, parseInt(s, 10));
|
|
667
|
+
const t = ((n = (i = e(this, I).owner).querySelector) == null ? void 0 : n.call(i, ".ng-container-body")) || e(this, I).owner.body;
|
|
668
|
+
t && !t.querySelector(`tbody.bindable tr[data-row="${e(this, D)}"]`) && setTimeout(() => {
|
|
669
|
+
var o, r;
|
|
670
|
+
(r = (o = e(this, I).owner).scrollTo_V1) == null || r.call(o, e(this, D));
|
|
632
671
|
});
|
|
633
672
|
}
|
|
634
673
|
};
|
|
635
|
-
|
|
636
|
-
let
|
|
637
|
-
var E, w,
|
|
638
|
-
const
|
|
674
|
+
I = new WeakMap(), D = new WeakMap(), l(Ee, "ngRow");
|
|
675
|
+
let be = Ee;
|
|
676
|
+
var E, w, q, P, se, $, ie, U, ne, re, X;
|
|
677
|
+
const T = class T {
|
|
639
678
|
constructor(s, t) {
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
679
|
+
f(this, E);
|
|
680
|
+
f(this, w);
|
|
681
|
+
f(this, q, []);
|
|
682
|
+
f(this, P, []);
|
|
683
|
+
f(this, se, 0);
|
|
684
|
+
f(this, $, []);
|
|
685
|
+
f(this, ie, /* @__PURE__ */ l(() => {
|
|
686
|
+
y(this, $, []);
|
|
648
687
|
const s = e(this, E).template || [];
|
|
649
688
|
Array.from(s).forEach((t) => {
|
|
650
689
|
var i;
|
|
651
|
-
e(this,
|
|
690
|
+
e(this, $).push(((i = t.getBoundingClientRect) == null ? void 0 : i.call(t).height) || 24);
|
|
652
691
|
}), (e(this, w).rawRecords || []).forEach((t) => {
|
|
653
|
-
t.__ng || (t.__ng = e(this,
|
|
692
|
+
t.__ng || (t.__ng = e(this, U).call(this)), t.__ng.height = e(this, $).slice();
|
|
654
693
|
});
|
|
655
694
|
}, "#initialize"));
|
|
656
|
-
|
|
695
|
+
v(this, "set", /* @__PURE__ */ l((s) => {
|
|
657
696
|
this.clear(), this.add(s, !1);
|
|
658
697
|
}, "set"));
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
}, "#getDefaultMeta"));
|
|
671
|
-
x(this, "reset", /* @__PURE__ */ a(() => {
|
|
672
|
-
m(this, _, []), m(this, B, []);
|
|
698
|
+
f(this, U, /* @__PURE__ */ l(() => ({
|
|
699
|
+
rowState: T.ROW_STATE.EMPTY,
|
|
700
|
+
deleted: !1,
|
|
701
|
+
filtered: !1,
|
|
702
|
+
height: e(this, $).slice(),
|
|
703
|
+
o: {},
|
|
704
|
+
c: {},
|
|
705
|
+
_: [0, 0, 0, 0, T.ROW_STATE.EMPTY, !1, !1, !0, !1, !0, !0, !1, e(this, $).slice(), -1, {}, {}]
|
|
706
|
+
}), "#getDefaultMeta"));
|
|
707
|
+
v(this, "reset", /* @__PURE__ */ l(() => {
|
|
708
|
+
y(this, q, []), y(this, P, []);
|
|
673
709
|
}, "reset"));
|
|
674
|
-
|
|
710
|
+
v(this, "clear", /* @__PURE__ */ l(() => {
|
|
675
711
|
var s;
|
|
676
|
-
e(this, w).rawRecords = [],
|
|
712
|
+
e(this, w).rawRecords = [], y(this, q, []), y(this, P, []), (s = e(this, w).viewRecords) != null && s.reset && e(this, w).viewRecords.reset();
|
|
677
713
|
}, "clear"));
|
|
678
|
-
|
|
714
|
+
f(this, ne, /* @__PURE__ */ l((s) => {
|
|
679
715
|
var n;
|
|
680
716
|
Array.isArray(s) || (s = [s]);
|
|
681
717
|
const t = typeof ((n = e(this, E).fields) == null ? void 0 : n.get) == "function" ? e(this, E).fields.get() : Object.keys(s[0] || {}), i = [];
|
|
682
|
-
return s.forEach((
|
|
718
|
+
return s.forEach((o) => {
|
|
683
719
|
const r = { v: [] };
|
|
684
720
|
t.forEach((c) => {
|
|
685
|
-
r.v.push(
|
|
721
|
+
r.v.push(o[c] !== void 0 && o[c] !== null ? o[c] : "");
|
|
686
722
|
}), i.push(r);
|
|
687
723
|
}), i;
|
|
688
724
|
}, "#json2Array"));
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
t.__ng = e(this, V).call(this), t.__ng.rowid = this.nextId, t.__ng.rowState = ((i = ninegrid.ROW_STATE) == null ? void 0 : i.INSERT) || "INSERT", t.__ng._[0] = t.__ng.rowid;
|
|
725
|
+
f(this, re, /* @__PURE__ */ l((s) => (Array.isArray(s) || (s = [s]), s.forEach((t) => {
|
|
726
|
+
t.__ng = e(this, U).call(this), t.__ng.rowid = this.nextId, t.__ng.rowState = T.ROW_STATE.INSERT, t.__ng._[0] = t.__ng.rowid;
|
|
692
727
|
}), s), "#defaultInsert"));
|
|
693
|
-
|
|
694
|
-
var
|
|
728
|
+
v(this, "add", /* @__PURE__ */ l((s, t = !0) => {
|
|
729
|
+
var o;
|
|
695
730
|
s === void 0 && (s = {});
|
|
696
|
-
const i = e(this,
|
|
697
|
-
e(this, w).rawRecords = e(this, w).rawRecords.concat(e(this,
|
|
731
|
+
const i = e(this, ne).call(this, s);
|
|
732
|
+
e(this, w).rawRecords = e(this, w).rawRecords.concat(e(this, re).call(this, i)), this.resetRecords();
|
|
698
733
|
const n = this.count() - 1;
|
|
699
734
|
return t || i.forEach((r, c) => {
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
}), (l = e(this, w).viewRecords) != null && l.reset && e(this, w).viewRecords.reset(), n;
|
|
735
|
+
const b = e(this, w).rawRecords[n - c];
|
|
736
|
+
b && (b.__ng.rowState = T.ROW_STATE.EMPTY);
|
|
737
|
+
}), (o = e(this, w).viewRecords) != null && o.reset && e(this, w).viewRecords.reset(), n;
|
|
704
738
|
}, "add"));
|
|
705
|
-
|
|
739
|
+
v(this, "delete", /* @__PURE__ */ l((s) => {
|
|
706
740
|
var i;
|
|
707
741
|
let t = [];
|
|
708
|
-
Array.isArray(s) ? t = s : typeof s > "u" ? t = [e(this, w).owner.row.at] : t = [parseInt(s, 10)], t.sort((n,
|
|
709
|
-
if (e(this,
|
|
710
|
-
const
|
|
711
|
-
e(this,
|
|
712
|
-
|
|
713
|
-
r.__ng.rowid === l && (r.__ng.deleted = !0, r.__ng.rowState = ((c = ninegrid.ROW_STATE) == null ? void 0 : c.DELETE) || "DELETE");
|
|
742
|
+
Array.isArray(s) ? t = s : typeof s > "u" ? t = [e(this, w).owner.row.at] : t = [parseInt(s, 10)], t.sort((n, o) => o - n).forEach((n) => {
|
|
743
|
+
if (e(this, q)[n]) {
|
|
744
|
+
const o = e(this, q)[n].__ng.rowid;
|
|
745
|
+
e(this, q)[n].__ng.rowState === T.ROW_STATE.INSERT ? e(this, w).rawRecords = e(this, w).rawRecords.filter((r) => r.__ng.rowid !== o) : e(this, w).rawRecords.forEach((r) => {
|
|
746
|
+
r.__ng.rowid === o && (r.__ng.deleted = !0, r.__ng.rowState = T.ROW_STATE.DELETE);
|
|
714
747
|
});
|
|
715
748
|
}
|
|
716
749
|
}), this.resetRecords(), (i = e(this, w).viewRecords) != null && i.reset && e(this, w).viewRecords.reset();
|
|
717
750
|
}, "delete"));
|
|
718
|
-
|
|
719
|
-
var
|
|
751
|
+
v(this, "setValue", /* @__PURE__ */ l((s, t, i) => {
|
|
752
|
+
var b;
|
|
720
753
|
s = parseInt(s, 10);
|
|
721
|
-
const
|
|
722
|
-
if (
|
|
754
|
+
const o = (typeof ((b = e(this, E).fields) == null ? void 0 : b.get) == "function" ? e(this, E).fields.get() : []).indexOf(t);
|
|
755
|
+
if (o < 0) return;
|
|
723
756
|
const r = this.getValidData()[s];
|
|
724
757
|
if (!r) return;
|
|
725
|
-
const c = r.v[
|
|
726
|
-
c !== i && r.__ng.rowState !==
|
|
758
|
+
const c = r.v[o];
|
|
759
|
+
c !== i && r.__ng.rowState !== T.ROW_STATE.INSERT && (r.__ng.o.hasOwnProperty(t) || (r.__ng.o[t] = c), r.__ng.rowState = T.ROW_STATE.UPDATE), r.v[o] = i, e(this, w).owner.refreshData && e(this, w).owner.refreshData(s);
|
|
727
760
|
}, "setValue"));
|
|
728
|
-
|
|
729
|
-
|
|
761
|
+
v(this, "resetRecords", /* @__PURE__ */ l(() => {
|
|
762
|
+
y(this, P, e(this, w).rawRecords.filter((s) => !s.__ng.deleted)), y(this, q, e(this, w).rawRecords.filter((s) => !s.__ng.deleted && !s.__ng.filtered)), e(this, w).rawRecords.forEach((s, t) => {
|
|
730
763
|
s.__ng.rowidx = t;
|
|
731
|
-
}), e(this,
|
|
764
|
+
}), e(this, q).forEach((s, t) => {
|
|
732
765
|
s.__ng.i = t;
|
|
733
766
|
});
|
|
734
767
|
}, "resetRecords"));
|
|
735
|
-
|
|
736
|
-
|
|
768
|
+
v(this, "getValidData", /* @__PURE__ */ l(() => (e(this, q).length === 0 && e(this, w).rawRecords.length > 0 && this.resetRecords(), e(this, q)), "getValidData"));
|
|
769
|
+
f(this, X, /* @__PURE__ */ l((s) => {
|
|
737
770
|
var i;
|
|
738
771
|
if (!s) return s;
|
|
739
772
|
const t = typeof ((i = e(this, E).fields) == null ? void 0 : i.get) == "function" ? e(this, E).fields.get() : [];
|
|
740
773
|
return Array.isArray(s) ? s.filter((n) => !n.__ng.deleted).map((n) => {
|
|
741
|
-
const
|
|
774
|
+
const o = {};
|
|
742
775
|
return t.forEach((r, c) => {
|
|
743
|
-
|
|
744
|
-
}),
|
|
776
|
+
o[r] = n.v ? n.v[c] : n[r];
|
|
777
|
+
}), o.__ng = n.__ng, o;
|
|
745
778
|
}) : s;
|
|
746
779
|
}, "#conv2"));
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
var
|
|
780
|
+
v(this, "count", /* @__PURE__ */ l(() => this.getValidData().length, "count"));
|
|
781
|
+
v(this, "get", /* @__PURE__ */ l((s, t) => {
|
|
782
|
+
var o;
|
|
750
783
|
const i = this.getValidData();
|
|
751
784
|
if (!i || i.length <= 0) return;
|
|
752
|
-
if (s == null) return e(this,
|
|
785
|
+
if (s == null) return e(this, X).call(this, i);
|
|
753
786
|
if (s < 0 || s >= i.length) return null;
|
|
754
|
-
const n = typeof ((
|
|
787
|
+
const n = typeof ((o = e(this, E).fields) == null ? void 0 : o.get) == "function" ? e(this, E).fields.get() : [];
|
|
755
788
|
if (t != null) {
|
|
756
789
|
const r = n.indexOf(t);
|
|
757
790
|
return r >= 0 ? i[s].v[r] : null;
|
|
758
791
|
}
|
|
759
|
-
return e(this,
|
|
792
|
+
return e(this, X).call(this, i[s]);
|
|
760
793
|
}, "get"));
|
|
761
|
-
|
|
794
|
+
y(this, E, s), y(this, w, t), e(this, ie).call(this);
|
|
762
795
|
}
|
|
763
796
|
get source() {
|
|
764
|
-
return e(this,
|
|
797
|
+
return e(this, X).call(this, e(this, w).rawRecords);
|
|
765
798
|
}
|
|
766
799
|
set source(s) {
|
|
767
800
|
this.clear(), this.add(s, !1);
|
|
768
801
|
}
|
|
769
802
|
get nextId() {
|
|
770
|
-
return ++
|
|
803
|
+
return ++Ae(this, se)._;
|
|
771
804
|
}
|
|
772
805
|
};
|
|
773
|
-
E = new WeakMap(), w = new WeakMap(),
|
|
774
|
-
|
|
775
|
-
|
|
806
|
+
E = new WeakMap(), w = new WeakMap(), q = new WeakMap(), P = new WeakMap(), se = new WeakMap(), $ = new WeakMap(), ie = new WeakMap(), U = new WeakMap(), ne = new WeakMap(), re = new WeakMap(), X = new WeakMap(), l(T, "ngData"), // π― ν μν μ μ μμλ₯Ό ν΄λμ€ λ΄λΆλ‘ λ΄μ¬ν
|
|
807
|
+
v(T, "ROW_STATE", {
|
|
808
|
+
EMPTY: "EMPTY",
|
|
809
|
+
NORMAL: "NORMAL",
|
|
810
|
+
INSERT: "INSERT",
|
|
811
|
+
UPDATE: "UPDATE",
|
|
812
|
+
DELETE: "DELETE"
|
|
813
|
+
});
|
|
814
|
+
let ge = T;
|
|
815
|
+
const Re = class Re {
|
|
776
816
|
constructor(s) {
|
|
777
|
-
this.owner = s, this.row = new
|
|
817
|
+
this.owner = s, this.row = new be(this), this.data = new ge(s, this), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.pageCnt = 25, this.viewRecords.reset = () => {
|
|
778
818
|
var t;
|
|
779
819
|
(t = this.owner.view) != null && t.redraw && this.owner.view.redraw();
|
|
780
820
|
}, this.setDataSource = (t) => {
|
|
781
821
|
this.data && this.data.reset(), this.rawRecords = [], this.viewRecords = [], this.delRecords = [], this.data.set(t || []);
|
|
782
822
|
}, this.getRowState = (t) => {
|
|
783
|
-
var n,
|
|
823
|
+
var n, o;
|
|
784
824
|
const i = parseInt(t, 10);
|
|
785
825
|
if (!(i >= this.data.count()))
|
|
786
|
-
return (
|
|
826
|
+
return (o = (n = this.data.getValidData()[i]) == null ? void 0 : n.__ng) == null ? void 0 : o.rowState;
|
|
787
827
|
}, this.getRowPosition = () => this.row.at, this.setRowPosition = (t) => {
|
|
788
828
|
this.row.at = t;
|
|
789
829
|
}, this.scrollTo_V1 = (t) => (t < 0 && (t = 0), t >= this.rawRecords.length && (t = this.rawRecords.length - 1), this.viewRecords.rawIndex = t, this.viewRecords.reset && this.viewRecords.reset(), !(t <= 0 || t >= this.rawRecords.length - 1)), this.getColumn = (t, i) => this.data.get(t, i), this.setColumn = (t, i, n) => {
|
|
@@ -791,37 +831,37 @@ const me = class me {
|
|
|
791
831
|
}, this.setDataSource([]);
|
|
792
832
|
}
|
|
793
833
|
};
|
|
794
|
-
|
|
795
|
-
let
|
|
796
|
-
var
|
|
797
|
-
const
|
|
834
|
+
l(Re, "ngDataManager");
|
|
835
|
+
let pe = Re;
|
|
836
|
+
var B, oe;
|
|
837
|
+
const Te = class Te extends HTMLElement {
|
|
798
838
|
constructor() {
|
|
799
839
|
super();
|
|
800
840
|
//#created = false;
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
this.attachShadow({ mode: "open" }),
|
|
841
|
+
f(this, B);
|
|
842
|
+
f(this, oe);
|
|
843
|
+
this.attachShadow({ mode: "open" }), y(this, B, new pe(this));
|
|
804
844
|
}
|
|
805
845
|
connectedCallback() {
|
|
806
|
-
|
|
846
|
+
y(this, oe, new ue(this.shadowRoot)), K.log("NineTable connected."), this.dispatchEvent(new CustomEvent("load", { bubbles: !0, detail: { target: this } }));
|
|
807
847
|
}
|
|
808
848
|
disconnectedCallback() {
|
|
809
|
-
|
|
849
|
+
K.log("NineTable disconnected.");
|
|
810
850
|
}
|
|
811
851
|
// π― μΈλΆμμ grid.data.set(...) ννλ‘ μ κ·Όν μ μλλ‘ λ°μ΄ν° λ§€λμ μ€ν
|
|
812
852
|
get data() {
|
|
813
|
-
return e(this,
|
|
853
|
+
return e(this, B).data;
|
|
814
854
|
}
|
|
815
855
|
// π― ν(row) κ΄λ ¨ μ μ΄ μ κ·Όμ μ€ν
|
|
816
856
|
get row() {
|
|
817
|
-
return e(this,
|
|
857
|
+
return e(this, B).row;
|
|
818
858
|
}
|
|
819
859
|
// π― μ 체 λ°μ΄ν° λ§€λμ μ κ·Ό νμν κ²½μ°
|
|
820
860
|
get dataManager() {
|
|
821
|
-
return e(this,
|
|
861
|
+
return e(this, B);
|
|
822
862
|
}
|
|
823
863
|
};
|
|
824
|
-
|
|
825
|
-
let
|
|
826
|
-
customElements.get("nine-table") || customElements.define("nine-table",
|
|
864
|
+
B = new WeakMap(), oe = new WeakMap(), l(Te, "NineTable");
|
|
865
|
+
let ye = Te;
|
|
866
|
+
customElements.get("nine-table") || customElements.define("nine-table", ye);
|
|
827
867
|
//# sourceMappingURL=nine-table.js.map
|