Content-Length: 400668 | pFad | http://github.com/lowcoder-org/lowcoder/pull/1754/commits/fe1dedad60d09f245160e380e65d1a9d7a02040b

E6 Added double click to almost all components by kamalqureshi · Pull Request #1754 · lowcoder-org/lowcoder · GitHub
Skip to content

Added double click to almost all components #1754

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge branch 'dev' into doubleClick_event_component
  • Loading branch information
kamal-qureshi committed Jun 14, 2025
commit fe1dedad60d09f245160e380e65d1a9d7a02040b
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import { styleControl } from "comps/controls/styleControl";
import { TableColumnLinkStyle } from "comps/controls/styleControlConstants";
import { clickEvent, eventHandlerControl, doubleClickEvent } from "comps/controls/eventHandlerControl";
import { ComponentClickHandler } from "@lowcoder-ee/comps/utils/componentClickHandler";
import { migrateOldData } from "@lowcoder-ee/comps/generators/simpleGenerators";
import { fixOldActionData } from "comps/comps/tableComp/column/simpleColumnTypeComps";

export const ColumnValueTooltip = trans("table.columnValueTooltip");

Expand Down Expand Up @@ -47,6 +49,9 @@ export const ColumnLink = React.memo(({ disabled, label, onClick }: { disabled:
// onClick?.();
// // onEvent?.("click");
// }, [disabled, onClick, onEvent]);
// if (disabled) return;
// onClick?.("click");
// }, [disabled, onClick]);

return (
<StyledLink
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import { ColumnLink } from "comps/comps/tableComp/column/columnTypeComps/columnL
import { LightActiveTextColor, PrimaryColor } from "constants/style";
import { clickEvent, eventHandlerControl, doubleClickEvent } from "comps/controls/eventHandlerControl";
import { ComponentClickHandler } from "@lowcoder-ee/comps/utils/componentClickHandler";
import { migrateOldData } from "@lowcoder-ee/comps/generators/simpleGenerators";
import { fixOldActionData } from "comps/comps/tableComp/column/simpleColumnTypeComps";

const MenuLinkWrapper = styled.div`
> a {
Expand Down Expand Up @@ -38,7 +40,7 @@ const MenuWrapper = styled.div`
}
`;

const LinksEventOptions = [clickEvent, doubleClickEvent] as const;
const LinkEventOptions = [clickEvent, doubleClickEvent] as const;

// Memoized menu item component
const MenuItem = React.memo(({ option, index }: { option: any; index: number }) => {
Expand Down Expand Up @@ -84,41 +86,7 @@ const OptionItemTmp = new MultiCompBuilder(
})
.build();

// Memoized menu item component
const MenuItem = React.memo(({ option, index, onMainEvent }: { option: any; index: number; onMainEvent?: (eventName: string) => void }) => {
const handleClick = useCallback(() => {
if (!option.disabled) {
// Handle both option's event and main event through ComponentClickHandler
const combinedHandler = (event: "click" | "doubleClick") => {
option.onEvent?.(event);
onMainEvent?.(event);
};
ComponentClickHandler({onEvent: combinedHandler})();
// if (option.onClick) {
// option.onClick();
// }
// // if (option.onEvent) {
// // option.onEvent("click");
// // }
// // Trigger the main component's event handler
// if (onMainEvent) {
// onMainEvent("click");
// }
}
}, [option.disabled, option.onEvent, onMainEvent]);

return (
<MenuLinkWrapper>
<ColumnLink
disabled={option.disabled}
label={option.label}
onEvent={handleClick}
/>
</MenuLinkWrapper>
);
});

MenuItem.displayName = 'MenuItem';
const OptionItem = migrateOldData(OptionItemTmp, fixOldActionData);

// Memoized menu component
const LinksMenu = React.memo(({ options }: { options: any[] }) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { RecordConstructorToComp } from "lowcoder-core";
import { ToViewReturn } from "@lowcoder-ee/comps/generators/multi";
import { clickEvent, eventHandlerControl, doubleClickEvent } from "comps/controls/eventHandlerControl";
import { ComponentClickHandler } from "@lowcoder-ee/comps/utils/componentClickHandler";
import { migrateOldData } from "@lowcoder-ee/comps/generators/simpleGenerators";

export const fixOldActionData = (oldData: any) => {
if (!oldData) return oldData;
Expand Down Expand Up @@ -71,6 +72,8 @@ const ButtonStyled = React.memo(({ props }: { props: ToViewReturn<RecordConstruc
// props.onClick?.();
// // props.onEvent?.("click");
// }, [props.onClick, props.onEvent]);
// props.onClick?.("click");
// }, [props.onClick]);

const buttonStyle = useMemo(() => ({
margin: 0,
Expand Down
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/lowcoder-org/lowcoder/pull/1754/commits/fe1dedad60d09f245160e380e65d1a9d7a02040b

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy