@patternfly/pfe-accordion
Advanced tools
Comparing version 1.0.0-prerelease.31 to 1.0.0-prerelease.32
import PFElement from '../../pfelement/dist/pfelement.js'; | ||
/*! | ||
* PatternFly Elements: PfeAccordion 1.0.0-prerelease.31 | ||
* PatternFly Elements: PfeAccordion 1.0.0-prerelease.32 | ||
* @license | ||
@@ -81,3 +81,3 @@ * Copyright 2019 Red Hat, Inc. | ||
static get version() { | ||
return "1.0.0-prerelease.31"; | ||
return "1.0.0-prerelease.32"; | ||
} | ||
@@ -418,3 +418,3 @@ | ||
static get version() { | ||
return "1.0.0-prerelease.31"; | ||
return "1.0.0-prerelease.32"; | ||
} | ||
@@ -559,3 +559,3 @@ | ||
static get version() { | ||
return "1.0.0-prerelease.31"; | ||
return "1.0.0-prerelease.32"; | ||
} | ||
@@ -562,0 +562,0 @@ |
import e from"../../pfelement/dist/pfelement.min.js";function r(){return Math.random().toString(36).substr(2,9)} | ||
/*! | ||
* PatternFly Elements: PfeAccordion 1.0.0-prerelease.31 | ||
* PatternFly Elements: PfeAccordion 1.0.0-prerelease.32 | ||
* @license | ||
@@ -26,3 +26,3 @@ * Copyright 2019 Red Hat, Inc. | ||
*/ | ||
Array.prototype.findIndex||Object.defineProperty(Array.prototype,"findIndex",{value:function(e){if(null==this)throw new TypeError('"this" is null or not defined');var r=Object(this),t=r.length>>>0;if("function"!=typeof e)throw new TypeError("predicate must be a function");for(var o=arguments[1],a=0;a<t;){var n=r[a];if(e.call(o,n,a,r))return a;a++}return-1}});class t extends e{static get version(){return"1.0.0-prerelease.31"}get html(){return"<style>:host([on=dark]){--pfe-broadcasted--text:var(--pfe-theme--color--text--on-dark, #fff);--pfe-broadcasted--link:var(--pfe-theme--color--link--on-dark, #99ccff);--pfe-broadcasted--link--hover:var(--pfe-theme--color--link--hover--on-dark, #cce6ff);--pfe-broadcasted--link--focus:var(--pfe-theme--color--link--focus--on-dark, #cce6ff);--pfe-broadcasted--link--visited:var(--pfe-theme--color--link--visited--on-dark, #b38cd9);--pfe-broadcasted--link-decoration:none;--pfe-broadcasted--link-decoration--hover:underline;--pfe-broadcasted--link-decoration--focus:underline;--pfe-broadcasted--link-decoration--visited:none}@media screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none){:host{color:#333!important;color:var(--pfe-theme--color--text,#333)!important}}:host([on=saturated]){--pfe-broadcasted--text:var(--pfe-theme--color--text--on-saturated, #fff);--pfe-broadcasted--link:var(--pfe-theme--color--link--on-saturated, #fff);--pfe-broadcasted--link--hover:var(--pfe-theme--color--link--hover--on-saturated, white);--pfe-broadcasted--link--focus:var(--pfe-theme--color--link--focus--on-saturated, white);--pfe-broadcasted--link--visited:var(--pfe-theme--color--link--visited--on-saturated, #b38cd9);--pfe-broadcasted--link-decoration:underline;--pfe-broadcasted--link-decoration--hover:underline;--pfe-broadcasted--link-decoration--focus:underline;--pfe-broadcasted--link-decoration--visited:underline}@media screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none){:host{color:#333!important;color:var(--pfe-theme--color--text,#333)!important}}:host([on=light]){--pfe-broadcasted--text:var(--pfe-theme--color--text, #333);--pfe-broadcasted--link:var(--pfe-theme--color--link, #06c);--pfe-broadcasted--link--hover:var(--pfe-theme--color--link--hover, #003366);--pfe-broadcasted--link--focus:var(--pfe-theme--color--link--focus, #003366);--pfe-broadcasted--link--visited:var(--pfe-theme--color--link--visited, rebeccapurple);--pfe-broadcasted--link-decoration:none;--pfe-broadcasted--link-decoration--hover:underline;--pfe-broadcasted--link-decoration--focus:underline;--pfe-broadcasted--link-decoration--visited:none}@media screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none){:host{color:#333!important;color:var(--pfe-theme--color--text,#333)!important}}:host{--pfe-accordion--BorderColor--accent:transparent;--pfe-accordion--BorderColor:var(--pfe-theme--color--surface--border, #d2d2d2);--pfe-accordion--BorderTopWidth:var(--pfe-theme--surface--border-width, 1px);--pfe-accordion--BorderRightWidth:0;--pfe-accordion--BorderBottomWidth:var(--pfe-theme--surface--border-width, 1px);--pfe-accordion--Color:var(--pfe-broadcasted--text, #333);--pfe-accordion--TextAlign:left;--pfe-accordion--accent:var(--pfe-theme--color--ui-base, #0477a4);display:block;position:relative;overflow:hidden;margin:0;color:var(--pfe-accordion--Color)}@media screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none){:host{background-color:#fff!important;background-color:var(--pfe-theme--color--surface--lightest,#fff)!important;color:#333!important;color:var(--pfe-theme--color--text,#333)!important}}:host([on=dark]){--pfe-accordion--BorderColor--accent:transparent;--pfe-accordion--BorderColor:var(--pfe-theme--color--surface--border, #d2d2d2);--pfe-accordion--BorderTopWidth:var(--pfe-theme--surface--border-width, 1px);--pfe-accordion--BorderRightWidth:0;--pfe-accordion--BorderBottomWidth:var(--pfe-theme--surface--border-width, 1px);--pfe-accordion--Color:var(--pfe-broadcasted--text, #333);--pfe-accordion--TextAlign:left;--pfe-accordion--accent:var(--pfe-theme--color--ui-base--on-dark, #78d7fc)}:host([on=saturated]){--pfe-accordion--BorderColor--accent:transparent;--pfe-accordion--BorderColor:var(--pfe-theme--color--surface--border, #d2d2d2);--pfe-accordion--BorderTopWidth:var(--pfe-theme--surface--border-width, 1px);--pfe-accordion--BorderRightWidth:0;--pfe-accordion--BorderBottomWidth:var(--pfe-theme--surface--border-width, 1px);--pfe-accordion--Color:var(--pfe-broadcasted--text, #333);--pfe-accordion--TextAlign:left;--pfe-accordion--accent:var(--pfe-theme--color--ui-base--on-saturated, #fff)}:host([on=light]){--pfe-accordion--BorderColor--accent:transparent;--pfe-accordion--BorderColor:var(--pfe-theme--color--surface--border, #d2d2d2);--pfe-accordion--BorderTopWidth:var(--pfe-theme--surface--border-width, 1px);--pfe-accordion--BorderRightWidth:0;--pfe-accordion--BorderBottomWidth:var(--pfe-theme--surface--border-width, 1px);--pfe-accordion--Color:var(--pfe-broadcasted--text, #333);--pfe-accordion--TextAlign:left;--pfe-accordion--accent:var(--pfe-theme--color--ui-base, #0477a4)}\n/*# sourceMappingURL=pfe-accordion.min.css.map */\n</style><slot></slot>"}static get properties(){return{}}static get slots(){return{default:{title:"Default",type:"array",namedSlot:!1,items:{oneOf:[{$ref:"pfe-accordion-header"},{$ref:"pfe-accordion-panel"}]}}}}static get tag(){return"pfe-accordion"}get styleUrl(){return"pfe-accordion.scss"}get templateUrl(){return"pfe-accordion.html"}get schemaUrl(){return"pfe-accordion.json"}static get cascadingAttributes(){return{on:"pfe-accordion-header, pfe-accordion-panel"}}static get PfeType(){return e.PfeTypes.Container}constructor(){super(t,{type:t.PfeType}),this._linkPanels=this._linkPanels.bind(this),this._observer=new MutationObserver(this._linkPanels)}connectedCallback(){super.connectedCallback(),this.setAttribute("role","presentation"),this.setAttribute("defined",""),this.addEventListener(`${t.tag}:change`,this._changeHandler),this.addEventListener("keydown",this._keydownHandler),Promise.all([customElements.whenDefined(o.tag),customElements.whenDefined(a.tag)]).then(()=>{this.children.length&&this._linkPanels(),this._observer.observe(this,{childList:!0})})}disconnectedCallback(){this.removeEventListener(`${t.tag}:change`,this._changeHandler),this.removeEventListener("keydown",this._keydownHandler),this._observer.disconnect()}attributeChangedCallback(e,r,t){super.attributeChangedCallback(e,r,t)}toggle(e){const r=this._allHeaders(),t=this._allPanels(),o=r[e],a=t[e];o&&a&&(o.expanded?(this._collapseHeader(o),this._collapsePanel(a)):(this._expandHeader(o),this._expandPanel(a)))}expand(e){const r=this._allHeaders(),t=this._allPanels(),o=r[e],a=t[e];o&&a&&(this._expandHeader(o),this._expandPanel(a))}expandAll(){const e=this._allHeaders(),r=this._allPanels();e.forEach(e=>this._expandHeader(e)),r.forEach(e=>this._expandPanel(e))}collapse(e){const r=this._allHeaders(),t=this._allPanels(),o=r[e],a=t[e];o&&a&&(this._collapseHeader(o),this._collapsePanel(a))}collapseAll(){const e=this._allHeaders(),r=this._allPanels();e.forEach(e=>this._collapseHeader(e)),r.forEach(e=>this._collapsePanel(e))}_linkPanels(){this._allHeaders().forEach(e=>{const r=this._panelForHeader(e);r&&(e.setAttribute("aria-controls",r.pfeId),r.setAttribute("aria-labelledby",e.pfeId))})}_changeHandler(e){if(this.classList.contains("animating"))return;const r=e.target,t=e.target.nextElementSibling;e.detail.expanded?(this._expandHeader(r),this._expandPanel(t)):(this._collapseHeader(r),this._collapsePanel(t))}_toggle(e,r){}_expandHeader(e){e.expanded=!0}_expandPanel(e){if(!e)return void console.error(`${t.tag}: Trying to expand a panel that doesn't exist`);if(e.expanded)return;e.expanded=!0;const r=e.getBoundingClientRect().height;this._animate(e,0,r)}_collapseHeader(e){e.expanded=!1}_collapsePanel(e){if(!e)return void console.error(`${t.tag}: Trying to collapse a panel that doesn't exist`);if(!e.expanded)return;const r=e.getBoundingClientRect().height;e.expanded=!1,this._animate(e,r,0)}_animate(e,r,t){if(e){const o=e.previousElementSibling;o&&o.classList.add("animating"),e.classList.add("animating"),e.style.height=`${r}px`,requestAnimationFrame(()=>{requestAnimationFrame(()=>{e.style.height=`${t}px`,e.addEventListener("transitionend",this._transitionEndHandler)})})}}_keydownHandler(e){const r=e.target;if(!this._isHeader(r))return;let t;switch(e.key){case"ArrowDown":case"Down":case"ArrowRight":case"Right":t=this._nextHeader();break;case"ArrowUp":case"Up":case"ArrowLeft":case"Left":t=this._previousHeader();break;case"Home":t=this._firstHeader();break;case"End":t=this._lastHeader();break;default:return}t.shadowRoot.querySelector("button").focus()}_transitionEndHandler(e){const r=e.target.previousElementSibling;r&&r.classList.remove("animating"),e.target.style.height="",e.target.classList.remove("animating"),e.target.removeEventListener("transitionend",this._transitionEndHandler)}_allHeaders(){return[...this.querySelectorAll(o.tag)]}_allPanels(){return[...this.querySelectorAll(a.tag)]}_panelForHeader(e){const r=e.nextElementSibling;if(r){if(r.tagName.toLowerCase()===a.tag)return r;console.error(`${t.tag}: Sibling element to a header needs to be a panel`)}}_previousHeader(){const e=this._allHeaders();let r=e.findIndex(e=>e===document.activeElement)-1;return e[(r+e.length)%e.length]}_nextHeader(){const e=this._allHeaders();let r=e.findIndex(e=>e===document.activeElement)+1;return e[r%e.length]}_firstHeader(){return this._allHeaders()[0]}_lastHeader(){const e=this._allHeaders();return e[e.length-1]}_isHeader(e){return e.tagName.toLowerCase()===o.tag}}class o extends e{static get version(){return"1.0.0-prerelease.31"}get html(){return'<style>:host{-webkit-transition:-webkit-transform .3s cubic-bezier(.465,.183,.153,.946);transition:-webkit-transform .3s cubic-bezier(.465,.183,.153,.946);transition:transform .3s cubic-bezier(.465,.183,.153,.946);transition:transform .3s cubic-bezier(.465,.183,.153,.946),-webkit-transform .3s cubic-bezier(.465,.183,.153,.946);-webkit-transition:-webkit-transform .3s var(--pfe-theme--animation-timing,cubic-bezier(.465,.183,.153,.946));transition:-webkit-transform .3s var(--pfe-theme--animation-timing,cubic-bezier(.465,.183,.153,.946));transition:transform .3s var(--pfe-theme--animation-timing,cubic-bezier(.465,.183,.153,.946));transition:transform .3s var(--pfe-theme--animation-timing,cubic-bezier(.465,.183,.153,.946)),-webkit-transform .3s var(--pfe-theme--animation-timing,cubic-bezier(.465,.183,.153,.946));display:block}:host>*{margin:0}button{--pfe-accordion--BorderBottomWidth:0;margin:0;width:100%;width:var(--pfe-accordion--Width,100%);max-width:100%;height:auto;position:relative;background-color:transparent;background-color:var(--pfe-accordion--BackgroundColor,transparent);color:var(--pfe-accordion--Color);border-top:1px solid #d2d2d2;border-top:var(--pfe-accordion--BorderTopWidth,var(--pfe-theme--surface--border-width,1px)) var(--pfe-theme--surface--border-style,solid) var(--pfe-accordion--BorderColor,var(--pfe-theme--color--surface--border,#d2d2d2));border-right:1px solid transparent;border-right:var(--pfe-accordion--BorderRightWidth,var(--pfe-theme--surface--border-width,1px)) var(--pfe-theme--surface--border-style,solid) var(--pfe-accordion--BorderColor,transparent);border-bottom:1px solid #d2d2d2;border-bottom:var(--pfe-accordion--BorderBottomWidth,var(--pfe-theme--surface--border-width,1px)) var(--pfe-theme--surface--border-style,solid) var(--pfe-accordion--BorderColor,var(--pfe-theme--color--surface--border,#d2d2d2));border-left:4px solid transparent;border-left:var(--pfe-accordion--BorderLeftWidth,var(--pfe-theme--surface--border-width--heavy,4px)) var(--pfe-theme--surface--border-style,solid) var(--pfe-accordion--BorderColor--accent,transparent);-webkit-box-shadow:var(--pfe-accordion--BoxShadow);box-shadow:var(--pfe-accordion--BoxShadow);cursor:pointer;z-index:1;font-family:inherit;font-size:calc(16px * 1.1);font-size:var(--pfe-accordion--FontSize--header,calc(var(--pfe-theme--font-size,16px) * 1.1));font-weight:700;font-weight:var(--pfe-theme--font-weight--bold,700);text-align:left;text-align:var(--pfe-accordion--TextAlign,left);line-height:1.5;line-height:var(--pfe-theme--line-height,1.5);padding:16px 50px 16px calc(16px * 1.5)!important;padding:var(--pfe-theme--container-spacer,16px) 50px var(--pfe-theme--container-spacer,16px) calc(var(--pfe-theme--container-spacer,16px) * 1.5)!important}button:hover{--pfe-accordion--BorderColor--accent:var(--pfe-accordion--accent)}button:hover{outline:0;z-index:2}button:focus{outline:0;z-index:2;text-decoration:underline}button::-moz-focus-inner{border:0}button[aria-expanded=true]::after{content:"";position:absolute;top:calc((16px * .5) + .4em);top:calc((var(--pfe-theme--container-spacer,16px) * .5) + .4em);display:block;border-style:solid;border-style:var(--pfe-theme--surface--border-style,solid);height:.4em;width:.4em;-webkit-transition:-webkit-transform .15s;transition:-webkit-transform .15s;transition:transform .15s;transition:transform .15s,-webkit-transform .15s;border-width:.1em .1em 0 0;border-bottom:0;-webkit-transform:rotate(-45deg);transform:rotate(-45deg);right:calc(16px * 1.5);right:calc(var(--pfe-theme--container-spacer,16px) * 1.5)}button[aria-expanded=false]::after{content:"";position:absolute;top:calc((16px * .5) + .4em);top:calc((var(--pfe-theme--container-spacer,16px) * .5) + .4em);display:block;border-style:solid;border-style:var(--pfe-theme--surface--border-style,solid);height:.4em;width:.4em;-webkit-transition:-webkit-transform .15s;transition:-webkit-transform .15s;transition:transform .15s;transition:transform .15s,-webkit-transform .15s;border-width:0 .1em .1em 0;-webkit-transform:rotate(45deg);transform:rotate(45deg);right:calc(16px * 1.5);right:calc(var(--pfe-theme--container-spacer,16px) * 1.5)}@supports (-ms-ime-align:auto){button{text-align:left}}@media screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none){button:hover{border-left-color:#0477a4;border-left-color:var(--pfe-theme--color--ui-base,#0477a4)}}:host(:last-of-type) button:not([aria-expanded=true]){--pfe-accordion--BorderBottomWidth:var(--pfe-theme--surface--border-width, 1px)}button[aria-expanded=true]{--pfe-accordion--BorderColor:var(--pfe-theme--color--surface--border, #d2d2d2);--pfe-accordion--BorderRightWidth:var(--pfe-theme--surface--border-width, 1px);--pfe-accordion--BackgroundColor:white;--pfe-accordion--Color:var(--pfe-theme--color--text, #333);--pfe-accordion--BorderColor--accent:var(--pfe-theme--color--ui-base, #0477a4)}@media screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none){button[aria-expanded=true]{border-bottom-width:0;border-left-color:#0477a4;border-left-color:var(--pfe-theme--color--ui-base,#0477a4)}}:host([on=dark]) button[aria-expanded=true]{--pfe-accordion--BorderColor:var(--pfe-theme--color--surface--border, #d2d2d2);--pfe-accordion--BorderRightWidth:var(--pfe-theme--surface--border-width, 1px);--pfe-accordion--BackgroundColor:rgba(247, 247, 249, 0.1);--pfe-accordion--Color:var(--pfe-broadcasted--text, #333);--pfe-accordion--BorderColor--accent:var(--pfe-theme--color--ui-base--on-dark, #78d7fc)}:host([on=saturated]) button[aria-expanded=true]{--pfe-accordion--BorderColor:var(--pfe-theme--color--surface--border, #d2d2d2);--pfe-accordion--BorderRightWidth:var(--pfe-theme--surface--border-width, 1px);--pfe-accordion--BackgroundColor:rgba(0, 0, 0, 0.2);--pfe-accordion--Color:var(--pfe-broadcasted--text, #333);--pfe-accordion--BorderColor--accent:var(--pfe-theme--color--ui-base--on-saturated, #fff)}:host([on=light]) button[aria-expanded=true]{--pfe-broadcasted--text:var(--pfe-theme--color--text, #333);--pfe-broadcasted--link:var(--pfe-theme--color--link, #06c);--pfe-broadcasted--link--hover:var(--pfe-theme--color--link--hover, #003366);--pfe-broadcasted--link--focus:var(--pfe-theme--color--link--focus, #003366);--pfe-broadcasted--link--visited:var(--pfe-theme--color--link--visited, rebeccapurple);--pfe-broadcasted--link-decoration:none;--pfe-broadcasted--link-decoration--hover:underline;--pfe-broadcasted--link-decoration--focus:underline;--pfe-broadcasted--link-decoration--visited:none;--theme:light}\n/*# sourceMappingURL=pfe-accordion-header.min.css.map */\n</style><button type="button" aria-expanded="false" role="tab"></button>'}static get tag(){return"pfe-accordion-header"}get styleUrl(){return"pfe-accordion-header.scss"}get templateUrl(){return"pfe-accordion-header.html"}get pfeId(){return this.getAttribute("pfe-id")}set pfeId(e){e&&this.setAttribute("pfe-id",e)}static get observedAttributes(){return["aria-expanded"]}constructor(){super(o),this.button=this.shadowRoot.querySelector("button"),this._init=this._init.bind(this),this._clickHandler=this._clickHandler.bind(this),this._observer=new MutationObserver(this._init)}connectedCallback(){super.connectedCallback(),(this.children.length||this.textContent.trim().length)&&this._init(),this.addEventListener("click",this._clickHandler),this._observer.observe(this,{childList:!0})}disconnectedCallback(){this.removeEventListener("click",this._clickHandler),this._observer.disconnect()}get expanded(){return this.hasAttribute("aria-expanded")}set expanded(e){(e=Boolean(e))?(this.setAttribute("aria-expanded",!0),this.button.setAttribute("aria-expanded",!0)):(this.removeAttribute("aria-expanded"),this.button.setAttribute("aria-expanded",!1))}_init(){window.ShadyCSS&&this._observer.disconnect(),this.hasAttribute("role")||this.setAttribute("role","header"),this.pfeId||(this.pfeId=`${o.tag}-${r()}`);const e=this.children[0];let t=!1;if(e){switch(e.tagName){case"H1":case"H2":case"H3":case"H4":case"H5":case"H6":t=!0}const r=document.createElement(e.tagName);this.button.innerText=e.innerText,r.appendChild(this.button),this.shadowRoot.appendChild(r)}else this.button.innerText=this.textContent.trim();t||console.warn(`${o.tag}: The first child in the light DOM must be a Header level tag (h1, h2, h3, h4, h5, or h6)`),window.ShadyCSS&&this._observer.observe(this,{childList:!0})}_clickHandler(e){this.dispatchEvent(new CustomEvent(`${t.tag}:change`,{detail:{expanded:!this.expanded},bubbles:!0}))}}class a extends e{static get version(){return"1.0.0-prerelease.31"}get html(){return'<style>.container{position:relative;display:block;width:100%;padding:16px;padding:var(--pfe-theme--container-spacer,16px)}:host{display:none;overflow:hidden;will-change:height;border-color:transparent;opacity:0;margin:0;width:100%;width:var(--pfe-accordion--Width,100%);max-width:100%;height:auto;position:relative;background-color:transparent;background-color:var(--pfe-accordion--BackgroundColor,transparent);color:var(--pfe-accordion--Color);border-top:1px solid #d2d2d2;border-top:var(--pfe-accordion--BorderTopWidth,var(--pfe-theme--surface--border-width,1px)) var(--pfe-theme--surface--border-style,solid) var(--pfe-accordion--BorderColor,var(--pfe-theme--color--surface--border,#d2d2d2));border-right:1px solid transparent;border-right:var(--pfe-accordion--BorderRightWidth,var(--pfe-theme--surface--border-width,1px)) var(--pfe-theme--surface--border-style,solid) var(--pfe-accordion--BorderColor,transparent);border-bottom:1px solid #d2d2d2;border-bottom:var(--pfe-accordion--BorderBottomWidth,var(--pfe-theme--surface--border-width,1px)) var(--pfe-theme--surface--border-style,solid) var(--pfe-accordion--BorderColor,var(--pfe-theme--color--surface--border,#d2d2d2));border-left:4px solid transparent;border-left:var(--pfe-accordion--BorderLeftWidth,var(--pfe-theme--surface--border-width--heavy,4px)) var(--pfe-theme--surface--border-style,solid) var(--pfe-accordion--BorderColor--accent,transparent);-webkit-box-shadow:var(--pfe-accordion--BoxShadow);box-shadow:var(--pfe-accordion--BoxShadow)}:host:hover{--pfe-accordion--BorderColor--accent:var(--pfe-accordion--accent)}:host *,:host ::after,:host ::before{-webkit-box-sizing:border-box;box-sizing:border-box}:host(.animating){display:block;-webkit-transition:height .3s ease-in-out;transition:height .3s ease-in-out}.container{--pfe-accordion--BoxShadow:none;padding-top:0;padding-right:3em;padding-left:calc(16px * 1.5);padding-left:calc(var(--pfe-theme--container-spacer,16px) * 1.5)}:host(:last-of-type[expanded]){margin-bottom:0}:host(.animating),:host([expanded]){--pfe-accordion--BorderColor:var(--pfe-theme--color--surface--border, #d2d2d2);--pfe-accordion--BorderRightWidth:var(--pfe-theme--surface--border-width, 1px);--pfe-accordion--BackgroundColor:white;--pfe-accordion--Color:var(--pfe-theme--color--text, #333);--pfe-accordion--BorderColor--accent:var(--pfe-theme--color--ui-base, #0477a4);--pfe-accordion--BorderTopWidth:0;--pfe-accordion--BoxShadow:0 5px var(--pfe-theme--surface--border-width--heavy, 4px) rgba(140, 140, 140, 0.35);display:block;position:relative;opacity:1}@media screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none){:host(.animating),:host([expanded]){border-top-width:0;border-left-color:#0477a4;border-left-color:var(--pfe-theme--color--ui-base,#0477a4)}}:host([on=dark].animating),:host([on=dark][expanded]){--pfe-accordion--BorderColor:var(--pfe-theme--color--surface--border, #d2d2d2);--pfe-accordion--BorderRightWidth:var(--pfe-theme--surface--border-width, 1px);--pfe-accordion--BackgroundColor:rgba(247, 247, 249, 0.1);--pfe-accordion--Color:var(--pfe-broadcasted--text, #333);--pfe-accordion--BorderColor--accent:var(--pfe-theme--color--ui-base--on-dark, #78d7fc);--pfe-accordion--BorderTopWidth:0;--pfe-accordion--BoxShadow:none}:host([on=saturated].animating),:host([on=saturated][expanded]){--pfe-accordion--BorderColor:var(--pfe-theme--color--surface--border, #d2d2d2);--pfe-accordion--BorderRightWidth:var(--pfe-theme--surface--border-width, 1px);--pfe-accordion--BackgroundColor:rgba(0, 0, 0, 0.2);--pfe-accordion--Color:var(--pfe-broadcasted--text, #333);--pfe-accordion--BorderColor--accent:var(--pfe-theme--color--ui-base--on-saturated, #fff);--pfe-accordion--BorderTopWidth:0;--pfe-accordion--BoxShadow:none}:host([on=light].animating),:host([on=light][expanded]){--pfe-broadcasted--text:var(--pfe-theme--color--text, #333);--pfe-broadcasted--link:var(--pfe-theme--color--link, #06c);--pfe-broadcasted--link--hover:var(--pfe-theme--color--link--hover, #003366);--pfe-broadcasted--link--focus:var(--pfe-theme--color--link--focus, #003366);--pfe-broadcasted--link--visited:var(--pfe-theme--color--link--visited, rebeccapurple);--pfe-broadcasted--link-decoration:none;--pfe-broadcasted--link-decoration--hover:underline;--pfe-broadcasted--link-decoration--focus:underline;--pfe-broadcasted--link-decoration--visited:none;--theme:light;--pfe-accordion--BorderTopWidth:0;--pfe-accordion--BoxShadow:0 5px var(--pfe-theme--surface--border-width--heavy, 4px) rgba(140, 140, 140, 0.35)}\n/*# sourceMappingURL=pfe-accordion-panel.min.css.map */\n</style><div tabindex="-1" role="tabpanel">\n <div class="container">\n <slot></slot>\n </div>\n</div>'}static get tag(){return"pfe-accordion-panel"}get styleUrl(){return"pfe-accordion-panel.scss"}get templateUrl(){return"pfe-accordion-panel.html"}get pfeId(){return this.getAttribute("pfe-id")}set pfeId(e){e&&this.setAttribute("pfe-id",e)}constructor(){super(a)}connectedCallback(){super.connectedCallback(),this.hasAttribute("role")||this.setAttribute("role","region"),this.pfeId||(this.pfeId=`${a.tag}-${r()}`)}get expanded(){return this.hasAttribute("expanded")}set expanded(e){Boolean(e)?this.setAttribute("expanded",""):this.removeAttribute("expanded")}}e.create(o),e.create(a),e.create(t);export default t; | ||
Array.prototype.findIndex||Object.defineProperty(Array.prototype,"findIndex",{value:function(e){if(null==this)throw new TypeError('"this" is null or not defined');var r=Object(this),t=r.length>>>0;if("function"!=typeof e)throw new TypeError("predicate must be a function");for(var o=arguments[1],a=0;a<t;){var n=r[a];if(e.call(o,n,a,r))return a;a++}return-1}});class t extends e{static get version(){return"1.0.0-prerelease.32"}get html(){return"<style>:host([on=dark]){--pfe-broadcasted--text:var(--pfe-theme--color--text--on-dark, #fff);--pfe-broadcasted--link:var(--pfe-theme--color--link--on-dark, #99ccff);--pfe-broadcasted--link--hover:var(--pfe-theme--color--link--hover--on-dark, #cce6ff);--pfe-broadcasted--link--focus:var(--pfe-theme--color--link--focus--on-dark, #cce6ff);--pfe-broadcasted--link--visited:var(--pfe-theme--color--link--visited--on-dark, #b38cd9);--pfe-broadcasted--link-decoration:none;--pfe-broadcasted--link-decoration--hover:underline;--pfe-broadcasted--link-decoration--focus:underline;--pfe-broadcasted--link-decoration--visited:none}@media screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none){:host{color:#333!important;color:var(--pfe-theme--color--text,#333)!important}}:host([on=saturated]){--pfe-broadcasted--text:var(--pfe-theme--color--text--on-saturated, #fff);--pfe-broadcasted--link:var(--pfe-theme--color--link--on-saturated, #fff);--pfe-broadcasted--link--hover:var(--pfe-theme--color--link--hover--on-saturated, white);--pfe-broadcasted--link--focus:var(--pfe-theme--color--link--focus--on-saturated, white);--pfe-broadcasted--link--visited:var(--pfe-theme--color--link--visited--on-saturated, #b38cd9);--pfe-broadcasted--link-decoration:underline;--pfe-broadcasted--link-decoration--hover:underline;--pfe-broadcasted--link-decoration--focus:underline;--pfe-broadcasted--link-decoration--visited:underline}@media screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none){:host{color:#333!important;color:var(--pfe-theme--color--text,#333)!important}}:host([on=light]){--pfe-broadcasted--text:var(--pfe-theme--color--text, #333);--pfe-broadcasted--link:var(--pfe-theme--color--link, #06c);--pfe-broadcasted--link--hover:var(--pfe-theme--color--link--hover, #003366);--pfe-broadcasted--link--focus:var(--pfe-theme--color--link--focus, #003366);--pfe-broadcasted--link--visited:var(--pfe-theme--color--link--visited, rebeccapurple);--pfe-broadcasted--link-decoration:none;--pfe-broadcasted--link-decoration--hover:underline;--pfe-broadcasted--link-decoration--focus:underline;--pfe-broadcasted--link-decoration--visited:none}@media screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none){:host{color:#333!important;color:var(--pfe-theme--color--text,#333)!important}}:host{--pfe-accordion--BorderColor--accent:transparent;--pfe-accordion--BorderColor:var(--pfe-theme--color--surface--border, #d2d2d2);--pfe-accordion--BorderTopWidth:var(--pfe-theme--surface--border-width, 1px);--pfe-accordion--BorderRightWidth:0;--pfe-accordion--BorderBottomWidth:var(--pfe-theme--surface--border-width, 1px);--pfe-accordion--Color:var(--pfe-broadcasted--text, #333);--pfe-accordion--TextAlign:left;--pfe-accordion--accent:var(--pfe-theme--color--ui-base, #0477a4);display:block;position:relative;overflow:hidden;margin:0;color:var(--pfe-accordion--Color)}@media screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none){:host{background-color:#fff!important;background-color:var(--pfe-theme--color--surface--lightest,#fff)!important;color:#333!important;color:var(--pfe-theme--color--text,#333)!important}}:host([on=dark]){--pfe-accordion--BorderColor--accent:transparent;--pfe-accordion--BorderColor:var(--pfe-theme--color--surface--border, #d2d2d2);--pfe-accordion--BorderTopWidth:var(--pfe-theme--surface--border-width, 1px);--pfe-accordion--BorderRightWidth:0;--pfe-accordion--BorderBottomWidth:var(--pfe-theme--surface--border-width, 1px);--pfe-accordion--Color:var(--pfe-broadcasted--text, #333);--pfe-accordion--TextAlign:left;--pfe-accordion--accent:var(--pfe-theme--color--ui-base--on-dark, #78d7fc)}:host([on=saturated]){--pfe-accordion--BorderColor--accent:transparent;--pfe-accordion--BorderColor:var(--pfe-theme--color--surface--border, #d2d2d2);--pfe-accordion--BorderTopWidth:var(--pfe-theme--surface--border-width, 1px);--pfe-accordion--BorderRightWidth:0;--pfe-accordion--BorderBottomWidth:var(--pfe-theme--surface--border-width, 1px);--pfe-accordion--Color:var(--pfe-broadcasted--text, #333);--pfe-accordion--TextAlign:left;--pfe-accordion--accent:var(--pfe-theme--color--ui-base--on-saturated, #fff)}:host([on=light]){--pfe-accordion--BorderColor--accent:transparent;--pfe-accordion--BorderColor:var(--pfe-theme--color--surface--border, #d2d2d2);--pfe-accordion--BorderTopWidth:var(--pfe-theme--surface--border-width, 1px);--pfe-accordion--BorderRightWidth:0;--pfe-accordion--BorderBottomWidth:var(--pfe-theme--surface--border-width, 1px);--pfe-accordion--Color:var(--pfe-broadcasted--text, #333);--pfe-accordion--TextAlign:left;--pfe-accordion--accent:var(--pfe-theme--color--ui-base, #0477a4)}\n/*# sourceMappingURL=pfe-accordion.min.css.map */\n</style><slot></slot>"}static get properties(){return{}}static get slots(){return{default:{title:"Default",type:"array",namedSlot:!1,items:{oneOf:[{$ref:"pfe-accordion-header"},{$ref:"pfe-accordion-panel"}]}}}}static get tag(){return"pfe-accordion"}get styleUrl(){return"pfe-accordion.scss"}get templateUrl(){return"pfe-accordion.html"}get schemaUrl(){return"pfe-accordion.json"}static get cascadingAttributes(){return{on:"pfe-accordion-header, pfe-accordion-panel"}}static get PfeType(){return e.PfeTypes.Container}constructor(){super(t,{type:t.PfeType}),this._linkPanels=this._linkPanels.bind(this),this._observer=new MutationObserver(this._linkPanels)}connectedCallback(){super.connectedCallback(),this.setAttribute("role","presentation"),this.setAttribute("defined",""),this.addEventListener(`${t.tag}:change`,this._changeHandler),this.addEventListener("keydown",this._keydownHandler),Promise.all([customElements.whenDefined(o.tag),customElements.whenDefined(a.tag)]).then(()=>{this.children.length&&this._linkPanels(),this._observer.observe(this,{childList:!0})})}disconnectedCallback(){this.removeEventListener(`${t.tag}:change`,this._changeHandler),this.removeEventListener("keydown",this._keydownHandler),this._observer.disconnect()}attributeChangedCallback(e,r,t){super.attributeChangedCallback(e,r,t)}toggle(e){const r=this._allHeaders(),t=this._allPanels(),o=r[e],a=t[e];o&&a&&(o.expanded?(this._collapseHeader(o),this._collapsePanel(a)):(this._expandHeader(o),this._expandPanel(a)))}expand(e){const r=this._allHeaders(),t=this._allPanels(),o=r[e],a=t[e];o&&a&&(this._expandHeader(o),this._expandPanel(a))}expandAll(){const e=this._allHeaders(),r=this._allPanels();e.forEach(e=>this._expandHeader(e)),r.forEach(e=>this._expandPanel(e))}collapse(e){const r=this._allHeaders(),t=this._allPanels(),o=r[e],a=t[e];o&&a&&(this._collapseHeader(o),this._collapsePanel(a))}collapseAll(){const e=this._allHeaders(),r=this._allPanels();e.forEach(e=>this._collapseHeader(e)),r.forEach(e=>this._collapsePanel(e))}_linkPanels(){this._allHeaders().forEach(e=>{const r=this._panelForHeader(e);r&&(e.setAttribute("aria-controls",r.pfeId),r.setAttribute("aria-labelledby",e.pfeId))})}_changeHandler(e){if(this.classList.contains("animating"))return;const r=e.target,t=e.target.nextElementSibling;e.detail.expanded?(this._expandHeader(r),this._expandPanel(t)):(this._collapseHeader(r),this._collapsePanel(t))}_toggle(e,r){}_expandHeader(e){e.expanded=!0}_expandPanel(e){if(!e)return void console.error(`${t.tag}: Trying to expand a panel that doesn't exist`);if(e.expanded)return;e.expanded=!0;const r=e.getBoundingClientRect().height;this._animate(e,0,r)}_collapseHeader(e){e.expanded=!1}_collapsePanel(e){if(!e)return void console.error(`${t.tag}: Trying to collapse a panel that doesn't exist`);if(!e.expanded)return;const r=e.getBoundingClientRect().height;e.expanded=!1,this._animate(e,r,0)}_animate(e,r,t){if(e){const o=e.previousElementSibling;o&&o.classList.add("animating"),e.classList.add("animating"),e.style.height=`${r}px`,requestAnimationFrame(()=>{requestAnimationFrame(()=>{e.style.height=`${t}px`,e.addEventListener("transitionend",this._transitionEndHandler)})})}}_keydownHandler(e){const r=e.target;if(!this._isHeader(r))return;let t;switch(e.key){case"ArrowDown":case"Down":case"ArrowRight":case"Right":t=this._nextHeader();break;case"ArrowUp":case"Up":case"ArrowLeft":case"Left":t=this._previousHeader();break;case"Home":t=this._firstHeader();break;case"End":t=this._lastHeader();break;default:return}t.shadowRoot.querySelector("button").focus()}_transitionEndHandler(e){const r=e.target.previousElementSibling;r&&r.classList.remove("animating"),e.target.style.height="",e.target.classList.remove("animating"),e.target.removeEventListener("transitionend",this._transitionEndHandler)}_allHeaders(){return[...this.querySelectorAll(o.tag)]}_allPanels(){return[...this.querySelectorAll(a.tag)]}_panelForHeader(e){const r=e.nextElementSibling;if(r){if(r.tagName.toLowerCase()===a.tag)return r;console.error(`${t.tag}: Sibling element to a header needs to be a panel`)}}_previousHeader(){const e=this._allHeaders();let r=e.findIndex(e=>e===document.activeElement)-1;return e[(r+e.length)%e.length]}_nextHeader(){const e=this._allHeaders();let r=e.findIndex(e=>e===document.activeElement)+1;return e[r%e.length]}_firstHeader(){return this._allHeaders()[0]}_lastHeader(){const e=this._allHeaders();return e[e.length-1]}_isHeader(e){return e.tagName.toLowerCase()===o.tag}}class o extends e{static get version(){return"1.0.0-prerelease.32"}get html(){return'<style>:host{-webkit-transition:-webkit-transform .3s cubic-bezier(.465,.183,.153,.946);transition:-webkit-transform .3s cubic-bezier(.465,.183,.153,.946);transition:transform .3s cubic-bezier(.465,.183,.153,.946);transition:transform .3s cubic-bezier(.465,.183,.153,.946),-webkit-transform .3s cubic-bezier(.465,.183,.153,.946);-webkit-transition:-webkit-transform .3s var(--pfe-theme--animation-timing,cubic-bezier(.465,.183,.153,.946));transition:-webkit-transform .3s var(--pfe-theme--animation-timing,cubic-bezier(.465,.183,.153,.946));transition:transform .3s var(--pfe-theme--animation-timing,cubic-bezier(.465,.183,.153,.946));transition:transform .3s var(--pfe-theme--animation-timing,cubic-bezier(.465,.183,.153,.946)),-webkit-transform .3s var(--pfe-theme--animation-timing,cubic-bezier(.465,.183,.153,.946));display:block}:host>*{margin:0}button{--pfe-accordion--BorderBottomWidth:0;margin:0;width:100%;width:var(--pfe-accordion--Width,100%);max-width:100%;height:auto;position:relative;background-color:transparent;background-color:var(--pfe-accordion--BackgroundColor,transparent);color:var(--pfe-accordion--Color);border-top:1px solid #d2d2d2;border-top:var(--pfe-accordion--BorderTopWidth,var(--pfe-theme--surface--border-width,1px)) var(--pfe-theme--surface--border-style,solid) var(--pfe-accordion--BorderColor,var(--pfe-theme--color--surface--border,#d2d2d2));border-right:1px solid transparent;border-right:var(--pfe-accordion--BorderRightWidth,var(--pfe-theme--surface--border-width,1px)) var(--pfe-theme--surface--border-style,solid) var(--pfe-accordion--BorderColor,transparent);border-bottom:1px solid #d2d2d2;border-bottom:var(--pfe-accordion--BorderBottomWidth,var(--pfe-theme--surface--border-width,1px)) var(--pfe-theme--surface--border-style,solid) var(--pfe-accordion--BorderColor,var(--pfe-theme--color--surface--border,#d2d2d2));border-left:4px solid transparent;border-left:var(--pfe-accordion--BorderLeftWidth,var(--pfe-theme--surface--border-width--heavy,4px)) var(--pfe-theme--surface--border-style,solid) var(--pfe-accordion--BorderColor--accent,transparent);-webkit-box-shadow:var(--pfe-accordion--BoxShadow);box-shadow:var(--pfe-accordion--BoxShadow);cursor:pointer;z-index:1;font-family:inherit;font-size:calc(16px * 1.1);font-size:var(--pfe-accordion--FontSize--header,calc(var(--pfe-theme--font-size,16px) * 1.1));font-weight:700;font-weight:var(--pfe-theme--font-weight--bold,700);text-align:left;text-align:var(--pfe-accordion--TextAlign,left);line-height:1.5;line-height:var(--pfe-theme--line-height,1.5);padding:16px 50px 16px calc(16px * 1.5)!important;padding:var(--pfe-theme--container-spacer,16px) 50px var(--pfe-theme--container-spacer,16px) calc(var(--pfe-theme--container-spacer,16px) * 1.5)!important}button:hover{--pfe-accordion--BorderColor--accent:var(--pfe-accordion--accent)}button:hover{outline:0;z-index:2}button:focus{outline:0;z-index:2;text-decoration:underline}button::-moz-focus-inner{border:0}button[aria-expanded=true]::after{content:"";position:absolute;top:calc((16px * .5) + .4em);top:calc((var(--pfe-theme--container-spacer,16px) * .5) + .4em);display:block;border-style:solid;border-style:var(--pfe-theme--surface--border-style,solid);height:.4em;width:.4em;-webkit-transition:-webkit-transform .15s;transition:-webkit-transform .15s;transition:transform .15s;transition:transform .15s,-webkit-transform .15s;border-width:.1em .1em 0 0;border-bottom:0;-webkit-transform:rotate(-45deg);transform:rotate(-45deg);right:calc(16px * 1.5);right:calc(var(--pfe-theme--container-spacer,16px) * 1.5)}button[aria-expanded=false]::after{content:"";position:absolute;top:calc((16px * .5) + .4em);top:calc((var(--pfe-theme--container-spacer,16px) * .5) + .4em);display:block;border-style:solid;border-style:var(--pfe-theme--surface--border-style,solid);height:.4em;width:.4em;-webkit-transition:-webkit-transform .15s;transition:-webkit-transform .15s;transition:transform .15s;transition:transform .15s,-webkit-transform .15s;border-width:0 .1em .1em 0;-webkit-transform:rotate(45deg);transform:rotate(45deg);right:calc(16px * 1.5);right:calc(var(--pfe-theme--container-spacer,16px) * 1.5)}@supports (-ms-ime-align:auto){button{text-align:left}}@media screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none){button:hover{border-left-color:#0477a4;border-left-color:var(--pfe-theme--color--ui-base,#0477a4)}}:host(:last-of-type) button:not([aria-expanded=true]){--pfe-accordion--BorderBottomWidth:var(--pfe-theme--surface--border-width, 1px)}button[aria-expanded=true]{--pfe-accordion--BorderColor:var(--pfe-theme--color--surface--border, #d2d2d2);--pfe-accordion--BorderRightWidth:var(--pfe-theme--surface--border-width, 1px);--pfe-accordion--BackgroundColor:white;--pfe-accordion--Color:var(--pfe-theme--color--text, #333);--pfe-accordion--BorderColor--accent:var(--pfe-theme--color--ui-base, #0477a4)}@media screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none){button[aria-expanded=true]{border-bottom-width:0;border-left-color:#0477a4;border-left-color:var(--pfe-theme--color--ui-base,#0477a4)}}:host([on=dark]) button[aria-expanded=true]{--pfe-accordion--BorderColor:var(--pfe-theme--color--surface--border, #d2d2d2);--pfe-accordion--BorderRightWidth:var(--pfe-theme--surface--border-width, 1px);--pfe-accordion--BackgroundColor:rgba(247, 247, 249, 0.1);--pfe-accordion--Color:var(--pfe-broadcasted--text, #333);--pfe-accordion--BorderColor--accent:var(--pfe-theme--color--ui-base--on-dark, #78d7fc)}:host([on=saturated]) button[aria-expanded=true]{--pfe-accordion--BorderColor:var(--pfe-theme--color--surface--border, #d2d2d2);--pfe-accordion--BorderRightWidth:var(--pfe-theme--surface--border-width, 1px);--pfe-accordion--BackgroundColor:rgba(0, 0, 0, 0.2);--pfe-accordion--Color:var(--pfe-broadcasted--text, #333);--pfe-accordion--BorderColor--accent:var(--pfe-theme--color--ui-base--on-saturated, #fff)}:host([on=light]) button[aria-expanded=true]{--pfe-broadcasted--text:var(--pfe-theme--color--text, #333);--pfe-broadcasted--link:var(--pfe-theme--color--link, #06c);--pfe-broadcasted--link--hover:var(--pfe-theme--color--link--hover, #003366);--pfe-broadcasted--link--focus:var(--pfe-theme--color--link--focus, #003366);--pfe-broadcasted--link--visited:var(--pfe-theme--color--link--visited, rebeccapurple);--pfe-broadcasted--link-decoration:none;--pfe-broadcasted--link-decoration--hover:underline;--pfe-broadcasted--link-decoration--focus:underline;--pfe-broadcasted--link-decoration--visited:none;--theme:light}\n/*# sourceMappingURL=pfe-accordion-header.min.css.map */\n</style><button type="button" aria-expanded="false" role="tab"></button>'}static get tag(){return"pfe-accordion-header"}get styleUrl(){return"pfe-accordion-header.scss"}get templateUrl(){return"pfe-accordion-header.html"}get pfeId(){return this.getAttribute("pfe-id")}set pfeId(e){e&&this.setAttribute("pfe-id",e)}static get observedAttributes(){return["aria-expanded"]}constructor(){super(o),this.button=this.shadowRoot.querySelector("button"),this._init=this._init.bind(this),this._clickHandler=this._clickHandler.bind(this),this._observer=new MutationObserver(this._init)}connectedCallback(){super.connectedCallback(),(this.children.length||this.textContent.trim().length)&&this._init(),this.addEventListener("click",this._clickHandler),this._observer.observe(this,{childList:!0})}disconnectedCallback(){this.removeEventListener("click",this._clickHandler),this._observer.disconnect()}get expanded(){return this.hasAttribute("aria-expanded")}set expanded(e){(e=Boolean(e))?(this.setAttribute("aria-expanded",!0),this.button.setAttribute("aria-expanded",!0)):(this.removeAttribute("aria-expanded"),this.button.setAttribute("aria-expanded",!1))}_init(){window.ShadyCSS&&this._observer.disconnect(),this.hasAttribute("role")||this.setAttribute("role","header"),this.pfeId||(this.pfeId=`${o.tag}-${r()}`);const e=this.children[0];let t=!1;if(e){switch(e.tagName){case"H1":case"H2":case"H3":case"H4":case"H5":case"H6":t=!0}const r=document.createElement(e.tagName);this.button.innerText=e.innerText,r.appendChild(this.button),this.shadowRoot.appendChild(r)}else this.button.innerText=this.textContent.trim();t||console.warn(`${o.tag}: The first child in the light DOM must be a Header level tag (h1, h2, h3, h4, h5, or h6)`),window.ShadyCSS&&this._observer.observe(this,{childList:!0})}_clickHandler(e){this.dispatchEvent(new CustomEvent(`${t.tag}:change`,{detail:{expanded:!this.expanded},bubbles:!0}))}}class a extends e{static get version(){return"1.0.0-prerelease.32"}get html(){return'<style>.container{position:relative;display:block;width:100%;padding:16px;padding:var(--pfe-theme--container-spacer,16px)}:host{display:none;overflow:hidden;will-change:height;border-color:transparent;opacity:0;margin:0;width:100%;width:var(--pfe-accordion--Width,100%);max-width:100%;height:auto;position:relative;background-color:transparent;background-color:var(--pfe-accordion--BackgroundColor,transparent);color:var(--pfe-accordion--Color);border-top:1px solid #d2d2d2;border-top:var(--pfe-accordion--BorderTopWidth,var(--pfe-theme--surface--border-width,1px)) var(--pfe-theme--surface--border-style,solid) var(--pfe-accordion--BorderColor,var(--pfe-theme--color--surface--border,#d2d2d2));border-right:1px solid transparent;border-right:var(--pfe-accordion--BorderRightWidth,var(--pfe-theme--surface--border-width,1px)) var(--pfe-theme--surface--border-style,solid) var(--pfe-accordion--BorderColor,transparent);border-bottom:1px solid #d2d2d2;border-bottom:var(--pfe-accordion--BorderBottomWidth,var(--pfe-theme--surface--border-width,1px)) var(--pfe-theme--surface--border-style,solid) var(--pfe-accordion--BorderColor,var(--pfe-theme--color--surface--border,#d2d2d2));border-left:4px solid transparent;border-left:var(--pfe-accordion--BorderLeftWidth,var(--pfe-theme--surface--border-width--heavy,4px)) var(--pfe-theme--surface--border-style,solid) var(--pfe-accordion--BorderColor--accent,transparent);-webkit-box-shadow:var(--pfe-accordion--BoxShadow);box-shadow:var(--pfe-accordion--BoxShadow)}:host:hover{--pfe-accordion--BorderColor--accent:var(--pfe-accordion--accent)}:host *,:host ::after,:host ::before{-webkit-box-sizing:border-box;box-sizing:border-box}:host(.animating){display:block;-webkit-transition:height .3s ease-in-out;transition:height .3s ease-in-out}.container{--pfe-accordion--BoxShadow:none;padding-top:0;padding-right:3em;padding-left:calc(16px * 1.5);padding-left:calc(var(--pfe-theme--container-spacer,16px) * 1.5)}:host(:last-of-type[expanded]){margin-bottom:0}:host(.animating),:host([expanded]){--pfe-accordion--BorderColor:var(--pfe-theme--color--surface--border, #d2d2d2);--pfe-accordion--BorderRightWidth:var(--pfe-theme--surface--border-width, 1px);--pfe-accordion--BackgroundColor:white;--pfe-accordion--Color:var(--pfe-theme--color--text, #333);--pfe-accordion--BorderColor--accent:var(--pfe-theme--color--ui-base, #0477a4);--pfe-accordion--BorderTopWidth:0;--pfe-accordion--BoxShadow:0 5px var(--pfe-theme--surface--border-width--heavy, 4px) rgba(140, 140, 140, 0.35);display:block;position:relative;opacity:1}@media screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none){:host(.animating),:host([expanded]){border-top-width:0;border-left-color:#0477a4;border-left-color:var(--pfe-theme--color--ui-base,#0477a4)}}:host([on=dark].animating),:host([on=dark][expanded]){--pfe-accordion--BorderColor:var(--pfe-theme--color--surface--border, #d2d2d2);--pfe-accordion--BorderRightWidth:var(--pfe-theme--surface--border-width, 1px);--pfe-accordion--BackgroundColor:rgba(247, 247, 249, 0.1);--pfe-accordion--Color:var(--pfe-broadcasted--text, #333);--pfe-accordion--BorderColor--accent:var(--pfe-theme--color--ui-base--on-dark, #78d7fc);--pfe-accordion--BorderTopWidth:0;--pfe-accordion--BoxShadow:none}:host([on=saturated].animating),:host([on=saturated][expanded]){--pfe-accordion--BorderColor:var(--pfe-theme--color--surface--border, #d2d2d2);--pfe-accordion--BorderRightWidth:var(--pfe-theme--surface--border-width, 1px);--pfe-accordion--BackgroundColor:rgba(0, 0, 0, 0.2);--pfe-accordion--Color:var(--pfe-broadcasted--text, #333);--pfe-accordion--BorderColor--accent:var(--pfe-theme--color--ui-base--on-saturated, #fff);--pfe-accordion--BorderTopWidth:0;--pfe-accordion--BoxShadow:none}:host([on=light].animating),:host([on=light][expanded]){--pfe-broadcasted--text:var(--pfe-theme--color--text, #333);--pfe-broadcasted--link:var(--pfe-theme--color--link, #06c);--pfe-broadcasted--link--hover:var(--pfe-theme--color--link--hover, #003366);--pfe-broadcasted--link--focus:var(--pfe-theme--color--link--focus, #003366);--pfe-broadcasted--link--visited:var(--pfe-theme--color--link--visited, rebeccapurple);--pfe-broadcasted--link-decoration:none;--pfe-broadcasted--link-decoration--hover:underline;--pfe-broadcasted--link-decoration--focus:underline;--pfe-broadcasted--link-decoration--visited:none;--theme:light;--pfe-accordion--BorderTopWidth:0;--pfe-accordion--BoxShadow:0 5px var(--pfe-theme--surface--border-width--heavy, 4px) rgba(140, 140, 140, 0.35)}\n/*# sourceMappingURL=pfe-accordion-panel.min.css.map */\n</style><div tabindex="-1" role="tabpanel">\n <div class="container">\n <slot></slot>\n </div>\n</div>'}static get tag(){return"pfe-accordion-panel"}get styleUrl(){return"pfe-accordion-panel.scss"}get templateUrl(){return"pfe-accordion-panel.html"}get pfeId(){return this.getAttribute("pfe-id")}set pfeId(e){e&&this.setAttribute("pfe-id",e)}constructor(){super(a)}connectedCallback(){super.connectedCallback(),this.hasAttribute("role")||this.setAttribute("role","region"),this.pfeId||(this.pfeId=`${a.tag}-${r()}`)}get expanded(){return this.hasAttribute("expanded")}set expanded(e){Boolean(e)?this.setAttribute("expanded",""):this.removeAttribute("expanded")}}e.create(o),e.create(a),e.create(t);export default t; | ||
//# sourceMappingURL=pfe-accordion.min.js.map |
@@ -93,3 +93,3 @@ (function (global, factory) { | ||
/*! | ||
* PatternFly Elements: PfeAccordion 1.0.0-prerelease.31 | ||
* PatternFly Elements: PfeAccordion 1.0.0-prerelease.32 | ||
* @license | ||
@@ -192,3 +192,3 @@ * Copyright 2019 Red Hat, Inc. | ||
get: function get$$1() { | ||
return "1.0.0-prerelease.31"; | ||
return "1.0.0-prerelease.32"; | ||
} | ||
@@ -597,3 +597,3 @@ }, { | ||
get: function get$$1() { | ||
return "1.0.0-prerelease.31"; | ||
return "1.0.0-prerelease.32"; | ||
} | ||
@@ -750,3 +750,3 @@ }, { | ||
get: function get$$1() { | ||
return "1.0.0-prerelease.31"; | ||
return "1.0.0-prerelease.32"; | ||
} | ||
@@ -753,0 +753,0 @@ }, { |
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("../../pfelement/dist/pfelement.umd")):"function"==typeof define&&define.amd?define(["../../pfelement/dist/pfelement.umd"],t):e.PfeAccordion=t(e.PFElement)}(this,function(e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;function t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var r=function(e,t,r){return t&&o(e.prototype,t),r&&o(e,r),e};function o(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function i(e,t,r){null===e&&(e=Function.prototype);var o=Object.getOwnPropertyDescriptor(e,t);if(void 0===o){var a=Object.getPrototypeOf(e);return null===a?void 0:i(a,t,r)}if("value"in o)return o.value;var n=o.get;return void 0!==n?n.call(r):void 0}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function n(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function d(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}function c(){return Math.random().toString(36).substr(2,9)}Array.prototype.findIndex||Object.defineProperty(Array.prototype,"findIndex",{value:function(e,t){if(null==this)throw new TypeError('"this" is null or not defined');var r=Object(this),o=r.length>>>0;if("function"!=typeof e)throw new TypeError("predicate must be a function");for(var a=t,n=0;n<o;){var i=r[n];if(e.call(a,i,n,r))return n;n++}return-1}});var s=(a(l,e),r(l,[{key:"html",get:function(){return"<style>:host([on=dark]){--pfe-broadcasted--text:var(--pfe-theme--color--text--on-dark, #fff);--pfe-broadcasted--link:var(--pfe-theme--color--link--on-dark, #99ccff);--pfe-broadcasted--link--hover:var(--pfe-theme--color--link--hover--on-dark, #cce6ff);--pfe-broadcasted--link--focus:var(--pfe-theme--color--link--focus--on-dark, #cce6ff);--pfe-broadcasted--link--visited:var(--pfe-theme--color--link--visited--on-dark, #b38cd9);--pfe-broadcasted--link-decoration:none;--pfe-broadcasted--link-decoration--hover:underline;--pfe-broadcasted--link-decoration--focus:underline;--pfe-broadcasted--link-decoration--visited:none}@media screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none){:host{color:#333!important;color:var(--pfe-theme--color--text,#333)!important}}:host([on=saturated]){--pfe-broadcasted--text:var(--pfe-theme--color--text--on-saturated, #fff);--pfe-broadcasted--link:var(--pfe-theme--color--link--on-saturated, #fff);--pfe-broadcasted--link--hover:var(--pfe-theme--color--link--hover--on-saturated, white);--pfe-broadcasted--link--focus:var(--pfe-theme--color--link--focus--on-saturated, white);--pfe-broadcasted--link--visited:var(--pfe-theme--color--link--visited--on-saturated, #b38cd9);--pfe-broadcasted--link-decoration:underline;--pfe-broadcasted--link-decoration--hover:underline;--pfe-broadcasted--link-decoration--focus:underline;--pfe-broadcasted--link-decoration--visited:underline}@media screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none){:host{color:#333!important;color:var(--pfe-theme--color--text,#333)!important}}:host([on=light]){--pfe-broadcasted--text:var(--pfe-theme--color--text, #333);--pfe-broadcasted--link:var(--pfe-theme--color--link, #06c);--pfe-broadcasted--link--hover:var(--pfe-theme--color--link--hover, #003366);--pfe-broadcasted--link--focus:var(--pfe-theme--color--link--focus, #003366);--pfe-broadcasted--link--visited:var(--pfe-theme--color--link--visited, rebeccapurple);--pfe-broadcasted--link-decoration:none;--pfe-broadcasted--link-decoration--hover:underline;--pfe-broadcasted--link-decoration--focus:underline;--pfe-broadcasted--link-decoration--visited:none}@media screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none){:host{color:#333!important;color:var(--pfe-theme--color--text,#333)!important}}:host{--pfe-accordion--BorderColor--accent:transparent;--pfe-accordion--BorderColor:var(--pfe-theme--color--surface--border, #d2d2d2);--pfe-accordion--BorderTopWidth:var(--pfe-theme--surface--border-width, 1px);--pfe-accordion--BorderRightWidth:0;--pfe-accordion--BorderBottomWidth:var(--pfe-theme--surface--border-width, 1px);--pfe-accordion--Color:var(--pfe-broadcasted--text, #333);--pfe-accordion--TextAlign:left;--pfe-accordion--accent:var(--pfe-theme--color--ui-base, #0477a4);display:block;position:relative;overflow:hidden;margin:0;color:var(--pfe-accordion--Color)}@media screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none){:host{background-color:#fff!important;background-color:var(--pfe-theme--color--surface--lightest,#fff)!important;color:#333!important;color:var(--pfe-theme--color--text,#333)!important}}:host([on=dark]){--pfe-accordion--BorderColor--accent:transparent;--pfe-accordion--BorderColor:var(--pfe-theme--color--surface--border, #d2d2d2);--pfe-accordion--BorderTopWidth:var(--pfe-theme--surface--border-width, 1px);--pfe-accordion--BorderRightWidth:0;--pfe-accordion--BorderBottomWidth:var(--pfe-theme--surface--border-width, 1px);--pfe-accordion--Color:var(--pfe-broadcasted--text, #333);--pfe-accordion--TextAlign:left;--pfe-accordion--accent:var(--pfe-theme--color--ui-base--on-dark, #78d7fc)}:host([on=saturated]){--pfe-accordion--BorderColor--accent:transparent;--pfe-accordion--BorderColor:var(--pfe-theme--color--surface--border, #d2d2d2);--pfe-accordion--BorderTopWidth:var(--pfe-theme--surface--border-width, 1px);--pfe-accordion--BorderRightWidth:0;--pfe-accordion--BorderBottomWidth:var(--pfe-theme--surface--border-width, 1px);--pfe-accordion--Color:var(--pfe-broadcasted--text, #333);--pfe-accordion--TextAlign:left;--pfe-accordion--accent:var(--pfe-theme--color--ui-base--on-saturated, #fff)}:host([on=light]){--pfe-accordion--BorderColor--accent:transparent;--pfe-accordion--BorderColor:var(--pfe-theme--color--surface--border, #d2d2d2);--pfe-accordion--BorderTopWidth:var(--pfe-theme--surface--border-width, 1px);--pfe-accordion--BorderRightWidth:0;--pfe-accordion--BorderBottomWidth:var(--pfe-theme--surface--border-width, 1px);--pfe-accordion--Color:var(--pfe-broadcasted--text, #333);--pfe-accordion--TextAlign:left;--pfe-accordion--accent:var(--pfe-theme--color--ui-base, #0477a4)}\n/*# sourceMappingURL=pfe-accordion.min.css.map */\n</style><slot></slot>"}},{key:"styleUrl",get:function(){return"pfe-accordion.scss"}},{key:"templateUrl",get:function(){return"pfe-accordion.html"}},{key:"schemaUrl",get:function(){return"pfe-accordion.json"}}],[{key:"version",get:function(){return"1.0.0-prerelease.31"}},{key:"properties",get:function(){return{}}},{key:"slots",get:function(){return{default:{title:"Default",type:"array",namedSlot:!1,items:{oneOf:[{$ref:"pfe-accordion-header"},{$ref:"pfe-accordion-panel"}]}}}}},{key:"tag",get:function(){return"pfe-accordion"}},{key:"cascadingAttributes",get:function(){return{on:"pfe-accordion-header, pfe-accordion-panel"}}},{key:"PfeType",get:function(){return e.PfeTypes.Container}}]),r(l,[{key:"connectedCallback",value:function(){var e=this;i(l.prototype.__proto__||Object.getPrototypeOf(l.prototype),"connectedCallback",this).call(this),this.setAttribute("role","presentation"),this.setAttribute("defined",""),this.addEventListener(l.tag+":change",this._changeHandler),this.addEventListener("keydown",this._keydownHandler),Promise.all([customElements.whenDefined(f.tag),customElements.whenDefined(h.tag)]).then(function(){e.children.length&&e._linkPanels(),e._observer.observe(e,{childList:!0})})}},{key:"disconnectedCallback",value:function(){this.removeEventListener(l.tag+":change",this._changeHandler),this.removeEventListener("keydown",this._keydownHandler),this._observer.disconnect()}},{key:"attributeChangedCallback",value:function(e,t,r){i(l.prototype.__proto__||Object.getPrototypeOf(l.prototype),"attributeChangedCallback",this).call(this,e,t,r)}},{key:"toggle",value:function(e){var t=this._allHeaders(),r=this._allPanels(),o=t[e],a=r[e];o&&a&&(o.expanded?(this._collapseHeader(o),this._collapsePanel(a)):(this._expandHeader(o),this._expandPanel(a)))}},{key:"expand",value:function(e){var t=this._allHeaders(),r=this._allPanels(),o=t[e],a=r[e];o&&a&&(this._expandHeader(o),this._expandPanel(a))}},{key:"expandAll",value:function(){var t=this,e=this._allHeaders(),r=this._allPanels();e.forEach(function(e){return t._expandHeader(e)}),r.forEach(function(e){return t._expandPanel(e)})}},{key:"collapse",value:function(e){var t=this._allHeaders(),r=this._allPanels(),o=t[e],a=r[e];o&&a&&(this._collapseHeader(o),this._collapsePanel(a))}},{key:"collapseAll",value:function(){var t=this,e=this._allHeaders(),r=this._allPanels();e.forEach(function(e){return t._collapseHeader(e)}),r.forEach(function(e){return t._collapsePanel(e)})}},{key:"_linkPanels",value:function(){var r=this;this._allHeaders().forEach(function(e){var t=r._panelForHeader(e);t&&(e.setAttribute("aria-controls",t.pfeId),t.setAttribute("aria-labelledby",e.pfeId))})}},{key:"_changeHandler",value:function(e){if(!this.classList.contains("animating")){var t=e.target,r=e.target.nextElementSibling;e.detail.expanded?(this._expandHeader(t),this._expandPanel(r)):(this._collapseHeader(t),this._collapsePanel(r))}}},{key:"_toggle",value:function(e,t){}},{key:"_expandHeader",value:function(e){e.expanded=!0}},{key:"_expandPanel",value:function(e){if(e){if(!e.expanded){e.expanded=!0;var t=e.getBoundingClientRect().height;this._animate(e,0,t)}}else console.error(l.tag+": Trying to expand a panel that doesn't exist")}},{key:"_collapseHeader",value:function(e){e.expanded=!1}},{key:"_collapsePanel",value:function(e){if(e){if(e.expanded){var t=e.getBoundingClientRect().height;e.expanded=!1,this._animate(e,t,0)}}else console.error(l.tag+": Trying to collapse a panel that doesn't exist")}},{key:"_animate",value:function(e,t,r){var o=this;if(e){var a=e.previousElementSibling;a&&a.classList.add("animating"),e.classList.add("animating"),e.style.height=t+"px",requestAnimationFrame(function(){requestAnimationFrame(function(){e.style.height=r+"px",e.addEventListener("transitionend",o._transitionEndHandler)})})}}},{key:"_keydownHandler",value:function(e){var t=e.target;if(this._isHeader(t)){var r=void 0;switch(e.key){case"ArrowDown":case"Down":case"ArrowRight":case"Right":r=this._nextHeader();break;case"ArrowUp":case"Up":case"ArrowLeft":case"Left":r=this._previousHeader();break;case"Home":r=this._firstHeader();break;case"End":r=this._lastHeader();break;default:return}r.shadowRoot.querySelector("button").focus()}}},{key:"_transitionEndHandler",value:function(e){var t=e.target.previousElementSibling;t&&t.classList.remove("animating"),e.target.style.height="",e.target.classList.remove("animating"),e.target.removeEventListener("transitionend",this._transitionEndHandler)}},{key:"_allHeaders",value:function(){return[].concat(d(this.querySelectorAll(f.tag)))}},{key:"_allPanels",value:function(){return[].concat(d(this.querySelectorAll(h.tag)))}},{key:"_panelForHeader",value:function(e){var t=e.nextElementSibling;if(t){if(t.tagName.toLowerCase()===h.tag)return t;console.error(l.tag+": Sibling element to a header needs to be a panel")}}},{key:"_previousHeader",value:function(){var e=this._allHeaders(),t=e.findIndex(function(e){return e===document.activeElement})-1;return e[(t+e.length)%e.length]}},{key:"_nextHeader",value:function(){var e=this._allHeaders(),t=e.findIndex(function(e){return e===document.activeElement})+1;return e[t%e.length]}},{key:"_firstHeader",value:function(){return this._allHeaders()[0]}},{key:"_lastHeader",value:function(){var e=this._allHeaders();return e[e.length-1]}},{key:"_isHeader",value:function(e){return e.tagName.toLowerCase()===f.tag}}]),l);function l(){t(this,l);var e=n(this,(l.__proto__||Object.getPrototypeOf(l)).call(this,l,{type:l.PfeType}));return e._linkPanels=e._linkPanels.bind(e),e._observer=new MutationObserver(e._linkPanels),e}var f=(a(p,e),r(p,[{key:"html",get:function(){return'<style>:host{-webkit-transition:-webkit-transform .3s cubic-bezier(.465,.183,.153,.946);transition:-webkit-transform .3s cubic-bezier(.465,.183,.153,.946);transition:transform .3s cubic-bezier(.465,.183,.153,.946);transition:transform .3s cubic-bezier(.465,.183,.153,.946),-webkit-transform .3s cubic-bezier(.465,.183,.153,.946);-webkit-transition:-webkit-transform .3s var(--pfe-theme--animation-timing,cubic-bezier(.465,.183,.153,.946));transition:-webkit-transform .3s var(--pfe-theme--animation-timing,cubic-bezier(.465,.183,.153,.946));transition:transform .3s var(--pfe-theme--animation-timing,cubic-bezier(.465,.183,.153,.946));transition:transform .3s var(--pfe-theme--animation-timing,cubic-bezier(.465,.183,.153,.946)),-webkit-transform .3s var(--pfe-theme--animation-timing,cubic-bezier(.465,.183,.153,.946));display:block}:host>*{margin:0}button{--pfe-accordion--BorderBottomWidth:0;margin:0;width:100%;width:var(--pfe-accordion--Width,100%);max-width:100%;height:auto;position:relative;background-color:transparent;background-color:var(--pfe-accordion--BackgroundColor,transparent);color:var(--pfe-accordion--Color);border-top:1px solid #d2d2d2;border-top:var(--pfe-accordion--BorderTopWidth,var(--pfe-theme--surface--border-width,1px)) var(--pfe-theme--surface--border-style,solid) var(--pfe-accordion--BorderColor,var(--pfe-theme--color--surface--border,#d2d2d2));border-right:1px solid transparent;border-right:var(--pfe-accordion--BorderRightWidth,var(--pfe-theme--surface--border-width,1px)) var(--pfe-theme--surface--border-style,solid) var(--pfe-accordion--BorderColor,transparent);border-bottom:1px solid #d2d2d2;border-bottom:var(--pfe-accordion--BorderBottomWidth,var(--pfe-theme--surface--border-width,1px)) var(--pfe-theme--surface--border-style,solid) var(--pfe-accordion--BorderColor,var(--pfe-theme--color--surface--border,#d2d2d2));border-left:4px solid transparent;border-left:var(--pfe-accordion--BorderLeftWidth,var(--pfe-theme--surface--border-width--heavy,4px)) var(--pfe-theme--surface--border-style,solid) var(--pfe-accordion--BorderColor--accent,transparent);-webkit-box-shadow:var(--pfe-accordion--BoxShadow);box-shadow:var(--pfe-accordion--BoxShadow);cursor:pointer;z-index:1;font-family:inherit;font-size:calc(16px * 1.1);font-size:var(--pfe-accordion--FontSize--header,calc(var(--pfe-theme--font-size,16px) * 1.1));font-weight:700;font-weight:var(--pfe-theme--font-weight--bold,700);text-align:left;text-align:var(--pfe-accordion--TextAlign,left);line-height:1.5;line-height:var(--pfe-theme--line-height,1.5);padding:16px 50px 16px calc(16px * 1.5)!important;padding:var(--pfe-theme--container-spacer,16px) 50px var(--pfe-theme--container-spacer,16px) calc(var(--pfe-theme--container-spacer,16px) * 1.5)!important}button:hover{--pfe-accordion--BorderColor--accent:var(--pfe-accordion--accent)}button:hover{outline:0;z-index:2}button:focus{outline:0;z-index:2;text-decoration:underline}button::-moz-focus-inner{border:0}button[aria-expanded=true]::after{content:"";position:absolute;top:calc((16px * .5) + .4em);top:calc((var(--pfe-theme--container-spacer,16px) * .5) + .4em);display:block;border-style:solid;border-style:var(--pfe-theme--surface--border-style,solid);height:.4em;width:.4em;-webkit-transition:-webkit-transform .15s;transition:-webkit-transform .15s;transition:transform .15s;transition:transform .15s,-webkit-transform .15s;border-width:.1em .1em 0 0;border-bottom:0;-webkit-transform:rotate(-45deg);transform:rotate(-45deg);right:calc(16px * 1.5);right:calc(var(--pfe-theme--container-spacer,16px) * 1.5)}button[aria-expanded=false]::after{content:"";position:absolute;top:calc((16px * .5) + .4em);top:calc((var(--pfe-theme--container-spacer,16px) * .5) + .4em);display:block;border-style:solid;border-style:var(--pfe-theme--surface--border-style,solid);height:.4em;width:.4em;-webkit-transition:-webkit-transform .15s;transition:-webkit-transform .15s;transition:transform .15s;transition:transform .15s,-webkit-transform .15s;border-width:0 .1em .1em 0;-webkit-transform:rotate(45deg);transform:rotate(45deg);right:calc(16px * 1.5);right:calc(var(--pfe-theme--container-spacer,16px) * 1.5)}@supports (-ms-ime-align:auto){button{text-align:left}}@media screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none){button:hover{border-left-color:#0477a4;border-left-color:var(--pfe-theme--color--ui-base,#0477a4)}}:host(:last-of-type) button:not([aria-expanded=true]){--pfe-accordion--BorderBottomWidth:var(--pfe-theme--surface--border-width, 1px)}button[aria-expanded=true]{--pfe-accordion--BorderColor:var(--pfe-theme--color--surface--border, #d2d2d2);--pfe-accordion--BorderRightWidth:var(--pfe-theme--surface--border-width, 1px);--pfe-accordion--BackgroundColor:white;--pfe-accordion--Color:var(--pfe-theme--color--text, #333);--pfe-accordion--BorderColor--accent:var(--pfe-theme--color--ui-base, #0477a4)}@media screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none){button[aria-expanded=true]{border-bottom-width:0;border-left-color:#0477a4;border-left-color:var(--pfe-theme--color--ui-base,#0477a4)}}:host([on=dark]) button[aria-expanded=true]{--pfe-accordion--BorderColor:var(--pfe-theme--color--surface--border, #d2d2d2);--pfe-accordion--BorderRightWidth:var(--pfe-theme--surface--border-width, 1px);--pfe-accordion--BackgroundColor:rgba(247, 247, 249, 0.1);--pfe-accordion--Color:var(--pfe-broadcasted--text, #333);--pfe-accordion--BorderColor--accent:var(--pfe-theme--color--ui-base--on-dark, #78d7fc)}:host([on=saturated]) button[aria-expanded=true]{--pfe-accordion--BorderColor:var(--pfe-theme--color--surface--border, #d2d2d2);--pfe-accordion--BorderRightWidth:var(--pfe-theme--surface--border-width, 1px);--pfe-accordion--BackgroundColor:rgba(0, 0, 0, 0.2);--pfe-accordion--Color:var(--pfe-broadcasted--text, #333);--pfe-accordion--BorderColor--accent:var(--pfe-theme--color--ui-base--on-saturated, #fff)}:host([on=light]) button[aria-expanded=true]{--pfe-broadcasted--text:var(--pfe-theme--color--text, #333);--pfe-broadcasted--link:var(--pfe-theme--color--link, #06c);--pfe-broadcasted--link--hover:var(--pfe-theme--color--link--hover, #003366);--pfe-broadcasted--link--focus:var(--pfe-theme--color--link--focus, #003366);--pfe-broadcasted--link--visited:var(--pfe-theme--color--link--visited, rebeccapurple);--pfe-broadcasted--link-decoration:none;--pfe-broadcasted--link-decoration--hover:underline;--pfe-broadcasted--link-decoration--focus:underline;--pfe-broadcasted--link-decoration--visited:none;--theme:light}\n/*# sourceMappingURL=pfe-accordion-header.min.css.map */\n</style><button type="button" aria-expanded="false" role="tab"></button>'}},{key:"styleUrl",get:function(){return"pfe-accordion-header.scss"}},{key:"templateUrl",get:function(){return"pfe-accordion-header.html"}},{key:"pfeId",get:function(){return this.getAttribute("pfe-id")},set:function(e){e&&this.setAttribute("pfe-id",e)}}],[{key:"version",get:function(){return"1.0.0-prerelease.31"}},{key:"tag",get:function(){return"pfe-accordion-header"}},{key:"observedAttributes",get:function(){return["aria-expanded"]}}]),r(p,[{key:"connectedCallback",value:function(){i(p.prototype.__proto__||Object.getPrototypeOf(p.prototype),"connectedCallback",this).call(this),(this.children.length||this.textContent.trim().length)&&this._init(),this.addEventListener("click",this._clickHandler),this._observer.observe(this,{childList:!0})}},{key:"disconnectedCallback",value:function(){this.removeEventListener("click",this._clickHandler),this._observer.disconnect()}},{key:"_init",value:function(){window.ShadyCSS&&this._observer.disconnect(),this.hasAttribute("role")||this.setAttribute("role","header"),this.pfeId||(this.pfeId=p.tag+"-"+c());var e=this.children[0],t=!1;if(e){switch(e.tagName){case"H1":case"H2":case"H3":case"H4":case"H5":case"H6":t=!0}var r=document.createElement(e.tagName);this.button.innerText=e.innerText,r.appendChild(this.button),this.shadowRoot.appendChild(r)}else this.button.innerText=this.textContent.trim();t||console.warn(p.tag+": The first child in the light DOM must be a Header level tag (h1, h2, h3, h4, h5, or h6)"),window.ShadyCSS&&this._observer.observe(this,{childList:!0})}},{key:"_clickHandler",value:function(e){this.dispatchEvent(new CustomEvent(s.tag+":change",{detail:{expanded:!this.expanded},bubbles:!0}))}},{key:"expanded",get:function(){return this.hasAttribute("aria-expanded")},set:function(e){(e=Boolean(e))?(this.setAttribute("aria-expanded",!0),this.button.setAttribute("aria-expanded",!0)):(this.removeAttribute("aria-expanded"),this.button.setAttribute("aria-expanded",!1))}}]),p);function p(){t(this,p);var e=n(this,(p.__proto__||Object.getPrototypeOf(p)).call(this,p));return e.button=e.shadowRoot.querySelector("button"),e._init=e._init.bind(e),e._clickHandler=e._clickHandler.bind(e),e._observer=new MutationObserver(e._init),e}var h=(a(u,e),r(u,[{key:"html",get:function(){return'<style>.container{position:relative;display:block;width:100%;padding:16px;padding:var(--pfe-theme--container-spacer,16px)}:host{display:none;overflow:hidden;will-change:height;border-color:transparent;opacity:0;margin:0;width:100%;width:var(--pfe-accordion--Width,100%);max-width:100%;height:auto;position:relative;background-color:transparent;background-color:var(--pfe-accordion--BackgroundColor,transparent);color:var(--pfe-accordion--Color);border-top:1px solid #d2d2d2;border-top:var(--pfe-accordion--BorderTopWidth,var(--pfe-theme--surface--border-width,1px)) var(--pfe-theme--surface--border-style,solid) var(--pfe-accordion--BorderColor,var(--pfe-theme--color--surface--border,#d2d2d2));border-right:1px solid transparent;border-right:var(--pfe-accordion--BorderRightWidth,var(--pfe-theme--surface--border-width,1px)) var(--pfe-theme--surface--border-style,solid) var(--pfe-accordion--BorderColor,transparent);border-bottom:1px solid #d2d2d2;border-bottom:var(--pfe-accordion--BorderBottomWidth,var(--pfe-theme--surface--border-width,1px)) var(--pfe-theme--surface--border-style,solid) var(--pfe-accordion--BorderColor,var(--pfe-theme--color--surface--border,#d2d2d2));border-left:4px solid transparent;border-left:var(--pfe-accordion--BorderLeftWidth,var(--pfe-theme--surface--border-width--heavy,4px)) var(--pfe-theme--surface--border-style,solid) var(--pfe-accordion--BorderColor--accent,transparent);-webkit-box-shadow:var(--pfe-accordion--BoxShadow);box-shadow:var(--pfe-accordion--BoxShadow)}:host:hover{--pfe-accordion--BorderColor--accent:var(--pfe-accordion--accent)}:host *,:host ::after,:host ::before{-webkit-box-sizing:border-box;box-sizing:border-box}:host(.animating){display:block;-webkit-transition:height .3s ease-in-out;transition:height .3s ease-in-out}.container{--pfe-accordion--BoxShadow:none;padding-top:0;padding-right:3em;padding-left:calc(16px * 1.5);padding-left:calc(var(--pfe-theme--container-spacer,16px) * 1.5)}:host(:last-of-type[expanded]){margin-bottom:0}:host(.animating),:host([expanded]){--pfe-accordion--BorderColor:var(--pfe-theme--color--surface--border, #d2d2d2);--pfe-accordion--BorderRightWidth:var(--pfe-theme--surface--border-width, 1px);--pfe-accordion--BackgroundColor:white;--pfe-accordion--Color:var(--pfe-theme--color--text, #333);--pfe-accordion--BorderColor--accent:var(--pfe-theme--color--ui-base, #0477a4);--pfe-accordion--BorderTopWidth:0;--pfe-accordion--BoxShadow:0 5px var(--pfe-theme--surface--border-width--heavy, 4px) rgba(140, 140, 140, 0.35);display:block;position:relative;opacity:1}@media screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none){:host(.animating),:host([expanded]){border-top-width:0;border-left-color:#0477a4;border-left-color:var(--pfe-theme--color--ui-base,#0477a4)}}:host([on=dark].animating),:host([on=dark][expanded]){--pfe-accordion--BorderColor:var(--pfe-theme--color--surface--border, #d2d2d2);--pfe-accordion--BorderRightWidth:var(--pfe-theme--surface--border-width, 1px);--pfe-accordion--BackgroundColor:rgba(247, 247, 249, 0.1);--pfe-accordion--Color:var(--pfe-broadcasted--text, #333);--pfe-accordion--BorderColor--accent:var(--pfe-theme--color--ui-base--on-dark, #78d7fc);--pfe-accordion--BorderTopWidth:0;--pfe-accordion--BoxShadow:none}:host([on=saturated].animating),:host([on=saturated][expanded]){--pfe-accordion--BorderColor:var(--pfe-theme--color--surface--border, #d2d2d2);--pfe-accordion--BorderRightWidth:var(--pfe-theme--surface--border-width, 1px);--pfe-accordion--BackgroundColor:rgba(0, 0, 0, 0.2);--pfe-accordion--Color:var(--pfe-broadcasted--text, #333);--pfe-accordion--BorderColor--accent:var(--pfe-theme--color--ui-base--on-saturated, #fff);--pfe-accordion--BorderTopWidth:0;--pfe-accordion--BoxShadow:none}:host([on=light].animating),:host([on=light][expanded]){--pfe-broadcasted--text:var(--pfe-theme--color--text, #333);--pfe-broadcasted--link:var(--pfe-theme--color--link, #06c);--pfe-broadcasted--link--hover:var(--pfe-theme--color--link--hover, #003366);--pfe-broadcasted--link--focus:var(--pfe-theme--color--link--focus, #003366);--pfe-broadcasted--link--visited:var(--pfe-theme--color--link--visited, rebeccapurple);--pfe-broadcasted--link-decoration:none;--pfe-broadcasted--link-decoration--hover:underline;--pfe-broadcasted--link-decoration--focus:underline;--pfe-broadcasted--link-decoration--visited:none;--theme:light;--pfe-accordion--BorderTopWidth:0;--pfe-accordion--BoxShadow:0 5px var(--pfe-theme--surface--border-width--heavy, 4px) rgba(140, 140, 140, 0.35)}\n/*# sourceMappingURL=pfe-accordion-panel.min.css.map */\n</style><div tabindex="-1" role="tabpanel">\n <div class="container">\n <slot></slot>\n </div>\n</div>'}},{key:"styleUrl",get:function(){return"pfe-accordion-panel.scss"}},{key:"templateUrl",get:function(){return"pfe-accordion-panel.html"}},{key:"pfeId",get:function(){return this.getAttribute("pfe-id")},set:function(e){e&&this.setAttribute("pfe-id",e)}}],[{key:"version",get:function(){return"1.0.0-prerelease.31"}},{key:"tag",get:function(){return"pfe-accordion-panel"}}]),r(u,[{key:"connectedCallback",value:function(){i(u.prototype.__proto__||Object.getPrototypeOf(u.prototype),"connectedCallback",this).call(this),this.hasAttribute("role")||this.setAttribute("role","region"),this.pfeId||(this.pfeId=u.tag+"-"+c())}},{key:"expanded",get:function(){return this.hasAttribute("expanded")},set:function(e){Boolean(e)?this.setAttribute("expanded",""):this.removeAttribute("expanded")}}]),u);function u(){return t(this,u),n(this,(u.__proto__||Object.getPrototypeOf(u)).call(this,u))}return e.create(f),e.create(h),e.create(s),s}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("../../pfelement/dist/pfelement.umd")):"function"==typeof define&&define.amd?define(["../../pfelement/dist/pfelement.umd"],t):e.PfeAccordion=t(e.PFElement)}(this,function(e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;function t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var r=function(e,t,r){return t&&o(e.prototype,t),r&&o(e,r),e};function o(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function i(e,t,r){null===e&&(e=Function.prototype);var o=Object.getOwnPropertyDescriptor(e,t);if(void 0===o){var a=Object.getPrototypeOf(e);return null===a?void 0:i(a,t,r)}if("value"in o)return o.value;var n=o.get;return void 0!==n?n.call(r):void 0}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function n(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function d(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}function c(){return Math.random().toString(36).substr(2,9)}Array.prototype.findIndex||Object.defineProperty(Array.prototype,"findIndex",{value:function(e,t){if(null==this)throw new TypeError('"this" is null or not defined');var r=Object(this),o=r.length>>>0;if("function"!=typeof e)throw new TypeError("predicate must be a function");for(var a=t,n=0;n<o;){var i=r[n];if(e.call(a,i,n,r))return n;n++}return-1}});var s=(a(l,e),r(l,[{key:"html",get:function(){return"<style>:host([on=dark]){--pfe-broadcasted--text:var(--pfe-theme--color--text--on-dark, #fff);--pfe-broadcasted--link:var(--pfe-theme--color--link--on-dark, #99ccff);--pfe-broadcasted--link--hover:var(--pfe-theme--color--link--hover--on-dark, #cce6ff);--pfe-broadcasted--link--focus:var(--pfe-theme--color--link--focus--on-dark, #cce6ff);--pfe-broadcasted--link--visited:var(--pfe-theme--color--link--visited--on-dark, #b38cd9);--pfe-broadcasted--link-decoration:none;--pfe-broadcasted--link-decoration--hover:underline;--pfe-broadcasted--link-decoration--focus:underline;--pfe-broadcasted--link-decoration--visited:none}@media screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none){:host{color:#333!important;color:var(--pfe-theme--color--text,#333)!important}}:host([on=saturated]){--pfe-broadcasted--text:var(--pfe-theme--color--text--on-saturated, #fff);--pfe-broadcasted--link:var(--pfe-theme--color--link--on-saturated, #fff);--pfe-broadcasted--link--hover:var(--pfe-theme--color--link--hover--on-saturated, white);--pfe-broadcasted--link--focus:var(--pfe-theme--color--link--focus--on-saturated, white);--pfe-broadcasted--link--visited:var(--pfe-theme--color--link--visited--on-saturated, #b38cd9);--pfe-broadcasted--link-decoration:underline;--pfe-broadcasted--link-decoration--hover:underline;--pfe-broadcasted--link-decoration--focus:underline;--pfe-broadcasted--link-decoration--visited:underline}@media screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none){:host{color:#333!important;color:var(--pfe-theme--color--text,#333)!important}}:host([on=light]){--pfe-broadcasted--text:var(--pfe-theme--color--text, #333);--pfe-broadcasted--link:var(--pfe-theme--color--link, #06c);--pfe-broadcasted--link--hover:var(--pfe-theme--color--link--hover, #003366);--pfe-broadcasted--link--focus:var(--pfe-theme--color--link--focus, #003366);--pfe-broadcasted--link--visited:var(--pfe-theme--color--link--visited, rebeccapurple);--pfe-broadcasted--link-decoration:none;--pfe-broadcasted--link-decoration--hover:underline;--pfe-broadcasted--link-decoration--focus:underline;--pfe-broadcasted--link-decoration--visited:none}@media screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none){:host{color:#333!important;color:var(--pfe-theme--color--text,#333)!important}}:host{--pfe-accordion--BorderColor--accent:transparent;--pfe-accordion--BorderColor:var(--pfe-theme--color--surface--border, #d2d2d2);--pfe-accordion--BorderTopWidth:var(--pfe-theme--surface--border-width, 1px);--pfe-accordion--BorderRightWidth:0;--pfe-accordion--BorderBottomWidth:var(--pfe-theme--surface--border-width, 1px);--pfe-accordion--Color:var(--pfe-broadcasted--text, #333);--pfe-accordion--TextAlign:left;--pfe-accordion--accent:var(--pfe-theme--color--ui-base, #0477a4);display:block;position:relative;overflow:hidden;margin:0;color:var(--pfe-accordion--Color)}@media screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none){:host{background-color:#fff!important;background-color:var(--pfe-theme--color--surface--lightest,#fff)!important;color:#333!important;color:var(--pfe-theme--color--text,#333)!important}}:host([on=dark]){--pfe-accordion--BorderColor--accent:transparent;--pfe-accordion--BorderColor:var(--pfe-theme--color--surface--border, #d2d2d2);--pfe-accordion--BorderTopWidth:var(--pfe-theme--surface--border-width, 1px);--pfe-accordion--BorderRightWidth:0;--pfe-accordion--BorderBottomWidth:var(--pfe-theme--surface--border-width, 1px);--pfe-accordion--Color:var(--pfe-broadcasted--text, #333);--pfe-accordion--TextAlign:left;--pfe-accordion--accent:var(--pfe-theme--color--ui-base--on-dark, #78d7fc)}:host([on=saturated]){--pfe-accordion--BorderColor--accent:transparent;--pfe-accordion--BorderColor:var(--pfe-theme--color--surface--border, #d2d2d2);--pfe-accordion--BorderTopWidth:var(--pfe-theme--surface--border-width, 1px);--pfe-accordion--BorderRightWidth:0;--pfe-accordion--BorderBottomWidth:var(--pfe-theme--surface--border-width, 1px);--pfe-accordion--Color:var(--pfe-broadcasted--text, #333);--pfe-accordion--TextAlign:left;--pfe-accordion--accent:var(--pfe-theme--color--ui-base--on-saturated, #fff)}:host([on=light]){--pfe-accordion--BorderColor--accent:transparent;--pfe-accordion--BorderColor:var(--pfe-theme--color--surface--border, #d2d2d2);--pfe-accordion--BorderTopWidth:var(--pfe-theme--surface--border-width, 1px);--pfe-accordion--BorderRightWidth:0;--pfe-accordion--BorderBottomWidth:var(--pfe-theme--surface--border-width, 1px);--pfe-accordion--Color:var(--pfe-broadcasted--text, #333);--pfe-accordion--TextAlign:left;--pfe-accordion--accent:var(--pfe-theme--color--ui-base, #0477a4)}\n/*# sourceMappingURL=pfe-accordion.min.css.map */\n</style><slot></slot>"}},{key:"styleUrl",get:function(){return"pfe-accordion.scss"}},{key:"templateUrl",get:function(){return"pfe-accordion.html"}},{key:"schemaUrl",get:function(){return"pfe-accordion.json"}}],[{key:"version",get:function(){return"1.0.0-prerelease.32"}},{key:"properties",get:function(){return{}}},{key:"slots",get:function(){return{default:{title:"Default",type:"array",namedSlot:!1,items:{oneOf:[{$ref:"pfe-accordion-header"},{$ref:"pfe-accordion-panel"}]}}}}},{key:"tag",get:function(){return"pfe-accordion"}},{key:"cascadingAttributes",get:function(){return{on:"pfe-accordion-header, pfe-accordion-panel"}}},{key:"PfeType",get:function(){return e.PfeTypes.Container}}]),r(l,[{key:"connectedCallback",value:function(){var e=this;i(l.prototype.__proto__||Object.getPrototypeOf(l.prototype),"connectedCallback",this).call(this),this.setAttribute("role","presentation"),this.setAttribute("defined",""),this.addEventListener(l.tag+":change",this._changeHandler),this.addEventListener("keydown",this._keydownHandler),Promise.all([customElements.whenDefined(f.tag),customElements.whenDefined(h.tag)]).then(function(){e.children.length&&e._linkPanels(),e._observer.observe(e,{childList:!0})})}},{key:"disconnectedCallback",value:function(){this.removeEventListener(l.tag+":change",this._changeHandler),this.removeEventListener("keydown",this._keydownHandler),this._observer.disconnect()}},{key:"attributeChangedCallback",value:function(e,t,r){i(l.prototype.__proto__||Object.getPrototypeOf(l.prototype),"attributeChangedCallback",this).call(this,e,t,r)}},{key:"toggle",value:function(e){var t=this._allHeaders(),r=this._allPanels(),o=t[e],a=r[e];o&&a&&(o.expanded?(this._collapseHeader(o),this._collapsePanel(a)):(this._expandHeader(o),this._expandPanel(a)))}},{key:"expand",value:function(e){var t=this._allHeaders(),r=this._allPanels(),o=t[e],a=r[e];o&&a&&(this._expandHeader(o),this._expandPanel(a))}},{key:"expandAll",value:function(){var t=this,e=this._allHeaders(),r=this._allPanels();e.forEach(function(e){return t._expandHeader(e)}),r.forEach(function(e){return t._expandPanel(e)})}},{key:"collapse",value:function(e){var t=this._allHeaders(),r=this._allPanels(),o=t[e],a=r[e];o&&a&&(this._collapseHeader(o),this._collapsePanel(a))}},{key:"collapseAll",value:function(){var t=this,e=this._allHeaders(),r=this._allPanels();e.forEach(function(e){return t._collapseHeader(e)}),r.forEach(function(e){return t._collapsePanel(e)})}},{key:"_linkPanels",value:function(){var r=this;this._allHeaders().forEach(function(e){var t=r._panelForHeader(e);t&&(e.setAttribute("aria-controls",t.pfeId),t.setAttribute("aria-labelledby",e.pfeId))})}},{key:"_changeHandler",value:function(e){if(!this.classList.contains("animating")){var t=e.target,r=e.target.nextElementSibling;e.detail.expanded?(this._expandHeader(t),this._expandPanel(r)):(this._collapseHeader(t),this._collapsePanel(r))}}},{key:"_toggle",value:function(e,t){}},{key:"_expandHeader",value:function(e){e.expanded=!0}},{key:"_expandPanel",value:function(e){if(e){if(!e.expanded){e.expanded=!0;var t=e.getBoundingClientRect().height;this._animate(e,0,t)}}else console.error(l.tag+": Trying to expand a panel that doesn't exist")}},{key:"_collapseHeader",value:function(e){e.expanded=!1}},{key:"_collapsePanel",value:function(e){if(e){if(e.expanded){var t=e.getBoundingClientRect().height;e.expanded=!1,this._animate(e,t,0)}}else console.error(l.tag+": Trying to collapse a panel that doesn't exist")}},{key:"_animate",value:function(e,t,r){var o=this;if(e){var a=e.previousElementSibling;a&&a.classList.add("animating"),e.classList.add("animating"),e.style.height=t+"px",requestAnimationFrame(function(){requestAnimationFrame(function(){e.style.height=r+"px",e.addEventListener("transitionend",o._transitionEndHandler)})})}}},{key:"_keydownHandler",value:function(e){var t=e.target;if(this._isHeader(t)){var r=void 0;switch(e.key){case"ArrowDown":case"Down":case"ArrowRight":case"Right":r=this._nextHeader();break;case"ArrowUp":case"Up":case"ArrowLeft":case"Left":r=this._previousHeader();break;case"Home":r=this._firstHeader();break;case"End":r=this._lastHeader();break;default:return}r.shadowRoot.querySelector("button").focus()}}},{key:"_transitionEndHandler",value:function(e){var t=e.target.previousElementSibling;t&&t.classList.remove("animating"),e.target.style.height="",e.target.classList.remove("animating"),e.target.removeEventListener("transitionend",this._transitionEndHandler)}},{key:"_allHeaders",value:function(){return[].concat(d(this.querySelectorAll(f.tag)))}},{key:"_allPanels",value:function(){return[].concat(d(this.querySelectorAll(h.tag)))}},{key:"_panelForHeader",value:function(e){var t=e.nextElementSibling;if(t){if(t.tagName.toLowerCase()===h.tag)return t;console.error(l.tag+": Sibling element to a header needs to be a panel")}}},{key:"_previousHeader",value:function(){var e=this._allHeaders(),t=e.findIndex(function(e){return e===document.activeElement})-1;return e[(t+e.length)%e.length]}},{key:"_nextHeader",value:function(){var e=this._allHeaders(),t=e.findIndex(function(e){return e===document.activeElement})+1;return e[t%e.length]}},{key:"_firstHeader",value:function(){return this._allHeaders()[0]}},{key:"_lastHeader",value:function(){var e=this._allHeaders();return e[e.length-1]}},{key:"_isHeader",value:function(e){return e.tagName.toLowerCase()===f.tag}}]),l);function l(){t(this,l);var e=n(this,(l.__proto__||Object.getPrototypeOf(l)).call(this,l,{type:l.PfeType}));return e._linkPanels=e._linkPanels.bind(e),e._observer=new MutationObserver(e._linkPanels),e}var f=(a(p,e),r(p,[{key:"html",get:function(){return'<style>:host{-webkit-transition:-webkit-transform .3s cubic-bezier(.465,.183,.153,.946);transition:-webkit-transform .3s cubic-bezier(.465,.183,.153,.946);transition:transform .3s cubic-bezier(.465,.183,.153,.946);transition:transform .3s cubic-bezier(.465,.183,.153,.946),-webkit-transform .3s cubic-bezier(.465,.183,.153,.946);-webkit-transition:-webkit-transform .3s var(--pfe-theme--animation-timing,cubic-bezier(.465,.183,.153,.946));transition:-webkit-transform .3s var(--pfe-theme--animation-timing,cubic-bezier(.465,.183,.153,.946));transition:transform .3s var(--pfe-theme--animation-timing,cubic-bezier(.465,.183,.153,.946));transition:transform .3s var(--pfe-theme--animation-timing,cubic-bezier(.465,.183,.153,.946)),-webkit-transform .3s var(--pfe-theme--animation-timing,cubic-bezier(.465,.183,.153,.946));display:block}:host>*{margin:0}button{--pfe-accordion--BorderBottomWidth:0;margin:0;width:100%;width:var(--pfe-accordion--Width,100%);max-width:100%;height:auto;position:relative;background-color:transparent;background-color:var(--pfe-accordion--BackgroundColor,transparent);color:var(--pfe-accordion--Color);border-top:1px solid #d2d2d2;border-top:var(--pfe-accordion--BorderTopWidth,var(--pfe-theme--surface--border-width,1px)) var(--pfe-theme--surface--border-style,solid) var(--pfe-accordion--BorderColor,var(--pfe-theme--color--surface--border,#d2d2d2));border-right:1px solid transparent;border-right:var(--pfe-accordion--BorderRightWidth,var(--pfe-theme--surface--border-width,1px)) var(--pfe-theme--surface--border-style,solid) var(--pfe-accordion--BorderColor,transparent);border-bottom:1px solid #d2d2d2;border-bottom:var(--pfe-accordion--BorderBottomWidth,var(--pfe-theme--surface--border-width,1px)) var(--pfe-theme--surface--border-style,solid) var(--pfe-accordion--BorderColor,var(--pfe-theme--color--surface--border,#d2d2d2));border-left:4px solid transparent;border-left:var(--pfe-accordion--BorderLeftWidth,var(--pfe-theme--surface--border-width--heavy,4px)) var(--pfe-theme--surface--border-style,solid) var(--pfe-accordion--BorderColor--accent,transparent);-webkit-box-shadow:var(--pfe-accordion--BoxShadow);box-shadow:var(--pfe-accordion--BoxShadow);cursor:pointer;z-index:1;font-family:inherit;font-size:calc(16px * 1.1);font-size:var(--pfe-accordion--FontSize--header,calc(var(--pfe-theme--font-size,16px) * 1.1));font-weight:700;font-weight:var(--pfe-theme--font-weight--bold,700);text-align:left;text-align:var(--pfe-accordion--TextAlign,left);line-height:1.5;line-height:var(--pfe-theme--line-height,1.5);padding:16px 50px 16px calc(16px * 1.5)!important;padding:var(--pfe-theme--container-spacer,16px) 50px var(--pfe-theme--container-spacer,16px) calc(var(--pfe-theme--container-spacer,16px) * 1.5)!important}button:hover{--pfe-accordion--BorderColor--accent:var(--pfe-accordion--accent)}button:hover{outline:0;z-index:2}button:focus{outline:0;z-index:2;text-decoration:underline}button::-moz-focus-inner{border:0}button[aria-expanded=true]::after{content:"";position:absolute;top:calc((16px * .5) + .4em);top:calc((var(--pfe-theme--container-spacer,16px) * .5) + .4em);display:block;border-style:solid;border-style:var(--pfe-theme--surface--border-style,solid);height:.4em;width:.4em;-webkit-transition:-webkit-transform .15s;transition:-webkit-transform .15s;transition:transform .15s;transition:transform .15s,-webkit-transform .15s;border-width:.1em .1em 0 0;border-bottom:0;-webkit-transform:rotate(-45deg);transform:rotate(-45deg);right:calc(16px * 1.5);right:calc(var(--pfe-theme--container-spacer,16px) * 1.5)}button[aria-expanded=false]::after{content:"";position:absolute;top:calc((16px * .5) + .4em);top:calc((var(--pfe-theme--container-spacer,16px) * .5) + .4em);display:block;border-style:solid;border-style:var(--pfe-theme--surface--border-style,solid);height:.4em;width:.4em;-webkit-transition:-webkit-transform .15s;transition:-webkit-transform .15s;transition:transform .15s;transition:transform .15s,-webkit-transform .15s;border-width:0 .1em .1em 0;-webkit-transform:rotate(45deg);transform:rotate(45deg);right:calc(16px * 1.5);right:calc(var(--pfe-theme--container-spacer,16px) * 1.5)}@supports (-ms-ime-align:auto){button{text-align:left}}@media screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none){button:hover{border-left-color:#0477a4;border-left-color:var(--pfe-theme--color--ui-base,#0477a4)}}:host(:last-of-type) button:not([aria-expanded=true]){--pfe-accordion--BorderBottomWidth:var(--pfe-theme--surface--border-width, 1px)}button[aria-expanded=true]{--pfe-accordion--BorderColor:var(--pfe-theme--color--surface--border, #d2d2d2);--pfe-accordion--BorderRightWidth:var(--pfe-theme--surface--border-width, 1px);--pfe-accordion--BackgroundColor:white;--pfe-accordion--Color:var(--pfe-theme--color--text, #333);--pfe-accordion--BorderColor--accent:var(--pfe-theme--color--ui-base, #0477a4)}@media screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none){button[aria-expanded=true]{border-bottom-width:0;border-left-color:#0477a4;border-left-color:var(--pfe-theme--color--ui-base,#0477a4)}}:host([on=dark]) button[aria-expanded=true]{--pfe-accordion--BorderColor:var(--pfe-theme--color--surface--border, #d2d2d2);--pfe-accordion--BorderRightWidth:var(--pfe-theme--surface--border-width, 1px);--pfe-accordion--BackgroundColor:rgba(247, 247, 249, 0.1);--pfe-accordion--Color:var(--pfe-broadcasted--text, #333);--pfe-accordion--BorderColor--accent:var(--pfe-theme--color--ui-base--on-dark, #78d7fc)}:host([on=saturated]) button[aria-expanded=true]{--pfe-accordion--BorderColor:var(--pfe-theme--color--surface--border, #d2d2d2);--pfe-accordion--BorderRightWidth:var(--pfe-theme--surface--border-width, 1px);--pfe-accordion--BackgroundColor:rgba(0, 0, 0, 0.2);--pfe-accordion--Color:var(--pfe-broadcasted--text, #333);--pfe-accordion--BorderColor--accent:var(--pfe-theme--color--ui-base--on-saturated, #fff)}:host([on=light]) button[aria-expanded=true]{--pfe-broadcasted--text:var(--pfe-theme--color--text, #333);--pfe-broadcasted--link:var(--pfe-theme--color--link, #06c);--pfe-broadcasted--link--hover:var(--pfe-theme--color--link--hover, #003366);--pfe-broadcasted--link--focus:var(--pfe-theme--color--link--focus, #003366);--pfe-broadcasted--link--visited:var(--pfe-theme--color--link--visited, rebeccapurple);--pfe-broadcasted--link-decoration:none;--pfe-broadcasted--link-decoration--hover:underline;--pfe-broadcasted--link-decoration--focus:underline;--pfe-broadcasted--link-decoration--visited:none;--theme:light}\n/*# sourceMappingURL=pfe-accordion-header.min.css.map */\n</style><button type="button" aria-expanded="false" role="tab"></button>'}},{key:"styleUrl",get:function(){return"pfe-accordion-header.scss"}},{key:"templateUrl",get:function(){return"pfe-accordion-header.html"}},{key:"pfeId",get:function(){return this.getAttribute("pfe-id")},set:function(e){e&&this.setAttribute("pfe-id",e)}}],[{key:"version",get:function(){return"1.0.0-prerelease.32"}},{key:"tag",get:function(){return"pfe-accordion-header"}},{key:"observedAttributes",get:function(){return["aria-expanded"]}}]),r(p,[{key:"connectedCallback",value:function(){i(p.prototype.__proto__||Object.getPrototypeOf(p.prototype),"connectedCallback",this).call(this),(this.children.length||this.textContent.trim().length)&&this._init(),this.addEventListener("click",this._clickHandler),this._observer.observe(this,{childList:!0})}},{key:"disconnectedCallback",value:function(){this.removeEventListener("click",this._clickHandler),this._observer.disconnect()}},{key:"_init",value:function(){window.ShadyCSS&&this._observer.disconnect(),this.hasAttribute("role")||this.setAttribute("role","header"),this.pfeId||(this.pfeId=p.tag+"-"+c());var e=this.children[0],t=!1;if(e){switch(e.tagName){case"H1":case"H2":case"H3":case"H4":case"H5":case"H6":t=!0}var r=document.createElement(e.tagName);this.button.innerText=e.innerText,r.appendChild(this.button),this.shadowRoot.appendChild(r)}else this.button.innerText=this.textContent.trim();t||console.warn(p.tag+": The first child in the light DOM must be a Header level tag (h1, h2, h3, h4, h5, or h6)"),window.ShadyCSS&&this._observer.observe(this,{childList:!0})}},{key:"_clickHandler",value:function(e){this.dispatchEvent(new CustomEvent(s.tag+":change",{detail:{expanded:!this.expanded},bubbles:!0}))}},{key:"expanded",get:function(){return this.hasAttribute("aria-expanded")},set:function(e){(e=Boolean(e))?(this.setAttribute("aria-expanded",!0),this.button.setAttribute("aria-expanded",!0)):(this.removeAttribute("aria-expanded"),this.button.setAttribute("aria-expanded",!1))}}]),p);function p(){t(this,p);var e=n(this,(p.__proto__||Object.getPrototypeOf(p)).call(this,p));return e.button=e.shadowRoot.querySelector("button"),e._init=e._init.bind(e),e._clickHandler=e._clickHandler.bind(e),e._observer=new MutationObserver(e._init),e}var h=(a(u,e),r(u,[{key:"html",get:function(){return'<style>.container{position:relative;display:block;width:100%;padding:16px;padding:var(--pfe-theme--container-spacer,16px)}:host{display:none;overflow:hidden;will-change:height;border-color:transparent;opacity:0;margin:0;width:100%;width:var(--pfe-accordion--Width,100%);max-width:100%;height:auto;position:relative;background-color:transparent;background-color:var(--pfe-accordion--BackgroundColor,transparent);color:var(--pfe-accordion--Color);border-top:1px solid #d2d2d2;border-top:var(--pfe-accordion--BorderTopWidth,var(--pfe-theme--surface--border-width,1px)) var(--pfe-theme--surface--border-style,solid) var(--pfe-accordion--BorderColor,var(--pfe-theme--color--surface--border,#d2d2d2));border-right:1px solid transparent;border-right:var(--pfe-accordion--BorderRightWidth,var(--pfe-theme--surface--border-width,1px)) var(--pfe-theme--surface--border-style,solid) var(--pfe-accordion--BorderColor,transparent);border-bottom:1px solid #d2d2d2;border-bottom:var(--pfe-accordion--BorderBottomWidth,var(--pfe-theme--surface--border-width,1px)) var(--pfe-theme--surface--border-style,solid) var(--pfe-accordion--BorderColor,var(--pfe-theme--color--surface--border,#d2d2d2));border-left:4px solid transparent;border-left:var(--pfe-accordion--BorderLeftWidth,var(--pfe-theme--surface--border-width--heavy,4px)) var(--pfe-theme--surface--border-style,solid) var(--pfe-accordion--BorderColor--accent,transparent);-webkit-box-shadow:var(--pfe-accordion--BoxShadow);box-shadow:var(--pfe-accordion--BoxShadow)}:host:hover{--pfe-accordion--BorderColor--accent:var(--pfe-accordion--accent)}:host *,:host ::after,:host ::before{-webkit-box-sizing:border-box;box-sizing:border-box}:host(.animating){display:block;-webkit-transition:height .3s ease-in-out;transition:height .3s ease-in-out}.container{--pfe-accordion--BoxShadow:none;padding-top:0;padding-right:3em;padding-left:calc(16px * 1.5);padding-left:calc(var(--pfe-theme--container-spacer,16px) * 1.5)}:host(:last-of-type[expanded]){margin-bottom:0}:host(.animating),:host([expanded]){--pfe-accordion--BorderColor:var(--pfe-theme--color--surface--border, #d2d2d2);--pfe-accordion--BorderRightWidth:var(--pfe-theme--surface--border-width, 1px);--pfe-accordion--BackgroundColor:white;--pfe-accordion--Color:var(--pfe-theme--color--text, #333);--pfe-accordion--BorderColor--accent:var(--pfe-theme--color--ui-base, #0477a4);--pfe-accordion--BorderTopWidth:0;--pfe-accordion--BoxShadow:0 5px var(--pfe-theme--surface--border-width--heavy, 4px) rgba(140, 140, 140, 0.35);display:block;position:relative;opacity:1}@media screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none){:host(.animating),:host([expanded]){border-top-width:0;border-left-color:#0477a4;border-left-color:var(--pfe-theme--color--ui-base,#0477a4)}}:host([on=dark].animating),:host([on=dark][expanded]){--pfe-accordion--BorderColor:var(--pfe-theme--color--surface--border, #d2d2d2);--pfe-accordion--BorderRightWidth:var(--pfe-theme--surface--border-width, 1px);--pfe-accordion--BackgroundColor:rgba(247, 247, 249, 0.1);--pfe-accordion--Color:var(--pfe-broadcasted--text, #333);--pfe-accordion--BorderColor--accent:var(--pfe-theme--color--ui-base--on-dark, #78d7fc);--pfe-accordion--BorderTopWidth:0;--pfe-accordion--BoxShadow:none}:host([on=saturated].animating),:host([on=saturated][expanded]){--pfe-accordion--BorderColor:var(--pfe-theme--color--surface--border, #d2d2d2);--pfe-accordion--BorderRightWidth:var(--pfe-theme--surface--border-width, 1px);--pfe-accordion--BackgroundColor:rgba(0, 0, 0, 0.2);--pfe-accordion--Color:var(--pfe-broadcasted--text, #333);--pfe-accordion--BorderColor--accent:var(--pfe-theme--color--ui-base--on-saturated, #fff);--pfe-accordion--BorderTopWidth:0;--pfe-accordion--BoxShadow:none}:host([on=light].animating),:host([on=light][expanded]){--pfe-broadcasted--text:var(--pfe-theme--color--text, #333);--pfe-broadcasted--link:var(--pfe-theme--color--link, #06c);--pfe-broadcasted--link--hover:var(--pfe-theme--color--link--hover, #003366);--pfe-broadcasted--link--focus:var(--pfe-theme--color--link--focus, #003366);--pfe-broadcasted--link--visited:var(--pfe-theme--color--link--visited, rebeccapurple);--pfe-broadcasted--link-decoration:none;--pfe-broadcasted--link-decoration--hover:underline;--pfe-broadcasted--link-decoration--focus:underline;--pfe-broadcasted--link-decoration--visited:none;--theme:light;--pfe-accordion--BorderTopWidth:0;--pfe-accordion--BoxShadow:0 5px var(--pfe-theme--surface--border-width--heavy, 4px) rgba(140, 140, 140, 0.35)}\n/*# sourceMappingURL=pfe-accordion-panel.min.css.map */\n</style><div tabindex="-1" role="tabpanel">\n <div class="container">\n <slot></slot>\n </div>\n</div>'}},{key:"styleUrl",get:function(){return"pfe-accordion-panel.scss"}},{key:"templateUrl",get:function(){return"pfe-accordion-panel.html"}},{key:"pfeId",get:function(){return this.getAttribute("pfe-id")},set:function(e){e&&this.setAttribute("pfe-id",e)}}],[{key:"version",get:function(){return"1.0.0-prerelease.32"}},{key:"tag",get:function(){return"pfe-accordion-panel"}}]),r(u,[{key:"connectedCallback",value:function(){i(u.prototype.__proto__||Object.getPrototypeOf(u.prototype),"connectedCallback",this).call(this),this.hasAttribute("role")||this.setAttribute("role","region"),this.pfeId||(this.pfeId=u.tag+"-"+c())}},{key:"expanded",get:function(){return this.hasAttribute("expanded")},set:function(e){Boolean(e)?this.setAttribute("expanded",""):this.removeAttribute("expanded")}}]),u);function u(){return t(this,u),n(this,(u.__proto__||Object.getPrototypeOf(u)).call(this,u))}return e.create(f),e.create(h),e.create(s),s}); | ||
//# sourceMappingURL=pfe-accordion.umd.min.js.map |
@@ -12,3 +12,3 @@ { | ||
}, | ||
"version": "1.0.0-prerelease.31", | ||
"version": "1.0.0-prerelease.32", | ||
"publishConfig": { | ||
@@ -53,3 +53,3 @@ "access": "public" | ||
"dependencies": { | ||
"@patternfly/pfe-sass": "^1.0.0-prerelease.31", | ||
"@patternfly/pfe-sass": "^1.0.0-prerelease.32", | ||
"@patternfly/pfelement": "^1.0.0-prerelease.31" | ||
@@ -61,3 +61,3 @@ }, | ||
}, | ||
"gitHead": "e096af5ec20ebe8d07d42b0a10c0d9ff6f95586e" | ||
"gitHead": "ba0cc500f6e84dd9dadece3df5bf1860690757a7" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet