@@ -12,6 +12,7 @@ import { styleControl } from "comps/controls/styleControl";
1212import { RefControl } from "comps/controls/refControl" ;
1313import { booleanExposingStateControl } from "comps/controls/codeStateControl" ;
1414import { changeEvent , eventHandlerControl } from "comps/controls/eventHandlerControl" ;
15+ import { disabledPropertyView } from "comps/utils/propertyUtils" ;
1516
1617interface SwitchWrapperProps {
1718 disabled : boolean ;
@@ -50,15 +51,6 @@ const getStyle = (style: SwitchStyleType) => {
5051const SwitchWrapper = styled . div < { disabled : boolean } > `
5152 display: flex;
5253 align-items: center;
53- // Can respond to drag & select events when disabled
54- ${ ( props ) =>
55- props . disabled &&
56- `
57- cursor: not-allowed;
58- >button:disabled {
59- pointer-events: none;
60- }
61- ` } ;
6254` ;
6355
6456const Wrapper = styled . div `
@@ -72,7 +64,6 @@ const childrenMap = {
7264 onEvent : eventHandlerControl ( EventOptions ) ,
7365 disabled : BoolCodeControl ,
7466 style : styleControl ( InputFieldStyle ) ,
75- labelStyle : styleControl ( LabelStyle . filter ( ( style ) => [ 'accent' , 'validate' ] . includes ( style . name ) === false ) ) ,
7667 viewRef : RefControl < HTMLElement > ,
7768} ;
7869
@@ -87,7 +78,7 @@ export const SwitchComp = (function () {
8778 return (
8879 < Switch
8980 checked = { value }
90- disabled = { props . disabled || true }
81+ disabled = { props . disabled }
9182 ref = { props . viewRef }
9283 onChange = { ( checked ) => {
9384 props . value . onChange ( checked ) ;
@@ -129,6 +120,8 @@ export const SwitchComp = (function () {
129120 label : trans ( "table.columnValue" ) ,
130121 tooltip : ColumnValueTooltip ,
131122 } ) }
123+ { children . onEvent . propertyView ( ) }
124+ { disabledPropertyView ( children ) }
132125
133126 </ >
134127 ) ;
0 commit comments