@firestitch/list 12.0.0 → 12.1.1
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/columns-controller.d.ts +8 -2
- package/app/classes/list-controller.d.ts +2 -1
- package/app/directives/column/column.directive.d.ts +15 -11
- package/app/directives/content-init/content-init.directive.d.ts +9 -0
- package/app/fs-list.module.d.ts +19 -18
- package/app/interfaces/column-config.interface.d.ts +2 -0
- package/app/interfaces/listconfig.interface.d.ts +2 -0
- package/app/models/column-async-attribute.d.ts +5 -0
- package/app/models/column-attributes.d.ts +38 -0
- package/app/models/column.model.d.ts +22 -15
- package/bundles/firestitch-list.umd.js +451 -132
- package/bundles/firestitch-list.umd.js.map +1 -1
- package/esm2015/app/classes/columns-controller.js +30 -10
- package/esm2015/app/classes/list-controller.js +7 -2
- package/esm2015/app/classes/sorting-controller.js +6 -2
- package/esm2015/app/components/list/list.component.js +5 -4
- package/esm2015/app/components/manage-saved-filters/manage-saved-filters.component.js +1 -1
- package/esm2015/app/directives/column/column.directive.js +60 -26
- package/esm2015/app/directives/content-init/content-init.directive.js +22 -0
- package/esm2015/app/fs-list.module.js +4 -1
- package/esm2015/app/interfaces/column-config.interface.js +2 -0
- package/esm2015/app/interfaces/listconfig.interface.js +1 -1
- package/esm2015/app/models/column-async-attribute.js +14 -0
- package/esm2015/app/models/column-attributes.js +112 -0
- package/esm2015/app/models/column.model.js +59 -87
- package/fesm2015/firestitch-list.js +304 -122
- package/fesm2015/firestitch-list.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
1
2
|
import { Column } from '../models/column.model';
|
|
2
3
|
import { FsListColumnChangeFn, FsListColumnConfig } from '../interfaces/listconfig.interface';
|
|
3
4
|
export declare class ColumnsController {
|
|
4
|
-
|
|
5
|
+
private _visibleColumns$;
|
|
6
|
+
private _visibleColumnsShared$;
|
|
5
7
|
private _theadClass;
|
|
6
8
|
private _loadFn;
|
|
7
9
|
private _changeFn;
|
|
@@ -16,9 +18,12 @@ export declare class ColumnsController {
|
|
|
16
18
|
private _hasFooter;
|
|
17
19
|
private _columns;
|
|
18
20
|
private _defaultConfigs;
|
|
21
|
+
private _columnsUpdated$;
|
|
19
22
|
private _destroy$;
|
|
20
23
|
constructor();
|
|
21
24
|
get columns(): Column[];
|
|
25
|
+
get visibleColumns(): Column[];
|
|
26
|
+
get visibleColumns$(): Observable<Column[]>;
|
|
22
27
|
get columnsForDialog(): {
|
|
23
28
|
template: import("@angular/core").TemplateRef<any>;
|
|
24
29
|
name: string;
|
|
@@ -50,7 +55,7 @@ export declare class ColumnsController {
|
|
|
50
55
|
/**
|
|
51
56
|
* Load visiblity config for columns from remote
|
|
52
57
|
*/
|
|
53
|
-
loadRemoteColumnConfigs():
|
|
58
|
+
loadRemoteColumnConfigs(): Observable<import("../interfaces/listconfig.interface").FsListColumn[]>;
|
|
54
59
|
/**
|
|
55
60
|
* Set visible columns based on current columns show status
|
|
56
61
|
*/
|
|
@@ -61,5 +66,6 @@ export declare class ColumnsController {
|
|
|
61
66
|
*/
|
|
62
67
|
updateVisibilityForCols(columnsConfig: any): void;
|
|
63
68
|
destroy(): void;
|
|
69
|
+
private _listenColumnVisibilityUpdates;
|
|
64
70
|
private _updateColspans;
|
|
65
71
|
}
|
|
@@ -5,7 +5,7 @@ import { FsScrollInstance, FsScrollService } from '@firestitch/scroll';
|
|
|
5
5
|
import { SelectionDialog } from '@firestitch/selection';
|
|
6
6
|
import { Model } from 'tsmodels';
|
|
7
7
|
import { BehaviorSubject, Observable, Subject } from 'rxjs';
|
|
8
|
-
import { FsListAfterFetchFn, FsListConfig, FsListEmptyStateConfig, FsListFetchFn, FsListFetchSubscription, FsListNoResultsConfig, FsListRestoreConfig, FsListScrollableConfig, FsListTrackByFn } from '../interfaces';
|
|
8
|
+
import { FsListAfterContentInitFn, FsListAfterFetchFn, FsListConfig, FsListEmptyStateConfig, FsListFetchFn, FsListFetchSubscription, FsListNoResultsConfig, FsListRestoreConfig, FsListScrollableConfig, FsListTrackByFn } from '../interfaces';
|
|
9
9
|
import { ColumnsController } from './columns-controller';
|
|
10
10
|
import { ActionsController } from './index';
|
|
11
11
|
import { DataController } from './data-controller';
|
|
@@ -43,6 +43,7 @@ export declare class List extends Model {
|
|
|
43
43
|
emptyState: FsListEmptyStateConfig;
|
|
44
44
|
fetchFn: FsListFetchFn;
|
|
45
45
|
afterFetchFn: FsListAfterFetchFn;
|
|
46
|
+
afterContentInit: FsListAfterContentInitFn;
|
|
46
47
|
initialized$: BehaviorSubject<boolean>;
|
|
47
48
|
loading$: BehaviorSubject<boolean>;
|
|
48
49
|
hasRowActions: any;
|
|
@@ -1,18 +1,9 @@
|
|
|
1
1
|
import { QueryList, TemplateRef } from '@angular/core';
|
|
2
2
|
import { CellConfig } from '../../interfaces';
|
|
3
3
|
import { FsListGroupExpandTriggerDirective } from '../group-expand-trigger/group-expand-trigger.directive';
|
|
4
|
+
import { ColumnAttributes } from '../../models/column-attributes';
|
|
4
5
|
import * as i0 from "@angular/core";
|
|
5
6
|
export declare class FsListColumnDirective {
|
|
6
|
-
title: string;
|
|
7
|
-
name: string;
|
|
8
|
-
show: boolean;
|
|
9
|
-
customize: boolean;
|
|
10
|
-
sortable: boolean;
|
|
11
|
-
sortableDefault: boolean;
|
|
12
|
-
direction: 'asc' | 'desc';
|
|
13
|
-
align: string;
|
|
14
|
-
width: string;
|
|
15
|
-
className: string | string[];
|
|
16
7
|
headerTemplate: TemplateRef<any>;
|
|
17
8
|
headerConfigs: CellConfig;
|
|
18
9
|
groupCellTemplate: TemplateRef<any>;
|
|
@@ -22,6 +13,19 @@ export declare class FsListColumnDirective {
|
|
|
22
13
|
cellConfigs: CellConfig;
|
|
23
14
|
footerTemplate: TemplateRef<any>;
|
|
24
15
|
footerConfigs: CellConfig;
|
|
16
|
+
private readonly _columnAttributes;
|
|
17
|
+
constructor();
|
|
18
|
+
get attributes(): ColumnAttributes;
|
|
19
|
+
set visible(value: boolean);
|
|
20
|
+
set title(value: string);
|
|
21
|
+
set name(value: string);
|
|
22
|
+
set customize(value: boolean);
|
|
23
|
+
set sortable(value: boolean);
|
|
24
|
+
set sortableDefault(value: boolean);
|
|
25
|
+
set direction(value: 'asc' | 'desc');
|
|
26
|
+
set align(value: string);
|
|
27
|
+
set width(value: string);
|
|
28
|
+
set className(value: string | string[]);
|
|
25
29
|
static ɵfac: i0.ɵɵFactoryDeclaration<FsListColumnDirective, never>;
|
|
26
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<FsListColumnDirective, "fs-list-column", never, { "
|
|
30
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<FsListColumnDirective, "fs-list-column", never, { "visible": "show"; "title": "title"; "name": "name"; "customize": "customize"; "sortable": "sortable"; "sortableDefault": "sortableDefault"; "direction": "direction"; "align": "align"; "width": "width"; "className": "class"; }, {}, ["headerTemplate", "headerConfigs", "groupCellTemplate", "groupCellConfigs", "cellTemplate", "cellConfigs", "footerTemplate", "footerConfigs", "expandTrigger"]>;
|
|
27
31
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { AfterViewInit } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class FsListContentInitDirective implements AfterViewInit {
|
|
4
|
+
contentInitCallback: Function;
|
|
5
|
+
constructor();
|
|
6
|
+
ngAfterViewInit(): void;
|
|
7
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FsListContentInitDirective, never>;
|
|
8
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<FsListContentInitDirective, "[fsListContentInit]", never, { "contentInitCallback": "fsListContentInit"; }, {}, never>;
|
|
9
|
+
}
|
package/app/fs-list.module.d.ts
CHANGED
|
@@ -28,27 +28,28 @@ import * as i24 from "./directives/draggable-list/draggable-list.directive";
|
|
|
28
28
|
import * as i25 from "./directives/draggable-row/draggable-row.directive";
|
|
29
29
|
import * as i26 from "./directives/empty-state/empty-state.directive";
|
|
30
30
|
import * as i27 from "./directives/content/content.directive";
|
|
31
|
-
import * as i28 from "./
|
|
32
|
-
import * as i29 from "
|
|
33
|
-
import * as i30 from "@angular/
|
|
34
|
-
import * as i31 from "@angular/
|
|
35
|
-
import * as i32 from "@angular/material/
|
|
36
|
-
import * as i33 from "@angular/material/
|
|
37
|
-
import * as i34 from "@angular/material/
|
|
38
|
-
import * as i35 from "@angular/material/
|
|
39
|
-
import * as i36 from "@angular/material/
|
|
40
|
-
import * as i37 from "@
|
|
41
|
-
import * as i38 from "@firestitch/
|
|
42
|
-
import * as i39 from "@
|
|
43
|
-
import * as i40 from "@
|
|
44
|
-
import * as i41 from "@firestitch/
|
|
45
|
-
import * as i42 from "@
|
|
46
|
-
import * as i43 from "@angular/material/
|
|
47
|
-
import * as i44 from "@
|
|
31
|
+
import * as i28 from "./directives/content-init/content-init.directive";
|
|
32
|
+
import * as i29 from "./components/customize-cols/customize-cols.component";
|
|
33
|
+
import * as i30 from "@angular/common";
|
|
34
|
+
import * as i31 from "@angular/router";
|
|
35
|
+
import * as i32 from "@angular/material/button";
|
|
36
|
+
import * as i33 from "@angular/material/icon";
|
|
37
|
+
import * as i34 from "@angular/material/menu";
|
|
38
|
+
import * as i35 from "@angular/material/progress-spinner";
|
|
39
|
+
import * as i36 from "@angular/material/checkbox";
|
|
40
|
+
import * as i37 from "@angular/material/core";
|
|
41
|
+
import * as i38 from "@firestitch/filter";
|
|
42
|
+
import * as i39 from "@firestitch/menu";
|
|
43
|
+
import * as i40 from "@angular/flex-layout";
|
|
44
|
+
import * as i41 from "@firestitch/scroll";
|
|
45
|
+
import * as i42 from "@firestitch/prompt";
|
|
46
|
+
import * as i43 from "@angular/material/dialog";
|
|
47
|
+
import * as i44 from "@angular/material/tooltip";
|
|
48
|
+
import * as i45 from "@firestitch/file";
|
|
48
49
|
export declare class FsListModule {
|
|
49
50
|
static forRoot(config?: FsListConfig): ModuleWithProviders<FsListModule>;
|
|
50
51
|
static ɵfac: i0.ɵɵFactoryDeclaration<FsListModule, never>;
|
|
51
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<FsListModule, [typeof i1.FsListComponent, typeof i2.FsRowComponent, typeof i3.FsRowActionsComponent, typeof i4.FsRowInlineActionComponent, typeof i5.FsRowMenuActionComponent, typeof i6.FsCellComponent, typeof i7.FsFooterRowComponent, typeof i8.FsFooterCellComponent, typeof i9.FsStatusComponent, typeof i10.FsListLoaderComponent, typeof i11.FsListSavedFiltersComponent, typeof i12.FsListManageSavedFiltersComponent, typeof i13.FsHeadComponent, typeof i14.FsHeadCellComponent, typeof i15.FsBodyComponent, typeof i16.FsFooterComponent, typeof i17.FsPaginationComponent, typeof i18.FsListColumnDirective, typeof i19.FsListCellDirective, typeof i20.FsListHeaderDirective, typeof i21.FsListFooterDirective, typeof i22.FsListGroupCellDirective, typeof i23.FsListGroupExpandTriggerDirective, typeof i24.FsListDraggableListDirective, typeof i25.FsListDraggableRowDirective, typeof i26.FsListEmptyStateDirective, typeof i27.FsListContentDirective, typeof i28.CustomizeColsDialogComponent], [typeof
|
|
52
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<FsListModule, [typeof i1.FsListComponent, typeof i2.FsRowComponent, typeof i3.FsRowActionsComponent, typeof i4.FsRowInlineActionComponent, typeof i5.FsRowMenuActionComponent, typeof i6.FsCellComponent, typeof i7.FsFooterRowComponent, typeof i8.FsFooterCellComponent, typeof i9.FsStatusComponent, typeof i10.FsListLoaderComponent, typeof i11.FsListSavedFiltersComponent, typeof i12.FsListManageSavedFiltersComponent, typeof i13.FsHeadComponent, typeof i14.FsHeadCellComponent, typeof i15.FsBodyComponent, typeof i16.FsFooterComponent, typeof i17.FsPaginationComponent, typeof i18.FsListColumnDirective, typeof i19.FsListCellDirective, typeof i20.FsListHeaderDirective, typeof i21.FsListFooterDirective, typeof i22.FsListGroupCellDirective, typeof i23.FsListGroupExpandTriggerDirective, typeof i24.FsListDraggableListDirective, typeof i25.FsListDraggableRowDirective, typeof i26.FsListEmptyStateDirective, typeof i27.FsListContentDirective, typeof i28.FsListContentInitDirective, typeof i29.CustomizeColsDialogComponent], [typeof i30.CommonModule, typeof i31.RouterModule, typeof i32.MatButtonModule, typeof i33.MatIconModule, typeof i34.MatMenuModule, typeof i35.MatProgressSpinnerModule, typeof i36.MatCheckboxModule, typeof i37.MatRippleModule, typeof i38.FsFilterModule, typeof i39.FsMenuModule, typeof i40.FlexLayoutModule, typeof i41.FsScrollModule, typeof i42.FsPromptModule, typeof i43.MatDialogModule, typeof i44.MatTooltipModule, typeof i45.FsFileModule], [typeof i1.FsListComponent, typeof i2.FsRowComponent, typeof i6.FsCellComponent, typeof i10.FsListLoaderComponent, typeof i18.FsListColumnDirective, typeof i19.FsListCellDirective, typeof i20.FsListHeaderDirective, typeof i21.FsListFooterDirective, typeof i22.FsListGroupCellDirective, typeof i23.FsListGroupExpandTriggerDirective, typeof i26.FsListEmptyStateDirective, typeof i27.FsListContentDirective]>;
|
|
52
53
|
static ɵinj: i0.ɵɵInjectorDeclaration<FsListModule>;
|
|
53
54
|
}
|
|
54
55
|
export declare function FsListConfigFactory(config: FsListConfig): any;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { FsListColumnDirective } from '../directives/column/column.directive';
|
|
2
|
+
export declare type FsListColumnConfig = Partial<Pick<FsListColumnDirective, 'className' | 'headerTemplate' | 'headerConfigs' | 'cellTemplate' | 'cellConfigs' | 'footerTemplate' | 'footerConfigs' | 'groupCellTemplate' | 'groupCellConfigs' | 'expandTrigger' | 'attributes'>>;
|
|
@@ -35,6 +35,7 @@ export interface FsListConfig {
|
|
|
35
35
|
actions?: FsListAction[];
|
|
36
36
|
fetch?: FsListFetchFn;
|
|
37
37
|
afterFetch?: FsListAfterFetchFn;
|
|
38
|
+
afterContentInit?: FsListAfterContentInitFn;
|
|
38
39
|
scrollable?: FsListScrollableConfig | boolean;
|
|
39
40
|
selection?: FsListSelectionConfig;
|
|
40
41
|
initialFetch?: boolean;
|
|
@@ -239,3 +240,4 @@ export declare type FsListFetchFn = (query: Record<string, any>, options: FsList
|
|
|
239
240
|
paging?: FsPaging;
|
|
240
241
|
}>;
|
|
241
242
|
export declare type FsListAfterFetchFn = (query: Record<string, any>, data: unknown[]) => void;
|
|
243
|
+
export declare type FsListAfterContentInitFn = (query: Record<string, any>, data: unknown[]) => void;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
|
+
export declare class ColumnAttributes {
|
|
3
|
+
private _title;
|
|
4
|
+
private _name;
|
|
5
|
+
private _customize;
|
|
6
|
+
private _sortable;
|
|
7
|
+
private _sortableDefault;
|
|
8
|
+
private _direction;
|
|
9
|
+
private _align;
|
|
10
|
+
private _width;
|
|
11
|
+
private _className;
|
|
12
|
+
private _visible$;
|
|
13
|
+
constructor(attrs?: {
|
|
14
|
+
[key: string]: any;
|
|
15
|
+
});
|
|
16
|
+
set title(value: string);
|
|
17
|
+
get title(): string;
|
|
18
|
+
set name(value: string);
|
|
19
|
+
get name(): string;
|
|
20
|
+
set customize(value: boolean);
|
|
21
|
+
get customize(): boolean;
|
|
22
|
+
set sortable(value: boolean);
|
|
23
|
+
get sortable(): boolean;
|
|
24
|
+
set sortableDefault(value: boolean);
|
|
25
|
+
get sortableDefault(): boolean;
|
|
26
|
+
set direction(value: 'asc' | 'desc');
|
|
27
|
+
get direction(): 'asc' | 'desc';
|
|
28
|
+
set align(value: string);
|
|
29
|
+
get align(): string;
|
|
30
|
+
set width(value: string);
|
|
31
|
+
get width(): string;
|
|
32
|
+
set className(value: string | string[]);
|
|
33
|
+
get className(): string | string[];
|
|
34
|
+
set visible(value: boolean);
|
|
35
|
+
get visible(): boolean;
|
|
36
|
+
get visible$(): Observable<boolean>;
|
|
37
|
+
private _init;
|
|
38
|
+
}
|
|
@@ -1,41 +1,46 @@
|
|
|
1
|
-
import { TemplateRef } from '@angular/core';
|
|
2
|
-
import {
|
|
1
|
+
import { QueryList, TemplateRef } from '@angular/core';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
3
|
import { StyleConfig } from './styleConfig.model';
|
|
4
|
+
import { FsListColumnConfig } from '../interfaces/column-config.interface';
|
|
5
|
+
import { FsListGroupExpandTriggerDirective } from '../directives/group-expand-trigger/group-expand-trigger.directive';
|
|
4
6
|
export declare enum SortingDirection {
|
|
5
7
|
asc = "asc",
|
|
6
8
|
desc = "desc"
|
|
7
9
|
}
|
|
8
|
-
export declare class Column
|
|
9
|
-
title: string;
|
|
10
|
-
name: string;
|
|
11
|
-
show: boolean;
|
|
12
|
-
customize: boolean;
|
|
13
|
-
width: string;
|
|
14
|
-
sortable: boolean;
|
|
15
|
-
sortableDefault: boolean;
|
|
10
|
+
export declare class Column {
|
|
16
11
|
headerTemplate: TemplateRef<any>;
|
|
17
12
|
groupCellTemplate: TemplateRef<any>;
|
|
18
13
|
cellTemplate: TemplateRef<any>;
|
|
19
14
|
footerTemplate: TemplateRef<any>;
|
|
20
|
-
expandTrigger:
|
|
21
|
-
superTriger: TemplateRef<any>;
|
|
15
|
+
expandTrigger: QueryList<FsListGroupExpandTriggerDirective>;
|
|
22
16
|
headerConfigs: StyleConfig;
|
|
23
17
|
groupCellConfigs: StyleConfig;
|
|
24
18
|
cellConfigs: StyleConfig;
|
|
25
19
|
footerConfigs: StyleConfig;
|
|
26
20
|
colStyles: StyleConfig;
|
|
27
|
-
sortingDirection: SortingDirection;
|
|
28
21
|
headerColspanned: boolean;
|
|
29
22
|
groupCellColspanned: boolean;
|
|
30
23
|
cellColspanned: boolean;
|
|
31
24
|
footerColspanned: boolean;
|
|
25
|
+
private _attributes;
|
|
32
26
|
private _ordered;
|
|
33
|
-
constructor(colConfig
|
|
27
|
+
constructor(colConfig: FsListColumnConfig, colDefaults?: any);
|
|
28
|
+
set title(value: string);
|
|
29
|
+
get title(): string;
|
|
30
|
+
get name(): string;
|
|
31
|
+
get customize(): boolean;
|
|
32
|
+
get width(): string;
|
|
33
|
+
set sortable(value: boolean);
|
|
34
|
+
get sortable(): boolean;
|
|
35
|
+
get sortableDefault(): boolean;
|
|
36
|
+
set sortingDirection(value: 'asc' | 'desc');
|
|
37
|
+
get sortingDirection(): 'asc' | 'desc';
|
|
38
|
+
get visible(): boolean;
|
|
39
|
+
get visible$(): Observable<boolean>;
|
|
34
40
|
get direction(): "desc" | "asc";
|
|
35
41
|
get fullNameDirection(): "Ascending" | "Descending";
|
|
36
42
|
get ordered(): boolean;
|
|
37
43
|
set ordered(value: boolean);
|
|
38
|
-
_fromJSON(value: any): void;
|
|
39
44
|
/**
|
|
40
45
|
* Merge with defaults with existing config
|
|
41
46
|
* @param defaults
|
|
@@ -45,4 +50,6 @@ export declare class Column extends Model {
|
|
|
45
50
|
* Change sorting direction
|
|
46
51
|
*/
|
|
47
52
|
changeDirection(): void;
|
|
53
|
+
updateVisibility(value: boolean): void;
|
|
54
|
+
private _parseConfig;
|
|
48
55
|
}
|