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

const OadpAttributeMeta: IPublicTypeComponentMetadata = {
  "componentName": "OadpAttribute",
  "title": "属性",
  "docUrl": "",
  "category": "高级组件",
  "group": "低代码组件",
  "screenshot": "https://alifd.oss-cn-hangzhou.aliyuncs.com/fusion-cool/icons/icon-light/ic_light_select.png",
  "devMode": "proCode",
  "npm": {
    "package": "oadp-material",
    "version": "{{version}}",
    "exportName": "OadpAttribute",
    "main": "src/index.tsx",
    "destructuring": true,
    "subName": ""
  },
  "configure": {
    "props": [
      {
        "name": "DataSetting",
        "title": "数据设置",
        "type": "group",
        "display": "block",
        "items": [ 
          {
            "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": "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": "code",
            "title": {
              "label": {
                "type": "i18n",
                "zh_CN": "编码",
                "en_US": "code",
              },
              "tip": {
                "type": "i18n",
                "zh_CN": "属性: code | 说明: 编码",
                "en_US": "prop: code | description: switch code",
              },
            },
            "setter": "StringSetter", 
            "supportVariable": false,
          },
          {
            "name": "logicalName",
            "title": {
              "label": {
                "type": "i18n",
                "zh_CN": "逻辑名称",
                "en_US": "logicalName",
              },
              "tip": {
                "type": "i18n",
                "zh_CN": "属性: logicalName | 说明: 逻辑名称",
                "en_US": "prop: logicalName | description: switch logicalName",
              },
            },
            "setter": "StringSetter", 
            "supportVariable": false,
          },
          {
            "name": "physicalName",
            "title": {
              "label": {
                "type": "i18n",
                "zh_CN": "物理名称",
                "en_US": "physicalName",
              },
              "tip": {
                "type": "i18n",
                "zh_CN": "属性: physicalName | 说明: 物理名称",
                "en_US": "prop: physicalName | description: switch physicalName",
              },
            },
            "setter": "StringSetter", 
            "supportVariable": false,
          },
          {
            "name": "attributeType",
            "title": {
              "label": {
                "type": "i18n",
                "zh_CN": "attributeType",
                "en_US": "属性类型",
              },
              "tip": {
                "type": "i18n",
                "zh_CN": "属性: attributeType | 说明: 属性类型",
                "en_US": "prop: attributeType | description: switch attributeType",
              },
            },
            "setter": "StringSetter", 
            "supportVariable": false,
          },  
          { 
            "title": {
              "label": {
                "type": "i18n",
                "en-US": "Attribute",
                "zh-CN": "属性"
              },
              "tip":  {
                "type": "i18n",
                "zh_CN": "属性: attribute | 说明:属性",
                "en_US": "prop: attribute | description: Set Attribute.",
              },
            },
            "name": "attribute",
            "description": "属性",
            "setter": {
              "componentName": "ArraySetter",
              "props": {
                "itemSetter": {
                  "componentName": "ObjectSetter",
                  "props": {
                    "config": {
                      "items": [
                        {
                          "name": "id",
                          "title": "属性ID",
                          "setter": "StringSetter"
                        },
                        {
                          "name": "name",
                          "title": "属性名称",
                          "setter": "StringSetter"
                        },
                        {
                          "name": "logicalName",
                          "title": "属性逻辑名称",
                          "setter": "StringSetter"
                        }
                      ]
                    }
                  },
                  "initialValue": {
                    "id": "属性ID",
                    "name": "属性名称",
                    "logicalName": "属性逻辑名称"
                  }
                }
              }
            },
            "supportVariable": true,
          }, 
          {
            "name": "defaultValue",
            "title": {
              "label": {
                "type": "i18n",
                "zh_CN": "默认值",
                "en_US": "Default Value",
              },
              "tip": {
                "type": "i18n",
                "zh_CN": "属性: defaultValue | 说明: 默认值",
                "en_US": "prop: defaultValue | description: Default Value",
              },
            },
            "setter": "StringSetter",
            "supportVariable": true,
            "description": "默认值",
          },  
          {
            "name": "description",
            "title": {
              "label": {
                "type": "i18n",
                "zh_CN": "描述",
                "en_US": "description",
              },
              "tip": {
                "type": "i18n",
                "zh_CN": "属性: description | 说明: 默认值",
                "en_US": "prop: description | description: description",
              },
            },
            "setter": "StringSetter",
            "supportVariable": true,
            "description": "描述",
          },  
        ]
      },
      // {
      //   "name": "DisplaySetting",
      //   "title": "显示设置",
      //   "type": "group",
      //   "display": "block",
      //   "items": [  
      //   ]
      // }, 
      {
        "name": "InteractionSetting",
        "title": "交互设置",
        "type": "group",
        "display": "block",
        "items": [ 
          {
            "name": "required",
            "title": {
              "label": {
                "type": "i18n",
                "en-US": "required",
                "zh-CN": "必填"
              },
              "tip": {
                "type": "i18n",
                "zh_CN": "属性: required | 说明: 必填",
                "en_US": "prop: required | description: required",
              },
            },
            "description": "必填",
            "setter": {
              "componentName": "BoolSetter",
              "isRequired": false,
              "initialValue": false
            }
          },  
          {
            "name": "disabled",
            "title": {
              "label": {
                "type": "i18n",
                "zh_CN": "禁用",
                "en_US": "Disabled",
              },
              "tip": {
                "type": "i18n",
                "zh_CN": "属性: disabled | 说明: 禁用",
                "en_US": "prop: disabled | description: disabled",
              },
            },
            "setter": "BoolSetter",
            "supportVariable": false,
            "description": "禁用",
          },  
        ]
      },
    ],
    "supports": {
      "style": true
    },
    "component": {}
  }
};
const snippets: IPublicTypeSnippet[] = [
  {
    "title": "属性",
    "screenshot": "https://alifd.oss-cn-hangzhou.aliyuncs.com/fusion-cool/icons/icon-light/ic_light_select.png",
    "schema": {
      "componentName": "OadpAttribute", 
      "props": {
        "name": "entityType",
        "placeholder": "请选择内容",
        "required": false,
        "disabled": false,
        "size": "medium",
        "style": {
          "width": 256
        },
        "hasArrow": true,
        "hasClear": true,
        "hasBorder": true,
        "referEntity": {
          "id": "E11FCBEC5BED4D0C9BB34A71352B7E4D",
          "name": "实体类型",
          "logicalName": "entityType"
        },
        "mode": "single"
      },
    }
  }
];

export default {
  ...OadpAttributeMeta,
  snippets
};
