Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(overlay): enable duration #2179

Merged
merged 4 commits into from
Jul 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -795,7 +795,7 @@ exports[`calendar :base 1`] = `
ariaLabel="关闭"
ariaRole="button"
class="t-overlay t-fade-enter t-fade-enter-active class"
style="z-index:11000;"
style="--td-overlay-transition-duration:300ms; z-index:11000;"
bind:tap="handleClick"
catch:touchmove="noop"
bind:transitionend="onTransitionEnd"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ exports[`date-time-picker :base 1`] = `
ariaLabel="关闭"
ariaRole="button"
class="t-overlay t-fade-enter t-fade-enter-active class"
style="z-index:11000;"
style="--td-overlay-transition-duration:300ms; z-index:11000;"
bind:tap="handleClick"
catch:touchmove="noop"
bind:transitionend="onTransitionEnd"
Expand Down
2 changes: 1 addition & 1 deletion src/dialog/__test__/__snapshots__/index.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ exports[`dialog :base 1`] = `
ariaLabel="关闭"
ariaRole="button"
class="t-overlay t-fade-enter t-fade-enter-active class"
style="z-index:11000;"
style="--td-overlay-transition-duration:300ms; z-index:11000;"
bind:tap="handleClick"
catch:touchmove="noop"
bind:transitionend="onTransitionEnd"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,7 @@ exports[`dropdown-menu :base 1`] = `
ariaLabel="关闭"
ariaRole="button"
class="t-overlay t-fade-enter-active t-fade-enter-to class"
style="z-index:11000; position: absolute;"
style="--td-overlay-transition-duration:300ms; z-index:11000; position: absolute;"
bind:tap="handleClick"
catch:touchmove="noop"
bind:transitionend="onTransitionEnd"
Expand Down
2 changes: 1 addition & 1 deletion src/overlay/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ isComponent: true
-- | -- | -- | -- | --
visible | Boolean | false | 是否展示 | N
zIndex | Number | 11000 | 遮罩层及 | N
duration | Number | 300 | (暂不支持)背景色过渡时间,单位毫秒 | N
duration | Number | 300 | 背景色过渡时间,单位毫秒 | N
backgroundColor | String | - | 遮罩层的背景色 | N
preventScrollThrough | Boolean | true | 防止滚动穿透,即不允许点击和滚动 | N

Expand Down
1 change: 1 addition & 0 deletions src/overlay/__test__/__snapshots__/demo.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
exports[`Overlay Overlay base demo works fine 1`] = `
<base>
<t-overlay
duration="{{500}}"
visible="{{false}}"
bind:click="handleOverlayClick"
/>
Expand Down
2 changes: 1 addition & 1 deletion src/overlay/__test__/__snapshots__/index.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ exports[`overlay :base 1`] = `
ariaLabel="关闭"
ariaRole="button"
class="t-overlay t-fade-enter t-fade-enter-active class"
style="z-index:11000;"
style="--td-overlay-transition-duration:300ms; z-index:11000;"
bind:tap="handleClick"
catch:touchmove="noop"
bind:transitionend="onTransitionEnd"
Expand Down
2 changes: 1 addition & 1 deletion src/overlay/_example/base/index.wxml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<t-overlay visible="{{visible}}" bind:click="handleOverlayClick" />
<t-overlay visible="{{visible}}" duration="{{500}}" bind:click="handleOverlayClick" />

<t-button block size="large" theme="primary" variant="outline" bind:tap="handleClick">基础用法</t-button>
2 changes: 1 addition & 1 deletion src/overlay/overlay.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<view
wx:if="{{realVisible && preventScrollThrough}}"
class="{{prefix}}-overlay {{transitionClass}} class"
style="{{_._style(['z-index:' + _zIndex, computedStyle, style, customStyle])}}"
style="{{_._style(['--td-overlay-transition-duration:' + duration + 'ms', 'z-index:' + _zIndex, computedStyle, style, customStyle])}}"
bind:tap="handleClick"
catchtouchmove="noop"
bind:transitionend="onTransitionEnd"
Expand Down
2 changes: 1 addition & 1 deletion src/picker/__test__/__snapshots__/index.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ exports[`picker :base 1`] = `
ariaLabel="关闭"
ariaRole="button"
class="t-overlay t-fade-enter t-fade-enter-active class"
style="z-index:11000;"
style="--td-overlay-transition-duration:300ms; z-index:11000;"
bind:tap="handleClick"
catch:touchmove="noop"
bind:transitionend="onTransitionEnd"
Expand Down