@design.estate/dees-catalog 3.99.0 → 3.99.1

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.
@@ -150293,6 +150293,15 @@ var _DeesTable = class _DeesTable extends (_a42 = DeesElement, _heading1_dec = [
150293
150293
  __privateAdd(this, _dataName, __runInitializers(_init39, 36, this)), __runInitializers(_init39, 39, this);
150294
150294
  __privateAdd(this, _searchable, __runInitializers(_init39, 40, this, true)), __runInitializers(_init39, 43, this);
150295
150295
  __privateAdd(this, _dataActions, __runInitializers(_init39, 44, this, [])), __runInitializers(_init39, 47, this);
150296
+ __publicField(this, "__searchAction", {
150297
+ name: "Search",
150298
+ iconName: "lucide:Search",
150299
+ type: ["header"],
150300
+ actionFunc: /* @__PURE__ */ __name(async () => {
150301
+ const searchGrid = this.shadowRoot.querySelector(".searchGrid");
150302
+ searchGrid.classList.toggle("hidden");
150303
+ }, "actionFunc")
150304
+ });
150296
150305
  __privateAdd(this, _columns, __runInitializers(_init39, 48, this, [])), __runInitializers(_init39, 51, this);
150297
150306
  __privateAdd(this, _rowKey, __runInitializers(_init39, 52, this)), __runInitializers(_init39, 55, this);
150298
150307
  __privateAdd(this, _augmentFromDisplayFunction, __runInitializers(_init39, 56, this, false)), __runInitializers(_init39, 59, this);
@@ -150455,7 +150464,7 @@ var _DeesTable = class _DeesTable extends (_a42 = DeesElement, _heading1_dec = [
150455
150464
  this.startEditing(cell2.item, cell2.col);
150456
150465
  return;
150457
150466
  }
150458
- const dblAction = this.dataActions.find(
150467
+ const dblAction = this.__getEffectiveDataActions().find(
150459
150468
  (action) => action.type?.includes("doubleClick") && this.isActionRelevant(action, cell2.item)
150460
150469
  );
150461
150470
  if (dblAction) dblAction.actionFunc({ item: cell2.item, table: this });
@@ -150884,7 +150893,7 @@ var _DeesTable = class _DeesTable extends (_a42 = DeesElement, _heading1_dec = [
150884
150893
  ${this.renderSortIndicator(col)}
150885
150894
  </th>`;
150886
150895
  })}
150887
- ${this.dataActions && this.dataActions.length > 0 ? b2`<th class="actionsCol">Actions</th>` : b2``}
150896
+ ${this.__getEffectiveDataActions().length > 0 ? b2`<th class="actionsCol">Actions</th>` : b2``}
150888
150897
  </tr>
150889
150898
  ${this.showColumnFilters ? b2`<tr class="filtersRow">
150890
150899
  ${this.showSelectionCheckbox ? b2`<th style="width:42px;"></th>` : b2``}
@@ -150896,7 +150905,7 @@ var _DeesTable = class _DeesTable extends (_a42 = DeesElement, _heading1_dec = [
150896
150905
  @input=${(e10) => this.setColumnFilter(key2, e10.target.value)} />
150897
150906
  </th>`;
150898
150907
  })}
150899
- ${this.dataActions && this.dataActions.length > 0 ? b2`<th></th>` : b2``}
150908
+ ${this.__getEffectiveDataActions().length > 0 ? b2`<th></th>` : b2``}
150900
150909
  </tr>` : b2``}
150901
150910
  `;
150902
150911
  }
@@ -151379,22 +151388,6 @@ var _DeesTable = class _DeesTable extends (_a42 = DeesElement, _heading1_dec = [
151379
151388
  this.__syncFloatingHeader();
151380
151389
  }
151381
151390
  if (this.searchable) {
151382
- const existing = this.dataActions.find((actionArg) => actionArg.type?.includes("header") && actionArg.name === "Search");
151383
- if (!existing) {
151384
- this.dataActions.unshift({
151385
- name: "Search",
151386
- iconName: "lucide:Search",
151387
- type: ["header"],
151388
- actionFunc: /* @__PURE__ */ __name(async () => {
151389
- console.log("open search");
151390
- const searchGrid = this.shadowRoot.querySelector(".searchGrid");
151391
- searchGrid.classList.toggle("hidden");
151392
- }, "actionFunc")
151393
- });
151394
- console.log(this.dataActions);
151395
- this.requestUpdate();
151396
- }
151397
- ;
151398
151391
  this.wireSearchInputs();
151399
151392
  }
151400
151393
  }
@@ -151450,7 +151443,9 @@ var _DeesTable = class _DeesTable extends (_a42 = DeesElement, _heading1_dec = [
151450
151443
  const cell2 = cells2[i11];
151451
151444
  const width = window.getComputedStyle(cell2).width;
151452
151445
  if (cell2.textContent.includes("Actions")) {
151453
- const neededWidth = this.dataActions.filter((actionArg) => actionArg.type?.includes("inRow")).length * 36;
151446
+ const neededWidth = this.__getEffectiveDataActions().filter(
151447
+ (actionArg) => actionArg.type?.includes("inRow")
151448
+ ).length * 36;
151454
151449
  cell2.style.width = `${Math.max(neededWidth, 68)}px`;
151455
151450
  } else {
151456
151451
  cell2.style.width = width;
@@ -152000,9 +151995,17 @@ var _DeesTable = class _DeesTable extends (_a42 = DeesElement, _heading1_dec = [
152000
151995
  isActionRelevant(actionArg, itemArg) {
152001
151996
  return !actionArg.actionRelevancyCheckFunc || actionArg.actionRelevancyCheckFunc(itemArg);
152002
151997
  }
151998
+ __getEffectiveDataActions() {
151999
+ if (!this.searchable || this.dataActions.some(
152000
+ (actionArg) => actionArg.type?.includes("header") && actionArg.name === "Search"
152001
+ )) {
152002
+ return this.dataActions;
152003
+ }
152004
+ return [this.__searchAction, ...this.dataActions];
152005
+ }
152003
152006
  getActionsForType(typeArg) {
152004
152007
  const actions = [];
152005
- for (const action of this.dataActions) {
152008
+ for (const action of this.__getEffectiveDataActions()) {
152006
152009
  if (!action.type?.includes(typeArg)) continue;
152007
152010
  actions.push(action);
152008
152011
  }
@@ -198384,7 +198387,7 @@ init_group_runtime();
198384
198387
  // ts_web/00_commitinfo_data.ts
198385
198388
  var commitinfo = {
198386
198389
  name: "@design.estate/dees-catalog",
198387
- version: "3.99.0",
198390
+ version: "3.99.1",
198388
198391
  description: "A comprehensive library that provides dynamic web components for building sophisticated and modern web applications using JavaScript and TypeScript."
198389
198392
  };
198390
198393
 
@@ -3,7 +3,7 @@
3
3
  */
4
4
  export const commitinfo = {
5
5
  name: '@design.estate/dees-catalog',
6
- version: '3.99.0',
6
+ version: '3.99.1',
7
7
  description: 'A comprehensive library that provides dynamic web components for building sophisticated and modern web applications using JavaScript and TypeScript.'
8
8
  };
9
9
  //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMDBfY29tbWl0aW5mb19kYXRhLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHNfd2ViLzAwX2NvbW1pdGluZm9fZGF0YS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7R0FFRztBQUNILE1BQU0sQ0FBQyxNQUFNLFVBQVUsR0FBRztJQUN4QixJQUFJLEVBQUUsNkJBQTZCO0lBQ25DLE9BQU8sRUFBRSxRQUFRO0lBQ2pCLFdBQVcsRUFBRSxzSkFBc0o7Q0FDcEssQ0FBQSJ9
@@ -32,6 +32,7 @@ export declare class DeesTable<T> extends DeesElement {
32
32
  accessor dataName: string;
33
33
  accessor searchable: boolean;
34
34
  accessor dataActions: ITableAction<T>[];
35
+ private readonly __searchAction;
35
36
  accessor columns: Column<T>[];
36
37
  /**
37
38
  * Stable row identity for selection and updates. If provided as a function,
@@ -386,6 +387,7 @@ export declare class DeesTable<T> extends DeesElement {
386
387
  private setSelectVisible;
387
388
  private emitSelectionChange;
388
389
  private isActionRelevant;
390
+ private __getEffectiveDataActions;
389
391
  getActionsForType(typeArg: ITableAction['type'][0]): ITableAction<any>[];
390
392
  /** True if the column has any in-cell editor configured. */
391
393
  private __isColumnEditable;