Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Branch] chore(merge): Merge master branch of v0.3.8 #736

Merged
merged 7 commits into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
6 changes: 6 additions & 0 deletions docs/charts/charts-CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ group: 可视化图表

---

## 0.3.3

`2024-09-23`

- 🐞 修复 `tooltip` 无法换行、导致内容溢出的问题。[#684](https://github.com/oceanbase/oceanbase-design/pull/684)

## 0.3.1

`2024-04-12`
Expand Down
8 changes: 8 additions & 0 deletions docs/codemod/codemod-CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@ group: 自动化迁移工具

---

## 0.3.7

`2024-09-23`

- 🆕 新增 `techui-and-pro-components-to-oceanbase-ui` 迁移能力。[#706](https://github.com/oceanbase/oceanbase-design/pull/706)
- ⭐️ 支持从 `pro-components` 和 `tech-ui` 迁移更多的组件和类型。[#718](https://github.com/oceanbase/oceanbase-design/pull/718)
- 🐞 修复普通函数和匿名函数自动改写成 Design Token 时,应该使用 `token` 对象而不是 `useToken()` 的问题。[#685](https://github.com/oceanbase/oceanbase-design/pull/685)

## 0.3.6

`2024-07-26`
Expand Down
10 changes: 10 additions & 0 deletions docs/design/design-CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@ group: 基础组件

---

## 0.3.8

`2024-09-23`

- 🔥 新增 `设计` 和 `博客` 模块,并上线 10 篇设计规范文档和 2 篇博客。[#682](https://github.com/oceanbase/oceanbase-design/pull/682)
- 📖 主题文档新增 Design Token 列表,便于开发侧查阅。[#701](https://github.com/oceanbase/oceanbase-design/pull/701)
- 💄 升级 [@oceanbase/aliyun-theme](https://www.npmjs.com/package/@oceanbase/aliyun-theme) 主题包,并更新阿里云主题的 less 样式文件。[#668](https://github.com/oceanbase/oceanbase-design/pull/668)
- 🐞 修复 Space 在新版浏览器下可能出现的间距抖动问题。[#722](https://github.com/oceanbase/oceanbase-design/pull/722)
- 🐞 修复 Tag 同时设置 `icon` 和 `ellipsis` 时省略样式异常的问题。[#687](https://github.com/oceanbase/oceanbase-design/pull/687) [@linhf123](https://github.com/linhf123)

## 0.3.7

`2024-07-26`
Expand Down
9 changes: 9 additions & 0 deletions docs/ui/ui-CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@ group: 业务组件

---

## 0.3.8

`2024-09-23`

- 📖 新增 @oceanbase/ui 在 Vite 中的使用文档和项目模板。[#673](https://github.com/oceanbase/oceanbase-design/pull/673)
- 🆕 Action.Group 新增 `buttonSize` 属性,用于设置按钮大小。[#719](https://github.com/oceanbase/oceanbase-design/pull/719)
- 🆕 Action.Button 新增 `size` 属性,用于设置按钮大小。[#719](https://github.com/oceanbase/oceanbase-design/pull/719)
- 💄 优化 PageContainer 仅设置 title 属性时页头和内容区的间距。[#721](https://github.com/oceanbase/oceanbase-design/pull/721)

## 0.3.6

`2024-07-10`
Expand Down
2 changes: 1 addition & 1 deletion packages/charts/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@oceanbase/charts",
"version": "0.3.2",
"version": "0.3.3",
"description": "The Chart library for OceanBase",
"homepage": "https://github.com/oceanbase/oceanbase-design/packages/charts",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion packages/codemod/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@oceanbase/codemod",
"version": "0.3.6",
"version": "0.3.7",
"description": "Codemod for OceanBase Design upgrade",
"keywords": [
"oceanbase",
Expand Down
2 changes: 1 addition & 1 deletion packages/design/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@oceanbase/design",
"version": "0.3.7",
"version": "0.3.8",
"description": "The Design System of OceanBase",
"keywords": [
"oceanbase",
Expand Down
2 changes: 1 addition & 1 deletion packages/design/src/_util/useFlexGapSupport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as React from 'react';
import { detectFlexGapSupported } from './styleChecker';

export default () => {
const [flexible, setFlexible] = React.useState(false);
const [flexible, setFlexible] = React.useState(true);
React.useEffect(() => {
setFlexible(detectFlexGapSupported());
}, []);
Expand Down
2 changes: 1 addition & 1 deletion packages/icons/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@oceanbase/icons",
"version": "0.3.2",
"version": "0.3.3",
"description": "The Icon Library for OceanBase",
"keywords": [
"oceanbase",
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@oceanbase/ui",
"version": "0.3.7",
"version": "0.3.8",
"description": "The UI library based on OceanBase Design",
"keywords": [
"oceanbase",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -982,3 +982,217 @@ exports[`PageContainer > extra and footer 1`] = `
</div>
</div>
`;

exports[`PageContainer > title 1`] = `
<div
class="ant-pro-page-container ant-pro-page-container-with-footer"
>
<div
class="ant-page-header ant-pro-page-container-warp-page-header ant-page-header-ghost"
>
<div
class="ant-page-header-heading "
>
<div
class="ant-page-header-heading-left"
>
<span
class="ant-page-header-heading-title"
title="页面标题"
>
页面标题
</span>
</div>
</div>
</div>
<div
class="ant-pro-grid-content"
>
<div
class="ant-pro-grid-content-children"
>
<div
class="ant-pro-page-container-children-container"
>
<div
class="ant-card"
>
<div
class="ant-card-body"
>
<div
class="ant-descriptions"
>
<div
class="ant-descriptions-header"
>
<div
class="ant-descriptions-title"
>
基本信息
</div>
</div>
<div
class="ant-descriptions-view"
>
<table>
<tbody>
<tr
class="ant-descriptions-row"
>
<td
class="ant-descriptions-item"
colspan="1"
>
<div
class="ant-descriptions-item-container"
>
<span
class="ant-descriptions-item-label"
>
创建人
</span>
<span
class="ant-descriptions-item-content"
>
<span
class="ant-typography ant-typography-ellipsis ant-typography-ellipsis-single-line"
>
曲丽丽
</span>
</span>
</div>
</td>
<td
class="ant-descriptions-item"
colspan="1"
>
<div
class="ant-descriptions-item-container"
>
<span
class="ant-descriptions-item-label"
>
电话号码
</span>
<span
class="ant-descriptions-item-content"
>
<span
class="ant-typography ant-typography-ellipsis ant-typography-ellipsis-single-line"
>
1810000000
</span>
</span>
</div>
</td>
<td
class="ant-descriptions-item"
colspan="1"
>
<div
class="ant-descriptions-item-container"
>
<span
class="ant-descriptions-item-label"
>
地址
</span>
<span
class="ant-descriptions-item-content"
>
<span
class="ant-typography ant-typography-ellipsis ant-typography-ellipsis-single-line"
>
浙江省杭州市西湖区工专路
</span>
</span>
</div>
</td>
</tr>
<tr
class="ant-descriptions-row"
>
<td
class="ant-descriptions-item"
colspan="1"
>
<div
class="ant-descriptions-item-container"
>
<span
class="ant-descriptions-item-label"
>
关联表单
</span>
<span
class="ant-descriptions-item-content"
>
<span
class="ant-typography ant-typography-ellipsis ant-typography-ellipsis-single-line"
>
<a>
421421
</a>
</span>
</span>
</div>
</td>
<td
class="ant-descriptions-item"
colspan="1"
>
<div
class="ant-descriptions-item-container"
>
<span
class="ant-descriptions-item-label"
>
创建时间
</span>
<span
class="ant-descriptions-item-content"
>
<span
class="ant-typography ant-typography-ellipsis ant-typography-ellipsis-single-line"
>
2017-01-10
</span>
</span>
</div>
</td>
<td
class="ant-descriptions-item"
colspan="1"
>
<div
class="ant-descriptions-item-container"
>
<span
class="ant-descriptions-item-label"
>
备注
</span>
<span
class="ant-descriptions-item-content"
>
<span
class="ant-typography ant-typography-ellipsis ant-typography-ellipsis-single-line"
>
这是备注
</span>
</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
`;
6 changes: 6 additions & 0 deletions packages/ui/src/PageContainer/__tests__/index.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React from 'react';
import { render } from '@testing-library/react';
import BasicDemo from '../demo/basic';
import ExtraAndFooterDemo from '../demo/extra-footer';
import TitleCompatibleDemo from '../demo/title';

describe('PageContainer', () => {
it('basic', () => {
Expand All @@ -13,4 +14,9 @@ describe('PageContainer', () => {
const { asFragment } = render(<ExtraAndFooterDemo />);
expect(asFragment().firstChild).toMatchSnapshot();
});

it('title', () => {
const { asFragment } = render(<TitleCompatibleDemo />);
expect(asFragment().firstChild).toMatchSnapshot();
});
});
29 changes: 29 additions & 0 deletions packages/ui/src/PageContainer/demo/title.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/**
* iframe: 600
*/
import React from 'react';
import { Button, Card, Descriptions } from '@oceanbase/design';
import { PageContainer } from '@oceanbase/ui';

export default () => {
return (
<PageContainer
ghost={false}
title="页面标题"
footer={[<Button>重置</Button>, <Button type="primary">提交</Button>]}
>
<Card bordered={false}>
<Descriptions title="基本信息">
<Descriptions.Item label="创建人">曲丽丽</Descriptions.Item>
<Descriptions.Item label="电话号码">1810000000</Descriptions.Item>
<Descriptions.Item label="地址">浙江省杭州市西湖区工专路</Descriptions.Item>
<Descriptions.Item label="关联表单">
<a>421421</a>
</Descriptions.Item>
<Descriptions.Item label="创建时间">2017-01-10</Descriptions.Item>
<Descriptions.Item label="备注">这是备注</Descriptions.Item>
</Descriptions>
</Card>
</PageContainer>
);
};
6 changes: 4 additions & 2 deletions packages/ui/src/PageContainer/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@ nav:

<code src="./demo/with-tabs.tsx" iframe="600" title="和 Tabs 组合使用"></code>

<code src="./demo/extra-footer.tsx" title="页头和页脚操作区" description="位于页头和页脚操作区的组件尺寸为 `large`,字体大小为 `middle`。" debug></code>

<code src="./demo/header-less.tsx" iframe="600" title="无 PageHeader" description="头部内容为空"></code>

<code src="./demo/empty.tsx" title="空页面"></code>

<code src="./demo/extra-footer.tsx" title="页头和页脚操作区" description="位于页头和页脚操作区的组件尺寸为 `large`,字体大小为 `middle`。" debug></code>

<code src="./demo/title.tsx" title="title 属性" description="样式需要符合预期" debug></code>

## 与路由搭配使用

由于 PageContainer 内置的面包屑导航跳转依赖路由能力,需要通过 ConfigProvider 全局注入 `navigate` 函数才会生效。
Expand Down
Loading
Loading