@ninebone/table 0.0.407 → 0.0.409
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 +21 -21
- package/dist/nine-table.js.map +1 -1
- package/dist/nine-table.umd.js +3 -3
- package/dist/nine-table.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/nine-table.js
CHANGED
|
@@ -23,12 +23,12 @@ const re = class re extends Se.constructor {
|
|
|
23
23
|
a(re, "Trace");
|
|
24
24
|
let jt = re;
|
|
25
25
|
const H = new jt();
|
|
26
|
-
var _,
|
|
26
|
+
var _, z, p, V, Y, X, St, U, Et;
|
|
27
27
|
const le = class le extends HTMLElement {
|
|
28
28
|
constructor() {
|
|
29
29
|
super();
|
|
30
30
|
c(this, _);
|
|
31
|
-
c(this,
|
|
31
|
+
c(this, z, !1);
|
|
32
32
|
c(this, p);
|
|
33
33
|
c(this, V);
|
|
34
34
|
c(this, Y);
|
|
@@ -41,7 +41,7 @@ const le = class le extends HTMLElement {
|
|
|
41
41
|
})), t(this, X).observe(e));
|
|
42
42
|
}, "#observeResize"));
|
|
43
43
|
v(this, "refresh", /* @__PURE__ */ a(() => {
|
|
44
|
-
if (!t(this, _) || !t(this, p) || t(this,
|
|
44
|
+
if (!t(this, _) || !t(this, p) || t(this, z)) return;
|
|
45
45
|
const e = t(this, p).container, s = e.querySelector("table");
|
|
46
46
|
if (!s) return;
|
|
47
47
|
const n = t(this, p).track, r = t(this, p).thumb, o = t(this, _).querySelector(".ng-container-bottom"), l = e.clientWidth, d = s.scrollWidth;
|
|
@@ -99,13 +99,13 @@ const le = class le extends HTMLElement {
|
|
|
99
99
|
t(this, U).call(this, n.clientX - r.left - o / 2);
|
|
100
100
|
}), t(this, p).thumb.addEventListener("mousedown", (n) => {
|
|
101
101
|
if (n.button !== 0) return;
|
|
102
|
-
n.stopPropagation(), n.preventDefault(), g(this,
|
|
102
|
+
n.stopPropagation(), n.preventDefault(), g(this, z, !0), this.shiftX = n.clientX - t(this, p).thumb.getBoundingClientRect().left;
|
|
103
103
|
const r = /* @__PURE__ */ a((l) => {
|
|
104
|
-
if (!t(this,
|
|
104
|
+
if (!t(this, z)) return;
|
|
105
105
|
const d = t(this, p).track.getBoundingClientRect();
|
|
106
106
|
t(this, U).call(this, l.clientX - d.left - this.shiftX);
|
|
107
107
|
}, "onMouseMove"), o = /* @__PURE__ */ a(() => {
|
|
108
|
-
g(this,
|
|
108
|
+
g(this, z, !1), s(), document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", o), this.refresh();
|
|
109
109
|
}, "onMouseUp");
|
|
110
110
|
document.addEventListener("mousemove", r), document.addEventListener("mouseup", o);
|
|
111
111
|
});
|
|
@@ -189,7 +189,7 @@ const le = class le extends HTMLElement {
|
|
|
189
189
|
left: this.querySelector(".ng-scroll-left"),
|
|
190
190
|
right: this.querySelector(".ng-scroll-right")
|
|
191
191
|
}), s.addEventListener("scroll", () => {
|
|
192
|
-
t(this,
|
|
192
|
+
t(this, z) || this.refresh();
|
|
193
193
|
}), t(this, Et).call(this), t(this, St).call(this), this.refresh();
|
|
194
194
|
}, "initWhenReady");
|
|
195
195
|
e();
|
|
@@ -198,16 +198,16 @@ const le = class le extends HTMLElement {
|
|
|
198
198
|
t(this, X) && t(this, X).disconnect();
|
|
199
199
|
}
|
|
200
200
|
};
|
|
201
|
-
_ = new WeakMap(),
|
|
201
|
+
_ = new WeakMap(), z = new WeakMap(), p = new WeakMap(), V = new WeakMap(), Y = new WeakMap(), X = new WeakMap(), St = new WeakMap(), U = new WeakMap(), Et = new WeakMap(), a(le, "NineTableHScrollBar");
|
|
202
202
|
let Kt = le;
|
|
203
203
|
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", Kt);
|
|
204
|
-
var
|
|
204
|
+
var D, Q, O, S, ht, dt, Rt;
|
|
205
205
|
const ae = class ae extends HTMLElement {
|
|
206
206
|
constructor() {
|
|
207
207
|
super();
|
|
208
|
-
c(this,
|
|
208
|
+
c(this, D);
|
|
209
209
|
c(this, Q);
|
|
210
|
-
c(this,
|
|
210
|
+
c(this, O, !1);
|
|
211
211
|
c(this, S);
|
|
212
212
|
c(this, ht, 0);
|
|
213
213
|
c(this, dt, 0);
|
|
@@ -215,9 +215,9 @@ const ae = class ae extends HTMLElement {
|
|
|
215
215
|
* 🎯 스크롤바 위치 및 썸브 크기 갱신
|
|
216
216
|
*/
|
|
217
217
|
v(this, "refresh", /* @__PURE__ */ a(() => {
|
|
218
|
-
if (H.log("refresh"), !t(this,
|
|
218
|
+
if (H.log("refresh", t(this, O)), !t(this, D) || !t(this, S) || t(this, O)) return;
|
|
219
219
|
H.log("refresh2");
|
|
220
|
-
const e = t(this, S).container, s = t(this, S).track, n = t(this, S).thumb, r = e.clientHeight, l = (t(this,
|
|
220
|
+
const e = t(this, S).container, s = t(this, S).track, n = t(this, S).thumb, r = e.clientHeight, l = (t(this, D).data.get() || []).length, d = t(this, Q).getRowHeight(), h = l * d;
|
|
221
221
|
if (h <= r) {
|
|
222
222
|
n.style.display = "none", t(this, S).top.disabled = !0, t(this, S).bottom.disabled = !0;
|
|
223
223
|
return;
|
|
@@ -235,16 +235,16 @@ const ae = class ae extends HTMLElement {
|
|
|
235
235
|
}, "refresh"));
|
|
236
236
|
c(this, Rt, /* @__PURE__ */ a(() => {
|
|
237
237
|
const e = t(this, S).container, s = /* @__PURE__ */ a(() => {
|
|
238
|
-
const r = (t(this,
|
|
238
|
+
const r = (t(this, D).data.get() || []).length, o = t(this, Q).getRowHeight();
|
|
239
239
|
return r * o;
|
|
240
240
|
}, "getContentHeight");
|
|
241
241
|
e.addEventListener("scroll", () => {
|
|
242
|
-
t(this,
|
|
242
|
+
t(this, O) || this.refresh();
|
|
243
243
|
}), t(this, S).thumb.addEventListener("mousedown", (n) => {
|
|
244
244
|
if (n.button !== 0) return;
|
|
245
|
-
n.stopPropagation(), n.preventDefault(), g(this,
|
|
245
|
+
n.stopPropagation(), n.preventDefault(), g(this, O, !0), g(this, ht, n.clientY), g(this, dt, e.scrollTop);
|
|
246
246
|
const r = /* @__PURE__ */ a((l) => {
|
|
247
|
-
if (!t(this,
|
|
247
|
+
if (!t(this, O)) return;
|
|
248
248
|
const d = t(this, S).track.getBoundingClientRect(), h = t(this, S).thumb.clientHeight, u = d.height - h, b = l.clientY - t(this, ht), y = e.clientHeight, m = s(), R = Math.max(m - y, 1);
|
|
249
249
|
if (u > 0 && R > 0) {
|
|
250
250
|
const J = b / u * R;
|
|
@@ -254,7 +254,7 @@ const ae = class ae extends HTMLElement {
|
|
|
254
254
|
}
|
|
255
255
|
this.refresh();
|
|
256
256
|
}, "onMouseMove"), o = /* @__PURE__ */ a(() => {
|
|
257
|
-
g(this,
|
|
257
|
+
g(this, O, !1), document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", o), this.refresh();
|
|
258
258
|
}, "onMouseUp");
|
|
259
259
|
document.addEventListener("mousemove", r), document.addEventListener("mouseup", o);
|
|
260
260
|
}), t(this, S).track.addEventListener("mousedown", (n) => {
|
|
@@ -273,7 +273,7 @@ const ae = class ae extends HTMLElement {
|
|
|
273
273
|
}, "#init"));
|
|
274
274
|
}
|
|
275
275
|
connectedCallback() {
|
|
276
|
-
g(this,
|
|
276
|
+
g(this, D, this.getRootNode().host), g(this, Q, this.closest("nine-table-sheet")), this.innerHTML = `
|
|
277
277
|
<style>
|
|
278
278
|
nine-table-vscrollbar {
|
|
279
279
|
display: flex;
|
|
@@ -339,7 +339,7 @@ const ae = class ae extends HTMLElement {
|
|
|
339
339
|
<button class='ng-scroll-bottom' disabled><div class='ng-scroll-icon'></div></button>
|
|
340
340
|
`;
|
|
341
341
|
const e = /* @__PURE__ */ a(() => {
|
|
342
|
-
const s = t(this,
|
|
342
|
+
const s = t(this, D).shadowRoot.querySelector(".ng-container-body");
|
|
343
343
|
if (!s) {
|
|
344
344
|
setTimeout(e, 10);
|
|
345
345
|
return;
|
|
@@ -355,7 +355,7 @@ const ae = class ae extends HTMLElement {
|
|
|
355
355
|
e();
|
|
356
356
|
}
|
|
357
357
|
};
|
|
358
|
-
|
|
358
|
+
D = new WeakMap(), Q = new WeakMap(), O = new WeakMap(), S = new WeakMap(), ht = new WeakMap(), dt = new WeakMap(), Rt = new WeakMap(), a(ae, "NineTableVScrollBar");
|
|
359
359
|
let Zt = ae;
|
|
360
360
|
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar", Zt);
|
|
361
361
|
var At, tt;
|