chore: pre popular placeholder ui

This commit is contained in:
Joel
2025-08-25 17:47:45 +08:00
parent fda19d3f0e
commit 305b5da764
3 changed files with 19 additions and 9 deletions

View File

@ -62,6 +62,7 @@ type Props = {
availableNodes?: Node[]
availableVars?: NodeOutPutVar[]
trigger?: React.ReactNode
isJustShowValue?: boolean
isAddBtnTrigger?: boolean
schema?: Partial<CredentialFormSchema>
valueTypePlaceHolder?: string
@ -94,6 +95,7 @@ const VarReferencePicker: FC<Props> = ({
availableNodes: passedInAvailableNodes,
availableVars: passedInAvailableVars,
trigger,
isJustShowValue,
isAddBtnTrigger,
schema,
valueTypePlaceHolder,
@ -408,7 +410,7 @@ const VarReferencePicker: FC<Props> = ({
<AddButton onClick={noop}></AddButton>
</div>
)
: (<div ref={!isSupportConstantValue ? triggerRef : null} className={cn((open || isFocus) ? 'border-gray-300' : 'border-gray-100', 'group/wrap relative flex h-8 w-full items-center', !isSupportConstantValue && 'rounded-lg bg-components-input-bg-normal p-1', isInTable && 'border-none bg-transparent', readonly && 'bg-components-input-bg-disabled')}>
: (<div ref={!isSupportConstantValue ? triggerRef : null} className={cn((open || isFocus) ? 'border-gray-300' : 'border-gray-100', 'group/wrap relative flex h-8 w-full items-center', !isSupportConstantValue && 'rounded-lg bg-components-input-bg-normal p-1', isInTable && 'border-none bg-transparent', readonly && 'bg-components-input-bg-disabled', isJustShowValue && 'h-6 bg-transparent p-0')}>
{isSupportConstantValue
? <div onClick={(e) => {
e.stopPropagation()
@ -516,7 +518,7 @@ const VarReferencePicker: FC<Props> = ({
</VarPickerWrap>
)}
{(hasValue && !readonly && !isInTable) && (<div
{(hasValue && !readonly && !isInTable && !isJustShowValue) && (<div
className='group invisible absolute right-1 top-[50%] h-5 translate-y-[-50%] cursor-pointer rounded-md p-1 hover:bg-state-base-hover group-hover/wrap:visible'
onClick={handleClearVar}
>