@firestitch/list 9.12.1 → 9.12.4
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/classes/pagination-controller.d.ts +10 -6
- package/app/components/body/row/menu-action/menu-action.component.d.ts +2 -2
- package/app/interfaces/listconfig.interface.d.ts +12 -5
- package/app/models/row-action.model.d.ts +2 -4
- package/bundles/firestitch-list.umd.js +83 -73
- package/bundles/firestitch-list.umd.js.map +1 -1
- package/bundles/firestitch-list.umd.min.js +1 -1
- package/bundles/firestitch-list.umd.min.js.map +1 -1
- package/esm2015/app/classes/list-controller.js +15 -5
- package/esm2015/app/classes/pagination-controller.js +40 -40
- package/esm2015/app/components/body/row/actions/actions.component.js +2 -2
- package/esm2015/app/components/body/row/inline-action/inline-action.component.js +2 -2
- package/esm2015/app/components/body/row/menu-action/menu-action.component.js +3 -7
- package/esm2015/app/interfaces/listconfig.interface.js +1 -1
- package/esm2015/app/models/row-action.model.js +6 -6
- package/esm2015/public_api.js +1 -1
- package/esm5/app/classes/list-controller.js +15 -5
- package/esm5/app/classes/pagination-controller.js +62 -60
- package/esm5/app/components/body/row/actions/actions.component.js +2 -2
- package/esm5/app/components/body/row/inline-action/inline-action.component.js +2 -2
- package/esm5/app/components/body/row/menu-action/menu-action.component.js +3 -7
- package/esm5/app/interfaces/listconfig.interface.js +1 -1
- package/esm5/app/models/row-action.model.js +7 -7
- package/esm5/public_api.js +1 -1
- package/fesm2015/firestitch-list.js +62 -54
- package/fesm2015/firestitch-list.js.map +1 -1
- package/fesm5/firestitch-list.js +84 -74
- package/fesm5/firestitch-list.js.map +1 -1
- package/firestitch-list.metadata.json +1 -1
- package/package.json +1 -1
- package/public_api.d.ts +1 -1
package/fesm5/firestitch-list.js
CHANGED
|
@@ -18,7 +18,7 @@ import { FsPrompt, FsPromptModule } from '@firestitch/prompt';
|
|
|
18
18
|
import { FsFileModule } from '@firestitch/file';
|
|
19
19
|
import { isString, isObject, isBoolean, isNumber, isFunction, get, cloneDeep, mergeWith, random, merge as merge$1 } from 'lodash-es';
|
|
20
20
|
import { Subject, BehaviorSubject, Observable, merge, from, combineLatest, of } from 'rxjs';
|
|
21
|
-
import { takeUntil, tap, take, map, debounceTime, switchMap, mapTo, catchError,
|
|
21
|
+
import { takeUntil, tap, distinctUntilChanged, take, map, debounceTime, switchMap, mapTo, catchError, shareReplay, skip, filter } from 'rxjs/operators';
|
|
22
22
|
import { SelectionDialog } from '@firestitch/selection';
|
|
23
23
|
import { getNormalizedPath } from '@firestitch/common';
|
|
24
24
|
import { DrawerRef } from '@firestitch/drawer';
|
|
@@ -358,13 +358,13 @@ var RowAction = /** @class */ (function (_super) {
|
|
|
358
358
|
};
|
|
359
359
|
this._linkFn = value.link;
|
|
360
360
|
if (value.file) {
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
361
|
+
this.fileConfig = __assign({}, value.file);
|
|
362
|
+
if (this.fileConfig.select) {
|
|
363
|
+
var selectFn_1 = this.fileConfig.select;
|
|
364
|
+
this.fileConfig.select = function (selection, row, index) {
|
|
365
|
+
selectFn_1(selection, row, index);
|
|
364
366
|
};
|
|
365
367
|
}
|
|
366
|
-
this.fileUploadErrorFn = value.file.error;
|
|
367
|
-
this.fileMultiple = value.file.multiple;
|
|
368
368
|
}
|
|
369
369
|
if (typeof value.label === 'function') {
|
|
370
370
|
this._labelFn = value.label;
|
|
@@ -1423,27 +1423,24 @@ var PaginationStrategy;
|
|
|
1423
1423
|
PaginationStrategy["None"] = "none";
|
|
1424
1424
|
})(PaginationStrategy || (PaginationStrategy = {}));
|
|
1425
1425
|
|
|
1426
|
-
var PaginationController = /** @class */ (function (
|
|
1427
|
-
__extends(PaginationController, _super);
|
|
1426
|
+
var PaginationController = /** @class */ (function () {
|
|
1428
1427
|
function PaginationController() {
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
_this.offset = 0;
|
|
1428
|
+
this.limit = 25;
|
|
1429
|
+
this.manual = false;
|
|
1430
|
+
this.page = 1; // Active page
|
|
1431
|
+
this.offset = 0;
|
|
1434
1432
|
// public pagesArray = [];
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
return _this;
|
|
1433
|
+
this.displayed = 0;
|
|
1434
|
+
this._pages$ = new BehaviorSubject(0); // Total pages
|
|
1435
|
+
this._strategy = PaginationStrategy.None;
|
|
1436
|
+
this._removedRows = 0;
|
|
1437
|
+
this._pageChanged$ = new Subject();
|
|
1438
|
+
this._pageReset$ = new Subject();
|
|
1439
|
+
this._onDestroy$ = new Subject();
|
|
1440
|
+
this._loadMoreEnabled = false;
|
|
1441
|
+
this._infinityScrollEnabled = false;
|
|
1442
|
+
this._loadMoreText = 'Load More';
|
|
1443
|
+
this._limits = [10, 25, 50, 100, 200];
|
|
1447
1444
|
}
|
|
1448
1445
|
Object.defineProperty(PaginationController.prototype, "pages", {
|
|
1449
1446
|
get: function () {
|
|
@@ -1458,7 +1455,8 @@ var PaginationController = /** @class */ (function (_super) {
|
|
|
1458
1455
|
});
|
|
1459
1456
|
Object.defineProperty(PaginationController.prototype, "pages$", {
|
|
1460
1457
|
get: function () {
|
|
1461
|
-
return this._pages
|
|
1458
|
+
return this._pages$
|
|
1459
|
+
.pipe(distinctUntilChanged());
|
|
1462
1460
|
},
|
|
1463
1461
|
enumerable: true,
|
|
1464
1462
|
configurable: true
|
|
@@ -1529,6 +1527,22 @@ var PaginationController = /** @class */ (function (_super) {
|
|
|
1529
1527
|
enumerable: true,
|
|
1530
1528
|
configurable: true
|
|
1531
1529
|
});
|
|
1530
|
+
Object.defineProperty(PaginationController.prototype, "loadMoreQuery", {
|
|
1531
|
+
get: function () {
|
|
1532
|
+
switch (this.strategy) {
|
|
1533
|
+
case PaginationStrategy.Page:
|
|
1534
|
+
return this.query;
|
|
1535
|
+
case PaginationStrategy.Offset:
|
|
1536
|
+
var query = this.queryOffsetStrategy;
|
|
1537
|
+
query.limit = query.offset + query.limit;
|
|
1538
|
+
query.offset = 0;
|
|
1539
|
+
return query;
|
|
1540
|
+
}
|
|
1541
|
+
return {};
|
|
1542
|
+
},
|
|
1543
|
+
enumerable: true,
|
|
1544
|
+
configurable: true
|
|
1545
|
+
});
|
|
1532
1546
|
Object.defineProperty(PaginationController.prototype, "queryPageStrategy", {
|
|
1533
1547
|
/**
|
|
1534
1548
|
* Query for Page Strategy
|
|
@@ -1691,12 +1705,6 @@ var PaginationController = /** @class */ (function (_super) {
|
|
|
1691
1705
|
enumerable: true,
|
|
1692
1706
|
configurable: true
|
|
1693
1707
|
});
|
|
1694
|
-
PaginationController.prototype._fromJSON = function (value) {
|
|
1695
|
-
_super.prototype._fromJSON.call(this, value);
|
|
1696
|
-
if (!value.limit) {
|
|
1697
|
-
this.limit = 25;
|
|
1698
|
-
}
|
|
1699
|
-
};
|
|
1700
1708
|
PaginationController.prototype.initWithConfig = function (config, loadMore, infinityScrollEnabled) {
|
|
1701
1709
|
if (infinityScrollEnabled === void 0) { infinityScrollEnabled = false; }
|
|
1702
1710
|
if (config) {
|
|
@@ -1706,12 +1714,12 @@ var PaginationController = /** @class */ (function (_super) {
|
|
|
1706
1714
|
if (config.limit) {
|
|
1707
1715
|
this.limit = config.limit;
|
|
1708
1716
|
}
|
|
1709
|
-
if (loadMore) {
|
|
1710
|
-
this.setLoadMore(loadMore);
|
|
1711
|
-
}
|
|
1712
|
-
this._infinityScrollEnabled = infinityScrollEnabled;
|
|
1713
1717
|
this.strategy = config.strategy;
|
|
1714
1718
|
}
|
|
1719
|
+
if (loadMore) {
|
|
1720
|
+
this.setLoadMore(loadMore);
|
|
1721
|
+
}
|
|
1722
|
+
this._infinityScrollEnabled = infinityScrollEnabled;
|
|
1715
1723
|
};
|
|
1716
1724
|
Object.defineProperty(PaginationController.prototype, "_hasPrevPagePageStrategy", {
|
|
1717
1725
|
/**
|
|
@@ -1756,15 +1764,15 @@ var PaginationController = /** @class */ (function (_super) {
|
|
|
1756
1764
|
/**
|
|
1757
1765
|
* Update paging config and all related fields
|
|
1758
1766
|
* @param config
|
|
1759
|
-
* @param
|
|
1760
|
-
* @param
|
|
1767
|
+
* @param displayedRecords
|
|
1768
|
+
* @param loadMoreOperation
|
|
1761
1769
|
*/
|
|
1762
|
-
PaginationController.prototype.updatePaging = function (config,
|
|
1763
|
-
if (
|
|
1764
|
-
if (
|
|
1765
|
-
if (!
|
|
1766
|
-
this.
|
|
1767
|
-
this.displayed =
|
|
1770
|
+
PaginationController.prototype.updatePaging = function (config, displayedRecords, loadMoreOperation) {
|
|
1771
|
+
if (displayedRecords === void 0) { displayedRecords = 0; }
|
|
1772
|
+
if (loadMoreOperation === void 0) { loadMoreOperation = false; }
|
|
1773
|
+
if (!loadMoreOperation) {
|
|
1774
|
+
this._fromParams(config);
|
|
1775
|
+
this.displayed = displayedRecords;
|
|
1768
1776
|
}
|
|
1769
1777
|
else {
|
|
1770
1778
|
this.records = config.records;
|
|
@@ -1951,6 +1959,19 @@ var PaginationController = /** @class */ (function (_super) {
|
|
|
1951
1959
|
this._onDestroy$.next();
|
|
1952
1960
|
this._onDestroy$.complete();
|
|
1953
1961
|
};
|
|
1962
|
+
/**
|
|
1963
|
+
* Update paging state
|
|
1964
|
+
* @param params
|
|
1965
|
+
*/
|
|
1966
|
+
PaginationController.prototype._fromParams = function (params) {
|
|
1967
|
+
var _a;
|
|
1968
|
+
if (!this.loadMoreEnabled) {
|
|
1969
|
+
this.limit = (_a = params.limit, (_a !== null && _a !== void 0 ? _a : 25));
|
|
1970
|
+
}
|
|
1971
|
+
this.records = params.records;
|
|
1972
|
+
this.manual = params.manual;
|
|
1973
|
+
this.pages = params.pages || 0;
|
|
1974
|
+
};
|
|
1954
1975
|
/**
|
|
1955
1976
|
* Calc and update offset
|
|
1956
1977
|
*/
|
|
@@ -1963,25 +1984,8 @@ var PaginationController = /** @class */ (function (_super) {
|
|
|
1963
1984
|
PaginationController.prototype.updateTotalPages = function () {
|
|
1964
1985
|
this.pages = Math.ceil(this.records / this.limit);
|
|
1965
1986
|
};
|
|
1966
|
-
__decorate([
|
|
1967
|
-
Alias(),
|
|
1968
|
-
__metadata("design:type", Object)
|
|
1969
|
-
], PaginationController.prototype, "limit", void 0);
|
|
1970
|
-
__decorate([
|
|
1971
|
-
Alias(),
|
|
1972
|
-
__metadata("design:type", Number)
|
|
1973
|
-
], PaginationController.prototype, "records", void 0);
|
|
1974
|
-
__decorate([
|
|
1975
|
-
Alias(),
|
|
1976
|
-
__metadata("design:type", Object)
|
|
1977
|
-
], PaginationController.prototype, "manual", void 0);
|
|
1978
|
-
__decorate([
|
|
1979
|
-
Alias('pages'),
|
|
1980
|
-
__metadata("design:type", Number),
|
|
1981
|
-
__metadata("design:paramtypes", [Number])
|
|
1982
|
-
], PaginationController.prototype, "pages", null);
|
|
1983
1987
|
return PaginationController;
|
|
1984
|
-
}(
|
|
1988
|
+
}());
|
|
1985
1989
|
|
|
1986
1990
|
var SelectionChangeType;
|
|
1987
1991
|
(function (SelectionChangeType) {
|
|
@@ -3201,9 +3205,18 @@ var List = /** @class */ (function (_super) {
|
|
|
3201
3205
|
var _a;
|
|
3202
3206
|
(_a = _this.selection) === null || _a === void 0 ? void 0 : _a.closeSelectionDialog();
|
|
3203
3207
|
}), map(function (params) {
|
|
3204
|
-
var query =
|
|
3205
|
-
|
|
3206
|
-
|
|
3208
|
+
var query = Object.assign({}, _this.filtersQuery);
|
|
3209
|
+
if (_this.paging.hasOffsetStrategy && params && params.loadOffset) {
|
|
3210
|
+
query = Object.assign(query, _this.paging.loadDeletedOffsetQuery);
|
|
3211
|
+
}
|
|
3212
|
+
else {
|
|
3213
|
+
if (_this.initialFetch && _this.paging.loadMoreEnabled) {
|
|
3214
|
+
query = Object.assign(query, _this.paging.loadMoreQuery);
|
|
3215
|
+
}
|
|
3216
|
+
else {
|
|
3217
|
+
query = Object.assign(query, _this.paging.query);
|
|
3218
|
+
}
|
|
3219
|
+
}
|
|
3207
3220
|
if (_this.sorting.sortingColumn) {
|
|
3208
3221
|
Object.assign(query, {
|
|
3209
3222
|
order: _this.sorting.sortingColumn.name + "," + _this.sorting.sortingColumn.direction
|
|
@@ -3230,6 +3243,7 @@ var List = /** @class */ (function (_super) {
|
|
|
3230
3243
|
return source$;
|
|
3231
3244
|
}), takeUntil(this.onDestroy$))
|
|
3232
3245
|
.subscribe(function (response) {
|
|
3246
|
+
_this.initialFetch = false;
|
|
3233
3247
|
_this.completeFetch(response);
|
|
3234
3248
|
});
|
|
3235
3249
|
};
|
|
@@ -3445,7 +3459,7 @@ var List = /** @class */ (function (_super) {
|
|
|
3445
3459
|
this.selection.selectedRowsIntersection(this.dataController.visibleRowsData);
|
|
3446
3460
|
}
|
|
3447
3461
|
if (((_c = this.emptyState) === null || _c === void 0 ? void 0 : _c.validate) && this.emptyStateTemplate) {
|
|
3448
|
-
this.emptyStateEnabled = this.emptyState.validate(query, cloneDeep(
|
|
3462
|
+
this.emptyStateEnabled = this.emptyState.validate(query, cloneDeep(this.dataController.visibleRowsData));
|
|
3449
3463
|
}
|
|
3450
3464
|
if (this.afterFetchFn) {
|
|
3451
3465
|
this.afterFetchFn(query, this.dataController.visibleRowsData);
|
|
@@ -5679,7 +5693,7 @@ var FsRowActionsComponent = /** @class */ (function () {
|
|
|
5679
5693
|
FsRowActionsComponent = __decorate([
|
|
5680
5694
|
Component({
|
|
5681
5695
|
selector: 'fs-list-row-actions',
|
|
5682
|
-
template: "<ng-container *ngIf=\"!restoreMode || (restoreMode && !restoreAction)\">\n <ng-container *ngFor=\"let action of inlineRowActions; trackBy: trackByFn\">\n <fs-list-row-inline-action class=\"row-inline-action row-inline-action-{{action.type}}\"\n [action]=\"action\"\n [ngClass]=\"{'mobile-hide': action.menu === undefined}\"\n (clicked)=\"actionClick(action, row, $event)\"\n (fileSelect)=\"action.
|
|
5696
|
+
template: "<ng-container *ngIf=\"!restoreMode || (restoreMode && !restoreAction)\">\n <ng-container *ngFor=\"let action of inlineRowActions; trackBy: trackByFn\">\n <fs-list-row-inline-action class=\"row-inline-action row-inline-action-{{action.type}}\"\n [action]=\"action\"\n [ngClass]=\"{'mobile-hide': action.menu === undefined}\"\n (clicked)=\"actionClick(action, row, $event)\"\n (fileSelect)=\"action.fileConfig.select($event, row, index)\">\n </fs-list-row-inline-action>\n </ng-container>\n</ng-container>\n\n<!-- Menu -->\n<fs-menu class=\"row-menu-action\"\n *ngIf=\"menuRowActions.length || (restoreMode && restoreAction)\"\n (click)=\"clickOnTrigger($event)\"\n #menuRef\n>\n <!-- Case when we have usual menu actions -->\n <ng-container *ngIf=\"!restoreMode || (restoreMode && !restoreAction)\">\n <ng-container *ngFor=\"let action of inlineRowActions; trackBy: trackByFn\">\n <ng-template class=\"hidden-mobile-menu-action\"\n fs-menu-item\n [link]=\"action.routerLink?.link\"\n [queryParams]=\"action.routerLink?.queryParams\"\n [target]=\"action.routerLink?.target\"\n [hidden]=\"action.menu !== undefined && !action.isShown\">\n <fs-list-row-menu-action\n [icon]=\"action.icon\"\n [label]=\"action.label\"\n [file]=\"action.fileConfig\"\n (fileSelect)=\"action.fileConfig.select($event, row, index)\"\n (fileError)=\"action.fileConfig.error && action.fileConfig.error($event)\">\n </fs-list-row-menu-action>\n </ng-template>\n </ng-container>\n\n <ng-container *ngFor=\"let action of menuRowActions; trackBy: trackByFn\">\n <ng-container *ngIf=\"action.isGroup else simpleMenuItem\">\n <fs-menu-group [label]=\"action.label\">\n <ng-container *ngFor=\"let subAction of action.rowActions\">\n <ng-template fs-menu-item\n [link]=\"subAction.routerLink?.link\"\n [queryParams]=\"subAction.routerLink?.queryParams\"\n [target]=\"subAction.routerLink?.target\"\n [hidden]=\"!subAction.isShown\"\n (click)=\"actionClick(subAction, row, $event, menuRef);\">\n <fs-list-row-menu-action\n [icon]=\"subAction.icon\"\n [label]=\"subAction.label\"\n [file]=\"subAction.fileConfig\"\n (fileSelect)=\"subAction.fileConfig.select($event, row, index)\"\n (fileError)=\"subAction.fileConfig.error && subAction.fileConfig.error($event)\">\n </fs-list-row-menu-action>\n </ng-template>\n </ng-container>\n </fs-menu-group>\n </ng-container>\n <ng-template #simpleMenuItem>\n <ng-template fs-menu-item\n [link]=\"action.routerLink?.link\"\n [queryParams]=\"action.routerLink?.queryParams\"\n [target]=\"action.routerLink?.target\"\n [hidden]=\"!action.isShown\"\n (click)=\"actionClick(action, row, $event, menuRef);\">\n <fs-list-row-menu-action\n [icon]=\"action.icon\"\n [label]=\"action.label\"\n [file]=\"action.fileConfig\"\n (fileSelect)=\"action.fileConfig.select($event, row, index)\"\n (fileError)=\"action.fileConfig.error && action.fileConfig.error($event)\">\n </fs-list-row-menu-action>\n </ng-template>\n </ng-template>\n </ng-container>\n </ng-container>\n\n <!-- Case when we have restore mode enabled and must hide menu actions -->\n <ng-container *ngIf=\"restoreMode && restoreAction\">\n <ng-template fs-menu-item (click)=\"actionClick(restoreAction, row, $event, menuRef)\">\n <mat-icon *ngIf=\"restoreAction.icon\">{{restoreAction.icon}}</mat-icon>\n {{restoreAction.label}}\n </ng-template>\n </ng-container>\n</fs-menu>\n",
|
|
5683
5697
|
changeDetection: ChangeDetectionStrategy.OnPush
|
|
5684
5698
|
}),
|
|
5685
5699
|
__metadata("design:paramtypes", [FsPrompt])
|
|
@@ -5717,7 +5731,7 @@ var FsRowInlineActionComponent = /** @class */ (function () {
|
|
|
5717
5731
|
FsRowInlineActionComponent = __decorate([
|
|
5718
5732
|
Component({
|
|
5719
5733
|
selector: 'fs-list-row-inline-action',
|
|
5720
|
-
template: "<ng-container *ngIf=\"action.isShown\" [ngSwitch]=\"action.type\">\n <!-- Basic button -->\n <ng-container *ngSwitchCase=\"'basic'\">\n <ng-container *ngIf=\"!action.routerLink; else link\">\n <button type=\"button\"\n mat-button\n (click)=\"actionClick($event)\"\n [ngClass]=\"action.classArray\"\n >\n <ng-template [ngTemplateOutlet]=\"buttonContent\"></ng-template>\n </button>\n </ng-container>\n <ng-template #link>\n <a mat-button\n [routerLink]=\"action.routerLink.link\"\n [queryParams]=\"action.routerLink.queryParams\">\n <ng-template [ngTemplateOutlet]=\"buttonContent\"></ng-template>\n </a>\n </ng-template>\n </ng-container>\n\n <!-- Raised button -->\n <ng-container *ngSwitchCase=\"'raised'\">\n <ng-container *ngIf=\"!action.routerLink; else link\">\n <button type=\"button\"\n mat-raised-button\n (click)=\"actionClick($event)\"\n [ngClass]=\"action.classArray\"\n >\n <ng-template [ngTemplateOutlet]=\"buttonContent\"></ng-template>\n </button>\n </ng-container>\n <ng-template #link>\n <a mat-raised-button\n [routerLink]=\"action.routerLink.link\"\n [queryParams]=\"action.routerLink.queryParams\">\n <ng-template [ngTemplateOutlet]=\"buttonContent\"></ng-template>\n </a>\n </ng-template>\n </ng-container>\n\n <!-- Icon button -->\n <ng-container *ngSwitchCase=\"'icon'\">\n <ng-container *ngIf=\"!action.routerLink; else link\">\n <button type=\"button\"\n mat-icon-button\n (click)=\"actionClick($event)\"\n [ngClass]=\"action.classArray\"\n >\n <ng-template [ngTemplateOutlet]=\"buttonContent\"></ng-template>\n </button>\n </ng-container>\n <ng-template #link>\n <a mat-icon-button\n [routerLink]=\"action.routerLink.link\"\n [queryParams]=\"action.routerLink.queryParams\">\n <ng-template [ngTemplateOutlet]=\"buttonContent\"></ng-template>\n </a>\n </ng-template>\n </ng-container>\n\n <!-- Fab button -->\n <ng-container *ngSwitchCase=\"'fab'\">\n <ng-container *ngIf=\"!action.routerLink; else link\">\n <button type=\"button\"\n mat-fab\n (click)=\"actionClick($event)\"\n [ngClass]=\"action.classArray\"\n >\n <ng-template [ngTemplateOutlet]=\"buttonContent\"></ng-template>\n </button>\n </ng-container>\n <ng-template #link>\n <a mat-fab\n [routerLink]=\"action.routerLink.link\"\n [queryParams]=\"action.routerLink.queryParams\">\n <ng-template [ngTemplateOutlet]=\"buttonContent\"></ng-template>\n </a>\n </ng-template>\n </ng-container>\n\n <!-- Mini Fab button -->\n <ng-container *ngSwitchCase=\"'mini-fab'\">\n <ng-container *ngIf=\"!action.routerLink; else link\">\n <button type=\"button\"\n mat-mini-fab\n (click)=\"actionClick($event)\"\n [ngClass]=\"action.classArray\"\n >\n <ng-template [ngTemplateOutlet]=\"buttonContent\"></ng-template>\n </button>\n </ng-container>\n <ng-template #link>\n <a mat-mini-fab\n [routerLink]=\"action.routerLink.link\"\n [queryParams]=\"action.routerLink.queryParams\">\n <ng-template [ngTemplateOutlet]=\"buttonContent\"></ng-template>\n </a>\n </ng-template>\n </ng-container>\n\n <ng-template #buttonContent>\n <ng-container *ngIf=\"!action.
|
|
5734
|
+
template: "<ng-container *ngIf=\"action.isShown\" [ngSwitch]=\"action.type\">\n <!-- Basic button -->\n <ng-container *ngSwitchCase=\"'basic'\">\n <ng-container *ngIf=\"!action.routerLink; else link\">\n <button type=\"button\"\n mat-button\n (click)=\"actionClick($event)\"\n [ngClass]=\"action.classArray\"\n >\n <ng-template [ngTemplateOutlet]=\"buttonContent\"></ng-template>\n </button>\n </ng-container>\n <ng-template #link>\n <a mat-button\n [routerLink]=\"action.routerLink.link\"\n [queryParams]=\"action.routerLink.queryParams\">\n <ng-template [ngTemplateOutlet]=\"buttonContent\"></ng-template>\n </a>\n </ng-template>\n </ng-container>\n\n <!-- Raised button -->\n <ng-container *ngSwitchCase=\"'raised'\">\n <ng-container *ngIf=\"!action.routerLink; else link\">\n <button type=\"button\"\n mat-raised-button\n (click)=\"actionClick($event)\"\n [ngClass]=\"action.classArray\"\n >\n <ng-template [ngTemplateOutlet]=\"buttonContent\"></ng-template>\n </button>\n </ng-container>\n <ng-template #link>\n <a mat-raised-button\n [routerLink]=\"action.routerLink.link\"\n [queryParams]=\"action.routerLink.queryParams\">\n <ng-template [ngTemplateOutlet]=\"buttonContent\"></ng-template>\n </a>\n </ng-template>\n </ng-container>\n\n <!-- Icon button -->\n <ng-container *ngSwitchCase=\"'icon'\">\n <ng-container *ngIf=\"!action.routerLink; else link\">\n <button type=\"button\"\n mat-icon-button\n (click)=\"actionClick($event)\"\n [ngClass]=\"action.classArray\"\n >\n <ng-template [ngTemplateOutlet]=\"buttonContent\"></ng-template>\n </button>\n </ng-container>\n <ng-template #link>\n <a mat-icon-button\n [routerLink]=\"action.routerLink.link\"\n [queryParams]=\"action.routerLink.queryParams\">\n <ng-template [ngTemplateOutlet]=\"buttonContent\"></ng-template>\n </a>\n </ng-template>\n </ng-container>\n\n <!-- Fab button -->\n <ng-container *ngSwitchCase=\"'fab'\">\n <ng-container *ngIf=\"!action.routerLink; else link\">\n <button type=\"button\"\n mat-fab\n (click)=\"actionClick($event)\"\n [ngClass]=\"action.classArray\"\n >\n <ng-template [ngTemplateOutlet]=\"buttonContent\"></ng-template>\n </button>\n </ng-container>\n <ng-template #link>\n <a mat-fab\n [routerLink]=\"action.routerLink.link\"\n [queryParams]=\"action.routerLink.queryParams\">\n <ng-template [ngTemplateOutlet]=\"buttonContent\"></ng-template>\n </a>\n </ng-template>\n </ng-container>\n\n <!-- Mini Fab button -->\n <ng-container *ngSwitchCase=\"'mini-fab'\">\n <ng-container *ngIf=\"!action.routerLink; else link\">\n <button type=\"button\"\n mat-mini-fab\n (click)=\"actionClick($event)\"\n [ngClass]=\"action.classArray\"\n >\n <ng-template [ngTemplateOutlet]=\"buttonContent\"></ng-template>\n </button>\n </ng-container>\n <ng-template #link>\n <a mat-mini-fab\n [routerLink]=\"action.routerLink.link\"\n [queryParams]=\"action.routerLink.queryParams\">\n <ng-template [ngTemplateOutlet]=\"buttonContent\"></ng-template>\n </a>\n </ng-template>\n </ng-container>\n\n <ng-template #buttonContent>\n <ng-container *ngIf=\"!action.fileConfig else uploadFileBtn\">\n <mat-icon *ngIf=\"action.icon\">{{action.icon}}</mat-icon>\n {{action.label}}\n </ng-container>\n\n <ng-template #uploadFileBtn>\n <fs-file\n class=\"action-button\"\n [accept]=\"action.fileConfig.accept || '*'\"\n [multiple]=\"action.fileConfig.multiple\"\n [minWidth]=\"action.fileConfig.minWidth\"\n [minHeight]=\"action.fileConfig.minHeight\"\n [imageWidth]=\"action.fileConfig.maxWidth\"\n [imageHeight]=\"action.fileConfig.maxHeight\"\n (select)=\"fileSelected($event)\"\n (error)=\"action.fileConfig.error && action.fileConfig.error($event)\">\n <mat-icon *ngIf=\"action.icon\">{{action.icon}}</mat-icon>\n {{action.label}}\n </fs-file>\n </ng-template>\n </ng-template>\n</ng-container>\n",
|
|
5721
5735
|
changeDetection: ChangeDetectionStrategy.OnPush
|
|
5722
5736
|
}),
|
|
5723
5737
|
__metadata("design:paramtypes", [FsPrompt])
|
|
@@ -5740,12 +5754,8 @@ var FsRowMenuActionComponent = /** @class */ (function () {
|
|
|
5740
5754
|
], FsRowMenuActionComponent.prototype, "label", void 0);
|
|
5741
5755
|
__decorate([
|
|
5742
5756
|
Input(),
|
|
5743
|
-
__metadata("design:type",
|
|
5757
|
+
__metadata("design:type", Object)
|
|
5744
5758
|
], FsRowMenuActionComponent.prototype, "file", void 0);
|
|
5745
|
-
__decorate([
|
|
5746
|
-
Input(),
|
|
5747
|
-
__metadata("design:type", Boolean)
|
|
5748
|
-
], FsRowMenuActionComponent.prototype, "fileMultiple", void 0);
|
|
5749
5759
|
__decorate([
|
|
5750
5760
|
Output(),
|
|
5751
5761
|
__metadata("design:type", Object)
|
|
@@ -5757,7 +5767,7 @@ var FsRowMenuActionComponent = /** @class */ (function () {
|
|
|
5757
5767
|
FsRowMenuActionComponent = __decorate([
|
|
5758
5768
|
Component({
|
|
5759
5769
|
selector: 'fs-list-row-menu-action',
|
|
5760
|
-
template: "<ng-container *ngIf=\"!file else withFile\">\n <mat-icon *ngIf=\"icon\">{{icon}}</mat-icon>\n {{label}}\n</ng-container>\n\n<ng-template #withFile>\n <fs-file\n class=\"action-button\"\n [multiple]=\"
|
|
5770
|
+
template: "<ng-container *ngIf=\"!file else withFile\">\n <mat-icon *ngIf=\"icon\">{{icon}}</mat-icon>\n {{label}}\n</ng-container>\n\n<ng-template #withFile>\n <fs-file\n class=\"action-button\"\n [accept]=\"file.accept || '*'\"\n [multiple]=\"file.multiple\"\n [minWidth]=\"file.minWidth\"\n [minHeight]=\"file.minHeight\"\n [imageWidth]=\"file.maxWidth\"\n [imageHeight]=\"file.maxHeight\"\n (select)=\"fileSelect.emit($event)\"\n (error)=\"fileError.emit($event)\">\n <mat-icon *ngIf=\"icon\">{{icon}}</mat-icon>\n {{label}}\n </fs-file>\n</ng-template>\n",
|
|
5761
5771
|
changeDetection: ChangeDetectionStrategy.OnPush
|
|
5762
5772
|
})
|
|
5763
5773
|
], FsRowMenuActionComponent);
|