// #region Imports
import { html } from '../../../../Dom/Html';
import { Icons } from '../../../../Resources/Icons';
import { when } from '../../../Directives/Directives';
import { styleSheetVar } from '../../../Directives/StyleSheetVarDirective';
import { Appearance } from '../../../Types/Appearance';
import { IconPosition } from '../../../Types/IconPosition';
import { Placement } from '../../../Types/Placement';
import { Size } from '../../../Types/Size';
// #endregion
/**
 * The template of the {@link DropDownButtonElement}.
 *
 * @public
 */
export function dropDownButtonElementTemplate(e) {
    return html `
        ${when(!e.disabled, () => html `
        <mosaik-focus-ring part="focusRing"
                           .variant="${e.variant}"
                           .visible="${e.isFocused}"
                           .controlled="${'manual'}"
                           .for="${'button'}"></mosaik-focus-ring>
        `)}
        <button id="button"
                part="button"
                type="${e.type}">
            ${when(!e.disabled, () => html `
            <mosaik-ripple part="ripple"
                           .variant="${e.variant}"
                           .for="${'button'}"></mosaik-ripple>
            `)}
            <mosaik-stack .orientation="${e.orientation}"
                          .verticalAlignment="${e.verticalContentAlignment}"
                          .horizontalAlignment="${e.horizontalContentAlignment}"
                          .gap="${styleSheetVar('--dropdown-button-gap')}"
                          ?reverse="${e.iconPosition === IconPosition.After}">
                <slot name="icon">
                ${when(e.icon, () => html `
                    <mosaik-icon part="icon"
                                 .appearance="${Appearance.Plain}"
                                 .variant="${e.variant}"
                                 .data="${e.icon}"
                                 .size="${e.iconSize ?? e.size}"
                                 .inline="${true}"
                                 ?disabled="${e.disabled}"></mosaik-icon>
                `)}
                </slot>
                <slot name="label">
                ${when(e.label, () => html `
                    <mosaik-text part="label"
                                 .text="${e.label}"
                                 .variant="${e.variant}"
                                 ?disabled="${e.disabled}"></mosaik-text>
                `)}
                </slot>
            </mosaik-stack>
            ${when(e.caretVisible, () => html `
            <mosaik-icon part="iconCaret"
                         slot="suffix"
                         .appearance="${Appearance.Plain}"
                         .variant="${e.variant}"
                         .size="${Size.Small}"
                         .data="${Icons.caretDown}"
                         .inline="${true}"
                         ?disabled="${e.disabled}"></mosaik-icon>
            `)}
        </button>
        ${when(e.isBusy, () => html `
        <mosaik-progress-ring part="progressRing"
                              .thickness="${2}"
                              .radius="${12}"
                              .variant="${e.variant}"
                              .isIndeterminate="${true}"
                              ?disabled="${e.disabled}"></mosaik-progress-ring>
        `)}
        <slot name="overlay"></slot>
         <!-- @activeChanged="${(x) => e.onFloatingActiveChanged(x.detail)}" -->
        <mosaik-floating part="popup"
                         .anchor="${'button'}"
                         .placement="${e.dropDownPlacement}"
                         .distance="${e.dropDownDistance}"
                         .skidding="${e.dropDownSkidding}"
                         .strategy="${e.dropDownStrategy}"
                         .sync="${'none'}"
                         .maxHeight="${e.maxDropDownHeight}"
                         .flipFallbackPlacements="${[Placement.Top, Placement.Bottom, Placement.Left, Placement.Right]}"
                         ?flip="${true}"
                         .shift="${true}"
                         ?active="${e.isDropDownOpen}"
                        >
            <slot></slot>
        </mosaik-floating>
    `;
}
//# sourceMappingURL=DropDownButtonElementTemplate.js.map