@tuya-miniapp/smart-ui 2.0.2-beta-10 → 2.0.2-beta-12
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/calendar/calendar.wxml +3 -8
- package/dist/calendar/demo/index.js +3 -0
- package/dist/calendar/index.css +1 -1
- package/dist/calendar/index.js +4 -1
- package/dist/calendar/index.json +4 -4
- package/dist/calendar/index.wxs +4 -2
- package/dist/calendar/index.wxss +1 -1
- package/dist/calendar-header/index.css +1 -0
- package/dist/{calendar/components/header → calendar-header}/index.js +1 -1
- package/{lib/calendar/components/header → dist/calendar-header}/index.json +1 -1
- package/dist/calendar-header/index.wxss +1 -0
- package/dist/calendar-month/index.css +1 -0
- package/dist/{calendar/components/month → calendar-month}/index.js +16 -2
- package/dist/{calendar/components/month → calendar-month}/index.wxml +2 -5
- package/dist/{calendar/components/month → calendar-month}/index.wxs +1 -1
- package/dist/calendar-month/index.wxss +1 -0
- package/dist/calendar-month-list/index.css +1 -0
- package/dist/{calendar/components/month-list → calendar-month-list}/index.js +2 -2
- package/dist/calendar-month-list/index.json +7 -0
- package/dist/calendar-month-list/index.wxss +1 -0
- package/dist/{calendar → calendar-utils}/types.d.ts +1 -0
- package/dist/calendar-year-list/index.css +1 -0
- package/dist/{calendar/components/year-list → calendar-year-list}/index.js +2 -2
- package/dist/calendar-year-list/index.json +7 -0
- package/dist/calendar-year-list/index.wxss +1 -0
- package/dist/field/cell-input.wxml +1 -1
- package/dist/field/cell-textarea.wxml +1 -1
- package/dist/field/index.css +1 -1
- package/dist/field/index.js +1 -1
- package/dist/field/index.wxss +1 -1
- package/dist/search/index.css +1 -1
- package/dist/search/index.js +4 -1
- package/dist/search/index.wxss +1 -1
- package/lib/calendar/calendar.wxml +3 -8
- package/lib/calendar/demo/index.js +3 -0
- package/lib/calendar/index.css +1 -1
- package/lib/calendar/index.js +4 -1
- package/lib/calendar/index.json +4 -4
- package/lib/calendar/index.wxs +4 -2
- package/lib/calendar/index.wxss +1 -1
- package/lib/calendar-header/index.css +1 -0
- package/lib/{calendar/components/header → calendar-header}/index.js +1 -1
- package/{dist/calendar/components/header → lib/calendar-header}/index.json +1 -1
- package/lib/calendar-header/index.wxss +1 -0
- package/lib/calendar-month/index.css +1 -0
- package/lib/{calendar/components/month → calendar-month}/index.js +16 -2
- package/lib/{calendar/components/month → calendar-month}/index.wxml +2 -5
- package/lib/{calendar/components/month → calendar-month}/index.wxs +1 -1
- package/lib/calendar-month/index.wxss +1 -0
- package/lib/calendar-month-list/index.css +1 -0
- package/lib/{calendar/components/month-list → calendar-month-list}/index.js +2 -2
- package/lib/calendar-month-list/index.json +7 -0
- package/lib/calendar-month-list/index.wxss +1 -0
- package/lib/{calendar → calendar-utils}/types.d.ts +1 -0
- package/lib/calendar-year-list/index.css +1 -0
- package/lib/{calendar/components/year-list → calendar-year-list}/index.js +2 -2
- package/lib/calendar-year-list/index.json +7 -0
- package/lib/calendar-year-list/index.wxss +1 -0
- package/lib/field/cell-input.wxml +1 -1
- package/lib/field/cell-textarea.wxml +1 -1
- package/lib/field/index.css +1 -1
- package/lib/field/index.js +1 -1
- package/lib/field/index.wxss +1 -1
- package/lib/search/index.css +1 -1
- package/lib/search/index.js +4 -1
- package/lib/search/index.wxss +1 -1
- package/package.json +1 -1
- package/dist/calendar/components/header/index.css +0 -1
- package/dist/calendar/components/header/index.wxss +0 -1
- package/dist/calendar/components/month/index.css +0 -1
- package/dist/calendar/components/month/index.wxss +0 -1
- package/dist/calendar/components/month-list/index.css +0 -1
- package/dist/calendar/components/month-list/index.json +0 -7
- package/dist/calendar/components/month-list/index.wxss +0 -1
- package/dist/calendar/components/year-list/index.css +0 -1
- package/dist/calendar/components/year-list/index.json +0 -7
- package/dist/calendar/components/year-list/index.wxss +0 -1
- package/lib/calendar/components/header/index.css +0 -1
- package/lib/calendar/components/header/index.wxss +0 -1
- package/lib/calendar/components/month/index.css +0 -1
- package/lib/calendar/components/month/index.wxss +0 -1
- package/lib/calendar/components/month-list/index.css +0 -1
- package/lib/calendar/components/month-list/index.json +0 -7
- package/lib/calendar/components/month-list/index.wxss +0 -1
- package/lib/calendar/components/year-list/index.css +0 -1
- package/lib/calendar/components/year-list/index.json +0 -7
- package/lib/calendar/components/year-list/index.wxss +0 -1
- /package/dist/{calendar/components/header → calendar-header}/index.d.ts +0 -0
- /package/dist/{calendar/components/header → calendar-header}/index.wxml +0 -0
- /package/dist/{calendar/components/month → calendar-month}/index.d.ts +0 -0
- /package/dist/{calendar/components/month → calendar-month}/index.json +0 -0
- /package/dist/{calendar/components/month-list → calendar-month-list}/index.d.ts +0 -0
- /package/dist/{calendar/components/month-list → calendar-month-list}/index.wxml +0 -0
- /package/dist/{calendar → calendar-utils}/types.js +0 -0
- /package/dist/{calendar → calendar-utils}/utils.d.ts +0 -0
- /package/dist/{calendar → calendar-utils}/utils.js +0 -0
- /package/dist/{calendar → calendar-utils}/utils.wxs +0 -0
- /package/dist/{calendar/components/year-list → calendar-year-list}/index.d.ts +0 -0
- /package/dist/{calendar/components/year-list → calendar-year-list}/index.wxml +0 -0
- /package/lib/{calendar/components/header → calendar-header}/index.d.ts +0 -0
- /package/lib/{calendar/components/header → calendar-header}/index.wxml +0 -0
- /package/lib/{calendar/components/month → calendar-month}/index.d.ts +0 -0
- /package/lib/{calendar/components/month → calendar-month}/index.json +0 -0
- /package/lib/{calendar/components/month-list → calendar-month-list}/index.d.ts +0 -0
- /package/lib/{calendar/components/month-list → calendar-month-list}/index.wxml +0 -0
- /package/lib/{calendar → calendar-utils}/types.js +0 -0
- /package/lib/{calendar → calendar-utils}/utils.d.ts +0 -0
- /package/lib/{calendar → calendar-utils}/utils.js +0 -0
- /package/lib/{calendar → calendar-utils}/utils.wxs +0 -0
- /package/lib/{calendar/components/year-list → calendar-year-list}/index.d.ts +0 -0
- /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
|
-
<
|
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
|
-
</
|
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>
|
package/dist/calendar/index.css
CHANGED
@@ -1 +1 @@
|
|
1
|
-
@import '../common/index.css';.smart-calendar{background-color:var(--calendar-background-color,var(--app-B6,#fff));color:var(--calendar-text-color,#000);display:flex;flex-direction:column;height: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:
|
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}
|
package/dist/calendar/index.js
CHANGED
@@ -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 '
|
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: '',
|
package/dist/calendar/index.json
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
{
|
2
2
|
"component": true,
|
3
3
|
"usingComponents": {
|
4
|
-
"header": "
|
5
|
-
"month": "
|
6
|
-
"month-list": "
|
7
|
-
"year-list": "
|
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"
|
package/dist/calendar/index.wxs
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
/* eslint-disable */
|
2
|
-
var utils = require('
|
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 ?
|
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 + '');
|
package/dist/calendar/index.wxss
CHANGED
@@ -1 +1 @@
|
|
1
|
-
@import '../common/index.wxss';.smart-calendar{background-color:var(--calendar-background-color,var(--app-B6,#fff));color:var(--calendar-text-color,#000);display:flex;flex-direction:column;height: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:
|
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}
|
@@ -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 '
|
2
|
-
import { getMonthEndDay, compareDay, getPrevDay, getNextDay } from '
|
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="
|
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>
|
@@ -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 '
|
3
|
-
import { SmartComponent } from '
|
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 @@
|
|
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}
|
@@ -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 '
|
3
|
-
import { SmartComponent } from '
|
2
|
+
import { getYears } from '../calendar-utils/utils';
|
3
|
+
import { SmartComponent } from '../common/component';
|
4
4
|
SmartComponent({
|
5
5
|
/**
|
6
6
|
* 组件的属性列表
|
@@ -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}
|
@@ -14,7 +14,7 @@
|
|
14
14
|
arrow-direction="{{ arrowDirection }}"
|
15
15
|
custom-class="custom-class smart-field"
|
16
16
|
>
|
17
|
-
<view class="{{ utils.bem('field__left__body', { disabled, card: cardMode }) }}">
|
17
|
+
<view wx:if="{{ !hiddenLabel }}" class="{{ utils.bem('field__left__body', { disabled, card: cardMode }) }}">
|
18
18
|
<view class="smart-field__left__icon">
|
19
19
|
<slot name="left-icon" slot="icon" />
|
20
20
|
</view>
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<wxs src="../wxs/utils.wxs" module="utils" />
|
2
2
|
<wxs src="./index.wxs" module="computed" />
|
3
3
|
<view class="smart-field smart-field--textarea">
|
4
|
-
<view class="{{ utils.bem('field__left__body', { disabled, card: cardMode }) }}">
|
4
|
+
<view wx:if="{{ !hiddenLabel }}" class="{{ utils.bem('field__left__body', { disabled, card: cardMode }) }}">
|
5
5
|
<view class="smart-field__left__icon">
|
6
6
|
<slot name="left-icon" slot="icon" />
|
7
7
|
</view>
|
package/dist/field/index.css
CHANGED
@@ -1 +1 @@
|
|
1
|
-
@import '../common/index.css';.smart-field{--cell-icon-size:var(--field-icon-size,16px)}.smart-field__left__body{align-items:center;display:flex;
|
1
|
+
@import '../common/index.css';.smart-field{--cell-icon-size:var(--field-icon-size,16px)}.smart-field__left__body{align-items:center;display:flex;padding-right:var(--field-left-body-padding-right,16px);text-align:left}.smart-field__left__body--card{width:var(--field-left-card-width,100%)}.smart-field__left__body--disabled{opacity:var(--field-disabled-opacity,.7)}.smart-field__label{color:var(--field-label-color,var(--app-B6-N1,#000));font-size:var(--field-label-font-size,16px);line-height:var(--field-label-line-height,18px);text-align:left}.smart-field__label--required{color:var(--field-input-error-text-color,var(--app-M2,#f04c4c))}.smart-field__label:empty{display:none}.smart-field__left__icon{display:flex;margin-right:var(--field-left-icon-margin-right,10px)}.smart-field__left__icon:empty{display:none}.smart-field__label__card__subtitle{color:var(--field-subtitle-text-color,var(--app-B6-N3,rgba(0,0,0,.5)));font-size:var(--field-sub-label-font-size,14px);line-height:var(--field-sub-label-line-height,16px);margin-top:4px}.smart-field__label__card__subtitle--error{color:var(--field-error-message-color,var(--app-M2,#f04c4c))}.smart-field__body__box{flex:1}.smart-field__body__box--disabled{opacity:var(--field-disabled-opacity,.7)}.smart-field__body{align-items:center;display:flex;justify-content:flex-end}.smart-field__control:empty+.smart-field__control{display:block}.smart-field__control{background-color:initial;border:0;box-sizing:border-box;color:var(--field-input-text-color,var(--app-B6-N1,#000));display:none;height:var(--cell-line-height,24px);line-height:inherit;margin:0;min-height:var(--cell-line-height,24px);padding:0;position:relative;resize:none;text-align:right;width:100%}.smart-field__control:empty{display:none}.smart-field__control--textarea{background-color:var(--field-textarea-background,var(--app-B3,#fff));border-radius:var(--field-textarea-border-radius,8px);height:var(--field-textarea-min-height,130px);min-height:var(--field-textarea-min-height,130px);padding:var(--field-textarea-padding,12px 8px);text-align:left}.smart-field__control--card{background:var(--field-card-background,var(--app-B6-N7,rgba(0,0,0,.1)));border-radius:var(--field-card-border-radius,8px);height:var(--field-card-height,38px);padding:var(--field-card-padding,0 10px);text-align:center;width:var(--field-card-width,105px)}.smart-field__control--limit{padding-bottom:var(--field-textarea-limit-padding-bottom,20px)}.smart-field__control--center{text-align:center}.smart-field__control--right{text-align:right}.smart-field__control--left{text-align:left}.smart-field__control--custom,.smart-field__icon-root{align-items:center;display:flex;min-height:var(--cell-line-height,24px)}.smart-field__clear-root,.smart-field__icon-container{line-height:inherit;margin-right:calc(var(--padding-xs, 8px)*-1);padding:0 var(--padding-xs,8px);vertical-align:middle}.smart-field__button,.smart-field__clear-root,.smart-field__icon-container{flex-shrink:0}.smart-field__clear-root{--icon-color:var(--field-clear-icon-color,var(--app-B6-N4,rgba(0,0,0,.4)));font-size:var(--field-clear-icon-size,16px)}.smart-field__icon-container{--icon-color:var(--field-icon-container-color,#969799);font-size:var(--field-icon-size,16px)}.smart-field__icon-container:empty{display:none}.smart-field__button{padding-left:var(--padding-xs,8px)}.smart-field__button:empty{display:none}.smart-field__error-message{color:var(--field-error-message-color,var(--app-M2,#f04c4c));display:block;font-size:var(--field-error-message-text-font-size,14px);font-weight:400;line-height:var(--field-error-message-text-line-height,18px);text-align:right;white-space:nowrap}.smart-field__error-message--center{text-align:center}.smart-field__error-message--right{text-align:right}.smart-field--textarea{padding:0 16px}.smart-field--textarea .smart-field__left__body{margin-bottom:8px;width:100%}.smart-field--textarea .smart-field__body__box{position:relative}.smart-field__word-limit{bottom:8px;color:var(--field-word-limit-color,var(--app-B6-N4,rgba(0,0,0,.4)));font-size:var(--field-word-limit-font-size,10px);line-height:var(--field-word-limit-line-height,14px);margin-top:var(--padding-base,4px);position:absolute;right:8px;text-align:right}.smart-field__word-num{display:inline}.smart-field__word-num--full{color:var(--field-word-num-full-color,var(--app-M2,#f04c4c))}
|
package/dist/field/index.js
CHANGED
@@ -7,7 +7,7 @@ SmartComponent({
|
|
7
7
|
classes: ['input-class', 'right-icon-class', 'label-class'],
|
8
8
|
props: Object.assign(Object.assign(Object.assign(Object.assign({}, commonProps), inputProps), textareaProps), { size: String, icon: String, label: String, error: Boolean, center: Boolean, isLink: Boolean, leftIcon: String, rightIcon: String, autosize: null, required: Boolean, interError: Boolean, inputAlign: {
|
9
9
|
type: String,
|
10
|
-
}, subLabel: String, cardMode: Boolean, iconClass: String, clickable: Boolean, customStyle: String, errorMessage: String, arrowDirection: String, showWordLimit: Boolean, errorMessageAlign: String, readonly: {
|
10
|
+
}, subLabel: String, cardMode: Boolean, iconClass: String, clickable: Boolean, customStyle: String, errorMessage: String, arrowDirection: String, showWordLimit: Boolean, errorMessageAlign: String, hiddenLabel: Boolean, readonly: {
|
11
11
|
type: Boolean,
|
12
12
|
observer: 'setShowClear',
|
13
13
|
}, clearable: {
|
package/dist/field/index.wxss
CHANGED
@@ -1 +1 @@
|
|
1
|
-
@import '../common/index.wxss';.smart-field{--cell-icon-size:var(--field-icon-size,16px)}.smart-field__left__body{align-items:center;display:flex;
|
1
|
+
@import '../common/index.wxss';.smart-field{--cell-icon-size:var(--field-icon-size,16px)}.smart-field__left__body{align-items:center;display:flex;padding-right:var(--field-left-body-padding-right,16px);text-align:left}.smart-field__left__body--card{width:var(--field-left-card-width,100%)}.smart-field__left__body--disabled{opacity:var(--field-disabled-opacity,.7)}.smart-field__label{color:var(--field-label-color,var(--app-B6-N1,#000));font-size:var(--field-label-font-size,16px);line-height:var(--field-label-line-height,18px);text-align:left}.smart-field__label--required{color:var(--field-input-error-text-color,var(--app-M2,#f04c4c))}.smart-field__label:empty{display:none}.smart-field__left__icon{display:flex;margin-right:var(--field-left-icon-margin-right,10px)}.smart-field__left__icon:empty{display:none}.smart-field__label__card__subtitle{color:var(--field-subtitle-text-color,var(--app-B6-N3,rgba(0,0,0,.5)));font-size:var(--field-sub-label-font-size,14px);line-height:var(--field-sub-label-line-height,16px);margin-top:4px}.smart-field__label__card__subtitle--error{color:var(--field-error-message-color,var(--app-M2,#f04c4c))}.smart-field__body__box{flex:1}.smart-field__body__box--disabled{opacity:var(--field-disabled-opacity,.7)}.smart-field__body{align-items:center;display:flex;justify-content:flex-end}.smart-field__control:empty+.smart-field__control{display:block}.smart-field__control{background-color:initial;border:0;box-sizing:border-box;color:var(--field-input-text-color,var(--app-B6-N1,#000));display:none;height:var(--cell-line-height,24px);line-height:inherit;margin:0;min-height:var(--cell-line-height,24px);padding:0;position:relative;resize:none;text-align:right;width:100%}.smart-field__control:empty{display:none}.smart-field__control--textarea{background-color:var(--field-textarea-background,var(--app-B3,#fff));border-radius:var(--field-textarea-border-radius,8px);height:var(--field-textarea-min-height,130px);min-height:var(--field-textarea-min-height,130px);padding:var(--field-textarea-padding,12px 8px);text-align:left}.smart-field__control--card{background:var(--field-card-background,var(--app-B6-N7,rgba(0,0,0,.1)));border-radius:var(--field-card-border-radius,8px);height:var(--field-card-height,38px);padding:var(--field-card-padding,0 10px);text-align:center;width:var(--field-card-width,105px)}.smart-field__control--limit{padding-bottom:var(--field-textarea-limit-padding-bottom,20px)}.smart-field__control--center{text-align:center}.smart-field__control--right{text-align:right}.smart-field__control--left{text-align:left}.smart-field__control--custom,.smart-field__icon-root{align-items:center;display:flex;min-height:var(--cell-line-height,24px)}.smart-field__clear-root,.smart-field__icon-container{line-height:inherit;margin-right:calc(var(--padding-xs, 8px)*-1);padding:0 var(--padding-xs,8px);vertical-align:middle}.smart-field__button,.smart-field__clear-root,.smart-field__icon-container{flex-shrink:0}.smart-field__clear-root{--icon-color:var(--field-clear-icon-color,var(--app-B6-N4,rgba(0,0,0,.4)));font-size:var(--field-clear-icon-size,16px)}.smart-field__icon-container{--icon-color:var(--field-icon-container-color,#969799);font-size:var(--field-icon-size,16px)}.smart-field__icon-container:empty{display:none}.smart-field__button{padding-left:var(--padding-xs,8px)}.smart-field__button:empty{display:none}.smart-field__error-message{color:var(--field-error-message-color,var(--app-M2,#f04c4c));display:block;font-size:var(--field-error-message-text-font-size,14px);font-weight:400;line-height:var(--field-error-message-text-line-height,18px);text-align:right;white-space:nowrap}.smart-field__error-message--center{text-align:center}.smart-field__error-message--right{text-align:right}.smart-field--textarea{padding:0 16px}.smart-field--textarea .smart-field__left__body{margin-bottom:8px;width:100%}.smart-field--textarea .smart-field__body__box{position:relative}.smart-field__word-limit{bottom:8px;color:var(--field-word-limit-color,var(--app-B6-N4,rgba(0,0,0,.4)));font-size:var(--field-word-limit-font-size,10px);line-height:var(--field-word-limit-line-height,14px);margin-top:var(--padding-base,4px);position:absolute;right:8px;text-align:right}.smart-field__word-num{display:inline}.smart-field__word-num--full{color:var(--field-word-num-full-color,var(--app-M2,#f04c4c))}
|
package/dist/search/index.css
CHANGED
@@ -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)));color:var(--search-label-color,var(--app-B4-N1,#000));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
|
+
@import '../common/index.css';.smart-search{--field-left-icon-margin-right:4px;--field-left-body-padding-right:0;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)));color:var(--search-label-color,var(--app-B4-N1,#000));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)}
|
package/dist/search/index.js
CHANGED
package/dist/search/index.wxss
CHANGED
@@ -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)));color:var(--search-label-color,var(--app-B4-N1,#000));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
|
+
@import '../common/index.wxss';.smart-search{--field-left-icon-margin-right:4px;--field-left-body-padding-right:0;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)));color:var(--search-label-color,var(--app-B4-N1,#000));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)}
|
@@ -21,7 +21,7 @@
|
|
21
21
|
</header>
|
22
22
|
|
23
23
|
<block wx:if="{{ type !== 'year' && type !== 'month' }}">
|
24
|
-
<
|
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
|
-
</
|
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>
|
package/lib/calendar/index.css
CHANGED
@@ -1 +1 @@
|
|
1
|
-
@import '../common/index.css';.smart-calendar{background-color:var(--calendar-background-color,var(--app-B6,#fff));color:var(--calendar-text-color,#000);display:flex;flex-direction:column;height: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:
|
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}
|
package/lib/calendar/index.js
CHANGED
@@ -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("
|
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: '',
|
package/lib/calendar/index.json
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
{
|
2
2
|
"component": true,
|
3
3
|
"usingComponents": {
|
4
|
-
"header": "
|
5
|
-
"month": "
|
6
|
-
"month-list": "
|
7
|
-
"year-list": "
|
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"
|
package/lib/calendar/index.wxs
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
/* eslint-disable */
|
2
|
-
var utils = require('
|
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 ?
|
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 + '');
|
package/lib/calendar/index.wxss
CHANGED
@@ -1 +1 @@
|
|
1
|
-
@import '../common/index.wxss';.smart-calendar{background-color:var(--calendar-background-color,var(--app-B6,#fff));color:var(--calendar-text-color,#000);display:flex;flex-direction:column;height: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:
|
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("
|
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)({
|
@@ -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)}
|