"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports["default"] = void 0;
var _locale = require("../../src/locale");
var _setters = require("../_setters");
var _snippets = _interopRequireDefault(require("./snippets"));
var _type = require("../_utils/treeDataRelationFn/type");
var _utils = require("../_utils/utils");
var _componentName = _interopRequireDefault(require("../_com-props/componentName"));
var _default = exports["default"] = {
  snippets: _snippets["default"],
  componentName: 'Drawer',
  "group": (0, _locale.t)('drawer.key_BmALqEVSYiaW'),
  title: (0, _locale.t)('drawer.key_8cdQSe7xHNEH'),
  category: (0, _locale.t)('drawer.key_Igsc04XCZU88'),
  props: [{
    title: (0, _locale.t)('drawer.key_9OXDO5XXMviP'),
    display: 'block',
    type: 'group',
    items: [{
      name: 'name',
      title: {
        label: (0, _locale.t)('drawer.key_WbgAWH9ywULX'),
        tip: (0, _locale.t)('drawer.key_3K0g9QbyAHRH')
      },
      isRequired: true,
      propType: 'string',
      setter: _setters.CStringOnlySetter,
      defaultValue: function defaultValue() {
        return "cr_" + (0, _utils.uuid)();
      },
      supportVariable: false,
      extraProps: {
        type: _type.PageStateFlag.Modal,
        setValue: function setValue(target, value) {
          if (value !== undefined && value !== '') {
            var exp = {
              "type": "JSExpression",
              "value": "this.state?." + _type.PageStateFlag.Modal + "?." + value + "?.visible",
              "mock": true
            };
            target.parent.setPropValue('open', exp);
            target.parent.setPropValue('componentName', value);
          }
        }
      }
    }, {
      name: 'open',
      title: {
        label: (0, _locale.t)('drawer.key_4nE3mrzgRm6q'),
        tip: (0, _locale.t)('drawer.key_5sDVmpYkkLk5')
      },
      propType: 'bool',
      setter: 'BoolSetter',
      condition: function condition() {
        return false;
      }
    }, _componentName["default"], {
      name: 'title',
      title: {
        label: (0, _locale.t)('drawer.key_qcdbihZnrgYO'),
        tip: (0, _locale.t)('drawer.key_uaLCsHCz8Qnx')
      },
      propType: {
        type: 'oneOfType',
        value: ['string', 'node']
      },
      setter: ['StringSetter', {
        componentName: 'SlotSetter',
        title: (0, _locale.t)('drawer.key_pZK0w9JsubXD'),
        initialValue: {
          type: 'JSSlot',
          value: []
        }
      }, 'VariableSetter']
    }, {
      name: 'apiParams',
      title: {
        label: (0, _locale.t)('drawer.key_VowufVM6WISP'),
        tip: (0, _locale.t)('drawer.key_otQpYqkTqwt4')
      },
      setter: _setters.CTreeDataRelationSetter,
      extraProps: {
        componentName: 'ModalDefault'
      }
    }]
  }, {
    title: (0, _locale.t)('drawer.key_jhe8Ky0cbxLO'),
    display: 'block',
    type: 'group',
    items: [{
      name: 'placement',
      title: {
        label: (0, _locale.t)('drawer.key_dnn3iBU9anoB'),
        tip: (0, _locale.t)('drawer.key_2Mbo1yhn6Q9t')
      },
      propType: {
        type: 'oneOf',
        value: ['top', 'right', 'bottom', 'left']
      },
      defaultValue: 'right',
      setter: {
        componentName: 'SelectSetter',
        props: {
          options: [{
            title: (0, _locale.t)('drawer.key_Ofuix2iPO4nL'),
            value: 'top'
          }, {
            title: (0, _locale.t)('drawer.key_eDTNRq1EYVzv'),
            value: 'right'
          }, {
            title: (0, _locale.t)('drawer.key_OUiB0DWHH9Sw'),
            value: 'bottom'
          }, {
            title: (0, _locale.t)('drawer.key_OoMDk8uSsdz7'),
            value: 'left'
          }]
        }
      }
    }, {
      name: 'size',
      title: {
        label: (0, _locale.t)('drawer.key_vxDdTKFNk8jp'),
        tip: (0, _locale.t)('drawer.key_zdYpJOaMpahj')
      },
      propType: {
        type: 'oneOf',
        value: ['default', 'large']
      },
      defaultValue: 'default',
      setter: {
        componentName: 'RadioGroupSetter',
        props: {
          options: [{
            title: (0, _locale.t)('drawer.key_YPBEsLpiTuPT'),
            value: 'default'
          }, {
            title: (0, _locale.t)('drawer.key_317hbqiK0nzb'),
            value: 'large'
          }]
        }
      }
    },
    // {
    //   name: 'width',
    //   title: { label: t('drawer.key_YerY3BFWOpk2'), tip: t('drawer.key_NJFx87TFpEYZ') },
    //   propType: { type: 'oneOfType', value: ['string', 'number'] },
    //   setter: ['StringSetter', 'NumberSetter', 'VariableSetter'],
    // },
    // {
    //   name: 'height',
    //   title: {
    //     label: t('drawer.key_u7a8ASYt97E8'),
    //     tip: t('drawer.key_BwKC8T9lfDp5'),
    //   },
    //   propType: { type: 'oneOfType', value: ['string', 'number'] },
    //   setter: ['StringSetter', 'NumberSetter', 'VariableSetter'],
    // },
    {
      name: 'zIndex',
      title: {
        label: 'z-index',
        tip: (0, _locale.t)('drawer.key_d19E9hsEPSL8')
      },
      propType: 'number',
      setter: 'NumberSetter'
    }]
  }, {
    title: (0, _locale.t)('drawer.key_SNaVCdVz2BGp'),
    display: 'block',
    type: 'group',
    items: [{
      name: 'mask',
      title: {
        label: (0, _locale.t)('drawer.key_wwNl25r3SI9E'),
        tip: (0, _locale.t)('drawer.key_Cg50hyybn2CT')
      },
      propType: 'bool',
      defaultValue: true,
      setter: 'BoolSetter'
    }, {
      name: 'maskClosable',
      title: {
        label: (0, _locale.t)('drawer.key_plEJhkxFismu'),
        tip: (0, _locale.t)('drawer.key_a97CEFwgql46')
      },
      propType: 'bool',
      defaultValue: false,
      setter: 'BoolSetter'
    }, {
      name: 'autoFocus',
      title: {
        label: (0, _locale.t)('drawer.key_BRp7KZ4rQ3Ne'),
        tip: (0, _locale.t)('drawer.key_d0niRGYUGTge')
      },
      propType: 'bool',
      defaultValue: true,
      setter: 'BoolSetter'
    }, {
      name: 'keyboard',
      title: {
        label: (0, _locale.t)('drawer.key_ULeWMSXaoC4F'),
        tip: (0, _locale.t)('drawer.key_pR1BhXbnd0ef')
      },
      propType: 'bool',
      defaultValue: true,
      setter: 'BoolSetter'
    }, {
      name: 'destroyOnClose',
      title: {
        label: (0, _locale.t)('drawer.key_gclwYZgCKC0B'),
        tip: (0, _locale.t)('drawer.key_QMH4LbCBeG3m')
      },
      propType: 'bool',
      defaultValue: true,
      setter: 'BoolSetter',
      condition: function condition() {
        return false;
      }
    }, {
      name: 'refreshType',
      title: {
        label: (0, _locale.t)('drawer.refreshType'),
        tip: (0, _locale.t)('drawer.refreshTypeTip')
      },
      defaultValue: function defaultValue() {
        return "refresh";
      },
      setter: {
        componentName: 'SelectSetter',
        props: {
          options: [{
            title: (0, _locale.t)('drawer.refreshOption'),
            value: 'refresh'
          }, {
            title: (0, _locale.t)('drawer.dataRefreshOption'),
            value: 'dataRefresh'
          }, {
            title: (0, _locale.t)('drawer.noRefreshOption'),
            value: 'noRefresh'
          }]
        }
      },
      extraProps: {
        setValue: function setValue(target, value) {
          if (value) {
            var res = value === 'refresh';
            target.parent.setPropValue('destroyOnClose', res);
          }
        }
      }
    }, {
      name: 'closable',
      title: {
        label: (0, _locale.t)('drawer.key_yXb6a5kxhrsk'),
        tip: (0, _locale.t)('drawer.key_UcmRhC582hIp')
      },
      propType: 'bool',
      defaultValue: true,
      setter: 'BoolSetter'
    }, {
      name: 'forceRender',
      title: {
        label: (0, _locale.t)('drawer.key_1yadVecBaVJd'),
        tip: (0, _locale.t)('drawer.key_XcGdlHj5He6W')
      },
      propType: 'bool',
      defaultValue: false,
      setter: 'BoolSetter'
    }]
  }, {
    title: (0, _locale.t)("page.tgConfig"),
    display: "accordion",
    type: "group",
    items: [{
      name: 'backButton',
      title: {
        label: (0, _locale.t)('drawer.tgBackButton'),
        tip: (0, _locale.t)('drawer.tgBackButton')
      },
      propType: 'bool',
      defaultValue: false,
      setter: 'BoolSetter'
    }]
  }, {
    title: (0, _locale.t)('drawer.key_CWdOULJuuktm'),
    display: 'block',
    type: 'group',
    items: [
    // {
    //   name: 'containerName',
    //   title: { label: t('drawer.key_ghNpxbkvaFUE'), tip: t('drawer.key_qaIpQikiVXSC') },
    //   propType: 'string',
    //   setter: 'StringSetter',
    // },
    {
      name: 'drawerStyle',
      title: (0, _locale.t)('drawer.key_RiMCWOyRY5EG'),
      type: 'group',
      extraProps: {
        display: 'entry'
      },
      items: [{
        name: 'drawerStyle',
        title: {
          label: (0, _locale.t)('drawer.key_fM7Qz6FUlPD7'),
          tip: (0, _locale.t)('drawer.key_wUrJlY1g2fCl')
        },
        setter: 'CStyleSetter',
        extraProps: {
          display: 'block'
        }
      }]
    }, {
      name: 'contentWrapperStyle',
      title: (0, _locale.t)('drawer.key_VC5uprqiC8aa'),
      type: 'group',
      extraProps: {
        display: 'entry'
      },
      items: [{
        name: 'contentWrapperStyle',
        title: {
          label: (0, _locale.t)('drawer.key_FJ35mYJXr0Lv'),
          tip: (0, _locale.t)('drawer.key_9FyDGeAZ7dGE')
        },
        setter: 'CStyleSetter',
        extraProps: {
          display: 'block'
        }
      }]
    }, {
      name: 'headerStyle',
      title: (0, _locale.t)('drawer.key_dTobFxjl7QlD'),
      type: 'group',
      extraProps: {
        display: 'entry'
      },
      items: [{
        name: 'headerStyle',
        title: {
          label: (0, _locale.t)('drawer.key_9102nCvCfrBu'),
          tip: (0, _locale.t)('drawer.key_whmR2kN4mKtc')
        },
        setter: 'CStyleSetter',
        extraProps: {
          display: 'block'
        }
      }]
    }, {
      name: 'bodyStyle',
      title: (0, _locale.t)('drawer.key_YxSpRn8CDwTJ'),
      type: 'group',
      extraProps: {
        display: 'entry'
      },
      items: [{
        name: 'bodyStyle',
        title: {
          label: (0, _locale.t)('drawer.key_HS0feT5lajF7'),
          tip: (0, _locale.t)('drawer.key_8JDbY2MiMpGz')
        },
        setter: 'CStyleSetter',
        extraProps: {
          display: 'block'
        }
      }]
    }, {
      name: 'footerStyle',
      title: (0, _locale.t)('drawer.key_4XbeJDbQMD5J'),
      type: 'group',
      extraProps: {
        display: 'entry'
      },
      items: [{
        name: 'footerStyle',
        title: {
          label: (0, _locale.t)('drawer.key_HnZ9ugHO5D0D'),
          tip: (0, _locale.t)('drawer.key_Qd9I0Q0T4UIX')
        },
        setter: 'CStyleSetter',
        extraProps: {
          display: 'block'
        }
      }]
    }, {
      name: 'maskStyle',
      title: (0, _locale.t)('drawer.key_pu0DFmPVCClB'),
      type: 'group',
      extraProps: {
        display: 'entry'
      },
      items: [{
        name: 'maskStyle',
        title: {
          label: (0, _locale.t)('drawer.key_PCXvu8JiPtn6'),
          tip: (0, _locale.t)('drawer.key_6MXeq5goTaUu')
        },
        setter: 'CStyleSetter',
        extraProps: {
          display: 'block'
        }
      }]
    }]
  }],
  configure: {
    component: {
      isContainer: true,
      isModal: true,
      nestingRule: {
        parentWhitelist: ['Page', 'Component']
      }
    },
    supports: {
      events: false,
      style: true,
      "loop": false,
      "condition": false
    }
  }
};