@design.estate/dees-catalog 3.62.0 → 3.64.0

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.
@@ -163914,29 +163914,48 @@ var tableStyles = [
163914
163914
  border-bottom-width: 0px;
163915
163915
  }
163916
163916
 
163917
+ /* Default mode (Mode B, page sticky): horizontal scroll lives on
163918
+ .tableScroll (so wide tables don't get clipped by an ancestor
163919
+ overflow:hidden such as dees-tile). Vertical sticky is handled by
163920
+ a JS-managed floating header (.floatingHeader, position:fixed),
163921
+ which is unaffected by ancestor overflow. */
163917
163922
  .tableScroll {
163918
- /* enable horizontal scroll only when content exceeds width */
163923
+ position: relative;
163919
163924
  overflow-x: auto;
163920
- /* prevent vertical scroll inside the table container */
163921
- overflow-y: hidden;
163922
- /* avoid reserving extra space for classic scrollbars where possible */
163925
+ overflow-y: visible;
163926
+ scrollbar-gutter: stable;
163927
+ }
163928
+ /* Mode A, internal scroll: opt-in via fixed-height attribute.
163929
+ The table scrolls inside its own box and the header sticks via plain CSS sticky. */
163930
+ :host([fixed-height]) .tableScroll {
163931
+ max-height: var(--table-max-height, 360px);
163932
+ overflow: auto;
163923
163933
  scrollbar-gutter: stable both-edges;
163924
163934
  }
