import { FormItem, FormConfig } from '@/components/form-render/form-render-types'

export const config: FormConfig = {
	layout: 'horizontal',
	colon: true,
	hideRequiredMark: false,
	labelAlign: 'right',
	scrollToFirstError: false,
	validateOnRuleChange: true,
	labelCol: {
		span: 4,
		offset: 0,
	},
}

export const formItems: FormItem[] = [
	{
		group: 'form',
		type: 'input',
		config: {
			autoLink: true,
			hasFeedback: false,
			label: '分组名称',
			name: 'name',
			required: true,
		},
		properties: {
			type: 'text',
			allowClear: true,
			bordered: true,
			showCount: true,
			placeholder: '请填写分组名称',
		},
		rules: [],
	},
	{
		type: 'textarea',
		group: 'form',
		config: {
			autoLink: true,
			hasFeedback: false,
			label: '分组描述',
			name: 'description',
		},
		properties: {
			size: 'default',
			visibilityToggle: true,
			allowClear: true,
			bordered: true,
			showCount: true,
			autoSize: {
				minRows: 3,
				maxRows: 6,
			},
			minRows: 3,
			maxRows: 6,
			placeholder: '请填写分组描述',
		},
		rules: [],
	},
	{
		type: 'switch',
		group: 'form',
		config: {
			autoLink: true,
			hasFeedback: false,
			label: '禁用',
			name: 'disabled',
		},
		properties: {
			checkedChildren: '禁用',
			unCheckedChildren: '启用',
		},
		rules: [],
	},
]
