@tuya-miniapp/smart-ui 2.0.2-beta-10 → 2.0.2-beta-11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (95) hide show
  1. package/dist/calendar/calendar.wxml +3 -8
  2. package/dist/calendar/demo/index.js +3 -0
  3. package/dist/calendar/index.css +1 -1
  4. package/dist/calendar/index.js +4 -1
  5. package/dist/calendar/index.json +4 -4
  6. package/dist/calendar/index.wxs +4 -2
  7. package/dist/calendar/index.wxss +1 -1
  8. package/dist/calendar-header/index.css +1 -0
  9. package/dist/{calendar/components/header → calendar-header}/index.js +1 -1
  10. package/{lib/calendar/components/header → dist/calendar-header}/index.json +1 -1
  11. package/dist/calendar-header/index.wxss +1 -0
  12. package/dist/calendar-month/index.css +1 -0
  13. package/dist/{calendar/components/month → calendar-month}/index.js +16 -2
  14. package/dist/{calendar/components/month → calendar-month}/index.wxml +2 -5
  15. package/dist/{calendar/components/month → calendar-month}/index.wxs +1 -1
  16. package/dist/calendar-month/index.wxss +1 -0
  17. package/dist/calendar-month-list/index.css +1 -0
  18. package/dist/{calendar/components/month-list → calendar-month-list}/index.js +2 -2
  19. package/dist/calendar-month-list/index.json +7 -0
  20. package/dist/calendar-month-list/index.wxss +1 -0
  21. package/dist/{calendar → calendar-utils}/types.d.ts +1 -0
  22. package/dist/calendar-year-list/index.css +1 -0
  23. package/dist/{calendar/components/year-list → calendar-year-list}/index.js +2 -2
  24. package/dist/calendar-year-list/index.json +7 -0
  25. package/dist/calendar-year-list/index.wxss +1 -0
  26. package/lib/calendar/calendar.wxml +3 -8
  27. package/lib/calendar/demo/index.js +3 -0
  28. package/lib/calendar/index.css +1 -1
  29. package/lib/calendar/index.js +4 -1
  30. package/lib/calendar/index.json +4 -4
  31. package/lib/calendar/index.wxs +4 -2
  32. package/lib/calendar/index.wxss +1 -1
  33. package/lib/calendar-header/index.css +1 -0
  34. package/lib/{calendar/components/header → calendar-header}/index.js +1 -1
  35. package/{dist/calendar/components/header → lib/calendar-header}/index.json +1 -1
  36. package/lib/calendar-header/index.wxss +1 -0
  37. package/lib/calendar-month/index.css +1 -0
  38. package/lib/{calendar/components/month → calendar-month}/index.js +16 -2
  39. package/lib/{calendar/components/month → calendar-month}/index.wxml +2 -5
  40. package/lib/{calendar/components/month → calendar-month}/index.wxs +1 -1
  41. package/lib/calendar-month/index.wxss +1 -0
  42. package/lib/calendar-month-list/index.css +1 -0
  43. package/lib/{calendar/components/month-list → calendar-month-list}/index.js +2 -2
  44. package/lib/calendar-month-list/index.json +7 -0
  45. package/lib/calendar-month-list/index.wxss +1 -0
  46. package/lib/{calendar → calendar-utils}/types.d.ts +1 -0
  47. package/lib/calendar-year-list/index.css +1 -0
  48. package/lib/{calendar/components/year-list → calendar-year-list}/index.js +2 -2
  49. package/lib/calendar-year-list/index.json +7 -0
  50. package/lib/calendar-year-list/index.wxss +1 -0
  51. package/package.json +1 -1
  52. package/dist/calendar/components/header/index.css +0 -1
  53. package/dist/calendar/components/header/index.wxss +0 -1
  54. package/dist/calendar/components/month/index.css +0 -1
  55. package/dist/calendar/components/month/index.wxss +0 -1
  56. package/dist/calendar/components/month-list/index.css +0 -1
  57. package/dist/calendar/components/month-list/index.json +0 -7
  58. package/dist/calendar/components/month-list/index.wxss +0 -1
  59. package/dist/calendar/components/year-list/index.css +0 -1
  60. package/dist/calendar/components/year-list/index.json +0 -7
  61. package/dist/calendar/components/year-list/index.wxss +0 -1
  62. package/lib/calendar/components/header/index.css +0 -1
  63. package/lib/calendar/components/header/index.wxss +0 -1
  64. package/lib/calendar/components/month/index.css +0 -1
  65. package/lib/calendar/components/month/index.wxss +0 -1
  66. package/lib/calendar/components/month-list/index.css +0 -1
  67. package/lib/calendar/components/month-list/index.json +0 -7
  68. package/lib/calendar/components/month-list/index.wxss +0 -1
  69. package/lib/calendar/components/year-list/index.css +0 -1
  70. package/lib/calendar/components/year-list/index.json +0 -7
  71. package/lib/calendar/components/year-list/index.wxss +0 -1
  72. /package/dist/{calendar/components/header → calendar-header}/index.d.ts +0 -0
  73. /package/dist/{calendar/components/header → calendar-header}/index.wxml +0 -0
  74. /package/dist/{calendar/components/month → calendar-month}/index.d.ts +0 -0
  75. /package/dist/{calendar/components/month → calendar-month}/index.json +0 -0
  76. /package/dist/{calendar/components/month-list → calendar-month-list}/index.d.ts +0 -0
  77. /package/dist/{calendar/components/month-list → calendar-month-list}/index.wxml +0 -0
  78. /package/dist/{calendar → calendar-utils}/types.js +0 -0
  79. /package/dist/{calendar → calendar-utils}/utils.d.ts +0 -0
  80. /package/dist/{calendar → calendar-utils}/utils.js +0 -0
  81. /package/dist/{calendar → calendar-utils}/utils.wxs +0 -0
  82. /package/dist/{calendar/components/year-list → calendar-year-list}/index.d.ts +0 -0
  83. /package/dist/{calendar/components/year-list → calendar-year-list}/index.wxml +0 -0
  84. /package/lib/{calendar/components/header → calendar-header}/index.d.ts +0 -0
  85. /package/lib/{calendar/components/header → calendar-header}/index.wxml +0 -0
  86. /package/lib/{calendar/components/month → calendar-month}/index.d.ts +0 -0
  87. /package/lib/{calendar/components/month → calendar-month}/index.json +0 -0
  88. /package/lib/{calendar/components/month-list → calendar-month-list}/index.d.ts +0 -0
  89. /package/lib/{calendar/components/month-list → calendar-month-list}/index.wxml +0 -0
  90. /package/lib/{calendar → calendar-utils}/types.js +0 -0
  91. /package/lib/{calendar → calendar-utils}/utils.d.ts +0 -0
  92. /package/lib/{calendar → calendar-utils}/utils.js +0 -0
  93. /package/lib/{calendar → calendar-utils}/utils.wxs +0 -0
  94. /package/lib/{calendar/components/year-list → calendar-year-list}/index.d.ts +0 -0
  95. /package/lib/{calendar/components/year-list → calendar-year-list}/index.wxml +0 -0
@@ -21,7 +21,7 @@
21
21
  </header>
22
22
 
23
23
  <block wx:if="{{ type !== 'year' && type !== 'month' }}">
24
- <view class="smart-calendar-month_wrap" wx:for="{{ months }}" wx:key="index">
24
+ <block wx:for="{{ months }}" wx:key="index">
25
25
  <month
26
26
  id="month{{ index }}"
27
27
  class="smart-calendar-month month"
@@ -45,8 +45,9 @@
45
45
  showMonthTitle="{{ index !== 0 || !showSubtitle }}"
46
46
  firstDayOfWeek="{{ firstDayOfWeek }}"
47
47
  bind:click="onClickDay"
48
+ dayClassMap="{{dayClassMap}}"
48
49
  />
49
- </view>
50
+ </block>
50
51
  </block>
51
52
 
52
53
  <block wx:if="{{type === 'month'}}">
@@ -73,10 +74,4 @@
73
74
  readonly="{{readonly}}"
74
75
  />
75
76
  </block>
76
-
77
- <view
78
- class="{{ utils.bem('calendar__footer', { safeAreaInsetBottom }) }}"
79
- >
80
- <slot name="footer"></slot>
81
- </view>
82
77
  </view>
@@ -61,6 +61,9 @@ SmartComponent({
61
61
  ]
62
62
  },
63
63
  showDayPicker: false,
64
+ dayClassMap: {
65
+ '2024-01-20': "bottom-point"
66
+ }
64
67
  },
65
68
  methods: {
66
69
  setCurDay(event) {
@@ -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: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}
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:0rpx}.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}
@@ -1,5 +1,5 @@
1
1
  import { SmartComponent } from '../common/component';
2
- import { ROW_HEIGHT, getPrevDay, getNextDay, getToday, compareDay, copyDates, calcDateNum, getMonths, getDayByOffset, getCurrentIndex, getWeekStartAndEnd, getInitEdgeDate, } from './utils';
2
+ import { ROW_HEIGHT, getPrevDay, getNextDay, getToday, compareDay, copyDates, calcDateNum, getMonths, getDayByOffset, getCurrentIndex, getWeekStartAndEnd, getInitEdgeDate, } from '../calendar-utils/utils';
3
3
  import Toast from '../toast/toast';
4
4
  const dateEdge = getInitEdgeDate('year');
5
5
  const getTime = (date) => (date instanceof Date ? date.getTime() : date);
@@ -135,6 +135,9 @@ SmartComponent({
135
135
  type: Boolean,
136
136
  value: false,
137
137
  },
138
+ dayClassMap: {
139
+ type: null,
140
+ },
138
141
  },
139
142
  data: {
140
143
  subtitle: '',
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "component": true,
3
3
  "usingComponents": {
4
- "header": "./components/header/index",
5
- "month": "./components/month/index",
6
- "month-list": "./components/month-list/index",
7
- "year-list": "./components/year-list/index",
4
+ "header": "../calendar-header/index",
5
+ "month": "../calendar-month/index",
6
+ "month-list": "../calendar-month-list/index",
7
+ "year-list": "../calendar-year-list/index",
8
8
  "smart-button": "../button/index",
9
9
  "smart-popup": "../popup/index",
10
10
  "smart-toast": "../toast/index"
@@ -1,5 +1,5 @@
1
1
  /* eslint-disable */
2
- var utils = require('./utils.wxs');
2
+ var utils = require('../calendar-utils/utils.wxs');
3
3
 
4
4
  function getMonths(minDate, maxDate) {
5
5
  var months = [];
@@ -36,13 +36,15 @@ function getVisible(visibleIndex, curIndex) {
36
36
  }
37
37
 
38
38
  function formatMonthTitle(date, formatter = 'YYYY-MM') {
39
+ if (!date) return '';
39
40
  date = getDate(date);
40
41
  const year = date.getFullYear();
41
- const month = date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1 + "";
42
+ const month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1 + '';
42
43
  return formatter.replace('YYYY', year + '').replace('MM', month);
43
44
  }
44
45
 
45
46
  function formatYearTitle(date, offset, formatter = 'YYYY') {
47
+ if (!date) return '';
46
48
  date = getDate(date);
47
49
  const year = date.getFullYear();
48
50
  return formatter.replace('YYYY', year + '');
@@ -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: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}
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:0rpx}.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}
@@ -0,0 +1 @@
1
+ @import '../common/index.css';.smart-calendar__header{flex-shrink:0}.smart-calendar__header-title{position:relative}.smart-calendar__header-title-save{color:var(--calendar-header-title-save-color,#1989fa);font-size:16px;font-weight:400;letter-spacing:0;line-height:24px;position:absolute;right:48rpx;text-align:right;top:50%;transform:translateY(-50%)}.smart-calendar__header-subtitle,.smart-calendar__header-title{color:var(--calendar-header-title-font-color,var(--app-B4-N1,#000));font-size:16px;font-weight:var(--font-weight-bold,500);height:var(--calendar-header-title-height,44px);line-height:var(--calendar-header-title-height,44px);text-align:center}.smart-calendar__header-subtitle_wrap{align-items:center;display:flex;justify-content:center;position:relative}.smart-calendar__header-subtitle_left{align-items:center;background:var(--calendar-header-icon-bg-color,var(--app-B2-N9,rgba(0,0,0,.05)));border-radius:50%;display:flex;height:48rpx;justify-content:center;left:52rpx;position:absolute;top:50%;transform:translateY(-50%);width:48rpx}.smart-calendar__header-subtitle_left_icon{left:-1px;position:relative}.smart-calendar__header-subtitle_right{align-items:center;background:var(--calendar-header-icon-bg-color,var(--app-B2-N9,rgba(0,0,0,.05)));border-radius:50%;display:flex;height:48rpx;justify-content:center;position:absolute;right:52rpx;top:50%;transform:translateY(-50%);width:48rpx}.smart-calendar__header-subtitle_right_icon{position:relative;right:-1px}.smart-calendar__header-title+.smart-calendar__header-title,.smart-calendar__header-title:empty{display:none}.smart-calendar__header-title:empty+.smart-calendar__header-title{display:block!important}.smart-calendar__weekdays{display:flex;margin-bottom:16rpx;margin-top:16rpx;padding-left:16rpx;padding-right:16rpx}.smart-calendar__weekday{color:var(--calendar-weekdays-font-color,var(--app-B4-N1,#000));flex:1;font-size:var(--calendar-weekdays-font-size,12px);font-weight:500;line-height:var(--calendar-weekdays-height,30px);opacity:.5;text-align:center}
@@ -1,4 +1,4 @@
1
- import { SmartComponent } from '../../../common/component';
1
+ import { SmartComponent } from '../common/component';
2
2
  import LeftIcon from '@tuya-miniapp/icons/dist/svg/Left';
3
3
  import RightIcon from '@tuya-miniapp/icons/dist/svg/Right';
4
4
  SmartComponent({
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "component": true,
3
3
  "usingComponents": {
4
- "smart-icon": "../../../icon/index"
4
+ "smart-icon": "../icon/index"
5
5
  }
6
6
  }
@@ -0,0 +1 @@
1
+ @import '../common/index.wxss';.smart-calendar__header{flex-shrink:0}.smart-calendar__header-title{position:relative}.smart-calendar__header-title-save{color:var(--calendar-header-title-save-color,#1989fa);font-size:16px;font-weight:400;letter-spacing:0;line-height:24px;position:absolute;right:48rpx;text-align:right;top:50%;transform:translateY(-50%)}.smart-calendar__header-subtitle,.smart-calendar__header-title{color:var(--calendar-header-title-font-color,var(--app-B4-N1,#000));font-size:16px;font-weight:var(--font-weight-bold,500);height:var(--calendar-header-title-height,44px);line-height:var(--calendar-header-title-height,44px);text-align:center}.smart-calendar__header-subtitle_wrap{align-items:center;display:flex;justify-content:center;position:relative}.smart-calendar__header-subtitle_left{align-items:center;background:var(--calendar-header-icon-bg-color,var(--app-B2-N9,rgba(0,0,0,.05)));border-radius:50%;display:flex;height:48rpx;justify-content:center;left:52rpx;position:absolute;top:50%;transform:translateY(-50%);width:48rpx}.smart-calendar__header-subtitle_left_icon{left:-1px;position:relative}.smart-calendar__header-subtitle_right{align-items:center;background:var(--calendar-header-icon-bg-color,var(--app-B2-N9,rgba(0,0,0,.05)));border-radius:50%;display:flex;height:48rpx;justify-content:center;position:absolute;right:52rpx;top:50%;transform:translateY(-50%);width:48rpx}.smart-calendar__header-subtitle_right_icon{position:relative;right:-1px}.smart-calendar__header-title+.smart-calendar__header-title,.smart-calendar__header-title:empty{display:none}.smart-calendar__header-title:empty+.smart-calendar__header-title{display:block!important}.smart-calendar__weekdays{display:flex;margin-bottom:16rpx;margin-top:16rpx;padding-left:16rpx;padding-right:16rpx}.smart-calendar__weekday{color:var(--calendar-weekdays-font-color,var(--app-B4-N1,#000));flex:1;font-size:var(--calendar-weekdays-font-size,12px);font-weight:500;line-height:var(--calendar-weekdays-height,30px);opacity:.5;text-align:center}
@@ -0,0 +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{padding-bottom:48rpx;padding-left:16rpx;padding-right:16rpx}.smart-calendar__month-title{font-size:var(--calendar-month-title-font-size,14px);font-weight:var(--font-weight-bold,500);height:var(--calendar-header-title-height,44px);line-height:var(--calendar-header-title-height,44px);text-align:center}.smart-calendar__days{display:flex;flex-wrap:wrap;position:relative;-webkit-user-select:none;user-select:none}.smart-calendar__month-mark{color:var(--calendar-month-mark-color,hsla(210,6%,87%,.6));font-size:var(--calendar-month-mark-font-size,160px);left:50%;pointer-events:none;position:absolute;top:50%;transform:translate(-50%,-50%);z-index:0}.smart-calendar__day,.smart-calendar__selected-day{align-items:center;display:flex;justify-content:center;text-align:center}.smart-calendar__day{color:var(--calendar-cell-item-font-color,var(--app-B4-N1,#000));font-size:var(--calendar-cell-item-font-size,15px);font-weight:var(--calendar-day-font-weight,500);height:var(--calendar-day-height,100rpx);margin:4px 0;position:relative;width:14.285%}.smart-calendar__day--end,.smart-calendar__day--multiple-middle,.smart-calendar__day--multiple-selected,.smart-calendar__day--start,.smart-calendar__day--start-end{background-color:var(--calendar-range-edge-background-color,#3678e3);color:var(--calendar-range-edge-color,#fff)}.smart-calendar__day--start{border-bottom-left-radius:var(--calendar-day-select-border-radius,34rpx);border-top-left-radius:var(--calendar-day-select-border-radius,34rpx)}.smart-calendar__day--end{border-bottom-right-radius:var(--calendar-day-select-border-radius,34rpx);border-top-right-radius:var(--calendar-day-select-border-radius,34rpx)}.smart-calendar__day--multiple-selected,.smart-calendar__day--start-end{border-radius:4px}.smart-calendar__day--middle{background-color:var(--calendar-range-edge-background-color,#3678e3);color:var(--calendar-range-middle-color,#fff)}.smart-calendar__day--disabled{color:var(--calendar-day-disabled-color,#c8c9cc);cursor:default}.smart-calendar__bottom-info,.smart-calendar__top-info{font-size:var(--calendar-info-font-size,10px);left:0;line-height:var(--calendar-info-line-height,14px);position:absolute;right:0}@media (max-width:350px){.smart-calendar__bottom-info,.smart-calendar__top-info{font-size:9px}}.smart-calendar__top-info{top:6px}.smart-calendar__bottom-info{bottom:6px}.smart-calendar__selected-day{background-color:var(--calendar-selected-day-background-color,#3678e3);border-radius:50%;color:var(--calendar-selected-day-color,#fff);height:var(--calendar-selected-day-size,34px);width:var(--calendar-selected-day-size,34px)}
@@ -1,5 +1,5 @@
1
- import { SmartComponent } from '../../../common/component';
2
- import { getMonthEndDay, compareDay, getPrevDay, getNextDay } from '../../utils';
1
+ import { SmartComponent } from '../common/component';
2
+ import { getMonthEndDay, compareDay, getPrevDay, getNextDay } from '../calendar-utils/utils';
3
3
  SmartComponent({
4
4
  props: {
5
5
  date: {
@@ -43,6 +43,9 @@ SmartComponent({
43
43
  allowSameDay: Boolean,
44
44
  showSubtitle: Boolean,
45
45
  showMonthTitle: Boolean,
46
+ dayClassMap: {
47
+ type: null,
48
+ },
46
49
  },
47
50
  data: {
48
51
  days: [],
@@ -64,12 +67,23 @@ SmartComponent({
64
67
  for (let day = 1; day <= totalDay; day++) {
65
68
  const date = new Date(year, month, day);
66
69
  const type = this.getDayType(date);
70
+ const { dayClassMap } = this.data;
67
71
  let config = {
68
72
  date,
69
73
  type,
70
74
  text: day,
71
75
  bottomInfo: this.getBottomInfo(type),
72
76
  };
77
+ if (dayClassMap) {
78
+ const id = `${year}-${month + 1}-${day}`;
79
+ const id2 = `${String(year)}-${String(month + 1).padStart(2, '0')}-${String(day).padStart(2, '0')}`;
80
+ if (dayClassMap[id]) {
81
+ config.customClass = dayClassMap[id];
82
+ }
83
+ if (dayClassMap[id2]) {
84
+ config.customClass = dayClassMap[id2];
85
+ }
86
+ }
73
87
  if (this.data.formatter) {
74
88
  config = this.data.formatter(config);
75
89
  }
@@ -1,23 +1,20 @@
1
1
  <wxs src="./index.wxs" module="computed"></wxs>
2
- <wxs src="../../../wxs/utils.wxs" module="utils" />
2
+ <wxs src="../wxs/utils.wxs" module="utils" />
3
3
 
4
4
  <view class="smart-calendar__month" style="{{ computed.getMonthStyle(visible, date, rowHeight) }}">
5
5
  <view wx:if="{{ visible }}" class="smart-calendar__days">
6
-
7
6
  <view
8
7
  wx:for="{{ days }}"
9
8
  wx:key="index"
10
9
  style="{{ computed.getDayStyle(item.type, index, date, rowHeight, color, firstDayOfWeek) }}"
11
- class="{{ utils.bem('calendar__day', [item.type]) }} {{ item.className }}"
10
+ class="{{ utils.bem('calendar__day', [item.type]) }} {{ item.className }} {{ item.customClass }}"
12
11
  data-index="{{ index }}"
13
12
  bindtap="onClick"
14
13
  >
15
14
  <view wx:if="{{ item.type === 'selected' }}" class="smart-calendar__selected-day" style="width: {{ rowHeight }}px; height: {{ rowHeight }}px; background: {{ color }}">
16
- <view wx:if="{{ item.topInfo }}" class="smart-calendar__top-info">{{ item.topInfo }}</view>
17
15
  {{ item.text }}
18
16
  </view>
19
17
  <block wx:else>
20
- <view wx:if="{{ item.topInfo }}" class="smart-calendar__top-info">{{ item.topInfo }}</view>
21
18
  {{ item.text }}
22
19
  </block>
23
20
  </view>
@@ -1,5 +1,5 @@
1
1
  /* eslint-disable */
2
- var utils = require('../../utils.wxs');
2
+ var utils = require('../calendar-utils/utils.wxs');
3
3
 
4
4
  function getMark(date) {
5
5
  return getDate(date).getMonth() + 1;
@@ -0,0 +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{padding-bottom:48rpx;padding-left:16rpx;padding-right:16rpx}.smart-calendar__month-title{font-size:var(--calendar-month-title-font-size,14px);font-weight:var(--font-weight-bold,500);height:var(--calendar-header-title-height,44px);line-height:var(--calendar-header-title-height,44px);text-align:center}.smart-calendar__days{display:flex;flex-wrap:wrap;position:relative;-webkit-user-select:none;user-select:none}.smart-calendar__month-mark{color:var(--calendar-month-mark-color,hsla(210,6%,87%,.6));font-size:var(--calendar-month-mark-font-size,160px);left:50%;pointer-events:none;position:absolute;top:50%;transform:translate(-50%,-50%);z-index:0}.smart-calendar__day,.smart-calendar__selected-day{align-items:center;display:flex;justify-content:center;text-align:center}.smart-calendar__day{color:var(--calendar-cell-item-font-color,var(--app-B4-N1,#000));font-size:var(--calendar-cell-item-font-size,15px);font-weight:var(--calendar-day-font-weight,500);height:var(--calendar-day-height,100rpx);margin:4px 0;position:relative;width:14.285%}.smart-calendar__day--end,.smart-calendar__day--multiple-middle,.smart-calendar__day--multiple-selected,.smart-calendar__day--start,.smart-calendar__day--start-end{background-color:var(--calendar-range-edge-background-color,#3678e3);color:var(--calendar-range-edge-color,#fff)}.smart-calendar__day--start{border-bottom-left-radius:var(--calendar-day-select-border-radius,34rpx);border-top-left-radius:var(--calendar-day-select-border-radius,34rpx)}.smart-calendar__day--end{border-bottom-right-radius:var(--calendar-day-select-border-radius,34rpx);border-top-right-radius:var(--calendar-day-select-border-radius,34rpx)}.smart-calendar__day--multiple-selected,.smart-calendar__day--start-end{border-radius:4px}.smart-calendar__day--middle{background-color:var(--calendar-range-edge-background-color,#3678e3);color:var(--calendar-range-middle-color,#fff)}.smart-calendar__day--disabled{color:var(--calendar-day-disabled-color,#c8c9cc);cursor:default}.smart-calendar__bottom-info,.smart-calendar__top-info{font-size:var(--calendar-info-font-size,10px);left:0;line-height:var(--calendar-info-line-height,14px);position:absolute;right:0}@media (max-width:350px){.smart-calendar__bottom-info,.smart-calendar__top-info{font-size:9px}}.smart-calendar__top-info{top:6px}.smart-calendar__bottom-info{bottom:6px}.smart-calendar__selected-day{background-color:var(--calendar-selected-day-background-color,#3678e3);border-radius:50%;color:var(--calendar-selected-day-color,#fff);height:var(--calendar-selected-day-size,34px);width:var(--calendar-selected-day-size,34px)}
@@ -0,0 +1 @@
1
+ @import '../common/index.css';.contain{margin:24rpx 0}.item{border-radius:var(--calendar-cell-item-border-radius,104rpx);color:var(--calendar-cell-item-font-color,var(--app-B4-N1,#000));font-size:var(--calendar-cell-item-font-size,15px);font-weight:var(--calendar-day-font-weight,500);height:var(--calendar-cell-item-height,104rpx);line-height:var(--calendar-cell-item-height,104rpx);text-align:center;width:var(--calendar-cell-item-width,104rpx)}.item_active{background:#3678e3;color:#fff}.item_disabled{opacity:.5}.col_item{display:flex;justify-content:center}
@@ -1,6 +1,6 @@
1
1
  // components/month-list.js
2
- import { getMonths } from '../../utils';
3
- import { SmartComponent } from '../../../common/component';
2
+ import { getMonths } from '../calendar-utils/utils';
3
+ import { SmartComponent } from '../common/component';
4
4
  const currentYear = new Date().getFullYear();
5
5
  const minMonthDate = new Date(currentYear - 10, 1, 1).getTime();
6
6
  const maxMonthDate = new Date(currentYear + 10, 12, 31).getTime();
@@ -0,0 +1,7 @@
1
+ {
2
+ "component": true,
3
+ "usingComponents": {
4
+ "smart-row": "../row/index",
5
+ "smart-col": "../col/index"
6
+ }
7
+ }
@@ -0,0 +1 @@
1
+ @import '../common/index.wxss';.contain{margin:24rpx 0}.item{border-radius:var(--calendar-cell-item-border-radius,104rpx);color:var(--calendar-cell-item-font-color,var(--app-B4-N1,#000));font-size:var(--calendar-cell-item-font-size,15px);font-weight:var(--calendar-day-font-weight,500);height:var(--calendar-cell-item-height,104rpx);line-height:var(--calendar-cell-item-height,104rpx);text-align:center;width:var(--calendar-cell-item-width,104rpx)}.item_active{background:#3678e3;color:#fff}.item_disabled{opacity:.5}.col_item{display:flex;justify-content:center}
@@ -3,4 +3,5 @@ export interface Day {
3
3
  type: string;
4
4
  text: number;
5
5
  bottomInfo?: string;
6
+ customClass?: string;
6
7
  }
@@ -0,0 +1 @@
1
+ @import '../common/index.css';.contain{margin:24rpx 0}.item{border-radius:var(--calendar-cell-item-border-radius,104rpx);color:var(--calendar-cell-item-font-color,var(--app-B4-N1,#000));font-size:var(--calendar-cell-item-font-size,15px);font-weight:var(--calendar-day-font-weight,500);height:var(--calendar-cell-item-height,104rpx);line-height:var(--calendar-cell-item-height,104rpx);text-align:center;width:var(--calendar-cell-item-width,104rpx)}.item_active{background:#3678e3;color:#fff}.item_disabled{opacity:.5}.col_item{display:flex;justify-content:center}
@@ -1,6 +1,6 @@
1
1
  // components/month-list.js
2
- import { getYears } from '../../utils';
3
- import { SmartComponent } from '../../../common/component';
2
+ import { getYears } from '../calendar-utils/utils';
3
+ import { SmartComponent } from '../common/component';
4
4
  SmartComponent({
5
5
  /**
6
6
  * 组件的属性列表
@@ -0,0 +1,7 @@
1
+ {
2
+ "component": true,
3
+ "usingComponents": {
4
+ "smart-row": "../row/index",
5
+ "smart-col": "../col/index"
6
+ }
7
+ }
@@ -0,0 +1 @@
1
+ @import '../common/index.wxss';.contain{margin:24rpx 0}.item{border-radius:var(--calendar-cell-item-border-radius,104rpx);color:var(--calendar-cell-item-font-color,var(--app-B4-N1,#000));font-size:var(--calendar-cell-item-font-size,15px);font-weight:var(--calendar-day-font-weight,500);height:var(--calendar-cell-item-height,104rpx);line-height:var(--calendar-cell-item-height,104rpx);text-align:center;width:var(--calendar-cell-item-width,104rpx)}.item_active{background:#3678e3;color:#fff}.item_disabled{opacity:.5}.col_item{display:flex;justify-content:center}
@@ -21,7 +21,7 @@
21
21
  </header>
22
22
 
23
23
  <block wx:if="{{ type !== 'year' && type !== 'month' }}">
24
- <view class="smart-calendar-month_wrap" wx:for="{{ months }}" wx:key="index">
24
+ <block wx:for="{{ months }}" wx:key="index">
25
25
  <month
26
26
  id="month{{ index }}"
27
27
  class="smart-calendar-month month"
@@ -45,8 +45,9 @@
45
45
  showMonthTitle="{{ index !== 0 || !showSubtitle }}"
46
46
  firstDayOfWeek="{{ firstDayOfWeek }}"
47
47
  bind:click="onClickDay"
48
+ dayClassMap="{{dayClassMap}}"
48
49
  />
49
- </view>
50
+ </block>
50
51
  </block>
51
52
 
52
53
  <block wx:if="{{type === 'month'}}">
@@ -73,10 +74,4 @@
73
74
  readonly="{{readonly}}"
74
75
  />
75
76
  </block>
76
-
77
- <view
78
- class="{{ utils.bem('calendar__footer', { safeAreaInsetBottom }) }}"
79
- >
80
- <slot name="footer"></slot>
81
- </view>
82
77
  </view>
@@ -63,6 +63,9 @@ var component_1 = require("../../common/component");
63
63
  ]
64
64
  },
65
65
  showDayPicker: false,
66
+ dayClassMap: {
67
+ '2024-01-20': "bottom-point"
68
+ }
66
69
  },
67
70
  methods: {
68
71
  setCurDay: function (event) {
@@ -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: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}
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:0rpx}.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}
@@ -13,7 +13,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
15
  var component_1 = require("../common/component");
16
- var utils_1 = require("./utils");
16
+ var utils_1 = require("../calendar-utils/utils");
17
17
  var toast_1 = __importDefault(require("../toast/toast"));
18
18
  var dateEdge = (0, utils_1.getInitEdgeDate)('year');
19
19
  var getTime = function (date) { return (date instanceof Date ? date.getTime() : date); };
@@ -149,6 +149,9 @@ var getTime = function (date) { return (date instanceof Date ? date.getTime() :
149
149
  type: Boolean,
150
150
  value: false,
151
151
  },
152
+ dayClassMap: {
153
+ type: null,
154
+ },
152
155
  },
153
156
  data: {
154
157
  subtitle: '',
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "component": true,
3
3
  "usingComponents": {
4
- "header": "./components/header/index",
5
- "month": "./components/month/index",
6
- "month-list": "./components/month-list/index",
7
- "year-list": "./components/year-list/index",
4
+ "header": "../calendar-header/index",
5
+ "month": "../calendar-month/index",
6
+ "month-list": "../calendar-month-list/index",
7
+ "year-list": "../calendar-year-list/index",
8
8
  "smart-button": "../button/index",
9
9
  "smart-popup": "../popup/index",
10
10
  "smart-toast": "../toast/index"
@@ -1,5 +1,5 @@
1
1
  /* eslint-disable */
2
- var utils = require('./utils.wxs');
2
+ var utils = require('../calendar-utils/utils.wxs');
3
3
 
4
4
  function getMonths(minDate, maxDate) {
5
5
  var months = [];
@@ -36,13 +36,15 @@ function getVisible(visibleIndex, curIndex) {
36
36
  }
37
37
 
38
38
  function formatMonthTitle(date, formatter = 'YYYY-MM') {
39
+ if (!date) return '';
39
40
  date = getDate(date);
40
41
  const year = date.getFullYear();
41
- const month = date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1 + "";
42
+ const month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1 + '';
42
43
  return formatter.replace('YYYY', year + '').replace('MM', month);
43
44
  }
44
45
 
45
46
  function formatYearTitle(date, offset, formatter = 'YYYY') {
47
+ if (!date) return '';
46
48
  date = getDate(date);
47
49
  const year = date.getFullYear();
48
50
  return formatter.replace('YYYY', year + '');
@@ -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: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}
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:0rpx}.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}
@@ -0,0 +1 @@
1
+ @import '../common/index.css';.smart-calendar__header{flex-shrink:0}.smart-calendar__header-title{position:relative}.smart-calendar__header-title-save{color:var(--calendar-header-title-save-color,#1989fa);font-size:16px;font-weight:400;letter-spacing:0;line-height:24px;position:absolute;right:48rpx;text-align:right;top:50%;transform:translateY(-50%)}.smart-calendar__header-subtitle,.smart-calendar__header-title{color:var(--calendar-header-title-font-color,var(--app-B4-N1,#000));font-size:16px;font-weight:var(--font-weight-bold,500);height:var(--calendar-header-title-height,44px);line-height:var(--calendar-header-title-height,44px);text-align:center}.smart-calendar__header-subtitle_wrap{align-items:center;display:flex;justify-content:center;position:relative}.smart-calendar__header-subtitle_left{align-items:center;background:var(--calendar-header-icon-bg-color,var(--app-B2-N9,rgba(0,0,0,.05)));border-radius:50%;display:flex;height:48rpx;justify-content:center;left:52rpx;position:absolute;top:50%;transform:translateY(-50%);width:48rpx}.smart-calendar__header-subtitle_left_icon{left:-1px;position:relative}.smart-calendar__header-subtitle_right{align-items:center;background:var(--calendar-header-icon-bg-color,var(--app-B2-N9,rgba(0,0,0,.05)));border-radius:50%;display:flex;height:48rpx;justify-content:center;position:absolute;right:52rpx;top:50%;transform:translateY(-50%);width:48rpx}.smart-calendar__header-subtitle_right_icon{position:relative;right:-1px}.smart-calendar__header-title+.smart-calendar__header-title,.smart-calendar__header-title:empty{display:none}.smart-calendar__header-title:empty+.smart-calendar__header-title{display:block!important}.smart-calendar__weekdays{display:flex;margin-bottom:16rpx;margin-top:16rpx;padding-left:16rpx;padding-right:16rpx}.smart-calendar__weekday{color:var(--calendar-weekdays-font-color,var(--app-B4-N1,#000));flex:1;font-size:var(--calendar-weekdays-font-size,12px);font-weight:500;line-height:var(--calendar-weekdays-height,30px);opacity:.5;text-align:center}
@@ -12,7 +12,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
12
12
  return (mod && mod.__esModule) ? mod : { "default": mod };
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
- var component_1 = require("../../../common/component");
15
+ var component_1 = require("../common/component");
16
16
  var Left_1 = __importDefault(require("@tuya-miniapp/icons/dist/svg/Left"));
17
17
  var Right_1 = __importDefault(require("@tuya-miniapp/icons/dist/svg/Right"));
18
18
  (0, component_1.SmartComponent)({
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "component": true,
3
3
  "usingComponents": {
4
- "smart-icon": "../../../icon/index"
4
+ "smart-icon": "../icon/index"
5
5
  }
6
6
  }
@@ -0,0 +1 @@
1
+ @import '../common/index.wxss';.smart-calendar__header{flex-shrink:0}.smart-calendar__header-title{position:relative}.smart-calendar__header-title-save{color:var(--calendar-header-title-save-color,#1989fa);font-size:16px;font-weight:400;letter-spacing:0;line-height:24px;position:absolute;right:48rpx;text-align:right;top:50%;transform:translateY(-50%)}.smart-calendar__header-subtitle,.smart-calendar__header-title{color:var(--calendar-header-title-font-color,var(--app-B4-N1,#000));font-size:16px;font-weight:var(--font-weight-bold,500);height:var(--calendar-header-title-height,44px);line-height:var(--calendar-header-title-height,44px);text-align:center}.smart-calendar__header-subtitle_wrap{align-items:center;display:flex;justify-content:center;position:relative}.smart-calendar__header-subtitle_left{align-items:center;background:var(--calendar-header-icon-bg-color,var(--app-B2-N9,rgba(0,0,0,.05)));border-radius:50%;display:flex;height:48rpx;justify-content:center;left:52rpx;position:absolute;top:50%;transform:translateY(-50%);width:48rpx}.smart-calendar__header-subtitle_left_icon{left:-1px;position:relative}.smart-calendar__header-subtitle_right{align-items:center;background:var(--calendar-header-icon-bg-color,var(--app-B2-N9,rgba(0,0,0,.05)));border-radius:50%;display:flex;height:48rpx;justify-content:center;position:absolute;right:52rpx;top:50%;transform:translateY(-50%);width:48rpx}.smart-calendar__header-subtitle_right_icon{position:relative;right:-1px}.smart-calendar__header-title+.smart-calendar__header-title,.smart-calendar__header-title:empty{display:none}.smart-calendar__header-title:empty+.smart-calendar__header-title{display:block!important}.smart-calendar__weekdays{display:flex;margin-bottom:16rpx;margin-top:16rpx;padding-left:16rpx;padding-right:16rpx}.smart-calendar__weekday{color:var(--calendar-weekdays-font-color,var(--app-B4-N1,#000));flex:1;font-size:var(--calendar-weekdays-font-size,12px);font-weight:500;line-height:var(--calendar-weekdays-height,30px);opacity:.5;text-align:center}
@@ -0,0 +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{padding-bottom:48rpx;padding-left:16rpx;padding-right:16rpx}.smart-calendar__month-title{font-size:var(--calendar-month-title-font-size,14px);font-weight:var(--font-weight-bold,500);height:var(--calendar-header-title-height,44px);line-height:var(--calendar-header-title-height,44px);text-align:center}.smart-calendar__days{display:flex;flex-wrap:wrap;position:relative;-webkit-user-select:none;user-select:none}.smart-calendar__month-mark{color:var(--calendar-month-mark-color,hsla(210,6%,87%,.6));font-size:var(--calendar-month-mark-font-size,160px);left:50%;pointer-events:none;position:absolute;top:50%;transform:translate(-50%,-50%);z-index:0}.smart-calendar__day,.smart-calendar__selected-day{align-items:center;display:flex;justify-content:center;text-align:center}.smart-calendar__day{color:var(--calendar-cell-item-font-color,var(--app-B4-N1,#000));font-size:var(--calendar-cell-item-font-size,15px);font-weight:var(--calendar-day-font-weight,500);height:var(--calendar-day-height,100rpx);margin:4px 0;position:relative;width:14.285%}.smart-calendar__day--end,.smart-calendar__day--multiple-middle,.smart-calendar__day--multiple-selected,.smart-calendar__day--start,.smart-calendar__day--start-end{background-color:var(--calendar-range-edge-background-color,#3678e3);color:var(--calendar-range-edge-color,#fff)}.smart-calendar__day--start{border-bottom-left-radius:var(--calendar-day-select-border-radius,34rpx);border-top-left-radius:var(--calendar-day-select-border-radius,34rpx)}.smart-calendar__day--end{border-bottom-right-radius:var(--calendar-day-select-border-radius,34rpx);border-top-right-radius:var(--calendar-day-select-border-radius,34rpx)}.smart-calendar__day--multiple-selected,.smart-calendar__day--start-end{border-radius:4px}.smart-calendar__day--middle{background-color:var(--calendar-range-edge-background-color,#3678e3);color:var(--calendar-range-middle-color,#fff)}.smart-calendar__day--disabled{color:var(--calendar-day-disabled-color,#c8c9cc);cursor:default}.smart-calendar__bottom-info,.smart-calendar__top-info{font-size:var(--calendar-info-font-size,10px);left:0;line-height:var(--calendar-info-line-height,14px);position:absolute;right:0}@media (max-width:350px){.smart-calendar__bottom-info,.smart-calendar__top-info{font-size:9px}}.smart-calendar__top-info{top:6px}.smart-calendar__bottom-info{bottom:6px}.smart-calendar__selected-day{background-color:var(--calendar-selected-day-background-color,#3678e3);border-radius:50%;color:var(--calendar-selected-day-color,#fff);height:var(--calendar-selected-day-size,34px);width:var(--calendar-selected-day-size,34px)}
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- var component_1 = require("../../../common/component");
4
- var utils_1 = require("../../utils");
3
+ var component_1 = require("../common/component");
4
+ var utils_1 = require("../calendar-utils/utils");
5
5
  (0, component_1.SmartComponent)({
6
6
  props: {
7
7
  date: {
@@ -45,6 +45,9 @@ var utils_1 = require("../../utils");
45
45
  allowSameDay: Boolean,
46
46
  showSubtitle: Boolean,
47
47
  showMonthTitle: Boolean,
48
+ dayClassMap: {
49
+ type: null,
50
+ },
48
51
  },
49
52
  data: {
50
53
  days: [],
@@ -66,12 +69,23 @@ var utils_1 = require("../../utils");
66
69
  for (var day = 1; day <= totalDay; day++) {
67
70
  var date = new Date(year, month, day);
68
71
  var type = this.getDayType(date);
72
+ var dayClassMap = this.data.dayClassMap;
69
73
  var config = {
70
74
  date: date,
71
75
  type: type,
72
76
  text: day,
73
77
  bottomInfo: this.getBottomInfo(type),
74
78
  };
79
+ if (dayClassMap) {
80
+ var id = "".concat(year, "-").concat(month + 1, "-").concat(day);
81
+ var id2 = "".concat(String(year), "-").concat(String(month + 1).padStart(2, '0'), "-").concat(String(day).padStart(2, '0'));
82
+ if (dayClassMap[id]) {
83
+ config.customClass = dayClassMap[id];
84
+ }
85
+ if (dayClassMap[id2]) {
86
+ config.customClass = dayClassMap[id2];
87
+ }
88
+ }
75
89
  if (this.data.formatter) {
76
90
  config = this.data.formatter(config);
77
91
  }
@@ -1,23 +1,20 @@
1
1
  <wxs src="./index.wxs" module="computed"></wxs>
2
- <wxs src="../../../wxs/utils.wxs" module="utils" />
2
+ <wxs src="../wxs/utils.wxs" module="utils" />
3
3
 
4
4
  <view class="smart-calendar__month" style="{{ computed.getMonthStyle(visible, date, rowHeight) }}">
5
5
  <view wx:if="{{ visible }}" class="smart-calendar__days">
6
-
7
6
  <view
8
7
  wx:for="{{ days }}"
9
8
  wx:key="index"
10
9
  style="{{ computed.getDayStyle(item.type, index, date, rowHeight, color, firstDayOfWeek) }}"
11
- class="{{ utils.bem('calendar__day', [item.type]) }} {{ item.className }}"
10
+ class="{{ utils.bem('calendar__day', [item.type]) }} {{ item.className }} {{ item.customClass }}"
12
11
  data-index="{{ index }}"
13
12
  bindtap="onClick"
14
13
  >
15
14
  <view wx:if="{{ item.type === 'selected' }}" class="smart-calendar__selected-day" style="width: {{ rowHeight }}px; height: {{ rowHeight }}px; background: {{ color }}">
16
- <view wx:if="{{ item.topInfo }}" class="smart-calendar__top-info">{{ item.topInfo }}</view>
17
15
  {{ item.text }}
18
16
  </view>
19
17
  <block wx:else>
20
- <view wx:if="{{ item.topInfo }}" class="smart-calendar__top-info">{{ item.topInfo }}</view>
21
18
  {{ item.text }}
22
19
  </block>
23
20
  </view>
@@ -1,5 +1,5 @@
1
1
  /* eslint-disable */
2
- var utils = require('../../utils.wxs');
2
+ var utils = require('../calendar-utils/utils.wxs');
3
3
 
4
4
  function getMark(date) {
5
5
  return getDate(date).getMonth() + 1;
@@ -0,0 +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{padding-bottom:48rpx;padding-left:16rpx;padding-right:16rpx}.smart-calendar__month-title{font-size:var(--calendar-month-title-font-size,14px);font-weight:var(--font-weight-bold,500);height:var(--calendar-header-title-height,44px);line-height:var(--calendar-header-title-height,44px);text-align:center}.smart-calendar__days{display:flex;flex-wrap:wrap;position:relative;-webkit-user-select:none;user-select:none}.smart-calendar__month-mark{color:var(--calendar-month-mark-color,hsla(210,6%,87%,.6));font-size:var(--calendar-month-mark-font-size,160px);left:50%;pointer-events:none;position:absolute;top:50%;transform:translate(-50%,-50%);z-index:0}.smart-calendar__day,.smart-calendar__selected-day{align-items:center;display:flex;justify-content:center;text-align:center}.smart-calendar__day{color:var(--calendar-cell-item-font-color,var(--app-B4-N1,#000));font-size:var(--calendar-cell-item-font-size,15px);font-weight:var(--calendar-day-font-weight,500);height:var(--calendar-day-height,100rpx);margin:4px 0;position:relative;width:14.285%}.smart-calendar__day--end,.smart-calendar__day--multiple-middle,.smart-calendar__day--multiple-selected,.smart-calendar__day--start,.smart-calendar__day--start-end{background-color:var(--calendar-range-edge-background-color,#3678e3);color:var(--calendar-range-edge-color,#fff)}.smart-calendar__day--start{border-bottom-left-radius:var(--calendar-day-select-border-radius,34rpx);border-top-left-radius:var(--calendar-day-select-border-radius,34rpx)}.smart-calendar__day--end{border-bottom-right-radius:var(--calendar-day-select-border-radius,34rpx);border-top-right-radius:var(--calendar-day-select-border-radius,34rpx)}.smart-calendar__day--multiple-selected,.smart-calendar__day--start-end{border-radius:4px}.smart-calendar__day--middle{background-color:var(--calendar-range-edge-background-color,#3678e3);color:var(--calendar-range-middle-color,#fff)}.smart-calendar__day--disabled{color:var(--calendar-day-disabled-color,#c8c9cc);cursor:default}.smart-calendar__bottom-info,.smart-calendar__top-info{font-size:var(--calendar-info-font-size,10px);left:0;line-height:var(--calendar-info-line-height,14px);position:absolute;right:0}@media (max-width:350px){.smart-calendar__bottom-info,.smart-calendar__top-info{font-size:9px}}.smart-calendar__top-info{top:6px}.smart-calendar__bottom-info{bottom:6px}.smart-calendar__selected-day{background-color:var(--calendar-selected-day-background-color,#3678e3);border-radius:50%;color:var(--calendar-selected-day-color,#fff);height:var(--calendar-selected-day-size,34px);width:var(--calendar-selected-day-size,34px)}
@@ -0,0 +1 @@
1
+ @import '../common/index.css';.contain{margin:24rpx 0}.item{border-radius:var(--calendar-cell-item-border-radius,104rpx);color:var(--calendar-cell-item-font-color,var(--app-B4-N1,#000));font-size:var(--calendar-cell-item-font-size,15px);font-weight:var(--calendar-day-font-weight,500);height:var(--calendar-cell-item-height,104rpx);line-height:var(--calendar-cell-item-height,104rpx);text-align:center;width:var(--calendar-cell-item-width,104rpx)}.item_active{background:#3678e3;color:#fff}.item_disabled{opacity:.5}.col_item{display:flex;justify-content:center}
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  // components/month-list.js
4
- var utils_1 = require("../../utils");
5
- var component_1 = require("../../../common/component");
4
+ var utils_1 = require("../calendar-utils/utils");
5
+ var component_1 = require("../common/component");
6
6
  var currentYear = new Date().getFullYear();
7
7
  var minMonthDate = new Date(currentYear - 10, 1, 1).getTime();
8
8
  var maxMonthDate = new Date(currentYear + 10, 12, 31).getTime();
@@ -0,0 +1,7 @@
1
+ {
2
+ "component": true,
3
+ "usingComponents": {
4
+ "smart-row": "../row/index",
5
+ "smart-col": "../col/index"
6
+ }
7
+ }
@@ -0,0 +1 @@
1
+ @import '../common/index.wxss';.contain{margin:24rpx 0}.item{border-radius:var(--calendar-cell-item-border-radius,104rpx);color:var(--calendar-cell-item-font-color,var(--app-B4-N1,#000));font-size:var(--calendar-cell-item-font-size,15px);font-weight:var(--calendar-day-font-weight,500);height:var(--calendar-cell-item-height,104rpx);line-height:var(--calendar-cell-item-height,104rpx);text-align:center;width:var(--calendar-cell-item-width,104rpx)}.item_active{background:#3678e3;color:#fff}.item_disabled{opacity:.5}.col_item{display:flex;justify-content:center}
@@ -3,4 +3,5 @@ export interface Day {
3
3
  type: string;
4
4
  text: number;
5
5
  bottomInfo?: string;
6
+ customClass?: string;
6
7
  }
@@ -0,0 +1 @@
1
+ @import '../common/index.css';.contain{margin:24rpx 0}.item{border-radius:var(--calendar-cell-item-border-radius,104rpx);color:var(--calendar-cell-item-font-color,var(--app-B4-N1,#000));font-size:var(--calendar-cell-item-font-size,15px);font-weight:var(--calendar-day-font-weight,500);height:var(--calendar-cell-item-height,104rpx);line-height:var(--calendar-cell-item-height,104rpx);text-align:center;width:var(--calendar-cell-item-width,104rpx)}.item_active{background:#3678e3;color:#fff}.item_disabled{opacity:.5}.col_item{display:flex;justify-content:center}
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  // components/month-list.js
4
- var utils_1 = require("../../utils");
5
- var component_1 = require("../../../common/component");
4
+ var utils_1 = require("../calendar-utils/utils");
5
+ var component_1 = require("../common/component");
6
6
  (0, component_1.SmartComponent)({
7
7
  /**
8
8
  * 组件的属性列表
@@ -0,0 +1,7 @@
1
+ {
2
+ "component": true,
3
+ "usingComponents": {
4
+ "smart-row": "../row/index",
5
+ "smart-col": "../col/index"
6
+ }
7
+ }
@@ -0,0 +1 @@
1
+ @import '../common/index.wxss';.contain{margin:24rpx 0}.item{border-radius:var(--calendar-cell-item-border-radius,104rpx);color:var(--calendar-cell-item-font-color,var(--app-B4-N1,#000));font-size:var(--calendar-cell-item-font-size,15px);font-weight:var(--calendar-day-font-weight,500);height:var(--calendar-cell-item-height,104rpx);line-height:var(--calendar-cell-item-height,104rpx);text-align:center;width:var(--calendar-cell-item-width,104rpx)}.item_active{background:#3678e3;color:#fff}.item_disabled{opacity:.5}.col_item{display:flex;justify-content:center}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tuya-miniapp/smart-ui",
3
- "version": "2.0.2-beta-10",
3
+ "version": "2.0.2-beta-11",
4
4
  "author": "MiniApp Team",
5
5
  "license": "MIT",
6
6
  "miniprogram": "lib",
@@ -1 +0,0 @@
1
- @import '../../../common/index.css';.smart-calendar__header{flex-shrink:0}.smart-calendar__header-title{position:relative}.smart-calendar__header-title-save{color:var(--calendar-header-title-save-color,#1989fa);font-size:16px;font-weight:400;letter-spacing:0;line-height:24px;position:absolute;right:48rpx;text-align:right;top:50%;transform:translateY(-50%)}.smart-calendar__header-subtitle,.smart-calendar__header-title{color:var(--calendar-header-title-font-color,var(--app-B4-N1,#000));font-size:16px;font-weight:var(--font-weight-bold,500);height:var(--calendar-header-title-height,44px);line-height:var(--calendar-header-title-height,44px);text-align:center}.smart-calendar__header-subtitle_wrap{align-items:center;display:flex;justify-content:center;position:relative}.smart-calendar__header-subtitle_left{align-items:center;background:var(--calendar-header-icon-bg-color,var(--app-B2-N9,rgba(0,0,0,.05)));border-radius:50%;display:flex;height:48rpx;justify-content:center;left:52rpx;position:absolute;top:50%;transform:translateY(-50%);width:48rpx}.smart-calendar__header-subtitle_left_icon{left:-1px;position:relative}.smart-calendar__header-subtitle_right{align-items:center;background:var(--calendar-header-icon-bg-color,var(--app-B2-N9,rgba(0,0,0,.05)));border-radius:50%;display:flex;height:48rpx;justify-content:center;position:absolute;right:52rpx;top:50%;transform:translateY(-50%);width:48rpx}.smart-calendar__header-subtitle_right_icon{position:relative;right:-1px}.smart-calendar__header-title+.smart-calendar__header-title,.smart-calendar__header-title:empty{display:none}.smart-calendar__header-title:empty+.smart-calendar__header-title{display:block!important}.smart-calendar__weekdays{display:flex;margin-bottom:16rpx;margin-top:16rpx;padding-left:16rpx;padding-right:16rpx}.smart-calendar__weekday{color:var(--calendar-weekdays-font-color,var(--app-B4-N1,#000));flex:1;font-size:var(--calendar-weekdays-font-size,12px);font-weight:500;line-height:var(--calendar-weekdays-height,30px);opacity:.5;text-align:center}
@@ -1 +0,0 @@
1
- @import '../../../common/index.wxss';.smart-calendar__header{flex-shrink:0}.smart-calendar__header-title{position:relative}.smart-calendar__header-title-save{color:var(--calendar-header-title-save-color,#1989fa);font-size:16px;font-weight:400;letter-spacing:0;line-height:24px;position:absolute;right:48rpx;text-align:right;top:50%;transform:translateY(-50%)}.smart-calendar__header-subtitle,.smart-calendar__header-title{color:var(--calendar-header-title-font-color,var(--app-B4-N1,#000));font-size:16px;font-weight:var(--font-weight-bold,500);height:var(--calendar-header-title-height,44px);line-height:var(--calendar-header-title-height,44px);text-align:center}.smart-calendar__header-subtitle_wrap{align-items:center;display:flex;justify-content:center;position:relative}.smart-calendar__header-subtitle_left{align-items:center;background:var(--calendar-header-icon-bg-color,var(--app-B2-N9,rgba(0,0,0,.05)));border-radius:50%;display:flex;height:48rpx;justify-content:center;left:52rpx;position:absolute;top:50%;transform:translateY(-50%);width:48rpx}.smart-calendar__header-subtitle_left_icon{left:-1px;position:relative}.smart-calendar__header-subtitle_right{align-items:center;background:var(--calendar-header-icon-bg-color,var(--app-B2-N9,rgba(0,0,0,.05)));border-radius:50%;display:flex;height:48rpx;justify-content:center;position:absolute;right:52rpx;top:50%;transform:translateY(-50%);width:48rpx}.smart-calendar__header-subtitle_right_icon{position:relative;right:-1px}.smart-calendar__header-title+.smart-calendar__header-title,.smart-calendar__header-title:empty{display:none}.smart-calendar__header-title:empty+.smart-calendar__header-title{display:block!important}.smart-calendar__weekdays{display:flex;margin-bottom:16rpx;margin-top:16rpx;padding-left:16rpx;padding-right:16rpx}.smart-calendar__weekday{color:var(--calendar-weekdays-font-color,var(--app-B4-N1,#000));flex:1;font-size:var(--calendar-weekdays-font-size,12px);font-weight:500;line-height:var(--calendar-weekdays-height,30px);opacity:.5;text-align:center}
@@ -1 +0,0 @@
1
- @import '../../../common/index.css';.smart-calendar{background-color:var(--calendar-background-color,var(--app-B6,#fff));display:flex;flex-direction:column;height:100%}.smart-calendar__month{padding-bottom:48rpx;padding-left:16rpx;padding-right:16rpx}.smart-calendar__month-title{font-size:var(--calendar-month-title-font-size,14px);font-weight:var(--font-weight-bold,500);height:var(--calendar-header-title-height,44px);line-height:var(--calendar-header-title-height,44px);text-align:center}.smart-calendar__days{display:flex;flex-wrap:wrap;position:relative;-webkit-user-select:none;user-select:none}.smart-calendar__month-mark{color:var(--calendar-month-mark-color,hsla(210,6%,87%,.6));font-size:var(--calendar-month-mark-font-size,160px);left:50%;pointer-events:none;position:absolute;top:50%;transform:translate(-50%,-50%);z-index:0}.smart-calendar__day,.smart-calendar__selected-day{align-items:center;display:flex;justify-content:center;text-align:center}.smart-calendar__day{color:var(--calendar-cell-item-font-color,var(--app-B4-N1,#000));font-size:var(--calendar-cell-item-font-size,15px);font-weight:var(--calendar-day-font-weight,500);height:var(--calendar-day-height,100rpx);margin:4px 0;position:relative;width:14.285%}.smart-calendar__day--end,.smart-calendar__day--multiple-middle,.smart-calendar__day--multiple-selected,.smart-calendar__day--start,.smart-calendar__day--start-end{background-color:var(--calendar-range-edge-background-color,#3678e3);color:var(--calendar-range-edge-color,#fff)}.smart-calendar__day--start{border-bottom-left-radius:var(--calendar-day-select-border-radius,34rpx);border-top-left-radius:var(--calendar-day-select-border-radius,34rpx)}.smart-calendar__day--end{border-bottom-right-radius:var(--calendar-day-select-border-radius,34rpx);border-top-right-radius:var(--calendar-day-select-border-radius,34rpx)}.smart-calendar__day--multiple-selected,.smart-calendar__day--start-end{border-radius:4px}.smart-calendar__day--middle{background-color:var(--calendar-range-edge-background-color,#3678e3);color:var(--calendar-range-middle-color,#fff)}.smart-calendar__day--disabled{color:var(--calendar-day-disabled-color,#c8c9cc);cursor:default}.smart-calendar__bottom-info,.smart-calendar__top-info{font-size:var(--calendar-info-font-size,10px);left:0;line-height:var(--calendar-info-line-height,14px);position:absolute;right:0}@media (max-width:350px){.smart-calendar__bottom-info,.smart-calendar__top-info{font-size:9px}}.smart-calendar__top-info{top:6px}.smart-calendar__bottom-info{bottom:6px}.smart-calendar__selected-day{background-color:var(--calendar-selected-day-background-color,#3678e3);border-radius:50%;color:var(--calendar-selected-day-color,#fff);height:var(--calendar-selected-day-size,34px);width:var(--calendar-selected-day-size,34px)}
@@ -1 +0,0 @@
1
- @import '../../../common/index.wxss';.smart-calendar{background-color:var(--calendar-background-color,var(--app-B6,#fff));display:flex;flex-direction:column;height:100%}.smart-calendar__month{padding-bottom:48rpx;padding-left:16rpx;padding-right:16rpx}.smart-calendar__month-title{font-size:var(--calendar-month-title-font-size,14px);font-weight:var(--font-weight-bold,500);height:var(--calendar-header-title-height,44px);line-height:var(--calendar-header-title-height,44px);text-align:center}.smart-calendar__days{display:flex;flex-wrap:wrap;position:relative;-webkit-user-select:none;user-select:none}.smart-calendar__month-mark{color:var(--calendar-month-mark-color,hsla(210,6%,87%,.6));font-size:var(--calendar-month-mark-font-size,160px);left:50%;pointer-events:none;position:absolute;top:50%;transform:translate(-50%,-50%);z-index:0}.smart-calendar__day,.smart-calendar__selected-day{align-items:center;display:flex;justify-content:center;text-align:center}.smart-calendar__day{color:var(--calendar-cell-item-font-color,var(--app-B4-N1,#000));font-size:var(--calendar-cell-item-font-size,15px);font-weight:var(--calendar-day-font-weight,500);height:var(--calendar-day-height,100rpx);margin:4px 0;position:relative;width:14.285%}.smart-calendar__day--end,.smart-calendar__day--multiple-middle,.smart-calendar__day--multiple-selected,.smart-calendar__day--start,.smart-calendar__day--start-end{background-color:var(--calendar-range-edge-background-color,#3678e3);color:var(--calendar-range-edge-color,#fff)}.smart-calendar__day--start{border-bottom-left-radius:var(--calendar-day-select-border-radius,34rpx);border-top-left-radius:var(--calendar-day-select-border-radius,34rpx)}.smart-calendar__day--end{border-bottom-right-radius:var(--calendar-day-select-border-radius,34rpx);border-top-right-radius:var(--calendar-day-select-border-radius,34rpx)}.smart-calendar__day--multiple-selected,.smart-calendar__day--start-end{border-radius:4px}.smart-calendar__day--middle{background-color:var(--calendar-range-edge-background-color,#3678e3);color:var(--calendar-range-middle-color,#fff)}.smart-calendar__day--disabled{color:var(--calendar-day-disabled-color,#c8c9cc);cursor:default}.smart-calendar__bottom-info,.smart-calendar__top-info{font-size:var(--calendar-info-font-size,10px);left:0;line-height:var(--calendar-info-line-height,14px);position:absolute;right:0}@media (max-width:350px){.smart-calendar__bottom-info,.smart-calendar__top-info{font-size:9px}}.smart-calendar__top-info{top:6px}.smart-calendar__bottom-info{bottom:6px}.smart-calendar__selected-day{background-color:var(--calendar-selected-day-background-color,#3678e3);border-radius:50%;color:var(--calendar-selected-day-color,#fff);height:var(--calendar-selected-day-size,34px);width:var(--calendar-selected-day-size,34px)}
@@ -1 +0,0 @@
1
- @import '../../../common/index.css';.contain{margin:24rpx 0}.item{border-radius:var(--calendar-cell-item-border-radius,104rpx);color:var(--calendar-cell-item-font-color,var(--app-B4-N1,#000));font-size:var(--calendar-cell-item-font-size,15px);font-weight:var(--calendar-day-font-weight,500);height:var(--calendar-cell-item-height,104rpx);line-height:var(--calendar-cell-item-height,104rpx);text-align:center;width:var(--calendar-cell-item-width,104rpx)}.item_active{background:#3678e3;color:#fff}.item_disabled{opacity:.5}.col_item{display:flex;justify-content:center}
@@ -1,7 +0,0 @@
1
- {
2
- "component": true,
3
- "usingComponents": {
4
- "smart-row": "../../../row/index",
5
- "smart-col": "../../../col/index"
6
- }
7
- }
@@ -1 +0,0 @@
1
- @import '../../../common/index.wxss';.contain{margin:24rpx 0}.item{border-radius:var(--calendar-cell-item-border-radius,104rpx);color:var(--calendar-cell-item-font-color,var(--app-B4-N1,#000));font-size:var(--calendar-cell-item-font-size,15px);font-weight:var(--calendar-day-font-weight,500);height:var(--calendar-cell-item-height,104rpx);line-height:var(--calendar-cell-item-height,104rpx);text-align:center;width:var(--calendar-cell-item-width,104rpx)}.item_active{background:#3678e3;color:#fff}.item_disabled{opacity:.5}.col_item{display:flex;justify-content:center}
@@ -1 +0,0 @@
1
- @import '../../../common/index.css';.contain{margin:24rpx 0}.item{border-radius:var(--calendar-cell-item-border-radius,104rpx);color:var(--calendar-cell-item-font-color,var(--app-B4-N1,#000));font-size:var(--calendar-cell-item-font-size,15px);font-weight:var(--calendar-day-font-weight,500);height:var(--calendar-cell-item-height,104rpx);line-height:var(--calendar-cell-item-height,104rpx);text-align:center;width:var(--calendar-cell-item-width,104rpx)}.item_active{background:#3678e3;color:#fff}.item_disabled{opacity:.5}.col_item{display:flex;justify-content:center}
@@ -1,7 +0,0 @@
1
- {
2
- "component": true,
3
- "usingComponents": {
4
- "smart-row": "../../../row/index",
5
- "smart-col": "../../../col/index"
6
- }
7
- }
@@ -1 +0,0 @@
1
- @import '../../../common/index.wxss';.contain{margin:24rpx 0}.item{border-radius:var(--calendar-cell-item-border-radius,104rpx);color:var(--calendar-cell-item-font-color,var(--app-B4-N1,#000));font-size:var(--calendar-cell-item-font-size,15px);font-weight:var(--calendar-day-font-weight,500);height:var(--calendar-cell-item-height,104rpx);line-height:var(--calendar-cell-item-height,104rpx);text-align:center;width:var(--calendar-cell-item-width,104rpx)}.item_active{background:#3678e3;color:#fff}.item_disabled{opacity:.5}.col_item{display:flex;justify-content:center}
@@ -1 +0,0 @@
1
- @import '../../../common/index.css';.smart-calendar__header{flex-shrink:0}.smart-calendar__header-title{position:relative}.smart-calendar__header-title-save{color:var(--calendar-header-title-save-color,#1989fa);font-size:16px;font-weight:400;letter-spacing:0;line-height:24px;position:absolute;right:48rpx;text-align:right;top:50%;transform:translateY(-50%)}.smart-calendar__header-subtitle,.smart-calendar__header-title{color:var(--calendar-header-title-font-color,var(--app-B4-N1,#000));font-size:16px;font-weight:var(--font-weight-bold,500);height:var(--calendar-header-title-height,44px);line-height:var(--calendar-header-title-height,44px);text-align:center}.smart-calendar__header-subtitle_wrap{align-items:center;display:flex;justify-content:center;position:relative}.smart-calendar__header-subtitle_left{align-items:center;background:var(--calendar-header-icon-bg-color,var(--app-B2-N9,rgba(0,0,0,.05)));border-radius:50%;display:flex;height:48rpx;justify-content:center;left:52rpx;position:absolute;top:50%;transform:translateY(-50%);width:48rpx}.smart-calendar__header-subtitle_left_icon{left:-1px;position:relative}.smart-calendar__header-subtitle_right{align-items:center;background:var(--calendar-header-icon-bg-color,var(--app-B2-N9,rgba(0,0,0,.05)));border-radius:50%;display:flex;height:48rpx;justify-content:center;position:absolute;right:52rpx;top:50%;transform:translateY(-50%);width:48rpx}.smart-calendar__header-subtitle_right_icon{position:relative;right:-1px}.smart-calendar__header-title+.smart-calendar__header-title,.smart-calendar__header-title:empty{display:none}.smart-calendar__header-title:empty+.smart-calendar__header-title{display:block!important}.smart-calendar__weekdays{display:flex;margin-bottom:16rpx;margin-top:16rpx;padding-left:16rpx;padding-right:16rpx}.smart-calendar__weekday{color:var(--calendar-weekdays-font-color,var(--app-B4-N1,#000));flex:1;font-size:var(--calendar-weekdays-font-size,12px);font-weight:500;line-height:var(--calendar-weekdays-height,30px);opacity:.5;text-align:center}
@@ -1 +0,0 @@
1
- @import '../../../common/index.wxss';.smart-calendar__header{flex-shrink:0}.smart-calendar__header-title{position:relative}.smart-calendar__header-title-save{color:var(--calendar-header-title-save-color,#1989fa);font-size:16px;font-weight:400;letter-spacing:0;line-height:24px;position:absolute;right:48rpx;text-align:right;top:50%;transform:translateY(-50%)}.smart-calendar__header-subtitle,.smart-calendar__header-title{color:var(--calendar-header-title-font-color,var(--app-B4-N1,#000));font-size:16px;font-weight:var(--font-weight-bold,500);height:var(--calendar-header-title-height,44px);line-height:var(--calendar-header-title-height,44px);text-align:center}.smart-calendar__header-subtitle_wrap{align-items:center;display:flex;justify-content:center;position:relative}.smart-calendar__header-subtitle_left{align-items:center;background:var(--calendar-header-icon-bg-color,var(--app-B2-N9,rgba(0,0,0,.05)));border-radius:50%;display:flex;height:48rpx;justify-content:center;left:52rpx;position:absolute;top:50%;transform:translateY(-50%);width:48rpx}.smart-calendar__header-subtitle_left_icon{left:-1px;position:relative}.smart-calendar__header-subtitle_right{align-items:center;background:var(--calendar-header-icon-bg-color,var(--app-B2-N9,rgba(0,0,0,.05)));border-radius:50%;display:flex;height:48rpx;justify-content:center;position:absolute;right:52rpx;top:50%;transform:translateY(-50%);width:48rpx}.smart-calendar__header-subtitle_right_icon{position:relative;right:-1px}.smart-calendar__header-title+.smart-calendar__header-title,.smart-calendar__header-title:empty{display:none}.smart-calendar__header-title:empty+.smart-calendar__header-title{display:block!important}.smart-calendar__weekdays{display:flex;margin-bottom:16rpx;margin-top:16rpx;padding-left:16rpx;padding-right:16rpx}.smart-calendar__weekday{color:var(--calendar-weekdays-font-color,var(--app-B4-N1,#000));flex:1;font-size:var(--calendar-weekdays-font-size,12px);font-weight:500;line-height:var(--calendar-weekdays-height,30px);opacity:.5;text-align:center}
@@ -1 +0,0 @@
1
- @import '../../../common/index.css';.smart-calendar{background-color:var(--calendar-background-color,var(--app-B6,#fff));display:flex;flex-direction:column;height:100%}.smart-calendar__month{padding-bottom:48rpx;padding-left:16rpx;padding-right:16rpx}.smart-calendar__month-title{font-size:var(--calendar-month-title-font-size,14px);font-weight:var(--font-weight-bold,500);height:var(--calendar-header-title-height,44px);line-height:var(--calendar-header-title-height,44px);text-align:center}.smart-calendar__days{display:flex;flex-wrap:wrap;position:relative;-webkit-user-select:none;user-select:none}.smart-calendar__month-mark{color:var(--calendar-month-mark-color,hsla(210,6%,87%,.6));font-size:var(--calendar-month-mark-font-size,160px);left:50%;pointer-events:none;position:absolute;top:50%;transform:translate(-50%,-50%);z-index:0}.smart-calendar__day,.smart-calendar__selected-day{align-items:center;display:flex;justify-content:center;text-align:center}.smart-calendar__day{color:var(--calendar-cell-item-font-color,var(--app-B4-N1,#000));font-size:var(--calendar-cell-item-font-size,15px);font-weight:var(--calendar-day-font-weight,500);height:var(--calendar-day-height,100rpx);margin:4px 0;position:relative;width:14.285%}.smart-calendar__day--end,.smart-calendar__day--multiple-middle,.smart-calendar__day--multiple-selected,.smart-calendar__day--start,.smart-calendar__day--start-end{background-color:var(--calendar-range-edge-background-color,#3678e3);color:var(--calendar-range-edge-color,#fff)}.smart-calendar__day--start{border-bottom-left-radius:var(--calendar-day-select-border-radius,34rpx);border-top-left-radius:var(--calendar-day-select-border-radius,34rpx)}.smart-calendar__day--end{border-bottom-right-radius:var(--calendar-day-select-border-radius,34rpx);border-top-right-radius:var(--calendar-day-select-border-radius,34rpx)}.smart-calendar__day--multiple-selected,.smart-calendar__day--start-end{border-radius:4px}.smart-calendar__day--middle{background-color:var(--calendar-range-edge-background-color,#3678e3);color:var(--calendar-range-middle-color,#fff)}.smart-calendar__day--disabled{color:var(--calendar-day-disabled-color,#c8c9cc);cursor:default}.smart-calendar__bottom-info,.smart-calendar__top-info{font-size:var(--calendar-info-font-size,10px);left:0;line-height:var(--calendar-info-line-height,14px);position:absolute;right:0}@media (max-width:350px){.smart-calendar__bottom-info,.smart-calendar__top-info{font-size:9px}}.smart-calendar__top-info{top:6px}.smart-calendar__bottom-info{bottom:6px}.smart-calendar__selected-day{background-color:var(--calendar-selected-day-background-color,#3678e3);border-radius:50%;color:var(--calendar-selected-day-color,#fff);height:var(--calendar-selected-day-size,34px);width:var(--calendar-selected-day-size,34px)}
@@ -1 +0,0 @@
1
- @import '../../../common/index.wxss';.smart-calendar{background-color:var(--calendar-background-color,var(--app-B6,#fff));display:flex;flex-direction:column;height:100%}.smart-calendar__month{padding-bottom:48rpx;padding-left:16rpx;padding-right:16rpx}.smart-calendar__month-title{font-size:var(--calendar-month-title-font-size,14px);font-weight:var(--font-weight-bold,500);height:var(--calendar-header-title-height,44px);line-height:var(--calendar-header-title-height,44px);text-align:center}.smart-calendar__days{display:flex;flex-wrap:wrap;position:relative;-webkit-user-select:none;user-select:none}.smart-calendar__month-mark{color:var(--calendar-month-mark-color,hsla(210,6%,87%,.6));font-size:var(--calendar-month-mark-font-size,160px);left:50%;pointer-events:none;position:absolute;top:50%;transform:translate(-50%,-50%);z-index:0}.smart-calendar__day,.smart-calendar__selected-day{align-items:center;display:flex;justify-content:center;text-align:center}.smart-calendar__day{color:var(--calendar-cell-item-font-color,var(--app-B4-N1,#000));font-size:var(--calendar-cell-item-font-size,15px);font-weight:var(--calendar-day-font-weight,500);height:var(--calendar-day-height,100rpx);margin:4px 0;position:relative;width:14.285%}.smart-calendar__day--end,.smart-calendar__day--multiple-middle,.smart-calendar__day--multiple-selected,.smart-calendar__day--start,.smart-calendar__day--start-end{background-color:var(--calendar-range-edge-background-color,#3678e3);color:var(--calendar-range-edge-color,#fff)}.smart-calendar__day--start{border-bottom-left-radius:var(--calendar-day-select-border-radius,34rpx);border-top-left-radius:var(--calendar-day-select-border-radius,34rpx)}.smart-calendar__day--end{border-bottom-right-radius:var(--calendar-day-select-border-radius,34rpx);border-top-right-radius:var(--calendar-day-select-border-radius,34rpx)}.smart-calendar__day--multiple-selected,.smart-calendar__day--start-end{border-radius:4px}.smart-calendar__day--middle{background-color:var(--calendar-range-edge-background-color,#3678e3);color:var(--calendar-range-middle-color,#fff)}.smart-calendar__day--disabled{color:var(--calendar-day-disabled-color,#c8c9cc);cursor:default}.smart-calendar__bottom-info,.smart-calendar__top-info{font-size:var(--calendar-info-font-size,10px);left:0;line-height:var(--calendar-info-line-height,14px);position:absolute;right:0}@media (max-width:350px){.smart-calendar__bottom-info,.smart-calendar__top-info{font-size:9px}}.smart-calendar__top-info{top:6px}.smart-calendar__bottom-info{bottom:6px}.smart-calendar__selected-day{background-color:var(--calendar-selected-day-background-color,#3678e3);border-radius:50%;color:var(--calendar-selected-day-color,#fff);height:var(--calendar-selected-day-size,34px);width:var(--calendar-selected-day-size,34px)}
@@ -1 +0,0 @@
1
- @import '../../../common/index.css';.contain{margin:24rpx 0}.item{border-radius:var(--calendar-cell-item-border-radius,104rpx);color:var(--calendar-cell-item-font-color,var(--app-B4-N1,#000));font-size:var(--calendar-cell-item-font-size,15px);font-weight:var(--calendar-day-font-weight,500);height:var(--calendar-cell-item-height,104rpx);line-height:var(--calendar-cell-item-height,104rpx);text-align:center;width:var(--calendar-cell-item-width,104rpx)}.item_active{background:#3678e3;color:#fff}.item_disabled{opacity:.5}.col_item{display:flex;justify-content:center}
@@ -1,7 +0,0 @@
1
- {
2
- "component": true,
3
- "usingComponents": {
4
- "smart-row": "../../../row/index",
5
- "smart-col": "../../../col/index"
6
- }
7
- }
@@ -1 +0,0 @@
1
- @import '../../../common/index.wxss';.contain{margin:24rpx 0}.item{border-radius:var(--calendar-cell-item-border-radius,104rpx);color:var(--calendar-cell-item-font-color,var(--app-B4-N1,#000));font-size:var(--calendar-cell-item-font-size,15px);font-weight:var(--calendar-day-font-weight,500);height:var(--calendar-cell-item-height,104rpx);line-height:var(--calendar-cell-item-height,104rpx);text-align:center;width:var(--calendar-cell-item-width,104rpx)}.item_active{background:#3678e3;color:#fff}.item_disabled{opacity:.5}.col_item{display:flex;justify-content:center}
@@ -1 +0,0 @@
1
- @import '../../../common/index.css';.contain{margin:24rpx 0}.item{border-radius:var(--calendar-cell-item-border-radius,104rpx);color:var(--calendar-cell-item-font-color,var(--app-B4-N1,#000));font-size:var(--calendar-cell-item-font-size,15px);font-weight:var(--calendar-day-font-weight,500);height:var(--calendar-cell-item-height,104rpx);line-height:var(--calendar-cell-item-height,104rpx);text-align:center;width:var(--calendar-cell-item-width,104rpx)}.item_active{background:#3678e3;color:#fff}.item_disabled{opacity:.5}.col_item{display:flex;justify-content:center}
@@ -1,7 +0,0 @@
1
- {
2
- "component": true,
3
- "usingComponents": {
4
- "smart-row": "../../../row/index",
5
- "smart-col": "../../../col/index"
6
- }
7
- }
@@ -1 +0,0 @@
1
- @import '../../../common/index.wxss';.contain{margin:24rpx 0}.item{border-radius:var(--calendar-cell-item-border-radius,104rpx);color:var(--calendar-cell-item-font-color,var(--app-B4-N1,#000));font-size:var(--calendar-cell-item-font-size,15px);font-weight:var(--calendar-day-font-weight,500);height:var(--calendar-cell-item-height,104rpx);line-height:var(--calendar-cell-item-height,104rpx);text-align:center;width:var(--calendar-cell-item-width,104rpx)}.item_active{background:#3678e3;color:#fff}.item_disabled{opacity:.5}.col_item{display:flex;justify-content:center}
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes