Skip to content

Commit

Permalink
chore(Modal): adjust style & add zIndex disableSrcoll animation props… (
Browse files Browse the repository at this point in the history
#128)

* chore(Modal): adjust style & add zIndex disableSrcoll animation props in Modal and Dialog

* chore(Icon): support fontSize prop

Co-authored-by: 陌缓 <[email protected]>
  • Loading branch information
miaodongqing and 陌缓 authored Jun 2, 2022
1 parent 20a56cf commit a59ec63
Show file tree
Hide file tree
Showing 11 changed files with 66 additions and 54 deletions.
4 changes: 2 additions & 2 deletions demo/pages/Modal/index.axml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
</modal>
<modal
visible="{{isCustomBtnModalShow}}"
content="人在天边月上明,风初紧,吹入画帘旌"
content="人在天边月上明"
mainButtonText="在线阅读"
addonButtonText="下载文件"
maskClosable="{{false}}"
Expand All @@ -29,7 +29,7 @@
</modal>
<modal
visible="{{isMainBtnModalShow}}"
content="人在天边月上明,风初紧,吹入画帘旌"
content="人在天边月上明"
mainButtonText="在线阅读"
addonButtonText=""
maskClosable="{{false}}"
Expand Down
10 changes: 7 additions & 3 deletions src/Dialog/index.axml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,16 @@
visible="{{visible}}"
maskClosable="{{maskClosable}}"
duration="{{duration}}"
disableScroll="{{disableScroll}}"
animation="{{animation}}"
zIndex="{{zIndex}}"
onClose="onClose">
<view class="amd-dialog-content">
<view class="amd-dialog-content-image-container">
<image class="amd-dialog-content-image amd-dialog-content-image-{{imageSize}}"
src="{{image}}"
a:if="{{image}}" />
<image class="amd-dialog-content-image amd-dialog-content-image-{{imageSize}}"
src="{{image}}"
a:if="{{image}}"
/>
</view>
<view class="amd-dialog-content-title">
{{title}}
Expand Down
2 changes: 1 addition & 1 deletion src/Dialog/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
}
&:empty ~ .amd-dialog-content-content {
margin-bottom: 5 * @rpx;
margin-top: 16 * @rpx;
margin-top: 40 * @rpx;
}
}

Expand Down
29 changes: 16 additions & 13 deletions src/Dialog/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ toc: false
| visible | boolean || false | 是否可见,受控模式 |
| duration | number || 300 | 过渡动画时长,单位毫秒 |
| maskClosable | boolean || true | 点击蒙层关闭 |
| disableScroll | boolean || true | 弹窗展示时,是否禁止页面滚动 |
| animation | boolean || true | 是否开启过渡动画 |
| zIndex | number || 998 | 弹窗层级 |
| className | string || - | 类名 |

## 事件
Expand Down Expand Up @@ -57,17 +60,17 @@ toc: false


<style>
table th:first-of-type { width: 180px; }
.__dumi-default-layout-content article table:first-of-type th:nth-of-type(2) {
width: 140px
}
.__dumi-default-layout-content article table:first-of-type th:nth-of-type(3) {
width: 30px
}
.__dumi-default-layout-content article table:first-of-type th:nth-of-type(4) {
width: 50px
}
.__dumi-default-layout-content article table:nth-of-type(4) th:first-of-type {
width: 300px
}
table th:first-of-type { width: 180px; }
.__dumi-default-layout-content article table:first-of-type th:nth-of-type(2) {
width: 140px;
}
.__dumi-default-layout-content article table:first-of-type th:nth-of-type(3) {
width: 30px;
}
.__dumi-default-layout-content article table:first-of-type th:nth-of-type(4) {
width: 50px;
}
.__dumi-default-layout-content article table:nth-of-type(4) th:first-of-type {
width: 300px;
}
</style>
2 changes: 1 addition & 1 deletion src/Icon/index.axml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<import-sjs name="icon"
from='./index.sjs' />
<text class="amd-icon amd-icon-{{type}} {{icon.getSize(size)}} {{className ? className : ''}}"
style="{{color ? `color: ${color};` : ''}}"
style="{{color ? `color: ${color};` : ''}} {{fontSize ? `font-size: ${fontSize};`: ''}}"
onTap="onTap">
</text>
21 changes: 11 additions & 10 deletions src/Icon/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ toc: false
| type | string || "" | icon 图标的类型 |
| size | 'x-small' &verbar; 'small' &verbar; 'medium' &verbar; 'large' &verbar; 'x-large' || "medium" | icon 的大小,x-small(16)、small(32)、medium(48)、large(64)、x-large(128), |
| color | string || - | icon 的颜色,即 CSS 中 color 属性的值 |
| fontSize | string || - | icon 的大小 |
| className | string || - | 类名 |

## 事件
Expand All @@ -37,15 +38,15 @@ toc: false
| amd-icon | 整体样式 |

<style>
table th:first-of-type { width: 180px; }
.__dumi-default-layout-content article table:first-of-type th:nth-of-type(2) {
width: 140px
}
.__dumi-default-layout-content article table:first-of-type th:nth-of-type(3) {
width: 30px
}
.__dumi-default-layout-content article table:first-of-type th:nth-of-type(4) {
width: 50px
}
table th:first-of-type { width: 180px; }
.__dumi-default-layout-content article table:first-of-type th:nth-of-type(2) {
width: 140px;
}
.__dumi-default-layout-content article table:first-of-type th:nth-of-type(3) {
width: 30px;
}
.__dumi-default-layout-content article table:first-of-type th:nth-of-type(4) {
width: 50px;
}

</style>
3 changes: 3 additions & 0 deletions src/Modal/index.axml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
visible="{{visible}}"
duration="{{duration}}"
maskClosable="{{maskClosable}}"
disableScroll="{{disableScroll}}"
animation="{{animation}}"
zIndex="{{zIndex}}"
onClose="onClose">
<view class="amd-modal-content">
<view class="amd-modal-content-image-container">
Expand Down
29 changes: 16 additions & 13 deletions src/Modal/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ toc: false
| mainButtonText | string || '主操作' | 主按钮 |
| addonButtonText | string || '辅助操作' | 辅助按钮,第二个按钮 |
| maskClosable | boolean || true | 点击蒙层关闭 |
| disableScroll | boolean || true | 弹窗展示时,是否禁止页面滚动 |
| animation | boolean || true | 是否开启过渡动画 |
| zIndex | number || 998 | 弹窗层级 |
| className | string || - | 类名 |

## 事件
Expand Down Expand Up @@ -58,17 +61,17 @@ toc: false
| amd-modal-close | close 图标样式 |

<style>
table th:first-of-type { width: 180px; }
.__dumi-default-layout-content article table:first-of-type th:nth-of-type(2) {
width: 140px
}
.__dumi-default-layout-content article table:first-of-type th:nth-of-type(3) {
width: 30px
}
.__dumi-default-layout-content article table:first-of-type th:nth-of-type(4) {
width: 50px
}
.__dumi-default-layout-content article table:nth-of-type(4) th:first-of-type {
width: 300px
}
table th:first-of-type { width: 180px; }
.__dumi-default-layout-content article table:first-of-type th:nth-of-type(2) {
width: 140px;
}
.__dumi-default-layout-content article table:first-of-type th:nth-of-type(3) {
width: 30px;
}
.__dumi-default-layout-content article table:first-of-type th:nth-of-type(4) {
width: 50px;
}
.__dumi-default-layout-content article table:nth-of-type(4) th:first-of-type {
width: 300px;
}
</style>
2 changes: 1 addition & 1 deletion src/Popup/index.axml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
onTouchMove="{{disableScroll && supportSjs ? _sjs.enableScrollEvent : ''}}"
>
<view class="amd-popup-close-container" a:if="{{showCloseIcon}}">
<icon type="CloseOutline" size="x-small" onTap="onClose"/>
<icon type="CloseOutline" onTap="onClose"/>
</view>
<view>
<slot />
Expand Down
2 changes: 1 addition & 1 deletion src/Popup/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
justify-content: center;
right: 24 * @rpx;
.amd-icon {
font-size: 26 * @rpx;
font-size: 36 * @rpx;
display: flex;
align-items: center;
justify-content: center;
Expand Down
16 changes: 7 additions & 9 deletions src/Popup/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ toc: false

| 属性 | 类型 | 必填 | 默认值 | 说明 |
| -----|-----|-----|-----|----- |
| className | string || - | 类名 |
| visible | boolean || false | 是否显示 |
| maskClosable | boolean || false | 点击蒙层是否可以关闭 |
| showCloseIcon | boolean || false | 是否展示关闭图标 |
Expand All @@ -34,8 +33,7 @@ toc: false
| duration | number || 300 | 过渡动画时长,单位毫秒 |
| position | 'center' &verbar; 'top' &verbar; 'bottom' &verbar; 'left' &verbar; 'right' || 'center' | 弹窗布局 |
| zIndex | number || 998 | 弹窗层级 |


| className | string || - | 类名 |

## 事件

Expand Down Expand Up @@ -63,13 +61,13 @@ toc: false

<style>
table th:first-of-type { width: 180px; }
.__dumi-default-layout-content article table:first-of-type th:nth-of-type(2) {
width: 140px
.__dumi-default-layout-content article table:first-of-type th:nth-of-type(2) {
width: 140px;
}
.__dumi-default-layout-content article table:first-of-type th:nth-of-type(3) {
width: 30px
.__dumi-default-layout-content article table:first-of-type th:nth-of-type(3) {
width: 30px;
}
.__dumi-default-layout-content article table:first-of-type th:nth-of-type(4) {
width: 110px
.__dumi-default-layout-content article table:first-of-type th:nth-of-type(4) {
width: 110px;
}
</style>

0 comments on commit a59ec63

Please sign in to comment.