import { IPublicModelSettingField } from '@alilc/lowcode-types'; import snippets from './snippets'; import { checkParentWhitelist } from '../_utils/nestingRules'; import { RequiredSetter } from '../_setters'; import { uuid } from '../_utils/utils'; import { version } from '../../package.json'; export default { snippets: snippets, title: '占位框', componentName: 'RsSpacerCol', docUrl: '', group: '基础组件', category: '表单元素', devMode: 'proCode', priority: 34, npm: { package: 'components-page', version, exportName: 'RsSpacerCol', main: 'src\\index.tsx', destructuring: true, subName: '', }, configure: { props: [ { name: 'rs_id', title: { label: { type: 'i18n', zh_CN: '组件ID', en_US: 'id', }, tip: { type: 'i18n', zh_CN: '属性: id | 说明: 字段唯一识别', en_US: 'prop: id | description: field ID', }, }, propType: 'string', condition: () => { return false; }, setter: { componentName: RequiredSetter, initialValue: () => 'spacercol_' + uuid(), }, extraProps: { setValue: (target: IPublicModelSettingField, value: any) => { if (!value) return; target.getProps().setPropValue('ref', value); }, }, }, { name: 'customcol', title: { label: { type: 'i18n', zh_CN: '独占列数', en_US: 'customcol', }, tip: { type: 'i18n', zh_CN: '属性: customcol | 说明: 表单元素独占一列、两列、三列、四列、五列、六列', en_US: 'prop: customcol | description: Form Item Layout', }, }, extraProps: { setValue: (target: IPublicModelSettingField, value: any) => { if (!value) return; target.getProps().setPropValue('customcol', value); }, }, setter: { componentName: 'RadioGroupSetter', initialValue: 1, mode: 'single', props: { options: [ { title: '一列', value: 1, }, { title: '二列', value: 2, }, { title: '三列', value: 3, }, { title: '四列', value: 4, }, { title: '五列', value: 5, }, { title: '六列', value: 6, }, ], }, }, }, ], component: { nestingRule: { parentWhitelist: (testNode: IPublicModelSettingField) => { return checkParentWhitelist(testNode); }, }, }, supports: { style: true, }, }, };