From b4e7ed847ec9beceec8986d192915af9c034cbc9 Mon Sep 17 00:00:00 2001 From: Blaine Landowski Date: Sat, 27 Apr 2024 16:07:57 -0500 Subject: [PATCH] Show AM/PM selector even if headers are hidden --- .../src/labs/VTimePicker/VTimePicker.tsx | 5 +- .../labs/VTimePicker/VTimePickerControls.sass | 7 +- .../labs/VTimePicker/VTimePickerControls.tsx | 123 +++++++++--------- 3 files changed, 73 insertions(+), 62 deletions(-) diff --git a/packages/vuetify/src/labs/VTimePicker/VTimePicker.tsx b/packages/vuetify/src/labs/VTimePicker/VTimePicker.tsx index c108a7efe50..99e47ce9efb 100644 --- a/packages/vuetify/src/labs/VTimePicker/VTimePicker.tsx +++ b/packages/vuetify/src/labs/VTimePicker/VTimePicker.tsx @@ -295,6 +295,7 @@ export const VTimePicker = genericComponent()({ return ( ()({ ]} style={ props.style } v-slots={{ - title: () => slots.title?.() ?? ( + title: () => slots.title?.() ?? (!props.hideHeader && (
{ t(props.title) }
- ), + )) ?? undefined, header: () => ( - emit('update:selecting', SelectingTimes.Hour) } - /> - - : - - emit('update:selecting', SelectingTimes.Minute) } - /> - { - props.useSeconds && ( - : - ) - } + !props.hideHeader && ( +
+ emit('update:selecting', SelectingTimes.Hour) } + /> - { - props.useSeconds && ( - emit('update:selecting', SelectingTimes.Second) } - class={{ - 'v-time-picker-controls__time__btn': true, - 'v-time-picker-controls__time__btn__active': props.selecting === 3, - 'v-time-picker-controls__time--with-seconds__btn': props.useSeconds, - }} - text={ props.second == null ? '--' : pad(props.second) } - /> - ) - } + : + emit('update:selecting', SelectingTimes.Minute) } + /> + + { + props.useSeconds && ( + : + ) + } + + { + props.useSeconds && ( + emit('update:selecting', SelectingTimes.Second) } + class={{ + 'v-time-picker-controls__time__btn': true, + 'v-time-picker-controls__time__btn__active': props.selecting === 3, + 'v-time-picker-controls__time--with-seconds__btn': props.useSeconds, + }} + text={ props.second == null ? '--' : pad(props.second) } + /> + ) + } +
+ )} { props.ampm && (