@@ -12,6 +12,7 @@ import { styleControl } from "comps/controls/styleControl";
12
12
import { RefControl } from "comps/controls/refControl" ;
13
13
import { booleanExposingStateControl } from "comps/controls/codeStateControl" ;
14
14
import { changeEvent , eventHandlerControl } from "comps/controls/eventHandlerControl" ;
15
+ import { disabledPropertyView } from "comps/utils/propertyUtils" ;
15
16
16
17
interface SwitchWrapperProps {
17
18
disabled : boolean ;
@@ -50,15 +51,6 @@ const getStyle = (style: SwitchStyleType) => {
50
51
const SwitchWrapper = styled . div < { disabled : boolean } > `
51
52
display: flex;
52
53
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
- ` } ;
62
54
` ;
63
55
64
56
const Wrapper = styled . div `
@@ -72,7 +64,6 @@ const childrenMap = {
72
64
onEvent : eventHandlerControl ( EventOptions ) ,
73
65
disabled : BoolCodeControl ,
74
66
style : styleControl ( InputFieldStyle ) ,
75
- labelStyle : styleControl ( LabelStyle . filter ( ( style ) => [ 'accent' , 'validate' ] . includes ( style . name ) === false ) ) ,
76
67
viewRef : RefControl < HTMLElement > ,
77
68
} ;
78
69
@@ -87,7 +78,7 @@ export const SwitchComp = (function () {
87
78
return (
88
79
< Switch
89
80
checked = { value }
90
- disabled = { props . disabled || true }
81
+ disabled = { props . disabled }
91
82
ref = { props . viewRef }
92
83
onChange = { ( checked ) => {
93
84
props . value . onChange ( checked ) ;
@@ -129,6 +120,8 @@ export const SwitchComp = (function () {
129
120
label : trans ( "table.columnValue" ) ,
130
121
tooltip : ColumnValueTooltip ,
131
122
} ) }
123
+ { children . onEvent . propertyView ( ) }
124
+ { disabledPropertyView ( children ) }
132
125
133
126
</ >
134
127
) ;
0 commit comments