Skip to content

Commit

Permalink
feat(Calendar): new component
Browse files Browse the repository at this point in the history
  • Loading branch information
xinshu.sxs committed Jul 26, 2022
1 parent be9b88e commit 082bcdb
Show file tree
Hide file tree
Showing 23 changed files with 1,889 additions and 3 deletions.
1 change: 0 additions & 1 deletion .minidev/config.json
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
{ "plugins": ["./scripts/umi.js"] }
3 changes: 2 additions & 1 deletion demo/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@
"pages/Empty/index",
"pages/Toast/index",
"pages/FloatPanel/index",
"pages/FloatPanelEvent/index"
"pages/FloatPanelEvent/index",
"pages/Calendar/index"
],
"window": {
"enableWK": "YES",
Expand Down
2 changes: 2 additions & 0 deletions demo/pages/Calendar/index.acss
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.wrapper {
}
14 changes: 14 additions & 0 deletions demo/pages/Calendar/index.axml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

<calendar
className="wrapper"
startDate="{{startDate}}"
endDate="{{endDate}}"
date="{{date}}"
holidayList="{{holidayList}}"
customDateList="{{customDateList}}"
disableDates="{{disableDates}}"
onChange="onChange"
selectionMode="range"
showConfirmButton="{{true}}"
onClose="onClose"
/>
109 changes: 109 additions & 0 deletions demo/pages/Calendar/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
Page({
data: {
startDate: '2022-07-01',
endDate: '2022-10-26',
// date: '2022-05-01',
holidayList: [
{
name: '国庆',
range: ['2022-10-01', '2022-10-07'],
type: 'holiday',
day: '2022-10-01'
}
],
customDateList: [
{
date: '2022-07-17',
text: '未出账',
color: '#999999'
},
{
date: '2022-07-18',
text: '未出账',
color: '#999999'
},
{
date: '2022-07-19',
text: '未出账',
color: '#999999'
},
{
date: '2022-07-20',
text: '未出账',
color: '#999999'
},
{
date: '2022-07-21',
text: '未出账',
color: '#999999'
},
{
date: '2022-08-25',
text: '+100',
color: '#F93A4A'
},
{
date: '2022-08-24',
text: '+100',
color: '#F93A4A'
},
{
date: '2022-08-23',
text: '+100',
color: '#F93A4A'
},
{
date: '2022-08-22',
text: '+100',
color: '#F93A4A'
},
{
date: '2022-08-21',
text: '+100',
color: '#F93A4A'
},
{
date: '2022-08-20',
text: '-100',
color: '#00B578'
},
{
date: '2022-08-19',
text: '-100',
color: '#00B578'
},
{
date: '2022-08-18',
text: '-100',
color: '#00B578'
},
{
date: '2022-08-17',
text: '-100',
color: '#00B578'
},
{
date: '2022-08-16',
text: '-100',
color: '#00B578'
},
],
disableDates: [
'2022-09-11',
'2022-09-12',
'2022-09-13',
'2022-09-14',
'2022-09-15',
]
},
onChange (date) {
my.alert({
content: date
})
},
onClose () {
my.alert({
content: '组件关闭'
})
}
});
7 changes: 7 additions & 0 deletions demo/pages/Calendar/index.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"defaultTitle": "Calendar",
"usingComponents": {
"calendar": "../../../src/Calendar/index"
},
"allowsBounceVertical": "NO"
}
5 changes: 5 additions & 0 deletions demo/utils/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ export const componentList = [
nameZN: '滑动面板',
path: '/pages/FloatPanel/index',
},
{
name: 'Calendar',
nameZN: '日历',
path: '/pages/Calendar/index',
},
],
},
{
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"dependencies": {
"@babel/runtime": "^7.17.2",
"async-validator": "^4.0.7",
"dayjs": "^1.11.3",
"fast-deep-equal": "3.1.3",
"tslib": "^2.3.1"
},
Expand Down Expand Up @@ -126,4 +127,4 @@
],
"license": "MIT",
"homepage": "https://github.com/ant-design/ant-design-mini"
}
}
Loading

0 comments on commit 082bcdb

Please sign in to comment.