import { RequiredSetter } from 'lowcode/_setters'; import { IPublicModelSettingField } from '@alilc/lowcode-types'; import { labelProps, statusOptionsProp } from '../_props'; import snippets from './snippets'; import { uuid } from '../_utils/utils'; import { checkParentWhitelist } from '../_utils/nestingRules'; const { version } = require('../../package.json'); export default { snippets, // 表单页显示组件 group: '基础组件', componentName: 'RsStatus', title: '状态框', category: '表单元素', priority: 33, npm: { package: 'components-page', version, exportName: 'RsStatus', main: 'src\\index.tsx', destructuring: true, subName: '', }, props: [ { name: 'rs_id', title: { label: '组件ID' }, propType: 'string', setter: { componentName: RequiredSetter, initialValue: () => `select_${uuid()}`, }, extraProps: { setValue: (target: IPublicModelSettingField, value: any) => { if (!value) return; target.getProps().setPropValue('ref', value); }, }, }, ...labelProps, { ...statusOptionsProp, }, ], configure: { component: { nestingRule: { parentWhitelist: (testNode: IPublicModelSettingField) => { return checkParentWhitelist(testNode); }, }, }, advanced: false, supports: { style: true, events: [], }, }, };