Migrated calendar

pull/5507/head
Cagatay Civici 2024-02-21 10:46:48 +03:00
parent 37a080dad2
commit 4bc3527a38
6 changed files with 514 additions and 0 deletions

View File

@ -0,0 +1,366 @@
export default {
css: `
.p-calendar {
display: inline-flex;
max-width: 100%;
}
.p-calendar .p-inputtext {
flex: 1 1 auto;
width: 1%;
}
.p-calendar-w-btn .p-inputtext {
border-top-right-radius: 0;
border-bottom-right-radius: 0;
}
.p-calendar-w-btn .p-datepicker-trigger {
border-top-left-radius: 0;
border-bottom-left-radius: 0;
}
.p-calendar .p-datepicker-trigger-icon {
cursor: pointer;
}
.p-fluid .p-calendar {
display: flex;
}
.p-fluid .p-calendar .p-inputtext {
width: 1%;
}
.p-calendar .p-datepicker {
min-width: 100%;
}
.p-datepicker {
width: auto;
padding: 0.75rem;
background: var(--p-calendar-background);
color: var(--p-calendar-text-color);
border: 1px solid var(--p-calendar-border-color);
border-radius: var(--p-rounded-base);
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
}
.p-datepicker-inline {
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;
background: var(--p-calendar-header-background);
color: var(--p-calendar-header-text-color);
border-bottom: 1px solid var(--p-calendar-header-border-color);
}
.p-datepicker-title {
margin: 0 auto;
line-height: 1.75rem;
}
.p-datepicker-prev,
.p-datepicker-next {
cursor: pointer;
display: inline-flex;
justify-content: center;
align-items: center;
overflow: hidden;
position: relative;
width: 1.75rem;
height: 1.75rem;
color: var(--p-calendar-navigator-color);
border: 0 none;
background: transparent;
border-radius: 50%;
transition: background-color var(--p-transition-duration), color var(--p-transition-duration), border-color var(--p-transition-duration), box-shadow var(--p-transition-duration), outline-color var(--p-transition-duration);
outline-color: transparent;
}
.p-datepicker-prev:enabled:hover,
.p-datepicker-next:enabled:hover {
color: var(--p-calendar-navigator-color-hover);
background: var(--p-calendar-navigator-background-hover);
}
.p-datepicker-prev:focus-visible,
.p-datepicker-next:focus-visible {
outline: var(--p-focus-ring-width) var(--p-focus-ring-style) var(--p-focus-ring-color);
outline-offset: var(--p-focus-ring-offset);
}
.p-datepicker-year,
.p-datepicker-month {
font-weight: 500;
padding: 0.25rem;
transition: background-color var(--p-transition-duration), color var(--p-transition-duration), border-color var(--p-transition-duration), box-shadow var(--p-transition-duration), outline-color var(--p-transition-duration);
}
.p-datepicker-month {
margin-right: 0.5rem;
color: var(--p-calendar-month-picker-text-color);
}
.p-datepicker-year {
margin-right: 0.5rem;
color: var(--p-calendar-year-picker-text-color);
}
.p-datepicker-month:enabled:hover {
color: var(--p-calendar-month-picker-text-color-hover);
background: var(--p-calendar-month-picker-background-hover);
}
.p-datepicker-year:enabled:hover {
color: var(--p-calendar-year-picker-text-color-hover);
background: var(--p-calendar-year-picker-background-hover);
}
.p-datepicker-multiple-month .p-datepicker-group-container {
display: flex;
}
.p-datepicker-multiple-month .p-datepicker-group {
flex: 1 1 auto;
border-left: 1px solid var(--p-calendar-group-border-color);
padding-right: 0.75rem;
padding-left: 0.75rem;
padding-top: 0;
padding-bottom: 0;
}
.p-datepicker.p-datepicker-multiple-month .p-datepicker-group:first-child {
padding-left: 0;
border-left: 0 none;
}
.p-datepicker.p-datepicker-multiple-month .p-datepicker-group:last-child {
padding-right: 0;
}
.p-datepicker table {
width: 100%;
border-collapse: collapse;
font-size: 1rem;
margin: 0.5rem 0 0 0;
}
.p-datepicker table th {
padding: 0.25rem;
font-weight: 500;
}
.p-datepicker table th > span {
width: 2rem;
height: 2rem;
}
.p-datepicker table td {
padding: 0.25rem;
}
.p-datepicker td > span {
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 var(--p-transition-duration), color var(--p-transition-duration), border-color var(--p-transition-duration), box-shadow var(--p-transition-duration), outline-color var(--p-transition-duration);
border: 1px solid transparent;
outline-color: transparent;
color: var(--p-calendar-date-text-color);
}
.p-datepicker:not(.p-disabled) table td span:not(.p-highlight):not(.p-disabled):hover {
background: var(--p-calendar-date-background-hover);
color: var(--p-calendar-date-text-color-hover);
}
.p-datepicker:not(.p-disabled) table td span:not(.p-highlight):not(.p-disabled):focus-visible {
outline: 1px solid var(--p-focus-ring-color);
outline-offset: var(--p-focus-ring-offset);
}
.p-datepicker table td > span.p-highlight {
background: var(--p-calendar-date-background-highlight);
color: var(--p-calendar-date-text-color-highlight);
}
.p-datepicker table td.p-datepicker-today > span {
background: var(--p-calendar-today-background);
color: var(--p-calendar-today-text-color);
}
.p-datepicker table td.p-datepicker-today > span.p-highlight {
background: var(--p-calendar-date-background-highlight);
color: var(--p-calendar-date-text-color-highlight);
}
.p-monthpicker {
margin: 0.5rem 0 0 0;
}
.p-monthpicker-month {
width: 33.3%;
display: inline-flex;
align-items: center;
justify-content: center;
cursor: pointer;
overflow: hidden;
position: relative;
padding: 0.25rem;
transition: background-color var(--p-transition-duration), color var(--p-transition-duration), border-color var(--p-transition-duration), box-shadow var(--p-transition-duration), outline-color var(--p-transition-duration);
border-radius: var(--p-rounded-base);
outline-color: transparent;
color: var(--p-calendar-month-text-color);
}
.p-datepicker:not(.p-disabled) .p-monthpicker .p-monthpicker-month:not(.p-disabled):not(.p-highlight):hover {
background: var(--p-calendar-month-background-hover);
color: var(--p-calendar-month-text-color-hover);
}
.p-monthpicker-month.p-highlight {
background: var(--p-calendar-month-background-selected);
color: var(--p-calendar-month-text-color-selected);
}
.p-datepicker:not(.p-disabled) .p-monthpicker .p-monthpicker-month:not(.p-disabled):focus-visible {
outline: var(--p-focus-ring-width) solid var(--p-focus-ring-color);
outline-offset: 0;
}
/* Year Picker */
.p-yearpicker {
margin: 0.5rem 0 0 0;
}
.p-yearpicker-year {
width: 50%;
display: inline-flex;
align-items: center;
justify-content: center;
cursor: pointer;
overflow: hidden;
position: relative;
padding: 0.25rem;
transition: background-color var(--p-transition-duration), color var(--p-transition-duration), border-color var(--p-transition-duration), box-shadow var(--p-transition-duration), outline-color var(--p-transition-duration);
border-radius: var(--p-rounded-base);
outline-color: transparent;
color: var(--p-calendar-year-text-color);
}
.p-datepicker:not(.p-disabled) .p-yearpicker .p-yearpicker-year:not(.p-disabled):not(.p-highlight):hover {
background: var(--p-calendar-year-background-hover);
color: var(--p-calendar-year-text-color-hover);
}
.p-yearpicker-year.p-highlight {
background: var(--p-calendar-year-background-selected);
color: var(--p-calendar-year-text-color-selected);
}
.p-datepicker:not(.p-disabled) .p-yearpicker .p-yearpicker-year:not(.p-disabled):focus-visible {
outline: var(--p-focus-ring-width) solid var(--p-focus-ring-color);
outline-offset: 0;
}
.p-datepicker-buttonbar {
display: flex;
justify-content: space-between;
align-items: center;
padding: 0.5rem 0 0 0;
border-top: 1px solid var(--p-calendar-buttonbar-border-color);
}
.p-datepicker-buttonbar .p-button {
width: auto;
padding: 0.25rem 0.75rem;
font-size: 0.875rem;
}
.p-timepicker {
display: flex;
justify-content: center;
align-items: center;
border-top: 1px solid var(--p-calendar-timepicker-border-color);
padding: 0;
}
.p-datepicker .p-datepicker-group-container+.p-timepicker {
margin-top: 0.5rem;
padding-top: 0.5rem;
}
.p-timepicker>div {
display: flex;
align-items: center;
flex-direction: column;
padding: 0 0.5rem;
}
.p-timepicker button {
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
overflow: hidden;
position: relative;
width: 1.75rem;
height: 1.75rem;
color: var(--p-calendar-timepicker-spin-color);
border: 0 none;
background: transparent;
border-radius: 50%;
transition: background-color var(--p-transition-duration), color var(--p-transition-duration), border-color var(--p-transition-duration), box-shadow var(--p-transition-duration), outline-color var(--p-transition-duration);
outline-color: transparent;
}
.p-timepicker button:enabled:hover {
background: var(--p-calendar-timepicker-spin-background-hover);
color: var(--p-calendar-timepicker-spin-color-hover);
}
.p-timepicker button:focus-visible {
outline: 1px solid var(--p-focus-ring-color);
outline-offset: var(--p-focus-ring-offset);
}
.p-timepicker button:last-child {
margin-top: 0.2em;
}
.p-timepicker span {
font-size: 1rem;
}
.p-datepicker-timeonly .p-timepicker {
border-top: 0 none;
}
/* Touch UI */
.p-datepicker-touch-ui,
.p-calendar .p-datepicker-touch-ui {
min-width: 80vw;
}
.p-datepicker.p-datepicker-mobile table th,
.p-datepicker.p-datepicker-mobile table td {
padding: 0.25rem;
}
`
};

