
import { ComponentMetadata, Snippet } from '@alilc/lowcode-types';

const SubTotalMeta: ComponentMetadata = {
  "componentName": "SubTotal",
  "title": "SubTotal",
  "docUrl": "",
  "screenshot": "",
  "devMode": "proCode",
  "npm": {
    "package": "@pisell/private-materials",
    "version": "1.0.4",
    "exportName": "SubTotal",
    "main": "src/index.ts",
    "destructuring": true,
    "subName": ""
  },
  "configure": {
    "props": [
      {
        "title": {
          "label": {
            "type": "i18n",
            "en-US": "List",
            "zh-CN": "列表"
          }
        },
        "name": "list",
        "setter": ["JsonSetter", "VariableSetter"],
      },
      {
        name: "mode",
        title: {
          label: {
            type: "i18n",
            "en-US": "mode",
            "zh-CN": "模式",
          },
        },
        setter: [
          {
            componentName: "RadioGroupSetter",
            props: {
              options: [
                {
                  title: "默认",
                  value: "column1",
                },
                {
                  title: "紧凑",
                  value: "column2",
                },
              ],
            },
          },
          "VariableSetter",
        ],
        defaultValue: "column1",
      },
      {
        "title": {
          "label": {
            "type": "i18n",
            "en-US": "Describe",
            "zh-CN": "描述"
          }
        },
        "name": "describe",
        "setter": ["StringSetter", "VariableSetter"],
      },
    ],
    "supports": {
      "style": true,
      "events": [{
        "name": "onSubTotal"
      }]
    },
    "component": {}
  }
};
const snippets: Snippet[] = [
  {
    "title": "SubTotal",
    "screenshot": "",
    "schema": {
      "componentName": "SubTotal",
      "props": {
        list: [
          {
            key: 'deposit',
            value: 0,
          },
          {
            key: 'total',
            value: 0,
          },
          {
            key: 'sub_total',
            value: 0,
            count: 1,
          },
          {
            key: 'tax',
            value: 0,
            tax: {
              rate: 0.1,
              is_price_include_tax: true,
              title: 'GST',
            },
          },
          {
            key: 'delivery_fee',
            value: 0,
          },
          {
            key: 'point_deduction',
            value: 0,
          },
          {
            key: 'member_deduction',
            value: 0,
          },
        ],
        describe: 'Describe',
        mode: "column1",
      }
    }
  }
];

export default {
  ...SubTotalMeta,
  snippets
};
