Skip to content

Commit 6a0a5a0

Browse files
committed
v1.8.0
1 parent 0cf578e commit 6a0a5a0

File tree

14 files changed

+229
-203
lines changed

14 files changed

+229
-203
lines changed

build/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

index.d.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,8 +251,10 @@ declare module "react-multi-date-picker" {
251251
*
252252
* Input modes:
253253
*
254-
* - none `useful for disabling virtual keyboard`
255254
* - text
255+
* - numeric
256+
* - decimal
257+
* - none `useful for disabling virtual keyboard`
256258
*
257259
* @default "text"
258260
*/

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-multi-date-picker",
3-
"version": "1.7.9",
3+
"version": "1.8.0",
44
"description": "a simple React datepicker component for work with gregorian, persian, arabic and indian calendars",
55
"main": "./build/index.js",
66
"types": "index.d.ts",
@@ -50,14 +50,14 @@
5050
"@rollup/plugin-url": "^6.0.0",
5151
"@svgr/rollup": "^5.5.0",
5252
"react": "^17.0.1",
53-
"react-dom": "^17.0.1",
53+
"react-dom": "^17.0.1",
5454
"rollup": "^2.34.1",
5555
"rollup-plugin-peer-deps-external": "^2.2.4",
5656
"rollup-plugin-postcss": "^3.1.8",
5757
"rollup-plugin-terser": "^7.0.2"
5858
},
5959
"dependencies": {
60-
"react-date-object": "^1.1.4"
60+
"react-date-object": "^1.1.6"
6161
},
6262
"peerDependencies": {
6363
"react": ">=16.8.0",

src/components/arrow/arrow.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ import React from "react"
33
export default function Arrow({ direction, onClick }) {
44
return (
55
<span
6-
className="rmdp-arrow-container"
6+
className={`rmdp-arrow-container ${direction}`}
77
onClick={onClick}
88
>
9-
<i className={`rmdp-arrow ${direction}`}></i>
9+
<i className="rmdp-arrow"></i>
1010
</span>
1111
)
1212
}

src/components/calendar/calendar.css

Lines changed: 70 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -14,36 +14,36 @@
1414
visibility: visible;
1515
}
1616

17-
.rmdp-calendar {
18-
position: relative;
19-
}
20-
2117
.rmpd-panel {
2218
min-width: 120px;
2319
border-left: 1px solid #8798ad;
2420
}
2521

2622
.rmdp-panel-body {
23+
position: absolute;
24+
left: 0;
25+
right: 0;
2726
list-style: none;
2827
padding: 0px 5px;
29-
margin: 5px 0;
28+
margin: 0;
3029
text-align: center;
31-
max-height: 235px;
3230
overflow: auto;
3331
}
3432

3533
.rmdp-panel-body li {
36-
margin: 0;
37-
padding: 0 5px;
38-
margin-bottom: 5px;
3934
border-radius: 5px;
4035
box-shadow: 0 0 2px #8798ad;
4136
background-color: #0074d9;
4237
color: white;
4338
display: flex;
44-
justify-content: center;
4539
cursor: pointer;
46-
text-align: center;
40+
position: relative;
41+
margin-bottom: 4px;
42+
}
43+
44+
.rmdp-panel-body span {
45+
margin: 0 5px;
46+
line-height: 23px;
4747
}
4848

4949
.rmdp-panel-body li .b-deselect {
@@ -52,23 +52,28 @@
5252
border: none;
5353
cursor: pointer;
5454
height: 12px;
55-
width: 10px;
55+
width: 12px;
5656
justify-content: center;
5757
border-radius: 50%;
58-
font-size: 9px;
59-
transform: rotate(45deg);
60-
margin-left: 4px;
61-
margin-top: 5.5px;
58+
font-size: 12px;
59+
position: absolute;
60+
right: 5px;
61+
top: 52%;
62+
transform: translateY(-50%) rotate(45deg);
6263
}
6364

6465
.rmdp-panel-body li .b-deselect:focus {
6566
outline: none;
6667
}
6768

68-
.rmdp-week {
69+
.rmdp-week,
70+
.rmdp-ym {
6971
display: flex;
7072
justify-content: center;
71-
font-size: 14px;
73+
}
74+
75+
.rmdp-ym {
76+
height: 25%;
7277
}
7378

7479
.rmdp-day,
@@ -124,16 +129,15 @@
124129
box-shadow: 0 0 3px #bac5d3;
125130
}
126131

