@smallpearl/ngx-helper 0.33.49 → 20.0.2
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/core/index.d.ts +3 -1
- package/entities/index.d.ts +313 -2
- package/entity-field/index.d.ts +101 -2
- package/fesm2022/smallpearl-ngx-helper-entities.mjs +18 -18
- package/fesm2022/smallpearl-ngx-helper-entities.mjs.map +1 -1
- package/fesm2022/smallpearl-ngx-helper-entity-field.mjs +5 -4
- package/fesm2022/smallpearl-ngx-helper-entity-field.mjs.map +1 -1
- package/fesm2022/smallpearl-ngx-helper-forms.mjs.map +1 -1
- package/fesm2022/smallpearl-ngx-helper-hover-dropdown.mjs +6 -6
- package/fesm2022/smallpearl-ngx-helper-hover-dropdown.mjs.map +1 -1
- package/fesm2022/smallpearl-ngx-helper-locale.mjs +6 -6
- package/fesm2022/smallpearl-ngx-helper-locale.mjs.map +1 -1
- package/fesm2022/smallpearl-ngx-helper-mat-busy-wheel.mjs +57 -31
- package/fesm2022/smallpearl-ngx-helper-mat-busy-wheel.mjs.map +1 -1
- package/fesm2022/smallpearl-ngx-helper-mat-context-menu.mjs +15 -15
- package/fesm2022/smallpearl-ngx-helper-mat-context-menu.mjs.map +1 -1
- package/fesm2022/smallpearl-ngx-helper-mat-entity-crud.mjs +347 -359
- package/fesm2022/smallpearl-ngx-helper-mat-entity-crud.mjs.map +1 -1
- package/fesm2022/smallpearl-ngx-helper-mat-entity-list.mjs +152 -146
- package/fesm2022/smallpearl-ngx-helper-mat-entity-list.mjs.map +1 -1
- package/fesm2022/smallpearl-ngx-helper-mat-file-input.mjs +5 -5
- package/fesm2022/smallpearl-ngx-helper-mat-file-input.mjs.map +1 -1
- package/fesm2022/smallpearl-ngx-helper-mat-form-error.mjs +19 -19
- package/fesm2022/smallpearl-ngx-helper-mat-form-error.mjs.map +1 -1
- package/fesm2022/smallpearl-ngx-helper-mat-select-entity.mjs +25 -26
- package/fesm2022/smallpearl-ngx-helper-mat-select-entity.mjs.map +1 -1
- package/fesm2022/smallpearl-ngx-helper-mat-select-infinite-scroll.mjs +7 -7
- package/fesm2022/smallpearl-ngx-helper-mat-select-infinite-scroll.mjs.map +1 -1
- package/fesm2022/smallpearl-ngx-helper-mat-side-menu-layout.mjs +24 -24
- package/fesm2022/smallpearl-ngx-helper-mat-side-menu-layout.mjs.map +1 -1
- package/fesm2022/smallpearl-ngx-helper-mat-tel-input.mjs +8 -9
- package/fesm2022/smallpearl-ngx-helper-mat-tel-input.mjs.map +1 -1
- package/fesm2022/smallpearl-ngx-helper-sideload.mjs.map +1 -1
- package/fesm2022/smallpearl-ngx-helper-stationary-with-line-items.mjs +35 -35
- package/fesm2022/smallpearl-ngx-helper-stationary-with-line-items.mjs.map +1 -1
- package/forms/index.d.ts +55 -1
- package/hover-dropdown/index.d.ts +44 -1
- package/index.d.ts +4 -5
- package/locale/index.d.ts +55 -5
- package/mat-busy-wheel/index.d.ts +165 -4
- package/mat-context-menu/index.d.ts +65 -1
- package/mat-entity-crud/index.d.ts +1075 -6
- package/mat-entity-list/index.d.ts +394 -3
- package/mat-file-input/index.d.ts +61 -1
- package/mat-form-error/index.d.ts +184 -6
- package/mat-select-entity/index.d.ts +194 -1
- package/mat-select-infinite-scroll/index.d.ts +45 -2
- package/mat-side-menu-layout/index.d.ts +180 -6
- package/mat-tel-input/index.d.ts +169 -2
- package/package.json +14 -14
- package/sideload/index.d.ts +20 -1
- package/stationary-with-line-items/index.d.ts +78 -1
- package/core/src/version.d.ts +0 -1
- package/entities/src/paged-loader.d.ts +0 -219
- package/entities/src/paginator.d.ts +0 -87
- package/entity-field/src/entity-field.d.ts +0 -70
- package/entity-field/src/provider.d.ts +0 -27
- package/forms/src/validation-error-handler.d.ts +0 -52
- package/hover-dropdown/src/hover-dropdown.directive.d.ts +0 -41
- package/locale/src/currency.pipe.d.ts +0 -14
- package/locale/src/date.pipe.d.ts +0 -14
- package/locale/src/format-currency.d.ts +0 -1
- package/locale/src/format-date.d.ts +0 -2
- package/locale/src/is-empty.d.ts +0 -1
- package/locale/src/providers.d.ts +0 -20
- package/mat-busy-wheel/src/busy-wheel-op.d.ts +0 -65
- package/mat-busy-wheel/src/busy-wheel.component.d.ts +0 -12
- package/mat-busy-wheel/src/busy-wheel.service.d.ts +0 -42
- package/mat-busy-wheel/src/host-busy-wheel.directive.d.ts +0 -35
- package/mat-context-menu/src/mat-context-menu.component.d.ts +0 -61
- package/mat-entity-crud/src/convert-context-input-to-http-context.d.ts +0 -11
- package/mat-entity-crud/src/default-config.d.ts +0 -9
- package/mat-entity-crud/src/form-view-host.component.d.ts +0 -43
- package/mat-entity-crud/src/mat-entity-crud-form-base.d.ts +0 -277
- package/mat-entity-crud/src/mat-entity-crud-internal-types.d.ts +0 -138
- package/mat-entity-crud/src/mat-entity-crud-item-action.d.ts +0 -68
- package/mat-entity-crud/src/mat-entity-crud-types.d.ts +0 -158
- package/mat-entity-crud/src/mat-entity-crud.component.d.ts +0 -367
- package/mat-entity-crud/src/preview-host.component.d.ts +0 -21
- package/mat-entity-crud/src/preview-pane.component.d.ts +0 -31
- package/mat-entity-crud/src/providers.d.ts +0 -3
- package/mat-entity-list/src/config.d.ts +0 -6
- package/mat-entity-list/src/mat-entity-list-types.d.ts +0 -128
- package/mat-entity-list/src/mat-entity-list.component.d.ts +0 -259
- package/mat-entity-list/src/providers.d.ts +0 -3
- package/mat-file-input/src/mat-file-input.component.d.ts +0 -58
- package/mat-form-error/src/locales/en.d.ts +0 -4
- package/mat-form-error/src/locales/hu.d.ts +0 -4
- package/mat-form-error/src/locales/index.d.ts +0 -5
- package/mat-form-error/src/locales/pt-br.d.ts +0 -4
- package/mat-form-error/src/locales/zh-hans.d.ts +0 -4
- package/mat-form-error/src/locales/zh-hant.d.ts +0 -4
- package/mat-form-error/src/ngx-error-list.component.d.ts +0 -9
- package/mat-form-error/src/ngx-mat-error-control.d.ts +0 -17
- package/mat-form-error/src/ngx-mat-error-def.directive.d.ts +0 -30
- package/mat-form-error/src/ngx-mat-errors-for-date-range-picker.directive.d.ts +0 -8
- package/mat-form-error/src/ngx-mat-errors.component.d.ts +0 -44
- package/mat-form-error/src/types.d.ts +0 -68
- package/mat-form-error/src/utils/coerce-to-observable.d.ts +0 -3
- package/mat-form-error/src/utils/distinct-until-error-changed.d.ts +0 -2
- package/mat-form-error/src/utils/find-error-for-control.d.ts +0 -9
- package/mat-form-error/src/utils/get-abstract-controls.d.ts +0 -3
- package/mat-form-error/src/utils/get-control-with-error.d.ts +0 -3
- package/mat-select-entity/src/mat-select-entity.component.d.ts +0 -190
- package/mat-select-infinite-scroll/src/mat-select-infinite-scroll.directive.d.ts +0 -19
- package/mat-select-infinite-scroll/src/mat-select-infinite-scroll.service.d.ts +0 -25
- package/mat-side-menu-layout/src/layout.service.d.ts +0 -23
- package/mat-side-menu-layout/src/mat-menu-layout.component.d.ts +0 -39
- package/mat-side-menu-layout/src/mat-menu-layout.module.d.ts +0 -18
- package/mat-side-menu-layout/src/mat-menu-list-item.component.d.ts +0 -36
- package/mat-side-menu-layout/src/mat-menu-pane.component.d.ts +0 -66
- package/mat-side-menu-layout/src/nav-item.d.ts +0 -10
- package/mat-tel-input/src/country-codes.d.ts +0 -5
- package/mat-tel-input/src/mat-telephone.component.d.ts +0 -129
- package/mat-tel-input/src/providers.d.ts +0 -38
- package/ngx-helper.d.ts +0 -2
- package/public-api.d.ts +0 -1
- package/sideload/src/sideload.d.ts +0 -18
- package/stationary-with-line-items/src/stationary-with-line-items.component.d.ts +0 -74
|
@@ -1,3 +1,394 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { HttpContextToken, HttpClient, HttpContext, HttpParams } from '@angular/common/http';
|
|
2
|
+
import { Observable, Subscription, Subject } from 'rxjs';
|
|
3
|
+
import * as _angular_core from '@angular/core';
|
|
4
|
+
import { InjectionToken, AfterViewInit, ElementRef, OnInit, OnDestroy, QueryList, EventEmitter, Injector } from '@angular/core';
|
|
5
|
+
import * as _smallpearl_ngx_helper_mat_entity_list from '@smallpearl/ngx-helper/mat-entity-list';
|
|
6
|
+
import * as _smallpearl_ngx_helper_entity_field from '@smallpearl/ngx-helper/entity-field';
|
|
7
|
+
import { SPEntityFieldSpec, SPEntityField } from '@smallpearl/ngx-helper/entity-field';
|
|
8
|
+
import * as _ngneat_elf from '@ngneat/elf';
|
|
9
|
+
import * as _angular_material_paginator from '@angular/material/paginator';
|
|
10
|
+
import { PageEvent } from '@angular/material/paginator';
|
|
11
|
+
import { MatSort } from '@angular/material/sort';
|
|
12
|
+
import { MatTableDataSource, MatTable, MatColumnDef } from '@angular/material/table';
|
|
13
|
+
import { DomSanitizer } from '@angular/platform-browser';
|
|
14
|
+
|
|
15
|
+
interface SPMatEntityListHttpContext {
|
|
16
|
+
entityName: string;
|
|
17
|
+
entityNamePlural: string;
|
|
18
|
+
endpoint: string;
|
|
19
|
+
}
|
|
20
|
+
declare const SP_MAT_ENTITY_LIST_HTTP_CONTEXT: HttpContextToken<SPMatEntityListHttpContext>;
|
|
21
|
+
/**
|
|
22
|
+
* Pagination HTTP request params. Actually copied from Angular's HttpParams
|
|
23
|
+
* declaration. The ReadonlyArray<string|number|boolean> is a bit of an
|
|
24
|
+
* overkill for pagination params, but what the heck. When you copy-paste,
|
|
25
|
+
* do it in full!
|
|
26
|
+
*/
|
|
27
|
+
type SPPageParams = {
|
|
28
|
+
[param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* An interface that the clients should provide, either via a global config
|
|
32
|
+
* (see above), that handles parsing the GET response and returns the entities
|
|
33
|
+
* stored therein. This class will allow the entity-list component to be
|
|
34
|
+
* used across different pagination response types as long as the appropriate
|
|
35
|
+
* SPMatEntityListPaginator class is provided to the component.
|
|
36
|
+
*/
|
|
37
|
+
interface SPMatEntityListPaginator {
|
|
38
|
+
/**
|
|
39
|
+
* Return the HTTP request params for the given page index and page size as
|
|
40
|
+
* an object. For example, for a REST API that supports 'skip' and 'top' params,
|
|
41
|
+
* the implementation would be:
|
|
42
|
+
*
|
|
43
|
+
* ```typescript
|
|
44
|
+
* getRequestPageParams(endpoint: string, pageIndex: number, pageSize: number): SPPageParams {
|
|
45
|
+
* return {
|
|
46
|
+
* skip: pageIndex * pageSize,
|
|
47
|
+
* top: pageSize
|
|
48
|
+
* };
|
|
49
|
+
* }
|
|
50
|
+
* ```
|
|
51
|
+
* @param endpoint
|
|
52
|
+
* @param pageIndex
|
|
53
|
+
* @param pageSize
|
|
54
|
+
* @returns
|
|
55
|
+
*/
|
|
56
|
+
getRequestPageParams: (endpoint: string, pageIndex: number, pageSize: number) => SPPageParams;
|
|
57
|
+
/**
|
|
58
|
+
* Parse the HTTP response received from the GET request and return an object
|
|
59
|
+
* containing the total number of entities available and the array of entities
|
|
60
|
+
* for the current page. For example, for the pure DRF paginated response
|
|
61
|
+
* like below:
|
|
62
|
+
* ```json
|
|
63
|
+
* {
|
|
64
|
+
* "count": 102,
|
|
65
|
+
* "next": "http://api.example.org/entities/?page=3",
|
|
66
|
+
* "previous": "http://api.example.org/entities/?page=1",
|
|
67
|
+
* "results": [
|
|
68
|
+
* {
|
|
69
|
+
* "id": 1,
|
|
70
|
+
* "name": "Entity 1"
|
|
71
|
+
* },
|
|
72
|
+
* {
|
|
73
|
+
* "id": 2,
|
|
74
|
+
* "name": "Entity 2"
|
|
75
|
+
* }
|
|
76
|
+
* ]
|
|
77
|
+
* }
|
|
78
|
+
* ```
|
|
79
|
+
* The implementation would be:
|
|
80
|
+
* ```typescript
|
|
81
|
+
* parseRequestResponse<TEntity extends { [P in IdKey]: PropertyKey }, IdKey extends string = 'id'>(
|
|
82
|
+
* entityName: string,
|
|
83
|
+
* entityNamePlural: string,
|
|
84
|
+
* endpoint: string,
|
|
85
|
+
* params: SPPageParams,
|
|
86
|
+
* resp: any
|
|
87
|
+
* ): { total: number; entities: TEntity[] } {
|
|
88
|
+
* return {
|
|
89
|
+
* total: resp.count,
|
|
90
|
+
* entities: resp.results
|
|
91
|
+
* };
|
|
92
|
+
* }
|
|
93
|
+
* ```
|
|
94
|
+
* @param entityName
|
|
95
|
+
* @param entityNamePlural
|
|
96
|
+
* @param endpoint
|
|
97
|
+
* @param params
|
|
98
|
+
* @param resp
|
|
99
|
+
* @returns
|
|
100
|
+
*/
|
|
101
|
+
parseRequestResponse: <TEntity extends {
|
|
102
|
+
[P in IdKey]: PropertyKey;
|
|
103
|
+
}, IdKey extends string = 'id'>(entityName: string, entityNamePlural: string, endpoint: string, params: SPPageParams, resp: any) => {
|
|
104
|
+
total: number;
|
|
105
|
+
entities: TEntity[];
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* 'entity' is really TEntity arg of SPMatEntityListComponent<TEntity>.
|
|
110
|
+
* 'column' is the column name. This allows the same value function to support
|
|
111
|
+
* multiple columns further enabing DRY.
|
|
112
|
+
*/
|
|
113
|
+
type COLUMN_VALUE_FN = (entity: any, column: string) => string | number | Date | boolean;
|
|
114
|
+
/**
|
|
115
|
+
* Global config for SPMatEntityList component.
|
|
116
|
+
*/
|
|
117
|
+
interface SPMatEntityListConfig {
|
|
118
|
+
urlResolver?: (endpoint: string) => string;
|
|
119
|
+
paginator?: SPMatEntityListPaginator;
|
|
120
|
+
defaultPageSize?: number;
|
|
121
|
+
pageSizes?: Array<number>;
|
|
122
|
+
/**
|
|
123
|
+
* Provide a method to return the labels for the columns. This is useful when
|
|
124
|
+
* the columns are specified as the JSON object key names and the labels are
|
|
125
|
+
* to be transformed into a uniform manner (uppercase) or when the labels
|
|
126
|
+
* are to be dynamically localized. Note that the response can be an
|
|
127
|
+
* Observable<string> if the label is to be fetched/changed asynchronously
|
|
128
|
+
* (as that can happen in an app that supports dynamic changing of the UI
|
|
129
|
+
* language).
|
|
130
|
+
* @param entityName
|
|
131
|
+
* @param columnName
|
|
132
|
+
* @returns
|
|
133
|
+
*/
|
|
134
|
+
columnLabelFn?: (entityName: string, columnName: string) => string | Observable<string>;
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Type for custom entities loader function, which if provided will be called
|
|
138
|
+
* instead of HttpClient.get.
|
|
139
|
+
*/
|
|
140
|
+
type SPMatEntityListEntityLoaderFn = (params: any) => Observable<any>;
|
|
141
|
+
|
|
142
|
+
declare const SP_MAT_ENTITY_LIST_CONFIG: InjectionToken<SPMatEntityListConfig>;
|
|
143
|
+
|
|
144
|
+
declare class HeaderAlignmentDirective implements AfterViewInit {
|
|
145
|
+
private el;
|
|
146
|
+
headerAlignment: _angular_core.InputSignal<string | undefined>;
|
|
147
|
+
constructor(el: ElementRef);
|
|
148
|
+
ngAfterViewInit(): void;
|
|
149
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<HeaderAlignmentDirective, never>;
|
|
150
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<HeaderAlignmentDirective, "[headerAlignment]", never, { "headerAlignment": { "alias": "headerAlignment"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Represents a request to load entities from the remote. This is used to
|
|
154
|
+
* compare two requests to determine if they are equal. This is useful to
|
|
155
|
+
* prevent duplicate requests being sent to the remote.
|
|
156
|
+
*/
|
|
157
|
+
declare class LoadRequest {
|
|
158
|
+
endpoint: string;
|
|
159
|
+
params: HttpParams;
|
|
160
|
+
force: boolean;
|
|
161
|
+
constructor(endpoint: string, params: HttpParams, force?: boolean);
|
|
162
|
+
isEqualToAndNotForced(prev: LoadRequest): boolean;
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* A component to display a list of entities loaded from remote.
|
|
166
|
+
*/
|
|
167
|
+
declare class SPMatEntityListComponent<TEntity extends {
|
|
168
|
+
[P in IdKey]: PropertyKey;
|
|
169
|
+
}, IdKey extends string = 'id'> implements OnInit, OnDestroy, AfterViewInit {
|
|
170
|
+
protected http: HttpClient;
|
|
171
|
+
private sanitizer;
|
|
172
|
+
private injector;
|
|
173
|
+
entityName: _angular_core.InputSignal<string>;
|
|
174
|
+
entityNamePlural: _angular_core.InputSignal<string | undefined>;
|
|
175
|
+
/**
|
|
176
|
+
* The endpoint from where the entities are to be retrieved
|
|
177
|
+
*/
|
|
178
|
+
endpoint: _angular_core.InputSignal<string>;
|
|
179
|
+
/**
|
|
180
|
+
* Custom entities loader function, which if provided will be called
|
|
181
|
+
* instead of HttpClient.get.
|
|
182
|
+
*/
|
|
183
|
+
entityLoaderFn: _angular_core.InputSignal<SPMatEntityListEntityLoaderFn | undefined>;
|
|
184
|
+
/**
|
|
185
|
+
* The columns of the entity to be displayed. This is an array of
|
|
186
|
+
* SPEntityFieldSpec objects. If there's a one-to-one mapping between the
|
|
187
|
+
* column's field name, its title & the rendered value, a string can be
|
|
188
|
+
* specified instead. That is, the value of this property is a heterogeneous
|
|
189
|
+
* array consisting of SPEntityFieldSpec<> objects and strings.
|
|
190
|
+
*/
|
|
191
|
+
columns: _angular_core.InputSignal<(string | SPEntityFieldSpec<TEntity, IdKey>)[]>;
|
|
192
|
+
/**
|
|
193
|
+
* Names of columns that are displayed. This will default to all the columns
|
|
194
|
+
* listed in columns.
|
|
195
|
+
*/
|
|
196
|
+
displayedColumns: _angular_core.InputSignal<string[]>;
|
|
197
|
+
/**
|
|
198
|
+
* Number of entities per page. If this is not set and paginator is defined,
|
|
199
|
+
* the number of entities int in the first request, will be taken as the
|
|
200
|
+
* page size.
|
|
201
|
+
*/
|
|
202
|
+
pageSize: _angular_core.InputSignal<number>;
|
|
203
|
+
/**
|
|
204
|
+
* Entity idKey, if idKey is different from the default 'id'.
|
|
205
|
+
*/
|
|
206
|
+
idKey: _angular_core.InputSignal<string>;
|
|
207
|
+
/**
|
|
208
|
+
* Type of pagination -- continuous or discrete. 'infinite' pagination
|
|
209
|
+
* uses an 'infiniteScroll' and 'discrete' pagination uses a mat-paginator
|
|
210
|
+
* at the bottom to navigate between pages.
|
|
211
|
+
*/
|
|
212
|
+
pagination: _angular_core.InputSignal<"infinite" | "discrete" | "none">;
|
|
213
|
+
/**
|
|
214
|
+
* Component specific paginator. Only used if pagination != 'none'.
|
|
215
|
+
*/
|
|
216
|
+
paginator: _angular_core.InputSignal<SPMatEntityListPaginator | undefined>;
|
|
217
|
+
/**
|
|
218
|
+
*
|
|
219
|
+
*/
|
|
220
|
+
sorter: _angular_core.InputSignal<MatSort | undefined>;
|
|
221
|
+
/**
|
|
222
|
+
* Disable sorting of rows
|
|
223
|
+
*/
|
|
224
|
+
disableSort: _angular_core.InputSignal<boolean>;
|
|
225
|
+
/**
|
|
226
|
+
* Wrappers for infiniteScroll properties, for customization by the client
|
|
227
|
+
*/
|
|
228
|
+
infiniteScrollContainer: _angular_core.InputSignal<any>;
|
|
229
|
+
infiniteScrollDistance: _angular_core.InputSignal<number>;
|
|
230
|
+
infiniteScrollThrottle: _angular_core.InputSignal<number>;
|
|
231
|
+
infiniteScrollWindow: _angular_core.InputSignal<boolean>;
|
|
232
|
+
/**
|
|
233
|
+
* Custom context to be set for HttpClient requests. Value for this attribute
|
|
234
|
+
* can be an array of HttpContextToken key, value pairs, or an instance of
|
|
235
|
+
* HttpContext.
|
|
236
|
+
*
|
|
237
|
+
* In the client code specify this property by initializing a member variable
|
|
238
|
+
* as:
|
|
239
|
+
|
|
240
|
+
```
|
|
241
|
+
Component({
|
|
242
|
+
...
|
|
243
|
+
template: `
|
|
244
|
+
<sp-mat-entity-list
|
|
245
|
+
[httpReqContext]="httpReqContext"
|
|
246
|
+
></sp-mat-entity-list>
|
|
247
|
+
`
|
|
248
|
+
})
|
|
249
|
+
export class YourComponent {
|
|
250
|
+
httpReqContext: [HttpContextToken<any>, any] = [
|
|
251
|
+
MY_CONTEXT_TOKEN, 'customers'
|
|
252
|
+
];
|
|
253
|
+
// Or [httpReqContext]="httpReqContext2" will work too.
|
|
254
|
+
httpReqContext2: HttpContext = new HttpContext().set(
|
|
255
|
+
MY_CONTEXT_TOKEN, 'customers'
|
|
256
|
+
);
|
|
257
|
+
}
|
|
258
|
+
```
|
|
259
|
+
*
|
|
260
|
+
* Of course if you want to pass multiple context properties, declare the type
|
|
261
|
+
* as an array of array. That is, `[[HttpContextToken<any>, any]]` and
|
|
262
|
+
* initialize it appropriately.
|
|
263
|
+
*/
|
|
264
|
+
httpReqContext: _angular_core.InputSignal<[HttpContextToken<any>, any] | [[HttpContextToken<any>, any]] | HttpContext | undefined>;
|
|
265
|
+
_entityNamePlural: _angular_core.Signal<string>;
|
|
266
|
+
_httpReqContext: _angular_core.Signal<HttpContext>;
|
|
267
|
+
deferViewInit: _angular_core.InputSignal<boolean>;
|
|
268
|
+
firstLoadDone: boolean;
|
|
269
|
+
allColumnNames: _angular_core.WritableSignal<string[]>;
|
|
270
|
+
_displayedColumns: _angular_core.Signal<string[]>;
|
|
271
|
+
dataSource: _angular_core.WritableSignal<MatTableDataSource<TEntity, _angular_material_paginator.MatPaginator>>;
|
|
272
|
+
table: _angular_core.Signal<MatTable<any> | undefined>;
|
|
273
|
+
sort: _angular_core.Signal<MatSort | undefined>;
|
|
274
|
+
viewColumnDefs: _angular_core.Signal<readonly MatColumnDef[]>;
|
|
275
|
+
clientColumnDefs: QueryList<MatColumnDef>;
|
|
276
|
+
contentColumnDefs: MatColumnDef[];
|
|
277
|
+
subs$: Subscription;
|
|
278
|
+
destroy$: Subject<void>;
|
|
279
|
+
entityCount: _angular_core.WritableSignal<number>;
|
|
280
|
+
pageIndex: _angular_core.WritableSignal<number>;
|
|
281
|
+
lastFetchedEntitiesCount: _angular_core.WritableSignal<number>;
|
|
282
|
+
_pageSize: _angular_core.Signal<number>;
|
|
283
|
+
_columns: _angular_core.Signal<SPEntityFieldSpec<TEntity, IdKey>[]>;
|
|
284
|
+
__columns: _angular_core.Signal<SPEntityField<TEntity, IdKey>[]>;
|
|
285
|
+
store: _ngneat_elf.Store<{
|
|
286
|
+
name: string;
|
|
287
|
+
state: {
|
|
288
|
+
entities: Record<TEntity[IdKey], TEntity>;
|
|
289
|
+
ids: TEntity[IdKey][];
|
|
290
|
+
};
|
|
291
|
+
config: {
|
|
292
|
+
idKey: IdKey;
|
|
293
|
+
};
|
|
294
|
+
}, {
|
|
295
|
+
entities: Record<TEntity[IdKey], TEntity>;
|
|
296
|
+
ids: TEntity[IdKey][];
|
|
297
|
+
}>;
|
|
298
|
+
entities$: Observable<TEntity[]>;
|
|
299
|
+
_paginator: SPMatEntityListPaginator | undefined;
|
|
300
|
+
loading: _angular_core.WritableSignal<boolean>;
|
|
301
|
+
hasMore: _angular_core.WritableSignal<boolean>;
|
|
302
|
+
activeEntity: _angular_core.WritableSignal<TEntity | undefined>;
|
|
303
|
+
activeEntityId: _angular_core.Signal<any>;
|
|
304
|
+
_prevActiveEntity: TEntity | undefined;
|
|
305
|
+
_activeEntityChange: _angular_core.EffectRef;
|
|
306
|
+
selectEntity: EventEmitter<TEntity | undefined>;
|
|
307
|
+
fieldConfig: _smallpearl_ngx_helper_entity_field.SPEntityFieldConfig;
|
|
308
|
+
entityListConfig: _smallpearl_ngx_helper_mat_entity_list.SPMatEntityListConfig;
|
|
309
|
+
/**
|
|
310
|
+
* A signal that can be used to trigger loading of more entities from the
|
|
311
|
+
* remote. This can be visualized as the event loop of the entity list
|
|
312
|
+
* component.
|
|
313
|
+
*/
|
|
314
|
+
loadRequest$: Subject<LoadRequest>;
|
|
315
|
+
endpointChanged: _angular_core.EffectRef;
|
|
316
|
+
constructor(http: HttpClient, sanitizer: DomSanitizer, injector: Injector);
|
|
317
|
+
ngOnInit(): void;
|
|
318
|
+
ngOnDestroy(): void;
|
|
319
|
+
ngAfterViewInit(): void;
|
|
320
|
+
/**
|
|
321
|
+
* Clear all entities in store and reload them from endpoint as if
|
|
322
|
+
* the entities are being loaded for the first time.
|
|
323
|
+
*/
|
|
324
|
+
refresh(force?: boolean): void;
|
|
325
|
+
addEntity(entity: TEntity): void;
|
|
326
|
+
/**
|
|
327
|
+
* Update an entity with a modified version. Can be used by CRUD UPDATE
|
|
328
|
+
* operation to update an entity in the local store that is used to as the
|
|
329
|
+
* source of MatTableDataSource.
|
|
330
|
+
* @param id
|
|
331
|
+
* @param entity
|
|
332
|
+
*/
|
|
333
|
+
updateEntity(id: TEntity[IdKey], entity: TEntity): void;
|
|
334
|
+
/**
|
|
335
|
+
* Clients can call this method when it has deleted and entity via a CRUD
|
|
336
|
+
* operation. Depending on the pagination mode, MatEntityList implements
|
|
337
|
+
* an appropriate behavior.
|
|
338
|
+
*
|
|
339
|
+
* If the pagination is 'infinite', the relevent entity is removed from our
|
|
340
|
+
* entity list. View will be repained as data store has changed.
|
|
341
|
+
*
|
|
342
|
+
* If the pagination is 'discrete', the entity is removed from the page.
|
|
343
|
+
* If this is the only entity in the page, the current pageNumber is
|
|
344
|
+
* decremented by 1 if it's possible (if the current pageNumber > 1).
|
|
345
|
+
* The page is reloaded from remote.
|
|
346
|
+
*/
|
|
347
|
+
removeEntity(id: TEntity[IdKey]): void;
|
|
348
|
+
/**
|
|
349
|
+
* Build the contentColumnDefs array by enumerating all of client's projected
|
|
350
|
+
* content with matColumnDef directive.
|
|
351
|
+
*/
|
|
352
|
+
buildContentColumnDefs(): void;
|
|
353
|
+
/**
|
|
354
|
+
* Build the effective columns by parsing our own <ng-container matColumnDef>
|
|
355
|
+
* statements for each column in columns() property and client's
|
|
356
|
+
* <ng-container matColumnDef> provided via content projection.
|
|
357
|
+
*/
|
|
358
|
+
buildColumns(): void;
|
|
359
|
+
setupSort(): void;
|
|
360
|
+
infiniteScrollLoadNextPage(ev: any): void;
|
|
361
|
+
loadMoreEntities(forceRefresh?: boolean): void;
|
|
362
|
+
/**
|
|
363
|
+
* Creates a LoadRequest object for loading entities using the current state
|
|
364
|
+
* of the component. Therefore, if the request is for next page of entities,
|
|
365
|
+
* the LoadRequest object will have the updated page index. However, if
|
|
366
|
+
* pagination has been reset (refer to refresh()), the LoadRequest object
|
|
367
|
+
* will be for the first page of data. Note that when 'endpoint' value
|
|
368
|
+
* changes, the component's pagination state is reset causing a refresh()
|
|
369
|
+
* to be called, which in turn will create a new LoadRequest object for the
|
|
370
|
+
* first page of data.
|
|
371
|
+
* @returns LoadRequest object for the next load request.
|
|
372
|
+
*/
|
|
373
|
+
private createNextLoadRequest;
|
|
374
|
+
/**
|
|
375
|
+
* Does the actual load of entities from the remote or via calling the
|
|
376
|
+
* entityLoaderFn. This method is the workhorse of the entity list
|
|
377
|
+
* 'loader-loop'.
|
|
378
|
+
* @param lr
|
|
379
|
+
* @returns Observable that emits the response from the remote or from
|
|
380
|
+
* entityLoaderFn().
|
|
381
|
+
*/
|
|
382
|
+
private doActualLoad;
|
|
383
|
+
private findArrayInResult;
|
|
384
|
+
handlePageEvent(e: PageEvent): void;
|
|
385
|
+
getUrl(endpoint: string): string;
|
|
386
|
+
toggleActiveEntity(entity: TEntity | undefined): void;
|
|
387
|
+
getColumnLabel(field: SPEntityField<TEntity, IdKey>): Observable<string>;
|
|
388
|
+
isAsync(val: any): val is Observable<any>;
|
|
389
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SPMatEntityListComponent<any, any>, never>;
|
|
390
|
+
static ɵcmp: _angular_core.ɵɵ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": false; "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>;
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
export { HeaderAlignmentDirective, SPMatEntityListComponent, SP_MAT_ENTITY_LIST_CONFIG, SP_MAT_ENTITY_LIST_HTTP_CONTEXT };
|
|
394
|
+
export type { COLUMN_VALUE_FN, SPMatEntityListConfig, SPMatEntityListEntityLoaderFn, SPMatEntityListHttpContext, SPMatEntityListPaginator, SPPageParams };
|
|
@@ -1 +1,61 @@
|
|
|
1
|
-
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { OnInit, OnDestroy, ElementRef } from '@angular/core';
|
|
3
|
+
import { ControlValueAccessor, NgControl, UntypedFormControl } from '@angular/forms';
|
|
4
|
+
import { MatFormFieldControl, MatFormField } from '@angular/material/form-field';
|
|
5
|
+
import { Subject } from 'rxjs';
|
|
6
|
+
|
|
7
|
+
declare class QQMatFileInputComponent implements ControlValueAccessor, MatFormFieldControl<File[]>, OnInit, OnDestroy {
|
|
8
|
+
_formField: MatFormField;
|
|
9
|
+
ngControl: NgControl;
|
|
10
|
+
accept: string;
|
|
11
|
+
thumbnailImageUrl: string;
|
|
12
|
+
imageFile: boolean;
|
|
13
|
+
_fileName: string;
|
|
14
|
+
inputFileUpload: ElementRef | undefined;
|
|
15
|
+
fileControl: UntypedFormControl;
|
|
16
|
+
static nextId: number;
|
|
17
|
+
stateChanges: Subject<void>;
|
|
18
|
+
focused: boolean;
|
|
19
|
+
errorState: boolean;
|
|
20
|
+
controlType: string;
|
|
21
|
+
id: string;
|
|
22
|
+
describedBy: string;
|
|
23
|
+
private _multiple;
|
|
24
|
+
ariaDescribedby: string | undefined;
|
|
25
|
+
_value: File[] | null;
|
|
26
|
+
get empty(): boolean;
|
|
27
|
+
get shouldLabelFloat(): boolean;
|
|
28
|
+
get acceptedFileTypes(): string;
|
|
29
|
+
get multiple(): boolean;
|
|
30
|
+
set multiple(value: boolean | string);
|
|
31
|
+
get placeholder(): string;
|
|
32
|
+
set placeholder(value: string);
|
|
33
|
+
private _placeholder;
|
|
34
|
+
get required(): boolean;
|
|
35
|
+
set required(value: boolean);
|
|
36
|
+
private _required;
|
|
37
|
+
private _disabled;
|
|
38
|
+
private destroy$;
|
|
39
|
+
get disabled(): boolean;
|
|
40
|
+
set disabled(value: boolean);
|
|
41
|
+
get fileName(): string;
|
|
42
|
+
get value(): File[] | null;
|
|
43
|
+
set value(files: File[] | string | null);
|
|
44
|
+
constructor(_formField: MatFormField, ngControl: NgControl);
|
|
45
|
+
setDescribedByIds(ids: string[]): void;
|
|
46
|
+
handleKeyboardEvent(event: KeyboardEvent): void;
|
|
47
|
+
onContainerClick(event: MouseEvent | KeyboardEvent): void;
|
|
48
|
+
writeValue(files: File[]): void;
|
|
49
|
+
registerOnChange(fn: any): void;
|
|
50
|
+
registerOnTouched(fn: any): void;
|
|
51
|
+
onTouched: () => void;
|
|
52
|
+
setDisabledState(isDisabled: boolean): void;
|
|
53
|
+
onFileSelected(event: any): void;
|
|
54
|
+
ngOnInit(): void;
|
|
55
|
+
ngOnDestroy(): void;
|
|
56
|
+
generateLocalThumbnail(file: File): void;
|
|
57
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<QQMatFileInputComponent, [{ optional: true; }, { optional: true; self: true; }]>;
|
|
58
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<QQMatFileInputComponent, "qq-mat-file-input", never, { "accept": { "alias": "accept"; "required": false; }; "thumbnailImageUrl": { "alias": "thumbnailImageUrl"; "required": false; }; "imageFile": { "alias": "imageFile"; "required": false; }; "multiple": { "alias": "multiple"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "required": { "alias": "required"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "value": { "alias": "value"; "required": false; }; }, {}, never, never, true, never>;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export { QQMatFileInputComponent };
|
|
@@ -1,6 +1,184 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { TemplateRef, FactoryProvider, InjectionToken, OnDestroy, QueryList } from '@angular/core';
|
|
3
|
+
import { ValidationErrors, AbstractControl, AbstractControlDirective } from '@angular/forms';
|
|
4
|
+
import * as _angular_material_form_field from '@angular/material/form-field';
|
|
5
|
+
import { MatFormFieldControl } from '@angular/material/form-field';
|
|
6
|
+
import * as _angular_material_datepicker from '@angular/material/datepicker';
|
|
7
|
+
import { Observable } from 'rxjs';
|
|
8
|
+
|
|
9
|
+
type ErrorTemplate = {
|
|
10
|
+
template: TemplateRef<any>;
|
|
11
|
+
$implicit: ValidationErrors;
|
|
12
|
+
} | {
|
|
13
|
+
template: undefined;
|
|
14
|
+
$implicit: string | string[];
|
|
15
|
+
} | undefined;
|
|
16
|
+
type FormFieldControl = Pick<MatFormFieldControl<any>, 'ngControl'>;
|
|
17
|
+
type NgxMatErrorControls = FormFieldControl | AbstractControl | AbstractControlDirective | (FormFieldControl | AbstractControl | AbstractControlDirective)[] | undefined | null | '';
|
|
18
|
+
type ErrorTransform = (error: any) => string;
|
|
19
|
+
interface ErrorMessages {
|
|
20
|
+
[key: string]: string | ErrorTransform;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* For errors: 'min', 'matDatepickerMin'
|
|
24
|
+
*/
|
|
25
|
+
interface MinError<T = number> {
|
|
26
|
+
min: T;
|
|
27
|
+
actual: T;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* For errors: 'max', 'matDatepickerMax'
|
|
31
|
+
*/
|
|
32
|
+
interface MaxError<T = number> {
|
|
33
|
+
max: T;
|
|
34
|
+
actual: T;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* For errors: 'minlength', 'maxlength'
|
|
38
|
+
*/
|
|
39
|
+
interface LengthError {
|
|
40
|
+
requiredLength: number;
|
|
41
|
+
actualLength: number;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* For errors: 'pattern'
|
|
45
|
+
*/
|
|
46
|
+
interface PatternValidator {
|
|
47
|
+
requiredPattern: string;
|
|
48
|
+
actualValue: string;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* For errors: 'matStartDateInvalid'
|
|
52
|
+
*/
|
|
53
|
+
interface StartDateError<D> {
|
|
54
|
+
end: D;
|
|
55
|
+
actual: D;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* For errors: 'matEndDateInvalid'
|
|
59
|
+
*/
|
|
60
|
+
interface EndDateError<D> {
|
|
61
|
+
start: D;
|
|
62
|
+
actual: D;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* For errors: 'matDatepickerParse', 'matTimepickerParse'
|
|
66
|
+
*/
|
|
67
|
+
interface ParseError {
|
|
68
|
+
text: string;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* @deprecated to be removed in version 20. Please use ParseError instead
|
|
72
|
+
*/
|
|
73
|
+
type DatepickerParseError = ParseError;
|
|
74
|
+
|
|
75
|
+
declare function errorMessagesEnFactory(locale: string, dateFormat?: string, timeFormat?: string): ErrorMessages;
|
|
76
|
+
declare const NGX_MAT_ERROR_CONFIG_EN: FactoryProvider;
|
|
77
|
+
|
|
78
|
+
declare function errorMessagesHuFactory(locale: string, dateFormat?: string, timeFormat?: string): ErrorMessages;
|
|
79
|
+
declare const NGX_MAT_ERROR_CONFIG_HU: FactoryProvider;
|
|
80
|
+
|
|
81
|
+
declare function errorMessagesPtBtFactory(locale: string, dateFormat?: string, timeFormat?: string): ErrorMessages;
|
|
82
|
+
declare const NGX_MAT_ERROR_CONFIG_PT_BR: FactoryProvider;
|
|
83
|
+
|
|
84
|
+
declare function errorMessagesZhHansFactory(locale: string, dateFormat?: string, timeFormat?: string): ErrorMessages;
|
|
85
|
+
declare const NGX_MAT_ERROR_CONFIG_ZH_HANS: FactoryProvider;
|
|
86
|
+
|
|
87
|
+
declare function errorMessagesZhHantFactory(locale: string, dateFormat?: string, timeFormat?: string): ErrorMessages;
|
|
88
|
+
declare const NGX_MAT_ERROR_CONFIG_ZH_HANT: FactoryProvider;
|
|
89
|
+
|
|
90
|
+
interface INgxMatErrorDef {
|
|
91
|
+
ngxMatErrorDefFor: string;
|
|
92
|
+
ngxMatErrorDefWithControl?: AbstractControlDirective | AbstractControl | string | null;
|
|
93
|
+
template: TemplateRef<any>;
|
|
94
|
+
control?: AbstractControl;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Lightweight injection token. When NgxMatErrorDef is not used, only this token will remain, the directive will be tree-shaken.
|
|
98
|
+
*/
|
|
99
|
+
declare const NGX_MAT_ERROR_DEF: InjectionToken<INgxMatErrorDef>;
|
|
100
|
+
declare class NgxMatErrorDef implements INgxMatErrorDef {
|
|
101
|
+
/**
|
|
102
|
+
* Specify the error key to be used for error matching.
|
|
103
|
+
* @required
|
|
104
|
+
*/
|
|
105
|
+
ngxMatErrorDefFor: string;
|
|
106
|
+
/**
|
|
107
|
+
* Specify the control to be used for error matching.
|
|
108
|
+
* @optional
|
|
109
|
+
*/
|
|
110
|
+
ngxMatErrorDefWithControl?: AbstractControlDirective | AbstractControl | string | null;
|
|
111
|
+
readonly template: TemplateRef<any>;
|
|
112
|
+
private readonly controlContainer;
|
|
113
|
+
get control(): AbstractControl | undefined;
|
|
114
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgxMatErrorDef, never>;
|
|
115
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<NgxMatErrorDef, "[ngxMatErrorDef]", never, { "ngxMatErrorDefFor": { "alias": "ngxMatErrorDefFor"; "required": true; }; "ngxMatErrorDefWithControl": { "alias": "ngxMatErrorDefWithControl"; "required": false; }; }, {}, never, never, true, never>;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* This class contains the logic of getting the default control of a MatFormField.
|
|
120
|
+
* Extend it to implement a custom getter method.
|
|
121
|
+
*/
|
|
122
|
+
declare class NgxMatErrorControl {
|
|
123
|
+
protected readonly matFormField: _angular_material_form_field.MatFormField | null;
|
|
124
|
+
get(): undefined | FormFieldControl | FormFieldControl[];
|
|
125
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgxMatErrorControl, never>;
|
|
126
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<NgxMatErrorControl>;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
declare class NgxMatErrorsForDateRangePicker<D> extends NgxMatErrorControl {
|
|
130
|
+
/** Returns start and end controls of the date range picker. */
|
|
131
|
+
get(): (_angular_material_datepicker.MatStartDate<D> | _angular_material_datepicker.MatEndDate<D>)[];
|
|
132
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgxMatErrorsForDateRangePicker<any>, never>;
|
|
133
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<NgxMatErrorsForDateRangePicker<any>, "[ngx-mat-errors][forDateRangePicker]", never, {}, {}, never, never, true, never>;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Default error messages for form controls. These messages can be overridden
|
|
138
|
+
* by providing custom messages using the {@link NGX_MAT_ERROR_ADDL_OPTIONS}
|
|
139
|
+
* injection token. Typically, this is initialized in the root module
|
|
140
|
+
* (or AppComponent) of the application, providing the app with a global set
|
|
141
|
+
* of validation error messages.
|
|
142
|
+
*
|
|
143
|
+
* Messages specific to each form can be provided using the
|
|
144
|
+
* {@link NGX_MAT_ERROR_ADDL_OPTIONS} injection token (see below).
|
|
145
|
+
*/
|
|
146
|
+
declare const NGX_MAT_ERROR_DEFAULT_OPTIONS: InjectionToken<ErrorMessages | Observable<ErrorMessages>>;
|
|
147
|
+
/**
|
|
148
|
+
* Additional error messages to be merged with the default error messages.
|
|
149
|
+
* These messages will override the default messages if the same key is
|
|
150
|
+
* provided. This is useful for adding custom error messages specific to a
|
|
151
|
+
* form, without having to redefine all the default messages.
|
|
152
|
+
*
|
|
153
|
+
* Typically, this is provided in the component or module where the form
|
|
154
|
+
* is defined.
|
|
155
|
+
*/
|
|
156
|
+
declare const NGX_MAT_ERROR_ADDL_OPTIONS: InjectionToken<ErrorMessages | Observable<ErrorMessages>>;
|
|
157
|
+
declare class NgxMatErrors implements OnDestroy {
|
|
158
|
+
private readonly messages$;
|
|
159
|
+
private readonly addlMessages$;
|
|
160
|
+
private readonly defaultControl;
|
|
161
|
+
private readonly controlChangedSubject;
|
|
162
|
+
protected error$: Observable<ErrorTemplate>;
|
|
163
|
+
protected set customErrorMessages(queryList: QueryList<INgxMatErrorDef>);
|
|
164
|
+
/**
|
|
165
|
+
* @deprecated will be changed to a signal and it won't be possible to set the property from TS.
|
|
166
|
+
* Instead of setting it in a directive, the directive should extend the {@link NgxMatErrorControl } class
|
|
167
|
+
* and provide itself as it.
|
|
168
|
+
*/
|
|
169
|
+
set control(control: NgxMatErrorControls);
|
|
170
|
+
/** @ignore */
|
|
171
|
+
ngOnDestroy(): void;
|
|
172
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgxMatErrors, never>;
|
|
173
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<NgxMatErrors, "ngx-mat-errors, [ngx-mat-errors]", never, { "control": { "alias": "ngx-mat-errors"; "required": false; }; }, {}, ["customErrorMessages"], never, true, never>;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
declare class NgxErrorList extends NgxMatErrors {
|
|
177
|
+
isArray(e: string | string[]): e is string[];
|
|
178
|
+
set control(control: NgxMatErrorControls);
|
|
179
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgxErrorList, never>;
|
|
180
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<NgxErrorList, "ngx-error-list, [ngx-error-list]", never, { "control": { "alias": "ngx-error-list"; "required": false; }; }, {}, never, never, true, never>;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
export { NGX_MAT_ERROR_ADDL_OPTIONS, NGX_MAT_ERROR_CONFIG_EN, NGX_MAT_ERROR_CONFIG_HU, NGX_MAT_ERROR_CONFIG_PT_BR, NGX_MAT_ERROR_CONFIG_ZH_HANS, NGX_MAT_ERROR_CONFIG_ZH_HANT, NGX_MAT_ERROR_DEF, NGX_MAT_ERROR_DEFAULT_OPTIONS, NgxErrorList, NgxMatErrorDef, NgxMatErrors, NgxMatErrorsForDateRangePicker, errorMessagesEnFactory, errorMessagesHuFactory, errorMessagesPtBtFactory, errorMessagesZhHansFactory, errorMessagesZhHantFactory };
|
|
184
|
+
export type { DatepickerParseError, EndDateError, ErrorMessages, ErrorTemplate, ErrorTransform, FormFieldControl, INgxMatErrorDef, LengthError, MaxError, MinError, NgxMatErrorControls, ParseError, PatternValidator, StartDateError };
|