react-datepicker2
Version:
react datepicker component. (include persian jalaali calendar)
538 lines (464 loc) • 10.1 kB
CSS
.calendarContainer {
position: relative;
border-radius: 4px;
-webkit-box-shadow: 0px 3px 15px rgba(0, 0, 0, 0.2);
box-shadow: 0px 3px 15px rgba(0, 0, 0, 0.2);
width: 320px;
margin: auto;
text-align: center;
padding: 15px;
background-color: #fff;
}
.calendarContainer * {
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
.calendarContainer .dayPickerContainer:after,
.calendarContainer .monthsList:after,
.calendarContainer .daysOfWeek:after {
content: '';
display: block;
clear: both;
}
.datepicker-input {
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
/* Heading */
.calendarContainer .heading {
height: auto;
font-weight: bold;
margin-bottom: 10px;
}
.calendarContainer .heading > button {
background: none;
margin: 5px 0;
border: none;
text-align: center;
line-height: 30px;
width: 36px;
height: 32px;
cursor: pointer;
}
.calendarContainer .heading > button:hover {
background-color: #f2f2f2;
}
.calendarContainer .heading svg {
width: 10px;
fill: #777;
}
.calendarContainer .heading .prev,
.calendarContainer .heading .next {
width: 42px;
height: 42px;
border-radius: 50%;
margin: 0;
}
.calendarContainer .heading .prev {
float: right;
}
.calendarContainer .heading .next {
float: left;
}
.calendarContainer .heading .title {
height: auto;
border-radius: 4px;
width: auto;
margin: 0 5px;
border: 1px solid #f7f7f7;
text-align: center;
display: inline-block;
font-weight: normal;
padding: 4px 15px 5px 15px;
line-height: 1.5;
font-size: 1.2em;
max-height: none;
}
.jalaali.calendarContainer .heading .title {
padding: 4px 15px 7px 15px;
}
/* Day wrapper styles */
.calendarContainer .dayWrapper {
float: left;
width: 14.28571429%;
margin-top: 5px;
position: relative;
}
/* Day wrapper button styles */
.calendarContainer .dayWrapper button {
border: none;
background: none;
outline: none;
width: 100%;
cursor: pointer;
width: 40px;
height: 40px;
border-radius: 50%;
font-size: 1.1em;
padding: 0;
line-height: 1.5;
padding: 0px 0px 1px 0px;
}
.jalaali.calendarContainer .dayWrapper button {
padding: 0px 0px 1px 0px;
}
.calendarContainer .dayWrapper:not(.selected) button:hover {
background-color: #d6f1ff;
}
.calendarContainer .dayWrapper button[disabled] {
color: #aaa;
cursor: not-allowed;
background-color: #ebebeb;
}
.calendarContainer .dayWrapper button.selected {
background-color: #337ab7;
color: #ffffff;
}
.calendarContainer .dayWrapper:not(.currentMonth) button {
opacity: 0.5;
}
/* Days of week row */
.calendarContainer .daysOfWeek {
margin-bottom: 5px;
padding-bottom: 5px;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
width: 100%;
color: #919191;
}
.calendarContainer .daysOfWeek > div {
-webkit-box-flex: 1;
-ms-flex-positive: 1;
flex-grow: 1;
-webkit-box-pack: justify;
-ms-flex-pack: justify;
justify-content: space-between;
width: 42px;
}
/* Month selector portion */
.calendarContainer .monthsList {
clear: both;
width: 100%;
}
.calendarContainer .monthsList button {
width: 33.33333332%;
height: 25%;
float: right;
border: 1px solid #f9f9f9;
outline: none;
font-size: 1em;
background: #fff;
padding: 10px 0;
cursor: pointer;
}
.calendarContainer .monthsList button:hover {
background: #eeeeee;
cursor: pointer;
}
/* Year selector portion */
.calendarContainer .yearsList {
clear: both;
width: 100%;
max-height: 200px;
overflow-y: scroll;
}
.calendarContainer .yearsList button {
width: 20%;
height: 25%;
float: right;
border: 1px solid #f9f9f9;
outline: none;
font-size: 1em;
background: #fff;
padding: 10px 0;
cursor: pointer;
}
.calendarContainer .yearsList button:hover {
background: #eeeeee;
cursor: pointer;
}
/* Selected state of buttons */
.calendarContainer .selected button,
.calendarContainer .selected button:hover :not([disabled]),
.calendarContainer .selected button:active,
.calendarContainer .selected button:focus {
background-color: #4285f4;
color: #ffffff;
}
.calendarContainer.jalaali {
direction: rtl;
}
.calendarContainer.jalaali .dayWrapper {
float: right;
}
/*time picker style*/
.time-picker-container {
margin-bottom: 10;
}
.time-picker-container > .time-label {
float: left;
line-height: 30px;
width: 50%;
text-align: center;
}
.time-picker-container > .time-picker-panel {
float: right;
width: 50%;
}
.time-picker-container.jalaali > .time-label {
float: right;
}
.time-picker-container.jalaali > .time-picker-panel {
float: left;
}
.rc-time-picker {
border-radius: 4px;
display: inline-block;
-webkit-box-sizing: border-box;
box-sizing: border-box;
width: 110px;
border: 1px solid #f7f7f7;
font-size: 1.2em;
}
.rc-time-picker * {
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
.rc-time-picker-input {
margin: 4px 0;
padding: 0px 15px 1px 15px;
direction: ltr;
text-align: center;
width: 100%;
position: relative;
display: inline-block;
cursor: pointer;
font-size: 1em;
line-height: 1.5;
border: none;
background-image: none;
background-color: transparent;
-webkit-box-shadow: none;
box-shadow: none;
}
.jalaali.calendarContainer .rc-time-picker-input {
padding: 0px 15px 3px 15px;
}
.rc-time-picker-input:focus {
-webkit-box-shadow: none;
box-shadow: none;
border: none;
background-color: #f2f2f2;
}
.rc-time-picker:hover {
background-color: #f2f2f2;
}
.rc-time-picker-panel {
z-index: 2001;
width: 170px;
position: absolute;
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
.rc-time-picker-panel * {
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
.rc-time-picker-panel-inner {
display: inline-block;
position: relative;
outline: none;
list-style: none;
font-size: 12px;
text-align: left;
background-color: #fff;
border-radius: 3px;
-webkit-box-shadow: 0 1px 5px #ccc;
box-shadow: 0 1px 5px #ccc;
background-clip: padding-box;
border: 1px solid #ccc;
line-height: 1.5;
}
.rc-time-picker-panel-input {
margin: 0;
padding: 0;
width: 100%;
cursor: default;
line-height: 1.5;
outline: 0;
border: 1px solid transparent;
padding: 4px 0;
font-size: 1.4em;
text-align: center;
font-family: inherit;
}
.rc-time-picker-panel-input,
.rc-time-picker-panel-input:hover {
-webkit-box-shadow: none;
box-shadow: none;
border: none;
}
.rc-time-picker-panel-input-wrap {
-webkit-box-sizing: border-box;
box-sizing: border-box;
position: relative;
padding: 6px;
border-bottom: 1px solid #e9e9e9;
}
.rc-time-picker-panel-input-invalid {
border-color: red;
}
.rc-time-picker-panel-clear-btn {
position: absolute;
right: 6px;
cursor: pointer;
overflow: hidden;
width: 20px;
height: 20px;
text-align: center;
line-height: 20px;
top: 6px;
margin: 0;
}
.rc-time-picker-panel-clear-btn:after {
content: 'x';
font-size: 12px;
color: #aaa;
display: inline-block;
line-height: 1;
width: 20px;
-webkit-transition: color 0.3s ease;
transition: color 0.3s ease;
}
.rc-time-picker-panel-clear-btn:hover:after {
color: #666;
}
.rc-time-picker-panel-select {
float: left;
font-size: 12px;
border: 1px solid #e9e9e9;
border-width: 0 1px;
margin-left: -1px;
-webkit-box-sizing: border-box;
box-sizing: border-box;
width: 56px;
overflow: hidden;
position: relative;
}
.rc-time-picker-panel-select-active {
overflow-y: auto;
}
.rc-time-picker-panel-select:first-child {
border-left: 0;
margin-left: 0;
}
.rc-time-picker-panel-select:last-child {
border-right: 0;
}
.rc-time-picker-panel-select ul {
list-style: none;
-webkit-box-sizing: border-box;
box-sizing: border-box;
margin: 0;
padding: 0;
width: 100%;
max-height: 144px;
overflow-x: hidden;
overflow-y: scroll;
}
.rc-time-picker-panel-select li {
list-style: none;
-webkit-box-sizing: content-box;
box-sizing: content-box;
margin: 0;
padding: 0 0 0 16px;
width: 100%;
height: 24px;
line-height: 24px;
text-align: left;
cursor: pointer;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.rc-time-picker-panel-select li:hover {
background: #edfaff;
}
li.rc-time-picker-panel-select-option-selected {
background: #edfaff;
color: #2db7f5;
}
li.rc-time-picker-panel-select-option-disabled {
color: #bfbfbf;
}
li.rc-time-picker-panel-select-option-disabled:hover {
background: transparent;
cursor: not-allowed;
}
.tether-element.tether-element-attached-top.tether-element-attached-center.tether-target-attached-bottom.tether-target-attached-center.tether-enabled {
z-index: 2000;
}
.calendarContainer *,
.datepicker-input {
font-family: inherit;
}
.today button {
border: 3px solid #4285f4 ;
}
.jalaali.calendarContainer .selectToday {
padding: 4px 0 6px 0;
}
.calendarButton {
display: block;
width: 100%;
background: #4285f4;
color: #fff;
outline: none;
border-radius: 5px;
border: 0;
cursor: pointer;
padding: 5px 0 7px 0;
-webkit-transition: 0.2s all ease-in-out;
transition: 0.2s all ease-in-out;
-webkit-transition-property: background;
transition-property: background;
}
.calendarButton:hover {
background: #1266f1;
}
.toggleButton {
margin-bottom: 1rem;
}
.selectToday {
margin-top: 1rem;
}
.highLightDot-container {
text-align: center;
bottom: 0;
width: 100%;
position: absolute;
cursor: pointer;
direction: ltr;
}
.highLightDot-container .highLightDot {
border: 1px solid #fff;
display: inline-block;
width: 7px;
height: 7px;
border-radius: 50%;
}
.highLightDot-container .highLightDot:not(:first-child) {
margin-left: 2px;
}
.disabled {
cursor: not-allowed;
}
button[disabled],
button[disabled]:hover {
color: #aaa;
cursor: not-allowed;
background-color: #ebebeb;
}
/*# sourceMappingURL=style.css.map */