From c0076f770ca48bf12fb6f017318c540c0a5f5771 Mon Sep 17 00:00:00 2001 From: tugcekucukoglu Date: Tue, 9 Apr 2024 09:05:44 +0300 Subject: [PATCH] Refactor #5548 - For Calendar --- components/lib/calendar/BaseCalendar.vue | 12 ++ components/lib/calendar/Calendar.d.ts | 24 ++- components/lib/calendar/Calendar.vue | 226 +++++++++++++---------- 3 files changed, 163 insertions(+), 99 deletions(-) diff --git a/components/lib/calendar/BaseCalendar.vue b/components/lib/calendar/BaseCalendar.vue index 80a5a72fd..bc5139dab 100644 --- a/components/lib/calendar/BaseCalendar.vue +++ b/components/lib/calendar/BaseCalendar.vue @@ -232,6 +232,18 @@ export default { return { severity: 'secondary', text: true, size: 'small' }; } }, + navigatorButtonProps: { + type: Object, + default() { + return { severity: 'secondary', text: true }; + } + }, + timepickerButtonProps: { + type: Object, + default() { + return { severity: 'secondary', text: true }; + } + }, ariaLabelledby: { type: String, default: null diff --git a/components/lib/calendar/Calendar.d.ts b/components/lib/calendar/Calendar.d.ts index 4bac218fd..6d5e6207e 100755 --- a/components/lib/calendar/Calendar.d.ts +++ b/components/lib/calendar/Calendar.d.ts @@ -161,8 +161,9 @@ export interface CalendarPassThroughOptions { header?: CalendarPassThroughOptionType; /** * Used to pass attributes to the previous button's DOM element. + * @see {@link ButtonPassThroughOptions} */ - previousButton?: CalendarPassThroughOptionType; + previousButton?: ButtonPassThroughOptions; /** * Used to pass attributes to the title's DOM element. */ @@ -180,9 +181,10 @@ export interface CalendarPassThroughOptions { */ decadeTitle?: CalendarPassThroughOptionType; /** - * Used to pass attributes to the previous button's DOM element. + * Used to pass attributes to the next button's DOM element. + * @see {@link ButtonPassThroughOptions} */ - nextButton?: CalendarPassThroughOptionType; + nextButton?: ButtonPassThroughOptions; /** * Used to pass attributes to the container's DOM element. */ @@ -766,15 +768,27 @@ export interface CalendarProps { /** * Used to pass all properties of the ButtonProps to the today button component. * @type {ButtonProps} - * @defaultValue { severity: 'secondary', text: true } + * @defaultValue { severity: 'secondary', text: true, size: 'small' } */ todayButtonProps?: object | undefined; /** * Used to pass all properties of the ButtonProps to the clear button component. * @type {ButtonProps} - * @defaultValue { severity: 'secondary', text: true } + * @defaultValue { severity: 'secondary', text: true, size: 'small' } */ clearButtonProps?: object | undefined; + /** + * Used to pass all properties of the ButtonProps to the navigator button component. + * @type {ButtonProps} + * @defaultValue { severity: 'secondary', text: true } + */ + navigatorButtonProps?: object | undefined; + /** + * Used to pass all properties of the ButtonProps to the timepicker button component. + * @type {ButtonProps} + * @defaultValue { severity: 'secondary', text: true } + */ + timepickerButtonProps?: object | undefined; /** * Establishes relationships between the component and label(s) where its value should be one or more element IDs. */ diff --git a/components/lib/calendar/Calendar.vue b/components/lib/calendar/Calendar.vue index f8ec80005..dc2152985 100755 --- a/components/lib/calendar/Calendar.vue +++ b/components/lib/calendar/Calendar.vue @@ -73,23 +73,25 @@
- + +
- + + {{ formattedCurrentHour }} - + +
{{ timeSeparator }}
- + + {{ formattedCurrentMinute }} - + +
{{ timeSeparator }}
- + + {{ formattedCurrentSecond }} - + +
{{ timeSeparator }}
- + + {{ pm ? $primevue.config.locale.pm : $primevue.config.locale.am }} - + +
-
@@ -491,6 +527,7 @@