import { n as c, e as l, a as u } from "./provide-91b7b1ec.mjs";
import { P as h, x, n as d } from "./plus-base-10eea8a6.mjs";
import { e as f } from "./custom-element-eaccb8d2.mjs";
var w = Object.defineProperty, m = Object.getOwnPropertyDescriptor, p = (r, t, i, o) => {
  for (var s = o > 1 ? void 0 : o ? m(t, i) : t, n = r.length - 1, a; n >= 0; n--)
    (a = r[n]) && (s = (o ? a(t, i, s) : a(s)) || s);
  return o && s && w(t, i, s), s;
};
const y = c("dropdownContext");
let e = class extends h {
  constructor() {
    super(...arguments), this.size = "md", this.position = "bottom-start", this.context = {
      onSelect: (r) => {
        var i;
        const t = (i = this.context) == null ? void 0 : i.slot;
        t == null || t.forEach((o) => {
          o.active = o.id == r;
        }), this.emit("plus-dropdown-change", { detail: { id: r } });
      },
      size: this.size
    };
  }
  updated(r) {
    this.context.size = this.size;
  }
  render() {
    return x`
      <div>
        <plus-button class="dropdown" status="primary" .size=${this.size} id="dropdown">${this.text} <i class="fas fa-caret-down"> </i></plus-button>
        <plus-sticky-box .target=${this.dropdown} .position=${this.position}>
          <slot></slot>
        </plus-sticky-box>
      </div>
    `;
  }
};
p([
  l(".dropdown")
], e.prototype, "dropdown", 2);
p([
  d({ type: String })
], e.prototype, "size", 2);
p([
  d({ type: String })
], e.prototype, "text", 2);
p([
  d({ attribute: !1 })
], e.prototype, "position", 2);
p([
  u({ context: y })
], e.prototype, "context", 2);
e = p([
  f("plus-dropdown")
], e);
export {
  e as DropdownComponent,
  y as dropdownContext
};
