2023-10-02 10:46:09 +00:00
|
|
|
import BaseStyle from 'primevue/base/style';
|
|
|
|
|
|
|
|
const inlineStyles = {
|
|
|
|
root: ({ props }) => ({ position: props.appendTo === 'self' ? 'relative' : undefined })
|
|
|
|
};
|
|
|
|
|
|
|
|
const classes = {
|
|
|
|
root: ({ props, state }) => [
|
2024-04-06 22:44:28 +00:00
|
|
|
'p-datepicker p-component p-inputwrapper',
|
2023-10-02 10:46:09 +00:00
|
|
|
{
|
2024-01-30 11:27:56 +00:00
|
|
|
'p-invalid': props.invalid,
|
2023-10-02 10:46:09 +00:00
|
|
|
'p-inputwrapper-filled': props.modelValue,
|
|
|
|
'p-inputwrapper-focus': state.focused,
|
|
|
|
'p-focus': state.focused || state.overlayVisible
|
|
|
|
}
|
|
|
|
],
|
2024-04-06 22:44:28 +00:00
|
|
|
input: 'p-datepicker-input',
|
|
|
|
dropdownButton: 'p-datepicker-dropdown',
|
2024-04-09 06:13:39 +00:00
|
|
|
inputIconContainer: 'p-datepicker-input-icon-container',
|
2024-04-06 22:44:28 +00:00
|
|
|
inputIcon: 'p-datepicker-input-icon',
|
|
|
|
panel: ({ instance, props }) => [
|
|
|
|
'p-datepicker-panel p-component',
|
2023-10-02 10:46:09 +00:00
|
|
|
{
|
2024-04-06 22:44:28 +00:00
|
|
|
'p-datepicker-panel-inline': props.inline,
|
2023-10-02 10:46:09 +00:00
|
|
|
'p-disabled': props.disabled,
|
|
|
|
'p-datepicker-timeonly': props.timeOnly,
|
|
|
|
'p-ripple-disabled': instance.$primevue.config.ripple === false
|
|
|
|
}
|
|
|
|
],
|
2024-04-06 22:44:28 +00:00
|
|
|
group: 'p-datepicker-calendar-container',
|
|
|
|
calendar: 'p-datepicker-calendar',
|
2023-10-02 10:46:09 +00:00
|
|
|
header: 'p-datepicker-header',
|
2024-04-09 08:27:15 +00:00
|
|
|
previousButton: 'p-datepicker-prev-button',
|
2023-10-02 10:46:09 +00:00
|
|
|
title: 'p-datepicker-title',
|
2024-04-06 22:44:28 +00:00
|
|
|
monthTitle: 'p-datepicker-view-month p-link',
|
|
|
|
yearTitle: 'p-datepicker-view-year p-link',
|
2023-10-02 10:46:09 +00:00
|
|
|
decadeTitle: 'p-datepicker-decade',
|
2024-04-09 08:27:15 +00:00
|
|
|
nextButton: 'p-datepicker-next-button',
|
2024-04-06 22:44:28 +00:00
|
|
|
grid: 'p-datepicker-day-view',
|
2023-10-02 10:46:09 +00:00
|
|
|
weekHeader: 'p-datepicker-weekheader p-disabled',
|
|
|
|
weekNumber: 'p-datepicker-weeknumber',
|
|
|
|
weekLabelContainer: 'p-disabled',
|
2024-04-06 22:44:28 +00:00
|
|
|
weekDay: 'p-datepicker-weekday-cell',
|
|
|
|
weekDayLabel: 'p-date-picker-weekday',
|
|
|
|
day: ({ date }) => ['p-datepicker-day-cell', { 'p-datepicker-other-month': date.otherMonth, 'p-datepicker-today': date.today }],
|
|
|
|
dayLabel: ({ instance, props, date }) => ['p-datepicker-day', { 'p-datepicker-day-selected': instance.isSelected(date) && date.selectable, 'p-disabled': props.disabled || !date.selectable }],
|
|
|
|
monthPicker: 'p-datepicker-month-view',
|
|
|
|
month: ({ instance, props, month, index }) => ['p-datepicker-month', { 'p-datepicker-month-selected': instance.isMonthSelected(index), 'p-disabled': props.disabled || !month.selectable }],
|
|
|
|
yearPicker: 'p-datepicker-year-view',
|
|
|
|
year: ({ instance, props, year }) => ['p-datepicker-year', { 'p-datepicker-year-selected': instance.isYearSelected(year.value), 'p-disabled': props.disabled || !year.selectable }],
|
2024-04-08 15:30:31 +00:00
|
|
|
timePicker: 'p-datepicker-time-picker',
|
|
|
|
hourPicker: 'p-datepicker-hour-picker',
|
|
|
|
incrementButton: 'p-datepicker-increment-button',
|
|
|
|
decrementButton: 'p-datepicker-decrement-button',
|
|
|
|
separatorContainer: 'p-datepicker-separator',
|
2023-10-02 10:46:09 +00:00
|
|
|
minutePicker: 'p-minute-picker',
|
|
|
|
secondPicker: 'p-second-picker',
|
|
|
|
ampmPicker: 'p-ampm-picker',
|
|
|
|
buttonbar: 'p-datepicker-buttonbar',
|
2024-04-08 15:30:31 +00:00
|
|
|
todayButton: 'p-datepicker-today-button',
|
|
|
|
clearButton: 'p-datepicker-clear-button'
|
2023-10-02 10:46:09 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
export default BaseStyle.extend({
|
|
|
|
name: 'calendar',
|
|
|
|
classes,
|
|
|
|
inlineStyles
|
|
|
|
});
|