@tuya-miniapp/smart-ui 2.9.3-beta-0 → 2.9.3-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.
@@ -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
  };
@@ -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-1",
4
4
  "author": "MiniApp Team",
5
5
  "license": "MIT",
6
6
  "miniprogram": "lib",