@lpdjs/firestore-repo-service 2.2.9-beta.5 → 2.2.9-beta.6

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/index.cjs CHANGED
@@ -825,14 +825,32 @@ function initTable(table) {
825
825
  // \u2500\u2500 Tag original column indices \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
826
826
  function tagOriginalIndices(table) {
827
827
  var ths = Array.from(table.querySelectorAll("thead th"));
828
+ // Skip the leading selection (checkbox) column \u2014 it must always stay
829
+ // visible and is not user-toggleable.
830
+ var startIdx = 0;
831
+ while (
832
+ startIdx < ths.length &&
833
+ ths[startIdx].querySelector("[data-frs-select-page]")
834
+ ) {
835
+ startIdx++;
836
+ }
828
837
  var dataCount = countDataColumns(table, ths);
829
838
  for (var i = 0; i < dataCount; i++) {
830
- ths[i].setAttribute("data-orig-col", String(i));
839
+ var th = ths[startIdx + i];
840
+ if (!th) break;
841
+ th.setAttribute("data-orig-col", String(i));
831
842
  }
832
843
  table.querySelectorAll("tbody tr").forEach(function (row) {
833
844
  var tds = Array.from(row.querySelectorAll("td"));
834
- for (var j = 0; j < dataCount && j < tds.length; j++) {
835
- tds[j].setAttribute("data-orig-col", String(j));
845
+ var rowStart = 0;
846
+ while (
847
+ rowStart < tds.length &&
848
+ tds[rowStart].querySelector("[data-frs-select-row]")
849
+ ) {
850
+ rowStart++;
851
+ }
852
+ for (var j = 0; j < dataCount && rowStart + j < tds.length; j++) {
853
+ tds[rowStart + j].setAttribute("data-orig-col", String(j));
836
854
  }
837
855
  });
838
856
  }