
import { IPublicTypeComponentMetadata, IPublicTypeSnippet } from '@alilc/lowcode-types';
import { customStyleConfigure, commonLayoutProps } from '../common'

const NextTextMeta: IPublicTypeComponentMetadata = {
  "componentName": "NextText",
  "title": "NextText",
  "docUrl": "",
  "screenshot": "",
  "devMode": "proCode",
  "npm": {
    "package": "lowcode_dynamic",
    "version": "0.2.1",
    "exportName": "NextText",
    "main": "src/index.tsx",
    "destructuring": true,
    "subName": ""
  },
  "configure": {
    "props": [
      {
        name: 'base',
        type: 'group',
        display: 'block',
        title: {
          label: '基础',
        },
        items:[
          {
            "name": 'children',
            "supportVariable": true,
            "title": {
              "label": {
                "type": 'i18n',
                "zh_CN": '文本内容',
                "en_US": 'Text',
              },
              "tip": {
                "type": 'i18n',
                "zh_CN": '属性：children | 说明：文本内容',
                "en_US": 'prop: children | description: text of the content',
              },
            },
            "setter": 'TextAreaSetter'
          },
          {
            "title": {
              "label": {
                "type": "i18n",
                "en-US": "ellipsizeMode",
                "zh-CN": "ellipsizeMode"
              },
              "tip": "When numberOfLines is set, this prop defines how the text will be truncated. numberOfLines must be set in conjunction with this prop."
            },
            "name": "ellipsizeMode",
            "description": "enum('head', 'middle', 'tail', 'clip')",
            "setter": {
              componentName: 'SelectSetter',
              defaultValue: "tail",
              props: {
                options: [
                  {
                    title: 'head',
                    value: 'head',
                  },
                  {
                    title: 'middle',
                    value: 'middle',
                  },
                  {
                    title: 'tail',
                    value: 'tail',
                  },
                  {
                    title: 'clip',
                    value: 'clip',
                  }
                ],
              },
            }
          },
          {
            "title": {
              "label": {
                "type": "i18n",
                "en-US": "numberOfLines",
                "zh-CN": "numberOfLines"
              },
              "tip": "Used to truncate the text with an ellipsis after computing the text layout, including line wrapping, such that the total number of lines does not exceed this number. Setting this property to 0 will result in unsetting this value, which means that no lines restriction will be applied."
            },
            "name": "numberOfLines",
            "setter": {
              componentName: 'NumberSetter',
              defaultValue: 0
            }
          },
          {
            "title": {
              "label": {
                "type": "i18n",
                "en-US": "fontFamily",
                "zh-CN": "字体"
              },
              "tip": "fontFamily | 字体"
            },
            "name": "fontFamily",
            "description": "字体",
            "setter": {
              componentName: 'SelectSetter',
              defaultValue: "PingFang SC",
              props: {
                options: [
                  {
                    title: 'PingFang SC',
                    value: 'PingFang SC',
                  }
                ],
              },
            }
          },
          {
            "title": {
              "label": {
                "type": "i18n",
                "en-US": "delete",
                "zh-CN": "添加删除线样式"
              },
              "tip": "delete | 添加删除线样式"
            },
            "name": "delete",
            "description": "添加删除线样式",
            "setter": {
              "componentName": "BoolSetter",
              "isRequired": false,
              "initialValue": false
            }
          },
          {
            "title": {
              "label": {
                "type": "i18n",
                "en-US": "underline",
                "zh-CN": "添加下划线样式"
              },
              "tip": "underline | 添加下划线样式"
            },
            "name": "underline",
            "description": "添加下划线样式",
            "setter": {
              "componentName": "BoolSetter",
              "isRequired": false,
              "initialValue": false
            }
          },
          {
            "title": {
              "label": {
                "type": "i18n",
                "en-US": "italic",
                "zh-CN": "添加斜体样式"
              },
              "tip": "italic | 添加斜体样式"
            },
            "name": "italic",
            "description": "添加斜体样式",
            "setter": {
              "componentName": "BoolSetter",
              "isRequired": false,
              "initialValue": false
            }
          },
          {
            "title": {
              "label": {
                "type": "i18n",
                "en-US": "Click Event",
                "zh-CN": "点击事件"
              },
              "tip": {
                "type": 'i18n',
                "zh_CN": '属性: click | 说明: 点击事件',
                "en_US": 'prop: click | description: click event',
              },
            },
            "name": "click",
            "setter": {
              "componentName": "MixedSetter",
              "isRequired": false,
              props: {
                setters: [
                  'StringSetter',
                  'VariableSetter',
                ],
              }
            }
          },
        ],
      },
      {...commonLayoutProps},
      {
        name: 'report',
        type: 'group',
        display: 'block',
        title: {
          label: '打点',
        },
        items:[
          {
            "title": {
              "label": {
                "type": "i18n",
                "en-US": "Report Show Name",
                "zh-CN": "曝光埋点名称"
              },
              "tip": {
                "type": 'i18n',
                "zh_CN": '属性: report show name | 说明: 曝光埋点名称',
                "en_US": 'prop: report show name | description: report show name',
              },
            },
            "name": "reportShowName",
            "setter": {
              "componentName": "StringSetter",
              "isRequired": false,
              "initialValue": ""
            }
          },
          {
            "title": {
              "label": {
                "type": "i18n",
                "en-US": "Report Show Data",
                "zh-CN": "曝光埋点数据"
              },
              "tip": {
                "type": 'i18n',
                "zh_CN": '属性: report show data | 说明: 曝光埋点数据',
                "en_US": 'prop: report show data | description: report show data',
              },
            },
            "name": "reportShowData",
            setter: [
              {
                componentName: 'JsonSetter',
              },
              {
                componentName: 'VariableSetter',
              },
            ],
          },
          {
            "title": {
              "label": {
                "type": "i18n",
                "en-US": "Report Click Name",
                "zh-CN": "点击埋点名称"
              },
              "tip": {
                "type": 'i18n',
                "zh_CN": '属性: report click name | 说明: 点击埋点名称',
                "en_US": 'prop: report click name | description: report click name',
              },
            },
            "name": "reportClickName",
            "setter": {
              "componentName": "StringSetter",
              "isRequired": false,
              "initialValue": ""
            }
          },
          {
            "title": {
              "label": {
                "type": "i18n",
                "en-US": "Report Click Data",
                "zh-CN": "点击埋点数据"
              },
              "tip": {
                "type": 'i18n',
                "zh_CN": '属性: report click data | 说明: 点击埋点数据',
                "en_US": 'prop: report click data | description: report click data',
              },
            },
            "name": "reportClickData",
            setter: [
              {
                componentName: 'JsonSetter',
              },
              {
                componentName: 'VariableSetter',
              },
            ],
          }
        ]
      },
      {
        ...customStyleConfigure
      },
      {
        name: 'extend',
        type: 'group',
        display: 'block',
        title: {
          label: '',
        },
        items: [
          {
            name: 'typeConversion',
            title: '类型转化',
            isRequired: true,
            setter: {
              componentName: 'SelectSetter',
              "initialValue": "NextText",
              props: {
                options: [
                  {
                    title: 'Div',
                    value: 'Box',
                  },
                  {
                    title: 'Image',
                    value: 'Image',
                  },
                  {
                    title: 'Text',
                    value: 'NextText',
                  },
                ]
              }
            }
          }
        ]
      }
    ],
    "supports": {
      "className": false,
      "style": true,
      events: ['onClick'],
    },
    "component": {},
    category: '基础元素',
    group: '基础组件',
  }
};
const snippets: IPublicTypeSnippet[] = [
  {
    title: '文本',
    screenshot:
      'https://img.alicdn.com/imgextra/i3/O1CN01n5wpxc1bi862KuXFz_!!6000000003498-55-tps-50-50.svg',
    schema: {
      componentName: 'NextText',
      props: {
        children:
          '普通文本',
      },
    },
  },
];

export default {
  ...NextTextMeta,
  snippets
};
