diff --git a/docs/zh-CN/components/form/picker.md b/docs/zh-CN/components/form/picker.md index 28526f7ee76..a46bcbe651c 100755 --- a/docs/zh-CN/components/form/picker.md +++ b/docs/zh-CN/components/form/picker.md @@ -1211,6 +1211,7 @@ order: 35 | pickerSchema | `string` | `{mode: 'list', listItem: {title: '${label}'}}` | 即用 List 类型的渲染,来展示列表信息。更多配置参考 [CRUD](../crud) | | embed | `boolean` | `false` | 是否使用内嵌模式 | | overflowConfig | `OverflowConfig` | 参考[OverflowConfig](./#overflowconfig) | 开启最大标签展示数量的相关配置 `3.4.0` | +| removable | `removable` | `true` | 用于控制是否显示选中项的删除图标,默认值为 `true` | `6.10.0` | ### OverflowConfig diff --git a/packages/amis-core/src/renderers/Form.tsx b/packages/amis-core/src/renderers/Form.tsx index de7ee80f525..69623a7601b 100644 --- a/packages/amis-core/src/renderers/Form.tsx +++ b/packages/amis-core/src/renderers/Form.tsx @@ -1814,22 +1814,33 @@ export default class Form extends React.Component { return (
- {children.map((control, key) => - ~['hidden', 'formula'].indexOf((control as any).type) || - (control as any).mode === 'inline' ? ( + {children.map((control, key) => { + const split = control.colSize?.split('/'); + const colSize = + split?.[0] && split?.[1] + ? (split[0] / split[1]) * 100 + '%' + : control.colSize; + return ~['hidden', 'formula'].indexOf((control as any).type) || + (control as any).mode === 'inline' ? ( this.renderChild(control, key, otherProps) ) : (
{this.renderChild(control, '', { ...otherProps, mode: 'row' })}
- ) - )} + ); + })}
); } diff --git a/packages/amis-core/src/utils/debug.tsx b/packages/amis-core/src/utils/debug.tsx index c2b3e4f8aba..3f8f5b6193e 100644 --- a/packages/amis-core/src/utils/debug.tsx +++ b/packages/amis-core/src/utils/debug.tsx @@ -181,7 +181,7 @@ const AMISDebug = observer(({store}: {store: AMISDebugStore}) => { } } - const panelRef = useRef(null); + const panelRef = useRef(null); const [isResizing, setResizing] = useState(false); @@ -220,6 +220,19 @@ const AMISDebug = observer(({store}: {store: AMISDebugStore}) => { }; }, [isResizing]); + // 避免触发 modal 的 closeOnOutside 逻辑 + useEffect(() => { + const handlePanelMouseUp = (e: Event) => { + e.preventDefault(); + }; + + panelRef.current!.addEventListener('mouseup', handlePanelMouseUp); + + return () => { + panelRef.current!.removeEventListener('mouseup', handlePanelMouseUp); + }; + }, []); + const handleInputKeyUp = React.useCallback((e: React.KeyboardEvent) => { if (e.key === 'Enter') { const input = e.target as HTMLInputElement; @@ -290,7 +303,7 @@ const AMISDebug = observer(({store}: {store: AMISDebugStore}) => { store.tab = 'log'; }} > - Log + Log({store.logs.length})