163925
- /* Hide horizontal scrollbar entirely when not using sticky header */
163926
- :host(:not([sticky-header])) .tableScroll {
163927
- -ms-overflow-style: none; /* IE/Edge */
163928
- scrollbar-width: none; /* Firefox (hides both axes) */
163935
+ :host([fixed-height]) .tableScroll::-webkit-scrollbar:horizontal {
163936
+ height: 0px;
163929
163937
  }
163930
- :host(:not([sticky-header])) .tableScroll::-webkit-scrollbar {
163931
- display: none; /* Chrome/Safari */
163938
+
163939
+ /* Floating header overlay (Mode B). Position is managed by JS so it
163940
+ escapes any ancestor overflow:hidden (position:fixed is not clipped
163941
+ by overflow ancestors). */
163942
+ .floatingHeader {
163943
+ position: fixed;
163944
+ top: 0;
163945
+ left: 0;
163946
+ z-index: 100;
163947
+ visibility: hidden;
163948
+ overflow: hidden;
163949
+ pointer-events: none;
163932
163950
  }
163933
- /* In sticky-header mode, hide only the horizontal scrollbar in WebKit/Blink */
163934
- :host([sticky-header]) .tableScroll::-webkit-scrollbar:horizontal {
163935
- height: 0px;
163951
+ .floatingHeader.active {
163952
+ visibility: visible;
163936
163953
  }
163937
- :host([sticky-header]) .tableScroll {
163938
- max-height: var(--table-max-height, 360px);
163939
- overflow: auto;
163954
+ .floatingHeader table {
163955
+ margin: 0;
163956
+ }
163957
+ .floatingHeader th {
163958
+ pointer-events: auto;
163940
163959
  }
163941
163960
 
163942
163961
  table {
@@ -163959,15 +163978,25 @@ var tableStyles = [
163959
163978
  background: ${cssManager.bdTheme("hsl(210 40% 96.1%)", "hsl(0 0% 9%)")};
163960
163979
  border-bottom: 1px solid var(--dees-color-border-strong);
163961
163980
  }
163962
- :host([sticky-header]) thead th {
163981
+ /* th needs its own background so sticky cells paint over scrolled rows
163982
+ (browsers don't paint the <thead> box behind a sticky <th>). */
163983
+ th {
163984
+ background: ${cssManager.bdTheme("hsl(210 40% 96.1%)", "hsl(0 0% 9%)")};
163985
+ }
163986
+ /* Mode A — internal scroll sticky */
163987
+ :host([fixed-height]) thead th {
163963
163988
  position: sticky;
163964
163989
  top: 0;
163965
163990
  z-index: 2;
163966
163991
  }
163992
+ :host([fixed-height]) thead tr.filtersRow th {
163993
+ top: 36px; /* matches th { height: 36px } below */
163994
+ }
163967
163995
 
163968
163996
  tbody tr {
163969
163997
  transition: background-color 0.15s ease;
163970
163998
  position: relative;
163999
+ user-select: none;
163971
164000
  }
163972
164001
 
163973
164002
  /* Default horizontal lines (bottom border only) */
@@ -164521,7 +164550,7 @@ __name(compileLucenePredicate, "compileLucenePredicate");
164521
164550
  init_dist_ts30();
164522
164551
  init_dist_ts29();
164523
164552
  init_theme();
164524
- var _selectedIds_dec, _selectionMode_dec, _searchMode_dec, _stickyHeader_dec, _showColumnFilters_dec, _columnFilters_dec, _filterText_dec, _sortBy_dec, _showGrid_dec, _showHorizontalLines_dec, _showVerticalLines_dec, _editableFields_dec, _selectedDataRow_dec, _reverseDisplayFunction_dec, _displayFunction_dec, _augmentFromDisplayFunction_dec, _rowKey_dec, _columns_dec, _dataActions_dec, _searchable_dec, _dataName_dec, _required_dec3, _disabled_dec3, _label_dec3, _key_dec2, _data_dec, _heading2_dec, _heading1_dec, _a42, _DeesTable_decorators, _init39, _heading1, _heading22, _data, _key2, _label3, _disabled3, _required3, _dataName, _searchable, _dataActions, _columns, _rowKey, _augmentFromDisplayFunction, _displayFunction, _reverseDisplayFunction, _selectedDataRow, _editableFields, _showVerticalLines, _showHorizontalLines, _showGrid, _sortBy, _filterText, _columnFilters, _showColumnFilters, _stickyHeader, _searchMode, _selectionMode, _selectedIds;
164553
+ var _selectedIds_dec, _selectionMode_dec, _searchMode_dec, _fixedHeight_dec, _showSelectionCheckbox_dec, _showColumnFilters_dec, _columnFilters_dec, _filterText_dec, _sortBy_dec, _showGrid_dec, _showHorizontalLines_dec, _showVerticalLines_dec, _editableFields_dec, _selectedDataRow_dec, _reverseDisplayFunction_dec, _displayFunction_dec, _augmentFromDisplayFunction_dec, _rowKey_dec, _columns_dec, _dataActions_dec, _searchable_dec, _dataName_dec, _required_dec3, _disabled_dec3, _label_dec3, _key_dec2, _data_dec, _heading2_dec, _heading1_dec, _a42, _DeesTable_decorators, _init39, _heading1, _heading22, _data, _key2, _label3, _disabled3, _required3, _dataName, _searchable, _dataActions, _columns, _rowKey, _augmentFromDisplayFunction, _displayFunction, _reverseDisplayFunction, _selectedDataRow, _editableFields, _showVerticalLines, _showHorizontalLines, _showGrid, _sortBy, _filterText, _columnFilters, _showColumnFilters, _showSelectionCheckbox, _fixedHeight, _searchMode, _selectionMode, _selectedIds;
164525
164554
  function ordinalLabel(n12) {
164526
164555
  const s10 = ["th", "st", "nd", "rd"];
164527
164556
  const v5 = n12 % 100;
@@ -164570,7 +164599,7 @@ var _DeesTable = class _DeesTable extends (_a42 = DeesElement, _heading1_dec = [
164570
164599
  type: Boolean,
164571
164600
  reflect: true,
164572
164601
  attribute: "show-grid"
164573
- })], _sortBy_dec = [n5({ attribute: false })], _filterText_dec = [n5({ type: String })], _columnFilters_dec = [n5({ attribute: false })], _showColumnFilters_dec = [n5({ type: Boolean, attribute: "show-column-filters" })], _stickyHeader_dec = [n5({ type: Boolean, reflect: true, attribute: "sticky-header" })], _searchMode_dec = [n5({ type: String })], _selectionMode_dec = [n5({ type: String })], _selectedIds_dec = [n5({ attribute: false })], _a42) {
164602
+ })], _sortBy_dec = [n5({ attribute: false })], _filterText_dec = [n5({ type: String })], _columnFilters_dec = [n5({ attribute: false })], _showColumnFilters_dec = [n5({ type: Boolean, attribute: "show-column-filters" })], _showSelectionCheckbox_dec = [n5({ type: Boolean, reflect: true, attribute: "show-selection-checkbox" })], _fixedHeight_dec = [n5({ type: Boolean, reflect: true, attribute: "fixed-height" })], _searchMode_dec = [n5({ type: String })], _selectionMode_dec = [n5({ type: String })], _selectedIds_dec = [n5({ attribute: false })], _a42) {
164574
164603
  constructor() {
164575
164604
  super();
164576
164605
  __privateAdd(this, _heading1, __runInitializers(_init39, 8, this, "heading 1")), __runInitializers(_init39, 11, this);
@@ -164601,21 +164630,84 @@ var _DeesTable = class _DeesTable extends (_a42 = DeesElement, _heading1_dec = [
164601
164630
  __privateAdd(this, _filterText, __runInitializers(_init39, 92, this, "")), __runInitializers(_init39, 95, this);
164602
164631
  __privateAdd(this, _columnFilters, __runInitializers(_init39, 96, this, {})), __runInitializers(_init39, 99, this);
164603
164632
  __privateAdd(this, _showColumnFilters, __runInitializers(_init39, 100, this, false)), __runInitializers(_init39, 103, this);
164604
- __privateAdd(this, _stickyHeader, __runInitializers(_init39, 104, this, false)), __runInitializers(_init39, 107, this);
164605
- __privateAdd(this, _searchMode, __runInitializers(_init39, 108, this, "table")), __runInitializers(_init39, 111, this);
164633
+ __privateAdd(this, _showSelectionCheckbox, __runInitializers(_init39, 104, this, false)), __runInitializers(_init39, 107, this);
164634
+ __privateAdd(this, _fixedHeight, __runInitializers(_init39, 108, this, false)), __runInitializers(_init39, 111, this);
164635
+ __privateAdd(this, _searchMode, __runInitializers(_init39, 112, this, "table")), __runInitializers(_init39, 115, this);
164606
164636
  __publicField(this, "__searchTextSub");
164607
164637
  __publicField(this, "__searchModeSub");
164608
- __privateAdd(this, _selectionMode, __runInitializers(_init39, 112, this, "none")), __runInitializers(_init39, 115, this);
164609
- __privateAdd(this, _selectedIds, __runInitializers(_init39, 116, this, /* @__PURE__ */ new Set())), __runInitializers(_init39, 119, this);
164638
+ __privateAdd(this, _selectionMode, __runInitializers(_init39, 116, this, "none")), __runInitializers(_init39, 119, this);
164639
+ __privateAdd(this, _selectedIds, __runInitializers(_init39, 120, this, /* @__PURE__ */ new Set())), __runInitializers(_init39, 123, this);
164610
164640
  __publicField(this, "_rowIdMap", /* @__PURE__ */ new WeakMap());
164611
164641
  __publicField(this, "_rowIdCounter", 0);
164642
+ /**
164643
+ * Anchor row id for shift+click range selection. Set whenever the user
164644
+ * makes a non-range click (plain or cmd/ctrl) so the next shift+click
164645
+ * can compute a contiguous range from this anchor.
164646
+ */
164647
+ __publicField(this, "__selectionAnchorId");
164648
+ /**
164649
+ * Ctrl/Cmd+C copies the currently selected rows as a JSON array. Falls
164650
+ * back to copying the focused-row (`selectedDataRow`) if no multi
164651
+ * selection exists. No-op if a focused input/textarea would normally
164652
+ * receive the copy.
164653
+ */
164654
+ __publicField(this, "__handleHostKeydown", /* @__PURE__ */ __name((eventArg) => {
164655
+ const isCopy = (eventArg.metaKey || eventArg.ctrlKey) && (eventArg.key === "c" || eventArg.key === "C");
164656
+ if (!isCopy) return;
164657
+ const path2 = eventArg.composedPath?.() || [];
164658
+ for (const t9 of path2) {
164659
+ const tag = t9?.tagName;
164660
+ if (tag === "INPUT" || tag === "TEXTAREA") return;
164661
+ if (t9?.isContentEditable) return;
164662
+ }
164663
+ const rows = [];
164664
+ if (this.selectedIds.size > 0) {
164665
+ for (const r11 of this.data) if (this.selectedIds.has(this.getRowId(r11))) rows.push(r11);
164666
+ } else if (this.selectedDataRow) {
164667
+ rows.push(this.selectedDataRow);
164668
+ }
164669
+ if (rows.length === 0) return;
164670
+ eventArg.preventDefault();
164671
+ this.__writeRowsAsJson(rows);
164672
+ }, "__handleHostKeydown"));
164673
+ // ─── Floating header (page-sticky) lifecycle ─────────────────────────
164674
+ __publicField(this, "__floatingResizeObserver");
164675
+ __publicField(this, "__floatingScrollHandler");
164676
+ __publicField(this, "__floatingActive", false);
164677
+ __publicField(this, "__scrollAncestors", []);
164612
164678
  __publicField(this, "__debounceTimer");
164679
+ if (!this.hasAttribute("tabindex")) this.setAttribute("tabindex", "0");
164680
+ this.addEventListener("keydown", this.__handleHostKeydown);
164613
164681
  }
164614
164682
  get value() {
164615
164683
  return this.data;
164616
164684
  }
164617
164685
  set value(_valueArg) {
164618
164686
  }
164687
+ /**
164688
+ * Copies the current selection as a JSON array. If `fallbackRow` is given
164689
+ * and there is no multi-selection, that row is copied instead. Used both
164690
+ * by the Ctrl/Cmd+C handler and by the default context-menu action.
164691
+ */
164692
+ copySelectionAsJson(fallbackRow) {
164693
+ const rows = [];
164694
+ if (this.selectedIds.size > 0) {
164695
+ for (const r11 of this.data) if (this.selectedIds.has(this.getRowId(r11))) rows.push(r11);
164696
+ } else if (fallbackRow) {
164697
+ rows.push(fallbackRow);
164698
+ } else if (this.selectedDataRow) {
164699
+ rows.push(this.selectedDataRow);
164700
+ }
164701
+ if (rows.length === 0) return;
164702
+ this.__writeRowsAsJson(rows);
164703
+ }
164704
+ __writeRowsAsJson(rows) {
164705
+ try {
164706
+ const json = JSON.stringify(rows, null, 2);
164707
+ navigator.clipboard?.writeText(json);
164708
+ } catch {
164709
+ }
164710
+ }
164619
164711
  render() {
164620
164712
  const usingColumns = Array.isArray(this.columns) && this.columns.length > 0;
164621
164713
  const effectiveColumns = usingColumns ? computeEffectiveColumns(this.columns, this.augmentFromDisplayFunction, this.displayFunction, this.data) : computeColumnsFromDisplayFunction(this.displayFunction, this.data);
@@ -164699,58 +164791,7 @@ var _DeesTable = class _DeesTable extends (_a42 = DeesElement, _heading1_dec = [
164699
164791
  <div class="tableScroll">
164700
164792
  <table>
164701
164793
  <thead>
164702
- <tr>
164703
- ${this.selectionMode !== "none" ? b2`
164704
- <th style="width:42px; text-align:center;">
164705
- ${this.selectionMode === "multi" ? b2`
164706
- <dees-input-checkbox
164707
- .value=${this.areAllVisibleSelected()}
164708
- .indeterminate=${this.isVisibleSelectionIndeterminate()}
164709
- @newValue=${(e11) => {
164710
- e11.stopPropagation();
164711
- this.setSelectVisible(e11.detail === true);
164712
- }}
164713
- ></dees-input-checkbox>
164714
- ` : b2``}
164715
- </th>
164716
- ` : b2``}
164717
- ${effectiveColumns.filter((c11) => !c11.hidden).map((col) => {
164718
- const isSortable = !!col.sortable;
164719
- const ariaSort = this.getAriaSort(col);
164720
- return b2`
164721
- <th
164722
- role="columnheader"
164723
- aria-sort=${ariaSort}
164724
- style="${isSortable ? "cursor: pointer;" : ""}"
164725
- @click=${(eventArg) => isSortable ? this.handleHeaderClick(eventArg, col, effectiveColumns) : null}
164726
- @contextmenu=${(eventArg) => isSortable ? this.openHeaderContextMenu(eventArg, col, effectiveColumns) : null}
164727
- >
164728
- ${col.header ?? col.key}
164729
- ${this.renderSortIndicator(col)}
164730
- </th>`;
164731
- })}
164732
- ${(() => {
164733
- if (this.dataActions && this.dataActions.length > 0) {
164734
- return b2` <th class="actionsCol">Actions</th> `;
164735
- }
164736
- })()}
164737
- </tr>
164738
- ${this.showColumnFilters ? b2`<tr class="filtersRow">
164739
- ${this.selectionMode !== "none" ? b2`<th style="width:42px;"></th>` : b2``}
164740
- ${effectiveColumns.filter((c11) => !c11.hidden).map((col) => {
164741
- const key2 = String(col.key);
164742
- if (col.filterable === false) return b2`<th></th>`;
164743
- return b2`<th>
164744
- <input type="text" placeholder="Filter..." .value=${this.columnFilters[key2] || ""}
164745
- @input=${(e11) => this.setColumnFilter(key2, e11.target.value)} />
164746
- </th>`;
164747
- })}
164748
- ${(() => {
164749
- if (this.dataActions && this.dataActions.length > 0) {
164750
- return b2` <th></th> `;
164751
- }
164752
- })()}
164753
- </tr>` : b2``}
164794
+ ${this.renderHeaderRows(effectiveColumns)}
164754
164795
  </thead>
164755
164796
  <tbody>
164756
164797
  ${viewData.map((itemArg, rowIndex) => {
@@ -164763,15 +164804,9 @@ var _DeesTable = class _DeesTable extends (_a42 = DeesElement, _heading1_dec = [
164763
164804
  }, "getTr");
164764
164805
  return b2`
164765
164806
  <tr
164766
- @click=${() => {
164767
- this.selectedDataRow = itemArg;
164768
- if (this.selectionMode === "single") {
164769
- const id = this.getRowId(itemArg);
164770
- this.selectedIds.clear();
164771
- this.selectedIds.add(id);
164772
- this.emitSelectionChange();
164773
- this.requestUpdate();
164774
- }
164807
+ @click=${(e11) => this.handleRowClick(e11, itemArg, rowIndex, viewData)}
164808
+ @mousedown=${(e11) => {
164809
+ if (e11.shiftKey && this.selectionMode !== "single") e11.preventDefault();
164775
164810
  }}
164776
164811
  @dragenter=${async (eventArg) => {
164777
164812
  eventArg.preventDefault();
@@ -164806,27 +164841,43 @@ var _DeesTable = class _DeesTable extends (_a42 = DeesElement, _heading1_dec = [
164806
164841
  }
164807
164842
  }}
164808
164843
  @contextmenu=${async (eventArg) => {
164809
- DeesContextmenu.openContextMenuWithOptions(
164810
- eventArg,
164811
- this.getActionsForType("contextmenu").map((action) => {
164812
- const menuItem = {
164813
- name: action.name,
164814
- iconName: action.iconName,
164815
- action: /* @__PURE__ */ __name(async () => {
164816
- await action.actionFunc({
164817
- item: itemArg,
164818
- table: this
164819
- });
164820
- return null;
164821
- }, "action")
164822
- };
164823
- return menuItem;
164824
- })
164825
- );
164844
+ if (!this.isRowSelected(itemArg)) {
164845
+ this.selectedDataRow = itemArg;
164846
+ this.selectedIds.clear();
164847
+ this.selectedIds.add(this.getRowId(itemArg));
164848
+ this.__selectionAnchorId = this.getRowId(itemArg);
164849
+ this.emitSelectionChange();
164850
+ this.requestUpdate();
164851
+ }
164852
+ const userItems = this.getActionsForType("contextmenu").map((action) => ({
164853
+ name: action.name,
164854
+ iconName: action.iconName,
164855
+ action: /* @__PURE__ */ __name(async () => {
164856
+ await action.actionFunc({
164857
+ item: itemArg,
164858
+ table: this
164859
+ });
164860
+ return null;
164861
+ }, "action")
164862
+ }));
164863
+ const defaultItems = [
164864
+ {
164865
+ name: this.selectedIds.size > 1 ? `Copy ${this.selectedIds.size} rows as JSON` : "Copy row as JSON",
164866
+ iconName: "lucide:Copy",
164867
+ action: /* @__PURE__ */ __name(async () => {
164868
+ this.copySelectionAsJson(itemArg);
164869
+ return null;
164870
+ }, "action")
164871
+ }
164872
+ ];
164873
+ DeesContextmenu.openContextMenuWithOptions(eventArg, [
164874
+ ...userItems,
164875
+ ...defaultItems
164876
+ ]);
164826
164877
  }}
164827
- class="${itemArg === this.selectedDataRow ? "selected" : ""}"
164878
+ class="${itemArg === this.selectedDataRow || this.isRowSelected(itemArg) ? "selected" : ""}"
164828
164879
  >
164829
- ${this.selectionMode !== "none" ? b2`<td style="width:42px; text-align:center;">
164880
+ ${this.showSelectionCheckbox ? b2`<td style="width:42px; text-align:center;">
164830
164881
  <dees-input-checkbox
164831
164882
  .value=${this.isRowSelected(itemArg)}
164832
164883
  @newValue=${(e11) => {
@@ -164884,6 +164935,13 @@ var _DeesTable = class _DeesTable extends (_a42 = DeesElement, _heading1_dec = [
164884
164935
  </tbody>
164885
164936
  </table>
164886
164937
  </div>
164938
+ <div class="floatingHeader" aria-hidden="true">
164939
+ <table>
164940
+ <thead>
164941
+ ${this.renderHeaderRows(effectiveColumns)}
164942
+ </thead>
164943
+ </table>
164944
+ </div>
164887
164945
  ` : b2` <div class="noDataSet">No data set!</div> `}
164888
164946
  <div slot="footer" class="footer">
164889
164947
  <div class="tableStatistics">
@@ -164918,11 +164976,226 @@ var _DeesTable = class _DeesTable extends (_a42 = DeesElement, _heading1_dec = [
164918
164976
  </dees-tile>
164919
164977
  `;
164920
164978
  }
164979
+ /**
164980
+ * Renders the header rows. Used twice per render: once inside the real
164981
+ * `<thead>` and once inside the floating-header clone, so sort indicators
164982
+ * and filter inputs stay in sync automatically.
164983
+ */
164984
+ renderHeaderRows(effectiveColumns) {
164985
+ return b2`
164986
+ <tr>
164987
+ ${this.showSelectionCheckbox ? b2`
164988
+ <th style="width:42px; text-align:center;">
164989
+ ${this.selectionMode === "multi" ? b2`
164990
+ <dees-input-checkbox
164991
+ .value=${this.areAllVisibleSelected()}
164992
+ .indeterminate=${this.isVisibleSelectionIndeterminate()}
164993
+ @newValue=${(e11) => {
164994
+ e11.stopPropagation();
164995
+ this.setSelectVisible(e11.detail === true);
164996
+ }}
164997
+ ></dees-input-checkbox>
164998
+ ` : b2``}
164999
+ </th>
165000
+ ` : b2``}
165001
+ ${effectiveColumns.filter((c11) => !c11.hidden).map((col) => {
165002
+ const isSortable = !!col.sortable;
165003
+ const ariaSort = this.getAriaSort(col);
165004
+ return b2`
165005
+ <th
165006
+ role="columnheader"
165007
+ aria-sort=${ariaSort}
165008
+ style="${isSortable ? "cursor: pointer;" : ""}"
165009
+ @click=${(eventArg) => isSortable ? this.handleHeaderClick(eventArg, col, effectiveColumns) : null}
165010
+ @contextmenu=${(eventArg) => isSortable ? this.openHeaderContextMenu(eventArg, col, effectiveColumns) : null}
165011
+ >
165012
+ ${col.header ?? col.key}
165013
+ ${this.renderSortIndicator(col)}
165014
+ </th>`;
165015
+ })}
165016
+ ${this.dataActions && this.dataActions.length > 0 ? b2`<th class="actionsCol">Actions</th>` : b2``}
165017
+ </tr>
165018
+ ${this.showColumnFilters ? b2`<tr class="filtersRow">
165019
+ ${this.showSelectionCheckbox ? b2`<th style="width:42px;"></th>` : b2``}
165020
+ ${effectiveColumns.filter((c11) => !c11.hidden).map((col) => {
165021
+ const key2 = String(col.key);
165022
+ if (col.filterable === false) return b2`<th></th>`;
165023
+ return b2`<th>
165024
+ <input type="text" placeholder="Filter..." .value=${this.columnFilters[key2] || ""}
165025
+ @input=${(e11) => this.setColumnFilter(key2, e11.target.value)} />
165026
+ </th>`;
165027
+ })}
165028
+ ${this.dataActions && this.dataActions.length > 0 ? b2`<th></th>` : b2``}
165029
+ </tr>` : b2``}
165030
+ `;
165031
+ }
165032
+ get __floatingHeaderEl() {
165033
+ return this.shadowRoot?.querySelector(".floatingHeader") ?? null;
165034
+ }
165035
+ get __realTableEl() {
165036
+ return this.shadowRoot?.querySelector(".tableScroll > table") ?? null;
165037
+ }
165038
+ get __floatingTableEl() {
165039
+ return this.shadowRoot?.querySelector(".floatingHeader > table") ?? null;
165040
+ }
165041
+ /**
165042
+ * Walks up the DOM (and through shadow roots) collecting every ancestor
165043
+ * element whose computed `overflow-y` makes it a scroll container, plus
165044
+ * `window` at the end. We listen for scroll on all of them so the floating
165045
+ * header reacts whether the user scrolls the page or any nested container.
165046
+ */
165047
+ __collectScrollAncestors() {
165048
+ const result = [];
165049
+ let node2 = this;
165050
+ const scrollish = /* @__PURE__ */ __name((v5) => v5 === "auto" || v5 === "scroll" || v5 === "overlay", "scrollish");
165051
+ while (node2) {
165052
+ if (node2 instanceof Element) {
165053
+ const style2 = getComputedStyle(node2);
165054
+ const sy = scrollish(style2.overflowY);
165055
+ const sx = scrollish(style2.overflowX);
165056
+ if (sy || sx) {
165057
+ result.push({ target: node2, scrollsY: sy, scrollsX: sx });
165058
+ }
165059
+ }
165060
+ const parent = node2.assignedSlot ? node2.assignedSlot : node2.parentNode;
165061
+ if (parent) {
165062
+ node2 = parent;
165063
+ } else if (node2.host) {
165064
+ node2 = node2.host;
165065
+ } else {
165066
+ node2 = null;
165067
+ }
165068
+ }
165069
+ result.push({ target: window, scrollsY: true, scrollsX: true });
165070
+ return result;
165071
+ }
165072
+ /**
165073
+ * Returns the "stick line" — the y-coordinate (in viewport space) at which
165074
+ * the floating header should appear. Defaults to 0 (page top), but if the
165075
+ * table is inside a scroll container we use that container's content-box
165076
+ * top so the header sits inside the container's border/padding instead of
165077
+ * floating over it.
165078
+ */
165079
+ __getStickContext() {
165080
+ let top = 0;
165081
+ let left = 0;
165082
+ let right = window.innerWidth;
165083
+ for (const a5 of this.__scrollAncestors) {
165084
+ if (a5.target === window) continue;
165085
+ const el = a5.target;
165086
+ const r11 = el.getBoundingClientRect();
165087
+ const cs = getComputedStyle(el);
165088
+ if (a5.scrollsY) {
165089
+ const bt = parseFloat(cs.borderTopWidth) || 0;
165090
+ top = Math.max(top, r11.top + bt);
165091
+ }
165092
+ if (a5.scrollsX) {
165093
+ const bl = parseFloat(cs.borderLeftWidth) || 0;
165094
+ const br = parseFloat(cs.borderRightWidth) || 0;
165095
+ left = Math.max(left, r11.left + bl);
165096
+ right = Math.min(right, r11.right - br);
165097
+ }
165098
+ }
165099
+ return { top, left, right };
165100
+ }
165101
+ setupFloatingHeader() {
165102
+ this.teardownFloatingHeader();
165103
+ if (this.fixedHeight) return;
165104
+ const realTable = this.__realTableEl;
165105
+ if (!realTable) return;
165106
+ this.__scrollAncestors = this.__collectScrollAncestors();
165107
+ const tableScrollEl = this.shadowRoot?.querySelector(".tableScroll");
165108
+ if (tableScrollEl) {
165109
+ this.__scrollAncestors.unshift({ target: tableScrollEl, scrollsY: false, scrollsX: true });
165110
+ }
165111
+ this.__floatingResizeObserver = new ResizeObserver(() => {
165112
+ this.__syncFloatingHeader();
165113
+ });
165114
+ this.__floatingResizeObserver.observe(realTable);
165115
+ this.__floatingScrollHandler = () => this.__syncFloatingHeader();
165116
+ for (const a5 of this.__scrollAncestors) {
165117
+ a5.target.addEventListener("scroll", this.__floatingScrollHandler, { passive: true });
165118
+ }
165119
+ window.addEventListener("resize", this.__floatingScrollHandler, { passive: true });
165120
+ this.__syncFloatingHeader();
165121
+ }
165122
+ teardownFloatingHeader() {
165123
+ this.__floatingResizeObserver?.disconnect();
165124
+ this.__floatingResizeObserver = void 0;
165125
+ if (this.__floatingScrollHandler) {
165126
+ for (const a5 of this.__scrollAncestors) {
165127
+ a5.target.removeEventListener("scroll", this.__floatingScrollHandler);
165128
+ }
165129
+ window.removeEventListener("resize", this.__floatingScrollHandler);
165130
+ this.__floatingScrollHandler = void 0;
165131
+ }
165132
+ this.__scrollAncestors = [];
165133
+ this.__floatingActive = false;
165134
+ const fh = this.__floatingHeaderEl;
165135
+ if (fh) fh.classList.remove("active");
165136
+ }
165137
+ /**
165138
+ * Single function that drives both activation and geometry of the floating
165139
+ * header. Called on scroll, resize, table-resize, and after each render.
165140
+ */
165141
+ __syncFloatingHeader() {
165142
+ const fh = this.__floatingHeaderEl;
165143
+ const realTable = this.__realTableEl;
165144
+ const floatTable = this.__floatingTableEl;
165145
+ if (!fh || !realTable || !floatTable) return;
165146
+ const tableRect = realTable.getBoundingClientRect();
165147
+ const stick = this.__getStickContext();
165148
+ floatTable.style.tableLayout = realTable.style.tableLayout || "auto";
165149
+ const realHeadRows = realTable.tHead?.rows;
165150
+ const floatHeadRows = floatTable.tHead?.rows;
165151
+ let headerHeight = 0;
165152
+ if (realHeadRows && floatHeadRows) {
165153
+ for (let r11 = 0; r11 < realHeadRows.length && r11 < floatHeadRows.length; r11++) {
165154
+ headerHeight += realHeadRows[r11].getBoundingClientRect().height;
165155
+ const realCells = realHeadRows[r11].cells;
165156
+ const floatCells = floatHeadRows[r11].cells;
165157
+ for (let c11 = 0; c11 < realCells.length && c11 < floatCells.length; c11++) {
165158
+ const w4 = realCells[c11].getBoundingClientRect().width;
165159
+ floatCells[c11].style.width = `${w4}px`;
165160
+ floatCells[c11].style.minWidth = `${w4}px`;
165161
+ floatCells[c11].style.maxWidth = `${w4}px`;
165162
+ }
165163
+ }
165164
+ }
165165
+ const shouldBeActive = tableRect.top < stick.top && tableRect.bottom > stick.top + Math.min(headerHeight, 1);
165166
+ if (shouldBeActive !== this.__floatingActive) {
165167
+ this.__floatingActive = shouldBeActive;
165168
+ fh.classList.toggle("active", shouldBeActive);
165169
+ }
165170
+ if (!shouldBeActive) return;
165171
+ const clipLeft = Math.max(tableRect.left, stick.left);
165172
+ const clipRight = Math.min(tableRect.right, stick.right);
165173
+ const clipWidth = Math.max(0, clipRight - clipLeft);
165174
+ fh.style.top = `${stick.top}px`;
165175
+ fh.style.left = `${clipLeft}px`;
165176
+ fh.style.width = `${clipWidth}px`;
165177
+ floatTable.style.width = `${tableRect.width}px`;
165178
+ floatTable.style.marginLeft = `${tableRect.left - clipLeft}px`;
165179
+ }
165180
+ async disconnectedCallback() {
165181
+ super.disconnectedCallback();
165182
+ this.teardownFloatingHeader();
165183
+ }
164921
165184
  async firstUpdated() {
164922
165185
  }
164923
165186
  async updated(changedProperties) {
164924
165187
  super.updated(changedProperties);
164925
165188
  this.determineColumnWidths();
165189
+ if (changedProperties.has("fixedHeight") || changedProperties.has("data") || changedProperties.has("columns") || !this.__floatingScrollHandler) {
165190
+ if (!this.fixedHeight && this.data.length > 0) {
165191
+ this.setupFloatingHeader();
165192
+ } else {
165193
+ this.teardownFloatingHeader();
165194
+ }
165195
+ }
165196
+ if (!this.fixedHeight && this.data.length > 0) {
165197
+ this.__syncFloatingHeader();
165198
+ }
164926
165199
  if (this.searchable) {
164927
165200
  const existing = this.dataActions.find((actionArg) => actionArg.type?.includes("header") && actionArg.name === "Search");
164928
165201
  if (!existing) {
@@ -165367,6 +165640,64 @@ var _DeesTable = class _DeesTable extends (_a42 = DeesElement, _heading1_dec = [
165367
165640
  this.emitSelectionChange();
165368
165641
  this.requestUpdate();
165369
165642
  }
165643
+ /**
165644
+ * Handles row clicks with file-manager style selection semantics:
165645
+ * - plain click: select only this row, set anchor
165646
+ * - cmd/ctrl+click: toggle this row in/out, set anchor
165647
+ * - shift+click: select the contiguous range from the anchor to this row
165648
+ *
165649
+ * Multi-row click selection is always available (`selectionMode === 'none'`
165650
+ * and `'multi'` both behave this way) so consumers can always copy a set
165651
+ * of rows. Only `selectionMode === 'single'` restricts to one row.
165652
+ */
165653
+ handleRowClick(eventArg, item, rowIndex, view) {
165654
+ const id = this.getRowId(item);
165655
+ if (this.selectionMode === "single") {
165656
+ this.selectedDataRow = item;
165657
+ this.selectedIds.clear();
165658
+ this.selectedIds.add(id);
165659
+ this.__selectionAnchorId = id;
165660
+ this.emitSelectionChange();
165661
+ this.requestUpdate();
165662
+ return;
165663
+ }
165664
+ const isToggle = eventArg.metaKey || eventArg.ctrlKey;
165665
+ const isRange = eventArg.shiftKey;
165666
+ if (isRange && this.__selectionAnchorId !== void 0) {
165667
+ window.getSelection?.()?.removeAllRanges();
165668
+ const anchorIdx = view.findIndex((r11) => this.getRowId(r11) === this.__selectionAnchorId);
165669
+ if (anchorIdx >= 0) {
165670
+ const [a5, b5] = anchorIdx <= rowIndex ? [anchorIdx, rowIndex] : [rowIndex, anchorIdx];
165671
+ this.selectedIds.clear();
165672
+ for (let i11 = a5; i11 <= b5; i11++) this.selectedIds.add(this.getRowId(view[i11]));
165673
+ } else {
165674
+ this.selectedIds.clear();
165675
+ this.selectedIds.add(id);
165676
+ this.__selectionAnchorId = id;
165677
+ }
165678
+ this.selectedDataRow = item;
165679
+ } else if (isToggle) {
165680
+ const wasSelected = this.selectedIds.has(id);
165681
+ if (wasSelected) {
165682
+ this.selectedIds.delete(id);
165683
+ if (this.selectedDataRow === item) {
165684
+ const remaining = view.find((r11) => this.selectedIds.has(this.getRowId(r11)));
165685
+ this.selectedDataRow = remaining;
165686
+ }
165687
+ } else {
165688
+ this.selectedIds.add(id);
165689
+ this.selectedDataRow = item;
165690
+ }
165691
+ this.__selectionAnchorId = id;
165692
+ } else {
165693
+ this.selectedDataRow = item;
165694
+ this.selectedIds.clear();
165695
+ this.selectedIds.add(id);
165696
+ this.__selectionAnchorId = id;
165697
+ }
165698
+ this.emitSelectionChange();
165699
+ this.requestUpdate();
165700
+ }
165370
165701
  setRowSelected(row, checked) {
165371
165702
  const id = this.getRowId(row);
165372
165703
  if (this.selectionMode === "single") {
@@ -165483,7 +165814,8 @@ _sortBy = new WeakMap();
165483
165814
  _filterText = new WeakMap();
165484
165815
  _columnFilters = new WeakMap();
165485
165816
  _showColumnFilters = new WeakMap();
165486
- _stickyHeader = new WeakMap();
165817
+ _showSelectionCheckbox = new WeakMap();
165818
+ _fixedHeight = new WeakMap();
165487
165819
  _searchMode = new WeakMap();
165488
165820
  _selectionMode = new WeakMap();
165489
165821
  _selectedIds = new WeakMap();
@@ -165511,7 +165843,8 @@ __decorateElement(_init39, 4, "sortBy", _sortBy_dec, _DeesTable, _sortBy);
165511
165843
  __decorateElement(_init39, 4, "filterText", _filterText_dec, _DeesTable, _filterText);
165512
165844
  __decorateElement(_init39, 4, "columnFilters", _columnFilters_dec, _DeesTable, _columnFilters);
165513
165845
  __decorateElement(_init39, 4, "showColumnFilters", _showColumnFilters_dec, _DeesTable, _showColumnFilters);
165514
- __decorateElement(_init39, 4, "stickyHeader", _stickyHeader_dec, _DeesTable, _stickyHeader);
165846
+ __decorateElement(_init39, 4, "showSelectionCheckbox", _showSelectionCheckbox_dec, _DeesTable, _showSelectionCheckbox);
165847
+ __decorateElement(_init39, 4, "fixedHeight", _fixedHeight_dec, _DeesTable, _fixedHeight);
165515
165848
  __decorateElement(_init39, 4, "searchMode", _searchMode_dec, _DeesTable, _searchMode);
165516
165849
  __decorateElement(_init39, 4, "selectionMode", _selectionMode_dec, _DeesTable, _selectionMode);
165517
165850
  __decorateElement(_init39, 4, "selectedIds", _selectedIds_dec, _DeesTable, _selectedIds);
@@ -199361,7 +199694,7 @@ init_group_runtime();
199361
199694
  // ts_web/00_commitinfo_data.ts
199362
199695
  var commitinfo = {
199363
199696
  name: "@design.estate/dees-catalog",
199364
- version: "3.62.0",
199697
+ version: "3.64.0",
199365
199698
  description: "A comprehensive library that provides dynamic web components for building sophisticated and modern web applications using JavaScript and TypeScript."
199366
199699
  };
199367
199700
  export {
@@ -201334,4 +201667,4 @@ ibantools/jsnext/ibantools.js:
201334
201667
  * @preferred
201335
201668
  *)
201336
201669
  */
201337
- //# sourceMappingURL=bundle-1775564414196.js.map
201670
+ //# sourceMappingURL=bundle-1775572474370.js.map