Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Component, OnInit, ViewChild } from '@angular/core';
import { UntypedFormBuilder, FormControl, UntypedFormGroup } from '@angular/forms';
import { FormBuilder, FormControl, FormGroup } from '@angular/forms';
import { List } from 'immutable';
import { Button, DxcCrudTableComponent, DxcResizeService } from '@dxc-technology/halstack-angular';
import { EFieldsType, EMethod, IFieldsBaseProperties, IRequest, ITextEditorproperties } from '@dxc-technology/halstack-angular';
Expand All @@ -11,12 +11,12 @@ import { EFieldsType, EMethod, IFieldsBaseProperties, IRequest, ITextEditorprope
})
export class CrudGridComponent implements OnInit {
@ViewChild('crudgridcomponent', {static: false}) crudGridComponent: DxcCrudTableComponent;
testForm: UntypedFormGroup;
testForm: FormGroup;
message:{ [key: string]: string };
columns: Array<string>;
gridToolbarList: List<Button>;

constructor( private fb: UntypedFormBuilder, private resizeSvc: DxcResizeService ) {
constructor( private fb: FormBuilder, private resizeSvc: DxcResizeService ) {

}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import { Component, OnInit } from '@angular/core';
import { UntypedFormGroup, UntypedFormBuilder, Validators, AbstractControl, ValidatorFn } from '@angular/forms';
import { FormGroup, FormBuilder, Validators, AbstractControl, ValidatorFn } from '@angular/forms';

@Component({
selector: 'date-info',
templateUrl: './date-info.component.html',
styleUrls: ['./date-info.component.scss']
})
export class DateInfoComponent implements OnInit {
public pageForm: UntypedFormGroup;
public pageForm: FormGroup;
customOutput: boolean = true;
inputValue: string = "1995/12/03";

isInvalidDate: boolean = false;

constructor(private fb: UntypedFormBuilder) {
constructor(private fb: FormBuilder) {
this.pageForm = this.fb.group({
dateCtrl: ['19951203']
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* found in the LICENSE file at https://angular.io/license
*/

import { UntypedFormControl, NgControl, NgForm } from '@angular/forms';
import { FormControl, NgControl, NgForm } from '@angular/forms';
import { Subject } from 'rxjs';
import { ErrorStateMatcher } from '../error/error-options';
import { Constructor } from './constructor';
Expand Down Expand Up @@ -52,7 +52,7 @@ export function mixinErrorState<T extends Constructor<HasErrorState>>(base: T)
const oldState = this.errorState;
const parent = this._parentForm;
const matcher = this.errorStateMatcher || this._defaultErrorStateMatcher;
const control = this.ngControl ? this.ngControl.control as UntypedFormControl : null;
const control = this.ngControl ? this.ngControl.control as FormControl : null;
const newState = matcher.isErrorState(control, parent);

if (newState !== oldState) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,20 @@
*/

import { Injectable } from '@angular/core';
import { NgForm, UntypedFormControl } from '@angular/forms';
import { NgForm, FormControl } from '@angular/forms';

/** Error state matcher that matches when a control is invalid and dirty. */
@Injectable()
export class ShowOnDirtyErrorStateMatcher implements ErrorStateMatcher {
isErrorState(control: UntypedFormControl | null, form: NgForm | null): boolean {
isErrorState(control: FormControl | null, form: NgForm | null): boolean {
return !!(control && control.invalid && (control.dirty || (form && form.submitted)));
}
}

/** Provider that defines how form controls behave with regards to displaying error messages. */
@Injectable({ providedIn: 'root' })
export class ErrorStateMatcher {
isErrorState(control: UntypedFormControl | null, form: NgForm | null): boolean {
isErrorState(control: FormControl | null, form: NgForm | null): boolean {
return !!(control && control.invalid && (control.touched || (form && form.submitted)));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
} from "@angular/core";
import { css } from "emotion";
import { BehaviorSubject } from "rxjs";
import { UntypedFormControl } from "@angular/forms";
import { FormControl } from "@angular/forms";
import { CssUtils } from "../utils";
import { coerceNumberProperty, coerceBooleanProperty } from "@angular/cdk/coercion";
import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';
Expand Down Expand Up @@ -124,7 +124,7 @@ export class DxcTextareaComponent
tabIndexValue: 0
});

public formControl = new UntypedFormControl();
public formControl = new FormControl();

constructor(private utils: CssUtils) {
this.numRows = 4;
Expand Down