Skip to content

Commit

Permalink
Merge branch 'master' into alpha
Browse files Browse the repository at this point in the history
  • Loading branch information
wjgogogo committed Nov 13, 2023
2 parents edc26db + eb8adbc commit de6f4e8
Show file tree
Hide file tree
Showing 71 changed files with 1,716 additions and 173 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug-report.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ eg.

<!-- Required! -->
<!-- eg. `s2Options` and `s2DataCfg`, or `<SheetComponent {...} />` -->
<!-- 请粘贴你的核心代码片段,包括但不限于 `报错信息`, `s2Options` 等,请不要粘贴你自己的业务代码,请注意使用 markdown code 标签 -->
<!-- 请粘贴你的核心代码片段 (文本形式,而不是图片),包括但不限于 `报错信息`, `s2Options` 等,请不要粘贴你自己的业务代码,请注意使用 markdown code 标签 -->
<!-- 如果你使用官网的在线示例,编辑代码后复现了 Bug,请粘贴你的代码,而不是直接贴一个在线示例的链接,没有任何意义,它不会保存你刚写的代码 -->

### 🔗 Reproduce Link
Expand Down
33 changes: 33 additions & 0 deletions .github/ISSUE_TEMPLATE/feature-request.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,39 @@ labels: 🙏feature request
<!-- ⚠️ Please fill in the template strictly, otherwise it will be closed directly (请严格按照模板填写,否则直接关闭) -->
<!-- ⚠️ 请严格按照模板填写,否则直接关闭 -->

### 🏷 Version

<!-- Required! -->
<!-- 请填写你正在使用的版本 -->
<!-- 请不要写 🙅🏻‍♀️🚫 `latest`, `1.x` -->
<!--
eg.
| Package | Version |
| -------------- | ------- |
| @antv/s2 | 1.2.0 |
| @antv/s2-react | 1.3.3 |
| @antv/s2-vue | - |
-->

| Package | Version |
| -------------- | ------- |
| @antv/s2 | |
| @antv/s2-react | |
| @antv/s2-vue | |

### Sheet Type

<!-- Required! -->
<!-- 请填写你具体使用的表格类型 -->

- [ ] PivotSheet
- [ ] TableSheet
- [ ] GridAnalysisSheet
- [ ] StrategySheet
- [ ] EditableSheet

### 🖋 Description

