@apia/execution 4.0.89 → 4.0.92

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.d.ts CHANGED
@@ -3362,6 +3362,7 @@ declare class Grid extends Field<GridProps, GridDefinition, GridState> {
3362
3362
  get startIndex(): number;
3363
3363
  protected static parseGridDefinition(xml: string | TApiaGridDefinition): TApiaGridDefinition;
3364
3364
  constructor(definition: TApiaGridDefinition);
3365
+ private getMaximizedStorageKey;
3365
3366
  private resolveHeaderWidth;
3366
3367
  protected getGridActionFromEventName(eventName: GridEvents): "delete" | "add" | undefined;
3367
3368
  protected fireServerEvent(eventName: GridEvents, params?: FireEventParameters): Promise<boolean>;
@@ -3427,6 +3428,7 @@ declare class Grid extends Field<GridProps, GridDefinition, GridState> {
3427
3428
  protected runAction<T extends Record<string, any>>(postData: IApiaApiPostConfig<Record<string, any>>): Promise<TApiaApiAxiosResponse<(T & ResponseSysMessages) | null> | null>;
3428
3429
  private swapRows;
3429
3430
  toggleMaximize(): void;
3431
+ clearMaximizeState(): void;
3430
3432
  }
3431
3433
 
3432
3434
  declare class GridPaginated extends Grid {
package/dist/index.js CHANGED
@@ -3070,6 +3070,15 @@ class Grid extends Field {
3070
3070
  }
3071
3071
  };
3072
3072
  }
3073
+ getMaximizedStorageKey() {
3074
+ return [
3075
+ getWindow(this.form.execution).TAB_ID,
3076
+ this.form.definition.frmParent,
3077
+ this.form.definition.id,
3078
+ this.definition.id,
3079
+ "isMaximized"
3080
+ ].join("__");
3081
+ }
3073
3082
  resolveHeaderWidth(c) {
3074
3083
  if (c.fldType === "9" || c.fldType === "1" && c.dataType === "D" || c.fldType === "1" && c.hasQuery) {
3075
3084
  return "200px";
@@ -3384,7 +3393,7 @@ class Grid extends Field {
3384
3393
  }
3385
3394
  async init(form) {
3386
3395
  await super.init(form);
3387
- this.state.isMaximized = localStorage.getItem(`${this.definition.id}__isMaximized`) === "true";
3396
+ this.state.isMaximized = localStorage.getItem(this.getMaximizedStorageKey()) === "true";
3388
3397
  const headerRow = new Row("header");
3389
3398
  if (this.properties.gridForm || !this.properties.hideDelButton && !this.properties.readonly && !this.properties.inputAsText && !this.getForm().definition.readOnly && !this.getForm().definition.readonly && getWindow(this.getForm().execution)?.config?.execution?.components?.dataGrid?.showDeleteButton)
3390
3399
  headerRow.addCell(
@@ -3439,7 +3448,7 @@ class Grid extends Field {
3439
3448
  this.controller.head.addRow(headerRow);
3440
3449
  getDocument(this.form.execution).addEventListener?.("keydown", (ev) => {
3441
3450
  if (ev.code === "Escape") {
3442
- this.state.isMaximized = false;
3451
+ this.clearMaximizeState();
3443
3452
  }
3444
3453
  });
3445
3454
  }
@@ -3797,10 +3806,14 @@ class Grid extends Field {
3797
3806
  toggleMaximize() {
3798
3807
  this.state.isMaximized = !this.state.isMaximized;
3799
3808
  localStorage.setItem(
3800
- `${this.definition.id}__isMaximized`,
3809
+ this.getMaximizedStorageKey(),
3801
3810
  String(this.state.isMaximized)
3802
3811
  );
3803
3812
  }
3813
+ clearMaximizeState() {
3814
+ this.state.isMaximized = false;
3815
+ localStorage.removeItem(this.getMaximizedStorageKey());
3816
+ }
3804
3817
  }
3805
3818
 
3806
3819
  class GridPaginated extends Grid {