import './es.symbol.description-ff7a02e9.js';
import './es.array.includes-429b943f.js';
import { c as createId } from './utils-1ee736f4.js';
import BaseIcon from './BaseIcon-97f2c0df.js';
import { B as BaseBoxTooltip } from './BaseBoxTooltip-01bd0121.js';
import { n as normalizeComponent } from './normalize-component-f552f2b0.js';
import './export-ca205aa3.js';
import './array-species-create-734a2b2d.js';
import './object-keys-2117de4f.js';
import './set-to-string-tag-8223b960.js';
import './array-iteration-174e15bc.js';
import './function-bind-context-b3fabf77.js';
import './typeof-6c6d8d7a.js';
import './unsupportedIterableToArray-577176bf.js';
import './es.array.join-6d270396.js';
import './array-method-is-strict-b717b087.js';
import './es.array.map-6e99e953.js';
import './array-method-has-species-support-4880738d.js';
import './regexp-exec-abstract-f3a4fb3d.js';
import './string-multibyte-2334bbf7.js';
import './regexp-flags-0e12a922.js';
import './es.string.split-e8138ba0.js';
import './is-regexp-2d7aa8f2.js';
import './es.array.slice-8edbe7ac.js';
import './create-property-64305cbf.js';
import './es.object.to-string-363bb00e.js';
import './classof-efe356f2.js';
import './es.regexp.to-string-60b34f50.js';
import './es.string.replace-71289216.js';
import './es.string.includes-7cd9db5f.js';
import './es.array.sort-429613bb.js';
import './web.dom-collections.for-each-88fb2ed7.js';
import './dom-iterables-b6f5ef3b.js';
import './es.object.keys-8d50ea2f.js';
import 'vue-svgicon';

/**
 * Standard buttons
 */

var script = {
  name: 'BaseButton',
  components: {
    BaseIcon: BaseIcon,
    BaseBoxTooltip: BaseBoxTooltip
  },
  props: {
    /**
     * Button Text
     */
    text: {
      type: String,
      default: 'Submit'
    },
    // TODO: need to check if it is possible to use custom icons --> if yes description!

    /**
     * icon displayed <br>
     * see [BaseIcon](#baseicon) for available icons<br>
     */
    icon: {
      type: String,
      default: null
    },

    /**
     * set from outside if icon should be made invisible
     */
    hideIcon: {
      type: Boolean,
      default: false
    },

    /**
     * specify if icon should be displayed left or right
     */
    iconPosition: {
      type: String,
      default: 'left',
      validator: function validator(val) {
        return ['top', 'right', 'left'].includes(val);
      }
    },

    /**
     * set button active (will display a colored border on botton) (row style)
     * or keep icon colored (single style)
     */
    active: {
      type: Boolean,
      default: false
    },

    /**
     * specify a button style
     */
    buttonStyle: {
      type: String,
      default: 'single',
      validator: function validator(val) {
        return ['single', 'row', 'secondary'].includes(val);
      }
    },

    /**
     * display icon with app-color
     */
    iconColored: {
      type: Boolean,
      default: false
    },

    /**
     * specify icon size<br>
     *   this will have no effect on button-style: secondary - icon will always be small
     */
    iconSize: {
      type: String,
      default: 'small',
      validator: function validator(val) {
        return ['small', 'large'].includes(val);
      }
    },

    /**
     * set a title for the icon that is shown as a tooltip on hover
     */
    iconTitle: {
      type: String,
      default: ''
    },

    /**
     * set button inactive
     */
    disabled: {
      type: Boolean,
      default: false
    },

    /**
     * set button type
     */
    buttonType: {
      type: String,
      default: 'button'
    },

    /**
     * define alignment of button content<br>
     * Info: has no effect, if iconPosition 'top' is set
     */
    alignText: {
      type: String,
      default: 'center',
      validator: function validator(val) {
        return ['center', 'left', 'right'].includes(val);
      }
    },

    /**
     * background color is fixed however at least possibility to
     * display transparent instead
     */
    hasBackgroundColor: {
      type: Boolean,
      default: true
    },

    /**
     * show tooltip
     */
    showTooltip: {
      type: Boolean,
      default: false
    },

    /**
     * Add a button description to be used by aria-describedby
     */
    description: {
      type: String,
      default: ''
    },

    /**
     * set false if button text should not be wrapped
     */
    buttonTextWrap: {
      type: Boolean,
      default: true
    }
  },
  data: function data() {
    return {
      internalId: createId()
    };
  },
  methods: {
    clicked: function clicked(event) {
      /**
       * triggered on button click
       *
       * @type {Event}
       */
      this.$emit('clicked', event);
    }
  }
};

var __vue_script__ = script;
/* template */

var __vue_render__ = function __vue_render__() {
  var _vm = this;

  var _h = _vm.$createElement;

  var _c = _vm._self._c || _h;

  return _c('button', {
    class: ['base-button', "base-button-" + _vm.buttonStyle, "base-button-icon-" + _vm.iconPosition, "base-button-align-" + _vm.alignText, {
      'base-button-background': _vm.hasBackgroundColor
    }, {
      'base-button-active': _vm.active
    }],
    attrs: {
      "disabled": _vm.disabled,
      "aria-disabled": _vm.disabled,
      "aria-describedby": _vm.internalId,
      "type": _vm.buttonType
    },
    on: {
      "click": function click($event) {
        $event.preventDefault();
        return _vm.clicked.apply(null, arguments);
      }
    }
  }, [_vm.icon ? _c('base-icon', {
    class: ['base-button-icon', 'base-button-icon-' + _vm.iconSize, {
      'base-button-icon-colored': _vm.iconColored
    }, {
      'base-button-icon-hide': _vm.hideIcon
    }],
    attrs: {
      "name": _vm.icon,
      "title": _vm.iconTitle
    }
  }) : _vm._e(), _vm._v(" "), _vm._t("left-of-text"), _vm._v(" "), _vm._t("text", function () {
    return [_vm.text ? _c('span', {
      class: ['base-button-text', {
        'base-button-text__nowrap': !_vm.buttonTextWrap
      }]
    }, [_vm._v("\n      " + _vm._s(_vm.text) + "\n    ")]) : _vm._e()];
  }), _vm._v(" "), _vm._t("right-of-text"), _vm._v(" "), _vm.showTooltip ? _c('BaseBoxTooltip', {
    on: {
      "clicked": _vm.clicked
    }
  }) : _vm._e(), _vm._v(" "), _vm.description ? _c('span', {
    staticClass: "hide",
    attrs: {
      "id": _vm.internalId
    }
  }, [_vm._v("\n    " + _vm._s(_vm.description) + "\n  ")]) : _vm._e()], 2);
};

var __vue_staticRenderFns__ = [];
/* style */

var __vue_inject_styles__ = undefined;
/* scoped */

var __vue_scope_id__ = "data-v-343e9d28";
/* module identifier */

var __vue_module_identifier__ = undefined;
/* functional template */

var __vue_is_functional_template__ = false;
/* style inject */

/* style inject SSR */

/* style inject shadow dom */

var __vue_component__ = /*#__PURE__*/normalizeComponent({
  render: __vue_render__,
  staticRenderFns: __vue_staticRenderFns__
}, __vue_inject_styles__, __vue_script__, __vue_scope_id__, __vue_is_functional_template__, __vue_module_identifier__, false, undefined, undefined, undefined);

var BaseButton = __vue_component__;

export { BaseButton as default };
