/*! * (C) Ionic http://ionicframework.com - MIT License */ import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client'; import { r as raf, t as transitionEndAsync, a as addEventListener, b as removeEventListener, g as getElementRoot } from './helpers.js'; import { c as chevronDown } from './index7.js'; import { c as config } from './index4.js'; import { b as getIonMode } from './ionic-global.js'; import { d as defineCustomElement$2 } from './icon.js'; const accordionIosCss = ":host{display:block;position:relative;width:100%;background-color:var(--ion-background-color, #ffffff);overflow:hidden;z-index:0}:host(.accordion-expanding) ::slotted(ion-item[slot=header]),:host(.accordion-expanded) ::slotted(ion-item[slot=header]){--border-width:0px}:host(.accordion-animated){-webkit-transition:all 300ms cubic-bezier(0.25, 0.8, 0.5, 1);transition:all 300ms cubic-bezier(0.25, 0.8, 0.5, 1)}:host(.accordion-animated) #content{-webkit-transition:max-height 300ms cubic-bezier(0.25, 0.8, 0.5, 1);transition:max-height 300ms cubic-bezier(0.25, 0.8, 0.5, 1)}#content{overflow:hidden;will-change:max-height}:host(.accordion-collapsing) #content{max-height:0 !important}:host(.accordion-collapsed) #content{display:none}:host(.accordion-expanding) #content{max-height:0}:host(.accordion-expanding) #content-wrapper{overflow:auto}:host(.accordion-disabled) #header,:host(.accordion-readonly) #header,:host(.accordion-disabled) #content,:host(.accordion-readonly) #content{pointer-events:none}:host(.accordion-disabled) #header,:host(.accordion-disabled) #content{opacity:0.4}@media (prefers-reduced-motion: reduce){:host,#content{-webkit-transition:none !important;transition:none !important}}:host(.accordion-next) ::slotted(ion-item[slot=header]){--border-width:0.55px 0px 0.55px 0px}"; const IonAccordionIosStyle0 = accordionIosCss; const accordionMdCss = ":host{display:block;position:relative;width:100%;background-color:var(--ion-background-color, #ffffff);overflow:hidden;z-index:0}:host(.accordion-expanding) ::slotted(ion-item[slot=header]),:host(.accordion-expanded) ::slotted(ion-item[slot=header]){--border-width:0px}:host(.accordion-animated){-webkit-transition:all 300ms cubic-bezier(0.25, 0.8, 0.5, 1);transition:all 300ms cubic-bezier(0.25, 0.8, 0.5, 1)}:host(.accordion-animated) #content{-webkit-transition:max-height 300ms cubic-bezier(0.25, 0.8, 0.5, 1);transition:max-height 300ms cubic-bezier(0.25, 0.8, 0.5, 1)}#content{overflow:hidden;will-change:max-height}:host(.accordion-collapsing) #content{max-height:0 !important}:host(.accordion-collapsed) #content{display:none}:host(.accordion-expanding) #content{max-height:0}:host(.accordion-expanding) #content-wrapper{overflow:auto}:host(.accordion-disabled) #header,:host(.accordion-readonly) #header,:host(.accordion-disabled) #content,:host(.accordion-readonly) #content{pointer-events:none}:host(.accordion-disabled) #header,:host(.accordion-disabled) #content{opacity:0.4}@media (prefers-reduced-motion: reduce){:host,#content{-webkit-transition:none !important;transition:none !important}}"; const IonAccordionMdStyle0 = accordionMdCss; const Accordion = /*@__PURE__*/ proxyCustomElement(class Accordion extends HTMLElement { constructor() { super(); this.__registerHost(); this.__attachShadow(); this.updateListener = () => this.updateState(false); this.setItemDefaults = () => { const ionItem = this.getSlottedHeaderIonItem(); if (!ionItem) { return; } /** * For a11y purposes, we make * the ion-item a button so users * can tab to it and use keyboard * navigation to get around. */ ionItem.button = true; ionItem.detail = false; /** * By default, the lines in an * item should be full here, but * only do that if a user has * not explicitly overridden them */ if (ionItem.lines === undefined) { ionItem.lines = 'full'; } }; this.getSlottedHeaderIonItem = () => { const { headerEl } = this; if (!headerEl) { return; } /** * Get the first ion-item * slotted in the header slot */ const slot = headerEl.querySelector('slot'); if (!slot) { return; } // This is not defined in unit tests if (slot.assignedElements === undefined) return; return slot.assignedElements().find((el) => el.tagName === 'ION-ITEM'); }; this.setAria = (expanded = false) => { const ionItem = this.getSlottedHeaderIonItem(); if (!ionItem) { return; } /** * Get the native