@ninebone/datagrid 0.0.12 → 0.0.14

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.
@@ -546,24 +546,20 @@ tbody {
546
546
  }
547
547
  }
548
548
 
549
- th.selected, td.selected {
550
- .selected {
551
- background-color: var(--cell-selection-bg);
552
- }
553
-
554
- .selected-start {
555
- background-color: transparent;
556
- }
549
+ .selected {
550
+ background-color: var(--cell-selection-bg);
551
+ }
557
552
 
558
- .selected-top { border-top: 2px solid var(--cell-selection-border-color); }
559
- .selected-bottom { border-bottom: 2px solid var(--cell-selection-border-color); }
560
- .selected-left { border-left: 2px solid var(--cell-selection-border-color); }
561
- .selected-right { border-right: 2px solid var(--cell-selection-border-color); }
553
+ .selected-start {
554
+ background-color: transparent;
562
555
  }
563
556
 
557
+ .selected-top { border-top: 2px solid var(--cell-selection-border-color); }
558
+ .selected-bottom { border-bottom: 2px solid var(--cell-selection-border-color); }
559
+ .selected-left { border-left: 2px solid var(--cell-selection-border-color); }
560
+ .selected-right { border-right: 2px solid var(--cell-selection-border-color); }
564
561
  }
565
562
 
566
-
567
563
  nine-table-col-expand {
568
564
  position: absolute;
569
565
  right: 2px;
@@ -1390,6 +1386,39 @@ nine-table-sheet.hscroll-visible {
1390
1386
  }
1391
1387
  }
1392
1388
 
1389
+ @media (hover: none) and (pointer: coarse) {
1390
+
1391
+ nine-table-sheet.vscroll-visible {
1392
+ grid-template-columns: 1fr;
1393
+ nine-table-vscrollbar {
1394
+ display: none;
1395
+ }
1396
+ }
1397
+ nine-table-sheet.hscroll-visible {
1398
+ grid-template-rows: 1fr;
1399
+
1400
+ nine-table-hscrollbar, .scroll-edge {
1401
+ display: none;
1402
+ }
1403
+ }
1404
+
1405
+ /* Hide custom scrollbar elements on touch-based mobile devices */
1406
+ nine-table-vscrollbar,
1407
+ nine-table-hscrollbar,
1408
+ .scroll-edge {
1409
+ display: none;
1410
+ }
1411
+
1412
+ /* Optional: Hide native scrollbars visually while maintaining smooth touch/momentum scrolling */
1413
+ .ng-sheet-body {
1414
+ scrollbar-width: none; /* Firefox */
1415
+ -ms-overflow-style: none; /* IE/Edge */
1416
+ }
1417
+ .ng-sheet-body::-webkit-scrollbar {
1418
+ display: none; /* Chrome/Safari/Opera */
1419
+ }
1420
+ }
1421
+
1393
1422
 
1394
1423
  nine-table-sheet {
1395
1424
  --sheet-bg: #ffffff;
@@ -582,17 +582,13 @@ var f = class extends HTMLElement {
582
582
  }, t = () => {
583
583
  clearInterval(this.#r), clearInterval(this.#i);
584
584
  };
585
- [
586
- "mouseup",
587
- "mouseleave",
588
- "touchend"
589
- ].forEach((e) => {
585
+ ["mouseup", "mouseleave"].forEach((e) => {
590
586
  this.#n.left.addEventListener(e, t), this.#n.right.addEventListener(e, t), this.#n.track.addEventListener(e, t);
591
587
  }), this.#n.left.addEventListener("mousedown", (t) => {
592
588
  t.button === 0 && e(-20);
593
589
  }), this.#n.right.addEventListener("mousedown", (t) => {
594
590
  t.button === 0 && e(20);
595
- }), this.#n.left.addEventListener("touchstart", () => e(-20)), this.#n.right.addEventListener("touchstart", () => e(20)), this.#n.track.addEventListener("mousedown", (e) => {
591
+ }), this.#n.track.addEventListener("mousedown", (e) => {
596
592
  if (e.button !== 0) return;
