diff --git a/packages/amis-editor/package.json b/packages/amis-editor/package.json index 5ad7128ae..505ae2097 100644 --- a/packages/amis-editor/package.json +++ b/packages/amis-editor/package.json @@ -1,6 +1,6 @@ { "name": "amis-editor", - "version": "5.2.1-beta.13", + "version": "5.2.1-beta.15", "description": "amis 可视化编辑器", "main": "lib/index.js", "module": "esm/index.js", diff --git a/packages/amis-editor/src/locale/en-US.ts b/packages/amis-editor/src/locale/en-US.ts index ca465d335..a41d45baf 100644 --- a/packages/amis-editor/src/locale/en-US.ts +++ b/packages/amis-editor/src/locale/en-US.ts @@ -3533,5 +3533,11 @@ extendLocale('en-US', { 'cb048b2d8426afd464dc01b72c446342': 'Block level (default)', '3b6e8d54b7b2ae890d5357b7eaaeaaf2': 'No line breaks (default)', '0611733b53e0098e6fd880bd44b2806f': - 'The minimum height is the smallest vertical display area of the current element' + 'The minimum height is the smallest vertical display area of the current element', + '03bfb834c8a5fef58d885e448a4e13b4': 'Virtual List Threshold', + '50437e080edc71ab624c93d419472919': + 'When the number of options exceeds the threshold, the virtual list is opened to optimize performance', + '02b9880e1d2df8a07e90e9878080c739': 'Option Height', + 'a3f66655c3d2bcfecc6afba0e4424460': + 'Height of each option when virtual list is turned on' }); diff --git a/packages/amis-editor/src/locale/zh-CN.ts b/packages/amis-editor/src/locale/zh-CN.ts index c479fdfed..1034feb97 100644 --- a/packages/amis-editor/src/locale/zh-CN.ts +++ b/packages/amis-editor/src/locale/zh-CN.ts @@ -3123,5 +3123,10 @@ extendLocale('zh-CN', { '自定义选项渲染模板,支持JSX、数据域变量使用', 'cb048b2d8426afd464dc01b72c446342': '块级(默认)', '3b6e8d54b7b2ae890d5357b7eaaeaaf2': '不换行(默认)', - '0611733b53e0098e6fd880bd44b2806f': '最小高度即当前元素最小的垂直展示区域' + '0611733b53e0098e6fd880bd44b2806f': '最小高度即当前元素最小的垂直展示区域', + '03bfb834c8a5fef58d885e448a4e13b4': '虚拟列表阈值', + '50437e080edc71ab624c93d419472919': + '当选项数量超过阈值后,会开启虚拟列表以优化性能', + '02b9880e1d2df8a07e90e9878080c739': '选项高度', + 'a3f66655c3d2bcfecc6afba0e4424460': '开启虚拟列表时每个选项的高度' }); diff --git a/packages/amis-editor/src/tpl/layout.tsx b/packages/amis-editor/src/tpl/layout.tsx index 20f88cc9c..87efcdb43 100644 --- a/packages/amis-editor/src/tpl/layout.tsx +++ b/packages/amis-editor/src/tpl/layout.tsx @@ -54,11 +54,14 @@ setSchemaTpl( if (value === 'static') { form.setValueByName('style.inset', undefined); form.setValueByName('style.zIndex', undefined); + form.setValueByName('originPosition', undefined); } else if (value === 'fixed' || value === 'absolute') { // 默认使用右下角进行相对定位 form.setValueByName('style.inset', 'auto 50px 50px auto'); + form.setValueByName('originPosition', 'right-bottom'); } else if (value === 'relative') { form.setValueByName('style.inset', 'auto'); + form.setValueByName('originPosition', undefined); } }, options: [ @@ -589,7 +592,15 @@ setSchemaTpl( clearable: true, unitOptions: config?.unitOptions ?? LayoutUnitOptions, pipeIn: config?.pipeIn, - pipeOut: config?.pipeOut + // pipeOut: config?.pipeOut, + pipeOut: (value: string) => { + const curValue = parseInt(value); + if (curValue || curValue === 0) { + return value; + } else { + return undefined; + } + } }; } );