text: import {
    ActiveMixin
  } from "./chunk-W5WIT4JA.js";
  import {
    FocusMixin
  } from "./chunk-VD23N2FG.js";
  
  // node_modules/.pnpm/@vaadin/item@22.0.0-beta2/node_modules/@vaadin/item/src/vaadin-item-mixin.js
  var ItemMixin = (superClass) => class VaadinItemMixin extends ActiveMixin(FocusMixin(superClass)) {
    static get properties() {
      return {
        _hasVaadinItemMixin: {
          value: true
        },
        selected: {
          type: Boolean,
          value: false,
          reflectToAttribute: true,
          observer: "_selectedChanged"
        },
        _value: String
      };
    }
    get _activeKeys() {
      return ["Enter", " "];
    }
    get value() {
      return this._value !== void 0 ? this._value : this.textContent.trim();
    }
    set value(value) {
      this._value = value;
    }
    ready() {
      super.ready();
      const attrValue = this.getAttribute("value");
      if (attrValue !== null) {
        this.value = attrValue;
      }
    }
    focus() {
      if (this.disabled) {
        return;
      }
      super.focus();
      this._setFocused(true);
    }
    _shouldSetActive(event) {
      return !this.disabled && !(event.type === "keydown" && event.defaultPrevented);
    }
    _selectedChanged(selected) {
      this.setAttribute("aria-selected", selected);
    }
    _disabledChanged(disabled) {
      super._disabledChanged(disabled);
      if (disabled) {
        this.selected = false;
        this.blur();
      }
    }
    _onKeyDown(event) {
      super._onKeyDown(event);
      if (this._activeKeys.includes(event.key) && !event.defaultPrevented) {
        event.preventDefault();
        this.click();
      }
    }
  };
  
  export {
    ItemMixin
  };
  /**
   * @license
   * Copyright (c) 2021 Vaadin Ltd.
   * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
   */
  //# sourceMappingURL=chunk-AP72M3JK.js.map
  