Skip to content

Commit e66c7a1

Browse files
committed
feat: 完善插槽功能以及补充文档
1 parent b3ff7d1 commit e66c7a1

File tree

6 files changed

+83
-73
lines changed

6 files changed

+83
-73
lines changed

README.md

Lines changed: 33 additions & 47 deletions
Large diffs are not rendered by default.

package.json

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,20 @@
11
{
22
"name": "react-hash-calendar",
33
"version": "0.1.0",
4-
"private": true,
4+
"author": "HashTang",
5+
"repository": {
6+
"type": "git",
7+
"url": "https://github.com/TangSY/reat-hash-calendar.git"
8+
},
9+
"bugs": {
10+
"url": "https://github.com/TangSY/reat-hash-calendar/issues"
11+
},
12+
"homepage": "https://www.hxkj.vip",
13+
"license": "MIT",
14+
"description": "reat 周 月 时间选择器",
15+
"main": "lib/reat-hash-calendar.umd.min.js",
16+
"keyword": "reat-hash-calendar calendar date-picker datetime-picker time-picker week-picker",
17+
"private": false,
518
"dependencies": {
619
"@testing-library/jest-dom": "^4.2.4",
720
"@testing-library/react": "^9.3.2",
@@ -16,7 +29,6 @@
1629
"react-scripts": "3.4.3",
1730
"typescript": "~3.7.2"
1831
},
19-
"homepage": "./",
2032
"scripts": {
2133
"start": "react-app-rewired start",
2234
"build": "react-app-rewired build",

public/favicon.ico

-67 Bytes
Binary file not shown.

public/index.html

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
11
<!DOCTYPE html>
22
<html lang="en">
3-
<head>
4-
<meta charset="utf-8" />
5-
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
6-
<meta name="viewport" content="width=device-width, initial-scale=1" />
7-
<meta name="theme-color" content="#000000" />
8-
<meta
9-
name="description"
10-
content="Web site created using create-react-app"
11-
/>
12-
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
13-
<!--
3+
4+
<head>
5+
<meta charset="utf-8" />
6+
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
7+
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover"
8+
name="viewport" />
9+
<meta name="theme-color" content="#000000" />
10+
<meta name="description" content="Web site created using create-react-app" />
11+
<!--
1412
manifest.json provides metadata used when your web app is installed on a
1513
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
1614
-->
17-
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
18-
<!--
15+
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
16+
<!--
1917
Notice the use of %PUBLIC_URL% in the tags above.
2018
It will be replaced with the URL of the `public` folder during the build.
2119
Only files inside the `public` folder can be referenced from the HTML.
@@ -24,12 +22,13 @@
2422
work correctly both with client-side routing and a non-root public URL.
2523
Learn how to configure a non-root public URL by running `npm run build`.
2624
-->
27-
<title>React App</title>
28-
</head>
29-
<body>
30-
<noscript>You need to enable JavaScript to run this app.</noscript>
31-
<div id="root"></div>
32-
<!--
25+
<title>React App</title>
26+
</head>
27+
28+
<body>
29+
<noscript>You need to enable JavaScript to run this app.</noscript>
30+
<div id="root"></div>
31+
<!--
3332
This HTML file is a template.
3433
If you open it directly in the browser, you will see an empty page.
3534
@@ -39,5 +38,6 @@
3938
To begin the development, run `npm start` or `yarn start`.
4039
To create a production bundle, use `npm run build` or `yarn build`.
4140
-->
42-
</body>
43-
</html>
41+
</body>
42+
43+
</html>

src/components/calendar/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1006,9 +1006,9 @@ class Calendar extends React.Component<Props & typeof defaultProps, State, {}> {
10061006
isCurrentMonthDay: !this.isNotCurrentMonthDay(date, mIndex),
10071007
isFirstDayOfMonth: this.isFirstDayOfMonth(date, mIndex),
10081008
})) ||
1009-
this.isFirstDayOfMonth(date, mIndex)
1010-
? language.MONTH && language.MONTH[date.month]
1011-
: date.day}
1009+
(this.isFirstDayOfMonth(date, mIndex)
1010+
? language.MONTH && language.MONTH[date.month]
1011+
: date.day)}
10121012
</div>
10131013
<div
10141014
style={{ background: this.markDateColor(date, 'dot') }}

src/components/datetimePicker/index.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,18 @@ type Props = {
7171
todaySlot?: React.ReactNode;
7272
confirmSlot?: React.ReactNode;
7373
onVisibleChange?: (visible: boolean) => void;
74+
weekSlot?: (week: string) => React.ReactNode;
75+
daySlot?: (
76+
date: IDate,
77+
extendAttr: {
78+
isMarked: boolean;
79+
isDisabledDate: boolean;
80+
isToday: boolean;
81+
isChecked: boolean;
82+
isCurrentMonthDay: boolean;
83+
isFirstDayOfMonth: boolean;
84+
}
85+
) => React.ReactNode;
7486
slideChangeCallback?: (direction: string) => void;
7587
touchStartCallback?: (e: React.TouchEvent) => void;
7688
touchMoveCallback?: (e: React.TouchEvent) => void;

0 commit comments

Comments
 (0)