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

const OadpButtonBarMeta: IPublicTypeComponentMetadata = {
  "componentName": "OadpButtonBar",
  "title": "按钮栏",
  "category": "基础组件",
  "group": "低代码组件",
  "docUrl": "",
  "screenshot": "https://img.alicdn.com/tfs/TB1t6dhvV67gK0jSZPfXXahhFXa-310-122.png",
  "devMode": "proCode",
  "npm": {
    "package": "oadp-material",
    "version": "{{version}}",
    "exportName": "OadpButtonBar",
    "main": "src/index.tsx",
    "destructuring": true,
    "subName": ""
  },
  "configure": {
    "props": [ 
      {
        "name": "direction",
        "title": {
          "label": {
            "type": "i18n",
            "en-US": "direction",
            "zh-CN": "方向"
          }
        },
        "setter": {
          "componentName": "RadioGroupSetter",
          "props": {
            "dataSource": [
              {
                "label": "水平",
                "value": "row"
              },
              {
                "label": "竖直",
                "value": "column"
              }
            ],
            "options": [
              {
                "label": "水平",
                "value": "row"
              },
              {
                "label": "竖直",
                "value": "column"
              }
            ]
          },
          "initialValue": "row"
        }
      },
      {
        "name": "justify",
        "title": {
          "label": {
            "type": "i18n",
            "en-US": "justify",
            "zh-CN": "水平对齐"
          }
        },
        "setter": {
          "componentName": "RadioGroupSetter",
          "props": {
            "dataSource": [
              {
                "label": "居左对齐",
                "value": "start"
              },
              {
                "label": "居中对齐",
                "value": "center"
              },
              {
                "label": "居右对齐",
                "value": "end"
              }
            ],
            "options": [ 
              {
                "label": "居左对齐",
                "value": "start"
              },
              {
                "label": "居中对齐",
                "value": "center"
              },
              {
                "label": "居右对齐",
                "value": "end"
              }
            ]
          },
          "initialValue": "start"
        }
      },
      {
        "name": "align",
        "title": {
          "label": {
            "type": "i18n",
            "en-US": "align",
            "zh-CN": "垂直对齐"
          }
        },
        "setter": {
          "componentName": "RadioGroupSetter",
          "props": {
            "dataSource": [
              {
                "label": "顶部对齐",
                "value": "start"
              },
              {
                "label": "居中对齐",
                "value": "center"
              },
              {
                "label": "底部对齐",
                "value": "end"
              }
            ],
            "options": [
              {
                "label": "顶部对齐",
                "value": "start"
              },
              {
                "label": "居中对齐",
                "value": "center"
              },
              {
                "label": "底部对齐",
                "value": "end"
              }
            ]
          },
          "initialValue": "center"
        }
      }
    ],
    "supports": {
      "style": true
    },
    "component": {
      "isContainer" : true
    },
    "advanced": {
      "callbacks": {
        "onNodeAdd": (dragment, currentNode) => {
          console.log('onNodeAdd oadp-button-bar ', dragment, currentNode); 
        },
      },
    },
  }
};
const snippets: IPublicTypeSnippet[] = [
  {
    "title": "按钮栏",
    "screenshot": "https://img.alicdn.com/tfs/TB1t6dhvV67gK0jSZPfXXahhFXa-310-122.png",
    "schema": {
      "componentName": "OadpButtonBar",
      "props": {
        "direction": "row",
        "justify": "end",
        "align": "center",
      },
      "children": [
        {
          "componentName": "OadpButton", 
          "props": {
            "label": "按钮",
            "type": "primary",
            "size": "medium",
            "disabled": false,
            "style": { 
              "marginTop": "5px",
              "marginBottom": "5px",
              "marginLeft": "10px",
              "marginRight": "10px",
            }
          },
          "hidden": false,
          "title": "",
          "isLocked": false,
          "condition": true,
          "conditionGroup": ""
        }
      ]
    }
  }
];

export default {
  ...OadpButtonBarMeta,
  snippets
};
