Skip to content

Commit 5c18bfc

Browse files
committed
Merge branch 'dev' into doubleClick_event_component
2 parents c6f2d79 + 09f6c22 commit 5c18bfc

File tree

5 files changed

+47
-14
lines changed

5 files changed

+47
-14
lines changed

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

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ const LinkEventOptions = [clickEvent, doubleClickEvent] as const;
2020

2121
const childrenMap = {
2222
text: StringControl,
23+
onClick: ActionSelectorControlInContext,
2324
onEvent: eventHandlerControl(LinkEventOptions),
2425
disabled: BoolCodeControl,
2526
style: styleControl(TableColumnLinkStyle),
@@ -38,12 +39,16 @@ const StyledLink = styled.a<{ $disabled: boolean }>`
3839
`;
3940

4041
// Memoized link component
41-
export const ColumnLink = React.memo(({ disabled, label, onEvent }: { disabled: boolean; label: string; onEvent?: (eventName: string) => void }) => {
42+
export const ColumnLink = React.memo(({ disabled, label, onClick, onEvent }: { disabled: boolean; label: string; onClick?: () => void; onEvent?: (eventName: string) => void }) => {
4243
const handleClick = useCallback(() => {
4344
if (!disabled && onEvent) {
4445
ComponentClickHandler({onEvent})();
4546
}
4647
}, [disabled, onEvent]);
48+
// if (disabled) return;
49+
// onClick?.();
50+
// // onEvent?.("click");
51+
// }, [disabled, onClick, onEvent]);
4752

4853
return (
4954
<StyledLink
@@ -110,7 +115,7 @@ export const LinkComp = (function () {
110115
childrenMap,
111116
(props, dispatch) => {
112117
const value = props.changeValue ?? getBaseValue(props, dispatch);
113-
return <ColumnLink disabled={props.disabled} label={value} onEvent={props.onEvent} />;
118+
return <ColumnLink disabled={props.disabled} label={value} onClick={props.onClick} />;
114119
},
115120
(nodeValue) => nodeValue.text.value,
116121
getBaseValue
@@ -129,7 +134,11 @@ export const LinkComp = (function () {
129134
tooltip: ColumnValueTooltip,
130135
})}
131136
{disabledPropertyView(children)}
132-
{children.onEvent.propertyView()}
137+
{/* {children.onEvent.propertyView()} */}
138+
{children.onClick.propertyView({
139+
label: trans("table.action"),
140+
placement: "table",
141+
})}
133142
</>
134143
))
135144
.setStylePropertyViewFn((children) => (

client/packages/lowcoder/src/comps/comps/tableComp/column/columnTypeComps/columnLinksComp.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ const OptionItem = new MultiCompBuilder(
6464
})}
6565
{hiddenPropertyView(children)}
6666
{disabledPropertyView(children)}
67-
{children.onEvent.propertyView()}
67+
{/* {children.onEvent.propertyView()} */}
6868
</>
6969
);
7070
})
@@ -80,6 +80,16 @@ const MenuItem = React.memo(({ option, index, onMainEvent }: { option: any; inde
8080
onMainEvent?.(event);
8181
};
8282
ComponentClickHandler({onEvent: combinedHandler})();
83+
// if (option.onClick) {
84+
// option.onClick();
85+
// }
86+
// // if (option.onEvent) {
87+
// // option.onEvent("click");
88+
// // }
89+
// // Trigger the main component's event handler
90+
// if (onMainEvent) {
91+
// onMainEvent("click");
92+
// }
8393
}
8494
}, [option.disabled, option.onEvent, onMainEvent]);
8595

client/packages/lowcoder/src/comps/comps/tableComp/column/simpleColumnTypeComps.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ const childrenMap = {
3939
text: StringControl,
4040
buttonType: dropdownControl(ButtonTypeOptions, "primary"),
4141
onEvent: eventHandlerControl(ButtonEventOptions),
42+
onClick: ActionSelectorControlInContext,
4243
loading: BoolCodeControl,
4344
disabled: BoolCodeControl,
4445
prefixIcon: IconControl,
@@ -55,6 +56,9 @@ const ButtonStyled = React.memo(({ props }: { props: ToViewReturn<RecordConstruc
5556
const handleClick = useCallback((e: React.MouseEvent) => {
5657
ComponentClickHandler({onEvent: props.onEvent})
5758
}, [props.onEvent]);
59+
// props.onClick?.();
60+
// // props.onEvent?.("click");
61+
// }, [props.onClick, props.onEvent]);
5862

5963
const buttonStyle = useMemo(() => ({
6064
margin: 0,
@@ -104,7 +108,11 @@ export const ButtonComp = (function () {
104108
})}
105109
{loadingPropertyView(children)}
106110
{disabledPropertyView(children)}
107-
{children.onEvent.propertyView()}
111+
{/* {children.onEvent.propertyView()} */}
112+
{children.onClick.propertyView({
113+
label: trans("table.action"),
114+
placement: "table",
115+
})}
108116
</>
109117
))
110118
.build();

client/packages/lowcoder/src/comps/comps/tableComp/column/tableColumnComp.tsx

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -194,26 +194,27 @@ const ColumnPropertyView = React.memo(({
194194
summaryRowIndex: number;
195195
}) => {
196196
const selectedColumn = comp.children.render.getSelectedComp();
197-
198197
const columnType = useMemo(() =>
199198
selectedColumn.getComp().children.compType.getView(),
200199
[selectedColumn]
201200
);
202-
201+
202+
const initialColumns = useMemo(() =>
203+
selectedColumn.getParams()?.initialColumns as OptionType[] || [],
204+
[selectedColumn]
205+
);
206+
203207
const columnValue = useMemo(() => {
204208
const column = selectedColumn.getComp().toJsonValue();
205209
if (column.comp?.hasOwnProperty('src')) {
206210
return (column.comp as any).src;
207211
} else if (column.comp?.hasOwnProperty('text')) {
208-
return (column.comp as any).text;
212+
const value = (column.comp as any).text;
213+
const isDynamicValue = initialColumns.find((column) => column.value === value);
214+
return !isDynamicValue ? '{{currentCell}}' : value;
209215
}
210216
return '{{currentCell}}';
211-
}, [selectedColumn]);
212-
213-
const initialColumns = useMemo(() =>
214-
selectedColumn.getParams()?.initialColumns as OptionType[] || [],
215-
[selectedColumn]
216-
);
217+
}, [selectedColumn, initialColumns]);
217218

218219
const summaryColumns = comp.children.summaryColumns.getView();
219220

client/packages/lowcoder/src/comps/queries/queryComp/queryPropertyView.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,11 @@ export const QueryGeneralPropertyView = (props: {
239239
comp.children.datasourceId.dispatchChangeValueAction(QUICK_REST_API_ID);
240240
}
241241

242+
if (datasourceType === 'js' && datasourceId === '') {
243+
datasourceId = JS_CODE_ID;
244+
comp.children.datasourceId.dispatchChangeValueAction(JS_CODE_ID);
245+
}
246+
242247
const triggerOptions = useMemo(() => {
243248
if (datasourceType === "js" || datasourceType === "streamApi") {
244249
return JSTriggerTypeOptions;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy