@tuya-miniapp/smart-ui 2.4.1-beta-5 → 2.5.1-beta-1

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 (83) hide show
  1. package/dist/action-sheet/index.js +3 -1
  2. package/dist/action-sheet/index.wxml +1 -1
  3. package/dist/bottom-sheet/index.css +1 -1
  4. package/dist/bottom-sheet/index.js +3 -4
  5. package/dist/bottom-sheet/index.wxml +5 -1
  6. package/dist/bottom-sheet/index.wxs +1 -1
  7. package/dist/bottom-sheet/index.wxss +1 -1
  8. package/dist/button/index.js +2 -7
  9. package/dist/calendar/index.wxs +3 -3
  10. package/dist/calendar-header/index.js +2 -2
  11. package/dist/calendar-month/index.wxs +2 -2
  12. package/dist/cascader/index.js +1 -1
  13. package/dist/cell/index.js +4 -4
  14. package/dist/checkbox/index.js +1 -1
  15. package/dist/common/appLog.js +1 -1
  16. package/dist/common/ty.d.ts +7 -0
  17. package/dist/common/ty.js +33 -0
  18. package/dist/custom-keyboard/index.wxml +3 -7
  19. package/dist/dialog/index.js +1 -1
  20. package/dist/dropdown-item/index.js +3 -3
  21. package/dist/dropdown-menu/index.js +4 -4
  22. package/dist/field/index.js +1 -1
  23. package/dist/image/index.js +2 -2
  24. package/dist/image/index.wxs +1 -1
  25. package/dist/loading/index.wxs +2 -2
  26. package/dist/mixins/transition.js +4 -6
  27. package/dist/nav-bar/index.js +1 -1
  28. package/dist/notice-bar/index.js +2 -2
  29. package/dist/picker-column/index.js +1 -1
  30. package/dist/picker-column/index.wxs +4 -4
  31. package/dist/popup/index.js +1 -1
  32. package/dist/popup/index.wxs +1 -1
  33. package/dist/radio/index.js +2 -2
  34. package/dist/rate/index.js +2 -2
  35. package/dist/search/index.js +2 -2
  36. package/dist/stepper/index.js +3 -3
  37. package/dist/steps/index.js +1 -1
  38. package/dist/tag/index.js +1 -1
  39. package/dist/toast/icons.js +3 -3
  40. package/dist/toast/toast.js +4 -8
  41. package/dist/tree-select/index.js +2 -2
  42. package/lib/action-sheet/index.js +4 -2
  43. package/lib/action-sheet/index.wxml +1 -1
  44. package/lib/bottom-sheet/index.css +1 -1
  45. package/lib/bottom-sheet/index.js +4 -5
  46. package/lib/bottom-sheet/index.wxml +5 -1
  47. package/lib/bottom-sheet/index.wxs +1 -1
  48. package/lib/bottom-sheet/index.wxss +1 -1
  49. package/lib/button/index.js +2 -7
  50. package/lib/calendar/index.wxs +3 -3
  51. package/lib/calendar-header/index.js +4 -7
  52. package/lib/calendar-month/index.wxs +2 -2
  53. package/lib/cascader/index.js +2 -5
  54. package/lib/cell/index.js +9 -12
  55. package/lib/checkbox/index.js +2 -5
  56. package/lib/common/appLog.js +1 -1
  57. package/lib/common/ty.d.ts +7 -0
  58. package/lib/common/ty.js +35 -0
  59. package/lib/custom-keyboard/index.wxml +3 -7
  60. package/lib/dialog/index.js +2 -2
  61. package/lib/dropdown-item/index.js +4 -4
  62. package/lib/dropdown-menu/index.js +4 -4
  63. package/lib/field/index.js +2 -5
  64. package/lib/image/index.js +2 -5
  65. package/lib/image/index.wxs +1 -1
  66. package/lib/loading/index.wxs +2 -2
  67. package/lib/mixins/transition.js +11 -10
  68. package/lib/nav-bar/index.js +2 -5
  69. package/lib/notice-bar/index.js +4 -7
  70. package/lib/picker-column/index.js +5 -2
  71. package/lib/picker-column/index.wxs +4 -4
  72. package/lib/popup/index.js +3 -6
  73. package/lib/popup/index.wxs +1 -1
  74. package/lib/radio/index.js +2 -5
  75. package/lib/rate/index.js +4 -7
  76. package/lib/search/index.js +4 -7
  77. package/lib/stepper/index.js +6 -6
  78. package/lib/steps/index.js +2 -5
  79. package/lib/tag/index.js +2 -5
  80. package/lib/toast/icons.js +6 -9
  81. package/lib/toast/toast.js +4 -8
  82. package/lib/tree-select/index.js +2 -5
  83. package/package.json +1 -1
