Skip to content

Commit

Permalink
chore: release 1.8.0-naruto (#2926)
Browse files Browse the repository at this point in the history
* fix(tree): tree 组件,解决 watch 回调时间过迟的问题 (#2873)

* fix(tree): tree 组件,解决 watch 回调时间过迟的问题

* style(tree): tree 组件,代码样式改进

* test(tree): tree 组件,完善单元测试,验证 mounted 赋值可在 nextTick 触发数据变更

* [cascader]选项disabled修改后,选项不是禁用状态#2859 (#2872)

* [cascader]选项disabled修改后,选项不是禁用状态#2859

* chore: fix lint

---------

Co-authored-by: wū yāng <[email protected]>

* feat(tree): add api getTreeData (#2888)

* refactor(tree): tree 组件完善数据初始化时机问题的解决方案

* feat(tree): tree 组件添加 api: getTreeData

* test(tree): tree 组件,完善 getTreeData 方法的单元测试

* test(tree): 完善单元测试

* docs(tree): tree 组件完善文档

* feat(upload): support fileListDisplay=null to hide file list (#2889)

* feat(image-viewer): support closeOnEscKeydown (#2890)

* feat(Upload): add Some Features and Bugs (#2891)

* feat: rebase develo

* feat(upload): some features

* test: update snapshots

* fix: remove unsued code

* feat(select): props collapsedItems to add onClose function (#2863)

* fix: 修正 lodash 引入 (#2893)

* fix(slider): step < 1 is not working (#2894)

* fix(slider): fix step is not working

* chore: update common

* chore: update demo

* fix(checkbox): value.splice does not work (#2896)

* feat(checkbox): support Array.splice

* revert: demo

* chore: release 1.7.2 (#2895)

* chore: release 1.7.2

* chore: changelog's changes

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* chore: fix api docs (#2904)

* chore: fix api docs

* chore: fix api docs

* fix: 误判断删除键(backspace)是空格键(space) (#2905)

* docs(Input): value type remove Number

* fix: 删除键(backspace)触发误判断成空格(space)

* fix(popup): ignore mouseenter when destroyOnClose is true and is leaving (#2898)

* feat(loading): support v-loading unbind (#2902)

* fix(table): do not calculate th width if props.showHeader=false (#2909)

* feat(space): compatibility problems (#2887)

* fix(space): compatibility problems

* test: unit tests

* feat: update common and snapshots

* test: update common and unit tests

* test: update snapshots

* chore: add ignore async expamle list test

* fix(checkbox): unexpected behavior when disabled is handled (#2911)

* fix(checkbox): unexpected behavior when disabled is handled

* fix(checkbox): max disabled state

---------

Co-authored-by: chaishi <[email protected]>

* feat(table): support update edited cell value (#2917)

* [Checkbox] fix set value checked before options pushed, while checkbox UI is not checked (#2914)

* fix: useElementLazyRender default value

* fix(checkbox): set value before options change does not work

* fix: useElementLazyRender

* [Table] fix column resize problem; column controller of multiple header improvement (#2916)

* docs: demo inprovement

* fix(table): multi header column config

* fix: 修复列宽调整问题

* fix(table): column controller of multiple header does not work

* test: update snapshots

* test: update snapshots

* feat(input): support number type (#2906)

* feat(input): support number type

* feat(input): default type is string

* fix: add ts

* feat: inputvalue string

* fix: lint error

* feat(taginput): support prefixIcon

* chore: remove api not implemented

---------

Co-authored-by: wū yāng <[email protected]>

* feat(statistic): add Statistic component  (#2397)

* Merge branch 'docs/statistic' into feat/statistic

* feat(statistic): add new component for statistic

add new component for statistic

BREAKING CHANGE: add statistic

* perf(renamed icons for consistency): renamed icons for consistency

Renamed icons for consistency

* feat(statistic): add component tests and update examples

add component tests and update examples

* chore(submodules): submodules

* docs(statistic): add file description

* chore: update snapshot

* chore: fix ui feedback

* chore: update snapshot

* chore: update common

* chore: update common

---------

Co-authored-by: Uyarn <[email protected]>

* fix(Textarea): autosize nextTick null err (#2921)

* feat(table): lazyLoad works not properly (#2915)

* fix: useElementLazyRender

* test: update snapshots

---------

Co-authored-by: Uyarn <[email protected]>

* chore: update docs (#2923)

* chore: update docs

* chore: update docs

* chore: update CONTRIBUTING.md

* fix(cascader): fix placeholder warning (#2924)

* chore: release 1.8.0 (#2925)

* chore: release 1.8.0

* chore: remove deprecated CHANGELOG

* chore: changelog's changes

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* chore: release 1.8.0-naruto

---------

Co-authored-by: TabSpace <[email protected]>
Co-authored-by: lxc-orange <[email protected]>
Co-authored-by: sheepluo <[email protected]>
Co-authored-by: bloglab <[email protected]>
Co-authored-by: fennghuang <[email protected]>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: liweijie0812 <[email protected]>
Co-authored-by: Guxi11 <[email protected]>
Co-authored-by: Zz-ZzzZ <[email protected]>
Co-authored-by: betavs <[email protected]>
Co-authored-by: chaishi <[email protected]>
Co-authored-by: 李江辰 <[email protected]>
Co-authored-by: Nined <[email protected]>
  • Loading branch information
14 people authored Nov 23, 2023
1 parent 48e1949 commit 1d04334
Show file tree
Hide file tree
Showing 127 changed files with 6,976 additions and 32,284 deletions.
334 changes: 57 additions & 277 deletions CHANGELOG.md

Large diffs are not rendered by default.

184 changes: 161 additions & 23 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,174 @@
# 参与贡献
# CONTRIBUTING

非常感谢你对 TDesign 的关注,如果你想为组件库或其他产品贡献一份力量,请先了解下以下内容。
`tdesign-vue` 包含 `vue` 代码和一个子仓库,子仓库指向 `tdesign-common`仓库

## 开启 issue
## 开发

### 安装依赖

如果你想要贡献一个新特性,请在实际写代码前先开一个 issue 与社区里的小伙伴一起讨论必要性及实现方案。
```bash
npm i
```

## Github flow 贡献流程
### 本地开发

- 请将本项目 clone 至本地
- 创建 feature/fix 分支
- 开发过程中可以使用 `git fetch``git rebase` 来同步上游分支代码
- 提交代码到 forked 仓库,commit message 撰写请参照 [Angular Commits 规范](https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#commits)
- 发起 pr
- 会有 PMC 同学来 CR 本次提交的代码,请及时关注 CR 评论通知信息
- CR 通过后会合并进入 develop 分支,等待周迭代或紧急 patch 版本发布 npm
```bash
npm run start
```

## 开发
浏览器访问 <http://127.0.0.1:16000>

### 目录结构

```text
├── script // 构建代码
├── site // 站点代码
├── src // 组件代码
└─ componentA
├── _example // 组件示例文档
├── _usage // 组件 live demo
└─ __tests__ // 组件测试用例
└─ test // 测试配置文件
```

### 组件页路由配置

每一个组件页,都是一个 md 文件,参考 `/site/config/index.js` 已有定义,直接按照模板添加即可

```js
{
title: '基础组件',
type: 'component', // 组件文档
children: [
{
title: 'Button 按钮',
name: 'button',
component: () => import(`@/examples/components/button/button.md`),
},
{
title: 'Icon 图标',
name: 'icon',
component: () => import(`@/examples/components/icon/icon.md`),
},
...
],
},
```

### Markdown 文件 demo 引用

文档 demo 排列与 common 仓库中的 UI demo 展示一致

```markdown
{{ base }}
[demo 描述(可不填)]
```

### Demo 调试

当一个 md 文件插入了很多个 demo 之后,一些组件生命周期方法调试起来会变得困难,若想对某个 demo 单独调试,可以访问路由:/demos/组件名/demo 名,

例如:<http://127.0.0.1:16000/vue/demos/button/base>

### 单元测试 & e2e 测试文档

[组件测试文档](./test/README.md)

## git

### 分支

主仓库遵循使用 `git flow` 规范,新组件分支从 `develop checkout`[https://nvie.com/posts/a-successful-git-branching-model/](https://nvie.com/posts/a-successful-git-branching-model/)

如果是贡献组件,则从 `develop checkout` 分支如:`feature/button`,记得如果同时要在子仓库开发 UI,子仓库也要 `checkout` 同名分支

> 关于 fork
以下内容处理 `fork` 仓库后,远端仓库的更新如何同步到 `fork` 仓库

```bash
# 子仓库需要ssh拉取,如果出现类似Host Key verification failed的错误,请先配置ssh,参考文档(https://git-scm.com/book/zh/v2/%E6%9C%8D%E5%8A%A1%E5%99%A8%E4%B8%8A%E7%9A%84-Git-%E7%94%9F%E6%88%90-SSH-%E5%85%AC%E9%92%A5)
git clone --recurse-submodules https://github.com/Tencent/tdesign-vue.git
cd tdesign-vue
# 建立 upstream remote
git remote add upstream [email protected]:Tencent/tdesign-vue.git

# 开发预览
npm i
npm run dev
# 更新 upstream
git fetch upstream develop

# 合并 upstream develop 到本地
git checkout develop

# 打开浏览器访问 http://127.0.0.1:16000
git merge upstream/develop
```

更多指引请参考:
## 提交说明

项目使用基于 angular 提交规范:[https://github.com/conventional-changelog/commitlint/tree/master/@commitlint/config-conventional](https://github.com/conventional-changelog/commitlint/tree/master/@commitlint/config-conventional)

每次提交会自动触发提交验证

- 使用工具 commitizen 协助规范 git commit 信息
- fix & feat 的提交会被用来生成 changelog
- 提交会触发 git pre-commit 检查,修复提示的 eslint 错误,

## 公共子仓库 tdesign-common

本项目以子仓库的形式引入 `tdesign-common` 公共仓库,对应 `src/\_common` 文件夹
公共仓库中包含

- 一些公共的工具函数
- 组件库 `UI` 开发内容,既 `html` 结构和 `css` 样式(React/Vue 共用)

### 初始化子仓库

- 初次克隆代码后需要初始化子仓库: `git submodule init && git submodule update`
- git submodule update 之后子仓库不指向任何分支,只是一个指向某一个提交的游离状态

### 子仓库开发

子仓库组件分支从 `develop checkout` 示例:`feature/button`,提交代码时先进入子仓库完成提交,然在回到主仓库完成提交

- 先进入 `src/\_common` 文件夹,正常将样式修改添加提交
- 回到主仓库,此时应该会看到 `src/\_common` 文件夹是修改状态,按照正常步骤添加提交即可

## 关于组件库 UI

UI 开发(HTML & CSS)是多个框架共用的,比如 React-web/Vue-web/Vue-next web。各个框架组件实现应该要复用 UI 开发的 html 结构,引用其组件 CSS 与 Demo CSS(本仓库已在入口处引用了),UI 开发一般可由单独的 UI 开发同学认领完成或各框架组件开发同学的其中一名同学完成

- 如果开发前已有某个组件的 UI 开发内容,直接在主仓库使用即可
- 如果没有,且你也负责 UI 开发:参考 UI 开发规范完成 UI 开发内容、然后再开发主仓库组件
- 如果没有,且 UI 开发工作已有其他同学负责或认领:可以先在主仓库开发组件功能,待 UI 开发输出之后对齐即可

如果 UI 内容和样式(其他同学负责开发)还未完成,而你开发组件功能时需要写一些样式,可以直接在组件文件夹先写一个临时的 less 文件,在 js 中引入即可,如:

```bash
├── button.less
├── button.tsx
```

```js
// button.tsx

// 先引入临时的样式文件用于开发功能,待 UI 开发完成之后需要与 UI 样式对齐并删除 less 文件
import './button.less';
```

## 开发规范

UI 开发规范参考子仓库 README [子仓库 README](https://github.com/Tencent/tdesign-common/blob/main/style/web/README.md)

### 新建组件

```shell
npm run generate:component
```

### API 规范

API 由 API 平台统一管理生成 https://github.com/tdesignoteam/tdesign-api

### 前缀

组件和 `CSS` 前缀以 `t-` 开头,无论 `js` 还是 `css` 都使用变量定义前缀,方便后续替换

### CSS

- [开发指南](./DEVELOP_GUIDE.md)
- [测试指南](./TEST_GUIDE.md)
组件样式在 `common` 子仓库开发,遵循 [tdesign-common 仓库 UI 开发规范](https://github.com/Tencent/tdesign-common/blob/main/style/web/README.md)
2 changes: 0 additions & 2 deletions PUBLISH.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@

## 版本号说明

目前还没有发布 1.0.0 正式版本,因此可以随时发布 PATCH、MINOR 及 MAJOR 版本,1.0.0 发布后 MINOR 及 MAJOR 版本的发布需要 PMC 团队决策后发布。

版本号设置遵循 [SemVer 语义化版本控制规范 2.0.0](https://semver.org/lang/zh-CN/),一切以保证用户版本稳定性为前提,原则如下:

- 当进行不兼容的 API 更改时,升级 MAJOR 版本
Expand Down
6 changes: 6 additions & 0 deletions README-zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,12 @@ npm package 中提供了多种构建产物,可以阅读 [这里](https://githu

TDesign 欢迎任何愿意参与贡献的参与者。如果需要本地运行代码或参与贡献,请先阅读[参与贡献](https://github.com/Tencent/tdesign-vue/blob/develop/CONTRIBUTING.md)

## 贡献成员

<a href="https://github.com/tencent/tdesign-vue/graphs/contributors">
<img src="https://contrib.rocks/image?repo=tencent/tdesign-vue" />
</a>

# 反馈

有任何问题,建议通过 [Github issues](https://github.com/Tencent/tdesign-vue/issues) 反馈或扫码加入用户微信群。
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@ TDesign also provides component libraries for other platforms and frameworks.

Contributing is welcome. Read [guidelines for contributing](https://github.com/Tencent/tdesign-vue/blob/develop/CONTRIBUTING.md) before submitting your [Pull Request](https://github.com/Tencent/tdesign-vue/pulls).

## Contributors

<a href="https://github.com/tencent/tdesign-vue/graphs/contributors">
<img src="https://contrib.rocks/image?repo=tencent/tdesign-vue" />
</a>

# Feedback

Create your [Github issues](https://github.com/Tencent/tdesign-vue/issues) or scan the QR code below to join our user groups
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "tdesign-vue",
"purename": "tdesign",
"version": "1.7.1-naruto",
"version": "1.8.0-naruto",
"description": "tdesign-vue",
"title": "tdesign-vue",
"keywords": [
Expand Down
8 changes: 8 additions & 0 deletions site/site.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,14 @@ const docs = [
component: () => import('tdesign-vue/skeleton/skeleton.md'),
componentEn: () => import('tdesign-vue/skeleton/skeleton.en-US.md'),
},
{
title: 'Statistic 统计数值',
titleEn: 'Statistic',
name: 'statistic',
path: '/vue/components/statistic',
component: () => import('tdesign-vue/statistic/statistic.md'),
componentEn: () => import('tdesign-vue/statistic/statistic.en-US.md'),
},
{
title: 'Swiper 轮播框',
titleEn: 'Swiper',
Expand Down
2 changes: 1 addition & 1 deletion src/anchor/__tests__/anchor-link.test.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { mount } from '@vue/test-utils';
import Vue from 'vue';
import { omit } from 'lodash';
import omit from 'lodash/omit';
import { AnchorItem } from '@/src/anchor/index.ts';

const defaultProvide = {
Expand Down
2 changes: 1 addition & 1 deletion src/anchor/anchor-item.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Vue, { VueConstructor } from 'vue';
import { ScopedSlotReturnValue } from 'vue/types/vnode';
import { isEmpty } from 'lodash';
import isEmpty from 'lodash/isEmpty';
import { VNode } from 'vue/types/umd';
import { ANCHOR_SHARP_REGEXP } from './utils';
import props from './anchor-item-props';
Expand Down
2 changes: 1 addition & 1 deletion src/anchor/anchor.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Vue, { VueConstructor } from 'vue';
import { ScopedSlotReturnValue } from 'vue/types/vnode';
import { isFunction } from 'lodash';
import isFunction from 'lodash/isFunction';
import { ANCHOR_SHARP_REGEXP, ANCHOR_CONTAINER, getOffsetTop } from './utils';
import {
on, off, getScroll, scrollTo, getScrollContainer,
Expand Down
10 changes: 5 additions & 5 deletions src/auto-complete/auto-complete.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
} from 'vue';
import props from './props';
import { TdAutoCompleteProps } from './type';
import Input, { InputProps, TdInputProps } from '../input';
import Input, { InputProps, StrInputProps } from '../input';
import Popup, { PopupProps } from '../popup';
import useCommonClassName from '../hooks/useCommonClassName';
import AutoCompleteOptionList from './option-list';
Expand Down Expand Up @@ -51,7 +51,7 @@ export default defineComponent({
return classes;
});

const onInputChange: TdInputProps['onChange'] = (value, context) => {
const onInputChange: StrInputProps['onChange'] = (value, context) => {
setTValue(value, context);
};

Expand All @@ -64,7 +64,7 @@ export default defineComponent({
return tProps;
});

const onInnerFocus: InputProps['onFocus'] = (value, context) => {
const onInnerFocus: StrInputProps['onFocus'] = (value, context) => {
popupVisible.value = true;
emit('focus', { ...context, value });
props.onFocus?.({ ...context, value });
Expand All @@ -73,7 +73,7 @@ export default defineComponent({
});
};

const onInnerBlur: InputProps['onBlur'] = (value, context) => {
const onInnerBlur: StrInputProps['onBlur'] = (value, context) => {
emit('blur', { ...context, value });
props.onBlur?.({ ...context, value });
};
Expand All @@ -88,7 +88,7 @@ export default defineComponent({
props.onCompositionstart?.({ ...context, value });
};

const onInnerEnter: InputProps['onEnter'] = (value, context) => {
const onInnerEnter: StrInputProps['onEnter'] = (value, context) => {
emit('enter', { ...context, value });
props.onEnter?.({ ...context, value });
};
Expand Down
16 changes: 9 additions & 7 deletions src/cascader/cascader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ import {
} from './interface';
import { useConfig, usePrefixClass, useCommonClassName } from '../hooks/useConfig';
import { PopupVisibleChangeContext } from '../popup';
import { InputValue } from '../input';

import { closeIconClickEffect, handleRemoveTagEffect } from './core/effect';
import { getPanels, getSingleContent, getMultipleContent } from './core/helper';
import { getFakeArrowIconClass } from './core/className';
Expand Down Expand Up @@ -49,10 +47,14 @@ export default defineComponent({

const panels = computed(() => getPanels(cascaderContext.value.treeNodes));

const inputPlaceholder = computed(
() => (cascaderContext.value.visible && !props.multiple && getSingleContent(cascaderContext.value))
|| (props.placeholder ?? global.value.placeholder),
);
const inputPlaceholder = computed(() => {
if (cascaderContext.value.visible && !props.multiple) {
let placeholder = getSingleContent(cascaderContext.value);
if (typeof placeholder === 'number') placeholder = String(placeholder);
return placeholder;
}
return props.placeholder ?? global.value.placeholder;
});

const { formDisabled } = useFormDisabled();
const isDisabled = computed(() => formDisabled.value || cascaderContext.value.disabled);
Expand Down Expand Up @@ -160,7 +162,7 @@ export default defineComponent({
inputProps: { size: this.size, ...(this.inputProps as TdCascaderProps['inputProps']) },
tagInputProps: { size: this.size, ...(this.tagInputProps as TdCascaderProps['tagInputProps']) },
tagProps: { ...(this.tagProps as TdCascaderProps['tagProps']) },
onInputChange: (value: InputValue, ctx: SelectInputValueChangeContext) => {
onInputChange: (value: string, ctx: SelectInputValueChangeContext) => {
if (!this.isFilterable) return;
setInputVal(`${value}`);
(this?.selectInputProps as TdSelectInputProps)?.onInputChange?.(value, ctx);
Expand Down
2 changes: 1 addition & 1 deletion src/cascader/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ export const useCascaderContext = (props: TdCascaderProps) => {
updateExpend();
updatedTreeNodes();
},
{ immediate: true },
{ immediate: true, deep: true },
);

// tree插件配置变化
Expand Down
Loading

0 comments on commit 1d04334

Please sign in to comment.