@fundamental-ngx/platform 0.64.2-rc.4 → 0.64.2-rc.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.
@@ -3376,6 +3376,14 @@ class TableInitialStateDirective extends TableInitialState {
3376
3376
  this.initialPage = 1;
3377
3377
  /** @hidden */
3378
3378
  this._tableService = inject(TableService);
3379
+ /** @hidden Snapshot of initialSortBy captured on first setInitialState() call */
3380
+ this._initialSortBySnapshot = [];
3381
+ /** @hidden Snapshot of initialFilterBy captured on first setInitialState() call */
3382
+ this._initialFilterBySnapshot = [];
3383
+ /** @hidden Snapshot of initialGroupBy captured on first setInitialState() call */
3384
+ this._initialGroupBySnapshot = [];
3385
+ /** @hidden */
3386
+ this._initialStateApplied = false;
3379
3387
  }
3380
3388
  /**
3381
3389
  * Initial state of table.
@@ -3407,6 +3415,13 @@ class TableInitialStateDirective extends TableInitialState {
3407
3415
  : directiveInitialPage;
3408
3416
  const initialPageSize = (this._table._loadPreviousPages ? directiveInitialPage : initialPage) *
3409
3417
  (this._table.pageSize || page.pageSize);
3418
+ // Capture the initial state values on first call only
3419
+ if (!this._initialStateApplied) {
3420
+ this._initialSortBySnapshot = this.initialSortBy ? [...this.initialSortBy] : [];
3421
+ this._initialFilterBySnapshot = this.initialFilterBy ? [...this.initialFilterBy] : [];
3422
+ this._initialGroupBySnapshot = this.initialGroupBy ? [...this.initialGroupBy] : [];
3423
+ this._initialStateApplied = true;
3424
+ }
3410
3425
  this.setTableState({
3411
3426
  ...prevState,
3412
3427
  columns: visibleColumns,
@@ -3430,6 +3445,18 @@ class TableInitialStateDirective extends TableInitialState {
3430
3445
  setTableState(state) {
3431
3446
  this._tableService.setTableState(state);
3432
3447
  }
3448
+ /** Returns the initial sort state snapshot captured when setInitialState() was first called. */
3449
+ getInitialSortBySnapshot() {
3450
+ return this._initialSortBySnapshot;
3451
+ }
3452
+ /** Returns the initial filter state snapshot captured when setInitialState() was first called. */
3453
+ getInitialFilterBySnapshot() {
3454
+ return this._initialFilterBySnapshot;
3455
+ }
3456
+ /** Returns the initial group state snapshot captured when setInitialState() was first called. */
3457
+ getInitialGroupBySnapshot() {
3458
+ return this._initialGroupBySnapshot;
3459
+ }
3433
3460
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: TableInitialStateDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
3434
3461
  static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.5", type: TableInitialStateDirective, isStandalone: true, selector: "[fdpTableInitialState],\n fdp-table", inputs: { initialVisibleColumns: "initialVisibleColumns", initialSortBy: "initialSortBy", initialFilterBy: "initialFilterBy", initialGroupBy: "initialGroupBy", initialPage: "initialPage", state: "state" }, providers: [
3435
3462
  {