@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.
Files changed (119) hide show
  1. package/core/index.d.ts +3 -1
  2. package/entities/index.d.ts +313 -2
  3. package/entity-field/index.d.ts +101 -2
  4. package/fesm2022/smallpearl-ngx-helper-entities.mjs +18 -18
  5. package/fesm2022/smallpearl-ngx-helper-entities.mjs.map +1 -1
  6. package/fesm2022/smallpearl-ngx-helper-entity-field.mjs +5 -4
  7. package/fesm2022/smallpearl-ngx-helper-entity-field.mjs.map +1 -1
  8. package/fesm2022/smallpearl-ngx-helper-forms.mjs.map +1 -1
  9. package/fesm2022/smallpearl-ngx-helper-hover-dropdown.mjs +6 -6
  10. package/fesm2022/smallpearl-ngx-helper-hover-dropdown.mjs.map +1 -1
  11. package/fesm2022/smallpearl-ngx-helper-locale.mjs +6 -6
  12. package/fesm2022/smallpearl-ngx-helper-locale.mjs.map +1 -1
  13. package/fesm2022/smallpearl-ngx-helper-mat-busy-wheel.mjs +57 -31
  14. package/fesm2022/smallpearl-ngx-helper-mat-busy-wheel.mjs.map +1 -1
  15. package/fesm2022/smallpearl-ngx-helper-mat-context-menu.mjs +15 -15
  16. package/fesm2022/smallpearl-ngx-helper-mat-context-menu.mjs.map +1 -1
  17. package/fesm2022/smallpearl-ngx-helper-mat-entity-crud.mjs +346 -334
  18. package/fesm2022/smallpearl-ngx-helper-mat-entity-crud.mjs.map +1 -1
  19. package/fesm2022/smallpearl-ngx-helper-mat-entity-list.mjs +152 -146
  20. package/fesm2022/smallpearl-ngx-helper-mat-entity-list.mjs.map +1 -1
  21. package/fesm2022/smallpearl-ngx-helper-mat-file-input.mjs +5 -5
  22. package/fesm2022/smallpearl-ngx-helper-mat-file-input.mjs.map +1 -1
  23. package/fesm2022/smallpearl-ngx-helper-mat-form-error.mjs +19 -19
  24. package/fesm2022/smallpearl-ngx-helper-mat-form-error.mjs.map +1 -1
  25. package/fesm2022/smallpearl-ngx-helper-mat-select-entity.mjs +25 -26
  26. package/fesm2022/smallpearl-ngx-helper-mat-select-entity.mjs.map +1 -1
  27. package/fesm2022/smallpearl-ngx-helper-mat-select-infinite-scroll.mjs +7 -7
  28. package/fesm2022/smallpearl-ngx-helper-mat-select-infinite-scroll.mjs.map +1 -1
  29. package/fesm2022/smallpearl-ngx-helper-mat-side-menu-layout.mjs +24 -24
  30. package/fesm2022/smallpearl-ngx-helper-mat-side-menu-layout.mjs.map +1 -1
  31. package/fesm2022/smallpearl-ngx-helper-mat-tel-input.mjs +8 -9
  32. package/fesm2022/smallpearl-ngx-helper-mat-tel-input.mjs.map +1 -1
  33. package/fesm2022/smallpearl-ngx-helper-sideload.mjs.map +1 -1
  34. package/fesm2022/smallpearl-ngx-helper-stationary-with-line-items.mjs +35 -35
  35. package/fesm2022/smallpearl-ngx-helper-stationary-with-line-items.mjs.map +1 -1
  36. package/forms/index.d.ts +55 -1
  37. package/hover-dropdown/index.d.ts +44 -1
  38. package/index.d.ts +4 -5
  39. package/locale/index.d.ts +55 -5
  40. package/mat-busy-wheel/index.d.ts +165 -4
  41. package/mat-context-menu/index.d.ts +65 -1
  42. package/mat-entity-crud/index.d.ts +1075 -6
  43. package/mat-entity-list/index.d.ts +394 -3
  44. package/mat-file-input/index.d.ts +61 -1
  45. package/mat-form-error/index.d.ts +184 -6
  46. package/mat-select-entity/index.d.ts +194 -1
  47. package/mat-select-infinite-scroll/index.d.ts +45 -2
  48. package/mat-side-menu-layout/index.d.ts +180 -6
  49. package/mat-tel-input/index.d.ts +169 -2
  50. package/package.json +8 -8
  51. package/sideload/index.d.ts +20 -1
  52. package/stationary-with-line-items/index.d.ts +78 -1
  53. package/core/src/version.d.ts +0 -1
  54. package/entities/src/paged-loader.d.ts +0 -219
  55. package/entities/src/paginator.d.ts +0 -87
  56. package/entity-field/src/entity-field.d.ts +0 -70
  57. package/entity-field/src/provider.d.ts +0 -27
  58. package/forms/src/validation-error-handler.d.ts +0 -52
  59. package/hover-dropdown/src/hover-dropdown.directive.d.ts +0 -41
  60. package/locale/src/currency.pipe.d.ts +0 -14
  61. package/locale/src/date.pipe.d.ts +0 -14
  62. package/locale/src/format-currency.d.ts +0 -1
  63. package/locale/src/format-date.d.ts +0 -2
  64. package/locale/src/is-empty.d.ts +0 -1
  65. package/locale/src/providers.d.ts +0 -20
  66. package/mat-busy-wheel/src/busy-wheel-op.d.ts +0 -65
  67. package/mat-busy-wheel/src/busy-wheel.component.d.ts +0 -12
  68. package/mat-busy-wheel/src/busy-wheel.service.d.ts +0 -42
  69. package/mat-busy-wheel/src/host-busy-wheel.directive.d.ts +0 -35
  70. package/mat-context-menu/src/mat-context-menu.component.d.ts +0 -61
  71. package/mat-entity-crud/src/convert-context-input-to-http-context.d.ts +0 -11
  72. package/mat-entity-crud/src/default-config.d.ts +0 -9
  73. package/mat-entity-crud/src/form-view-host.component.d.ts +0 -41
  74. package/mat-entity-crud/src/mat-entity-crud-form-base.d.ts +0 -277
  75. package/mat-entity-crud/src/mat-entity-crud-internal-types.d.ts +0 -131
  76. package/mat-entity-crud/src/mat-entity-crud-item-action.d.ts +0 -68
  77. package/mat-entity-crud/src/mat-entity-crud-types.d.ts +0 -149
  78. package/mat-entity-crud/src/mat-entity-crud.component.d.ts +0 -366
  79. package/mat-entity-crud/src/preview-host.component.d.ts +0 -21
  80. package/mat-entity-crud/src/preview-pane.component.d.ts +0 -31
  81. package/mat-entity-crud/src/providers.d.ts +0 -3
  82. package/mat-entity-list/src/config.d.ts +0 -6
  83. package/mat-entity-list/src/mat-entity-list-types.d.ts +0 -128
  84. package/mat-entity-list/src/mat-entity-list.component.d.ts +0 -259
  85. package/mat-entity-list/src/providers.d.ts +0 -3
  86. package/mat-file-input/src/mat-file-input.component.d.ts +0 -58
  87. package/mat-form-error/src/locales/en.d.ts +0 -4
  88. package/mat-form-error/src/locales/hu.d.ts +0 -4
  89. package/mat-form-error/src/locales/index.d.ts +0 -5
  90. package/mat-form-error/src/locales/pt-br.d.ts +0 -4
  91. package/mat-form-error/src/locales/zh-hans.d.ts +0 -4
  92. package/mat-form-error/src/locales/zh-hant.d.ts +0 -4
  93. package/mat-form-error/src/ngx-error-list.component.d.ts +0 -9
  94. package/mat-form-error/src/ngx-mat-error-control.d.ts +0 -17
  95. package/mat-form-error/src/ngx-mat-error-def.directive.d.ts +0 -30
  96. package/mat-form-error/src/ngx-mat-errors-for-date-range-picker.directive.d.ts +0 -8
  97. package/mat-form-error/src/ngx-mat-errors.component.d.ts +0 -44
  98. package/mat-form-error/src/types.d.ts +0 -68
  99. package/mat-form-error/src/utils/coerce-to-observable.d.ts +0 -3
  100. package/mat-form-error/src/utils/distinct-until-error-changed.d.ts +0 -2
  101. package/mat-form-error/src/utils/find-error-for-control.d.ts +0 -9
  102. package/mat-form-error/src/utils/get-abstract-controls.d.ts +0 -3
  103. package/mat-form-error/src/utils/get-control-with-error.d.ts +0 -3
  104. package/mat-select-entity/src/mat-select-entity.component.d.ts +0 -190
  105. package/mat-select-infinite-scroll/src/mat-select-infinite-scroll.directive.d.ts +0 -19
  106. package/mat-select-infinite-scroll/src/mat-select-infinite-scroll.service.d.ts +0 -25
  107. package/mat-side-menu-layout/src/layout.service.d.ts +0 -23
  108. package/mat-side-menu-layout/src/mat-menu-layout.component.d.ts +0 -39
  109. package/mat-side-menu-layout/src/mat-menu-layout.module.d.ts +0 -18
  110. package/mat-side-menu-layout/src/mat-menu-list-item.component.d.ts +0 -36
  111. package/mat-side-menu-layout/src/mat-menu-pane.component.d.ts +0 -66
  112. package/mat-side-menu-layout/src/nav-item.d.ts +0 -10
  113. package/mat-tel-input/src/country-codes.d.ts +0 -5
  114. package/mat-tel-input/src/mat-telephone.component.d.ts +0 -129
  115. package/mat-tel-input/src/providers.d.ts +0 -38
  116. package/ngx-helper.d.ts +0 -2
  117. package/public-api.d.ts +0 -1
  118. package/sideload/src/sideload.d.ts +0 -18
  119. package/stationary-with-line-items/src/stationary-with-line-items.component.d.ts +0 -74
