import './es.symbol.description-3b56bced.js';
import './es.array.includes-1f433385.js';
import { c as createId } from './utils-21c04279.js';
import BaseIcon from './BaseIcon-d03b1fa2.js';
import { B as BaseBoxTooltip } from './BaseBoxTooltip-29b1c51f.js';
import { n as normalizeComponent } from './normalize-component-63e8c7a0.js';
import './export-ecf4b1cb.js';
import './array-species-create-afb281e6.js';
import './object-keys-a5d351f7.js';
import './set-to-string-tag-452fb9b0.js';
import './array-iteration-dec5536e.js';
import './function-bind-context-b3fabf77.js';
import './typeof-6c6d8d7a.js';
import './unsupportedIterableToArray-577176bf.js';
import './es.array.join-6ca857ff.js';
import './array-method-is-strict-903f485b.js';
import './es.array.map-093cfbca.js';
import './array-method-has-species-support-d96108b0.js';
import './regexp-exec-abstract-04d119fc.js';
import './string-multibyte-88926e02.js';
import './regexp-flags-b5fc4ddb.js';
import './es.string.split-cd1f3afc.js';
import './is-regexp-5558fd03.js';
import './es.array.slice-e9c3dd03.js';
import './create-property-c00b5c27.js';
import './es.object.to-string-5a59fbfc.js';
import './classof-b10e7604.js';
import './es.regexp.to-string-784af81c.js';
import './es.string.replace-07eeebfe.js';
import './es.string.includes-53dbb113.js';
import './es.array.sort-92cbfa54.js';
import './web.dom-collections.for-each-917714ef.js';
import './dom-iterables-b6f5ef3b.js';
import './es.object.keys-6369b884.js';
import './es.array.concat-9f3136dc.js';

/**
 * 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-29193ad2";
/* 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 };
