feat: allow trigger schedule TimePicker to stretch with panel

This commit is contained in:
lyzno1 2025-10-17 13:52:26 +08:00
parent d90ffbcf14
commit 5e2d5f0d83
No known key found for this signature in database
3 changed files with 8 additions and 2 deletions

View File

@ -37,6 +37,7 @@ const TimePicker = ({
minuteFilter,
popupClassName,
notClearable = false,
triggerFullWidth = false,
showTimezone = false,
}: TimePickerProps) => {
const { t } = useTranslation()
@ -205,14 +206,17 @@ const TimePicker = ({
onOpenChange={setIsOpen}
placement='bottom-start'
>
<PortalToFollowElemTrigger>
<PortalToFollowElemTrigger className={triggerFullWidth ? '!block w-full' : undefined}>
{renderTrigger ? (renderTrigger({
inputElem,
onClick: handleClickTrigger,
isOpen,
})) : (
<div
className='group flex w-[252px] cursor-pointer items-center gap-x-0.5 rounded-lg bg-components-input-bg-normal px-2 py-1 hover:bg-state-base-hover-alt'
className={cn(
'group flex cursor-pointer items-center gap-x-0.5 rounded-lg bg-components-input-bg-normal px-2 py-1 hover:bg-state-base-hover-alt',
triggerFullWidth ? 'w-full min-w-0' : 'w-[252px]',
)}
onClick={handleClickTrigger}
>
{inputElem}

View File

@ -65,6 +65,7 @@ export type TimePickerProps = {
minuteFilter?: (minutes: string[]) => string[]
popupClassName?: string
notClearable?: boolean
triggerFullWidth?: boolean
/** Show timezone label inline with the time picker */
showTimezone?: boolean
}

View File

@ -73,6 +73,7 @@ const Panel: FC<NodePanelProps<ScheduleTriggerNodeType>> = ({
notClearable={true}
timezone={inputs.timezone}
value={inputs.visual_config?.time || '12:00 AM'}
triggerFullWidth={true}
onChange={(time) => {
if (time) {
const timeString = time.format('h:mm A')