@decaf-ts/for-angular 0.0.11 → 0.0.13
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/package.json +19 -91
- package/LICENSE.md +0 -659
- package/dist/lib/README.md +0 -92
- package/dist/lib/assets/i18n/en.json +0 -140
- package/dist/lib/assets/images/angular-logo.svg +0 -45
- package/dist/lib/assets/images/decaf-logo-black.svg +0 -22
- package/dist/lib/assets/images/decaf-logo-lw.svg +0 -50
- package/dist/lib/assets/images/decaf-logo-white.svg +0 -22
- package/dist/lib/assets/images/decaf-logo.svg +0 -54
- package/dist/lib/components/component-renderer/component-renderer.component.d.ts +0 -276
- package/dist/lib/components/crud-field/crud-field.component.d.ts +0 -445
- package/dist/lib/components/crud-form/constants.d.ts +0 -5
- package/dist/lib/components/crud-form/crud-form.component.d.ts +0 -102
- package/dist/lib/components/crud-form/types.d.ts +0 -17
- package/dist/lib/components/empty-state/empty-state.component.d.ts +0 -301
- package/dist/lib/components/fieldset/fieldset.component.d.ts +0 -199
- package/dist/lib/components/filter/filter.component.d.ts +0 -505
- package/dist/lib/components/for-angular-components.module.d.ts +0 -20
- package/dist/lib/components/index.d.ts +0 -16
- package/dist/lib/components/layout/layout.component.d.ts +0 -133
- package/dist/lib/components/list/constants.d.ts +0 -29
- package/dist/lib/components/list/list.component.d.ts +0 -849
- package/dist/lib/components/list-item/list-item.component.d.ts +0 -390
- package/dist/lib/components/model-renderer/model-renderer.component.d.ts +0 -96
- package/dist/lib/components/pagination/constants.d.ts +0 -7
- package/dist/lib/components/pagination/pagination.component.d.ts +0 -264
- package/dist/lib/components/searchbar/searchbar.component.d.ts +0 -407
- package/dist/lib/directives/collapsable.directive.d.ts +0 -8
- package/dist/lib/directives/index.d.ts +0 -1
- package/dist/lib/engine/DynamicModule.d.ts +0 -17
- package/dist/lib/engine/NgxBaseComponent.d.ts +0 -541
- package/dist/lib/engine/NgxCrudFormField.d.ts +0 -118
- package/dist/lib/engine/NgxFormService.d.ts +0 -167
- package/dist/lib/engine/NgxRenderingEngine.d.ts +0 -127
- package/dist/lib/engine/NgxRenderingEngine2.d.ts +0 -250
- package/dist/lib/engine/ValidatorFactory.d.ts +0 -15
- package/dist/lib/engine/constants.d.ts +0 -151
- package/dist/lib/engine/decorators.d.ts +0 -25
- package/dist/lib/engine/index.d.ts +0 -16
- package/dist/lib/engine/types.d.ts +0 -381
- package/dist/lib/esm2022/components/component-renderer/component-renderer.component.mjs +0 -313
- package/dist/lib/esm2022/components/crud-field/crud-field.component.mjs +0 -301
- package/dist/lib/esm2022/components/crud-form/constants.mjs +0 -14
- package/dist/lib/esm2022/components/crud-form/crud-form.component.mjs +0 -139
- package/dist/lib/esm2022/components/crud-form/types.mjs +0 -2
- package/dist/lib/esm2022/components/empty-state/empty-state.component.mjs +0 -348
- package/dist/lib/esm2022/components/fieldset/fieldset.component.mjs +0 -225
- package/dist/lib/esm2022/components/filter/filter.component.mjs +0 -689
- package/dist/lib/esm2022/components/for-angular-components.module.mjs +0 -71
- package/dist/lib/esm2022/components/index.mjs +0 -20
- package/dist/lib/esm2022/components/layout/layout.component.mjs +0 -176
- package/dist/lib/esm2022/components/list/constants.mjs +0 -6
- package/dist/lib/esm2022/components/list/list.component.mjs +0 -1236
- package/dist/lib/esm2022/components/list-item/list-item.component.mjs +0 -408
- package/dist/lib/esm2022/components/model-renderer/model-renderer.component.mjs +0 -138
- package/dist/lib/esm2022/components/pagination/constants.mjs +0 -2
- package/dist/lib/esm2022/components/pagination/pagination.component.mjs +0 -323
- package/dist/lib/esm2022/components/searchbar/searchbar.component.mjs +0 -493
- package/dist/lib/esm2022/decaf-ts-for-angular.mjs +0 -5
- package/dist/lib/esm2022/directives/collapsable.directive.mjs +0 -28
- package/dist/lib/esm2022/directives/index.mjs +0 -2
- package/dist/lib/esm2022/engine/DynamicModule.mjs +0 -18
- package/dist/lib/esm2022/engine/NgxBaseComponent.mjs +0 -539
- package/dist/lib/esm2022/engine/NgxCrudFormField.mjs +0 -125
- package/dist/lib/esm2022/engine/NgxFormService.mjs +0 -315
- package/dist/lib/esm2022/engine/NgxRenderingEngine.mjs +0 -192
- package/dist/lib/esm2022/engine/NgxRenderingEngine2.mjs +0 -332
- package/dist/lib/esm2022/engine/ValidatorFactory.mjs +0 -102
- package/dist/lib/esm2022/engine/constants.mjs +0 -160
- package/dist/lib/esm2022/engine/decorators.mjs +0 -38
- package/dist/lib/esm2022/engine/index.mjs +0 -17
- package/dist/lib/esm2022/engine/types.mjs +0 -4
- package/dist/lib/esm2022/for-angular.module.mjs +0 -118
- package/dist/lib/esm2022/helpers/index.mjs +0 -13
- package/dist/lib/esm2022/helpers/utils.mjs +0 -415
- package/dist/lib/esm2022/interfaces.mjs +0 -2
- package/dist/lib/esm2022/public-apis.mjs +0 -14
- package/dist/lib/fesm2022/decaf-ts-for-angular.mjs +0 -7109
- package/dist/lib/fesm2022/decaf-ts-for-angular.mjs.map +0 -1
- package/dist/lib/for-angular.module.d.ts +0 -45
- package/dist/lib/helpers/index.d.ts +0 -12
- package/dist/lib/helpers/utils.d.ts +0 -253
- package/dist/lib/index.d.ts +0 -5
- package/dist/lib/interfaces.d.ts +0 -28
- package/dist/lib/public-apis.d.ts +0 -13
|
@@ -1,445 +0,0 @@
|
|
|
1
|
-
import { AfterViewInit, ElementRef, OnDestroy, OnInit } from '@angular/core';
|
|
2
|
-
import { FormControl, FormGroup } from '@angular/forms';
|
|
3
|
-
import { AutocompleteTypes, SelectInterface } from '@ionic/core';
|
|
4
|
-
import { CrudOperations } from '@decaf-ts/db-decorators';
|
|
5
|
-
import { NgxCrudFormField } from '../../engine/NgxCrudFormField';
|
|
6
|
-
import { FieldUpdateMode, PossibleInputTypes, RadioOption, SelectOption, StringOrBoolean } from '../../engine/types';
|
|
7
|
-
import * as i0 from "@angular/core";
|
|
8
|
-
/**
|
|
9
|
-
* @description A dynamic form field component for CRUD operations.
|
|
10
|
-
* @summary The CrudFieldComponent is a versatile form field component that adapts to different
|
|
11
|
-
* input types and CRUD operations. It extends NgxCrudFormField to inherit form handling capabilities
|
|
12
|
-
* and implements lifecycle hooks to properly initialize, render, and clean up. This component
|
|
13
|
-
* supports various input types (text, number, date, select, etc.), validation rules, and styling
|
|
14
|
-
* options, making it suitable for building dynamic forms for create, read, update, and delete
|
|
15
|
-
* operations.
|
|
16
|
-
*
|
|
17
|
-
* @param {CrudOperations} operation - The CRUD operation being performed (create, read, update, delete)
|
|
18
|
-
* @param {string} name - The field name, used as form control identifier
|
|
19
|
-
* @param {PossibleInputTypes} type - The input type (text, number, date, select, etc.)
|
|
20
|
-
* @param {string|number|Date} value - The initial value of the field
|
|
21
|
-
* @param {boolean} disabled - Whether the field is disabled
|
|
22
|
-
* @param {string} label - The display label for the field
|
|
23
|
-
* @param {string} placeholder - Placeholder text when field is empty
|
|
24
|
-
* @param {string} format - Format pattern for the field value
|
|
25
|
-
* @param {boolean} hidden - Whether the field should be hidden
|
|
26
|
-
* @param {number|Date} max - Maximum allowed value
|
|
27
|
-
* @param {number} maxlength - Maximum allowed length
|
|
28
|
-
* @param {number|Date} min - Minimum allowed value
|
|
29
|
-
* @param {number} minlength - Minimum allowed length
|
|
30
|
-
* @param {string} pattern - Validation pattern
|
|
31
|
-
* @param {boolean} readonly - Whether the field is read-only
|
|
32
|
-
* @param {boolean} required - Whether the field is required
|
|
33
|
-
* @param {number} step - Step value for number inputs
|
|
34
|
-
* @param {FormGroup} formGroup - The parent form group
|
|
35
|
-
* @param {StringOrBoolean} translatable - Whether field labels should be translated
|
|
36
|
-
*
|
|
37
|
-
* @component CrudFieldComponent
|
|
38
|
-
* @example
|
|
39
|
-
* <ngx-decaf-crud-field
|
|
40
|
-
* operation="create"
|
|
41
|
-
* name="firstName"
|
|
42
|
-
* type="text"
|
|
43
|
-
* label="<NAME>"
|
|
44
|
-
* placeholder="<NAME>"
|
|
45
|
-
* [value]="model.firstName"
|
|
46
|
-
* [disabled]="model.readOnly">
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
* @memberOf module:for-angular
|
|
50
|
-
*/
|
|
51
|
-
export declare class CrudFieldComponent extends NgxCrudFormField implements OnInit, OnDestroy, AfterViewInit {
|
|
52
|
-
/**
|
|
53
|
-
* @description The CRUD operation being performed.
|
|
54
|
-
* @summary Specifies which CRUD operation (Create, Read, Update, Delete) the field is being used for.
|
|
55
|
-
* This affects how the field behaves and is rendered. For example, fields might be read-only in
|
|
56
|
-
* 'read' mode but editable in 'create' or 'update' modes.
|
|
57
|
-
*
|
|
58
|
-
* @type {CrudOperations}
|
|
59
|
-
* @memberOf CrudFieldComponent
|
|
60
|
-
*/
|
|
61
|
-
operation: CrudOperations;
|
|
62
|
-
/**
|
|
63
|
-
* @summary The flat field name used as the form control identifier in immediate parent FormGroup.
|
|
64
|
-
* @description
|
|
65
|
-
* Specifies the name of the field, which is used as the FormControl identifier in immediate parent FormGroup.
|
|
66
|
-
* This value must be unique within the immediate parent FormGroup context and should not contain dots or nesting.
|
|
67
|
-
*
|
|
68
|
-
* @type {string}
|
|
69
|
-
* @memberOf CrudFieldComponent
|
|
70
|
-
*/
|
|
71
|
-
name: string;
|
|
72
|
-
/**
|
|
73
|
-
* @summary The full field path used for form control resolution.
|
|
74
|
-
* @description Specifies the hierarchical path of the field, used to resolve its location within the parent FormGroup (or nested FormGroups).
|
|
75
|
-
* It is used as the identifier in the rendered HTML, and may include nesting (e.g., 'address.billing.street') and
|
|
76
|
-
* should match the structure of the data model
|
|
77
|
-
*
|
|
78
|
-
* @type {string}
|
|
79
|
-
* @memberOf CrudFieldComponent
|
|
80
|
-
*/
|
|
81
|
-
path: string;
|
|
82
|
-
/**
|
|
83
|
-
* @description The parent field path, if this field is nested.
|
|
84
|
-
* @summary Specifies the full dot-delimited path of the parent field. This is only set when the field is nested.
|
|
85
|
-
*
|
|
86
|
-
* @type {string}
|
|
87
|
-
* @memberOf CrudFieldComponent
|
|
88
|
-
*/
|
|
89
|
-
childOf: string;
|
|
90
|
-
/**
|
|
91
|
-
* @description The input type of the field.
|
|
92
|
-
* @summary Defines the type of input to render, such as text, number, date, select, etc.
|
|
93
|
-
* This determines which Ionic form component will be used to render the field and how
|
|
94
|
-
* the data will be formatted and validated.
|
|
95
|
-
*
|
|
96
|
-
* @type {PossibleInputTypes}
|
|
97
|
-
* @memberOf CrudFieldComponent
|
|
98
|
-
*/
|
|
99
|
-
type: PossibleInputTypes;
|
|
100
|
-
/**
|
|
101
|
-
* @description The initial value of the field.
|
|
102
|
-
* @summary Sets the initial value of the form field. This can be a string, number, or Date
|
|
103
|
-
* depending on the field type. For select fields, this should match one of the option values.
|
|
104
|
-
*
|
|
105
|
-
* @type {string | number | Date}
|
|
106
|
-
* @default ''
|
|
107
|
-
* @memberOf CrudFieldComponent
|
|
108
|
-
*/
|
|
109
|
-
value: string | number | Date;
|
|
110
|
-
/**
|
|
111
|
-
* @description Whether the field is disabled.
|
|
112
|
-
* @summary When true, the field will be rendered in a disabled state, preventing user interaction.
|
|
113
|
-
* Disabled fields are still included in the form model but cannot be edited by the user.
|
|
114
|
-
*
|
|
115
|
-
* @type {boolean}
|
|
116
|
-
* @memberOf CrudFieldComponent
|
|
117
|
-
*/
|
|
118
|
-
disabled?: boolean;
|
|
119
|
-
/**
|
|
120
|
-
* @description The display label for the field.
|
|
121
|
-
* @summary The text label displayed alongside the field to identify it to the user.
|
|
122
|
-
* This label can be translated if the translatable property is set to true.
|
|
123
|
-
*
|
|
124
|
-
* @type {string}
|
|
125
|
-
* @memberOf CrudFieldComponent
|
|
126
|
-
*/
|
|
127
|
-
label: string;
|
|
128
|
-
/**
|
|
129
|
-
* @description Placeholder text when field is empty.
|
|
130
|
-
* @summary Text that appears in the input when it has no value. This provides a hint to the user
|
|
131
|
-
* about what kind of data is expected. The placeholder disappears when the user starts typing.
|
|
132
|
-
*
|
|
133
|
-
* @type {string}
|
|
134
|
-
* @memberOf CrudFieldComponent
|
|
135
|
-
*/
|
|
136
|
-
placeholder: string;
|
|
137
|
-
/**
|
|
138
|
-
* @description Format pattern for the field value.
|
|
139
|
-
* @summary Specifies a format pattern for the field value, which can be used for date formatting,
|
|
140
|
-
* number formatting, or other type-specific formatting requirements.
|
|
141
|
-
*
|
|
142
|
-
* @type {string}
|
|
143
|
-
* @memberOf CrudFieldComponent
|
|
144
|
-
*/
|
|
145
|
-
format?: string;
|
|
146
|
-
/**
|
|
147
|
-
* @description Whether the field should be hidden.
|
|
148
|
-
* @summary When true, the field will not be visible in the UI but will still be part of the form model.
|
|
149
|
-
* This is useful for fields that need to be included in form submission but should not be displayed to the user.
|
|
150
|
-
*
|
|
151
|
-
* @type {boolean}
|
|
152
|
-
* @memberOf CrudFieldComponent
|
|
153
|
-
*/
|
|
154
|
-
hidden?: boolean;
|
|
155
|
-
/**
|
|
156
|
-
* @description Maximum allowed value for the field.
|
|
157
|
-
* @summary For number inputs, this sets the maximum allowed numeric value.
|
|
158
|
-
* For date inputs, this sets the latest allowed date.
|
|
159
|
-
*
|
|
160
|
-
* @type {number | Date}
|
|
161
|
-
* @memberOf CrudFieldComponent
|
|
162
|
-
*/
|
|
163
|
-
max?: number | Date;
|
|
164
|
-
/**
|
|
165
|
-
* @description Maximum allowed length for text input.
|
|
166
|
-
* @summary For text inputs, this sets the maximum number of characters allowed.
|
|
167
|
-
* This is used for validation and may also be used to limit input in the UI.
|
|
168
|
-
*
|
|
169
|
-
* @type {number}
|
|
170
|
-
* @memberOf CrudFieldComponent
|
|
171
|
-
*/
|
|
172
|
-
maxlength?: number;
|
|
173
|
-
/**
|
|
174
|
-
* @description Minimum allowed value for the field.
|
|
175
|
-
* @summary For number inputs, this sets the minimum allowed numeric value.
|
|
176
|
-
* For date inputs, this sets the earliest allowed date.
|
|
177
|
-
*
|
|
178
|
-
* @type {number | Date}
|
|
179
|
-
* @memberOf CrudFieldComponent
|
|
180
|
-
*/
|
|
181
|
-
min?: number | Date;
|
|
182
|
-
/**
|
|
183
|
-
* @description Minimum allowed length for text input.
|
|
184
|
-
* @summary For text inputs, this sets the minimum number of characters required.
|
|
185
|
-
* This is used for validation to ensure the input meets a minimum length requirement.
|
|
186
|
-
*
|
|
187
|
-
* @type {number}
|
|
188
|
-
* @memberOf CrudFieldComponent
|
|
189
|
-
*/
|
|
190
|
-
minlength?: number;
|
|
191
|
-
/**
|
|
192
|
-
* @description Validation pattern for text input.
|
|
193
|
-
* @summary A regular expression pattern used to validate text input.
|
|
194
|
-
* The input value must match this pattern to be considered valid.
|
|
195
|
-
*
|
|
196
|
-
* @type {string}
|
|
197
|
-
* @memberOf CrudFieldComponent
|
|
198
|
-
*/
|
|
199
|
-
pattern?: string;
|
|
200
|
-
/**
|
|
201
|
-
* @description Whether the field is read-only.
|
|
202
|
-
* @summary When true, the field will be rendered in a read-only state. Unlike disabled fields,
|
|
203
|
-
* read-only fields are still focusable but cannot be modified by the user.
|
|
204
|
-
*
|
|
205
|
-
* @type {boolean}
|
|
206
|
-
* @memberOf CrudFieldComponent
|
|
207
|
-
*/
|
|
208
|
-
readonly?: boolean;
|
|
209
|
-
/**
|
|
210
|
-
* @description Whether the field is required.
|
|
211
|
-
* @summary When true, the field must have a value for the form to be valid.
|
|
212
|
-
* Required fields are typically marked with an indicator in the UI.
|
|
213
|
-
*
|
|
214
|
-
* @type {boolean}
|
|
215
|
-
* @memberOf CrudFieldComponent
|
|
216
|
-
*/
|
|
217
|
-
required?: boolean;
|
|
218
|
-
/**
|
|
219
|
-
* @description Step value for number inputs.
|
|
220
|
-
* @summary For number inputs, this sets the increment/decrement step when using
|
|
221
|
-
* the up/down arrows or when using a range slider.
|
|
222
|
-
*
|
|
223
|
-
* @type {number}
|
|
224
|
-
* @memberOf CrudFieldComponent
|
|
225
|
-
*/
|
|
226
|
-
step?: number;
|
|
227
|
-
/**
|
|
228
|
-
* @description Field name for equals comparison.
|
|
229
|
-
* @type {string}
|
|
230
|
-
* @memberOf CrudFieldComponent
|
|
231
|
-
*/
|
|
232
|
-
equals?: string;
|
|
233
|
-
/**
|
|
234
|
-
* @description Field name for different comparison.
|
|
235
|
-
* @type {string}
|
|
236
|
-
* @memberOf CrudFieldComponent
|
|
237
|
-
*/
|
|
238
|
-
different?: string;
|
|
239
|
-
/**
|
|
240
|
-
* @description Field name for less than comparison.
|
|
241
|
-
* @type {string}
|
|
242
|
-
* @memberOf CrudFieldComponent
|
|
243
|
-
*/
|
|
244
|
-
lessThan?: string;
|
|
245
|
-
/**
|
|
246
|
-
* @description Field name for less than or equal comparison.
|
|
247
|
-
* @type {string}
|
|
248
|
-
* @memberOf CrudFieldComponent
|
|
249
|
-
*/
|
|
250
|
-
lessThanOrEqual?: string;
|
|
251
|
-
/**
|
|
252
|
-
* @description Field name for greater than comparison.
|
|
253
|
-
* @type {string}
|
|
254
|
-
* @memberOf CrudFieldComponent
|
|
255
|
-
*/
|
|
256
|
-
greaterThan?: string;
|
|
257
|
-
/**
|
|
258
|
-
* @description Field name for greater than or equal comparison.
|
|
259
|
-
* @type {string}
|
|
260
|
-
* @memberOf CrudFieldComponent
|
|
261
|
-
*/
|
|
262
|
-
greaterThanOrEqual?: string;
|
|
263
|
-
/**
|
|
264
|
-
* @description Number of columns for textarea inputs.
|
|
265
|
-
* @summary For textarea inputs, this sets the visible width of the text area in average character widths.
|
|
266
|
-
* This is used alongside rows to define the dimensions of the textarea.
|
|
267
|
-
*
|
|
268
|
-
* @type {number}
|
|
269
|
-
* @memberOf CrudFieldComponent
|
|
270
|
-
*/
|
|
271
|
-
cols?: number;
|
|
272
|
-
/**
|
|
273
|
-
* @description Number of rows for textarea inputs.
|
|
274
|
-
* @summary For textarea inputs, this sets the visible height of the text area in lines of text.
|
|
275
|
-
* This is used alongside cols to define the dimensions of the textarea.
|
|
276
|
-
*
|
|
277
|
-
* @type {number}
|
|
278
|
-
* @memberOf CrudFieldComponent
|
|
279
|
-
*/
|
|
280
|
-
rows?: number;
|
|
281
|
-
/**
|
|
282
|
-
* @description Alignment of the field content.
|
|
283
|
-
* @summary Controls the horizontal alignment of the field content.
|
|
284
|
-
* This affects how the content is positioned within the field container.
|
|
285
|
-
*
|
|
286
|
-
* @type {'start' | 'center'}
|
|
287
|
-
* @memberOf CrudFieldComponent
|
|
288
|
-
*/
|
|
289
|
-
alignment?: 'start' | 'center';
|
|
290
|
-
/**
|
|
291
|
-
* @description Initial checked state for checkbox or toggle inputs.
|
|
292
|
-
* @summary For checkbox or toggle inputs, this sets the initial checked state.
|
|
293
|
-
* When true, the checkbox or toggle will be initially checked.
|
|
294
|
-
*
|
|
295
|
-
* @type {boolean}
|
|
296
|
-
* @memberOf CrudFieldComponent
|
|
297
|
-
*/
|
|
298
|
-
checked?: boolean;
|
|
299
|
-
/**
|
|
300
|
-
* @description Justification of items within the field.
|
|
301
|
-
* @summary Controls how items are justified within the field container.
|
|
302
|
-
* This is particularly useful for fields with multiple elements, such as radio groups.
|
|
303
|
-
*
|
|
304
|
-
* @type {'start' | 'end' | 'space-between'}
|
|
305
|
-
* @memberOf CrudFieldComponent
|
|
306
|
-
*/
|
|
307
|
-
justify?: 'start' | 'end' | 'space-between';
|
|
308
|
-
/**
|
|
309
|
-
* @description Text for the cancel button in select inputs.
|
|
310
|
-
* @summary For select inputs with a cancel button, this sets the text displayed on the cancel button.
|
|
311
|
-
* This is typically used in select dialogs to provide a way for users to dismiss the selection without making a change.
|
|
312
|
-
*
|
|
313
|
-
* @type {string}
|
|
314
|
-
* @memberOf CrudFieldComponent
|
|
315
|
-
*/
|
|
316
|
-
cancelText?: string;
|
|
317
|
-
/**
|
|
318
|
-
* @description Interface style for select inputs.
|
|
319
|
-
* @summary Specifies the interface style for select inputs, such as 'alert', 'action-sheet', or 'popover'.
|
|
320
|
-
* This determines how the select options are presented to the user.
|
|
321
|
-
*
|
|
322
|
-
* @type {SelectInterface}
|
|
323
|
-
* @memberOf CrudFieldComponent
|
|
324
|
-
*/
|
|
325
|
-
interface: SelectInterface;
|
|
326
|
-
/**
|
|
327
|
-
* @description Options for select or radio inputs.
|
|
328
|
-
* @summary Provides the list of options for select or radio inputs. Each option can have a value and a label.
|
|
329
|
-
* This is used to populate the dropdown or radio group with choices.
|
|
330
|
-
*
|
|
331
|
-
* @type {SelectOption[] | RadioOption[]}
|
|
332
|
-
* @memberOf CrudFieldComponent
|
|
333
|
-
*/
|
|
334
|
-
options: SelectOption[] | RadioOption[];
|
|
335
|
-
/**
|
|
336
|
-
* @description Mode of the field.
|
|
337
|
-
* @summary Specifies the visual mode of the field, such as 'ios' or 'md'.
|
|
338
|
-
* This affects the styling and appearance of the field to match the platform style.
|
|
339
|
-
*
|
|
340
|
-
* @type {'ios' | 'md'}
|
|
341
|
-
* @memberOf CrudFieldComponent
|
|
342
|
-
*/
|
|
343
|
-
mode?: 'ios' | 'md';
|
|
344
|
-
/**
|
|
345
|
-
* @description Spellcheck attribute for text inputs.
|
|
346
|
-
* @summary Enables or disables spellchecking for text inputs.
|
|
347
|
-
* When true, the browser will check the spelling of the input text.
|
|
348
|
-
*
|
|
349
|
-
* @type {boolean}
|
|
350
|
-
* @default false
|
|
351
|
-
* @memberOf CrudFieldComponent
|
|
352
|
-
*/
|
|
353
|
-
spellcheck: boolean;
|
|
354
|
-
/**
|
|
355
|
-
* @description Input mode for text inputs.
|
|
356
|
-
* @summary Hints at the type of data that might be entered by the user while editing the element.
|
|
357
|
-
* This can affect the virtual keyboard layout on mobile devices.
|
|
358
|
-
*
|
|
359
|
-
* @type {'none' | 'text' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search'}
|
|
360
|
-
* @default 'none'
|
|
361
|
-
* @memberOf CrudFieldComponent
|
|
362
|
-
*/
|
|
363
|
-
inputmode: 'none' | 'text' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search';
|
|
364
|
-
/**
|
|
365
|
-
* @description Autocomplete behavior for the field.
|
|
366
|
-
* @summary Specifies whether and how the browser should automatically complete the input.
|
|
367
|
-
* This can improve user experience by suggesting previously entered values.
|
|
368
|
-
*
|
|
369
|
-
* @type {AutocompleteTypes}
|
|
370
|
-
* @default 'off'
|
|
371
|
-
* @memberOf CrudFieldComponent
|
|
372
|
-
*/
|
|
373
|
-
autocomplete: AutocompleteTypes;
|
|
374
|
-
/**
|
|
375
|
-
* @description Fill style for the field.
|
|
376
|
-
* @summary Determines the fill style of the field, such as 'outline' or 'solid'.
|
|
377
|
-
* This affects the border and background of the field.
|
|
378
|
-
*
|
|
379
|
-
* @type {'outline' | 'solid'}
|
|
380
|
-
* @default 'outline'
|
|
381
|
-
* @memberOf CrudFieldComponent
|
|
382
|
-
*/
|
|
383
|
-
fill: 'outline' | 'solid';
|
|
384
|
-
/**
|
|
385
|
-
* @description Placement of the label relative to the field.
|
|
386
|
-
* @summary Specifies where the label should be placed relative to the field.
|
|
387
|
-
* Options include 'start', 'end', 'floating', 'stacked', and 'fixed'.
|
|
388
|
-
*
|
|
389
|
-
* @type {'start' | 'end' | 'floating' | 'stacked' | 'fixed'}
|
|
390
|
-
* @default 'floating'
|
|
391
|
-
* @memberOf CrudFieldComponent
|
|
392
|
-
*/
|
|
393
|
-
labelPlacement: 'start' | 'end' | 'floating' | 'stacked' | 'fixed';
|
|
394
|
-
/**
|
|
395
|
-
* @description Update mode for the field.
|
|
396
|
-
* @summary Determines when the field value should be updated in the form model.
|
|
397
|
-
* Options include 'change', 'blur', and 'submit'.
|
|
398
|
-
*
|
|
399
|
-
* @type {FieldUpdateMode}
|
|
400
|
-
* @default 'change'
|
|
401
|
-
* @memberOf CrudFieldComponent
|
|
402
|
-
*/
|
|
403
|
-
updateOn: FieldUpdateMode;
|
|
404
|
-
/**
|
|
405
|
-
* @description Reference to the field component.
|
|
406
|
-
* @summary Provides a reference to the field component element, allowing direct access to its properties and methods.
|
|
407
|
-
*
|
|
408
|
-
* @type {ElementRef}
|
|
409
|
-
* @memberOf CrudFieldComponent
|
|
410
|
-
*/
|
|
411
|
-
component: ElementRef;
|
|
412
|
-
/**
|
|
413
|
-
* @description Parent form group.
|
|
414
|
-
* @summary References the parent form group to which this field belongs.
|
|
415
|
-
* This is necessary for integrating the field with Angular's reactive forms.
|
|
416
|
-
*
|
|
417
|
-
* @type {FormGroup}
|
|
418
|
-
* @memberOf CrudFieldComponent
|
|
419
|
-
*/
|
|
420
|
-
formGroup: FormGroup | undefined;
|
|
421
|
-
formControl: FormControl;
|
|
422
|
-
/**
|
|
423
|
-
* @description Translatability of field labels.
|
|
424
|
-
* @summary Indicates whether the field labels should be translated based on the current language settings.
|
|
425
|
-
* This is useful for applications supporting multiple languages.
|
|
426
|
-
*
|
|
427
|
-
* @type {StringOrBoolean}
|
|
428
|
-
* @default true
|
|
429
|
-
* @memberOf CrudFieldComponent
|
|
430
|
-
*/
|
|
431
|
-
translatable: StringOrBoolean;
|
|
432
|
-
/**
|
|
433
|
-
* @description Unique identifier for the current record.
|
|
434
|
-
* @summary A unique identifier for the current record being displayed or manipulated.
|
|
435
|
-
* This is typically used in conjunction with the primary key for operations on specific records.
|
|
436
|
-
*
|
|
437
|
-
* @type {string | number}
|
|
438
|
-
*/
|
|
439
|
-
uid: string | number | undefined;
|
|
440
|
-
ngOnInit(): void;
|
|
441
|
-
ngAfterViewInit(): void;
|
|
442
|
-
ngOnDestroy(): void;
|
|
443
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<CrudFieldComponent, never>;
|
|
444
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<CrudFieldComponent, "ngx-decaf-crud-field", never, { "operation": { "alias": "operation"; "required": true; }; "name": { "alias": "name"; "required": true; }; "path": { "alias": "path"; "required": true; }; "childOf": { "alias": "childOf"; "required": false; }; "type": { "alias": "type"; "required": true; }; "value": { "alias": "value"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "label": { "alias": "label"; "required": true; }; "placeholder": { "alias": "placeholder"; "required": false; }; "format": { "alias": "format"; "required": false; }; "hidden": { "alias": "hidden"; "required": false; }; "max": { "alias": "max"; "required": false; }; "maxlength": { "alias": "maxlength"; "required": false; }; "min": { "alias": "min"; "required": false; }; "minlength": { "alias": "minlength"; "required": false; }; "pattern": { "alias": "pattern"; "required": false; }; "readonly": { "alias": "readonly"; "required": false; }; "required": { "alias": "required"; "required": false; }; "step": { "alias": "step"; "required": false; }; "equals": { "alias": "equals"; "required": false; }; "different": { "alias": "different"; "required": false; }; "lessThan": { "alias": "lessThan"; "required": false; }; "lessThanOrEqual": { "alias": "lessThanOrEqual"; "required": false; }; "greaterThan": { "alias": "greaterThan"; "required": false; }; "greaterThanOrEqual": { "alias": "greaterThanOrEqual"; "required": false; }; "cols": { "alias": "cols"; "required": false; }; "rows": { "alias": "rows"; "required": false; }; "alignment": { "alias": "alignment"; "required": false; }; "checked": { "alias": "checked"; "required": false; }; "justify": { "alias": "justify"; "required": false; }; "cancelText": { "alias": "cancelText"; "required": false; }; "interface": { "alias": "interface"; "required": false; }; "options": { "alias": "options"; "required": false; }; "mode": { "alias": "mode"; "required": false; }; "spellcheck": { "alias": "spellcheck"; "required": false; }; "inputmode": { "alias": "inputmode"; "required": false; }; "autocomplete": { "alias": "autocomplete"; "required": false; }; "fill": { "alias": "fill"; "required": false; }; "labelPlacement": { "alias": "labelPlacement"; "required": false; }; "updateOn": { "alias": "updateOn"; "required": false; }; "formGroup": { "alias": "formGroup"; "required": false; }; "formControl": { "alias": "formControl"; "required": false; }; "translatable": { "alias": "translatable"; "required": false; }; "uid": { "alias": "uid"; "required": false; }; }, {}, never, never, true, never>;
|
|
445
|
-
}
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
import { ElementRef, EventEmitter, OnDestroy, OnInit } from '@angular/core';
|
|
2
|
-
import { FormGroup } from '@angular/forms';
|
|
3
|
-
import { FormElement } from '../../interfaces';
|
|
4
|
-
import { CrudFormEvent, FieldUpdateMode, HTMLFormTarget, RenderedModel } from '../../engine';
|
|
5
|
-
import { CrudFormOptions } from './types';
|
|
6
|
-
import { CrudOperations, OperationKeys } from '@decaf-ts/db-decorators';
|
|
7
|
-
import { Model } from '@decaf-ts/decorator-validation';
|
|
8
|
-
import * as i0 from "@angular/core";
|
|
9
|
-
/**
|
|
10
|
-
* @component CrudFormComponent
|
|
11
|
-
* @example <ngx-decaf-crud-form
|
|
12
|
-
* action="create"
|
|
13
|
-
* operation="create"
|
|
14
|
-
* formGroup="formGroup"
|
|
15
|
-
* rendererId="rendererId"
|
|
16
|
-
* submitEvent="submitEvent"
|
|
17
|
-
* target="_self"
|
|
18
|
-
* method="event">
|
|
19
|
-
* </ngx-decaf-crud-form>
|
|
20
|
-
*
|
|
21
|
-
* @param {string} action - The action to be performed (create, read, update, delete)
|
|
22
|
-
* @param {CrudOperations} operation - The CRUD operation being performed (create, read, update, delete)
|
|
23
|
-
* @param {FormGroup} formGroup - The form group
|
|
24
|
-
* @param {string} rendererId - The renderer id
|
|
25
|
-
* @param {SubmitEvent} submitEvent - The submit event
|
|
26
|
-
* @param {string} target - The target
|
|
27
|
-
* @param {string} method - The method
|
|
28
|
-
*/
|
|
29
|
-
export declare class CrudFormComponent implements OnInit, FormElement, OnDestroy, RenderedModel {
|
|
30
|
-
/**
|
|
31
|
-
* @description Repository model for data operations.
|
|
32
|
-
* @summary The data model repository that this component will use for CRUD operations.
|
|
33
|
-
* This provides a connection to the data layer for retrieving and manipulating data.
|
|
34
|
-
*
|
|
35
|
-
* @type {Model| undefined}
|
|
36
|
-
*/
|
|
37
|
-
model: Model | undefined;
|
|
38
|
-
updateOn: FieldUpdateMode;
|
|
39
|
-
component: ElementRef;
|
|
40
|
-
target: HTMLFormTarget;
|
|
41
|
-
method: 'get' | 'post' | 'event';
|
|
42
|
-
options: CrudFormOptions;
|
|
43
|
-
action?: string;
|
|
44
|
-
operation: CrudOperations;
|
|
45
|
-
handlers: Record<string, (...args: unknown[]) => unknown | Promise<unknown>>;
|
|
46
|
-
formGroup: FormGroup | undefined;
|
|
47
|
-
/**
|
|
48
|
-
* @description Path to the parent FormGroup, if nested.
|
|
49
|
-
* @summary Full dot-delimited path of the parent FormGroup. Set only when is part of a nested structure.
|
|
50
|
-
*
|
|
51
|
-
* @type {string}
|
|
52
|
-
* @memberOf CrudFormComponent
|
|
53
|
-
*/
|
|
54
|
-
childOf?: string;
|
|
55
|
-
rendererId: string;
|
|
56
|
-
/**
|
|
57
|
-
* @description Unique identifier for the current record.
|
|
58
|
-
* @summary A unique identifier for the current record being displayed or manipulated.
|
|
59
|
-
* This is typically used in conjunction with the primary key for operations on specific records.
|
|
60
|
-
*
|
|
61
|
-
* @type {string | number}
|
|
62
|
-
*/
|
|
63
|
-
uid: string | number | undefined;
|
|
64
|
-
submitEvent: EventEmitter<CrudFormEvent>;
|
|
65
|
-
/**
|
|
66
|
-
* @description Logger instance for the component.
|
|
67
|
-
* @summary Provides logging capabilities for the component, allowing for consistent
|
|
68
|
-
* and structured logging of information, warnings, and errors. This logger is initialized
|
|
69
|
-
* in the ngOnInit method using the getLogger function from the ForAngularModule.
|
|
70
|
-
*
|
|
71
|
-
* The logger is used throughout the component to record important events, debug information,
|
|
72
|
-
* and potential issues. It helps in monitoring the component's behavior, tracking the flow
|
|
73
|
-
* of operations, and facilitating easier debugging and maintenance.
|
|
74
|
-
*
|
|
75
|
-
* @type {Logger}
|
|
76
|
-
* @private
|
|
77
|
-
* @memberOf CrudFormComponent
|
|
78
|
-
*/
|
|
79
|
-
private logger;
|
|
80
|
-
/**
|
|
81
|
-
* @description Angular Location service.
|
|
82
|
-
* @summary Injected service that provides access to the browser's URL and history.
|
|
83
|
-
* This service is used for interacting with the browser's history API, allowing
|
|
84
|
-
* for back navigation and URL manipulation outside of Angular's router.
|
|
85
|
-
*
|
|
86
|
-
* @private
|
|
87
|
-
* @type {Location}
|
|
88
|
-
* @memberOf CrudFormComponent
|
|
89
|
-
*/
|
|
90
|
-
private location;
|
|
91
|
-
ngOnInit(): Promise<void>;
|
|
92
|
-
ngOnDestroy(): void;
|
|
93
|
-
/**
|
|
94
|
-
* @param {SubmitEvent} event
|
|
95
|
-
*/
|
|
96
|
-
submit(event: SubmitEvent): Promise<boolean | void>;
|
|
97
|
-
handleReset(): void;
|
|
98
|
-
handleDelete(): void;
|
|
99
|
-
protected readonly OperationKeys: typeof OperationKeys;
|
|
100
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<CrudFormComponent, never>;
|
|
101
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<CrudFormComponent, "ngx-decaf-crud-form", never, { "model": { "alias": "model"; "required": false; }; "updateOn": { "alias": "updateOn"; "required": false; }; "target": { "alias": "target"; "required": false; }; "method": { "alias": "method"; "required": false; }; "options": { "alias": "options"; "required": false; }; "action": { "alias": "action"; "required": false; }; "operation": { "alias": "operation"; "required": true; }; "handlers": { "alias": "handlers"; "required": false; }; "formGroup": { "alias": "formGroup"; "required": false; }; "childOf": { "alias": "childOf"; "required": false; }; "rendererId": { "alias": "rendererId"; "required": false; }; "uid": { "alias": "uid"; "required": false; }; }, { "submitEvent": "submitEvent"; }, never, ["*"], true, never>;
|
|
102
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export interface FormReactiveSubmitEvent {
|
|
2
|
-
data: Record<string, unknown>;
|
|
3
|
-
}
|
|
4
|
-
export interface CrudFormOptions {
|
|
5
|
-
buttons: {
|
|
6
|
-
submit: {
|
|
7
|
-
icon?: string;
|
|
8
|
-
iconSlot?: 'start' | 'end';
|
|
9
|
-
text?: string;
|
|
10
|
-
};
|
|
11
|
-
clear?: {
|
|
12
|
-
icon?: string;
|
|
13
|
-
iconSlot?: 'start' | 'end';
|
|
14
|
-
text?: string;
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
}
|