-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add translate pipe to save button add ng-content ajfFormTopToolbarButtons for adding buttons on top toolbar now you can override the save form button added form 2e2 specs fix aria label form single choice fields and input fields
- Loading branch information
Showing
13 changed files
with
164 additions
and
24 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ ng_module( | |
deps = [ | ||
"//src/material/forms", | ||
"@npm//@angular/router", | ||
"@npm//rxjs", | ||
], | ||
) | ||
|
||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
<h1>Number Field Example</h1> | ||
<section> | ||
<ajf-form [form]="form"></ajf-form> | ||
</section> | ||
<ajf-form | ||
[form]="form" | ||
[topBar]="(topBar$|async)|| false" | ||
[hideTopToolbar]="(hideToolbar$|async)|| false" | ||
></ajf-form> | ||
</section> |
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
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 |
---|---|---|
@@ -0,0 +1,89 @@ | ||
import {browser, by, element} from 'protractor'; | ||
|
||
describe('ajf-form test top toolbar input', () => { | ||
it(`topbar input is true and hideTopToolbar is not defined: | ||
should show three mat toolbars(topBar buttonsBar pageSliderToolBar)`, | ||
async () => { | ||
await browser.get('/mat-form/?topbar=true'); | ||
const toolbars = await element.all(by.tagName('mat-toolbar')).getWebElements(); | ||
expect(toolbars.length).toBe(3); | ||
|
||
const topBar = toolbars[0]; | ||
expect(await topBar.getText()).toBe('Number Field Example'); | ||
const buttonsBar = toolbars[1]; | ||
expect(await buttonsBar.getText()).toBe('Save'); | ||
}); | ||
it(`topbar input is true and hideTopToolbar is false: | ||
should show one mat toolbar(pageSliderToolBar)`, | ||
async () => { | ||
await browser.get('/mat-form/?topbar=true&hidetoolbar=false'); | ||
const toolbars = await element.all(by.tagName('mat-toolbar')).getWebElements(); | ||
expect(toolbars.length).toBe(3); | ||
|
||
const topBar = toolbars[0]; | ||
expect(await topBar.getText()).toBe('Number Field Example'); | ||
const buttonsBar = toolbars[1]; | ||
expect(await buttonsBar.getText()).toBe('Save'); | ||
}); | ||
it(`topbar input is true and hideTopToolbar is true: | ||
should show one mat toolbar(pageSliderToolBar)`, | ||
async () => { | ||
await browser.get('/mat-form/?topbar=true&hidetoolbar=true'); | ||
const toolbars = await element.all(by.tagName('mat-toolbar')).getWebElements(); | ||
expect(toolbars.length).toBe(1); | ||
}); | ||
it(`topbar input is false and hideTopToolbar is not defined: | ||
should show two mat toolbars(buttonsBar pageSliderToolBar)`, | ||
async () => { | ||
await browser.get('/mat-form/?topbar=false'); | ||
const toolbars = await element.all(by.tagName('mat-toolbar')).getWebElements(); | ||
expect(toolbars.length).toBe(2); | ||
|
||
const buttonsBar = toolbars[0]; | ||
expect(await buttonsBar.getText()).toBe('Save'); | ||
}); | ||
it(`topbar input is false and hideTopToolbar is false: | ||
should show two mat toolbars(buttonsBar pageSliderToolBar)`, | ||
async () => { | ||
await browser.get('/mat-form/?topbar=false&hidetoolbar=false'); | ||
const toolbars = await element.all(by.tagName('mat-toolbar')).getWebElements(); | ||
expect(toolbars.length).toBe(2); | ||
|
||
const buttonsBar = toolbars[0]; | ||
expect(await buttonsBar.getText()).toBe('Save'); | ||
}); | ||
it(`topbar input is false and hideTopToolbar is true: | ||
should show one mat toolbar(pageSliderToolBar)`, | ||
async () => { | ||
await browser.get('/mat-form/?topbar=true&hidetoolbar=true'); | ||
const toolbars = await element.all(by.tagName('mat-toolbar')).getWebElements(); | ||
expect(toolbars.length).toBe(1); | ||
}); | ||
it(`topbar input is not defined and hideTopToolbar is not defined: | ||
should show two mat toolbars(buttonsBar pageSliderToolBar)`, | ||
async () => { | ||
await browser.get('/mat-form/'); | ||
const toolbars = await element.all(by.tagName('mat-toolbar')).getWebElements(); | ||
expect(toolbars.length).toBe(2); | ||
|
||
const buttonsBar = toolbars[0]; | ||
expect(await buttonsBar.getText()).toBe('Save'); | ||
}); | ||
it(`topbar input is not defined and hideTopToolbar is false: | ||
should show two mat toolbars(buttonsBar pageSliderToolBar)`, | ||
async () => { | ||
await browser.get('/mat-form/?hidetoolbar=false'); | ||
const toolbars = await element.all(by.tagName('mat-toolbar')).getWebElements(); | ||
expect(toolbars.length).toBe(2); | ||
|
||
const buttonsBar = toolbars[0]; | ||
expect(await buttonsBar.getText()).toBe('Save'); | ||
}); | ||
it(`topbar input is not defined and hideTopToolbar is true: | ||
should show one mat toolbar(pageSliderToolBar)`, | ||
async () => { | ||
await browser.get('/mat-form/?hidetoolbar=true'); | ||
const toolbars = await element.all(by.tagName('mat-toolbar')).getWebElements(); | ||
expect(toolbars.length).toBe(1); | ||
}); | ||
}); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<mat-form-field *ngIf="control|async as ctrl"> | ||
<input matInput *ngIf="type === 'text'" type="text" [formControl]="ctrl!" | ||
[readonly]="instance|ajfIsReadonlyInputField"> | ||
[readonly]="instance|ajfIsReadonlyInputField" [attr.aria-labelledby]="instance.node.name"> | ||
<input matInput *ngIf="type === 'number'" type="number" [formControl]="ctrl!" | ||
[readonly]="instance|ajfIsReadonlyInputField"> | ||
[readonly]="instance|ajfIsReadonlyInputField" [attr.aria-labelledby]="instance.node.name"> | ||
</mat-form-field> |
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