mirror of https://github.com/langgenius/dify.git
feat: allow trigger schedule TimePicker to stretch with panel
This commit is contained in:
parent
d90ffbcf14
commit
5e2d5f0d83
|
|
@ -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}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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')
|
||||
|
|
|
|||
Loading…
Reference in New Issue