@smartbit4all/ng-client 5.0.19 → 5.0.20

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.
@@ -7151,7 +7151,9 @@ var SmartTableInterfaceTypeEnum;
7151
7151
  SmartTableInterfaceTypeEnum[SmartTableInterfaceTypeEnum["GRID"] = 1] = "GRID";
7152
7152
  })(SmartTableInterfaceTypeEnum || (SmartTableInterfaceTypeEnum = {}));
7153
7153
  class SmartTable {
7154
- constructor(config) {
7154
+ constructor(config, gridId, serviceToUse) {
7155
+ this.gridId = gridId;
7156
+ this.serviceToUse = serviceToUse;
7155
7157
  this.type = SmartTableInterfaceTypeEnum.NORMAL;
7156
7158
  this.expandable = config.expandable;
7157
7159
  this.expandedComponent = config.expandedComponent;
@@ -7204,8 +7206,6 @@ class SmartTable {
7204
7206
  this.onSelection = config.onSelection;
7205
7207
  this.onAllSelection = config.onAllSelection;
7206
7208
  this.rowExpander = config.rowExpander;
7207
- this.gridId = config.gridId;
7208
- this.serviceToUse = config.serviceToUse;
7209
7209
  this.pushOptions();
7210
7210
  }
7211
7211
  getPropertyNamesDeeply(element) {
@@ -7281,6 +7281,12 @@ class SmartTable {
7281
7281
  this.customTableHeaders = this.tableHeaders;
7282
7282
  }
7283
7283
  }
7284
+ getServiceToUse() {
7285
+ return this.serviceToUse;
7286
+ }
7287
+ getGridId() {
7288
+ return this.gridId;
7289
+ }
7284
7290
  }
7285
7291
 
7286
7292
  class MatContextMenuTriggerForDirective extends MatMenuTrigger {
@@ -7501,8 +7507,12 @@ class Table {
7501
7507
  ngOnInit() {
7502
7508
  if (this.smartTable.sortable)
7503
7509
  this.sortEvent = new Subject();
7504
- //Create columns to actions map
7505
- this.cellToActionMap = SmartGridToolbarActionsUtil.calculateCellToActionMap(this.smartTable.tableRows, this.smartTable.serviceToUse, this.smartTable.gridId);
7510
+ const service = this.smartTable.getServiceToUse();
7511
+ const gridId = this.smartTable.getGridId();
7512
+ if (service && gridId) {
7513
+ //Create columns to actions map
7514
+ this.cellToActionMap = SmartGridToolbarActionsUtil.calculateCellToActionMap(this.smartTable.tableRows, service, gridId);
7515
+ }
7506
7516
  }
7507
7517
  ngOnDestroy() {
7508
7518
  this._destroy$.next();
@@ -12092,8 +12102,6 @@ class SmartGridComponent {
12092
12102
  if (this.smartGrid.layoutDef === SmartLayoutDef.TABLE) {
12093
12103
  let tableConfig = {
12094
12104
  ...this.smartGrid.tableConfig,
12095
- gridId: this.smartGrid?.gridIdentifier,
12096
- serviceToUse: this.smartGrid?.serviceToUse,
12097
12105
  tableRows: tableRow,
12098
12106
  tableType: this.tableType,
12099
12107
  customSmartTableHeaders: await this.constructHeader(),
@@ -12159,7 +12167,7 @@ class SmartGridComponent {
12159
12167
  ? tableConfig.showCheckboxInHeader // keep if set
12160
12168
  : this.isMultiple; //if unset, turn it on for multiple selection
12161
12169
  }
12162
- this.smartTable = new SmartTable(tableConfig);
12170
+ this.smartTable = new SmartTable(tableConfig, this.smartGrid?.gridIdentifier, this.smartGrid?.serviceToUse ?? this.uiActionService);
12163
12171
  if (this.componentRefTable) {
12164
12172
  this.componentRefTable.instance.updateSmartTable(this.smartTable);
12165
12173
  }