Skip to content

Commit

Permalink
chore: Merge feature branch and fix conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
dengfuping committed Mar 11, 2024
2 parents 766c4eb + 64c02eb commit 5a84e6c
Show file tree
Hide file tree
Showing 37 changed files with 1,539 additions and 916 deletions.
1 change: 1 addition & 0 deletions .dumirc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ export default defineConfig({
children: [
{ title: 'BasicLayout 导航和布局', link: '/biz-components/basic-layout' },
{ title: 'PageContainer 页容器', link: '/biz-components/page-container' },
{ title: 'PageLoading 页面级加载', link: '/biz-components/page-loading' },
{ title: 'FooterToolbar 底部操作栏', link: '/biz-components/footer-toolbar' },
{ title: 'Login 登录页', link: '/biz-components/login' },
// { title: 'NavMenu', link: '/biz-components/nav-menu' },
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@
"@testing-library/react-hooks": "^8.0.1",
"@testing-library/user-event": "^14.5.2",
"@types/lodash": "^4.14.202",
"@types/node": "^20.11.24",
"@types/react": "^18.2.62",
"@types/node": "^20.11.25",
"@types/react": "^18.2.64",
"@umijs/fabric": "^4.0.1",
"@umijs/test": "^4.1.2",
"@vercel/analytics": "^1.2.2",
Expand Down Expand Up @@ -99,18 +99,18 @@
"rc-footer": "^0.6.8",
"rc-resize-observer": "^1.4.0",
"rc-segmented": "^2.3.0",
"rc-tabs": "^14.0.0",
"rc-util": "^5.38.2",
"rc-tabs": "^14.1.1",
"rc-util": "^5.39.1",
"react": "^18.2.0",
"react-color": "^2.19.3",
"react-copy-to-clipboard": "^5.1.0",
"react-dom": "^18.2.0",
"react-fast-marquee": "^1.6.4",
"react-intl": "^6.6.2",
"react-router-dom": "^6.22.2",
"react-router-dom": "^6.22.3",
"runscript": "^1.6.0",
"ts-node": "^10.9.2",
"typescript": "^5.3.3",
"typescript": "^5.4.2",
"vanilla-jsoneditor": "^0.21.6",
"vitest": "^1.3.1",
"vitest-canvas-mock": "^0.3.3",
Expand Down
312 changes: 312 additions & 0 deletions packages/design/src/empty/colored.tsx

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';

const Empty: React.FC = props => (
const DefaultEmptyImg: React.FC = props => (
<svg
width="46.25775px"
height="46.36575px"
Expand Down Expand Up @@ -52,7 +52,7 @@ const Empty: React.FC = props => (
);

if (process.env.NODE_ENV !== 'production') {
Empty.displayName = 'SimpleImage';
DefaultEmptyImg.displayName = 'DefaultEmptyImg';
}

export default Empty;
export default DefaultEmptyImg;
54 changes: 54 additions & 0 deletions packages/design/src/empty/demo/complete-debug.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import React, { useState } from 'react';
import { Button, Empty, Form, Switch } from '@oceanbase/design';

export default () => {
const [title, setTitle] = useState(true);
const [description, setDescription] = useState(true);
const [children, setChildren] = useState(true);

return (
<>
<Form
layout="inline"
style={{
marginBottom: 48,
}}
>
<Form.Item label="title" required={true}>
<Switch
size="small"
value={title}
onChange={value => {
setTitle(value);
}}
/>
</Form.Item>
<Form.Item label="description" required={true}>
<Switch
size="small"
value={description}
onChange={value => {
setDescription(value);
}}
/>
</Form.Item>
<Form.Item label="children" required={true}>
<Switch
size="small"
value={children}
onChange={value => {
setChildren(value);
}}
/>
</Form.Item>
</Form>
<Empty
image={Empty.PRESENTED_IMAGE_COLORED}
title={title && 'Create Your Cluster'}
description={description ? 'There is no cluster, welcome to create one!' : ''}
>
{children && <Button type="primary">Create</Button>}
</Empty>
</>
);
};
6 changes: 5 additions & 1 deletion packages/design/src/empty/demo/complete.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ import { Button, Empty } from '@oceanbase/design';

export default () => {
return (
<Empty title="Create Your Cluster" description="There is no cluster, welcome to create one!">
<Empty
image={Empty.PRESENTED_IMAGE_COLORED}
title="Create Your Cluster"
description="There is no cluster, welcome to create one!"
>
<Button type="primary">Create</Button>
</Empty>
);
Expand Down
2 changes: 1 addition & 1 deletion packages/design/src/empty/demo/horizontal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default () => {
return (
<Empty
layout="horizontal"
image="https://mdn.alipayobjects.com/huamei_fhnyvh/afts/img/A*5Z-QSplMlFwAAAAAAAAAAAAADmfOAQ/original"
image="https://mdn.alipayobjects.com/huamei_fhnyvh/afts/img/A*KMWoRLCIATsAAAAAAAAAAAAADmfOAQ/original"
title="欢迎体验 OB 智能诊断"
description={
<>
Expand Down
2 changes: 1 addition & 1 deletion packages/design/src/empty/demo/image.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Button, Empty } from '@oceanbase/design';
export default () => {
return (
<Empty
image="https://mdn.alipayobjects.com/huamei_fhnyvh/afts/img/A*5Z-QSplMlFwAAAAAAAAAAAAADmfOAQ/original"
image="https://mdn.alipayobjects.com/huamei_fhnyvh/afts/img/A*KMWoRLCIATsAAAAAAAAAAAAADmfOAQ/original"
title="Create Your Cluster"
description="There is no cluster, welcome to create one!"
>
Expand Down
7 changes: 6 additions & 1 deletion packages/design/src/empty/demo/steps.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,12 @@ export default () => {
];

return (
<Empty title="Create Your Cluster" steps={steps}>
<Empty
image={Empty.PRESENTED_IMAGE_COLORED}
title="Create Your Cluster"
description="There is no cluster, welcome to create one!"
steps={steps}
>
<Button type="primary">Create Cluster</Button>
</Empty>
);
Expand Down
3 changes: 2 additions & 1 deletion packages/design/src/empty/demo/with-page-container.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { Empty, Button, Card } from '@oceanbase/design';
import { Button, Card, Empty } from '@oceanbase/design';
import { PageContainer } from '@oceanbase/ui';

export default () => {
Expand All @@ -20,6 +20,7 @@ export default () => {
}}
>
<Empty
image={Empty.PRESENTED_IMAGE_COLORED}
title="Create Your Cluster"
description="There is no cluster, welcome to create one!"
>
Expand Down
153 changes: 0 additions & 153 deletions packages/design/src/empty/empty.tsx

This file was deleted.

6 changes: 3 additions & 3 deletions packages/design/src/empty/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ nav:

## 代码演示

<code src="./demo/basic.tsx" title="基本" description="简单展示"></code>
<code src="./demo/basic.tsx" title="默认" description="简单展示"></code>

<code src="./demo/complete.tsx" title="完整" description="设置标题、描述和操作"></code>
<code src="./demo/complete.tsx" title="完整版" description="图片设置为 Empty.PRESENTED_IMAGE_COLORED,包含标题、描述和操作"></code>

<code src="./demo/simple.tsx" title="简洁版" description="图片设置为 Empty.PRESENTED_IMAGE_SIMPLE"></code>
<code src="./demo/complete-debug.tsx" title="完整版 debug" description="图片设置为 Empty.PRESENTED_IMAGE_COLORED,包含标题、描述和操作" debug></code>

<code src="./demo/image.tsx" title="自定义图片" description="可设置图片链接或 ReactNode"></code>

Expand Down
Loading

0 comments on commit 5a84e6c

Please sign in to comment.