@smallpearl/ngx-helper 0.33.50 → 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 +346 -334
- 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 +8 -8
- 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 -41
- 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 -131
- 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 -149
- package/mat-entity-crud/src/mat-entity-crud.component.d.ts +0 -366
- 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,366 +0,0 @@
|
|
|
1
|
-
import { HttpClient, HttpContextToken, HttpParams } from '@angular/common/http';
|
|
2
|
-
import { AfterViewInit, EventEmitter, Injector, QueryList, TemplateRef } from '@angular/core';
|
|
3
|
-
import { MatSnackBar } from '@angular/material/snack-bar';
|
|
4
|
-
import { MatColumnDef } from '@angular/material/table';
|
|
5
|
-
import { SPMatEntityListComponent } from '@smallpearl/ngx-helper/mat-entity-list';
|
|
6
|
-
import { DomSanitizer } from '@angular/platform-browser';
|
|
7
|
-
import { TranslocoService } from '@jsverse/transloco';
|
|
8
|
-
import { Observable, Subscription } from 'rxjs';
|
|
9
|
-
import { FormViewHostComponent } from './form-view-host.component';
|
|
10
|
-
import { SPMatEntityCrudComponentBase } from './mat-entity-crud-internal-types';
|
|
11
|
-
import { MatEntityCrudItemAction } from './mat-entity-crud-item-action';
|
|
12
|
-
import { ALLOW_ITEM_ACTION_FN, CRUD_OP_FN, NewItemSubType, SPMatEntityCrudConfig, SPMatEntityCrudResponseParser } from './mat-entity-crud-types';
|
|
13
|
-
import { PreviewHostComponent } from './preview-host.component';
|
|
14
|
-
import * as i0 from "@angular/core";
|
|
15
|
-
export declare class SPMatEntityCrudComponent<TEntity extends {
|
|
16
|
-
[P in IdKey]: PropertyKey;
|
|
17
|
-
}, IdKey extends string = 'id'> extends SPMatEntityListComponent<TEntity, IdKey> implements SPMatEntityCrudComponentBase<TEntity, IdKey>, AfterViewInit {
|
|
18
|
-
private snackBar;
|
|
19
|
-
itemLabel: import("@angular/core").InputSignal<string | Observable<string> | undefined>;
|
|
20
|
-
itemLabelPlural: import("@angular/core").InputSignal<string | Observable<string> | undefined>;
|
|
21
|
-
/**
|
|
22
|
-
* Title string displayed above the component. If not specified, will use
|
|
23
|
-
* itemLabelPlural() as the title.
|
|
24
|
-
*/
|
|
25
|
-
title: import("@angular/core").InputSignal<string | Observable<string> | undefined>;
|
|
26
|
-
/**
|
|
27
|
-
*
|
|
28
|
-
*/
|
|
29
|
-
itemActions: import("@angular/core").InputSignal<MatEntityCrudItemAction<TEntity, IdKey>[]>;
|
|
30
|
-
/**
|
|
31
|
-
* Specify the list of router paths that will be set as the value for
|
|
32
|
-
* [routerLink] for the 'New {{ item }}' button. If not specified,
|
|
33
|
-
* if createEditTemplate is specified, it will be shown. If not, `action`
|
|
34
|
-
* out event will be raised with `{ role: '_new_' }`.
|
|
35
|
-
*/
|
|
36
|
-
newItemLink: import("@angular/core").InputSignal<string | string[] | undefined>;
|
|
37
|
-
/**
|
|
38
|
-
* If not specified, will default to 'New <itemLabel()>'.
|
|
39
|
-
*/
|
|
40
|
-
newItemLabel: import("@angular/core").InputSignal<string | string[] | undefined>;
|
|
41
|
-
/**
|
|
42
|
-
* Text for the Edit <item> pane title
|
|
43
|
-
*/
|
|
44
|
-
editItemTitle: import("@angular/core").InputSignal<string | undefined>;
|
|
45
|
-
/**
|
|
46
|
-
* If you want "New {{item}}" button to support multiple entity types,
|
|
47
|
-
* you can set this to `NewItemSubType[]`, where each element stands for for
|
|
48
|
-
* a dropdown menu item. Refer to `NewItemSubType` for details on this
|
|
49
|
-
* interface.
|
|
50
|
-
*/
|
|
51
|
-
newItemSubTypes: import("@angular/core").InputSignal<NewItemSubType[] | undefined>;
|
|
52
|
-
/**
|
|
53
|
-
* If you want to take control of the network operations for the CRUD
|
|
54
|
-
* operations (GET/CREATE/UPDATE/DELETE), provide a value for this property.
|
|
55
|
-
*/
|
|
56
|
-
crudOpFn: import("@angular/core").InputSignal<CRUD_OP_FN<TEntity, IdKey> | undefined>;
|
|
57
|
-
/**
|
|
58
|
-
* Item preview template.
|
|
59
|
-
*/
|
|
60
|
-
previewTemplate: import("@angular/core").InputSignal<TemplateRef<any> | undefined>;
|
|
61
|
-
/**
|
|
62
|
-
* Whether to allow a context menu action or not. Return false to disable
|
|
63
|
-
* the action.
|
|
64
|
-
*/
|
|
65
|
-
allowEntityActionFn: import("@angular/core").InputSignal<ALLOW_ITEM_ACTION_FN<TEntity> | undefined>;
|
|
66
|
-
/**
|
|
67
|
-
* A template that allows the header to be replaced. Usage:-
|
|
68
|
-
*
|
|
69
|
-
* ```
|
|
70
|
-
* <sp-map-entity-crud
|
|
71
|
-
* [headerTemplate]="myCrudViewHeader"
|
|
72
|
-
* ></sp-map-entity-crud>
|
|
73
|
-
* <ng-template #myCrudViewHeader>...</ng-template>
|
|
74
|
-
* ```
|
|
75
|
-
*/
|
|
76
|
-
headerTemplate: import("@angular/core").InputSignal<TemplateRef<any> | undefined>;
|
|
77
|
-
/**
|
|
78
|
-
* Set this to the custom template identifier that will replace the
|
|
79
|
-
* "New {{Item}}" button portion. This template will expand towards the
|
|
80
|
-
* title which will be placed to its left (right in rtl).
|
|
81
|
-
*
|
|
82
|
-
* ```
|
|
83
|
-
* <sp-map-entity-crud
|
|
84
|
-
* [actionsTemplate]="myCrudActions"
|
|
85
|
-
* ></sp-map-entity-crud>
|
|
86
|
-
* <ng-template #myCrudActions>...</ng-template>
|
|
87
|
-
* ```
|
|
88
|
-
*/
|
|
89
|
-
actionsTemplate: import("@angular/core").InputSignal<TemplateRef<any> | undefined>;
|
|
90
|
-
/**
|
|
91
|
-
* CRUD action response parser. This will be called with the response
|
|
92
|
-
* from CREATE & UPDATE operations to parse the response JSON and return
|
|
93
|
-
* the created/updated TEntity.
|
|
94
|
-
*/
|
|
95
|
-
crudResponseParser: import("@angular/core").InputSignal<SPMatEntityCrudResponseParser | undefined>;
|
|
96
|
-
/**
|
|
97
|
-
* An ng-template name that contains the component which provides the
|
|
98
|
-
* create/edit CRUD action.
|
|
99
|
-
*
|
|
100
|
-
* ```
|
|
101
|
-
* <ng-template #createEdit let-data>
|
|
102
|
-
* <app-create-edit-entity-demo [bridge]="data.bridge" [entity]="data.entity"></app-create-edit-entity-demo>
|
|
103
|
-
* </ng-template>
|
|
104
|
-
* ```
|
|
105
|
-
* Note how [bridge] & [entity] properties are set deriving them from the
|
|
106
|
-
* implicit template context. [entity] will be undefined for Create
|
|
107
|
-
* opreation and will be the valid entity for an Update.
|
|
108
|
-
* (app-create-edit-entity-demo here is the client code that implements the
|
|
109
|
-
* Create/Edit form)
|
|
110
|
-
*/
|
|
111
|
-
createEditFormTemplate: import("@angular/core").InputSignal<TemplateRef<any> | null>;
|
|
112
|
-
/**
|
|
113
|
-
* Disables the per item actions column, preventing 'Edit' & 'Delete'
|
|
114
|
-
* (and other user defined) item operations.
|
|
115
|
-
*/
|
|
116
|
-
disableItemActions: import("@angular/core").InputSignal<boolean>;
|
|
117
|
-
/**
|
|
118
|
-
* Disables the Create function.
|
|
119
|
-
*/
|
|
120
|
-
disableCreate: import("@angular/core").InputSignal<boolean>;
|
|
121
|
-
/**
|
|
122
|
-
* View refresh policy after a CREATE/UPDATE operation. Values
|
|
123
|
-
* 'none' - Objects are not refreshed after an edit operation. The return
|
|
124
|
-
* value of the edit operation is used as the object to
|
|
125
|
-
* add/update the component's internal store. This is the default.
|
|
126
|
-
* 'object' - Refresh just the object that was returned from the
|
|
127
|
-
* CREATE/UPDATE operation. Use this if the JSON object returned
|
|
128
|
-
* after a successful CREATE/UPDATE op differs from the JSON
|
|
129
|
-
* object returned for the GET request.
|
|
130
|
-
* 'all' - Refresh the entire list after a CREATE/UPDATE operation. This
|
|
131
|
-
* mimics the behaviour of legacy HTML apps with pure server
|
|
132
|
-
* defined UI.
|
|
133
|
-
*/
|
|
134
|
-
refreshAfterEdit: import("@angular/core").InputSignal<"object" | "none" | "all">;
|
|
135
|
-
/**
|
|
136
|
-
* HttpContext for crud requests - `create`, `retrieve`, `update` & `delete`.
|
|
137
|
-
* Note that HttpContext for `list` operation should be set using the
|
|
138
|
-
* `httpReqContext` property inherited from SPMatEntityListComponent.
|
|
139
|
-
* The value of the property is an object where the key names reflect the CRUD
|
|
140
|
-
* operation with each of these keys expected to have a value of type
|
|
141
|
-
* `[[HttpContextToken<any>, any]] | [HttpContextToken<any>, any] | HttpContext`.
|
|
142
|
-
*
|
|
143
|
-
* Alternatively the property value can be set to
|
|
144
|
-
* `[[HttpContextToken<any>, any]] | [HttpContextToken<any>, any] | HttpContext`,
|
|
145
|
-
* in which case the same context would be used for all HTTP requests.
|
|
146
|
-
*/
|
|
147
|
-
crudHttpReqContext: import("@angular/core").InputSignal<[HttpContextToken<any>, any] | [[HttpContextToken<any>, any]] | {
|
|
148
|
-
create?: [[HttpContextToken<any>, any]] | [HttpContextToken<any>, any];
|
|
149
|
-
retrieve?: [[HttpContextToken<any>, any]] | [HttpContextToken<any>, any];
|
|
150
|
-
update?: [[HttpContextToken<any>, any]] | [HttpContextToken<any>, any];
|
|
151
|
-
delete?: [[HttpContextToken<any>, any]] | [HttpContextToken<any>, any];
|
|
152
|
-
} | undefined>;
|
|
153
|
-
/**
|
|
154
|
-
* Width of the edit pane as a percentange of the overall <as-split> width.
|
|
155
|
-
*/
|
|
156
|
-
editPaneWidth: import("@angular/core").InputSignal<number>;
|
|
157
|
-
/**
|
|
158
|
-
* Width of the preview pane as a percentange of the overall <as-split> width.
|
|
159
|
-
*/
|
|
160
|
-
previewPaneWidth: import("@angular/core").InputSignal<number>;
|
|
161
|
-
/**
|
|
162
|
-
* The class class that will be applied to the list pane wrapper.
|
|
163
|
-
*/
|
|
164
|
-
listPaneWrapperClass: import("@angular/core").InputSignal<string>;
|
|
165
|
-
/**
|
|
166
|
-
* The class class that will be applied to the preview pane wrapper.
|
|
167
|
-
* Inside this wrapper, another div element with class='previewPaneContentClass()'
|
|
168
|
-
* will be created to host the preview content. The client supplied preview
|
|
169
|
-
* template will be rendered inside this div.
|
|
170
|
-
*
|
|
171
|
-
* +----------------------------------------+
|
|
172
|
-
* | previewPaneWrapperClass |
|
|
173
|
-
* |----------------------------------------|
|
|
174
|
-
* | preview toolbar |
|
|
175
|
-
* |----------------------------------------|
|
|
176
|
-
* | +------------------------------------+ |
|
|
177
|
-
* | | div class=previewPaneContentClass()| |
|
|
178
|
-
* | |------------------------------------| |
|
|
179
|
-
* | | client supplied preview template | |
|
|
180
|
-
* | +------------------------------------+ |
|
|
181
|
-
* +----------------------------------------+
|
|
182
|
-
*/
|
|
183
|
-
previewPaneWrapperClass: import("@angular/core").InputSignal<string>;
|
|
184
|
-
/**
|
|
185
|
-
* The class class that will be applied to the preview pane content.
|
|
186
|
-
*/
|
|
187
|
-
previewPaneContentClass: import("@angular/core").InputSignal<string>;
|
|
188
|
-
/**
|
|
189
|
-
* The class class that will be applied to the form pane wrapper. Inside this
|
|
190
|
-
* wrapper, another div element with class='formPaneContentClass()' will be
|
|
191
|
-
* created to host the form content. The client supplied form template will
|
|
192
|
-
* be rendered inside this div.
|
|
193
|
-
*
|
|
194
|
-
* +----------------------------------------+
|
|
195
|
-
* | formPaneWrapperClass |
|
|
196
|
-
* | +------------------------------------+ |
|
|
197
|
-
* | | div class=formPaneContentClass() | |
|
|
198
|
-
* | |------------------------------------| |
|
|
199
|
-
* | | form title + close button | |
|
|
200
|
-
* | |------------------------------------| |
|
|
201
|
-
* | | client supplied form template | |
|
|
202
|
-
* | +------------------------------------+ |
|
|
203
|
-
* +----------------------------------------+
|
|
204
|
-
*/
|
|
205
|
-
formPaneWrapperClass: import("@angular/core").InputSignal<string>;
|
|
206
|
-
/**
|
|
207
|
-
* The CSS class that will be applied to the form pane content.
|
|
208
|
-
*/
|
|
209
|
-
formPaneContentClass: import("@angular/core").InputSignal<string>;
|
|
210
|
-
private getLabel;
|
|
211
|
-
_itemLabel: import("@angular/core").Signal<Observable<string>>;
|
|
212
|
-
_itemLabelPlural: import("@angular/core").Signal<Observable<string>>;
|
|
213
|
-
_title: import("@angular/core").Signal<Observable<string | undefined>>;
|
|
214
|
-
_endpointSansParams: import("@angular/core").Signal<string>;
|
|
215
|
-
_endpointParams: import("@angular/core").Signal<void>;
|
|
216
|
-
componentColumns: import("@angular/core").Signal<readonly MatColumnDef[]>;
|
|
217
|
-
_clientColumnDefs: QueryList<MatColumnDef>;
|
|
218
|
-
/**
|
|
219
|
-
* Event raised for user selecting an item action. It's also raised
|
|
220
|
-
* for 'New <Item>' action, if 'newItemLink' property is not set.
|
|
221
|
-
*/
|
|
222
|
-
action: EventEmitter<{
|
|
223
|
-
role: string;
|
|
224
|
-
entity?: TEntity;
|
|
225
|
-
}>;
|
|
226
|
-
/**
|
|
227
|
-
* Event raised when create Create/Edit pane is activated & deactivated.
|
|
228
|
-
* Event contains two flags:-
|
|
229
|
-
* activated - whether the createEdit form view was activated or
|
|
230
|
-
* deactivated.
|
|
231
|
-
* cancelled - whether the form view was cancelled by user. False for this
|
|
232
|
-
* indicates that the form view was closed after a successful
|
|
233
|
-
* edit operation.
|
|
234
|
-
*/
|
|
235
|
-
entityViewPaneActivated: EventEmitter<{
|
|
236
|
-
activated: boolean;
|
|
237
|
-
cancelled: boolean | undefined;
|
|
238
|
-
mode: "edit" | "preview";
|
|
239
|
-
}>;
|
|
240
|
-
busyWheelId: string;
|
|
241
|
-
sub$: Subscription;
|
|
242
|
-
spEntitiesList: import("@angular/core").Signal<SPMatEntityListComponent<TEntity, IdKey> | undefined>;
|
|
243
|
-
spEntitiesListInited: import("@angular/core").EffectRef;
|
|
244
|
-
crudConfig: SPMatEntityCrudConfig;
|
|
245
|
-
createEditHostComponent: import("@angular/core").Signal<FormViewHostComponent<{
|
|
246
|
-
[x: string]: PropertyKey;
|
|
247
|
-
}, string> | undefined>;
|
|
248
|
-
createEditViewActive: import("@angular/core").WritableSignal<boolean>;
|
|
249
|
-
canCancelEditCallback: () => boolean;
|
|
250
|
-
previewHostComponent: import("@angular/core").Signal<PreviewHostComponent<{
|
|
251
|
-
[x: string]: PropertyKey;
|
|
252
|
-
}, string> | undefined>;
|
|
253
|
-
previewActive: import("@angular/core").Signal<boolean>;
|
|
254
|
-
previewedEntity: import("@angular/core").WritableSignal<TEntity | undefined>;
|
|
255
|
-
entityPaneActive: import("@angular/core").Signal<boolean>;
|
|
256
|
-
entityPaneWidth: import("@angular/core").Signal<number>;
|
|
257
|
-
entitiesPaneWidth: import("@angular/core").Signal<number>;
|
|
258
|
-
entitiesPaneHidden: import("@angular/core").Signal<boolean>;
|
|
259
|
-
defaultItemCrudActions: import("@angular/core").WritableSignal<MatEntityCrudItemAction<TEntity, IdKey>[]>;
|
|
260
|
-
columnsWithAction: import("@angular/core").Signal<(string | import("@smallpearl/ngx-helper/entity-field").SPEntityFieldSpec<TEntity, IdKey>)[]>;
|
|
261
|
-
_itemActions: (entity: TEntity) => MatEntityCrudItemAction<TEntity, IdKey>[];
|
|
262
|
-
visibleColumns: import("@angular/core").Signal<string[]>;
|
|
263
|
-
transloco: TranslocoService;
|
|
264
|
-
constructor(http: HttpClient, snackBar: MatSnackBar, sanitizer: DomSanitizer, injector: Injector);
|
|
265
|
-
ngOnInit(): void;
|
|
266
|
-
ngOnDestroy(): void;
|
|
267
|
-
/**
|
|
268
|
-
* Override so that we can suppress default action in SPMatEntityListComponent
|
|
269
|
-
*/
|
|
270
|
-
ngAfterViewInit(): void;
|
|
271
|
-
/**
|
|
272
|
-
* If the create/edit entity form is active, it calls its registered
|
|
273
|
-
* canCancelEdit callback to determine if it's okay to cancel the edit.
|
|
274
|
-
* You can use this method from the host component's router guard to
|
|
275
|
-
* ensure that any changes made to the form are not accidentally lost by
|
|
276
|
-
* navigating away from the CRUD page.
|
|
277
|
-
*
|
|
278
|
-
* If your CRUD page has multiple sp-mat-entity-crud components, you have to
|
|
279
|
-
* implement the logic to call this method on the appropriate component.
|
|
280
|
-
*
|
|
281
|
-
* If the the create/edit form is not active, this method returns true.
|
|
282
|
-
* @returns
|
|
283
|
-
*/
|
|
284
|
-
canDeactivate(): boolean;
|
|
285
|
-
refresh(force?: boolean): void;
|
|
286
|
-
getEntityName(): string;
|
|
287
|
-
getEntityNamePlural(): string;
|
|
288
|
-
getIdKey(): string;
|
|
289
|
-
closeCreateEdit(cancelled: boolean): void;
|
|
290
|
-
canCancelEdit(): boolean;
|
|
291
|
-
registerCanCancelEditCallback(callback: () => boolean): void;
|
|
292
|
-
triggerEntityUpdate(entity: TEntity): void;
|
|
293
|
-
triggerEntityDelete(entity: TEntity): void;
|
|
294
|
-
create(entityValue: any): Observable<any>;
|
|
295
|
-
update(id: TEntity[IdKey], entityValue: any): Observable<any>;
|
|
296
|
-
/**
|
|
297
|
-
* Thunk these methods to the internal <sp-mat-entity-list> component.
|
|
298
|
-
*/
|
|
299
|
-
addEntity(entity: TEntity): void;
|
|
300
|
-
removeEntity(id: TEntity[IdKey]): void;
|
|
301
|
-
updateEntity(id: TEntity[IdKey], entity: TEntity): void;
|
|
302
|
-
/**
|
|
303
|
-
* Refresh the entity list, after a CRUD CREATE or UPDATE operation.
|
|
304
|
-
* @param resp This is the response from the CRUD operation (CREATE/UPDATE).
|
|
305
|
-
* @param method The CRUD operation post which REFRESH is requested.
|
|
306
|
-
* @returns Observable<TEntity|null>
|
|
307
|
-
*/
|
|
308
|
-
doRefreshAfterEdit(resp: any, method: 'create' | 'update'): Observable<any>;
|
|
309
|
-
getCrudOpResponseParser(): SPMatEntityCrudResponseParser;
|
|
310
|
-
closePreview(): void;
|
|
311
|
-
private closePreviewImpl;
|
|
312
|
-
onItemAction(role: string, entity: TEntity): void;
|
|
313
|
-
onCreate(event: Event): void;
|
|
314
|
-
onUpdate(entity: TEntity): void;
|
|
315
|
-
/**
|
|
316
|
-
* Show the create/edit component. This is deliberately made public so as to
|
|
317
|
-
* be callable from the client. This allows the client to dynamically
|
|
318
|
-
* set the form edit template and then show the edit pane by calling this
|
|
319
|
-
* method.
|
|
320
|
-
* @param entity
|
|
321
|
-
* @param params
|
|
322
|
-
*/
|
|
323
|
-
showCreateEditView(entity?: TEntity | undefined, params?: any): void;
|
|
324
|
-
showPreviewView(entity?: TEntity, params?: any): void;
|
|
325
|
-
hidePreviewView(): void;
|
|
326
|
-
onDelete(entity: TEntity): Promise<void>;
|
|
327
|
-
getUrl(endpoint: string): string;
|
|
328
|
-
getEntityUrl(entityId: TEntity[IdKey]): string;
|
|
329
|
-
getEntityActionUrl(entityId: TEntity[IdKey], action: string): string;
|
|
330
|
-
handleSelectEntity(entity: TEntity | undefined): void;
|
|
331
|
-
handleNewItemSubType(subtype: NewItemSubType): void;
|
|
332
|
-
private getCrudReqHttpContext;
|
|
333
|
-
isItemActionAllowed(action: string, entity: TEntity): boolean;
|
|
334
|
-
/**
|
|
335
|
-
* Returns the list of item actions. Calls 'allowItemActionFn' for each action
|
|
336
|
-
* to determine if the action is allowed for the given entity.
|
|
337
|
-
* @returns
|
|
338
|
-
*/
|
|
339
|
-
getItemActions(entity: TEntity): MatEntityCrudItemAction<TEntity, IdKey>[];
|
|
340
|
-
getPreviewPaneContentClass(): string;
|
|
341
|
-
getFormPaneWrapperClass(): string;
|
|
342
|
-
getFormPaneContentClass(): string;
|
|
343
|
-
getItemLabel(): string | Observable<string>;
|
|
344
|
-
getItemLabelPlural(): string | Observable<string>;
|
|
345
|
-
/**
|
|
346
|
-
* Perform an action on the entity with the given id. The endpoint for the
|
|
347
|
-
* action is derived from the `verb` argument which is appended to the
|
|
348
|
-
* entity URL. This is following DRF specification where ViewSets can be
|
|
349
|
-
* extended with custom actions that are not part of the standard
|
|
350
|
-
* CRUD operations. Such methods will have a URL like
|
|
351
|
-
* `/api/v1/entity/<id>/<verb>/` where `<verb>` is the custom action verb.
|
|
352
|
-
* @param id
|
|
353
|
-
* @param verb
|
|
354
|
-
* @param addlParams
|
|
355
|
-
* @param data
|
|
356
|
-
*/
|
|
357
|
-
doEntityAction(id: TEntity[IdKey], verb: string, addlParams: HttpParams, data: any, busyWheelName?: string): Observable<any>;
|
|
358
|
-
/**
|
|
359
|
-
* Initialize the columns for the mat-entities-list component. This is
|
|
360
|
-
* called when the <sp-mat-entities-list> component has been properly
|
|
361
|
-
* initialized.
|
|
362
|
-
*/
|
|
363
|
-
private _initEntitiesList;
|
|
364
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<SPMatEntityCrudComponent<any, any>, never>;
|
|
365
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<SPMatEntityCrudComponent<any, any>, "sp-mat-entity-crud", never, { "itemLabel": { "alias": "itemLabel"; "required": false; "isSignal": true; }; "itemLabelPlural": { "alias": "itemLabelPlural"; "required": false; "isSignal": true; }; "title": { "alias": "title"; "required": false; "isSignal": true; }; "itemActions": { "alias": "itemActions"; "required": false; "isSignal": true; }; "newItemLink": { "alias": "newItemLink"; "required": false; "isSignal": true; }; "newItemLabel": { "alias": "newItemLabel"; "required": false; "isSignal": true; }; "editItemTitle": { "alias": "editItemTitle"; "required": false; "isSignal": true; }; "newItemSubTypes": { "alias": "newItemSubTypes"; "required": false; "isSignal": true; }; "crudOpFn": { "alias": "crudOpFn"; "required": false; "isSignal": true; }; "previewTemplate": { "alias": "previewTemplate"; "required": false; "isSignal": true; }; "allowEntityActionFn": { "alias": "allowEntityActionFn"; "required": false; "isSignal": true; }; "headerTemplate": { "alias": "headerTemplate"; "required": false; "isSignal": true; }; "actionsTemplate": { "alias": "actionsTemplate"; "required": false; "isSignal": true; }; "crudResponseParser": { "alias": "crudResponseParser"; "required": false; "isSignal": true; }; "createEditFormTemplate": { "alias": "createEditFormTemplate"; "required": false; "isSignal": true; }; "disableItemActions": { "alias": "disableItemActions"; "required": false; "isSignal": true; }; "disableCreate": { "alias": "disableCreate"; "required": false; "isSignal": true; }; "refreshAfterEdit": { "alias": "refreshAfterEdit"; "required": false; "isSignal": true; }; "crudHttpReqContext": { "alias": "crudHttpReqContext"; "required": false; "isSignal": true; }; "editPaneWidth": { "alias": "editPaneWidth"; "required": false; "isSignal": true; }; "previewPaneWidth": { "alias": "previewPaneWidth"; "required": false; "isSignal": true; }; "listPaneWrapperClass": { "alias": "listPaneWrapperClass"; "required": false; "isSignal": true; }; "previewPaneWrapperClass": { "alias": "previewPaneWrapperClass"; "required": false; "isSignal": true; }; "previewPaneContentClass": { "alias": "previewPaneContentClass"; "required": false; "isSignal": true; }; "formPaneWrapperClass": { "alias": "formPaneWrapperClass"; "required": false; "isSignal": true; }; "formPaneContentClass": { "alias": "formPaneContentClass"; "required": false; "isSignal": true; }; }, { "action": "action"; "entityViewPaneActivated": "entityViewPaneActivated"; }, ["_clientColumnDefs"], ["[breadCrumbs]"], true, never>;
|
|
366
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { EmbeddedViewRef, OnDestroy, OnInit, TemplateRef, ViewContainerRef } from '@angular/core';
|
|
2
|
-
import { SPMatEntityCrudComponentBase } from './mat-entity-crud-internal-types';
|
|
3
|
-
import * as i0 from "@angular/core";
|
|
4
|
-
export declare class PreviewHostComponent<TEntity extends {
|
|
5
|
-
[P in IdKey]: PropertyKey;
|
|
6
|
-
}, IdKey extends string = 'id'> implements OnInit, OnDestroy {
|
|
7
|
-
vc: import("@angular/core").Signal<ViewContainerRef | undefined>;
|
|
8
|
-
entityCrudComponentBase: import("@angular/core").InputSignal<SPMatEntityCrudComponentBase<TEntity, IdKey>>;
|
|
9
|
-
clientViewTemplate: import("@angular/core").InputSignal<TemplateRef<any> | null>;
|
|
10
|
-
entity: import("@angular/core").WritableSignal<TEntity | undefined>;
|
|
11
|
-
clientView: EmbeddedViewRef<any> | null;
|
|
12
|
-
constructor();
|
|
13
|
-
ngOnInit(): void;
|
|
14
|
-
ngOnDestroy(): void;
|
|
15
|
-
show(entity: TEntity | undefined, params?: any): void;
|
|
16
|
-
close(): void;
|
|
17
|
-
private createClientView;
|
|
18
|
-
destroyClientView(): void;
|
|
19
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<PreviewHostComponent<any, any>, never>;
|
|
20
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<PreviewHostComponent<any, any>, "sp-entity-crud-preview-host", never, { "entityCrudComponentBase": { "alias": "entityCrudComponentBase"; "required": true; "isSignal": true; }; "clientViewTemplate": { "alias": "clientViewTemplate"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
21
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { InputSignal, OnDestroy, OnInit } from '@angular/core';
|
|
2
|
-
import { SPContextMenuItem } from '@smallpearl/ngx-helper/mat-context-menu';
|
|
3
|
-
import { SPMatEntityCrudComponentBase } from './mat-entity-crud-internal-types';
|
|
4
|
-
import * as i0 from "@angular/core";
|
|
5
|
-
/**
|
|
6
|
-
* A preview pane container to provide a consistent UX for all preview panes.
|
|
7
|
-
* It consits of a toolbar on the top and a container div below that takes up
|
|
8
|
-
* the rest of the preview pane area.
|
|
9
|
-
*/
|
|
10
|
-
export declare class SPMatEntityCrudPreviewPaneComponent<TEntity extends {
|
|
11
|
-
[P in IdKey]: PropertyKey;
|
|
12
|
-
}, IdKey extends string = 'id'> implements OnInit, OnDestroy {
|
|
13
|
-
entity: InputSignal<TEntity>;
|
|
14
|
-
entityCrudComponent: InputSignal<SPMatEntityCrudComponentBase<TEntity, IdKey>>;
|
|
15
|
-
title: InputSignal<string | undefined>;
|
|
16
|
-
disableUpdate: InputSignal<boolean>;
|
|
17
|
-
hideUpdate: InputSignal<boolean>;
|
|
18
|
-
disableDelete: InputSignal<boolean>;
|
|
19
|
-
hideDelete: InputSignal<boolean>;
|
|
20
|
-
itemActions: SPContextMenuItem[];
|
|
21
|
-
_disableActionFactory: (role: string, signal?: InputSignal<boolean>) => import("@angular/core").Signal<boolean>;
|
|
22
|
-
_disableUpdate: import("@angular/core").Signal<boolean>;
|
|
23
|
-
_disableDelete: import("@angular/core").Signal<boolean>;
|
|
24
|
-
ngOnInit(): void;
|
|
25
|
-
ngOnDestroy(): void;
|
|
26
|
-
onEdit(): void;
|
|
27
|
-
onDelete(): void;
|
|
28
|
-
onClose(): void;
|
|
29
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<SPMatEntityCrudPreviewPaneComponent<any, any>, never>;
|
|
30
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<SPMatEntityCrudPreviewPaneComponent<any, any>, "sp-mat-entity-crud-preview-pane", never, { "entity": { "alias": "entity"; "required": true; "isSignal": true; }; "entityCrudComponent": { "alias": "entityCrudComponent"; "required": true; "isSignal": true; }; "title": { "alias": "title"; "required": false; "isSignal": true; }; "disableUpdate": { "alias": "disableUpdate"; "required": false; "isSignal": true; }; "hideUpdate": { "alias": "hideUpdate"; "required": false; "isSignal": true; }; "disableDelete": { "alias": "disableDelete"; "required": false; "isSignal": true; }; "hideDelete": { "alias": "hideDelete"; "required": false; "isSignal": true; }; }, {}, never, ["[previewToolbarContent]", "[previewContent]"], true, never>;
|
|
31
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { SPMatEntityListConfig } from './mat-entity-list-types';
|
|
2
|
-
export declare const DefaultSPMatEntityListConfig: SPMatEntityListConfig;
|
|
3
|
-
/**
|
|
4
|
-
* To be called from an object's constructor.
|
|
5
|
-
*/
|
|
6
|
-
export declare function getEntityListConfig(): SPMatEntityListConfig;
|
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
import { HttpContextToken } from "@angular/common/http";
|
|
2
|
-
import { Observable } from "rxjs";
|
|
3
|
-
export interface SPMatEntityListHttpContext {
|
|
4
|
-
entityName: string;
|
|
5
|
-
entityNamePlural: string;
|
|
6
|
-
endpoint: string;
|
|
7
|
-
}
|
|
8
|
-
export declare const SP_MAT_ENTITY_LIST_HTTP_CONTEXT: HttpContextToken<SPMatEntityListHttpContext>;
|
|
9
|
-
/**
|
|
10
|
-
* Pagination HTTP request params. Actually copied from Angular's HttpParams
|
|
11
|
-
* declaration. The ReadonlyArray<string|number|boolean> is a bit of an
|
|
12
|
-
* overkill for pagination params, but what the heck. When you copy-paste,
|
|
13
|
-
* do it in full!
|
|
14
|
-
*/
|
|
15
|
-
export type SPPageParams = {
|
|
16
|
-
[param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
|
|
17
|
-
};
|
|
18
|
-
/**
|
|
19
|
-
* An interface that the clients should provide, either via a global config
|
|
20
|
-
* (see above), that handles parsing the GET response and returns the entities
|
|
21
|
-
* stored therein. This class will allow the entity-list component to be
|
|
22
|
-
* used across different pagination response types as long as the appropriate
|
|
23
|
-
* SPMatEntityListPaginator class is provided to the component.
|
|
24
|
-
*/
|
|
25
|
-
export interface SPMatEntityListPaginator {
|
|
26
|
-
/**
|
|
27
|
-
* Return the HTTP request params for the given page index and page size as
|
|
28
|
-
* an object. For example, for a REST API that supports 'skip' and 'top' params,
|
|
29
|
-
* the implementation would be:
|
|
30
|
-
*
|
|
31
|
-
* ```typescript
|
|
32
|
-
* getRequestPageParams(endpoint: string, pageIndex: number, pageSize: number): SPPageParams {
|
|
33
|
-
* return {
|
|
34
|
-
* skip: pageIndex * pageSize,
|
|
35
|
-
* top: pageSize
|
|
36
|
-
* };
|
|
37
|
-
* }
|
|
38
|
-
* ```
|
|
39
|
-
* @param endpoint
|
|
40
|
-
* @param pageIndex
|
|
41
|
-
* @param pageSize
|
|
42
|
-
* @returns
|
|
43
|
-
*/
|
|
44
|
-
getRequestPageParams: (endpoint: string, pageIndex: number, pageSize: number) => SPPageParams;
|
|
45
|
-
/**
|
|
46
|
-
* Parse the HTTP response received from the GET request and return an object
|
|
47
|
-
* containing the total number of entities available and the array of entities
|
|
48
|
-
* for the current page. For example, for the pure DRF paginated response
|
|
49
|
-
* like below:
|
|
50
|
-
* ```json
|
|
51
|
-
* {
|
|
52
|
-
* "count": 102,
|
|
53
|
-
* "next": "http://api.example.org/entities/?page=3",
|
|
54
|
-
* "previous": "http://api.example.org/entities/?page=1",
|
|
55
|
-
* "results": [
|
|
56
|
-
* {
|
|
57
|
-
* "id": 1,
|
|
58
|
-
* "name": "Entity 1"
|
|
59
|
-
* },
|
|
60
|
-
* {
|
|
61
|
-
* "id": 2,
|
|
62
|
-
* "name": "Entity 2"
|
|
63
|
-
* }
|
|
64
|
-
* ]
|
|
65
|
-
* }
|
|
66
|
-
* ```
|
|
67
|
-
* The implementation would be:
|
|
68
|
-
* ```typescript
|
|
69
|
-
* parseRequestResponse<TEntity extends { [P in IdKey]: PropertyKey }, IdKey extends string = 'id'>(
|
|
70
|
-
* entityName: string,
|
|
71
|
-
* entityNamePlural: string,
|
|
72
|
-
* endpoint: string,
|
|
73
|
-
* params: SPPageParams,
|
|
74
|
-
* resp: any
|
|
75
|
-
* ): { total: number; entities: TEntity[] } {
|
|
76
|
-
* return {
|
|
77
|
-
* total: resp.count,
|
|
78
|
-
* entities: resp.results
|
|
79
|
-
* };
|
|
80
|
-
* }
|
|
81
|
-
* ```
|
|
82
|
-
* @param entityName
|
|
83
|
-
* @param entityNamePlural
|
|
84
|
-
* @param endpoint
|
|
85
|
-
* @param params
|
|
86
|
-
* @param resp
|
|
87
|
-
* @returns
|
|
88
|
-
*/
|
|
89
|
-
parseRequestResponse: <TEntity extends {
|
|
90
|
-
[P in IdKey]: PropertyKey;
|
|
91
|
-
}, IdKey extends string = 'id'>(entityName: string, entityNamePlural: string, endpoint: string, params: SPPageParams, resp: any) => {
|
|
92
|
-
total: number;
|
|
93
|
-
entities: TEntity[];
|
|
94
|
-
};
|
|
95
|
-
}
|
|
96
|
-
/**
|
|
97
|
-
* 'entity' is really TEntity arg of SPMatEntityListComponent<TEntity>.
|
|
98
|
-
* 'column' is the column name. This allows the same value function to support
|
|
99
|
-
* multiple columns further enabing DRY.
|
|
100
|
-
*/
|
|
101
|
-
export type COLUMN_VALUE_FN = (entity: any, column: string) => string | number | Date | boolean;
|
|
102
|
-
/**
|
|
103
|
-
* Global config for SPMatEntityList component.
|
|
104
|
-
*/
|
|
105
|
-
export interface SPMatEntityListConfig {
|
|
106
|
-
urlResolver?: (endpoint: string) => string;
|
|
107
|
-
paginator?: SPMatEntityListPaginator;
|
|
108
|
-
defaultPageSize?: number;
|
|
109
|
-
pageSizes?: Array<number>;
|
|
110
|
-
/**
|
|
111
|
-
* Provide a method to return the labels for the columns. This is useful when
|
|
112
|
-
* the columns are specified as the JSON object key names and the labels are
|
|
113
|
-
* to be transformed into a uniform manner (uppercase) or when the labels
|
|
114
|
-
* are to be dynamically localized. Note that the response can be an
|
|
115
|
-
* Observable<string> if the label is to be fetched/changed asynchronously
|
|
116
|
-
* (as that can happen in an app that supports dynamic changing of the UI
|
|
117
|
-
* language).
|
|
118
|
-
* @param entityName
|
|
119
|
-
* @param columnName
|
|
120
|
-
* @returns
|
|
121
|
-
*/
|
|
122
|
-
columnLabelFn?: (entityName: string, columnName: string) => string | Observable<string>;
|
|
123
|
-
}
|
|
124
|
-
/**
|
|
125
|
-
* Type for custom entities loader function, which if provided will be called
|
|
126
|
-
* instead of HttpClient.get.
|
|
127
|
-
*/
|
|
128
|
-
export type SPMatEntityListEntityLoaderFn = (params: any) => Observable<any>;
|