
import { IPublicTypeComponentMetadata, IPublicTypeSnippet } from '@alilc/lowcode-types'; 

const OadpEntityButtonBatchDeleteMeta: IPublicTypeComponentMetadata = {
  "componentName": "OadpEntityButtonBatchDelete",
  "title": "实体批量删除按钮",
  "category": "基础组件",
  "group": "低代码组件",
  "docUrl": "",
  "screenshot": "https://alifd.oss-cn-hangzhou.aliyuncs.com/fusion-cool/icons/icon-light/ic_light_button.png",
  "devMode": "proCode",
  "npm": {
    "package": "oadp-material",
    "version": "{{version}}",
    "exportName": "OadpEntityButtonBatchDelete",
    "main": "src/index.tsx",
    "destructuring": true,
    "subName": ""
  },
  "configure": {
    "props": [ 
      {
        "name": "DataSetting",
        "title": "数据设置",
        "type": "group",
        "display": "block",
        "items": [  
          {
            "name": "label",
            "title": {
              "label": {
                "type": "i18n",
                "zh_CN": "标题",
                "en_US": "Label",
              },
              "tip": {
                "type": "i18n",
                "zh_CN": "属性: label | 说明: 标题",
                "en_US": "prop: label | description: label content",
              },
            },
            "setter": "StringSetter",
            "description": "标题",
          }, 
          {
            "name": "name",
            "title": {
              "label": {
                "type": "i18n",
                "zh_CN": "表单标识",
                "en_US": "Name",
              },
              "tip": {
                "type": "i18n",
                "zh_CN": "属性: name | 说明: 表单标识",
                "en_US": "prop: name | description: switch name",
              },
            },
            "setter": "StringSetter", 
            "supportVariable": false,
          }, 
          {
            "name": "id",
            "title": {
              "label": {
                "type": "i18n",
                "zh_CN": "唯一标识",
                "en_US": "ID",
              },
              "tip": {
                "type": "i18n",
                "zh_CN": "属性: id | 说明: 唯一标识",
                "en_US": "prop: id | description: switch id",
              },
            },
            "setter": "StringSetter" 
          }, 
          { 
            "name": "entity",
            "title": {
              "label": {
                "type": "i18n",
                "en-US": "Entity",
                "zh-CN": "绑定实体"
              },
              "tip":  {
                "type": "i18n",
                "zh_CN": "属性: entity | 说明:绑定实体",
                "en_US": "prop: entity | description: Set Entity.",
              },
            },
            "description": "绑定实体",
            "setter": "OadpEntitySetter",
            "supportVariable": true,
          },  
          {
            "name": "tableComponentRefId",
            "title": {
              "label": {
                "type": "i18n",
                "zh_CN": "联动表格",
                "en_US": "Bind Table Component",
              },
              "tip": {
                "type": "i18n",
                "zh_CN": "属性: tableComponentRefId | 说明: 联动表格",
                "en_US": "prop: tableComponentRefId | description: Bind Table Component",
              },
            },
            "setter": "StringSetter" 
          },
        ]
      },
      {
        "name": "DisplaySetting",
        "title": "显示设置",
        "type": "group",
        "display": "block",
        "items": [ 
          {
            "name": "type",
            "title": {
              "label": {
                "type": "i18n",
                "en-US": "type",
                "zh-CN": "类型"
              },
              "tip": "type | 类型"
            },
            "description": "类型",
            "setter": {
              "componentName": "RadioGroupSetter",
              "props": {
                "dataSource": [
                  {
                    "label": "主按钮",
                    "value": "primary"
                  },
                  {
                    "label": "次按钮",
                    "value": "secondary"
                  },
                  {
                    "label": "普通按钮",
                    "value": "normal"
                  }
                ],
                "options": [
                  {
                    "label": "主按钮",
                    "value": "primary"
                  },
                  {
                    "label": "次按钮",
                    "value": "secondary"
                  },
                  {
                    "label": "普通按钮",
                    "value": "normal"
                  }
                ]
              },
              "initialValue": "primary"
            }
          },
          {
            "title": {
              "label": {
                "type": "i18n",
                "en-US": "size",
                "zh-CN": "尺寸"
              },
              "tip": "size | 尺寸"
            },
            "name": "size",
            "description": "尺寸",
            "setter": {
              "componentName": "RadioGroupSetter",
              "props": {
                "dataSource": [
                  {
                    "label": "小",
                    "value": "small"
                  },
                  {
                    "label": "中",
                    "value": "medium"
                  },
                  {
                    "label": "大",
                    "value": "large"
                  }
                ],
                "options": [
                  {
                    "label": "小",
                    "value": "small"
                  },
                  {
                    "label": "中",
                    "value": "medium"
                  },
                  {
                    "label": "大",
                    "value": "large"
                  }
                ]
              },
              "initialValue": "medium"
            }
          },
          {
            "name": "text",
            "title": {
              "label": {
                "type": "i18n",
                "en-US": "text",
                "zh-CN": "文本按钮"
              },
              "tip": {
                "type": "i18n",
                "zh_CN": "属性: text | 说明: 文本按钮 | 类型: boolean | 默认值: false",
                "en_US": "prop: text | description: Text Button | type: boolean | default: false",
              }
            },
            "description": "文本按钮",
            "setter": {
              "componentName": "BoolSetter",
              "isRequired": false,
              "initialValue": false
            }
          }
        ]
      }, 
      {
        "name": "InteractionSetting",
        "title": "交互设置",
        "type": "group",
        "display": "block",
        "items": [ 
          {
            "title": {
              "label": {
                "type": "i18n",
                "en-US": "disabled",
                "zh-CN": "是否禁用"
              },
              "tip": "disabled | 是否禁用"
            },
            "name": "disabled",
            "description": "是否禁用",
            "setter": {
              "componentName": "BoolSetter",
              "isRequired": false,
              "initialValue": false
            }
          },
        ]
      },
    ],
    "supports": {
      "style": true,
      "events": ["onClick"]
    },
    "component": {}
  }
};
const snippets: IPublicTypeSnippet[] = [
  {
    "title": "实体批量删除按钮",
    "screenshot": "https://alifd.oss-cn-hangzhou.aliyuncs.com/fusion-cool/icons/icon-light/ic_light_button.png",
    "schema": {
      "componentName": "OadpEntityButtonBatchDelete",
      "props": {
        "label": "批量删除",
        "type": "secondary",
        "size": "medium",
        "disabled": false,
        "text": false,
        "onClick": {
          "type": "JSExpression",
          "value": "function() {\n      const self = this;\n      try {\n        return (function (v,e){ return this.utils.eventUtil.onBatchDelete.apply(this,Array.prototype.slice.call(arguments).concat([{\n\t\"schema\": this.schema\n}])) }).apply(self, arguments);\n      } catch(e) {\n        console.warn('call function which parsed by lowcode failed: ', e);\n        return e.message;\n      }\n    }"
        },
        "__events": {
          "eventDataList": [
            {
              "type": "componentEvent",
              "name": "onClick",
              "relatedEventName": "onClick",
              "paramStr": "{\n\t\"schema\": this.schema\n}"
            }
          ],
          "eventList": [
            {
              "name": "onClick",
              "disabled": true
            }
          ]
        },
        "style": { 
          "marginRight": "5px"
        }
      }
    }
  }
];

export default {
  ...OadpEntityButtonBatchDeleteMeta,
  snippets
};