597
593
  e.preventDefault();
598
594
  let t = this.#n.track.getBoundingClientRect(), n = this.#n.thumb.clientWidth;
@@ -854,10 +850,10 @@ var m = {
854
850
  }
855
851
  let o = this.#n.templateLength, s = (this.#n.elements.body.thead?.offsetHeight || 0) + (this.#n.elements.body.tfoot?.offsetHeight || 0) + this.#n.elements.body.tbody.head.offsetHeight, c = this.#n.querySelector(".ng-sheet-body").offsetHeight || 0, l = Math.max(a * n - (c - s - n), 0), u = 15e6, d = l > u, f = 1, p = l;
856
852
  d && (f = u / l, p = u), this.#n.elements.scrollHolder.style.height = `${p}px`;
857
- let m = d ? e / f : e, h = Math.max(0, a - 1), g = Math.min(m, l), _ = Math.max(0, Math.min(Math.floor(g / n), h)), v = g % n;
858
- this.#n.elements.left.tbody.body.style.top = this.#n.elements.body.tbody.body.style.top = this.#n.elements.right.tbody.body.style.top = `-${v}px`;
859
- let y = this.#r.firstTr, b = y && y.dataset.row !== void 0 ? parseInt(y.dataset.row, 10) : -1;
860
- (t || b !== _) && ([
853
+ let m = d ? e / f : e, h = Math.max(0, a - 1), g = Math.min(m, l), _ = Math.max(0, Math.min(Math.floor(g / n), h));
854
+ this.#n.elements.left.tbody.body.style.transform = this.#n.elements.body.tbody.body.style.transform = this.#n.elements.right.tbody.body.style.transform = `translate3d(0px, -${g % n}px, 0px)`;
855
+ let v = this.#r.firstTr, y = v && v.dataset.row !== void 0 ? parseInt(v.dataset.row, 10) : -1;
856
+ (t || y !== _) && ([
861
857
  this.#n.elements.left.tbody.body,
862
858
  this.#n.elements.body.tbody.body,
863
859
  this.#n.elements.right.tbody.body
@@ -2852,7 +2848,7 @@ var N = class {
2852
2848
  let e = Array.from(this.#e.children).filter((e) => e.tagName.toUpperCase() === "TABLE"), t = this.#e.getAttribute("auto-height") === "true", n = e.length, r = e.map((e, t) => {
2853
2849
  let r = t === 0 ? "active" : "", i = e.id || `sheet${t + 1}`;
2854
2850
  return `<nine-table-sheet class="${r}" data-index="${t}" data-sheet-id="${i}" id="${i}"></nine-table-sheet>` + (t < n - 1 ? `<nine-splitter class="h" data-split-index="${t}"></nine-splitter>` : "");
2855
- }).join(""), i = ["@import \"https://cdn.jsdelivr.net/npm/@ninebone/datagrid@0.0.12/dist/css/nine-table.css\";"];
2851
+ }).join(""), i = ["@import \"https://cdn.jsdelivr.net/npm/@ninebone/datagrid@0.0.14/dist/css/nine-table.css\";"];
2856
2852
  nine["nine-table"] && nine["nine-table"].cssFile && i.push(`@import "${nine["nine-table"].cssFile}";`), this.#e.shadowRoot.innerHTML = `
2857
2853
  <style>
2858
2854
  ${i.join("\n")}
@@ -2921,7 +2917,7 @@ var N = class {
2921
2917
  #r = 0;
2922
2918
  #i = "";
2923
2919
  constructor() {
2924
- super(), ["NINE-TABLE"].includes(this.tagName) && n.log("Welcome nine-table", "0.0.12"), this.#e = this.attachShadow({ mode: "open" }), this.#t = new o(this);
2920
+ super(), ["NINE-TABLE"].includes(this.tagName) && n.log("Welcome nine-table", "0.0.14"), this.#e = this.attachShadow({ mode: "open" }), this.#t = new o(this);
2925
2921
  }
2926
2922
  connectedCallback() {
2927
2923
  setTimeout(() => {