-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: (core) Add [state] to all input-group related components. Adapt…
… forms (#1613) * Add [state] @input to all input-group related components Solve conflicts, Change FormState type file Add new forms styling Add input group examples Add datepicker form example Add multiple addons on input group Adapt new forms from styles, add form usage example in input-group components Change input group multiple addons * Add semantic toggle, beautify forms examples * Fix cursor pointer, remove old help message examples * Remove [isCheck], remove fd-form-control class, change fd-form-set to fd-fieldset * Solve rebase conflicts, fix tests * Adapt newest RC.21 version with new input groups * Adapt 0.4.0v styles * Remove multi addons, fix localization editor compact mode * Fix documentation, playground, optimize class adding * Fix datepicker and datetimepickers examples state, remove leftovers * Change bracket on comments * Fix stackblitz, remove scss imports, change fd-fieldset to body-less component, remove brs * Add dynamic states to datepickers * Add example of dynamic state to multi input
- Loading branch information
1 parent
4adbf80
commit adabbc7
Showing
115 changed files
with
965 additions
and
690 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
84 changes: 56 additions & 28 deletions
84
apps/docs/src/app/core/component-docs/checkbox/examples/checkbox-example.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,86 +1,114 @@ | ||
<fieldset fd-form-set> | ||
<fieldset fd-fieldset> | ||
<legend fd-form-legend>Checkboxes</legend> | ||
<div fd-form-item [isCheck]="true"> | ||
<label fd-form-label for="checkbox-1"> | ||
<div fd-form-item> | ||
<label fd-form-label for="checkbox-1" [checkbox]="true"> | ||
<input fd-form-control type="checkbox" id="checkbox-1" name="checkbox-name-1" checked> | ||
Option One | ||
</label> | ||
</div> | ||
<div fd-form-item [isCheck]="true"> | ||
<label fd-form-label for="checkbox-2"> | ||
<div fd-form-item> | ||
<label fd-form-label for="checkbox-2" [checkbox]="true"> | ||
<input fd-form-control type="checkbox" id="checkbox-2" name="checkbox-name-1"> | ||
Option Two | ||
</label> | ||
</div> | ||
<div fd-form-item [isCheck]="true"> | ||
<label fd-form-label for="checkbox-3"> | ||
<div fd-form-item> | ||
<label fd-form-label for="checkbox-3" [checkbox]="true"> | ||
<input fd-form-control type="checkbox" id="checkbox-3" name="checkbox-name-1"> | ||
Option Three | ||
</label> | ||
</div> | ||
</fieldset> | ||
|
||
<fieldset fd-form-set> | ||
<fieldset fd-fieldset> | ||
<legend fd-form-legend>Compact Checkboxes</legend> | ||
<div fd-form-item> | ||
<label fd-form-label for="checkbox-13" [checkbox]="true"> | ||
<input fd-form-control [compact]="true" type="checkbox" id="checkbox-13" name="checkbox-name-6" checked> | ||
Option One | ||
</label> | ||
</div> | ||
<div fd-form-item> | ||
<label fd-form-label for="checkbox-14" [checkbox]="true"> | ||
<input fd-form-control [compact]="true" type="checkbox" id="checkbox-14" name="checkbox-name-6"> | ||
Option Two | ||
</label> | ||
</div> | ||
<div fd-form-item> | ||
<label fd-form-label for="checkbox-15" [checkbox]="true"> | ||
<input fd-form-control [compact]="true" type="checkbox" id="checkbox-15" name="checkbox-name-6"> | ||
Option Three | ||
</label> | ||
</div> | ||
</fieldset> | ||
|
||
<fieldset fd-fieldset> | ||
<legend fd-form-legend>Checkboxes disabled</legend> | ||
<div fd-form-item [isCheck]="true"> | ||
<label fd-form-label for="checkbox-4"> | ||
<div fd-form-item> | ||
<label fd-form-label for="checkbox-4" [checkbox]="true"> | ||
<input fd-form-control type="checkbox" id="checkbox-4" name="checkbox-name-2" disabled> | ||
Option One | ||
</label> | ||
</div> | ||
<div fd-form-item [isCheck]="true"> | ||
<label fd-form-label for="checkbox-5"> | ||
<div fd-form-item> | ||
<label fd-form-label for="checkbox-5" [checkbox]="true"> | ||
<input fd-form-control type="checkbox" id="checkbox-5" name="checkbox-name-2" checked disabled> | ||
Option Two | ||
</label> | ||
</div> | ||
<div fd-form-item [isCheck]="true"> | ||
<label fd-form-label for="checkbox-6"> | ||
<div fd-form-item> | ||
<label fd-form-label for="checkbox-6" [checkbox]="true"> | ||
<input fd-form-control type="checkbox" id="checkbox-6" name="checkbox-name-2" disabled> | ||
Option Three | ||
</label> | ||
</div> | ||
</fieldset> | ||
<fieldset fd-form-set> | ||
<fieldset fd-fieldset> | ||
<legend fd-form-legend>Checkboxes inline</legend> | ||
<fd-form-group> | ||
<div fd-form-item [isInline]="true" [isCheck]="true"> | ||
<label fd-form-label for="checkbox-7"> | ||
<div fd-form-item [isInline]="true"> | ||
<label fd-form-label for="checkbox-7" [checkbox]="true"> | ||
<input fd-form-control type="checkbox" id="checkbox-7" name="checkbox-name-3" checked> Option One | ||
</label> | ||
</div> | ||
<div fd-form-item [isInline]="true" [isCheck]="true"> | ||
<label fd-form-label for="checkbox-8"> | ||
<div fd-form-item [isInline]="true"> | ||
<label fd-form-label for="checkbox-8" [checkbox]="true"> | ||
<input fd-form-control type="checkbox" id="checkbox-8" name="checkbox-name-3"> Option Two | ||
</label> | ||
</div> | ||
<div fd-form-item [isInline]="true" [isCheck]="true"> | ||
<label fd-form-label for="checkbox-9"> | ||
<div fd-form-item [isInline]="true"> | ||
<label fd-form-label for="checkbox-9" [checkbox]="true"> | ||
<input fd-form-control type="checkbox" id="checkbox-9" name="checkbox-name-3"> Option Three | ||
</label> | ||
</div> | ||
</fd-form-group> | ||
</fieldset> | ||
<fieldset fd-form-set> | ||
<fieldset fd-fieldset> | ||
<legend fd-form-legend>Checkbox States</legend> | ||
<fd-form-group> | ||
<div fd-form-item [isCheck]="true"> | ||
<label fd-form-label for="checkbox-10"> | ||
<div fd-form-item> | ||
<label fd-form-label for="checkbox-10" [checkbox]="true"> | ||
<input fd-form-control type="checkbox" id="checkbox-10" name="checkbox-name-3" [state]="'valid'"> | ||
Valid Option | ||
</label> | ||
</div> | ||
<div fd-form-item [isCheck]="true"> | ||
<label fd-form-label for="checkbox-11"> | ||
<div fd-form-item> | ||
<label fd-form-label for="checkbox-11" [checkbox]="true"> | ||
<input fd-form-control type="checkbox" id="checkbox-11" name="checkbox-name-4" [state]="'warning'"> | ||
Warning Option | ||
</label> | ||
</div> | ||
<div fd-form-item [isCheck]="true"> | ||
<label fd-form-label for="checkbox-12"> | ||
<div fd-form-item> | ||
<label fd-form-label for="checkbox-12" [checkbox]="true"> | ||
<input fd-form-control type="checkbox" id="checkbox-12" name="checkbox-name-5" [state]="'invalid'"> | ||
Invalid Option | ||
</label> | ||
</div> | ||
<div fd-form-item> | ||
<label fd-form-label for="checkbox-16" [checkbox]="true"> | ||
<input fd-form-control type="checkbox" id="checkbox-16" name="checkbox-name-5" [state]="'information'"> | ||
Information Option | ||
</label> | ||
</div> | ||
</fd-form-group> | ||
</fieldset> |
28 changes: 14 additions & 14 deletions
28
.../src/app/core/component-docs/checkbox/examples/checkbox-form-group-example.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 9 additions & 3 deletions
12
.../app/core/component-docs/date-picker/examples/date-picker-allow-null-example.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,21 @@ | ||
import { Component } from '@angular/core'; | ||
import { FdDate } from '@fundamental-ngx/core'; | ||
import { Component, ViewChild } from '@angular/core'; | ||
import { DatePickerComponent, FdDate } from '@fundamental-ngx/core'; | ||
|
||
@Component({ | ||
selector: 'fd-date-picker-allow-null-example', | ||
template: ` | ||
<fd-date-picker [allowNull]="false" [type]="'single'" [(ngModel)]="date"></fd-date-picker> | ||
<fd-date-picker [allowNull]="false" [type]="'single'" [(ngModel)]="date" [state]="isInvalid() ? 'invalid' : 'valid'"></fd-date-picker> | ||
<br/> | ||
<div>Selected Date: {{date ? date.toDateString() : 'null'}}</div>` | ||
}) | ||
export class DatePickerAllowNullExampleComponent { | ||
|
||
@ViewChild(DatePickerComponent, { static: false }) datePicker: DatePickerComponent; | ||
|
||
date = FdDate.getToday(); | ||
|
||
isInvalid(): boolean { | ||
return !this.datePicker || !this.datePicker.isModelValid() | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 11 additions & 4 deletions
15
...time-picker/examples/datetime-allow-null-example/datetime-allow-null-example.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,20 @@ | ||
import { Component } from '@angular/core'; | ||
import { FdDatetime } from '@fundamental-ngx/core'; | ||
import { Component, ViewChild } from '@angular/core'; | ||
import { DatetimePickerComponent, FdDatetime } from '@fundamental-ngx/core'; | ||
|
||
@Component({ | ||
selector: 'fd-date-time-picker-allow-null-example', | ||
template: ` <fd-datetime-picker [allowNull]="false" [(ngModel)]="selectedDay"></fd-datetime-picker> | ||
<span style="padding-left: 20px;">Selected Date: {{selectedDay?.toLocaleDateString()}}</span>` | ||
template: ` | ||
<fd-datetime-picker [allowNull]="false" [(ngModel)]="selectedDay" [state]="isValid() ? 'invalid' : 'valid'"></fd-datetime-picker> | ||
<span style="padding-left: 20px;">Selected Date: {{selectedDay?.toLocaleDateString()}}</span> | ||
` | ||
}) | ||
export class DatetimePickerAllowNullExampleComponent { | ||
|
||
@ViewChild(DatetimePickerComponent, { static: false }) datePicker: DatetimePickerComponent; | ||
|
||
selectedDay: FdDatetime = FdDatetime.getToday(); | ||
|
||
isValid(): boolean { | ||
return this.datePicker && this.datePicker.isInvalidDateInput | ||
} | ||
} |
Oops, something went wrong.