@tuya-miniapp/smart-ui 1.3.1-beta-1 → 1.3.1-beta-3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (55) hide show
  1. package/dist/calendar/calendar.wxml +13 -8
  2. package/dist/calendar/components/header/index.js +6 -2
  3. package/dist/calendar/components/header/index.wxml +1 -1
  4. package/dist/calendar/components/month/index.css +1 -1
  5. package/dist/calendar/components/month/index.wxss +1 -1
  6. package/dist/calendar/components/month-list/index.css +1 -1
  7. package/dist/calendar/components/month-list/index.js +24 -26
  8. package/dist/calendar/components/month-list/index.wxml +13 -9
  9. package/dist/calendar/components/month-list/index.wxss +1 -1
  10. package/dist/calendar/components/year-list/index.css +1 -1
  11. package/dist/calendar/components/year-list/index.js +15 -2
  12. package/dist/calendar/components/year-list/index.wxml +7 -1
  13. package/dist/calendar/components/year-list/index.wxss +1 -1
  14. package/dist/calendar/index.js +25 -27
  15. package/dist/calendar/index.wxs +1 -1
  16. package/dist/calendar/utils.d.ts +4 -0
  17. package/dist/calendar/utils.js +28 -0
  18. package/dist/notice-bar/index.css +1 -1
  19. package/dist/notice-bar/index.wxss +1 -1
  20. package/dist/search/index.css +1 -1
  21. package/dist/search/index.js +1 -5
  22. package/dist/search/index.wxml +1 -1
  23. package/dist/search/index.wxss +1 -1
  24. package/dist/tabs/index.css +1 -1
  25. package/dist/tabs/index.wxss +1 -1
  26. package/dist/toast/toast.js +2 -0
  27. package/dist/wxs/style.wxs +0 -7
  28. package/lib/calendar/calendar.wxml +13 -8
  29. package/lib/calendar/components/header/index.js +6 -2
  30. package/lib/calendar/components/header/index.wxml +1 -1
  31. package/lib/calendar/components/month/index.css +1 -1
  32. package/lib/calendar/components/month/index.wxss +1 -1
  33. package/lib/calendar/components/month-list/index.css +1 -1
  34. package/lib/calendar/components/month-list/index.js +24 -26
  35. package/lib/calendar/components/month-list/index.wxml +13 -9
  36. package/lib/calendar/components/month-list/index.wxss +1 -1
  37. package/lib/calendar/components/year-list/index.css +1 -1
  38. package/lib/calendar/components/year-list/index.js +15 -2
  39. package/lib/calendar/components/year-list/index.wxml +7 -1
  40. package/lib/calendar/components/year-list/index.wxss +1 -1
  41. package/lib/calendar/index.js +24 -26
  42. package/lib/calendar/index.wxs +1 -1
  43. package/lib/calendar/utils.d.ts +4 -0
  44. package/lib/calendar/utils.js +30 -1
  45. package/lib/notice-bar/index.css +1 -1
  46. package/lib/notice-bar/index.wxss +1 -1
  47. package/lib/search/index.css +1 -1
  48. package/lib/search/index.js +1 -5
  49. package/lib/search/index.wxml +1 -1
  50. package/lib/search/index.wxss +1 -1
  51. package/lib/tabs/index.css +1 -1
  52. package/lib/tabs/index.wxss +1 -1
  53. package/lib/toast/toast.js +2 -0
  54. package/lib/wxs/style.wxs +0 -7
  55. package/package.json +17 -4
@@ -4,7 +4,7 @@
4
4
  <header
5
5
  title="{{ title }}"
6
6
  showTitle="{{ showTitle }}"
7
- subtitle="{{ mode === 'year' ? '' : mode === 'month' ? computed.formatYearTitle(currentDate, visibleIndex, locale.yearFormatter) : computed.formatMonthTitle(months[visibleIndex], subFormatter) }}"
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="{{ mode !== 'day' }}"
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="{{mode === 'day'}}">
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="{{mode === 'month'}}">
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="{{defaultDate}}"
57
- visibleIndex="{{visibleIndex}}"
58
+ date="{{currentDate}}"
59
+ color="{{color}}"
60
+ readonly="{{readonly}}"
58
61
  />
59
62
  </block>
60
63
 
61
- <block wx:if="{{mode === 'year'}}">
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="{{defaultDate}}"
70
+ date="{{currentDate}}"
68
71
  visibleIndex="{{visibleIndex}}"
72
+ color="{{color}}"
73
+ readonly="{{readonly}}"
69
74
  />
70
75
  </block>
71
76
 
