@quadrel-enterprise-ui/framework 20.5.0 → 20.6.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.
@@ -22401,6 +22401,8 @@ const updateSort$1 = createAction('[QdUi Table] Update Sort', props());
22401
22401
  const setRequestState$1 = createAction('[QdUi Table] Set Loading State', props());
22402
22402
  const connect$1 = createAction('[QdUi Table]', props());
22403
22403
  const resetConnectorStates$1 = createAction('[QdUi Table] Reset Connector States', props());
22404
+ const setLastVisitedRow$1 = createAction('[QdUi Table] Set Last Visited Row', props());
22405
+ const clearLastVisitedRow$1 = createAction('[QdUi Table] Clear Last Visited Row', props());
22404
22406
  const deleteTableState = createAction('[QdUi Table] Delete Table State', props());
22405
22407
  const QdTableActions = {
22406
22408
  initTableState,
@@ -22420,6 +22422,8 @@ const QdTableActions = {
22420
22422
  setRequestState: setRequestState$1,
22421
22423
  connect: connect$1,
22422
22424
  resetConnectorStates: resetConnectorStates$1,
22425
+ setLastVisitedRow: setLastVisitedRow$1,
22426
+ clearLastVisitedRow: clearLastVisitedRow$1,
22423
22427
  deleteTableState
22424
22428
  };
22425
22429
 
@@ -22447,6 +22451,15 @@ var QdTableRequestState;
22447
22451
  QdTableRequestState[QdTableRequestState["SUCCESS"] = 1] = "SUCCESS";
22448
22452
  })(QdTableRequestState || (QdTableRequestState = {}));
22449
22453
 
