@tuya-miniapp/smart-ui 1.3.1-beta-3 → 1.3.1-beta-4
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/action-sheet/demo/index.d.ts +1 -0
- package/dist/action-sheet/demo/index.js +101 -0
- package/dist/action-sheet/index.js +1 -1
- package/dist/area/demo/index.d.ts +1 -0
- package/dist/area/demo/index.js +41 -0
- package/dist/area/index.js +4 -5
- package/dist/battery/demo/index.d.ts +1 -0
- package/dist/battery/demo/index.js +2 -0
- package/dist/battery/index.js +1 -3
- package/dist/bottom-sheet/demo/index.d.ts +1 -0
- package/dist/bottom-sheet/demo/index.js +24 -0
- package/dist/bottom-sheet/index.css +1 -1
- package/dist/bottom-sheet/index.js +3 -2
- package/dist/bottom-sheet/index.wxml +3 -1
- package/dist/bottom-sheet/index.wxss +1 -1
- package/dist/button/demo/index.d.ts +1 -0
- package/dist/button/demo/index.js +9 -0
- package/dist/button/index.js +1 -1
- package/dist/calendar/components/header/index.css +1 -1
- package/dist/calendar/components/header/index.js +1 -1
- package/dist/calendar/components/header/index.wxml +3 -3
- package/dist/calendar/components/header/index.wxss +1 -1
- package/dist/calendar/components/month/index.css +1 -1
- package/dist/calendar/components/month/index.js +3 -5
- package/dist/calendar/components/month/index.wxs +1 -4
- package/dist/calendar/components/month/index.wxss +1 -1
- package/dist/calendar/components/month-list/index.css +1 -1
- package/dist/calendar/components/month-list/index.js +4 -17
- package/dist/calendar/components/month-list/index.wxml +15 -13
- package/dist/calendar/components/month-list/index.wxss +1 -1
- package/dist/calendar/components/year-list/index.css +1 -1
- package/dist/calendar/components/year-list/index.js +3 -3
- package/dist/calendar/components/year-list/index.wxml +1 -1
- package/dist/calendar/components/year-list/index.wxss +1 -1
- package/dist/calendar/demo/index.d.ts +1 -0
- package/dist/calendar/demo/index.js +103 -0
- package/dist/calendar/index.js +9 -14
- package/dist/calendar/index.wxs +4 -7
- package/dist/calendar/utils.js +2 -4
- package/dist/cascader/demo/index.d.ts +1 -0
- package/dist/cascader/demo/index.js +191 -0
- package/dist/cascader/index.js +3 -3
- package/dist/cell/demo/index.d.ts +1 -0
- package/dist/cell/demo/index.js +14 -0
- package/dist/cell/index.js +1 -7
- package/dist/checkbox/demo/index.d.ts +1 -0
- package/dist/checkbox/demo/index.js +34 -0
- package/dist/checkbox-group/index.js +1 -1
- package/dist/circle/demo/index.d.ts +1 -0
- package/dist/circle/demo/index.js +19 -0
- package/dist/col/demo/index.d.ts +1 -0
- package/dist/col/demo/index.js +4 -0
- package/dist/collapse/demo/index.d.ts +1 -0
- package/dist/collapse/demo/index.js +36 -0
- package/dist/collapse/index.js +1 -1
- package/dist/collapse-item/animate.js +1 -1
- package/dist/common/component.js +1 -1
- package/dist/common/utils.js +3 -3
- package/dist/config-provider/demo/index.d.ts +1 -0
- package/dist/config-provider/demo/index.js +22 -0
- package/dist/count-down/demo/index.d.ts +1 -0
- package/dist/count-down/demo/index.js +33 -0
- package/dist/custom-keyboard/demo/index.d.ts +1 -0
- package/dist/custom-keyboard/demo/index.js +17 -0
- package/dist/custom-keyboard/index.js +1 -3
- package/dist/datetime-picker/demo/index.d.ts +1 -0
- package/dist/datetime-picker/demo/index.js +63 -0
- package/dist/datetime-picker/index.js +4 -5
- package/dist/dialog/demo/index.d.ts +1 -0
- package/dist/dialog/demo/index.js +134 -0
- package/dist/dialog/dialog.js +3 -5
- package/dist/dialog/index.js +1 -1
- package/dist/divider/demo/index.d.ts +1 -0
- package/dist/divider/demo/index.js +4 -0
- package/dist/dropdown-item/index.js +3 -3
- package/dist/dropdown-item/index.wxml +1 -7
- package/dist/dropdown-menu/demo/index.d.ts +1 -0
- package/dist/dropdown-menu/demo/index.js +47 -0
- package/dist/dropdown-menu/index.js +8 -10
- package/dist/empty/demo/index.d.ts +1 -0
- package/dist/empty/demo/index.js +13 -0
- package/dist/empty/index.css +1 -1
- package/dist/empty/index.wxs +1 -1
- package/dist/empty/index.wxss +1 -1
- package/dist/field/demo/index.d.ts +1 -0
- package/dist/field/demo/index.js +21 -0
- package/dist/goods-action/demo/index.d.ts +1 -0
- package/dist/goods-action/demo/index.js +12 -0
- package/dist/goods-action/index.js +1 -1
- package/dist/grid/demo/index.d.ts +1 -0
- package/dist/grid/demo/index.js +9 -0
- package/dist/grid/index.js +1 -1
- package/dist/grid-item/index.js +1 -1
- package/dist/icon/demo/index.d.ts +1 -0
- package/dist/icon/demo/index.js +26 -0
- package/dist/image/demo/index.d.ts +1 -0
- package/dist/image/demo/index.js +15 -0
- package/dist/index-anchor/index.js +1 -1
- package/dist/index-bar/demo/index.d.ts +1 -0
- package/dist/index-bar/demo/index.js +21 -0
- package/dist/index-bar/index.js +9 -16
- package/dist/loading/demo/index.d.ts +1 -0
- package/dist/loading/demo/index.js +4 -0
- package/dist/loading/index.js +25 -1
- package/dist/loading/index.wxml +2 -2
- package/dist/loading/index.wxs +6 -21
- package/dist/mixins/basic.js +2 -2
- package/dist/mixins/link.js +1 -2
- package/dist/mixins/page-scroll.js +1 -1
- package/dist/mixins/touch.js +1 -2
- package/dist/mixins/transition.js +1 -1
- package/dist/nav-bar/demo/index.d.ts +1 -0
- package/dist/nav-bar/demo/index.js +26 -0
- package/dist/nav-bar/index.css +1 -1
- package/dist/nav-bar/index.js +1 -1
- package/dist/nav-bar/index.wxml +1 -1
- package/dist/nav-bar/index.wxss +1 -1
- package/dist/normal-slider/demo/index.d.ts +1 -0
- package/dist/normal-slider/demo/index.js +19 -0
- package/dist/notice-bar/demo/index.d.ts +1 -0
- package/dist/notice-bar/demo/index.js +11 -0
- package/dist/notice-bar/index.js +3 -6
- package/dist/notice-bar/index.wxml +1 -5
- package/dist/notify/demo/index.d.ts +1 -0
- package/dist/notify/demo/index.js +45 -0
- package/dist/overlay/demo/index.d.ts +1 -0
- package/dist/overlay/demo/index.js +22 -0
- package/dist/picker/demo/index.d.ts +1 -0
- package/dist/picker/demo/index.js +76 -0
- package/dist/picker/index.css +1 -1
- package/dist/picker/index.js +2 -2
- package/dist/picker/index.wxml +1 -0
- package/dist/picker/index.wxss +1 -1
- package/dist/picker-column/index.js +3 -8
- package/dist/popup/demo/index.d.ts +1 -0
- package/dist/popup/demo/index.js +79 -0
- package/dist/progress/demo/index.d.ts +1 -0
- package/dist/progress/demo/index.js +4 -0
- package/dist/progress/index.js +1 -4
- package/dist/radio/demo/index.d.ts +1 -0
- package/dist/radio/demo/index.js +31 -0
- package/dist/radio-group/index.js +1 -1
- package/dist/rate/demo/index.d.ts +1 -0
- package/dist/rate/demo/index.js +25 -0
- package/dist/rate/index.js +2 -2
- package/dist/row/index.js +1 -1
- package/dist/search/demo/index.d.ts +1 -0
- package/dist/search/demo/index.js +43 -0
- package/dist/sidebar/demo/index.d.ts +1 -0
- package/dist/sidebar/demo/index.js +9 -0
- package/dist/skeleton/demo/index.d.ts +1 -0
- package/dist/skeleton/demo/index.js +11 -0
- package/dist/slider/demo/index.d.ts +1 -0
- package/dist/slider/demo/index.js +19 -0
- package/dist/slider/index.js +5 -7
- package/dist/stepper/demo/index.d.ts +1 -0
- package/dist/stepper/demo/index.js +19 -0
- package/dist/steps/demo/index.d.ts +1 -0
- package/dist/steps/demo/index.js +42 -0
- package/dist/sticky/demo/index.d.ts +1 -0
- package/dist/sticky/demo/index.js +26 -0
- package/dist/sticky/index.js +2 -2
- package/dist/swipe-cell/demo/index.d.ts +1 -0
- package/dist/swipe-cell/demo/index.js +45 -0
- package/dist/swipe-cell/index.js +3 -5
- package/dist/switch/demo/index.d.ts +1 -0
- package/dist/switch/demo/index.js +29 -0
- package/dist/switch/index.css +1 -1
- package/dist/switch/index.wxss +1 -1
- package/dist/tab/demo/index.d.ts +1 -0
- package/dist/tab/demo/index.js +55 -0
- package/dist/tabbar/demo/index.d.ts +1 -0
- package/dist/tabbar/demo/index.js +34 -0
- package/dist/tabbar/index.js +1 -1
- package/dist/tabs/index.js +7 -25
- package/dist/tag/demo/index.d.ts +1 -0
- package/dist/tag/demo/index.js +16 -0
- package/dist/tag/index.css +1 -1
- package/dist/tag/index.wxss +1 -1
- package/dist/toast/demo/index.d.ts +1 -0
- package/dist/toast/demo/index.js +67 -0
- package/dist/toast/toast.js +3 -5
- package/dist/transition/demo/index.d.ts +1 -0
- package/dist/transition/demo/index.js +67 -0
- package/dist/tree-select/demo/index.d.ts +1 -0
- package/dist/tree-select/demo/index.js +113 -0
- package/lib/action-sheet/demo/index.d.ts +1 -0
- package/lib/action-sheet/demo/index.js +115 -0
- package/lib/area/demo/index.d.ts +1 -0
- package/lib/area/demo/index.js +47 -0
- package/lib/area/index.js +1 -2
- package/lib/battery/demo/index.d.ts +1 -0
- package/lib/battery/demo/index.js +4 -0
- package/lib/battery/index.js +1 -3
- package/lib/bottom-sheet/demo/index.d.ts +1 -0
- package/lib/bottom-sheet/demo/index.js +27 -0
- package/lib/bottom-sheet/index.css +1 -1
- package/lib/bottom-sheet/index.js +3 -2
- package/lib/bottom-sheet/index.wxml +3 -1
- package/lib/bottom-sheet/index.wxss +1 -1
- package/lib/button/demo/index.d.ts +1 -0
- package/lib/button/demo/index.js +14 -0
- package/lib/calendar/components/header/index.css +1 -1
- package/lib/calendar/components/header/index.wxml +3 -3
- package/lib/calendar/components/header/index.wxss +1 -1
- package/lib/calendar/components/month/index.css +1 -1
- package/lib/calendar/components/month/index.js +2 -6
- package/lib/calendar/components/month/index.wxs +1 -4
- package/lib/calendar/components/month/index.wxss +1 -1
- package/lib/calendar/components/month-list/index.css +1 -1
- package/lib/calendar/components/month-list/index.js +3 -16
- package/lib/calendar/components/month-list/index.wxml +15 -13
- package/lib/calendar/components/month-list/index.wxss +1 -1
- package/lib/calendar/components/year-list/index.css +1 -1
- package/lib/calendar/components/year-list/index.js +1 -1
- package/lib/calendar/components/year-list/index.wxml +1 -1
- package/lib/calendar/components/year-list/index.wxss +1 -1
- package/lib/calendar/demo/index.d.ts +1 -0
- package/lib/calendar/demo/index.js +105 -0
- package/lib/calendar/index.js +7 -14
- package/lib/calendar/index.wxs +4 -7
- package/lib/calendar/utils.js +1 -3
- package/lib/cascader/demo/index.d.ts +1 -0
- package/lib/cascader/demo/index.js +197 -0
- package/lib/cell/demo/index.d.ts +1 -0
- package/lib/cell/demo/index.js +39 -0
- package/lib/cell/index.js +1 -7
- package/lib/checkbox/demo/index.d.ts +1 -0
- package/lib/checkbox/demo/index.js +38 -0
- package/lib/circle/demo/index.d.ts +1 -0
- package/lib/circle/demo/index.js +21 -0
- package/lib/col/demo/index.d.ts +1 -0
- package/lib/col/demo/index.js +6 -0
- package/lib/collapse/demo/index.d.ts +1 -0
- package/lib/collapse/demo/index.js +42 -0
- package/lib/config-provider/demo/index.d.ts +1 -0
- package/lib/config-provider/demo/index.js +24 -0
- package/lib/count-down/demo/index.d.ts +1 -0
- package/lib/count-down/demo/index.js +38 -0
- package/lib/custom-keyboard/demo/index.d.ts +1 -0
- package/lib/custom-keyboard/demo/index.js +19 -0
- package/lib/custom-keyboard/index.js +1 -3
- package/lib/datetime-picker/demo/index.d.ts +1 -0
- package/lib/datetime-picker/demo/index.js +68 -0
- package/lib/datetime-picker/index.js +4 -3
- package/lib/dialog/demo/index.d.ts +1 -0
- package/lib/dialog/demo/index.js +144 -0
- package/lib/dialog/dialog.js +1 -3
- package/lib/divider/demo/index.d.ts +1 -0
- package/lib/divider/demo/index.js +6 -0
- package/lib/dropdown-item/index.wxml +1 -7
- package/lib/dropdown-menu/demo/index.d.ts +1 -0
- package/lib/dropdown-menu/demo/index.js +52 -0
- package/lib/dropdown-menu/index.js +2 -4
- package/lib/empty/demo/index.d.ts +1 -0
- package/lib/empty/demo/index.js +15 -0
- package/lib/empty/index.css +1 -1
- package/lib/empty/index.wxs +1 -1
- package/lib/empty/index.wxss +1 -1
- package/lib/field/demo/index.d.ts +1 -0
- package/lib/field/demo/index.js +23 -0
- package/lib/goods-action/demo/index.d.ts +1 -0
- package/lib/goods-action/demo/index.js +17 -0
- package/lib/grid/demo/index.d.ts +1 -0
- package/lib/grid/demo/index.js +11 -0
- package/lib/icon/demo/index.d.ts +1 -0
- package/lib/icon/demo/index.js +54 -0
- package/lib/image/demo/index.d.ts +1 -0
- package/lib/image/demo/index.js +17 -0
- package/lib/index-bar/demo/index.d.ts +1 -0
- package/lib/index-bar/demo/index.js +23 -0
- package/lib/index-bar/index.js +3 -10
- package/lib/loading/demo/index.d.ts +1 -0
- package/lib/loading/demo/index.js +6 -0
- package/lib/loading/index.js +27 -1
- package/lib/loading/index.wxml +2 -2
- package/lib/loading/index.wxs +6 -21
- package/lib/mixins/link.js +1 -2
- package/lib/mixins/touch.js +1 -2
- package/lib/nav-bar/demo/index.d.ts +1 -0
- package/lib/nav-bar/demo/index.js +31 -0
- package/lib/nav-bar/index.css +1 -1
- package/lib/nav-bar/index.wxml +1 -1
- package/lib/nav-bar/index.wxss +1 -1
- package/lib/normal-slider/demo/index.d.ts +1 -0
- package/lib/normal-slider/demo/index.js +21 -0
- package/lib/notice-bar/demo/index.d.ts +1 -0
- package/lib/notice-bar/demo/index.js +16 -0
- package/lib/notice-bar/index.js +2 -5
- package/lib/notice-bar/index.wxml +1 -5
- package/lib/notify/demo/index.d.ts +1 -0
- package/lib/notify/demo/index.js +50 -0
- package/lib/overlay/demo/index.d.ts +1 -0
- package/lib/overlay/demo/index.js +24 -0
- package/lib/picker/demo/index.d.ts +1 -0
- package/lib/picker/demo/index.js +82 -0
- package/lib/picker/index.css +1 -1
- package/lib/picker/index.js +1 -3
- package/lib/picker/index.wxml +1 -0
- package/lib/picker/index.wxss +1 -1
- package/lib/picker-column/index.js +2 -7
- package/lib/popup/demo/index.d.ts +1 -0
- package/lib/popup/demo/index.js +85 -0
- package/lib/progress/demo/index.d.ts +1 -0
- package/lib/progress/demo/index.js +6 -0
- package/lib/progress/index.js +1 -4
- package/lib/radio/demo/index.d.ts +1 -0
- package/lib/radio/demo/index.js +34 -0
- package/lib/rate/demo/index.d.ts +1 -0
- package/lib/rate/demo/index.js +30 -0
- package/lib/search/demo/index.d.ts +1 -0
- package/lib/search/demo/index.js +48 -0
- package/lib/sidebar/demo/index.d.ts +1 -0
- package/lib/sidebar/demo/index.js +14 -0
- package/lib/skeleton/demo/index.d.ts +1 -0
- package/lib/skeleton/demo/index.js +14 -0
- package/lib/slider/demo/index.d.ts +1 -0
- package/lib/slider/demo/index.js +21 -0
- package/lib/slider/index.js +1 -3
- package/lib/stepper/demo/index.d.ts +1 -0
- package/lib/stepper/demo/index.js +25 -0
- package/lib/steps/demo/index.d.ts +1 -0
- package/lib/steps/demo/index.js +47 -0
- package/lib/sticky/demo/index.d.ts +1 -0
- package/lib/sticky/demo/index.js +30 -0
- package/lib/sticky/index.js +3 -1
- package/lib/swipe-cell/demo/index.d.ts +1 -0
- package/lib/swipe-cell/demo/index.js +50 -0
- package/lib/swipe-cell/index.js +1 -3
- package/lib/switch/demo/index.d.ts +1 -0
- package/lib/switch/demo/index.js +37 -0
- package/lib/switch/index.css +1 -1
- package/lib/switch/index.wxss +1 -1
- package/lib/tab/demo/index.d.ts +1 -0
- package/lib/tab/demo/index.js +57 -0
- package/lib/tabbar/demo/index.d.ts +1 -0
- package/lib/tabbar/demo/index.js +41 -0
- package/lib/tabs/index.js +6 -24
- package/lib/tag/demo/index.d.ts +1 -0
- package/lib/tag/demo/index.js +19 -0
- package/lib/tag/index.css +1 -1
- package/lib/tag/index.wxss +1 -1
- package/lib/toast/demo/index.d.ts +1 -0
- package/lib/toast/demo/index.js +74 -0
- package/lib/toast/toast.js +1 -3
- package/lib/transition/demo/index.d.ts +1 -0
- package/lib/transition/demo/index.js +71 -0
- package/lib/tree-select/demo/index.d.ts +1 -0
- package/lib/tree-select/demo/index.js +130 -0
- package/package.json +1 -1
@@ -0,0 +1,30 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
+
};
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
+
var Icloud_1 = __importDefault(require("@tuya-miniapp/icons/dist/svg/Icloud"));
|
7
|
+
var XmarkIcloud_1 = __importDefault(require("@tuya-miniapp/icons/dist/svg/XmarkIcloud"));
|
8
|
+
var component_1 = require("../../common/component");
|
9
|
+
var toast_1 = __importDefault(require("../../toast/toast"));
|
10
|
+
(0, component_1.SmartComponent)({
|
11
|
+
data: {
|
12
|
+
value1: 3,
|
13
|
+
value2: 3,
|
14
|
+
value3: 3,
|
15
|
+
value4: 2.5,
|
16
|
+
value5: 4,
|
17
|
+
value6: 3,
|
18
|
+
value8: 2,
|
19
|
+
icon: Icloud_1.default,
|
20
|
+
voidIcon: XmarkIcloud_1.default,
|
21
|
+
},
|
22
|
+
methods: {
|
23
|
+
onChange: function (event) {
|
24
|
+
(0, toast_1.default)({
|
25
|
+
context: this,
|
26
|
+
message: I18n.t('currentValue') + event.detail,
|
27
|
+
});
|
28
|
+
},
|
29
|
+
},
|
30
|
+
});
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1,48 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
+
};
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
+
var component_1 = require("../../common/component");
|
7
|
+
var TriangleDown_1 = __importDefault(require("@tuya-miniapp/icons/dist/svg/TriangleDown"));
|
8
|
+
(0, component_1.SmartComponent)({
|
9
|
+
data: {
|
10
|
+
value: '',
|
11
|
+
icon: TriangleDown_1.default,
|
12
|
+
},
|
13
|
+
methods: {
|
14
|
+
onChange: function (e) {
|
15
|
+
this.setData({
|
16
|
+
value: e.detail,
|
17
|
+
});
|
18
|
+
},
|
19
|
+
onSearch: function (event) {
|
20
|
+
if (event.detail) {
|
21
|
+
wx.showToast({
|
22
|
+
title: I18n.t('searchText') + ': ' + event.detail,
|
23
|
+
icon: 'none',
|
24
|
+
});
|
25
|
+
}
|
26
|
+
},
|
27
|
+
onClick: function () {
|
28
|
+
if (this.data.value) {
|
29
|
+
wx.showToast({
|
30
|
+
title: I18n.t('searchText') + ': ' + this.data.value,
|
31
|
+
icon: 'none',
|
32
|
+
});
|
33
|
+
}
|
34
|
+
},
|
35
|
+
onCancel: function () {
|
36
|
+
wx.showToast({
|
37
|
+
title: I18n.t('cancel'),
|
38
|
+
icon: 'none',
|
39
|
+
});
|
40
|
+
},
|
41
|
+
onClear: function () {
|
42
|
+
wx.showToast({
|
43
|
+
title: I18n.t('clear'),
|
44
|
+
icon: 'none',
|
45
|
+
});
|
46
|
+
},
|
47
|
+
},
|
48
|
+
});
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1,14 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
+
};
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
+
var component_1 = require("../../common/component");
|
7
|
+
var toast_1 = __importDefault(require("../../toast/toast"));
|
8
|
+
(0, component_1.SmartComponent)({
|
9
|
+
methods: {
|
10
|
+
onChange: function (event) {
|
11
|
+
(0, toast_1.default)({ context: this, message: "".concat(I18n.t('switchTo')).concat(event.detail).concat(I18n.t('item')) });
|
12
|
+
},
|
13
|
+
},
|
14
|
+
});
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1,14 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
var component_1 = require("../../common/component");
|
4
|
+
(0, component_1.SmartComponent)({
|
5
|
+
data: {
|
6
|
+
show: false,
|
7
|
+
},
|
8
|
+
methods: {
|
9
|
+
onChange: function (_a) {
|
10
|
+
var detail = _a.detail;
|
11
|
+
this.setData({ show: detail });
|
12
|
+
},
|
13
|
+
},
|
14
|
+
});
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1,21 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
var component_1 = require("../../common/component");
|
4
|
+
(0, component_1.SmartComponent)({
|
5
|
+
data: {
|
6
|
+
currentValue: 50,
|
7
|
+
},
|
8
|
+
methods: {
|
9
|
+
onChange: function (event) {
|
10
|
+
wx.showToast({
|
11
|
+
icon: 'none',
|
12
|
+
title: "".concat(I18n.t('currentValue')).concat(event.detail),
|
13
|
+
});
|
14
|
+
},
|
15
|
+
onDrag: function (event) {
|
16
|
+
this.setData({
|
17
|
+
currentValue: event.detail.value,
|
18
|
+
});
|
19
|
+
},
|
20
|
+
},
|
21
|
+
});
|
package/lib/slider/index.js
CHANGED
@@ -111,9 +111,7 @@ var DRAG_STATUS = {
|
|
111
111
|
(0, utils_1.getRect)(this, '.smart-slider').then(function (rect) {
|
112
112
|
var vertical = _this.data.vertical;
|
113
113
|
var touch = event.touches[0];
|
114
|
-
var delta = vertical
|
115
|
-
? touch.clientY - rect.top
|
116
|
-
: touch.clientX - rect.left;
|
114
|
+
var delta = vertical ? touch.clientY - rect.top : touch.clientX - rect.left;
|
117
115
|
var total = vertical ? rect.height : rect.width;
|
118
116
|
var value = Number(min) + (delta / total) * _this.getRange();
|
119
117
|
if (_this.isRange(_this.value)) {
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1,25 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
+
};
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
+
var component_1 = require("../../common/component");
|
7
|
+
var toast_1 = __importDefault(require("../../toast/toast"));
|
8
|
+
(0, component_1.SmartComponent)({
|
9
|
+
data: {
|
10
|
+
value: 1,
|
11
|
+
},
|
12
|
+
methods: {
|
13
|
+
onChange: function (event) {
|
14
|
+
var _this = this;
|
15
|
+
toast_1.default.loading({
|
16
|
+
context: this,
|
17
|
+
forbidClick: true,
|
18
|
+
});
|
19
|
+
setTimeout(function () {
|
20
|
+
toast_1.default.clear();
|
21
|
+
_this.setData({ value: event.detail });
|
22
|
+
}, 500);
|
23
|
+
},
|
24
|
+
},
|
25
|
+
});
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1,47 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
+
};
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
+
var icons_1 = require("@tuya-miniapp/icons");
|
7
|
+
var component_1 = require("../../common/component");
|
8
|
+
var toast_1 = __importDefault(require("../../toast/toast"));
|
9
|
+
var steps = [
|
10
|
+
{
|
11
|
+
text: I18n.t('step1'),
|
12
|
+
desc: I18n.t('descriptionInformation'),
|
13
|
+
},
|
14
|
+
{
|
15
|
+
text: I18n.t('stepTwo'),
|
16
|
+
desc: I18n.t('descriptionInformation'),
|
17
|
+
},
|
18
|
+
{
|
19
|
+
text: I18n.t('stepThree'),
|
20
|
+
desc: I18n.t('descriptionInformation'),
|
21
|
+
},
|
22
|
+
{
|
23
|
+
text: I18n.t('stepFour'),
|
24
|
+
desc: I18n.t('descriptionInformation'),
|
25
|
+
},
|
26
|
+
];
|
27
|
+
(0, component_1.SmartComponent)({
|
28
|
+
data: {
|
29
|
+
active: 1,
|
30
|
+
steps: steps,
|
31
|
+
customIcon: icons_1.CheckmarkCircle,
|
32
|
+
inActiveIcon: icons_1.Right,
|
33
|
+
},
|
34
|
+
methods: {
|
35
|
+
nextStep: function () {
|
36
|
+
this.setData({
|
37
|
+
active: ++this.data.active % 4,
|
38
|
+
});
|
39
|
+
},
|
40
|
+
onClick: function (event) {
|
41
|
+
(0, toast_1.default)({
|
42
|
+
context: this,
|
43
|
+
message: "Index: ".concat(event.detail),
|
44
|
+
});
|
45
|
+
},
|
46
|
+
},
|
47
|
+
});
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1,30 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
var component_1 = require("../../common/component");
|
4
|
+
(0, component_1.SmartComponent)({
|
5
|
+
data: {
|
6
|
+
container: function () { },
|
7
|
+
scrollTop: 0,
|
8
|
+
offsetTop: 0,
|
9
|
+
},
|
10
|
+
mounted: function () {
|
11
|
+
var _this = this;
|
12
|
+
this.setData({
|
13
|
+
container: function () { return _this.createSelectorQuery().select('#container'); },
|
14
|
+
});
|
15
|
+
},
|
16
|
+
methods: {
|
17
|
+
onScroll: function (event) {
|
18
|
+
var _this = this;
|
19
|
+
this.createSelectorQuery()
|
20
|
+
.select('#scroller')
|
21
|
+
.boundingClientRect(function (res) {
|
22
|
+
_this.setData({
|
23
|
+
scrollTop: event.detail.scrollTop,
|
24
|
+
offsetTop: res.top,
|
25
|
+
});
|
26
|
+
})
|
27
|
+
.exec();
|
28
|
+
},
|
29
|
+
},
|
30
|
+
});
|
package/lib/sticky/index.js
CHANGED
@@ -120,7 +120,9 @@ var ROOT_ELEMENT = '.smart-sticky';
|
|
120
120
|
if (!nodesRef) {
|
121
121
|
return Promise.reject(new Error('not found container'));
|
122
122
|
}
|
123
|
-
return new Promise(function (resolve) {
|
123
|
+
return new Promise(function (resolve) {
|
124
|
+
return nodesRef.boundingClientRect(resolve).exec();
|
125
|
+
});
|
124
126
|
},
|
125
127
|
},
|
126
128
|
});
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1,50 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
+
};
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
+
var component_1 = require("../../common/component");
|
7
|
+
var dialog_1 = __importDefault(require("../../dialog/dialog"));
|
8
|
+
var toast_1 = __importDefault(require("../../toast/toast"));
|
9
|
+
(0, component_1.SmartComponent)({
|
10
|
+
methods: {
|
11
|
+
onClose: function (event) {
|
12
|
+
var _a = event.detail, position = _a.position, instance = _a.instance;
|
13
|
+
switch (position) {
|
14
|
+
case 'left':
|
15
|
+
case 'cell':
|
16
|
+
instance.close();
|
17
|
+
break;
|
18
|
+
case 'right':
|
19
|
+
dialog_1.default.confirm({
|
20
|
+
context: this,
|
21
|
+
message: I18n.t('areYouSureYouWantToDelete'),
|
22
|
+
})
|
23
|
+
.then(function () {
|
24
|
+
instance.close();
|
25
|
+
})
|
26
|
+
.catch(function () {
|
27
|
+
console.log('cancel');
|
28
|
+
});
|
29
|
+
break;
|
30
|
+
}
|
31
|
+
},
|
32
|
+
onOpen: function (event) {
|
33
|
+
var _a = event.detail, position = _a.position, name = _a.name;
|
34
|
+
switch (position) {
|
35
|
+
case 'left':
|
36
|
+
(0, toast_1.default)({
|
37
|
+
context: this,
|
38
|
+
message: "".concat(name).concat(position).concat(I18n.t('partialOpenEventTriggered')),
|
39
|
+
});
|
40
|
+
break;
|
41
|
+
case 'right':
|
42
|
+
(0, toast_1.default)({
|
43
|
+
context: this,
|
44
|
+
message: "".concat(name).concat(position).concat(I18n.t('partialDisplayOpenEventTriggered')),
|
45
|
+
});
|
46
|
+
break;
|
47
|
+
}
|
48
|
+
},
|
49
|
+
},
|
50
|
+
});
|
package/lib/swipe-cell/index.js
CHANGED
@@ -64,9 +64,7 @@ var ARRAY = [];
|
|
64
64
|
if (offset === void 0) { offset = 0; }
|
65
65
|
this.offset = (0, utils_1.range)(offset, -this.data.rightWidth, this.data.leftWidth);
|
66
66
|
var transform = "translate3d(".concat(this.offset, "px, 0, 0)");
|
67
|
-
var transition = this.dragging
|
68
|
-
? 'none'
|
69
|
-
: 'transform .6s cubic-bezier(0.18, 0.89, 0.32, 1)';
|
67
|
+
var transition = this.dragging ? 'none' : 'transform .6s cubic-bezier(0.18, 0.89, 0.32, 1)';
|
70
68
|
this.setData({
|
71
69
|
wrapperStyle: "\n -webkit-transform: ".concat(transform, ";\n -webkit-transition: ").concat(transition, ";\n transform: ").concat(transform, ";\n transition: ").concat(transition, ";\n "),
|
72
70
|
});
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1,37 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
+
};
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
+
var component_1 = require("../../common/component");
|
7
|
+
var dialog_1 = __importDefault(require("../../dialog/dialog"));
|
8
|
+
(0, component_1.SmartComponent)({
|
9
|
+
data: {
|
10
|
+
checked: true,
|
11
|
+
checked2: true,
|
12
|
+
},
|
13
|
+
methods: {
|
14
|
+
onChange: function (_a) {
|
15
|
+
var detail = _a.detail;
|
16
|
+
this.setData({ checked: detail });
|
17
|
+
},
|
18
|
+
onChange2: function (_a) {
|
19
|
+
var _this = this;
|
20
|
+
var detail = _a.detail;
|
21
|
+
dialog_1.default.confirm({
|
22
|
+
context: this,
|
23
|
+
title: I18n.t('prompt'),
|
24
|
+
message: I18n.t('doYouWantToToggleTheSwitch'),
|
25
|
+
}).then(function () {
|
26
|
+
_this.setData({ checked2: detail });
|
27
|
+
});
|
28
|
+
},
|
29
|
+
onClick: function () {
|
30
|
+
dialog_1.default.confirm({
|
31
|
+
context: this,
|
32
|
+
title: I18n.t('hint'),
|
33
|
+
message: I18n.t('bubbleEvent'),
|
34
|
+
});
|
35
|
+
},
|
36
|
+
},
|
37
|
+
});
|
package/lib/switch/index.css
CHANGED
@@ -1 +1 @@
|
|
1
|
-
@import '../common/index.css';.smart-switch{background-color:var(--switch-background-color,var(--app-B4-N6,rgba(0,0,0,.2)));border:var(--switch-border,1px solid rgba(0,0,0,.1));border-radius:var(--switch-node-size,1em);box-sizing:initial;display:inline-block;height:var(--switch-height,1em);position:relative;transition:background-color var(--switch-transition-duration,.3s);width:var(--switch-width,1.667em)}.smart-switch__node{background-color:var(--switch-node-background-color,#fff);border-radius:100%;box-shadow:var(--switch-node-box-shadow,0 3px 1px 0 rgba(0,0,0,.05),0 2px 2px 0 rgba(0,0,0,.1),0 3px 3px 0 rgba(0,0,0,.05));height:var(--switch-node-size,1em);left:0;position:absolute;top:0;transition:var(--switch-transition-duration,.3s) cubic-bezier(.3,1.05,.4,1.05);width:var(--switch-node-size,1em);z-index:var(--switch-node-z-index,1)}.smart-switch__loading{left:50%;position:absolute!important;top:50%;transform:translate(-50%,-50%)}.smart-switch--on{background-color:var(--switch-on-background-color,#1989fa)}.smart-switch--on .smart-switch__node{transform:translateX(calc(var(--switch-width, 1.667em) - var(--switch-node-size, 1em)))}.smart-switch--disabled{opacity:var(--switch-disabled-opacity,.4)}
|
1
|
+
@import '../common/index.css';.smart-switch{background-color:var(--switch-background-color,var(--app-B4-N6,rgba(0,0,0,.2)));border:var(--switch-border,1px solid rgba(0,0,0,.1));border-color:transparent;border-radius:var(--switch-node-size,1em);box-sizing:initial;display:inline-block;height:var(--switch-height,1em);position:relative;transition:background-color var(--switch-transition-duration,.3s);width:var(--switch-width,1.667em)}.smart-switch__node{background-color:var(--switch-node-background-color,#fff);border-radius:100%;box-shadow:var(--switch-node-box-shadow,0 3px 1px 0 rgba(0,0,0,.05),0 2px 2px 0 rgba(0,0,0,.1),0 3px 3px 0 rgba(0,0,0,.05));height:var(--switch-node-size,1em);left:0;position:absolute;top:0;transition:var(--switch-transition-duration,.3s) cubic-bezier(.3,1.05,.4,1.05);width:var(--switch-node-size,1em);z-index:var(--switch-node-z-index,1)}.smart-switch__loading{left:50%;position:absolute!important;top:50%;transform:translate(-50%,-50%)}.smart-switch--on{background-color:var(--switch-on-background-color,#1989fa)}.smart-switch--on .smart-switch__node{transform:translateX(calc(var(--switch-width, 1.667em) - var(--switch-node-size, 1em)))}.smart-switch--disabled{opacity:var(--switch-disabled-opacity,.4)}
|
package/lib/switch/index.wxss
CHANGED
@@ -1 +1 @@
|
|
1
|
-
@import '../common/index.wxss';.smart-switch{background-color:var(--switch-background-color,var(--app-B4-N6,rgba(0,0,0,.2)));border:var(--switch-border,1px solid rgba(0,0,0,.1));border-radius:var(--switch-node-size,1em);box-sizing:initial;display:inline-block;height:var(--switch-height,1em);position:relative;transition:background-color var(--switch-transition-duration,.3s);width:var(--switch-width,1.667em)}.smart-switch__node{background-color:var(--switch-node-background-color,#fff);border-radius:100%;box-shadow:var(--switch-node-box-shadow,0 3px 1px 0 rgba(0,0,0,.05),0 2px 2px 0 rgba(0,0,0,.1),0 3px 3px 0 rgba(0,0,0,.05));height:var(--switch-node-size,1em);left:0;position:absolute;top:0;transition:var(--switch-transition-duration,.3s) cubic-bezier(.3,1.05,.4,1.05);width:var(--switch-node-size,1em);z-index:var(--switch-node-z-index,1)}.smart-switch__loading{left:50%;position:absolute!important;top:50%;transform:translate(-50%,-50%)}.smart-switch--on{background-color:var(--switch-on-background-color,#1989fa)}.smart-switch--on .smart-switch__node{transform:translateX(calc(var(--switch-width, 1.667em) - var(--switch-node-size, 1em)))}.smart-switch--disabled{opacity:var(--switch-disabled-opacity,.4)}
|
1
|
+
@import '../common/index.wxss';.smart-switch{background-color:var(--switch-background-color,var(--app-B4-N6,rgba(0,0,0,.2)));border:var(--switch-border,1px solid rgba(0,0,0,.1));border-color:transparent;border-radius:var(--switch-node-size,1em);box-sizing:initial;display:inline-block;height:var(--switch-height,1em);position:relative;transition:background-color var(--switch-transition-duration,.3s);width:var(--switch-width,1.667em)}.smart-switch__node{background-color:var(--switch-node-background-color,#fff);border-radius:100%;box-shadow:var(--switch-node-box-shadow,0 3px 1px 0 rgba(0,0,0,.05),0 2px 2px 0 rgba(0,0,0,.1),0 3px 3px 0 rgba(0,0,0,.05));height:var(--switch-node-size,1em);left:0;position:absolute;top:0;transition:var(--switch-transition-duration,.3s) cubic-bezier(.3,1.05,.4,1.05);width:var(--switch-node-size,1em);z-index:var(--switch-node-z-index,1)}.smart-switch__loading{left:50%;position:absolute!important;top:50%;transform:translate(-50%,-50%)}.smart-switch--on{background-color:var(--switch-on-background-color,#1989fa)}.smart-switch--on .smart-switch__node{transform:translateX(calc(var(--switch-width, 1.667em) - var(--switch-node-size, 1em)))}.smart-switch--disabled{opacity:var(--switch-disabled-opacity,.4)}
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1,57 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
var component_1 = require("../../common/component");
|
4
|
+
(0, component_1.SmartComponent)({
|
5
|
+
data: {
|
6
|
+
tabs2: [1, 2],
|
7
|
+
tabs3: [1, 2, 3],
|
8
|
+
tabs4: [1, 2, 3, 4],
|
9
|
+
tabs6: [1, 2, 3, 4, 5, 6],
|
10
|
+
tabsWithName: [
|
11
|
+
{ name: 'a', index: 1 },
|
12
|
+
{ name: 'b', index: 2 },
|
13
|
+
{ name: 'c', index: 3 },
|
14
|
+
],
|
15
|
+
},
|
16
|
+
methods: {
|
17
|
+
onClickDisabled: function (event) {
|
18
|
+
wx.showToast({
|
19
|
+
title: "".concat(I18n.t('label'), " ").concat(event.detail.index + 1, " ").concat(I18n.t('hasBeenDisabled')),
|
20
|
+
icon: 'none',
|
21
|
+
});
|
22
|
+
},
|
23
|
+
onChange: function (event) {
|
24
|
+
wx.showToast({
|
25
|
+
title: "".concat(I18n.t('switchToTab'), " ").concat(event.detail.index + 1),
|
26
|
+
icon: 'none',
|
27
|
+
});
|
28
|
+
},
|
29
|
+
onClickNavRight: function () {
|
30
|
+
wx.showToast({
|
31
|
+
title: "".concat(I18n.t('click'), " right nav"),
|
32
|
+
icon: 'none',
|
33
|
+
});
|
34
|
+
},
|
35
|
+
onClick: function (event) {
|
36
|
+
wx.showToast({
|
37
|
+
title: "".concat(I18n.t('clickTag'), " ").concat(event.detail.index + 1),
|
38
|
+
icon: 'none',
|
39
|
+
});
|
40
|
+
},
|
41
|
+
onBeforeChange: function (event) {
|
42
|
+
var _a = event.detail, callback = _a.callback, title = _a.title;
|
43
|
+
wx.showModal({
|
44
|
+
title: I18n.t('asynchronousSwitching'),
|
45
|
+
content: "I18n.t('areYouSureYouWantToSwitchTo') ".concat(title, " tab\uFF1F"),
|
46
|
+
success: function (res) {
|
47
|
+
if (res.confirm) {
|
48
|
+
callback(true);
|
49
|
+
}
|
50
|
+
else if (res.cancel) {
|
51
|
+
callback(false);
|
52
|
+
}
|
53
|
+
},
|
54
|
+
});
|
55
|
+
},
|
56
|
+
},
|
57
|
+
});
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1,41 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
+
};
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
+
var Tornado_1 = __importDefault(require("@tuya-miniapp/icons/dist/svg/Tornado"));
|
7
|
+
var Timer_1 = __importDefault(require("@tuya-miniapp/icons/dist/svg/Timer"));
|
8
|
+
var Snow_1 = __importDefault(require("@tuya-miniapp/icons/dist/svg/Snow"));
|
9
|
+
var Connect_1 = __importDefault(require("@tuya-miniapp/icons/dist/svg/Connect"));
|
10
|
+
var component_1 = require("../../common/component");
|
11
|
+
(0, component_1.SmartComponent)({
|
12
|
+
data: {
|
13
|
+
active: 0,
|
14
|
+
active2: 'home',
|
15
|
+
active3: 0,
|
16
|
+
active4: 0,
|
17
|
+
active5: 0,
|
18
|
+
active6: 0,
|
19
|
+
icon: {
|
20
|
+
normal: '',
|
21
|
+
active: 'https://static1.tuyacn.com/static/tuya-miniapp-doc/_next/static/images/logo-small.png',
|
22
|
+
},
|
23
|
+
defaultIcon1: Tornado_1.default,
|
24
|
+
defaultIcon2: Timer_1.default,
|
25
|
+
defaultIcon3: Snow_1.default,
|
26
|
+
defaultIcon4: Connect_1.default,
|
27
|
+
},
|
28
|
+
methods: {
|
29
|
+
onChange: function (event) {
|
30
|
+
var _a;
|
31
|
+
var key = event.currentTarget.dataset.key;
|
32
|
+
this.setData((_a = {}, _a[key] = event.detail, _a));
|
33
|
+
},
|
34
|
+
handleChange: function (event) {
|
35
|
+
var _a;
|
36
|
+
var key = event.currentTarget.dataset.key;
|
37
|
+
this.setData((_a = {}, _a[key] = event.detail, _a));
|
38
|
+
wx.showToast({ title: "".concat(I18n.t('clickTheTab'), " ").concat(event.detail + 1), icon: 'none' });
|
39
|
+
},
|
40
|
+
},
|
41
|
+
});
|
package/lib/tabs/index.js
CHANGED
@@ -18,13 +18,7 @@ var validator_1 = require("../common/validator");
|
|
18
18
|
var relation_1 = require("../common/relation");
|
19
19
|
(0, component_1.SmartComponent)({
|
20
20
|
mixins: [touch_1.touch],
|
21
|
-
classes: [
|
22
|
-
'nav-class',
|
23
|
-
'tab-class',
|
24
|
-
'tab-active-class',
|
25
|
-
'line-class',
|
26
|
-
'wrap-class',
|
27
|
-
],
|
21
|
+
classes: ['nav-class', 'tab-class', 'tab-active-class', 'line-class', 'wrap-class'],
|
28
22
|
relation: (0, relation_1.useChildren)('tab', function () {
|
29
23
|
this.updateTabs();
|
30
24
|
}),
|
@@ -165,9 +159,7 @@ var relation_1 = require("../common/relation");
|
|
165
159
|
setCurrentIndex: function (currentIndex) {
|
166
160
|
var _this = this;
|
167
161
|
var _a = this, data = _a.data, _b = _a.children, children = _b === void 0 ? [] : _b;
|
168
|
-
if (!(0, validator_1.isDef)(currentIndex) ||
|
169
|
-
currentIndex >= children.length ||
|
170
|
-
currentIndex < 0) {
|
162
|
+
if (!(0, validator_1.isDef)(currentIndex) || currentIndex >= children.length || currentIndex < 0) {
|
171
163
|
return;
|
172
164
|
}
|
173
165
|
(0, utils_1.groupSetData)(this, function () {
|
@@ -206,10 +198,7 @@ var relation_1 = require("../common/relation");
|
|
206
198
|
resize: function () {
|
207
199
|
var _this = this;
|
208
200
|
var _a = this.data, currentIndex = _a.currentIndex, ellipsis = _a.ellipsis, skipTransition = _a.skipTransition, type = _a.type;
|
209
|
-
Promise.all([
|
210
|
-
(0, utils_1.getAllRect)(this, '.smart-tab'),
|
211
|
-
(0, utils_1.getRect)(this, '.smart-tabs__line'),
|
212
|
-
]).then(function (_a) {
|
201
|
+
Promise.all([(0, utils_1.getAllRect)(this, '.smart-tab'), (0, utils_1.getRect)(this, '.smart-tabs__line')]).then(function (_a) {
|
213
202
|
var _b = _a[0], rects = _b === void 0 ? [] : _b, lineRect = _a[1];
|
214
203
|
var rect = rects[currentIndex];
|
215
204
|
if (rect == null) {
|
@@ -220,8 +209,7 @@ var relation_1 = require("../common/relation");
|
|
220
209
|
.slice(0, currentIndex)
|
221
210
|
.reduce(function (prev, curr) { return prev + curr.width; }, 0);
|
222
211
|
if (type === 'line') {
|
223
|
-
lineOffsetLeft +=
|
224
|
-
(rect.width - lineRect.width) / 2 + (ellipsis ? 0 : 8);
|
212
|
+
lineOffsetLeft += (rect.width - lineRect.width) / 2 + (ellipsis ? 0 : 8);
|
225
213
|
}
|
226
214
|
else if (type === 'card') {
|
227
215
|
lineOffsetLeft += 2;
|
@@ -243,10 +231,7 @@ var relation_1 = require("../common/relation");
|
|
243
231
|
if (!scrollable) {
|
244
232
|
return;
|
245
233
|
}
|
246
|
-
Promise.all([
|
247
|
-
(0, utils_1.getAllRect)(this, '.smart-tab'),
|
248
|
-
(0, utils_1.getRect)(this, '.smart-tabs__nav'),
|
249
|
-
]).then(function (_a) {
|
234
|
+
Promise.all([(0, utils_1.getAllRect)(this, '.smart-tab'), (0, utils_1.getRect)(this, '.smart-tabs__nav')]).then(function (_a) {
|
250
235
|
var tabRects = _a[0], navRect = _a[1];
|
251
236
|
var tabRect = tabRects[currentIndex];
|
252
237
|
var offsetLeft = tabRects
|
@@ -296,10 +281,7 @@ var relation_1 = require("../common/relation");
|
|
296
281
|
var step = direction > 0 ? -1 : 1;
|
297
282
|
for (var i = step; currentIndex + i < tabs.length && currentIndex + i >= 0; i += step) {
|
298
283
|
var index = currentIndex + i;
|
299
|
-
if (index >= 0 &&
|
300
|
-
index < tabs.length &&
|
301
|
-
tabs[index] &&
|
302
|
-
!tabs[index].disabled) {
|
284
|
+
if (index >= 0 && index < tabs.length && tabs[index] && !tabs[index].disabled) {
|
303
285
|
return index;
|
304
286
|
}
|
305
287
|
}
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1,19 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
var component_1 = require("../../common/component");
|
4
|
+
(0, component_1.SmartComponent)({
|
5
|
+
data: {
|
6
|
+
show: {
|
7
|
+
success: true,
|
8
|
+
primary: true,
|
9
|
+
},
|
10
|
+
},
|
11
|
+
methods: {
|
12
|
+
onClose: function (event) {
|
13
|
+
var _a;
|
14
|
+
this.setData((_a = {},
|
15
|
+
_a["show.".concat(event.target.id)] = false,
|
16
|
+
_a));
|
17
|
+
},
|
18
|
+
},
|
19
|
+
});
|
package/lib/tag/index.css
CHANGED
@@ -1 +1 @@
|
|
1
|
-
@import '../common/index.css';.smart-tag{align-items:center;border-radius:var(--tag-border-radius,4px);color:var(--tag-text-color,#fff);display:inline-flex;font-size:var(--tag-font-size,12px);line-height:var(--tag-line-height,17px);padding:var(--tag-padding,2px 8px);position:relative}.smart-tag--default{background-color:var(--tag-default-color,#969799)}.smart-tag--default.smart-tag--plain{color:var(--tag-default-color,#969799)}.smart-tag--danger{background-color:var(--tag-danger-color,#ee0a24)}.smart-tag--danger.smart-tag--plain{color:var(--tag-danger-color,#ee0a24)}.smart-tag--primary{background-color:var(--tag-primary-color,#1989fa)}.smart-tag--primary.smart-tag--plain{color:var(--tag-primary-color,#1989fa)}.smart-tag--success{background-color:var(--tag-success-color,#07c160)}.smart-tag--success.smart-tag--plain{color:var(--tag-success-color,#07c160)}.smart-tag--warning{background-color:var(--tag-warning-color,#ff976a)}.smart-tag--warning.smart-tag--plain{color:var(--tag-warning-color,#ff976a)}.smart-tag--plain{background-color:var(--tag-plain-background-color
|
1
|
+
@import '../common/index.css';.smart-tag{align-items:center;border-radius:var(--tag-border-radius,4px);color:var(--tag-text-color,#fff);display:inline-flex;font-size:var(--tag-font-size,12px);line-height:var(--tag-line-height,17px);padding:var(--tag-padding,2px 8px);position:relative}.smart-tag--default{background-color:var(--tag-default-color,#969799)}.smart-tag--default.smart-tag--plain{color:var(--tag-default-color,#969799)}.smart-tag--danger{background-color:var(--tag-danger-color,#ee0a24)}.smart-tag--danger.smart-tag--plain{color:var(--tag-danger-color,#ee0a24)}.smart-tag--primary{background-color:var(--tag-primary-color,#1989fa)}.smart-tag--primary.smart-tag--plain{color:var(--tag-primary-color,#1989fa)}.smart-tag--success{background-color:var(--tag-success-color,#07c160)}.smart-tag--success.smart-tag--plain{color:var(--tag-success-color,#07c160)}.smart-tag--warning{background-color:var(--tag-warning-color,#ff976a)}.smart-tag--warning.smart-tag--plain{color:var(--tag-warning-color,#ff976a)}.smart-tag--plain{background-color:var(--tag-plain-background-color,transparent)}.smart-tag--plain:before{border:1px solid;border-radius:inherit;bottom:0;content:"";left:0;pointer-events:none;position:absolute;right:0;top:0}.smart-tag--medium{font-size:var(--tag-medium-font-size,14px);line-height:var(--tag-medium-line-height,20px)}.smart-tag--large{font-size:var(--tag-large-font-size,16px);line-height:var(--tag-large-line-height,22px)}.smart-tag--mark{border-radius:0 var(--tag-round-border-radius,var(--tag-round-border-radius,999px)) var(--tag-round-border-radius,var(--tag-round-border-radius,999px)) 0}.smart-tag--mark:after{content:"";display:block;width:2px}.smart-tag--round{border-radius:var(--tag-round-border-radius,999px)}.smart-tag__close{margin-left:2px;min-width:1em}
|
package/lib/tag/index.wxss
CHANGED
@@ -1 +1 @@
|
|
1
|
-
@import '../common/index.wxss';.smart-tag{align-items:center;border-radius:var(--tag-border-radius,4px);color:var(--tag-text-color,#fff);display:inline-flex;font-size:var(--tag-font-size,12px);line-height:var(--tag-line-height,17px);padding:var(--tag-padding,2px 8px);position:relative}.smart-tag--default{background-color:var(--tag-default-color,#969799)}.smart-tag--default.smart-tag--plain{color:var(--tag-default-color,#969799)}.smart-tag--danger{background-color:var(--tag-danger-color,#ee0a24)}.smart-tag--danger.smart-tag--plain{color:var(--tag-danger-color,#ee0a24)}.smart-tag--primary{background-color:var(--tag-primary-color,#1989fa)}.smart-tag--primary.smart-tag--plain{color:var(--tag-primary-color,#1989fa)}.smart-tag--success{background-color:var(--tag-success-color,#07c160)}.smart-tag--success.smart-tag--plain{color:var(--tag-success-color,#07c160)}.smart-tag--warning{background-color:var(--tag-warning-color,#ff976a)}.smart-tag--warning.smart-tag--plain{color:var(--tag-warning-color,#ff976a)}.smart-tag--plain{background-color:var(--tag-plain-background-color
|
1
|
+
@import '../common/index.wxss';.smart-tag{align-items:center;border-radius:var(--tag-border-radius,4px);color:var(--tag-text-color,#fff);display:inline-flex;font-size:var(--tag-font-size,12px);line-height:var(--tag-line-height,17px);padding:var(--tag-padding,2px 8px);position:relative}.smart-tag--default{background-color:var(--tag-default-color,#969799)}.smart-tag--default.smart-tag--plain{color:var(--tag-default-color,#969799)}.smart-tag--danger{background-color:var(--tag-danger-color,#ee0a24)}.smart-tag--danger.smart-tag--plain{color:var(--tag-danger-color,#ee0a24)}.smart-tag--primary{background-color:var(--tag-primary-color,#1989fa)}.smart-tag--primary.smart-tag--plain{color:var(--tag-primary-color,#1989fa)}.smart-tag--success{background-color:var(--tag-success-color,#07c160)}.smart-tag--success.smart-tag--plain{color:var(--tag-success-color,#07c160)}.smart-tag--warning{background-color:var(--tag-warning-color,#ff976a)}.smart-tag--warning.smart-tag--plain{color:var(--tag-warning-color,#ff976a)}.smart-tag--plain{background-color:var(--tag-plain-background-color,transparent)}.smart-tag--plain:before{border:1px solid;border-radius:inherit;bottom:0;content:"";left:0;pointer-events:none;position:absolute;right:0;top:0}.smart-tag--medium{font-size:var(--tag-medium-font-size,14px);line-height:var(--tag-medium-line-height,20px)}.smart-tag--large{font-size:var(--tag-large-font-size,16px);line-height:var(--tag-large-line-height,22px)}.smart-tag--mark{border-radius:0 var(--tag-round-border-radius,var(--tag-round-border-radius,999px)) var(--tag-round-border-radius,var(--tag-round-border-radius,999px)) 0}.smart-tag--mark:after{content:"";display:block;width:2px}.smart-tag--round{border-radius:var(--tag-round-border-radius,999px)}.smart-tag__close{margin-left:2px;min-width:1em}
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|