diff --git a/projects/go-style-guide/src/app/features/ui-kit/components/form-docs/components/forms-overview/forms-overview.component.html b/projects/go-style-guide/src/app/features/ui-kit/components/form-docs/components/forms-overview/forms-overview.component.html index 4f5c46ddd..456fe9ba3 100644 --- a/projects/go-style-guide/src/app/features/ui-kit/components/form-docs/components/forms-overview/forms-overview.component.html +++ b/projects/go-style-guide/src/app/features/ui-kit/components/form-docs/components/forms-overview/forms-overview.component.html @@ -5,25 +5,28 @@

Reactive Forms

-

As per the Angular Documentation:

+

+ As per the + Angular Documentation: +

- Reactive forms use an explicit and immutable approach to - managing the state of a form at a given point in time. - Each change to the form state returns a new state, which - maintains the integrity of the model between changes. - Reactive forms are built around observable streams, where - form inputs and values are provided as streams of input - values, which can be accessed synchronously. + Reactive forms use an explicit and immutable approach to managing the + state of a form at a given point in time. Each change to the form state + returns a new state, which maintains the integrity of the model between + changes. Reactive forms are built around observable streams, where form + inputs and values are provided as streams of input values, which can be + accessed synchronously.

- Reactive forms differ from template-driven forms in distinct - ways. Reactive forms provide more predictability with - synchronous access to the data model, immutability with - observable operators, and change tracking through observable - streams. If you prefer direct access to modify data in your - template, template-driven forms are less explicit because they - rely on directives embedded in the template, along with mutable - data to track changes asynchronously. + Reactive forms differ from template-driven forms in distinct ways. + Reactive forms provide more predictability with synchronous access to + the data model, immutability with observable operators, and change + tracking through observable streams. If you prefer direct access to + modify data in your template, template-driven forms are less explicit + because they rely on directives embedded in the template, along with + mutable data to track changes asynchronously.

@@ -34,15 +37,22 @@

Required Inputs

-

As per the Angular Documentation:

+

+ As per the + Angular Documentation: +

- Form controls have the ability to pass in Validators. In the case of every form input in Goponents we pass a control - thus you may specify on the control passed in to any form input a Validators.required validator on the control. Adding this validator - to any control in Goponents will render a red asterisk next to the label automatically. + Form controls have the ability to pass in Validators. In the case of + every form input in Goponents we pass a control thus you may specify on + the control passed in to any form input a Validators.required validator + on the control. Adding this validator to any control in Goponents will + render a red asterisk next to the label automatically.

- +
@@ -53,40 +63,62 @@

Validation Errors

-

As per the Angular Documentation:

+

+ As per the + Angular Documentation: +

- Form controls have the ability to hold a set of ValidationErrors. In the case of every form input in Goponents we automatically look for these - ValidationErrors and render error text beneath the form element dynamically. This is how form error handling should be done within Goponents. + Form controls have the ability to hold a set of + ValidationErrors. In the case of + every form input in Goponents we automatically look for these + ValidationErrors and render + error text beneath the form element dynamically. These errors are + displayed by default, but they can be hidden by setting + hideFieldError input property to + true. This is how form error handling should be done within Goponents.

+ + placeholder="Try typing something..." + >

- Angular provides some ValidationErrors out of the box, Goponents provides default error messages for: - email, max, maxlength, - min, minlength, required, and requiredtrue. - These will automatically render error messages if the matching Angular Validators are set for the control. If desired, these can be overridden by - passing a key/value validator with the same name of the Angular one and a custom string as the value. + Angular provides some + ValidationErrors out of the box, + Goponents provides default error messages for: + email, + max, + maxlength, + min, + minlength, + required, and + requiredtrue. These will + automatically render error messages if the matching Angular Validators + are set for the control. If desired, these can be overridden by passing + a key/value validator with the same name of the Angular one and a custom + string as the value.

-

- Form Elements Example -

+

Form Elements Example

@@ -98,84 +130,95 @@

label="Form Theme" [clearable]="false" [control]="themeSelect" - [items]="['light', 'dark']"> + [items]="['light', 'dark']" + > -
+
+ [ngClass]="{ + 'go-form--dark card-form-dark': themeSelect.value === 'dark' + }" + [formGroup]="form" + >

Create Profile

+ [control]="form.get('name')" + > + [control]="form.get('bio')" + > + [control]="form.get('birthday')" + > + [control]="form.get('birthtime')" + > + [theme]="themeSelect.value" + > + [items]="hpCharacters" + > + [control]="form.get('enableNotifications')" + > + [control]="form.get('notificationMethod')" + >
- - +
- - +
+ [control]="form.get('notificationsReceived')" + > + [control]="form.get('notificationsReceived').get('comments')" + > + [control]="form.get('notificationsReceived').get('mentions')" + >