Skip to content

Commit 36baf09

Browse files
LeeJimCyrus97favoureddddbitjianzjianzzhang
authored
1.1.4 (#1951)
* fix(loading): resolve style error (#1873) * fix(loading): resolve style error * test: update unit test * feat: empty的文案添加换行 (#1870) * fix(button): 修复[button] type="submit"时,disabled未生效 (#1878) * fix(button): 修复[button] type="submit"时,disabled未生效 修复[button] type="submit"时,disabled未生效 * fix(button): 修复[button] type="submit"时,disabled未生效 修复[button] type="submit"时,disabled未生效 * test: update snap --------- Co-authored-by: zjianzzhang <zjianzzhang@tencent.com> * style(row): row垂直居中样式 (#1866) 添加row的flex布局,垂直居中 * fix(progress): 安卓机朗读异常 & 动态朗读 (#1354) * fix: 安卓机朗读异常 * fix: fix code * fix: 安卓不发音 * fix: fix code * fix: wip 优化中 * fix: 优化 * chore: update snap * fix: fix code * fix: fix code * fix: 错误使用iOS变量 * fix(补充注释): 补充注释 * fix: 优化 * test: update snap * fix: 补充注释 * fix: 优化部分注释, remove code * fix: 优化注释 --------- Co-authored-by: leejimqiu <leejimqiu@gmail.com> * feature/swiper aria v2 (#1598) * feat(swiper): support aria * feat(swiper): support custom ariaLabel * feat(swiper): image name * chore(swiper): update snap --------- Co-authored-by: leejimqiu <leejimqiu@gmail.com> * docs: update custom theme * fix(radio): resolve style (#1889) * feat: 支持分割线组件的线条使用变量控制属性 (#1890) * fix(action-sheet): resolve ts error of show method (#1907) * fix(grid): 修复column>=4个时,--td-grid-item-image-width和--td-grid-item-text-font-size是无效的 (#1903) * chore: update _common (#1902) * feat: 支持radio的内容字体大小使用变量。 (#1895) * feat: 支持radio的内容字体大小使用变量。 * style: 修改css变量名称 * Bitjian fix/radio icon size (#1909) * fix: 修复--td-radio-icon-size对未选中的图标未生效 * fix: fix radio 未选择的图标未生效 * fix(radio): support css variables to change circle icon size --------- Co-authored-by: bitjian <1183048003@qq.com> * chore: publish v1.1.2 (#1910) * chore: publish v1.1.2 * chore: changelog's changes --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * fix(rate): 评分组件支持无障碍滑动 (#1574) * fix(rate): 评分组件支持滑动无障碍操作(#1050) * fix(rate): 评分组件样式问题修复.(#1050) * fix(rate): 评分组件单测问题.(#1050) * fix(rate): 抽象样式, 冗余代码.(#1050) * fix(rate): 删除冗余节点.(#1050) * fix(rate): 优化读取.(#1050) * fix(rate): 新增额外的读取.(#1050) * fix(rate): 修复警告旁白导致的滑动卡顿.(#1050) * fix(rate): sr-only注释(#1050) * fix(rate): update test snapshots. (#1050) * build: remove preview workflow tentatively * fix(upload): resolve max (#1914) * fix(navbar): resolve capsule zindex (#1920) * chore: update site * fix(button): 修复variant=outline等状态下loading不展示 (#1922) * fix(button): 修复variant=outline等状态下loading不展示 * fix(button): loading inheritColor 字段错误 * fix(navbar): resolve vertical align (#1926) * fix(navbar): resolve vertical align * test(navbar): update snapshot * fix(dropdown-menu): support multiple column radio (#1927) * fix(Link): resolve disabled problem (#1928) * fix(calendar): resolve error (#1930) * fix(calendar): resolve error * fix(calendar): make observer robust * fix(tabs): resolve content overflow (#1931) * fix(tabs): resolve content overflow * test(tabs): update snapshot * chore: update issue template * fix(Input): resolve vertical layout style error (#1934) * feat(collapse): add header-left-icon property (#1933) * feat(tabs): add middle slot (#1936) * chore: publish v1.1.3 (#1937) * chore: publish v1.1.3 * chore: changelog's changes --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * fix(slider): enable dragstart and dragend event (#1940) * fix(image-viewer): add using-custom-navation property (#1944) * feat(Swiper): update api docs (#1945) * feat(Swiper): update api docs * Update CHANGELOG.md * fix(picker): enable to using falsy value (#1948) * fix(toast): auto hide when page is hide (#1947) * feat(swiper): add image-load event (#1949) * feat(swiper): add image-load event * fix: resolve fallback value * test: update snapshot * chore: publish v1.1.4 (#1950) * chore: publish v1.1.4 * chore: changelog's changes --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> --------- Co-authored-by: Cyrus <liuxingran97@qq.com> Co-authored-by: favouredddd <40692560+favouredddd@users.noreply.github.com> Co-authored-by: 孜孜 <1183048003@qq.com> Co-authored-by: zjianzzhang <zjianzzhang@tencent.com> Co-authored-by: tomcat-hz <59186135+tomcat-hz@users.noreply.github.com> Co-authored-by: 龙风 <455947455@qq.com> Co-authored-by: zhangpaopao <zhangpaopao0609@gmail.com> Co-authored-by: Guan9 <mllz79@163.com> Co-authored-by: Y <anly_yaw@163.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: byqbai <byq1213@qq.com>
1 parent 7be7545 commit 36baf09

24 files changed

Lines changed: 153 additions & 70 deletions

File tree

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,19 @@ toc: false
55
docClass: timeline
66
---
77

8+
## 🌈 1.1.4 `2023-05-01`
9+
### 🚀 Features
10+
- `ImageViewer`: 新增 usingCustomNavigation 属性,处理使用自定义导航栏时被遮挡的问题 @LeeJim ([#1944](https://github.com/Tencent/tdesign-miniprogram/pull/1944))
11+
- `Swiper`: 新增 image-load 事件 @LeeJim ([#1949](https://github.com/Tencent/tdesign-miniprogram/pull/1949))
12+
13+
### 🐞 Bug Fixes
14+
- `Slider`: 修复 dragstart、dragend 事件没反应的问题 @LeeJim ([#1940](https://github.com/Tencent/tdesign-miniprogram/pull/1940))
15+
- `Picker`: 解决使用 falsy 值导致无法正确选择的问题 @LeeJim ([#1948](https://github.com/Tencent/tdesign-miniprogram/pull/1948))
16+
- `Toast`: 页面隐藏的时候自动关闭 @LeeJim ([#1947](https://github.com/Tencent/tdesign-miniprogram/pull/1947))
17+
18+
### 🚧 Others
19+
- `Swiper`: 更新 swiper 组件 API 文档 @anlyyao ([#1945](https://github.com/Tencent/tdesign-miniprogram/pull/1945))
20+
821
## 🌈 1.1.3 `2023-04-26`
922
### 🚀 Features
1023
- `Rate`: 支持无障碍访问 @byq1213 ([#1574](https://github.com/Tencent/tdesign-miniprogram/pull/1574))
@@ -24,6 +37,7 @@ docClass: timeline
2437
## 🌈 1.1.2 `2023-04-17`
2538
### 🚀 Features
2639
- `Swiper`: 支持无障碍访问 @zhangpaopao0609 ([#1598](https://github.com/Tencent/tdesign-miniprogram/pull/1598))
40+
- `Swiper`: list 属性支持 SwiperList[] 类型 @zhangpaopao0609 ([#1598](https://github.com/Tencent/tdesign-miniprogram/pull/1598))
2741
- `Divider`: 新增 CSS Variables 用于控制分割线样式 @favouredddd ([#1890](https://github.com/Tencent/tdesign-miniprogram/pull/1890))
2842
- `Grid`: 补充 CSS Variables 以修改不同列数下的图片尺寸和文字大小 @lolhezihehe ([#1903](https://github.com/Tencent/tdesign-miniprogram/pull/1903))
2943
- `Radio`: 新增 CSS Variables 用于控制内容字体大小 @favouredddd ([#1895](https://github.com/Tencent/tdesign-miniprogram/pull/1895))

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "tdesign-miniprogram",
33
"purename": "tdesign",
4-
"version": "1.1.3",
4+
"version": "1.1.4",
55
"description": "tdesign-miniprogram",
66
"title": "tdesign-ßminiprogram",
77
"main": "miniprogram_dist/index.js",

src/common/style/_variables.less

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,3 +183,6 @@
183183
@text-color-anti: var(--td-text-color-anti, @font-white-1);
184184
@text-color-brand: var(--td-text-color-brand, @brand-color);
185185
@text-color-link: var(--td-text-color-link, @brand-color);
186+
187+
// 定位
188+
@position-fixed-top: var(--td-position-fixed-top, 0);

src/common/template/image.wxml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
mode="{{mode || 'scaleToFill'}}"
1616
webp="{{webp || false}}"
1717
showMenuByLongpress="{{showMenuByLongpress || false}}"
18+
data-custom="{{dataset || null}}"
1819
bind:error="{{binderror}}"
1920
bind:load="{{bindload}}"
2021
/>

src/image-viewer/README.en-US.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
:: BASE_DOC ::
2+
3+
## API
4+
### ImageViewer Props
5+
6+
name | type | default | description | required
7+
-- | -- | -- | -- | --
8+
background-color | String | 'rgba(0, 0, 0, 1)' | \- | N
9+
close-btn | String / Boolean / Object / Slot | false | \- | N
10+
delete-btn | String / Boolean / Object / Slot | false | \- | N
11+
images | Array | [] | Typescript:`Array<string>` | N
12+
initial-index | Number | 0 | Typescript:`Number` | N
13+
show-index | Boolean | false | \- | N
14+
using-custom-navbar | Boolean | false | \- | N
15+
visible | Boolean | false | \- | N
16+
default-visible | Boolean | undefined | uncontrolled property | N
17+
18+
### ImageViewer Events
19+
20+
name | params | description
21+
-- | -- | --
22+
change | `(index: Number)` | \-
23+
close | `(trigger: 'overlay' \| 'button', visible: Boolean, index: Number)` | \-
24+
delete | `(index: Number)` | \-

src/image-viewer/README.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,36 +28,37 @@ isComponent: true
2828

2929
### 类型
3030

31-
基础图片预览
31+
#### 基础图片预览
3232

3333
{{ base }}
3434

35-
带操作图片预览
35+
#### 带操作图片预览
36+
37+
顶部区域可以配置关闭按钮、页码信息、删除按钮。
3638

3739
{{ delete }}
3840

41+
> 当使用自定义导航栏的时候,顶部的操作按钮会被遮挡,此时需要开启 `using-custom-navbar` 来解决
3942
4043
## API
41-
4244
### ImageViewer Props
4345

4446
名称 | 类型 | 默认值 | 说明 | 必传
4547
-- | -- | -- | -- | --
46-
background-color | String / Number | rgba(0, 0, 0, 1) | 遮罩的背景颜色 | N
48+
background-color | String | 'rgba(0, 0, 0, 1)' | 遮罩的背景颜色 | N
49+
close-btn | String / Boolean / Object / Slot | false | 是否显示关闭操作,前提需要开启页码。值为字符串表示图标名称,值为 `true` 表示使用默认图标 `close`,值为 `Object` 类型,表示透传至 `icon` ,不传表示不显示图标 | N
50+
delete-btn | String / Boolean / Object / Slot | false | 是否显示删除操作,前提需要开启页码。值为字符串表示图标名称,值为 `true` 表示使用默认图标 `delete`,值为 `Object` 类型,表示透传至 `icon`,不传表示不显示图标 | N
4751
images | Array | [] | 图片数组。TS 类型:`Array<string>` | N
48-
initial-index | Number | 0 | 默认展示第几项 | N
52+
initial-index | Number | 0 | 初始化页码。TS 类型:`Number` | N
4953
show-index | Boolean | false | 是否显示页码 | N
50-
delete-btn | Boolean / String / Object / Slot | false | 是否显示删除操作,前提需要开启页码。值为字符串表示图标名称,值为 `true` 表示使用默认图标 `delete`,值为 `Object` 类型,表示透传至 `icon`,不传表示不显示图标。 | N
51-
close-btn | Boolean / String / Object / Slot | false | 是否显示关闭操作,前提需要开启页码。值为字符串表示图标名称,值为 `true` 表示使用默认图标 `close`,值为 `Object` 类型,表示透传至 `icon` ,不传表示不显示图标。 | N
54+
using-custom-navbar | Boolean | false | `v1.1.4` 是否使用了自定义导航栏 | N
5255
visible | Boolean | false | 隐藏/显示预览 | N
5356
default-visible | Boolean | undefined | 隐藏/显示预览。非受控属性 | N
5457

55-
5658
### ImageViewer Events
5759

5860
名称 | 参数 | 描述
5961
-- | -- | --
6062
change | `(index: Number)` | 翻页时回调
61-
close | `(trigger: 'overlay' \| 'button' , visible: Boolean, index: Number)` | 点击操作按钮button或者overlay时触发
63+
close | `(trigger: 'overlay' \| 'button', visible: Boolean, index: Number)` | 点击操作按钮button或者overlay时触发
6264
delete | `(index: Number)` | 点击删除操作按钮时触发
63-

src/image-viewer/image-viewer.less

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,11 @@
1010
@image-viewer-nav-index-font-size: var(--td-image-viewer-nav-index-font-size, @font-size-base);
1111
@image-viewer-close-margin-left: var(--td-image-viewer-close-margin-left, @spacer-1);
1212
@image-viewer-delete-margin-right: var(--td-image-viewer-delete-margin-right, @spacer-1);
13+
@image-viewer-top: var(--td-image-viewer-top, @position-fixed-top);
1314

1415
.@{image-viewer} {
1516
position: fixed;
16-
top: 0;
17+
top: @image-viewer-top;
1718
left: 0;
1819
bottom: 0;
1920
right: 0;
@@ -23,7 +24,7 @@
2324
overflow: hidden;
2425

2526
&__mask {
26-
position: fixed;
27+
position: absolute;
2728
z-index: 1000;
2829
left: 0;
2930
top: 0;
@@ -56,7 +57,7 @@
5657

5758
&__nav {
5859
width: 100%;
59-
position: fixed;
60+
position: absolute;
6061
display: flex;
6162
align-items: center;
6263
justify-content: space-between;

src/image-viewer/image-viewer.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ export default class ImageViewer extends SuperComponent {
2222
windowWidth: 0,
2323
swiperStyle: {},
2424
imagesStyle: {},
25+
maskTop: 0,
2526
};
2627

2728
options = {
@@ -37,6 +38,7 @@ export default class ImageViewer extends SuperComponent {
3738

3839
ready() {
3940
this.saveScreenSize();
41+
this.calcMaskTop();
4042
}
4143

4244
observers = {
@@ -60,6 +62,18 @@ export default class ImageViewer extends SuperComponent {
6062
};
6163

6264
methods = {
65+
calcMaskTop() {
66+
if (this.data.usingCustomNavbar) {
67+
const rect = wx?.getMenuButtonBoundingClientRect() || null;
68+
const { statusBarHeight } = wx.getSystemInfoSync();
69+
70+
if (rect && statusBarHeight) {
71+
this.setData({
72+
maskTop: rect.top - statusBarHeight + rect.bottom,
73+
});
74+
}
75+
}
76+
},
6377
saveScreenSize() {
6478
const { windowHeight, windowWidth } = wx.getSystemInfoSync();
6579
this.setData({

src/image-viewer/image-viewer.wxml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
wx:if="{{visible}}"
66
id="{{classPrefix}}"
77
class="{{classPrefix}} class {{prefix}}-class"
8-
style="{{_._style([style, customStyle])}}"
8+
style="{{_._style([style, customStyle, '--td-image-viewer-top: ' + maskTop + 'px'])}}"
99
>
1010
<view
1111
class="{{classPrefix}}__mask"

src/image-viewer/props.ts

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,24 @@ const props: TdImageViewerProps = {
99
/** 遮罩的背景颜色 */
1010
backgroundColor: {
1111
type: String,
12-
optionalTypes: [Number],
1312
value: 'rgba(0, 0, 0, 1)',
1413
},
14+
/** 是否显示关闭操作,前提需要开启页码。值为字符串表示图标名称,值为 `true` 表示使用默认图标 `close`,值为 `Object` 类型,表示透传至 `icon` ,不传表示不显示图标 */
15+
closeBtn: {
16+
type: null,
17+
value: false,
18+
},
19+
/** 是否显示删除操作,前提需要开启页码。值为字符串表示图标名称,值为 `true` 表示使用默认图标 `delete`,值为 `Object` 类型,表示透传至 `icon`,不传表示不显示图标 */
20+
deleteBtn: {
21+
type: null,
22+
value: false,
23+
},
1524
/** 图片数组 */
1625
images: {
1726
type: Array,
1827
value: [],
1928
},
20-
/** 默认展示第几项 */
29+
/** 初始化页码 */
2130
initialIndex: {
2231
type: Number,
2332
value: 0,
@@ -27,14 +36,9 @@ const props: TdImageViewerProps = {
2736
type: Boolean,
2837
value: false,
2938
},
30-
/** 是否显示删除操作 */
31-
deleteBtn: {
32-
type: null,
33-
value: false,
34-
},
35-
/** 是否显示关闭操作 */
36-
closeBtn: {
37-
type: null,
39+
/** 是否使用了自定义导航栏 */
40+
usingCustomNavbar: {
41+
type: Boolean,
3842
value: false,
3943
},
4044
/** 隐藏/显示预览 */

0 commit comments

Comments
 (0)