import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-72f3c995.js';
import { b as getHostAttrs } from './index-9dff857b.js';

const bsInputSearchCss = "bs-input-search{display:inline-block;width:100%}bs-input-search :where(bs-input-addon) :where(bs-icon-search){padding-left:0.75rem}bs-input-search :where(bs-input-addon) :where(bs-icon-close){padding-right:0.75rem}bs-input-search :where(bs-input-addon) :where(button){align-items:center;background-color:transparent;cursor:pointer;display:flex;height:100%}";

const BsInputSearch = class {
  constructor(hostRef) {
    registerInstance(this, hostRef);
    this.onclear = createEvent(this, "onclear", 7);
    /** Native attributes to pass through to the input element. */
    this.attrs = {};
    this.disabled = false;
    this.passAttrs = '';
    this.placeholder = "Search Items";
    this.ariaLabel = "Search Items";
    this.hintId = undefined;
    this.value = '';
  }
  componentWillLoad() {
    this.attrs = getHostAttrs(this.hostEl, [
      'autocomplete',
      'id',
      'maxlength',
      'minlength',
      'name',
      ...this.passAttrs.split(',')
    ]);
  }
  render() {
    const passAttrs = 'aria-label';
    return (h(Host, null, h("bs-input-addon", { disabled: this.disabled }, h("bs-icon-search", null), h("bs-input", Object.assign({ "aria-label": this.ariaLabel, "data-autowidth": true, disabled: this.disabled, passAttrs: passAttrs, placeholder: this.placeholder, value: this.value }, Object.assign(Object.assign({}, this.attrs), { 'aria-describedby': this.hintId }))), !this.disabled &&
      h("button", { title: "Clear", type: "button", onClick: () => this.onclear.emit() }, h("bs-icon-close", { size: "sm" })))));
  }
  get hostEl() { return getElement(this); }
};
BsInputSearch.style = bsInputSearchCss;

export { BsInputSearch as bs_input_search };

//# sourceMappingURL=bs-input-search.entry.js.map