@tuya-miniapp/smart-ui 2.4.1-beta-4 → 2.5.0

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.
Files changed (51) hide show
  1. package/dist/bottom-sheet/index.css +1 -1
  2. package/dist/bottom-sheet/index.js +1 -0
  3. package/dist/bottom-sheet/index.wxml +3 -1
  4. package/dist/bottom-sheet/index.wxs +12 -0
  5. package/dist/bottom-sheet/index.wxss +1 -1
  6. package/dist/button/index.js +2 -7
  7. package/dist/calendar/index.wxs +3 -3
  8. package/dist/calendar-month/index.wxs +2 -2
  9. package/dist/circle/index.rjs +2 -1
  10. package/dist/common/appLog.js +1 -1
  11. package/dist/common/ty.d.ts +5 -0
  12. package/dist/common/ty.js +21 -0
  13. package/dist/dialog/index.css +1 -1
  14. package/dist/dialog/index.wxss +1 -1
  15. package/dist/image/index.wxs +1 -1
  16. package/dist/loading/index.wxs +2 -2
  17. package/dist/mixins/transition.js +4 -6
  18. package/dist/picker-column/index.js +1 -1
  19. package/dist/picker-column/index.wxs +4 -4
  20. package/dist/popup/index.wxs +1 -1
  21. package/dist/stepper/index.js +1 -1
  22. package/dist/switch/index.css +1 -1
  23. package/dist/switch/index.wxss +1 -1
  24. package/dist/toast/index.wxml +1 -1
  25. package/dist/toast/toast.js +4 -8
  26. package/lib/bottom-sheet/index.css +1 -1
  27. package/lib/bottom-sheet/index.js +1 -0
  28. package/lib/bottom-sheet/index.wxml +3 -1
  29. package/lib/bottom-sheet/index.wxs +12 -0
  30. package/lib/bottom-sheet/index.wxss +1 -1
  31. package/lib/button/index.js +2 -7
  32. package/lib/calendar/index.wxs +3 -3
  33. package/lib/calendar-month/index.wxs +2 -2
  34. package/lib/circle/index.rjs +2 -1
  35. package/lib/common/appLog.js +1 -1
  36. package/lib/common/ty.d.ts +5 -0
  37. package/lib/common/ty.js +23 -0
  38. package/lib/dialog/index.css +1 -1
  39. package/lib/dialog/index.wxss +1 -1
  40. package/lib/image/index.wxs +1 -1
  41. package/lib/loading/index.wxs +2 -2
  42. package/lib/mixins/transition.js +11 -10
  43. package/lib/picker-column/index.js +5 -2
  44. package/lib/picker-column/index.wxs +4 -4
  45. package/lib/popup/index.wxs +1 -1
  46. package/lib/stepper/index.js +2 -2
  47. package/lib/switch/index.css +1 -1
  48. package/lib/switch/index.wxss +1 -1
  49. package/lib/toast/index.wxml +1 -1
  50. package/lib/toast/toast.js +4 -8
  51. package/package.json +1 -1
