@tuya-miniapp/smart-ui 2.9.3-beta-0 → 2.9.3-beta-2

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.
@@ -43,6 +43,7 @@ interface DialogOptions {
43
43
  confirmButtonOpenType?: string;
44
44
  value?: null | string;
45
45
  ignoreQueue?: boolean;
46
+ emptyDisabled?: boolean;
46
47
  password?: boolean;
47
48
  placeholder?: string;
48
49
  maxlength?: number;
@@ -29,6 +29,7 @@ const defaultOptions = {
29
29
  ignoreQueue: false,
30
30
  value: null,
31
31
  password: false,
32
+ emptyDisabled: false,
32
33
  placeholder: '',
33
34
  maxlength: 20,
34
35
  };
@@ -117,7 +117,7 @@
117
117
  size="large"
118
118
  class="smart-dialog__button"
119
119
  loading="{{ loading.confirm }}"
120
- custom-class="smart-dialog__confirm {{ !inputValue && emptyDisabled ? 'smart-dialog__confirm--disabled' : '' }} confirm-button-class"
120
+ custom-class="smart-dialog__confirm {{ inputValue === '' && emptyDisabled ? 'smart-dialog__confirm--disabled' : '' }} confirm-button-class"
121
121
  custom-style="color: {{ confirmButtonColor || 'var(--dialog-confirm-color, var(--app-B4-N1, rgba(0, 0, 0, 1)))' }}"
122
122
  button-id="{{ confirmButtonId }}"
123
123
  open-type="{{ confirmButtonOpenType }}"
@@ -26,6 +26,7 @@
26
26
  options="{{ item.values }}"
27
27
  disabled="{{ item.disabled || false }}"
28
28
  unit="{{ item.unit || unit }}"
29
+ unit-gap="{{ item.unitGap }}"
29
30
  changeAnimation="{{ changeAnimation }}"
30
31
  default-index="{{ item.defaultIndex || defaultIndex }}"
31
32
  active-index="{{ (item.activeIndex === null || item.activeIndex === undefined) ? activeIndex : item.activeIndex }}"
@@ -57,6 +57,10 @@ SmartComponent({
57
57
  type: String,
58
58
  value: '',
59
59
  },
60
+ unitGap: {
61
+ type: null,
62
+ value: undefined,
63
+ },
60
64
  animationTime: {
61
65
  type: Number,
62
66
  value: 300,
@@ -53,7 +53,7 @@
53
53
  <view wx:if="{{unit}}" class="smart-picker-column__unit" style="height: {{ itemHeight }}px">
54
54
  <view class="smart-picker-column__max-text" style="{{fontStyle}}">
55
55
  {{ maxText }}
56
- <view class="smart-picker-column__unit_text" >{{unit}}</view>
56
+ <view class="smart-picker-column__unit_text" style="{{computed.unitGapStyle(unitGap)}}">{{unit}}</view>
57
57
  </view>
58
58
  </view>
59
59
 
@@ -3,6 +3,15 @@ var style = require('../wxs/style.wxs');
3
3
  var addUnit = require('../wxs/add-unit.wxs');
4
4
  var wxUtils = require('../wxs/utils.wxs');
5
5
 
6
+ function unitGapStyle(unitGap) {
7
+ if (unitGap === undefined || unitGap === null) {
8
+ return '';
9
+ }
10
+ return style({
11
+ 'margin-left': addUnit(unitGap)
12
+ });
13
+ }
14
+
6
15
  function setStyle(ownerInstance, style, selector) {
7
16
  var dom = wxUtils.queryComponent(ownerInstance, selector);
8
17
  if (!dom) {
@@ -628,4 +637,5 @@ module.exports = {
628
637
  touchMove: touchMove,
629
638
  touchEnd: touchEnd,
630
639
  tapItem: tapItem,
640
+ unitGapStyle: unitGapStyle,
631
641
  };
@@ -43,6 +43,7 @@ interface DialogOptions {
43
43
  confirmButtonOpenType?: string;
44
44
  value?: null | string;
45
45
  ignoreQueue?: boolean;
46
+ emptyDisabled?: boolean;
46
47
  password?: boolean;
47
48
  placeholder?: string;
48
49
  maxlength?: number;
@@ -46,6 +46,7 @@ var defaultOptions = {
46
46
  ignoreQueue: false,
47
47
  value: null,
48
48
  password: false,
49
+ emptyDisabled: false,
49
50
  placeholder: '',
50
51
  maxlength: 20,
51
52
  };
@@ -117,7 +117,7 @@
117
117
  size="large"
118
118
  class="smart-dialog__button"
119
119
  loading="{{ loading.confirm }}"
120
- custom-class="smart-dialog__confirm {{ !inputValue && emptyDisabled ? 'smart-dialog__confirm--disabled' : '' }} confirm-button-class"
120
+ custom-class="smart-dialog__confirm {{ inputValue === '' && emptyDisabled ? 'smart-dialog__confirm--disabled' : '' }} confirm-button-class"
121
121
  custom-style="color: {{ confirmButtonColor || 'var(--dialog-confirm-color, var(--app-B4-N1, rgba(0, 0, 0, 1)))' }}"
122
122
  button-id="{{ confirmButtonId }}"
123
123
  open-type="{{ confirmButtonOpenType }}"
@@ -26,6 +26,7 @@
26
26
  options="{{ item.values }}"
27
27
  disabled="{{ item.disabled || false }}"
28
28
  unit="{{ item.unit || unit }}"
29
+ unit-gap="{{ item.unitGap }}"
29
30
  changeAnimation="{{ changeAnimation }}"
30
31
  default-index="{{ item.defaultIndex || defaultIndex }}"
31
32
  active-index="{{ (item.activeIndex === null || item.activeIndex === undefined) ? activeIndex : item.activeIndex }}"
@@ -62,6 +62,10 @@ var getId = function () {
62
62
  type: String,
63
63
  value: '',
64
64
  },
65
+ unitGap: {
66
+ type: null,
67
+ value: undefined,
68
+ },
65
69
  animationTime: {
66
70
  type: Number,
67
71
  value: 300,
@@ -53,7 +53,7 @@
53
53
  <view wx:if="{{unit}}" class="smart-picker-column__unit" style="height: {{ itemHeight }}px">
54
54
  <view class="smart-picker-column__max-text" style="{{fontStyle}}">
55
55
  {{ maxText }}
56
- <view class="smart-picker-column__unit_text" >{{unit}}</view>
56
+ <view class="smart-picker-column__unit_text" style="{{computed.unitGapStyle(unitGap)}}">{{unit}}</view>
57
57
  </view>
58
58
  </view>
59
59
 
@@ -3,6 +3,15 @@ var style = require('../wxs/style.wxs');
3
3
  var addUnit = require('../wxs/add-unit.wxs');
4
4
  var wxUtils = require('../wxs/utils.wxs');
5
5
 
6
+ function unitGapStyle(unitGap) {
7
+ if (unitGap === undefined || unitGap === null) {
8
+ return '';
9
+ }
10
+ return style({
11
+ 'margin-left': addUnit(unitGap)
12
+ });
13
+ }
14
+
6
15
  function setStyle(ownerInstance, style, selector) {
7
16
  var dom = wxUtils.queryComponent(ownerInstance, selector);
8
17
  if (!dom) {
@@ -628,4 +637,5 @@ module.exports = {
628
637
  touchMove: touchMove,
629
638
  touchEnd: touchEnd,
630
639
  tapItem: tapItem,
640
+ unitGapStyle: unitGapStyle,
631
641
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tuya-miniapp/smart-ui",
3
- "version": "2.9.3-beta-0",
3
+ "version": "2.9.3-beta-2",
4
4
  "author": "MiniApp Team",
5
5
  "license": "MIT",
6
6
  "miniprogram": "lib",