Skip to content

Commit

Permalink
feat(overlay): enable duration (#2179)
Browse files Browse the repository at this point in the history
* feat(overlay): enable duration

* test: snap-update

* test: update snapshot

---------

Co-authored-by: lijun <leejimqiu@gmail.com>
  • Loading branch information
betavs and LeeJim authored Jul 25, 2023
1 parent e941403 commit bba642f
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 9 deletions.
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

0 comments on commit bba642f

Please sign in to comment.