From b53a9f7eefc748ba8a7c94270c3a374b9d6ed211 Mon Sep 17 00:00:00 2001
From: BoBoooooo <17746714@qq.com>
Date: Tue, 18 Jun 2024 16:56:00 +0800
Subject: [PATCH] fix: drag-panel add resizeable & height prop (#175)
* fix: drag-panel add resizeable & height prop
* fix: add className
---
apps/storybook/src/ui/drag-panel.stories.tsx | 57 +++++++++--
.../src/components/components-popover.tsx | 6 +-
.../src/setters/expression-setter.tsx | 23 +++--
packages/ui/src/drag-panel.tsx | 98 ++++++++++++-------
4 files changed, 125 insertions(+), 59 deletions(-)
diff --git a/apps/storybook/src/ui/drag-panel.stories.tsx b/apps/storybook/src/ui/drag-panel.stories.tsx
index 073c218..f43e945 100644
--- a/apps/storybook/src/ui/drag-panel.stories.tsx
+++ b/apps/storybook/src/ui/drag-panel.stories.tsx
@@ -9,15 +9,34 @@ export default {
export function Basic() {
return (
- 内容}
- footer={底部信息}
- >
-
-
+ <>
+ 内容}
+ footer={底部信息}
+ >
+
+
+ 内容}
+ footer={底部信息}
+ >
+
+
+ >
);
}
@@ -41,3 +60,23 @@ export function FooterCustom() {
);
}
+
+export function ResizeablePanel() {
+ return (
+
+ 内容
+
+ }
+ footer={底部信息}
+ >
+
+
+ );
+}
diff --git a/packages/designer/src/components/components-popover.tsx b/packages/designer/src/components/components-popover.tsx
index 2d6d3b0..cb7866b 100644
--- a/packages/designer/src/components/components-popover.tsx
+++ b/packages/designer/src/components/components-popover.tsx
@@ -125,6 +125,8 @@ export const ComponentsPopover = observer(
}
footer={tipsTextMap[type]}
width="330px"
+ height="450px"
+ resizeable
maskClosable
body={
}
{...popoverProps}
diff --git a/packages/designer/src/setters/expression-setter.tsx b/packages/designer/src/setters/expression-setter.tsx
index 2682d49..816309a 100644
--- a/packages/designer/src/setters/expression-setter.tsx
+++ b/packages/designer/src/setters/expression-setter.tsx
@@ -195,6 +195,8 @@ export function ExpressionPopover({
return (
{
@@ -203,16 +205,13 @@ export function ExpressionPopover({
setError('');
}
}}
- popoverStyle={{
- height: '615px',
- }}
body={
- <>
+
- >
+
}
footer={(close) => (
-
+