@tuya-miniapp/smart-ui 2.9.2 → 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.
- package/dist/dialog/dialog.d.ts +1 -0
- package/dist/dialog/dialog.js +1 -1
- package/dist/dialog/index.js +6 -1
- package/dist/picker/index.wxml +1 -0
- package/dist/picker-column/index.js +4 -0
- package/dist/picker-column/index.wxml +1 -1
- package/dist/picker-column/index.wxs +10 -0
- package/lib/dialog/dialog.d.ts +1 -0
- package/lib/dialog/dialog.js +1 -3
- package/lib/dialog/index.js +6 -1
- package/lib/picker/index.wxml +1 -0
- package/lib/picker-column/index.js +4 -0
- package/lib/picker-column/index.wxml +1 -1
- package/lib/picker-column/index.wxs +10 -0
- package/package.json +1 -1
package/dist/dialog/dialog.d.ts
CHANGED
package/dist/dialog/dialog.js
CHANGED
|
@@ -90,7 +90,7 @@ const Dialog = (options) => {
|
|
|
90
90
|
};
|
|
91
91
|
Dialog.alert = (options) => Dialog(options);
|
|
92
92
|
Dialog.confirm = (options) => Dialog(Object.assign({ showCancelButton: true }, options));
|
|
93
|
-
Dialog.input = ((options) => Dialog(Object.assign({ showCancelButton: true }, options)));
|
|
93
|
+
Dialog.input = ((options) => { var _a; return Dialog(Object.assign(Object.assign({ showCancelButton: true }, options), { value: (_a = options.value) !== null && _a !== void 0 ? _a : '' })); });
|
|
94
94
|
Dialog.close = () => {
|
|
95
95
|
queueRef.value.forEach(dialog => {
|
|
96
96
|
dialog.close();
|
package/dist/dialog/index.js
CHANGED
|
@@ -103,6 +103,7 @@ SmartComponent({
|
|
|
103
103
|
},
|
|
104
104
|
actionType: '',
|
|
105
105
|
callback: (() => { }),
|
|
106
|
+
onInput: (() => { }),
|
|
106
107
|
},
|
|
107
108
|
mounted: function () {
|
|
108
109
|
if (!this.id)
|
|
@@ -133,7 +134,11 @@ SmartComponent({
|
|
|
133
134
|
},
|
|
134
135
|
onInput(evt) {
|
|
135
136
|
var _a, _b;
|
|
136
|
-
|
|
137
|
+
const inputValue = (_b = (_a = evt === null || evt === void 0 ? void 0 : evt.detail) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : '';
|
|
138
|
+
this.setData({ inputValue });
|
|
139
|
+
if (this.data.onInput) {
|
|
140
|
+
this.data.onInput(inputValue);
|
|
141
|
+
}
|
|
137
142
|
},
|
|
138
143
|
close(action) {
|
|
139
144
|
if (this.data.autoClose) {
|
package/dist/picker/index.wxml
CHANGED
|
@@ -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 }}"
|
|
@@ -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/lib/dialog/dialog.d.ts
CHANGED
package/lib/dialog/dialog.js
CHANGED
|
@@ -109,9 +109,7 @@ Dialog.alert = function (options) { return Dialog(options); };
|
|
|
109
109
|
Dialog.confirm = function (options) {
|
|
110
110
|
return Dialog(__assign({ showCancelButton: true }, options));
|
|
111
111
|
};
|
|
112
|
-
Dialog.input = (function (options) {
|
|
113
|
-
return Dialog(__assign({ showCancelButton: true }, options));
|
|
114
|
-
});
|
|
112
|
+
Dialog.input = (function (options) { var _a; return Dialog(__assign(__assign({ showCancelButton: true }, options), { value: (_a = options.value) !== null && _a !== void 0 ? _a : '' })); });
|
|
115
113
|
Dialog.close = function () {
|
|
116
114
|
exports.queueRef.value.forEach(function (dialog) {
|
|
117
115
|
dialog.close();
|
package/lib/dialog/index.js
CHANGED
|
@@ -108,6 +108,7 @@ var dialog_1 = require("./dialog");
|
|
|
108
108
|
},
|
|
109
109
|
actionType: '',
|
|
110
110
|
callback: (function () { }),
|
|
111
|
+
onInput: (function () { }),
|
|
111
112
|
},
|
|
112
113
|
mounted: function () {
|
|
113
114
|
if (!this.id)
|
|
@@ -139,7 +140,11 @@ var dialog_1 = require("./dialog");
|
|
|
139
140
|
},
|
|
140
141
|
onInput: function (evt) {
|
|
141
142
|
var _a, _b;
|
|
142
|
-
|
|
143
|
+
var inputValue = (_b = (_a = evt === null || evt === void 0 ? void 0 : evt.detail) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : '';
|
|
144
|
+
this.setData({ inputValue: inputValue });
|
|
145
|
+
if (this.data.onInput) {
|
|
146
|
+
this.data.onInput(inputValue);
|
|
147
|
+
}
|
|
143
148
|
},
|
|
144
149
|
close: function (action) {
|
|
145
150
|
var _this = this;
|
package/lib/picker/index.wxml
CHANGED
|
@@ -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 }}"
|
|
@@ -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
|
};
|