@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,115 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
3
|
+
__assign = Object.assign || function(t) {
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
5
|
+
s = arguments[i];
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
7
|
+
t[p] = s[p];
|
8
|
+
}
|
9
|
+
return t;
|
10
|
+
};
|
11
|
+
return __assign.apply(this, arguments);
|
12
|
+
};
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
14
|
+
var component_1 = require("../../common/component");
|
15
|
+
(0, component_1.SmartComponent)({
|
16
|
+
data: {
|
17
|
+
show1: false,
|
18
|
+
show2: false,
|
19
|
+
show3: false,
|
20
|
+
show4: false,
|
21
|
+
show5: false,
|
22
|
+
showSelect: false,
|
23
|
+
showSelect2: false,
|
24
|
+
showNumber: false,
|
25
|
+
showPicker: false,
|
26
|
+
action1: [{ name: 'Action' }, { name: 'Action' }, { name: 'Action' }],
|
27
|
+
action2: [
|
28
|
+
{ name: I18n.t('coloringOptions'), color: '#ee0a24' },
|
29
|
+
{ loading: true },
|
30
|
+
{ name: I18n.t('disableOption'), disabled: true },
|
31
|
+
],
|
32
|
+
actionSelect: [
|
33
|
+
{ id: 0, name: 'Action', checked: true },
|
34
|
+
{ id: 1, name: 'Action', checked: false },
|
35
|
+
{ id: 2, name: 'Action', checked: false },
|
36
|
+
],
|
37
|
+
currentNumber: 100,
|
38
|
+
currentDate: new Date(2018, 0, 1),
|
39
|
+
currentDateStr: new Date(2018, 0, 1).toLocaleDateString(),
|
40
|
+
minDate: new Date(2018, 0, 1).getTime(),
|
41
|
+
formatter: function (type, value) {
|
42
|
+
if (type === 'year') {
|
43
|
+
return "".concat(value).concat(I18n.t('year'));
|
44
|
+
}
|
45
|
+
if (type === 'month') {
|
46
|
+
return "".concat(value).concat(I18n.t('month'));
|
47
|
+
}
|
48
|
+
return value;
|
49
|
+
},
|
50
|
+
},
|
51
|
+
methods: {
|
52
|
+
toggle: function (type) {
|
53
|
+
var _a;
|
54
|
+
this.setData((_a = {},
|
55
|
+
_a[type] = !this.data[type],
|
56
|
+
_a));
|
57
|
+
},
|
58
|
+
toggleActionSheet1: function () {
|
59
|
+
this.toggle('show1');
|
60
|
+
},
|
61
|
+
toggleActionSheet2: function () {
|
62
|
+
this.toggle('show2');
|
63
|
+
},
|
64
|
+
toggleActionSheet3: function () {
|
65
|
+
this.toggle('show3');
|
66
|
+
},
|
67
|
+
toggleActionSheet4: function () {
|
68
|
+
this.toggle('show4');
|
69
|
+
},
|
70
|
+
toggleActionSheet5: function () {
|
71
|
+
this.toggle('show5');
|
72
|
+
},
|
73
|
+
toggleActionSheet6: function () {
|
74
|
+
this.toggle('show6');
|
75
|
+
},
|
76
|
+
toggleActionSheetSelect: function () {
|
77
|
+
this.toggle('showSelect');
|
78
|
+
},
|
79
|
+
toggleActionSheetSelect2: function () {
|
80
|
+
this.toggle('showSelect2');
|
81
|
+
},
|
82
|
+
toggleActionSheetNumber: function () {
|
83
|
+
this.toggle('showNumber');
|
84
|
+
},
|
85
|
+
toggleActionSheetPicker: function () {
|
86
|
+
this.toggle('showPicker');
|
87
|
+
},
|
88
|
+
onChange: function (event) {
|
89
|
+
this.setData({ currentNumber: event.detail.value });
|
90
|
+
},
|
91
|
+
onSelect: function (evt) {
|
92
|
+
var id = evt.detail.id;
|
93
|
+
var newActionSelect = this.data.actionSelect.map(function (item) {
|
94
|
+
if (item.id === id)
|
95
|
+
return __assign(__assign({}, item), { checked: true });
|
96
|
+
return __assign(__assign({}, item), { checked: false });
|
97
|
+
});
|
98
|
+
this.setData({
|
99
|
+
actionSelect: newActionSelect,
|
100
|
+
});
|
101
|
+
},
|
102
|
+
onInput: function (event) {
|
103
|
+
var detail = event.detail;
|
104
|
+
var date = new Date(detail);
|
105
|
+
this.setData({ currentDate: date });
|
106
|
+
},
|
107
|
+
onPickerConfirm: function () {
|
108
|
+
var _a, _b;
|
109
|
+
this.setData({
|
110
|
+
showPicker: false,
|
111
|
+
currentDateStr: (_b = (_a = this.data) === null || _a === void 0 ? void 0 : _a.currentDate) === null || _b === void 0 ? void 0 : _b.toLocaleDateString(),
|
112
|
+
});
|
113
|
+
},
|
114
|
+
},
|
115
|
+
});
|
@@ -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
|
+
var _a;
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
7
|
+
var component_1 = require("../../common/component");
|
8
|
+
var toast_1 = __importDefault(require("../../toast/toast"));
|
9
|
+
var db = (_a = wx.cloud) === null || _a === void 0 ? void 0 : _a.database();
|
10
|
+
(0, component_1.SmartComponent)({
|
11
|
+
data: {
|
12
|
+
areaList: {},
|
13
|
+
loading: true,
|
14
|
+
value: 330302,
|
15
|
+
},
|
16
|
+
mounted: function () {
|
17
|
+
var _this = this;
|
18
|
+
db === null || db === void 0 ? void 0 : db.collection('region').limit(1).get().then(function (res) {
|
19
|
+
if (res.data && res.data.length > 0) {
|
20
|
+
_this.setData({
|
21
|
+
loading: false,
|
22
|
+
areaList: res.data[0],
|
23
|
+
});
|
24
|
+
}
|
25
|
+
}).catch(function (err) {
|
26
|
+
console.log(err);
|
27
|
+
_this.setData({
|
28
|
+
loading: false,
|
29
|
+
});
|
30
|
+
});
|
31
|
+
},
|
32
|
+
methods: {
|
33
|
+
onChange: function (event) {
|
34
|
+
var values = event.detail.values;
|
35
|
+
(0, toast_1.default)({
|
36
|
+
context: this,
|
37
|
+
message: values.map(function (item) { return item.name; }).join('-'),
|
38
|
+
});
|
39
|
+
},
|
40
|
+
onConfirm: function (event) {
|
41
|
+
console.log(event);
|
42
|
+
},
|
43
|
+
onCancel: function (event) {
|
44
|
+
console.log(event);
|
45
|
+
},
|
46
|
+
},
|
47
|
+
});
|
package/lib/area/index.js
CHANGED
@@ -79,8 +79,7 @@ var EMPTY_CODE = '000000';
|
|
79
79
|
parseValues: function (values) {
|
80
80
|
var columnsPlaceholder = this.data.columnsPlaceholder;
|
81
81
|
return values.map(function (value, index) {
|
82
|
-
if (value &&
|
83
|
-
(!value.code || value.name === columnsPlaceholder[index])) {
|
82
|
+
if (value && (!value.code || value.name === columnsPlaceholder[index])) {
|
84
83
|
return __assign(__assign({}, value), { code: '', name: '' });
|
85
84
|
}
|
86
85
|
return value;
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
package/lib/battery/index.js
CHANGED
@@ -86,9 +86,7 @@ var wrapBatteryD = 'M6.5,0 C6.77614237,-5.07265313e-17 7,0.223857625 7,0.5 L7,1
|
|
86
86
|
toSvgCssBackground: function (svgString) {
|
87
87
|
var res = svgString;
|
88
88
|
res = svgString
|
89
|
-
.replace('<svg', ~svgString.indexOf('xmlns')
|
90
|
-
? '<svg'
|
91
|
-
: '<svg xmlns="http://www.w3.org/2000/svg"')
|
89
|
+
.replace('<svg', ~svgString.indexOf('xmlns') ? '<svg' : '<svg xmlns="http://www.w3.org/2000/svg"')
|
92
90
|
.replace(/"/g, "'")
|
93
91
|
.replace(/%/g, '%25')
|
94
92
|
.replace(/#/g, '%23')
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1,27 @@
|
|
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
|
+
show1: false,
|
7
|
+
show2: false,
|
8
|
+
show3: false,
|
9
|
+
},
|
10
|
+
methods: {
|
11
|
+
toggle: function (type) {
|
12
|
+
var _a;
|
13
|
+
this.setData((_a = {},
|
14
|
+
_a[type] = !this.data[type],
|
15
|
+
_a));
|
16
|
+
},
|
17
|
+
toggleActionSheet1: function () {
|
18
|
+
this.toggle('show1');
|
19
|
+
},
|
20
|
+
toggleActionSheet2: function () {
|
21
|
+
this.toggle('show2');
|
22
|
+
},
|
23
|
+
toggleActionSheet3: function () {
|
24
|
+
this.toggle('show3');
|
25
|
+
},
|
26
|
+
},
|
27
|
+
});
|
@@ -1 +1 @@
|
|
1
|
-
@import '../common/index.css';.smart-bottom-sheet{color:var(--bottom-sheet-font-color,var(--app-B4-N1,#000));max-height:var(--bottom-sheet-max-height,50%)!important;min-height:var(--bottom-sheet-min-height,auto);padding:var(--bottom-sheet-padding,0 16px);padding-bottom:env(safe-area-inset-bottom);width:var(--bottom-sheet-width,100%)!important}.smart-bottom-sheet__header{color:var(--bottom-sheet-header-color,var(--app-B4-N1,#000));font-size:var(--bottom-sheet-header-font-size,17px);font-weight:var(--bottom-sheet-header-font-weight,600);line-height:var(--bottom-sheet-header-height,56px);text-align:center}.smart-bottom-sheet__icon{margin:var(--bottom-sheet-icon-margin,16px 16px 0 0);position:absolute;right:0;top:0}
|
1
|
+
@import '../common/index.css';.smart-bottom-sheet{color:var(--bottom-sheet-font-color,var(--app-B4-N1,#000));display:flex;flex-direction:column;max-height:var(--bottom-sheet-max-height,50%)!important;min-height:var(--bottom-sheet-min-height,auto);padding:var(--bottom-sheet-padding,0 16px);padding-bottom:env(safe-area-inset-bottom);width:var(--bottom-sheet-width,100%)!important}.smart-bottom-sheet__header{color:var(--bottom-sheet-header-color,var(--app-B4-N1,#000));font-size:var(--bottom-sheet-header-font-size,17px);font-weight:var(--bottom-sheet-header-font-weight,600);line-height:var(--bottom-sheet-header-height,56px);text-align:center}.smart-bottom-sheet__content{overflow-y:scroll}.smart-bottom-sheet__icon{margin:var(--bottom-sheet-icon-margin,16px 16px 0 0);position:absolute;right:0;top:0}
|
@@ -9,6 +9,7 @@ var component_1 = require("../common/component");
|
|
9
9
|
props: {
|
10
10
|
show: Boolean,
|
11
11
|
title: String,
|
12
|
+
iconColor: String,
|
12
13
|
iconSize: {
|
13
14
|
type: null,
|
14
15
|
value: 24,
|
@@ -36,13 +37,13 @@ var component_1 = require("../common/component");
|
|
36
37
|
},
|
37
38
|
data: {
|
38
39
|
xmarkIcon: Xmark_1.default,
|
39
|
-
xmarkIconColor: '
|
40
|
+
xmarkIconColor: 'rgba(0, 0, 0, 0.5)',
|
40
41
|
},
|
41
42
|
mounted: function () {
|
42
43
|
var _a;
|
43
44
|
// @ts-ignore
|
44
45
|
var themeInfo = (_a = ty === null || ty === void 0 ? void 0 : ty.getThemeInfo()) !== null && _a !== void 0 ? _a : {};
|
45
|
-
var xmarkIconColor = this.data.
|
46
|
+
var xmarkIconColor = this.data.iconColor || themeInfo['--app-B4-N3'] || 'rgba(0, 0, 0, 0.5)';
|
46
47
|
this.setData({ xmarkIconColor: xmarkIconColor });
|
47
48
|
},
|
48
49
|
methods: {
|
@@ -22,5 +22,7 @@
|
|
22
22
|
{{ title }}
|
23
23
|
<smart-icon bind:click="onClose" name="{{ xmarkIcon }}" class="smart-bottom-sheet__icon" size="{{ iconSize }}" color="{{ xmarkIconColor }}" />
|
24
24
|
</view>
|
25
|
-
<
|
25
|
+
<view class="smart-bottom-sheet__content">
|
26
|
+
<slot />
|
27
|
+
</view>
|
26
28
|
</smart-popup>
|
@@ -1 +1 @@
|
|
1
|
-
@import '../common/index.wxss';.smart-bottom-sheet{color:var(--bottom-sheet-font-color,var(--app-B4-N1,#000));max-height:var(--bottom-sheet-max-height,50%)!important;min-height:var(--bottom-sheet-min-height,auto);padding:var(--bottom-sheet-padding,0 16px);padding-bottom:env(safe-area-inset-bottom);width:var(--bottom-sheet-width,100%)!important}.smart-bottom-sheet__header{color:var(--bottom-sheet-header-color,var(--app-B4-N1,#000));font-size:var(--bottom-sheet-header-font-size,17px);font-weight:var(--bottom-sheet-header-font-weight,600);line-height:var(--bottom-sheet-header-height,56px);text-align:center}.smart-bottom-sheet__icon{margin:var(--bottom-sheet-icon-margin,16px 16px 0 0);position:absolute;right:0;top:0}
|
1
|
+
@import '../common/index.wxss';.smart-bottom-sheet{color:var(--bottom-sheet-font-color,var(--app-B4-N1,#000));display:flex;flex-direction:column;max-height:var(--bottom-sheet-max-height,50%)!important;min-height:var(--bottom-sheet-min-height,auto);padding:var(--bottom-sheet-padding,0 16px);padding-bottom:env(safe-area-inset-bottom);width:var(--bottom-sheet-width,100%)!important}.smart-bottom-sheet__header{color:var(--bottom-sheet-header-color,var(--app-B4-N1,#000));font-size:var(--bottom-sheet-header-font-size,17px);font-weight:var(--bottom-sheet-header-font-weight,600);line-height:var(--bottom-sheet-header-height,56px);text-align:center}.smart-bottom-sheet__content{overflow-y:scroll}.smart-bottom-sheet__icon{margin:var(--bottom-sheet-icon-margin,16px 16px 0 0);position:absolute;right:0;top:0}
|
@@ -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 PlusCircle_1 = __importDefault(require("@tuya-miniapp/icons/dist/svg/PlusCircle"));
|
7
|
+
var Right_1 = __importDefault(require("@tuya-miniapp/icons/dist/svg/Right"));
|
8
|
+
var component_1 = require("../../common/component");
|
9
|
+
(0, component_1.SmartComponent)({
|
10
|
+
data: {
|
11
|
+
iconAdd: PlusCircle_1.default,
|
12
|
+
iconRight: Right_1.default,
|
13
|
+
},
|
14
|
+
});
|
@@ -4,7 +4,7 @@
|
|
4
4
|
<header
|
5
5
|
title="{{ title }}"
|
6
6
|
showTitle="{{ showTitle }}"
|
7
|
-
subtitle="{{
|
7
|
+
subtitle="{{ type === 'year' ? '' : type === 'month' ? computed.formatYearTitle(currentDate, visibleIndex, locale.yearFormatter) : computed.formatMonthTitle(months[visibleIndex], subFormatter) }}"
|
8
8
|
subFormatter="{{locale.subFormatter || 'YYYY-MM'}}"
|
9
9
|
showSubtitle="{{ showSubtitle }}"
|
10
10
|
firstDayOfWeek="{{ firstDayOfWeek }}"
|
@@ -13,12 +13,14 @@
|
|
13
13
|
bind:click-prev="onPrev"
|
14
14
|
bind:click-next="onNext"
|
15
15
|
bind:click-save="onConfirm"
|
16
|
-
hideWeek="{{
|
16
|
+
hideWeek="{{ type === 'year' || type === 'month' }}"
|
17
|
+
right-text="{{confirmText}}"
|
18
|
+
showConfirm="{{showConfirm}}"
|
17
19
|
>
|
18
20
|
<slot name="title" slot="title"></slot>
|
19
21
|
</header>
|
20
22
|
|
21
|
-
<block wx:if="{{
|
23
|
+
<block wx:if="{{ type !== 'year' && type !== 'month' }}">
|
22
24
|
<view class="smart-calendar-month_wrap" wx:for="{{ months }}" wx:key="index">
|
23
25
|
<month
|
24
26
|
id="month{{ index }}"
|
@@ -47,25 +49,28 @@
|
|
47
49
|
</view>
|
48
50
|
</block>
|
49
51
|
|
50
|
-
<block wx:if="{{
|
52
|
+
<block wx:if="{{type === 'month'}}">
|
51
53
|
<month-list
|
52
54
|
minDate="{{ minDate }}"
|
53
55
|
maxDate="{{ maxDate }}"
|
54
56
|
monthsFormatter="{{ locale.monthsFormatter }}"
|
55
57
|
bind:click="onClickDate"
|
56
|
-
date="{{
|
57
|
-
|
58
|
+
date="{{currentDate}}"
|
59
|
+
color="{{color}}"
|
60
|
+
readonly="{{readonly}}"
|
58
61
|
/>
|
59
62
|
</block>
|
60
63
|
|
61
|
-
<block wx:if="{{
|
64
|
+
<block wx:if="{{type === 'year'}}">
|
62
65
|
<year-list
|
63
66
|
minDate="{{ minDate }}"
|
64
67
|
maxDate="{{ maxDate }}"
|
65
68
|
yearFormatter="{{ locale.yearFormatter }}"
|
66
69
|
bind:click="onClickDate"
|
67
|
-
date="{{
|
70
|
+
date="{{currentDate}}"
|
68
71
|
visibleIndex="{{visibleIndex}}"
|
72
|
+
color="{{color}}"
|
73
|
+
readonly="{{readonly}}"
|
69
74
|
/>
|
70
75
|
</block>
|
71
76
|
|
@@ -1 +1 @@
|
|
1
|
-
@import '../../../common/index.css';.smart-calendar__header{flex-shrink:0}.smart-calendar__header-title{position:relative}.smart-calendar__header-title-save{color:var(--calendar-header-title-save-color,#1989fa);font-size:16px;font-weight:400;letter-spacing:0;line-height:24px;position:absolute;right:48rpx;text-align:right;top:50%;transform:translateY(-50%)}.smart-calendar__header-subtitle,.smart-calendar__header-title{font-size:16px;font-weight:var(--font-weight-bold,500);
|
1
|
+
@import '../../../common/index.css';.smart-calendar__header{flex-shrink:0}.smart-calendar__header-title{position:relative}.smart-calendar__header-title-save{color:var(--calendar-header-title-save-color,#1989fa);font-size:16px;font-weight:400;letter-spacing:0;line-height:24px;position:absolute;right:48rpx;text-align:right;top:50%;transform:translateY(-50%)}.smart-calendar__header-subtitle,.smart-calendar__header-title{color:var(--calendar-header-title-font-color,var(--app-B4-N1,#000));font-size:16px;font-weight:var(--font-weight-bold,500);height:var(--calendar-header-title-height,44px);line-height:var(--calendar-header-title-height,44px);text-align:center}.smart-calendar__header-subtitle_wrap{align-items:center;display:flex;justify-content:center;position:relative}.smart-calendar__header-subtitle_left{align-items:center;background:rgba(0,0,0,.05);border-radius:50%;display:flex;height:48rpx;justify-content:center;left:52rpx;position:absolute;top:50%;transform:translateY(-50%);width:48rpx}.smart-calendar__header-subtitle_left_icon{left:-1px;position:relative}.smart-calendar__header-subtitle_right{align-items:center;background:rgba(0,0,0,.05);border-radius:50%;display:flex;height:48rpx;justify-content:center;position:absolute;right:52rpx;top:50%;transform:translateY(-50%);width:48rpx}.smart-calendar__header-subtitle_right_icon{position:relative;right:-1px}.smart-calendar__header-title+.smart-calendar__header-title,.smart-calendar__header-title:empty{display:none}.smart-calendar__header-title:empty+.smart-calendar__header-title{display:block!important}.smart-calendar__weekdays{display:flex;margin-bottom:16rpx;margin-top:16rpx;padding-left:16rpx;padding-right:16rpx}.smart-calendar__weekday{color:var(--calendar-weekdays-font-color,var(--app-B4-N1,#000));flex:1;font-size:var(--calendar-weekdays-font-size,12px);font-weight:500;line-height:var(--calendar-weekdays-height,30px);opacity:.5;text-align:center}
|
@@ -19,17 +19,21 @@ var Right_1 = __importDefault(require("@tuya-miniapp/icons/dist/svg/Right"));
|
|
19
19
|
props: {
|
20
20
|
title: {
|
21
21
|
type: String,
|
22
|
-
value: '
|
22
|
+
value: 'Select Date',
|
23
23
|
},
|
24
24
|
rightText: {
|
25
25
|
type: String,
|
26
|
-
value: '
|
26
|
+
value: 'Save',
|
27
27
|
},
|
28
28
|
subtitle: String,
|
29
29
|
showTitle: Boolean,
|
30
30
|
showSubtitle: Boolean,
|
31
31
|
defaultWeeks: Array,
|
32
32
|
hideWeek: Boolean,
|
33
|
+
showConfirm: {
|
34
|
+
type: Boolean,
|
35
|
+
value: true,
|
36
|
+
},
|
33
37
|
firstDayOfWeek: {
|
34
38
|
type: Number,
|
35
39
|
observer: 'initWeekDay',
|
@@ -3,19 +3,19 @@
|
|
3
3
|
<view class="smart-calendar__header-title"><slot name="title"></slot></view>
|
4
4
|
<view class="smart-calendar__header-title">
|
5
5
|
{{ title }}
|
6
|
-
<view class="smart-calendar__header-title-save" bind:tap
|
6
|
+
<view class="smart-calendar__header-title-save" bind:tap="onSave" wx:if="{{showConfirm}}">{{ rightText }}</view>
|
7
7
|
</view>
|
8
8
|
</block>
|
9
9
|
|
10
10
|
<view class="smart-calendar__header-subtitle_wrap">
|
11
11
|
<view class="smart-calendar__header-subtitle_left" bind:tap="onPrev">
|
12
|
-
<smart-icon name="{{LeftIcon}}" />
|
12
|
+
<smart-icon class="smart-calendar__header-subtitle_left_icon" name="{{LeftIcon}}" />
|
13
13
|
</view>
|
14
14
|
<view wx:if="{{ showSubtitle }}" class="smart-calendar__header-subtitle" bind:tap="onClickSubtitle">
|
15
15
|
{{ subtitle }}
|
16
16
|
</view>
|
17
17
|
<view class="smart-calendar__header-subtitle_right" bind:tap="onNext">
|
18
|
-
<smart-icon name="{{RightIcon}}" />
|
18
|
+
<smart-icon class="smart-calendar__header-subtitle_right_icon" name="{{RightIcon}}" />
|
19
19
|
</view>
|
20
20
|
</view>
|
21
21
|
|
@@ -1 +1 @@
|
|
1
|
-
@import '../../../common/index.wxss';.smart-calendar__header{flex-shrink:0}.smart-calendar__header-title{position:relative}.smart-calendar__header-title-save{color:var(--calendar-header-title-save-color,#1989fa);font-size:16px;font-weight:400;letter-spacing:0;line-height:24px;position:absolute;right:48rpx;text-align:right;top:50%;transform:translateY(-50%)}.smart-calendar__header-subtitle,.smart-calendar__header-title{font-size:16px;font-weight:var(--font-weight-bold,500);
|
1
|
+
@import '../../../common/index.wxss';.smart-calendar__header{flex-shrink:0}.smart-calendar__header-title{position:relative}.smart-calendar__header-title-save{color:var(--calendar-header-title-save-color,#1989fa);font-size:16px;font-weight:400;letter-spacing:0;line-height:24px;position:absolute;right:48rpx;text-align:right;top:50%;transform:translateY(-50%)}.smart-calendar__header-subtitle,.smart-calendar__header-title{color:var(--calendar-header-title-font-color,var(--app-B4-N1,#000));font-size:16px;font-weight:var(--font-weight-bold,500);height:var(--calendar-header-title-height,44px);line-height:var(--calendar-header-title-height,44px);text-align:center}.smart-calendar__header-subtitle_wrap{align-items:center;display:flex;justify-content:center;position:relative}.smart-calendar__header-subtitle_left{align-items:center;background:rgba(0,0,0,.05);border-radius:50%;display:flex;height:48rpx;justify-content:center;left:52rpx;position:absolute;top:50%;transform:translateY(-50%);width:48rpx}.smart-calendar__header-subtitle_left_icon{left:-1px;position:relative}.smart-calendar__header-subtitle_right{align-items:center;background:rgba(0,0,0,.05);border-radius:50%;display:flex;height:48rpx;justify-content:center;position:absolute;right:52rpx;top:50%;transform:translateY(-50%);width:48rpx}.smart-calendar__header-subtitle_right_icon{position:relative;right:-1px}.smart-calendar__header-title+.smart-calendar__header-title,.smart-calendar__header-title:empty{display:none}.smart-calendar__header-title:empty+.smart-calendar__header-title{display:block!important}.smart-calendar__weekdays{display:flex;margin-bottom:16rpx;margin-top:16rpx;padding-left:16rpx;padding-right:16rpx}.smart-calendar__weekday{color:var(--calendar-weekdays-font-color,var(--app-B4-N1,#000));flex:1;font-size:var(--calendar-weekdays-font-size,12px);font-weight:500;line-height:var(--calendar-weekdays-height,30px);opacity:.5;text-align:center}
|
@@ -1 +1 @@
|
|
1
|
-
@import '../../../common/index.css';.smart-calendar{background-color:var(--calendar-background-color,var(--app-B6,#fff));display:flex;flex-direction:column;height:100%}.smart-calendar__month-title{font-size:var(--calendar-month-title-font-size,14px);font-weight:var(--font-weight-bold,500);height:var(--calendar-header-title-height,44px);line-height:var(--calendar-header-title-height,44px);text-align:center}.smart-calendar__days{display:flex;flex-wrap:wrap;position:relative;-webkit-user-select:none;user-select:none}.smart-calendar__month-mark{color:var(--calendar-month-mark-color,hsla(210,6%,87%,.6));font-size:var(--calendar-month-mark-font-size,160px);left:50%;pointer-events:none;position:absolute;top:50%;transform:translate(-50%,-50%);z-index:0}.smart-calendar__day,.smart-calendar__selected-day{align-items:center;display:flex;justify-content:center;text-align:center}.smart-calendar__day{font-size:var(--calendar-
|
1
|
+
@import '../../../common/index.css';.smart-calendar{background-color:var(--calendar-background-color,var(--app-B6,#fff));display:flex;flex-direction:column;height:100%}.smart-calendar__month{padding-bottom:48rpx;padding-left:16rpx;padding-right:16rpx}.smart-calendar__month-title{font-size:var(--calendar-month-title-font-size,14px);font-weight:var(--font-weight-bold,500);height:var(--calendar-header-title-height,44px);line-height:var(--calendar-header-title-height,44px);text-align:center}.smart-calendar__days{display:flex;flex-wrap:wrap;position:relative;-webkit-user-select:none;user-select:none}.smart-calendar__month-mark{color:var(--calendar-month-mark-color,hsla(210,6%,87%,.6));font-size:var(--calendar-month-mark-font-size,160px);left:50%;pointer-events:none;position:absolute;top:50%;transform:translate(-50%,-50%);z-index:0}.smart-calendar__day,.smart-calendar__selected-day{align-items:center;display:flex;justify-content:center;text-align:center}.smart-calendar__day{color:var(--calendar-cell-item-font-color,var(--app-B4-N1,#000));font-size:var(--calendar-cell-item-font-size,15px);font-weight:var(--calendar-day-font-weight,500);height:var(--calendar-day-height,100rpx);margin:4px 0;position:relative;width:14.285%}.smart-calendar__day--end,.smart-calendar__day--multiple-middle,.smart-calendar__day--multiple-selected,.smart-calendar__day--start,.smart-calendar__day--start-end{background-color:var(--calendar-range-edge-background-color,#3678e3);color:var(--calendar-range-edge-color,#fff)}.smart-calendar__day--start{border-bottom-left-radius:var(--calendar-day-select-border-radius,34rpx);border-top-left-radius:var(--calendar-day-select-border-radius,34rpx)}.smart-calendar__day--end{border-bottom-right-radius:var(--calendar-day-select-border-radius,34rpx);border-top-right-radius:var(--calendar-day-select-border-radius,34rpx)}.smart-calendar__day--multiple-selected,.smart-calendar__day--start-end{border-radius:4px}.smart-calendar__day--middle{background-color:var(--calendar-range-edge-background-color,#3678e3);color:var(--calendar-range-middle-color,#fff)}.smart-calendar__day--disabled{color:var(--calendar-day-disabled-color,#c8c9cc);cursor:default}.smart-calendar__bottom-info,.smart-calendar__top-info{font-size:var(--calendar-info-font-size,10px);left:0;line-height:var(--calendar-info-line-height,14px);position:absolute;right:0}@media (max-width:350px){.smart-calendar__bottom-info,.smart-calendar__top-info{font-size:9px}}.smart-calendar__top-info{top:6px}.smart-calendar__bottom-info{bottom:6px}.smart-calendar__selected-day{background-color:var(--calendar-selected-day-background-color,#3678e3);border-radius:50%;color:var(--calendar-selected-day-color,#fff);height:var(--calendar-selected-day-size,34px);width:var(--calendar-selected-day-size,34px)}
|
@@ -84,9 +84,7 @@ var utils_1 = require("../../utils");
|
|
84
84
|
if (!Array.isArray(currentDate)) {
|
85
85
|
return '';
|
86
86
|
}
|
87
|
-
var isSelected = function (date) {
|
88
|
-
return currentDate.some(function (item) { return (0, utils_1.compareDay)(item, date) === 0; });
|
89
|
-
};
|
87
|
+
var isSelected = function (date) { return currentDate.some(function (item) { return (0, utils_1.compareDay)(item, date) === 0; }); };
|
90
88
|
if (isSelected(day)) {
|
91
89
|
var prevDay = (0, utils_1.getPrevDay)(day);
|
92
90
|
var nextDay = (0, utils_1.getNextDay)(day);
|
@@ -159,9 +157,7 @@ var utils_1 = require("../../utils");
|
|
159
157
|
return this.properties.rangeEnd || 'End';
|
160
158
|
}
|
161
159
|
if (type === 'start-end') {
|
162
|
-
return ((this.properties.rangeStart || 'Start') +
|
163
|
-
'/' +
|
164
|
-
(this.properties.rangeEnd || 'End'));
|
160
|
+
return ((this.properties.rangeStart || 'Start') + '/' + (this.properties.rangeEnd || 'End'));
|
165
161
|
}
|
166
162
|
}
|
167
163
|
},
|
@@ -49,10 +49,7 @@ function getDayStyle(type, index, date, rowHeight, color, firstDayOfWeek) {
|
|
49
49
|
function formatMonthTitle(date, formatter = 'YYYY-MM') {
|
50
50
|
date = getDate(date);
|
51
51
|
const year = date.getFullYear();
|
52
|
-
const month =
|
53
|
-
date.getMonth() + 1 < 10
|
54
|
-
? `0${date.getMonth() + 1}`
|
55
|
-
: date.getMonth() + 1 + '';
|
52
|
+
const month = date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1 + "";
|
56
53
|
return formatter.replace('YYYY', year + '').replace('MM', month);
|
57
54
|
}
|
58
55
|
|
@@ -1 +1 @@
|
|
1
|
-
@import '../../../common/index.wxss';.smart-calendar{background-color:var(--calendar-background-color,var(--app-B6,#fff));display:flex;flex-direction:column;height:100%}.smart-calendar__month-title{font-size:var(--calendar-month-title-font-size,14px);font-weight:var(--font-weight-bold,500);height:var(--calendar-header-title-height,44px);line-height:var(--calendar-header-title-height,44px);text-align:center}.smart-calendar__days{display:flex;flex-wrap:wrap;position:relative;-webkit-user-select:none;user-select:none}.smart-calendar__month-mark{color:var(--calendar-month-mark-color,hsla(210,6%,87%,.6));font-size:var(--calendar-month-mark-font-size,160px);left:50%;pointer-events:none;position:absolute;top:50%;transform:translate(-50%,-50%);z-index:0}.smart-calendar__day,.smart-calendar__selected-day{align-items:center;display:flex;justify-content:center;text-align:center}.smart-calendar__day{font-size:var(--calendar-
|
1
|
+
@import '../../../common/index.wxss';.smart-calendar{background-color:var(--calendar-background-color,var(--app-B6,#fff));display:flex;flex-direction:column;height:100%}.smart-calendar__month{padding-bottom:48rpx;padding-left:16rpx;padding-right:16rpx}.smart-calendar__month-title{font-size:var(--calendar-month-title-font-size,14px);font-weight:var(--font-weight-bold,500);height:var(--calendar-header-title-height,44px);line-height:var(--calendar-header-title-height,44px);text-align:center}.smart-calendar__days{display:flex;flex-wrap:wrap;position:relative;-webkit-user-select:none;user-select:none}.smart-calendar__month-mark{color:var(--calendar-month-mark-color,hsla(210,6%,87%,.6));font-size:var(--calendar-month-mark-font-size,160px);left:50%;pointer-events:none;position:absolute;top:50%;transform:translate(-50%,-50%);z-index:0}.smart-calendar__day,.smart-calendar__selected-day{align-items:center;display:flex;justify-content:center;text-align:center}.smart-calendar__day{color:var(--calendar-cell-item-font-color,var(--app-B4-N1,#000));font-size:var(--calendar-cell-item-font-size,15px);font-weight:var(--calendar-day-font-weight,500);height:var(--calendar-day-height,100rpx);margin:4px 0;position:relative;width:14.285%}.smart-calendar__day--end,.smart-calendar__day--multiple-middle,.smart-calendar__day--multiple-selected,.smart-calendar__day--start,.smart-calendar__day--start-end{background-color:var(--calendar-range-edge-background-color,#3678e3);color:var(--calendar-range-edge-color,#fff)}.smart-calendar__day--start{border-bottom-left-radius:var(--calendar-day-select-border-radius,34rpx);border-top-left-radius:var(--calendar-day-select-border-radius,34rpx)}.smart-calendar__day--end{border-bottom-right-radius:var(--calendar-day-select-border-radius,34rpx);border-top-right-radius:var(--calendar-day-select-border-radius,34rpx)}.smart-calendar__day--multiple-selected,.smart-calendar__day--start-end{border-radius:4px}.smart-calendar__day--middle{background-color:var(--calendar-range-edge-background-color,#3678e3);color:var(--calendar-range-middle-color,#fff)}.smart-calendar__day--disabled{color:var(--calendar-day-disabled-color,#c8c9cc);cursor:default}.smart-calendar__bottom-info,.smart-calendar__top-info{font-size:var(--calendar-info-font-size,10px);left:0;line-height:var(--calendar-info-line-height,14px);position:absolute;right:0}@media (max-width:350px){.smart-calendar__bottom-info,.smart-calendar__top-info{font-size:9px}}.smart-calendar__top-info{top:6px}.smart-calendar__bottom-info{bottom:6px}.smart-calendar__selected-day{background-color:var(--calendar-selected-day-background-color,#3678e3);border-radius:50%;color:var(--calendar-selected-day-color,#fff);height:var(--calendar-selected-day-size,34px);width:var(--calendar-selected-day-size,34px)}
|
@@ -1 +1 @@
|
|
1
|
-
@import '../../../common/index.css';.item{border-radius:
|
1
|
+
@import '../../../common/index.css';.contain{margin:24rpx 0}.item{border-radius:var(--calendar-cell-item-border-radius,104rpx);color:var(--calendar-cell-item-font-color,var(--app-B4-N1,#000));font-size:var(--calendar-cell-item-font-size,15px);font-weight:var(--calendar-day-font-weight,500);height:var(--calendar-cell-item-height,104rpx);line-height:var(--calendar-cell-item-height,104rpx);text-align:center;width:var(--calendar-cell-item-width,104rpx)}.item_active{background:#3678e3;color:#fff}.item_disabled{opacity:.5}.col_item{display:flex;justify-content:center}
|
@@ -3,6 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
// components/month-list.js
|
4
4
|
var utils_1 = require("../../utils");
|
5
5
|
var component_1 = require("../../../common/component");
|
6
|
+
var currentYear = new Date().getFullYear();
|
7
|
+
var minMonthDate = new Date(currentYear - 10, 1, 1).getTime();
|
8
|
+
var maxMonthDate = new Date(currentYear + 10, 12, 31).getTime();
|
6
9
|
(0, component_1.SmartComponent)({
|
7
10
|
/**
|
8
11
|
* 组件的属性列表
|
@@ -12,47 +15,29 @@ var component_1 = require("../../../common/component");
|
|
12
15
|
type: null,
|
13
16
|
observer: function (newVal, oldVal) {
|
14
17
|
if (newVal !== oldVal) {
|
15
|
-
this.
|
18
|
+
this.getMonthList();
|
16
19
|
}
|
17
20
|
},
|
18
21
|
},
|
22
|
+
color: {
|
23
|
+
type: String,
|
24
|
+
value: '#3678e3',
|
25
|
+
},
|
19
26
|
minDate: {
|
20
27
|
type: null,
|
21
|
-
value:
|
28
|
+
value: minMonthDate,
|
22
29
|
},
|
23
30
|
maxDate: {
|
24
31
|
type: null,
|
25
|
-
value:
|
32
|
+
value: maxMonthDate,
|
26
33
|
},
|
27
|
-
|
28
|
-
type:
|
29
|
-
value:
|
30
|
-
},
|
31
|
-
visibleIndex: {
|
32
|
-
type: Number,
|
33
|
-
value: 0,
|
34
|
-
observer: function (newVal, oldVal) {
|
35
|
-
if (newVal !== oldVal) {
|
36
|
-
this.getMonthList();
|
37
|
-
}
|
38
|
-
},
|
34
|
+
readonly: {
|
35
|
+
type: Boolean,
|
36
|
+
value: false,
|
39
37
|
},
|
40
38
|
monthsFormatter: {
|
41
39
|
type: null,
|
42
|
-
value: [
|
43
|
-
'Jan',
|
44
|
-
'Feb',
|
45
|
-
'Mar',
|
46
|
-
'Apr',
|
47
|
-
'May',
|
48
|
-
'Jun',
|
49
|
-
'Jul',
|
50
|
-
'Aug',
|
51
|
-
'Sept',
|
52
|
-
'Oct',
|
53
|
-
'Nov',
|
54
|
-
'Dec',
|
55
|
-
],
|
40
|
+
value: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sept', 'Oct', 'Nov', 'Dec'],
|
56
41
|
},
|
57
42
|
},
|
58
43
|
/**
|
@@ -64,22 +49,16 @@ var component_1 = require("../../../common/component");
|
|
64
49
|
},
|
65
50
|
created: function () {
|
66
51
|
this.getMonthList();
|
67
|
-
this.calcMonth();
|
68
52
|
},
|
69
53
|
/**
|
70
54
|
* 组件的方法列表
|
71
55
|
*/
|
72
56
|
methods: {
|
73
|
-
calcMonth: function () {
|
74
|
-
var date = new Date(this.data.date);
|
75
|
-
var cur = date.getMonth();
|
76
|
-
this.setData({
|
77
|
-
currentMonth: cur,
|
78
|
-
});
|
79
|
-
},
|
80
57
|
getMonthList: function () {
|
81
|
-
var _a = this.data, minDate = _a.minDate, maxDate = _a.maxDate,
|
82
|
-
var
|
58
|
+
var _a = this.data, minDate = _a.minDate, maxDate = _a.maxDate, _b = _a.monthsFormatter, monthsFormatter = _b === void 0 ? [] : _b;
|
59
|
+
var curDate = new Date(this.data.date);
|
60
|
+
var cur = curDate.getFullYear();
|
61
|
+
var curMonthDate = new Date(curDate.getFullYear(), curDate.getMonth(), 1);
|
83
62
|
var start = new Date(cur, 0, 1).getTime();
|
84
63
|
var end = new Date(cur, 11, 31).getTime();
|
85
64
|
var minDateTime = new Date(minDate).getTime();
|
@@ -88,7 +67,10 @@ var component_1 = require("../../../common/component");
|
|
88
67
|
var monthlist = months.map(function (date) {
|
89
68
|
var monthVal = new Date(date).getMonth();
|
90
69
|
var time = new Date(date).getTime();
|
91
|
-
var isDisabled =
|
70
|
+
var isDisabled = false;
|
71
|
+
if (minDate && maxDate) {
|
72
|
+
isDisabled = time < minDateTime || time > maxDateTime;
|
73
|
+
}
|
92
74
|
return {
|
93
75
|
value: date,
|
94
76
|
month: monthVal,
|
@@ -98,9 +80,12 @@ var component_1 = require("../../../common/component");
|
|
98
80
|
});
|
99
81
|
this.setData({
|
100
82
|
months: monthlist,
|
83
|
+
currentMonth: curMonthDate.getTime(),
|
101
84
|
});
|
102
85
|
},
|
103
86
|
onClick: function (event) {
|
87
|
+
if (this.data.readonly)
|
88
|
+
return;
|
104
89
|
var index = event.currentTarget.dataset.index;
|
105
90
|
var item = this.data.months[index];
|
106
91
|
if (item.type !== 'disabled') {
|
@@ -1,7 +1,13 @@
|
|
1
1
|
<view class="contain">
|
2
2
|
<smart-row>
|
3
|
-
<smart-col wx:for="{{months}}" span="6">
|
4
|
-
<view
|
3
|
+
<smart-col wx:for="{{months}}" span="6" custom-class="col_item">
|
4
|
+
<view wx:if="{{item.type === 'disabled'}}" class="item item_disabled" data-index="{{index}}">
|
5
|
+
{{item.text}}
|
6
|
+
</view>
|
7
|
+
<view wx:elif="{{currentMonth === item.value}}" class="item item_active" data-index="{{index}}" bindtap="onClick" style="background: {{ color }};">
|
8
|
+
{{item.text}}
|
9
|
+
</view>
|
10
|
+
<view wx:else class="item" data-index="{{index}}" bindtap="onClick">
|
5
11
|
{{item.text}}
|
6
12
|
</view>
|
7
13
|
</smart-col>
|
@@ -1 +1 @@
|
|
1
|
-
@import '../../../common/index.wxss';.item{border-radius:
|
1
|
+
@import '../../../common/index.wxss';.contain{margin:24rpx 0}.item{border-radius:var(--calendar-cell-item-border-radius,104rpx);color:var(--calendar-cell-item-font-color,var(--app-B4-N1,#000));font-size:var(--calendar-cell-item-font-size,15px);font-weight:var(--calendar-day-font-weight,500);height:var(--calendar-cell-item-height,104rpx);line-height:var(--calendar-cell-item-height,104rpx);text-align:center;width:var(--calendar-cell-item-width,104rpx)}.item_active{background:#3678e3;color:#fff}.item_disabled{opacity:.5}.col_item{display:flex;justify-content:center}
|