22454
+ function resolveRowIdentifier(row, rowIndex, trackRowBy) {
22455
+ if (trackRowBy) {
22456
+ const value = trackRowBy(row);
22457
+ if (value !== undefined && value !== null && (typeof value === 'string' || typeof value === 'number'))
22458
+ return value;
22459
+ }
22460
+ return row.uid ?? rowIndex;
22461
+ }
22462
+
22450
22463
  class QdTableStoreSelectorService {
22451
22464
  _tableId;
22452
22465
  set tableId(tableId) {
@@ -22476,13 +22489,16 @@ class QdTableStoreSelectorService {
22476
22489
  selectedRows() {
22477
22490
  return createSelector(this.selectTables, tables => this.getTable(tables)?.selectedRows ?? []);
22478
22491
  }
22479
- isTableRowSelected(rowIndex) {
22492
+ isTableRowSelected(rowIndex, trackRowBy) {
22480
22493
  return createSelector(this.selectTables, tables => {
22481
22494
  const table = this.getTable(tables);
22482
22495
  if (!table)
22483
22496
  return false;
22484
- const tableUid = table.data[rowIndex]?.uid;
22485
- return table.selectedRows?.includes(rowIndex) || (tableUid && table.selectedRows?.includes(tableUid)) || false;
22497
+ const row = table.data[rowIndex];
22498
+ if (!row)
22499
+ return false;
22500
+ const identifier = resolveRowIdentifier(row, rowIndex, trackRowBy);
22501
+ return table.selectedRows?.includes(identifier) || false;
22486
22502
  });
22487
22503
  }
22488
22504
  recentSecondaryAction() {
@@ -22572,6 +22588,9 @@ class QdTableStoreSelectorService {
22572
22588
  };
22573
22589
  });
22574
22590
  }
22591
+ lastVisitedRowIdentifier() {
22592
+ return createSelector(this.selectTables, tables => this.getTable(tables)?.lastVisitedRowIdentifier);
22593
+ }
22575
22594
  selectTables(state) {
22576
22595
  return state.qdUiTable;
22577
22596
  }
@@ -22610,14 +22629,14 @@ class QdTableStoreService {
22610
22629
  updateTableStateData(data) {
22611
22630
  this.store.dispatch(QdTableActions.updateTableStateData({ tableId: this.tableId, data }));
22612
22631
  }
22613
- updateTableStateRowToSelected(rowIndex) {
22614
- this.store.dispatch(QdTableActions.updateTableStateRowToSelected({ tableId: this.tableId, rowIndex }));
22632
+ updateTableStateRowToSelected(rowIdentifier) {
22633
+ this.store.dispatch(QdTableActions.updateTableStateRowToSelected({ tableId: this.tableId, rowIdentifier }));
22615
22634
  }
22616
- updateTableStateSingleRowToSelected(rowIndex) {
22617
- this.store.dispatch(QdTableActions.updateTableStateSingleRowToSelected({ tableId: this.tableId, rowIndex }));
22635
+ updateTableStateSingleRowToSelected(rowIdentifier) {
22636
+ this.store.dispatch(QdTableActions.updateTableStateSingleRowToSelected({ tableId: this.tableId, rowIdentifier }));
22618
22637
  }
22619
- updateTableStateRowToUnselected(rowIndex) {
22620
- this.store.dispatch(QdTableActions.updateTableStateRowToUnselected({ tableId: this.tableId, rowIndex }));
22638
+ updateTableStateRowToUnselected(rowIdentifier) {
22639
+ this.store.dispatch(QdTableActions.updateTableStateRowToUnselected({ tableId: this.tableId, rowIdentifier }));
22621
22640
  }
22622
22641
  updateTableStateRecentSecondaryAction(action) {
22623
22642
  this.store.dispatch(QdTableActions.updateTableStateRecentSecondaryAction({ tableId: this.tableId, recentSecondaryAction: action }));
@@ -22649,6 +22668,12 @@ class QdTableStoreService {
22649
22668
  connect(connectorName, connectorState, connectorCriteria) {
22650
22669
  this.store.dispatch(QdTableActions.connect({ tableId: this.tableId, connectorCriteria, connectorName, connectorState }));
22651
22670
  }
22671
+ setLastVisitedRow(rowIdentifier) {
22672
+ this.store.dispatch(QdTableActions.setLastVisitedRow({ tableId: this.tableId, rowIdentifier }));
22673
+ }
22674
+ clearLastVisitedRow() {
22675
+ this.store.dispatch(QdTableActions.clearLastVisitedRow({ tableId: this.tableId }));
22676
+ }
22652
22677
  resetConnectorStates() {
22653
22678
  this.store.dispatch(QdTableActions.resetConnectorStates({ tableId: this.tableId }));
22654
22679
  }
@@ -22669,8 +22694,8 @@ class QdTableStoreService {
22669
22694
  .select(this.tableStoreSelectorService.selectedRows())
22670
22695
  .pipe(filter(selectedRows => selectedRows !== undefined));
22671
22696
  }
22672
- isTableRowSelected$(rowIndex) {
22673
- return this.store.select(this.tableStoreSelectorService.isTableRowSelected(rowIndex));
22697
+ isTableRowSelected$(rowIndex, trackRowBy) {
22698
+ return this.store.select(this.tableStoreSelectorService.isTableRowSelected(rowIndex, trackRowBy));
22674
22699
  }
22675
22700
  recentSecondaryAction$() {
22676
22701
  return this.store
@@ -22707,6 +22732,9 @@ class QdTableStoreService {
22707
22732
  selectDataResolutionCriteria$() {
22708
22733
  return this.store.select(this.tableStoreSelectorService.selectDataResolutionCriteria());
22709
22734
  }
22735
+ lastVisitedRowIdentifier$() {
22736
+ return this.store.select(this.tableStoreSelectorService.lastVisitedRowIdentifier());
22737
+ }
22710
22738
  selectConnectorState$(connectorName) {
22711
22739
  return this.store.select(this.tableStoreSelectorService.selectConnectorState(connectorName));
22712
22740
  }
@@ -23106,24 +23134,27 @@ class QdTableRowSelectionService {
23106
23134
  ]).pipe(skip(this._config.selection?.emitOutputInitially ? 0 : 1), map(([tableData]) => (tableData || []).map(this.getIndexedRows).filter(isRowSelected)));
23107
23135
  }
23108
23136
  isRowSelected(row, index) {
23109
- return this._selectedRows.includes(row.uid) || this._selectedRows.includes(index);
23137
+ const identifier = resolveRowIdentifier(row, index, this._config.trackRowBy);
23138
+ return this._selectedRows.includes(identifier);
23110
23139
  }
23111
23140
  getIndexedRows(row, index) {
23112
23141
  return { ...row, index };
23113
23142
  }
23114
23143
  isRowSelected$(rowIndex) {
23115
- return this.tableStoreService.isTableRowSelected$(rowIndex);
23144
+ return this.tableStoreService.isTableRowSelected$(rowIndex, this._config.trackRowBy);
23116
23145
  }
23117
- setRowSelected(rowIndex) {
23146
+ setRowSelected(rowIndex, rowData) {
23147
+ const identifier = resolveRowIdentifier(rowData, rowIndex, this._config.trackRowBy);
23118
23148
  if (this._config.selection.type === 'singleSelect') {
23119
- this.tableStoreService.updateTableStateSingleRowToSelected(rowIndex);
23149
+ this.tableStoreService.updateTableStateSingleRowToSelected(identifier);
23120
23150
  }
23121
23151
  else {
23122
- this.tableStoreService.updateTableStateRowToSelected(rowIndex);
23152
+ this.tableStoreService.updateTableStateRowToSelected(identifier);
23123
23153
  }
23124
23154
  }
23125
- setRowUnselected(rowIndex) {
23126
- this.tableStoreService.updateTableStateRowToUnselected(rowIndex);
23155
+ setRowUnselected(rowIndex, rowData) {
23156
+ const identifier = resolveRowIdentifier(rowData, rowIndex, this._config.trackRowBy);
23157
+ this.tableStoreService.updateTableStateRowToUnselected(identifier);
23127
23158
  }
23128
23159
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: QdTableRowSelectionService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
23129
23160
  static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: QdTableRowSelectionService });
@@ -23562,6 +23593,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImpo
23562
23593
  class QdTableRowSelectionComponent {
23563
23594
  rowSelectionService = inject(QdTableRowSelectionService);
23564
23595
  rowIndex;
23596
+ rowData;
23565
23597
  testId;
23566
23598
  get dataTestId() {
23567
23599
  return this.testId;
@@ -23580,20 +23612,22 @@ class QdTableRowSelectionComponent {
23580
23612
  }
23581
23613
  handleChange(event) {
23582
23614
  if (event.target.checked) {
23583
- this.rowSelectionService.setRowSelected(this.rowIndex);
23615
+ this.rowSelectionService.setRowSelected(this.rowIndex, this.rowData);
23584
23616
  }
23585
23617
  else {
23586
- this.rowSelectionService.setRowUnselected(this.rowIndex);
23618
+ this.rowSelectionService.setRowUnselected(this.rowIndex, this.rowData);
23587
23619
  }
23588
23620
  }
23589
23621
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: QdTableRowSelectionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
23590
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.18", type: QdTableRowSelectionComponent, isStandalone: false, selector: "[qd-table-row-selection]", inputs: { rowIndex: "rowIndex", testId: ["data-test-id", "testId"] }, host: { properties: { "attr.data-test-id": "this.dataTestId" } }, ngImport: i0, template: "<ng-container [ngSwitch]=\"selectionType\">\n <ng-container *ngSwitchCase=\"'singleSelect'\">\n <input\n type=\"radio\"\n [name]=\"'qd-table-selection__' + tableId\"\n [checked]=\"isRowSelected$() | async\"\n (click)=\"stopPropagation($event)\"\n (change)=\"handleChange($event)\"\n [attr.data-test-id]=\"testId + '-radio'\"\n />\n </ng-container>\n <ng-container *ngSwitchCase=\"'multiSelect'\">\n <input\n type=\"checkbox\"\n [name]=\"'qd-table-selection__' + tableId\"\n [checked]=\"isRowSelected$() | async\"\n (click)=\"stopPropagation($event)\"\n (change)=\"handleChange($event)\"\n [attr.data-test-id]=\"testId + '-checkbox'\"\n />\n </ng-container>\n</ng-container>\n", styles: ["input{cursor:pointer}\n"], dependencies: [{ kind: "directive", type: i1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
23622
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.18", type: QdTableRowSelectionComponent, isStandalone: false, selector: "[qd-table-row-selection]", inputs: { rowIndex: "rowIndex", rowData: "rowData", testId: ["data-test-id", "testId"] }, host: { properties: { "attr.data-test-id": "this.dataTestId" } }, ngImport: i0, template: "<ng-container [ngSwitch]=\"selectionType\">\n <ng-container *ngSwitchCase=\"'singleSelect'\">\n <input\n type=\"radio\"\n [name]=\"'qd-table-selection__' + tableId\"\n [checked]=\"isRowSelected$() | async\"\n (click)=\"stopPropagation($event)\"\n (change)=\"handleChange($event)\"\n [attr.data-test-id]=\"testId + '-radio'\"\n />\n </ng-container>\n <ng-container *ngSwitchCase=\"'multiSelect'\">\n <input\n type=\"checkbox\"\n [name]=\"'qd-table-selection__' + tableId\"\n [checked]=\"isRowSelected$() | async\"\n (click)=\"stopPropagation($event)\"\n (change)=\"handleChange($event)\"\n [attr.data-test-id]=\"testId + '-checkbox'\"\n />\n </ng-container>\n</ng-container>\n", styles: ["input{cursor:pointer}\n"], dependencies: [{ kind: "directive", type: i1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
23591
23623
  }
23592
23624
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: QdTableRowSelectionComponent, decorators: [{
23593
23625
  type: Component,
23594
23626
  args: [{ selector: '[qd-table-row-selection]', changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, template: "<ng-container [ngSwitch]=\"selectionType\">\n <ng-container *ngSwitchCase=\"'singleSelect'\">\n <input\n type=\"radio\"\n [name]=\"'qd-table-selection__' + tableId\"\n [checked]=\"isRowSelected$() | async\"\n (click)=\"stopPropagation($event)\"\n (change)=\"handleChange($event)\"\n [attr.data-test-id]=\"testId + '-radio'\"\n />\n </ng-container>\n <ng-container *ngSwitchCase=\"'multiSelect'\">\n <input\n type=\"checkbox\"\n [name]=\"'qd-table-selection__' + tableId\"\n [checked]=\"isRowSelected$() | async\"\n (click)=\"stopPropagation($event)\"\n (change)=\"handleChange($event)\"\n [attr.data-test-id]=\"testId + '-checkbox'\"\n />\n </ng-container>\n</ng-container>\n", styles: ["input{cursor:pointer}\n"] }]
23595
23627
  }], propDecorators: { rowIndex: [{
23596
23628
  type: Input
23629
+ }], rowData: [{
23630
+ type: Input
23597
23631
  }], testId: [{
23598
23632
  type: Input,
23599
23633
  args: ['data-test-id']
@@ -23676,11 +23710,11 @@ class QdTableRowComponent {
23676
23710
  return this.config.columns.find(column => column.column === item)?.type || 'blank';
23677
23711
  }
23678
23712
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: QdTableRowComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
23679
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.18", type: QdTableRowComponent, isStandalone: false, selector: "[qd-table-row]", inputs: { config: "config", rowData: "rowData", rowIndex: "rowIndex", testId: ["data-test-id", "testId"] }, host: { properties: { "attr.data-test-id": "this.hostTestId" } }, providers: [QdDataFacetsContextService], ngImport: i0, template: "<td\n qd-table-row-selection\n *ngIf=\"config.selection\"\n class=\"qd-table__body-cell--selection\"\n [rowIndex]=\"rowIndex\"\n [data-test-id]=\"testId + '-cell-selection'\"\n></td>\n\n<ng-container *ngFor=\"let item of columnsDefinitions$ | async\">\n <td\n *ngIf=\"hasMergedColumns(item)\"\n [class]=\"'qd-table__body-cell--merged ' + getCellClass(item)\"\n [attr.data-test-id]=\"testId + '-cell-merged'\"\n >\n <div *ngFor=\"let item of item; let first = first\">\n <ng-container *ngTemplateOutlet=\"headings; context: { item, translations, first }\"></ng-container>\n <span class=\"qd-table__body-cell\">\n <ng-container *ngComponentOutlet=\"getComponentType(item); inputs: getComponentInputs(item)\"></ng-container>\n </span>\n </div>\n </td>\n\n <td\n *ngIf=\"!hasMergedColumns(item)\"\n [class]=\"'qd-table__body-cell ' + getCellClass(item)\"\n [attr.data-test-id]=\"testId + '-cell-' + item\"\n >\n <ng-container *ngComponentOutlet=\"getComponentType(item); inputs: getComponentInputs(item)\"></ng-container>\n </td>\n</ng-container>\n\n<td\n *ngIf=\"config.secondaryActions?.length > 0\"\n qd-table-row-actions-secondary-menu\n class=\"qd-table__body-cell--actions-secondary-actions-menu\"\n [rowIndex]=\"rowIndex\"\n [rowData]=\"rowData\"\n [i18ns]=\"config.i18ns\"\n [testId]=\"testId + '-secondary-actions'\"\n [viewonly]=\"config.viewonly\"\n [attr.data-test-id]=\"testId + '-cell-secondary-actions'\"\n></td>\n\n<ng-template #headings let-item=\"item\" let-translations=\"translations\" let-first=\"first\">\n <ng-container *ngIf=\"!first && findColumnType(item) !== 'blank'\">\n <span class=\"qd-table__body-cell--merged-headings\">\n {{ translations ? (getI18n(item) | translate) : capitalize(item) }}\n </span>\n </ng-container>\n</ng-template>\n", styles: ["[qd-table-row] .qd-table__body-cell--actions-secondary-actions-menu{vertical-align:top}[qd-table-row] .qd-data-facets{display:block}[qd-table-row] qd-data-facets-progress.qd-data-facets{transform:translateY(.1875rem)}[qd-table-row] qd-data-facets-chip.qd-data-facets{display:contents}[qd-table-row] .qd-table__body-cell--merged qd-data-facets-text{padding-top:0}\n"], dependencies: [{ kind: "directive", type: i1.NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletEnvironmentInjector", "ngComponentOutletContent", "ngComponentOutletNgModule", "ngComponentOutletNgModuleFactory"], exportAs: ["ngComponentOutlet"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: QdTableRowActionsSecondaryMenuComponent, selector: "[qd-table-row-actions-secondary-menu]", inputs: ["rowIndex", "rowData", "i18ns", "testId", "viewonly"] }, { kind: "component", type: QdTableRowSelectionComponent, selector: "[qd-table-row-selection]", inputs: ["rowIndex", "data-test-id"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: i3.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
23713
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.18", type: QdTableRowComponent, isStandalone: false, selector: "[qd-table-row]", inputs: { config: "config", rowData: "rowData", rowIndex: "rowIndex", testId: ["data-test-id", "testId"] }, host: { properties: { "attr.data-test-id": "this.hostTestId" } }, providers: [QdDataFacetsContextService], ngImport: i0, template: "<td\n qd-table-row-selection\n *ngIf=\"config.selection\"\n class=\"qd-table__body-cell--selection\"\n [rowIndex]=\"rowIndex\"\n [rowData]=\"rowData\"\n [data-test-id]=\"testId + '-cell-selection'\"\n></td>\n\n<ng-container *ngFor=\"let item of columnsDefinitions$ | async\">\n <td\n *ngIf=\"hasMergedColumns(item)\"\n [class]=\"'qd-table__body-cell--merged ' + getCellClass(item)\"\n [attr.data-test-id]=\"testId + '-cell-merged'\"\n >\n <div *ngFor=\"let item of item; let first = first\">\n <ng-container *ngTemplateOutlet=\"headings; context: { item, translations, first }\"></ng-container>\n <span class=\"qd-table__body-cell\">\n <ng-container *ngComponentOutlet=\"getComponentType(item); inputs: getComponentInputs(item)\"></ng-container>\n </span>\n </div>\n </td>\n\n <td\n *ngIf=\"!hasMergedColumns(item)\"\n [class]=\"'qd-table__body-cell ' + getCellClass(item)\"\n [attr.data-test-id]=\"testId + '-cell-' + item\"\n >\n <ng-container *ngComponentOutlet=\"getComponentType(item); inputs: getComponentInputs(item)\"></ng-container>\n </td>\n</ng-container>\n\n<td\n *ngIf=\"config.secondaryActions?.length > 0\"\n qd-table-row-actions-secondary-menu\n class=\"qd-table__body-cell--actions-secondary-actions-menu\"\n [rowIndex]=\"rowIndex\"\n [rowData]=\"rowData\"\n [i18ns]=\"config.i18ns\"\n [testId]=\"testId + '-secondary-actions'\"\n [viewonly]=\"config.viewonly\"\n [attr.data-test-id]=\"testId + '-cell-secondary-actions'\"\n></td>\n\n<ng-template #headings let-item=\"item\" let-translations=\"translations\" let-first=\"first\">\n <ng-container *ngIf=\"!first && findColumnType(item) !== 'blank'\">\n <span class=\"qd-table__body-cell--merged-headings\">\n {{ translations ? (getI18n(item) | translate) : capitalize(item) }}\n </span>\n </ng-container>\n</ng-template>\n", styles: ["[qd-table-row] .qd-table__body-cell--actions-secondary-actions-menu{vertical-align:top}[qd-table-row] .qd-data-facets{display:block}[qd-table-row] qd-data-facets-progress.qd-data-facets{transform:translateY(.1875rem)}[qd-table-row] qd-data-facets-chip.qd-data-facets{display:contents}[qd-table-row] .qd-table__body-cell--merged qd-data-facets-text{padding-top:0}\n"], dependencies: [{ kind: "directive", type: i1.NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletEnvironmentInjector", "ngComponentOutletContent", "ngComponentOutletNgModule", "ngComponentOutletNgModuleFactory"], exportAs: ["ngComponentOutlet"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: QdTableRowActionsSecondaryMenuComponent, selector: "[qd-table-row-actions-secondary-menu]", inputs: ["rowIndex", "rowData", "i18ns", "testId", "viewonly"] }, { kind: "component", type: QdTableRowSelectionComponent, selector: "[qd-table-row-selection]", inputs: ["rowIndex", "rowData", "data-test-id"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: i3.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
23680
23714
  }
23681
23715
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: QdTableRowComponent, decorators: [{
23682
23716
  type: Component,
23683
- args: [{ selector: '[qd-table-row]', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, providers: [QdDataFacetsContextService], standalone: false, template: "<td\n qd-table-row-selection\n *ngIf=\"config.selection\"\n class=\"qd-table__body-cell--selection\"\n [rowIndex]=\"rowIndex\"\n [data-test-id]=\"testId + '-cell-selection'\"\n></td>\n\n<ng-container *ngFor=\"let item of columnsDefinitions$ | async\">\n <td\n *ngIf=\"hasMergedColumns(item)\"\n [class]=\"'qd-table__body-cell--merged ' + getCellClass(item)\"\n [attr.data-test-id]=\"testId + '-cell-merged'\"\n >\n <div *ngFor=\"let item of item; let first = first\">\n <ng-container *ngTemplateOutlet=\"headings; context: { item, translations, first }\"></ng-container>\n <span class=\"qd-table__body-cell\">\n <ng-container *ngComponentOutlet=\"getComponentType(item); inputs: getComponentInputs(item)\"></ng-container>\n </span>\n </div>\n </td>\n\n <td\n *ngIf=\"!hasMergedColumns(item)\"\n [class]=\"'qd-table__body-cell ' + getCellClass(item)\"\n [attr.data-test-id]=\"testId + '-cell-' + item\"\n >\n <ng-container *ngComponentOutlet=\"getComponentType(item); inputs: getComponentInputs(item)\"></ng-container>\n </td>\n</ng-container>\n\n<td\n *ngIf=\"config.secondaryActions?.length > 0\"\n qd-table-row-actions-secondary-menu\n class=\"qd-table__body-cell--actions-secondary-actions-menu\"\n [rowIndex]=\"rowIndex\"\n [rowData]=\"rowData\"\n [i18ns]=\"config.i18ns\"\n [testId]=\"testId + '-secondary-actions'\"\n [viewonly]=\"config.viewonly\"\n [attr.data-test-id]=\"testId + '-cell-secondary-actions'\"\n></td>\n\n<ng-template #headings let-item=\"item\" let-translations=\"translations\" let-first=\"first\">\n <ng-container *ngIf=\"!first && findColumnType(item) !== 'blank'\">\n <span class=\"qd-table__body-cell--merged-headings\">\n {{ translations ? (getI18n(item) | translate) : capitalize(item) }}\n </span>\n </ng-container>\n</ng-template>\n", styles: ["[qd-table-row] .qd-table__body-cell--actions-secondary-actions-menu{vertical-align:top}[qd-table-row] .qd-data-facets{display:block}[qd-table-row] qd-data-facets-progress.qd-data-facets{transform:translateY(.1875rem)}[qd-table-row] qd-data-facets-chip.qd-data-facets{display:contents}[qd-table-row] .qd-table__body-cell--merged qd-data-facets-text{padding-top:0}\n"] }]
23717
+ args: [{ selector: '[qd-table-row]', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, providers: [QdDataFacetsContextService], standalone: false, template: "<td\n qd-table-row-selection\n *ngIf=\"config.selection\"\n class=\"qd-table__body-cell--selection\"\n [rowIndex]=\"rowIndex\"\n [rowData]=\"rowData\"\n [data-test-id]=\"testId + '-cell-selection'\"\n></td>\n\n<ng-container *ngFor=\"let item of columnsDefinitions$ | async\">\n <td\n *ngIf=\"hasMergedColumns(item)\"\n [class]=\"'qd-table__body-cell--merged ' + getCellClass(item)\"\n [attr.data-test-id]=\"testId + '-cell-merged'\"\n >\n <div *ngFor=\"let item of item; let first = first\">\n <ng-container *ngTemplateOutlet=\"headings; context: { item, translations, first }\"></ng-container>\n <span class=\"qd-table__body-cell\">\n <ng-container *ngComponentOutlet=\"getComponentType(item); inputs: getComponentInputs(item)\"></ng-container>\n </span>\n </div>\n </td>\n\n <td\n *ngIf=\"!hasMergedColumns(item)\"\n [class]=\"'qd-table__body-cell ' + getCellClass(item)\"\n [attr.data-test-id]=\"testId + '-cell-' + item\"\n >\n <ng-container *ngComponentOutlet=\"getComponentType(item); inputs: getComponentInputs(item)\"></ng-container>\n </td>\n</ng-container>\n\n<td\n *ngIf=\"config.secondaryActions?.length > 0\"\n qd-table-row-actions-secondary-menu\n class=\"qd-table__body-cell--actions-secondary-actions-menu\"\n [rowIndex]=\"rowIndex\"\n [rowData]=\"rowData\"\n [i18ns]=\"config.i18ns\"\n [testId]=\"testId + '-secondary-actions'\"\n [viewonly]=\"config.viewonly\"\n [attr.data-test-id]=\"testId + '-cell-secondary-actions'\"\n></td>\n\n<ng-template #headings let-item=\"item\" let-translations=\"translations\" let-first=\"first\">\n <ng-container *ngIf=\"!first && findColumnType(item) !== 'blank'\">\n <span class=\"qd-table__body-cell--merged-headings\">\n {{ translations ? (getI18n(item) | translate) : capitalize(item) }}\n </span>\n </ng-container>\n</ng-template>\n", styles: ["[qd-table-row] .qd-table__body-cell--actions-secondary-actions-menu{vertical-align:top}[qd-table-row] .qd-data-facets{display:block}[qd-table-row] qd-data-facets-progress.qd-data-facets{transform:translateY(.1875rem)}[qd-table-row] qd-data-facets-chip.qd-data-facets{display:contents}[qd-table-row] .qd-table__body-cell--merged qd-data-facets-text{padding-top:0}\n"] }]
23684
23718
  }], propDecorators: { config: [{
23685
23719
  type: Input
23686
23720
  }], rowData: [{
@@ -23698,20 +23732,33 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImpo
23698
23732
  class QdTableBodyComponent {
23699
23733
  tableStoreService = inject(QdTableStoreService);
23700
23734
  resolverService = inject(QdTableResolverService);
23735
+ cdr = inject(ChangeDetectorRef);
23701
23736
  config;
23702
23737
  data;
23703
23738
  testId;
23704
23739
  isLoading$;
23740
+ highlightedRowIdentifier;
23705
23741
  _primaryActionRefreshSubscription;
23706
23742
  constructor() {
23707
23743
  this.isLoading$ = this.tableStoreService.selectIsLoading$().pipe(debounceTime$1(400));
23708
23744
  }
23745
+ ngOnInit() {
23746
+ this.initHighlight();
23747
+ }
23709
23748
  ngOnDestroy() {
23710
23749
  this._primaryActionRefreshSubscription?.unsubscribe();
23711
23750
  }
23751
+ isLastVisitedRow(rowData, rowIndex) {
23752
+ if (this.highlightedRowIdentifier === undefined)
23753
+ return false;
23754
+ return resolveRowIdentifier(rowData, rowIndex, this.config.trackRowBy) === this.highlightedRowIdentifier;
23755
+ }
23712
23756
  primaryAction(rowData, index) {
23713
23757
  if (!this.config.primaryAction?.handler)
23714
23758
  return console.warn('QD-UI | QdTable - No handler defined for primary action.');
23759
+ if (this.config.primaryAction?.highlightOnRevisit) {
23760
+ this.tableStoreService.setLastVisitedRow(resolveRowIdentifier(rowData, index, this.config.trackRowBy));
23761
+ }
23715
23762
  const result = this.config.primaryAction?.handler({ rowData, index });
23716
23763
  if (!this.config.primaryAction?.refresh?.isEnabled)
23717
23764
  return;
@@ -23721,16 +23768,28 @@ class QdTableBodyComponent {
23721
23768
  }
23722
23769
  this.triggerRefresh();
23723
23770
  }
23771
+ initHighlight() {
23772
+ this.tableStoreService
23773
+ .lastVisitedRowIdentifier$()
23774
+ .pipe(take(1))
23775
+ .subscribe(id => {
23776
+ if (id === undefined)
23777
+ return;
23778
+ this.highlightedRowIdentifier = id;
23779
+ this.tableStoreService.clearLastVisitedRow();
23780
+ this.cdr.markForCheck();
23781
+ });
23782
+ }
23724
23783
  triggerRefresh() {
23725
23784
  const pageIndex = this.config.primaryAction?.refresh?.page;
23726
23785
  this.resolverService.refresh(pageIndex !== undefined ? { pageIndex } : undefined);
23727
23786
  }
23728
23787
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: QdTableBodyComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
23729
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.18", type: QdTableBodyComponent, isStandalone: false, selector: "[qd-table-body]", inputs: { config: "config", data: "data", testId: ["data-test-id", "testId"] }, host: { classAttribute: "qd-table__body qd-table__body--plain" }, ngImport: i0, template: "<div class=\"loading-overlay\" *ngIf=\"isLoading$ | async\">\n <qd-spinner></qd-spinner>\n</div>\n<ng-container *ngFor=\"let rowData of data; index as rowIndex\">\n <tr\n qd-table-row\n [rowData]=\"rowData\"\n [rowIndex]=\"rowIndex\"\n [config]=\"config\"\n [class]=\"'qd-table__body-row'\"\n [data-test-id]=\"testId + '-row-' + rowIndex\"\n (click)=\"config.primaryAction && primaryAction(rowData, rowIndex)\"\n [class.hasAction]=\"config.primaryAction\"\n ></tr>\n</ng-container>\n", styles: [".qd-table__body--plain{position:relative}.qd-table__body--plain td{border-bottom:.0625rem solid rgb(213,213,213)}.qd-table__body--plain td.qd-table__body-cell--selection{padding-left:1rem;vertical-align:top}.qd-table__body--plain td>div{display:flex;align-items:stretch;line-height:1.5rem}.qd-table__body--plain td>div:first-child{font-weight:500;line-height:1.5rem}.qd-table__body--plain td>div:not(:first-child) .qd-table__body-cell{padding:0 .5rem}.qd-table__body--plain td.qd-table__body-cell--merged{padding:.5rem 0;vertical-align:top}.qd-table__body--plain td .qd-table__body-cell--merged-headings{width:33%;padding-left:1rem;color:#757575;overflow-wrap:break-word}.qd-table__body--plain td .qd-table__body-cell--merged-headings+.qd-table__body-cell{width:66%}.qd-table__body--plain td .qd-table__body-cell--merged-headings+.qd-table__body-cell>*{overflow-wrap:break-word;text-align:left}@media (max-width: 959.98px){.qd-table__body--plain td.qd-table__body-cell--merged{display:grid;max-width:100%;grid-template-columns:fit-content(66%) 1fr}.qd-table__body--plain td.qd-table__body-cell--merged>div:first-child{display:block;font-weight:500;grid-column:1/-1;line-height:1.5rem}.qd-table__body--plain td.qd-table__body-cell--merged>div:first-child>span.qd-table__body-cell{display:block;width:auto;padding-left:1rem}.qd-table__body--plain td.qd-table__body-cell--merged>div:not(:first-child){display:grid;grid-column:1/-1;grid-template-columns:subgrid}.qd-table__body--plain td.qd-table__body-cell--merged>div:not(:first-child)>span.qd-table__body-cell--merged-headings{display:block;overflow:hidden;width:auto;min-width:0;padding-right:0;padding-left:1rem;color:#757575;-webkit-hyphens:auto;hyphens:auto;line-height:1.5rem;overflow-wrap:break-word;text-overflow:ellipsis}.qd-table__body--plain td.qd-table__body-cell--merged>div:not(:first-child)>span.qd-table__body-cell{display:block;overflow:hidden;width:auto;min-width:0;padding:0 .5rem;-webkit-hyphens:auto;hyphens:auto;line-height:1.5rem;overflow-wrap:break-word;text-align:left;text-overflow:ellipsis}.qd-table__body--plain td.qd-table__body-cell--merged>div:not(:first-child)>span.qd-table__body-cell>*{display:block;overflow:hidden;-webkit-hyphens:auto;hyphens:auto;overflow-wrap:break-word;text-align:left;text-overflow:ellipsis}}.qd-table__body--plain td span.qd-table__body-cell--boolean{display:flex;align-items:center}.qd-table__body--plain td span.qd-table__body-cell--progress{flex-grow:1;align-self:center;padding-top:0}.qd-table__body--plain td span.qd-table__body-cell--status{margin-top:-.5rem}.qd-table__body--plain td span.qd-table__body-cell--text .text{min-height:auto;padding-top:0;line-height:1.5rem}.qd-table__body--plain td span.qd-table__body-cell--text .text+.text{margin-top:.1875rem}.qd-table__body--plain tr.hasAction{cursor:pointer}.qd-table__body--plain tr.hasAction:hover{background-color:#f2f7fa}.loading-overlay{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background-color:#0003}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: QdSpinnerComponent, selector: "qd-spinner" }, { kind: "component", type: QdTableRowComponent, selector: "[qd-table-row]", inputs: ["config", "rowData", "rowIndex", "data-test-id"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
23788
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.18", type: QdTableBodyComponent, isStandalone: false, selector: "[qd-table-body]", inputs: { config: "config", data: "data", testId: ["data-test-id", "testId"] }, host: { classAttribute: "qd-table__body qd-table__body--plain" }, ngImport: i0, template: "<div class=\"loading-overlay\" *ngIf=\"isLoading$ | async\">\n <qd-spinner></qd-spinner>\n</div>\n<ng-container *ngFor=\"let rowData of data; index as rowIndex\">\n <tr\n qd-table-row\n [rowData]=\"rowData\"\n [rowIndex]=\"rowIndex\"\n [config]=\"config\"\n [class]=\"'qd-table__body-row'\"\n [data-test-id]=\"testId + '-row-' + rowIndex\"\n (click)=\"config.primaryAction && primaryAction(rowData, rowIndex)\"\n [class.hasAction]=\"config.primaryAction\"\n [class.qd-table__body-row--last-visited]=\"isLastVisitedRow(rowData, rowIndex)\"\n ></tr>\n</ng-container>\n", styles: [".qd-table__body--plain{position:relative}.qd-table__body--plain td{border-bottom:.0625rem solid rgb(213,213,213)}.qd-table__body--plain td.qd-table__body-cell--selection{padding-left:1rem;vertical-align:top}.qd-table__body--plain td>div{display:flex;align-items:stretch;line-height:1.5rem}.qd-table__body--plain td>div:first-child{font-weight:500;line-height:1.5rem}.qd-table__body--plain td>div:not(:first-child) .qd-table__body-cell{padding:0 .5rem}.qd-table__body--plain td.qd-table__body-cell--merged{padding:.5rem 0;vertical-align:top}.qd-table__body--plain td .qd-table__body-cell--merged-headings{width:33%;padding-left:1rem;color:#757575;overflow-wrap:break-word}.qd-table__body--plain td .qd-table__body-cell--merged-headings+.qd-table__body-cell{width:66%}.qd-table__body--plain td .qd-table__body-cell--merged-headings+.qd-table__body-cell>*{overflow-wrap:break-word;text-align:left}@media (max-width: 959.98px){.qd-table__body--plain td.qd-table__body-cell--merged{display:grid;max-width:100%;grid-template-columns:fit-content(66%) 1fr}.qd-table__body--plain td.qd-table__body-cell--merged>div:first-child{display:block;font-weight:500;grid-column:1/-1;line-height:1.5rem}.qd-table__body--plain td.qd-table__body-cell--merged>div:first-child>span.qd-table__body-cell{display:block;width:auto;padding-left:1rem}.qd-table__body--plain td.qd-table__body-cell--merged>div:not(:first-child){display:grid;grid-column:1/-1;grid-template-columns:subgrid}.qd-table__body--plain td.qd-table__body-cell--merged>div:not(:first-child)>span.qd-table__body-cell--merged-headings{display:block;overflow:hidden;width:auto;min-width:0;padding-right:0;padding-left:1rem;color:#757575;-webkit-hyphens:auto;hyphens:auto;line-height:1.5rem;overflow-wrap:break-word;text-overflow:ellipsis}.qd-table__body--plain td.qd-table__body-cell--merged>div:not(:first-child)>span.qd-table__body-cell{display:block;overflow:hidden;width:auto;min-width:0;padding:0 .5rem;-webkit-hyphens:auto;hyphens:auto;line-height:1.5rem;overflow-wrap:break-word;text-align:left;text-overflow:ellipsis}.qd-table__body--plain td.qd-table__body-cell--merged>div:not(:first-child)>span.qd-table__body-cell>*{display:block;overflow:hidden;-webkit-hyphens:auto;hyphens:auto;overflow-wrap:break-word;text-align:left;text-overflow:ellipsis}}.qd-table__body--plain td span.qd-table__body-cell--boolean{display:flex;align-items:center}.qd-table__body--plain td span.qd-table__body-cell--progress{flex-grow:1;align-self:center;padding-top:0}.qd-table__body--plain td span.qd-table__body-cell--status{margin-top:-.5rem}.qd-table__body--plain td span.qd-table__body-cell--text .text{min-height:auto;padding-top:0;line-height:1.5rem}.qd-table__body--plain td span.qd-table__body-cell--text .text+.text{margin-top:.1875rem}.qd-table__body--plain tr.hasAction{cursor:pointer}.qd-table__body--plain tr.hasAction:hover{background-color:#f2f7fa}.qd-table__body--plain tr.qd-table__body-row--last-visited{animation:last-visited-fade 1.5s linear forwards}@keyframes last-visited-fade{0%,33%{background-color:#c3e8cd}to{background-color:transparent}}.loading-overlay{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background-color:#0003}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: QdSpinnerComponent, selector: "qd-spinner" }, { kind: "component", type: QdTableRowComponent, selector: "[qd-table-row]", inputs: ["config", "rowData", "rowIndex", "data-test-id"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
23730
23789
  }
23731
23790
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: QdTableBodyComponent, decorators: [{
23732
23791
  type: Component,
23733
- args: [{ selector: '[qd-table-body]', host: { class: 'qd-table__body qd-table__body--plain' }, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, template: "<div class=\"loading-overlay\" *ngIf=\"isLoading$ | async\">\n <qd-spinner></qd-spinner>\n</div>\n<ng-container *ngFor=\"let rowData of data; index as rowIndex\">\n <tr\n qd-table-row\n [rowData]=\"rowData\"\n [rowIndex]=\"rowIndex\"\n [config]=\"config\"\n [class]=\"'qd-table__body-row'\"\n [data-test-id]=\"testId + '-row-' + rowIndex\"\n (click)=\"config.primaryAction && primaryAction(rowData, rowIndex)\"\n [class.hasAction]=\"config.primaryAction\"\n ></tr>\n</ng-container>\n", styles: [".qd-table__body--plain{position:relative}.qd-table__body--plain td{border-bottom:.0625rem solid rgb(213,213,213)}.qd-table__body--plain td.qd-table__body-cell--selection{padding-left:1rem;vertical-align:top}.qd-table__body--plain td>div{display:flex;align-items:stretch;line-height:1.5rem}.qd-table__body--plain td>div:first-child{font-weight:500;line-height:1.5rem}.qd-table__body--plain td>div:not(:first-child) .qd-table__body-cell{padding:0 .5rem}.qd-table__body--plain td.qd-table__body-cell--merged{padding:.5rem 0;vertical-align:top}.qd-table__body--plain td .qd-table__body-cell--merged-headings{width:33%;padding-left:1rem;color:#757575;overflow-wrap:break-word}.qd-table__body--plain td .qd-table__body-cell--merged-headings+.qd-table__body-cell{width:66%}.qd-table__body--plain td .qd-table__body-cell--merged-headings+.qd-table__body-cell>*{overflow-wrap:break-word;text-align:left}@media (max-width: 959.98px){.qd-table__body--plain td.qd-table__body-cell--merged{display:grid;max-width:100%;grid-template-columns:fit-content(66%) 1fr}.qd-table__body--plain td.qd-table__body-cell--merged>div:first-child{display:block;font-weight:500;grid-column:1/-1;line-height:1.5rem}.qd-table__body--plain td.qd-table__body-cell--merged>div:first-child>span.qd-table__body-cell{display:block;width:auto;padding-left:1rem}.qd-table__body--plain td.qd-table__body-cell--merged>div:not(:first-child){display:grid;grid-column:1/-1;grid-template-columns:subgrid}.qd-table__body--plain td.qd-table__body-cell--merged>div:not(:first-child)>span.qd-table__body-cell--merged-headings{display:block;overflow:hidden;width:auto;min-width:0;padding-right:0;padding-left:1rem;color:#757575;-webkit-hyphens:auto;hyphens:auto;line-height:1.5rem;overflow-wrap:break-word;text-overflow:ellipsis}.qd-table__body--plain td.qd-table__body-cell--merged>div:not(:first-child)>span.qd-table__body-cell{display:block;overflow:hidden;width:auto;min-width:0;padding:0 .5rem;-webkit-hyphens:auto;hyphens:auto;line-height:1.5rem;overflow-wrap:break-word;text-align:left;text-overflow:ellipsis}.qd-table__body--plain td.qd-table__body-cell--merged>div:not(:first-child)>span.qd-table__body-cell>*{display:block;overflow:hidden;-webkit-hyphens:auto;hyphens:auto;overflow-wrap:break-word;text-align:left;text-overflow:ellipsis}}.qd-table__body--plain td span.qd-table__body-cell--boolean{display:flex;align-items:center}.qd-table__body--plain td span.qd-table__body-cell--progress{flex-grow:1;align-self:center;padding-top:0}.qd-table__body--plain td span.qd-table__body-cell--status{margin-top:-.5rem}.qd-table__body--plain td span.qd-table__body-cell--text .text{min-height:auto;padding-top:0;line-height:1.5rem}.qd-table__body--plain td span.qd-table__body-cell--text .text+.text{margin-top:.1875rem}.qd-table__body--plain tr.hasAction{cursor:pointer}.qd-table__body--plain tr.hasAction:hover{background-color:#f2f7fa}.loading-overlay{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background-color:#0003}\n"] }]
23792
+ args: [{ selector: '[qd-table-body]', host: { class: 'qd-table__body qd-table__body--plain' }, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, template: "<div class=\"loading-overlay\" *ngIf=\"isLoading$ | async\">\n <qd-spinner></qd-spinner>\n</div>\n<ng-container *ngFor=\"let rowData of data; index as rowIndex\">\n <tr\n qd-table-row\n [rowData]=\"rowData\"\n [rowIndex]=\"rowIndex\"\n [config]=\"config\"\n [class]=\"'qd-table__body-row'\"\n [data-test-id]=\"testId + '-row-' + rowIndex\"\n (click)=\"config.primaryAction && primaryAction(rowData, rowIndex)\"\n [class.hasAction]=\"config.primaryAction\"\n [class.qd-table__body-row--last-visited]=\"isLastVisitedRow(rowData, rowIndex)\"\n ></tr>\n</ng-container>\n", styles: [".qd-table__body--plain{position:relative}.qd-table__body--plain td{border-bottom:.0625rem solid rgb(213,213,213)}.qd-table__body--plain td.qd-table__body-cell--selection{padding-left:1rem;vertical-align:top}.qd-table__body--plain td>div{display:flex;align-items:stretch;line-height:1.5rem}.qd-table__body--plain td>div:first-child{font-weight:500;line-height:1.5rem}.qd-table__body--plain td>div:not(:first-child) .qd-table__body-cell{padding:0 .5rem}.qd-table__body--plain td.qd-table__body-cell--merged{padding:.5rem 0;vertical-align:top}.qd-table__body--plain td .qd-table__body-cell--merged-headings{width:33%;padding-left:1rem;color:#757575;overflow-wrap:break-word}.qd-table__body--plain td .qd-table__body-cell--merged-headings+.qd-table__body-cell{width:66%}.qd-table__body--plain td .qd-table__body-cell--merged-headings+.qd-table__body-cell>*{overflow-wrap:break-word;text-align:left}@media (max-width: 959.98px){.qd-table__body--plain td.qd-table__body-cell--merged{display:grid;max-width:100%;grid-template-columns:fit-content(66%) 1fr}.qd-table__body--plain td.qd-table__body-cell--merged>div:first-child{display:block;font-weight:500;grid-column:1/-1;line-height:1.5rem}.qd-table__body--plain td.qd-table__body-cell--merged>div:first-child>span.qd-table__body-cell{display:block;width:auto;padding-left:1rem}.qd-table__body--plain td.qd-table__body-cell--merged>div:not(:first-child){display:grid;grid-column:1/-1;grid-template-columns:subgrid}.qd-table__body--plain td.qd-table__body-cell--merged>div:not(:first-child)>span.qd-table__body-cell--merged-headings{display:block;overflow:hidden;width:auto;min-width:0;padding-right:0;padding-left:1rem;color:#757575;-webkit-hyphens:auto;hyphens:auto;line-height:1.5rem;overflow-wrap:break-word;text-overflow:ellipsis}.qd-table__body--plain td.qd-table__body-cell--merged>div:not(:first-child)>span.qd-table__body-cell{display:block;overflow:hidden;width:auto;min-width:0;padding:0 .5rem;-webkit-hyphens:auto;hyphens:auto;line-height:1.5rem;overflow-wrap:break-word;text-align:left;text-overflow:ellipsis}.qd-table__body--plain td.qd-table__body-cell--merged>div:not(:first-child)>span.qd-table__body-cell>*{display:block;overflow:hidden;-webkit-hyphens:auto;hyphens:auto;overflow-wrap:break-word;text-align:left;text-overflow:ellipsis}}.qd-table__body--plain td span.qd-table__body-cell--boolean{display:flex;align-items:center}.qd-table__body--plain td span.qd-table__body-cell--progress{flex-grow:1;align-self:center;padding-top:0}.qd-table__body--plain td span.qd-table__body-cell--status{margin-top:-.5rem}.qd-table__body--plain td span.qd-table__body-cell--text .text{min-height:auto;padding-top:0;line-height:1.5rem}.qd-table__body--plain td span.qd-table__body-cell--text .text+.text{margin-top:.1875rem}.qd-table__body--plain tr.hasAction{cursor:pointer}.qd-table__body--plain tr.hasAction:hover{background-color:#f2f7fa}.qd-table__body--plain tr.qd-table__body-row--last-visited{animation:last-visited-fade 1.5s linear forwards}@keyframes last-visited-fade{0%,33%{background-color:#c3e8cd}to{background-color:transparent}}.loading-overlay{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background-color:#0003}\n"] }]
23734
23793
  }], ctorParameters: () => [], propDecorators: { config: [{
23735
23794
  type: Input
23736
23795
  }], data: [{
@@ -24260,6 +24319,9 @@ class QdTableComponent {
24260
24319
  const action = this.config.secondaryActions?.find(a => a.type === recentAction.type);
24261
24320
  if (!action?.handler)
24262
24321
  return console.warn('QD-UI | QdTable - No handler defined for secondary action:', recentAction.type);
24322
+ if (action.highlightOnRevisit) {
24323
+ this.tableStoreService.setLastVisitedRow(resolveRowIdentifier(recentAction.rowData, recentAction.index, this.config.trackRowBy));
24324
+ }
24263
24325
  const result = action.handler(recentAction);
24264
24326
  if (action.refresh?.isEnabled)
24265
24327
  this.processSecondaryActionRefresh(result, action.refresh);
@@ -24273,13 +24335,14 @@ class QdTableComponent {
24273
24335
  'The table uid has to match the path of the server side event.');
24274
24336
  return;
24275
24337
  }
24276
- if (!this.pushEventsService.isConnectedOrConnecting()) {
24338
+ if (!this.pushEventsService || !this.pushEventsService.isConnectedOrConnecting()) {
24277
24339
  console.error('QD-UI | QdTable - You have to connect the QdPushEventsService on your own ' +
24278
24340
  'if you enable the refreshOnPushEvent flag in the table.');
24279
24341
  return;
24280
24342
  }
24343
+ const pushEventsService = this.pushEventsService;
24281
24344
  const events = [...(this.config?.refreshingEvents || []), 'RESOURCE_UPDATED'];
24282
- const combinedEvents$ = merge(...events.map(eventName => this.pushEventsService.observe(eventName)));
24345
+ const combinedEvents$ = merge(...events.map(eventName => pushEventsService.observe(eventName)));
24283
24346
  this._pushEventsSubscription = combinedEvents$
24284
24347
  .pipe(filter(messageEvent => {
24285
24348
  try {
@@ -24313,6 +24376,13 @@ class QdTableComponent {
24313
24376
  if (!this.config.i18ns) {
24314
24377
  console.warn('QD-UI | QdTable - No translations available for the secondaryActions.');
24315
24378
  }
24379
+ if (this.hasHighlightOnRevisit() && !this.config.uid) {
24380
+ console.warn('QD-UI | QdTable - A uid has to be defined when highlightOnRevisit is enabled. ' +
24381
+ 'Without a uid, the table state does not persist across navigation.');
24382
+ }
24383
+ }
24384
+ hasHighlightOnRevisit() {
24385
+ return (!!this.config.primaryAction?.highlightOnRevisit || !!this.config.secondaryActions?.some(a => a.highlightOnRevisit));
24316
24386
  }
24317
24387
  /**
24318
24388
  * @description Can be deleted when the property "mainColumnNotFillingWidth" is dropped.
@@ -25268,6 +25338,8 @@ const connect = (state, tableId, newConnectorCriteria, connectorName, connectorS
25268
25338
  connectors: updatedConnectors
25269
25339
  });
25270
25340
  };
25341
+ const setLastVisitedRow = (state, tableId, rowIdentifier) => updateStateWithNewTable(state, tableId, { ...state[tableId], lastVisitedRowIdentifier: rowIdentifier });
25342
+ const clearLastVisitedRow = (state, tableId) => updateStateWithNewTable(state, tableId, { ...state[tableId], lastVisitedRowIdentifier: undefined });
25271
25343
  const resetConnectorStates = (state, tableId) => {
25272
25344
  const { connectors } = state[tableId];
25273
25345
  return updateStateWithNewTable(state, tableId, {
@@ -25295,10 +25367,9 @@ const _tableReducer = createReducer(initialState, on(QdTableActions.initTableSta
25295
25367
  if (state[tableId].selectedRows)
25296
25368
  return state;
25297
25369
  return updateTableStateSelectedRows(state, tableId, selectedRows);
25298
- }), on(QdTableActions.updateTableStateData, (state, { tableId, data }) => updateTableStateData(state, tableId, data)), on(QdTableActions.updateTableStateRowToSelected, (state, { tableId, rowIndex }) => updateTableStateSelectedRows(state, tableId, [
25299
- ...(state[tableId].selectedRows ?? []),
25300
- state[tableId].data[rowIndex].uid || rowIndex
25301
- ])), on(QdTableActions.updateTableStateSingleRowToSelected, (state, { tableId, rowIndex }) => updateTableStateSelectedRows(state, tableId, [state[tableId].data[rowIndex].uid || rowIndex])), on(QdTableActions.updateTableStateRowToUnselected, (state, { tableId, rowIndex }) => updateTableStateSelectedRows(state, tableId, (state[tableId].selectedRows ?? []).filter(rowIdentifier => rowIdentifier !== rowIndex && rowIdentifier !== state[tableId].data[rowIndex].uid))), on(QdTableActions.updateTableStateRecentSecondaryAction, (state, { tableId, recentSecondaryAction: recentSecondaryAction }) => updateTableStateRecentSecondaryAction(state, tableId, recentSecondaryAction)), on(QdTableActions.setupPagination, (state, { tableId, pageSize }) => setupPagination(state, tableId, pageSize)), on(QdTableActions.setPage, (state, { tableId, pageIndex, pageSize, totalCount, data }) => setPage(state, tableId, pageIndex, pageSize, totalCount, data)), on(QdTableActions.setPageSize, (state, { tableId, pageSize }) => setPageSize(state, tableId, pageSize)), on(QdTableActions.setPageParams, (state, { tableId, pageIndex, pageSize, totalCount }) => setPageParams(state, tableId, pageIndex, pageSize, totalCount)), on(QdTableActions.setupSort, (state, { tableId, columns }) => setupSort(state, tableId, columns)), on(QdTableActions.setSort, (state, { tableId, column, direction }) => setSort(state, tableId, column, direction)), on(QdTableActions.updateSort, (state, { tableId, column, direction }) => updateSort(state, tableId, column, direction)), on(QdTableActions.setRequestState, (state, { tableId, requestState }) => setRequestState(state, tableId, requestState)), on(QdTableActions.connect, (state, { tableId, connectorName, connectorCriteria, connectorState }) => connect(state, tableId, connectorCriteria, connectorName, connectorState)), on(QdTableActions.resetConnectorStates, (state, { tableId }) => resetConnectorStates(state, tableId)), on(QdTableActions.deleteTableState, (state, { tableId }) => omit({ ...state }, tableId)));
25370
+ }),
25371
+ // TODO: Remove QdTreeData references from table — Tree has been extracted into its own component
25372
+ on(QdTableActions.updateTableStateData, (state, { tableId, data }) => updateTableStateData(state, tableId, data)), on(QdTableActions.updateTableStateRowToSelected, (state, { tableId, rowIdentifier }) => updateTableStateSelectedRows(state, tableId, [...(state[tableId].selectedRows ?? []), rowIdentifier])), on(QdTableActions.updateTableStateSingleRowToSelected, (state, { tableId, rowIdentifier }) => updateTableStateSelectedRows(state, tableId, [rowIdentifier])), on(QdTableActions.updateTableStateRowToUnselected, (state, { tableId, rowIdentifier }) => updateTableStateSelectedRows(state, tableId, (state[tableId].selectedRows ?? []).filter(id => id !== rowIdentifier))), on(QdTableActions.updateTableStateRecentSecondaryAction, (state, { tableId, recentSecondaryAction: recentSecondaryAction }) => updateTableStateRecentSecondaryAction(state, tableId, recentSecondaryAction)), on(QdTableActions.setupPagination, (state, { tableId, pageSize }) => setupPagination(state, tableId, pageSize)), on(QdTableActions.setPage, (state, { tableId, pageIndex, pageSize, totalCount, data }) => setPage(state, tableId, pageIndex, pageSize, totalCount, data)), on(QdTableActions.setPageSize, (state, { tableId, pageSize }) => setPageSize(state, tableId, pageSize)), on(QdTableActions.setPageParams, (state, { tableId, pageIndex, pageSize, totalCount }) => setPageParams(state, tableId, pageIndex, pageSize, totalCount)), on(QdTableActions.setupSort, (state, { tableId, columns }) => setupSort(state, tableId, columns)), on(QdTableActions.setSort, (state, { tableId, column, direction }) => setSort(state, tableId, column, direction)), on(QdTableActions.updateSort, (state, { tableId, column, direction }) => updateSort(state, tableId, column, direction)), on(QdTableActions.setRequestState, (state, { tableId, requestState }) => setRequestState(state, tableId, requestState)), on(QdTableActions.connect, (state, { tableId, connectorName, connectorCriteria, connectorState }) => connect(state, tableId, connectorCriteria, connectorName, connectorState)), on(QdTableActions.resetConnectorStates, (state, { tableId }) => resetConnectorStates(state, tableId)), on(QdTableActions.setLastVisitedRow, (state, { tableId, rowIdentifier }) => setLastVisitedRow(state, tableId, rowIdentifier)), on(QdTableActions.clearLastVisitedRow, (state, { tableId }) => clearLastVisitedRow(state, tableId)), on(QdTableActions.deleteTableState, (state, { tableId }) => omit({ ...state }, tableId)));
25302
25373
  function tableReducer(state, action) {
25303
25374
  return _tableReducer(state, action);
25304
25375
  }