@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/esm5/public_api.js
CHANGED
|
@@ -37,4 +37,4 @@ export { ActionType } from './app/enums/button-type.enum';
|
|
|
37
37
|
export { PaginationStrategy } from './app/enums/pagination-strategy.enum';
|
|
38
38
|
export { RowType } from './app/enums/row-type.enum';
|
|
39
39
|
export { FsListState } from './app/enums/state.enum';
|
|
40
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
40
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljX2FwaS5qcyIsInNvdXJjZVJvb3QiOiJuZzovL0BmaXJlc3RpdGNoL2xpc3QvIiwic291cmNlcyI6WyJwdWJsaWNfYXBpLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBRUgsVUFBVTtBQUNWLE9BQU8sRUFBRSxZQUFZLEVBQUUsTUFBTSxzQkFBc0IsQ0FBQztBQUVwRCxZQUFZO0FBQ1osT0FBTyxFQUFFLGNBQWMsRUFBRSxzQkFBc0IsRUFBRSxNQUFNLHlCQUF5QixDQUFDO0FBRWpGLGFBQWE7QUFDYixPQUFPLEVBQUUsZUFBZSxFQUFFLE1BQU0sc0NBQXNDLENBQUM7QUFDdkUsT0FBTyxFQUFFLGVBQWUsRUFBRSxNQUFNLHNDQUFzQyxDQUFDO0FBQ3ZFLE9BQU8sRUFBRSxjQUFjLEVBQUUsTUFBTSx5Q0FBeUMsQ0FBQztBQUN6RSxPQUFPLEVBQUUsZUFBZSxFQUFFLE1BQU0sK0NBQStDLENBQUM7QUFDaEYsT0FBTyxFQUFFLGVBQWUsRUFBRSxNQUFNLHNDQUFzQyxDQUFDO0FBQ3ZFLE9BQU8sRUFBRSxtQkFBbUIsRUFBRSxNQUFNLHFEQUFxRCxDQUFDO0FBQzFGLE9BQU8sRUFBRSxpQkFBaUIsRUFBRSxNQUFNLDBDQUEwQyxDQUFDO0FBQzdFLE9BQU8sRUFBRSxvQkFBb0IsRUFBRSxNQUFNLHlEQUF5RCxDQUFDO0FBQy9GLE9BQU8sRUFDTCxxQkFBcUIsRUFDdEIsTUFBSyxzRUFBc0UsQ0FBQztBQUM3RSxPQUFPLEVBQUUsaUJBQWlCLEVBQUUsTUFBTSwwQ0FBMEMsQ0FBQztB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gIEZzTGlzdEZldGNoT3B0aW9ucyxcbiAgRnNMaXN0RmV0Y2hGbixcbiAgRnNMaXN0Um93QWN0aW9uRmlsZUZuLFxuICBGc0xpc3RSb3dBY3Rpb25GaWxlLFxufSBmcm9tICcuL2FwcC9pbnRlcmZhY2VzL2xpc3Rjb25maWcuaW50ZXJmYWNlJztcbmV4cG9ydCB7IFF1ZXJ5T2Zmc2V0U3RyYXRlZ3ksIFF1ZXJ5UGFnZVN0cmF0ZWd5IH0gZnJvbSAnLi9hcHAvaW50ZXJmYWNlcy9wYWdpbmF0aW9uLmludGVyZmFjZSc7XG5cbi8vIEVudW1zXG5leHBvcnQgeyBBY3Rpb25UeXBlIH0gZnJvbSAnLi9hcHAvZW51bXMvYnV0dG9uLXR5cGUuZW51bSc7XG5leHBvcnQgeyBQYWdpbmF0aW9uU3RyYXRlZ3kgfSBmcm9tICcuL2FwcC9lbnVtcy9wYWdpbmF0aW9uLXN0cmF0ZWd5LmVudW0nO1xuZXhwb3J0IHsgUm93VHlwZSB9IGZyb20gJy4vYXBwL2VudW1zL3Jvdy10eXBlLmVudW0nO1xuZXhwb3J0IHsgRnNMaXN0U3RhdGUgfSBmcm9tICcuL2FwcC9lbnVtcy9zdGF0ZS5lbnVtJztcbiJdfQ==
|
|
@@ -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';
|
|
@@ -327,13 +327,13 @@ class RowAction extends Model {
|
|
|
327
327
|
};
|
|
328
328
|
this._linkFn = value.link;
|
|
329
329
|
if (value.file) {
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
330
|
+
this.fileConfig = Object.assign({}, value.file);
|
|
331
|
+
if (this.fileConfig.select) {
|
|
332
|
+
const selectFn = this.fileConfig.select;
|
|
333
|
+
this.fileConfig.select = (selection, row, index) => {
|
|
334
|
+
selectFn(selection, row, index);
|
|
333
335
|
};
|
|
334
336
|
}
|
|
335
|
-
this.fileUploadErrorFn = value.file.error;
|
|
336
|
-
this.fileMultiple = value.file.multiple;
|
|
337
337
|
}
|
|
338
338
|
if (typeof value.label === 'function') {
|
|
339
339
|
this._labelFn = value.label;
|
|
@@ -1179,9 +1179,8 @@ var PaginationStrategy;
|
|
|
1179
1179
|
PaginationStrategy["None"] = "none";
|
|
1180
1180
|
})(PaginationStrategy || (PaginationStrategy = {}));
|
|
1181
1181
|
|
|
1182
|
-
class PaginationController
|
|
1182
|
+
class PaginationController {
|
|
1183
1183
|
constructor() {
|
|
1184
|
-
super();
|
|
1185
1184
|
this.limit = 25;
|
|
1186
1185
|
this.manual = false;
|
|
1187
1186
|
this.page = 1; // Active page
|
|
@@ -1207,7 +1206,8 @@ class PaginationController extends Model {
|
|
|
1207
1206
|
return this._pages$.getValue();
|
|
1208
1207
|
}
|
|
1209
1208
|
get pages$() {
|
|
1210
|
-
return this._pages
|
|
1209
|
+
return this._pages$
|
|
1210
|
+
.pipe(distinctUntilChanged());
|
|
1211
1211
|
}
|
|
1212
1212
|
/**
|
|
1213
1213
|
* Fire if page was changed
|
|
@@ -1255,6 +1255,18 @@ class PaginationController extends Model {
|
|
|
1255
1255
|
}
|
|
1256
1256
|
return {};
|
|
1257
1257
|
}
|
|
1258
|
+
get loadMoreQuery() {
|
|
1259
|
+
switch (this.strategy) {
|
|
1260
|
+
case PaginationStrategy.Page:
|
|
1261
|
+
return this.query;
|
|
1262
|
+
case PaginationStrategy.Offset:
|
|
1263
|
+
const query = this.queryOffsetStrategy;
|
|
1264
|
+
query.limit = query.offset + query.limit;
|
|
1265
|
+
query.offset = 0;
|
|
1266
|
+
return query;
|
|
1267
|
+
}
|
|
1268
|
+
return {};
|
|
1269
|
+
}
|
|
1258
1270
|
/**
|
|
1259
1271
|
* Query for Page Strategy
|
|
1260
1272
|
*/
|
|
@@ -1361,12 +1373,6 @@ class PaginationController extends Model {
|
|
|
1361
1373
|
const to = Math.min(this.records, current + this.limit);
|
|
1362
1374
|
return `${from}-${to}`;
|
|
1363
1375
|
}
|
|
1364
|
-
_fromJSON(value) {
|
|
1365
|
-
super._fromJSON(value);
|
|
1366
|
-
if (!value.limit) {
|
|
1367
|
-
this.limit = 25;
|
|
1368
|
-
}
|
|
1369
|
-
}
|
|
1370
1376
|
initWithConfig(config, loadMore, infinityScrollEnabled = false) {
|
|
1371
1377
|
if (config) {
|
|
1372
1378
|
if (config.limits) {
|
|
@@ -1375,12 +1381,12 @@ class PaginationController extends Model {
|
|
|
1375
1381
|
if (config.limit) {
|
|
1376
1382
|
this.limit = config.limit;
|
|
1377
1383
|
}
|
|
1378
|
-
if (loadMore) {
|
|
1379
|
-
this.setLoadMore(loadMore);
|
|
1380
|
-
}
|
|
1381
|
-
this._infinityScrollEnabled = infinityScrollEnabled;
|
|
1382
1384
|
this.strategy = config.strategy;
|
|
1383
1385
|
}
|
|
1386
|
+
if (loadMore) {
|
|
1387
|
+
this.setLoadMore(loadMore);
|
|
1388
|
+
}
|
|
1389
|
+
this._infinityScrollEnabled = infinityScrollEnabled;
|
|
1384
1390
|
}
|
|
1385
1391
|
/**
|
|
1386
1392
|
* If pagination has prev page when Page Strategy
|
|
@@ -1409,13 +1415,13 @@ class PaginationController extends Model {
|
|
|
1409
1415
|
/**
|
|
1410
1416
|
* Update paging config and all related fields
|
|
1411
1417
|
* @param config
|
|
1412
|
-
* @param
|
|
1413
|
-
* @param
|
|
1418
|
+
* @param displayedRecords
|
|
1419
|
+
* @param loadMoreOperation
|
|
1414
1420
|
*/
|
|
1415
|
-
updatePaging(config,
|
|
1416
|
-
if (!
|
|
1417
|
-
this.
|
|
1418
|
-
this.displayed =
|
|
1421
|
+
updatePaging(config, displayedRecords = 0, loadMoreOperation = false) {
|
|
1422
|
+
if (!loadMoreOperation) {
|
|
1423
|
+
this._fromParams(config);
|
|
1424
|
+
this.displayed = displayedRecords;
|
|
1419
1425
|
}
|
|
1420
1426
|
else {
|
|
1421
1427
|
this.records = config.records;
|
|
@@ -1602,6 +1608,19 @@ class PaginationController extends Model {
|
|
|
1602
1608
|
this._onDestroy$.next();
|
|
1603
1609
|
this._onDestroy$.complete();
|
|
1604
1610
|
}
|
|
1611
|
+
/**
|
|
1612
|
+
* Update paging state
|
|
1613
|
+
* @param params
|
|
1614
|
+
*/
|
|
1615
|
+
_fromParams(params) {
|
|
1616
|
+
var _a;
|
|
1617
|
+
if (!this.loadMoreEnabled) {
|
|
1618
|
+
this.limit = (_a = params.limit, (_a !== null && _a !== void 0 ? _a : 25));
|
|
1619
|
+
}
|
|
1620
|
+
this.records = params.records;
|
|
1621
|
+
this.manual = params.manual;
|
|
1622
|
+
this.pages = params.pages || 0;
|
|
1623
|
+
}
|
|
1605
1624
|
/**
|
|
1606
1625
|
* Calc and update offset
|
|
1607
1626
|
*/
|
|
@@ -1615,23 +1634,6 @@ class PaginationController extends Model {
|
|
|
1615
1634
|
this.pages = Math.ceil(this.records / this.limit);
|
|
1616
1635
|
}
|
|
1617
1636
|
}
|
|
1618
|
-
__decorate([
|
|
1619
|
-
Alias(),
|
|
1620
|
-
__metadata("design:type", Object)
|
|
1621
|
-
], PaginationController.prototype, "limit", void 0);
|
|
1622
|
-
__decorate([
|
|
1623
|
-
Alias(),
|
|
1624
|
-
__metadata("design:type", Number)
|
|
1625
|
-
], PaginationController.prototype, "records", void 0);
|
|
1626
|
-
__decorate([
|
|
1627
|
-
Alias(),
|
|
1628
|
-
__metadata("design:type", Object)
|
|
1629
|
-
], PaginationController.prototype, "manual", void 0);
|
|
1630
|
-
__decorate([
|
|
1631
|
-
Alias('pages'),
|
|
1632
|
-
__metadata("design:type", Number),
|
|
1633
|
-
__metadata("design:paramtypes", [Number])
|
|
1634
|
-
], PaginationController.prototype, "pages", null);
|
|
1635
1637
|
|
|
1636
1638
|
var SelectionChangeType;
|
|
1637
1639
|
(function (SelectionChangeType) {
|
|
@@ -2759,9 +2761,18 @@ class List extends Model {
|
|
|
2759
2761
|
var _a;
|
|
2760
2762
|
(_a = this.selection) === null || _a === void 0 ? void 0 : _a.closeSelectionDialog();
|
|
2761
2763
|
}), map((params) => {
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
|
|
2764
|
+
let query = Object.assign({}, this.filtersQuery);
|
|
2765
|
+
if (this.paging.hasOffsetStrategy && params && params.loadOffset) {
|
|
2766
|
+
query = Object.assign(query, this.paging.loadDeletedOffsetQuery);
|
|
2767
|
+
}
|
|
2768
|
+
else {
|
|
2769
|
+
if (this.initialFetch && this.paging.loadMoreEnabled) {
|
|
2770
|
+
query = Object.assign(query, this.paging.loadMoreQuery);
|
|
2771
|
+
}
|
|
2772
|
+
else {
|
|
2773
|
+
query = Object.assign(query, this.paging.query);
|
|
2774
|
+
}
|
|
2775
|
+
}
|
|
2765
2776
|
if (this.sorting.sortingColumn) {
|
|
2766
2777
|
Object.assign(query, {
|
|
2767
2778
|
order: `${this.sorting.sortingColumn.name},${this.sorting.sortingColumn.direction}`
|
|
@@ -2788,6 +2799,7 @@ class List extends Model {
|
|
|
2788
2799
|
return source$;
|
|
2789
2800
|
}), takeUntil(this.onDestroy$))
|
|
2790
2801
|
.subscribe((response) => {
|
|
2802
|
+
this.initialFetch = false;
|
|
2791
2803
|
this.completeFetch(response);
|
|
2792
2804
|
});
|
|
2793
2805
|
}
|
|
@@ -3002,7 +3014,7 @@ class List extends Model {
|
|
|
3002
3014
|
this.selection.selectedRowsIntersection(this.dataController.visibleRowsData);
|
|
3003
3015
|
}
|
|
3004
3016
|
if (((_a = this.emptyState) === null || _a === void 0 ? void 0 : _a.validate) && this.emptyStateTemplate) {
|
|
3005
|
-
this.emptyStateEnabled = this.emptyState.validate(query, cloneDeep(
|
|
3017
|
+
this.emptyStateEnabled = this.emptyState.validate(query, cloneDeep(this.dataController.visibleRowsData));
|
|
3006
3018
|
}
|
|
3007
3019
|
if (this.afterFetchFn) {
|
|
3008
3020
|
this.afterFetchFn(query, this.dataController.visibleRowsData);
|
|
@@ -5065,7 +5077,7 @@ __decorate([
|
|
|
5065
5077
|
FsRowActionsComponent = __decorate([
|
|
5066
5078
|
Component({
|
|
5067
5079
|
selector: 'fs-list-row-actions',
|
|
5068
|
-
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.
|
|
5080
|
+
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",
|
|
5069
5081
|
changeDetection: ChangeDetectionStrategy.OnPush
|
|
5070
5082
|
}),
|
|
5071
5083
|
__metadata("design:paramtypes", [FsPrompt])
|
|
@@ -5102,7 +5114,7 @@ __decorate([
|
|
|
5102
5114
|
FsRowInlineActionComponent = __decorate([
|
|
5103
5115
|
Component({
|
|
5104
5116
|
selector: 'fs-list-row-inline-action',
|
|
5105
|
-
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.
|
|
5117
|
+
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",
|
|
5106
5118
|
changeDetection: ChangeDetectionStrategy.OnPush
|
|
5107
5119
|
}),
|
|
5108
5120
|
__metadata("design:paramtypes", [FsPrompt])
|
|
@@ -5124,12 +5136,8 @@ __decorate([
|
|
|
5124
5136
|
], FsRowMenuActionComponent.prototype, "label", void 0);
|
|
5125
5137
|
__decorate([
|
|
5126
5138
|
Input(),
|
|
5127
|
-
__metadata("design:type",
|
|
5139
|
+
__metadata("design:type", Object)
|
|
5128
5140
|
], FsRowMenuActionComponent.prototype, "file", void 0);
|
|
5129
|
-
__decorate([
|
|
5130
|
-
Input(),
|
|
5131
|
-
__metadata("design:type", Boolean)
|
|
5132
|
-
], FsRowMenuActionComponent.prototype, "fileMultiple", void 0);
|
|
5133
5141
|
__decorate([
|
|
5134
5142
|
Output(),
|
|
5135
5143
|
__metadata("design:type", Object)
|
|
@@ -5141,7 +5149,7 @@ __decorate([
|
|
|
5141
5149
|
FsRowMenuActionComponent = __decorate([
|
|
5142
5150
|
Component({
|
|
5143
5151
|
selector: 'fs-list-row-menu-action',
|
|
5144
|
-
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]=\"
|
|
5152
|
+
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",
|
|
5145
5153
|
changeDetection: ChangeDetectionStrategy.OnPush
|
|
5146
5154
|
})
|
|
5147
5155
|
], FsRowMenuActionComponent);
|