mirror of https://github.com/langgenius/dify.git
feat(portal): add customContainer prop to PortalToFollowElem for flexible rendering
This commit is contained in:
parent
273dae6738
commit
00b5772012
|
|
@ -112,6 +112,7 @@ const DropDown = ({
|
|||
} : {
|
||||
mainAxis: 4,
|
||||
}}
|
||||
customContainer={document.body}
|
||||
>
|
||||
<PortalToFollowElemTrigger onClick={handleTrigger}>
|
||||
<ActionButton className={cn(expand ? 'size-8 rounded-lg' : 'size-6 rounded-md')}>
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ export type PortalToFollowElemOptions = {
|
|||
offset?: number | OffsetOptions
|
||||
onOpenChange?: (open: boolean) => void
|
||||
triggerPopupSameWidth?: boolean
|
||||
customContainer?: HTMLElement | null
|
||||
}
|
||||
|
||||
export function usePortalToFollowElem({
|
||||
|
|
@ -39,8 +40,9 @@ export function usePortalToFollowElem({
|
|||
offset: offsetValue = 0,
|
||||
onOpenChange: setControlledOpen,
|
||||
triggerPopupSameWidth,
|
||||
customContainer = null,
|
||||
}: PortalToFollowElemOptions = {}) {
|
||||
const container = document.getElementById('workflow-container') || document.body
|
||||
const container = customContainer || document.getElementById('workflow-container') || document.body
|
||||
const [localOpen, setLocalOpen] = useState(false)
|
||||
const open = controlledOpen ?? localOpen
|
||||
const handleOpenChange = useCallback((newOpen: boolean) => {
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ const Operations = ({
|
|||
onClick={onClickExport}
|
||||
>
|
||||
<span className='system-md-regular px-1 text-text-secondary'>
|
||||
{t('datasetPipeline.operations.exportDSL')}
|
||||
{t('datasetPipeline.operations.exportPipeline')}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@ const translation = {
|
|||
choose: 'Choose',
|
||||
details: 'Details',
|
||||
editInfo: 'Edit info',
|
||||
exportDSL: 'Export DSL',
|
||||
useTemplate: 'Use this Knowledge Pipeline',
|
||||
backToDataSource: 'Back to Data Source',
|
||||
process: 'Process',
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@ const translation = {
|
|||
choose: '选择',
|
||||
details: '详情',
|
||||
editInfo: '编辑信息',
|
||||
exportDSL: '导出 DSL',
|
||||
useTemplate: '使用此知识流水线',
|
||||
backToDataSource: '返回数据源',
|
||||
process: '处理',
|
||||
|
|
|
|||
Loading…
Reference in New Issue