@@ -1,131 +0,0 @@
1
- import { HttpParams } from "@angular/common/http";
2
- import { SPContextMenuItem } from "@smallpearl/ngx-helper/mat-context-menu";
3
- import { Observable } from "rxjs";
4
- export declare const ITEM_ACTION_UPDATE = "_update_";
5
- export declare const ITEM_ACTION_DELETE = "_delete_";
6
- /**
7
- * SPMatEntityCrudCreateEditBridge implementer uses this interface to
8
- * communicate with the parent SPMatEntityCreateComponent. The bridge
9
- * component would use the hideCreateEdit() to close itself, when user cancels
10
- * the create/edit operation.
11
- */
12
- export interface SPMatEntityCrudComponentBase<TEntity extends {
13
- [P in IdKey]: PropertyKey;
14
- }, IdKey extends string = 'id'> {
15
- /**
16
- * Wrappers around entityName & entityNamePlural properties.
17
- */
18
- getEntityName(): string;
19
- getEntityNamePlural(): string;
20
- /**
21
- * Wrapper around idKey property.
22
- */
23
- getIdKey(): string;
24
- /**
25
- * This method should return the entity URL for the given entity id.
26
- * The entity URL should include any additional query parameters that were
27
- * passed to the SPMatEntityCrudComponentBase component's `url` property.
28
- * @param id
29
- */
30
- getEntityUrl(id: TEntity[IdKey] | undefined): string;
31
- /**
32
- * FormViewHostComponent will call this to close the Create/Edit pane.
33
- * SPMatEntityCrudComponentBase implementor will destroy the client form
34
- * view and hide the Create/Edit form view pane and show the hidden
35
- * entity list view.
36
- * @returns
37
- */
38
- closeCreateEdit: (cancelled: boolean) => void;
39
- /**
40
- * Used internally by FormViewHostComponent to determine if the client form
41
- * view wants to intercept user's cancel the create/edit operation. Perhaps
42
- * with the Yes/No prompt 'Lose changes?'
43
- * @returns boolean indicating it's okay to cancel the create/edit operation.
44
- */
45
- canCancelEdit: () => boolean;
46
- /**
47
- * Client form view can register a callback that will be invoked by the
48
- * framework when user cancels the create/edit operation by clicking on the
49
- * close button on the top right.
50
- * @param callback
51
- * @returns
52
- */
53
- registerCanCancelEditCallback: (callback: () => boolean) => void;
54
- /**
55
- * Initiates update on the given entity.
56
- * @returns
57
- */
58
- triggerEntityUpdate: (entity: TEntity) => void;
59
- /**
60
- * Initiates entity delete.
61
- * @returns
62
- */
63
- triggerEntityDelete: (entity: TEntity) => void;
64
- /**
65
- * Called by client form-view host component to close a new entity.
66
- * @param entityValue The ReactiveForm.value object that the server expects
67
- * to create a new object.
68
- * @returns The new Entity object returned by the server. For typical REST
69
- * API, this would be of the same shape as the objects returned by the
70
- * REST's GET request.
71
- */
72
- create: (entityValue: any) => Observable<any>;
73
- /**
74
- * Called by client form-view host component to close a new entity.
75
- * @param id The id of the entity being edited.
76
- * @param entityValue The ReactiveForm.value object that the server expects
77
- * to update the new object.
78
- * @returns The new Entity object returned by the server. For typical REST
79
- * API, this would be of the same shape as the objects returned by the
80
- * REST's GET request.
81
- */
82
- update: (id: any, entityValue: any) => Observable<any>;
83
- /**
84
- * Close the preview pane.
85
- * @returns
86
- */
87
- closePreview: () => void;
88
- /**
89
- * Returns the context menu items for the entity. This can be used to build
90
- * the context menu for an entity in its preview pane toolbar.
91
- * @returns
92
- */
93
- getItemActions(entity?: TEntity): SPContextMenuItem[];
94
- /**
95
- * Returns the class to be used for the preview pane content. This interface
96
- * is provided to allow the PreviewPaneComponent to access the client
97
- * configured class for the preview pane content.
98
- */
99
- getPreviewPaneContentClass(): string;
100
- getFormPaneWrapperClass(): string;
101
- getFormPaneContentClass(): string;
102
- getItemLabel(): string | Observable<string>;
103
- getItemLabelPlural(): string | Observable<string>;
104
- removeEntity(id: TEntity[IdKey]): void;
105
- /**
106
- * Update the entity with the given id in the list of entities.
107
- * This is typically called by the client when it has performed an update
108
- * on the entity itself and want to reflect the resulting changed
109
- * entity in the list view.
110
- *
111
- * @param id The id of the entity to update.
112
- * @param data The updated entity.
113
- */
114
- updateEntity(id: TEntity[IdKey], data: TEntity): void;
115
- /**
116
- * Perform a custom action on the entity endpoint. The action is specified
117
- * by the verb argument, which will be used to derive the final URL. This
118
- * is keeping in line with DRF specification where viewsets can define
119
- * custom action methods, which translate into endpoints with the same name
120
- * ast he action method.
121
- * @param id id of the entity to perform the action on.
122
- * @param verb The action verb, which will be appended to the entity URL to
123
- * derive the final URL for the POST request.
124
- * @param addlParams additional query parameters to include in the request.
125
- * Called `additional` as these are in addition to the query params specified
126
- * in the CRUD's endpoint.
127
- * @param data the data to send with the request for the POST
128
- * @returns Observable<TEntity>
129
- */
130
- doEntityAction(id: TEntity[IdKey], verb: string, addlParams: HttpParams, data: any, busyWheelName: string): Observable<any>;
131
- }
@@ -1,68 +0,0 @@
1
- import { HttpParams } from "@angular/common/http";
2
- import { SPContextMenuItem } from "@smallpearl/ngx-helper/mat-context-menu";
3
- /**
4
- * Describes an action on an item in the MatEntityCrud component. Actions are
5
- * shown in the context menu for each entity in the MatEntityCrud component.
6
- * The action is triggered when the user selects the corresponding menu item.
7
- * There are two ways to handle the action when it is triggered (user selects
8
- * the corresponding menu item):
9
- *
10
- * 1. If the action's 'role' property is one of the predefined roles
11
- * ('_edit_', '_view_', '_delete_'), the MatEntityCrud component handles
12
- * the action internally by opening the corresponding dialog (edit/view)
13
- * or performing the delete operation.
14
- * 2. If the action maps to a HTTP REST API endpoint on the item at the server,
15
- * the MatEntityCrud component can perform the HTTP request. To enable this,
16
- * the application must set the action's 'behavior' property to 'http' and
17
- * if the REST request differs from the default POST to the entity's base URL
18
- * with the action's 'role' appended as the URL path, provide the necessary
19
- * HTTP request parameters in the 'httpRequestParameters' property.
20
- * 3. For all other actions, the MatEntityCrud component emits an 'action'
21
- * event with the action's 'role' and the entity as arguments. The
22
- * application can listen to this event and handle the action as needed.
23
- *
24
- * @template TEntity The type of the entity on which the action is performed.
25
- */
26
- export interface MatEntityCrudItemAction<TEntity extends {
27
- [P in IdKey]: PropertyKey;
28
- }, IdKey extends string = 'id'> extends SPContextMenuItem {
29
- /**
30
- * Optional confirmation prompt message to be shown to the user
31
- * before performing the action. If specified, the user must confirm
32
- * the action before it is executed.
33
- */
34
- confirmPrompt?: string;
35
- /**
36
- * Optional message to be shown to the user after the action is
37
- * successfully performed.
38
- */
39
- successMessage?: string;
40
- /**
41
- * Optional error message to be shown to the user if the action fails.
42
- */
43
- errorMessage?: string;
44
- /**
45
- * HTTP request parameters for actions that map to HTTP REST API
46
- * endpoints on the item at the server. This property is used when
47
- * 'actionBehavior' is set to 'http'.
48
- *
49
- * If not specified, and behavior is set to 'http', a POST request is
50
- * made to the entity's base URL with the action's 'role' appended
51
- * as the URL path.
52
- */
53
- httpRequestParameters?: {
54
- method: 'POST' | 'PUT' | 'PATCH' | 'DELETE';
55
- urlPath?: string;
56
- params?: HttpParams;
57
- body?: any;
58
- };
59
- /**
60
- * Custom handler function to be called when the action is triggered.
61
- * If provided, this function is called instead of the default handling
62
- * by the MatEntityCrud component. This property takes precedence over
63
- * `httpRequestParameters`.
64
- *
65
- * @param entity The entity on which the action is performed.
66
- */
67
- action?: (entity: TEntity) => void;
68
- }
@@ -1,149 +0,0 @@
1
- import { HttpContextToken } from "@angular/common/http";
2
- import { SPContextMenuItem } from "@smallpearl/ngx-helper/mat-context-menu";
3
- import { Observable } from "rxjs";
4
- /**
5
- * Prototype of the function to parse the CRUD action response.
6
- */
7
- export type SPMatEntityCrudResponseParser = (entityName: string, idKey: string, method: string, // 'create' | 'retrieve' | 'update' | 'delete',
8
- resp: any) => any | undefined;
9
- /**
10
- * Global config for SPMatEntityList component.
11
- */
12
- export interface SPMatEntityCrudConfig {
13
- /**
14
- * The item actions that will be shown for each item in the list.
15
- * This defaults to 'Update' & 'Delete' actions, but can be customized
16
- * by this property. Note the item actions can be set for individual
17
- * <sp-mat-entity-crud> component through its itemActions property.
18
- */
19
- defaultItemActions?: SPContextMenuItem[];
20
- /**
21
- * Global crud response parser.
22
- */
23
- crudOpResponseParser?: SPMatEntityCrudResponseParser;
24
- }
25
- /**
26
- * This is the interface through which the client provided CRUD form component
27
- * interacts with the 'host' SPMatEntityCrudComponent. When the form wants to
28
- * submit an entity to the server (for create or update), it should call the
29
- * one of the create or update methods. The interface also provides other
30
- * methods for the form component to interact with SPMatEntityCrudComponent
31
- * such as refresh its entities list, close the form pane, etc.
32
- *
33
- * The interface name has a 'Bridge' as the interface acts as a bridge between
34
- * the client provided form handler component and the host
35
- * SPMatEntityCrudComponent.
36
- */
37
- export interface SPMatEntityCrudCreateEditBridge {
38
- /**
39
- * Returns the entity name as provided to the host SPMatEntityCrudComponent.
40
- * @returns The entity name string.
41
- */
42
- getEntityName(): string;
43
- /**
44
- * Returns the entity id key as provided to the host SPMatEntityCrudComponent.
45
- * @returns The entity id key string.
46
- */
47
- getIdKey(): string;
48
- /**
49
- * Get Entity url
50
- * @param cancel
51
- * @returns
52
- */
53
- getEntityUrl(entityId: any): string;
54
- /**
55
- * Close the edit/update form pane. This WON'T call the 'cancelEditCallback'
56
- * even if one is registered.
57
- */
58
- close: (cancel: boolean) => void;
59
- /**
60
- * Client form view can register a callback that will be invoked by the
61
- * framework when user cancels the create/edit operation by clicking on the
62
- * close button on the top right.
63
- * @param callback
64
- * @returns None
65
- */
66
- registerCanCancelEditCallback: (callback: () => boolean) => void;
67
- /**
68
- * Create a new instance of TEntity, by sending a POST request to remote.
69
- * @param entityValue This is the typically the output of Reactive form's
70
- * form.value. Since this value's shape may be different from TEntity and is
71
- * known only to client form, we use 'any'.
72
- * @returns None
73
- * @inner Implementation will show a busy wheel centered on the form
74
- * view while the async function to update the object remains active.
75
- */
76
- create: (entityValue: any) => Observable<any>;
77
- /**
78
- * Update the entity with id `id` with new values in entityValue.
79
- * @param id TEntity id
80
- * @param entityValue Entity values to be updated.
81
- * @returns None
82
- * @inner Implementation will show a busy wheel centered on the form
83
- * view while the async function to update the object remains active.
84
- */
85
- update: (id: any, entityValue: any) => Observable<any>;
86
- }
87
- /**
88
- * Prototype of the function that will be used instead of HttpClient for
89
- * CRUD operations.
90
- * @param op - the CRUD operation being requested
91
- * @param entityValue - The entity or entity value upon which the operation
92
- * is being requested. for 'create' & 'update' this will be the value
93
- * of the reactive form. This is typically form.value or the 2nd arg to create
94
- * & update methods of SPMatEntityCrudCreateEditBridge.
95
- */
96
- export type CRUD_OP_FN<TEntity extends {
97
- [P in IdKey]: PropertyKey;
98
- }, IdKey extends string = 'id'> = (op: string, id: TEntity[IdKey] | undefined, // valid only for 'get', 'update' & 'delete'
99
- entityValue: any, // valid only for 'create' & 'update'
100
- entityCrudComponent: any) => Observable<TEntity | null>;
101
- export type ALLOW_ITEM_ACTION_FN<TEntity> = (entity: TEntity, action: string) => boolean;
102
- /**
103
- * This interface is used to define sub types for the "New {{item}}" button on
104
- * top of the CRUD UI. An array of these is provided as the value to the
105
- * component property 'newItemSubTypes'.
106
- */
107
- export interface NewItemSubType {
108
- /**
109
- * A role string that will be passed as argument to the (action) event
110
- * handler. This string allows the event handler to distinguish the selected
111
- * sub-type.
112
- *
113
- * The special keyword '_new_' can be used to activate the
114
- * `createEditTemplate` template if one is provided. In this case the params
115
- * element value (see below) can be used in the template to distinguish
116
- * between different menu items.
117
- */
118
- role: string;
119
- /**
120
- * Label displayed in the menu representing this role.
121
- */
122
- label: string;
123
- /**
124
- * Arbitrary value that will be passed to the 'createEditTemplate' in the
125
- * $implicit template context as 'params'. You can access this in the
126
- * template like below (see `data.params`):-
127
- ```
128
- <ng-template #createEdit let-data>
129
- <app-create-edit-entity-demo
130
- [bridge]="data.bridge"
131
- [entity]="data.entity"
132
- [params]="data.params"
133
- ></app-create-edit-entity-demo>
134
- </ng-template>
135
- ```
136
-
137
- If params is an object and it includes the key 'title', its value will be
138
- used as the title for the edit form.
139
- */
140
- params?: any;
141
- }
142
- export type CrudOp = 'create' | 'retrieve' | 'update' | 'delete' | undefined;
143
- export interface SPMatEntityCrudHttpContext {
144
- entityName: string;
145
- entityNamePlural: string;
146
- endpoint: string;
147
- op: CrudOp;
148
- }
149
- export declare const SP_MAT_ENTITY_CRUD_HTTP_CONTEXT: HttpContextToken<SPMatEntityCrudHttpContext>;