Skip to content

Commit 3651e0a

Browse files
authored
Merge pull request #482 from easyops-cn/steve/chat-panel
fix(chat-panel): support setting maskClosable
2 parents eafbbaf + d9ad356 commit 3651e0a

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

bricks/ai-portal/src/chat-panel/index.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ export interface ChatPanelProps {
7777
placeholder?: string;
7878
uploadOptions?: UploadOptions;
7979
help?: { useBrick: UseBrickConf };
80+
maskClosable?: boolean;
8081
}
8182

8283
const ChatPanelComponent = forwardRef(LegacyChatPanelComponent);
@@ -114,6 +115,14 @@ class ChatPanel extends ReactNextElement implements ChatPanelProps {
114115
@property({ attribute: false })
115116
accessor help: { useBrick: UseBrickConf } | undefined;
116117

118+
/**
119+
* Whether to close the panel when clicking the mask.
120+
*
121+
* @default false
122+
*/
123+
@property({ type: Boolean })
124+
accessor maskClosable: boolean | undefined;
125+
117126
#ref = createRef<ChatPanelRef>();
118127

119128
@method()
@@ -153,6 +162,7 @@ class ChatPanel extends ReactNextElement implements ChatPanelProps {
153162
placeholder={this.placeholder}
154163
uploadOptions={this.uploadOptions}
155164
help={this.help}
165+
maskClosable={this.maskClosable}
156166
/>
157167
);
158168
}
@@ -181,6 +191,7 @@ function LegacyChatPanelComponent(
181191
placeholder,
182192
uploadOptions,
183193
help,
194+
maskClosable,
184195
}: ChatPanelComponentProps,
185196
ref: React.Ref<ChatPanelRef>
186197
) {
@@ -323,7 +334,7 @@ function LegacyChatPanelComponent(
323334
width={width}
324335
height={height}
325336
themeVariant="elevo"
326-
maskClosable
337+
maskClosable={maskClosable}
327338
noFooter
328339
headerBordered
329340
fullscreenButton

0 commit comments

Comments
 (0)