@@ -5,17 +5,21 @@ SmartComponent({
5
5
  props: {
6
6
  title: {
7
7
  type: String,
8
- value: '日期选择',
8
+ value: 'Select Date',
9
9
  },
10
10
  rightText: {
11
11
  type: String,
12
- value: '保存',
12
+ value: 'Save',
13
13
  },
14
14
  subtitle: String,
15
15
  showTitle: Boolean,
16
16
  showSubtitle: Boolean,
17
17
  defaultWeeks: Array,
18
18
  hideWeek: Boolean,
19
+ showConfirm: {
20
+ type: Boolean,
21
+ value: true,
22
+ },
19
23
  firstDayOfWeek: {
20
24
  type: Number,
21
25
  observer: 'initWeekDay',
@@ -3,7 +3,7 @@
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=="onSave">{{ rightText }}</view>
6
+ <view class="smart-calendar__header-title-save" bind:tap=="onSave" wx:if="{{showConfirm}}">{{ rightText }}</view>
7
7
  </view>
8
8
  </block>
9
9
 
@@ -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-day-font-size,15px);font-weight:500;height:var(--calendar-day-height,100rpx);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:34rpx;border-top-left-radius:34rpx}.smart-calendar__day--end{border-bottom-right-radius:34rpx;border-top-right-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,var(--app-B3,#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
+ @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-day-font-size,15px);font-weight:var(--calendar-day-font-weight,500);height:var(--calendar-day-height,100rpx);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,var(--app-B3,#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.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-day-font-size,15px);font-weight:500;height:var(--calendar-day-height,100rpx);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:34rpx;border-top-left-radius:34rpx}.smart-calendar__day--end{border-bottom-right-radius:34rpx;border-top-right-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,var(--app-B3,#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
+ @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-day-font-size,15px);font-weight:var(--calendar-day-font-weight,500);height:var(--calendar-day-height,100rpx);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,var(--app-B3,#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: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}
1
+ @import '../../../common/index.css';.item{border-radius:50%;color:rgba(0,0,0,.9);font-size:15px;font-weight:500;height:104rpx;line-height:104rpx;text-align:center;width:104rpx}.item_active{background:#3678e3;color:#fff}.item_disabled{opacity:.5}
@@ -1,6 +1,9 @@
1
1
  // components/month-list.js
2
2
  import { getMonths } from '../../utils';
3
3
  import { SmartComponent } from '../../../common/component';
4
+ const currentYear = new Date().getFullYear();
5
+ const minMonthDate = new Date(currentYear - 10, 1, 1).getTime();
6
+ const maxMonthDate = new Date(currentYear + 10, 12, 31).getTime();
4
7
  SmartComponent({
5
8
  /**
6
9
  * 组件的属性列表
@@ -10,30 +13,25 @@ SmartComponent({
10
13
  type: null,
11
14
  observer(newVal, oldVal) {
12
15
  if (newVal !== oldVal) {
13
- this.calcMonth();
16
+ this.getMonthList();
14
17
  }
15
18
  },
16
19
  },
20
+ color: {
21
+ type: String,
22
+ value: '#3678e3'
23
+ },
17
24
  minDate: {
18
25
  type: null,
19
- value: new Date(new Date().getFullYear(), 0, 1).getTime(),
26
+ value: minMonthDate,
20
27
  },
21
28
  maxDate: {
22
29
  type: null,
23
- value: new Date(new Date().getFullYear(), 11, 31).getTime(),
30
+ value: maxMonthDate,
24
31
  },
25
- currentYear: {
26
- type: null,
27
- value: new Date().getFullYear(),
28
- },
29
- visibleIndex: {
30
- type: Number,
31
- value: 0,
32
- observer(newVal, oldVal) {
33
- if (newVal !== oldVal) {
34
- this.getMonthList();
35
- }
36
- },
32
+ readonly: {
33
+ type: Boolean,
34
+ value: false
37
35
  },
38
36
  monthsFormatter: {
39
37
  type: null,
@@ -62,22 +60,16 @@ SmartComponent({
62
60
  },
63
61
  created() {
64
62
  this.getMonthList();
65
- this.calcMonth();
66
63
  },
67
64
  /**
68
65
  * 组件的方法列表
69
66
  */
70
67
  methods: {
71
- calcMonth() {
72
- const date = new Date(this.data.date);
73
- const cur = date.getMonth();
74
- this.setData({
75
- currentMonth: cur,
76
- });
77
- },
78
68
  getMonthList() {
79
- const { minDate, maxDate, visibleIndex, monthsFormatter = [], } = this.data;
80
- const cur = new Date().getFullYear() + visibleIndex;
69
+ const { minDate, maxDate, monthsFormatter = [] } = this.data;
70
+ const curDate = new Date(this.data.date);
71
+ const cur = curDate.getFullYear();
72
+ const curMonthDate = new Date(curDate.getFullYear(), curDate.getMonth(), 1);
81
73
  const start = new Date(cur, 0, 1).getTime();
82
74
  const end = new Date(cur, 11, 31).getTime();
83
75
  const minDateTime = new Date(minDate).getTime();
@@ -86,7 +78,10 @@ SmartComponent({
86
78
  const monthlist = months.map((date) => {
87
79
  const monthVal = new Date(date).getMonth();
88
80
  const time = new Date(date).getTime();
89
- const isDisabled = time < minDateTime || time > maxDateTime;
81
+ let isDisabled = false;
82
+ if (minDate && maxDate) {
83
+ isDisabled = time < minDateTime || time > maxDateTime;
84
+ }
90
85
  return {
91
86
  value: date,
92
87
  month: monthVal,
@@ -96,9 +91,12 @@ SmartComponent({
96
91
  });
97
92
  this.setData({
98
93
  months: monthlist,
94
+ currentMonth: curMonthDate.getTime(),
99
95
  });
100
96
  },
101
97
  onClick(event) {
98
+ if (this.data.readonly)
99
+ return;
102
100
  const { index } = event.currentTarget.dataset;
103
101
  const item = this.data.months[index];
104
102
  if (item.type !== 'disabled') {
@@ -1,9 +1,13 @@
1
- <view class="contain">
2
- <smart-row>
3
- <smart-col wx:for="{{months}}" span="6">
4
- <view class="item {{ currentMonth === item.month ? '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>
1
+ <smart-row>
2
+ <smart-col wx:for="{{months}}" span="6">
3
+ <view wx:if="{{item.type === 'disabled'}}" class="item item_disabled" data-index="{{index}}">
4
+ {{item.text}}
5
+ </view>
6
+ <view wx:elif="{{currentMonth === item.value}}" class="item item_active" data-index="{{index}}" bindtap="onClick" style="background: {{ color }};">
7
+ {{item.text}}
8
+ </view>
9
+ <view wx:else class="item" data-index="{{index}}" bindtap="onClick">
10
+ {{item.text}}
11
+ </view>
12
+ </smart-col>
13
+ </smart-row>
@@ -1 +1 @@
1
- @import '../../../common/index.wxss';.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}
1
+ @import '../../../common/index.wxss';.item{border-radius:50%;color:rgba(0,0,0,.9);font-size:15px;font-weight:500;height:104rpx;line-height:104rpx;text-align:center;width:104rpx}.item_active{background:#3678e3;color:#fff}.item_disabled{opacity:.5}
@@ -1 +1 @@
1
- @import '../../../common/index.css';.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}
1
+ @import '../../../common/index.css';.contain{margin:24rpx 0}.item{border-radius:50%;color:rgba(0,0,0,.9);font-size:15px;font-weight:500;height:104rpx;line-height:104rpx;text-align:center;width:104rpx}.item_active{background:#3678e3;color:#fff}.item_disabled{opacity:.5}
@@ -14,6 +14,10 @@ SmartComponent({
14
14
  }
15
15
  },
16
16
  },
17
+ readonly: {
18
+ type: Boolean,
19
+ value: false
20
+ },
17
21
  minDate: {
18
22
  type: null,
19
23
  value: new Date(new Date().getFullYear() - 30, 0, 1).getTime(),
@@ -22,6 +26,10 @@ SmartComponent({
22
26
  type: null,
23
27
  value: new Date(new Date().getFullYear() + 30, 11, 31).getTime(),
24
28
  },
29
+ color: {
30
+ type: String,
31
+ value: '#3678e3',
32
+ },
25
33
  currentYear: {
26
34
  type: null,
27
35
  value: new Date().getFullYear(),
@@ -74,12 +82,15 @@ SmartComponent({
74
82
  const yearlist = years.map((date) => {
75
83
  const yearVal = new Date(date).getFullYear();
76
84
  const curTime = new Date(date).getTime();
77
- const disabled = curTime <= minStart || curTime >= maxStart;
85
+ let isDisabled = false;
86
+ if (minDate && maxDate) {
87
+ isDisabled = curTime <= minStart || curTime >= maxStart;
88
+ }
78
89
  return {
79
90
  value: date,
80
91
  year: yearVal,
81
92
  text: yearFormatter.replace('YYYY', yearVal),
82
- type: disabled ? 'disabled' : '',
93
+ type: isDisabled ? 'disabled' : '',
83
94
  };
84
95
  });
85
96
  this.setData({
@@ -87,6 +98,8 @@ SmartComponent({
87
98
  });
88
99
  },
89
100
  onClick(event) {
101
+ if (this.data.readonly)
102
+ return;
90
103
  const { index } = event.currentTarget.dataset;
91
104
  const item = this.data.years[index];
92
105
  if (item.type !== 'disabled') {
@@ -1,7 +1,13 @@
1
1
  <view class="contain">
2
2
  <smart-row>
3
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">
4
+ <view wx:if="{{item.type === 'disabled'}}" class="item item_disabled" data-index="{{index}}">
5
+ {{item.text}}
6
+ </view>
7
+ <view wx:elif="{{currentYear === item.year}}" 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';.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}
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;height:104rpx;line-height:104rpx;text-align:center;width:104rpx}.item_active{background:#3678e3;color:#fff}.item_disabled{opacity:.5}
@@ -1,17 +1,13 @@
1
1
  import { SmartComponent } from '../common/component';
2
- import { ROW_HEIGHT, getPrevDay, getNextDay, getToday, compareDay, copyDates, calcDateNum, getMonths, getDayByOffset, getCurrentIndex, getWeekStartAndEnd, } from './utils';
2
+ import { ROW_HEIGHT, getPrevDay, getNextDay, getToday, compareDay, copyDates, calcDateNum, getMonths, getDayByOffset, getCurrentIndex, getWeekStartAndEnd, getInitEdgeDate, } from './utils';
3
3
  import Toast from '../toast/toast';
4
- const initialMinDate = getToday().getTime();
5
- const initialMaxDate = (() => {
6
- const now = getToday();
7
- return new Date(now.getFullYear(), now.getMonth() + 6, now.getDate()).getTime();
8
- })();
4
+ const dateEdge = getInitEdgeDate('year');
9
5
  const getTime = (date) => date instanceof Date ? date.getTime() : date;
10
6
  SmartComponent({
11
7
  props: {
12
8
  title: {
13
9
  type: String,
14
- value: '日期选择',
10
+ value: 'Select Date',
15
11
  },
16
12
  color: String,
17
13
  show: {
@@ -47,18 +43,13 @@ SmartComponent({
47
43
  rangeEnd: 'End',
48
44
  },
49
45
  },
50
- formatter: null,
51
46
  confirmText: {
52
47
  type: String,
53
- value: '确定',
48
+ value: 'Confirm',
54
49
  },
55
50
  confirmDisabledText: {
56
51
  type: String,
57
- value: '确定',
58
- },
59
- mode: {
60
- type: String,
61
- value: 'day',
52
+ value: 'Confirm',
62
53
  },
63
54
  rangePrompt: String,
64
55
  showRangePrompt: {
@@ -81,11 +72,11 @@ SmartComponent({
81
72
  },
82
73
  minDate: {
83
74
  type: Number,
84
- value: initialMinDate,
75
+ value: dateEdge.min
85
76
  },
86
77
  maxDate: {
87
78
  type: Number,
88
- value: initialMaxDate,
79
+ value: dateEdge.max
89
80
  },
90
81
  position: {
91
82
  type: String,
@@ -101,7 +92,7 @@ SmartComponent({
101
92
  },
102
93
  poppable: {
103
94
  type: Boolean,
104
- value: true,
95
+ value: false,
105
96
  },
106
97
  showMark: {
107
98
  type: Boolean,
@@ -173,15 +164,19 @@ SmartComponent({
173
164
  methods: {
174
165
  onPrev() {
175
166
  const visibleIndex = this.data.visibleIndex - 1;
176
- if (this.data.mode === 'year') {
167
+ if (this.data.type === 'year') {
177
168
  this.setData({
178
169
  visibleIndex,
179
170
  });
180
171
  return;
181
172
  }
182
- if (this.data.mode === 'month') {
173
+ if (this.data.type === 'month') {
174
+ const nextDate = new Date(this.data.currentDate);
175
+ nextDate.setFullYear(nextDate.getFullYear() - 1);
176
+ this.select(nextDate, true);
183
177
  this.setData({
184
178
  visibleIndex,
179
+ currentDate: nextDate,
185
180
  });
186
181
  return;
187
182
  }
@@ -193,15 +188,19 @@ SmartComponent({
193
188
  },
194
189
  onNext() {
195
190
  const visibleIndex = this.data.visibleIndex + 1;
196
- if (this.data.mode === 'year') {
191
+ if (this.data.type === 'year') {
197
192
  this.setData({
198
193
  visibleIndex,
199
194
  });
200
195
  return;
201
196
  }
202
- if (this.data.mode === 'month') {
197
+ if (this.data.type === 'month') {
198
+ const nextDate = new Date(this.data.currentDate);
199
+ nextDate.setFullYear(nextDate.getFullYear() + 1);
200
+ this.select(nextDate, true);
203
201
  this.setData({
204
202
  visibleIndex,
203
+ currentDate: nextDate,
205
204
  });
206
205
  return;
207
206
  }
@@ -215,16 +214,14 @@ SmartComponent({
215
214
  this.setData({ currentDate: this.getInitialDate(this.data.defaultDate) });
216
215
  this.scrollIntoView();
217
216
  },
218
- initYearIdx(currentDate) {
219
- },
220
217
  initData() {
221
218
  const currentDate = this.getInitialDate(this.data.defaultDate);
222
219
  const months = getMonths(this.data.minDate, this.data.maxDate);
223
220
  const visibleIndex = this.data.defaultDate
224
221
  ? getCurrentIndex(currentDate, months)
225
222
  : months.length - 1;
226
- const isYear = this.data.mode === 'year';
227
- const isMonth = this.data.mode === 'month';
223
+ const isYear = this.data.type === 'year';
224
+ const isMonth = this.data.type === 'month';
228
225
  const data = {
229
226
  currentDate,
230
227
  months,
@@ -242,8 +239,9 @@ SmartComponent({
242
239
  this.initData();
243
240
  },
244
241
  limitDateRange(date, minDate = null, maxDate = null) {
245
- minDate = minDate || this.data.minDate;
246
- maxDate = maxDate || this.data.maxDate;
242
+ const { min, max } = getInitEdgeDate(this.data.type);
243
+ minDate = minDate || this.data.minDate || min;
244
+ maxDate = maxDate || this.data.maxDate || max;
247
245
  if (compareDay(date, minDate) === -1) {
248
246
  return minDate;
249
247
  }
@@ -47,7 +47,7 @@ function formatMonthTitle(date, formatter = 'YYYY-MM') {
47
47
 
48
48
  function formatYearTitle(date, offset, formatter = 'YYYY') {
49
49
  date = getDate(date);
50
- const year = date.getFullYear() + offset;
50
+ const year = date.getFullYear();
51
51
  return formatter.replace('YYYY', year + '');
52
52
  }
53
53
 
@@ -16,3 +16,7 @@ export declare function getWeekStartAndEnd(date: Date): {
16
16
  weekStart: Date;
17
17
  weekEnd: Date;
18
18
  };
19
+ export declare const getInitEdgeDate: (type: string) => {
20
+ min: number;
21
+ max: number;
22
+ };
@@ -129,3 +129,31 @@ export function getWeekStartAndEnd(date) {
129
129
  weekEnd: endOfWeek,
130
130
  };
131
131
  }
132
+ export const getInitEdgeDate = (type) => {
133
+ const currentYear = new Date().getFullYear();
134
+ if (type === 'month') {
135
+ const minMonthDate = new Date(currentYear - 1, 1, 1).getTime();
136
+ const maxMonthDate = new Date(currentYear + 1, 12, 31).getTime();
137
+ return {
138
+ min: minMonthDate,
139
+ max: maxMonthDate,
140
+ };
141
+ }
142
+ if (type === 'year') {
143
+ const minMonthDate = new Date(currentYear - 10, 1, 1).getTime();
144
+ const maxMonthDate = new Date(currentYear + 10, 12, 31).getTime();
145
+ return {
146
+ min: minMonthDate,
147
+ max: maxMonthDate,
148
+ };
149
+ }
150
+ const initialMinDate = getToday().getTime();
151
+ const initialMaxDate = (() => {
152
+ const now = getToday();
153
+ return new Date(now.getFullYear(), now.getMonth() + 6, now.getDate()).getTime();
154
+ })();
155
+ return {
156
+ min: initialMinDate,
157
+ max: initialMaxDate,
158
+ };
159
+ };
@@ -1 +1 @@
1
- @import '../common/index.css';.smart-notice-bar{--notice-bar-info-color:#1989fa;--notice-bar-warning-color:#ffa000;--notice-bar-error-color:#f04c4c;--notice-bar-right-icon-color:rgba(0,0,0,.2);align-items:center;background-color:var(--notice-bar-background-color,rgba(25,137,250,.1));color:var(--notice-bar-text-color,var(--app-B6-N3,rgba(0,0,0,.5)));display:flex;font-size:var(--notice-bar-font-size,12px);height:var(--notice-bar-height,40px);line-height:var(--notice-bar-line-height,14px);padding:var(--notice-bar-padding,0 16px)}.smart-notice-bar--warning{background-color:var(--notice-bar-background-warning-color,rgba(255,160,0,.1))}.smart-notice-bar--error{background-color:var(--notice-bar-background-error-color,rgba(240,76,76,.1))}.smart-notice-bar--hover{opacity:.6}.smart-notice-bar--wrapable{height:auto;padding:var(--notice-bar-wrapable-padding,8px 16px)}.smart-notice-bar--wrapable .smart-notice-bar__wrap{height:auto}.smart-notice-bar--wrapable .smart-notice-bar__content{position:relative;white-space:normal}.smart-notice-bar__left-icon{align-items:center;display:flex;font-size:var(--notice-bar-icon-size,16px);margin-right:var(--notice-bar-left-icon-margin-right,8px);vertical-align:middle}.smart-notice-bar__right-icon{font-size:var(--notice-bar-icon-size,16px);margin-left:var(--notice-bar-right-icon-margin-left,8px)}.smart-notice-bar__wrap{flex:1;height:var(--notice-bar-line-height,14px);overflow:hidden;position:relative}.smart-notice-bar__content{position:absolute;white-space:nowrap}.smart-notice-bar__content.smart-ellipsis{max-width:100%}.smart-notice-bar__content__btn{color:#1989fa;display:inline-block}
1
+ @import '../common/index.css';.smart-notice-bar{--notice-bar-info-color:#1989fa;--notice-bar-warning-color:#ffa000;--notice-bar-error-color:#f04c4c;--notice-bar-right-icon-color:rgba(0,0,0,.2);align-items:center;background-color:var(--notice-bar-background-color,rgba(25,137,250,.1));color:var(--notice-bar-text-color,var(--app-B6-N3,rgba(0,0,0,.5)));display:flex;font-size:var(--notice-bar-font-size,12px);height:var(--notice-bar-height,40px);line-height:var(--notice-bar-line-height,14px);padding:var(--notice-bar-padding,0 16px)}.smart-notice-bar--warning{background-color:var(--notice-bar-background-warning-color,rgba(255,160,0,.1))}.smart-notice-bar--error{background-color:var(--notice-bar-background-error-color,rgba(240,76,76,.1))}.smart-notice-bar--hover{opacity:.6}.smart-notice-bar--wrapable{height:auto;padding:var(--notice-bar-wrapable-padding,8px 16px)}.smart-notice-bar--wrapable .smart-notice-bar__wrap{height:auto}.smart-notice-bar--wrapable .smart-notice-bar__content{position:relative;white-space:normal}.smart-notice-bar__left-icon{align-items:center;display:flex;font-size:var(--notice-bar-icon-size,16px);margin-right:var(--notice-bar-left-icon-margin-right,8px);vertical-align:middle}.smart-notice-bar__right-icon{font-size:var(--notice-bar-icon-size,16px);margin-left:var(--notice-bar-right-icon-margin-left,8px)}.smart-notice-bar__wrap{flex:1;height:var(--notice-bar-line-height,14px);overflow:hidden;position:relative}.smart-notice-bar__content{position:absolute;white-space:nowrap}.smart-notice-bar__content.smart-ellipsis{max-width:100%}.smart-notice-bar__content__btn{color:var(--notice-bar-btn-color,var(--app-M4,#1989fa));display:inline-block}
@@ -1 +1 @@
1
- @import '../common/index.wxss';.smart-notice-bar{--notice-bar-info-color:#1989fa;--notice-bar-warning-color:#ffa000;--notice-bar-error-color:#f04c4c;--notice-bar-right-icon-color:rgba(0,0,0,.2);align-items:center;background-color:var(--notice-bar-background-color,rgba(25,137,250,.1));color:var(--notice-bar-text-color,var(--app-B6-N3,rgba(0,0,0,.5)));display:flex;font-size:var(--notice-bar-font-size,12px);height:var(--notice-bar-height,40px);line-height:var(--notice-bar-line-height,14px);padding:var(--notice-bar-padding,0 16px)}.smart-notice-bar--warning{background-color:var(--notice-bar-background-warning-color,rgba(255,160,0,.1))}.smart-notice-bar--error{background-color:var(--notice-bar-background-error-color,rgba(240,76,76,.1))}.smart-notice-bar--hover{opacity:.6}.smart-notice-bar--wrapable{height:auto;padding:var(--notice-bar-wrapable-padding,8px 16px)}.smart-notice-bar--wrapable .smart-notice-bar__wrap{height:auto}.smart-notice-bar--wrapable .smart-notice-bar__content{position:relative;white-space:normal}.smart-notice-bar__left-icon{align-items:center;display:flex;font-size:var(--notice-bar-icon-size,16px);margin-right:var(--notice-bar-left-icon-margin-right,8px);vertical-align:middle}.smart-notice-bar__right-icon{font-size:var(--notice-bar-icon-size,16px);margin-left:var(--notice-bar-right-icon-margin-left,8px)}.smart-notice-bar__wrap{flex:1;height:var(--notice-bar-line-height,14px);overflow:hidden;position:relative}.smart-notice-bar__content{position:absolute;white-space:nowrap}.smart-notice-bar__content.smart-ellipsis{max-width:100%}.smart-notice-bar__content__btn{color:#1989fa;display:inline-block}
1
+ @import '../common/index.wxss';.smart-notice-bar{--notice-bar-info-color:#1989fa;--notice-bar-warning-color:#ffa000;--notice-bar-error-color:#f04c4c;--notice-bar-right-icon-color:rgba(0,0,0,.2);align-items:center;background-color:var(--notice-bar-background-color,rgba(25,137,250,.1));color:var(--notice-bar-text-color,var(--app-B6-N3,rgba(0,0,0,.5)));display:flex;font-size:var(--notice-bar-font-size,12px);height:var(--notice-bar-height,40px);line-height:var(--notice-bar-line-height,14px);padding:var(--notice-bar-padding,0 16px)}.smart-notice-bar--warning{background-color:var(--notice-bar-background-warning-color,rgba(255,160,0,.1))}.smart-notice-bar--error{background-color:var(--notice-bar-background-error-color,rgba(240,76,76,.1))}.smart-notice-bar--hover{opacity:.6}.smart-notice-bar--wrapable{height:auto;padding:var(--notice-bar-wrapable-padding,8px 16px)}.smart-notice-bar--wrapable .smart-notice-bar__wrap{height:auto}.smart-notice-bar--wrapable .smart-notice-bar__content{position:relative;white-space:normal}.smart-notice-bar__left-icon{align-items:center;display:flex;font-size:var(--notice-bar-icon-size,16px);margin-right:var(--notice-bar-left-icon-margin-right,8px);vertical-align:middle}.smart-notice-bar__right-icon{font-size:var(--notice-bar-icon-size,16px);margin-left:var(--notice-bar-right-icon-margin-left,8px)}.smart-notice-bar__wrap{flex:1;height:var(--notice-bar-line-height,14px);overflow:hidden;position:relative}.smart-notice-bar__content{position:absolute;white-space:nowrap}.smart-notice-bar__content.smart-ellipsis{max-width:100%}.smart-notice-bar__content__btn{color:var(--notice-bar-btn-color,var(--app-M4,#1989fa));display:inline-block}
@@ -1 +1 @@
1
- @import '../common/index.css';.smart-search{align-items:center;background-color:var(--search-background-color,var(--app-B3,#fff));box-sizing:border-box;display:flex;padding:var(--search-padding,12px 16px)}.smart-search__content{align-items:center;background-color:var(--search-body-background-color,var(--app-B4-N9,rgba(0,0,0,.05)));display:flex;flex:1;flex-direction:row;padding:12px 16px}.smart-search__content--round{border-radius:999px}.smart-search__label{color:var(--search-label-color,var(--app-B4-N1,#000));font-size:var(--search-label-font-size,14px);line-height:var(--search-input-height,24px);padding:var(--search-label-padding,0 5px)}.smart-search__field{flex:1}.smart-search__field__left-icon{--icon-color:var(--search-left-icon-color,var(--app-B4-N4,rgba(0,0,0,.4)));margin-left:2px}.smart-search__input{font-size:var(--search-value-font-size,14px)}.smart-search--withaction{padding-right:0}.smart-search__action{color:var(--search-action-text-color,var(--app-B4-N3,rgba(0,0,0,.5)));font-size:var(--search-action-font-size,14px);line-height:var(--search-input-height,24px)}.smart-search__action--hover{background-color:var(--app-B4-N9,rgba(0,0,0,.05));opacity:.4}.smart-search__action-button{padding:var(--search-action-padding,0 16px 0 12px)}.smart-search__hover{background-color:var(--app-B4-N9,rgba(0,0,0,.05));opacity:.4}.smart-search__submit{align-items:center;color:var(--search-submit-color,var(--app-M1,#3678e3));display:flex;flex-direction:row;font-size:var(--search-submit-font-size,14px)}.smart-search__submit:before{background-color:var(--search-submit-color,var(--app-M1,#3678e3));content:"";display:block;height:12px;margin-right:12px;width:1px}
1
+ @import '../common/index.css';.smart-search{align-items:center;background-color:var(--search-background-color,var(--app-B3,#fff));box-sizing:border-box;display:flex;padding:var(--search-padding,12px 16px)}.smart-search__content{align-items:center;background-color:var(--search-body-background-color,var(--app-B4-N9,rgba(0,0,0,.05)));display:flex;flex:1;flex-direction:row;padding:12px 16px}.smart-search__content--round{border-radius:999px}.smart-search__label{color:var(--search-label-color,var(--app-B4-N1,#000));font-size:var(--search-label-font-size,14px);line-height:var(--search-input-height,24px);padding:var(--search-label-padding,0 5px)}.smart-search__field{flex:1}.smart-search__field__left-icon{--icon-color:var(--search-left-icon-color,var(--app-B4-N4,rgba(0,0,0,.4)));margin-left:2px}.smart-search__input{font-size:var(--search-value-font-size,14px)}.smart-search--withaction{padding-right:0}.smart-search__action{color:var(--search-action-text-color,var(--app-B4-N3,rgba(0,0,0,.5)));font-size:var(--search-action-font-size,14px);line-height:var(--search-input-height,24px)}.smart-search__action--hover{background-color:var(--app-B4-N9,rgba(0,0,0,.05));opacity:var(--search-btn-hover-opacity,.4)}.smart-search__action-button{padding:var(--search-action-padding,0 16px 0 12px)}.smart-search__hover{background-color:var(--app-B4-N9,rgba(0,0,0,.05));opacity:var(--search-btn-hover-opacity,.4)}.smart-search__submit{align-items:center;color:var(--search-submit-color,var(--app-M1,#3678e3));display:flex;flex-direction:row;font-size:var(--search-submit-font-size,14px)}.smart-search__submit:before{background-color:var(--search-submit-color,var(--app-M1,#3678e3));content:"";display:block;height:var(--search-submit-line-height,12px);margin-right:12px;width:var(--search-submit-line-width,1px)}
@@ -27,11 +27,7 @@ SmartComponent({
27
27
  rightIcon: String,
28
28
  placeholder: String,
29
29
  placeholderStyle: String,
30
- searchText: {
31
- type: String,
32
- value: 'Search',
33
- },
34
- showSearchButton: Boolean,
30
+ searchText: String,
35
31
  background: String,
36
32
  actionText: {
37
33
  type: String,
@@ -40,7 +40,7 @@
40
40
  <smart-icon wx:if="{{ !useLeftIconSlot && leftIcon }}" size="18" name="{{ leftIcon }}" custom-class="smart-search__field__left-icon" slot="left-icon" />
41
41
  <slot wx:if="{{ useLeftIconSlot }}" name="left-icon" slot="left-icon" />
42
42
  <slot wx:if="{{ useRightIconSlot }}" name="right-icon" slot="right-icon" />
43
- <view wx:if="{{ showSearchButton && searchText }}" hover-class="smart-search__hover" bind:tap="goSearch" class="smart-search__submit" slot="button" >{{ searchText }}</view>
43
+ <view wx:if="{{ searchText }}" hover-class="smart-search__hover" bind:tap="goSearch" class="smart-search__submit" slot="button" >{{ searchText }}</view>
44
44
  <slot name="search-button" slot="button" />
45
45
  </smart-field>
46
46
  </view>
@@ -1 +1 @@
1
- @import '../common/index.wxss';.smart-search{align-items:center;background-color:var(--search-background-color,var(--app-B3,#fff));box-sizing:border-box;display:flex;padding:var(--search-padding,12px 16px)}.smart-search__content{align-items:center;background-color:var(--search-body-background-color,var(--app-B4-N9,rgba(0,0,0,.05)));display:flex;flex:1;flex-direction:row;padding:12px 16px}.smart-search__content--round{border-radius:999px}.smart-search__label{color:var(--search-label-color,var(--app-B4-N1,#000));font-size:var(--search-label-font-size,14px);line-height:var(--search-input-height,24px);padding:var(--search-label-padding,0 5px)}.smart-search__field{flex:1}.smart-search__field__left-icon{--icon-color:var(--search-left-icon-color,var(--app-B4-N4,rgba(0,0,0,.4)));margin-left:2px}.smart-search__input{font-size:var(--search-value-font-size,14px)}.smart-search--withaction{padding-right:0}.smart-search__action{color:var(--search-action-text-color,var(--app-B4-N3,rgba(0,0,0,.5)));font-size:var(--search-action-font-size,14px);line-height:var(--search-input-height,24px)}.smart-search__action--hover{background-color:var(--app-B4-N9,rgba(0,0,0,.05));opacity:.4}.smart-search__action-button{padding:var(--search-action-padding,0 16px 0 12px)}.smart-search__hover{background-color:var(--app-B4-N9,rgba(0,0,0,.05));opacity:.4}.smart-search__submit{align-items:center;color:var(--search-submit-color,var(--app-M1,#3678e3));display:flex;flex-direction:row;font-size:var(--search-submit-font-size,14px)}.smart-search__submit:before{background-color:var(--search-submit-color,var(--app-M1,#3678e3));content:"";display:block;height:12px;margin-right:12px;width:1px}
1
+ @import '../common/index.wxss';.smart-search{align-items:center;background-color:var(--search-background-color,var(--app-B3,#fff));box-sizing:border-box;display:flex;padding:var(--search-padding,12px 16px)}.smart-search__content{align-items:center;background-color:var(--search-body-background-color,var(--app-B4-N9,rgba(0,0,0,.05)));display:flex;flex:1;flex-direction:row;padding:12px 16px}.smart-search__content--round{border-radius:999px}.smart-search__label{color:var(--search-label-color,var(--app-B4-N1,#000));font-size:var(--search-label-font-size,14px);line-height:var(--search-input-height,24px);padding:var(--search-label-padding,0 5px)}.smart-search__field{flex:1}.smart-search__field__left-icon{--icon-color:var(--search-left-icon-color,var(--app-B4-N4,rgba(0,0,0,.4)));margin-left:2px}.smart-search__input{font-size:var(--search-value-font-size,14px)}.smart-search--withaction{padding-right:0}.smart-search__action{color:var(--search-action-text-color,var(--app-B4-N3,rgba(0,0,0,.5)));font-size:var(--search-action-font-size,14px);line-height:var(--search-input-height,24px)}.smart-search__action--hover{background-color:var(--app-B4-N9,rgba(0,0,0,.05));opacity:var(--search-btn-hover-opacity,.4)}.smart-search__action-button{padding:var(--search-action-padding,0 16px 0 12px)}.smart-search__hover{background-color:var(--app-B4-N9,rgba(0,0,0,.05));opacity:var(--search-btn-hover-opacity,.4)}.smart-search__submit{align-items:center;color:var(--search-submit-color,var(--app-M1,#3678e3));display:flex;flex-direction:row;font-size:var(--search-submit-font-size,14px)}.smart-search__submit:before{background-color:var(--search-submit-color,var(--app-M1,#3678e3));content:"";display:block;height:var(--search-submit-line-height,12px);margin-right:12px;width:var(--search-submit-line-width,1px)}
@@ -1 +1 @@
1
- @import '../common/index.css';:root{--tabs-card-background-color:rgba(0,0,0,.08)}:root[theme=dark]{--tabs-card-background-color:hsla(0,0%,100%,.12)}.smart-tabs{-webkit-tap-highlight-color:transparent;position:relative}.smart-tabs__wrap{display:flex;overflow:hidden}.smart-tabs__wrap--scrollable .smart-tab{flex:0 0 22%}.smart-tabs__wrap--scrollable .smart-tab--complete{flex:1 0 auto!important;padding:0 12px}.smart-tabs__wrap--scrollable .smart-tabs__nav--complete{padding-left:8px;padding-right:8px}.smart-tabs__scroll{background-color:var(--tabs-background-color,var(--app-B3,#fff));overflow:auto}.smart-tabs__scroll--line{box-sizing:initial;height:calc(100% + 15px)}.smart-tabs__scroll--card{border-radius:var(--tabs-card-border-radius,8px);box-sizing:border-box;margin:0 var(--padding-md,16px);width:calc(100% - var(--padding-md, 16px)*2)}.smart-tabs__scroll::-webkit-scrollbar{display:none}.smart-tabs__nav{display:flex;position:relative;-webkit-user-select:none;user-select:none}.smart-tabs__nav--card{background-color:var(--tabs-card-background-color);border-radius:var(--tabs-card-border-radius,8px);box-sizing:border-box;height:var(--tabs-card-height,32px);padding:2px}.smart-tabs__nav--card .smart-tab{color:var(--tabs-card-text-color,var(--app-B6-N3,rgba(0,0,0,.5)));line-height:calc(var(--tabs-card-height, 32px) - 2px)}.smart-tabs__nav--card .smart-tab:last-child{border-right:none}.smart-tabs__nav--card .smart-tab.smart-tab--active{color:var(--tabs-card-text-active-color,var(--app-B6-N1,#000))}.smart-tabs__nav--card .smart-tab--disabled{color:var(--tab-disabled-text-color,var(--app-B6-N7,rgba(0,0,0,.1)))}.smart-tabs__line{background-color:var(--tabs-bottom-bar-color,var(--app-M4,#1989fa));border-radius:var(--tabs-bottom-bar-height,3px);bottom:0;height:var(--tabs-bottom-bar-height,3px);left:0;opacity:0;position:absolute;z-index:1}.smart-tabs__card{background-color:var(--tabs-card-active-background-color,var(--app-B3,#fff));border-radius:6px;left:0;opacity:0;position:absolute;top:0;z-index:0}.smart-tabs__track{height:100%;position:relative;width:100%}.smart-tabs__track--animated{display:flex;transition-property:left}.smart-tabs__content{overflow:hidden}.smart-tabs--line{height:var(--tabs-line-height,32px)}.smart-tabs--card{height:var(--tabs-card-height,32px)}.smart-tab{box-sizing:border-box;color:var(--tabs-card-text-color,var(--app-B6-N3,rgba(0,0,0,.5)));cursor:pointer;flex:1;font-size:var(--tab-font-size,13px);line-height:var(--tabs-line-height,32px);min-width:0;padding:0 5px;position:relative;text-align:center}.smart-tab--active{color:var(--tabs-card-text-active-color,var(--app-B6-N1,#000));font-weight:var(--font-weight-bold,500)}.smart-tab--disabled{color:var(--tab-disabled-text-color,var(--app-B6-N7,rgba(0,0,0,.1)))}.smart-tab__title__info{position:relative!important;top:-1px!important;transform:translateX(0)!important}
1
+ @import '../common/index.css';:root{--tabs-card-background-color:rgba(0,0,0,.08)}:root[theme=dark]{--tabs-card-background-color:hsla(0,0%,100%,.12)}.smart-tabs{-webkit-tap-highlight-color:transparent;position:relative}.smart-tabs__wrap{display:flex;overflow:hidden}.smart-tabs__wrap--scrollable .smart-tab{flex:0 0 22%}.smart-tabs__wrap--scrollable .smart-tab--complete{flex:1 0 auto!important;padding:0 12px}.smart-tabs__wrap--scrollable .smart-tabs__nav--complete{padding-left:8px;padding-right:8px}.smart-tabs__scroll{background-color:var(--tabs-background-color,var(--app-B3,#fff));overflow:auto}.smart-tabs__scroll--line{box-sizing:initial;height:calc(100% + 15px)}.smart-tabs__scroll--card{border-radius:var(--tabs-card-border-radius,8px);box-sizing:border-box;margin:0 var(--padding-md,16px);width:calc(100% - var(--padding-md, 16px)*2)}.smart-tabs__scroll::-webkit-scrollbar{display:none}.smart-tabs__nav{display:flex;position:relative;-webkit-user-select:none;user-select:none}.smart-tabs__nav--card{background-color:var(--tabs-card-background-color);border-radius:var(--tabs-card-border-radius,8px);box-sizing:border-box;height:var(--tabs-card-height,32px);padding:2px}.smart-tabs__nav--card .smart-tab{color:var(--tabs-card-text-color,var(--app-B6-N3,rgba(0,0,0,.5)));line-height:calc(var(--tabs-card-height, 32px) - 2px)}.smart-tabs__nav--card .smart-tab:last-child{border-right:none}.smart-tabs__nav--card .smart-tab.smart-tab--active{color:var(--tabs-card-text-active-color,var(--app-B6-N1,#000))}.smart-tabs__nav--card .smart-tab--disabled{color:var(--tab-disabled-text-color,var(--app-B6-N7,rgba(0,0,0,.1)))}.smart-tabs__line{background-color:var(--tabs-bottom-bar-color,var(--app-M4,#1989fa));border-radius:var(--tabs-bottom-bar-height,3px);bottom:0;height:var(--tabs-bottom-bar-height,3px);left:0;opacity:0;position:absolute;z-index:1}.smart-tabs__card{background-color:var(--tabs-card-active-background-color,var(--app-B3,#fff));border-radius:var(--tabs-card-active-border-radius,6px);left:0;opacity:0;position:absolute;top:0;z-index:0}.smart-tabs__track{height:100%;position:relative;width:100%}.smart-tabs__track--animated{display:flex;transition-property:left}.smart-tabs__content{overflow:hidden}.smart-tabs--line{height:var(--tabs-line-height,32px)}.smart-tabs--card{height:var(--tabs-card-height,32px)}.smart-tab{box-sizing:border-box;color:var(--tabs-card-text-color,var(--app-B6-N3,rgba(0,0,0,.5)));cursor:pointer;flex:1;font-size:var(--tab-font-size,13px);line-height:var(--tabs-line-height,32px);min-width:0;padding:0 5px;position:relative;text-align:center}.smart-tab--active{color:var(--tabs-card-text-active-color,var(--app-B6-N1,#000));font-weight:var(--font-weight-bold,500)}.smart-tab--disabled{color:var(--tab-disabled-text-color,var(--app-B6-N7,rgba(0,0,0,.1)))}.smart-tab__title__info{position:relative!important;top:-1px!important;transform:translateX(0)!important}
@@ -1 +1 @@
1
- @import '../common/index.wxss';:root{--tabs-card-background-color:rgba(0,0,0,.08)}:root[theme=dark]{--tabs-card-background-color:hsla(0,0%,100%,.12)}.smart-tabs{-webkit-tap-highlight-color:transparent;position:relative}.smart-tabs__wrap{display:flex;overflow:hidden}.smart-tabs__wrap--scrollable .smart-tab{flex:0 0 22%}.smart-tabs__wrap--scrollable .smart-tab--complete{flex:1 0 auto!important;padding:0 12px}.smart-tabs__wrap--scrollable .smart-tabs__nav--complete{padding-left:8px;padding-right:8px}.smart-tabs__scroll{background-color:var(--tabs-background-color,var(--app-B3,#fff));overflow:auto}.smart-tabs__scroll--line{box-sizing:initial;height:calc(100% + 15px)}.smart-tabs__scroll--card{border-radius:var(--tabs-card-border-radius,8px);box-sizing:border-box;margin:0 var(--padding-md,16px);width:calc(100% - var(--padding-md, 16px)*2)}.smart-tabs__scroll::-webkit-scrollbar{display:none}.smart-tabs__nav{display:flex;position:relative;-webkit-user-select:none;user-select:none}.smart-tabs__nav--card{background-color:var(--tabs-card-background-color);border-radius:var(--tabs-card-border-radius,8px);box-sizing:border-box;height:var(--tabs-card-height,32px);padding:2px}.smart-tabs__nav--card .smart-tab{color:var(--tabs-card-text-color,var(--app-B6-N3,rgba(0,0,0,.5)));line-height:calc(var(--tabs-card-height, 32px) - 2px)}.smart-tabs__nav--card .smart-tab:last-child{border-right:none}.smart-tabs__nav--card .smart-tab.smart-tab--active{color:var(--tabs-card-text-active-color,var(--app-B6-N1,#000))}.smart-tabs__nav--card .smart-tab--disabled{color:var(--tab-disabled-text-color,var(--app-B6-N7,rgba(0,0,0,.1)))}.smart-tabs__line{background-color:var(--tabs-bottom-bar-color,var(--app-M4,#1989fa));border-radius:var(--tabs-bottom-bar-height,3px);bottom:0;height:var(--tabs-bottom-bar-height,3px);left:0;opacity:0;position:absolute;z-index:1}.smart-tabs__card{background-color:var(--tabs-card-active-background-color,var(--app-B3,#fff));border-radius:6px;left:0;opacity:0;position:absolute;top:0;z-index:0}.smart-tabs__track{height:100%;position:relative;width:100%}.smart-tabs__track--animated{display:flex;transition-property:left}.smart-tabs__content{overflow:hidden}.smart-tabs--line{height:var(--tabs-line-height,32px)}.smart-tabs--card{height:var(--tabs-card-height,32px)}.smart-tab{box-sizing:border-box;color:var(--tabs-card-text-color,var(--app-B6-N3,rgba(0,0,0,.5)));cursor:pointer;flex:1;font-size:var(--tab-font-size,13px);line-height:var(--tabs-line-height,32px);min-width:0;padding:0 5px;position:relative;text-align:center}.smart-tab--active{color:var(--tabs-card-text-active-color,var(--app-B6-N1,#000));font-weight:var(--font-weight-bold,500)}.smart-tab--disabled{color:var(--tab-disabled-text-color,var(--app-B6-N7,rgba(0,0,0,.1)))}.smart-tab__title__info{position:relative!important;top:-1px!important;transform:translateX(0)!important}
1
+ @import '../common/index.wxss';:root{--tabs-card-background-color:rgba(0,0,0,.08)}:root[theme=dark]{--tabs-card-background-color:hsla(0,0%,100%,.12)}.smart-tabs{-webkit-tap-highlight-color:transparent;position:relative}.smart-tabs__wrap{display:flex;overflow:hidden}.smart-tabs__wrap--scrollable .smart-tab{flex:0 0 22%}.smart-tabs__wrap--scrollable .smart-tab--complete{flex:1 0 auto!important;padding:0 12px}.smart-tabs__wrap--scrollable .smart-tabs__nav--complete{padding-left:8px;padding-right:8px}.smart-tabs__scroll{background-color:var(--tabs-background-color,var(--app-B3,#fff));overflow:auto}.smart-tabs__scroll--line{box-sizing:initial;height:calc(100% + 15px)}.smart-tabs__scroll--card{border-radius:var(--tabs-card-border-radius,8px);box-sizing:border-box;margin:0 var(--padding-md,16px);width:calc(100% - var(--padding-md, 16px)*2)}.smart-tabs__scroll::-webkit-scrollbar{display:none}.smart-tabs__nav{display:flex;position:relative;-webkit-user-select:none;user-select:none}.smart-tabs__nav--card{background-color:var(--tabs-card-background-color);border-radius:var(--tabs-card-border-radius,8px);box-sizing:border-box;height:var(--tabs-card-height,32px);padding:2px}.smart-tabs__nav--card .smart-tab{color:var(--tabs-card-text-color,var(--app-B6-N3,rgba(0,0,0,.5)));line-height:calc(var(--tabs-card-height, 32px) - 2px)}.smart-tabs__nav--card .smart-tab:last-child{border-right:none}.smart-tabs__nav--card .smart-tab.smart-tab--active{color:var(--tabs-card-text-active-color,var(--app-B6-N1,#000))}.smart-tabs__nav--card .smart-tab--disabled{color:var(--tab-disabled-text-color,var(--app-B6-N7,rgba(0,0,0,.1)))}.smart-tabs__line{background-color:var(--tabs-bottom-bar-color,var(--app-M4,#1989fa));border-radius:var(--tabs-bottom-bar-height,3px);bottom:0;height:var(--tabs-bottom-bar-height,3px);left:0;opacity:0;position:absolute;z-index:1}.smart-tabs__card{background-color:var(--tabs-card-active-background-color,var(--app-B3,#fff));border-radius:var(--tabs-card-active-border-radius,6px);left:0;opacity:0;position:absolute;top:0;z-index:0}.smart-tabs__track{height:100%;position:relative;width:100%}.smart-tabs__track--animated{display:flex;transition-property:left}.smart-tabs__content{overflow:hidden}.smart-tabs--line{height:var(--tabs-line-height,32px)}.smart-tabs--card{height:var(--tabs-card-height,32px)}.smart-tab{box-sizing:border-box;color:var(--tabs-card-text-color,var(--app-B6-N3,rgba(0,0,0,.5)));cursor:pointer;flex:1;font-size:var(--tab-font-size,13px);line-height:var(--tabs-line-height,32px);min-width:0;padding:0 5px;position:relative;text-align:center}.smart-tab--active{color:var(--tabs-card-text-active-color,var(--app-B6-N1,#000));font-weight:var(--font-weight-bold,500)}.smart-tab--disabled{color:var(--tab-disabled-text-color,var(--app-B6-N7,rgba(0,0,0,.1)))}.smart-tab__title__info{position:relative!important;top:-1px!important;transform:translateX(0)!important}