"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports["default"] = void 0;
var _loopData = _interopRequireDefault(require("../_com-props/loopData"));
var _componentKey = _interopRequireDefault(require("../_com-props/componentKey"));
var _componentName = _interopRequireDefault(require("../_com-props/componentName"));
var _flowEventConfig = require("../_com-props/flowEventConfig");
var _snippets = _interopRequireDefault(require("./snippets"));
var _setters = require("../_setters");
var _conditionRenderService = require("../_utils/conditionRenderService");
var _locale = require("../../src/locale");
var _default = exports["default"] = {
  componentName: 'Button',
  title: (0, _locale.t)('button.title'),
  category: (0, _locale.t)('button.category'),
  group: (0, _locale.t)('button.group'),
  props: [_loopData["default"], _componentKey["default"], _componentName["default"], {
    title: (0, _locale.t)('button.feature'),
    display: 'block',
    type: 'group',
    items: [{
      name: 'dictionaryKey',
      title: {
        label: (0, _locale.t)('typographyText.key_kbMeuiEtQtNa'),
        tip: (0, _locale.t)('typographyText.key_kbMeuiEtQtNb')
      },
      setter: 'DictionarySetter',
      props: {
        type: 'text'
      }
    }, {
      name: 'children',
      title: {
        label: (0, _locale.t)('button.children'),
        tip: (0, _locale.t)('button.childrenTip')
      },
      propType: "string",
      setter: 'StringSetter'
    }, {
      name: 'defaultValue',
      title: {
        label: (0, _locale.t)('button.defaultValue'),
        tip: (0, _locale.t)('button.defaultValueTip')
      },
      propType: 'string',
      defaultValue: '',
      setter: _setters.CComputedSetter,
      extraProps: {
        setValue: function setValue(target, value) {
          if (value !== undefined && value !== '') {
            var conditionRenderService = new _conditionRenderService.ConditionRenderService();
            conditionRenderService.load(value.data);
            var exp = conditionRenderService.getConditionExpression();
            target.parent.setPropValue('children', exp);
          }
        }
      }
    }]
  }, (0, _flowEventConfig.getFlowEventConfig)({
    label: (0, _locale.t)('gridCol.clickFlowEvent'),
    tip: (0, _locale.t)('gridCol.clickFlowEventTip'),
    props: {}
  }),
  // getFlowEventConfig({
  //   name: "mouseDownFlowEvent",
  //   label: t('button.mouseDownFlowEvent'),
  //   tip: t('button.mouseDownFlowEventTip'),
  //   props: {}
  // }),
  // getFlowEventConfig({
  //   name: "mouseUpFlowEvent",
  //   label: t('button.mouseUpFlowEvent'),
  //   tip: t('button.mouseUpFlowEventTip'),
  //   props: {}
  // }),
  {
    title: (0, _locale.t)('button.appearance'),
    display: 'block',
    type: 'group',
    items: [{
      name: 'type',
      title: {
        label: (0, _locale.t)('button.type'),
        tip: (0, _locale.t)('button.typeTip')
      },
      propType: {
        type: 'oneOf',
        value: ['primary', 'ghost', 'dashed', 'danger', 'link', 'text']
      },
      setter: [{
        componentName: 'SelectSetter',
        props: {
          options: [{
            title: (0, _locale.t)('button.typeOptionPrimary'),
            value: 'primary'
          }, {
            title: (0, _locale.t)('button.typeOptionDashed'),
            value: 'dashed'
          }, {
            title: (0, _locale.t)('button.typeOptionDanger'),
            value: 'danger'
          }, {
            title: (0, _locale.t)('button.typeOptionLink'),
            value: 'link'
          }, {
            title: (0, _locale.t)('button.typeOptionText'),
            value: 'text'
          }]
        }
      }, 'VariableSetter']
    }, {
      name: 'size',
      title: {
        label: (0, _locale.t)('button.size'),
        tip: (0, _locale.t)('button.sizeTip')
      },
      propType: {
        type: 'oneOf',
        value: ['large', 'middle', 'small']
      },
      setter: [{
        componentName: 'RadioGroupSetter',
        props: {
          options: [{
            title: (0, _locale.t)('button.sizeOptionLarge'),
            value: 'large'
          }, {
            title: (0, _locale.t)('button.sizeOptionMiddle'),
            value: 'middle'
          }, {
            title: (0, _locale.t)('button.sizeOptionSmall'),
            value: 'small'
          }]
        }
      }, 'VariableSetter'],
      defaultValue: 'middle'
    }, {
      name: 'shape',
      title: {
        label: (0, _locale.t)('button.shape'),
        tip: (0, _locale.t)('button.shapeTip')
      },
      propType: {
        type: 'oneOf',
        value: ['default', 'circle', 'round']
      },
      defaultValue: 'default',
      setter: [{
        componentName: 'RadioGroupSetter',
        props: {
          options: [{
            title: (0, _locale.t)('button.shapeOptionDefault'),
            value: 'default'
          }, {
            title: (0, _locale.t)('button.shapeOptionCircle'),
            value: 'circle'
          }, {
            title: (0, _locale.t)('button.shapeOptionRound'),
            value: 'round'
          }]
        }
      }, 'VariableSetter']
    }, {
      name: 'block',
      title: {
        label: (0, _locale.t)('button.block'),
        tip: (0, _locale.t)('button.blockTip')
      },
      propType: 'bool',
      setter: 'BoolSetter',
      defaultValue: false
    }]
  }, {
    title: (0, _locale.t)('button.statusTitle'),
    display: 'block',
    type: 'group',
    items: [{
      name: 'disabled',
      title: {
        label: (0, _locale.t)('button.disabled'),
        tip: (0, _locale.t)('button.disabledTip')
      },
      propType: 'bool',
      setter: ['BoolSetter', 'VariableSetter'],
      defaultValue: false
    }]
  }, {
    title: (0, _locale.t)('button.buttonStatus'),
    display: 'block',
    type: 'group',
    items: [{
      name: 'hoverStyle',
      title: (0, _locale.t)('button.hoverStyle'),
      type: 'group',
      extraProps: {
        display: 'entry'
      },
      items: [{
        name: 'hoverStyle',
        title: {
          label: (0, _locale.t)('button.hoverStyle'),
          tip: (0, _locale.t)('button.hoverStyleTip')
        },
        setter: 'CStyleSetter',
        extraProps: {
          display: 'block'
        }
      }]
    }, {
      name: 'clickStyle',
      title: (0, _locale.t)('button.clickStyle'),
      type: 'group',
      extraProps: {
        display: 'entry'
      },
      items: [{
        name: 'clickStyle',
        title: {
          label: (0, _locale.t)('button.clickStyle'),
          tip: (0, _locale.t)('button.clickStyleTip')
        },
        setter: 'CStyleSetter',
        extraProps: {
          display: 'block'
        }
      }]
    }, {
      name: 'selectStyle',
      title: (0, _locale.t)('button.selectStyle'),
      type: 'group',
      extraProps: {
        display: 'entry'
      },
      items: [{
        name: 'selectStyle',
        title: {
          label: (0, _locale.t)('button.selectStyle'),
          tip: (0, _locale.t)('button.selectStyleTip')
        },
        setter: 'CStyleSetter',
        extraProps: {
          display: 'block'
        }
      }]
    }, {
      name: 'loadingStyle',
      title: (0, _locale.t)('button.loadingStyle'),
      type: 'group',
      extraProps: {
        display: 'entry'
      },
      items: [{
        name: 'loadingStyle',
        title: {
          label: (0, _locale.t)('button.loadingStyle'),
          tip: (0, _locale.t)('button.loadingStyleTip')
        },
        setter: 'CStyleSetter',
        extraProps: {
          display: 'block'
        }
      }]
    }, {
      name: 'errorStyle',
      title: (0, _locale.t)('button.errorStyle'),
      type: 'group',
      extraProps: {
        display: 'entry'
      },
      items: [{
        name: 'errorStyle',
        title: {
          label: (0, _locale.t)('button.errorStyle'),
          tip: (0, _locale.t)('button.errorStyleTip')
        },
        setter: 'CStyleSetter',
        extraProps: {
          display: 'block'
        }
      }]
    }]
  }],
  configure: {
    supports: {
      events: false,
      style: true,
      loop: false,
      condition: false
    }
  },
  snippets: _snippets["default"]
};