@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.
@@ -1,68 +0,0 @@
1
- import { ChangeDetectorRef, TemplateRef, QueryList, AfterContentInit, OnDestroy } from '@angular/core';
2
- import { UntypedFormGroup, UntypedFormBuilder, AbstractControl } from '@angular/forms';
3
- import { TdDynamicFormsService, ITdDynamicElementConfig } from './services/dynamic-forms.service';
4
- import { TdDynamicFormsErrorTemplateDirective } from './dynamic-element.component';
5
- import * as i0 from "@angular/core";
6
- export declare class TdDynamicFormsComponent implements AfterContentInit, OnDestroy {
7
- private _formBuilder;
8
- private _dynamicFormsService;
9
- private _changeDetectorRef;
10
- private _renderedElements;
11
- private _elements;
12
- private _templateMap;
13
- private _destroy$;
14
- private _destroyControl$;
15
- _errorTemplates: QueryList<TdDynamicFormsErrorTemplateDirective>;
16
- dynamicForm: UntypedFormGroup;
17
- /**
18
- * elements: ITdDynamicElementConfig[]
19
- * JS Object that will render the elements depending on its config.
20
- * [name] property is required.
21
- */
22
- set elements(elements: ITdDynamicElementConfig[]);
23
- get elements(): ITdDynamicElementConfig[];
24
- /**
25
- * Getter property for dynamic [FormGroup].
26
- */
27
- get form(): UntypedFormGroup;
28
- /**
29
- * Getter property for [valid] of dynamic [FormGroup].
30
- */
31
- get valid(): boolean;
32
- /**
33
- * Getter property for [value] of dynamic [FormGroup].
34
- */
35
- get value(): any;
36
- /**
37
- * Getter property for [errors] of dynamic [FormGroup].
38
- */
39
- get errors(): {
40
- [name: string]: any;
41
- };
42
- /**
43
- * Getter property for [controls] of dynamic [FormGroup].
44
- */
45
- get controls(): {
46
- [key: string]: AbstractControl;
47
- };
48
- constructor(_formBuilder: UntypedFormBuilder, _dynamicFormsService: TdDynamicFormsService, _changeDetectorRef: ChangeDetectorRef);
49
- ngAfterContentInit(): void;
50
- ngOnDestroy(): void;
51
- /**
52
- * Refreshes the form and rerenders all validator/element modifications.
53
- */
54
- refresh(): void;
55
- /**
56
- * Getter method for error template references
57
- */
58
- getErrorTemplateRef(name: string): TemplateRef<any> | undefined;
59
- /**
60
- * Loads error templates and sets them in a map for faster access.
61
- */
62
- private _updateErrorTemplates;
63
- private _rerenderElements;
64
- private _clearRemovedElements;
65
- private _subscribeToControlStatusChanges;
66
- static ɵfac: i0.ɵɵFactoryDeclaration<TdDynamicFormsComponent, never>;
67
- static ɵcmp: i0.ɵɵComponentDeclaration<TdDynamicFormsComponent, "td-dynamic-forms", never, { "elements": { "alias": "elements"; "required": false; }; }, {}, ["_errorTemplates"], ["*"], true, never>;
68
- }
@@ -1,16 +0,0 @@
1
- import * as i0 from "@angular/core";
2
- import * as i1 from "./dynamic-forms.component";
3
- import * as i2 from "./dynamic-element.component";
4
- import * as i3 from "./dynamic-elements/dynamic-input/dynamic-input.component";
5
- import * as i4 from "./dynamic-elements/dynamic-file-input/dynamic-file-input.component";
6
- import * as i5 from "./dynamic-elements/dynamic-textarea/dynamic-textarea.component";
7
- import * as i6 from "./dynamic-elements/dynamic-slide-toggle/dynamic-slide-toggle.component";
8
- import * as i7 from "./dynamic-elements/dynamic-checkbox/dynamic-checkbox.component";
9
- import * as i8 from "./dynamic-elements/dynamic-slider/dynamic-slider.component";
10
- import * as i9 from "./dynamic-elements/dynamic-select/dynamic-select.component";
11
- import * as i10 from "./dynamic-elements/dynamic-datepicker/dynamic-datepicker.component";
12
- export declare class CovalentDynamicFormsModule {
13
- static ɵfac: i0.ɵɵFactoryDeclaration<CovalentDynamicFormsModule, never>;
14
- static ɵmod: i0.ɵɵNgModuleDeclaration<CovalentDynamicFormsModule, never, [typeof i1.TdDynamicFormsComponent, typeof i2.TdDynamicElementComponent, typeof i2.TdDynamicElementDirective, typeof i2.TdDynamicFormsErrorTemplateDirective, typeof i3.TdDynamicInputComponent, typeof i4.TdDynamicFileInputComponent, typeof i5.TdDynamicTextareaComponent, typeof i6.TdDynamicSlideToggleComponent, typeof i7.TdDynamicCheckboxComponent, typeof i8.TdDynamicSliderComponent, typeof i9.TdDynamicSelectComponent, typeof i10.TdDynamicDatepickerComponent], [typeof i1.TdDynamicFormsComponent, typeof i2.TdDynamicElementComponent, typeof i2.TdDynamicElementDirective, typeof i2.TdDynamicFormsErrorTemplateDirective, typeof i3.TdDynamicInputComponent, typeof i4.TdDynamicFileInputComponent, typeof i5.TdDynamicTextareaComponent, typeof i6.TdDynamicSlideToggleComponent, typeof i7.TdDynamicCheckboxComponent, typeof i8.TdDynamicSliderComponent, typeof i9.TdDynamicSelectComponent, typeof i10.TdDynamicDatepickerComponent]>;
15
- static ɵinj: i0.ɵɵInjectorDeclaration<CovalentDynamicFormsModule>;
16
- }
@@ -1,74 +0,0 @@
1
- import { Provider, Type } from '@angular/core';
2
- import { ValidatorFn, UntypedFormControl } from '@angular/forms';
3
- import * as i0 from "@angular/core";
4
- export declare enum TdDynamicType {
5
- Text = "text",
6
- Boolean = "boolean",
7
- Number = "number",
8
- Array = "array",
9
- Date = "date"
10
- }
11
- export declare enum TdDynamicElement {
12
- Input = "input",
13
- Datepicker = "datepicker",
14
- Password = "password",
15
- Textarea = "textarea",
16
- Slider = "slider",
17
- SlideToggle = "slide-toggle",
18
- Checkbox = "checkbox",
19
- Select = "select",
20
- FileInput = "file-input"
21
- }
22
- export interface ITdDynamicElementValidator {
23
- validator: ValidatorFn;
24
- }
25
- export interface ITdDynamicElementCustomConfig {
26
- [name: string]: any;
27
- }
28
- export interface ITdDynamicElementConfig {
29
- label?: string;
30
- name: string;
31
- hint?: string;
32
- type: TdDynamicType | TdDynamicElement | Type<any>;
33
- required?: boolean;
34
- disabled?: boolean;
35
- min?: any;
36
- max?: any;
37
- minLength?: any;
38
- maxLength?: any;
39
- selections?: string[] | {
40
- value: any;
41
- label: string;
42
- }[];
43
- multiple?: boolean;
44
- default?: any;
45
- flex?: number;
46
- validators?: ITdDynamicElementValidator[];
47
- customConfig?: ITdDynamicElementCustomConfig;
48
- placeholder?: string;
49
- }
50
- export declare const DYNAMIC_ELEMENT_NAME_REGEX: RegExp;
51
- export declare class TdDynamicFormsService {
52
- /**
53
- * Method to validate if the [name] is a proper element name.
54
- * Throws error if name is not valid.
55
- */
56
- validateDynamicElementName(name: string): void;
57
- /**
58
- * Gets component to be rendered depending on [TdDynamicElement | TdDynamicType]
59
- * Throws error if it does not exists or not supported.
60
- */
61
- getDynamicElement(element: TdDynamicElement | TdDynamicType | Type<any> | undefined): any;
62
- /**
63
- * Creates form control for element depending [ITdDynamicElementConfig] properties.
64
- */
65
- createFormControl(config: ITdDynamicElementConfig): UntypedFormControl;
66
- /**
67
- * Creates form validationdepending [ITdDynamicElementConfig] properties.
68
- */
69
- createValidators(config: ITdDynamicElementConfig): ValidatorFn | null;
70
- static ɵfac: i0.ɵɵFactoryDeclaration<TdDynamicFormsService, never>;
71
- static ɵprov: i0.ɵɵInjectableDeclaration<TdDynamicFormsService>;
72
- }
73
- export declare function DYNAMIC_FORMS_PROVIDER_FACTORY(parent: TdDynamicFormsService): TdDynamicFormsService;
74
- export declare const DYNAMIC_FORMS_PROVIDER: Provider;
package/public_api.d.ts DELETED
@@ -1,12 +0,0 @@
1
- export * from './lib/dynamic-forms.module';
2
- export * from './lib/dynamic-forms.component';
3
- export * from './lib/dynamic-element.component';
4
- export * from './lib/services/dynamic-forms.service';
5
- export * from './lib/dynamic-elements/dynamic-textarea/dynamic-textarea.component';
6
- export * from './lib/dynamic-elements/dynamic-slider/dynamic-slider.component';
7
- export * from './lib/dynamic-elements/dynamic-slide-toggle/dynamic-slide-toggle.component';
8
- export * from './lib/dynamic-elements/dynamic-select/dynamic-select.component';
9
- export * from './lib/dynamic-elements/dynamic-input/dynamic-input.component';
10
- export * from './lib/dynamic-elements/dynamic-file-input/dynamic-file-input.component';
11
- export * from './lib/dynamic-elements/dynamic-datepicker/dynamic-datepicker.component';
12
- export * from './lib/dynamic-elements/dynamic-checkbox/dynamic-checkbox.component';