import { ComponentMetadata } from '@alilc/lowcode-types';
import snippets from './snippets';

const SaasCreateOrganizationMeta: ComponentMetadata = {
  componentName: 'SaasCreateOrganization',
  title: 'Saas创建企业',
  docUrl: '',
  screenshot: '',
  category: '表单',
  devMode: 'proCode',
  npm: {
    package: '@pisell/private-materials',
    version: '1.0.0',
    exportName: 'SaasCreateOrganization',
    main: 'src/index.tsx',
    destructuring: true,
    subName: '',
  },
  props: [],
  configure: {
    props: [
      {
        title: {
          label: 'RegisterHeader',
        },
        type: 'group',
        display: 'block',
        items: [
          {
            name: 'showLogo',
            title: { label: '显示Logo' },
            propType: 'bool',
            defaultValue: true,
            setter: 'BoolSetter',
          },
          {
            name: 'logo',
            title: { label: 'Logo图片' },
            propType: 'string',
            setter: 'ImageSetter',
          },
          {
            name: 'logoPosition',
            title: { label: 'Logo位置' },
            setter: {
              componentName: 'RadioGroupSetter',
              props: {
                options: [
                  { label: '居左', value: 'left' },
                  { label: '居中', value: 'center' },
                  { label: '居右', value: 'right' },
                ],
              },
            },
            defaultValue: 'center',
          },
          {
            name: 'logoSize',
            title: { label: 'Logo尺寸' },
            propType: 'object',
            display: 'inline',
            setter: {
              componentName: 'ObjectSetter',
              props: {
                config: {
                  items: [
                    {
                      name: 'width',
                      title: '宽度',
                      setter: 'NumberSetter',
                    },
                    {
                      name: 'height',
                      title: '高度',
                      setter: 'NumberSetter',
                    },
                  ],
                },
              },
            },
          },
        ],
      },
      {
        title: {
          label: '欢迎语',
        },
        type: 'group',
        display: 'block',
        items: [
          {
            name: 'showWelcomeMessage',
            title: { label: '显示欢迎语' },
            propType: 'bool',
            defaultValue: true,
            setter: 'BoolSetter',
          },
          {
            name: 'welcomeMessage',
            title: { label: '欢迎语文案' },
            propType: 'string',
            setter: 'PisellI18nSetter',
          },
          {
            name: 'welcomeMessageAlign',
            title: { label: '位置' },
            setter: {
              componentName: 'RadioGroupSetter',
              props: {
                options: [
                  { label: '居左', value: 'left' },
                  { label: '居中', value: 'center' },
                  { label: '居右', value: 'right' },
                ],
              },
            },
          },
        ],
      },
      {
        title: {
          label: '标题',
        },
        type: 'group',
        display: 'block',
        items: [
          {
            name: 'showTitle',
            title: { label: '显示标题' },
            propType: 'bool',
            defaultValue: true,
            setter: 'BoolSetter',
          },
          {
            name: 'title',
            title: { label: '标题文案' },
            propType: 'string',
            setter: 'PisellI18nSetter',
          },
          {
            name: 'titleAlign',
            title: { label: '位置' },
            setter: {
              componentName: 'RadioGroupSetter',
              props: {
                options: [
                  { label: '居左', value: 'left' },
                  { label: '居中', value: 'center' },
                  { label: '居右', value: 'right' },
                ],
              },
            },
          },
        ],
      },
      {
        title: {
          label: '副标题',
        },
        type: 'group',
        display: 'block',
        items: [
          {
            name: 'showSubtitle',
            title: { label: '显示副标题' },
            propType: 'bool',
            defaultValue: true,
            setter: 'BoolSetter',
          },
          {
            name: 'subtitle',
            title: { label: '副标题文案' },
            propType: {
              type: 'oneOfType',
              value: ['node', 'string'],
            },
            setter: 'PisellI18nSetter',
          },
          {
            name: 'subtitleAlign',
            title: { label: '位置' },
            setter: {
              componentName: 'RadioGroupSetter',
              props: {
                options: [
                  { label: '居左', value: 'left' },
                  { label: '居中', value: 'center' },
                  { label: '居右', value: 'right' },
                ],
              },
            },
          },
        ],
      },
    ],
    supports: {
      style: true,
      events: [
        {
          name: 'onCreateOrganization',
          description: '创建企业回调',
        },
      ],
    },
    component: {
      isContainer: true,
    },
  },
};

export default {
  ...SaasCreateOrganizationMeta,
  snippets,
};
