@firestitch/list 9.9.12 → 9.11.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.
@@ -323,6 +323,7 @@ var RowAction = /** @class */ (function (_super) {
323
323
  function RowAction(config) {
324
324
  if (config === void 0) { config = {}; }
325
325
  var _this = _super.call(this) || this;
326
+ _this.label = '';
326
327
  _this.classArray = [];
327
328
  _this.isShown = true;
328
329
  _this._isGroup = false;
@@ -355,6 +356,13 @@ var RowAction = /** @class */ (function (_super) {
355
356
  return _this.clickEvent(row, event, index, rowActionsRef, clickFn);
356
357
  };
357
358
  this._linkFn = value.link;
359
+ if (typeof value.label === 'function') {
360
+ this._labelFn = value.label;
361
+ this.label = '';
362
+ }
363
+ else {
364
+ this.label = value.label;
365
+ }
358
366
  if (this.className) {
359
367
  this.classArray = this.className.split(' ').reduce(function (acc, elem) {
360
368
  acc.push(elem);
@@ -389,6 +397,19 @@ var RowAction = /** @class */ (function (_super) {
389
397
  }
390
398
  }
391
399
  };
400
+ RowAction.prototype.updateLabel = function (row) {
401
+ if (!this.isShown) {
402
+ return;
403
+ }
404
+ if (this.isGroup) {
405
+ this.rowActions.forEach(function (action) {
406
+ action.updateLabel(row);
407
+ });
408
+ }
409
+ else if (this._labelFn) {
410
+ this.label = this._labelFn(row);
411
+ }
412
+ };
392
413
  RowAction.prototype.clickEvent = function (row, event, index, rowActionsRef, clickFn) {
393
414
  // Stop event propagation for parent
394
415
  event.stopPropagation();
@@ -405,10 +426,6 @@ var RowAction = /** @class */ (function (_super) {
405
426
  Alias(),
406
427
  __metadata("design:type", String)
407
428
  ], RowAction.prototype, "icon", void 0);
408
- __decorate([
409
- Alias(),
410
- __metadata("design:type", String)
411
- ], RowAction.prototype, "label", void 0);
412
429
  __decorate([
413
430
  Alias(),
414
431
  __metadata("design:type", Boolean)
@@ -3404,6 +3421,9 @@ var List = /** @class */ (function (_super) {
3404
3421
  if (((_c = this.emptyState) === null || _c === void 0 ? void 0 : _c.validate) && this.emptyStateTemplate) {
3405
3422
  this.emptyStateEnabled = this.emptyState.validate(query, cloneDeep(response.data));
3406
3423
  }
3424
+ if (this.afterFetchFn) {
3425
+ this.afterFetchFn(query, this.dataController.visibleRowsData);
3426
+ }
3407
3427
  this.fetchComplete$.next();
3408
3428
  this.loading$.next(false);
3409
3429
  };
@@ -3523,6 +3543,10 @@ var List = /** @class */ (function (_super) {
3523
3543
  Alias('fetch'),
3524
3544
  __metadata("design:type", Function)
3525
3545
  ], List.prototype, "fetchFn", void 0);
3546
+ __decorate([
3547
+ Alias('afterFetch'),
3548
+ __metadata("design:type", Function)
3549
+ ], List.prototype, "afterFetchFn", void 0);
3526
3550
  return List;
3527
3551
  }(Model));
3528
3552
 
@@ -5547,7 +5571,10 @@ var FsRowActionsComponent = /** @class */ (function () {
5547
5571
  return index;
5548
5572
  };
5549
5573
  FsRowActionsComponent.prototype.clickOnTrigger = function (event) {
5574
+ var _this = this;
5550
5575
  event.stopPropagation();
5576
+ this.rowActions
5577
+ .forEach(function (action) { return action.updateLabel(_this.row.data); });
5551
5578
  };
5552
5579
  /**
5553
5580
  * Emit that some row must be removed