@@ -10,7 +10,6 @@ import { trans } from "i18n";
1010import styled from "styled-components" ;
1111import { ColumnLink } from "comps/comps/tableComp/column/columnTypeComps/columnLinkComp" ;
1212import { LightActiveTextColor , PrimaryColor } from "constants/style" ;
13- import { clickEvent , eventHandlerControl } from "comps/controls/eventHandlerControl" ;
1413
1514const MenuLinkWrapper = styled . div `
1615 > a {
@@ -38,26 +37,13 @@ const MenuWrapper = styled.div`
3837 }
3938` ;
4039
41- const LinksEventOptions = [ clickEvent ] as const ;
42-
4340// Memoized menu item component
44- const MenuItem = React . memo ( ( { option, index, onMainEvent } : { option : any ; index : number ; onMainEvent ?: ( eventName : string ) => void } ) => {
41+ const MenuItem = React . memo ( ( { option, index } : { option : any ; index : number } ) => {
4542 const handleClick = useCallback ( ( ) => {
46- if ( ! option . disabled ) {
47- // Trigger legacy onClick action for backward compatibility
48- if ( option . onClick ) {
49- option . onClick ( ) ;
50- }
51- // Trigger individual item event handlers
52- if ( option . onEvent ) {
53- option . onEvent ( "click" ) ;
54- }
55- // Trigger the main column's event handler
56- if ( onMainEvent ) {
57- onMainEvent ( "click" ) ;
58- }
43+ if ( ! option . disabled && option . onClick ) {
44+ option . onClick ( ) ;
5945 }
60- } , [ option . disabled , option . onClick , option . onEvent , onMainEvent ] ) ;
46+ } , [ option . disabled , option . onClick ] ) ;
6147
6248 return (
6349 < MenuLinkWrapper >
@@ -72,12 +58,10 @@ const MenuItem = React.memo(({ option, index, onMainEvent }: { option: any; inde
7258
7359MenuItem . displayName = 'MenuItem' ;
7460
75- // Update OptionItem to include event handlers
7661const OptionItem = new MultiCompBuilder (
7762 {
7863 label : StringControl ,
7964 onClick : ActionSelectorControlInContext ,
80- onEvent : eventHandlerControl ( LinksEventOptions ) ,
8165 hidden : BoolCodeControl ,
8266 disabled : BoolCodeControl ,
8367 } ,
@@ -86,28 +70,22 @@ const OptionItem = new MultiCompBuilder(
8670 }
8771)
8872 . setPropertyViewFn ( ( children ) => {
89- // Check if there's a legacy action configured for this individual item
90- const hasLegacyAction = children . onClick . getView ( ) &&
91- typeof children . onClick . getView ( ) === 'function' &&
92- children . onClick . displayName ( ) !== trans ( "eventHandler.incomplete" ) ;
93-
9473 return (
9574 < >
9675 { children . label . propertyView ( { label : trans ( "label" ) } ) }
97- { hasLegacyAction && children . onClick . propertyView ( {
76+ { children . onClick . propertyView ( {
9877 label : trans ( "table.action" ) ,
9978 placement : "table" ,
10079 } ) }
10180 { hiddenPropertyView ( children ) }
10281 { disabledPropertyView ( children ) }
103- { children . onEvent . propertyView ( ) }
10482 </ >
10583 ) ;
10684 } )
10785 . build ( ) ;
10886
10987// Memoized menu component
110- const LinksMenu = React . memo ( ( { options, onEvent } : { options : any [ ] ; onEvent ?: ( eventName : string ) => void } ) => {
88+ const LinksMenu = React . memo ( ( { options } : { options : any [ ] } ) => {
11189 const mountedRef = useRef ( true ) ;
11290
11391 // Cleanup on unmount
@@ -122,9 +100,9 @@ const LinksMenu = React.memo(({ options, onEvent }: { options: any[]; onEvent?:
122100 . filter ( ( o ) => ! o . hidden )
123101 . map ( ( option , index ) => ( {
124102 key : index ,
125- label : < MenuItem option = { option } index = { index } onMainEvent = { onEvent } />
103+ label : < MenuItem option = { option } index = { index } />
126104 } ) ) ,
127- [ options , onEvent ]
105+ [ options ]
128106 ) ;
129107
130108 return (
@@ -141,12 +119,11 @@ export const ColumnLinksComp = (function () {
141119 options : manualOptionsControl ( OptionItem , {
142120 initOptions : [ { label : trans ( "table.option1" ) } ] ,
143121 } ) ,
144- onEvent : eventHandlerControl ( LinksEventOptions ) , // Main column level event handlers
145122 } ;
146123 return new ColumnTypeCompBuilder (
147124 childrenMap ,
148125 ( props ) => {
149- return < LinksMenu options = { props . options } onEvent = { props . onEvent } /> ;
126+ return < LinksMenu options = { props . options } /> ;
150127 } ,
151128 ( ) => ""
152129 )
@@ -156,7 +133,6 @@ export const ColumnLinksComp = (function () {
156133 newOptionLabel : trans ( "table.option" ) ,
157134 title : trans ( "table.optionList" ) ,
158135 } ) }
159- { children . onEvent . propertyView ( ) }
160136 </ >
161137 ) )
162138 . build ( ) ;
0 commit comments