@tuya-miniapp/smart-ui 1.3.1-beta-2 → 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/calendar.wxml +13 -8
- package/dist/calendar/components/header/index.css +1 -1
- package/dist/calendar/components/header/index.js +7 -3
- 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 +26 -41
- package/dist/calendar/components/month-list/index.wxml +8 -2
- 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 +17 -4
- package/dist/calendar/components/year-list/index.wxml +8 -2
- 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 +32 -39
- package/dist/calendar/index.wxs +5 -8
- package/dist/calendar/utils.d.ts +4 -0
- package/dist/calendar/utils.js +30 -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.css +1 -1
- package/dist/notice-bar/index.js +3 -6
- package/dist/notice-bar/index.wxml +1 -5
- package/dist/notice-bar/index.wxss +1 -1
- 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/search/index.css +1 -1
- package/dist/search/index.js +1 -5
- package/dist/search/index.wxml +1 -1
- package/dist/search/index.wxss +1 -1
- 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.css +1 -1
- package/dist/tabs/index.js +7 -25
- package/dist/tabs/index.wxss +1 -1
- 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 +5 -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/dist/wxs/style.wxs +0 -7
- 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/calendar.wxml +13 -8
- package/lib/calendar/components/header/index.css +1 -1
- package/lib/calendar/components/header/index.js +6 -2
- 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 +25 -40
- package/lib/calendar/components/month-list/index.wxml +8 -2
- 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 +15 -2
- package/lib/calendar/components/year-list/index.wxml +8 -2
- 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 +29 -38
- package/lib/calendar/index.wxs +5 -8
- package/lib/calendar/utils.d.ts +4 -0
- package/lib/calendar/utils.js +31 -4
- 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.css +1 -1
- package/lib/notice-bar/index.js +2 -5
- package/lib/notice-bar/index.wxml +1 -5
- package/lib/notice-bar/index.wxss +1 -1
- 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/search/index.css +1 -1
- package/lib/search/index.js +1 -5
- package/lib/search/index.wxml +1 -1
- package/lib/search/index.wxss +1 -1
- 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.css +1 -1
- package/lib/tabs/index.js +6 -24
- package/lib/tabs/index.wxss +1 -1
- 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 +3 -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/lib/wxs/style.wxs +0 -7
- package/package.json +15 -3
@@ -0,0 +1,55 @@
|
|
1
|
+
import { SmartComponent } from '../../common/component';
|
2
|
+
SmartComponent({
|
3
|
+
data: {
|
4
|
+
tabs2: [1, 2],
|
5
|
+
tabs3: [1, 2, 3],
|
6
|
+
tabs4: [1, 2, 3, 4],
|
7
|
+
tabs6: [1, 2, 3, 4, 5, 6],
|
8
|
+
tabsWithName: [
|
9
|
+
{ name: 'a', index: 1 },
|
10
|
+
{ name: 'b', index: 2 },
|
11
|
+
{ name: 'c', index: 3 },
|
12
|
+
],
|
13
|
+
},
|
14
|
+
methods: {
|
15
|
+
onClickDisabled(event) {
|
16
|
+
wx.showToast({
|
17
|
+
title: `${I18n.t('label')} ${event.detail.index + 1} ${I18n.t('hasBeenDisabled')}`,
|
18
|
+
icon: 'none',
|
19
|
+
});
|
20
|
+
},
|
21
|
+
onChange(event) {
|
22
|
+
wx.showToast({
|
23
|
+
title: `${I18n.t('switchToTab')} ${event.detail.index + 1}`,
|
24
|
+
icon: 'none',
|
25
|
+
});
|
26
|
+
},
|
27
|
+
onClickNavRight() {
|
28
|
+
wx.showToast({
|
29
|
+
title: `${I18n.t('click')} right nav`,
|
30
|
+
icon: 'none',
|
31
|
+
});
|
32
|
+
},
|
33
|
+
onClick(event) {
|
34
|
+
wx.showToast({
|
35
|
+
title: `${I18n.t('clickTag')} ${event.detail.index + 1}`,
|
36
|
+
icon: 'none',
|
37
|
+
});
|
38
|
+
},
|
39
|
+
onBeforeChange(event) {
|
40
|
+
const { callback, title } = event.detail;
|
41
|
+
wx.showModal({
|
42
|
+
title: I18n.t('asynchronousSwitching'),
|
43
|
+
content: `I18n.t('areYouSureYouWantToSwitchTo') ${title} tab?`,
|
44
|
+
success: (res) => {
|
45
|
+
if (res.confirm) {
|
46
|
+
callback(true);
|
47
|
+
}
|
48
|
+
else if (res.cancel) {
|
49
|
+
callback(false);
|
50
|
+
}
|
51
|
+
},
|
52
|
+
});
|
53
|
+
},
|
54
|
+
},
|
55
|
+
});
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1,34 @@
|
|
1
|
+
import Tornado from '@tuya-miniapp/icons/dist/svg/Tornado';
|
2
|
+
import Timer from '@tuya-miniapp/icons/dist/svg/Timer';
|
3
|
+
import TorSnownado from '@tuya-miniapp/icons/dist/svg/Snow';
|
4
|
+
import Connect from '@tuya-miniapp/icons/dist/svg/Connect';
|
5
|
+
import { SmartComponent } from '../../common/component';
|
6
|
+
SmartComponent({
|
7
|
+
data: {
|
8
|
+
active: 0,
|
9
|
+
active2: 'home',
|
10
|
+
active3: 0,
|
11
|
+
active4: 0,
|
12
|
+
active5: 0,
|
13
|
+
active6: 0,
|
14
|
+
icon: {
|
15
|
+
normal: '',
|
16
|
+
active: 'https://static1.tuyacn.com/static/tuya-miniapp-doc/_next/static/images/logo-small.png',
|
17
|
+
},
|
18
|
+
defaultIcon1: Tornado,
|
19
|
+
defaultIcon2: Timer,
|
20
|
+
defaultIcon3: TorSnownado,
|
21
|
+
defaultIcon4: Connect,
|
22
|
+
},
|
23
|
+
methods: {
|
24
|
+
onChange(event) {
|
25
|
+
const { key } = event.currentTarget.dataset;
|
26
|
+
this.setData({ [key]: event.detail });
|
27
|
+
},
|
28
|
+
handleChange(event) {
|
29
|
+
const { key } = event.currentTarget.dataset;
|
30
|
+
this.setData({ [key]: event.detail });
|
31
|
+
wx.showToast({ title: `${I18n.t('clickTheTab')} ${event.detail + 1}`, icon: 'none' });
|
32
|
+
},
|
33
|
+
},
|
34
|
+
});
|
package/dist/tabbar/index.js
CHANGED
package/dist/tabs/index.css
CHANGED
@@ -1 +1 @@
|
|
1
|
-
@import '../common/index.css';:root{--tabs-card-background-color:rgba(0,0,0,.08)}:root[theme=dark]{--tabs-card-background-color:hsla(0,0%,100%,.12)}.smart-tabs{-webkit-tap-highlight-color:transparent;position:relative}.smart-tabs__wrap{display:flex;overflow:hidden}.smart-tabs__wrap--scrollable .smart-tab{flex:0 0 22%}.smart-tabs__wrap--scrollable .smart-tab--complete{flex:1 0 auto!important;padding:0 12px}.smart-tabs__wrap--scrollable .smart-tabs__nav--complete{padding-left:8px;padding-right:8px}.smart-tabs__scroll{background-color:var(--tabs-background-color,var(--app-B3,#fff));overflow:auto}.smart-tabs__scroll--line{box-sizing:initial;height:calc(100% + 15px)}.smart-tabs__scroll--card{border-radius:var(--tabs-card-border-radius,8px);box-sizing:border-box;margin:0 var(--padding-md,16px);width:calc(100% - var(--padding-md, 16px)*2)}.smart-tabs__scroll::-webkit-scrollbar{display:none}.smart-tabs__nav{display:flex;position:relative;-webkit-user-select:none;user-select:none}.smart-tabs__nav--card{background-color:var(--tabs-card-background-color);border-radius:var(--tabs-card-border-radius,8px);box-sizing:border-box;height:var(--tabs-card-height,32px);padding:2px}.smart-tabs__nav--card .smart-tab{color:var(--tabs-card-text-color,var(--app-B6-N3,rgba(0,0,0,.5)));line-height:calc(var(--tabs-card-height, 32px) - 2px)}.smart-tabs__nav--card .smart-tab:last-child{border-right:none}.smart-tabs__nav--card .smart-tab.smart-tab--active{color:var(--tabs-card-text-active-color,var(--app-B6-N1,#000))}.smart-tabs__nav--card .smart-tab--disabled{color:var(--tab-disabled-text-color,var(--app-B6-N7,rgba(0,0,0,.1)))}.smart-tabs__line{background-color:var(--tabs-bottom-bar-color,var(--app-M4,#1989fa));border-radius:var(--tabs-bottom-bar-height,3px);bottom:0;height:var(--tabs-bottom-bar-height,3px);left:0;opacity:0;position:absolute;z-index:1}.smart-tabs__card{background-color:var(--tabs-card-active-background-color,var(--app-B3,#fff));border-radius:6px;left:0;opacity:0;position:absolute;top:0;z-index:0}.smart-tabs__track{height:100%;position:relative;width:100%}.smart-tabs__track--animated{display:flex;transition-property:left}.smart-tabs__content{overflow:hidden}.smart-tabs--line{height:var(--tabs-line-height,32px)}.smart-tabs--card{height:var(--tabs-card-height,32px)}.smart-tab{box-sizing:border-box;color:var(--tabs-card-text-color,var(--app-B6-N3,rgba(0,0,0,.5)));cursor:pointer;flex:1;font-size:var(--tab-font-size,13px);line-height:var(--tabs-line-height,32px);min-width:0;padding:0 5px;position:relative;text-align:center}.smart-tab--active{color:var(--tabs-card-text-active-color,var(--app-B6-N1,#000));font-weight:var(--font-weight-bold,500)}.smart-tab--disabled{color:var(--tab-disabled-text-color,var(--app-B6-N7,rgba(0,0,0,.1)))}.smart-tab__title__info{position:relative!important;top:-1px!important;transform:translateX(0)!important}
|
1
|
+
@import '../common/index.css';:root{--tabs-card-background-color:rgba(0,0,0,.08)}:root[theme=dark]{--tabs-card-background-color:hsla(0,0%,100%,.12)}.smart-tabs{-webkit-tap-highlight-color:transparent;position:relative}.smart-tabs__wrap{display:flex;overflow:hidden}.smart-tabs__wrap--scrollable .smart-tab{flex:0 0 22%}.smart-tabs__wrap--scrollable .smart-tab--complete{flex:1 0 auto!important;padding:0 12px}.smart-tabs__wrap--scrollable .smart-tabs__nav--complete{padding-left:8px;padding-right:8px}.smart-tabs__scroll{background-color:var(--tabs-background-color,var(--app-B3,#fff));overflow:auto}.smart-tabs__scroll--line{box-sizing:initial;height:calc(100% + 15px)}.smart-tabs__scroll--card{border-radius:var(--tabs-card-border-radius,8px);box-sizing:border-box;margin:0 var(--padding-md,16px);width:calc(100% - var(--padding-md, 16px)*2)}.smart-tabs__scroll::-webkit-scrollbar{display:none}.smart-tabs__nav{display:flex;position:relative;-webkit-user-select:none;user-select:none}.smart-tabs__nav--card{background-color:var(--tabs-card-background-color);border-radius:var(--tabs-card-border-radius,8px);box-sizing:border-box;height:var(--tabs-card-height,32px);padding:2px}.smart-tabs__nav--card .smart-tab{color:var(--tabs-card-text-color,var(--app-B6-N3,rgba(0,0,0,.5)));line-height:calc(var(--tabs-card-height, 32px) - 2px)}.smart-tabs__nav--card .smart-tab:last-child{border-right:none}.smart-tabs__nav--card .smart-tab.smart-tab--active{color:var(--tabs-card-text-active-color,var(--app-B6-N1,#000))}.smart-tabs__nav--card .smart-tab--disabled{color:var(--tab-disabled-text-color,var(--app-B6-N7,rgba(0,0,0,.1)))}.smart-tabs__line{background-color:var(--tabs-bottom-bar-color,var(--app-M4,#1989fa));border-radius:var(--tabs-bottom-bar-height,3px);bottom:0;height:var(--tabs-bottom-bar-height,3px);left:0;opacity:0;position:absolute;z-index:1}.smart-tabs__card{background-color:var(--tabs-card-active-background-color,var(--app-B3,#fff));border-radius:var(--tabs-card-active-border-radius,6px);left:0;opacity:0;position:absolute;top:0;z-index:0}.smart-tabs__track{height:100%;position:relative;width:100%}.smart-tabs__track--animated{display:flex;transition-property:left}.smart-tabs__content{overflow:hidden}.smart-tabs--line{height:var(--tabs-line-height,32px)}.smart-tabs--card{height:var(--tabs-card-height,32px)}.smart-tab{box-sizing:border-box;color:var(--tabs-card-text-color,var(--app-B6-N3,rgba(0,0,0,.5)));cursor:pointer;flex:1;font-size:var(--tab-font-size,13px);line-height:var(--tabs-line-height,32px);min-width:0;padding:0 5px;position:relative;text-align:center}.smart-tab--active{color:var(--tabs-card-text-active-color,var(--app-B6-N1,#000));font-weight:var(--font-weight-bold,500)}.smart-tab--disabled{color:var(--tab-disabled-text-color,var(--app-B6-N7,rgba(0,0,0,.1)))}.smart-tab__title__info{position:relative!important;top:-1px!important;transform:translateX(0)!important}
|
package/dist/tabs/index.js
CHANGED
@@ -5,13 +5,7 @@ import { isDef } from '../common/validator';
|
|
5
5
|
import { useChildren } from '../common/relation';
|
6
6
|
SmartComponent({
|
7
7
|
mixins: [touch],
|
8
|
-
classes: [
|
9
|
-
'nav-class',
|
10
|
-
'tab-class',
|
11
|
-
'tab-active-class',
|
12
|
-
'line-class',
|
13
|
-
'wrap-class',
|
14
|
-
],
|
8
|
+
classes: ['nav-class', 'tab-class', 'tab-active-class', 'line-class', 'wrap-class'],
|
15
9
|
relation: useChildren('tab', function () {
|
16
10
|
this.updateTabs();
|
17
11
|
}),
|
@@ -146,9 +140,7 @@ SmartComponent({
|
|
146
140
|
},
|
147
141
|
setCurrentIndex(currentIndex) {
|
148
142
|
const { data, children = [] } = this;
|
149
|
-
if (!isDef(currentIndex) ||
|
150
|
-
currentIndex >= children.length ||
|
151
|
-
currentIndex < 0) {
|
143
|
+
if (!isDef(currentIndex) || currentIndex >= children.length || currentIndex < 0) {
|
152
144
|
return;
|
153
145
|
}
|
154
146
|
groupSetData(this, () => {
|
@@ -186,10 +178,7 @@ SmartComponent({
|
|
186
178
|
},
|
187
179
|
resize() {
|
188
180
|
const { currentIndex, ellipsis, skipTransition, type } = this.data;
|
189
|
-
Promise.all([
|
190
|
-
getAllRect(this, '.smart-tab'),
|
191
|
-
getRect(this, '.smart-tabs__line'),
|
192
|
-
]).then(([rects = [], lineRect]) => {
|
181
|
+
Promise.all([getAllRect(this, '.smart-tab'), getRect(this, '.smart-tabs__line')]).then(([rects = [], lineRect]) => {
|
193
182
|
const rect = rects[currentIndex];
|
194
183
|
if (rect == null) {
|
195
184
|
return;
|
@@ -199,8 +188,7 @@ SmartComponent({
|
|
199
188
|
.slice(0, currentIndex)
|
200
189
|
.reduce((prev, curr) => prev + curr.width, 0);
|
201
190
|
if (type === 'line') {
|
202
|
-
lineOffsetLeft +=
|
203
|
-
(rect.width - lineRect.width) / 2 + (ellipsis ? 0 : 8);
|
191
|
+
lineOffsetLeft += (rect.width - lineRect.width) / 2 + (ellipsis ? 0 : 8);
|
204
192
|
}
|
205
193
|
else if (type === 'card') {
|
206
194
|
lineOffsetLeft += 2;
|
@@ -221,10 +209,7 @@ SmartComponent({
|
|
221
209
|
if (!scrollable) {
|
222
210
|
return;
|
223
211
|
}
|
224
|
-
Promise.all([
|
225
|
-
getAllRect(this, '.smart-tab'),
|
226
|
-
getRect(this, '.smart-tabs__nav'),
|
227
|
-
]).then(([tabRects, navRect]) => {
|
212
|
+
Promise.all([getAllRect(this, '.smart-tab'), getRect(this, '.smart-tabs__nav')]).then(([tabRects, navRect]) => {
|
228
213
|
const tabRect = tabRects[currentIndex];
|
229
214
|
const offsetLeft = tabRects
|
230
215
|
.slice(0, currentIndex)
|
@@ -272,10 +257,7 @@ SmartComponent({
|
|
272
257
|
const step = direction > 0 ? -1 : 1;
|
273
258
|
for (let i = step; currentIndex + i < tabs.length && currentIndex + i >= 0; i += step) {
|
274
259
|
const index = currentIndex + i;
|
275
|
-
if (index >= 0 &&
|
276
|
-
index < tabs.length &&
|
277
|
-
tabs[index] &&
|
278
|
-
!tabs[index].disabled) {
|
260
|
+
if (index >= 0 && index < tabs.length && tabs[index] && !tabs[index].disabled) {
|
279
261
|
return index;
|
280
262
|
}
|
281
263
|
}
|
@@ -287,7 +269,7 @@ SmartComponent({
|
|
287
269
|
return Promise.resolve();
|
288
270
|
}
|
289
271
|
return new Promise((resolve, reject) => {
|
290
|
-
this.$emit('before-change', Object.assign(Object.assign({}, this.getChildData(index)), { callback:
|
272
|
+
this.$emit('before-change', Object.assign(Object.assign({}, this.getChildData(index)), { callback: status => (status ? resolve() : reject()) }));
|
291
273
|
});
|
292
274
|
},
|
293
275
|
getChildData(index, child) {
|
package/dist/tabs/index.wxss
CHANGED
@@ -1 +1 @@
|
|
1
|
-
@import '../common/index.wxss';:root{--tabs-card-background-color:rgba(0,0,0,.08)}:root[theme=dark]{--tabs-card-background-color:hsla(0,0%,100%,.12)}.smart-tabs{-webkit-tap-highlight-color:transparent;position:relative}.smart-tabs__wrap{display:flex;overflow:hidden}.smart-tabs__wrap--scrollable .smart-tab{flex:0 0 22%}.smart-tabs__wrap--scrollable .smart-tab--complete{flex:1 0 auto!important;padding:0 12px}.smart-tabs__wrap--scrollable .smart-tabs__nav--complete{padding-left:8px;padding-right:8px}.smart-tabs__scroll{background-color:var(--tabs-background-color,var(--app-B3,#fff));overflow:auto}.smart-tabs__scroll--line{box-sizing:initial;height:calc(100% + 15px)}.smart-tabs__scroll--card{border-radius:var(--tabs-card-border-radius,8px);box-sizing:border-box;margin:0 var(--padding-md,16px);width:calc(100% - var(--padding-md, 16px)*2)}.smart-tabs__scroll::-webkit-scrollbar{display:none}.smart-tabs__nav{display:flex;position:relative;-webkit-user-select:none;user-select:none}.smart-tabs__nav--card{background-color:var(--tabs-card-background-color);border-radius:var(--tabs-card-border-radius,8px);box-sizing:border-box;height:var(--tabs-card-height,32px);padding:2px}.smart-tabs__nav--card .smart-tab{color:var(--tabs-card-text-color,var(--app-B6-N3,rgba(0,0,0,.5)));line-height:calc(var(--tabs-card-height, 32px) - 2px)}.smart-tabs__nav--card .smart-tab:last-child{border-right:none}.smart-tabs__nav--card .smart-tab.smart-tab--active{color:var(--tabs-card-text-active-color,var(--app-B6-N1,#000))}.smart-tabs__nav--card .smart-tab--disabled{color:var(--tab-disabled-text-color,var(--app-B6-N7,rgba(0,0,0,.1)))}.smart-tabs__line{background-color:var(--tabs-bottom-bar-color,var(--app-M4,#1989fa));border-radius:var(--tabs-bottom-bar-height,3px);bottom:0;height:var(--tabs-bottom-bar-height,3px);left:0;opacity:0;position:absolute;z-index:1}.smart-tabs__card{background-color:var(--tabs-card-active-background-color,var(--app-B3,#fff));border-radius:6px;left:0;opacity:0;position:absolute;top:0;z-index:0}.smart-tabs__track{height:100%;position:relative;width:100%}.smart-tabs__track--animated{display:flex;transition-property:left}.smart-tabs__content{overflow:hidden}.smart-tabs--line{height:var(--tabs-line-height,32px)}.smart-tabs--card{height:var(--tabs-card-height,32px)}.smart-tab{box-sizing:border-box;color:var(--tabs-card-text-color,var(--app-B6-N3,rgba(0,0,0,.5)));cursor:pointer;flex:1;font-size:var(--tab-font-size,13px);line-height:var(--tabs-line-height,32px);min-width:0;padding:0 5px;position:relative;text-align:center}.smart-tab--active{color:var(--tabs-card-text-active-color,var(--app-B6-N1,#000));font-weight:var(--font-weight-bold,500)}.smart-tab--disabled{color:var(--tab-disabled-text-color,var(--app-B6-N7,rgba(0,0,0,.1)))}.smart-tab__title__info{position:relative!important;top:-1px!important;transform:translateX(0)!important}
|
1
|
+
@import '../common/index.wxss';:root{--tabs-card-background-color:rgba(0,0,0,.08)}:root[theme=dark]{--tabs-card-background-color:hsla(0,0%,100%,.12)}.smart-tabs{-webkit-tap-highlight-color:transparent;position:relative}.smart-tabs__wrap{display:flex;overflow:hidden}.smart-tabs__wrap--scrollable .smart-tab{flex:0 0 22%}.smart-tabs__wrap--scrollable .smart-tab--complete{flex:1 0 auto!important;padding:0 12px}.smart-tabs__wrap--scrollable .smart-tabs__nav--complete{padding-left:8px;padding-right:8px}.smart-tabs__scroll{background-color:var(--tabs-background-color,var(--app-B3,#fff));overflow:auto}.smart-tabs__scroll--line{box-sizing:initial;height:calc(100% + 15px)}.smart-tabs__scroll--card{border-radius:var(--tabs-card-border-radius,8px);box-sizing:border-box;margin:0 var(--padding-md,16px);width:calc(100% - var(--padding-md, 16px)*2)}.smart-tabs__scroll::-webkit-scrollbar{display:none}.smart-tabs__nav{display:flex;position:relative;-webkit-user-select:none;user-select:none}.smart-tabs__nav--card{background-color:var(--tabs-card-background-color);border-radius:var(--tabs-card-border-radius,8px);box-sizing:border-box;height:var(--tabs-card-height,32px);padding:2px}.smart-tabs__nav--card .smart-tab{color:var(--tabs-card-text-color,var(--app-B6-N3,rgba(0,0,0,.5)));line-height:calc(var(--tabs-card-height, 32px) - 2px)}.smart-tabs__nav--card .smart-tab:last-child{border-right:none}.smart-tabs__nav--card .smart-tab.smart-tab--active{color:var(--tabs-card-text-active-color,var(--app-B6-N1,#000))}.smart-tabs__nav--card .smart-tab--disabled{color:var(--tab-disabled-text-color,var(--app-B6-N7,rgba(0,0,0,.1)))}.smart-tabs__line{background-color:var(--tabs-bottom-bar-color,var(--app-M4,#1989fa));border-radius:var(--tabs-bottom-bar-height,3px);bottom:0;height:var(--tabs-bottom-bar-height,3px);left:0;opacity:0;position:absolute;z-index:1}.smart-tabs__card{background-color:var(--tabs-card-active-background-color,var(--app-B3,#fff));border-radius:var(--tabs-card-active-border-radius,6px);left:0;opacity:0;position:absolute;top:0;z-index:0}.smart-tabs__track{height:100%;position:relative;width:100%}.smart-tabs__track--animated{display:flex;transition-property:left}.smart-tabs__content{overflow:hidden}.smart-tabs--line{height:var(--tabs-line-height,32px)}.smart-tabs--card{height:var(--tabs-card-height,32px)}.smart-tab{box-sizing:border-box;color:var(--tabs-card-text-color,var(--app-B6-N3,rgba(0,0,0,.5)));cursor:pointer;flex:1;font-size:var(--tab-font-size,13px);line-height:var(--tabs-line-height,32px);min-width:0;padding:0 5px;position:relative;text-align:center}.smart-tab--active{color:var(--tabs-card-text-active-color,var(--app-B6-N1,#000));font-weight:var(--font-weight-bold,500)}.smart-tab--disabled{color:var(--tab-disabled-text-color,var(--app-B6-N7,rgba(0,0,0,.1)))}.smart-tab__title__info{position:relative!important;top:-1px!important;transform:translateX(0)!important}
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import { SmartComponent } from '../../common/component';
|
2
|
+
SmartComponent({
|
3
|
+
data: {
|
4
|
+
show: {
|
5
|
+
success: true,
|
6
|
+
primary: true,
|
7
|
+
},
|
8
|
+
},
|
9
|
+
methods: {
|
10
|
+
onClose(event) {
|
11
|
+
this.setData({
|
12
|
+
[`show.${event.target.id}`]: false,
|
13
|
+
});
|
14
|
+
},
|
15
|
+
},
|
16
|
+
});
|
package/dist/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/dist/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 {};
|
@@ -0,0 +1,67 @@
|
|
1
|
+
import { SmartComponent } from '../../common/component';
|
2
|
+
import Toast from '../../toast/toast';
|
3
|
+
SmartComponent({
|
4
|
+
methods: {
|
5
|
+
showToast() {
|
6
|
+
Toast({ context: this, message: I18n.t('promptContent') });
|
7
|
+
},
|
8
|
+
showLongToast() {
|
9
|
+
Toast({
|
10
|
+
context: this,
|
11
|
+
message: I18n.t('toastDemoTip1'),
|
12
|
+
});
|
13
|
+
},
|
14
|
+
showLoadingToast() {
|
15
|
+
Toast.loading({
|
16
|
+
context: this,
|
17
|
+
message: I18n.t('loading') + '...',
|
18
|
+
forbidClick: true,
|
19
|
+
});
|
20
|
+
},
|
21
|
+
showCustomLoadingToast() {
|
22
|
+
Toast.loading({
|
23
|
+
context: this,
|
24
|
+
message: I18n.t('loading') + '...',
|
25
|
+
forbidClick: true,
|
26
|
+
loadingType: 'spinner',
|
27
|
+
});
|
28
|
+
},
|
29
|
+
showSuccessToast() {
|
30
|
+
Toast.success({ context: this, message: I18n.t('successMessage') });
|
31
|
+
},
|
32
|
+
showFailToast() {
|
33
|
+
Toast.fail({ context: this, message: I18n.t('failurePrompt') });
|
34
|
+
},
|
35
|
+
showWarnToast() {
|
36
|
+
Toast.warn({ context: this, message: I18n.t('warningPrompt') });
|
37
|
+
},
|
38
|
+
showCustomizedToast() {
|
39
|
+
const text = (second) => `${I18n.t('countdown')} ${second} ${I18n.t('second')}`;
|
40
|
+
const toast = Toast.loading({
|
41
|
+
context: this,
|
42
|
+
duration: 0,
|
43
|
+
forbidClick: true,
|
44
|
+
message: text(3),
|
45
|
+
});
|
46
|
+
let second = 3;
|
47
|
+
const timer = setInterval(() => {
|
48
|
+
second--;
|
49
|
+
if (second) {
|
50
|
+
toast === null || toast === void 0 ? void 0 : toast.setData({ message: text(second) });
|
51
|
+
}
|
52
|
+
else {
|
53
|
+
clearInterval(timer);
|
54
|
+
Toast.clear();
|
55
|
+
}
|
56
|
+
}, 1000);
|
57
|
+
},
|
58
|
+
showCustomizedWidthToast() {
|
59
|
+
Toast.loading({
|
60
|
+
context: this,
|
61
|
+
message: I18n.t('loading') + '...',
|
62
|
+
forbidClick: true,
|
63
|
+
width: 200,
|
64
|
+
});
|
65
|
+
},
|
66
|
+
},
|
67
|
+
});
|
package/dist/toast/toast.js
CHANGED
@@ -13,6 +13,7 @@ const defaultOptions = {
|
|
13
13
|
width: '100%',
|
14
14
|
};
|
15
15
|
let queue = [];
|
16
|
+
// @ts-expect-error
|
16
17
|
let currentOptions = Object.assign({}, defaultOptions);
|
17
18
|
function parseOptions(message) {
|
18
19
|
return isObj(message) ? message : { message };
|
@@ -23,9 +24,7 @@ function getContext() {
|
|
23
24
|
}
|
24
25
|
function Toast(toastOptions) {
|
25
26
|
const options = Object.assign(Object.assign({}, currentOptions), parseOptions(toastOptions));
|
26
|
-
const context = (typeof options.context === 'function'
|
27
|
-
? options.context()
|
28
|
-
: options.context) || getContext();
|
27
|
+
const context = (typeof options.context === 'function' ? options.context() : options.context) || getContext();
|
29
28
|
const toast = context.selectComponent(options.selector);
|
30
29
|
if (!toast) {
|
31
30
|
console.warn('未找到 smart-toast 节点,请确认 selector 及 context 是否正确');
|
@@ -45,7 +44,7 @@ function Toast(toastOptions) {
|
|
45
44
|
if (options.duration != null && options.duration > 0) {
|
46
45
|
toast.timer = setTimeout(() => {
|
47
46
|
toast.clear();
|
48
|
-
queue = queue.filter(
|
47
|
+
queue = queue.filter(item => item !== toast);
|
49
48
|
}, options.duration);
|
50
49
|
}
|
51
50
|
return toast;
|
@@ -56,7 +55,7 @@ Toast.success = createMethod('success');
|
|
56
55
|
Toast.fail = createMethod('fail');
|
57
56
|
Toast.warn = createMethod('warn');
|
58
57
|
Toast.clear = () => {
|
59
|
-
queue.forEach(
|
58
|
+
queue.forEach(toast => {
|
60
59
|
toast.clear();
|
61
60
|
});
|
62
61
|
queue = [];
|
@@ -65,6 +64,7 @@ Toast.setDefaultOptions = (options) => {
|
|
65
64
|
Object.assign(currentOptions, options);
|
66
65
|
};
|
67
66
|
Toast.resetDefaultOptions = () => {
|
67
|
+
// @ts-expect-error
|
68
68
|
currentOptions = Object.assign({}, defaultOptions);
|
69
69
|
};
|
70
70
|
export default Toast;
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1,67 @@
|
|
1
|
+
import { SmartComponent } from '../../common/component';
|
2
|
+
SmartComponent({
|
3
|
+
data: {
|
4
|
+
show: false,
|
5
|
+
name: 'fade',
|
6
|
+
showCustom: false,
|
7
|
+
},
|
8
|
+
methods: {
|
9
|
+
onClickFade() {
|
10
|
+
this.trigger('fade');
|
11
|
+
},
|
12
|
+
onClickFadeUp() {
|
13
|
+
this.trigger('fade-up');
|
14
|
+
},
|
15
|
+
onClickFadeDown() {
|
16
|
+
this.trigger('fade-down');
|
17
|
+
},
|
18
|
+
onClickFadeLeft() {
|
19
|
+
this.trigger('fade-left');
|
20
|
+
},
|
21
|
+
onClickFadeRight() {
|
22
|
+
this.trigger('fade-right');
|
23
|
+
},
|
24
|
+
onClickSlideUp() {
|
25
|
+
this.trigger('slide-up');
|
26
|
+
},
|
27
|
+
onClickSlideDown() {
|
28
|
+
this.trigger('slide-down');
|
29
|
+
},
|
30
|
+
onClickSlideLeft() {
|
31
|
+
this.trigger('slide-left');
|
32
|
+
},
|
33
|
+
onClickSlideRight() {
|
34
|
+
this.trigger('slide-right');
|
35
|
+
},
|
36
|
+
trigger(name) {
|
37
|
+
this.setData({ name, show: true });
|
38
|
+
setTimeout(() => {
|
39
|
+
this.setData({ show: false });
|
40
|
+
}, 500);
|
41
|
+
},
|
42
|
+
onClickCustom() {
|
43
|
+
this.setData({ showCustom: true });
|
44
|
+
setTimeout(() => {
|
45
|
+
this.setData({ showCustom: false });
|
46
|
+
}, 1000);
|
47
|
+
},
|
48
|
+
onBeforeEnter() {
|
49
|
+
console.log('before enter');
|
50
|
+
},
|
51
|
+
onEnter() {
|
52
|
+
console.log('enter');
|
53
|
+
},
|
54
|
+
onAfterEnter() {
|
55
|
+
console.log('after enter');
|
56
|
+
},
|
57
|
+
onBeforeLeave() {
|
58
|
+
console.log('before leave');
|
59
|
+
},
|
60
|
+
onLeave() {
|
61
|
+
console.log('leave');
|
62
|
+
},
|
63
|
+
onAfterLeave() {
|
64
|
+
console.log('after leave');
|
65
|
+
},
|
66
|
+
},
|
67
|
+
});
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1,113 @@
|
|
1
|
+
import { SmartComponent } from '../../common/component';
|
2
|
+
const config = {
|
3
|
+
pro1Name: I18n.t('zhejiang'),
|
4
|
+
pro1: [
|
5
|
+
{
|
6
|
+
text: I18n.t('hangzhou'),
|
7
|
+
id: 1,
|
8
|
+
},
|
9
|
+
{
|
10
|
+
text: I18n.t('wenzhou'),
|
11
|
+
id: 2,
|
12
|
+
},
|
13
|
+
{
|
14
|
+
text: I18n.t('ningbo'),
|
15
|
+
id: 3,
|
16
|
+
disabled: true,
|
17
|
+
},
|
18
|
+
{
|
19
|
+
text: I18n.t('yiwu'),
|
20
|
+
id: 4,
|
21
|
+
},
|
22
|
+
],
|
23
|
+
pro2Name: I18n.t('jiangsu'),
|
24
|
+
pro2: [
|
25
|
+
{
|
26
|
+
text: I18n.t('nanjing'),
|
27
|
+
id: 5,
|
28
|
+
},
|
29
|
+
{
|
30
|
+
text: I18n.t('wuxi'),
|
31
|
+
id: 6,
|
32
|
+
},
|
33
|
+
{
|
34
|
+
text: I18n.t('xuzhou'),
|
35
|
+
id: 7,
|
36
|
+
},
|
37
|
+
{
|
38
|
+
text: I18n.t('suzhou'),
|
39
|
+
id: 8,
|
40
|
+
},
|
41
|
+
],
|
42
|
+
pro3Name: I18n.t('fujian'),
|
43
|
+
pro3: [
|
44
|
+
{
|
45
|
+
text: I18n.t('quanzhou'),
|
46
|
+
id: 9,
|
47
|
+
},
|
48
|
+
{
|
49
|
+
text: I18n.t('xiamen'),
|
50
|
+
id: 10,
|
51
|
+
},
|
52
|
+
],
|
53
|
+
};
|
54
|
+
const items = [
|
55
|
+
{
|
56
|
+
text: config.pro1Name,
|
57
|
+
options: config.pro1,
|
58
|
+
},
|
59
|
+
{
|
60
|
+
text: config.pro2Name,
|
61
|
+
options: config.pro2,
|
62
|
+
},
|
63
|
+
{
|
64
|
+
text: config.pro3Name,
|
65
|
+
disabled: true,
|
66
|
+
options: config.pro3,
|
67
|
+
},
|
68
|
+
];
|
69
|
+
SmartComponent({
|
70
|
+
data: {
|
71
|
+
items,
|
72
|
+
badgeItems: items.slice(0, 2).map((item, index) => {
|
73
|
+
if (index === 0) {
|
74
|
+
return Object.assign(Object.assign({}, item), { dot: true });
|
75
|
+
}
|
76
|
+
if (index === 1) {
|
77
|
+
return Object.assign(Object.assign({}, item), { badge: 5 });
|
78
|
+
}
|
79
|
+
return item;
|
80
|
+
}),
|
81
|
+
mainActiveIndex: 0,
|
82
|
+
activeId: 0,
|
83
|
+
mainActiveIndexMulti: 0,
|
84
|
+
activeIdMulti: [],
|
85
|
+
},
|
86
|
+
methods: {
|
87
|
+
onClickNav({ detail }) {
|
88
|
+
this.setData({
|
89
|
+
mainActiveIndex: detail.index || 0,
|
90
|
+
});
|
91
|
+
},
|
92
|
+
onClickItem({ detail }) {
|
93
|
+
const activeId = this.data.activeId === detail.id ? null : detail.id;
|
94
|
+
this.setData({ activeId });
|
95
|
+
},
|
96
|
+
onClickNavMulti({ detail }) {
|
97
|
+
this.setData({
|
98
|
+
mainActiveIndexMulti: detail.index || 0,
|
99
|
+
});
|
100
|
+
},
|
101
|
+
onClickItemMulti({ detail }) {
|
102
|
+
const { activeIdMulti } = this.data;
|
103
|
+
const idx = activeIdMulti.indexOf(detail.id);
|
104
|
+
if (idx > -1) {
|
105
|
+
activeIdMulti.splice(idx, 1);
|
106
|
+
}
|
107
|
+
else {
|
108
|
+
activeIdMulti.push(detail.id);
|
109
|
+
}
|
110
|
+
this.setData({ activeIdMulti });
|
111
|
+
},
|
112
|
+
},
|
113
|
+
});
|
package/dist/wxs/style.wxs
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|