mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-20 20:33:32 +08:00
fix(input): update input css/tests
This commit is contained in:
@ -19,7 +19,7 @@ $checkbox-ios-icon-checkmark-color: $background-ios-color !default;
|
||||
|
||||
$checkbox-ios-media-margin: $item-ios-padding-media-top $item-ios-padding-right $item-ios-padding-media-bottom 2px !default;
|
||||
|
||||
$checkbox-ios-disabled-opacity: 0.5 !default;
|
||||
$checkbox-ios-disabled-opacity: 0.4 !default;
|
||||
|
||||
|
||||
// iOS Checkbox Outer Circle: Unchecked
|
||||
|
@ -9,7 +9,7 @@ $checkbox-md-border-bottom-color: $list-md-border-color !default;
|
||||
$checkbox-md-padding: $item-md-padding-top ($item-md-padding-right / 2) $item-md-padding-bottom 0 !default;
|
||||
$checkbox-md-margin: 0 !default;
|
||||
$checkbox-md-media-margin: $item-md-padding-media-top 36px $item-md-padding-media-bottom 4px !default;
|
||||
$checkbox-md-disabled-opacity: 0.5 !default;
|
||||
$checkbox-md-disabled-opacity: 0.4 !default;
|
||||
|
||||
$checkbox-md-icon-background-color-off: $list-md-background-color !default;
|
||||
$checkbox-md-icon-background-color-on: map-get($colors-md, primary) !default;
|
||||
@ -78,13 +78,17 @@ $checkbox-md-icon-border-color-on: map-get($colors-md, primary) !default;
|
||||
}
|
||||
|
||||
|
||||
// Material Design Checkbox within an item
|
||||
// Material Design Checkbox Within An Item
|
||||
// -----------------------------------------
|
||||
|
||||
.item ion-checkbox {
|
||||
margin: $checkbox-md-media-margin;
|
||||
}
|
||||
|
||||
ion-checkbox + .item-inner ion-label {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
|
||||
// Material Design Checkbox Color Mixin
|
||||
// --------------------------------------------------
|
||||
|
@ -80,6 +80,7 @@ export class Checkbox {
|
||||
if (_item) {
|
||||
this.id = 'chk-' + _item.registerInput('checkbox');
|
||||
this._labelId = 'lbl-' + _item.id;
|
||||
this._item.setCssClass('item-checkbox', true);
|
||||
}
|
||||
}
|
||||
|
||||
@ -91,11 +92,11 @@ export class Checkbox {
|
||||
this.checked = !this.checked;
|
||||
}
|
||||
|
||||
@Input()
|
||||
get checked() {
|
||||
return this._checked;
|
||||
}
|
||||
|
||||
@Input()
|
||||
set checked(val) {
|
||||
if (!this._disabled) {
|
||||
this._checked = (val === true || val === 'true');
|
||||
@ -104,11 +105,11 @@ export class Checkbox {
|
||||
}
|
||||
}
|
||||
|
||||
@Input()
|
||||
get disabled() {
|
||||
return this._disabled;
|
||||
}
|
||||
|
||||
@Input()
|
||||
set disabled(val) {
|
||||
this._disabled = (val === true || val === 'true');
|
||||
this._item && this._item.setCssClass('item-checkbox-disabled', this._disabled);
|
||||
|
Reference in New Issue
Block a user