View File

@ -5,6 +5,7 @@ import badge from 'primevue/themes/primeone/base/badge';
import blockui from 'primevue/themes/primeone/base/blockui'; import blockui from 'primevue/themes/primeone/base/blockui';
import breadcrumb from 'primevue/themes/primeone/base/breadcrumb'; import breadcrumb from 'primevue/themes/primeone/base/breadcrumb';
import button from 'primevue/themes/primeone/base/button'; import button from 'primevue/themes/primeone/base/button';
import calendar from 'primevue/themes/primeone/base/calendar';
import card from 'primevue/themes/primeone/base/card'; import card from 'primevue/themes/primeone/base/card';
import carousel from 'primevue/themes/primeone/base/carousel'; import carousel from 'primevue/themes/primeone/base/carousel';
import checkbox from 'primevue/themes/primeone/base/checkbox'; import checkbox from 'primevue/themes/primeone/base/checkbox';
@ -81,6 +82,7 @@ export default {
blockui, blockui,
breadcrumb, breadcrumb,
button, button,
calendar,
card, card,
carousel, carousel,
checkbox, checkbox,

View File

@ -0,0 +1,138 @@
export default {
variables: {
colorScheme: {
light: {
root: {
background: '{surface.0}',
borderColor: '{surface.200}',
color: '{surface.700}'
},
header: {
background: '{surface.0}',
borderColor: '{surface.200}',
color: '{surface.700}'
},
navigator: {
backgroundHover: '{surface.100}',
color: '{surface.500}',
colorHover: '{surface.600}'
},
monthPicker: {
backgroundHover: '{surface.100}',
textColor: '{surface.700}',
textColorHover: '{surface.800}'
},
yearPicker: {
backgroundHover: '{surface.100}',
textColor: '{surface.700}',
textColorHover: '{surface.800}'
},
group: {
borderColor: '{surface.200}'
},
date: {
backgroundHover: '{surface.100}',
backgroundSelected: '{highlight.background}',
textColor: '{surface.700}',
textColorHover: '{surface.800}',
textColorSelected: '{highlight.text.color}'
},
today: {
background: '{surface.200}',
textColor: '{surface.900}'
},
month: {
backgroundHover: '{surface.100}',
backgroundSelected: '{highlight.background}',
textColor: '{surface.700}',
textColorHover: '{surface.800}',
textColorSelected: '{highlight.text.color}'
},
year: {
backgroundHover: '{surface.100}',
backgroundSelected: '{highlight.background}',
textColor: '{surface.700}',
textColorHover: '{surface.800}',
textColorSelected: '{highlight.text.color}'
},
buttonbar: {
borderColor: '{surface.200}'
},
timepicker: {
borderColor: '{surface.200}'
},
timepickerSpin: {
backgroundHover: '{surface.100}',
color: '{surface.500}',
colorHover: '{surface.600}'
}
},
dark: {
root: {
background: '{surface.900}',
borderColor: '{surface.700}',
color: '{surface.0}'
},
header: {
background: '{surface.900}',
borderColor: '{surface.700}',
color: '{surface.0}'
},
navigator: {
backgroundHover: '{surface.800}',
color: '{surface.400}',
colorHover: '{surface.300}'
},
monthPicker: {
backgroundHover: '{surface.800}',
textColor: '{surface.0}',
textColorHover: '{surface.0}'
},
yearPicker: {
backgroundHover: '{surface.800}',
textColor: '{surface.0}',
textColorHover: '{surface.0}'
},
group: {
borderColor: '{surface.700}'
},
date: {
backgroundHover: '{surface.800}',
backgroundSelected: '{highlight.background}',
textColor: '{surface.0}',
textColorHover: '{surface.0}',
textColorSelected: '{highlight.text.color}'
},
today: {
background: '{surface.700}',
textColor: '{surface.0}'
},
month: {
backgroundHover: '{surface.800}',
backgroundSelected: '{highlight.background}',
textColor: '{surface.0}',
textColorHover: '{surface.0}',
textColorSelected: '{highlight.text.color}'
},
year: {
backgroundHover: '{surface.800}',
backgroundSelected: '{highlight.background}',
textColor: '{surface.0}',
textColorHover: '{surface.0}',
textColorSelected: '{highlight.text.color}'
},
buttonbar: {
borderColor: '{surface.700}'
},
timepicker: {
borderColor: '{surface.700}'
},
timepickerSpin: {
backgroundHover: '{surface.800}',
color: '{surface.400}',
colorHover: '{surface.300}'
}
}
}
}
};

View File

@ -0,0 +1,6 @@
{
"main": "./index.cjs.js",
"module": "./index.esm.js",
"unpkg": "./index.min.js",
"types": "./index.d.ts"
}

View File

@ -5,6 +5,7 @@ import badge from 'primevue/themes/primeone/presets/aura/badge';
import blockui from 'primevue/themes/primeone/presets/aura/blockui'; import blockui from 'primevue/themes/primeone/presets/aura/blockui';
import breadcrumb from 'primevue/themes/primeone/presets/aura/breadcrumb'; import breadcrumb from 'primevue/themes/primeone/presets/aura/breadcrumb';
import button from 'primevue/themes/primeone/presets/aura/button'; import button from 'primevue/themes/primeone/presets/aura/button';
import calendar from 'primevue/themes/primeone/presets/aura/calendar';
import card from 'primevue/themes/primeone/presets/aura/card'; import card from 'primevue/themes/primeone/presets/aura/card';
import carousel from 'primevue/themes/primeone/presets/aura/carousel'; import carousel from 'primevue/themes/primeone/presets/aura/carousel';
import checkbox from 'primevue/themes/primeone/presets/aura/checkbox'; import checkbox from 'primevue/themes/primeone/presets/aura/checkbox';
@ -222,6 +223,7 @@ export default {
blockui, blockui,
breadcrumb, breadcrumb,
button, button,
calendar,
card, card,
carousel, carousel,
checkbox, checkbox,