@tuya-miniapp/smart-ui 1.3.0-beta-1 → 1.3.1-beta-1
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/bottom-sheet/index.css +1 -0
- package/dist/bottom-sheet/index.d.ts +1 -0
- package/dist/bottom-sheet/index.js +70 -0
- package/dist/bottom-sheet/index.json +8 -0
- package/dist/bottom-sheet/index.wxml +26 -0
- package/dist/bottom-sheet/index.wxss +1 -0
- package/dist/button/index.js +1 -0
- package/dist/button/index.wxml +1 -1
- package/dist/calendar/calendar.wxml +53 -52
- package/dist/calendar/components/header/index.css +1 -1
- package/dist/calendar/components/header/index.js +18 -0
- package/dist/calendar/components/header/index.json +4 -1
- package/dist/calendar/components/header/index.wxml +15 -4
- 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 +7 -2
- package/dist/calendar/components/month/index.wxml +0 -13
- package/dist/calendar/components/month/index.wxs +13 -7
- package/dist/calendar/components/month/index.wxss +1 -1
- package/dist/calendar/components/month-list/index.css +1 -0
- package/dist/calendar/components/month-list/index.d.ts +1 -0
- package/dist/calendar/components/month-list/index.js +112 -0
- package/dist/calendar/components/month-list/index.json +7 -0
- package/dist/calendar/components/month-list/index.wxml +9 -0
- package/dist/calendar/components/month-list/index.wxss +1 -0
- package/dist/calendar/components/year-list/index.css +1 -0
- package/dist/calendar/components/year-list/index.d.ts +1 -0
- package/dist/calendar/components/year-list/index.js +100 -0
- package/dist/calendar/components/year-list/index.json +7 -0
- package/dist/calendar/components/year-list/index.wxml +9 -0
- package/dist/calendar/components/year-list/index.wxss +1 -0
- package/dist/calendar/index.css +1 -1
- package/dist/calendar/index.js +101 -42
- package/dist/calendar/index.json +3 -1
- package/dist/calendar/index.wxml +1 -1
- package/dist/calendar/index.wxs +20 -2
- package/dist/calendar/index.wxss +1 -1
- package/dist/calendar/utils.d.ts +7 -1
- package/dist/calendar/utils.js +48 -2
- package/dist/checkbox/index.css +1 -1
- package/dist/checkbox/index.js +1 -1
- package/dist/checkbox/index.wxml +2 -2
- package/dist/checkbox/index.wxss +1 -1
- package/dist/config-provider/index.wxs +2 -7
- package/dist/dropdown-item/index.css +1 -1
- package/dist/dropdown-item/index.js +10 -0
- package/dist/dropdown-item/index.wxml +9 -4
- package/dist/dropdown-item/index.wxss +1 -1
- package/dist/dropdown-menu/index.css +1 -1
- package/dist/dropdown-menu/index.js +15 -0
- package/dist/dropdown-menu/index.json +4 -1
- package/dist/dropdown-menu/index.wxml +2 -1
- package/dist/dropdown-menu/index.wxss +1 -1
- package/dist/empty/index.css +1 -1
- package/dist/empty/index.js +20 -1
- package/dist/empty/index.wxml +7 -7
- package/dist/empty/index.wxs +3 -16
- package/dist/empty/index.wxss +1 -1
- package/dist/field/index.css +1 -1
- package/dist/field/index.wxss +1 -1
- package/dist/loading/index.css +1 -1
- package/dist/loading/index.js +4 -4
- package/dist/loading/index.wxml +4 -6
- package/dist/loading/index.wxs +39 -8
- package/dist/loading/index.wxss +1 -1
- package/dist/nav-bar/index.css +1 -1
- package/dist/nav-bar/index.js +19 -1
- package/dist/nav-bar/index.wxml +16 -6
- package/dist/nav-bar/index.wxss +1 -1
- package/dist/normal-slider/index.css +1 -1
- package/dist/normal-slider/index.wxss +1 -1
- package/dist/notice-bar/index.css +1 -1
- package/dist/notice-bar/index.js +55 -2
- package/dist/notice-bar/index.wxml +28 -10
- package/dist/notice-bar/index.wxs +1 -5
- package/dist/notice-bar/index.wxss +1 -1
- package/dist/picker-column/index.js +8 -1
- package/dist/radio/index.css +1 -1
- package/dist/radio/index.js +1 -1
- package/dist/radio/index.wxml +2 -1
- package/dist/radio/index.wxss +1 -1
- package/dist/search/index.css +1 -1
- package/dist/search/index.js +14 -9
- package/dist/search/index.json +2 -1
- package/dist/search/index.wxml +7 -4
- package/dist/search/index.wxss +1 -1
- package/dist/switch/index.css +1 -1
- package/dist/switch/index.wxml +1 -0
- package/dist/switch/index.wxss +1 -1
- package/dist/tabs/index.css +1 -1
- package/dist/tabs/index.js +10 -7
- package/dist/tabs/index.wxml +1 -0
- package/dist/tabs/index.wxs +17 -0
- package/dist/tabs/index.wxss +1 -1
- package/dist/tag/index.css +1 -1
- package/dist/tag/index.wxss +1 -1
- package/dist/toast/icons.d.ts +3 -0
- package/dist/toast/icons.js +6 -0
- package/dist/toast/index.js +8 -4
- package/dist/toast/index.wxml +3 -7
- package/dist/toast/toast.d.ts +2 -0
- package/dist/toast/toast.js +2 -0
- package/dist/wxs/style.wxs +11 -5
- package/dist/wxs/utils.wxs +1 -3
- package/lib/bottom-sheet/index.css +1 -0
- package/lib/bottom-sheet/index.d.ts +1 -0
- package/lib/bottom-sheet/index.js +75 -0
- package/lib/bottom-sheet/index.json +8 -0
- package/lib/bottom-sheet/index.wxml +26 -0
- package/lib/bottom-sheet/index.wxss +1 -0
- package/lib/button/index.js +1 -0
- package/lib/button/index.wxml +1 -1
- package/lib/calendar/calendar.wxml +53 -52
- package/lib/calendar/components/header/index.css +1 -1
- package/lib/calendar/components/header/index.js +21 -0
- package/lib/calendar/components/header/index.json +4 -1
- package/lib/calendar/components/header/index.wxml +15 -4
- 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 +7 -2
- package/lib/calendar/components/month/index.wxml +0 -13
- package/lib/calendar/components/month/index.wxs +13 -7
- package/lib/calendar/components/month/index.wxss +1 -1
- package/lib/calendar/components/month-list/index.css +1 -0
- package/lib/calendar/components/month-list/index.d.ts +1 -0
- package/lib/calendar/components/month-list/index.js +114 -0
- package/lib/calendar/components/month-list/index.json +7 -0
- package/lib/calendar/components/month-list/index.wxml +9 -0
- package/lib/calendar/components/month-list/index.wxss +1 -0
- package/lib/calendar/components/year-list/index.css +1 -0
- package/lib/calendar/components/year-list/index.d.ts +1 -0
- package/lib/calendar/components/year-list/index.js +102 -0
- package/lib/calendar/components/year-list/index.json +7 -0
- package/lib/calendar/components/year-list/index.wxml +9 -0
- package/lib/calendar/components/year-list/index.wxss +1 -0
- package/lib/calendar/index.css +1 -1
- package/lib/calendar/index.js +100 -43
- package/lib/calendar/index.json +3 -1
- package/lib/calendar/index.wxml +1 -1
- package/lib/calendar/index.wxs +20 -2
- package/lib/calendar/index.wxss +1 -1
- package/lib/calendar/utils.d.ts +7 -1
- package/lib/calendar/utils.js +52 -3
- package/lib/checkbox/index.css +1 -1
- package/lib/checkbox/index.js +1 -1
- package/lib/checkbox/index.wxml +2 -2
- package/lib/checkbox/index.wxss +1 -1
- package/lib/config-provider/index.wxs +2 -7
- package/lib/dropdown-item/index.css +1 -1
- package/lib/dropdown-item/index.js +13 -0
- package/lib/dropdown-item/index.wxml +9 -4
- package/lib/dropdown-item/index.wxss +1 -1
- package/lib/dropdown-menu/index.css +1 -1
- package/lib/dropdown-menu/index.js +18 -0
- package/lib/dropdown-menu/index.json +4 -1
- package/lib/dropdown-menu/index.wxml +2 -1
- package/lib/dropdown-menu/index.wxss +1 -1
- package/lib/empty/index.css +1 -1
- package/lib/empty/index.js +20 -1
- package/lib/empty/index.wxml +7 -7
- package/lib/empty/index.wxs +3 -16
- package/lib/empty/index.wxss +1 -1
- package/lib/field/index.css +1 -1
- package/lib/field/index.wxss +1 -1
- package/lib/loading/index.css +1 -1
- package/lib/loading/index.js +4 -4
- package/lib/loading/index.wxml +4 -6
- package/lib/loading/index.wxs +39 -8
- package/lib/loading/index.wxss +1 -1
- package/lib/nav-bar/index.css +1 -1
- package/lib/nav-bar/index.js +19 -1
- package/lib/nav-bar/index.wxml +16 -6
- package/lib/nav-bar/index.wxss +1 -1
- package/lib/normal-slider/index.css +1 -1
- package/lib/normal-slider/index.wxss +1 -1
- package/lib/notice-bar/index.css +1 -1
- package/lib/notice-bar/index.js +58 -2
- package/lib/notice-bar/index.wxml +28 -10
- package/lib/notice-bar/index.wxs +1 -5
- package/lib/notice-bar/index.wxss +1 -1
- package/lib/picker-column/index.js +8 -1
- package/lib/radio/index.css +1 -1
- package/lib/radio/index.js +1 -1
- package/lib/radio/index.wxml +2 -1
- package/lib/radio/index.wxss +1 -1
- package/lib/search/index.css +1 -1
- package/lib/search/index.js +17 -9
- package/lib/search/index.json +2 -1
- package/lib/search/index.wxml +7 -4
- package/lib/search/index.wxss +1 -1
- package/lib/switch/index.css +1 -1
- package/lib/switch/index.wxml +1 -0
- package/lib/switch/index.wxss +1 -1
- package/lib/tabs/index.css +1 -1
- package/lib/tabs/index.js +10 -7
- package/lib/tabs/index.wxml +1 -0
- package/lib/tabs/index.wxs +17 -0
- package/lib/tabs/index.wxss +1 -1
- package/lib/tag/index.css +1 -1
- package/lib/tag/index.wxss +1 -1
- package/lib/toast/icons.d.ts +3 -0
- package/lib/toast/icons.js +12 -0
- package/lib/toast/index.js +8 -7
- package/lib/toast/index.wxml +3 -7
- package/lib/toast/toast.d.ts +2 -0
- package/lib/toast/toast.js +2 -0
- package/lib/wxs/style.wxs +11 -5
- package/lib/wxs/utils.wxs +1 -3
- package/package.json +4 -8
- package/dist/common/theme/dark.d.ts +0 -344
- package/dist/common/theme/dark.js +0 -343
- package/dist/common/theme/light.d.ts +0 -344
- package/dist/common/theme/light.js +0 -343
- package/dist/wxs/is-app-theme-var.wxs +0 -8
- package/lib/common/theme/dark.d.ts +0 -344
- package/lib/common/theme/dark.js +0 -345
- package/lib/common/theme/light.d.ts +0 -344
- package/lib/common/theme/light.js +0 -345
- package/lib/wxs/is-app-theme-var.wxs +0 -8
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1,100 @@
|
|
1
|
+
// components/month-list.js
|
2
|
+
import { getYears } from '../../utils';
|
3
|
+
import { SmartComponent } from '../../../common/component';
|
4
|
+
SmartComponent({
|
5
|
+
/**
|
6
|
+
* 组件的属性列表
|
7
|
+
*/
|
8
|
+
props: {
|
9
|
+
date: {
|
10
|
+
type: null,
|
11
|
+
observer(newVal, oldVal) {
|
12
|
+
if (newVal !== oldVal) {
|
13
|
+
this.calcYear();
|
14
|
+
}
|
15
|
+
},
|
16
|
+
},
|
17
|
+
minDate: {
|
18
|
+
type: null,
|
19
|
+
value: new Date(new Date().getFullYear() - 30, 0, 1).getTime(),
|
20
|
+
},
|
21
|
+
maxDate: {
|
22
|
+
type: null,
|
23
|
+
value: new Date(new Date().getFullYear() + 30, 11, 31).getTime(),
|
24
|
+
},
|
25
|
+
currentYear: {
|
26
|
+
type: null,
|
27
|
+
value: new Date().getFullYear(),
|
28
|
+
},
|
29
|
+
yearFormatter: {
|
30
|
+
type: null,
|
31
|
+
value: 'YYYY',
|
32
|
+
},
|
33
|
+
visibleIndex: {
|
34
|
+
type: Number,
|
35
|
+
value: 0,
|
36
|
+
observer(newVal, oldVal) {
|
37
|
+
if (newVal !== oldVal) {
|
38
|
+
this.getYearList();
|
39
|
+
}
|
40
|
+
},
|
41
|
+
},
|
42
|
+
},
|
43
|
+
/**
|
44
|
+
* 组件的初始数据
|
45
|
+
*/
|
46
|
+
data: {
|
47
|
+
years: [],
|
48
|
+
currentYear: null,
|
49
|
+
},
|
50
|
+
created() {
|
51
|
+
this.getYearList();
|
52
|
+
this.calcYear();
|
53
|
+
},
|
54
|
+
/**
|
55
|
+
* 组件的方法列表
|
56
|
+
*/
|
57
|
+
methods: {
|
58
|
+
calcYear() {
|
59
|
+
const date = new Date(this.data.date);
|
60
|
+
const cur = date.getFullYear();
|
61
|
+
this.setData({
|
62
|
+
currentYear: cur,
|
63
|
+
});
|
64
|
+
},
|
65
|
+
getYearList() {
|
66
|
+
const { minDate, maxDate, yearFormatter = 'YYYY', visibleIndex, date, } = this.data;
|
67
|
+
const cur = new Date(date).getFullYear();
|
68
|
+
const offset = visibleIndex * 12;
|
69
|
+
const start = new Date(cur + offset - 5, 0, 1).getTime();
|
70
|
+
const end = new Date(cur + offset + 6, 11, 31).getTime();
|
71
|
+
const minStart = new Date(minDate).getTime();
|
72
|
+
const maxStart = new Date(maxDate).getTime();
|
73
|
+
const years = getYears(start, end);
|
74
|
+
const yearlist = years.map((date) => {
|
75
|
+
const yearVal = new Date(date).getFullYear();
|
76
|
+
const curTime = new Date(date).getTime();
|
77
|
+
const disabled = curTime <= minStart || curTime >= maxStart;
|
78
|
+
return {
|
79
|
+
value: date,
|
80
|
+
year: yearVal,
|
81
|
+
text: yearFormatter.replace('YYYY', yearVal),
|
82
|
+
type: disabled ? 'disabled' : '',
|
83
|
+
};
|
84
|
+
});
|
85
|
+
this.setData({
|
86
|
+
years: yearlist,
|
87
|
+
});
|
88
|
+
},
|
89
|
+
onClick(event) {
|
90
|
+
const { index } = event.currentTarget.dataset;
|
91
|
+
const item = this.data.years[index];
|
92
|
+
if (item.type !== 'disabled') {
|
93
|
+
this.$emit('click', item.value);
|
94
|
+
this.setData({
|
95
|
+
date: item.value,
|
96
|
+
});
|
97
|
+
}
|
98
|
+
},
|
99
|
+
},
|
100
|
+
});
|
@@ -0,0 +1,9 @@
|
|
1
|
+
<view class="contain">
|
2
|
+
<smart-row>
|
3
|
+
<smart-col wx:for="{{years}}" span="6">
|
4
|
+
<view class="item {{ currentYear === item.year ? 'item_active' : '' }} {{ item.type === 'disabled' ? 'item_disabled' : '' }}" data-index="{{index}}" bindtap="onClick">
|
5
|
+
{{item.text}}
|
6
|
+
</view>
|
7
|
+
</smart-col>
|
8
|
+
</smart-row>
|
9
|
+
</view>
|
@@ -0,0 +1 @@
|
|
1
|
+
@import '../../../common/index.wxss';.contain{margin:24rpx 0}.item{border-radius:50%;color:rgba(0,0,0,.9);font-size:15px;font-weight:500;line-height:104rpx;text-align:center}.item,.item_active{height:104rpx;width:104rpx}.item_active{background:#3678e3;color:#fff}.item_disabled{opacity:.5}
|
package/dist/calendar/index.css
CHANGED
@@ -1 +1 @@
|
|
1
|
-
@import '../common/index.css';.smart-calendar{background-color:var(--calendar-background-color,var(--app-B6,#fff));color:var(--calendar-text-color,#000);display:flex;flex-direction:column;height:
|
1
|
+
@import '../common/index.css';.smart-calendar{background-color:var(--calendar-background-color,var(--app-B6,#fff));color:var(--calendar-text-color,#000);display:flex;flex-direction:column;height:auto}.smart-calendar__close-icon{top:11px}.smart-calendar__popup--bottom,.smart-calendar__popup--top{height:848rpx}.smart-calendar__popup--left,.smart-calendar__popup--right{height:100%}.smart-calendar-month{margin-top:44rpx}.smart-calendar__body{-webkit-overflow-scrolling:touch;flex:1;overflow:auto}.smart-calendar__footer{flex-shrink:0;padding:0 var(--padding-md,16px)}.smart-calendar__footer--safe-area-inset-bottom{padding-bottom:env(safe-area-inset-bottom)}.smart-calendar__footer+.smart-calendar__footer,.smart-calendar__footer:empty{display:none}.smart-calendar__footer:empty+.smart-calendar__footer{display:block!important}
|
package/dist/calendar/index.js
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
import { SmartComponent } from '../common/component';
|
2
|
-
import { ROW_HEIGHT, getPrevDay, getNextDay, getToday, compareDay, copyDates, calcDateNum,
|
2
|
+
import { ROW_HEIGHT, getPrevDay, getNextDay, getToday, compareDay, copyDates, calcDateNum, getMonths, getDayByOffset, getCurrentIndex, getWeekStartAndEnd, } from './utils';
|
3
3
|
import Toast from '../toast/toast';
|
4
|
-
import { requestAnimationFrame } from '../common/utils';
|
5
4
|
const initialMinDate = getToday().getTime();
|
6
5
|
const initialMaxDate = (() => {
|
7
6
|
const now = getToday();
|
@@ -28,6 +27,21 @@ SmartComponent({
|
|
28
27
|
type: Object,
|
29
28
|
value: {
|
30
29
|
shortWeekDays: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
|
30
|
+
monthsFormatter: [
|
31
|
+
'Jan',
|
32
|
+
'Feb',
|
33
|
+
'Mar',
|
34
|
+
'Apr',
|
35
|
+
'May',
|
36
|
+
'Jun',
|
37
|
+
'Jul',
|
38
|
+
'Aug',
|
39
|
+
'Sept',
|
40
|
+
'Oct',
|
41
|
+
'Nov',
|
42
|
+
'Dec',
|
43
|
+
],
|
44
|
+
yearFormatter: 'YYYY',
|
31
45
|
subFormatter: 'YYYY-MM',
|
32
46
|
rangeStart: 'Start',
|
33
47
|
rangeEnd: 'End',
|
@@ -42,6 +56,10 @@ SmartComponent({
|
|
42
56
|
type: String,
|
43
57
|
value: '确定',
|
44
58
|
},
|
59
|
+
mode: {
|
60
|
+
type: String,
|
61
|
+
value: 'day',
|
62
|
+
},
|
45
63
|
rangePrompt: String,
|
46
64
|
showRangePrompt: {
|
47
65
|
type: Boolean,
|
@@ -131,7 +149,8 @@ SmartComponent({
|
|
131
149
|
subtitle: '',
|
132
150
|
currentDate: null,
|
133
151
|
scrollIntoView: '',
|
134
|
-
visibleIndex: 0
|
152
|
+
visibleIndex: 0,
|
153
|
+
months: [],
|
135
154
|
},
|
136
155
|
watch: {
|
137
156
|
minDate() {
|
@@ -142,9 +161,7 @@ SmartComponent({
|
|
142
161
|
},
|
143
162
|
},
|
144
163
|
created() {
|
145
|
-
this.
|
146
|
-
currentDate: this.getInitialDate(this.data.defaultDate),
|
147
|
-
});
|
164
|
+
this.initData();
|
148
165
|
},
|
149
166
|
mounted() {
|
150
167
|
this.isMounted = true;
|
@@ -154,28 +171,75 @@ SmartComponent({
|
|
154
171
|
}
|
155
172
|
},
|
156
173
|
methods: {
|
174
|
+
onPrev() {
|
175
|
+
const visibleIndex = this.data.visibleIndex - 1;
|
176
|
+
if (this.data.mode === 'year') {
|
177
|
+
this.setData({
|
178
|
+
visibleIndex,
|
179
|
+
});
|
180
|
+
return;
|
181
|
+
}
|
182
|
+
if (this.data.mode === 'month') {
|
183
|
+
this.setData({
|
184
|
+
visibleIndex,
|
185
|
+
});
|
186
|
+
return;
|
187
|
+
}
|
188
|
+
if (this.data.months[visibleIndex]) {
|
189
|
+
this.setData({
|
190
|
+
visibleIndex,
|
191
|
+
});
|
192
|
+
}
|
193
|
+
},
|
194
|
+
onNext() {
|
195
|
+
const visibleIndex = this.data.visibleIndex + 1;
|
196
|
+
if (this.data.mode === 'year') {
|
197
|
+
this.setData({
|
198
|
+
visibleIndex,
|
199
|
+
});
|
200
|
+
return;
|
201
|
+
}
|
202
|
+
if (this.data.mode === 'month') {
|
203
|
+
this.setData({
|
204
|
+
visibleIndex,
|
205
|
+
});
|
206
|
+
return;
|
207
|
+
}
|
208
|
+
if (this.data.months[visibleIndex]) {
|
209
|
+
this.setData({
|
210
|
+
visibleIndex,
|
211
|
+
});
|
212
|
+
}
|
213
|
+
},
|
157
214
|
reset() {
|
158
215
|
this.setData({ currentDate: this.getInitialDate(this.data.defaultDate) });
|
159
216
|
this.scrollIntoView();
|
160
217
|
},
|
218
|
+
initYearIdx(currentDate) {
|
219
|
+
},
|
220
|
+
initData() {
|
221
|
+
const currentDate = this.getInitialDate(this.data.defaultDate);
|
222
|
+
const months = getMonths(this.data.minDate, this.data.maxDate);
|
223
|
+
const visibleIndex = this.data.defaultDate
|
224
|
+
? getCurrentIndex(currentDate, months)
|
225
|
+
: months.length - 1;
|
226
|
+
const isYear = this.data.mode === 'year';
|
227
|
+
const isMonth = this.data.mode === 'month';
|
228
|
+
const data = {
|
229
|
+
currentDate,
|
230
|
+
months,
|
231
|
+
visibleIndex: visibleIndex,
|
232
|
+
};
|
233
|
+
if (isYear || isMonth) {
|
234
|
+
// @ts-ignore
|
235
|
+
delete data.visibleIndex;
|
236
|
+
}
|
237
|
+
this.setData(data);
|
238
|
+
},
|
161
239
|
initRect() {
|
162
240
|
if (!this.isMounted)
|
163
241
|
return;
|
164
|
-
|
165
|
-
this.contentObserver.disconnect();
|
166
|
-
}
|
167
|
-
const contentObserver = this.createIntersectionObserver({
|
168
|
-
thresholds: [0, 0.1, 0.9, 1],
|
169
|
-
observeAll: true,
|
170
|
-
});
|
171
|
-
this.contentObserver = contentObserver;
|
172
|
-
contentObserver.relativeTo('.smart-calendar__body');
|
173
|
-
contentObserver.observe('.month', (res) => {
|
174
|
-
if (res.boundingClientRect.top <= res.relativeRect.top) {
|
175
|
-
// @ts-ignore
|
176
|
-
this.setData({ subtitle: formatMonthTitle(res.dataset.date, this.properties.locale.subFormatter), visibleIndex: res.dataset.index });
|
177
|
-
}
|
178
|
-
});
|
242
|
+
this.initData();
|
179
243
|
},
|
180
244
|
limitDateRange(date, minDate = null, maxDate = null) {
|
181
245
|
minDate = minDate || this.data.minDate;
|
@@ -193,7 +257,7 @@ SmartComponent({
|
|
193
257
|
if (!defaultDate)
|
194
258
|
return [];
|
195
259
|
const now = getToday().getTime();
|
196
|
-
if (type === 'range') {
|
260
|
+
if (type === 'range' || type === 'week') {
|
197
261
|
if (!Array.isArray(defaultDate)) {
|
198
262
|
defaultDate = [];
|
199
263
|
}
|
@@ -218,25 +282,6 @@ SmartComponent({
|
|
218
282
|
scrollIntoView() {
|
219
283
|
if (!this.isMounted)
|
220
284
|
return;
|
221
|
-
requestAnimationFrame(() => {
|
222
|
-
const { currentDate, type, show, poppable, minDate, maxDate } = this.data;
|
223
|
-
if (!currentDate)
|
224
|
-
return;
|
225
|
-
// @ts-ignore
|
226
|
-
const targetDate = type === 'single' ? currentDate : currentDate[0];
|
227
|
-
const displayed = show || !poppable;
|
228
|
-
if (!targetDate || !displayed) {
|
229
|
-
return;
|
230
|
-
}
|
231
|
-
const months = getMonths(minDate, maxDate);
|
232
|
-
months.some((month, index) => {
|
233
|
-
if (compareMonth(month, targetDate) === 0) {
|
234
|
-
this.setData({ scrollIntoView: `month${index}`, visibleIndex: index });
|
235
|
-
return true;
|
236
|
-
}
|
237
|
-
return false;
|
238
|
-
});
|
239
|
-
});
|
240
285
|
},
|
241
286
|
onOpen() {
|
242
287
|
this.$emit('open');
|
@@ -256,7 +301,14 @@ SmartComponent({
|
|
256
301
|
}
|
257
302
|
let { date } = event.detail;
|
258
303
|
const { type, currentDate, allowSameDay } = this.data;
|
259
|
-
if (type === '
|
304
|
+
if (type === 'week') {
|
305
|
+
const { weekStart, weekEnd } = getWeekStartAndEnd(date);
|
306
|
+
this.select([
|
307
|
+
Math.max(getTime(weekStart), getTime(this.data.minDate)),
|
308
|
+
Math.min(getTime(weekEnd), getTime(this.data.maxDate)),
|
309
|
+
], true);
|
310
|
+
}
|
311
|
+
else if (type === 'range') {
|
260
312
|
// @ts-ignore
|
261
313
|
const [startDay, endDay] = currentDate;
|
262
314
|
if (startDay && !endDay) {
|
@@ -310,6 +362,13 @@ SmartComponent({
|
|
310
362
|
this.select(date, true);
|
311
363
|
}
|
312
364
|
},
|
365
|
+
onClickDate(event) {
|
366
|
+
if (this.data.readonly) {
|
367
|
+
return;
|
368
|
+
}
|
369
|
+
let date = event.detail;
|
370
|
+
this.select(date, true);
|
371
|
+
},
|
313
372
|
unselect(dateArray) {
|
314
373
|
const date = dateArray[0];
|
315
374
|
if (date) {
|
package/dist/calendar/index.json
CHANGED
@@ -3,8 +3,10 @@
|
|
3
3
|
"usingComponents": {
|
4
4
|
"header": "./components/header/index",
|
5
5
|
"month": "./components/month/index",
|
6
|
+
"month-list": "./components/month-list/index",
|
7
|
+
"year-list": "./components/year-list/index",
|
6
8
|
"smart-button": "../button/index",
|
7
9
|
"smart-popup": "../popup/index",
|
8
10
|
"smart-toast": "../toast/index"
|
9
11
|
}
|
10
|
-
}
|
12
|
+
}
|
package/dist/calendar/index.wxml
CHANGED
@@ -10,7 +10,7 @@
|
|
10
10
|
show="{{ show }}"
|
11
11
|
round="{{ round }}"
|
12
12
|
position="{{ position }}"
|
13
|
-
closeable="{{
|
13
|
+
closeable="{{false}}"
|
14
14
|
close-on-click-overlay="{{ closeOnClickOverlay }}"
|
15
15
|
safe-area-inset-bottom="{{ safeAreaInsetBottom }}"
|
16
16
|
root-portal="{{ rootPortal }}"
|
package/dist/calendar/index.wxs
CHANGED
@@ -32,11 +32,29 @@ function getButtonDisabled(type, currentDate, minRange) {
|
|
32
32
|
}
|
33
33
|
|
34
34
|
function getVisible(visibleIndex, curIndex) {
|
35
|
-
return
|
35
|
+
return visibleIndex === curIndex;
|
36
|
+
}
|
37
|
+
|
38
|
+
function formatMonthTitle(date, formatter = 'YYYY-MM') {
|
39
|
+
date = getDate(date);
|
40
|
+
const year = date.getFullYear();
|
41
|
+
const month =
|
42
|
+
date.getMonth() + 1 < 10
|
43
|
+
? `0${date.getMonth() + 1}`
|
44
|
+
: date.getMonth() + 1 + '';
|
45
|
+
return formatter.replace('YYYY', year + '').replace('MM', month);
|
46
|
+
}
|
47
|
+
|
48
|
+
function formatYearTitle(date, offset, formatter = 'YYYY') {
|
49
|
+
date = getDate(date);
|
50
|
+
const year = date.getFullYear() + offset;
|
51
|
+
return formatter.replace('YYYY', year + '');
|
36
52
|
}
|
37
53
|
|
38
54
|
module.exports = {
|
39
55
|
getMonths: getMonths,
|
40
56
|
getVisible,
|
41
|
-
getButtonDisabled: getButtonDisabled
|
57
|
+
getButtonDisabled: getButtonDisabled,
|
58
|
+
formatMonthTitle,
|
59
|
+
formatYearTitle,
|
42
60
|
};
|
package/dist/calendar/index.wxss
CHANGED
@@ -1 +1 @@
|
|
1
|
-
@import '../common/index.wxss';.smart-calendar{background-color:var(--calendar-background-color,var(--app-B6,#fff));color:var(--calendar-text-color,#000);display:flex;flex-direction:column;height:
|
1
|
+
@import '../common/index.wxss';.smart-calendar{background-color:var(--calendar-background-color,var(--app-B6,#fff));color:var(--calendar-text-color,#000);display:flex;flex-direction:column;height:auto}.smart-calendar__close-icon{top:11px}.smart-calendar__popup--bottom,.smart-calendar__popup--top{height:848rpx}.smart-calendar__popup--left,.smart-calendar__popup--right{height:100%}.smart-calendar-month{margin-top:44rpx}.smart-calendar__body{-webkit-overflow-scrolling:touch;flex:1;overflow:auto}.smart-calendar__footer{flex-shrink:0;padding:0 var(--padding-md,16px)}.smart-calendar__footer--safe-area-inset-bottom{padding-bottom:env(safe-area-inset-bottom)}.smart-calendar__footer+.smart-calendar__footer,.smart-calendar__footer:empty{display:none}.smart-calendar__footer:empty+.smart-calendar__footer{display:block!important}
|
package/dist/calendar/utils.d.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
export declare const ROW_HEIGHT =
|
1
|
+
export declare const ROW_HEIGHT = 34;
|
2
2
|
export declare function formatMonthTitle(date: Date, formatter?: string): string;
|
3
3
|
export declare function compareMonth(date1: Date | number, date2: Date | number): 0 | 1 | -1;
|
4
4
|
export declare function compareDay(day1: Date | number, day2: Date | number): 0 | 1 | -1;
|
@@ -10,3 +10,9 @@ export declare function calcDateNum(date: [Date, Date]): number;
|
|
10
10
|
export declare function copyDates(dates: Date | Date[]): Date | Date[];
|
11
11
|
export declare function getMonthEndDay(year: number, month: number): number;
|
12
12
|
export declare function getMonths(minDate: number, maxDate: number): number[];
|
13
|
+
export declare function getYears(minDate: number, maxDate: number): number[];
|
14
|
+
export declare function getCurrentIndex(currentDate: any, months: any): number;
|
15
|
+
export declare function getWeekStartAndEnd(date: Date): {
|
16
|
+
weekStart: Date;
|
17
|
+
weekEnd: Date;
|
18
|
+
};
|
package/dist/calendar/utils.js
CHANGED
@@ -1,10 +1,12 @@
|
|
1
|
-
export const ROW_HEIGHT =
|
1
|
+
export const ROW_HEIGHT = 34;
|
2
2
|
export function formatMonthTitle(date, formatter = 'YYYY-MM') {
|
3
3
|
if (!(date instanceof Date)) {
|
4
4
|
date = new Date(date);
|
5
5
|
}
|
6
6
|
const year = date.getFullYear();
|
7
|
-
const month = date.getMonth() + 1 < 10
|
7
|
+
const month = date.getMonth() + 1 < 10
|
8
|
+
? `0${date.getMonth() + 1}`
|
9
|
+
: date.getMonth() + 1 + '';
|
8
10
|
return formatter.replace('YYYY', year + '').replace('MM', month);
|
9
11
|
}
|
10
12
|
export function compareMonth(date1, date2) {
|
@@ -83,3 +85,47 @@ export function getMonths(minDate, maxDate) {
|
|
83
85
|
} while (compareMonth(cursor, maxDate) !== 1);
|
84
86
|
return months;
|
85
87
|
}
|
88
|
+
export function getYears(minDate, maxDate) {
|
89
|
+
const years = [];
|
90
|
+
const cursor = new Date(minDate);
|
91
|
+
cursor.setDate(1);
|
92
|
+
do {
|
93
|
+
years.push(cursor.getTime());
|
94
|
+
cursor.setFullYear(cursor.getFullYear() + 1);
|
95
|
+
} while (compareMonth(cursor, maxDate) !== 1);
|
96
|
+
return years;
|
97
|
+
}
|
98
|
+
function findLastGreaterOrEqual(arr, n) {
|
99
|
+
let left = 0;
|
100
|
+
let right = arr.length - 1;
|
101
|
+
let result = -1; // 初始化为 -1,若无符合条件的元素返回 -1
|
102
|
+
while (left <= right) {
|
103
|
+
const mid = Math.floor((left + right) / 2);
|
104
|
+
if (arr[mid] <= n) {
|
105
|
+
result = mid; // 暂存满足条件的索引
|
106
|
+
left = mid + 1; // 继续向右搜索更大的满足条件的元素
|
107
|
+
}
|
108
|
+
else {
|
109
|
+
right = mid - 1;
|
110
|
+
}
|
111
|
+
}
|
112
|
+
return result;
|
113
|
+
}
|
114
|
+
export function getCurrentIndex(currentDate, months) {
|
115
|
+
if (Array.isArray(currentDate)) {
|
116
|
+
currentDate = currentDate[0];
|
117
|
+
}
|
118
|
+
return findLastGreaterOrEqual(months, currentDate);
|
119
|
+
}
|
120
|
+
export function getWeekStartAndEnd(date) {
|
121
|
+
const startOfWeek = new Date(date);
|
122
|
+
const dayOfWeek = startOfWeek.getDay();
|
123
|
+
const diffToMonday = (dayOfWeek + 6) % 7;
|
124
|
+
startOfWeek.setDate(startOfWeek.getDate() - diffToMonday);
|
125
|
+
const endOfWeek = new Date(startOfWeek);
|
126
|
+
endOfWeek.setDate(startOfWeek.getDate() + 6);
|
127
|
+
return {
|
128
|
+
weekStart: startOfWeek,
|
129
|
+
weekEnd: endOfWeek,
|
130
|
+
};
|
131
|
+
}
|
package/dist/checkbox/index.css
CHANGED
@@ -1 +1 @@
|
|
1
|
-
@import '../common/index.css';.smart-checkbox{align-items:center;display:flex;overflow:hidden;-webkit-user-select:none;user-select:none}.smart-checkbox--horizontal{margin-right:12px}.smart-checkbox__icon-wrap,.smart-checkbox__label{line-height:var(--checkbox-size,
|
1
|
+
@import '../common/index.css';.smart-checkbox{align-items:center;display:flex;overflow:hidden;-webkit-user-select:none;user-select:none}.smart-checkbox--horizontal{margin-right:12px}.smart-checkbox__icon-wrap,.smart-checkbox__label{line-height:var(--checkbox-size,24px)}.smart-checkbox__icon-wrap{display:flex;flex:none}.smart-checkbox__icon{align-items:center;border:2px solid var(--checkbox-border-color,var(--app-B6-N6,rgba(0,0,0,.2)));border-radius:var(--checkbox-border-radius,4px);box-sizing:border-box;color:transparent;display:flex;font-size:var(--checkbox-size,24px);height:1em;justify-content:center;text-align:center;transition-duration:var(--checkbox-transition-duration,.2s);transition-property:color,border,background-color;width:1em}.smart-checkbox__icon--round{border-radius:100%}.smart-checkbox__icon--checked{background-color:var(--checkbox-checked-icon-color,var(--app-M4,#1989fa));border:none;color:#fff}.smart-checkbox__icon--disabled{opacity:.3}.smart-checkbox__label{word-wrap:break-word;color:var(--checkbox-label-color,var(--app-B6-N1,#000));font-size:var(--checkbox-label-size,12px);padding-left:var(--checkbox-label-margin,10px)}.smart-checkbox__label--left{float:left;margin:0 var(--checkbox-label-margin,10px) 0 0}.smart-checkbox__label--disabled{color:var(--checkbox-disabled-label-color,var(--app-B6-N1,#000))}.smart-checkbox__label:empty{margin:0}
|
package/dist/checkbox/index.js
CHANGED
package/dist/checkbox/index.wxml
CHANGED
@@ -13,8 +13,8 @@
|
|
13
13
|
<slot wx:if="{{ useIconSlot }}" name="icon" />
|
14
14
|
<smart-icon
|
15
15
|
wx:else
|
16
|
-
name="{{icon}}"
|
17
|
-
size="
|
16
|
+
name="{{ icon }}"
|
17
|
+
size="1em"
|
18
18
|
color="{{ value ? '#fff' : 'none'}}"
|
19
19
|
class="{{ utils.bem('checkbox__icon', [shape, { disabled: disabled || parentDisabled, checked: value }]) }}"
|
20
20
|
style="{{ computed.iconStyle(checkedColor, value, disabled, parentDisabled, iconSize) }}"
|
package/dist/checkbox/index.wxss
CHANGED
@@ -1 +1 @@
|
|
1
|
-
@import '../common/index.wxss';.smart-checkbox{align-items:center;display:flex;overflow:hidden;-webkit-user-select:none;user-select:none}.smart-checkbox--horizontal{margin-right:12px}.smart-checkbox__icon-wrap,.smart-checkbox__label{line-height:var(--checkbox-size,
|
1
|
+
@import '../common/index.wxss';.smart-checkbox{align-items:center;display:flex;overflow:hidden;-webkit-user-select:none;user-select:none}.smart-checkbox--horizontal{margin-right:12px}.smart-checkbox__icon-wrap,.smart-checkbox__label{line-height:var(--checkbox-size,24px)}.smart-checkbox__icon-wrap{display:flex;flex:none}.smart-checkbox__icon{align-items:center;border:2px solid var(--checkbox-border-color,var(--app-B6-N6,rgba(0,0,0,.2)));border-radius:var(--checkbox-border-radius,4px);box-sizing:border-box;color:transparent;display:flex;font-size:var(--checkbox-size,24px);height:1em;justify-content:center;text-align:center;transition-duration:var(--checkbox-transition-duration,.2s);transition-property:color,border,background-color;width:1em}.smart-checkbox__icon--round{border-radius:100%}.smart-checkbox__icon--checked{background-color:var(--checkbox-checked-icon-color,var(--app-M4,#1989fa));border:none;color:#fff}.smart-checkbox__icon--disabled{opacity:.3}.smart-checkbox__label{word-wrap:break-word;color:var(--checkbox-label-color,var(--app-B6-N1,#000));font-size:var(--checkbox-label-size,12px);padding-left:var(--checkbox-label-margin,10px)}.smart-checkbox__label--left{float:left;margin:0 var(--checkbox-label-margin,10px) 0 0}.smart-checkbox__label--disabled{color:var(--checkbox-disabled-label-color,var(--app-B6-N1,#000))}.smart-checkbox__label:empty{margin:0}
|
@@ -1,7 +1,6 @@
|
|
1
1
|
/* eslint-disable */
|
2
2
|
var object = require('../wxs/object.wxs');
|
3
3
|
var style = require('../wxs/style.wxs');
|
4
|
-
var utils = require('../wxs/utils.wxs');
|
5
4
|
|
6
5
|
function kebabCase(word) {
|
7
6
|
var newWord = word
|
@@ -17,12 +16,8 @@ function kebabCase(word) {
|
|
17
16
|
function mapThemeVarsToCSSVars(themeVars) {
|
18
17
|
var cssVars = {};
|
19
18
|
object.keys(themeVars).forEach(function (key) {
|
20
|
-
|
21
|
-
|
22
|
-
} else {
|
23
|
-
var cssVarsKey = '--' + kebabCase(key);
|
24
|
-
cssVars[cssVarsKey] = themeVars[key];
|
25
|
-
}
|
19
|
+
var cssVarsKey = '--' + kebabCase(key);
|
20
|
+
cssVars[cssVarsKey] = themeVars[key];
|
26
21
|
});
|
27
22
|
|
28
23
|
return style(cssVars);
|
@@ -1 +1 @@
|
|
1
|
-
@import '../common/index.css';.smart-dropdown-item{left:0;overflow:hidden;position:fixed;right:0}.smart-dropdown-item__option{text-align:left}.smart-dropdown-item__option--active .smart-dropdown-item__icon,.smart-dropdown-item__option--active .smart-dropdown-item__title{color:var(--dropdown-menu-option-active-color,var(--app-M1,#3678e3))}.smart-dropdown-item--up{top:0}.smart-dropdown-item--down{bottom:0}.smart-dropdown-item__icon{display:block;line-height:inherit}
|
1
|
+
@import '../common/index.css';.smart-dropdown-item{left:0;overflow:hidden;position:fixed;right:0}.smart-dropdown-item .smart-dropdown-item__title{font-size:var(--dropdown-menu-item-title-font-size,14px);font-weight:var(--dropdown-menu-item-title-font-weight,normal);line-height:var(--dropdown-menu-item-title-line-height,28px)}.smart-dropdown-item .smart-dropdown-item__icon{font-size:var(--dropdown-menu-item-icon-font-size,28px)}.smart-dropdown-item__option{--app-B6-N7:transparent;position:relative;text-align:left}.smart-dropdown-item__option:after{border-top:var(--dropdown-menu-item-line-width,1px) solid var(--dropdown-menu-item-line-color,rgba(0,0,0,.05));box-sizing:border-box;content:" ";left:0;pointer-events:none;position:absolute;right:0;top:0;transform-origin:center}.smart-dropdown-item__option--first:after{border-top:var(--dropdown-menu-item-line-width,1px) solid var(--dropdown-menu-item-first-line-color,rgba(0,0,0,.08))}.smart-dropdown-item__option--active .smart-dropdown-item__icon,.smart-dropdown-item__option--active .smart-dropdown-item__title{color:var(--dropdown-menu-option-active-color,var(--app-M1,#3678e3));font-weight:var(--dropdown-menu-item-title-active-font-weight,500)}.smart-dropdown-item__option--up:after{bottom:0;top:auto}.smart-dropdown-item--up{top:0}.smart-dropdown-item--down{bottom:0}.smart-dropdown-item__icon{display:block;line-height:inherit}
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { useParent } from '../common/relation';
|
2
2
|
import { SmartComponent } from '../common/component';
|
3
|
+
import checkMarkIcon from '@tuya-miniapp/icons/dist/svg/Checkmark';
|
3
4
|
SmartComponent({
|
4
5
|
classes: ['item-title-class'],
|
5
6
|
field: true,
|
@@ -36,12 +37,21 @@ SmartComponent({
|
|
36
37
|
},
|
37
38
|
},
|
38
39
|
data: {
|
40
|
+
checkMarkIcon,
|
41
|
+
checkMarkIconColor: '',
|
39
42
|
transition: true,
|
40
43
|
showPopup: false,
|
41
44
|
showWrapper: false,
|
42
45
|
displayTitle: '',
|
43
46
|
safeAreaTabBar: false,
|
44
47
|
},
|
48
|
+
mounted() {
|
49
|
+
var _a;
|
50
|
+
// @ts-ignore
|
51
|
+
const themeInfo = (_a = ty === null || ty === void 0 ? void 0 : ty.getThemeInfo()) !== null && _a !== void 0 ? _a : {};
|
52
|
+
const checkMarkIconColor = this.data.activeColor || themeInfo['--app-M1'] || '#3678E3';
|
53
|
+
this.setData({ checkMarkIconColor });
|
54
|
+
},
|
45
55
|
methods: {
|
46
56
|
rerender() {
|
47
57
|
wx.nextTick(() => {
|
@@ -25,7 +25,13 @@
|
|
25
25
|
wx:for="{{ options }}"
|
26
26
|
wx:key="value"
|
27
27
|
data-option="{{ item }}"
|
28
|
-
class="{{ utils.bem(
|
28
|
+
class="{{ utils.bem(
|
29
|
+
'dropdown-item__option',
|
30
|
+
{
|
31
|
+
active: item.value === value,
|
32
|
+
first: direction === 'up' ? index === options.length-1 : !index,
|
33
|
+
up: direction === 'up'
|
34
|
+
} ) }}"
|
29
35
|
clickable
|
30
36
|
icon="{{ item.icon }}"
|
31
37
|
bind:tap="onOptionTap"
|
@@ -39,12 +45,11 @@
|
|
39
45
|
</view>
|
40
46
|
<smart-icon
|
41
47
|
wx:if="{{ item.value === value }}"
|
42
|
-
name="
|
48
|
+
name="{{ checkMarkIcon }}"
|
43
49
|
class="smart-dropdown-item__icon"
|
44
|
-
color="{{ activeColor }}"
|
50
|
+
color="{{ activeColor || checkMarkIconColor }}"
|
45
51
|
/>
|
46
52
|
</smart-cell>
|
47
|
-
|
48
53
|
<slot />
|
49
54
|
</smart-popup>
|
50
55
|
</view>
|
@@ -1 +1 @@
|
|
1
|
-
@import '../common/index.wxss';.smart-dropdown-item{left:0;overflow:hidden;position:fixed;right:0}.smart-dropdown-item__option{text-align:left}.smart-dropdown-item__option--active .smart-dropdown-item__icon,.smart-dropdown-item__option--active .smart-dropdown-item__title{color:var(--dropdown-menu-option-active-color,var(--app-M1,#3678e3))}.smart-dropdown-item--up{top:0}.smart-dropdown-item--down{bottom:0}.smart-dropdown-item__icon{display:block;line-height:inherit}
|
1
|
+
@import '../common/index.wxss';.smart-dropdown-item{left:0;overflow:hidden;position:fixed;right:0}.smart-dropdown-item .smart-dropdown-item__title{font-size:var(--dropdown-menu-item-title-font-size,14px);font-weight:var(--dropdown-menu-item-title-font-weight,normal);line-height:var(--dropdown-menu-item-title-line-height,28px)}.smart-dropdown-item .smart-dropdown-item__icon{font-size:var(--dropdown-menu-item-icon-font-size,28px)}.smart-dropdown-item__option{--app-B6-N7:transparent;position:relative;text-align:left}.smart-dropdown-item__option:after{border-top:var(--dropdown-menu-item-line-width,1px) solid var(--dropdown-menu-item-line-color,rgba(0,0,0,.05));box-sizing:border-box;content:" ";left:0;pointer-events:none;position:absolute;right:0;top:0;transform-origin:center}.smart-dropdown-item__option--first:after{border-top:var(--dropdown-menu-item-line-width,1px) solid var(--dropdown-menu-item-first-line-color,rgba(0,0,0,.08))}.smart-dropdown-item__option--active .smart-dropdown-item__icon,.smart-dropdown-item__option--active .smart-dropdown-item__title{color:var(--dropdown-menu-option-active-color,var(--app-M1,#3678e3));font-weight:var(--dropdown-menu-item-title-active-font-weight,500)}.smart-dropdown-item__option--up:after{bottom:0;top:auto}.smart-dropdown-item--up{top:0}.smart-dropdown-item--down{bottom:0}.smart-dropdown-item__icon{display:block;line-height:inherit}
|
@@ -1 +1 @@
|
|
1
|
-
@import '../common/index.css';.smart-dropdown-menu{background-color:var(--dropdown-menu-background-color,var(--app-B3,#fff));
|
1
|
+
@import '../common/index.css';.smart-dropdown-menu{background-color:var(--dropdown-menu-background-color,var(--app-B3,#fff));display:flex;height:var(--dropdown-menu-height,46px);-webkit-user-select:none;user-select:none}.smart-dropdown-menu__item{align-items:center;display:flex;flex:1;justify-content:center;min-width:0}.smart-dropdown-menu__item:active{opacity:.7}.smart-dropdown-menu__item--disabled:active{opacity:1}.smart-dropdown-menu__item--disabled .smart-dropdown-menu__title{color:var(--dropdown-menu-title-disabled-text-color,var(--app-B6-N4,rgba(0,0,0,.4)))}.smart-dropdown-menu__title{align-items:center;box-sizing:border-box;color:var(--dropdown-menu-title-text-color,var(--app-B6-N1,#000));display:flex;font-size:var(--dropdown-menu-title-font-size,14px);justify-content:center;line-height:var(--dropdown-menu-title-line-height,18px);max-width:100%;padding:var(--dropdown-menu-title-padding,0 24px 0 8px)}.smart-dropdown-menu__title__triangle{font-size:var(--dropdown-menu-title-triangle-size,12px);margin-left:var(--dropdown-menu-title-triangle-margin-left,4px);transform:translateY(10%);transition:all .2s}.smart-dropdown-menu__title__triangle--up{transform:rotate(180deg)}.smart-dropdown-menu__title--active{color:var(--dropdown-menu-title-active-text-color,var(--app-M1,#3678e3))}.smart-dropdown-menu__title--active .smart-dropdown-menu__title__triangle{transform:rotate(180deg);transform-origin:center}.smart-dropdown-menu__title--active .smart-dropdown-menu__title__triangle--up{transform:translateY(10%) rotate(1turn);transform-origin:center}
|