// #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 { TextOverflow } from '../../../Types/TextOverflow';
import { queryShadow } from './../../../Directives/QueryShadow';
// #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}"
                              .dir="${e.dir}"
                              .lang="${e.lang}"
                              ?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}"
                             .dir="${e.dir}"
                             .lang="${e.lang}"
                             ?disabled="${e.disabled}"></mosaik-icon>
                `)}
            </slot>
            <mosaik-stack part="text"
                          .orientation="${Orientation.Vertical}"
                          .dir="${e.dir}"
                          .lang="${e.lang}">
                <slot name="label">
                ${when(e.label, () => html `
                    <mosaik-text .text="${e.label}"
                                 .dir="${e.dir}"
                                 .lang="${e.lang}"
                                 ?truncate="${e.textOverflow === TextOverflow.Truncate}"
                                 ?wrap="${e.textOverflow === TextOverflow.Wrap}"
                                 ?disabled="${e.disabled}"></mosaik-text>
                `)}
                </slot>
                <slot name="subLabel">
                ${when(e.subLabel, () => html `
                    <mosaik-text .text="${e.subLabel}"
                                 .dir="${e.dir}"
                                 .lang="${e.lang}"
                                 ?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}"
                           .dir="${e.dir}"
                           .lang="${e.lang}"
                           ?disabled="${e.disabled}"
                           @click="${(x) => { queryShadow(e, '[part="expandable"]', true).toggle(); x.preventDefault(); }}"></mosaik-button>
            `)}
            <slot name="end"></slot>
        </div>
        <mosaik-expandable part="expandable"
                           exportparts="content:content"
                           .dir="${e.dir}"
                           .lang="${e.lang}"
                           .isExpanded="${e.isExpanded}"
                           ?hidden="${!e.hasSlotContent('')}">
            <slot></slot>
        </mosaik-expandable>
    `;
}
//# sourceMappingURL=MenuItemElementTemplate.js.map