feat: 工作流增加条件判断节点,重构部分UI

This commit is contained in:
2026-03-04 17:35:49 +08:00
parent 67d42a80b9
commit 27376a5f33
14 changed files with 2481 additions and 31 deletions

View File

@@ -23,6 +23,7 @@ export type FloatingOptions = {
onShow?: () => void;
onHide?: () => void;
syncWidth?: boolean;
syncWidthMode?: 'min' | 'equal';
};
export type FloatingInstance = {
@@ -43,7 +44,8 @@ export const createFloating = ({
showArrow,
onShow,
onHide,
syncWidth = false
syncWidth = false,
syncWidthMode = 'min'
}: FloatingOptions): FloatingInstance => {
if (typeof trigger === 'string') {
const triggerEl = document.querySelector(trigger);
@@ -89,9 +91,17 @@ export const createFloating = ({
...(showArrow ? [arrow({ element: arrowElement })] : []),
...(syncWidth ? [size({
apply({ rects, elements }) {
Object.assign(elements.floating.style, {
minWidth: `${rects.reference.width}px`,
});
if (syncWidthMode === 'equal') {
Object.assign(elements.floating.style, {
width: `${rects.reference.width}px`,
minWidth: `${rects.reference.width}px`
});
} else {
Object.assign(elements.floating.style, {
width: '',
minWidth: `${rects.reference.width}px`
});
}
}
})] : [])
]