mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-23 05:58:26 +08:00
@ -10,12 +10,17 @@ $select-ios-padding-bottom: $item-ios-padding-bottom !default;
|
|||||||
$select-ios-padding-left: $item-ios-padding-left !default;
|
$select-ios-padding-left: $item-ios-padding-left !default;
|
||||||
|
|
||||||
$select-ios-icon-color: #999 !default;
|
$select-ios-icon-color: #999 !default;
|
||||||
|
$select-ios-placeholder-color: $select-ios-icon-color !default;
|
||||||
|
|
||||||
|
|
||||||
ion-select {
|
ion-select {
|
||||||
padding: $select-ios-padding-top $select-ios-padding-right $select-ios-padding-bottom $select-ios-padding-left;
|
padding: $select-ios-padding-top $select-ios-padding-right $select-ios-padding-bottom $select-ios-padding-left;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.select-placeholder {
|
||||||
|
color: $select-ios-placeholder-color;
|
||||||
|
}
|
||||||
|
|
||||||
.select-icon {
|
.select-icon {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
|
@ -10,12 +10,17 @@ $select-md-padding-bottom: $item-md-padding-bottom !default;
|
|||||||
$select-md-padding-left: $item-md-padding-left !default;
|
$select-md-padding-left: $item-md-padding-left !default;
|
||||||
|
|
||||||
$select-md-icon-color: #999 !default;
|
$select-md-icon-color: #999 !default;
|
||||||
|
$select-md-placeholder-color: $select-md-icon-color !default;
|
||||||
|
|
||||||
|
|
||||||
ion-select {
|
ion-select {
|
||||||
padding: $select-md-padding-top $select-md-padding-right $select-md-padding-bottom $select-md-padding-left;
|
padding: $select-md-padding-top $select-md-padding-right $select-md-padding-bottom $select-md-padding-left;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.select-placeholder {
|
||||||
|
color: $select-md-placeholder-color;
|
||||||
|
}
|
||||||
|
|
||||||
.item-select ion-label {
|
.item-select ion-label {
|
||||||
margin-left: 0;
|
margin-left: 0;
|
||||||
}
|
}
|
||||||
|
@ -116,7 +116,8 @@ const SELECT_VALUE_ACCESSOR = new Provider(
|
|||||||
@Component({
|
@Component({
|
||||||
selector: 'ion-select',
|
selector: 'ion-select',
|
||||||
template:
|
template:
|
||||||
'<div class="select-text">{{_text}}</div>' +
|
'<div *ngIf="!_text" class="select-placeholder select-text">{{placeholder}}</div>' +
|
||||||
|
'<div *ngIf="_text" class="select-text">{{_text}}</div>' +
|
||||||
'<div class="select-icon">' +
|
'<div class="select-icon">' +
|
||||||
'<div class="select-icon-inner"></div>' +
|
'<div class="select-icon-inner"></div>' +
|
||||||
'</div>' +
|
'</div>' +
|
||||||
@ -159,6 +160,11 @@ export class Select {
|
|||||||
*/
|
*/
|
||||||
@Input() okText: string = 'OK';
|
@Input() okText: string = 'OK';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @input {string} The text to display when the select is empty.
|
||||||
|
*/
|
||||||
|
@Input() placeholder: string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @input {any} Any addition options that the alert interface can take.
|
* @input {any} Any addition options that the alert interface can take.
|
||||||
* See the [Alert API docs](../../alert/Alert) for the create options.
|
* See the [Alert API docs](../../alert/Alert) for the create options.
|
||||||
|
@ -17,7 +17,9 @@ $select-wp-border-color: $input-wp-border-color !default;
|
|||||||
|
|
||||||
$select-wp-icon-width: 18px !default;
|
$select-wp-icon-width: 18px !default;
|
||||||
$select-wp-icon-arrow-width: 2px !default;
|
$select-wp-icon-arrow-width: 2px !default;
|
||||||
|
|
||||||
$select-wp-icon-color: $select-wp-border-color !default;
|
$select-wp-icon-color: $select-wp-border-color !default;
|
||||||
|
$select-wp-placeholder-color: $select-wp-icon-color !default;
|
||||||
|
|
||||||
|
|
||||||
ion-select {
|
ion-select {
|
||||||
@ -32,6 +34,10 @@ ion-select {
|
|||||||
line-height: 3rem;
|
line-height: 3rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.select-placeholder {
|
||||||
|
color: $select-wp-placeholder-color;
|
||||||
|
}
|
||||||
|
|
||||||
.item-select ion-label {
|
.item-select ion-label {
|
||||||
margin-left: 0;
|
margin-left: 0;
|
||||||
}
|
}
|
||||||
|
@ -49,7 +49,7 @@
|
|||||||
|
|
||||||
<ion-item>
|
<ion-item>
|
||||||
<ion-label>Music</ion-label>
|
<ion-label>Music</ion-label>
|
||||||
<ion-select [(ngModel)]="music" [alertOptions]="musicAlertOpts">
|
<ion-select [(ngModel)]="music" [alertOptions]="musicAlertOpts" placeholder="Select Music">
|
||||||
<ion-option>Alice in Chains</ion-option>
|
<ion-option>Alice in Chains</ion-option>
|
||||||
<ion-option>Green Day</ion-option>
|
<ion-option>Green Day</ion-option>
|
||||||
<ion-option>Nirvana</ion-option>
|
<ion-option>Nirvana</ion-option>
|
||||||
|
Reference in New Issue
Block a user