@masterteam/components 0.0.215 → 0.0.217
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/README.md +70 -70
- package/fesm2022/masterteam-components-business-fields.mjs +6 -6
- package/fesm2022/masterteam-components-business-fields.mjs.map +1 -1
- package/fesm2022/masterteam-components-drawer.mjs +2 -2
- package/fesm2022/masterteam-components-drawer.mjs.map +1 -1
- package/fesm2022/masterteam-components-dynamic-drawer.mjs.map +1 -1
- package/fesm2022/masterteam-components-entities.mjs +14 -14
- package/fesm2022/masterteam-components-entities.mjs.map +1 -1
- package/fesm2022/masterteam-components-field-validation.mjs.map +1 -1
- package/fesm2022/masterteam-components-formula.mjs +2 -2
- package/fesm2022/masterteam-components-formula.mjs.map +1 -1
- package/fesm2022/masterteam-components-icon-field.mjs.map +1 -1
- package/fesm2022/masterteam-components-location-field.mjs +2 -2
- package/fesm2022/masterteam-components-location-field.mjs.map +1 -1
- package/fesm2022/masterteam-components-number-field.mjs +2 -2
- package/fesm2022/masterteam-components-number-field.mjs.map +1 -1
- package/fesm2022/masterteam-components-radio-cards-field.mjs +2 -2
- package/fesm2022/masterteam-components-radio-cards-field.mjs.map +1 -1
- package/fesm2022/masterteam-components-runtime-action.mjs.map +1 -1
- package/fesm2022/masterteam-components-table.mjs +142 -46
- package/fesm2022/masterteam-components-table.mjs.map +1 -1
- package/fesm2022/masterteam-components-text-field.mjs +2 -2
- package/fesm2022/masterteam-components-text-field.mjs.map +1 -1
- package/fesm2022/masterteam-components-textarea-field.mjs +2 -2
- package/fesm2022/masterteam-components-textarea-field.mjs.map +1 -1
- package/fesm2022/masterteam-components-toggle-field.mjs +2 -2
- package/fesm2022/masterteam-components-toggle-field.mjs.map +1 -1
- package/fesm2022/masterteam-components-treeselect-field.mjs +2 -2
- package/fesm2022/masterteam-components-treeselect-field.mjs.map +1 -1
- package/fesm2022/masterteam-components.mjs +3 -3
- package/fesm2022/masterteam-components.mjs.map +1 -1
- package/package.json +1 -1
- package/types/masterteam-components-table.d.ts +18 -2
- package/types/masterteam-components.d.ts +19 -18
package/package.json
CHANGED
|
@@ -83,6 +83,16 @@ type TableActionShape = 'flat' | 'popover';
|
|
|
83
83
|
* Add new modes here + a matching branch in the table header template.
|
|
84
84
|
*/
|
|
85
85
|
type TableFilterMode = 'popover' | 'column';
|
|
86
|
+
/**
|
|
87
|
+
* Keys that can be excluded from mt-table storage persistence.
|
|
88
|
+
*
|
|
89
|
+
* - `pageSize`: selected rows-per-page value.
|
|
90
|
+
* - `pagePosition`: current page / first row offset.
|
|
91
|
+
* - `sort`: sort field and direction.
|
|
92
|
+
* - `selection`: selected row keys.
|
|
93
|
+
* - `groupBy`: active grouped column.
|
|
94
|
+
*/
|
|
95
|
+
type TablePersistStateKey = 'pageSize' | 'pagePosition' | 'sort' | 'selection' | 'groupBy';
|
|
86
96
|
/**
|
|
87
97
|
* Injected value resolver for export/print — caller decides how a cell value
|
|
88
98
|
* becomes a scalar for Excel/PDF output. Keeps TableExportService
|
|
@@ -227,6 +237,7 @@ declare class Table {
|
|
|
227
237
|
dataKey: _angular_core.InputSignal<string | undefined>;
|
|
228
238
|
storageKey: _angular_core.InputSignal<string | null>;
|
|
229
239
|
storageMode: _angular_core.InputSignal<"local" | "session">;
|
|
240
|
+
persistStateExclude: _angular_core.InputSignal<TablePersistStateKey[]>;
|
|
230
241
|
exportable: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
231
242
|
printable: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
232
243
|
groupable: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
@@ -310,6 +321,8 @@ declare class Table {
|
|
|
310
321
|
*/
|
|
311
322
|
protected groupKeyedData: _angular_core.Signal<any[]>;
|
|
312
323
|
protected totalRecords: _angular_core.Signal<number>;
|
|
324
|
+
protected usesVirtualScroll: _angular_core.Signal<boolean>;
|
|
325
|
+
protected showPaginator: _angular_core.Signal<boolean>;
|
|
313
326
|
protected paginatedData: _angular_core.Signal<any[]>;
|
|
314
327
|
protected allSelectedOnPage: _angular_core.Signal<boolean>;
|
|
315
328
|
protected totalColumnSpan: _angular_core.Signal<number>;
|
|
@@ -415,13 +428,16 @@ declare class Table {
|
|
|
415
428
|
private buildPersistedState;
|
|
416
429
|
private applyPersistedState;
|
|
417
430
|
private shouldEmitLazyLoadAfterRestore;
|
|
431
|
+
private shouldPersistStateKey;
|
|
418
432
|
private readPersistedState;
|
|
433
|
+
private getRestorablePersistedState;
|
|
419
434
|
private writePersistedState;
|
|
420
435
|
private toPositiveInteger;
|
|
421
436
|
private normalizePersistedPageSize;
|
|
437
|
+
private resolveScrollHeightPixels;
|
|
422
438
|
private toNonNegativeInteger;
|
|
423
439
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<Table, never>;
|
|
424
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<Table, "mt-table", never, { "filters": { "alias": "filters"; "required": false; "isSignal": true; }; "data": { "alias": "data"; "required": true; "isSignal": true; }; "columns": { "alias": "columns"; "required": true; "isSignal": true; }; "rowActions": { "alias": "rowActions"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "showGridlines": { "alias": "showGridlines"; "required": false; "isSignal": true; }; "stripedRows": { "alias": "stripedRows"; "required": false; "isSignal": true; }; "selectableRows": { "alias": "selectableRows"; "required": false; "isSignal": true; }; "clickableRows": { "alias": "clickableRows"; "required": false; "isSignal": true; }; "generalSearch": { "alias": "generalSearch"; "required": false; "isSignal": true; }; "lazyLocalSearch": { "alias": "lazyLocalSearch"; "required": false; "isSignal": true; }; "showFilters": { "alias": "showFilters"; "required": false; "isSignal": true; }; "filterMode": { "alias": "filterMode"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "updating": { "alias": "updating"; "required": false; "isSignal": true; }; "lazy": { "alias": "lazy"; "required": false; "isSignal": true; }; "lazyLocalSort": { "alias": "lazyLocalSort"; "required": false; "isSignal": true; }; "lazyTotalRecords": { "alias": "lazyTotalRecords"; "required": false; "isSignal": true; }; "reorderableColumns": { "alias": "reorderableColumns"; "required": false; "isSignal": true; }; "reorderableRows": { "alias": "reorderableRows"; "required": false; "isSignal": true; }; "dataKey": { "alias": "dataKey"; "required": false; "isSignal": true; }; "storageKey": { "alias": "storageKey"; "required": false; "isSignal": true; }; "storageMode": { "alias": "storageMode"; "required": false; "isSignal": true; }; "exportable": { "alias": "exportable"; "required": false; "isSignal": true; }; "printable": { "alias": "printable"; "required": false; "isSignal": true; }; "groupable": { "alias": "groupable"; "required": false; "isSignal": true; }; "groupCountMap": { "alias": "groupCountMap"; "required": false; "isSignal": true; }; "cellClickFilter": { "alias": "cellClickFilter"; "required": false; "isSignal": true; }; "freezeActions": { "alias": "freezeActions"; "required": false; "isSignal": true; }; "virtualScroll": { "alias": "virtualScroll"; "required": false; "isSignal": true; }; "virtualScrollItemSize": { "alias": "virtualScrollItemSize"; "required": false; "isSignal": true; }; "scrollHeight": { "alias": "scrollHeight"; "required": false; "isSignal": true; }; "printTitle": { "alias": "printTitle"; "required": false; "isSignal": true; }; "exportFilename": { "alias": "exportFilename"; "required": false; "isSignal": true; }; "actionShape": { "alias": "actionShape"; "required": false; "isSignal": true; }; "rowActionsLoadingFn": { "alias": "rowActionsLoadingFn"; "required": false; "isSignal": true; }; "tableLayout": { "alias": "tableLayout"; "required": false; "isSignal": true; }; "noCard": { "alias": "noCard"; "required": false; "isSignal": true; }; "tabs": { "alias": "tabs"; "required": false; "isSignal": true; }; "tabsOptionLabel": { "alias": "tabsOptionLabel"; "required": false; "isSignal": true; }; "tabsOptionValue": { "alias": "tabsOptionValue"; "required": false; "isSignal": true; }; "activeTab": { "alias": "activeTab"; "required": false; "isSignal": true; }; "actions": { "alias": "actions"; "required": false; "isSignal": true; }; "paginatorPosition": { "alias": "paginatorPosition"; "required": false; "isSignal": true; }; "alwaysShowPaginator": { "alias": "alwaysShowPaginator"; "required": false; "isSignal": true; }; "rowsPerPageOptions": { "alias": "rowsPerPageOptions"; "required": false; "isSignal": true; }; "pageSize": { "alias": "pageSize"; "required": false; "isSignal": true; }; "currentPage": { "alias": "currentPage"; "required": false; "isSignal": true; }; "first": { "alias": "first"; "required": false; "isSignal": true; }; "filterTerm": { "alias": "filterTerm"; "required": false; "isSignal": true; }; "groupBy": { "alias": "groupBy"; "required": false; "isSignal": true; }; }, { "selectionChange": "selectionChange"; "cellChange": "cellChange"; "lazyLoad": "lazyLoad"; "columnReorder": "columnReorder"; "rowReorder": "rowReorder"; "rowClick": "rowClick"; "rowActionsRequested": "rowActionsRequested"; "filters": "filtersChange"; "activeTab": "activeTabChange"; "onTabChange": "onTabChange"; "pageSize": "pageSizeChange"; "currentPage": "currentPageChange"; "first": "firstChange"; "filterTerm": "filterTermChange"; "groupBy": "groupByChange"; }, ["captionStartContent", "captionEndContent", "emptyContent"], never, true, never>;
|
|
440
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<Table, "mt-table", never, { "filters": { "alias": "filters"; "required": false; "isSignal": true; }; "data": { "alias": "data"; "required": true; "isSignal": true; }; "columns": { "alias": "columns"; "required": true; "isSignal": true; }; "rowActions": { "alias": "rowActions"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "showGridlines": { "alias": "showGridlines"; "required": false; "isSignal": true; }; "stripedRows": { "alias": "stripedRows"; "required": false; "isSignal": true; }; "selectableRows": { "alias": "selectableRows"; "required": false; "isSignal": true; }; "clickableRows": { "alias": "clickableRows"; "required": false; "isSignal": true; }; "generalSearch": { "alias": "generalSearch"; "required": false; "isSignal": true; }; "lazyLocalSearch": { "alias": "lazyLocalSearch"; "required": false; "isSignal": true; }; "showFilters": { "alias": "showFilters"; "required": false; "isSignal": true; }; "filterMode": { "alias": "filterMode"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "updating": { "alias": "updating"; "required": false; "isSignal": true; }; "lazy": { "alias": "lazy"; "required": false; "isSignal": true; }; "lazyLocalSort": { "alias": "lazyLocalSort"; "required": false; "isSignal": true; }; "lazyTotalRecords": { "alias": "lazyTotalRecords"; "required": false; "isSignal": true; }; "reorderableColumns": { "alias": "reorderableColumns"; "required": false; "isSignal": true; }; "reorderableRows": { "alias": "reorderableRows"; "required": false; "isSignal": true; }; "dataKey": { "alias": "dataKey"; "required": false; "isSignal": true; }; "storageKey": { "alias": "storageKey"; "required": false; "isSignal": true; }; "storageMode": { "alias": "storageMode"; "required": false; "isSignal": true; }; "persistStateExclude": { "alias": "persistStateExclude"; "required": false; "isSignal": true; }; "exportable": { "alias": "exportable"; "required": false; "isSignal": true; }; "printable": { "alias": "printable"; "required": false; "isSignal": true; }; "groupable": { "alias": "groupable"; "required": false; "isSignal": true; }; "groupCountMap": { "alias": "groupCountMap"; "required": false; "isSignal": true; }; "cellClickFilter": { "alias": "cellClickFilter"; "required": false; "isSignal": true; }; "freezeActions": { "alias": "freezeActions"; "required": false; "isSignal": true; }; "virtualScroll": { "alias": "virtualScroll"; "required": false; "isSignal": true; }; "virtualScrollItemSize": { "alias": "virtualScrollItemSize"; "required": false; "isSignal": true; }; "scrollHeight": { "alias": "scrollHeight"; "required": false; "isSignal": true; }; "printTitle": { "alias": "printTitle"; "required": false; "isSignal": true; }; "exportFilename": { "alias": "exportFilename"; "required": false; "isSignal": true; }; "actionShape": { "alias": "actionShape"; "required": false; "isSignal": true; }; "rowActionsLoadingFn": { "alias": "rowActionsLoadingFn"; "required": false; "isSignal": true; }; "tableLayout": { "alias": "tableLayout"; "required": false; "isSignal": true; }; "noCard": { "alias": "noCard"; "required": false; "isSignal": true; }; "tabs": { "alias": "tabs"; "required": false; "isSignal": true; }; "tabsOptionLabel": { "alias": "tabsOptionLabel"; "required": false; "isSignal": true; }; "tabsOptionValue": { "alias": "tabsOptionValue"; "required": false; "isSignal": true; }; "activeTab": { "alias": "activeTab"; "required": false; "isSignal": true; }; "actions": { "alias": "actions"; "required": false; "isSignal": true; }; "paginatorPosition": { "alias": "paginatorPosition"; "required": false; "isSignal": true; }; "alwaysShowPaginator": { "alias": "alwaysShowPaginator"; "required": false; "isSignal": true; }; "rowsPerPageOptions": { "alias": "rowsPerPageOptions"; "required": false; "isSignal": true; }; "pageSize": { "alias": "pageSize"; "required": false; "isSignal": true; }; "currentPage": { "alias": "currentPage"; "required": false; "isSignal": true; }; "first": { "alias": "first"; "required": false; "isSignal": true; }; "filterTerm": { "alias": "filterTerm"; "required": false; "isSignal": true; }; "groupBy": { "alias": "groupBy"; "required": false; "isSignal": true; }; }, { "selectionChange": "selectionChange"; "cellChange": "cellChange"; "lazyLoad": "lazyLoad"; "columnReorder": "columnReorder"; "rowReorder": "rowReorder"; "rowClick": "rowClick"; "rowActionsRequested": "rowActionsRequested"; "filters": "filtersChange"; "activeTab": "activeTabChange"; "onTabChange": "onTabChange"; "pageSize": "pageSizeChange"; "currentPage": "currentPageChange"; "first": "firstChange"; "filterTerm": "filterTermChange"; "groupBy": "groupByChange"; }, ["captionStartContent", "captionEndContent", "emptyContent"], never, true, never>;
|
|
425
441
|
}
|
|
426
442
|
|
|
427
443
|
type TableEntityUsage = 'sort' | 'export' | 'filter';
|
|
@@ -708,4 +724,4 @@ declare class TableExportService {
|
|
|
708
724
|
}
|
|
709
725
|
|
|
710
726
|
export { Table, TableActionsMenu, TableCaption, TableColumnFilter, TableExportService, TableFilter, TableFilterField, TableGroupingController, TableValueResolver };
|
|
711
|
-
export type { CellChangeEvent, ColumnDef, ColumnType, ColumnTypeForActionCell, FilterConfig, FilterOption, FilterValue, TableAction, TableActionConfirmationConfig, TableActionShape, TableEntityUsage, TableExportConfig, TableExportValueResolver, TableFilterMode, TableFilters, TablePrintConfig, TableStatusMapValue };
|
|
727
|
+
export type { CellChangeEvent, ColumnDef, ColumnType, ColumnTypeForActionCell, FilterConfig, FilterOption, FilterValue, TableAction, TableActionConfirmationConfig, TableActionShape, TableEntityUsage, TableExportConfig, TableExportValueResolver, TableFilterMode, TableFilters, TablePersistStateKey, TablePrintConfig, TableStatusMapValue };
|
|
@@ -751,10 +751,10 @@ interface LoadingStateShape<L extends string = string> {
|
|
|
751
751
|
loadingActive: L[];
|
|
752
752
|
errors: Partial<Record<L, string>>;
|
|
753
753
|
}
|
|
754
|
-
type LoadingName<T extends LoadingStateShape<string>> = T['loadingActive'][number];
|
|
755
|
-
declare function startLoading<T extends LoadingStateShape<string>>(ctx: StateContext<T>, loadingName: LoadingName<T>): void;
|
|
756
|
-
declare function endLoading<T extends LoadingStateShape<string>>(ctx: StateContext<T>, loadingName: LoadingName<T>): void;
|
|
757
|
-
declare function setLoadingError<T extends LoadingStateShape<string>>(ctx: StateContext<T>, loadingName: LoadingName<T>, message: string): void;
|
|
754
|
+
type LoadingName$1<T extends LoadingStateShape<string>> = T['loadingActive'][number];
|
|
755
|
+
declare function startLoading<T extends LoadingStateShape<string>>(ctx: StateContext<T>, loadingName: LoadingName$1<T>): void;
|
|
756
|
+
declare function endLoading<T extends LoadingStateShape<string>>(ctx: StateContext<T>, loadingName: LoadingName$1<T>): void;
|
|
757
|
+
declare function setLoadingError<T extends LoadingStateShape<string>>(ctx: StateContext<T>, loadingName: LoadingName$1<T>, message: string): void;
|
|
758
758
|
|
|
759
759
|
interface Response<T> {
|
|
760
760
|
endpoint: string;
|
|
@@ -766,8 +766,8 @@ interface Response<T> {
|
|
|
766
766
|
data: T;
|
|
767
767
|
cacheSession?: string;
|
|
768
768
|
}
|
|
769
|
-
interface CrudLoadConfig<T, TState, TData = T[]> {
|
|
770
|
-
key:
|
|
769
|
+
interface CrudLoadConfig<T, TState, TLoad extends string, TData = T[]> {
|
|
770
|
+
key: TLoad;
|
|
771
771
|
request$: Observable<Response<TData>>;
|
|
772
772
|
stateProperty?: (state: TState) => T[];
|
|
773
773
|
/**
|
|
@@ -783,8 +783,8 @@ interface CrudLoadConfig<T, TState, TData = T[]> {
|
|
|
783
783
|
onError?: (error: any, state: TState) => Partial<TState> | void;
|
|
784
784
|
errorMessage?: string;
|
|
785
785
|
}
|
|
786
|
-
interface CrudCreateConfig<T, TState> {
|
|
787
|
-
key:
|
|
786
|
+
interface CrudCreateConfig<T, TState, TLoad extends string> {
|
|
787
|
+
key: TLoad;
|
|
788
788
|
request$: Observable<Response<T>>;
|
|
789
789
|
stateProperty: (state: TState) => T[];
|
|
790
790
|
/**
|
|
@@ -800,8 +800,8 @@ interface CrudCreateConfig<T, TState> {
|
|
|
800
800
|
onError?: (error: any, state: TState) => Partial<TState> | void;
|
|
801
801
|
errorMessage?: string;
|
|
802
802
|
}
|
|
803
|
-
interface CrudUpdateConfig<T, TState> {
|
|
804
|
-
key:
|
|
803
|
+
interface CrudUpdateConfig<T, TState, TLoad extends string> {
|
|
804
|
+
key: TLoad;
|
|
805
805
|
request$: Observable<Response<T>>;
|
|
806
806
|
uniqueKey: keyof T;
|
|
807
807
|
id: string | number;
|
|
@@ -819,8 +819,8 @@ interface CrudUpdateConfig<T, TState> {
|
|
|
819
819
|
onError?: (error: any, state: TState) => Partial<TState> | void;
|
|
820
820
|
errorMessage?: string;
|
|
821
821
|
}
|
|
822
|
-
interface CrudDeleteConfig<T, TState> {
|
|
823
|
-
key:
|
|
822
|
+
interface CrudDeleteConfig<T, TState, TLoad extends string> {
|
|
823
|
+
key: TLoad;
|
|
824
824
|
request$: Observable<Response<void>>;
|
|
825
825
|
uniqueKey: keyof T;
|
|
826
826
|
id: string | number;
|
|
@@ -859,19 +859,19 @@ declare abstract class CrudStateBase<T, TState extends LoadingStateShape<TLoad>,
|
|
|
859
859
|
* }),
|
|
860
860
|
* });
|
|
861
861
|
*/
|
|
862
|
-
protected load<TData = T[]>(ctx: StateContext<TState>, config: CrudLoadConfig<T, TState, TData>): Observable<Response<TData>>;
|
|
862
|
+
protected load<TData = T[]>(ctx: StateContext<TState>, config: CrudLoadConfig<T, TState, TLoad, TData>): Observable<Response<TData>>;
|
|
863
863
|
/**
|
|
864
864
|
* Create one entity with config object
|
|
865
865
|
*/
|
|
866
|
-
protected create(ctx: StateContext<TState>, config: CrudCreateConfig<T, TState>): Observable<Response<T>>;
|
|
866
|
+
protected create(ctx: StateContext<TState>, config: CrudCreateConfig<T, TState, TLoad>): Observable<Response<T>>;
|
|
867
867
|
/**
|
|
868
868
|
* Update one entity with config object
|
|
869
869
|
*/
|
|
870
|
-
protected update(ctx: StateContext<TState>, config: CrudUpdateConfig<T, TState>): Observable<Response<T>>;
|
|
870
|
+
protected update(ctx: StateContext<TState>, config: CrudUpdateConfig<T, TState, TLoad>): Observable<Response<T>>;
|
|
871
871
|
/**
|
|
872
872
|
* Delete one entity with config object
|
|
873
873
|
*/
|
|
874
|
-
protected delete(ctx: StateContext<TState>, config: CrudDeleteConfig<T, TState>): Observable<Response<void>>;
|
|
874
|
+
protected delete(ctx: StateContext<TState>, config: CrudDeleteConfig<T, TState, TLoad>): Observable<Response<void>>;
|
|
875
875
|
}
|
|
876
876
|
|
|
877
877
|
type TailwindColorPalette = {
|
|
@@ -896,9 +896,10 @@ declare function generateTailwindPalette(baseColorHex: string, baseColorShade?:
|
|
|
896
896
|
|
|
897
897
|
declare function isInvalid(control: AbstractControl | null): boolean;
|
|
898
898
|
|
|
899
|
-
|
|
899
|
+
type LoadingName<TState extends LoadingStateShape<string>> = TState['loadingActive'][number];
|
|
900
|
+
interface ApiRequestConfig<TState extends LoadingStateShape<string>, TResponse> {
|
|
900
901
|
ctx: StateContext<TState>;
|
|
901
|
-
key:
|
|
902
|
+
key: LoadingName<TState>;
|
|
902
903
|
request$: Observable<TResponse>;
|
|
903
904
|
onSuccess: (response: TResponse, state: TState) => Partial<TState> | void;
|
|
904
905
|
onError?: (error: any, state: TState) => Partial<TState> | void;
|