<!-- Required! -->
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/issue-labeled.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ jobs:
body: |
你好 @${{ github.event.issue.user.login }},经过我们的反复讨论, 你的需求现已被采纳, 我们会排期开发, 但人力资源有限, 短期内无法支持, 请关注后续发布日志。当然, 如果能贡献 PR 帮助我们改进, 不胜感激!
Hello, @${{ github.vent.issue.user.login }}, your feature request has been accepted after our repeated discussion. We will schedule the development. However, it could not be supported in the short term since limited time, please pay attention to the follow-up release logs. Of course, looking forward for your PR!
Hello, @${{ github.event.issue.user.login }}, your feature request has been accepted after our repeated discussion. We will schedule the development. However, it could not be supported in the short term since limited time, please pay attention to the follow-up release logs. Of course, looking forward for your PR!
- name: Rejected
if: github.event.label.name == '❌ won''t support'
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/issue-opend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ jobs:
Hello, @${{ github.event.issue.user.login }}, please edit your issue title. a concise issue title will save everyone time. please do not leave the title as the body or empty.
# 如果是 bug 的 issue, 但是基本的版本号,表格类型, 描述都没有, 直接关闭, 不多BB.
- name: check bug report issue body
if: contains(github.event.issue.title, '🐛') == true && contains(github.event.issue.body, 'Version') == false && contains(github.event.issue.body, 'Sheet Type') == false && contains(github.event.issue.body, 'Description') == false
# 如果 issue 的提交者无视模版, 连基本的版本号,表格类型, 描述都没有, 直接自动关闭, 不多BB.
- name: check issue body
if: contains(github.event.issue.body, 'Version') == false && contains(github.event.issue.body, 'Sheet Type') == false && contains(github.event.issue.body, 'Description') == false
uses: actions-cool/issues-helper@main
with:
actions: 'create-comment,add-labels,close-issue'
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
2. 安装依赖:`yarn bootstrap` 或者 `yarn`
3. 提交你的改动,commit 请遵守 [AngularJS Git Commit Message Conventions](https://docs.google.com/document/d/1QrDFcIiPjSLDn3EL15IJygNPiHORgU1_OOAqWjiDU5Y/edit#heading=h.uyo6cb12dt6w)
4. 如果你的改动是修复 bug, 还可以在提交信息后面加上 `close #issue 号`, 这样可以在 pr 合并后,可以自动关闭对应的 issue, 比如 `fix: render bug close #123`
5. 确保加上了对应的单元测试和文档 (如有必要)
5. 确保加上了对应的单元测试和文档 (如果有 `Snapshot` UI 快照 (.snap 文件)更新, 可以运行 `yarn core:test -- -u``yarn react:test -- -u` 自动更新, 并一起提交上来, 请勿手动编辑)
6. 所有 Lint 和 Test 检查通过后,并且 review 通过,我们会合并你的 pr.

![preview](https://gw.alipayobjects.com/zos/antfincdn/ssOxFrycD/86339514-5f9a-4101-8690-e47c97cd8af5.png)
Expand Down
8 changes: 3 additions & 5 deletions README.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,9 @@ demo components and expansion capabilities, it allows developers to use it quick
## 📦 Installation

```bash
$ npm install @antv/s2
# yarn add @antv/s2
$ npm install @antv/s2 --save
# yarn add @antv/s2 --save
# pnpm install @antv/s2 --save
```

## 🔨 Getting Started
Expand Down Expand Up @@ -227,9 +228,6 @@ yarn site:start
<a>
<img width="300" height="auto" alt="S2" src="https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*2VvTSZmI4vYAAAAAAAAAAAAADmJ7AQ/original">
</a>
<a>
<img width="300" height="auto" alt="S2" src="https://gw.alipayobjects.com/zos/antfincdn/v4TlwgORE/qq_qr_code.JPG">
</a>
</p>

## 👬 Contributors
Expand Down
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,17 @@ S2 是 AntV 在多维交叉分析表格领域的解决方案,完全基于数
## 📦 安装

```bash
$ npm install @antv/s2
# yarn add @antv/s2
$ npm install @antv/s2 --save
# yarn add @antv/s2 --save
# pnpm install @antv/s2 --save
```

## 🔨 使用

### 1. 数据准备

<details>
<summary> s2DataConfig</summary>
<summary>s2DataConfig</summary>

```ts
const s2DataConfig = {
Expand Down Expand Up @@ -221,9 +222,6 @@ yarn site:start
<a>
<img width="300" height="auto" alt="DingTalk" src="https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*2VvTSZmI4vYAAAAAAAAAAAAADmJ7AQ/original">
</a>
<a>
<img width="300" height="auto" alt="qq" src="https://gw.alipayobjects.com/zos/antfincdn/v4TlwgORE/qq_qr_code.JPG">
</a>
</p>

## 👬 Contributors
Expand Down
10 changes: 10 additions & 0 deletions packages/s2-core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# [@antv/s2-v1.51.2](https://github.com/antvis/S2/compare/@antv/s2-v1.51.1...@antv/s2-v1.51.2) (2023-10-27)


### Bug Fixes

* **interaction:** 修复拖动水平滚动条后单元格选中状态被重置 close [#2376](https://github.com/antvis/S2/issues/2376) ([#2380](https://github.com/antvis/S2/issues/2380)) ([b2e9700](https://github.com/antvis/S2/commit/b2e97008122f5320342fd069a08f6e821a5c9ad6))
* **layout:** 修复在紧凑模式列头宽度未按文本自适应 close [#2385](https://github.com/antvis/S2/issues/2385) ([#2392](https://github.com/antvis/S2/issues/2392)) ([2edd99c](https://github.com/antvis/S2/commit/2edd99c367116bad661a02893a303311787eb647))
* 修复分组汇总时,按汇总排序获取排序数据为空 ([#2370](https://github.com/antvis/S2/issues/2370)) ([2443762](https://github.com/antvis/S2/commit/24437622e1b259288bf7f8f3505837088a6e1b9d))
* 修复树状角头,当有存在icon时,内容与box宽度恰好相等,出现换行 close [#2389](https://github.com/antvis/S2/issues/2389) ([#2390](https://github.com/antvis/S2/issues/2390)) ([19497b3](https://github.com/antvis/S2/commit/19497b34aaa9bd19ca5f410926f3035f1aa76d09))

# [@antv/s2-v1.51.1](https://github.com/antvis/S2/compare/@antv/s2-v1.51.0...@antv/s2-v1.51.1) (2023-10-13)


Expand Down
57 changes: 57 additions & 0 deletions packages/s2-core/__tests__/bugs/issue-2385-spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
/**
* @description spec for issue #2385
* https://github.com/antvis/S2/issues/2385
*/
import { createPivotSheet, getContainer } from '../util/helpers';
import * as mockDataConfig from '../data/data-issue-2385.json';
import type { S2Options } from '../../src';
import { PivotSheet, TableSheet } from '@/sheet-type';

const s2Options: S2Options = {
width: 800,
height: 600,
style: {
cellCfg: {
width: 200,
},
layoutWidthType: 'compact',
},
};

describe('Compare Layout Tests', () => {
test('should get max col width for pivot sheet', () => {
const s2 = new PivotSheet(getContainer(), mockDataConfig, s2Options);
s2.setTheme({
dataCell: {
text: {
fontSize: 20,
},
},
});
s2.render();

const colLeafNodes = s2.facet.layoutResult.colLeafNodes;
expect(Math.floor(colLeafNodes[0].width)).toBeCloseTo(179);
expect(Math.floor(colLeafNodes[1].width)).toEqual(98);
});

test('should get max col width for table sheet', () => {
const s2 = new TableSheet(getContainer(), mockDataConfig, s2Options);
s2.setDataCfg({
fields: {
columns: ['price'],
},
});
s2.setTheme({
dataCell: {
text: {
fontSize: 20,
},
},
});
s2.render();

const colLeafNodes = s2.facet.layoutResult.colLeafNodes;
expect(Math.floor(colLeafNodes[0].width)).toBeCloseTo(165);
});
});
Loading

0 comments on commit de6f4e8

Please sign in to comment.