Skip to content

Commit 47c1723

Browse files
refactor: antd component changes
1 parent 5baddfe commit 47c1723

34 files changed

+197
-127
lines changed

client/packages/lowcoder-design/src/components/Dropdown.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ export function Dropdown<T extends OptionsType>(props: DropdownProps<T>) {
170170
<CustomSelect
171171
open={props.open}
172172
listHeight={props.lineHeight}
173-
dropdownClassName="ob-dropdown-control-select"
173+
popupClassName="ob-dropdown-control-select"
174174
showSearch={props.showSearch}
175175
filterOption={(input, option) => {
176176
if (props.optionFilterProp) {

client/packages/lowcoder-design/src/components/TriggeredDialog.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export function TriggeredDialog(props: {
3838
</div>
3939
)}
4040
<CustomModal
41-
visible={visible}
41+
open={visible}
4242
title={modalTitle}
4343
destroyOnClose
4444
onCancel={() => setVisible(false)}

client/packages/lowcoder-design/src/components/colorSelect/index.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { RgbaStringColorPicker } from "react-colorful";
22
import { Popover } from "antd";
3+
import { ActionType } from '@rc-component/trigger/lib/interface';
34
import {
45
alphaOfRgba,
56
toRGBA,
@@ -14,7 +15,7 @@ import { changeValueAction } from "lowcoder-core";
1415

1516
interface ColorSelectProps {
1617
color: string;
17-
trigger?: string;
18+
trigger?: ActionType;
1819
dispatch?: (value: any) => void;
1920
changeColor?: (value: any) => void;
2021
}
@@ -35,7 +36,7 @@ export const ColorSelect = (props: ColorSelectProps) => {
3536
<Popover
3637
trigger={trigger}
3738
destroyTooltipOnHide={true}
38-
onVisibleChange={(value) => {
39+
onOpenChange={(value) => {
3940
pickerColor.current = toRGBA(color);
4041
setVisible(value);
4142
}}

client/packages/lowcoder-design/src/components/customSelect.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,14 +83,14 @@ function CustomSelect(props: CustomSelectProps & AntdSelectProps) {
8383
innerRef,
8484
className,
8585
border,
86-
dropdownClassName = "custom-ant-select-dropdown",
86+
popupClassName = "custom-ant-select-dropdown",
8787
...restProps
8888
} = props;
8989
return (
9090
<SelectWrapper className={className} ref={innerRef} border={border}>
9191
<AntdSelect
92-
dropdownClassName={dropdownClassName}
93-
dropdownMatchSelectWidth={false}
92+
popupClassName={popupClassName}
93+
popupMatchSelectWidth={false}
9494
suffixIcon={<PackUpIcon />}
9595
{...restProps}
9696
>

client/packages/lowcoder-design/src/components/form.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ const FormSelect = (props: any) => {
335335
onChange(x);
336336
props.afterChange && props.afterChange(x);
337337
}}
338-
dropdownMatchSelectWidth={false}
338+
popupMatchSelectWidth={false}
339339
placeholder={props.placeholder}
340340
dropdownRender={props.dropdownRender}
341341
>

client/packages/lowcoder-design/src/components/iconSelect/index.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
22
import type { IconDefinition } from "@fortawesome/free-regular-svg-icons";
33
import { Popover } from "antd";
4+
import { ActionType } from '@rc-component/trigger/lib/interface';
45
import { TacoInput } from "components/tacoInput";
56
import { Tooltip } from "components/toolTip";
67
import { trans } from "i18n/design";
@@ -274,7 +275,7 @@ export const IconSelectBase = (props: {
274275
children?: ReactNode;
275276
visible?: boolean;
276277
setVisible?: (v: boolean) => void;
277-
trigger?: string;
278+
trigger?: ActionType;
278279
leftOffset?: number;
279280
parent?: HTMLElement | null;
280281
searchKeywords?: Record<string, string>;
@@ -285,8 +286,8 @@ export const IconSelectBase = (props: {
285286
trigger={props.trigger}
286287
placement="left"
287288
align={{ offset: [props.leftOffset ?? 0, 0, 0, 0] }}
288-
visible={props.visible}
289-
onVisibleChange={setVisible}
289+
open={props.visible}
290+
onOpenChange={setVisible}
290291
getPopupContainer={parent ? () => parent : undefined}
291292
// hide the original background when dragging the popover is allowed
292293
overlayInnerStyle={{ border: "none", boxShadow: "none", background: "transparent" }}

client/packages/lowcoder-design/src/components/popover.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ const SimplePopover = (props: {
6868
destroyTooltipOnHide
6969
content={contentWithBox}
7070
trigger="click"
71-
visible={visible}
72-
onVisibleChange={setVisible}
71+
open={visible}
72+
onOpenChange={setVisible}
7373
placement="left"
7474
overlayStyle={{ width: "310px" }}
7575
>
@@ -100,8 +100,8 @@ const CustomPopover = (props: {
100100
<Popover
101101
content={contentWithBox}
102102
trigger="click"
103-
visible={visible}
104-
onVisibleChange={setVisible}
103+
open={visible}
104+
onOpenChange={setVisible}
105105
placement={props.type === "query" ? "top" : "left"}
106106
overlayStyle={{ width: "310px" }}
107107
align={{
@@ -225,8 +225,8 @@ const EditPopover = (props: EditPopoverProps) => {
225225
</>
226226
)}
227227
trigger="click"
228-
visible={visible}
229-
onVisibleChange={setVisible}
228+
open={visible}
229+
onOpenChange={setVisible}
230230
placement="bottomRight"
231231
// overlayStyle={{ width: "88px" }}
232232
align={{

client/packages/lowcoder-design/src/components/toolTip.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,9 +182,11 @@ function ToolTipLabel(
182182
color="#2c2c2c"
183183
title={title && <TooltipTitleWrapper>{title}</TooltipTitleWrapper>}
184184
overlayInnerStyle={{ maxWidth: "232px", whiteSpace: "break-spaces" }}
185-
arrowPointAtCenter={true}
185+
arrow={{
186+
pointAtCenter: true
187+
}}
186188
placement="top"
187-
defaultVisible={false}
189+
defaultOpen={false}
188190
trigger="hover"
189191
popupVisible={!!title}
190192
style={tooltipStyle}

client/packages/lowcoder/src/components/PermissionDialog/PermissionDialog.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export const PermissionDialog = (props: {
6464

6565
return (
6666
<StepModal
67-
visible={visible}
67+
open={visible}
6868
destroyOnClose
6969
onCancel={() => {
7070
setActiveStepKey("view");

client/packages/lowcoder/src/components/ResCreatePanel.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ export function ResCreatePanel(props: ResCreateModalProps) {
341341
</ScrollBar>
342342
</Content>
343343
<CreateDataSourceModal
344-
visible={visible}
344+
open={visible}
345345
onCancel={() => setVisible(false)}
346346
onCreated={() => setVisible(false)}
347347
/>

0 commit comments

Comments
 (0)