File tree Expand file tree Collapse file tree 2 files changed +28
-1
lines changed
Expand file tree Collapse file tree 2 files changed +28
-1
lines changed Original file line number Diff line number Diff line change @@ -54,3 +54,26 @@ styles.checkbox.checked>.box>.background-box {
5454 transform : scale3d (1 , 1 , 1 );
5555 border-radius : 0 ;
5656}
57+
58+ styles .checkbox [disabled = "" ],
59+ styles .checkbox [disabled = "true" ] {
60+ pointer-events : none;
61+ cursor : default;
62+ }
63+
64+ styles .checkbox [disabled = "" ]> .box : hover ,
65+ styles .checkbox [disabled = "true" ]> .box : hover {
66+ border : ${disabledBorder || $swatches.grey .p400 } solid 2px;
67+ bor der- radius: 3px;
68+ }
69+
70+ styles .checkbox .checked [disabled = "" ]> .box ,
71+ styles .checkbox .checked [disabled = "true" ]> .box {
72+ background-color : ${disabledBackground || $swatches.grey .p500 };
73+ bor der: ${disabledBackground || $swatches.grey .p500 } solid 2px;
74+ }
75+
76+ styles .checkbox [disabled = "" ]> .box > .background-box ::after ,
77+ styles .checkbox [disabled = "true" ]> .box > .background-box ::after {
78+ border-color : ${disabledForeground || $swatches.white };
79+ }
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ import { processDesignAttributes } from '../designs/design-attributes';
99@customElement ( 'ux-checkbox' )
1010@processAttributes ( processDesignAttributes )
1111export class UxCheckbox implements Themable {
12- @bindable public disabled = false ;
12+ @bindable public disabled : any = null ;
1313 @bindable public effect = null ;
1414 @bindable public matcher = ( a : any , b : any ) => a === b ;
1515 @bindable public model : any ;
@@ -59,6 +59,10 @@ export class UxCheckbox implements Themable {
5959 }
6060
6161 public toggleCheckbox ( ) {
62+ if ( this . disabled === true || this . disabled === '' ) {
63+ return ;
64+ }
65+
6266 const elementValue = this . model ? this . model : this . value ;
6367
6468 if ( Array . isArray ( this . checked ) ) {
You can’t perform that action at this time.
0 commit comments