Skip to content

Commit

Permalink
1.1.0 (#1846)
Browse files Browse the repository at this point in the history
* docs: update custom theme

* 新增layout布局 (#1821)

* feat(layout): add a new component

feat #1701

* fix: 修复代码

* fix: 修复PR问题

* build: update issue label workflow

* Docs/layout (#1822)

* chore(layout): add docs and property file

* chore: update layout url

* fix(col): update api

* fix: cls函数支持传入数值类型 (#1827)

* 修复 button 组件 disableb 对控制 tap 无效问题 (#1833)

* fix: button的tap事件没触发

fix #1797

* fix: disableb 对控制 tap 无效

* fix: fix lint question

* feat(search): add type prop to input component (#1828)

add type prop to input component

fix #1793

* fix(NoticeBar): resolve scroll (#1835)

* fix(checkbox): placement name in demo is wrong (#1836)

* fix(popup): resolve close can not tap

* feat(popup): support background,border-radius,safe-area

* fix(popup): add less variable (#1758)

* fix(checkbox): placement name

* feat(pulldownrefresh): add default value to loading-texts (#1837)

* feat(pulldownrefresh): add default value to loading-texts

add default value to loading-texts

* fix(pulldownrefresh): add default value to loading-texts

#1806

* fix(pulldown-refresh): resolve external class (#1839)

* chore: add layout on overview page

* fix(grid): resolve image class (#1842)

* fix(notice-bar): fix loop prop (#1826)

fix notice-bar loop issue

* fix(cascader): resolve options when value changed (#1841)

* fix(tabs): resolve animation and uncaught error (#1843)

* fix(tabs): remove scroll bar (#1844)

* chore: publish v1.1.0 (#1845)

* chore: publish v1.1.0

* chore: changelog's changes

---------

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

---------

Co-authored-by: pingwu <58472278+wuping97@users.noreply.github.com>
Co-authored-by: Haochen Li <lihaochen2017@outlook.com>
Co-authored-by: Y <anly_yaw@163.com>
Co-authored-by: Wang <awangjianjun9@gmail.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
6 people authored Mar 27, 2023
1 parent 901c6d7 commit 911b402
Show file tree
Hide file tree
Showing 64 changed files with 522 additions and 67 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/issue-label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@ jobs:
label=${{ github.event.label.name }}
if [[ $label = "easy" ]]
then
echo "level=简单" >> $GITHUB_OUTPUT
echo "level=" >> $GITHUB_OUTPUT
echo "duration=1" >> $GITHUB_OUTPUT
deadline=$(date -d "+3 days" +'%Y-%m-%d')
echo "deadline=${deadline}" >> $GITHUB_OUTPUT
elif [[ $label = "middle" ]]
then
echo "level=中等" >> $GITHUB_OUTPUT
echo "level=" >> $GITHUB_OUTPUT
echo "duration=3" >> $GITHUB_OUTPUT
deadline=$(date -d "+7 days" +'%Y-%m-%d')
echo "deadline=${deadline}" >> $GITHUB_OUTPUT
else
echo "level=困难" >> $GITHUB_OUTPUT
echo "level=" >> $GITHUB_OUTPUT
echo "duration=5" >> $GITHUB_OUTPUT
deadline=$(date -d "+10 days" +'%Y-%m-%d')
echo "deadline=${deadline}" >> $GITHUB_OUTPUT
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ test/unit-virtualHost
.DS_Store
node_modules
package-lock.json
yarn.lock

# Log files
npm-debug.log*
Expand Down
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,24 @@ toc: false
docClass: timeline
---

## 🌈 1.1.0 `2023-03-27`
### 🚀 Features
- `Layout`: 新增布局组件,包含 row 和 col 组件 @wuping97 ([#1821](https://github.com/Tencent/tdesign-miniprogram/pull/1821))
- `Search`: 新增 type 属性透传至 input,默认为 text @haochenli ([#1828](https://github.com/Tencent/tdesign-miniprogram/pull/1828))

### 🐞 Bug Fixes
- `Button`: 修复 disabled = true 仍触发 tap 事件的问题 @wuping97 ([#1833](https://github.com/Tencent/tdesign-miniprogram/pull/1833))
- `NoticeBar`: 修复二轮滚动初始位置不正确 @anlyyao ([#1835](https://github.com/Tencent/tdesign-miniprogram/pull/1835))
- `PullDownRefresh`: 修复 loading-texts 默认值缺失的问题 @haochenli ([#1837](https://github.com/Tencent/tdesign-miniprogram/pull/1837))
- `PullDownRefresh`: 解决外部样式类 t-class-text 拼写错误的问题 @LeeJim ([#1839](https://github.com/Tencent/tdesign-miniprogram/pull/1839))
- `Grid`: 修复 t-class-image 无法赋予 image 样式的问题 @LeeJim ([#1842](https://github.com/Tencent/tdesign-miniprogram/pull/1842))
- `NoticeBar`: 修复 loop 为 0 时还会循环播放的问题 @haochenli ([#1826](https://github.com/Tencent/tdesign-miniprogram/pull/1826))
- `Cascader`: 修复当 value 发生变更时,options 没有更新的问题 @LeeJim ([#1841](https://github.com/Tencent/tdesign-miniprogram/pull/1841))
- `Tabs`: 修复设置 animation 导致 panel 内容无法切换的问题 @LeeJim ([#1843](https://github.com/Tencent/tdesign-miniprogram/pull/1843))
- `Tabs`: 修复 theme 不等于 line 时,获取 track 报错的问题 @LeeJim ([#1843](https://github.com/Tencent/tdesign-miniprogram/pull/1843))
- `Tabs`: 移除滚动条 @LeeJim ([#1844](https://github.com/Tencent/tdesign-miniprogram/pull/1844))


## 🌈 1.0.4 `2023-03-20`
### 🚀 Features
- `PullDownRefresh`: 支持无障碍访问支持 @shinyina ([#1241](https://github.com/Tencent/tdesign-miniprogram/pull/1241))
Expand Down
3 changes: 2 additions & 1 deletion example/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@
"pages/image-viewer/image-viewer",
"pages/result/result",
"pages/result/result-page",
"pages/link/link"
"pages/link/link",
"pages/col/col"
],
"subpackages": [
{
Expand Down
9 changes: 5 additions & 4 deletions example/pages/home/data/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,11 @@ const base = {
name: 'Link',
label: '链接',
},
// {
// name: 'Layout',
// label: '布局',
// },
{
name: 'Layout',
label: '布局',
path: '/pages/col/col',
},
// {
// name: 'Typography',
// label: '字体',
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-miniprogram",
"purename": "tdesign",
"version": "1.0.4",
"version": "1.1.0",
"description": "tdesign-miniprogram",
"title": "tdesign-ßminiprogram",
"main": "miniprogram_dist/index.js",
Expand Down
2 changes: 1 addition & 1 deletion site/docs/custom-theme.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,4 @@ page {
}
```

> 目前仅有部分组件支持自定义主题,支持的组件在其文档有陈列对应的 CSS Varialbes,可以访问 [tab-bar-item.less](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/tab-bar/tab-bar-item.less)
> 目前仅有部分组件支持自定义主题,支持的组件在其文档有陈列对应的 CSS Varialbes,可以访问 [tab-bar-item.less](https://github.com/Tencent/tdesign-miniprogram/blob/develop/src/tab-bar-item/tab-bar-item.less)
10 changes: 9 additions & 1 deletion site/docs/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: 将根据业务实践持续新增组件类型,敬请留意组件
spline: explain
---

<h3>基础<em class="tag">5</em></h3>
<h3>基础<em class="tag">6</em></h3>
<section class="image-group">
<div class="image-wrapper">
<a class="item" href="/miniprogram/components/button">
Expand Down Expand Up @@ -38,6 +38,14 @@ spline: explain
</a>
</div>

<div class="image-wrapper">
<a class="item" href="/miniprogram/components/col">
<img class="__light__" src="https://tdesign.gtimg.com/site/miniprogram-doc/doc-layout.png" />
<img class="__dark__" src="https://tdesign.gtimg.com/site/miniprogram-doc/doc-layout-dark.png" />
<p class="name">Layout 布局</p>
</a>
</div>

<div class="image-wrapper">
<a class="item" href="/miniprogram/components/link">
<img class="__light__" src="https://tdesign.gtimg.com/site/miniprogram-doc/doc-link.png" />
Expand Down
11 changes: 3 additions & 8 deletions site/plugin-tdoc/component.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,8 @@
<img class="qrcode" :src="qrcode" />
<!-- <img class="qrcode" :src="`https://tdesign.gtimg.com/miniprogram/qrcode/${name}.png`" /> -->
</div>
<iframe
:src="liveUrl"
frameborder="0"
width="100%"
height="100%"
style="box-sizing: border-box; border-radius: 0 0 6px 6px; overflow: hidden; border-top: 8px solid #f8f8f8"
></iframe>
<iframe :src="liveUrl" frameborder="0" width="100%" height="100%"
style="box-sizing: border-box; border-radius: 0 0 6px 6px; overflow: hidden; border-top: 8px solid #f8f8f8"></iframe>
</td-doc-phone>
<td-contributors platform="miniprogram" framework="wx" :component-name="name"></td-contributors>
</div>
Expand Down Expand Up @@ -113,7 +108,7 @@ export default defineComponent({
filter: unset;
}
div[name='DEMO'] & + pre {
div[name='DEMO'] &+pre {
margin-top: 0;
border-top-left-radius: 0;
border-top-right-radius: 0;
Expand Down
7 changes: 7 additions & 0 deletions site/site.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,13 @@ export default {
path: '/miniprogram/components/icon',
component: () => import('@/icon/README.md'),
},
{
title: 'Layout 布局',
name: 'layout',
meta: { docType: 'base' },
path: '/miniprogram/components/col',
component: () => import('@/col/README.md'),
},
{
title: 'Link 链接',
name: 'link',
Expand Down
2 changes: 1 addition & 1 deletion src/button/button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export default class Button extends SuperComponent {
this.triggerEvent('chooseavatar', e.detail);
},
handleTap(e) {
if (this.data.disabled) return;
if (this.data.disabled || this.data.loading) return;

this.triggerEvent('tap', e);
},
Expand Down
2 changes: 1 addition & 1 deletion src/button/button.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
send-message-img="{{sendMessageImg}}"
app-parameter="{{appParameter}}"
show-message-card="{{showMessageCard}}"
catch:tap="{{ disabled || loading ? '' : handleTap}}"
catch:tap="handleTap"
bind:getuserinfo="getuserinfo"
bind:contact="contact"
bind:getphonenumber="getphonenumber"
Expand Down
2 changes: 1 addition & 1 deletion src/calendar/__test__/__snapshots__/index.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -771,7 +771,7 @@ exports[`calendar :base 1`] = `
bind:getuserinfo="getuserinfo"
bind:launchapp="launchapp"
bind:opensetting="opensetting"
catch:tap=""
catch:tap="handleTap"
>
<wx-view
class="t-button__content"
Expand Down
2 changes: 2 additions & 0 deletions src/cascader/__test__/__snapshots__/demo.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,10 @@ exports[`Cascader Cascader base demo works fine 1`] = `
]
}}"
title="请选择地址"
value=""
visible="{{false}}"
bind:change="onChange"
bind:pick="onPick"
/>
</base>
`;
Expand Down
7 changes: 6 additions & 1 deletion src/cascader/_example/base/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,20 @@ Component({
options: data.areaList,
note: '请选择地址',
visible: false,
value: '',
},
methods: {
showCascader() {
this.setData({ visible: true });
},
onPick(e) {
console.log(e.detail);
},
onChange(e) {
const { selectedOptions } = e.detail;
const { selectedOptions, value } = e.detail;

this.setData({
value,
note: selectedOptions.map((item) => item.label).join('/'),
});
},
Expand Down
11 changes: 9 additions & 2 deletions src/cascader/_example/base/index.wxml
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
<t-cell title="地址" note="{{note}}" bind:click="showCascader" arrow></t-cell>
<t-cell title="地址" note="{{note}}" bind:click="showCascader" arrow />

<t-cascader visible="{{visible}}" options="{{options}}" title="请选择地址" bind:change="onChange"></t-cascader>
<t-cascader
visible="{{visible}}"
value="{{value}}"
options="{{options}}"
title="请选择地址"
bind:change="onChange"
bind:pick="onPick"
/>
19 changes: 13 additions & 6 deletions src/cascader/cascader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ export default class Cascader extends SuperComponent {

properties = props;

controlledProps = [
{
key: 'value',
event: 'change',
},
];

data = {
prefix,
name,
Expand All @@ -40,11 +47,9 @@ export default class Cascader extends SuperComponent {

$tabs?.setTrack();
this.updateScrollTop();
this.initWithValue();
}
},
'value, options'() {
this.initWithValue();
},
'selectedIndexes, options'() {
const { options, selectedIndexes, keys } = this.data;
const selectedValue = [];
Expand Down Expand Up @@ -87,12 +92,14 @@ export default class Cascader extends SuperComponent {

methods = {
initWithValue() {
if (this.data.value != null) {
if (this.data.value != null && this.data.value !== '') {
const selectedIndexes = this.getIndexesByValue(this.data.options, this.data.value);

if (selectedIndexes) {
this.setData({ selectedIndexes });
}
} else {
this.setData({ selectedIndexes: [] });
}
},
getIndexesByValue(options: OptionsType, value) {
Expand Down Expand Up @@ -159,15 +166,15 @@ export default class Cascader extends SuperComponent {
selectedIndexes[level] = index;
selectedIndexes.length = level + 1;

this.triggerEvent('pick', { value: item[keys?.value ?? 'value'], index });
this.triggerEvent('pick', { value: item[keys?.value ?? 'value'], index, level });

if (item?.[keys?.children ?? 'children']?.length) {
this.setData({ selectedIndexes });
} else {
// setCascaderValue(item.value);
this.setData({ selectedIndexes }, () => {
const { items } = this.data;
this.triggerEvent('change', {
this._trigger('change', {
value: item[keys?.value ?? 'value'],
selectedOptions: items.map((item, index) => item[selectedIndexes[index]]),
});
Expand Down
6 changes: 3 additions & 3 deletions src/checkbox/__test__/__snapshots__/demo.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ exports[`Checkbox Checkbox horizontal demo works fine 1`] = `
exports[`Checkbox Checkbox right demo works fine 1`] = `
<right>
<t-checkbox
checked="{{true}}"
defaultChecked="{{true}}"
label="多选"
value="1"
/>
Expand All @@ -145,9 +145,9 @@ exports[`Checkbox Checkbox right demo works fine 1`] = `
style="height: 32rpx"
/>
<t-checkbox
align="right"
checked="{{true}}"
defaultChecked="{{true}}"
label="多选"
placement="right"
value="2"
/>
</right>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ exports[`Checkbox Checkbox horizontal demo works fine 1`] = `
exports[`Checkbox Checkbox right demo works fine 1`] = `
<right>
<t-checkbox
checked="{{true}}"
defaultChecked="{{true}}"
label="多选"
value="1"
/>
Expand All @@ -145,9 +145,9 @@ exports[`Checkbox Checkbox right demo works fine 1`] = `
style="height: 32rpx"
/>
<t-checkbox
align="right"
checked="{{true}}"
defaultChecked="{{true}}"
label="多选"
placement="right"
value="2"
/>
</right>
Expand Down
4 changes: 2 additions & 2 deletions src/checkbox/_example/right/index.wxml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<t-checkbox value="1" label="多选" checked />
<t-checkbox value="1" label="多选" default-checked />

<view class="box" style="height: 32rpx" />

<t-checkbox value="2" label="多选" align="right" checked />
<t-checkbox value="2" label="多选" placement="right" default-checked />
15 changes: 15 additions & 0 deletions src/col/README.en-US.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
:: BASE_DOC ::

## API
### Col Props

name | type | default | description | required
-- | -- | -- | -- | --
offset | String / Number | - | \- | N
span | String / Number | - | \- | N

### Row Props

name | type | default | description | required
-- | -- | -- | -- | --
gutter | String / Number | - | \- | N
Loading

0 comments on commit 911b402

Please sign in to comment.