From 854da6478cb1d2d7b9e09249b2d6c0df6b21c8e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mehmet=20=C3=87etin?= <92744169+mehmetcetin01140@users.noreply.github.com> Date: Thu, 23 May 2024 18:36:09 +0300 Subject: [PATCH] Fixed #15682 | Calendar: Reimplement all buttons --- src/app/components/calendar/calendar.ts | 287 ++++++++++++++++++------ 1 file changed, 222 insertions(+), 65 deletions(-) diff --git a/src/app/components/calendar/calendar.ts b/src/app/components/calendar/calendar.ts index b03ad4e65b2..51c73e0a375 100644 --- a/src/app/components/calendar/calendar.ts +++ b/src/app/components/calendar/calendar.ts @@ -25,7 +25,7 @@ import { } from '@angular/core'; import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'; import { OverlayService, PrimeNGConfig, PrimeTemplate, SharedModule, TranslationKeys } from 'primeng/api'; -import { ButtonModule } from 'primeng/button'; +import { ButtonModule, ButtonProps } from 'primeng/button'; import { ConnectedOverlayScrollHandler, DomHandler } from 'primeng/dom'; import { RippleModule } from 'primeng/ripple'; import { ObjectUtils, UniqueComponentId, ZIndexUtils } from 'primeng/utils'; @@ -106,35 +106,42 @@ export const CALENDAR_VALUE_ACCESSOR: any = { - + + + + - + + +
- +
- - + {{ yearPickerValues()[0] }} - {{ yearPickerValues()[yearPickerValues().length - 1] }}
- +
@@ -301,8 +323,8 @@ export const CALENDAR_VALUE_ACCESSOR: any = {
- + + + + + 0{{ currentHour }} - + + + + +
{{ timeSeparator }}
- + + + + + 0{{ currentMinute }} - + + + + +
{{ timeSeparator }}
- + + + + + 0{{ currentSecond }} - + + + + +
- + + + + + + {{ pm ? 'PM' : 'AM' }} - + + + + + +
- - + +
@@ -737,6 +817,83 @@ export class Calendar implements OnInit, OnDestroy, ControlValueAccessor { * @group Props */ @Input() showTransitionOptions: string = '.12s cubic-bezier(0, 0, 0.2, 1)'; + /** + * Used to pass all properties of the ButtonProps to the Button component. + * @group Props + */ + @Input() yearButtonProps: ButtonProps; + /** + * Used to pass all properties of the ButtonProps to the Button component. + * @group Props + */ + @Input() monthButtonProps: ButtonProps; + /** + /** + * Used to pass all properties of the ButtonProps to the Button component. + * @group Props + */ + @Input() nextButtonProps: ButtonProps; + /** + /** + * Used to pass all properties of the ButtonProps to the Button component. + * @group Props + */ + @Input() prevButtonProps: ButtonProps; + /** + * Used to pass all properties of the ButtonProps to the Button component. + * @group Props + */ + @Input() iconButtonProps: ButtonProps; + /** + * Used to pass all properties of the ButtonProps to the Button component. + * @group Props + */ + @Input() hourPickerIncrementButtonProps: ButtonProps; + /** + * Used to pass all properties of the ButtonProps to the Button component. + * @group Props + */ + @Input() hourPickerDecrementButtonProps: ButtonProps; + /** + * Used to pass all properties of the ButtonProps to the Button component. + * @group Props + */ + @Input() minutePickerIncrementButtonProps: ButtonProps; + /** + * Used to pass all properties of the ButtonProps to the Button component. + * @group Props + */ + @Input() minutePickerDecrementButtonProps: ButtonProps; + /** + * Used to pass all properties of the ButtonProps to the Button component. + * @group Props + */ + @Input() secondPickerIncrementButtonProps: ButtonProps; + /** + * Used to pass all properties of the ButtonProps to the Button component. + * @group Props + */ + @Input() secondPickerDecrementButtonProps: ButtonProps; + /** + * Used to pass all properties of the ButtonProps to the Button component. + * @group Props + */ + @Input() ampmPickerIncrementButtonProps: ButtonProps; + /** + * Used to pass all properties of the ButtonProps to the Button component. + * @group Props + */ + @Input() ampmPickerDecrementButtonProps: ButtonProps; + /** + * Used to pass all properties of the ButtonProps to the Button component. + * @group Props + */ + @Input() todayButtonProps: ButtonProps; + /** + * Used to pass all properties of the ButtonProps to the Button component. + * @group Props + */ + @Input() clearButtonProps: ButtonProps; /** * Transition options of the hide animation. * @group Props