// #region Imports
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
import { Emit } from '../../../../Events/Decorators/EmitDecorator';
import { HTMLElementEventEmitter } from '@breadstone/mosaik-elements';
import { Disableable } from '../../../Behaviors/Disableable';
import { Insetable } from '../../../Behaviors/Insetable';
import { Component } from '../../../Decorators/ComponentDecorator';
import { CustomElement } from '../../Abstracts/CustomElement';
import { menuElementTemplate } from './MenuElementTemplate';
import { menuElementJoyStyle } from './Themes/MenuElement.Joy';
import { menuElementRetroStyle } from './Themes/MenuElement.Retro';
import { menuElementCosmopolitanStyle } from './Themes/MenuElement.Cosmopolitan';
import { Themeable } from '../../../Behaviors/Themeable';
// #endregion
/**
 * Menu - A list of options or actions presented to users.
 *
 * @element mosaik-menu
 *
 * @fires activated - Called when the element is activated.
 *
 * @public
 */
let MenuElement = class MenuElement extends Themeable(Disableable(Insetable(CustomElement))) {
    // #region Fields
    _activated;
    // #endregion
    // #region Ctor
    /**
     * @public
     */
    constructor() {
        super();
        this._activated = new HTMLElementEventEmitter(this, 'activated');
    }
    // #endregion
    // #region Properties
    /**
     * Returns the `{@link is}` property.
     * The `{@link is}` property represents natural name of this element.
     *
     * @public
     * @static
     * @readonly
     */
    static get is() {
        return 'mosaik-menu';
    }
    /**
     * Called when a menu item is activated.
     * Provides reference to `{@link IEventDetail}` as event detail.
     *
     * @public
     * @readonly
     * @eventProperty
     */
    get activated() {
        return this._activated;
    }
    // #endregion
    // #region Methods
    /**
     * @protected
     * @template
     */
    onSlotChange(x) {
        const target = x.target;
        if (target.assignedElements().length === 0) {
            this.setAttribute('empty', '');
        }
        else {
            this.removeAttribute('empty');
        }
    }
};
__decorate([
    Emit({ eventName: 'activated' }),
    __metadata("design:type", Object),
    __metadata("design:paramtypes", [])
], MenuElement.prototype, "activated", null);
MenuElement = __decorate([
    Component({
        selector: 'mosaik-menu',
        template: menuElementTemplate,
        themes: {
            joy: menuElementJoyStyle,
            retro: menuElementRetroStyle,
            cosmopolitan: menuElementCosmopolitanStyle
        },
        imports: []
    }),
    __metadata("design:paramtypes", [])
], MenuElement);
export { MenuElement };
//# sourceMappingURL=MenuElement.js.map