Skip to content

Commit bf39d23

Browse files
anlyyaoliweijie0812novlan1Wesley-0808uyarn
authored
chore: update site (#4000)
* chore: merge deploy mode (#3965) * chore: merge deploy mode * chore: rename * chore: pin [email protected] --------- Co-authored-by: 黎伟杰 <[email protected]> * chore: update build package name (#3974) * chore: update build package name * chore: fix typos * chore(indexes): fix sidebar click error in demo (#3980) * chore(indexes): fix sidebar click error in demo * chore: retain controlled usage --------- Co-authored-by: anlyyao <[email protected]> * fix(sidebar): fix color of disabled sidebar (#3982) * fix(sidebar): fix color of disabled sidebar * chore: optimize active state logic --------- Co-authored-by: anlyyao <[email protected]> * chore: update site (#3984) * chore: update site * chore: update image link --------- Co-authored-by: anlyyao <[email protected]> * feat(Drawer): add overlayProps attr (#3978) * feat(Drawer): add overlayProps attr * chore: unified code standard * feat(Watermark): support layout API (#3976) * fix: mini..._npm path * feat: api * feat: function * feat: layout demo * chore: docs * chore: typo * fix(Watermark): fix demo --------- Co-authored-by: anlyyao <[email protected]> * fix(SideBarItem): min-height is set to auto (#3985) * fix(SideBarItem): min-height is set to auto * docs: update css vars * chore(deploy): add static prefix (#3987) * chore: static * chore: add static prefix * 【DOC】修复文档错误、优化脚本 (#3993) * chore: update css generation script * chore: update script * fix(Calendar): fix action button status error (#3996) * chore: publish v1.11.0 (#3999) * chore: publish v1.11.0 * chore: changelog's changes --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> --------- Co-authored-by: 黎伟杰 <[email protected]> Co-authored-by: novlan1 <[email protected]> Co-authored-by: Wesley <[email protected]> Co-authored-by: wū yāng <[email protected]> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 846f29b commit bf39d23

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+510
-201
lines changed

packages/components/calendar/calendar.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,14 +167,16 @@ export default class Calendar extends SuperComponent {
167167
updateActionButton(value: Date) {
168168
const _min = this.getCurrentYearAndMonth(this.base.minDate);
169169
const _max = this.getCurrentYearAndMonth(this.base.maxDate);
170+
const _value = this.getCurrentYearAndMonth(value);
170171

171172
const _minTimestamp = new Date(_min.year, _min.month, 1).getTime();
172173
const _maxTimestamp = new Date(_max.year, _max.month, 1).getTime();
174+
const _dateValue = new Date(_value.year, _value.month, 1);
173175

174-
const _prevYearTimestamp = getPrevYear(value).getTime();
175-
const _prevMonthTimestamp = getPrevMonth(value).getTime();
176-
const _nextMonthTimestamp = getNextMonth(value).getTime();
177-
const _nextYearTimestamp = getNextYear(value).getTime();
176+
const _prevYearTimestamp = getPrevYear(_dateValue).getTime();
177+
const _prevMonthTimestamp = getPrevMonth(_dateValue).getTime();
178+
const _nextMonthTimestamp = getNextMonth(_dateValue).getTime();
179+
const _nextYearTimestamp = getNextYear(_dateValue).getTime();
178180

179181
const preYearBtnDisable = _prevYearTimestamp < _minTimestamp || _prevMonthTimestamp < _minTimestamp;
180182
const prevMonthBtnDisable = _prevMonthTimestamp < _minTimestamp;

packages/components/calendar/utils.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
export function getMonthByOffset(date: Date, offset: number) {
22
const _date = new Date(date);
33
_date.setMonth(_date.getMonth() + offset);
4-
_date.setDate(1);
54
return _date;
65
}
76

87
export function getYearByOffset(date: Date, offset: number) {
98
const _date = new Date(date);
109
_date.setFullYear(_date.getFullYear() + offset);
11-
_date.setDate(1);
1210
return _date;
1311
}
1412

packages/components/drawer/README.en-US.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,23 @@ style | Object | - | CSS(Cascading Style Sheets) | N
1010
custom-style | Object | - | CSS(Cascading Style Sheets),used to set style on virtual component | N
1111
close-on-overlay-click | Boolean | true | \- | N
1212
destroy-on-close | Boolean | false | \- | N
13-
footer | Slot | - | `0.29.0`[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/packages/components/common/common.ts) | N
13+
1414
items | Array | - | Typescript:`DrawerItem[]` `interface DrawerItem { title: string; icon: string; }`[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/packages/components/drawer/type.ts) | N
15+
overlay-props | Object | {} | Typescript:`OverlayProps`[Overlay API Documents](./overlay?tab=api)[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/packages/components/drawer/type.ts) | N
1516
placement | String | right | options: left/right | N
1617
show-overlay | Boolean | true | \- | N
17-
title | String / Slot | - | `0.29.0`[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/packages/components/common/common.ts) | N
18+
title | String | - | `0.29.0` | N
1819
using-custom-navbar | Boolean | false | \- | N
1920
visible | Boolean | false | \- | N
2021
z-index | Number | 11500 | \- | N
2122

23+
### Drawer Slots
24+
25+
name | Description
26+
-- | --
27+
footer | `0.29.0`
28+
title | `0.29.0`
29+
2230
### Drawer Events
2331

2432
name | params | description

packages/components/drawer/README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,23 @@ style | Object | - | 样式 | N
5353
custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
5454
close-on-overlay-click | Boolean | true | 点击蒙层时是否触发抽屉关闭事件 | N
5555
destroy-on-close | Boolean | false | 抽屉关闭时是否销毁节点 | N
56-
footer | Slot | - | `0.29.0`。抽屉的底部。[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/packages/components/common/common.ts) | N
56+
5757
items | Array | - | 抽屉里的列表项。TS 类型:`DrawerItem[]` `interface DrawerItem { title: string; icon: string; }`[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/packages/components/drawer/type.ts) | N
58+
overlay-props | Object | {} | 遮罩层的属性,透传至 overlay。TS 类型:`OverlayProps`[Overlay API Documents](./overlay?tab=api)[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/packages/components/drawer/type.ts) | N
5859
placement | String | right | 抽屉方向。可选项:left/right | N
5960
show-overlay | Boolean | true | 是否显示遮罩层 | N
60-
title | String / Slot | - | `0.29.0`。抽屉的标题[通用类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/packages/components/common/common.ts) | N
61+
title | String | - | `0.29.0`。抽屉的标题 | N
6162
using-custom-navbar | Boolean | false | 是否使用了自定义导航栏 | N
6263
visible | Boolean | false | 组件是否可见 | N
6364
z-index | Number | 11500 | 抽屉层级,样式默认为 11500 | N
6465

66+
### Drawer Slots
67+
68+
名称 | 描述
69+
-- | --
70+
footer | `0.29.0`。抽屉的底部
71+
title | `0.29.0`。抽屉的标题
72+
6573
### Drawer Events
6674

6775
名称 | 参数 | 描述

packages/components/drawer/drawer.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export default class Drawer extends SuperComponent {
2424

2525
methods = {
2626
// closeOnOverlayClick为true时才能触发popup的visible-change事件
27-
visibleChange({ detail }) {
27+
onVisibleChange({ detail }) {
2828
const { visible } = detail;
2929
const { showOverlay } = this.data;
3030

@@ -41,7 +41,7 @@ export default class Drawer extends SuperComponent {
4141
}
4242
},
4343

44-
itemClick(detail) {
44+
onItemClick(detail) {
4545
const { index, item } = detail.currentTarget.dataset;
4646

4747
this.triggerEvent('item-click', { index, item });

packages/components/drawer/drawer.wxml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@
44
wx:if="{{!destroyOnClose || visible}}"
55
style="{{_._style([style, customStyle])}}"
66
class="class"
7-
bind:visible-change="visibleChange"
87
visible="{{visible}}"
9-
zIndex="{{zIndex}}"
10-
usingCustomNavbar="{{usingCustomNavbar}}"
8+
z-index="{{zIndex}}"
9+
using-custom-navbar="{{usingCustomNavbar}}"
1110
placement="{{placement == 'right' ? 'right' : 'left'}}"
12-
showOverlay="{{showOverlay}}"
13-
closeOnOverlayClick="{{closeOnOverlayClick}}"
11+
show-overlay="{{showOverlay}}"
12+
overlay-props="{{overlayProps}}"
13+
close-on-click-overlay="{{closeOnOverlayClick}}"
14+
bind:visible-change="onVisibleChange"
1415
>
1516
<view class="{{classPrefix}}">
1617
<slot name="title" />
@@ -26,9 +27,9 @@
2627
wx:key="index"
2728
data-item="{{item}}"
2829
data-index="{{index}}"
29-
bindtap="itemClick"
3030
aria-role="{{ ariaRole || 'button' }}"
3131
aria-label="{{item.title}}"
32+
bindtap="onItemClick"
3233
>
3334
<view aria-hidden="{{true}}" wx:if="{{item.icon}}" class="{{classPrefix}}__sidebar-item-icon">
3435
<t-icon name="{{item.icon}}" />

packages/components/drawer/props.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ const props: TdDrawerProps = {
2020
items: {
2121
type: Array,
2222
},
23+
/** 遮罩层的属性,透传至 overlay */
24+
overlayProps: {
25+
type: Object,
26+
value: {},
27+
},
2328
/** 抽屉方向 */
2429
placement: {
2530
type: String,

packages/components/drawer/type.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
* 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC
55
* */
66

7+
import { OverlayProps } from '../overlay/index';
8+
79
export interface TdDrawerProps {
810
/**
911
* 点击蒙层时是否触发抽屉关闭事件
@@ -28,6 +30,14 @@ export interface TdDrawerProps {
2830
type: ArrayConstructor;
2931
value?: DrawerItem[];
3032
};
33+
/**
34+
* 遮罩层的属性,透传至 overlay
35+
* @default {}
36+
*/
37+
overlayProps?: {
38+
type: ObjectConstructor;
39+
value?: OverlayProps;
40+
};
3141
/**
3242
* 抽屉方向
3343
* @default right

packages/components/dropdown-menu/README.en-US.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ Name | Default Value | Description
8383
--td-dropdown-menu-height | 96rpx | -
8484
--td-dropdown-menu-icon-size | 40rpx | -
8585
--td-dropdown-body-max-height | 560rpx | -
86-
--td-dropdown-menu-bg-color | @bg-color-container | -
8786
--td-tree-bg-color | @bg-color-container | -
8887
--td-tree-item-active-color | @brand-color | -
8988
--td-tree-item-font-size | 32rpx | -

packages/components/dropdown-menu/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,6 @@ t-class-footer | 底部样式类
130130
--td-dropdown-menu-height | 96rpx | -
131131
--td-dropdown-menu-icon-size | 40rpx | -
132132
--td-dropdown-body-max-height | 560rpx | -
133-
--td-dropdown-menu-bg-color | @bg-color-container | -
134133
--td-tree-bg-color | @bg-color-container | -
135134
--td-tree-item-active-color | @brand-color | -
136135
--td-tree-item-font-size | 32rpx | -

0 commit comments

Comments
 (0)