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

Editor fixes#569

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
FalkWolsky merged 3 commits intolowcoder-org:devfromraheeliftikhar5:editor-fixes
Dec 8, 2023
Merged
Show file tree
Hide file tree
Changes fromall commits
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
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -153,8 +153,9 @@ const OptionItem = (props: {
popoverTitle?: string;
draggable?: boolean;
optionExtra?: React.ReactNode;
scrollable?: boolean;
}) => {
const { content, config, title, popoverTitle, draggable = true, optionExtra } = props;
const { content, config, title, popoverTitle, draggable = true, optionExtra, scrollable } = props;
const [visible, setVisible] = useState(false);
const { attributes, listeners, setNodeRef, transform, transition } = useSortable({
id: config.dataIndex,
Expand DownExpand Up@@ -182,6 +183,7 @@ const OptionItem = (props: {
setVisible={(vis) => {
setVisible(vis);
}}
scrollable={scrollable}
>
{optionRow}
</SimplePopover>
Expand All@@ -204,6 +206,7 @@ function Option<T extends ConstructorToComp<MultiCompConstructor>>(props: {
optionToolbar?: React.ReactNode;
headerItem?: React.ReactNode;
itemExtra?: (comp: T) => React.ReactNode;
scrollable?: boolean;
}) {
const { items, uniqVal, headerItem, optionToolbar, itemExtra } = props;
const itemsDistinctValCount = uniqVal
Expand DownExpand Up@@ -286,6 +289,7 @@ function Option<T extends ConstructorToComp<MultiCompConstructor>>(props: {
title={props.itemTitle(item)}
config={{ dataIndex: dataIndex }}
optionExtra={optionExtra}
scrollable={props.scrollable}
/>
);
})}
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -51,13 +51,15 @@ const SimplePopover = (props: {
setVisible?: (vis: boolean) => void;
children: JSX.Element | React.ReactNode;
content: JSX.Element | React.ReactNode;
scrollable?: boolean;
}) => {
const { visible, setVisible } = props;
const contentWithBox = (
<SuspensionBox
title={props.title}
onClose={() => setVisible?.(false)}
content={props.content}
scrollable={props.scrollable}
/>
);
return (
Expand All@@ -66,7 +68,7 @@ const SimplePopover = (props: {
align={{
offset: [-12, 0, 0, 0],
}}
destroyTooltipOnHide
//destroyTooltipOnHide
content={contentWithBox}
trigger="click"
open={visible}
Expand Down
1 change: 0 additions & 1 deletionclient/packages/lowcoder/src/app.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -159,7 +159,6 @@ class AppIndex extends React.Component<AppIndexProps, any> {
)}
</Switch>
</Router>
<CodeEditorTooltipContainer />
</Wrapper>
);
}
Expand Down
39 changes: 21 additions & 18 deletionsclient/packages/lowcoder/src/base/codeEditor/codeEditor.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -227,6 +227,7 @@ function useCodeMirror(
...props,
showLineNum,
onChange: handleChange,
tooltipContainer: container.current,
});
useEffect(() => reconfigure(viewRef.current), [reconfigure]);
useEffect(() => {
Expand DownExpand Up@@ -385,24 +386,26 @@ export function CodeEditor(props: CodeEditorProps) {
const { expandable = true, ...editorProps } = props;
const [disabled, setDisabled] = useState(false);
return (
<CodeEditorCommon {...editorProps} editor={editor} disabled={disabled}>
<Container
styleName={props.styleName}
bordered={props.bordered}
disabled={disabled}
error={props.hasError}
ref={editor as MutableRefObject<HTMLDivElement>}
enableClickCompName={props.enableClickCompName}
>
{expandable && (
<CodeEditorPanel
breadcrumb={[props.label ?? ""]}
editor={<CodeEditorForPanel {...props} styleName="window" showLineNum />}
onVisibleChange={(visible) => setDisabled(visible)}
/>
)}
</Container>
</CodeEditorCommon>
<CodeEditorTooltipContainer>
<CodeEditorCommon {...editorProps} editor={editor} disabled={disabled}>
<Container
styleName={props.styleName}
bordered={props.bordered}
disabled={disabled}
error={props.hasError}
ref={editor as MutableRefObject<HTMLDivElement>}
enableClickCompName={props.enableClickCompName}
>
{expandable && (
<CodeEditorPanel
breadcrumb={[props.label ?? ""]}
editor={<CodeEditorForPanel {...props} styleName="window" showLineNum />}
onVisibleChange={(visible) => setDisabled(visible)}
/>
)}
</Container>
</CodeEditorCommon>
</CodeEditorTooltipContainer>
);
}

Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -390,6 +390,7 @@ function ColumnPropertyView<T extends MultiBaseComp<TableChildrenType>>(props: {
comp.children.columns.dispatch(action);
}}
dataIndex={(column) => column.getView().dataIndex}
scrollable={true}
/>
</>
);
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -129,6 +129,7 @@ export const CodeEditorPanel = (props: {
maskClosable={true}
onPopupVisibleChange={(visible) => setVisible(visible)}
afterPopupVisibleChange={(visible) => props.onVisibleChange(visible)}
getPopupContainer={(node: any) => node.parentNode.parentNode}
popup={() => (
<Draggable
positionOffset={{ x: "-50%", y: "-50%" }}
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp