@tuya-miniapp/smart-ui 2.3.4-beta-3 → 2.3.4-beta-5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/common/appLog.js +1 -1
- package/dist/common/utils.d.ts +1 -0
- package/dist/common/utils.js +5 -0
- package/dist/dialog/index.css +1 -1
- package/dist/dialog/index.wxml +1 -1
- package/dist/dialog/index.wxss +1 -1
- package/dist/goods-action-button/index.css +1 -1
- package/dist/goods-action-button/index.wxss +1 -1
- package/dist/picker/index.wxml +1 -0
- package/dist/picker-column/index.js +12 -0
- package/dist/popup/index.js +2 -3
- package/dist/tab/index.js +8 -0
- package/dist/tabbar/index.js +1 -1
- package/dist/tabs/index.css +1 -1
- package/dist/tabs/index.js +6 -1
- package/dist/tabs/index.wxml +4 -1
- package/dist/tabs/index.wxss +1 -1
- package/dist/toast/index.css +1 -1
- package/dist/toast/index.wxml +2 -2
- package/dist/toast/index.wxss +1 -1
- package/lib/common/appLog.js +1 -1
- package/lib/common/utils.d.ts +1 -0
- package/lib/common/utils.js +7 -1
- package/lib/dialog/index.css +1 -1
- package/lib/dialog/index.wxml +1 -1
- package/lib/dialog/index.wxss +1 -1
- package/lib/goods-action-button/index.css +1 -1
- package/lib/goods-action-button/index.wxss +1 -1
- package/lib/picker/index.wxml +1 -0
- package/lib/picker-column/index.js +12 -0
- package/lib/popup/index.js +1 -2
- package/lib/tab/index.js +8 -0
- package/lib/tabbar/index.js +1 -1
- package/lib/tabs/index.css +1 -1
- package/lib/tabs/index.js +6 -1
- package/lib/tabs/index.wxml +4 -1
- package/lib/tabs/index.wxss +1 -1
- package/lib/toast/index.css +1 -1
- package/lib/toast/index.wxml +2 -2
- package/lib/toast/index.wxss +1 -1
- package/package.json +2 -1
package/dist/common/appLog.js
CHANGED
package/dist/common/utils.d.ts
CHANGED
@@ -19,3 +19,4 @@ export declare function getCurrentPage<T>(): T & WechatMiniprogram.OptionalInter
|
|
19
19
|
export declare const isPC: boolean;
|
20
20
|
export declare const isWxWork: boolean;
|
21
21
|
export declare function replacePlaceholders(template: any, values: any): any;
|
22
|
+
export declare function getSafeBottomOffset(): number;
|
package/dist/common/utils.js
CHANGED
@@ -93,3 +93,8 @@ export function replacePlaceholders(template, values) {
|
|
93
93
|
return values[key] || match; // 如果在values中找到key对应的值,则替换;否则保留原样
|
94
94
|
});
|
95
95
|
}
|
96
|
+
export function getSafeBottomOffset() {
|
97
|
+
const { safeArea, screenHeight, statusBarHeight } = getSystemInfoSync() || {};
|
98
|
+
const bottomSafeHeight = screenHeight - (safeArea === null || safeArea === void 0 ? void 0 : safeArea.height) - statusBarHeight;
|
99
|
+
return bottomSafeHeight;
|
100
|
+
}
|
package/dist/dialog/index.css
CHANGED
@@ -1 +1 @@
|
|
1
|
-
@import '../common/index.css';.smart-dialog{background-color:var(--dialog-background-color,var(--app-B4,#fff));border-radius:var(--dialog-border-radius,16px);font-size:var(--dialog-font-size,16px);overflow:hidden;top:45%!important;width:var(--dialog-width,311px)}@media (max-width:321px){.smart-dialog{width:var(--dialog-small-screen-width,90%)}}.smart-dialog__header{color:var(--dialog-header-font-color,var(--app-B4-N1,#000));font-weight:var(--dialog-header-font-weight,400);line-height:var(--dialog-header-line-height,24px);padding-top:var(--dialog-header-padding-top,24px);text-align:center}.smart-dialog__header-icon{border-radius:100%;display:block;font-size:var(--dialog-header-icon-size,39px);height:var(--dialog-header-icon-size,39px);margin:auto auto 12px;width:var(--dialog-header-icon-size,39px)}.smart-dialog__header--isolated{padding:var(--dialog-header-isolated-padding,24px 0)}.smart-dialog__message{-webkit-overflow-scrolling:touch;color:var(--dialog-message-text-color,var(--app-B4-N1,#000));font-size:var(--dialog-message-font-size,16px);line-height:var(--dialog-message-line-height,20px);max-height:var(--dialog-message-max-height,60vh);overflow-y:auto;padding:var(--dialog-message-padding,24px);text-align:center}.smart-dialog__message-text{word-wrap:break-word}.smart-dialog__message--hasTitle{color:var(--dialog-has-title-message-text-color,var(--app-B4-N3,rgba(0,0,0,.5)));font-size:var(--dialog-has-title-message-font-size,14px);padding-top:var(--dialog-has-title-message-padding-top,8px)}.smart-dialog__message--round-button{padding-bottom:16px}.smart-dialog__message--left{text-align:left}.smart-dialog__message--right{text-align:right}.smart-dialog__message--justify{text-align:justify}.smart-dialog__input{background-color:var(--dialog-input-background-color,var(--app-B4-N9,rgba(0,0,0,.05)));border-radius:var(--dialog-input-border-radius,10px);font-size:var(--dialog-input-font-size,14px);height:var(--dialog-input-height,40px);margin:var(--dialog-input-margin,0 16px 24px);padding:var(--dialog-input-padding,0 10px)}.smart-dialog__footer{display:flex}.smart-dialog__footer--round-button{height:40px!important;padding:8px 20px 16px!important;position:relative!important}.smart-dialog__button{flex:1}.smart-dialog__cancel,.smart-dialog__confirm{border:0!important;border-radius:0!important}.smart-dialog-bounce-enter{opacity:0;transform:translate3d(-50%,-50%,0) scale(.7)}.smart-dialog-bounce-leave-active{opacity:0;transform:translate3d(-50%,-50%,0) scale(.9)}
|
1
|
+
@import '../common/index.css';.smart-dialog{background-color:var(--dialog-background-color,var(--app-B4,#fff));border-radius:var(--dialog-border-radius,16px);font-size:var(--dialog-font-size,16px);overflow:hidden;top:45%!important;width:var(--dialog-width,311px)}@media (max-width:321px){.smart-dialog{width:var(--dialog-small-screen-width,90%)}}.smart-dialog__header{color:var(--dialog-header-font-color,var(--app-B4-N1,#000));font-weight:var(--dialog-header-font-weight,400);line-height:var(--dialog-header-line-height,24px);padding:var(--dialog-header-padding,0);padding-top:var(--dialog-header-padding-top,24px);text-align:center}.smart-dialog__header-icon{border-radius:100%;display:block;font-size:var(--dialog-header-icon-size,39px);height:var(--dialog-header-icon-size,39px);margin:auto auto 12px;width:var(--dialog-header-icon-size,39px)}.smart-dialog__header--isolated{padding:var(--dialog-header-isolated-padding,24px 0)}.smart-dialog__message{-webkit-overflow-scrolling:touch;color:var(--dialog-message-text-color,var(--app-B4-N1,#000));font-size:var(--dialog-message-font-size,16px);line-height:var(--dialog-message-line-height,20px);max-height:var(--dialog-message-max-height,60vh);overflow-y:auto;padding:var(--dialog-message-padding,24px);text-align:center}.smart-dialog__message-text{word-wrap:break-word}.smart-dialog__message--hasTitle{color:var(--dialog-has-title-message-text-color,var(--app-B4-N3,rgba(0,0,0,.5)));font-size:var(--dialog-has-title-message-font-size,14px);padding-top:var(--dialog-has-title-message-padding-top,8px)}.smart-dialog__message--round-button{padding-bottom:16px}.smart-dialog__message--left{text-align:left}.smart-dialog__message--right{text-align:right}.smart-dialog__message--justify{text-align:justify}.smart-dialog__input{background-color:var(--dialog-input-background-color,var(--app-B4-N9,rgba(0,0,0,.05)));border-radius:var(--dialog-input-border-radius,10px);font-size:var(--dialog-input-font-size,14px);height:var(--dialog-input-height,40px);margin:var(--dialog-input-margin,0 16px 24px);padding:var(--dialog-input-padding,0 10px)}.smart-dialog__footer{display:flex}.smart-dialog__footer--round-button{height:40px!important;padding:8px 20px 16px!important;position:relative!important}.smart-dialog__button{flex:1}.smart-dialog__cancel,.smart-dialog__confirm{border:0!important;border-radius:0!important}.smart-dialog-bounce-enter{opacity:0;transform:translate3d(-50%,-50%,0) scale(.7)}.smart-dialog-bounce-leave-active{opacity:0;transform:translate3d(-50%,-50%,0) scale(.9)}.smart-dialog--round-button .smart-dialog__cancel,.smart-dialog--round-button .smart-dialog__confirm{border-radius:var(--smart-dialog--round-button-border-radius,20px)!important}
|
package/dist/dialog/index.wxml
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
z-index="{{ zIndex }}"
|
6
6
|
overlay="{{ overlay }}"
|
7
7
|
transition="{{ transition }}"
|
8
|
-
custom-class="smart-dialog smart-dialog--{{ theme }}{{ className }} custom-class"
|
8
|
+
custom-class="smart-dialog smart-dialog--{{ theme }} {{ className }} custom-class"
|
9
9
|
custom-style="width: {{ utils.addUnit(width) }};{{ customStyle }}"
|
10
10
|
overlay-style="{{ overlayStyle }}"
|
11
11
|
close-on-click-overlay="{{ closeOnClickOverlay }}"
|
package/dist/dialog/index.wxss
CHANGED
@@ -1 +1 @@
|
|
1
|
-
@import '../common/index.wxss';.smart-dialog{background-color:var(--dialog-background-color,var(--app-B4,#fff));border-radius:var(--dialog-border-radius,16px);font-size:var(--dialog-font-size,16px);overflow:hidden;top:45%!important;width:var(--dialog-width,311px)}@media (max-width:321px){.smart-dialog{width:var(--dialog-small-screen-width,90%)}}.smart-dialog__header{color:var(--dialog-header-font-color,var(--app-B4-N1,#000));font-weight:var(--dialog-header-font-weight,400);line-height:var(--dialog-header-line-height,24px);padding-top:var(--dialog-header-padding-top,24px);text-align:center}.smart-dialog__header-icon{border-radius:100%;display:block;font-size:var(--dialog-header-icon-size,39px);height:var(--dialog-header-icon-size,39px);margin:auto auto 12px;width:var(--dialog-header-icon-size,39px)}.smart-dialog__header--isolated{padding:var(--dialog-header-isolated-padding,24px 0)}.smart-dialog__message{-webkit-overflow-scrolling:touch;color:var(--dialog-message-text-color,var(--app-B4-N1,#000));font-size:var(--dialog-message-font-size,16px);line-height:var(--dialog-message-line-height,20px);max-height:var(--dialog-message-max-height,60vh);overflow-y:auto;padding:var(--dialog-message-padding,24px);text-align:center}.smart-dialog__message-text{word-wrap:break-word}.smart-dialog__message--hasTitle{color:var(--dialog-has-title-message-text-color,var(--app-B4-N3,rgba(0,0,0,.5)));font-size:var(--dialog-has-title-message-font-size,14px);padding-top:var(--dialog-has-title-message-padding-top,8px)}.smart-dialog__message--round-button{padding-bottom:16px}.smart-dialog__message--left{text-align:left}.smart-dialog__message--right{text-align:right}.smart-dialog__message--justify{text-align:justify}.smart-dialog__input{background-color:var(--dialog-input-background-color,var(--app-B4-N9,rgba(0,0,0,.05)));border-radius:var(--dialog-input-border-radius,10px);font-size:var(--dialog-input-font-size,14px);height:var(--dialog-input-height,40px);margin:var(--dialog-input-margin,0 16px 24px);padding:var(--dialog-input-padding,0 10px)}.smart-dialog__footer{display:flex}.smart-dialog__footer--round-button{height:40px!important;padding:8px 20px 16px!important;position:relative!important}.smart-dialog__button{flex:1}.smart-dialog__cancel,.smart-dialog__confirm{border:0!important;border-radius:0!important}.smart-dialog-bounce-enter{opacity:0;transform:translate3d(-50%,-50%,0) scale(.7)}.smart-dialog-bounce-leave-active{opacity:0;transform:translate3d(-50%,-50%,0) scale(.9)}
|
1
|
+
@import '../common/index.wxss';.smart-dialog{background-color:var(--dialog-background-color,var(--app-B4,#fff));border-radius:var(--dialog-border-radius,16px);font-size:var(--dialog-font-size,16px);overflow:hidden;top:45%!important;width:var(--dialog-width,311px)}@media (max-width:321px){.smart-dialog{width:var(--dialog-small-screen-width,90%)}}.smart-dialog__header{color:var(--dialog-header-font-color,var(--app-B4-N1,#000));font-weight:var(--dialog-header-font-weight,400);line-height:var(--dialog-header-line-height,24px);padding:var(--dialog-header-padding,0);padding-top:var(--dialog-header-padding-top,24px);text-align:center}.smart-dialog__header-icon{border-radius:100%;display:block;font-size:var(--dialog-header-icon-size,39px);height:var(--dialog-header-icon-size,39px);margin:auto auto 12px;width:var(--dialog-header-icon-size,39px)}.smart-dialog__header--isolated{padding:var(--dialog-header-isolated-padding,24px 0)}.smart-dialog__message{-webkit-overflow-scrolling:touch;color:var(--dialog-message-text-color,var(--app-B4-N1,#000));font-size:var(--dialog-message-font-size,16px);line-height:var(--dialog-message-line-height,20px);max-height:var(--dialog-message-max-height,60vh);overflow-y:auto;padding:var(--dialog-message-padding,24px);text-align:center}.smart-dialog__message-text{word-wrap:break-word}.smart-dialog__message--hasTitle{color:var(--dialog-has-title-message-text-color,var(--app-B4-N3,rgba(0,0,0,.5)));font-size:var(--dialog-has-title-message-font-size,14px);padding-top:var(--dialog-has-title-message-padding-top,8px)}.smart-dialog__message--round-button{padding-bottom:16px}.smart-dialog__message--left{text-align:left}.smart-dialog__message--right{text-align:right}.smart-dialog__message--justify{text-align:justify}.smart-dialog__input{background-color:var(--dialog-input-background-color,var(--app-B4-N9,rgba(0,0,0,.05)));border-radius:var(--dialog-input-border-radius,10px);font-size:var(--dialog-input-font-size,14px);height:var(--dialog-input-height,40px);margin:var(--dialog-input-margin,0 16px 24px);padding:var(--dialog-input-padding,0 10px)}.smart-dialog__footer{display:flex}.smart-dialog__footer--round-button{height:40px!important;padding:8px 20px 16px!important;position:relative!important}.smart-dialog__button{flex:1}.smart-dialog__cancel,.smart-dialog__confirm{border:0!important;border-radius:0!important}.smart-dialog-bounce-enter{opacity:0;transform:translate3d(-50%,-50%,0) scale(.7)}.smart-dialog-bounce-leave-active{opacity:0;transform:translate3d(-50%,-50%,0) scale(.9)}.smart-dialog--round-button .smart-dialog__cancel,.smart-dialog--round-button .smart-dialog__confirm{border-radius:var(--smart-dialog--round-button-border-radius,20px)!important}
|
@@ -1 +1 @@
|
|
1
|
-
@import '../common/index.css';:host{flex:1}.smart-goods-action-button{--button-warning-background-color:var(--goods-action-button-warning-color,linear-gradient(to right,#ffd01e,#ff8917));--button-danger-background-color:var(--goods-action-button-danger-color,linear-gradient(to right,#ff6034,#ee0a24));--button-default-height:var(--goods-action-button-height,40px);--button-line-height:var(--goods-action-button-line-height,20px);--button-plain-background-color:var(--goods-action-button-plain-color,var(--app-B4,#fff));--button-border-width:0;display:block}.smart-goods-action-button--first{--button-border-radius:999px 0 0 var(--goods-action-button-border-radius,999px);margin-left:5px}.smart-goods-action-button--last{--button-border-radius:0 999px var(--goods-action-button-border-radius,999px) 0;margin-right:5px}.smart-goods-action-button--first.smart-goods-action-button--last{--button-border-radius:var(--goods-action-button-border-radius,999px)}.smart-goods-action-button--plain{--button-border-width:1px}.smart-goods-action-button__inner{font-weight:var(--font-weight-bold,500)!important;width:100%}@media (max-width:321px){.smart-goods-action-button{font-size:13px}}
|
1
|
+
@import '../common/index.css';:host{flex:1}.smart-goods-action-button{--button-warning-background-color:var(--goods-action-button-warning-color,linear-gradient(to right,#ffd01e,#ff8917));--button-danger-background-color:var(--goods-action-button-danger-color,linear-gradient(to right,#ff6034,#ee0a24));--button-default-height:var(--goods-action-button-height,40px);--button-line-height:var(--goods-action-button-line-height,20px);--button-plain-background-color:var(--goods-action-button-plain-color,var(--app-B4,#fff));--button-border-width:0;display:block}.smart-goods-action-button--first{--button-border-radius:var(--goods-action-button-border-radius,999px) 0 0 var(--goods-action-button-border-radius,999px);margin-left:5px}.smart-goods-action-button--last{--button-border-radius:0 var(--goods-action-button-border-radius,999px) var(--goods-action-button-border-radius,999px) 0;margin-right:5px}.smart-goods-action-button--first.smart-goods-action-button--last{--button-border-radius:var(--goods-action-button-border-radius,999px)}.smart-goods-action-button--plain{--button-border-width:1px}.smart-goods-action-button__inner{font-weight:var(--font-weight-bold,500)!important;width:100%}@media (max-width:321px){.smart-goods-action-button{font-size:13px}}
|
@@ -1 +1 @@
|
|
1
|
-
@import '../common/index.wxss';:host{flex:1}.smart-goods-action-button{--button-warning-background-color:var(--goods-action-button-warning-color,linear-gradient(to right,#ffd01e,#ff8917));--button-danger-background-color:var(--goods-action-button-danger-color,linear-gradient(to right,#ff6034,#ee0a24));--button-default-height:var(--goods-action-button-height,40px);--button-line-height:var(--goods-action-button-line-height,20px);--button-plain-background-color:var(--goods-action-button-plain-color,var(--app-B4,#fff));--button-border-width:0;display:block}.smart-goods-action-button--first{--button-border-radius:999px 0 0 var(--goods-action-button-border-radius,999px);margin-left:5px}.smart-goods-action-button--last{--button-border-radius:0 999px var(--goods-action-button-border-radius,999px) 0;margin-right:5px}.smart-goods-action-button--first.smart-goods-action-button--last{--button-border-radius:var(--goods-action-button-border-radius,999px)}.smart-goods-action-button--plain{--button-border-width:1px}.smart-goods-action-button__inner{font-weight:var(--font-weight-bold,500)!important;width:100%}@media (max-width:321px){.smart-goods-action-button{font-size:13px}}
|
1
|
+
@import '../common/index.wxss';:host{flex:1}.smart-goods-action-button{--button-warning-background-color:var(--goods-action-button-warning-color,linear-gradient(to right,#ffd01e,#ff8917));--button-danger-background-color:var(--goods-action-button-danger-color,linear-gradient(to right,#ff6034,#ee0a24));--button-default-height:var(--goods-action-button-height,40px);--button-line-height:var(--goods-action-button-line-height,20px);--button-plain-background-color:var(--goods-action-button-plain-color,var(--app-B4,#fff));--button-border-width:0;display:block}.smart-goods-action-button--first{--button-border-radius:var(--goods-action-button-border-radius,999px) 0 0 var(--goods-action-button-border-radius,999px);margin-left:5px}.smart-goods-action-button--last{--button-border-radius:0 var(--goods-action-button-border-radius,999px) var(--goods-action-button-border-radius,999px) 0;margin-right:5px}.smart-goods-action-button--first.smart-goods-action-button--last{--button-border-radius:var(--goods-action-button-border-radius,999px)}.smart-goods-action-button--plain{--button-border-width:1px}.smart-goods-action-button__inner{font-weight:var(--font-weight-bold,500)!important;width:100%}@media (max-width:321px){.smart-goods-action-button{font-size:13px}}
|
package/dist/picker/index.wxml
CHANGED
@@ -22,6 +22,7 @@
|
|
22
22
|
style="order: {{ item.order }}; {{ computed.style(item.style) }}"
|
23
23
|
active-style="{{ activeStyle }}"
|
24
24
|
options="{{ item.values }}"
|
25
|
+
disabled="{{ item.disabled }}"
|
25
26
|
unit="{{ item.unit || unit }}"
|
26
27
|
changeAnimation="{{ changeAnimation }}"
|
27
28
|
default-index="{{ item.defaultIndex || defaultIndex }}"
|
@@ -17,6 +17,7 @@ SmartComponent({
|
|
17
17
|
valueKey: String,
|
18
18
|
className: String,
|
19
19
|
itemHeight: Number,
|
20
|
+
disabled: Boolean,
|
20
21
|
visibleItemCount: Number,
|
21
22
|
activeStyle: {
|
22
23
|
type: String,
|
@@ -83,6 +84,9 @@ SmartComponent({
|
|
83
84
|
return this.data.options.length;
|
84
85
|
},
|
85
86
|
onTouchStart(event) {
|
87
|
+
if (this.data.disabled) {
|
88
|
+
return;
|
89
|
+
}
|
86
90
|
if (this.data.timer) {
|
87
91
|
clearTimeout(this.data.timer);
|
88
92
|
this.setData({
|
@@ -102,6 +106,9 @@ SmartComponent({
|
|
102
106
|
});
|
103
107
|
},
|
104
108
|
onTouchMove(event) {
|
109
|
+
if (this.data.disabled) {
|
110
|
+
return;
|
111
|
+
}
|
105
112
|
const { data } = this;
|
106
113
|
const { preOffsetList } = data;
|
107
114
|
const deltaY = event.touches[0].clientY - data.startY;
|
@@ -131,6 +138,9 @@ SmartComponent({
|
|
131
138
|
onTouchEnd() {
|
132
139
|
return __awaiter(this, void 0, void 0, function* () {
|
133
140
|
const { data } = this;
|
141
|
+
if (data.disabled) {
|
142
|
+
return;
|
143
|
+
}
|
134
144
|
const { preOffsetList } = data;
|
135
145
|
let preOffset = Math.max(Math.abs(preOffsetList[preOffsetList.length - 3] - preOffsetList[preOffsetList.length - 4]), Math.abs(preOffsetList[preOffsetList.length - 2] - preOffsetList[preOffsetList.length - 3]), Math.abs(preOffsetList[preOffsetList.length - 1] - preOffsetList[preOffsetList.length - 2]));
|
136
146
|
if (isNaN(preOffset))
|
@@ -223,6 +233,8 @@ SmartComponent({
|
|
223
233
|
}, time / count - 20);
|
224
234
|
},
|
225
235
|
onClickItem(event) {
|
236
|
+
if (this.data.disabled)
|
237
|
+
return;
|
226
238
|
const { index } = event.currentTarget.dataset;
|
227
239
|
if (index === this.data.currentIndex || index < 0 || index > this.data.options.length - 1) {
|
228
240
|
return;
|
package/dist/popup/index.js
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
import closeIcon from '@tuya-miniapp/icons/dist/svg/Xmark';
|
2
2
|
import { SmartComponent } from '../common/component';
|
3
3
|
import { transition } from '../mixins/transition';
|
4
|
-
import {
|
5
|
-
const { safeArea, screenHeight, statusBarHeight } = getSystemInfoSync() || {};
|
4
|
+
import { getSafeBottomOffset } from '../common/utils';
|
6
5
|
SmartComponent({
|
7
6
|
classes: [
|
8
7
|
'enter-class',
|
@@ -80,7 +79,7 @@ SmartComponent({
|
|
80
79
|
mounted() {
|
81
80
|
if (!this.data.safeAreaInsetBottom)
|
82
81
|
return;
|
83
|
-
const bottomSafeHeight =
|
82
|
+
const bottomSafeHeight = getSafeBottomOffset();
|
84
83
|
this.setData({
|
85
84
|
bottomSafeHeight: Math.max(bottomSafeHeight, this.data.safeAreaInsetBottomMin),
|
86
85
|
});
|
package/dist/tab/index.js
CHANGED
@@ -15,6 +15,10 @@ SmartComponent({
|
|
15
15
|
type: String,
|
16
16
|
observer: 'update',
|
17
17
|
},
|
18
|
+
subtitle: {
|
19
|
+
type: String,
|
20
|
+
observer: 'update',
|
21
|
+
},
|
18
22
|
disabled: {
|
19
23
|
type: Boolean,
|
20
24
|
observer: 'update',
|
@@ -23,6 +27,10 @@ SmartComponent({
|
|
23
27
|
type: String,
|
24
28
|
observer: 'update',
|
25
29
|
},
|
30
|
+
subTitleStyle: {
|
31
|
+
type: String,
|
32
|
+
observer: 'update',
|
33
|
+
},
|
26
34
|
name: {
|
27
35
|
type: null,
|
28
36
|
value: '',
|
package/dist/tabbar/index.js
CHANGED
package/dist/tabs/index.css
CHANGED
@@ -1 +1 @@
|
|
1
|
-
@import '../common/index.css';.smart-tabs{-webkit-tap-highlight-color:transparent;position:relative}.smart-tabs__wrap{display:flex;overflow:hidden}.smart-tabs__wrap--scrollable .smart-tab{flex:0 0 22%}.smart-tabs__wrap--scrollable .smart-tab--complete{flex:1 0 auto!important;padding:0 12px}.smart-tabs__wrap--scrollable .smart-tabs__nav--complete{padding-left:8px;padding-right:8px}.smart-tabs__scroll{background-color:var(--tabs-background-color,var(--app-B3,#fff));overflow:auto}.smart-tabs__scroll--line{box-sizing:initial;height:calc(100% + 15px)}.smart-tabs__scroll--card{background-color:var(--tabs-card-background-color,var(--app-B6-N9,rgba(0,0,0,.05)));border-radius:var(--tabs-card-border-radius,8px);box-sizing:border-box;padding:var(--tabs-card-padding,2px);width:100%}.smart-tabs__scroll::-webkit-scrollbar{display:none}.smart-tabs__nav{display:flex;position:relative;-webkit-user-select:none;user-select:none}.smart-tabs__nav--card{border-radius:var(--tabs-card-border-radius,8px);box-sizing:border-box;height:100%}.smart-tabs__nav--card .smart-tab{align-items:center;color:var(--tabs-card-text-color,var(--app-B6-N3,rgba(0,0,0,.5)));display:flex;justify-content:center}.smart-tabs__nav--card .smart-tab:last-child{border-right:none}.smart-tabs__nav--card .smart-tab.smart-tab--active{color:var(--tabs-card-text-active-color,var(--app-B6-N1,#000))}.smart-tabs__nav--card .smart-tab--disabled{color:var(--tab-disabled-text-color,var(--app-B6-N7,rgba(0,0,0,.1)))}.smart-tabs__line{background-color:var(--tabs-bottom-bar-color,var(--app-M4,#1989fa));border-radius:var(--tabs-bottom-bar-height,3px);bottom:0;height:var(--tabs-bottom-bar-height,3px);left:0;opacity:0;position:absolute;z-index:1}.smart-tabs__card-box{background-color:initial;height:100%;pointer-events:none;position:relative;width:100%}.smart-tabs__card{background-color:var(--tabs-card-active-background-color,var(--app-B3,#fff));border-radius:var(--tabs-card-active-border-radius,6px);height:100%;left:var(--tabs-card-active-left,0);opacity:0;position:absolute;top:var(--tabs-card-active-top,0);z-index:0}.smart-tabs__track{height:100%;position:relative;width:100%;z-index:1}.smart-tabs__track--animated{display:flex;transition-property:left}.smart-tabs__content{overflow:hidden}.smart-tabs--line{height:var(--tabs-line-height,32px)}.smart-tabs--card{height:var(--tabs-card-height,32px)}.smart-tab{box-sizing:border-box;color:var(--tabs-card-text-color,var(--app-B6-N3,rgba(0,0,0,.5)));cursor:pointer;flex:1;font-size:var(--tab-font-size,13px);line-height:var(--tabs-line-height,32px);min-width:0;position:relative;text-align:center}.smart-tab--active{color:var(--tabs-card-text-active-color,var(--app-B6-N1,#000));font-weight:var(--font-weight-bold,500)}.smart-tab--disabled{color:var(--tab-disabled-text-color,var(--app-B6-N7,rgba(0,0,0,.1)))}.smart-tab__title__info{position:relative!important;top:-1px!important;transform:translateX(0)!important}
|
1
|
+
@import '../common/index.css';.smart-tabs{-webkit-tap-highlight-color:transparent;position:relative}.smart-tabs__wrap{display:flex;overflow:hidden}.smart-tabs__wrap--scrollable .smart-tab{flex:0 0 22%}.smart-tabs__wrap--scrollable .smart-tab--complete{flex:1 0 auto!important;padding:0 12px}.smart-tabs__wrap--scrollable .smart-tabs__nav--complete{padding-left:8px;padding-right:8px}.smart-tabs__scroll{background-color:var(--tabs-background-color,var(--app-B3,#fff));overflow:auto}.smart-tabs__scroll--line{box-sizing:initial;height:calc(100% + 15px)}.smart-tabs__scroll--card{background-color:var(--tabs-card-background-color,var(--app-B6-N9,rgba(0,0,0,.05)));border-radius:var(--tabs-card-border-radius,8px);box-sizing:border-box;padding:var(--tabs-card-padding,2px);width:100%}.smart-tabs__scroll::-webkit-scrollbar{display:none}.smart-tabs__nav{display:flex;position:relative;-webkit-user-select:none;user-select:none}.smart-tabs__nav--card{border-radius:var(--tabs-card-border-radius,8px);box-sizing:border-box;height:100%}.smart-tabs__nav--card .smart-tab{align-items:center;color:var(--tabs-card-text-color,var(--app-B6-N3,rgba(0,0,0,.5)));display:flex;justify-content:center}.smart-tabs__nav--card .smart-tab:last-child{border-right:none}.smart-tabs__nav--card .smart-tab.smart-tab--active{color:var(--tabs-card-text-active-color,var(--app-B6-N1,#000))}.smart-tabs__nav--card .smart-tab--disabled{color:var(--tab-disabled-text-color,var(--app-B6-N7,rgba(0,0,0,.1)))}.smart-tabs__line{background-color:var(--tabs-bottom-bar-color,var(--app-M4,#1989fa));border-radius:var(--tabs-bottom-bar-height,3px);bottom:0;height:var(--tabs-bottom-bar-height,3px);left:0;opacity:0;position:absolute;z-index:1}.smart-tabs__card-box{background-color:initial;height:100%;pointer-events:none;position:relative;width:100%}.smart-tabs__card{background-color:var(--tabs-card-active-background-color,var(--app-B3,#fff));border-radius:var(--tabs-card-active-border-radius,6px);height:100%;left:var(--tabs-card-active-left,0);opacity:0;position:absolute;top:var(--tabs-card-active-top,0);z-index:0}.smart-tabs__track{height:100%;position:relative;width:100%;z-index:1}.smart-tabs__track--animated{display:flex;transition-property:left}.smart-tabs__content{overflow:hidden}.smart-tabs--line{height:var(--tabs-line-height,32px)}.smart-tabs--linesubtitle{height:var(--tabs-sub-line-height,64px)}.smart-tabs--card{height:var(--tabs-card-height,32px)}.smart-tab{box-sizing:border-box;color:var(--tabs-card-text-color,var(--app-B6-N3,rgba(0,0,0,.5)));cursor:pointer;flex:1;font-size:var(--tab-font-size,13px);line-height:var(--tabs-line-height,32px);min-width:0;position:relative;text-align:center}.smart-tab--active{color:var(--tabs-card-text-active-color,var(--app-B6-N1,#000));font-weight:var(--font-weight-bold,500)}.smart-tab--disabled{color:var(--tab-disabled-text-color,var(--app-B6-N7,rgba(0,0,0,.1)))}.smart-tab__title__info{position:relative!important;top:-1px!important;transform:translateX(0)!important}
|
package/dist/tabs/index.js
CHANGED
@@ -92,6 +92,7 @@ SmartComponent({
|
|
92
92
|
scrollWithAnimation: false,
|
93
93
|
lineOffsetLeft: 0,
|
94
94
|
inited: false,
|
95
|
+
hasSubTitle: false,
|
95
96
|
},
|
96
97
|
mounted() {
|
97
98
|
requestAnimationFrame(() => {
|
@@ -147,6 +148,7 @@ SmartComponent({
|
|
147
148
|
if (!isDef(currentIndex) || currentIndex >= children.length || currentIndex < 0) {
|
148
149
|
return;
|
149
150
|
}
|
151
|
+
let hasSubTitle = false;
|
150
152
|
groupSetData(this, () => {
|
151
153
|
const task = [];
|
152
154
|
children.forEach((item, index) => {
|
@@ -156,6 +158,9 @@ SmartComponent({
|
|
156
158
|
? task.push(() => item.updateRender(active, this))
|
157
159
|
: task.unshift(() => item.updateRender(active, this));
|
158
160
|
}
|
161
|
+
if (item.data.subtitle) {
|
162
|
+
hasSubTitle = true;
|
163
|
+
}
|
159
164
|
});
|
160
165
|
task.forEach(fun => fun());
|
161
166
|
});
|
@@ -166,7 +171,7 @@ SmartComponent({
|
|
166
171
|
return;
|
167
172
|
}
|
168
173
|
const shouldEmitChange = data.currentIndex !== null;
|
169
|
-
this.setData({ currentIndex });
|
174
|
+
this.setData({ currentIndex, hasSubTitle });
|
170
175
|
requestAnimationFrame(() => {
|
171
176
|
this.resize();
|
172
177
|
this.scrollIntoView();
|
package/dist/tabs/index.wxml
CHANGED
@@ -9,7 +9,7 @@
|
|
9
9
|
container="{{ container }}"
|
10
10
|
bind:scroll="onTouchScroll"
|
11
11
|
>
|
12
|
-
<view class="{{ utils.bem('tabs--') + type }} {{ utils.bem('tabs__wrap', { scrollable }) }} {{ type === 'line' && border ? 'smart-hairline--top-bottom' : '' }} wrap-class">
|
12
|
+
<view class="{{ utils.bem('tabs--') + type }} {{ utils.bem('tabs__wrap', { scrollable }) }} {{ type === 'line' && border ? 'smart-hairline--top-bottom' : '' }} {{ hasSubTitle ? 'smart-tabs--linesubtitle' : '' }} wrap-class">
|
13
13
|
<slot name="nav-left" />
|
14
14
|
|
15
15
|
<scroll-view
|
@@ -39,6 +39,9 @@
|
|
39
39
|
custom-class="smart-tab__title__info"
|
40
40
|
/>
|
41
41
|
</view>
|
42
|
+
<view wx:if="{{!!item.subtitle}}" class="{{ ellipsis ? 'smart-ellipsis' : '' }}" style="{{ item.subTitleStyle }}">
|
43
|
+
{{ item.subtitle }}
|
44
|
+
</view>
|
42
45
|
</view>
|
43
46
|
</view>
|
44
47
|
</scroll-view>
|
package/dist/tabs/index.wxss
CHANGED
@@ -1 +1 @@
|
|
1
|
-
@import '../common/index.wxss';.smart-tabs{-webkit-tap-highlight-color:transparent;position:relative}.smart-tabs__wrap{display:flex;overflow:hidden}.smart-tabs__wrap--scrollable .smart-tab{flex:0 0 22%}.smart-tabs__wrap--scrollable .smart-tab--complete{flex:1 0 auto!important;padding:0 12px}.smart-tabs__wrap--scrollable .smart-tabs__nav--complete{padding-left:8px;padding-right:8px}.smart-tabs__scroll{background-color:var(--tabs-background-color,var(--app-B3,#fff));overflow:auto}.smart-tabs__scroll--line{box-sizing:initial;height:calc(100% + 15px)}.smart-tabs__scroll--card{background-color:var(--tabs-card-background-color,var(--app-B6-N9,rgba(0,0,0,.05)));border-radius:var(--tabs-card-border-radius,8px);box-sizing:border-box;padding:var(--tabs-card-padding,2px);width:100%}.smart-tabs__scroll::-webkit-scrollbar{display:none}.smart-tabs__nav{display:flex;position:relative;-webkit-user-select:none;user-select:none}.smart-tabs__nav--card{border-radius:var(--tabs-card-border-radius,8px);box-sizing:border-box;height:100%}.smart-tabs__nav--card .smart-tab{align-items:center;color:var(--tabs-card-text-color,var(--app-B6-N3,rgba(0,0,0,.5)));display:flex;justify-content:center}.smart-tabs__nav--card .smart-tab:last-child{border-right:none}.smart-tabs__nav--card .smart-tab.smart-tab--active{color:var(--tabs-card-text-active-color,var(--app-B6-N1,#000))}.smart-tabs__nav--card .smart-tab--disabled{color:var(--tab-disabled-text-color,var(--app-B6-N7,rgba(0,0,0,.1)))}.smart-tabs__line{background-color:var(--tabs-bottom-bar-color,var(--app-M4,#1989fa));border-radius:var(--tabs-bottom-bar-height,3px);bottom:0;height:var(--tabs-bottom-bar-height,3px);left:0;opacity:0;position:absolute;z-index:1}.smart-tabs__card-box{background-color:initial;height:100%;pointer-events:none;position:relative;width:100%}.smart-tabs__card{background-color:var(--tabs-card-active-background-color,var(--app-B3,#fff));border-radius:var(--tabs-card-active-border-radius,6px);height:100%;left:var(--tabs-card-active-left,0);opacity:0;position:absolute;top:var(--tabs-card-active-top,0);z-index:0}.smart-tabs__track{height:100%;position:relative;width:100%;z-index:1}.smart-tabs__track--animated{display:flex;transition-property:left}.smart-tabs__content{overflow:hidden}.smart-tabs--line{height:var(--tabs-line-height,32px)}.smart-tabs--card{height:var(--tabs-card-height,32px)}.smart-tab{box-sizing:border-box;color:var(--tabs-card-text-color,var(--app-B6-N3,rgba(0,0,0,.5)));cursor:pointer;flex:1;font-size:var(--tab-font-size,13px);line-height:var(--tabs-line-height,32px);min-width:0;position:relative;text-align:center}.smart-tab--active{color:var(--tabs-card-text-active-color,var(--app-B6-N1,#000));font-weight:var(--font-weight-bold,500)}.smart-tab--disabled{color:var(--tab-disabled-text-color,var(--app-B6-N7,rgba(0,0,0,.1)))}.smart-tab__title__info{position:relative!important;top:-1px!important;transform:translateX(0)!important}
|
1
|
+
@import '../common/index.wxss';.smart-tabs{-webkit-tap-highlight-color:transparent;position:relative}.smart-tabs__wrap{display:flex;overflow:hidden}.smart-tabs__wrap--scrollable .smart-tab{flex:0 0 22%}.smart-tabs__wrap--scrollable .smart-tab--complete{flex:1 0 auto!important;padding:0 12px}.smart-tabs__wrap--scrollable .smart-tabs__nav--complete{padding-left:8px;padding-right:8px}.smart-tabs__scroll{background-color:var(--tabs-background-color,var(--app-B3,#fff));overflow:auto}.smart-tabs__scroll--line{box-sizing:initial;height:calc(100% + 15px)}.smart-tabs__scroll--card{background-color:var(--tabs-card-background-color,var(--app-B6-N9,rgba(0,0,0,.05)));border-radius:var(--tabs-card-border-radius,8px);box-sizing:border-box;padding:var(--tabs-card-padding,2px);width:100%}.smart-tabs__scroll::-webkit-scrollbar{display:none}.smart-tabs__nav{display:flex;position:relative;-webkit-user-select:none;user-select:none}.smart-tabs__nav--card{border-radius:var(--tabs-card-border-radius,8px);box-sizing:border-box;height:100%}.smart-tabs__nav--card .smart-tab{align-items:center;color:var(--tabs-card-text-color,var(--app-B6-N3,rgba(0,0,0,.5)));display:flex;justify-content:center}.smart-tabs__nav--card .smart-tab:last-child{border-right:none}.smart-tabs__nav--card .smart-tab.smart-tab--active{color:var(--tabs-card-text-active-color,var(--app-B6-N1,#000))}.smart-tabs__nav--card .smart-tab--disabled{color:var(--tab-disabled-text-color,var(--app-B6-N7,rgba(0,0,0,.1)))}.smart-tabs__line{background-color:var(--tabs-bottom-bar-color,var(--app-M4,#1989fa));border-radius:var(--tabs-bottom-bar-height,3px);bottom:0;height:var(--tabs-bottom-bar-height,3px);left:0;opacity:0;position:absolute;z-index:1}.smart-tabs__card-box{background-color:initial;height:100%;pointer-events:none;position:relative;width:100%}.smart-tabs__card{background-color:var(--tabs-card-active-background-color,var(--app-B3,#fff));border-radius:var(--tabs-card-active-border-radius,6px);height:100%;left:var(--tabs-card-active-left,0);opacity:0;position:absolute;top:var(--tabs-card-active-top,0);z-index:0}.smart-tabs__track{height:100%;position:relative;width:100%;z-index:1}.smart-tabs__track--animated{display:flex;transition-property:left}.smart-tabs__content{overflow:hidden}.smart-tabs--line{height:var(--tabs-line-height,32px)}.smart-tabs--linesubtitle{height:var(--tabs-sub-line-height,64px)}.smart-tabs--card{height:var(--tabs-card-height,32px)}.smart-tab{box-sizing:border-box;color:var(--tabs-card-text-color,var(--app-B6-N3,rgba(0,0,0,.5)));cursor:pointer;flex:1;font-size:var(--tab-font-size,13px);line-height:var(--tabs-line-height,32px);min-width:0;position:relative;text-align:center}.smart-tab--active{color:var(--tabs-card-text-active-color,var(--app-B6-N1,#000));font-weight:var(--font-weight-bold,500)}.smart-tab--disabled{color:var(--tab-disabled-text-color,var(--app-B6-N7,rgba(0,0,0,.1)))}.smart-tab__title__info{position:relative!important;top:-1px!important;transform:translateX(0)!important}
|
package/dist/toast/index.css
CHANGED
@@ -1 +1 @@
|
|
1
|
-
@import '../common/index.css';.smart-toast{word-wrap:break-word;align-items:center;background-color:var(--toast-background-color,rgba(0,0,0,.7));border-radius:var(--toast-border-radius,10px);box-sizing:initial;color:var(--toast-text-color,#fff);display:flex;flex-direction:column;font-size:var(--toast-font-size,14px);justify-content:center;line-height:var(--toast-line-height,20px);white-space:pre-wrap}.smart-toast__container{left:50%;max-width:var(--toast-max-width,70%);position:fixed;top:50%;transform:translate(-50%,-50%);width:-webkit-fit-content;width:fit-content}.smart-toast--text{min-width:var(--toast-text-min-width,96px);padding:var(--toast-text-padding,8px 12px)}.smart-toast--icon{min-height:var(--toast-default-min-height,88px);padding:var(--toast-default-padding,16px);width:var(--toast-default-width,88px)}.smart-toast--icon .smart-toast__icon{font-size:var(--toast-icon-size,36px)}.smart-toast--icon .smart-toast__text{padding-top:8px}.smart-toast__loading{margin:10px 0}.smart-toast--top{transform:translateY(-30vh)}.smart-toast--bottom{transform:translateY(30vh)}
|
1
|
+
@import '../common/index.css';.smart-toast{word-wrap:break-word;align-items:center;background-color:var(--toast-background-color,rgba(0,0,0,.7));border-radius:var(--toast-border-radius,10px);box-sizing:initial;color:var(--toast-text-color,#fff);display:flex;flex-direction:column;font-size:var(--toast-font-size,14px);justify-content:center;line-height:var(--toast-line-height,20px);white-space:pre-wrap}.smart-toast__container{left:50%;max-width:var(--toast-max-width,70%);position:fixed;top:50%;transform:translate(-50%,-50%);width:-webkit-fit-content;width:fit-content}.smart-toast--text{min-width:var(--toast-text-min-width,96px);padding:var(--toast-text-padding,8px 12px)}.smart-toast--icon{min-height:var(--toast-default-min-height,88px);padding:var(--toast-default-padding,16px);width:var(--toast-default-width,88px)}.smart-toast--icon .smart-toast__icon{font-size:var(--toast-icon-size,36px)}.smart-toast--icon .smart-toast__text{padding-top:8px}.smart-toast__loading{margin:10px 0}.smart-toast--top{transform:translateY(-30vh) translate(-50%,-50%)}.smart-toast--bottom{transform:translateY(30vh) translate(-50%,-50%)}
|
package/dist/toast/index.wxml
CHANGED
@@ -7,10 +7,10 @@
|
|
7
7
|
<smart-transition
|
8
8
|
show="{{ show }}"
|
9
9
|
custom-style="z-index: {{ zIndex }}"
|
10
|
-
custom-class="smart-toast__container"
|
10
|
+
custom-class="smart-toast__container smart-toast--{{ position }}"
|
11
11
|
>
|
12
12
|
<view
|
13
|
-
class="smart-toast smart-toast--{{ (type === 'text' || type === 'html') ? 'text' : 'icon' }}
|
13
|
+
class="smart-toast smart-toast--{{ (type === 'text' || type === 'html') ? 'text' : 'icon' }}"
|
14
14
|
catch:touchmove="noop"
|
15
15
|
style="{{ width ? ('width: ' + width + 'px') : '' }}"
|
16
16
|
>
|
package/dist/toast/index.wxss
CHANGED
@@ -1 +1 @@
|
|
1
|
-
@import '../common/index.wxss';.smart-toast{word-wrap:break-word;align-items:center;background-color:var(--toast-background-color,rgba(0,0,0,.7));border-radius:var(--toast-border-radius,10px);box-sizing:initial;color:var(--toast-text-color,#fff);display:flex;flex-direction:column;font-size:var(--toast-font-size,14px);justify-content:center;line-height:var(--toast-line-height,20px);white-space:pre-wrap}.smart-toast__container{left:50%;max-width:var(--toast-max-width,70%);position:fixed;top:50%;transform:translate(-50%,-50%);width:-webkit-fit-content;width:fit-content}.smart-toast--text{min-width:var(--toast-text-min-width,96px);padding:var(--toast-text-padding,8px 12px)}.smart-toast--icon{min-height:var(--toast-default-min-height,88px);padding:var(--toast-default-padding,16px);width:var(--toast-default-width,88px)}.smart-toast--icon .smart-toast__icon{font-size:var(--toast-icon-size,36px)}.smart-toast--icon .smart-toast__text{padding-top:8px}.smart-toast__loading{margin:10px 0}.smart-toast--top{transform:translateY(-30vh)}.smart-toast--bottom{transform:translateY(30vh)}
|
1
|
+
@import '../common/index.wxss';.smart-toast{word-wrap:break-word;align-items:center;background-color:var(--toast-background-color,rgba(0,0,0,.7));border-radius:var(--toast-border-radius,10px);box-sizing:initial;color:var(--toast-text-color,#fff);display:flex;flex-direction:column;font-size:var(--toast-font-size,14px);justify-content:center;line-height:var(--toast-line-height,20px);white-space:pre-wrap}.smart-toast__container{left:50%;max-width:var(--toast-max-width,70%);position:fixed;top:50%;transform:translate(-50%,-50%);width:-webkit-fit-content;width:fit-content}.smart-toast--text{min-width:var(--toast-text-min-width,96px);padding:var(--toast-text-padding,8px 12px)}.smart-toast--icon{min-height:var(--toast-default-min-height,88px);padding:var(--toast-default-padding,16px);width:var(--toast-default-width,88px)}.smart-toast--icon .smart-toast__icon{font-size:var(--toast-icon-size,36px)}.smart-toast--icon .smart-toast__text{padding-top:8px}.smart-toast__loading{margin:10px 0}.smart-toast--top{transform:translateY(-30vh) translate(-50%,-50%)}.smart-toast--bottom{transform:translateY(30vh) translate(-50%,-50%)}
|
package/lib/common/appLog.js
CHANGED
package/lib/common/utils.d.ts
CHANGED
@@ -19,3 +19,4 @@ export declare function getCurrentPage<T>(): T & WechatMiniprogram.OptionalInter
|
|
19
19
|
export declare const isPC: boolean;
|
20
20
|
export declare const isWxWork: boolean;
|
21
21
|
export declare function replacePlaceholders(template: any, values: any): any;
|
22
|
+
export declare function getSafeBottomOffset(): number;
|
package/lib/common/utils.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.replacePlaceholders = exports.isWxWork = exports.isPC = exports.getCurrentPage = exports.clamp = exports.addNumber = exports.toPromise = exports.groupSetData = exports.getAllRect = exports.getRect = exports.pickExclude = exports.requestAnimationFrame = exports.addUnit = exports.nextTick = exports.range = exports.getSystemInfoSync = exports.isDef = void 0;
|
3
|
+
exports.getSafeBottomOffset = exports.replacePlaceholders = exports.isWxWork = exports.isPC = exports.getCurrentPage = exports.clamp = exports.addNumber = exports.toPromise = exports.groupSetData = exports.getAllRect = exports.getRect = exports.pickExclude = exports.requestAnimationFrame = exports.addUnit = exports.nextTick = exports.range = exports.getSystemInfoSync = exports.isDef = void 0;
|
4
4
|
var validator_1 = require("./validator");
|
5
5
|
var version_1 = require("./version");
|
6
6
|
var validator_2 = require("./validator");
|
@@ -117,3 +117,9 @@ function replacePlaceholders(template, values) {
|
|
117
117
|
});
|
118
118
|
}
|
119
119
|
exports.replacePlaceholders = replacePlaceholders;
|
120
|
+
function getSafeBottomOffset() {
|
121
|
+
var _a = (0, version_1.getSystemInfoSync)() || {}, safeArea = _a.safeArea, screenHeight = _a.screenHeight, statusBarHeight = _a.statusBarHeight;
|
122
|
+
var bottomSafeHeight = screenHeight - (safeArea === null || safeArea === void 0 ? void 0 : safeArea.height) - statusBarHeight;
|
123
|
+
return bottomSafeHeight;
|
124
|
+
}
|
125
|
+
exports.getSafeBottomOffset = getSafeBottomOffset;
|
package/lib/dialog/index.css
CHANGED
@@ -1 +1 @@
|
|
1
|
-
@import '../common/index.css';.smart-dialog{background-color:var(--dialog-background-color,var(--app-B4,#fff));border-radius:var(--dialog-border-radius,16px);font-size:var(--dialog-font-size,16px);overflow:hidden;top:45%!important;width:var(--dialog-width,311px)}@media (max-width:321px){.smart-dialog{width:var(--dialog-small-screen-width,90%)}}.smart-dialog__header{color:var(--dialog-header-font-color,var(--app-B4-N1,#000));font-weight:var(--dialog-header-font-weight,400);line-height:var(--dialog-header-line-height,24px);padding-top:var(--dialog-header-padding-top,24px);text-align:center}.smart-dialog__header-icon{border-radius:100%;display:block;font-size:var(--dialog-header-icon-size,39px);height:var(--dialog-header-icon-size,39px);margin:auto auto 12px;width:var(--dialog-header-icon-size,39px)}.smart-dialog__header--isolated{padding:var(--dialog-header-isolated-padding,24px 0)}.smart-dialog__message{-webkit-overflow-scrolling:touch;color:var(--dialog-message-text-color,var(--app-B4-N1,#000));font-size:var(--dialog-message-font-size,16px);line-height:var(--dialog-message-line-height,20px);max-height:var(--dialog-message-max-height,60vh);overflow-y:auto;padding:var(--dialog-message-padding,24px);text-align:center}.smart-dialog__message-text{word-wrap:break-word}.smart-dialog__message--hasTitle{color:var(--dialog-has-title-message-text-color,var(--app-B4-N3,rgba(0,0,0,.5)));font-size:var(--dialog-has-title-message-font-size,14px);padding-top:var(--dialog-has-title-message-padding-top,8px)}.smart-dialog__message--round-button{padding-bottom:16px}.smart-dialog__message--left{text-align:left}.smart-dialog__message--right{text-align:right}.smart-dialog__message--justify{text-align:justify}.smart-dialog__input{background-color:var(--dialog-input-background-color,var(--app-B4-N9,rgba(0,0,0,.05)));border-radius:var(--dialog-input-border-radius,10px);font-size:var(--dialog-input-font-size,14px);height:var(--dialog-input-height,40px);margin:var(--dialog-input-margin,0 16px 24px);padding:var(--dialog-input-padding,0 10px)}.smart-dialog__footer{display:flex}.smart-dialog__footer--round-button{height:40px!important;padding:8px 20px 16px!important;position:relative!important}.smart-dialog__button{flex:1}.smart-dialog__cancel,.smart-dialog__confirm{border:0!important;border-radius:0!important}.smart-dialog-bounce-enter{opacity:0;transform:translate3d(-50%,-50%,0) scale(.7)}.smart-dialog-bounce-leave-active{opacity:0;transform:translate3d(-50%,-50%,0) scale(.9)}
|
1
|
+
@import '../common/index.css';.smart-dialog{background-color:var(--dialog-background-color,var(--app-B4,#fff));border-radius:var(--dialog-border-radius,16px);font-size:var(--dialog-font-size,16px);overflow:hidden;top:45%!important;width:var(--dialog-width,311px)}@media (max-width:321px){.smart-dialog{width:var(--dialog-small-screen-width,90%)}}.smart-dialog__header{color:var(--dialog-header-font-color,var(--app-B4-N1,#000));font-weight:var(--dialog-header-font-weight,400);line-height:var(--dialog-header-line-height,24px);padding:var(--dialog-header-padding,0);padding-top:var(--dialog-header-padding-top,24px);text-align:center}.smart-dialog__header-icon{border-radius:100%;display:block;font-size:var(--dialog-header-icon-size,39px);height:var(--dialog-header-icon-size,39px);margin:auto auto 12px;width:var(--dialog-header-icon-size,39px)}.smart-dialog__header--isolated{padding:var(--dialog-header-isolated-padding,24px 0)}.smart-dialog__message{-webkit-overflow-scrolling:touch;color:var(--dialog-message-text-color,var(--app-B4-N1,#000));font-size:var(--dialog-message-font-size,16px);line-height:var(--dialog-message-line-height,20px);max-height:var(--dialog-message-max-height,60vh);overflow-y:auto;padding:var(--dialog-message-padding,24px);text-align:center}.smart-dialog__message-text{word-wrap:break-word}.smart-dialog__message--hasTitle{color:var(--dialog-has-title-message-text-color,var(--app-B4-N3,rgba(0,0,0,.5)));font-size:var(--dialog-has-title-message-font-size,14px);padding-top:var(--dialog-has-title-message-padding-top,8px)}.smart-dialog__message--round-button{padding-bottom:16px}.smart-dialog__message--left{text-align:left}.smart-dialog__message--right{text-align:right}.smart-dialog__message--justify{text-align:justify}.smart-dialog__input{background-color:var(--dialog-input-background-color,var(--app-B4-N9,rgba(0,0,0,.05)));border-radius:var(--dialog-input-border-radius,10px);font-size:var(--dialog-input-font-size,14px);height:var(--dialog-input-height,40px);margin:var(--dialog-input-margin,0 16px 24px);padding:var(--dialog-input-padding,0 10px)}.smart-dialog__footer{display:flex}.smart-dialog__footer--round-button{height:40px!important;padding:8px 20px 16px!important;position:relative!important}.smart-dialog__button{flex:1}.smart-dialog__cancel,.smart-dialog__confirm{border:0!important;border-radius:0!important}.smart-dialog-bounce-enter{opacity:0;transform:translate3d(-50%,-50%,0) scale(.7)}.smart-dialog-bounce-leave-active{opacity:0;transform:translate3d(-50%,-50%,0) scale(.9)}.smart-dialog--round-button .smart-dialog__cancel,.smart-dialog--round-button .smart-dialog__confirm{border-radius:var(--smart-dialog--round-button-border-radius,20px)!important}
|
package/lib/dialog/index.wxml
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
z-index="{{ zIndex }}"
|
6
6
|
overlay="{{ overlay }}"
|
7
7
|
transition="{{ transition }}"
|
8
|
-
custom-class="smart-dialog smart-dialog--{{ theme }}{{ className }} custom-class"
|
8
|
+
custom-class="smart-dialog smart-dialog--{{ theme }} {{ className }} custom-class"
|
9
9
|
custom-style="width: {{ utils.addUnit(width) }};{{ customStyle }}"
|
10
10
|
overlay-style="{{ overlayStyle }}"
|
11
11
|
close-on-click-overlay="{{ closeOnClickOverlay }}"
|
package/lib/dialog/index.wxss
CHANGED
@@ -1 +1 @@
|
|
1
|
-
@import '../common/index.wxss';.smart-dialog{background-color:var(--dialog-background-color,var(--app-B4,#fff));border-radius:var(--dialog-border-radius,16px);font-size:var(--dialog-font-size,16px);overflow:hidden;top:45%!important;width:var(--dialog-width,311px)}@media (max-width:321px){.smart-dialog{width:var(--dialog-small-screen-width,90%)}}.smart-dialog__header{color:var(--dialog-header-font-color,var(--app-B4-N1,#000));font-weight:var(--dialog-header-font-weight,400);line-height:var(--dialog-header-line-height,24px);padding-top:var(--dialog-header-padding-top,24px);text-align:center}.smart-dialog__header-icon{border-radius:100%;display:block;font-size:var(--dialog-header-icon-size,39px);height:var(--dialog-header-icon-size,39px);margin:auto auto 12px;width:var(--dialog-header-icon-size,39px)}.smart-dialog__header--isolated{padding:var(--dialog-header-isolated-padding,24px 0)}.smart-dialog__message{-webkit-overflow-scrolling:touch;color:var(--dialog-message-text-color,var(--app-B4-N1,#000));font-size:var(--dialog-message-font-size,16px);line-height:var(--dialog-message-line-height,20px);max-height:var(--dialog-message-max-height,60vh);overflow-y:auto;padding:var(--dialog-message-padding,24px);text-align:center}.smart-dialog__message-text{word-wrap:break-word}.smart-dialog__message--hasTitle{color:var(--dialog-has-title-message-text-color,var(--app-B4-N3,rgba(0,0,0,.5)));font-size:var(--dialog-has-title-message-font-size,14px);padding-top:var(--dialog-has-title-message-padding-top,8px)}.smart-dialog__message--round-button{padding-bottom:16px}.smart-dialog__message--left{text-align:left}.smart-dialog__message--right{text-align:right}.smart-dialog__message--justify{text-align:justify}.smart-dialog__input{background-color:var(--dialog-input-background-color,var(--app-B4-N9,rgba(0,0,0,.05)));border-radius:var(--dialog-input-border-radius,10px);font-size:var(--dialog-input-font-size,14px);height:var(--dialog-input-height,40px);margin:var(--dialog-input-margin,0 16px 24px);padding:var(--dialog-input-padding,0 10px)}.smart-dialog__footer{display:flex}.smart-dialog__footer--round-button{height:40px!important;padding:8px 20px 16px!important;position:relative!important}.smart-dialog__button{flex:1}.smart-dialog__cancel,.smart-dialog__confirm{border:0!important;border-radius:0!important}.smart-dialog-bounce-enter{opacity:0;transform:translate3d(-50%,-50%,0) scale(.7)}.smart-dialog-bounce-leave-active{opacity:0;transform:translate3d(-50%,-50%,0) scale(.9)}
|
1
|
+
@import '../common/index.wxss';.smart-dialog{background-color:var(--dialog-background-color,var(--app-B4,#fff));border-radius:var(--dialog-border-radius,16px);font-size:var(--dialog-font-size,16px);overflow:hidden;top:45%!important;width:var(--dialog-width,311px)}@media (max-width:321px){.smart-dialog{width:var(--dialog-small-screen-width,90%)}}.smart-dialog__header{color:var(--dialog-header-font-color,var(--app-B4-N1,#000));font-weight:var(--dialog-header-font-weight,400);line-height:var(--dialog-header-line-height,24px);padding:var(--dialog-header-padding,0);padding-top:var(--dialog-header-padding-top,24px);text-align:center}.smart-dialog__header-icon{border-radius:100%;display:block;font-size:var(--dialog-header-icon-size,39px);height:var(--dialog-header-icon-size,39px);margin:auto auto 12px;width:var(--dialog-header-icon-size,39px)}.smart-dialog__header--isolated{padding:var(--dialog-header-isolated-padding,24px 0)}.smart-dialog__message{-webkit-overflow-scrolling:touch;color:var(--dialog-message-text-color,var(--app-B4-N1,#000));font-size:var(--dialog-message-font-size,16px);line-height:var(--dialog-message-line-height,20px);max-height:var(--dialog-message-max-height,60vh);overflow-y:auto;padding:var(--dialog-message-padding,24px);text-align:center}.smart-dialog__message-text{word-wrap:break-word}.smart-dialog__message--hasTitle{color:var(--dialog-has-title-message-text-color,var(--app-B4-N3,rgba(0,0,0,.5)));font-size:var(--dialog-has-title-message-font-size,14px);padding-top:var(--dialog-has-title-message-padding-top,8px)}.smart-dialog__message--round-button{padding-bottom:16px}.smart-dialog__message--left{text-align:left}.smart-dialog__message--right{text-align:right}.smart-dialog__message--justify{text-align:justify}.smart-dialog__input{background-color:var(--dialog-input-background-color,var(--app-B4-N9,rgba(0,0,0,.05)));border-radius:var(--dialog-input-border-radius,10px);font-size:var(--dialog-input-font-size,14px);height:var(--dialog-input-height,40px);margin:var(--dialog-input-margin,0 16px 24px);padding:var(--dialog-input-padding,0 10px)}.smart-dialog__footer{display:flex}.smart-dialog__footer--round-button{height:40px!important;padding:8px 20px 16px!important;position:relative!important}.smart-dialog__button{flex:1}.smart-dialog__cancel,.smart-dialog__confirm{border:0!important;border-radius:0!important}.smart-dialog-bounce-enter{opacity:0;transform:translate3d(-50%,-50%,0) scale(.7)}.smart-dialog-bounce-leave-active{opacity:0;transform:translate3d(-50%,-50%,0) scale(.9)}.smart-dialog--round-button .smart-dialog__cancel,.smart-dialog--round-button .smart-dialog__confirm{border-radius:var(--smart-dialog--round-button-border-radius,20px)!important}
|
@@ -1 +1 @@
|
|
1
|
-
@import '../common/index.css';:host{flex:1}.smart-goods-action-button{--button-warning-background-color:var(--goods-action-button-warning-color,linear-gradient(to right,#ffd01e,#ff8917));--button-danger-background-color:var(--goods-action-button-danger-color,linear-gradient(to right,#ff6034,#ee0a24));--button-default-height:var(--goods-action-button-height,40px);--button-line-height:var(--goods-action-button-line-height,20px);--button-plain-background-color:var(--goods-action-button-plain-color,var(--app-B4,#fff));--button-border-width:0;display:block}.smart-goods-action-button--first{--button-border-radius:999px 0 0 var(--goods-action-button-border-radius,999px);margin-left:5px}.smart-goods-action-button--last{--button-border-radius:0 999px var(--goods-action-button-border-radius,999px) 0;margin-right:5px}.smart-goods-action-button--first.smart-goods-action-button--last{--button-border-radius:var(--goods-action-button-border-radius,999px)}.smart-goods-action-button--plain{--button-border-width:1px}.smart-goods-action-button__inner{font-weight:var(--font-weight-bold,500)!important;width:100%}@media (max-width:321px){.smart-goods-action-button{font-size:13px}}
|
1
|
+
@import '../common/index.css';:host{flex:1}.smart-goods-action-button{--button-warning-background-color:var(--goods-action-button-warning-color,linear-gradient(to right,#ffd01e,#ff8917));--button-danger-background-color:var(--goods-action-button-danger-color,linear-gradient(to right,#ff6034,#ee0a24));--button-default-height:var(--goods-action-button-height,40px);--button-line-height:var(--goods-action-button-line-height,20px);--button-plain-background-color:var(--goods-action-button-plain-color,var(--app-B4,#fff));--button-border-width:0;display:block}.smart-goods-action-button--first{--button-border-radius:var(--goods-action-button-border-radius,999px) 0 0 var(--goods-action-button-border-radius,999px);margin-left:5px}.smart-goods-action-button--last{--button-border-radius:0 var(--goods-action-button-border-radius,999px) var(--goods-action-button-border-radius,999px) 0;margin-right:5px}.smart-goods-action-button--first.smart-goods-action-button--last{--button-border-radius:var(--goods-action-button-border-radius,999px)}.smart-goods-action-button--plain{--button-border-width:1px}.smart-goods-action-button__inner{font-weight:var(--font-weight-bold,500)!important;width:100%}@media (max-width:321px){.smart-goods-action-button{font-size:13px}}
|
@@ -1 +1 @@
|
|
1
|
-
@import '../common/index.wxss';:host{flex:1}.smart-goods-action-button{--button-warning-background-color:var(--goods-action-button-warning-color,linear-gradient(to right,#ffd01e,#ff8917));--button-danger-background-color:var(--goods-action-button-danger-color,linear-gradient(to right,#ff6034,#ee0a24));--button-default-height:var(--goods-action-button-height,40px);--button-line-height:var(--goods-action-button-line-height,20px);--button-plain-background-color:var(--goods-action-button-plain-color,var(--app-B4,#fff));--button-border-width:0;display:block}.smart-goods-action-button--first{--button-border-radius:999px 0 0 var(--goods-action-button-border-radius,999px);margin-left:5px}.smart-goods-action-button--last{--button-border-radius:0 999px var(--goods-action-button-border-radius,999px) 0;margin-right:5px}.smart-goods-action-button--first.smart-goods-action-button--last{--button-border-radius:var(--goods-action-button-border-radius,999px)}.smart-goods-action-button--plain{--button-border-width:1px}.smart-goods-action-button__inner{font-weight:var(--font-weight-bold,500)!important;width:100%}@media (max-width:321px){.smart-goods-action-button{font-size:13px}}
|
1
|
+
@import '../common/index.wxss';:host{flex:1}.smart-goods-action-button{--button-warning-background-color:var(--goods-action-button-warning-color,linear-gradient(to right,#ffd01e,#ff8917));--button-danger-background-color:var(--goods-action-button-danger-color,linear-gradient(to right,#ff6034,#ee0a24));--button-default-height:var(--goods-action-button-height,40px);--button-line-height:var(--goods-action-button-line-height,20px);--button-plain-background-color:var(--goods-action-button-plain-color,var(--app-B4,#fff));--button-border-width:0;display:block}.smart-goods-action-button--first{--button-border-radius:var(--goods-action-button-border-radius,999px) 0 0 var(--goods-action-button-border-radius,999px);margin-left:5px}.smart-goods-action-button--last{--button-border-radius:0 var(--goods-action-button-border-radius,999px) var(--goods-action-button-border-radius,999px) 0;margin-right:5px}.smart-goods-action-button--first.smart-goods-action-button--last{--button-border-radius:var(--goods-action-button-border-radius,999px)}.smart-goods-action-button--plain{--button-border-width:1px}.smart-goods-action-button__inner{font-weight:var(--font-weight-bold,500)!important;width:100%}@media (max-width:321px){.smart-goods-action-button{font-size:13px}}
|
package/lib/picker/index.wxml
CHANGED
@@ -22,6 +22,7 @@
|
|
22
22
|
style="order: {{ item.order }}; {{ computed.style(item.style) }}"
|
23
23
|
active-style="{{ activeStyle }}"
|
24
24
|
options="{{ item.values }}"
|
25
|
+
disabled="{{ item.disabled }}"
|
25
26
|
unit="{{ item.unit || unit }}"
|
26
27
|
changeAnimation="{{ changeAnimation }}"
|
27
28
|
default-index="{{ item.defaultIndex || defaultIndex }}"
|
@@ -55,6 +55,7 @@ var DEFAULT_DURATION = 400;
|
|
55
55
|
valueKey: String,
|
56
56
|
className: String,
|
57
57
|
itemHeight: Number,
|
58
|
+
disabled: Boolean,
|
58
59
|
visibleItemCount: Number,
|
59
60
|
activeStyle: {
|
60
61
|
type: String,
|
@@ -121,6 +122,9 @@ var DEFAULT_DURATION = 400;
|
|
121
122
|
return this.data.options.length;
|
122
123
|
},
|
123
124
|
onTouchStart: function (event) {
|
125
|
+
if (this.data.disabled) {
|
126
|
+
return;
|
127
|
+
}
|
124
128
|
if (this.data.timer) {
|
125
129
|
clearTimeout(this.data.timer);
|
126
130
|
this.setData({
|
@@ -140,6 +144,9 @@ var DEFAULT_DURATION = 400;
|
|
140
144
|
});
|
141
145
|
},
|
142
146
|
onTouchMove: function (event) {
|
147
|
+
if (this.data.disabled) {
|
148
|
+
return;
|
149
|
+
}
|
143
150
|
var data = this.data;
|
144
151
|
var preOffsetList = data.preOffsetList;
|
145
152
|
var deltaY = event.touches[0].clientY - data.startY;
|
@@ -174,6 +181,9 @@ var DEFAULT_DURATION = 400;
|
|
174
181
|
switch (_a.label) {
|
175
182
|
case 0:
|
176
183
|
data = this.data;
|
184
|
+
if (data.disabled) {
|
185
|
+
return [2 /*return*/];
|
186
|
+
}
|
177
187
|
preOffsetList = data.preOffsetList;
|
178
188
|
preOffset = Math.max(Math.abs(preOffsetList[preOffsetList.length - 3] - preOffsetList[preOffsetList.length - 4]), Math.abs(preOffsetList[preOffsetList.length - 2] - preOffsetList[preOffsetList.length - 3]), Math.abs(preOffsetList[preOffsetList.length - 1] - preOffsetList[preOffsetList.length - 2]));
|
179
189
|
if (isNaN(preOffset))
|
@@ -262,6 +272,8 @@ var DEFAULT_DURATION = 400;
|
|
262
272
|
}, time / count - 20);
|
263
273
|
},
|
264
274
|
onClickItem: function (event) {
|
275
|
+
if (this.data.disabled)
|
276
|
+
return;
|
265
277
|
var index = event.currentTarget.dataset.index;
|
266
278
|
if (index === this.data.currentIndex || index < 0 || index > this.data.options.length - 1) {
|
267
279
|
return;
|
package/lib/popup/index.js
CHANGED
@@ -7,7 +7,6 @@ var Xmark_1 = __importDefault(require("@tuya-miniapp/icons/dist/svg/Xmark"));
|
|
7
7
|
var component_1 = require("../common/component");
|
8
8
|
var transition_1 = require("../mixins/transition");
|
9
9
|
var utils_1 = require("../common/utils");
|
10
|
-
var _a = (0, utils_1.getSystemInfoSync)() || {}, safeArea = _a.safeArea, screenHeight = _a.screenHeight, statusBarHeight = _a.statusBarHeight;
|
11
10
|
(0, component_1.SmartComponent)({
|
12
11
|
classes: [
|
13
12
|
'enter-class',
|
@@ -85,7 +84,7 @@ var _a = (0, utils_1.getSystemInfoSync)() || {}, safeArea = _a.safeArea, screenH
|
|
85
84
|
mounted: function () {
|
86
85
|
if (!this.data.safeAreaInsetBottom)
|
87
86
|
return;
|
88
|
-
var bottomSafeHeight =
|
87
|
+
var bottomSafeHeight = (0, utils_1.getSafeBottomOffset)();
|
89
88
|
this.setData({
|
90
89
|
bottomSafeHeight: Math.max(bottomSafeHeight, this.data.safeAreaInsetBottomMin),
|
91
90
|
});
|
package/lib/tab/index.js
CHANGED
@@ -17,6 +17,10 @@ var component_1 = require("../common/component");
|
|
17
17
|
type: String,
|
18
18
|
observer: 'update',
|
19
19
|
},
|
20
|
+
subtitle: {
|
21
|
+
type: String,
|
22
|
+
observer: 'update',
|
23
|
+
},
|
20
24
|
disabled: {
|
21
25
|
type: Boolean,
|
22
26
|
observer: 'update',
|
@@ -25,6 +29,10 @@ var component_1 = require("../common/component");
|
|
25
29
|
type: String,
|
26
30
|
observer: 'update',
|
27
31
|
},
|
32
|
+
subTitleStyle: {
|
33
|
+
type: String,
|
34
|
+
observer: 'update',
|
35
|
+
},
|
28
36
|
name: {
|
29
37
|
type: null,
|
30
38
|
value: '',
|
package/lib/tabbar/index.js
CHANGED
package/lib/tabs/index.css
CHANGED
@@ -1 +1 @@
|
|
1
|
-
@import '../common/index.css';.smart-tabs{-webkit-tap-highlight-color:transparent;position:relative}.smart-tabs__wrap{display:flex;overflow:hidden}.smart-tabs__wrap--scrollable .smart-tab{flex:0 0 22%}.smart-tabs__wrap--scrollable .smart-tab--complete{flex:1 0 auto!important;padding:0 12px}.smart-tabs__wrap--scrollable .smart-tabs__nav--complete{padding-left:8px;padding-right:8px}.smart-tabs__scroll{background-color:var(--tabs-background-color,var(--app-B3,#fff));overflow:auto}.smart-tabs__scroll--line{box-sizing:initial;height:calc(100% + 15px)}.smart-tabs__scroll--card{background-color:var(--tabs-card-background-color,var(--app-B6-N9,rgba(0,0,0,.05)));border-radius:var(--tabs-card-border-radius,8px);box-sizing:border-box;padding:var(--tabs-card-padding,2px);width:100%}.smart-tabs__scroll::-webkit-scrollbar{display:none}.smart-tabs__nav{display:flex;position:relative;-webkit-user-select:none;user-select:none}.smart-tabs__nav--card{border-radius:var(--tabs-card-border-radius,8px);box-sizing:border-box;height:100%}.smart-tabs__nav--card .smart-tab{align-items:center;color:var(--tabs-card-text-color,var(--app-B6-N3,rgba(0,0,0,.5)));display:flex;justify-content:center}.smart-tabs__nav--card .smart-tab:last-child{border-right:none}.smart-tabs__nav--card .smart-tab.smart-tab--active{color:var(--tabs-card-text-active-color,var(--app-B6-N1,#000))}.smart-tabs__nav--card .smart-tab--disabled{color:var(--tab-disabled-text-color,var(--app-B6-N7,rgba(0,0,0,.1)))}.smart-tabs__line{background-color:var(--tabs-bottom-bar-color,var(--app-M4,#1989fa));border-radius:var(--tabs-bottom-bar-height,3px);bottom:0;height:var(--tabs-bottom-bar-height,3px);left:0;opacity:0;position:absolute;z-index:1}.smart-tabs__card-box{background-color:initial;height:100%;pointer-events:none;position:relative;width:100%}.smart-tabs__card{background-color:var(--tabs-card-active-background-color,var(--app-B3,#fff));border-radius:var(--tabs-card-active-border-radius,6px);height:100%;left:var(--tabs-card-active-left,0);opacity:0;position:absolute;top:var(--tabs-card-active-top,0);z-index:0}.smart-tabs__track{height:100%;position:relative;width:100%;z-index:1}.smart-tabs__track--animated{display:flex;transition-property:left}.smart-tabs__content{overflow:hidden}.smart-tabs--line{height:var(--tabs-line-height,32px)}.smart-tabs--card{height:var(--tabs-card-height,32px)}.smart-tab{box-sizing:border-box;color:var(--tabs-card-text-color,var(--app-B6-N3,rgba(0,0,0,.5)));cursor:pointer;flex:1;font-size:var(--tab-font-size,13px);line-height:var(--tabs-line-height,32px);min-width:0;position:relative;text-align:center}.smart-tab--active{color:var(--tabs-card-text-active-color,var(--app-B6-N1,#000));font-weight:var(--font-weight-bold,500)}.smart-tab--disabled{color:var(--tab-disabled-text-color,var(--app-B6-N7,rgba(0,0,0,.1)))}.smart-tab__title__info{position:relative!important;top:-1px!important;transform:translateX(0)!important}
|
1
|
+
@import '../common/index.css';.smart-tabs{-webkit-tap-highlight-color:transparent;position:relative}.smart-tabs__wrap{display:flex;overflow:hidden}.smart-tabs__wrap--scrollable .smart-tab{flex:0 0 22%}.smart-tabs__wrap--scrollable .smart-tab--complete{flex:1 0 auto!important;padding:0 12px}.smart-tabs__wrap--scrollable .smart-tabs__nav--complete{padding-left:8px;padding-right:8px}.smart-tabs__scroll{background-color:var(--tabs-background-color,var(--app-B3,#fff));overflow:auto}.smart-tabs__scroll--line{box-sizing:initial;height:calc(100% + 15px)}.smart-tabs__scroll--card{background-color:var(--tabs-card-background-color,var(--app-B6-N9,rgba(0,0,0,.05)));border-radius:var(--tabs-card-border-radius,8px);box-sizing:border-box;padding:var(--tabs-card-padding,2px);width:100%}.smart-tabs__scroll::-webkit-scrollbar{display:none}.smart-tabs__nav{display:flex;position:relative;-webkit-user-select:none;user-select:none}.smart-tabs__nav--card{border-radius:var(--tabs-card-border-radius,8px);box-sizing:border-box;height:100%}.smart-tabs__nav--card .smart-tab{align-items:center;color:var(--tabs-card-text-color,var(--app-B6-N3,rgba(0,0,0,.5)));display:flex;justify-content:center}.smart-tabs__nav--card .smart-tab:last-child{border-right:none}.smart-tabs__nav--card .smart-tab.smart-tab--active{color:var(--tabs-card-text-active-color,var(--app-B6-N1,#000))}.smart-tabs__nav--card .smart-tab--disabled{color:var(--tab-disabled-text-color,var(--app-B6-N7,rgba(0,0,0,.1)))}.smart-tabs__line{background-color:var(--tabs-bottom-bar-color,var(--app-M4,#1989fa));border-radius:var(--tabs-bottom-bar-height,3px);bottom:0;height:var(--tabs-bottom-bar-height,3px);left:0;opacity:0;position:absolute;z-index:1}.smart-tabs__card-box{background-color:initial;height:100%;pointer-events:none;position:relative;width:100%}.smart-tabs__card{background-color:var(--tabs-card-active-background-color,var(--app-B3,#fff));border-radius:var(--tabs-card-active-border-radius,6px);height:100%;left:var(--tabs-card-active-left,0);opacity:0;position:absolute;top:var(--tabs-card-active-top,0);z-index:0}.smart-tabs__track{height:100%;position:relative;width:100%;z-index:1}.smart-tabs__track--animated{display:flex;transition-property:left}.smart-tabs__content{overflow:hidden}.smart-tabs--line{height:var(--tabs-line-height,32px)}.smart-tabs--linesubtitle{height:var(--tabs-sub-line-height,64px)}.smart-tabs--card{height:var(--tabs-card-height,32px)}.smart-tab{box-sizing:border-box;color:var(--tabs-card-text-color,var(--app-B6-N3,rgba(0,0,0,.5)));cursor:pointer;flex:1;font-size:var(--tab-font-size,13px);line-height:var(--tabs-line-height,32px);min-width:0;position:relative;text-align:center}.smart-tab--active{color:var(--tabs-card-text-active-color,var(--app-B6-N1,#000));font-weight:var(--font-weight-bold,500)}.smart-tab--disabled{color:var(--tab-disabled-text-color,var(--app-B6-N7,rgba(0,0,0,.1)))}.smart-tab__title__info{position:relative!important;top:-1px!important;transform:translateX(0)!important}
|
package/lib/tabs/index.js
CHANGED
@@ -108,6 +108,7 @@ var relation_1 = require("../common/relation");
|
|
108
108
|
scrollWithAnimation: false,
|
109
109
|
lineOffsetLeft: 0,
|
110
110
|
inited: false,
|
111
|
+
hasSubTitle: false,
|
111
112
|
},
|
112
113
|
mounted: function () {
|
113
114
|
var _this = this;
|
@@ -166,6 +167,7 @@ var relation_1 = require("../common/relation");
|
|
166
167
|
if (!(0, validator_1.isDef)(currentIndex) || currentIndex >= children.length || currentIndex < 0) {
|
167
168
|
return;
|
168
169
|
}
|
170
|
+
var hasSubTitle = false;
|
169
171
|
(0, utils_1.groupSetData)(this, function () {
|
170
172
|
var task = [];
|
171
173
|
children.forEach(function (item, index) {
|
@@ -175,6 +177,9 @@ var relation_1 = require("../common/relation");
|
|
175
177
|
? task.push(function () { return item.updateRender(active, _this); })
|
176
178
|
: task.unshift(function () { return item.updateRender(active, _this); });
|
177
179
|
}
|
180
|
+
if (item.data.subtitle) {
|
181
|
+
hasSubTitle = true;
|
182
|
+
}
|
178
183
|
});
|
179
184
|
task.forEach(function (fun) { return fun(); });
|
180
185
|
});
|
@@ -185,7 +190,7 @@ var relation_1 = require("../common/relation");
|
|
185
190
|
return;
|
186
191
|
}
|
187
192
|
var shouldEmitChange = data.currentIndex !== null;
|
188
|
-
this.setData({ currentIndex: currentIndex });
|
193
|
+
this.setData({ currentIndex: currentIndex, hasSubTitle: hasSubTitle });
|
189
194
|
(0, utils_1.requestAnimationFrame)(function () {
|
190
195
|
_this.resize();
|
191
196
|
_this.scrollIntoView();
|
package/lib/tabs/index.wxml
CHANGED
@@ -9,7 +9,7 @@
|
|
9
9
|
container="{{ container }}"
|
10
10
|
bind:scroll="onTouchScroll"
|
11
11
|
>
|
12
|
-
<view class="{{ utils.bem('tabs--') + type }} {{ utils.bem('tabs__wrap', { scrollable }) }} {{ type === 'line' && border ? 'smart-hairline--top-bottom' : '' }} wrap-class">
|
12
|
+
<view class="{{ utils.bem('tabs--') + type }} {{ utils.bem('tabs__wrap', { scrollable }) }} {{ type === 'line' && border ? 'smart-hairline--top-bottom' : '' }} {{ hasSubTitle ? 'smart-tabs--linesubtitle' : '' }} wrap-class">
|
13
13
|
<slot name="nav-left" />
|
14
14
|
|
15
15
|
<scroll-view
|
@@ -39,6 +39,9 @@
|
|
39
39
|
custom-class="smart-tab__title__info"
|
40
40
|
/>
|
41
41
|
</view>
|
42
|
+
<view wx:if="{{!!item.subtitle}}" class="{{ ellipsis ? 'smart-ellipsis' : '' }}" style="{{ item.subTitleStyle }}">
|
43
|
+
{{ item.subtitle }}
|
44
|
+
</view>
|
42
45
|
</view>
|
43
46
|
</view>
|
44
47
|
</scroll-view>
|
package/lib/tabs/index.wxss
CHANGED
@@ -1 +1 @@
|
|
1
|
-
@import '../common/index.wxss';.smart-tabs{-webkit-tap-highlight-color:transparent;position:relative}.smart-tabs__wrap{display:flex;overflow:hidden}.smart-tabs__wrap--scrollable .smart-tab{flex:0 0 22%}.smart-tabs__wrap--scrollable .smart-tab--complete{flex:1 0 auto!important;padding:0 12px}.smart-tabs__wrap--scrollable .smart-tabs__nav--complete{padding-left:8px;padding-right:8px}.smart-tabs__scroll{background-color:var(--tabs-background-color,var(--app-B3,#fff));overflow:auto}.smart-tabs__scroll--line{box-sizing:initial;height:calc(100% + 15px)}.smart-tabs__scroll--card{background-color:var(--tabs-card-background-color,var(--app-B6-N9,rgba(0,0,0,.05)));border-radius:var(--tabs-card-border-radius,8px);box-sizing:border-box;padding:var(--tabs-card-padding,2px);width:100%}.smart-tabs__scroll::-webkit-scrollbar{display:none}.smart-tabs__nav{display:flex;position:relative;-webkit-user-select:none;user-select:none}.smart-tabs__nav--card{border-radius:var(--tabs-card-border-radius,8px);box-sizing:border-box;height:100%}.smart-tabs__nav--card .smart-tab{align-items:center;color:var(--tabs-card-text-color,var(--app-B6-N3,rgba(0,0,0,.5)));display:flex;justify-content:center}.smart-tabs__nav--card .smart-tab:last-child{border-right:none}.smart-tabs__nav--card .smart-tab.smart-tab--active{color:var(--tabs-card-text-active-color,var(--app-B6-N1,#000))}.smart-tabs__nav--card .smart-tab--disabled{color:var(--tab-disabled-text-color,var(--app-B6-N7,rgba(0,0,0,.1)))}.smart-tabs__line{background-color:var(--tabs-bottom-bar-color,var(--app-M4,#1989fa));border-radius:var(--tabs-bottom-bar-height,3px);bottom:0;height:var(--tabs-bottom-bar-height,3px);left:0;opacity:0;position:absolute;z-index:1}.smart-tabs__card-box{background-color:initial;height:100%;pointer-events:none;position:relative;width:100%}.smart-tabs__card{background-color:var(--tabs-card-active-background-color,var(--app-B3,#fff));border-radius:var(--tabs-card-active-border-radius,6px);height:100%;left:var(--tabs-card-active-left,0);opacity:0;position:absolute;top:var(--tabs-card-active-top,0);z-index:0}.smart-tabs__track{height:100%;position:relative;width:100%;z-index:1}.smart-tabs__track--animated{display:flex;transition-property:left}.smart-tabs__content{overflow:hidden}.smart-tabs--line{height:var(--tabs-line-height,32px)}.smart-tabs--card{height:var(--tabs-card-height,32px)}.smart-tab{box-sizing:border-box;color:var(--tabs-card-text-color,var(--app-B6-N3,rgba(0,0,0,.5)));cursor:pointer;flex:1;font-size:var(--tab-font-size,13px);line-height:var(--tabs-line-height,32px);min-width:0;position:relative;text-align:center}.smart-tab--active{color:var(--tabs-card-text-active-color,var(--app-B6-N1,#000));font-weight:var(--font-weight-bold,500)}.smart-tab--disabled{color:var(--tab-disabled-text-color,var(--app-B6-N7,rgba(0,0,0,.1)))}.smart-tab__title__info{position:relative!important;top:-1px!important;transform:translateX(0)!important}
|
1
|
+
@import '../common/index.wxss';.smart-tabs{-webkit-tap-highlight-color:transparent;position:relative}.smart-tabs__wrap{display:flex;overflow:hidden}.smart-tabs__wrap--scrollable .smart-tab{flex:0 0 22%}.smart-tabs__wrap--scrollable .smart-tab--complete{flex:1 0 auto!important;padding:0 12px}.smart-tabs__wrap--scrollable .smart-tabs__nav--complete{padding-left:8px;padding-right:8px}.smart-tabs__scroll{background-color:var(--tabs-background-color,var(--app-B3,#fff));overflow:auto}.smart-tabs__scroll--line{box-sizing:initial;height:calc(100% + 15px)}.smart-tabs__scroll--card{background-color:var(--tabs-card-background-color,var(--app-B6-N9,rgba(0,0,0,.05)));border-radius:var(--tabs-card-border-radius,8px);box-sizing:border-box;padding:var(--tabs-card-padding,2px);width:100%}.smart-tabs__scroll::-webkit-scrollbar{display:none}.smart-tabs__nav{display:flex;position:relative;-webkit-user-select:none;user-select:none}.smart-tabs__nav--card{border-radius:var(--tabs-card-border-radius,8px);box-sizing:border-box;height:100%}.smart-tabs__nav--card .smart-tab{align-items:center;color:var(--tabs-card-text-color,var(--app-B6-N3,rgba(0,0,0,.5)));display:flex;justify-content:center}.smart-tabs__nav--card .smart-tab:last-child{border-right:none}.smart-tabs__nav--card .smart-tab.smart-tab--active{color:var(--tabs-card-text-active-color,var(--app-B6-N1,#000))}.smart-tabs__nav--card .smart-tab--disabled{color:var(--tab-disabled-text-color,var(--app-B6-N7,rgba(0,0,0,.1)))}.smart-tabs__line{background-color:var(--tabs-bottom-bar-color,var(--app-M4,#1989fa));border-radius:var(--tabs-bottom-bar-height,3px);bottom:0;height:var(--tabs-bottom-bar-height,3px);left:0;opacity:0;position:absolute;z-index:1}.smart-tabs__card-box{background-color:initial;height:100%;pointer-events:none;position:relative;width:100%}.smart-tabs__card{background-color:var(--tabs-card-active-background-color,var(--app-B3,#fff));border-radius:var(--tabs-card-active-border-radius,6px);height:100%;left:var(--tabs-card-active-left,0);opacity:0;position:absolute;top:var(--tabs-card-active-top,0);z-index:0}.smart-tabs__track{height:100%;position:relative;width:100%;z-index:1}.smart-tabs__track--animated{display:flex;transition-property:left}.smart-tabs__content{overflow:hidden}.smart-tabs--line{height:var(--tabs-line-height,32px)}.smart-tabs--linesubtitle{height:var(--tabs-sub-line-height,64px)}.smart-tabs--card{height:var(--tabs-card-height,32px)}.smart-tab{box-sizing:border-box;color:var(--tabs-card-text-color,var(--app-B6-N3,rgba(0,0,0,.5)));cursor:pointer;flex:1;font-size:var(--tab-font-size,13px);line-height:var(--tabs-line-height,32px);min-width:0;position:relative;text-align:center}.smart-tab--active{color:var(--tabs-card-text-active-color,var(--app-B6-N1,#000));font-weight:var(--font-weight-bold,500)}.smart-tab--disabled{color:var(--tab-disabled-text-color,var(--app-B6-N7,rgba(0,0,0,.1)))}.smart-tab__title__info{position:relative!important;top:-1px!important;transform:translateX(0)!important}
|
package/lib/toast/index.css
CHANGED
@@ -1 +1 @@
|
|
1
|
-
@import '../common/index.css';.smart-toast{word-wrap:break-word;align-items:center;background-color:var(--toast-background-color,rgba(0,0,0,.7));border-radius:var(--toast-border-radius,10px);box-sizing:initial;color:var(--toast-text-color,#fff);display:flex;flex-direction:column;font-size:var(--toast-font-size,14px);justify-content:center;line-height:var(--toast-line-height,20px);white-space:pre-wrap}.smart-toast__container{left:50%;max-width:var(--toast-max-width,70%);position:fixed;top:50%;transform:translate(-50%,-50%);width:-webkit-fit-content;width:fit-content}.smart-toast--text{min-width:var(--toast-text-min-width,96px);padding:var(--toast-text-padding,8px 12px)}.smart-toast--icon{min-height:var(--toast-default-min-height,88px);padding:var(--toast-default-padding,16px);width:var(--toast-default-width,88px)}.smart-toast--icon .smart-toast__icon{font-size:var(--toast-icon-size,36px)}.smart-toast--icon .smart-toast__text{padding-top:8px}.smart-toast__loading{margin:10px 0}.smart-toast--top{transform:translateY(-30vh)}.smart-toast--bottom{transform:translateY(30vh)}
|
1
|
+
@import '../common/index.css';.smart-toast{word-wrap:break-word;align-items:center;background-color:var(--toast-background-color,rgba(0,0,0,.7));border-radius:var(--toast-border-radius,10px);box-sizing:initial;color:var(--toast-text-color,#fff);display:flex;flex-direction:column;font-size:var(--toast-font-size,14px);justify-content:center;line-height:var(--toast-line-height,20px);white-space:pre-wrap}.smart-toast__container{left:50%;max-width:var(--toast-max-width,70%);position:fixed;top:50%;transform:translate(-50%,-50%);width:-webkit-fit-content;width:fit-content}.smart-toast--text{min-width:var(--toast-text-min-width,96px);padding:var(--toast-text-padding,8px 12px)}.smart-toast--icon{min-height:var(--toast-default-min-height,88px);padding:var(--toast-default-padding,16px);width:var(--toast-default-width,88px)}.smart-toast--icon .smart-toast__icon{font-size:var(--toast-icon-size,36px)}.smart-toast--icon .smart-toast__text{padding-top:8px}.smart-toast__loading{margin:10px 0}.smart-toast--top{transform:translateY(-30vh) translate(-50%,-50%)}.smart-toast--bottom{transform:translateY(30vh) translate(-50%,-50%)}
|
package/lib/toast/index.wxml
CHANGED
@@ -7,10 +7,10 @@
|
|
7
7
|
<smart-transition
|
8
8
|
show="{{ show }}"
|
9
9
|
custom-style="z-index: {{ zIndex }}"
|
10
|
-
custom-class="smart-toast__container"
|
10
|
+
custom-class="smart-toast__container smart-toast--{{ position }}"
|
11
11
|
>
|
12
12
|
<view
|
13
|
-
class="smart-toast smart-toast--{{ (type === 'text' || type === 'html') ? 'text' : 'icon' }}
|
13
|
+
class="smart-toast smart-toast--{{ (type === 'text' || type === 'html') ? 'text' : 'icon' }}"
|
14
14
|
catch:touchmove="noop"
|
15
15
|
style="{{ width ? ('width: ' + width + 'px') : '' }}"
|
16
16
|
>
|
package/lib/toast/index.wxss
CHANGED
@@ -1 +1 @@
|
|
1
|
-
@import '../common/index.wxss';.smart-toast{word-wrap:break-word;align-items:center;background-color:var(--toast-background-color,rgba(0,0,0,.7));border-radius:var(--toast-border-radius,10px);box-sizing:initial;color:var(--toast-text-color,#fff);display:flex;flex-direction:column;font-size:var(--toast-font-size,14px);justify-content:center;line-height:var(--toast-line-height,20px);white-space:pre-wrap}.smart-toast__container{left:50%;max-width:var(--toast-max-width,70%);position:fixed;top:50%;transform:translate(-50%,-50%);width:-webkit-fit-content;width:fit-content}.smart-toast--text{min-width:var(--toast-text-min-width,96px);padding:var(--toast-text-padding,8px 12px)}.smart-toast--icon{min-height:var(--toast-default-min-height,88px);padding:var(--toast-default-padding,16px);width:var(--toast-default-width,88px)}.smart-toast--icon .smart-toast__icon{font-size:var(--toast-icon-size,36px)}.smart-toast--icon .smart-toast__text{padding-top:8px}.smart-toast__loading{margin:10px 0}.smart-toast--top{transform:translateY(-30vh)}.smart-toast--bottom{transform:translateY(30vh)}
|
1
|
+
@import '../common/index.wxss';.smart-toast{word-wrap:break-word;align-items:center;background-color:var(--toast-background-color,rgba(0,0,0,.7));border-radius:var(--toast-border-radius,10px);box-sizing:initial;color:var(--toast-text-color,#fff);display:flex;flex-direction:column;font-size:var(--toast-font-size,14px);justify-content:center;line-height:var(--toast-line-height,20px);white-space:pre-wrap}.smart-toast__container{left:50%;max-width:var(--toast-max-width,70%);position:fixed;top:50%;transform:translate(-50%,-50%);width:-webkit-fit-content;width:fit-content}.smart-toast--text{min-width:var(--toast-text-min-width,96px);padding:var(--toast-text-padding,8px 12px)}.smart-toast--icon{min-height:var(--toast-default-min-height,88px);padding:var(--toast-default-padding,16px);width:var(--toast-default-width,88px)}.smart-toast--icon .smart-toast__icon{font-size:var(--toast-icon-size,36px)}.smart-toast--icon .smart-toast__text{padding-top:8px}.smart-toast__loading{margin:10px 0}.smart-toast--top{transform:translateY(-30vh) translate(-50%,-50%)}.smart-toast--bottom{transform:translateY(30vh) translate(-50%,-50%)}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@tuya-miniapp/smart-ui",
|
3
|
-
"version": "2.3.4-beta-
|
3
|
+
"version": "2.3.4-beta-5",
|
4
4
|
"author": "MiniApp Team",
|
5
5
|
"license": "MIT",
|
6
6
|
"miniprogram": "lib",
|
@@ -14,6 +14,7 @@
|
|
14
14
|
"release": "sh build/release.sh",
|
15
15
|
"build:icon": "yarn && node build/generate-icon/index.js",
|
16
16
|
"build": "yarn && MODE=build NODE_OPTIONS=--no-experimental-fetch npx gulp -f build/compiler.js --series buildEs buildLib buildExample",
|
17
|
+
"build:wx": "node build/wx.mjs",
|
17
18
|
"test": "jest",
|
18
19
|
"test:watch": "jest --watch",
|
19
20
|
"preMinipackBuild": "yarn && MODE=build NODE_OPTIONS=--no-experimental-fetch npx gulp -f build/compiler.js --series buildEs buildLib buildExample",
|