127-
.rmdp-day.ym {
132+
.rmdp-ym .rmdp-day {
128133
flex: 1;
129-
height: 60px;
134+
margin: auto;
130135
}
131136

132-
.rmdp-day.ym span {
133-
border-radius: 10px;
134-
font-size: 14px;
135-
top: 20%;
136-
bottom: 20%;
137+
.rmdp-ym .rmdp-day span {
138+
border-radius: 12px;
139+
height: 98%;
140+
padding: 2px 0px;
137141
}
138142

139143
.rmdp-range {
@@ -164,35 +168,35 @@
164168
.rmdp-header,
165169
.rmdp-panel-header {
166170
border-bottom: 1px solid #8798ad;
167-
height: 28px;
168-
padding-top: 8px;
171+
height: 38px;
172+
line-height: 37px;
169173
}
170174

171175
.rmdp-panel-header {
172176
font-size: 14px;
173177
color: black;
178+
margin-bottom: 5px;
174179
}
175180

176181
.rmdp-month-picker,
177182
.rmdp-year-picker {
178183
background-color: white;
179184
position: absolute;
180-
top: 38px;
181-
left: 0;
185+
top: 2px;
186+
left: 2px;
182187
bottom: 2px;
183-
right: 0;
188+
right: 2px;
184189
border-radius: 0 0 5px 5px;
185190
}
186191

187192
.only.rmdp-month-picker,
188193
.only.rmdp-year-picker {
189194
position: static;
190195
width: 250px;
196+
height: 240px;
191197
}
192198

193199
.rmdp-header-values {
194-
flex: 1;
195-
margin-top: -2px;
196200
color: black;
197201
}
198202

@@ -212,30 +216,41 @@
212216
margin-top: 5px;
213217
}
214218

215-
.rmdp-up {
219+
.rmdp-up i {
216220
transform: rotate(-135deg);
217221
-webkit-transform: rotate(-135deg);
218222
margin-top: 7px;
219223
}
220224

221-
.rmdp-down {
225+
.rmdp-down i {
222226
transform: rotate(45deg);
223227
-webkit-transform: rotate(45deg);
224228
margin-top: 3px;
225229
}
226230

227-
.rmdp-right {
231+
.rmdp-right i {
228232
transform: rotate(-45deg);
229233
-webkit-transform: rotate(-45deg);
230234
margin-right: 3px;
231235
}
232236

233-
.rmdp-left {
237+
.rmdp-left i {
234238
transform: rotate(135deg);
235239
-webkit-transform: rotate(135deg);
236240
margin-left: 3px;
237241
}
238242

243+
.rmdp-left,
244+
.rmdp-right {
245+
position: absolute;
246+
top: 54%;
247+
transform: translateY(-50%);
248+
}
249+
250+
.rmdp-right {
251+
right: 0;
252+
}
253+
239254
.rmdp-arrow-container {
240255
cursor: pointer;
241256
border-radius: 50%;
@@ -327,29 +342,33 @@
327342
direction: rtl;
328343
}
329344

330-
.rmdp-rtl .rmdp-left {
345+
.rmdp-rtl .rmdp-left i {
331346
transform: rotate(-45deg);
332347
-webkit-transform: rotate(-45deg);
333348
margin-left: unset;
334349
margin-right: 3px;
335350
}
336351

337-
.rmdp-rtl .rmdp-right {
352+
.rmdp-rtl .rmdp-right i {
338353
transform: rotate(135deg);
339354
-webkit-transform: rotate(135deg);
340355
margin-right: unset;
341356
margin-left: 3px;
342357
}
343358

359+
.rmdp-rtl .rmdp-right {
360+
right: unset;
361+
left: 0;
362+
}
363+
344364
.rmdp-rtl .rmpd-panel {
345365
border-left: unset;
346366
border-right: 1px solid #8798ad;
347367
}
348368

349-
.rmdp-rtl .b-deselect {
350-
margin-left: unset;
351-
margin-right: 4px;
352-
margin-top: 5.5px;
369+
.rmdp-rtl .rmdp-panel-body li .b-deselect {
370+
right: unset;
371+
left: 5px;
353372
}
354373

355374
.rmdp-rtl .rmdp-range.start {
@@ -409,39 +428,27 @@
409428
font-size: 12px;
410429
}
411430

412-
.rmdp-day.ym {
413-
height: 50px;
414-
}
415-
416-
.rmdp-day.ym span {
417-
font-size: 12px;
418-
}
419-
420431
.rmpd-panel {
421-
min-width: 80px;
432+
min-width: 93px;
422433
}
423434

424-
.rmdp-panel-body li {
425-
font-size: 14px;
426-
}
427-
428-
.rmdp-panel-body li .b-deselect {
429-
margin-left: 4px;
430-
margin-top: 3px;
435+
.rmdp-panel-body {
436+
padding: 0 2px;
431437
}
432438

433-
.rmdp-year-picker,
434-
.rmdp-month-picker {
435-
top: 41px;
439+
.rmdp-panel-body li {
440+
font-size: 12px;
436441
}
437442

438443
.only.rmdp-year-picker,
439444
.only.rmdp-month-picker {
440445
width: 205px;
441446
}
442447

443-
.rmdp-panel-body {
444-
max-height: 195px;
448+
.rmdp-header,
449+
.rmdp-panel-header {
450+
height: 32px;
451+
line-height: 32px;
445452
}
446453
}
447454

src/components/calendar/calendar.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -219,15 +219,15 @@ export default function Calendar({
219219
<div
220220
className={`rmdp-wrapper ${state.ready ? "active" : ""} ${["fa", "ar"].includes(state.local) ? "rmdp-rtl" : ""} ${className || ""} ${(state.range || state.multiple) && state.mustShowDates ? "" : "rmdp-single"}`}
221221
>
222-
<div>
223-
<div className="rmdp-calendar">
224-
<Header
225-
state={state}
226-
setState={setState}
227-
onChange={onChange}
228-
disableYearPicker={disableYearPicker}
229-
disableMonthPicker={disableMonthPicker}
230-
/>
222+
<div style={{ height: "max-content" }}>
223+
<Header
224+
state={state}
225+
setState={setState}
226+
onChange={onChange}
227+
disableYearPicker={disableYearPicker}
228+
disableMonthPicker={disableMonthPicker}
229+
/>
230+
<div style={{ position: "relative" }}>
231231
<DayPicker
232232
state={state}
233233
setState={setState}

0 commit comments

Comments
 (0)