@covalent/dynamic-forms 10.4.0-beta.2 → 11.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/covalent-dynamic-forms.mjs +3 -5
- package/fesm2022/covalent-dynamic-forms.mjs.map +1 -1
- package/index.d.ts +352 -5
- package/package.json +5 -5
- package/lib/dynamic-element.component.d.ts +0 -102
- package/lib/dynamic-elements/dynamic-checkbox/dynamic-checkbox.component.d.ts +0 -11
- package/lib/dynamic-elements/dynamic-datepicker/dynamic-datepicker.component.d.ts +0 -17
- package/lib/dynamic-elements/dynamic-file-input/dynamic-file-input.component.d.ts +0 -15
- package/lib/dynamic-elements/dynamic-input/dynamic-input.component.d.ts +0 -19
- package/lib/dynamic-elements/dynamic-select/dynamic-select.component.d.ts +0 -16
- package/lib/dynamic-elements/dynamic-slide-toggle/dynamic-slide-toggle.component.d.ts +0 -11
- package/lib/dynamic-elements/dynamic-slider/dynamic-slider.component.d.ts +0 -17
- package/lib/dynamic-elements/dynamic-textarea/dynamic-textarea.component.d.ts +0 -14
- package/lib/dynamic-forms.component.d.ts +0 -68
- package/lib/dynamic-forms.module.d.ts +0 -16
- package/lib/services/dynamic-forms.service.d.ts +0 -74
- package/public_api.d.ts +0 -12
package/index.d.ts
CHANGED
|
@@ -1,5 +1,352 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Type, Provider, TemplateRef, ViewContainerRef, ChangeDetectorRef, OnInit, OnChanges, Injector, SimpleChanges, AfterContentInit, OnDestroy, QueryList } from '@angular/core';
|
|
3
|
+
import { ValidatorFn, UntypedFormControl, AbstractControl, UntypedFormGroup, UntypedFormBuilder } from '@angular/forms';
|
|
4
|
+
import { CdkPortal } from '@angular/cdk/portal';
|
|
5
|
+
import { IControlValueAccessor } from '@covalent/core/common';
|
|
6
|
+
|
|
7
|
+
declare enum TdDynamicType {
|
|
8
|
+
Text = "text",
|
|
9
|
+
Boolean = "boolean",
|
|
10
|
+
Number = "number",
|
|
11
|
+
Array = "array",
|
|
12
|
+
Date = "date"
|
|
13
|
+
}
|
|
14
|
+
declare enum TdDynamicElement {
|
|
15
|
+
Input = "input",
|
|
16
|
+
Datepicker = "datepicker",
|
|
17
|
+
Password = "password",
|
|
18
|
+
Textarea = "textarea",
|
|
19
|
+
Slider = "slider",
|
|
20
|
+
SlideToggle = "slide-toggle",
|
|
21
|
+
Checkbox = "checkbox",
|
|
22
|
+
Select = "select",
|
|
23
|
+
FileInput = "file-input"
|
|
24
|
+
}
|
|
25
|
+
interface ITdDynamicElementValidator {
|
|
26
|
+
validator: ValidatorFn;
|
|
27
|
+
}
|
|
28
|
+
interface ITdDynamicElementCustomConfig {
|
|
29
|
+
[name: string]: any;
|
|
30
|
+
}
|
|
31
|
+
interface ITdDynamicElementConfig {
|
|
32
|
+
label?: string;
|
|
33
|
+
name: string;
|
|
34
|
+
hint?: string;
|
|
35
|
+
type: TdDynamicType | TdDynamicElement | Type<any>;
|
|
36
|
+
required?: boolean;
|
|
37
|
+
disabled?: boolean;
|
|
38
|
+
min?: any;
|
|
39
|
+
max?: any;
|
|
40
|
+
minLength?: any;
|
|
41
|
+
maxLength?: any;
|
|
42
|
+
selections?: string[] | {
|
|
43
|
+
value: any;
|
|
44
|
+
label: string;
|
|
45
|
+
}[];
|
|
46
|
+
multiple?: boolean;
|
|
47
|
+
default?: any;
|
|
48
|
+
flex?: number;
|
|
49
|
+
validators?: ITdDynamicElementValidator[];
|
|
50
|
+
customConfig?: ITdDynamicElementCustomConfig;
|
|
51
|
+
placeholder?: string;
|
|
52
|
+
}
|
|
53
|
+
declare const DYNAMIC_ELEMENT_NAME_REGEX: RegExp;
|
|
54
|
+
declare class TdDynamicFormsService {
|
|
55
|
+
/**
|
|
56
|
+
* Method to validate if the [name] is a proper element name.
|
|
57
|
+
* Throws error if name is not valid.
|
|
58
|
+
*/
|
|
59
|
+
validateDynamicElementName(name: string): void;
|
|
60
|
+
/**
|
|
61
|
+
* Gets component to be rendered depending on [TdDynamicElement | TdDynamicType]
|
|
62
|
+
* Throws error if it does not exists or not supported.
|
|
63
|
+
*/
|
|
64
|
+
getDynamicElement(element: TdDynamicElement | TdDynamicType | Type<any> | undefined): any;
|
|
65
|
+
/**
|
|
66
|
+
* Creates form control for element depending [ITdDynamicElementConfig] properties.
|
|
67
|
+
*/
|
|
68
|
+
createFormControl(config: ITdDynamicElementConfig): UntypedFormControl;
|
|
69
|
+
/**
|
|
70
|
+
* Creates form validationdepending [ITdDynamicElementConfig] properties.
|
|
71
|
+
*/
|
|
72
|
+
createValidators(config: ITdDynamicElementConfig): ValidatorFn | null;
|
|
73
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TdDynamicFormsService, never>;
|
|
74
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<TdDynamicFormsService>;
|
|
75
|
+
}
|
|
76
|
+
declare function DYNAMIC_FORMS_PROVIDER_FACTORY(parent: TdDynamicFormsService): TdDynamicFormsService;
|
|
77
|
+
declare const DYNAMIC_FORMS_PROVIDER: Provider;
|
|
78
|
+
|
|
79
|
+
declare class TdDynamicElementBase {
|
|
80
|
+
_changeDetectorRef: ChangeDetectorRef;
|
|
81
|
+
constructor(_changeDetectorRef: ChangeDetectorRef);
|
|
82
|
+
}
|
|
83
|
+
declare const _TdDynamicElementMixinBase: (new (...args: any[]) => IControlValueAccessor) & typeof TdDynamicElementBase;
|
|
84
|
+
declare class TdDynamicFormsErrorTemplateDirective extends CdkPortal {
|
|
85
|
+
templateRef: TemplateRef<any>;
|
|
86
|
+
tdDynamicFormsError?: string;
|
|
87
|
+
constructor(templateRef: TemplateRef<any>, viewContainerRef: ViewContainerRef);
|
|
88
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TdDynamicFormsErrorTemplateDirective, never>;
|
|
89
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<TdDynamicFormsErrorTemplateDirective, "[tdDynamicFormsError]ng-template", never, { "tdDynamicFormsError": { "alias": "tdDynamicFormsError"; "required": false; }; }, {}, never, never, true, never>;
|
|
90
|
+
}
|
|
91
|
+
declare class TdDynamicElementDirective {
|
|
92
|
+
viewContainer: ViewContainerRef;
|
|
93
|
+
constructor(viewContainer: ViewContainerRef);
|
|
94
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TdDynamicElementDirective, never>;
|
|
95
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<TdDynamicElementDirective, "[tdDynamicContainer]", never, {}, {}, never, never, true, never>;
|
|
96
|
+
}
|
|
97
|
+
declare class TdDynamicElementComponent extends _TdDynamicElementMixinBase implements IControlValueAccessor, OnInit, OnChanges {
|
|
98
|
+
private _injector;
|
|
99
|
+
private _dynamicFormsService;
|
|
100
|
+
private _instance;
|
|
101
|
+
/**
|
|
102
|
+
* Sets form control of the element.
|
|
103
|
+
*/
|
|
104
|
+
dynamicControl: AbstractControl;
|
|
105
|
+
/**
|
|
106
|
+
* Sets label to be displayed.
|
|
107
|
+
*/
|
|
108
|
+
label: string;
|
|
109
|
+
/**
|
|
110
|
+
* Sets hint to be displayed.
|
|
111
|
+
*/
|
|
112
|
+
hint?: string | undefined;
|
|
113
|
+
/**
|
|
114
|
+
* Sets name to be displayed as attribute.
|
|
115
|
+
*/
|
|
116
|
+
name: string;
|
|
117
|
+
/**
|
|
118
|
+
* Sets type or element of element to be rendered.
|
|
119
|
+
* Throws error if does not exist or no supported.
|
|
120
|
+
*/
|
|
121
|
+
type?: TdDynamicElement | TdDynamicType | Type<any>;
|
|
122
|
+
/**
|
|
123
|
+
* Sets required validation checkup (if supported by element).
|
|
124
|
+
*/
|
|
125
|
+
required?: boolean | string | undefined;
|
|
126
|
+
/**
|
|
127
|
+
* Sets min validation checkup (if supported by element).
|
|
128
|
+
*/
|
|
129
|
+
min?: number;
|
|
130
|
+
/**
|
|
131
|
+
* Sets max validation checkup (if supported by element).
|
|
132
|
+
*/
|
|
133
|
+
max?: number;
|
|
134
|
+
/**
|
|
135
|
+
* Sets minLength validation checkup (if supported by element).
|
|
136
|
+
*/
|
|
137
|
+
minLength?: number;
|
|
138
|
+
/**
|
|
139
|
+
* Sets maxLength validation checkup (if supported by element).
|
|
140
|
+
*/
|
|
141
|
+
maxLength?: number;
|
|
142
|
+
/**
|
|
143
|
+
* Sets selections for array elements (if supported by element).
|
|
144
|
+
*/
|
|
145
|
+
selections?: any[];
|
|
146
|
+
/**
|
|
147
|
+
* Sets multiple property for array elements (if supported by element).
|
|
148
|
+
*/
|
|
149
|
+
multiple?: boolean;
|
|
150
|
+
/**
|
|
151
|
+
* Sets any additional properties on custom component.
|
|
152
|
+
*/
|
|
153
|
+
customConfig?: ITdDynamicElementCustomConfig;
|
|
154
|
+
/**
|
|
155
|
+
* Sets error message template so it can be injected into dynamic components.
|
|
156
|
+
*/
|
|
157
|
+
errorMessageTemplate: TemplateRef<any> | undefined;
|
|
158
|
+
/**
|
|
159
|
+
* Sets the placeholder message
|
|
160
|
+
*/
|
|
161
|
+
placeholder?: string | undefined;
|
|
162
|
+
childElement: TdDynamicElementDirective;
|
|
163
|
+
get maxAttr(): any;
|
|
164
|
+
get minAttr(): any;
|
|
165
|
+
constructor(_injector: Injector, _dynamicFormsService: TdDynamicFormsService, _changeDetectorRef: ChangeDetectorRef);
|
|
166
|
+
ngOnInit(): void;
|
|
167
|
+
/**
|
|
168
|
+
* Reassign any inputs that have changed
|
|
169
|
+
*/
|
|
170
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
171
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TdDynamicElementComponent, never>;
|
|
172
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TdDynamicElementComponent, "td-dynamic-element", never, { "dynamicControl": { "alias": "dynamicControl"; "required": false; }; "label": { "alias": "label"; "required": false; }; "hint": { "alias": "hint"; "required": false; }; "name": { "alias": "name"; "required": false; }; "type": { "alias": "type"; "required": false; }; "required": { "alias": "required"; "required": false; }; "min": { "alias": "min"; "required": false; }; "max": { "alias": "max"; "required": false; }; "minLength": { "alias": "minLength"; "required": false; }; "maxLength": { "alias": "maxLength"; "required": false; }; "selections": { "alias": "selections"; "required": false; }; "multiple": { "alias": "multiple"; "required": false; }; "customConfig": { "alias": "customConfig"; "required": false; }; "errorMessageTemplate": { "alias": "errorMessageTemplate"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; }, {}, never, never, true, never>;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
declare class TdDynamicFormsComponent implements AfterContentInit, OnDestroy {
|
|
176
|
+
private _formBuilder;
|
|
177
|
+
private _dynamicFormsService;
|
|
178
|
+
private _changeDetectorRef;
|
|
179
|
+
private _renderedElements;
|
|
180
|
+
private _elements;
|
|
181
|
+
private _templateMap;
|
|
182
|
+
private _destroy$;
|
|
183
|
+
private _destroyControl$;
|
|
184
|
+
_errorTemplates: QueryList<TdDynamicFormsErrorTemplateDirective>;
|
|
185
|
+
dynamicForm: UntypedFormGroup;
|
|
186
|
+
/**
|
|
187
|
+
* elements: ITdDynamicElementConfig[]
|
|
188
|
+
* JS Object that will render the elements depending on its config.
|
|
189
|
+
* [name] property is required.
|
|
190
|
+
*/
|
|
191
|
+
set elements(elements: ITdDynamicElementConfig[]);
|
|
192
|
+
get elements(): ITdDynamicElementConfig[];
|
|
193
|
+
/**
|
|
194
|
+
* Getter property for dynamic [FormGroup].
|
|
195
|
+
*/
|
|
196
|
+
get form(): UntypedFormGroup;
|
|
197
|
+
/**
|
|
198
|
+
* Getter property for [valid] of dynamic [FormGroup].
|
|
199
|
+
*/
|
|
200
|
+
get valid(): boolean;
|
|
201
|
+
/**
|
|
202
|
+
* Getter property for [value] of dynamic [FormGroup].
|
|
203
|
+
*/
|
|
204
|
+
get value(): any;
|
|
205
|
+
/**
|
|
206
|
+
* Getter property for [errors] of dynamic [FormGroup].
|
|
207
|
+
*/
|
|
208
|
+
get errors(): {
|
|
209
|
+
[name: string]: any;
|
|
210
|
+
};
|
|
211
|
+
/**
|
|
212
|
+
* Getter property for [controls] of dynamic [FormGroup].
|
|
213
|
+
*/
|
|
214
|
+
get controls(): {
|
|
215
|
+
[key: string]: AbstractControl;
|
|
216
|
+
};
|
|
217
|
+
constructor(_formBuilder: UntypedFormBuilder, _dynamicFormsService: TdDynamicFormsService, _changeDetectorRef: ChangeDetectorRef);
|
|
218
|
+
ngAfterContentInit(): void;
|
|
219
|
+
ngOnDestroy(): void;
|
|
220
|
+
/**
|
|
221
|
+
* Refreshes the form and rerenders all validator/element modifications.
|
|
222
|
+
*/
|
|
223
|
+
refresh(): void;
|
|
224
|
+
/**
|
|
225
|
+
* Getter method for error template references
|
|
226
|
+
*/
|
|
227
|
+
getErrorTemplateRef(name: string): TemplateRef<any> | undefined;
|
|
228
|
+
/**
|
|
229
|
+
* Loads error templates and sets them in a map for faster access.
|
|
230
|
+
*/
|
|
231
|
+
private _updateErrorTemplates;
|
|
232
|
+
private _rerenderElements;
|
|
233
|
+
private _clearRemovedElements;
|
|
234
|
+
private _subscribeToControlStatusChanges;
|
|
235
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TdDynamicFormsComponent, never>;
|
|
236
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TdDynamicFormsComponent, "td-dynamic-forms", never, { "elements": { "alias": "elements"; "required": false; }; }, {}, ["_errorTemplates"], ["*"], true, never>;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
declare class TdDynamicInputComponent {
|
|
240
|
+
control: UntypedFormControl;
|
|
241
|
+
label: string;
|
|
242
|
+
hint: string;
|
|
243
|
+
type: string;
|
|
244
|
+
required: boolean;
|
|
245
|
+
name: string;
|
|
246
|
+
min?: number;
|
|
247
|
+
max?: number;
|
|
248
|
+
minLength?: number;
|
|
249
|
+
maxLength?: number;
|
|
250
|
+
errorMessageTemplate: TemplateRef<any>;
|
|
251
|
+
placeholder: string;
|
|
252
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TdDynamicInputComponent, never>;
|
|
253
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TdDynamicInputComponent, "td-dynamic-input", never, {}, {}, never, never, true, never>;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
declare class TdDynamicFileInputComponent {
|
|
257
|
+
control: UntypedFormControl;
|
|
258
|
+
required: boolean;
|
|
259
|
+
label: string;
|
|
260
|
+
name: string;
|
|
261
|
+
hint: string;
|
|
262
|
+
errorMessageTemplate: TemplateRef<any>;
|
|
263
|
+
placeholder: string;
|
|
264
|
+
_handlefileDrop(value: any): void;
|
|
265
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TdDynamicFileInputComponent, never>;
|
|
266
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TdDynamicFileInputComponent, "td-dynamic-file-input", never, {}, {}, never, never, true, never>;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
declare class TdDynamicTextareaComponent {
|
|
270
|
+
control: UntypedFormControl;
|
|
271
|
+
label: string;
|
|
272
|
+
hint: string;
|
|
273
|
+
name: string;
|
|
274
|
+
required: boolean;
|
|
275
|
+
errorMessageTemplate: TemplateRef<any>;
|
|
276
|
+
placeholder: string;
|
|
277
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TdDynamicTextareaComponent, never>;
|
|
278
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TdDynamicTextareaComponent, "td-dynamic-textarea", never, {}, {}, never, never, true, never>;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
declare class TdDynamicSlideToggleComponent {
|
|
282
|
+
control: UntypedFormControl;
|
|
283
|
+
label: string;
|
|
284
|
+
name: string;
|
|
285
|
+
hint: string;
|
|
286
|
+
required: boolean;
|
|
287
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TdDynamicSlideToggleComponent, never>;
|
|
288
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TdDynamicSlideToggleComponent, "td-dynamic-slide-toggle", never, {}, {}, never, never, true, never>;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
declare class TdDynamicCheckboxComponent {
|
|
292
|
+
control: UntypedFormControl;
|
|
293
|
+
label: string;
|
|
294
|
+
name: string;
|
|
295
|
+
hint: string;
|
|
296
|
+
required: boolean;
|
|
297
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TdDynamicCheckboxComponent, never>;
|
|
298
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TdDynamicCheckboxComponent, "td-dynamic-checkbox", never, {}, {}, never, never, true, never>;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
declare class TdDynamicSliderComponent {
|
|
302
|
+
private _changeDetectorRef;
|
|
303
|
+
control: UntypedFormControl;
|
|
304
|
+
label: string;
|
|
305
|
+
required: boolean;
|
|
306
|
+
name: string;
|
|
307
|
+
hint: string;
|
|
308
|
+
min?: number;
|
|
309
|
+
max?: number;
|
|
310
|
+
constructor(_changeDetectorRef: ChangeDetectorRef);
|
|
311
|
+
_handleBlur(): void;
|
|
312
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TdDynamicSliderComponent, never>;
|
|
313
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TdDynamicSliderComponent, "td-dynamic-slider", never, {}, {}, never, never, true, never>;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
declare class TdDynamicSelectComponent {
|
|
317
|
+
control: UntypedFormControl;
|
|
318
|
+
label: string;
|
|
319
|
+
hint: string;
|
|
320
|
+
name: string;
|
|
321
|
+
required: boolean;
|
|
322
|
+
selections?: any[];
|
|
323
|
+
multiple?: boolean;
|
|
324
|
+
errorMessageTemplate: TemplateRef<any>;
|
|
325
|
+
placeholder: string;
|
|
326
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TdDynamicSelectComponent, never>;
|
|
327
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TdDynamicSelectComponent, "td-dynamic-select", never, {}, {}, never, never, true, never>;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
declare class TdDynamicDatepickerComponent {
|
|
331
|
+
control: UntypedFormControl;
|
|
332
|
+
label: string;
|
|
333
|
+
hint: string;
|
|
334
|
+
name: string;
|
|
335
|
+
type?: string;
|
|
336
|
+
required: boolean;
|
|
337
|
+
min?: number;
|
|
338
|
+
max?: number;
|
|
339
|
+
errorMessageTemplate: TemplateRef<any>;
|
|
340
|
+
placeholder: string;
|
|
341
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TdDynamicDatepickerComponent, never>;
|
|
342
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TdDynamicDatepickerComponent, "td-dynamic-datepicker", never, {}, {}, never, never, true, never>;
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
declare class CovalentDynamicFormsModule {
|
|
346
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CovalentDynamicFormsModule, never>;
|
|
347
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<CovalentDynamicFormsModule, never, [typeof TdDynamicFormsComponent, typeof TdDynamicElementComponent, typeof TdDynamicElementDirective, typeof TdDynamicFormsErrorTemplateDirective, typeof TdDynamicInputComponent, typeof TdDynamicFileInputComponent, typeof TdDynamicTextareaComponent, typeof TdDynamicSlideToggleComponent, typeof TdDynamicCheckboxComponent, typeof TdDynamicSliderComponent, typeof TdDynamicSelectComponent, typeof TdDynamicDatepickerComponent], [typeof TdDynamicFormsComponent, typeof TdDynamicElementComponent, typeof TdDynamicElementDirective, typeof TdDynamicFormsErrorTemplateDirective, typeof TdDynamicInputComponent, typeof TdDynamicFileInputComponent, typeof TdDynamicTextareaComponent, typeof TdDynamicSlideToggleComponent, typeof TdDynamicCheckboxComponent, typeof TdDynamicSliderComponent, typeof TdDynamicSelectComponent, typeof TdDynamicDatepickerComponent]>;
|
|
348
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<CovalentDynamicFormsModule>;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
export { CovalentDynamicFormsModule, DYNAMIC_ELEMENT_NAME_REGEX, DYNAMIC_FORMS_PROVIDER, DYNAMIC_FORMS_PROVIDER_FACTORY, TdDynamicCheckboxComponent, TdDynamicDatepickerComponent, TdDynamicElement, TdDynamicElementBase, TdDynamicElementComponent, TdDynamicElementDirective, TdDynamicFileInputComponent, TdDynamicFormsComponent, TdDynamicFormsErrorTemplateDirective, TdDynamicFormsService, TdDynamicInputComponent, TdDynamicSelectComponent, TdDynamicSlideToggleComponent, TdDynamicSliderComponent, TdDynamicTextareaComponent, TdDynamicType, _TdDynamicElementMixinBase };
|
|
352
|
+
export type { ITdDynamicElementConfig, ITdDynamicElementCustomConfig, ITdDynamicElementValidator };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@covalent/dynamic-forms",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "11.0.0-beta.1",
|
|
4
4
|
"description": "Teradata UI Platform Dynamic Forms Module",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"angular",
|
|
@@ -19,9 +19,9 @@
|
|
|
19
19
|
"license": "MIT",
|
|
20
20
|
"author": "Teradata UX",
|
|
21
21
|
"peerDependencies": {
|
|
22
|
-
"@angular/common": "
|
|
23
|
-
"@angular/core": "
|
|
24
|
-
"@covalent/core": "
|
|
22
|
+
"@angular/common": "20.x.x",
|
|
23
|
+
"@angular/core": "20.x.x",
|
|
24
|
+
"@covalent/core": "11.0.0-beta.1"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"tslib": "^2.8.1"
|
|
@@ -39,6 +39,6 @@
|
|
|
39
39
|
},
|
|
40
40
|
"sideEffects": false,
|
|
41
41
|
"scripts": {
|
|
42
|
-
"prepublishOnly": "node --eval \"console.error('ERROR: Trying to publish a package that has been compiled
|
|
42
|
+
"prepublishOnly": "node --eval \"console.error('ERROR: Trying to publish a package that has been compiled in full compilation mode. This is not allowed.\\nPlease delete and rebuild the package with partial compilation mode, before attempting to publish.\\n')\" && exit 1"
|
|
43
43
|
}
|
|
44
44
|
}
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
import { OnInit, SimpleChanges, OnChanges, TemplateRef, ChangeDetectorRef, Type, Injector } from '@angular/core';
|
|
2
|
-
import { ViewContainerRef } from '@angular/core';
|
|
3
|
-
import { AbstractControl } from '@angular/forms';
|
|
4
|
-
import { CdkPortal } from '@angular/cdk/portal';
|
|
5
|
-
import { IControlValueAccessor } from '@covalent/core/common';
|
|
6
|
-
import { TdDynamicElement, TdDynamicType, TdDynamicFormsService, ITdDynamicElementCustomConfig } from './services/dynamic-forms.service';
|
|
7
|
-
import * as i0 from "@angular/core";
|
|
8
|
-
export declare class TdDynamicElementBase {
|
|
9
|
-
_changeDetectorRef: ChangeDetectorRef;
|
|
10
|
-
constructor(_changeDetectorRef: ChangeDetectorRef);
|
|
11
|
-
}
|
|
12
|
-
export declare const _TdDynamicElementMixinBase: (new (...args: any[]) => IControlValueAccessor) & typeof TdDynamicElementBase;
|
|
13
|
-
export declare class TdDynamicFormsErrorTemplateDirective extends CdkPortal {
|
|
14
|
-
templateRef: TemplateRef<any>;
|
|
15
|
-
tdDynamicFormsError?: string;
|
|
16
|
-
constructor(templateRef: TemplateRef<any>, viewContainerRef: ViewContainerRef);
|
|
17
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<TdDynamicFormsErrorTemplateDirective, never>;
|
|
18
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<TdDynamicFormsErrorTemplateDirective, "[tdDynamicFormsError]ng-template", never, { "tdDynamicFormsError": { "alias": "tdDynamicFormsError"; "required": false; }; }, {}, never, never, true, never>;
|
|
19
|
-
}
|
|
20
|
-
export declare class TdDynamicElementDirective {
|
|
21
|
-
viewContainer: ViewContainerRef;
|
|
22
|
-
constructor(viewContainer: ViewContainerRef);
|
|
23
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<TdDynamicElementDirective, never>;
|
|
24
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<TdDynamicElementDirective, "[tdDynamicContainer]", never, {}, {}, never, never, true, never>;
|
|
25
|
-
}
|
|
26
|
-
export declare class TdDynamicElementComponent extends _TdDynamicElementMixinBase implements IControlValueAccessor, OnInit, OnChanges {
|
|
27
|
-
private _injector;
|
|
28
|
-
private _dynamicFormsService;
|
|
29
|
-
private _instance;
|
|
30
|
-
/**
|
|
31
|
-
* Sets form control of the element.
|
|
32
|
-
*/
|
|
33
|
-
dynamicControl: AbstractControl;
|
|
34
|
-
/**
|
|
35
|
-
* Sets label to be displayed.
|
|
36
|
-
*/
|
|
37
|
-
label: string;
|
|
38
|
-
/**
|
|
39
|
-
* Sets hint to be displayed.
|
|
40
|
-
*/
|
|
41
|
-
hint?: string | undefined;
|
|
42
|
-
/**
|
|
43
|
-
* Sets name to be displayed as attribute.
|
|
44
|
-
*/
|
|
45
|
-
name: string;
|
|
46
|
-
/**
|
|
47
|
-
* Sets type or element of element to be rendered.
|
|
48
|
-
* Throws error if does not exist or no supported.
|
|
49
|
-
*/
|
|
50
|
-
type?: TdDynamicElement | TdDynamicType | Type<any>;
|
|
51
|
-
/**
|
|
52
|
-
* Sets required validation checkup (if supported by element).
|
|
53
|
-
*/
|
|
54
|
-
required?: boolean | string | undefined;
|
|
55
|
-
/**
|
|
56
|
-
* Sets min validation checkup (if supported by element).
|
|
57
|
-
*/
|
|
58
|
-
min?: number;
|
|
59
|
-
/**
|
|
60
|
-
* Sets max validation checkup (if supported by element).
|
|
61
|
-
*/
|
|
62
|
-
max?: number;
|
|
63
|
-
/**
|
|
64
|
-
* Sets minLength validation checkup (if supported by element).
|
|
65
|
-
*/
|
|
66
|
-
minLength?: number;
|
|
67
|
-
/**
|
|
68
|
-
* Sets maxLength validation checkup (if supported by element).
|
|
69
|
-
*/
|
|
70
|
-
maxLength?: number;
|
|
71
|
-
/**
|
|
72
|
-
* Sets selections for array elements (if supported by element).
|
|
73
|
-
*/
|
|
74
|
-
selections?: any[];
|
|
75
|
-
/**
|
|
76
|
-
* Sets multiple property for array elements (if supported by element).
|
|
77
|
-
*/
|
|
78
|
-
multiple?: boolean;
|
|
79
|
-
/**
|
|
80
|
-
* Sets any additional properties on custom component.
|
|
81
|
-
*/
|
|
82
|
-
customConfig?: ITdDynamicElementCustomConfig;
|
|
83
|
-
/**
|
|
84
|
-
* Sets error message template so it can be injected into dynamic components.
|
|
85
|
-
*/
|
|
86
|
-
errorMessageTemplate: TemplateRef<any> | undefined;
|
|
87
|
-
/**
|
|
88
|
-
* Sets the placeholder message
|
|
89
|
-
*/
|
|
90
|
-
placeholder?: string | undefined;
|
|
91
|
-
childElement: TdDynamicElementDirective;
|
|
92
|
-
get maxAttr(): any;
|
|
93
|
-
get minAttr(): any;
|
|
94
|
-
constructor(_injector: Injector, _dynamicFormsService: TdDynamicFormsService, _changeDetectorRef: ChangeDetectorRef);
|
|
95
|
-
ngOnInit(): void;
|
|
96
|
-
/**
|
|
97
|
-
* Reassign any inputs that have changed
|
|
98
|
-
*/
|
|
99
|
-
ngOnChanges(changes: SimpleChanges): void;
|
|
100
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<TdDynamicElementComponent, never>;
|
|
101
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<TdDynamicElementComponent, "td-dynamic-element", never, { "dynamicControl": { "alias": "dynamicControl"; "required": false; }; "label": { "alias": "label"; "required": false; }; "hint": { "alias": "hint"; "required": false; }; "name": { "alias": "name"; "required": false; }; "type": { "alias": "type"; "required": false; }; "required": { "alias": "required"; "required": false; }; "min": { "alias": "min"; "required": false; }; "max": { "alias": "max"; "required": false; }; "minLength": { "alias": "minLength"; "required": false; }; "maxLength": { "alias": "maxLength"; "required": false; }; "selections": { "alias": "selections"; "required": false; }; "multiple": { "alias": "multiple"; "required": false; }; "customConfig": { "alias": "customConfig"; "required": false; }; "errorMessageTemplate": { "alias": "errorMessageTemplate"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; }, {}, never, never, true, never>;
|
|
102
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { UntypedFormControl } from '@angular/forms';
|
|
2
|
-
import * as i0 from "@angular/core";
|
|
3
|
-
export declare class TdDynamicCheckboxComponent {
|
|
4
|
-
control: UntypedFormControl;
|
|
5
|
-
label: string;
|
|
6
|
-
name: string;
|
|
7
|
-
hint: string;
|
|
8
|
-
required: boolean;
|
|
9
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<TdDynamicCheckboxComponent, never>;
|
|
10
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<TdDynamicCheckboxComponent, "td-dynamic-checkbox", never, {}, {}, never, never, true, never>;
|
|
11
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { TemplateRef } from '@angular/core';
|
|
2
|
-
import { UntypedFormControl } from '@angular/forms';
|
|
3
|
-
import * as i0 from "@angular/core";
|
|
4
|
-
export declare class TdDynamicDatepickerComponent {
|
|
5
|
-
control: UntypedFormControl;
|
|
6
|
-
label: string;
|
|
7
|
-
hint: string;
|
|
8
|
-
name: string;
|
|
9
|
-
type?: string;
|
|
10
|
-
required: boolean;
|
|
11
|
-
min?: number;
|
|
12
|
-
max?: number;
|
|
13
|
-
errorMessageTemplate: TemplateRef<any>;
|
|
14
|
-
placeholder: string;
|
|
15
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<TdDynamicDatepickerComponent, never>;
|
|
16
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<TdDynamicDatepickerComponent, "td-dynamic-datepicker", never, {}, {}, never, never, true, never>;
|
|
17
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { TemplateRef } from '@angular/core';
|
|
2
|
-
import { UntypedFormControl } from '@angular/forms';
|
|
3
|
-
import * as i0 from "@angular/core";
|
|
4
|
-
export declare class TdDynamicFileInputComponent {
|
|
5
|
-
control: UntypedFormControl;
|
|
6
|
-
required: boolean;
|
|
7
|
-
label: string;
|
|
8
|
-
name: string;
|
|
9
|
-
hint: string;
|
|
10
|
-
errorMessageTemplate: TemplateRef<any>;
|
|
11
|
-
placeholder: string;
|
|
12
|
-
_handlefileDrop(value: any): void;
|
|
13
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<TdDynamicFileInputComponent, never>;
|
|
14
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<TdDynamicFileInputComponent, "td-dynamic-file-input", never, {}, {}, never, never, true, never>;
|
|
15
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { TemplateRef } from '@angular/core';
|
|
2
|
-
import { UntypedFormControl } from '@angular/forms';
|
|
3
|
-
import * as i0 from "@angular/core";
|
|
4
|
-
export declare class TdDynamicInputComponent {
|
|
5
|
-
control: UntypedFormControl;
|
|
6
|
-
label: string;
|
|
7
|
-
hint: string;
|
|
8
|
-
type: string;
|
|
9
|
-
required: boolean;
|
|
10
|
-
name: string;
|
|
11
|
-
min?: number;
|
|
12
|
-
max?: number;
|
|
13
|
-
minLength?: number;
|
|
14
|
-
maxLength?: number;
|
|
15
|
-
errorMessageTemplate: TemplateRef<any>;
|
|
16
|
-
placeholder: string;
|
|
17
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<TdDynamicInputComponent, never>;
|
|
18
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<TdDynamicInputComponent, "td-dynamic-input", never, {}, {}, never, never, true, never>;
|
|
19
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { TemplateRef } from '@angular/core';
|
|
2
|
-
import { UntypedFormControl } from '@angular/forms';
|
|
3
|
-
import * as i0 from "@angular/core";
|
|
4
|
-
export declare class TdDynamicSelectComponent {
|
|
5
|
-
control: UntypedFormControl;
|
|
6
|
-
label: string;
|
|
7
|
-
hint: string;
|
|
8
|
-
name: string;
|
|
9
|
-
required: boolean;
|
|
10
|
-
selections?: any[];
|
|
11
|
-
multiple?: boolean;
|
|
12
|
-
errorMessageTemplate: TemplateRef<any>;
|
|
13
|
-
placeholder: string;
|
|
14
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<TdDynamicSelectComponent, never>;
|
|
15
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<TdDynamicSelectComponent, "td-dynamic-select", never, {}, {}, never, never, true, never>;
|
|
16
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { UntypedFormControl } from '@angular/forms';
|
|
2
|
-
import * as i0 from "@angular/core";
|
|
3
|
-
export declare class TdDynamicSlideToggleComponent {
|
|
4
|
-
control: UntypedFormControl;
|
|
5
|
-
label: string;
|
|
6
|
-
name: string;
|
|
7
|
-
hint: string;
|
|
8
|
-
required: boolean;
|
|
9
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<TdDynamicSlideToggleComponent, never>;
|
|
10
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<TdDynamicSlideToggleComponent, "td-dynamic-slide-toggle", never, {}, {}, never, never, true, never>;
|
|
11
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { ChangeDetectorRef } from '@angular/core';
|
|
2
|
-
import { UntypedFormControl } from '@angular/forms';
|
|
3
|
-
import * as i0 from "@angular/core";
|
|
4
|
-
export declare class TdDynamicSliderComponent {
|
|
5
|
-
private _changeDetectorRef;
|
|
6
|
-
control: UntypedFormControl;
|
|
7
|
-
label: string;
|
|
8
|
-
required: boolean;
|
|
9
|
-
name: string;
|
|
10
|
-
hint: string;
|
|
11
|
-
min?: number;
|
|
12
|
-
max?: number;
|
|
13
|
-
constructor(_changeDetectorRef: ChangeDetectorRef);
|
|
14
|
-
_handleBlur(): void;
|
|
15
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<TdDynamicSliderComponent, never>;
|
|
16
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<TdDynamicSliderComponent, "td-dynamic-slider", never, {}, {}, never, never, true, never>;
|
|
17
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { TemplateRef } from '@angular/core';
|
|
2
|
-
import { UntypedFormControl } from '@angular/forms';
|
|
3
|
-
import * as i0 from "@angular/core";
|
|
4
|
-
export declare class TdDynamicTextareaComponent {
|
|
5
|
-
control: UntypedFormControl;
|
|
6
|
-
label: string;
|
|
7
|
-
hint: string;
|
|
8
|
-
name: string;
|
|
9
|
-
required: boolean;
|
|
10
|
-
errorMessageTemplate: TemplateRef<any>;
|
|
11
|
-
placeholder: string;
|
|
12
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<TdDynamicTextareaComponent, never>;
|
|
13
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<TdDynamicTextareaComponent, "td-dynamic-textarea", never, {}, {}, never, never, true, never>;
|
|
14
|
-
}
|