@firestitch/list 9.10.2 → 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.
- package/app/interfaces/listconfig.interface.d.ts +4 -1
- package/app/models/row-action.model.d.ts +3 -1
- package/bundles/firestitch-list.umd.js +24 -4
- package/bundles/firestitch-list.umd.js.map +1 -1
- package/bundles/firestitch-list.umd.min.js +2 -2
- package/bundles/firestitch-list.umd.min.js.map +1 -1
- package/esm2015/app/components/body/row/actions/actions.component.js +3 -1
- package/esm2015/app/interfaces/listconfig.interface.js +1 -1
- package/esm2015/app/models/row-action.model.js +22 -5
- package/esm5/app/components/body/row/actions/actions.component.js +4 -1
- package/esm5/app/interfaces/listconfig.interface.js +1 -1
- package/esm5/app/models/row-action.model.js +22 -5
- package/fesm2015/firestitch-list.js +23 -4
- package/fesm2015/firestitch-list.js.map +1 -1
- package/fesm5/firestitch-list.js +24 -4
- package/fesm5/firestitch-list.js.map +1 -1
- package/firestitch-list.metadata.json +1 -1
- package/package.json +5 -5
package/fesm5/firestitch-list.js
CHANGED
|
@@ -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)
|
|
@@ -5554,7 +5571,10 @@ var FsRowActionsComponent = /** @class */ (function () {
|
|
|
5554
5571
|
return index;
|
|
5555
5572
|
};
|
|
5556
5573
|
FsRowActionsComponent.prototype.clickOnTrigger = function (event) {
|
|
5574
|
+
var _this = this;
|
|
5557
5575
|
event.stopPropagation();
|
|
5576
|
+
this.rowActions
|
|
5577
|
+
.forEach(function (action) { return action.updateLabel(_this.row.data); });
|
|
5558
5578
|
};
|
|
5559
5579
|
/**
|
|
5560
5580
|
* Emit that some row must be removed
|