Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit4a2f13b

Browse files
committed
revert link column type
1 parent3deda9b commit4a2f13b

File tree

1 file changed

+19
-34
lines changed
  • client/packages/lowcoder/src/comps/comps/tableComp/column/columnTypeComps

1 file changed

+19
-34
lines changed

‎client/packages/lowcoder/src/comps/comps/tableComp/column/columnTypeComps/columnLinkComp.tsx

Lines changed: 19 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,12 @@ import { disabledPropertyView } from "comps/utils/propertyUtils";
1111
importstyled,{css}from"styled-components";
1212
import{styleControl}from"comps/controls/styleControl";
1313
import{TableColumnLinkStyle}from"comps/controls/styleControlConstants";
14-
import{clickEvent,eventHandlerControl}from"comps/controls/eventHandlerControl";
1514

1615
exportconstColumnValueTooltip=trans("table.columnValueTooltip");
1716

18-
constLinkEventOptions=[clickEvent]asconst;
19-
2017
constchildrenMap={
2118
text:StringControl,
2219
onClick:ActionSelectorControlInContext,
23-
onEvent:eventHandlerControl(LinkEventOptions),
2420
disabled:BoolCodeControl,
2521
style:styleControl(TableColumnLinkStyle),
2622
};
@@ -37,16 +33,13 @@ const StyledLink = styled.a<{ $disabled: boolean }>`
3733
${(props)=>props.$disabled&&disableCss};
3834
`;
3935

40-
//Updated link component to handle both legacy and new event handlers
41-
exportconstColumnLink=React.memo(({ disabled, label, onClick, onEvent}:{disabled:boolean;label:string;onClick?:()=>void;onEvent?:(eventName:string)=>void})=>{
36+
//Memoized link component
37+
exportconstColumnLink=React.memo(({ disabled, label, onClick}:{disabled:boolean;label:string;onClick?:()=>void})=>{
4238
consthandleClick=useCallback(()=>{
43-
if(!disabled){
44-
// Trigger legacy onClick action for backward compatibility
45-
onClick?.();
46-
// Trigger new event handlers
47-
onEvent?.("click");
39+
if(!disabled&&onClick){
40+
onClick();
4841
}
49-
},[disabled,onClick,onEvent]);
42+
},[disabled,onClick]);
5043

5144
return(
5245
<StyledLink
@@ -113,7 +106,7 @@ export const LinkComp = (function () {
113106
childrenMap,
114107
(props,dispatch)=>{
115108
constvalue=props.changeValue??getBaseValue(props,dispatch);
116-
return<ColumnLinkdisabled={props.disabled}label={value}onClick={props.onClick}onEvent={props.onEvent}/>;
109+
return<ColumnLinkdisabled={props.disabled}label={value}onClick={props.onClick}/>;
117110
},
118111
(nodeValue)=>nodeValue.text.value,
119112
getBaseValue
@@ -125,27 +118,19 @@ export const LinkComp = (function () {
125118
onChangeEnd={props.onChangeEnd}
126119
/>
127120
))
128-
.setPropertyViewFn((children)=>{
129-
// Check if there's a legacy action configured
130-
consthasLegacyAction=children.onClick.getView()&&
131-
typeofchildren.onClick.getView()==='function'&&
132-
children.onClick.displayName()!==trans("eventHandler.incomplete");
133-
134-
return(
135-
<>
136-
{children.text.propertyView({
137-
label:trans("table.columnValue"),
138-
tooltip:ColumnValueTooltip,
139-
})}
140-
{disabledPropertyView(children)}
141-
{children.onEvent.propertyView()}
142-
{hasLegacyAction&&children.onClick.propertyView({
143-
label:trans("table.action"),
144-
placement:"table",
145-
})}
146-
</>
147-
);
148-
})
121+
.setPropertyViewFn((children)=>(
122+
<>
123+
{children.text.propertyView({
124+
label:trans("table.columnValue"),
125+
tooltip:ColumnValueTooltip,
126+
})}
127+
{disabledPropertyView(children)}
128+
{children.onClick.propertyView({
129+
label:trans("table.action"),
130+
placement:"table",
131+
})}
132+
</>
133+
))
149134
.setStylePropertyViewFn((children)=>(
150135
<>
151136
{children.style.getPropertyView()}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp