// #region Imports
import { html } from '../../../../Dom/Html';
import { Icons } from '../../../../Resources/Icons';
import { when } from '../../../Directives/Directives';
import { Appearance } from '../../../Types/Appearance';
import { CheckType } from '../../../Types/CheckType';
import { Orientation } from '../../../Types/Orientation';
import { Size } from '../../../Types/Size';
import { query } from './../../../Directives/Query';
// #endregion
/**
 * The template of the {@link MenuItemElement}.
 *
 * @public
 */
export function menuItemElementTemplate(e) {
    return html `
        <div part="root">
            ${when(!e.disabled, () => html `
            <mosaik-focus-ring part="focusRing"
                            .variant="${e.variant}"
                            .visible="${e.isFocused}"
                            .controlled="${'manual'}"
                            @connected="${(evt) => evt.target.attach(e)}"></mosaik-focus-ring>
            <mosaik-ripple .variant="${e.variant}"
                           @connected="${(evt) => evt.target.attach(e)}"></mosaik-ripple>
            `)}
            ${when(e.isChecked, () => html `
            <mosaik-checkmark part="checkmark"
                            .appearance="${Appearance.Plain}"
                            .variant="${e.variant}"
                            .type="${CheckType.Hook}"
                            ?checked="${e.isChecked}"
                            ?disabled="${e.disabled}"></mosaik-checkmark>
            `)}
            <slot name="start"></slot>
            <slot name="icon">
                ${when(e.icon.trim(), () => html `
                <mosaik-icon .size="${Size.Small}"
                             .data="${e.icon}"
                             ?disabled="${e.disabled}"></mosaik-icon>
                `)}
            </slot>
            <mosaik-stack part="text"
                        .orientation="${Orientation.Vertical}">
                <slot name="label">
                ${when(e.label, () => html `
                    <mosaik-text .text="${e.label}"
                                 ?truncate="${true}"
                                 ?disabled="${e.disabled}"></mosaik-text>
                `)}
                </slot>
                <slot name="subLabel">
                ${when(e.subLabel, () => html `
                    <mosaik-text .text="${e.subLabel}"
                                 ?disabled="${e.disabled}"></mosaik-text>
                `)}
                </slot>
            </mosaik-stack>
            ${when(e.hasChildren, () => html `
            <mosaik-button part="caret"
                           .appearance="${Appearance.Plain}"
                           .icon="${Icons.caretDown}"
                           .size="${Size.Small}"
                           ?disabled="${e.disabled}"
                           @click="${() => query(e, '[part="expandable"]', { shadow: true, strict: true }).toggle()}"></mosaik-button>
            `)}
            <slot name="end"></slot>
        </div>
        <mosaik-expandable part="expandable"
                           ?hidden="${!e.hasSlotContent('')}"
                           @toggled="${() => e.onExpandableToggle()}">
            <slot></slot>
        </mosaik-expandable>

    `;
}
//# sourceMappingURL=MenuItemElementTemplate.js.map