@firestitch/list 9.12.2 → 9.12.5
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/directives/content/content.directive.d.ts +2 -0
- package/bundles/firestitch-list.umd.js +91 -61
- 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 +17 -5
- package/esm2015/app/classes/pagination-controller.js +40 -40
- package/esm2015/app/components/list/list.component.js +2 -2
- package/esm2015/app/directives/content/content.directive.js +11 -0
- package/esm2015/app/fs-list.module.js +4 -1
- package/esm2015/public_api.js +2 -1
- package/esm5/app/classes/list-controller.js +17 -5
- package/esm5/app/classes/pagination-controller.js +62 -60
- package/esm5/app/components/list/list.component.js +2 -2
- package/esm5/app/directives/content/content.directive.js +14 -0
- package/esm5/app/fs-list.module.js +4 -1
- package/esm5/public_api.js +2 -1
- package/fesm2015/firestitch-list.js +67 -43
- package/fesm2015/firestitch-list.js.map +1 -1
- package/fesm5/firestitch-list.js +92 -63
- 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 -0
package/esm5/public_api.js
CHANGED
|
@@ -23,6 +23,7 @@ export { FsListColumnDirective } from './app/directives/column/column.directive'
|
|
|
23
23
|
export { FsListCellDirective } from './app/directives/cell/cell.directive';
|
|
24
24
|
export { FsListHeaderDirective } from './app/directives/header/header.directive';
|
|
25
25
|
export { FsListEmptyStateDirective } from './app/directives/empty-state/empty-state.directive';
|
|
26
|
+
export { FsListContentDirective } from './app/directives/content/content.directive';
|
|
26
27
|
// Models
|
|
27
28
|
export { Column, SortingDirection } from './app/models/column.model';
|
|
28
29
|
export { List } from './app/classes/list-controller';
|
|
@@ -37,4 +38,4 @@ export { ActionType } from './app/enums/button-type.enum';
|
|
|
37
38
|
export { PaginationStrategy } from './app/enums/pagination-strategy.enum';
|
|
38
39
|
export { RowType } from './app/enums/row-type.enum';
|
|
39
40
|
export { FsListState } from './app/enums/state.enum';
|
|
40
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
41
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljX2FwaS5qcyIsInNvdXJjZVJvb3QiOiJuZzovL0BmaXJlc3RpdGNoL2xpc3QvIiwic291cmNlcyI6WyJwdWJsaWNfYXBpLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBRUgsVUFBVTtBQUNWLE9BQU8sRUFBRSxZQUFZLEVBQUUsTUFBTSxzQkFBc0IsQ0FBQztBQUVwRCxZQUFZO0FBQ1osT0FBTyxFQUFFLGNBQWMsRUFBRSxzQkFBc0IsRUFBRSxNQUFNLHlCQUF5QixDQUFDO0FBRWpGLGFBQWE7QUFDYixPQUFPLEVBQUUsZUFBZSxFQUFFLE1BQU0sc0NBQXNDLENBQUM7QUFDdkUsT0FBTyxFQUFFLGVBQWUsRUFBRSxNQUFNLHNDQUFzQyxDQUFDO0FBQ3ZFLE9BQU8sRUFBRSxjQUFjLEVBQUUsTUFBTSx5Q0FBeUMsQ0FBQztBQUN6RSxPQUFPLEVBQUUsZUFBZSxFQUFFLE1BQU0sK0NBQStDLENBQUM7QUFDaEYsT0FBTyxFQUFFLGVBQWUsRUFBRSxNQUFNLHNDQUFzQyxDQUFDO0FBQ3ZFLE9BQU8sRUFBRSxtQkFBbUIsRUFBRSxNQUFNLHFEQUFxRCxDQUFDO0FBQzFGLE9BQU8sRUFBRSxpQkFBaUIsRUFBRSxNQUFNLDBDQUEwQyxDQUFDO0FBQzdFLE9BQU8sRUFBRSxvQkFBb0IsRUFBRSxNQUFNLHlEQUF5RCxDQUFDO0FBQy9GLE9BQU8sRUFDTCxxQkFBcUIsRUFDdEIsTUFBSyxzRUFBc0UsQ0FB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2VsZWN0ZWQsXG4gIEZzTGlzdEdyb3VwQ29uZmlnLFxuICBGc0xpc3RSb3dBY3Rpb25MaW5rLFxuICBGc0xpc3RSb3dBY3Rpb25MaW5rRm4sXG4gIEZzTGlzdFJvd0FjdGlvbkdyb3VwLFxuICBGc0xpc3RFbXB0eVN0YXRlQ29uZmlnLFxuICBGc0xpc3RTdGF0ZVZhbGlkYXRpb25GbixcbiAgRnNMaXN0RmV0Y2hPcHRpb25zLFxuICBGc0xpc3RGZXRjaEZuLFxuICBGc0xpc3RSb3dBY3Rpb25GaWxlRm4sXG4gIEZzTGlzdFJvd0FjdGlvbkZpbGUsXG59IGZyb20gJy4vYXBwL2ludGVyZmFjZXMvbGlzdGNvbmZpZy5pbnRlcmZhY2UnO1xuZXhwb3J0IHsgUXVlcnlPZmZzZXRTdHJhdGVneSwgUXVlcnlQYWdlU3RyYXRlZ3kgfSBmcm9tICcuL2FwcC9pbnRlcmZhY2VzL3BhZ2luYXRpb24uaW50ZXJmYWNlJztcblxuLy8gRW51bXNcbmV4cG9ydCB7IEFjdGlvblR5cGUgfSBmcm9tICcuL2FwcC9lbnVtcy9idXR0b24tdHlwZS5lbnVtJztcbmV4cG9ydCB7IFBhZ2luYXRpb25TdHJhdGVneSB9IGZyb20gJy4vYXBwL2VudW1zL3BhZ2luYXRpb24tc3RyYXRlZ3kuZW51bSc7XG5leHBvcnQgeyBSb3dUeXBlIH0gZnJvbSAnLi9hcHAvZW51bXMvcm93LXR5cGUuZW51bSc7XG5leHBvcnQgeyBGc0xpc3RTdGF0ZSB9IGZyb20gJy4vYXBwL2VudW1zL3N0YXRlLmVudW0nO1xuIl19
|
|
@@ -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';
|
|
@@ -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,20 @@ 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
|
+
const allRecordsRangeNeeded = (this.initialFetch
|
|
2770
|
+
|| this.dataController.operation === FsListState.Reload) && this.paging.loadMoreEnabled;
|
|
2771
|
+
if (allRecordsRangeNeeded) {
|
|
2772
|
+
query = Object.assign(query, this.paging.loadMoreQuery);
|
|
2773
|
+
}
|
|
2774
|
+
else {
|
|
2775
|
+
query = Object.assign(query, this.paging.query);
|
|
2776
|
+
}
|
|
2777
|
+
}
|
|
2765
2778
|
if (this.sorting.sortingColumn) {
|
|
2766
2779
|
Object.assign(query, {
|
|
2767
2780
|
order: `${this.sorting.sortingColumn.name},${this.sorting.sortingColumn.direction}`
|
|
@@ -2788,6 +2801,7 @@ class List extends Model {
|
|
|
2788
2801
|
return source$;
|
|
2789
2802
|
}), takeUntil(this.onDestroy$))
|
|
2790
2803
|
.subscribe((response) => {
|
|
2804
|
+
this.initialFetch = false;
|
|
2791
2805
|
this.completeFetch(response);
|
|
2792
2806
|
});
|
|
2793
2807
|
}
|
|
@@ -3002,7 +3016,7 @@ class List extends Model {
|
|
|
3002
3016
|
this.selection.selectedRowsIntersection(this.dataController.visibleRowsData);
|
|
3003
3017
|
}
|
|
3004
3018
|
if (((_a = this.emptyState) === null || _a === void 0 ? void 0 : _a.validate) && this.emptyStateTemplate) {
|
|
3005
|
-
this.emptyStateEnabled = this.emptyState.validate(query, cloneDeep(
|
|
3019
|
+
this.emptyStateEnabled = this.emptyState.validate(query, cloneDeep(this.dataController.visibleRowsData));
|
|
3006
3020
|
}
|
|
3007
3021
|
if (this.afterFetchFn) {
|
|
3008
3022
|
this.afterFetchFn(query, this.dataController.visibleRowsData);
|
|
@@ -3902,7 +3916,7 @@ __decorate([
|
|
|
3902
3916
|
FsListComponent = __decorate([
|
|
3903
3917
|
Component({
|
|
3904
3918
|
selector: 'fs-list',
|
|
3905
|
-
template: "<div class=\"fs-list-container\"\
|
|
3919
|
+
template: "<div class=\"fs-list-container\"\n [ngClass]=\"{ 'has-filter-input': list.filterInput,\n 'has-filters': list.filterConfig?.items.length,\n 'has-heading': list.heading,\n 'has-status': list.status,\n 'has-chips': list.chips,\n 'has-actions': list.actions.hasActions,\n 'first-load': firstLoad,\n 'loading': list.loading$ | async }\">\n <ng-template [ngTemplateOutlet]=\"listContainerContent\"></ng-template>\n</div>\n\n<ng-template #listContainerContent>\n <ng-container *ngIf=\"list.dataController.visibleRows$ | async as listData\">\n <!-- Header -->\n <div class=\"fs-list-header-container\">\n\n <div class=\"fs-list-header\"\n [ngClass]=\"{ 'no-wrap': reorderController.manualReorderActivated$ || !list.filterConfig?.items.length }\">\n <div class=\"heading-container\">\n <h2 class=\"heading\" *ngIf=\"list.heading\">{{list.heading}}</h2>\n <span class=\"subheading\" *ngIf=\"list.subheading\">{{list.subheading}}</span>\n </div>\n <fs-filter\n class=\"fs-list-filter\"\n *ngIf=\"list.filterConfig\"\n [filter]=\"list.filterConfig\"\n [showSortBy]=\"!list.status\"\n [showFilterInput]=\"list.filterInput\"\n (ready)=\"filterReady()\">\n\n <ng-template fsFilterStatusBar>\n <ng-container *ngIf=\"\n list.paging &&\n !(reorderController.manualReorderActivated$ | async) &&\n (!reorderController.enabled || reorderController.status) &&\n ((list.scrollable && list.scrollable.status) || !list.scrollable)\">\n <!-- Status -->\n <fs-list-status\n class=\"fs-list-status\"\n [ngClass]=\"{ 'hidden-mobile': !list.status }\"\n [rows]=\"listData\"\n [sorting]=\"list.sorting\"\n [paging]=\"list.paging\"\n [firstLoad]=\"firstLoad\"\n [scrollable]=\"list.scrollable\">\n </fs-list-status>\n </ng-container>\n </ng-template>\n </fs-filter>\n </div>\n </div>\n\n <ng-content select=\"[fs-list-content]\"></ng-content>\n\n <!-- Table implementation -->\n <div class=\"fs-list-table-container\">\n <table class=\"fs-list-table\" role=\"grid\" *ngIf=\"!firstLoad && listData.length > 0 && !list.emptyStateEnabled\">\n <thead fs-list-head\n class=\"fs-list-head\"\n role=\"rowgroup\"\n *ngIf=\"list.columns.hasHeader\"\n [ngClass]=\"list.columns.theadClass\"\n [columns]=\"list.columns.visibleColumns\"\n [sorting]=\"list.sorting\"\n [selection]=\"list.selection\"\n [hasRowActions]=\"list.hasRowActions\"\n >\n </thead>\n\n <tbody fs-list-body\n fsListDraggableList\n class=\"fs-list-body\"\n role=\"rowgroup\"\n [class.disabled]=\"!!(reorderController.reorderDisabled$ | async)\"\n [rows]=\"listData\"\n [rowActionsRaw]=\"list.rowActionsRaw\"\n [groupActionsRaw]=\"list.groupActionsRaw\"\n [hasRowActions]=\"list.hasRowActions\"\n [rowEvents]=\"list.rowEvents\"\n [rowClass]=\"list.rowClass\"\n [columns]=\"list.columns.visibleColumns\"\n [restoreMode]=\"list.restoreMode\"\n [selection]=\"list.selection\"\n [rowRemoved]=\"rowRemoved\"\n >\n </tbody>\n\n <tfoot fs-list-footer\n class=\"fs-list-footer\"\n *ngIf=\"list.columns.hasFooter\"\n [columns]=\"list.columns.visibleColumns\"\n [selection]=\"list.selection\"\n [hasRowActions]=\"list.hasRowActions\">\n </tfoot>\n </table>\n <fs-list-loader\n *ngIf=\"firstLoad\"\n [columns]=\"list.columns.columns\"\n [loaderLines]=\"loaderLines\">\n </fs-list-loader>\n </div>\n\n <fs-list-pagination\n *ngIf=\"paginatorVisible\"\n class=\"fs-list-pagination\"\n [rows]=\"listData\"\n [pagination]=\"list.paging\">\n </fs-list-pagination>\n\n\n <ng-container *ngIf=\"!firstLoad\">\n <div\n *ngIf=\"listData.length === 0\"\n class=\"fs-list-no-results-container\">\n <div\n *ngIf=\"list.noResults?.message && !list.emptyStateEnabled\"\n class=\"fs-list-no-results\">\n {{ list.noResults?.message }}\n </div>\n <ng-container *ngIf=\"list.emptyStateEnabled\">\n <ng-template [ngTemplateOutlet]=\"list.emptyStateTemplate\"></ng-template>\n </ng-container>\n </div>\n </ng-container>\n </ng-container>\n</ng-template>\n\n",
|
|
3906
3920
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
3907
3921
|
providers: [
|
|
3908
3922
|
GroupExpandNotifierService,
|
|
@@ -5314,6 +5328,14 @@ FsListDraggableRowDirective = __decorate([
|
|
|
5314
5328
|
FsListDraggableListDirective])
|
|
5315
5329
|
], FsListDraggableRowDirective);
|
|
5316
5330
|
|
|
5331
|
+
let FsListContentDirective = class FsListContentDirective {
|
|
5332
|
+
};
|
|
5333
|
+
FsListContentDirective = __decorate([
|
|
5334
|
+
Directive({
|
|
5335
|
+
selector: '[fs-list-content]',
|
|
5336
|
+
})
|
|
5337
|
+
], FsListContentDirective);
|
|
5338
|
+
|
|
5317
5339
|
var FsListModule_1;
|
|
5318
5340
|
let FsListModule = FsListModule_1 = class FsListModule {
|
|
5319
5341
|
static forRoot(config = {}) {
|
|
@@ -5380,6 +5402,7 @@ FsListModule = FsListModule_1 = __decorate([
|
|
|
5380
5402
|
FsListDraggableListDirective,
|
|
5381
5403
|
FsListDraggableRowDirective,
|
|
5382
5404
|
FsListEmptyStateDirective,
|
|
5405
|
+
FsListContentDirective,
|
|
5383
5406
|
// Dialog
|
|
5384
5407
|
CustomizeColsDialogComponent,
|
|
5385
5408
|
],
|
|
@@ -5400,6 +5423,7 @@ FsListModule = FsListModule_1 = __decorate([
|
|
|
5400
5423
|
FsListGroupCellDirective,
|
|
5401
5424
|
FsListGroupExpandTriggerDirective,
|
|
5402
5425
|
FsListEmptyStateDirective,
|
|
5426
|
+
FsListContentDirective,
|
|
5403
5427
|
],
|
|
5404
5428
|
})
|
|
5405
5429
|
], FsListModule);
|
|
@@ -5415,5 +5439,5 @@ function FsListConfigFactory(config) {
|
|
|
5415
5439
|
* Generated bundle index. Do not edit.
|
|
5416
5440
|
*/
|
|
5417
5441
|
|
|
5418
|
-
export { ActionType, Column, FS_LIST_CONFIG, FS_LIST_DEFAULT_CONFIG, FsBodyComponent, FsCellComponent, FsFooterCellComponent, FsFooterComponent, FsFooterRowComponent, FsHeadCellComponent, FsHeadComponent, FsListCellDirective, FsListColumnDirective, FsListComponent, FsListEmptyStateDirective, FsListFooterDirective, FsListHeaderDirective, FsListModule, FsListState, FsPaginationComponent, FsRowComponent, FsStatusComponent, List, PaginationController, PaginationStrategy, ReorderController, ReorderPosition, ReorderStrategy, RowAction, RowType, SelectionChangeType, SelectionController, SortingController, SortingDirection, StyleConfig, FsListConfigFactory as ɵa, GroupExpandNotifierService as ɵb, PersistanceController as ɵc, FsListGroupCellDirective as ɵd, FsListGroupExpandTriggerDirective as ɵe, FsListDraggableListDirective as ɵf, FsRowActionsComponent as ɵg, FsRowInlineActionComponent as ɵh, FsRowMenuActionComponent as ɵi, FsListLoaderComponent as ɵj, FsListSavedFiltersComponent as ɵk, FsListManageSavedFiltersComponent as ɵl, FsListDraggableRowDirective as ɵm, CustomizeColsDialogComponent as ɵn };
|
|
5442
|
+
export { ActionType, Column, FS_LIST_CONFIG, FS_LIST_DEFAULT_CONFIG, FsBodyComponent, FsCellComponent, FsFooterCellComponent, FsFooterComponent, FsFooterRowComponent, FsHeadCellComponent, FsHeadComponent, FsListCellDirective, FsListColumnDirective, FsListComponent, FsListContentDirective, FsListEmptyStateDirective, FsListFooterDirective, FsListHeaderDirective, FsListModule, FsListState, FsPaginationComponent, FsRowComponent, FsStatusComponent, List, PaginationController, PaginationStrategy, ReorderController, ReorderPosition, ReorderStrategy, RowAction, RowType, SelectionChangeType, SelectionController, SortingController, SortingDirection, StyleConfig, FsListConfigFactory as ɵa, GroupExpandNotifierService as ɵb, PersistanceController as ɵc, FsListGroupCellDirective as ɵd, FsListGroupExpandTriggerDirective as ɵe, FsListDraggableListDirective as ɵf, FsRowActionsComponent as ɵg, FsRowInlineActionComponent as ɵh, FsRowMenuActionComponent as ɵi, FsListLoaderComponent as ɵj, FsListSavedFiltersComponent as ɵk, FsListManageSavedFiltersComponent as ɵl, FsListDraggableRowDirective as ɵm, CustomizeColsDialogComponent as ɵn };
|
|
5419
5443
|
//# sourceMappingURL=firestitch-list.js.map
|