@@ -1,5 +1,6 @@
1
- import checkMarkIcon from '@tuya-miniapp/icons/dist/svg/Check';
1
+ import { Check as checkMarkIcon } from '@tuya-miniapp/icons';
2
2
  import { SmartComponent } from '../common/component';
3
+ import ty from '../common/ty';
3
4
  import { button } from '../mixins/button';
4
5
  SmartComponent({
5
6
  classes: ['list-class'],
@@ -51,6 +52,7 @@ SmartComponent({
51
52
  },
52
53
  data: {
53
54
  checkMarkIcon,
55
+ isWX: ty.isWX(),
54
56
  },
55
57
  methods: {
56
58
  onSelect(event) {
@@ -26,7 +26,7 @@
26
26
  <view wx:if="{{ description }}" class="smart-action-sheet__description smart-hairline--bottom">
27
27
  {{ description }}
28
28
  </view>
29
- <scroll-view wx:if="{{ actions && actions.length }}" class="smart-action-sheet__list list-class">
29
+ <scroll-view scroll-y="{{isWX}}" wx:if="{{ actions && actions.length }}" class="smart-action-sheet__list list-class">
30
30
  <!-- button外包一层view,防止actions动态变化,导致渲染时button被打散 -->
31
31
  <button
32
32
  wx:for="{{ actions }}"
@@ -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%);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
+ @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{box-sizing:border-box;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,5 +1,6 @@
1
- import xmarkIcon from '@tuya-miniapp/icons/dist/svg/Xmark';
1
+ import { Xmark as xmarkIcon } from '@tuya-miniapp/icons';
2
2
  import { SmartComponent } from '../common/component';
3
+ import ty from '../common/ty';
3
4
  SmartComponent({
4
5
  props: {
5
6
  show: Boolean,
@@ -37,9 +38,7 @@ SmartComponent({
37
38
  xmarkIconColor: 'rgba(0, 0, 0, 0.5)',
38
39
  },
39
40
  mounted() {
40
- var _a;
41
- // @ts-ignore
42
- const themeInfo = (_a = ty === null || ty === void 0 ? void 0 : ty.getThemeInfo()) !== null && _a !== void 0 ? _a : {};
41
+ const themeInfo = ty.getThemeInfo() || {};
43
42
  const xmarkIconColor = this.data.iconColor || themeInfo['--app-B4-N3'] || 'rgba(0, 0, 0, 0.5)';
44
43
  this.setData({ xmarkIconColor });
45
44
  },
@@ -25,7 +25,11 @@
25
25
  {{ title }}
26
26
  <smart-icon bind:click="onClose" name="{{ xmarkIcon }}" class="smart-bottom-sheet__icon" size="{{ iconSize }}" color="{{ xmarkIconColor }}" />
27
27
  </view>
28
- <scroll-view class="smart-bottom-sheet__content" style="{{computed.getHeight(contentHeight)}}">
28
+
29
+ <view wx:if="{{ contentHeight !== null }}" class="smart-bottom-sheet__content" style="{{computed.getHeight(contentHeight)}}">
30
+ <slot />
31
+ </view>
32
+ <scroll-view wx:else class="smart-bottom-sheet__content">
29
33
  <slot />
30
34
  </scroll-view>
31
35
  </smart-popup>
@@ -1,5 +1,5 @@
1
1
  function getHeight(contentHeight) {
2
- const height = contentHeight
2
+ var height = contentHeight
3
3
  ? typeof contentHeight === 'number'
4
4
  ? contentHeight + 'rpx'
5
5
  : contentHeight
@@ -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%);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
+ @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{box-sizing:border-box;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
 
@@ -1,6 +1,6 @@
1
1
  import { SmartComponent } from '../common/component';
2
- import LeftIcon from '@tuya-miniapp/icons/dist/svg/Left';
3
- import RightIcon from '@tuya-miniapp/icons/dist/svg/Right';
2
+ import { Left as LeftIcon } from '@tuya-miniapp/icons';
3
+ import { Right as RightIcon } from '@tuya-miniapp/icons';
4
4
  SmartComponent({
5
5
  props: {
6
6
  title: {
@@ -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
 
@@ -1,5 +1,5 @@
1
1
  import { SmartComponent } from '../common/component';
2
- import closeIcon from '@tuya-miniapp/icons/dist/svg/Xmark';
2
+ import { Xmark as closeIcon } from '@tuya-miniapp/icons';
3
3
  SmartComponent({
4
4
  props: {
5
5
  title: String,
@@ -1,7 +1,7 @@
1
- import upIcon from '@tuya-miniapp/icons/dist/svg/Up';
2
- import downIcon from '@tuya-miniapp/icons/dist/svg/Down';
3
- import leftIcon from '@tuya-miniapp/icons/dist/svg/Left';
4
- import rightIcon from '@tuya-miniapp/icons/dist/svg/Right';
1
+ import { Up as upIcon } from '@tuya-miniapp/icons';
2
+ import { Down as downIcon } from '@tuya-miniapp/icons';
3
+ import { Left as leftIcon } from '@tuya-miniapp/icons';
4
+ import { Right as rightIcon } from '@tuya-miniapp/icons';
5
5
  import { link } from '../mixins/link';
6
6
  import { SmartComponent } from '../common/component';
7
7
  SmartComponent({
@@ -1,4 +1,4 @@
1
- import CheckIcon from '@tuya-miniapp/icons/dist/svg/Check';
1
+ import { Check as CheckIcon } from '@tuya-miniapp/icons';
2
2
  import { useParent } from '../common/relation';
3
3
  import { SmartComponent } from '../common/component';
4
4
  function emit(target, value) {
@@ -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,7 @@
1
+ declare const tyApi: {
2
+ vibrateShort: (v: any) => void;
3
+ nativeDisabled: (v: boolean) => void;
4
+ getThemeInfo: () => any;
5
+ isWX: () => boolean;
6
+ };
7
+ export default tyApi;
@@ -0,0 +1,33 @@
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
+ getThemeInfo: () => {
21
+ var _a;
22
+ // @ts-ignore
23
+ if (typeof ty !== 'undefined') {
24
+ // @ts-ignore
25
+ return (_a = ty.getThemeInfo) === null || _a === void 0 ? void 0 : _a.call(ty);
26
+ }
27
+ },
28
+ isWX: () => {
29
+ // @ts-ignore
30
+ return typeof ty === 'undefined' && !!wx;
31
+ },
32
+ };
33
+ export default tyApi;
@@ -1,8 +1,6 @@
1
1
  <view class="{{prefix}} {{prefix}}-container" style="{{inputContainerStyle}}">
2
2
  <view class="{{prefix}}-textView" bind:tap="handlePassword">
3
- <text class="{{prefix}}-pwdText {{currValue !== '' ? prefix + '-password' : null}}" style="{{valueTextStyle}}">
4
- {{currValue || placeholder}}
5
- </text>
3
+ <text class="{{prefix}}-pwdText {{currValue !== '' ? prefix + '-password' : null}}" style="{{valueTextStyle}}">{{currValue || placeholder}}</text>
6
4
  </view>
7
5
  <slot name="custom-button" />
8
6
  </view>
@@ -14,7 +12,7 @@
14
12
  >
15
13
  <view class="{{prefix}}-popup-container">
16
14
  <view class="{{prefix}}-number-wrap" style="height: {{row * 56}}px">
17
- <view wx:for="{{numberArray}}" wx:key="index" bind:tap="changeValue" hover-class="{{prefix}}-hover-class" data-item="{{ item }}" class="{{prefix}}-number-item" style="{{(item === 0 || item === 10) && numberArray.length === 11 ? 'width: 175px' : ''}}">
15
+ <view wx:for="{{numberArray}}" wx:key="index" bind:tap="changeValue" hover-class="{{prefix}}-hover-class" data-item="{{ item }}" class="{{prefix}}-number-item" style="{{(item === 0 || item === 10) && numberArray.length === 11 ? 'width: 345rpx' : ''}}">
18
16
  <view
19
17
  wx:if="{{item === -2}}"
20
18
  class="{{prefix}}-hidden-image"
@@ -39,9 +37,7 @@
39
37
  bind:tap="confirm"
40
38
  hover-class="{{prefix}}-hover-class"
41
39
  >
42
- <text class="{{prefix}}-confirm-text" style="{{confirmTextStyle}}">
43
- {{confirmText}}
44
- </text>
40
+ <text class="{{prefix}}-confirm-text" space="false" style="{{confirmTextStyle}}">{{confirmText}}</text>
45
41
  </button >
46
42
  </view>
47
43
  </view>
@@ -1,4 +1,4 @@
1
- import warningIcon from '@tuya-miniapp/icons/dist/svg/Warning';
1
+ import { Warning as warningIcon } from '@tuya-miniapp/icons';
2
2
  import { SmartComponent } from '../common/component';
3
3
  import { button } from '../mixins/button';
4
4
  import appLog from '../common/appLog';
@@ -1,6 +1,7 @@
1
1
  import { useParent } from '../common/relation';
2
2
  import { SmartComponent } from '../common/component';
3
- import checkMarkIcon from '@tuya-miniapp/icons/dist/svg/Check';
3
+ import { Check as checkMarkIcon } from '@tuya-miniapp/icons';
4
+ import ty from '../common/ty';
4
5
  SmartComponent({
5
6
  classes: ['item-title-class'],
6
7
  field: true,
@@ -48,8 +49,7 @@ SmartComponent({
48
49
  },
49
50
  mounted() {
50
51
  var _a;
51
- // @ts-ignore
52
- const themeInfo = (_a = ty === null || ty === void 0 ? void 0 : ty.getThemeInfo()) !== null && _a !== void 0 ? _a : {};
52
+ const themeInfo = (_a = ty.getThemeInfo()) !== null && _a !== void 0 ? _a : {};
53
53
  const checkMarkIconColor = this.data.activeColor || themeInfo['--app-M1'] || '#3678E3';
54
54
  this.setData({ checkMarkIconColor });
55
55
  },
@@ -1,7 +1,8 @@
1
1
  import { SmartComponent } from '../common/component';
2
2
  import { useChildren } from '../common/relation';
3
3
  import { addUnit, getRect, getSystemInfoSync } from '../common/utils';
4
- import triangleDown from '@tuya-miniapp/icons/dist/svg/TriangleDown';
4
+ import { TriangleDown } from '@tuya-miniapp/icons';
5
+ import ty from '../common/ty';
5
6
  let ARRAY = [];
6
7
  SmartComponent({
7
8
  field: true,
@@ -53,14 +54,13 @@ SmartComponent({
53
54
  },
54
55
  },
55
56
  data: {
56
- triangleDown,
57
+ triangleDown: TriangleDown,
57
58
  activeColorStatic: '',
58
59
  itemListData: [],
59
60
  },
60
61
  mounted() {
61
62
  var _a;
62
- // @ts-ignore
63
- const themeInfo = (_a = ty === null || ty === void 0 ? void 0 : ty.getThemeInfo()) !== null && _a !== void 0 ? _a : {};
63
+ const themeInfo = (_a = ty.getThemeInfo()) !== null && _a !== void 0 ? _a : {};
64
64
  const activeColorStatic = this.data.activeColor || themeInfo['--app-M1'] || '#3678E3';
65
65
  this.setData({ activeColorStatic });
66
66
  },
@@ -1,7 +1,7 @@
1
1
  import { nextTick } from '../common/utils';
2
2
  import { SmartComponent } from '../common/component';
3
3
  import { commonProps, inputProps, textareaProps } from './props';
4
- import Xmark from '@tuya-miniapp/icons/dist/svg/Xmark';
4
+ import { Xmark } from '@tuya-miniapp/icons';
5
5
  SmartComponent({
6
6
  field: true,
7
7
  classes: ['input-class', 'right-icon-class', 'label-class'],
@@ -1,6 +1,6 @@
1
1
  import { SmartComponent } from '../common/component';
2
2
  import { button } from '../mixins/button';
3
- import LoadingSvg from '@tuya-miniapp/icons/dist/svg/Loading';
3
+ import { Loading } from '@tuya-miniapp/icons';
4
4
  SmartComponent({
5
5
  mixins: [button],
6
6
  classes: ['custom-class', 'loading-class', 'error-class', 'image-class'],
@@ -46,7 +46,7 @@ SmartComponent({
46
46
  data: {
47
47
  error: false,
48
48
  loading: true,
49
- loadingSvg: LoadingSvg,
49
+ loadingSvg: Loading,
50
50
  viewStyle: '',
51
51
  },
52
52
  methods: {
@@ -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
  });
@@ -1,4 +1,4 @@
1
- import Left from '@tuya-miniapp/icons/dist/svg/Left';
1
+ import { Left } from '@tuya-miniapp/icons';
2
2
  import { SmartComponent } from '../common/component';
3
3
  import { getRect, getSystemInfoSync } from '../common/utils';
4
4
  SmartComponent({
@@ -1,7 +1,7 @@
1
1
  import { SmartComponent } from '../common/component';
2
2
  import { getRect, requestAnimationFrame } from '../common/utils';
3
- import Xmark from '@tuya-miniapp/icons/dist/svg/Xmark';
4
- import Right from '@tuya-miniapp/icons/dist/svg/Right';
3
+ import { Xmark } from '@tuya-miniapp/icons';
4
+ import { Right } from '@tuya-miniapp/icons';
5
5
  SmartComponent({
6
6
  props: {
7
7
  text: {
@@ -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})`
@@ -1,4 +1,4 @@
1
- import closeIcon from '@tuya-miniapp/icons/dist/svg/Xmark';
1
+ import { Xmark as closeIcon } from '@tuya-miniapp/icons';
2
2
  import { SmartComponent } from '../common/component';
3
3
  import { transition } from '../mixins/transition';
4
4
  import { getSafeBottomOffset } from '../common/utils';
@@ -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,4 +1,4 @@
1
- import CheckIcon from '@tuya-miniapp/icons/dist/svg/Check';
1
+ import { Check } from '@tuya-miniapp/icons';
2
2
  import { canIUseModel } from '../common/version';
3
3
  import { SmartComponent } from '../common/component';
4
4
  import { useParent } from '../common/relation';
@@ -31,7 +31,7 @@ SmartComponent({
31
31
  data: {
32
32
  direction: '',
33
33
  parentDisabled: false,
34
- icon: CheckIcon,
34
+ icon: Check,
35
35
  preventDefault: false,
36
36
  },
37
37
  methods: {
@@ -1,5 +1,5 @@
1
- import CheckmarkCircle from '@tuya-miniapp/icons/dist/svg/CheckmarkCircle';
2
- import CheckmarkCircleVoid from '@tuya-miniapp/icons/dist/svg/CheckmarkCircleVoid';
1
+ import { CheckmarkCircle } from '@tuya-miniapp/icons';
2
+ import { CheckmarkCircleVoid } from '@tuya-miniapp/icons';
3
3
  import { getAllRect } from '../common/utils';
4
4
  import { SmartComponent } from '../common/component';
5
5
  import { canIUseModel } from '../common/version';
@@ -1,7 +1,7 @@
1
1
  import { SmartComponent } from '../common/component';
2
2
  import { canIUseModel } from '../common/version';
3
- import SearchIcon from '@tuya-miniapp/icons/dist/svg/Search';
4
- import CloseIcon from '@tuya-miniapp/icons/dist/svg/Close';
3
+ import { Search as SearchIcon } from '@tuya-miniapp/icons';
4
+ import { Close as CloseIcon } from '@tuya-miniapp/icons';
5
5
  SmartComponent({
6
6
  field: true,
7
7
  classes: ['field-class', 'input-class', 'cancel-class'],
@@ -1,7 +1,8 @@
1
1
  import { SmartComponent } from '../common/component';
2
2
  import { isDef } from '../common/validator';
3
- import Minus from '@tuya-miniapp/icons/dist/svg/Minus';
4
- import Plus from '@tuya-miniapp/icons/dist/svg/Plus';
3
+ import ty from '../common/ty';
4
+ import { Minus } from '@tuya-miniapp/icons';
5
+ import { Plus } from '@tuya-miniapp/icons';
5
6
  const LONG_PRESS_START_TIME = 600;
6
7
  const LONG_PRESS_INTERVAL = 200;
7
8
  // add num and avoid float number
@@ -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,4 +1,4 @@
1
- import Checkmark from '@tuya-miniapp/icons/dist/svg/Checkmark';
1
+ import { Checkmark } from '@tuya-miniapp/icons';
2
2
  import { SmartComponent } from '../common/component';
3
3
  import { GREEN, GRAY_DARK } from '../common/color';
4
4
  SmartComponent({
package/dist/tag/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import Xmark from '@tuya-miniapp/icons/dist/svg/Xmark';
1
+ import { Xmark } from '@tuya-miniapp/icons';
2
2
  import { SmartComponent } from '../common/component';
3
3
  SmartComponent({
4
4
  props: {
@@ -1,6 +1,6 @@
1
- import Warning from '@tuya-miniapp/icons/dist/svg/Warning';
2
- import CheckmarkCircle from '@tuya-miniapp/icons/dist/svg/CheckmarkCircle';
3
- import Cancel from '@tuya-miniapp/icons/dist/svg/Cancel';
1
+ import { Warning } from '@tuya-miniapp/icons';
2
+ import { CheckmarkCircle } from '@tuya-miniapp/icons';
3
+ import { Cancel } from '@tuya-miniapp/icons';
4
4
  export const Success = CheckmarkCircle;
5
5
  export const Alarm = Warning;
6
6
  export const Error = Cancel;
@@ -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,4 +1,4 @@
1
- import IconCheckmark from '@tuya-miniapp/icons/dist/svg/Check';
1
+ import { Check } from '@tuya-miniapp/icons';
2
2
  import { SmartComponent } from '../common/component';
3
3
  SmartComponent({
4
4
  classes: [
@@ -30,7 +30,7 @@ SmartComponent({
30
30
  },
31
31
  selectedIcon: {
32
32
  type: String,
33
- value: IconCheckmark,
33
+ value: Check,
34
34
  },
35
35
  },
36
36
  data: {