@ninebone/table 0.0.613 → 0.0.615
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 +28 -28
- package/dist/nine-table.js.map +1 -1
- package/dist/nine-table.umd.js +1 -1
- package/dist/nine-table.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/nine-table.js
CHANGED
|
@@ -201,24 +201,24 @@ const Me = class Me extends HTMLElement {
|
|
|
201
201
|
B = new WeakMap(), j = new WeakMap(), w = new WeakMap(), X = new WeakMap(), K = new WeakMap(), Z = new WeakMap(), It = new WeakMap(), G = new WeakMap(), _t = new WeakMap(), c(Me, "NineTableHScrollBar");
|
|
202
202
|
let ae = Me;
|
|
203
203
|
customElements.get("nine-table-hscrollbar") || customElements.define("nine-table-hscrollbar", ae);
|
|
204
|
-
var F, at, J,
|
|
204
|
+
var F, at, J, T, vt, xt, Nt;
|
|
205
205
|
const $e = class $e extends HTMLElement {
|
|
206
206
|
constructor() {
|
|
207
207
|
super();
|
|
208
208
|
d(this, F);
|
|
209
209
|
d(this, at);
|
|
210
210
|
d(this, J, !1);
|
|
211
|
-
d(this,
|
|
211
|
+
d(this, T);
|
|
212
212
|
d(this, vt, 0);
|
|
213
213
|
d(this, xt, 0);
|
|
214
214
|
E(this, "refresh", /* @__PURE__ */ c(() => {
|
|
215
|
-
if (!t(this, F) || !t(this,
|
|
216
|
-
const e = t(this,
|
|
217
|
-
if (l <= n) {
|
|
218
|
-
|
|
215
|
+
if (!t(this, F) || !t(this, T)) return;
|
|
216
|
+
const e = t(this, T).container, s = t(this, T).track, r = t(this, T).thumb, n = e.clientHeight, a = (t(this, F).data.get() || []).length, h = t(this, at).getRowHeight(), l = a * h;
|
|
217
|
+
if (l <= n || a === 0) {
|
|
218
|
+
this.style.display = "none";
|
|
219
219
|
return;
|
|
220
220
|
} else
|
|
221
|
-
|
|
221
|
+
this.style.display = "flex";
|
|
222
222
|
const f = s.clientHeight;
|
|
223
223
|
if (f <= 0) return;
|
|
224
224
|
const u = Math.max(Math.min(f * (n / l), f), 20);
|
|
@@ -227,22 +227,22 @@ const $e = class $e extends HTMLElement {
|
|
|
227
227
|
let m = 0;
|
|
228
228
|
b > 0 && (m = g / b * (f - u));
|
|
229
229
|
const x = f - u;
|
|
230
|
-
m < 0 && (m = 0), m > x && (m = x), r.style.top = `${m}px`, t(this,
|
|
230
|
+
m < 0 && (m = 0), m > x && (m = x), r.style.top = `${m}px`, t(this, T).top.disabled = g <= 0, t(this, T).bottom.disabled = g >= b - 1;
|
|
231
231
|
}, "refresh"));
|
|
232
232
|
d(this, Nt, /* @__PURE__ */ c(() => {
|
|
233
233
|
W.log("nine-table-vscrollbar.#init");
|
|
234
|
-
const e = t(this,
|
|
234
|
+
const e = t(this, T).container, s = /* @__PURE__ */ c(() => {
|
|
235
235
|
const n = (t(this, F).data.get() || []).length, o = t(this, at).getRowHeight();
|
|
236
236
|
return n * o;
|
|
237
237
|
}, "getContentHeight");
|
|
238
238
|
e.addEventListener("scroll", () => {
|
|
239
239
|
t(this, J) || this.refresh();
|
|
240
|
-
}), t(this,
|
|
240
|
+
}), t(this, T).thumb.addEventListener("mousedown", (r) => {
|
|
241
241
|
if (r.button !== 0) return;
|
|
242
242
|
r.stopPropagation(), r.preventDefault(), y(this, J, !0), y(this, vt, r.clientY), y(this, xt, e.scrollTop);
|
|
243
243
|
const n = /* @__PURE__ */ c((a) => {
|
|
244
244
|
if (!t(this, J)) return;
|
|
245
|
-
const h = t(this,
|
|
245
|
+
const h = t(this, T).track.getBoundingClientRect(), l = t(this, T).thumb.clientHeight, u = h.height - l, g = a.clientY - t(this, vt), b = e.clientHeight, m = s(), x = Math.max(m - b, 1);
|
|
246
246
|
if (u > 0 && x > 0) {
|
|
247
247
|
const A = g / u * x;
|
|
248
248
|
let v = t(this, xt) + A;
|
|
@@ -254,17 +254,17 @@ const $e = class $e extends HTMLElement {
|
|
|
254
254
|
y(this, J, !1), document.removeEventListener("mousemove", n), document.removeEventListener("mouseup", o), this.refresh();
|
|
255
255
|
}, "onMouseUp");
|
|
256
256
|
document.addEventListener("mousemove", n), document.addEventListener("mouseup", o);
|
|
257
|
-
}), t(this,
|
|
258
|
-
if (r.button !== 0 || r.target === t(this,
|
|
259
|
-
const n = t(this,
|
|
257
|
+
}), t(this, T).track.addEventListener("mousedown", (r) => {
|
|
258
|
+
if (r.button !== 0 || r.target === t(this, T).thumb) return;
|
|
259
|
+
const n = t(this, T).track.getBoundingClientRect(), o = t(this, T).thumb.clientHeight, a = r.clientY - n.top - o / 2, l = n.height - o, f = e.clientHeight, u = s(), g = Math.max(u - f, 1);
|
|
260
260
|
if (l > 0 && g > 0) {
|
|
261
261
|
const b = Math.max(0, Math.min(1, a / l));
|
|
262
262
|
e.scrollTop = b * g;
|
|
263
263
|
}
|
|
264
264
|
this.refresh();
|
|
265
|
-
}), t(this,
|
|
265
|
+
}), t(this, T).top.addEventListener("click", () => {
|
|
266
266
|
e.scrollTop -= 40;
|
|
267
|
-
}), t(this,
|
|
267
|
+
}), t(this, T).bottom.addEventListener("click", () => {
|
|
268
268
|
e.scrollTop += 40;
|
|
269
269
|
});
|
|
270
270
|
}, "#init"));
|
|
@@ -340,7 +340,7 @@ const $e = class $e extends HTMLElement {
|
|
|
340
340
|
setTimeout(e, 10);
|
|
341
341
|
return;
|
|
342
342
|
}
|
|
343
|
-
y(this,
|
|
343
|
+
y(this, T, {
|
|
344
344
|
container: s,
|
|
345
345
|
track: this.querySelector(".ng-scroll-track"),
|
|
346
346
|
thumb: this.querySelector(".ng-scroll-thumb"),
|
|
@@ -351,7 +351,7 @@ const $e = class $e extends HTMLElement {
|
|
|
351
351
|
e();
|
|
352
352
|
}
|
|
353
353
|
};
|
|
354
|
-
F = new WeakMap(), at = new WeakMap(), J = new WeakMap(),
|
|
354
|
+
F = new WeakMap(), at = new WeakMap(), J = new WeakMap(), T = new WeakMap(), vt = new WeakMap(), xt = new WeakMap(), Nt = new WeakMap(), c($e, "NineTableVScrollBar");
|
|
355
355
|
let le = $e;
|
|
356
356
|
customElements.get("nine-table-vscrollbar") || customElements.define("nine-table-vscrollbar", le);
|
|
357
357
|
var P, S, Q, D, I, V, tt, wt, Se, Ae, Wt, Ot, zt, St, At, Bt, Dt, Et, Ee, lt, qt, Pt;
|
|
@@ -467,8 +467,8 @@ const Ie = class Ie {
|
|
|
467
467
|
((a = b[v]) == null ? void 0 : a.getBoundingClientRect().height) || 0,
|
|
468
468
|
((h = m[v]) == null ? void 0 : h.getBoundingClientRect().height) || 0,
|
|
469
469
|
((l = x[v]) == null ? void 0 : l.getBoundingClientRect().height) || 0
|
|
470
|
-
],
|
|
471
|
-
|
|
470
|
+
], R = Math.max(...M);
|
|
471
|
+
R > 0 && (b[v] && (b[v].style.height = `${R}px`), m[v] && (m[v].style.height = `${R}px`), x[v] && (x[v].style.height = `${R}px`));
|
|
472
472
|
}
|
|
473
473
|
}
|
|
474
474
|
const r = t(this, S).querySelector(".ng-container-left .ng-part-footer table"), n = t(this, S).querySelector(".ng-container-body .ng-part-footer table"), o = t(this, S).querySelector(".ng-container-right .ng-part-footer table");
|
|
@@ -479,8 +479,8 @@ const Ie = class Ie {
|
|
|
479
479
|
((f = b[v]) == null ? void 0 : f.getBoundingClientRect().height) || 0,
|
|
480
480
|
((u = m[v]) == null ? void 0 : u.getBoundingClientRect().height) || 0,
|
|
481
481
|
((g = x[v]) == null ? void 0 : g.getBoundingClientRect().height) || 0
|
|
482
|
-
],
|
|
483
|
-
|
|
482
|
+
], R = Math.max(...M);
|
|
483
|
+
R > 0 && (b[v] && (b[v].style.height = `${R}px`), m[v] && (m[v].style.height = `${R}px`), x[v] && (x[v].style.height = `${R}px`));
|
|
484
484
|
}
|
|
485
485
|
}
|
|
486
486
|
}, "#syncRowHeights"));
|
|
@@ -545,8 +545,8 @@ const Ie = class Ie {
|
|
|
545
545
|
A.style.display = "none";
|
|
546
546
|
return;
|
|
547
547
|
}
|
|
548
|
-
const
|
|
549
|
-
A.style.display = "", t(this, qt).call(this, A,
|
|
548
|
+
const R = t(this, P).data.get(M);
|
|
549
|
+
A.style.display = "", t(this, qt).call(this, A, R, M);
|
|
550
550
|
});
|
|
551
551
|
});
|
|
552
552
|
}, "#handleScroll"));
|
|
@@ -653,9 +653,9 @@ const jt = class jt {
|
|
|
653
653
|
A = z;
|
|
654
654
|
break;
|
|
655
655
|
}
|
|
656
|
-
const M = v.rowSpan || 1,
|
|
656
|
+
const M = v.rowSpan || 1, R = v.colSpan || 1;
|
|
657
657
|
for (let z = 0; z < M; z++)
|
|
658
|
-
for (let yt = 0; yt <
|
|
658
|
+
for (let yt = 0; yt < R; yt++)
|
|
659
659
|
x + z < u && A + yt < g && (b[x + z][A + yt] = z === 0 && yt === 0 ? "1" : "0");
|
|
660
660
|
});
|
|
661
661
|
}), l.forEach((m) => {
|
|
@@ -1505,8 +1505,8 @@ const De = class De extends me {
|
|
|
1505
1505
|
if (e && (e = parseInt(e)), e && !isNaN(e)) {
|
|
1506
1506
|
var s = t(this, p).closest("tr"), r = [];
|
|
1507
1507
|
$("th,td", s).each((v, M) => {
|
|
1508
|
-
var
|
|
1509
|
-
|
|
1508
|
+
var R = ninegrid.j.querySelectorAll(M).attr("suppress");
|
|
1509
|
+
R && M.dataset.row && (R = parseInt(R), !isNaN(R) && R <= e && r.push(R));
|
|
1510
1510
|
}), r.sort();
|
|
1511
1511
|
var n = !1;
|
|
1512
1512
|
if (parseInt(s.sectionRowIndex / t(this, C).template.length) > 0)
|