@@ -1 +1 @@
1
- @import '../common/index.css';.smart-bottom-sheet{color:var(--bottom-sheet-font-color,var(--app-B4-N1,#000));display:flex;flex-direction:column;max-height:var(--bottom-sheet-max-height,50%)!important;min-height:var(--bottom-sheet-min-height,auto);padding-bottom:env(safe-area-inset-bottom);width:var(--bottom-sheet-width,100%)!important}.smart-bottom-sheet__header{color:var(--bottom-sheet-header-color,var(--app-B4-N1,#000));font-size:var(--bottom-sheet-header-font-size,17px);font-weight:var(--bottom-sheet-header-font-weight,600);line-height:var(--bottom-sheet-header-height,56px);padding:var(--bottom-sheet-header-padding,0 16px);text-align:center}.smart-bottom-sheet__content{overflow-y:scroll;padding:var(--bottom-sheet-padding,0 16px)}.smart-bottom-sheet__icon{margin:var(--bottom-sheet-icon-margin,16px 16px 0 0);position:absolute;right:0;top:0}
1
+ @import '../common/index.css';.smart-bottom-sheet{color:var(--bottom-sheet-font-color,var(--app-B4-N1,#000));display:flex;flex-direction:column;max-height:var(--bottom-sheet-max-height,50%);min-height:var(--bottom-sheet-min-height,auto);padding-bottom:env(safe-area-inset-bottom);width:var(--bottom-sheet-width,100%)}.smart-bottom-sheet__header{color:var(--bottom-sheet-header-color,var(--app-B4-N1,#000));font-size:var(--bottom-sheet-header-font-size,17px);font-weight:var(--bottom-sheet-header-font-weight,600);line-height:var(--bottom-sheet-header-height,56px);padding:var(--bottom-sheet-header-padding,0 16px);text-align:center}.smart-bottom-sheet__content{overflow-y:auto;padding:var(--bottom-sheet-padding,0 16px);position:relative}.smart-bottom-sheet__icon{margin:var(--bottom-sheet-icon-margin,16px 16px 0 0);position:absolute;right:0;top:0}
@@ -10,6 +10,7 @@ SmartComponent({
10
10
  type: null,
11
11
  value: 24,
12
12
  },
13
+ contentHeight: null,
13
14
  round: {
14
15
  type: Boolean,
15
16
  value: true,
@@ -1,4 +1,5 @@
1
1
  <wxs src="../wxs/utils.wxs" module="utils" />
2
+ <wxs src="./index.wxs" module="computed" />
2
3
 
3
4
  <smart-popup
4
5
  show="{{ show }}"
@@ -8,6 +9,7 @@
8
9
  overlay="{{ overlay }}"
9
10
  custom-class="smart-bottom-sheet custom-class"
10
11
  native-disabled="{{ nativeDisabled }}"
12
+ customStyle="{{contentHeight ? 'max-height: fit-content;' : ''}}"
11
13
  safe-area-inset-bottom="{{false}}"
12
14
  close-on-click-overlay="{{ closeOnClickOverlay }}"
13
15
  root-portal="{{ rootPortal }}"
@@ -23,7 +25,7 @@
23
25
  {{ title }}
24
26
  <smart-icon bind:click="onClose" name="{{ xmarkIcon }}" class="smart-bottom-sheet__icon" size="{{ iconSize }}" color="{{ xmarkIconColor }}" />
25
27
  </view>
26
- <scroll-view class="smart-bottom-sheet__content" scroll-y>
28
+ <scroll-view class="smart-bottom-sheet__content" style="{{computed.getHeight(contentHeight)}}">
27
29
  <slot />
28
30
  </scroll-view>
29
31
  </smart-popup>
@@ -0,0 +1,12 @@
1
+ function getHeight(contentHeight) {
2
+ var height = contentHeight
3
+ ? typeof contentHeight === 'number'
4
+ ? contentHeight + 'rpx'
5
+ : contentHeight
6
+ : 'undefined';
7
+ return 'height: ' + height + ';';
8
+ }
9
+
10
+ module.exports = {
11
+ getHeight: getHeight,
12
+ };
@@ -1 +1 @@
1
- @import '../common/index.wxss';.smart-bottom-sheet{color:var(--bottom-sheet-font-color,var(--app-B4-N1,#000));display:flex;flex-direction:column;max-height:var(--bottom-sheet-max-height,50%)!important;min-height:var(--bottom-sheet-min-height,auto);padding-bottom:env(safe-area-inset-bottom);width:var(--bottom-sheet-width,100%)!important}.smart-bottom-sheet__header{color:var(--bottom-sheet-header-color,var(--app-B4-N1,#000));font-size:var(--bottom-sheet-header-font-size,17px);font-weight:var(--bottom-sheet-header-font-weight,600);line-height:var(--bottom-sheet-header-height,56px);padding:var(--bottom-sheet-header-padding,0 16px);text-align:center}.smart-bottom-sheet__content{overflow-y:scroll;padding:var(--bottom-sheet-padding,0 16px)}.smart-bottom-sheet__icon{margin:var(--bottom-sheet-icon-margin,16px 16px 0 0);position:absolute;right:0;top:0}
1
+ @import '../common/index.wxss';.smart-bottom-sheet{color:var(--bottom-sheet-font-color,var(--app-B4-N1,#000));display:flex;flex-direction:column;max-height:var(--bottom-sheet-max-height,50%);min-height:var(--bottom-sheet-min-height,auto);padding-bottom:env(safe-area-inset-bottom);width:var(--bottom-sheet-width,100%)}.smart-bottom-sheet__header{color:var(--bottom-sheet-header-color,var(--app-B4-N1,#000));font-size:var(--bottom-sheet-header-font-size,17px);font-weight:var(--bottom-sheet-header-font-weight,600);line-height:var(--bottom-sheet-header-height,56px);padding:var(--bottom-sheet-header-padding,0 16px);text-align:center}.smart-bottom-sheet__content{overflow-y:auto;padding:var(--bottom-sheet-padding,0 16px);position:relative}.smart-bottom-sheet__icon{margin:var(--bottom-sheet-icon-margin,16px 16px 0 0);position:absolute;right:0;top:0}
@@ -1,12 +1,7 @@
1
1
  import { SmartComponent } from '../common/component';
2
2
  import { button } from '../mixins/button';
3
- // import { canIUseFormFieldButton } from '../common/version';
4
- const mixins = [button];
5
- // if (canIUseFormFieldButton()) {
6
- // mixins.push('wx://form-field-button');
7
- // }
8
3
  SmartComponent({
9
- mixins,
4
+ mixins: [button],
10
5
  classes: ['hover-class', 'loading-class'],
11
6
  data: {
12
7
  baseStyle: '',
@@ -52,7 +47,7 @@ SmartComponent({
52
47
  onClick(event) {
53
48
  this.$emit('click', event);
54
49
  const { canIUseGetUserProfile, openType, getUserProfileDesc, lang } = this.data;
55
- if (openType === 'getUserInfo' && canIUseGetUserProfile) {
50
+ if (openType === 'getUserInfo' && canIUseGetUserProfile && typeof wx !== 'undefined') {
56
51
  wx.getUserProfile({
57
52
  desc: getUserProfileDesc || ' ',
58
53
  lang: lang || 'en',
@@ -38,15 +38,15 @@ function getVisible(visibleIndex, curIndex) {
38
38
  function formatMonthTitle(date, formatter = 'YYYY-MM') {
39
39
  if (!date) return '';
40
40
  date = getDate(date);
41
- const year = date.getFullYear();
42
- const month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1 + '';
41
+ var year = date.getFullYear();
42
+ var month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1 + '';
43
43
  return formatter.replace('YYYY', year + '').replace('MM', month);
44
44
  }
45
45
 
46
46
  function formatYearTitle(date, offset, formatter = 'YYYY') {
47
47
  if (!date) return '';
48
48
  date = getDate(date);
49
- const year = date.getFullYear();
49
+ var year = date.getFullYear();
50
50
  return formatter.replace('YYYY', year + '');
51
51
  }
52
52
 
@@ -48,8 +48,8 @@ function getDayStyle(type, index, date, rowHeight, color, firstDayOfWeek) {
48
48
 
49
49
  function formatMonthTitle(date, formatter = 'YYYY-MM') {
50
50
  date = getDate(date);
51
- const year = date.getFullYear();
52
- const month = date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1 + "";
51
+ var year = date.getFullYear();
52
+ var month = date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1 + "";
53
53
  return formatter.replace('YYYY', year + '').replace('MM', month);
54
54
  }
55
55
 
@@ -190,7 +190,7 @@ export default Render({
190
190
  ctx.stroke();
191
191
 
192
192
  // 绘制进度条
193
- const progressAngle = progress * (Math.PI * 2); // 根据进度计算角度
193
+ const progressAngle = progress * (Math.PI * 2.12); // 根据进度计算角度
194
194
  ctx.beginPath();
195
195
  ctx.arc(this.width / 2, this.height / 2, radius, startAngle, startAngle + progressAngle);
196
196
  ctx.lineWidth = lineWidth;
@@ -217,6 +217,7 @@ export default Render({
217
217
  drawProgressBar(progress, this.fillColor); // 25%的蓝色进度条
218
218
  },
219
219
  render(val) {
220
+ val = Math.min(Math.max(0, val), 100)
220
221
  if (this.mode === 'basic') {
221
222
  this.renderAll(val / 100, this.round ? { lineCap: 'round' } : { lineCap: '' });
222
223
  }
@@ -12,7 +12,7 @@ export const init = (tag) => {
12
12
  return Log;
13
13
  }
14
14
  // @ts-ignore
15
- if (typeof ty !== 'undefined' && !ty.getLogManager) {
15
+ if (typeof ty === 'undefined' || (typeof ty !== 'undefined' && !ty.getLogManager)) {
16
16
  // console.warn('不支持ty.getLogManager');
17
17
  return null;
18
18
  }
@@ -0,0 +1,5 @@
1
+ declare const tyApi: {
2
+ vibrateShort: (v: any) => void;
3
+ nativeDisabled: (v: boolean) => void;
4
+ };
5
+ export default tyApi;
@@ -0,0 +1,21 @@
1
+ const tyApi = {
2
+ vibrateShort: (v) => {
3
+ // @ts-ignore
4
+ if (typeof ty !== 'undefined') {
5
+ // @ts-ignore
6
+ ty.vibrateShort(v);
7
+ }
8
+ else if (typeof wx !== 'undefined') {
9
+ wx.vibrateShort(v);
10
+ }
11
+ },
12
+ nativeDisabled: (v) => {
13
+ var _a;
14
+ // @ts-ignore
15
+ if (typeof ty !== 'undefined') {
16
+ // @ts-ignore
17
+ (_a = ty.nativeDisabled) === null || _a === void 0 ? void 0 : _a.call(ty, v);
18
+ }
19
+ },
20
+ };
21
+ export default tyApi;
@@ -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: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:hidden;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{--hairline-right-width:0;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{--hairline-right-width:0;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(--dialog--round-button-border-radius,20px)!important}
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{--hairline-right-width:0;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{--hairline-right-width:0;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(--dialog--round-button-border-radius,20px)!important}
@@ -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: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:hidden;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{--hairline-right-width:0;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{--hairline-right-width:0;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(--dialog--round-button-border-radius,20px)!important}
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{--hairline-right-width:0;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{--hairline-right-width:0;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(--dialog--round-button-border-radius,20px)!important}
@@ -30,7 +30,7 @@ function mode(fit) {
30
30
 
31
31
 
32
32
  function maskStyle(url, color) {
33
- const str = 'mask-image: url(' + url + ');-webkit-mask-image: url(' + url + ');background: ' + color + ';'
33
+ var str = 'mask-image: url(' + url + ');-webkit-mask-image: url(' + url + ');background: ' + color + ';'
34
34
  return str
35
35
  }
36
36
 
@@ -3,7 +3,7 @@ var style = require('../wxs/style.wxs');
3
3
  var addUnit = require('../wxs/add-unit.wxs');
4
4
 
5
5
  function textStyle(data) {
6
- const ret = style({
6
+ var ret = style({
7
7
  'font-size': addUnit(data.textSize),
8
8
  color: data.color,
9
9
  });
@@ -12,7 +12,7 @@ function textStyle(data) {
12
12
  }
13
13
 
14
14
  function loadingStyle(data) {
15
- let iconSrc = ''
15
+ var iconSrc = ''
16
16
 
17
17
  if (data.type === 'spinner') {
18
18
  iconSrc = data.spinner
@@ -10,6 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  // @ts-nocheck
11
11
  import { requestAnimationFrame } from '../common/utils';
12
12
  import { isObj } from '../common/validator';
13
+ import ty from '../common/ty';
13
14
  const getClassNames = (name) => ({
14
15
  enter: `smart-${name}-enter smart-${name}-enter-active enter-class enter-active-class`,
15
16
  'enter-to': `smart-${name}-enter-to smart-${name}-enter-active enter-to-class enter-active-class`,
@@ -65,13 +66,12 @@ export function transition(showDefaultValue) {
65
66
  });
66
67
  // eslint-disable-next-line no-async-promise-executor
67
68
  this.enterFinishedPromise = new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {
68
- var _a;
69
69
  const { duration, name } = this.data;
70
70
  const classNames = getClassNames(name);
71
71
  const currentDuration = isObj(duration) ? duration.enter : duration;
72
72
  this.$emit('before-enter');
73
73
  if (this.data.nativeDisabled) {
74
- (_a = ty === null || ty === void 0 ? void 0 : ty.nativeDisabled) === null || _a === void 0 ? void 0 : _a.call(ty, true);
74
+ ty.nativeDisabled(true);
75
75
  }
76
76
  yield requestAnimationFrame();
77
77
  this.$emit('enter');
@@ -125,11 +125,10 @@ export function transition(showDefaultValue) {
125
125
  this.transitionEnded = false;
126
126
  clearTimeout(this.timer);
127
127
  setTimeout(() => {
128
- var _a;
129
128
  this.enterFinishedPromise = null;
130
129
  this.$emit('after-leave');
131
130
  if (this.data.nativeDisabled) {
132
- (_a = ty === null || ty === void 0 ? void 0 : ty.nativeDisabled) === null || _a === void 0 ? void 0 : _a.call(ty, false);
131
+ ty.nativeDisabled(false);
133
132
  }
134
133
  this.setData({
135
134
  display: false,
@@ -140,13 +139,12 @@ export function transition(showDefaultValue) {
140
139
  this.setData({ classes: classNames['leave-to'] });
141
140
  }))
142
141
  .catch(err => {
143
- var _a;
144
142
  this.enterFinishedPromise = null;
145
143
  this.setData({ animating: false });
146
144
  console.log(err, '---error-leave');
147
145
  this.$emit('leave-error', err);
148
146
  if (this.data.nativeDisabled) {
149
- (_a = ty === null || ty === void 0 ? void 0 : ty.nativeDisabled) === null || _a === void 0 ? void 0 : _a.call(ty, false);
147
+ ty.nativeDisabled(false);
150
148
  }
151
149
  });
152
150
  });
@@ -10,6 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  import { SmartComponent } from '../common/component';
11
11
  import { range } from '../common/utils';
12
12
  import { isObj } from '../common/validator';
13
+ import ty from '../common/ty';
13
14
  const DEFAULT_DURATION = 400;
14
15
  SmartComponent({
15
16
  classes: ['active-class'],
@@ -226,7 +227,6 @@ SmartComponent({
226
227
  },
227
228
  vibrateShort(count, time = 1000) {
228
229
  if (!count) {
229
- // @ts-ignore
230
230
  ty.vibrateShort({ type: 'light' });
231
231
  return;
232
232
  }
@@ -52,10 +52,10 @@ function wrapperItemStyle(data) {
52
52
  }
53
53
 
54
54
  // function wrapperItemStyle(data) {
55
- // const { index, animationIndex: currentIndex } = data;
56
- // const offsetIndex = currentIndex - index;
57
- // const rotateX = offsetIndex * 25 > 0 ? Math.min(offsetIndex * 25, 25 * 2) : Math.max(offsetIndex * 25, -25 * 2)
58
- // const scale = Math.min(Math.abs(offsetIndex * 0.05), 0.05 * 2)
55
+ // var { index, animationIndex: currentIndex } = data;
56
+ // var offsetIndex = currentIndex - index;
57
+ // var rotateX = offsetIndex * 25 > 0 ? Math.min(offsetIndex * 25, 25 * 2) : Math.max(offsetIndex * 25, -25 * 2)
58
+ // var scale = Math.min(Math.abs(offsetIndex * 0.05), 0.05 * 2)
59
59
  // return style({
60
60
  // transition: 'transform ' + data.duration + 'ms ease-out',
61
61
  // transform: `rotateX(${rotateX}deg) scale(${1 - scale})`
@@ -2,7 +2,7 @@
2
2
  var style = require('../wxs/style.wxs');
3
3
 
4
4
  function popupStyle(data) {
5
- const transformStyle = data.position === 'bottom' ? "transform: translate3d(0, calc(100% + " + data.bottomSafeHeight + "px), 0)" : null;
5
+ var transformStyle = data.position === 'bottom' ? "transform: translate3d(0, calc(100% + " + data.bottomSafeHeight + "px), 0)" : null;
6
6
 
7
7
  return style([
8
8
  {
@@ -1,5 +1,6 @@
1
1
  import { SmartComponent } from '../common/component';
2
2
  import { isDef } from '../common/validator';
3
+ import ty from '../common/ty';
3
4
  import Minus from '@tuya-miniapp/icons/dist/svg/Minus';
4
5
  import Plus from '@tuya-miniapp/icons/dist/svg/Plus';
5
6
  const LONG_PRESS_START_TIME = 600;
@@ -151,7 +152,6 @@ SmartComponent({
151
152
  const value = this.format(add(+this.data.currentValue, diff));
152
153
  this.emitChange(value);
153
154
  this.$emit(type);
154
- // @ts-ignore
155
155
  ty.vibrateShort({ type: 'light' });
156
156
  },
157
157
  longPressStep() {
@@ -1 +1 @@
1
- @import '../common/index.css';.smart-switch{background-color:var(--switch-background-color,var(--app-B4-N6,rgba(0,0,0,.2)));border-radius:var(--switch-node-size,.867em);height:var(--switch-height,.867em);padding:var(--switch-padding,.08em);transition:background-color var(--switch-transition-duration,.3s);vertical-align:middle;width:var(--switch-width,1.5338em)}.smart-switch,.smart-switch__center{box-sizing:initial;display:inline-block}.smart-switch__center{height:100%;position:relative;vertical-align:top;width:100%}.smart-switch__node{background-color:var(--switch-node-background-color,#fff);border-radius:100%;box-shadow:var(--switch-node-box-shadow,0 3px 1px 0 rgba(0,0,0,.05),0 2px 2px 0 rgba(0,0,0,.1),0 3px 3px 0 rgba(0,0,0,.05));height:var(--switch-node-size,.867em);left:0;position:absolute;top:0;transition:var(--switch-transition-duration,.3s) cubic-bezier(.3,1.05,.4,1.05);width:var(--switch-node-size,.867em);z-index:var(--switch-node-z-index,1)}.smart-switch__loading{left:50%;position:absolute!important;top:50%;transform:translate(-50%,-50%)}.smart-switch--on{background-color:var(--switch-on-background-color,#1989fa)}.smart-switch--on .smart-switch__node{background-color:var(--switch-node-on-background-color,var(--switch-node-background-color,#fff));transform:translateX(calc(var(--switch-width, 1.5338em) - var(--switch-node-size, .867em)))}.smart-switch--disabled{opacity:var(--switch-disabled-opacity,.4)}
1
+ @import '../common/index.css';.smart-switch{background-color:var(--switch-background-color,var(--app-B4-N6,rgba(0,0,0,.2)));border-radius:var(--switch-node-size,.867em);height:var(--switch-height,.867em);padding:var(--switch-border,var(--switch-padding,.08em));transition:background-color var(--switch-transition-duration,.3s);vertical-align:middle;width:var(--switch-width,1.5338em)}.smart-switch,.smart-switch__center{box-sizing:initial;display:inline-block}.smart-switch__center{height:100%;position:relative;vertical-align:top;width:100%}.smart-switch__node{background-color:var(--switch-node-background-color,#fff);border-radius:100%;box-shadow:var(--switch-node-box-shadow,0 3px 1px 0 rgba(0,0,0,.05),0 2px 2px 0 rgba(0,0,0,.1),0 3px 3px 0 rgba(0,0,0,.05));height:var(--switch-node-size,.867em);left:0;position:absolute;top:0;transition:var(--switch-transition-duration,.3s) cubic-bezier(.3,1.05,.4,1.05);width:var(--switch-node-size,.867em);z-index:var(--switch-node-z-index,1)}.smart-switch__loading{left:50%;position:absolute!important;top:50%;transform:translate(-50%,-50%)}.smart-switch--on{background-color:var(--switch-on-background-color,#1989fa)}.smart-switch--on .smart-switch__node{background-color:var(--switch-node-on-background-color,var(--switch-node-background-color,#fff));transform:translateX(calc(var(--switch-width, 1.5338em) - var(--switch-node-size, .867em)))}.smart-switch--disabled{opacity:var(--switch-disabled-opacity,.4)}
@@ -1 +1 @@
1
- @import '../common/index.wxss';.smart-switch{background-color:var(--switch-background-color,var(--app-B4-N6,rgba(0,0,0,.2)));border-radius:var(--switch-node-size,.867em);height:var(--switch-height,.867em);padding:var(--switch-padding,.08em);transition:background-color var(--switch-transition-duration,.3s);vertical-align:middle;width:var(--switch-width,1.5338em)}.smart-switch,.smart-switch__center{box-sizing:initial;display:inline-block}.smart-switch__center{height:100%;position:relative;vertical-align:top;width:100%}.smart-switch__node{background-color:var(--switch-node-background-color,#fff);border-radius:100%;box-shadow:var(--switch-node-box-shadow,0 3px 1px 0 rgba(0,0,0,.05),0 2px 2px 0 rgba(0,0,0,.1),0 3px 3px 0 rgba(0,0,0,.05));height:var(--switch-node-size,.867em);left:0;position:absolute;top:0;transition:var(--switch-transition-duration,.3s) cubic-bezier(.3,1.05,.4,1.05);width:var(--switch-node-size,.867em);z-index:var(--switch-node-z-index,1)}.smart-switch__loading{left:50%;position:absolute!important;top:50%;transform:translate(-50%,-50%)}.smart-switch--on{background-color:var(--switch-on-background-color,#1989fa)}.smart-switch--on .smart-switch__node{background-color:var(--switch-node-on-background-color,var(--switch-node-background-color,#fff));transform:translateX(calc(var(--switch-width, 1.5338em) - var(--switch-node-size, .867em)))}.smart-switch--disabled{opacity:var(--switch-disabled-opacity,.4)}
1
+ @import '../common/index.wxss';.smart-switch{background-color:var(--switch-background-color,var(--app-B4-N6,rgba(0,0,0,.2)));border-radius:var(--switch-node-size,.867em);height:var(--switch-height,.867em);padding:var(--switch-border,var(--switch-padding,.08em));transition:background-color var(--switch-transition-duration,.3s);vertical-align:middle;width:var(--switch-width,1.5338em)}.smart-switch,.smart-switch__center{box-sizing:initial;display:inline-block}.smart-switch__center{height:100%;position:relative;vertical-align:top;width:100%}.smart-switch__node{background-color:var(--switch-node-background-color,#fff);border-radius:100%;box-shadow:var(--switch-node-box-shadow,0 3px 1px 0 rgba(0,0,0,.05),0 2px 2px 0 rgba(0,0,0,.1),0 3px 3px 0 rgba(0,0,0,.05));height:var(--switch-node-size,.867em);left:0;position:absolute;top:0;transition:var(--switch-transition-duration,.3s) cubic-bezier(.3,1.05,.4,1.05);width:var(--switch-node-size,.867em);z-index:var(--switch-node-z-index,1)}.smart-switch__loading{left:50%;position:absolute!important;top:50%;transform:translate(-50%,-50%)}.smart-switch--on{background-color:var(--switch-on-background-color,#1989fa)}.smart-switch--on .smart-switch__node{background-color:var(--switch-node-on-background-color,var(--switch-node-background-color,#fff));transform:translateX(calc(var(--switch-width, 1.5338em) - var(--switch-node-size, .867em)))}.smart-switch--disabled{opacity:var(--switch-disabled-opacity,.4)}
@@ -16,7 +16,7 @@
16
16
  >
17
17
 
18
18
  <!-- text only -->
19
- <text wx:if="{{ type === 'text' }}">{{ message }}</text>
19
+ <text class="smart-toast__text" wx:if="{{ type === 'text' }}">{{ message }}</text>
20
20
 
21
21
  <!-- html only -->
22
22
  <rich-text wx:elif="{{ type === 'html' }}" nodes="{{ message }}"></rich-text>
@@ -1,6 +1,7 @@
1
1
  import appLog from '../common/appLog';
2
2
  import { getCurrentPage } from '../common/utils';
3
3
  import { isObj } from '../common/validator';
4
+ import ty from '../common/ty';
4
5
  const defaultOptions = {
5
6
  type: 'text',
6
7
  mask: false,
@@ -31,7 +32,6 @@ export const contextRef = {
31
32
  value: {},
32
33
  };
33
34
  function Toast(toastOptions) {
34
- var _a, _b;
35
35
  const options = Object.assign(Object.assign({}, currentOptions), parseOptions(toastOptions));
36
36
  appLog.info('start open Toast');
37
37
  const context = (typeof options.context === 'function' ? options.context() : options.context) ||
@@ -48,11 +48,9 @@ function Toast(toastOptions) {
48
48
  delete options.context;
49
49
  delete options.selector;
50
50
  toast.clear = () => {
51
- var _a;
52
51
  toast.setData({ show: false });
53
52
  if (options.nativeDisabled) {
54
- // @ts-ignore
55
- (_a = ty === null || ty === void 0 ? void 0 : ty.nativeDisabled) === null || _a === void 0 ? void 0 : _a.call(ty, false);
53
+ ty.nativeDisabled(false);
56
54
  }
57
55
  preDisRef.value[options.selector] = false;
58
56
  if (options.onClose) {
@@ -62,12 +60,10 @@ function Toast(toastOptions) {
62
60
  queueRef.value.push(toast);
63
61
  toast.setData(options);
64
62
  if (options.nativeDisabled) {
65
- // @ts-ignore
66
- (_a = ty === null || ty === void 0 ? void 0 : ty.nativeDisabled) === null || _a === void 0 ? void 0 : _a.call(ty, true);
63
+ ty.nativeDisabled(true);
67
64
  }
68
65
  if (preDisRef.value[options.selector] && !options.nativeDisabled) {
69
- // @ts-ignore
70
- (_b = ty === null || ty === void 0 ? void 0 : ty.nativeDisabled) === null || _b === void 0 ? void 0 : _b.call(ty, false);
66
+ ty.nativeDisabled(false);
71
67
  }
72
68
  preDisRef.value[options.selector] = options.nativeDisabled || false;
73
69
  clearTimeout(toast.timer);
@@ -1 +1 @@
1
- @import '../common/index.css';.smart-bottom-sheet{color:var(--bottom-sheet-font-color,var(--app-B4-N1,#000));display:flex;flex-direction:column;max-height:var(--bottom-sheet-max-height,50%)!important;min-height:var(--bottom-sheet-min-height,auto);padding-bottom:env(safe-area-inset-bottom);width:var(--bottom-sheet-width,100%)!important}.smart-bottom-sheet__header{color:var(--bottom-sheet-header-color,var(--app-B4-N1,#000));font-size:var(--bottom-sheet-header-font-size,17px);font-weight:var(--bottom-sheet-header-font-weight,600);line-height:var(--bottom-sheet-header-height,56px);padding:var(--bottom-sheet-header-padding,0 16px);text-align:center}.smart-bottom-sheet__content{overflow-y:scroll;padding:var(--bottom-sheet-padding,0 16px)}.smart-bottom-sheet__icon{margin:var(--bottom-sheet-icon-margin,16px 16px 0 0);position:absolute;right:0;top:0}
1
+ @import '../common/index.css';.smart-bottom-sheet{color:var(--bottom-sheet-font-color,var(--app-B4-N1,#000));display:flex;flex-direction:column;max-height:var(--bottom-sheet-max-height,50%);min-height:var(--bottom-sheet-min-height,auto);padding-bottom:env(safe-area-inset-bottom);width:var(--bottom-sheet-width,100%)}.smart-bottom-sheet__header{color:var(--bottom-sheet-header-color,var(--app-B4-N1,#000));font-size:var(--bottom-sheet-header-font-size,17px);font-weight:var(--bottom-sheet-header-font-weight,600);line-height:var(--bottom-sheet-header-height,56px);padding:var(--bottom-sheet-header-padding,0 16px);text-align:center}.smart-bottom-sheet__content{overflow-y:auto;padding:var(--bottom-sheet-padding,0 16px);position:relative}.smart-bottom-sheet__icon{margin:var(--bottom-sheet-icon-margin,16px 16px 0 0);position:absolute;right:0;top:0}
@@ -15,6 +15,7 @@ var component_1 = require("../common/component");
15
15
  type: null,
16
16
  value: 24,
17
17
  },
18
+ contentHeight: null,
18
19
  round: {
19
20
  type: Boolean,
20
21
  value: true,
@@ -1,4 +1,5 @@
1
1
  <wxs src="../wxs/utils.wxs" module="utils" />
2
+ <wxs src="./index.wxs" module="computed" />
2
3
 
3
4
  <smart-popup
4
5
  show="{{ show }}"
@@ -8,6 +9,7 @@
8
9
  overlay="{{ overlay }}"
9
10
  custom-class="smart-bottom-sheet custom-class"
10
11
  native-disabled="{{ nativeDisabled }}"
12
+ customStyle="{{contentHeight ? 'max-height: fit-content;' : ''}}"
11
13
  safe-area-inset-bottom="{{false}}"
12
14
  close-on-click-overlay="{{ closeOnClickOverlay }}"
13
15
  root-portal="{{ rootPortal }}"
@@ -23,7 +25,7 @@
23
25
  {{ title }}
24
26
  <smart-icon bind:click="onClose" name="{{ xmarkIcon }}" class="smart-bottom-sheet__icon" size="{{ iconSize }}" color="{{ xmarkIconColor }}" />
25
27
  </view>
26
- <scroll-view class="smart-bottom-sheet__content" scroll-y>
28
+ <scroll-view class="smart-bottom-sheet__content" style="{{computed.getHeight(contentHeight)}}">
27
29
  <slot />
28
30
  </scroll-view>
29
31
  </smart-popup>
@@ -0,0 +1,12 @@
1
+ function getHeight(contentHeight) {
2
+ var height = contentHeight
3
+ ? typeof contentHeight === 'number'
4
+ ? contentHeight + 'rpx'
5
+ : contentHeight
6
+ : 'undefined';
7
+ return 'height: ' + height + ';';
8
+ }
9
+
10
+ module.exports = {
11
+ getHeight: getHeight,
12
+ };
@@ -1 +1 @@
1
- @import '../common/index.wxss';.smart-bottom-sheet{color:var(--bottom-sheet-font-color,var(--app-B4-N1,#000));display:flex;flex-direction:column;max-height:var(--bottom-sheet-max-height,50%)!important;min-height:var(--bottom-sheet-min-height,auto);padding-bottom:env(safe-area-inset-bottom);width:var(--bottom-sheet-width,100%)!important}.smart-bottom-sheet__header{color:var(--bottom-sheet-header-color,var(--app-B4-N1,#000));font-size:var(--bottom-sheet-header-font-size,17px);font-weight:var(--bottom-sheet-header-font-weight,600);line-height:var(--bottom-sheet-header-height,56px);padding:var(--bottom-sheet-header-padding,0 16px);text-align:center}.smart-bottom-sheet__content{overflow-y:scroll;padding:var(--bottom-sheet-padding,0 16px)}.smart-bottom-sheet__icon{margin:var(--bottom-sheet-icon-margin,16px 16px 0 0);position:absolute;right:0;top:0}
1
+ @import '../common/index.wxss';.smart-bottom-sheet{color:var(--bottom-sheet-font-color,var(--app-B4-N1,#000));display:flex;flex-direction:column;max-height:var(--bottom-sheet-max-height,50%);min-height:var(--bottom-sheet-min-height,auto);padding-bottom:env(safe-area-inset-bottom);width:var(--bottom-sheet-width,100%)}.smart-bottom-sheet__header{color:var(--bottom-sheet-header-color,var(--app-B4-N1,#000));font-size:var(--bottom-sheet-header-font-size,17px);font-weight:var(--bottom-sheet-header-font-weight,600);line-height:var(--bottom-sheet-header-height,56px);padding:var(--bottom-sheet-header-padding,0 16px);text-align:center}.smart-bottom-sheet__content{overflow-y:auto;padding:var(--bottom-sheet-padding,0 16px);position:relative}.smart-bottom-sheet__icon{margin:var(--bottom-sheet-icon-margin,16px 16px 0 0);position:absolute;right:0;top:0}
@@ -2,13 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  var component_1 = require("../common/component");
4
4
  var button_1 = require("../mixins/button");
5
- // import { canIUseFormFieldButton } from '../common/version';
6
- var mixins = [button_1.button];
7
- // if (canIUseFormFieldButton()) {
8
- // mixins.push('wx://form-field-button');
9
- // }
10
5
  (0, component_1.SmartComponent)({
11
- mixins: mixins,
6
+ mixins: [button_1.button],
12
7
  classes: ['hover-class', 'loading-class'],
13
8
  data: {
14
9
  baseStyle: '',
@@ -55,7 +50,7 @@ var mixins = [button_1.button];
55
50
  var _this = this;
56
51
  this.$emit('click', event);
57
52
  var _a = this.data, canIUseGetUserProfile = _a.canIUseGetUserProfile, openType = _a.openType, getUserProfileDesc = _a.getUserProfileDesc, lang = _a.lang;
58
- if (openType === 'getUserInfo' && canIUseGetUserProfile) {
53
+ if (openType === 'getUserInfo' && canIUseGetUserProfile && typeof wx !== 'undefined') {
59
54
  wx.getUserProfile({
60
55
  desc: getUserProfileDesc || ' ',
61
56
  lang: lang || 'en',
@@ -38,15 +38,15 @@ function getVisible(visibleIndex, curIndex) {
38
38
  function formatMonthTitle(date, formatter = 'YYYY-MM') {
39
39
  if (!date) return '';
40
40
  date = getDate(date);
41
- const year = date.getFullYear();
42
- const month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1 + '';
41
+ var year = date.getFullYear();
42
+ var month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1 + '';
43
43
  return formatter.replace('YYYY', year + '').replace('MM', month);
44
44
  }
45
45
 
46
46
  function formatYearTitle(date, offset, formatter = 'YYYY') {
47
47
  if (!date) return '';
48
48
  date = getDate(date);
49
- const year = date.getFullYear();
49
+ var year = date.getFullYear();
50
50
  return formatter.replace('YYYY', year + '');
51
51
  }
52
52
 
@@ -48,8 +48,8 @@ function getDayStyle(type, index, date, rowHeight, color, firstDayOfWeek) {
48
48
 
49
49
  function formatMonthTitle(date, formatter = 'YYYY-MM') {
50
50
  date = getDate(date);
51
- const year = date.getFullYear();
52
- const month = date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1 + "";
51
+ var year = date.getFullYear();
52
+ var month = date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1 + "";
53
53
  return formatter.replace('YYYY', year + '').replace('MM', month);
54
54
  }
55
55
 
@@ -190,7 +190,7 @@ export default Render({
190
190
  ctx.stroke();
191
191
 
192
192
  // 绘制进度条
193
- const progressAngle = progress * (Math.PI * 2); // 根据进度计算角度
193
+ const progressAngle = progress * (Math.PI * 2.12); // 根据进度计算角度
194
194
  ctx.beginPath();
195
195
  ctx.arc(this.width / 2, this.height / 2, radius, startAngle, startAngle + progressAngle);
196
196
  ctx.lineWidth = lineWidth;
@@ -217,6 +217,7 @@ export default Render({
217
217
  drawProgressBar(progress, this.fillColor); // 25%的蓝色进度条
218
218
  },
219
219
  render(val) {
220
+ val = Math.min(Math.max(0, val), 100)
220
221
  if (this.mode === 'basic') {
221
222
  this.renderAll(val / 100, this.round ? { lineCap: 'round' } : { lineCap: '' });
222
223
  }
@@ -15,7 +15,7 @@ var init = function (tag) {
15
15
  return Log;
16
16
  }
17
17
  // @ts-ignore
18
- if (typeof ty !== 'undefined' && !ty.getLogManager) {
18
+ if (typeof ty === 'undefined' || (typeof ty !== 'undefined' && !ty.getLogManager)) {
19
19
  // console.warn('不支持ty.getLogManager');
20
20
  return null;
21
21
  }
@@ -0,0 +1,5 @@
1
+ declare const tyApi: {
2
+ vibrateShort: (v: any) => void;
3
+ nativeDisabled: (v: boolean) => void;
4
+ };
5
+ export default tyApi;
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var tyApi = {
4
+ vibrateShort: function (v) {
5
+ // @ts-ignore
6
+ if (typeof ty !== 'undefined') {
7
+ // @ts-ignore
8
+ ty.vibrateShort(v);
9
+ }
10
+ else if (typeof wx !== 'undefined') {
11
+ wx.vibrateShort(v);
12
+ }
13
+ },
14
+ nativeDisabled: function (v) {
15
+ var _a;
16
+ // @ts-ignore
17
+ if (typeof ty !== 'undefined') {
18
+ // @ts-ignore
19
+ (_a = ty.nativeDisabled) === null || _a === void 0 ? void 0 : _a.call(ty, v);
20
+ }
21
+ },
22
+ };
23
+ exports.default = tyApi;
@@ -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: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:hidden;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{--hairline-right-width:0;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{--hairline-right-width:0;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(--dialog--round-button-border-radius,20px)!important}
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{--hairline-right-width:0;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{--hairline-right-width:0;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(--dialog--round-button-border-radius,20px)!important}
@@ -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: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:hidden;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{--hairline-right-width:0;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{--hairline-right-width:0;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(--dialog--round-button-border-radius,20px)!important}
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{--hairline-right-width:0;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{--hairline-right-width:0;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(--dialog--round-button-border-radius,20px)!important}
@@ -30,7 +30,7 @@ function mode(fit) {
30
30
 
31
31
 
32
32
  function maskStyle(url, color) {
33
- const str = 'mask-image: url(' + url + ');-webkit-mask-image: url(' + url + ');background: ' + color + ';'
33
+ var str = 'mask-image: url(' + url + ');-webkit-mask-image: url(' + url + ');background: ' + color + ';'
34
34
  return str
35
35
  }
36
36
 
@@ -3,7 +3,7 @@ var style = require('../wxs/style.wxs');
3
3
  var addUnit = require('../wxs/add-unit.wxs');
4
4
 
5
5
  function textStyle(data) {
6
- const ret = style({
6
+ var ret = style({
7
7
  'font-size': addUnit(data.textSize),
8
8
  color: data.color,
9
9
  });
@@ -12,7 +12,7 @@ function textStyle(data) {
12
12
  }
13
13
 
14
14
  function loadingStyle(data) {
15
- let iconSrc = ''
15
+ var iconSrc = ''
16
16
 
17
17
  if (data.type === 'spinner') {
18
18
  iconSrc = data.spinner
@@ -35,11 +35,15 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
35
35
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
36
  }
37
37
  };
38
+ var __importDefault = (this && this.__importDefault) || function (mod) {
39
+ return (mod && mod.__esModule) ? mod : { "default": mod };
40
+ };
38
41
  Object.defineProperty(exports, "__esModule", { value: true });
39
42
  exports.transition = void 0;
40
43
  // @ts-nocheck
41
44
  var utils_1 = require("../common/utils");
42
45
  var validator_1 = require("../common/validator");
46
+ var ty_1 = __importDefault(require("../common/ty"));
43
47
  var getClassNames = function (name) { return ({
44
48
  enter: "smart-".concat(name, "-enter smart-").concat(name, "-enter-active enter-class enter-active-class"),
45
49
  'enter-to': "smart-".concat(name, "-enter-to smart-").concat(name, "-enter-active enter-to-class enter-active-class"),
@@ -98,20 +102,19 @@ function transition(showDefaultValue) {
98
102
  this.enterFinishedPromise = new Promise(function (resolve) { return __awaiter(_this, void 0, void 0, function () {
99
103
  var _a, duration, name, classNames, currentDuration;
100
104
  var _this = this;
101
- var _b;
102
- return __generator(this, function (_c) {
103
- switch (_c.label) {
105
+ return __generator(this, function (_b) {
106
+ switch (_b.label) {
104
107
  case 0:
105
108
  _a = this.data, duration = _a.duration, name = _a.name;
106
109
  classNames = getClassNames(name);
107
110
  currentDuration = (0, validator_1.isObj)(duration) ? duration.enter : duration;
108
111
  this.$emit('before-enter');
109
112
  if (this.data.nativeDisabled) {
110
- (_b = ty === null || ty === void 0 ? void 0 : ty.nativeDisabled) === null || _b === void 0 ? void 0 : _b.call(ty, true);
113
+ ty_1.default.nativeDisabled(true);
111
114
  }
112
115
  return [4 /*yield*/, (0, utils_1.requestAnimationFrame)()];
113
116
  case 1:
114
- _c.sent();
117
+ _b.sent();
115
118
  this.$emit('enter');
116
119
  this.setData({
117
120
  inited: true,
@@ -121,7 +124,7 @@ function transition(showDefaultValue) {
121
124
  });
122
125
  return [4 /*yield*/, (0, utils_1.requestAnimationFrame)()];
123
126
  case 2:
124
- _c.sent();
127
+ _b.sent();
125
128
  this.transitionEnded = false;
126
129
  this.setData({ classes: classNames['enter-to'] });
127
130
  clearTimeout(this.timer);
@@ -179,11 +182,10 @@ function transition(showDefaultValue) {
179
182
  this.transitionEnded = false;
180
183
  clearTimeout(this.timer);
181
184
  setTimeout(function () {
182
- var _a;
183
185
  _this.enterFinishedPromise = null;
184
186
  _this.$emit('after-leave');
185
187
  if (_this.data.nativeDisabled) {
186
- (_a = ty === null || ty === void 0 ? void 0 : ty.nativeDisabled) === null || _a === void 0 ? void 0 : _a.call(ty, false);
188
+ ty_1.default.nativeDisabled(false);
187
189
  }
188
190
  _this.setData({
189
191
  display: false,
@@ -197,13 +199,12 @@ function transition(showDefaultValue) {
197
199
  });
198
200
  }); })
199
201
  .catch(function (err) {
200
- var _a;
201
202
  _this.enterFinishedPromise = null;
202
203
  _this.setData({ animating: false });
203
204
  console.log(err, '---error-leave');
204
205
  _this.$emit('leave-error', err);
205
206
  if (_this.data.nativeDisabled) {
206
- (_a = ty === null || ty === void 0 ? void 0 : ty.nativeDisabled) === null || _a === void 0 ? void 0 : _a.call(ty, false);
207
+ ty_1.default.nativeDisabled(false);
207
208
  }
208
209
  });
209
210
  return [2 /*return*/];
@@ -44,10 +44,14 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
44
44
  }
45
45
  return to.concat(ar || Array.prototype.slice.call(from));
46
46
  };
47
+ var __importDefault = (this && this.__importDefault) || function (mod) {
48
+ return (mod && mod.__esModule) ? mod : { "default": mod };
49
+ };
47
50
  Object.defineProperty(exports, "__esModule", { value: true });
48
51
  var component_1 = require("../common/component");
49
52
  var utils_1 = require("../common/utils");
50
53
  var validator_1 = require("../common/validator");
54
+ var ty_1 = __importDefault(require("../common/ty"));
51
55
  var DEFAULT_DURATION = 400;
52
56
  (0, component_1.SmartComponent)({
53
57
  classes: ['active-class'],
@@ -265,8 +269,7 @@ var DEFAULT_DURATION = 400;
265
269
  var _this = this;
266
270
  if (time === void 0) { time = 1000; }
267
271
  if (!count) {
268
- // @ts-ignore
269
- ty.vibrateShort({ type: 'light' });
272
+ ty_1.default.vibrateShort({ type: 'light' });
270
273
  return;
271
274
  }
272
275
  var has = 0;
@@ -52,10 +52,10 @@ function wrapperItemStyle(data) {
52
52
  }
53
53
 
54
54
  // function wrapperItemStyle(data) {
55
- // const { index, animationIndex: currentIndex } = data;
56
- // const offsetIndex = currentIndex - index;
57
- // const rotateX = offsetIndex * 25 > 0 ? Math.min(offsetIndex * 25, 25 * 2) : Math.max(offsetIndex * 25, -25 * 2)
58
- // const scale = Math.min(Math.abs(offsetIndex * 0.05), 0.05 * 2)
55
+ // var { index, animationIndex: currentIndex } = data;
56
+ // var offsetIndex = currentIndex - index;
57
+ // var rotateX = offsetIndex * 25 > 0 ? Math.min(offsetIndex * 25, 25 * 2) : Math.max(offsetIndex * 25, -25 * 2)
58
+ // var scale = Math.min(Math.abs(offsetIndex * 0.05), 0.05 * 2)
59
59
  // return style({
60
60
  // transition: 'transform ' + data.duration + 'ms ease-out',
61
61
  // transform: `rotateX(${rotateX}deg) scale(${1 - scale})`
@@ -2,7 +2,7 @@
2
2
  var style = require('../wxs/style.wxs');
3
3
 
4
4
  function popupStyle(data) {
5
- const transformStyle = data.position === 'bottom' ? "transform: translate3d(0, calc(100% + " + data.bottomSafeHeight + "px), 0)" : null;
5
+ var transformStyle = data.position === 'bottom' ? "transform: translate3d(0, calc(100% + " + data.bottomSafeHeight + "px), 0)" : null;
6
6
 
7
7
  return style([
8
8
  {
@@ -16,6 +16,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  var component_1 = require("../common/component");
18
18
  var validator_1 = require("../common/validator");
19
+ var ty_1 = __importDefault(require("../common/ty"));
19
20
  var Minus_1 = __importDefault(require("@tuya-miniapp/icons/dist/svg/Minus"));
20
21
  var Plus_1 = __importDefault(require("@tuya-miniapp/icons/dist/svg/Plus"));
21
22
  var LONG_PRESS_START_TIME = 600;
@@ -167,8 +168,7 @@ function equal(value1, value2) {
167
168
  var value = this.format(add(+this.data.currentValue, diff));
168
169
  this.emitChange(value);
169
170
  this.$emit(type);
170
- // @ts-ignore
171
- ty.vibrateShort({ type: 'light' });
171
+ ty_1.default.vibrateShort({ type: 'light' });
172
172
  },
173
173
  longPressStep: function () {
174
174
  var _this = this;
@@ -1 +1 @@
1
- @import '../common/index.css';.smart-switch{background-color:var(--switch-background-color,var(--app-B4-N6,rgba(0,0,0,.2)));border-radius:var(--switch-node-size,.867em);height:var(--switch-height,.867em);padding:var(--switch-padding,.08em);transition:background-color var(--switch-transition-duration,.3s);vertical-align:middle;width:var(--switch-width,1.5338em)}.smart-switch,.smart-switch__center{box-sizing:initial;display:inline-block}.smart-switch__center{height:100%;position:relative;vertical-align:top;width:100%}.smart-switch__node{background-color:var(--switch-node-background-color,#fff);border-radius:100%;box-shadow:var(--switch-node-box-shadow,0 3px 1px 0 rgba(0,0,0,.05),0 2px 2px 0 rgba(0,0,0,.1),0 3px 3px 0 rgba(0,0,0,.05));height:var(--switch-node-size,.867em);left:0;position:absolute;top:0;transition:var(--switch-transition-duration,.3s) cubic-bezier(.3,1.05,.4,1.05);width:var(--switch-node-size,.867em);z-index:var(--switch-node-z-index,1)}.smart-switch__loading{left:50%;position:absolute!important;top:50%;transform:translate(-50%,-50%)}.smart-switch--on{background-color:var(--switch-on-background-color,#1989fa)}.smart-switch--on .smart-switch__node{background-color:var(--switch-node-on-background-color,var(--switch-node-background-color,#fff));transform:translateX(calc(var(--switch-width, 1.5338em) - var(--switch-node-size, .867em)))}.smart-switch--disabled{opacity:var(--switch-disabled-opacity,.4)}
1
+ @import '../common/index.css';.smart-switch{background-color:var(--switch-background-color,var(--app-B4-N6,rgba(0,0,0,.2)));border-radius:var(--switch-node-size,.867em);height:var(--switch-height,.867em);padding:var(--switch-border,var(--switch-padding,.08em));transition:background-color var(--switch-transition-duration,.3s);vertical-align:middle;width:var(--switch-width,1.5338em)}.smart-switch,.smart-switch__center{box-sizing:initial;display:inline-block}.smart-switch__center{height:100%;position:relative;vertical-align:top;width:100%}.smart-switch__node{background-color:var(--switch-node-background-color,#fff);border-radius:100%;box-shadow:var(--switch-node-box-shadow,0 3px 1px 0 rgba(0,0,0,.05),0 2px 2px 0 rgba(0,0,0,.1),0 3px 3px 0 rgba(0,0,0,.05));height:var(--switch-node-size,.867em);left:0;position:absolute;top:0;transition:var(--switch-transition-duration,.3s) cubic-bezier(.3,1.05,.4,1.05);width:var(--switch-node-size,.867em);z-index:var(--switch-node-z-index,1)}.smart-switch__loading{left:50%;position:absolute!important;top:50%;transform:translate(-50%,-50%)}.smart-switch--on{background-color:var(--switch-on-background-color,#1989fa)}.smart-switch--on .smart-switch__node{background-color:var(--switch-node-on-background-color,var(--switch-node-background-color,#fff));transform:translateX(calc(var(--switch-width, 1.5338em) - var(--switch-node-size, .867em)))}.smart-switch--disabled{opacity:var(--switch-disabled-opacity,.4)}
@@ -1 +1 @@
1
- @import '../common/index.wxss';.smart-switch{background-color:var(--switch-background-color,var(--app-B4-N6,rgba(0,0,0,.2)));border-radius:var(--switch-node-size,.867em);height:var(--switch-height,.867em);padding:var(--switch-padding,.08em);transition:background-color var(--switch-transition-duration,.3s);vertical-align:middle;width:var(--switch-width,1.5338em)}.smart-switch,.smart-switch__center{box-sizing:initial;display:inline-block}.smart-switch__center{height:100%;position:relative;vertical-align:top;width:100%}.smart-switch__node{background-color:var(--switch-node-background-color,#fff);border-radius:100%;box-shadow:var(--switch-node-box-shadow,0 3px 1px 0 rgba(0,0,0,.05),0 2px 2px 0 rgba(0,0,0,.1),0 3px 3px 0 rgba(0,0,0,.05));height:var(--switch-node-size,.867em);left:0;position:absolute;top:0;transition:var(--switch-transition-duration,.3s) cubic-bezier(.3,1.05,.4,1.05);width:var(--switch-node-size,.867em);z-index:var(--switch-node-z-index,1)}.smart-switch__loading{left:50%;position:absolute!important;top:50%;transform:translate(-50%,-50%)}.smart-switch--on{background-color:var(--switch-on-background-color,#1989fa)}.smart-switch--on .smart-switch__node{background-color:var(--switch-node-on-background-color,var(--switch-node-background-color,#fff));transform:translateX(calc(var(--switch-width, 1.5338em) - var(--switch-node-size, .867em)))}.smart-switch--disabled{opacity:var(--switch-disabled-opacity,.4)}
1
+ @import '../common/index.wxss';.smart-switch{background-color:var(--switch-background-color,var(--app-B4-N6,rgba(0,0,0,.2)));border-radius:var(--switch-node-size,.867em);height:var(--switch-height,.867em);padding:var(--switch-border,var(--switch-padding,.08em));transition:background-color var(--switch-transition-duration,.3s);vertical-align:middle;width:var(--switch-width,1.5338em)}.smart-switch,.smart-switch__center{box-sizing:initial;display:inline-block}.smart-switch__center{height:100%;position:relative;vertical-align:top;width:100%}.smart-switch__node{background-color:var(--switch-node-background-color,#fff);border-radius:100%;box-shadow:var(--switch-node-box-shadow,0 3px 1px 0 rgba(0,0,0,.05),0 2px 2px 0 rgba(0,0,0,.1),0 3px 3px 0 rgba(0,0,0,.05));height:var(--switch-node-size,.867em);left:0;position:absolute;top:0;transition:var(--switch-transition-duration,.3s) cubic-bezier(.3,1.05,.4,1.05);width:var(--switch-node-size,.867em);z-index:var(--switch-node-z-index,1)}.smart-switch__loading{left:50%;position:absolute!important;top:50%;transform:translate(-50%,-50%)}.smart-switch--on{background-color:var(--switch-on-background-color,#1989fa)}.smart-switch--on .smart-switch__node{background-color:var(--switch-node-on-background-color,var(--switch-node-background-color,#fff));transform:translateX(calc(var(--switch-width, 1.5338em) - var(--switch-node-size, .867em)))}.smart-switch--disabled{opacity:var(--switch-disabled-opacity,.4)}
@@ -16,7 +16,7 @@
16
16
  >
17
17
 
18
18
  <!-- text only -->
19
- <text wx:if="{{ type === 'text' }}">{{ message }}</text>
19
+ <text class="smart-toast__text" wx:if="{{ type === 'text' }}">{{ message }}</text>
20
20
 
21
21
  <!-- html only -->
22
22
  <rich-text wx:elif="{{ type === 'html' }}" nodes="{{ message }}"></rich-text>
@@ -18,6 +18,7 @@ exports.contextRef = void 0;
18
18
  var appLog_1 = __importDefault(require("../common/appLog"));
19
19
  var utils_1 = require("../common/utils");
20
20
  var validator_1 = require("../common/validator");
21
+ var ty_1 = __importDefault(require("../common/ty"));
21
22
  var defaultOptions = {
22
23
  type: 'text',
23
24
  mask: false,
@@ -48,7 +49,6 @@ exports.contextRef = {
48
49
  value: {},
49
50
  };
50
51
  function Toast(toastOptions) {
51
- var _a, _b;
52
52
  var options = __assign(__assign({}, currentOptions), parseOptions(toastOptions));
53
53
  appLog_1.default.info('start open Toast');
54
54
  var context = (typeof options.context === 'function' ? options.context() : options.context) ||
@@ -65,11 +65,9 @@ function Toast(toastOptions) {
65
65
  delete options.context;
66
66
  delete options.selector;
67
67
  toast.clear = function () {
68
- var _a;
69
68
  toast.setData({ show: false });
70
69
  if (options.nativeDisabled) {
71
- // @ts-ignore
72
- (_a = ty === null || ty === void 0 ? void 0 : ty.nativeDisabled) === null || _a === void 0 ? void 0 : _a.call(ty, false);
70
+ ty_1.default.nativeDisabled(false);
73
71
  }
74
72
  preDisRef.value[options.selector] = false;
75
73
  if (options.onClose) {
@@ -79,12 +77,10 @@ function Toast(toastOptions) {
79
77
  queueRef.value.push(toast);
80
78
  toast.setData(options);
81
79
  if (options.nativeDisabled) {
82
- // @ts-ignore
83
- (_a = ty === null || ty === void 0 ? void 0 : ty.nativeDisabled) === null || _a === void 0 ? void 0 : _a.call(ty, true);
80
+ ty_1.default.nativeDisabled(true);
84
81
  }
85
82
  if (preDisRef.value[options.selector] && !options.nativeDisabled) {
86
- // @ts-ignore
87
- (_b = ty === null || ty === void 0 ? void 0 : ty.nativeDisabled) === null || _b === void 0 ? void 0 : _b.call(ty, false);
83
+ ty_1.default.nativeDisabled(false);
88
84
  }
89
85
  preDisRef.value[options.selector] = options.nativeDisabled || false;
90
86
  clearTimeout(toast.timer);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tuya-miniapp/smart-ui",
3
- "version": "2.4.1-beta-4",
3
+ "version": "2.5.0",
4
4
  "author": "MiniApp Team",
5
5
  "license": "MIT",
6
6
  "miniprogram": "lib",