mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
@@ -42,7 +42,7 @@ import {Icon} from '../icon/icon';
|
||||
'<button *ng-if="showCancel" (click)="cancelAction($event, query)" class="searchbar-cancel">{{cancelText}}</button>',
|
||||
directives: [FORM_DIRECTIVES, NgIf, NgClass, Icon]
|
||||
})
|
||||
export class SearchBar extends Ion {
|
||||
export class Searchbar extends Ion {
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
|
||||
@@ -1,25 +1,25 @@
|
||||
|
||||
it('default should focus', function() {
|
||||
element(by.css('.e2eDefaultFloatingSearchBar input')).sendKeys("AA");
|
||||
element(by.css('.e2eDefaultFloatingSearchbar input')).sendKeys("AA");
|
||||
});
|
||||
|
||||
it('custom placeholder should focus', function() {
|
||||
element(by.css('.e2eCustomPlaceholderFloatingSearchBar input')).sendKeys("BB");
|
||||
element(by.css('.e2eCustomPlaceholderFloatingSearchbar input')).sendKeys("BB");
|
||||
});
|
||||
|
||||
it('default cancel button should focus', function() {
|
||||
element(by.css('.e2eDefaultCancelButtonFloatingSearchBar input')).sendKeys("CC");
|
||||
element(by.css('.e2eDefaultCancelButtonFloatingSearchbar input')).sendKeys("CC");
|
||||
});
|
||||
|
||||
it('custom cancel button should focus', function() {
|
||||
element(by.css('.e2eCustomCancelButtonFloatingSearchBar input')).sendKeys("DD");
|
||||
element(by.css('.e2eCustomCancelButtonFloatingSearchbar input')).sendKeys("DD");
|
||||
});
|
||||
|
||||
it('custom cancel action should focus', function() {
|
||||
element(by.css('.e2eCustomCancelActionFloatingSearchBar input')).sendKeys("FF");
|
||||
element(by.css('.e2eCustomCancelActionFloatingSearchbar input')).sendKeys("FF");
|
||||
});
|
||||
|
||||
// TODO - this test will work on iOS but fail on Android
|
||||
// it('custom cancel action should alert', function() {
|
||||
// element(by.css('.e2eCustomCancelActionFloatingSearchBar .searchbar-cancel')).click();
|
||||
// element(by.css('.e2eCustomCancelActionFloatingSearchbar .searchbar-cancel')).click();
|
||||
// });
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
<ion-content>
|
||||
<h5 padding-left padding-top> Search - Default </h5>
|
||||
<ion-searchbar [(ng-model)]="defaultSearch" class="e2eDefaultFloatingSearchBar"></ion-searchbar>
|
||||
<ion-searchbar [(ng-model)]="defaultSearch" class="e2eDefaultFloatingSearchbar"></ion-searchbar>
|
||||
|
||||
<h5 padding-left> Search - Custom Placeholder </h5>
|
||||
<ion-searchbar [(ng-model)]="customPlaceholder" placeholder="Filter Schedules" class="e2eCustomPlaceholderFloatingSearchBar"></ion-searchbar>
|
||||
<ion-searchbar [(ng-model)]="customPlaceholder" placeholder="Filter Schedules" class="e2eCustomPlaceholderFloatingSearchbar"></ion-searchbar>
|
||||
|
||||
<h5 padding-left> Search - Default Cancel Button </h5>
|
||||
<ion-searchbar [(ng-model)]="defaultCancel" show-cancel="true" class="e2eDefaultCancelButtonFloatingSearchBar"></ion-searchbar>
|
||||
<ion-searchbar [(ng-model)]="defaultCancel" show-cancel="true" class="e2eDefaultCancelButtonFloatingSearchbar"></ion-searchbar>
|
||||
|
||||
<h5 padding-left> Search - Custom Cancel Button Danger </h5>
|
||||
<ion-searchbar [(ng-model)]="customCancel" show-cancel="true" cancel-text="Really Long Cancel" class="e2eCustomCancelButtonFloatingSearchBar" danger></ion-searchbar>
|
||||
<ion-searchbar [(ng-model)]="customCancel" show-cancel="true" cancel-text="Really Long Cancel" class="e2eCustomCancelButtonFloatingSearchbar" danger></ion-searchbar>
|
||||
|
||||
<h5 padding-left> Search - Custom Cancel Action</h5>
|
||||
<ion-searchbar [(ng-model)]="customCancelAction" show-cancel="true" cancel-text="Done" [cancel-action]="myCancelAction" class="e2eCustomCancelActionFloatingSearchBar"></ion-searchbar>
|
||||
<ion-searchbar [(ng-model)]="customCancelAction" show-cancel="true" cancel-text="Done" [cancel-action]="myCancelAction" class="e2eCustomCancelActionFloatingSearchbar"></ion-searchbar>
|
||||
|
||||
<div *ng-if="clickedCustomAction">
|
||||
Clicked custom action with input = {{customCancelAction}}
|
||||
|
||||
@@ -23,7 +23,7 @@ import {TextInput, TextInputElement} from '../components/text-input/text-input';
|
||||
import {Label} from '../components/text-input/label';
|
||||
import {Segment, SegmentButton} from '../components/segment/segment';
|
||||
import {RadioGroup, RadioButton} from '../components/radio/radio';
|
||||
import {SearchBar} from '../components/searchbar/searchbar';
|
||||
import {Searchbar} from '../components/searchbar/searchbar';
|
||||
import {Nav} from '../components/nav/nav';
|
||||
import {NavPush, NavPop} from '../components/nav/nav-push';
|
||||
import {NavRouter} from '../components/nav/nav-router';
|
||||
@@ -76,7 +76,7 @@ export const IONIC_DIRECTIVES = [
|
||||
Icon,
|
||||
|
||||
// Forms
|
||||
SearchBar,
|
||||
Searchbar,
|
||||
Segment,
|
||||
SegmentButton,
|
||||
Checkbox,
|
||||
|
||||
Reference in New Issue
Block a user