diff --git a/npm/ng-packs/packages/components/dynamic-form/src/dynamic-form-field.component.ts b/npm/ng-packs/packages/components/dynamic-form/src/dynamic-form-field.component.ts deleted file mode 100644 index 63875e5507..0000000000 --- a/npm/ng-packs/packages/components/dynamic-form/src/dynamic-form-field.component.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { ChangeDetectionStrategy, Component } from '@angular/core'; - -@Component({ - selector: 'abp-dynamic-form-field', - template: ``, - changeDetection: ChangeDetectionStrategy.OnPush -}) - -export class DynamicFormFieldComponent {} diff --git a/npm/ng-packs/packages/components/dynamic-form/src/dynamic-form-field/dynamic-form-field-control.ts b/npm/ng-packs/packages/components/dynamic-form/src/dynamic-form-field/dynamic-form-field-control.ts new file mode 100644 index 0000000000..3a87454884 --- /dev/null +++ b/npm/ng-packs/packages/components/dynamic-form/src/dynamic-form-field/dynamic-form-field-control.ts @@ -0,0 +1,75 @@ + +import {Observable} from 'rxjs'; +import {AbstractControlDirective, NgControl} from '@angular/forms'; +import {Directive} from '@angular/core'; + +@Directive() +export abstract class MatFormFieldControl { + /** The value of the control. */ + value: T | null; + + /** + * Stream that emits whenever the state of the control changes such that the parent `MatFormField` + * needs to run change detection. + */ + readonly stateChanges: Observable; + + /** The element ID for this control. */ + readonly id: string; + + /** The placeholder for this control. */ + readonly placeholder: string; + + /** Gets the AbstractControlDirective for this control. */ + readonly ngControl: NgControl | AbstractControlDirective | null; + + /** Whether the control is focused. */ + readonly focused: boolean; + + /** Whether the control is empty. */ + readonly empty: boolean; + + /** Whether the control is required. */ + readonly required: boolean; + + /** Whether the control is disabled. */ + readonly disabled: boolean; + + /** Whether the control is in an error state. */ + readonly errorState: boolean; + + /** + * An optional name for the control type that can be used to distinguish `mat-form-field` elements + * based on their control type. The form field will add a class, + * `mat-form-field-type-{{controlType}}` to its root element. + */ + readonly controlType?: string; + + /** + * Whether the input is currently in an autofilled state. If property is not present on the + * control it is assumed to be false. + */ + readonly autofilled?: boolean; + + /** + * Value of `aria-describedby` that should be merged with the described-by ids + * which are set by the form-field. + */ + readonly userAriaDescribedBy?: string; + + /** + * Whether to automatically assign the ID of the form field as the `for` attribute + * on the `