primevue-mirror/components/lib/themes/primeone/base/calendar/index.js

338 lines
8.9 KiB
JavaScript
Raw Normal View History

2024-02-21 07:46:48 +00:00
export default {
css: ({ dt }) => `
2024-04-06 22:44:28 +00:00
.p-datepicker {
2024-02-21 07:46:48 +00:00
display: inline-flex;
max-width: 100%;
}
2024-04-06 22:44:28 +00:00
.p-datepicker-input {
2024-02-21 07:46:48 +00:00
flex: 1 1 auto;
width: 1%;
}
2024-04-06 22:44:28 +00:00
.p-datepicker:has(.p-datepicker-dropdown) .p-datepicker-input {
2024-02-21 07:46:48 +00:00
border-top-right-radius: 0;
border-bottom-right-radius: 0;
}
2024-04-06 22:44:28 +00:00
.p-datepicker-dropdown {
2024-03-25 09:24:03 +00:00
cursor: pointer;
display: inline-flex;
cursor: pointer;
user-select: none;
align-items: center;
justify-content: center;
overflow: hidden;
position: relative;
width: ${dt('calendar.dropdown.width')};
border-top-right-radius: ${dt('rounded.base')};
border-bottom-right-radius: ${dt('rounded.base')};
background: ${dt('calendar.dropdown.background')};
border: 1px solid ${dt('calendar.dropdown.border.color')};
border-left: 0 none;
background: ${dt('calendar.dropdown.background')};
transition: background-color ${dt('transition.duration')}, color ${dt('transition.duration')}, border-color ${dt('transition.duration')}, outline-color ${dt('transition.duration')};
outline-color: transparent;
}
2024-04-06 22:44:28 +00:00
.p-datepicker-dropdown:not(:disabled):hover {
2024-03-25 09:24:03 +00:00
background: ${dt('calendar.dropdown.hover.background')};
border-color: ${dt('calendar.dropdown.hover.border.color')};
background: ${dt('calendar.dropdown.hover.background')};
}
2024-04-06 22:44:28 +00:00
.p-datepicker-dropdown:not(:disabled):active {
2024-03-25 09:24:03 +00:00
background: ${dt('calendar.dropdown.active.background')};
border-color: ${dt('calendar.dropdown.active.border.color')};
background: ${dt('calendar.dropdown.active.background')};
}
2024-04-06 22:44:28 +00:00
.p-datepicker-dropdown:focus-visible {
outline: ${dt('focus.ring.width')} ${dt('focus.ring.style')} ${dt('focus.ring.color')};
2024-03-25 09:24:03 +00:00
outline-offset: ${dt('focus.ring.offset')};
}
2024-04-06 22:44:28 +00:00
.p-datepicker:has(.p-datepicker-input-icon) {
2024-03-25 09:24:03 +00:00
position: relative;
}
2024-04-06 22:44:28 +00:00
.p-datepicker:has(.p-datepicker-input-icon) .p-datepicker-input {
2024-03-25 09:24:03 +00:00
padding-right: 2.5rem;
2024-02-21 07:46:48 +00:00
}
2024-04-06 22:44:28 +00:00
.p-datepicker-input-icon {
2024-02-21 07:46:48 +00:00
cursor: pointer;
2024-03-25 09:24:03 +00:00
position: absolute;
top: 50%;
right: .75rem;
margin-top: -.5rem;
2024-02-21 07:46:48 +00:00
}
2024-04-06 22:44:28 +00:00
.p-fluid .p-datepicker {
2024-02-21 07:46:48 +00:00
display: flex;
}
2024-04-06 22:44:28 +00:00
.p-fluid .p-datepicker-input {
2024-02-21 07:46:48 +00:00
width: 1%;
}
2024-04-06 22:44:28 +00:00
.p-datepicker .p-datepicker-panel {
2024-02-21 07:46:48 +00:00
min-width: 100%;
}
2024-04-06 22:44:28 +00:00
.p-datepicker-panel {
2024-02-21 07:46:48 +00:00
width: auto;
padding: 0.75rem;
2024-03-13 11:59:34 +00:00
background: ${dt('calendar.background')};
color: ${dt('calendar.color')};
border: 1px solid ${dt('calendar.border.color')};
border-radius: ${dt('rounded.base')};
2024-02-21 07:46:48 +00:00
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
}
2024-04-06 22:44:28 +00:00
.p-datepicker-panel-inline {
2024-02-21 07:46:48 +00:00
display: inline-block;
overflow-x: auto;
box-shadow: none;
}
.p-datepicker-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 0 0.5rem 0;
font-weight: 500;
2024-03-13 11:59:34 +00:00
background: ${dt('calendar.header.background')};
color: ${dt('calendar.header.color')};
border-bottom: 1px solid ${dt('calendar.header.border.color')};
2024-02-21 07:46:48 +00:00
}
.p-datepicker-title {
margin: 0 auto;
line-height: 1.75rem;
}
2024-04-06 22:44:28 +00:00
.p-datepicker-view-year,
.p-datepicker-view-month {
2024-02-21 07:46:48 +00:00
font-weight: 500;
padding: 0.25rem;
transition: background-color ${dt('transition.duration')}, color ${dt('transition.duration')}, border-color ${dt('transition.duration')}, box-shadow ${dt('transition.duration')}, outline-color ${dt('transition.duration')};
2024-02-21 07:46:48 +00:00
}
2024-04-06 22:44:28 +00:00
.p-datepicker-view-month {
2024-02-21 07:46:48 +00:00
margin-right: 0.5rem;
2024-03-13 11:59:34 +00:00
color: ${dt('calendar.month.picker.color')};
2024-02-21 07:46:48 +00:00
}
2024-04-06 22:44:28 +00:00
.p-datepicker-view-year {
2024-02-21 07:46:48 +00:00
margin-right: 0.5rem;
2024-03-13 11:59:34 +00:00
color: ${dt('calendar.year.picker.color')};
2024-02-21 07:46:48 +00:00
}
2024-04-06 22:44:28 +00:00
.p-datepicker-view-month:enabled:hover {
2024-03-13 11:59:34 +00:00
background: ${dt('calendar.month.picker.hover.background')};
color: ${dt('calendar.month.picker.hover.color')};
2024-02-21 07:46:48 +00:00
}
2024-04-06 22:44:28 +00:00
.p-datepicker-view-year:enabled:hover {
2024-03-13 11:59:34 +00:00
background: ${dt('calendar.year.picker.hover.background')};
color: ${dt('calendar.year.picker.hover.color')};
2024-02-21 07:46:48 +00:00
}
2024-04-06 22:44:28 +00:00
.p-datepicker-calendar-container {
2024-02-21 07:46:48 +00:00
display: flex;
}
2024-04-06 22:44:28 +00:00
.p-datepicker-calendar-container .p-datepicker-calendar {
2024-02-21 07:46:48 +00:00
flex: 1 1 auto;
2024-03-13 11:59:34 +00:00
border-left: 1px solid ${dt('calendar.group.border.color')};
2024-02-21 07:46:48 +00:00
padding-right: 0.75rem;
padding-left: 0.75rem;
padding-top: 0;
padding-bottom: 0;
}
2024-04-06 22:44:28 +00:00
.p-datepicker-calendar-container .p-datepicker-calendar:first-child {
2024-02-21 07:46:48 +00:00
padding-left: 0;
border-left: 0 none;
}
2024-04-06 22:44:28 +00:00
.p-datepicker-calendar-container .p-datepicker-calendar:last-child {
2024-02-21 07:46:48 +00:00
padding-right: 0;
}
2024-04-06 22:44:28 +00:00
.p-datepicker-day-view {
2024-02-21 07:46:48 +00:00
width: 100%;
border-collapse: collapse;
font-size: 1rem;
margin: 0.5rem 0 0 0;
}
2024-04-06 22:44:28 +00:00
.p-datepicker-weekday-cell {
2024-02-21 07:46:48 +00:00
padding: 0.25rem;
}
2024-04-06 22:44:28 +00:00
.p-datepicker-weekday {
font-weight: 500;
2024-02-21 07:46:48 +00:00
}
2024-04-06 22:44:28 +00:00
.p-datepicker-day-cell {
2024-02-21 07:46:48 +00:00
padding: 0.25rem;
}
2024-04-06 22:44:28 +00:00
.p-datepicker-day {
2024-02-21 07:46:48 +00:00
display: flex;
justify-content: center;
align-items: center;
cursor: pointer;
margin: 0 auto;
overflow: hidden;
position: relative;
width: 2rem;
height: 2rem;
border-radius: 50%;
transition: background-color ${dt('transition.duration')}, color ${dt('transition.duration')}, border-color ${dt('transition.duration')}, box-shadow ${dt('transition.duration')}, outline-color ${dt('transition.duration')};
2024-02-21 07:46:48 +00:00
border: 1px solid transparent;
outline-color: transparent;
2024-03-13 11:59:34 +00:00
color: ${dt('calendar.date.color')};
2024-02-21 07:46:48 +00:00
}
2024-04-06 22:44:28 +00:00
.p-datepicker-day:not(.p-datepicker-day-selected):not(.p-disabled):hover {
2024-03-13 11:59:34 +00:00
background: ${dt('calendar.date.hover.background')};
color: ${dt('calendar.date.hover.color')};
2024-02-21 07:46:48 +00:00
}
2024-04-06 22:44:28 +00:00
.p-datepicker-day:focus-visible {
outline: 1px solid ${dt('focus.ring.color')};
outline-offset: ${dt('focus.ring.offset')};
2024-02-21 07:46:48 +00:00
}
2024-04-06 22:44:28 +00:00
.p-datepicker-day-selected {
2024-03-13 11:59:34 +00:00
background: ${dt('calendar.date.selected.background')};
color: ${dt('calendar.date.selected.color')};
2024-02-21 07:46:48 +00:00
}
2024-04-06 22:44:28 +00:00
.p-datepicker-today > .p-datepicker-day {
2024-03-13 11:59:34 +00:00
background: ${dt('calendar.today.background')};
color: ${dt('calendar.today.color')};
2024-02-21 07:46:48 +00:00
}
2024-04-06 22:44:28 +00:00
.p-datepicker-today > .p-datepicker-day-selected {
2024-03-13 11:59:34 +00:00
background: ${dt('calendar.date.selected.background')};
color: ${dt('calendar.date.selected.color')};
2024-02-21 07:46:48 +00:00
}
2024-04-06 22:44:28 +00:00
.p-datepicker-month-view {
2024-02-21 07:46:48 +00:00
margin: 0.5rem 0 0 0;
}
2024-04-06 22:44:28 +00:00
.p-datepicker-month {
2024-02-21 07:46:48 +00:00
width: 33.3%;
display: inline-flex;
align-items: center;
justify-content: center;
cursor: pointer;
overflow: hidden;
position: relative;
padding: 0.25rem;
transition: background-color ${dt('transition.duration')}, color ${dt('transition.duration')}, border-color ${dt('transition.duration')}, box-shadow ${dt('transition.duration')}, outline-color ${dt('transition.duration')};
border-radius: ${dt('rounded.base')};
2024-02-21 07:46:48 +00:00
outline-color: transparent;
2024-03-13 11:59:34 +00:00
color: ${dt('calendar.month.color')};
2024-02-21 07:46:48 +00:00
}
2024-04-06 22:44:28 +00:00
.p-datepicker-month:not(.p-disabled):not(.p-datepicker-month-selected):hover {
2024-03-13 11:59:34 +00:00
color: ${dt('calendar.month.hover.color')};
background: ${dt('calendar.month.hover.background')};
2024-02-21 07:46:48 +00:00
}
2024-04-06 22:44:28 +00:00
.p-datepicker-month-selected {
2024-03-13 11:59:34 +00:00
color: ${dt('calendar.month.selected.color')};
background: ${dt('calendar.month.selected.background')};
2024-02-21 07:46:48 +00:00
}
2024-04-06 22:44:28 +00:00
.p-datepicker-month:not(.p-disabled):focus-visible {
outline: ${dt('focus.ring.width')} solid ${dt('focus.ring.color')};
2024-02-21 07:46:48 +00:00
outline-offset: 0;
}
2024-04-06 22:44:28 +00:00
.p-datepicker-year-view {
2024-02-21 07:46:48 +00:00
margin: 0.5rem 0 0 0;
}
2024-04-06 22:44:28 +00:00
.p-datepicker-year {
2024-02-21 07:46:48 +00:00
width: 50%;
display: inline-flex;
align-items: center;
justify-content: center;
cursor: pointer;
overflow: hidden;
position: relative;
padding: 0.25rem;
transition: background-color ${dt('transition.duration')}, color ${dt('transition.duration')}, border-color ${dt('transition.duration')}, box-shadow ${dt('transition.duration')}, outline-color ${dt('transition.duration')};
border-radius: ${dt('rounded.base')};
2024-02-21 07:46:48 +00:00
outline-color: transparent;
2024-03-13 11:59:34 +00:00
color: ${dt('calendar.year.color')};
2024-02-21 07:46:48 +00:00
}
2024-04-06 22:44:28 +00:00
.p-datepicker-year:not(.p-disabled):not(.p-datepicker-year-selected):hover {
2024-03-13 11:59:34 +00:00
color: ${dt('calendar.year.hover.color')};
background: ${dt('calendar.year.hover.background')};
2024-02-21 07:46:48 +00:00
}
2024-04-06 22:44:28 +00:00
.p-datepicker-year-selected {
2024-03-13 11:59:34 +00:00
color: ${dt('calendar.year.selected.color')};
background: ${dt('calendar.year.selected.background')};
2024-02-21 07:46:48 +00:00
}
2024-04-06 22:44:28 +00:00
.p-datepicker-year:not(.p-disabled):focus-visible {
outline: ${dt('focus.ring.width')} solid ${dt('focus.ring.color')};
2024-02-21 07:46:48 +00:00
outline-offset: 0;
}
.p-datepicker-buttonbar {
display: flex;
justify-content: space-between;
align-items: center;
padding: 0.5rem 0 0 0;
2024-03-13 11:59:34 +00:00
border-top: 1px solid ${dt('calendar.buttonbar.border.color')};
2024-02-21 07:46:48 +00:00
}
.p-datepicker-buttonbar .p-button {
width: auto;
}
2024-04-08 15:30:31 +00:00
.p-datepicker-time-picker {
2024-02-21 07:46:48 +00:00
display: flex;
justify-content: center;
align-items: center;
2024-03-13 11:59:34 +00:00
border-top: 1px solid ${dt('calendar.timepicker.border.color')};
2024-02-21 07:46:48 +00:00
padding: 0;
}
2024-04-06 22:44:28 +00:00
.p-datepicker-calendar-group + .p-timepicker {
2024-02-21 07:46:48 +00:00
margin-top: 0.5rem;
padding-top: 0.5rem;
}
2024-04-08 15:30:31 +00:00
.p-datepicker-time-picker > div {
2024-02-21 07:46:48 +00:00
display: flex;
align-items: center;
flex-direction: column;
padding: 0 0.5rem;
}
2024-04-08 15:30:31 +00:00
.p-datepicker-time-picker button:last-child {
2024-02-21 07:46:48 +00:00
margin-top: 0.2em;
}
2024-04-08 15:30:31 +00:00
.p-datepicker-time-picker span {
2024-02-21 07:46:48 +00:00
font-size: 1rem;
}
2024-04-08 15:30:31 +00:00
.p-datepicker-timeonly .p-datepicker-time-picker {
2024-02-21 07:46:48 +00:00
border-top: 0 none;
}
`
};