@smallpearl/ngx-helper 0.29.23 → 0.29.26
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/fesm2022/smallpearl-ngx-helper-mat-entity-crud.mjs +75 -26
- package/fesm2022/smallpearl-ngx-helper-mat-entity-crud.mjs.map +1 -1
- package/fesm2022/smallpearl-ngx-helper-mat-entity-list.mjs +99 -23
- package/fesm2022/smallpearl-ngx-helper-mat-entity-list.mjs.map +1 -1
- package/mat-entity-crud/src/mat-entity-crud-internal-types.d.ts +9 -0
- package/mat-entity-crud/src/mat-entity-crud.component.d.ts +8 -1
- package/mat-entity-crud/src/preview-pane.component.d.ts +13 -8
- package/mat-entity-list/src/mat-entity-list.component.d.ts +45 -4
- package/package.json +16 -16
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { HttpClient, HttpContext, HttpContextToken } from '@angular/common/http';
|
|
1
|
+
import { HttpClient, HttpContext, HttpContextToken, HttpParams } from '@angular/common/http';
|
|
2
2
|
import { AfterViewInit, ElementRef, EventEmitter, Injector, OnDestroy, OnInit, QueryList } from '@angular/core';
|
|
3
3
|
import { PageEvent } from '@angular/material/paginator';
|
|
4
4
|
import { MatSort } from '@angular/material/sort';
|
|
5
5
|
import { MatColumnDef, MatTable, MatTableDataSource } from '@angular/material/table';
|
|
6
6
|
import { DomSanitizer } from '@angular/platform-browser';
|
|
7
7
|
import { SPEntityField, SPEntityFieldSpec } from '@smallpearl/ngx-helper/entity-field';
|
|
8
|
-
import { Observable, Subscription } from 'rxjs';
|
|
8
|
+
import { Observable, Subject, Subscription } from 'rxjs';
|
|
9
9
|
import { SPMatEntityListEntityLoaderFn, SPMatEntityListPaginator } from './mat-entity-list-types';
|
|
10
10
|
import * as i0 from "@angular/core";
|
|
11
11
|
export declare class HeaderAlignmentDirective implements AfterViewInit {
|
|
@@ -16,6 +16,18 @@ export declare class HeaderAlignmentDirective implements AfterViewInit {
|
|
|
16
16
|
static ɵfac: i0.ɵɵFactoryDeclaration<HeaderAlignmentDirective, never>;
|
|
17
17
|
static ɵdir: i0.ɵɵDirectiveDeclaration<HeaderAlignmentDirective, "[headerAlignment]", never, { "headerAlignment": { "alias": "headerAlignment"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
18
18
|
}
|
|
19
|
+
/**
|
|
20
|
+
* Represents a request to load entities from the remote. This is used to
|
|
21
|
+
* compare two requests to determine if they are equal. This is useful to
|
|
22
|
+
* prevent duplicate requests being sent to the remote.
|
|
23
|
+
*/
|
|
24
|
+
declare class LoadRequest {
|
|
25
|
+
endpoint: string;
|
|
26
|
+
params: HttpParams;
|
|
27
|
+
force: boolean;
|
|
28
|
+
constructor(endpoint: string, params: HttpParams, force?: boolean);
|
|
29
|
+
isEqualToAndNotForced(prev: LoadRequest): boolean;
|
|
30
|
+
}
|
|
19
31
|
/**
|
|
20
32
|
* A component to display a list of entities loaded from remote.
|
|
21
33
|
*/
|
|
@@ -122,6 +134,7 @@ export declare class SPMatEntityListComponent<TEntity extends {
|
|
|
122
134
|
clientColumnDefs: QueryList<MatColumnDef>;
|
|
123
135
|
contentColumnDefs: MatColumnDef[];
|
|
124
136
|
subs$: Subscription;
|
|
137
|
+
destroy$: Subject<void>;
|
|
125
138
|
entityCount: import("@angular/core").WritableSignal<number>;
|
|
126
139
|
pageIndex: import("@angular/core").WritableSignal<number>;
|
|
127
140
|
lastFetchedEntitiesCount: import("@angular/core").WritableSignal<number>;
|
|
@@ -153,6 +166,12 @@ export declare class SPMatEntityListComponent<TEntity extends {
|
|
|
153
166
|
ngxHelperConfig: import("@smallpearl/ngx-helper/core").SPNgxHelperConfig;
|
|
154
167
|
fieldConfig: import("@smallpearl/ngx-helper/entity-field").SPEntityFieldConfig;
|
|
155
168
|
entityListConfig: import("./mat-entity-list-types").SPMatEntityListConfig;
|
|
169
|
+
/**
|
|
170
|
+
* A signal that can be used to trigger loading of more entities from the
|
|
171
|
+
* remote. This can be visualized as the event loop of the entity list
|
|
172
|
+
* component.
|
|
173
|
+
*/
|
|
174
|
+
loadRequest$: Subject<LoadRequest>;
|
|
156
175
|
endpointChanged: import("@angular/core").EffectRef;
|
|
157
176
|
constructor(http: HttpClient, sanitizer: DomSanitizer, injector: Injector);
|
|
158
177
|
ngOnInit(): void;
|
|
@@ -162,7 +181,7 @@ export declare class SPMatEntityListComponent<TEntity extends {
|
|
|
162
181
|
* Clear all entities in store and reload them from endpoint as if
|
|
163
182
|
* the entities are being loaded for the first time.
|
|
164
183
|
*/
|
|
165
|
-
refresh(): void;
|
|
184
|
+
refresh(force?: boolean): void;
|
|
166
185
|
addEntity(entity: TEntity): void;
|
|
167
186
|
/**
|
|
168
187
|
* Update an entity with a modified version. Can be used by CRUD UPDATE
|
|
@@ -199,7 +218,28 @@ export declare class SPMatEntityListComponent<TEntity extends {
|
|
|
199
218
|
buildColumns(): void;
|
|
200
219
|
setupSort(): void;
|
|
201
220
|
infiniteScrollLoadNextPage(ev: any): void;
|
|
202
|
-
loadMoreEntities(): void;
|
|
221
|
+
loadMoreEntities(forceRefresh?: boolean): void;
|
|
222
|
+
/**
|
|
223
|
+
* Creates a LoadRequest object for loading entities using the current state
|
|
224
|
+
* of the component. Therefore, if the request is for next page of entities,
|
|
225
|
+
* the LoadRequest object will have the updated page index. However, if
|
|
226
|
+
* pagination has been reset (refer to refresh()), the LoadRequest object
|
|
227
|
+
* will be for the first page of data. Note that when 'endpoint' value
|
|
228
|
+
* changes, the component's pagination state is reset causing a refresh()
|
|
229
|
+
* to be called, which in turn will create a new LoadRequest object for the
|
|
230
|
+
* first page of data.
|
|
231
|
+
* @returns LoadRequest object for the next load request.
|
|
232
|
+
*/
|
|
233
|
+
private createNextLoadRequest;
|
|
234
|
+
/**
|
|
235
|
+
* Does the actual load of entities from the remote or via calling the
|
|
236
|
+
* entityLoaderFn. This method is the workhorse of the entity list
|
|
237
|
+
* 'loader-loop'.
|
|
238
|
+
* @param lr
|
|
239
|
+
* @returns Observable that emits the response from the remote or from
|
|
240
|
+
* entityLoaderFn().
|
|
241
|
+
*/
|
|
242
|
+
private doActualLoad;
|
|
203
243
|
private findArrayInResult;
|
|
204
244
|
handlePageEvent(e: PageEvent): void;
|
|
205
245
|
getUrl(endpoint: string): string;
|
|
@@ -207,3 +247,4 @@ export declare class SPMatEntityListComponent<TEntity extends {
|
|
|
207
247
|
static ɵfac: i0.ɵɵFactoryDeclaration<SPMatEntityListComponent<any, any>, never>;
|
|
208
248
|
static ɵcmp: i0.ɵɵComponentDeclaration<SPMatEntityListComponent<any, any>, "sp-mat-entity-list", never, { "entityName": { "alias": "entityName"; "required": true; "isSignal": true; }; "entityNamePlural": { "alias": "entityNamePlural"; "required": false; "isSignal": true; }; "endpoint": { "alias": "endpoint"; "required": false; "isSignal": true; }; "entityLoaderFn": { "alias": "entityLoaderFn"; "required": false; "isSignal": true; }; "columns": { "alias": "columns"; "required": true; "isSignal": true; }; "displayedColumns": { "alias": "displayedColumns"; "required": false; "isSignal": true; }; "pageSize": { "alias": "pageSize"; "required": false; "isSignal": true; }; "idKey": { "alias": "idKey"; "required": false; "isSignal": true; }; "pagination": { "alias": "pagination"; "required": false; "isSignal": true; }; "paginator": { "alias": "paginator"; "required": false; "isSignal": true; }; "sorter": { "alias": "sorter"; "required": false; "isSignal": true; }; "disableSort": { "alias": "disableSort"; "required": false; "isSignal": true; }; "infiniteScrollContainer": { "alias": "infiniteScrollContainer"; "required": false; "isSignal": true; }; "infiniteScrollDistance": { "alias": "infiniteScrollDistance"; "required": false; "isSignal": true; }; "infiniteScrollThrottle": { "alias": "infiniteScrollThrottle"; "required": false; "isSignal": true; }; "infiniteScrollWindow": { "alias": "infiniteScrollWindow"; "required": false; "isSignal": true; }; "httpReqContext": { "alias": "httpReqContext"; "required": false; "isSignal": true; }; "_deferViewInit": { "alias": "_deferViewInit"; "required": false; "isSignal": true; }; }, { "selectEntity": "selectEntity"; }, ["clientColumnDefs"], never, true, never>;
|
|
209
249
|
}
|
|
250
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@smallpearl/ngx-helper",
|
|
3
|
-
"version": "0.29.
|
|
3
|
+
"version": "0.29.26",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@angular/common": "^19.1.0",
|
|
6
6
|
"@angular/core": "^19.1.0",
|
|
@@ -54,26 +54,26 @@
|
|
|
54
54
|
"types": "./entity-field/index.d.ts",
|
|
55
55
|
"default": "./fesm2022/smallpearl-ngx-helper-entity-field.mjs"
|
|
56
56
|
},
|
|
57
|
-
"./
|
|
58
|
-
"types": "./
|
|
59
|
-
"default": "./fesm2022/smallpearl-ngx-helper-
|
|
57
|
+
"./forms": {
|
|
58
|
+
"types": "./forms/index.d.ts",
|
|
59
|
+
"default": "./fesm2022/smallpearl-ngx-helper-forms.mjs"
|
|
60
|
+
},
|
|
61
|
+
"./mat-context-menu": {
|
|
62
|
+
"types": "./mat-context-menu/index.d.ts",
|
|
63
|
+
"default": "./fesm2022/smallpearl-ngx-helper-mat-context-menu.mjs"
|
|
60
64
|
},
|
|
61
65
|
"./locale": {
|
|
62
66
|
"types": "./locale/index.d.ts",
|
|
63
67
|
"default": "./fesm2022/smallpearl-ngx-helper-locale.mjs"
|
|
64
68
|
},
|
|
69
|
+
"./hover-dropdown": {
|
|
70
|
+
"types": "./hover-dropdown/index.d.ts",
|
|
71
|
+
"default": "./fesm2022/smallpearl-ngx-helper-hover-dropdown.mjs"
|
|
72
|
+
},
|
|
65
73
|
"./mat-busy-wheel": {
|
|
66
74
|
"types": "./mat-busy-wheel/index.d.ts",
|
|
67
75
|
"default": "./fesm2022/smallpearl-ngx-helper-mat-busy-wheel.mjs"
|
|
68
76
|
},
|
|
69
|
-
"./mat-context-menu": {
|
|
70
|
-
"types": "./mat-context-menu/index.d.ts",
|
|
71
|
-
"default": "./fesm2022/smallpearl-ngx-helper-mat-context-menu.mjs"
|
|
72
|
-
},
|
|
73
|
-
"./forms": {
|
|
74
|
-
"types": "./forms/index.d.ts",
|
|
75
|
-
"default": "./fesm2022/smallpearl-ngx-helper-forms.mjs"
|
|
76
|
-
},
|
|
77
77
|
"./mat-entity-crud": {
|
|
78
78
|
"types": "./mat-entity-crud/index.d.ts",
|
|
79
79
|
"default": "./fesm2022/smallpearl-ngx-helper-mat-entity-crud.mjs"
|
|
@@ -98,14 +98,14 @@
|
|
|
98
98
|
"types": "./mat-side-menu-layout/index.d.ts",
|
|
99
99
|
"default": "./fesm2022/smallpearl-ngx-helper-mat-side-menu-layout.mjs"
|
|
100
100
|
},
|
|
101
|
-
"./mat-tel-input": {
|
|
102
|
-
"types": "./mat-tel-input/index.d.ts",
|
|
103
|
-
"default": "./fesm2022/smallpearl-ngx-helper-mat-tel-input.mjs"
|
|
104
|
-
},
|
|
105
101
|
"./sideload": {
|
|
106
102
|
"types": "./sideload/index.d.ts",
|
|
107
103
|
"default": "./fesm2022/smallpearl-ngx-helper-sideload.mjs"
|
|
108
104
|
},
|
|
105
|
+
"./mat-tel-input": {
|
|
106
|
+
"types": "./mat-tel-input/index.d.ts",
|
|
107
|
+
"default": "./fesm2022/smallpearl-ngx-helper-mat-tel-input.mjs"
|
|
108
|
+
},
|
|
109
109
|
"./stationary-with-line-items": {
|
|
110
110
|
"types": "./stationary-with-line-items/index.d.ts",
|
|
111
111
|
"default": "./fesm2022/smallpearl-ngx-helper-stationary-with-line-items.mjs"
|