@tuya-miniapp/smart-ui 1.0.2 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/action-sheet/index.js +4 -0
- package/dist/action-sheet/index.wxml +1 -0
- package/dist/dialog/dialog.js +5 -1
- package/dist/notify/index.js +8 -0
- package/dist/notify/index.wxml +3 -2
- package/dist/notify/notify.d.ts +1 -0
- package/dist/popup/index.js +9 -3
- package/lib/action-sheet/index.js +4 -0
- package/lib/action-sheet/index.wxml +1 -0
- package/lib/dialog/dialog.js +5 -1
- package/lib/notify/index.js +8 -0
- package/lib/notify/index.wxml +3 -2
- package/lib/notify/notify.d.ts +1 -0
- package/lib/popup/index.js +9 -3
- package/package.json +1 -1
@@ -8,6 +8,7 @@
|
|
8
8
|
overlay="{{ overlay }}"
|
9
9
|
custom-class="smart-action-sheet custom-class"
|
10
10
|
safe-area-inset-bottom="{{ safeAreaInsetBottom }}"
|
11
|
+
safe-area-inset-bottom-min="{{ safeAreaInsetBottomMin }}"
|
11
12
|
close-on-click-overlay="{{ closeOnClickOverlay }}"
|
12
13
|
root-portal="{{ rootPortal }}"
|
13
14
|
bind:close="onClickOverlay"
|
package/dist/dialog/dialog.js
CHANGED
@@ -42,9 +42,13 @@ const Dialog = (options) => {
|
|
42
42
|
delete options.context;
|
43
43
|
delete options.selector;
|
44
44
|
if (dialog) {
|
45
|
+
const optionsWithInputValue = Object.assign({}, options);
|
46
|
+
if (typeof options.value === 'string') {
|
47
|
+
optionsWithInputValue.inputValue = options.value;
|
48
|
+
}
|
45
49
|
dialog.setData(Object.assign({ callback: (action, instance) => {
|
46
50
|
action === 'confirm' ? resolve(instance) : reject(instance);
|
47
|
-
} },
|
51
|
+
} }, optionsWithInputValue));
|
48
52
|
wx.nextTick(() => {
|
49
53
|
dialog.setData({ show: true });
|
50
54
|
});
|
package/dist/notify/index.js
CHANGED
package/dist/notify/index.wxml
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
<wxs src="./index.wxs" module="computed" />
|
3
3
|
|
4
4
|
<smart-transition
|
5
|
-
name="
|
5
|
+
name="{{ transition }}"
|
6
6
|
show="{{ show }}"
|
7
7
|
custom-class="smart-notify__container"
|
8
8
|
custom-style="{{ computed.rootStyle({ zIndex, top }) }}"
|
@@ -16,6 +16,7 @@
|
|
16
16
|
wx:if="{{ safeAreaInsetTop }}"
|
17
17
|
style="height: {{ statusBarHeight }}px"
|
18
18
|
/>
|
19
|
-
<
|
19
|
+
<slot wx:if="{{ useSlot }}" />
|
20
|
+
<text wx:else>{{ message }}</text>
|
20
21
|
</view>
|
21
22
|
</smart-transition>
|
package/dist/notify/notify.d.ts
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
interface NotifyOptions {
|
2
2
|
type?: 'primary' | 'success' | 'danger' | 'warning';
|
3
|
+
transition?: 'fade' | 'fade-up' | 'fade-down' | 'fade-left' | 'fade-right' | 'slide-up' | 'slide-down' | 'slide-left' | 'slide-right';
|
3
4
|
color?: string;
|
4
5
|
zIndex?: number;
|
5
6
|
top?: number;
|
package/dist/popup/index.js
CHANGED
@@ -2,6 +2,7 @@ import closeIcon from '@tuya-miniapp/icons/dist/svg/Xmark';
|
|
2
2
|
import { SmartComponent } from '../common/component';
|
3
3
|
import { transition } from '../mixins/transition';
|
4
4
|
import { getSystemInfoSync } from '../common/utils';
|
5
|
+
const { safeArea, screenHeight, statusBarHeight } = getSystemInfoSync() || {};
|
5
6
|
SmartComponent({
|
6
7
|
classes: [
|
7
8
|
'enter-class',
|
@@ -51,6 +52,10 @@ SmartComponent({
|
|
51
52
|
type: Boolean,
|
52
53
|
value: true,
|
53
54
|
},
|
55
|
+
safeAreaInsetBottomMin: {
|
56
|
+
type: Number,
|
57
|
+
value: 0,
|
58
|
+
},
|
54
59
|
safeAreaInsetTop: {
|
55
60
|
type: Boolean,
|
56
61
|
value: false,
|
@@ -70,14 +75,15 @@ SmartComponent({
|
|
70
75
|
},
|
71
76
|
data: {
|
72
77
|
closeIcon,
|
73
|
-
bottomSafeHeight:
|
78
|
+
bottomSafeHeight: 0,
|
74
79
|
},
|
75
80
|
mounted() {
|
76
81
|
if (!this.data.safeAreaInsetBottom)
|
77
82
|
return;
|
78
|
-
const { safeArea, screenHeight, statusBarHeight } = getSystemInfoSync() || {};
|
79
83
|
const bottomSafeHeight = screenHeight - (safeArea === null || safeArea === void 0 ? void 0 : safeArea.height) - statusBarHeight;
|
80
|
-
this.setData({
|
84
|
+
this.setData({
|
85
|
+
bottomSafeHeight: Math.max(bottomSafeHeight, this.data.safeAreaInsetBottomMin),
|
86
|
+
});
|
81
87
|
},
|
82
88
|
created() {
|
83
89
|
this.observeClass();
|
@@ -8,6 +8,7 @@
|
|
8
8
|
overlay="{{ overlay }}"
|
9
9
|
custom-class="smart-action-sheet custom-class"
|
10
10
|
safe-area-inset-bottom="{{ safeAreaInsetBottom }}"
|
11
|
+
safe-area-inset-bottom-min="{{ safeAreaInsetBottomMin }}"
|
11
12
|
close-on-click-overlay="{{ closeOnClickOverlay }}"
|
12
13
|
root-portal="{{ rootPortal }}"
|
13
14
|
bind:close="onClickOverlay"
|
package/lib/dialog/dialog.js
CHANGED
@@ -55,9 +55,13 @@ var Dialog = function (options) {
|
|
55
55
|
delete options.context;
|
56
56
|
delete options.selector;
|
57
57
|
if (dialog) {
|
58
|
+
var optionsWithInputValue = __assign({}, options);
|
59
|
+
if (typeof options.value === 'string') {
|
60
|
+
optionsWithInputValue.inputValue = options.value;
|
61
|
+
}
|
58
62
|
dialog.setData(__assign({ callback: function (action, instance) {
|
59
63
|
action === 'confirm' ? resolve(instance) : reject(instance);
|
60
|
-
} },
|
64
|
+
} }, optionsWithInputValue));
|
61
65
|
wx.nextTick(function () {
|
62
66
|
dialog.setData({ show: true });
|
63
67
|
});
|
package/lib/notify/index.js
CHANGED
package/lib/notify/index.wxml
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
<wxs src="./index.wxs" module="computed" />
|
3
3
|
|
4
4
|
<smart-transition
|
5
|
-
name="
|
5
|
+
name="{{ transition }}"
|
6
6
|
show="{{ show }}"
|
7
7
|
custom-class="smart-notify__container"
|
8
8
|
custom-style="{{ computed.rootStyle({ zIndex, top }) }}"
|
@@ -16,6 +16,7 @@
|
|
16
16
|
wx:if="{{ safeAreaInsetTop }}"
|
17
17
|
style="height: {{ statusBarHeight }}px"
|
18
18
|
/>
|
19
|
-
<
|
19
|
+
<slot wx:if="{{ useSlot }}" />
|
20
|
+
<text wx:else>{{ message }}</text>
|
20
21
|
</view>
|
21
22
|
</smart-transition>
|
package/lib/notify/notify.d.ts
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
interface NotifyOptions {
|
2
2
|
type?: 'primary' | 'success' | 'danger' | 'warning';
|
3
|
+
transition?: 'fade' | 'fade-up' | 'fade-down' | 'fade-left' | 'fade-right' | 'slide-up' | 'slide-down' | 'slide-left' | 'slide-right';
|
3
4
|
color?: string;
|
4
5
|
zIndex?: number;
|
5
6
|
top?: number;
|
package/lib/popup/index.js
CHANGED
@@ -7,6 +7,7 @@ var Xmark_1 = __importDefault(require("@tuya-miniapp/icons/dist/svg/Xmark"));
|
|
7
7
|
var component_1 = require("../common/component");
|
8
8
|
var transition_1 = require("../mixins/transition");
|
9
9
|
var utils_1 = require("../common/utils");
|
10
|
+
var _a = (0, utils_1.getSystemInfoSync)() || {}, safeArea = _a.safeArea, screenHeight = _a.screenHeight, statusBarHeight = _a.statusBarHeight;
|
10
11
|
(0, component_1.SmartComponent)({
|
11
12
|
classes: [
|
12
13
|
'enter-class',
|
@@ -56,6 +57,10 @@ var utils_1 = require("../common/utils");
|
|
56
57
|
type: Boolean,
|
57
58
|
value: true,
|
58
59
|
},
|
60
|
+
safeAreaInsetBottomMin: {
|
61
|
+
type: Number,
|
62
|
+
value: 0,
|
63
|
+
},
|
59
64
|
safeAreaInsetTop: {
|
60
65
|
type: Boolean,
|
61
66
|
value: false,
|
@@ -75,14 +80,15 @@ var utils_1 = require("../common/utils");
|
|
75
80
|
},
|
76
81
|
data: {
|
77
82
|
closeIcon: Xmark_1.default,
|
78
|
-
bottomSafeHeight:
|
83
|
+
bottomSafeHeight: 0,
|
79
84
|
},
|
80
85
|
mounted: function () {
|
81
86
|
if (!this.data.safeAreaInsetBottom)
|
82
87
|
return;
|
83
|
-
var _a = (0, utils_1.getSystemInfoSync)() || {}, safeArea = _a.safeArea, screenHeight = _a.screenHeight, statusBarHeight = _a.statusBarHeight;
|
84
88
|
var bottomSafeHeight = screenHeight - (safeArea === null || safeArea === void 0 ? void 0 : safeArea.height) - statusBarHeight;
|
85
|
-
this.setData({
|
89
|
+
this.setData({
|
90
|
+
bottomSafeHeight: Math.max(bottomSafeHeight, this.data.safeAreaInsetBottomMin),
|
91
|
+
});
|
86
92
|
},
|
87
93
|
created: function () {
|
88
94
|
this.observeClass();
|