/* eslint-disable @typescript-eslint/no-unused-vars */
import { IPublicTypeComponentMetadata, IPublicTypeSnippet } from '@alilc/lowcode-types';

const DialogMeta: IPublicTypeComponentMetadata = {
  componentName: 'Dialog',
  title: '对话框',
  docUrl: '',
  screenshot: '',
  devMode: 'proCode',
  group: '基础组件',
  category: '弹框类',
  npm: {
    package: 'kernelsoft-lowcode-material',
    version: '0.1.0',
    exportName: 'Dialog',
    main: 'src/index.tsx',
    destructuring: true,
    subName: '',
  },
  configure: {
    props: [
      {
        title: {
          label: {
            type: 'i18n',
            'en-US': 'visible',
            'zh-CN': '是否可见',
          },
        },
        name: 'visible',
        setter: {
          componentName: 'BoolSetter',
          isRequired: false,
        },
      },
      {
        title: {
          label: {
            type: 'i18n',
            'en-US': 'title',
            'zh-CN': '标题',
          },
        },
        name: 'title',
        setter: {
          componentName: 'SlotSetter',
          props: {
            mode: 'node',
          },
          isRequired: false,
        },
      },
      {
        title: {
          label: {
            type: 'i18n',
            'en-US': 'content',
            'zh-CN': '内容',
          },
        },
        name: 'content',
        setter: {
          componentName: 'SlotSetter',
          props: {
            mode: 'node',
          },
          isRequired: false,
        },
      },
      {
        title: {
          label: {
            type: 'i18n',
            'en-US': 'okText',
            'zh-CN': '确定文本',
          },
        },
        name: 'okText',
        setter: {
          componentName: 'StringSetter',
          isRequired: false,
        },
      },
      {
        title: {
          label: {
            type: 'i18n',
            'en-US': 'cancelText',
            'zh-CN': '取消文本',
          },
        },
        name: 'cancelText',
        setter: {
          componentName: 'StringSetter',
          isRequired: false,
        },
      },
      {
        title: {
          label: {
            type: 'i18n',
            'en-US': 'mask',
            'zh-CN': '显示遮罩',
          },
        },
        name: 'mask',
        setter: {
          componentName: 'BoolSetter',
          isRequired: false,
          initialValue: false,
        },
      },
      {
        title: {
          label: {
            type: 'i18n',
            'en-US': 'noOkBtn',
            'zh-CN': '隐藏确定按钮',
          },
        },
        name: 'noOkBtn',
        setter: {
          componentName: 'BoolSetter',
          isRequired: false,
          initialValue: false,
        },
      },
      {
        title: {
          label: {
            type: 'i18n',
            'en-US': 'noCancelBtn',
            'zh-CN': '隐藏取消按钮',
          },
        },
        name: 'noCancelBtn',
        setter: {
          componentName: 'BoolSetter',
          isRequired: false,
          initialValue: false,
        },
      },
      {
        title: {
          label: {
            type: 'i18n',
            'en-US': 'okBtnDisabled',
            'zh-CN': '禁用确定按钮',
          },
        },
        name: 'okBtnDisabled',
        setter: {
          componentName: 'BoolSetter',
          isRequired: false,
          initialValue: false,
        },
      },
      {
        title: {
          label: {
            type: 'i18n',
            'en-US': 'noFooter',
            'zh-CN': '隐藏底部',
          },
        },
        name: 'noFooter',
        setter: {
          componentName: 'BoolSetter',
          isRequired: false,
          initialValue: false,
        },
      },
      {
        title: {
          label: {
            type: 'i18n',
            'en-US': 'closeOnClickOverlay',
            'zh-CN': '点击蒙层是否关闭对话框',
          },
        },
        name: 'closeOnClickOverlay',
        setter: {
          componentName: 'BoolSetter',
          isRequired: false,
          initialValue: false,
        },
      },
      {
        title: {
          label: {
            type: 'i18n',
            'en-US': 'cancelAutoClose',
            'zh-CN': '取消按钮是否默认关闭弹窗',
          },
        },
        name: 'cancelAutoClose',
        setter: {
          componentName: 'BoolSetter',
          isRequired: false,
          initialValue: false,
        },
      },
      {
        title: {
          label: {
            type: 'i18n',
            'en-US': 'lockScroll',
            'zh-CN': '背景是否锁定',
          },
        },
        name: 'lockScroll',
        setter: {
          componentName: 'BoolSetter',
          isRequired: false,
          initialValue: false,
        },
      },
    ],
    supports: {
      className: true,
      style: true,
      events: [
        {
          name: 'onClosed',
        },
        {
          name: 'onCancel',
        },
        {
          name: 'onClickSelf',
        },
      ],
    },
    component: {},
  },
};
const snippets: IPublicTypeSnippet[] = [
  {
    title: '对话框',
    screenshot:
      'https://alifd.oss-cn-hangzhou.aliyuncs.com/fusion-cool/icons/icon-light/ic_light_dialog.png',
    schema: {
      componentName: 'Dialog',
      props: {
        visible: true,
        title: {
          type: 'JSSlot',
          value: [],
        },
        content: {
          type: 'JSSlot',
          value: [],
        },
        okText: '确定',
        cancelText: '取消',
      },
    },
  },
];

export default {
  ...DialogMeta,
  // snippets,
};
