Skip to content

Commit

Permalink
chore(): merge master
Browse files Browse the repository at this point in the history
  • Loading branch information
Vanleehao committed Feb 4, 2024
2 parents 6d864f9 + 70d1c90 commit 973e3fc
Show file tree
Hide file tree
Showing 69 changed files with 3,519 additions and 1,259 deletions.
7 changes: 7 additions & 0 deletions docs/charts/charts-CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ group: 可视化图表

---

## 0.2.22

`2024-01-18`

- 🆕 Stat 新增 padding 属性,用于设置图表的内间距。[#412](https://github.com/oceanbase/oceanbase-design/pull/412)
- 🐞 修复 Pie 环图统计组件标题和内容 `formatter` 不生效的问题。[#413](https://github.com/oceanbase/oceanbase-design/pull/413)

## 0.2.21

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

---

## 0.2.37

`2024-01-30`

- 🆕 新增 injectStaticFunction 属性,用于配置 message、notification 和 Modal 静态方法是否可以消费全局配置,默认开启。[#446](https://github.com/oceanbase/oceanbase-design/pull/446)
- 🐞 修复 Typography 的样式优先级,保证字体和行高默认继承父元素,便于和其他组件组合使用。[#428](https://github.com/oceanbase/oceanbase-design/pull/428) [@wdyea-ya](https://github.com/wdyea-ya)
- 🐞 修复 Table 选中行和 `hover` 行的背景色不一致的问题。[#455](https://github.com/oceanbase/oceanbase-design/pull/455)

## 0.2.36

`2024-01-19`

- 💄 ConfigProvider 内嵌的 App 组件不再创建 DOM 节点,避免增加一层 DOM 结构影响子元素的样式表现。[#431](https://github.com/oceanbase/oceanbase-design/pull/431)

## 0.2.35

`2024-01-18`

- 🆕 ConfigProvider 新增 table.selectionColumnWidth 属性,用于配置表格的展开列宽度。[#421](https://github.com/oceanbase/oceanbase-design/pull/421)
- Table
- 🐞 修复 Table 可展开时底部出现重复边框的问题。[#420](https://github.com/oceanbase/oceanbase-design/pull/420)
- 💄 优化 Table 在无间距卡片内的展示样式,包括第一列和卡片标题对齐、最后一列和卡片操作区对齐、分页器左右增加间距。[#422](https://github.com/oceanbase/oceanbase-design/pull/422)
- 💄 减小 Table 单元格的纵向内间距,以对齐设计规范。[#425](https://github.com/oceanbase/oceanbase-design/pull/425)
- 💄 Modal 去掉最大高度限制,高度超出时内容滚动改由上层控制。[#411](https://github.com/oceanbase/oceanbase-design/pull/411)

## 0.2.34

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

---

## 0.2.38

`2024-01-30`

- PageContainer
- 🐞 修复 PageContainer 页头和页脚操作区外的组件尺寸也可能被改为 large 的问题。[#443](https://github.com/oceanbase/oceanbase-design/pull/443)
- 💄 修复 PageContainer 页头和页脚操作区样式适配 Space.Compact 组件。[#454](https://github.com/oceanbase/oceanbase-design/pull/454)
- 🐞 修复 FooterToolbar 子元素外的组件尺寸被改为 large 的问题。[#447](https://github.com/oceanbase/oceanbase-design/pull/447)

## 0.2.37

`2024-01-19`

- PageContainer
- 💄 PageContainer 页头和页脚操作区的组件尺寸默认为 `large`、字体大小为 `middle`[#432](https://github.com/oceanbase/oceanbase-design/pull/432)
- 💄 优化 PageContainer 和 Tabs 组合使用时的间距,以对齐设计规范。[#434](https://github.com/oceanbase/oceanbase-design/pull/434)
- 💄 FooterToolbar 子元素的组件尺寸默认为 `large`、字体大小默认为 `middle`[#433](https://github.com/oceanbase/oceanbase-design/pull/433)

## 0.2.36

`2024-01-18`

- 🐞 修复 Password 组件快速输入时丢失字符和焦点跳跃的问题。[#424](https://github.com/oceanbase/oceanbase-design/pull/424) [@Vanleehao](https://github.com/Vanleehao)
- 🐞 修复 Highlight 国际化不生效的问题。[#419](https://github.com/oceanbase/oceanbase-design/pull/419) [@linhf123](https://github.com/linhf123)
- 💄 优化 PageContainer 右上角和页脚操作区中的 Input 样式,保证宽高和字体大小符合设计规范。[#426](https://github.com/oceanbase/oceanbase-design/pull/426)

## 0.2.35

`2024-01-12`
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,15 @@
"@testing-library/jest-dom": "^6.2.0",
"@testing-library/react": "^14.1.0",
"@testing-library/react-hooks": "^8.0.1",
"@testing-library/user-event": "^14.5.1",
"@testing-library/user-event": "^14.5.2",
"@types/jest": "^29.5.10",
"@types/lodash": "^4.14.202",
"@types/node": "^20.10.5",
"@types/react": "^18.2.47",
"@umijs/fabric": "^4.0.1",
"@umijs/test": "^4.0.90",
"@umijs/test": "^4.1.0",
"@vercel/analytics": "^1.1.1",
"antd": "^5.11.2",
"antd": "^5.13.2",
"antd-style": "3.5.2",
"antd-token-previewer": "^2.0.5",
"babel-jest": "^29.7.0",
Expand Down Expand Up @@ -98,7 +98,7 @@
"lodash": "^4.17.21",
"lz-string": "^1.5.0",
"mockdate": "^3.0.5",
"prettier": "^3.1.1",
"prettier": "^3.2.4",
"prismjs": "^1.29.0",
"rc-checkbox": "^3.1.0",
"rc-drawer": "^7.0.0",
Expand All @@ -120,7 +120,7 @@
"ts-jest": "^29.1.1",
"ts-node": "^10.9.1",
"typescript": "^5.3.3",
"vanilla-jsoneditor": "^0.21.1",
"vanilla-jsoneditor": "^0.21.2",
"web-vitals": "^3.5.0",
"yorkie": "^2.0.0"
}
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.2.21",
"version": "0.2.22",
"description": "The Chart library for OceanBase",
"homepage": "https://github.com/oceanbase/oceanbase-design/packages/charts",
"repository": {
Expand Down
144 changes: 66 additions & 78 deletions packages/charts/src/Pie/__tests__/__snapshots__/donut.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,102 +2,90 @@

exports[`donut floor number 1`] = `
<div
class="ant-row"
style="margin: -8px -100px -8px -100px;"
data-chart-source-type="G2Plot"
size-sensor-id="1"
style="height: inherit;"
>
<div
class="ant-col ant-col-12"
style="padding: 8px 100px 8px 100px;"
style="position:relative;"
>
<canvas
height="400"
style="width: 400px; height: 400px; display: inline-block; vertical-align: middle;"
width="400"
/>
<div
data-chart-source-type="G2Plot"
size-sensor-id="1"
style="height: inherit;"
class="g2-html-annotation"
style="position: absolute; pointer-events: none; width: 197.87573593128806px; transform: translate(-50%, -100%); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; display: flex; justify-content: center; align-items: center; text-shadow: 0px 0px 0px; font-weight: 300; color: rgb(92, 107, 138); text-align: center; font-size: 14px; line-height: 1; font-family: Avenir-Heavy; left: 164.89644660940672px; top: 236px; z-index: 7;"
>
<div
style="position:relative;"
style="width:0px;;font-size:0em;line-height:1;"
>
<canvas
height="300"
style="width: 400px; height: 300px; display: inline-block; vertical-align: middle;"
width="400"
/>
<div
class="g2-html-annotation"
style="position: absolute; pointer-events: none; width: 180px; transform: translate(-50%, -100%); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; display: flex; justify-content: center; align-items: center; text-shadow: 0px 0px 0px; font-weight: 300; color: rgb(92, 107, 138); text-align: center; font-size: 14px; line-height: 1; font-family: Avenir-Heavy; left: 164.89644660940672px; top: 186px; z-index: 7;"
>
<div
style="width:0px;;font-size:0em;line-height:1;"
>
总数
</div>
</div>
<div
class="g2-html-annotation"
style="position: absolute; pointer-events: none; width: 180px; transform: translate(-50%, 0); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; display: flex; justify-content: center; align-items: center; text-shadow: 0px 0px 0px; font-weight: bold; color: rgb(92, 107, 138); text-align: center; font-size: 32px; line-height: 1; font-family: PingFangSC; left: 164.89644660940672px; top: 132px; z-index: 7;"
>
<div
style="width:0px;;font-size:0em;line-height:1;"
>
21.16
</div>
</div>
总数
</div>
</div>
<div
class="g2-html-annotation"
style="position: absolute; pointer-events: none; width: 197.87573593128806px; transform: translate(-50%, 0); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; display: flex; justify-content: center; align-items: center; text-shadow: 0px 0px 0px; font-weight: bold; color: rgb(92, 107, 138); text-align: center; font-size: 32px; line-height: 1; font-family: PingFangSC; left: 164.89644660940672px; top: 182px; z-index: 7;"
>
<div
style="width:0px;;font-size:0em;line-height:1;"
>
21.16
</div>
<object
class="size-sensor-object"
data="about:blank"
style="display: block; position: absolute; top: 0px; left: 0px; height: 100%; width: 100%; overflow: hidden; pointer-events: none; z-index: -1; opacity: 0;"
tabindex="-1"
type="text/html"
/>
</div>
</div>
<object
class="size-sensor-object"
data="about:blank"
style="display: block; position: absolute; top: 0px; left: 0px; height: 100%; width: 100%; overflow: hidden; pointer-events: none; z-index: -1; opacity: 0;"
tabindex="-1"
type="text/html"
/>
</div>
`;

exports[`donut statistic title and content formatter 1`] = `
<div
data-chart-source-type="G2Plot"
size-sensor-id="2"
style="height: inherit;"
>
<div
class="ant-col ant-col-12"
style="padding: 8px 100px 8px 100px;"
style="position:relative;"
>
<canvas
height="400"
style="width: 400px; height: 400px; display: inline-block; vertical-align: middle;"
width="400"
/>
<div
class="g2-html-annotation"
style="position: absolute; pointer-events: none; width: 197.87573593128806px; transform: translate(-50%, -100%); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; display: flex; justify-content: center; align-items: center; text-shadow: 0px 0px 0px; font-weight: 300; color: rgb(92, 107, 138); text-align: center; font-size: 14px; line-height: 1; font-family: Avenir-Heavy; left: 164.89644660940672px; top: 236px; z-index: 7;"
>
<div
style="width:0px;;font-size:0em;line-height:1;"
>
custom title
</div>
</div>
<div
data-chart-source-type="G2Plot"
size-sensor-id="2"
style="height: inherit;"
class="g2-html-annotation"
style="position: absolute; pointer-events: none; width: 197.87573593128806px; transform: translate(-50%, 0); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; display: flex; justify-content: center; align-items: center; text-shadow: 0px 0px 0px; font-weight: bold; color: rgb(92, 107, 138); text-align: center; font-size: 32px; line-height: 1; font-family: PingFangSC; left: 164.89644660940672px; top: 182px; z-index: 7;"
>
<div
style="position:relative;"
style="width:0px;;font-size:0em;line-height:1;"
>
<canvas
height="300"
style="width: 400px; height: 300px; display: inline-block; vertical-align: middle;"
width="400"
/>
<div
class="g2-html-annotation"
style="position: absolute; pointer-events: none; width: 162.05147186257614px; transform: translate(-50%, -100%); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; display: flex; justify-content: center; align-items: center; text-shadow: 0px 0px 0px; font-weight: 300; color: rgb(92, 107, 138); text-align: center; font-size: 14px; line-height: 1; font-family: Avenir-Heavy; left: 200px; top: 171.04289321881345px; z-index: 7;"
>
<div
style="width:0px;;font-size:0em;line-height:1;"
>
总数
</div>
</div>
<div
class="g2-html-annotation"
style="position: absolute; pointer-events: none; width: 162.05147186257614px; transform: translate(-50%, 0); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; display: flex; justify-content: center; align-items: center; text-shadow: 0px 0px 0px; font-weight: bold; color: rgb(92, 107, 138); text-align: center; font-size: 32px; line-height: 1; font-family: PingFangSC; left: 200px; top: 117.04289321881345px; z-index: 7;"
>
<div
style="width:0px;;font-size:0em;line-height:1;"
>
21.16
</div>
</div>
custom content
</div>
<object
class="size-sensor-object"
data="about:blank"
style="display: block; position: absolute; top: 0px; left: 0px; height: 100%; width: 100%; overflow: hidden; pointer-events: none; z-index: -1; opacity: 0;"
tabindex="-1"
type="text/html"
/>
</div>
</div>
<object
class="size-sensor-object"
data="about:blank"
style="display: block; position: absolute; top: 0px; left: 0px; height: 100%; width: 100%; overflow: hidden; pointer-events: none; z-index: -1; opacity: 0;"
tabindex="-1"
type="text/html"
/>
</div>
`;
58 changes: 56 additions & 2 deletions packages/charts/src/Pie/__tests__/donut.test.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,65 @@
import React from 'react';
import { render } from '@testing-library/react';
import DonutFloor from '../demo/donut-floor';
import { Pie } from '@oceanbase/charts';
import type { PieConfig } from '@oceanbase/charts';

const DonutTest = (props: Partial<PieConfig>) => {
const data = [
{
type: '分类一',
value: 1.3,
},
{
type: '分类二',
value: 3.38,
},
{
type: '分类三',
value: 4.56,
},
{
type: '分类四',
value: 5.7,
},
{
type: '分类五',
value: 6.22,
},
];
const config: PieConfig = {
data,
angleField: 'value',
colorField: 'type',
isDonut: true,
...props,
};
return <Pie {...config} />;
};

describe('donut', () => {
it('floor number', () => {
const { container, asFragment } = render(<DonutFloor />);
const { container, asFragment } = render(<DonutTest />);
expect(container.querySelectorAll('.g2-html-annotation')?.[1].textContent).toBe('21.16');
expect(asFragment().firstChild).toMatchSnapshot();
});

it('statistic title and content formatter', () => {
const { container, asFragment } = render(
<DonutTest
statistic={{
title: {
formatter: () => 'custom title',
},
content: {
formatter: () => 'custom content',
},
}}
/>
);
expect(container.querySelectorAll('.g2-html-annotation')?.[0].textContent).toBe('custom title');
expect(container.querySelectorAll('.g2-html-annotation')?.[1].textContent).toBe(
'custom content'
);
expect(asFragment().firstChild).toMatchSnapshot();
});
});
Loading

0 comments on commit 973e3fc

Please sign in to comment.