'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var vue = require('vue');
var index = require('../../overlay/index.js');
require('../../dialog/index.js');
var index$1 = require('../../icon/index.js');
require('../../../directives/index.js');
var icons = require('@element-plus/icons');
var index$2 = require('../../button/index.js');
require('../../../hooks/index.js');
var index$3 = require('../../../directives/trap-focus/index.js');
var dialog = require('../../dialog/src/dialog2.js');
var index$4 = require('../../../hooks/use-locale/index.js');
var useDialog = require('../../dialog/src/use-dialog.js');

var script = vue.defineComponent({
  name: "ElDrawer",
  components: {
    ElOverlay: index.ElOverlay,
    ElIcon: index$1.ElIcon,
    ElButton: index$2.ElButton,
    Close: icons.Close
  },
  directives: {
    TrapFocus: index$3["default"]
  },
  props: {
    ...dialog.dialogProps,
    direction: {
      type: String,
      default: "rtl",
      validator: (val) => {
        return ["ltr", "rtl", "ttb", "btt"].indexOf(val) !== -1;
      }
    },
    size: {
      type: [String, Number],
      default: "30%"
    },
    withHeader: {
      type: Boolean,
      default: true
    },
    modalFade: {
      type: Boolean,
      default: true
    }
  },
  emits: dialog.dialogEmits,
  setup(props, ctx) {
    const drawerRef = vue.ref(null);
    const { t } = index$4.useLocale();
    const cancelText = props.cancelText || t("el.popconfirm.cancelButtonText");
    const submitText = props.submitText || t("el.popconfirm.confirmButtonText");
    return {
      ...useDialog.useDialog(props, ctx, drawerRef),
      drawerRef,
      isHorizontal: vue.computed(() => props.direction === "rtl" || props.direction === "ltr"),
      drawerSize: vue.computed(() => typeof props.size === "number" ? `${props.size}px` : props.size),
      cancelText,
      submitText
    };
  }
});

exports["default"] = script;
//# sourceMappingURL=index.vue_vue_type_script_lang.js.map
