// #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 { Disableable } from '../../../Behaviors/Disableable';
import { Stickable } from '../../../Behaviors/Stickable';
import { Attribute } from '../../../Decorators/AttributeDecorator';
import { Component } from '../../../Decorators/ComponentDecorator';
import { CustomElement } from '../../Abstracts/CustomElement';
import { StickyElement } from '../../Primitives/Sticky/StickyElement';
import { TextElement } from '../../Primitives/Text/TextElement';
import { ListItemElement } from './ListItemElement';
import { listItemGroupElementTemplate } from './ListItemGroupElementTemplate';
import { listItemGroupElementJoyStyle } from './Themes/ListItemGroupElement.Joy';
import { listItemGroupElementMemphisStyle } from './Themes/ListItemGroupElement.Memphis';
import { listItemGroupElementCosmopolitanStyle } from './Themes/ListItemGroupElement.Cosmopolitan';
import { Themeable } from '../../../Behaviors/Themeable';
import { getSlotElements } from '../../../../Dom/Slot';
// #endregion
/**
 * List Item Group - A container for grouping and organizing related list items with an optional header.
 *
 * @description
 * The List Item Group component provides a way to organize related list items into logical sections
 * within a larger list. It supports sticky headers that remain visible when scrolling, displays an
 * item count, and can be used to create visual or functional groupings such as categories, sections,
 * or alphabetical divisions. The group automatically tracks the number of child list items and can
 * display a customizable header with the group name and count.
 *
 * @name List Item Group
 * @element mosaik-list-item-group
 * @category Selectors
 *
 * @slot - The default slot for list items (mosaik-list-item elements)
 * @slot header - Custom header content (overrides the default header text)
 *
 * @csspart sticky - The sticky wrapper element when isSticky is true
 * @csspart header - The header text element
 *
 * @cssprop {String} --list-item-group-font-family - The font family for group text
 * @cssprop {String} --list-item-group-font-size - The font size for group text
 * @cssprop {String} --list-item-group-font-weight - The font weight for group text
 * @cssprop {String} --list-item-group-padding-top - The top padding inside the group
 * @cssprop {String} --list-item-group-padding-right - The right padding inside the group
 * @cssprop {String} --list-item-group-padding-bottom - The bottom padding inside the group
 * @cssprop {String} --list-item-group-padding-left - The left padding inside the group
 * @cssprop {String} --list-item-group-gap - The spacing between items
 * @cssprop {String} --list-item-group-foreground-color - The text color
 * @cssprop {String} --list-item-group-background-color - The background fill color
 * @cssprop {String} --list-item-group-border-color - The border color
 * @cssprop {String} --list-item-group-border-width - The border thickness
 * @cssprop {String} --list-item-group-border-radius - The corner rounding radius
 * @cssprop {String} --list-item-group-border-style - The border line style
 * @cssprop {String} --list-item-group-shadow - The drop shadow or elevation effect
 * @cssprop {String} --list-item-group-transition-duration - The duration of transitions
 * @cssprop {String} --list-item-group-transition-mode - The timing function for transitions
 * @cssprop {String} --list-item-group-transition-property - The CSS properties to transition
 *
 * @dependency {TextElement} - Text rendering component for the header
 * @dependency {StickyElement} - Sticky positioning wrapper for headers
 *
 * @fires connected {ConnectedEvent} - Fired when connected to the DOM
 * @fires changed {PropertyChangedEvent} - Fired when properties change
 *
 * @example
 * Basic list item group with header:
 * ```html
 * <mosaik-list-item-group header="Favorites">
 *   <mosaik-list-item>Item 1</mosaik-list-item>
 *   <mosaik-list-item>Item 2</mosaik-list-item>
 *   <mosaik-list-item>Item 3</mosaik-list-item>
 * </mosaik-list-item-group>
 * ```
 *
 * @example
 * Sticky group header:
 * ```html
 * <mosaik-list-item-group header="Recent" is-sticky>
 *   <mosaik-list-item>Recent item 1</mosaik-list-item>
 *   <mosaik-list-item>Recent item 2</mosaik-list-item>
 * </mosaik-list-item-group>
 * ```
 *
 * @example
 * Group with custom header slot:
 * ```html
 * <mosaik-list-item-group>
 *   <div slot="header">
 *     <mosaik-icon data="star-icon"></mosaik-icon>
 *     <strong>Starred Items</strong>
 *   </div>
 *   <mosaik-list-item>Starred 1</mosaik-list-item>
 *   <mosaik-list-item>Starred 2</mosaik-list-item>
 * </mosaik-list-item-group>
 * ```
 *
 * @public
 */
let ListItemGroupElement = class ListItemGroupElement extends Themeable(Stickable(Disableable(CustomElement))) {
    // #region Fields
    _header;
    // #endregion
    // #region Ctor
    /**
     * @public
     */
    constructor() {
        super();
        this._header = '';
    }
    // #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-list-item-group';
    }
    /**
     * Gets or sets the `header` property.
     *
     * @public
     * @attr
     */
    get header() {
        return this._header;
    }
    set header(value) {
        if (this._header !== value) {
            this._header = value;
            this.requestUpdate('header');
        }
    }
    /**
     * Returns the `count` property.
     *
     * @private
     * @readonly
     */
    get count() {
        return this.items.length;
    }
    /**
     * Returns the `items` property.
     *
     * @private
     * @readonly
     */
    get items() {
        const elements = getSlotElements(this.shadowRoot, ListItemElement.is);
        return elements;
    }
};
__decorate([
    Attribute({ type: String }),
    __metadata("design:type", String),
    __metadata("design:paramtypes", [String])
], ListItemGroupElement.prototype, "header", null);
ListItemGroupElement = __decorate([
    Component({
        selector: 'mosaik-list-item-group',
        template: listItemGroupElementTemplate,
        themes: {
            joy: listItemGroupElementJoyStyle,
            memphis: listItemGroupElementMemphisStyle,
            cosmopolitan: listItemGroupElementCosmopolitanStyle
        },
        imports: [
            TextElement,
            StickyElement
        ]
    }),
    __metadata("design:paramtypes", [])
], ListItemGroupElement);
export { ListItemGroupElement };
//# sourceMappingURL=ListItemGroupElement.js.map