@patternfly/pfe-accordion
Advanced tools
Comparing version 1.9.1 to 1.9.2
/*! | ||
* PatternFly Elements: PfeAccordion 1.9.1 | ||
* PatternFly Elements: PfeAccordion 1.9.2 | ||
* @license | ||
@@ -32,3 +32,3 @@ * Copyright 2021 Red Hat, Inc. | ||
static get version() { | ||
return "1.9.1"; | ||
return "1.9.2"; | ||
} | ||
@@ -35,0 +35,0 @@ |
/*! | ||
* PatternFly Elements: PfeAccordion 1.9.1 | ||
* PatternFly Elements: PfeAccordion 1.9.2 | ||
* @license | ||
@@ -32,3 +32,3 @@ * Copyright 2021 Red Hat, Inc. | ||
static get version() { | ||
return "1.9.1"; | ||
return "1.9.2"; | ||
} | ||
@@ -35,0 +35,0 @@ |
@@ -50,3 +50,3 @@ import PFElement from '../../pfelement/dist/pfelement.js'; | ||
/*! | ||
* PatternFly Elements: PfeAccordion 1.9.1 | ||
* PatternFly Elements: PfeAccordion 1.9.2 | ||
* @license | ||
@@ -79,3 +79,3 @@ * Copyright 2021 Red Hat, Inc. | ||
static get version() { | ||
return "1.9.1"; | ||
return "1.9.2"; | ||
} | ||
@@ -262,3 +262,3 @@ | ||
/*! | ||
* PatternFly Elements: PfeAccordion 1.9.1 | ||
* PatternFly Elements: PfeAccordion 1.9.2 | ||
* @license | ||
@@ -291,3 +291,3 @@ * Copyright 2021 Red Hat, Inc. | ||
static get version() { | ||
return "1.9.1"; | ||
return "1.9.2"; | ||
} | ||
@@ -358,3 +358,3 @@ | ||
/*! | ||
* PatternFly Elements: PfeAccordion 1.9.1 | ||
* PatternFly Elements: PfeAccordion 1.9.2 | ||
* @license | ||
@@ -387,3 +387,3 @@ * Copyright 2021 Red Hat, Inc. | ||
static get version() { | ||
return "1.9.1"; | ||
return "1.9.2"; | ||
} | ||
@@ -390,0 +390,0 @@ |
import e from"../../pfelement/dist/pfelement.min.js";Array.prototype.findIndex||Object.defineProperty(Array.prototype,"findIndex",{value:function(e){if(null==this)throw new TypeError('"this" is null or not defined');var t=Object(this),r=t.length>>>0;if("function"!=typeof e)throw new TypeError("predicate must be a function");for(var o=arguments[1],a=0;a<r;){var n=t[a];if(e.call(o,n,a,t))return a;a++}return-1}}) | ||
/*! | ||
* PatternFly Elements: PfeAccordion 1.9.1 | ||
* PatternFly Elements: PfeAccordion 1.9.2 | ||
* @license | ||
@@ -25,5 +25,5 @@ * Copyright 2021 Red Hat, Inc. | ||
* | ||
*/;class t extends e{static get version(){return"1.9.1"}get html(){return'\n<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([hidden]){display:none}:host>*{margin:0}:host button{--pfe-accordion--BorderBottomWidth:0;--pfe-accordion--ZIndex:3;--pfe-accordion__trigger--Padding:var(--pfe-accordion__base--Padding, var(--pfe-theme--container-spacer, 1rem)) 50px var(--pfe-accordion__base--Padding, var(--pfe-theme--container-spacer, 1rem)) calc(var(--pfe-accordion__base--Padding, var(--pfe-theme--container-spacer, 1rem)) * 1.5);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:#3c3f42;color:var(--pfe-accordion--Color,var(--pfe-broadcasted--text,#3c3f42));border-width:0;border-style:solid;border-style:var(--pfe-theme--surface--border-style,solid);border-color:#d2d2d2;border-color:var(--pfe-accordion--BorderColor,var(--pfe-theme--color--surface--border,#d2d2d2));border-top-width:1px;border-top-width:var(--pfe-accordion--BorderTopWidth,var(--pfe-theme--surface--border-width,1px));border-right-width:0;border-right-width:var(--pfe-accordion--BorderRightWidth,0);border-bottom-width:1px;border-bottom-width:var(--pfe-accordion--BorderBottomWidth,var(--pfe-theme--surface--border-width,1px));border-left-width:4px;border-left-width:var(--pfe-accordion--BorderLeftWidth,var(--pfe-theme--surface--border-width--heavy,4px));border-left-color:transparent;border-left-color:var(--pfe-accordion--BorderColor--accent,transparent);-webkit-box-shadow:var(--pfe-accordion--BoxShadow);box-shadow:var(--pfe-accordion--BoxShadow);z-index:var(--pfe-accordion--ZIndex);cursor:pointer;font-family:inherit;font-size:calc(1rem * 1.1);font-size:var(--pfe-accordion--FontSize--header,calc(var(--pfe-theme--font-size,1rem) * 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:var(--pfe-accordion__trigger--Padding)}@media screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none){:host button{border-top-width:1px;border-right-width:0;border-bottom-width:1px;border-left-width:4px}}:host button:focus,:host button:hover{--pfe-accordion--BorderColor--accent:var(--pfe-accordion--accent, var(--pfe-theme--color--ui-accent, #06c))}@media screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none){:host button:focus,:host button:hover{border-left-color:#06c}}:host button:hover{outline:0;border-left-width:4px;border-left-width:var(--pfe-theme--surface--border-width--heavy,4px)}:host button:focus{outline:0;text-decoration:underline}:host button::-moz-focus-inner{border:0}@supports (-ms-ime-align:auto){:host button{text-align:left}}@media screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none){:host button{padding:16px 24px;background-color:#fff!important;color:#151515!important}:host button:hover{border-left-color:#06c}}:host 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--BorderLeftWidth:var(--pfe-theme--surface--border-width--heavy, 4px);--pfe-accordion--BackgroundColor:white;--pfe-accordion--Color:var(--pfe-theme--color--text, #151515);--pfe-accordion--BorderColor--accent:var(--pfe-accordion--accent, var(--pfe-theme--color--ui-accent, #06c));--pfe-accordion--BoxShadow:0 5px var(--pfe-theme--surface--border-width--heavy, 4px) rgba(140, 140, 140, 0.35);--pfe-accordion--ZIndex:3}@media screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none){:host button[aria-expanded=true]{border-bottom-width:0;border-left-color:#06c;border-right-color:#d2d2d2}}:host(:not([disclosure=true])) button::after{content:"";position:absolute;top:calc(1rem + .4em);top:calc(var(--pfe-theme--container-spacer,1rem) + .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(1rem * 1.3125);right:calc(var(--pfe-theme--container-spacer,1rem) * 1.3125)}:host(:not([disclosure=true])) button[aria-expanded=true]::after{-webkit-transform:rotate(-135deg);transform:rotate(-135deg)}:host(:last-of-type) button:not([aria-expanded=true]){--pfe-accordion--BorderBottomWidth:var(--pfe-theme--surface--border-width, 1px)}:host(:last-of-type.animating) button{--pfe-accordion--BorderBottomWidth:0}:host([on=dark]) button[aria-expanded=true]{--pfe-accordion--BackgroundColor:rgba(247, 247, 249, 0.1);--pfe-accordion--Color:var(--pfe-broadcasted--text, #3c3f42);--pfe-accordion--BorderColor--accent:var(--pfe-theme--color--ui-accent--on-dark, #73bcf7);--pfe-accordion--BoxShadow:none}:host([on=saturated]) button[aria-expanded=true]{--pfe-accordion--BackgroundColor:rgba(0, 0, 0, 0.2);--pfe-accordion--Color:var(--pfe-broadcasted--text, #3c3f42);--pfe-accordion--BorderColor--accent:var(--pfe-theme--color--ui-accent--on-saturated, #fff);--pfe-accordion--BoxShadow:none}:host([disclosure=true]) button{padding-left:calc(1rem * 3);padding-left:calc(var(--pfe-accordion__base--Padding,var(--pfe-theme--container-spacer,1rem)) * 3)}@media screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none){:host([disclosure=true]) button{padding:16px 24px 16px 47px;border-right-color:#d2d2d2;border-left-color:#d2d2d2;border-left-width:1px}}:host([disclosure=true]) button::before{content:"";position:absolute;top:calc(1rem + .55em);top:calc(var(--pfe-theme--container-spacer,1rem) + .55em);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);left:calc(1rem * 1.3125);left:calc(var(--pfe-theme--container-spacer,1rem) * 1.3125);-webkit-transform:rotate(-45deg);transform:rotate(-45deg)}:host([disclosure=true]) button[aria-expanded=true]::before{-webkit-transform:rotate(45deg);transform:rotate(45deg)}:host([disclosure=true]) button:not([aria-expanded=true]):hover,:host([disclosure=true]) button[aria-expanded=true]{padding-left:calc(1rem * 3 - 4px + 1px);padding-left:calc(var(--pfe-accordion__base--Padding,var(--pfe-theme--container-spacer,1rem)) * 3 - var(--pfe-theme--surface--border-width--heavy,4px) + var(--pfe-theme--surface--border-width,1px))}:host([disclosure=true]) button:not([aria-expanded=true]):hover::before,:host([disclosure=true]) button[aria-expanded=true]::before{margin-left:calc((4px - 1px) * -1);margin-left:calc((var(--pfe-theme--surface--border-width--heavy,4px) - var(--pfe-theme--surface--border-width,1px)) * -1)}@media screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none){:host([disclosure=true]) button:not([aria-expanded=true]):hover,:host([disclosure=true]) button[aria-expanded=true]{border-left-color:#06c;border-left-width:4px;border-right-color:#d2d2d2}} /*# sourceMappingURL=pfe-accordion-header.min.css.map */</style>\n'}static get tag(){return"pfe-accordion-header"}get styleUrl(){return"pfe-accordion-header.scss"}get templateUrl(){return"pfe-accordion-header.html"}static get properties(){return{_id:{type:String,default:e=>""+e.randomId.replace("pfe",e.tag),prefix:!1},ariaControls:{type:String,prefix:!1},oldPfeId:{type:String,alias:"_id",attr:"pfe-id"},expanded:{title:"Expanded",type:Boolean,cascade:"#pfe-accordion-header--button",observer:"_expandedChanged"}}}static get events(){return{change:"pfe-accordion:change"}}constructor(){super(t),this._init=this._init.bind(this),this._clickHandler=this._clickHandler.bind(this),this._observer=new MutationObserver(this._init),this._slotObserver=new MutationObserver(this._init),this._getHeaderElement=this._getHeaderElement.bind(this),this._createButton=this._createButton.bind(this)}connectedCallback(){super.connectedCallback(),this.hasLightDOM()&&this._init(),this.addEventListener("click",this._clickHandler),this._observer.observe(this,{childList:!0})}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("click",this._clickHandler),this._observer.disconnect()}_init(){window.ShadyCSS&&this._observer.disconnect();const e=this.shadowRoot.querySelector(`#${this.tag}--button`),t=e||this._createButton(),r=e?e.parentElement:null,o=this._getHeaderElement();if(o){let e=document.createElement(o.tagName.toLowerCase()||"h3");r&&r.tagName===o.tagName?e=r:r&&r.tagName!==o.tagName&&r.remove(),t.innerText=o.innerText,e.appendChild(t),this.shadowRoot.appendChild(e)}else t.innerText=this.textContent.trim();window.ShadyCSS&&this._observer.observe(this,{childList:!0})}_getHeaderElement(){if(this.firstElementChild||this.firstChild){if(this.firstElementChild&&this.firstElementChild.tagName){if("SLOT"===this.firstElementChild.tagName){const e=this.firstElementChild.assignedNodes();if(0===e.length)return void this.warn("No heading information exists within this slot.");e.length>1&&this.warn("Heading currently only supports 1 tag.");const t=e.filter(e=>e.tagName.match(/^H[1-6]/)||"P"===e.tagName);return t.length>0?(e.forEach(e=>this._slotObserver.observe(e,{characterData:!0,childList:!0,subtree:!0})),t[0]):void 0}if(this.firstElementChild.tagName.match(/^H[1-6]/)||"P"===this.firstElementChild.tagName)return this.firstElementChild;this.warn("Heading should contain at least 1 heading tag for correct semantics.")}}else this.warn("No header content provided")}_createButton(e="false"){const t=document.createElement("button");return t.type="button",t.setAttribute("aria-expanded",e),t.id=this.tag+"--button",t}_clickHandler(e){this.emitEvent(t.events.change,{detail:{expanded:!this.expanded}})}_expandedChanged(){this.setAttribute("aria-expanded",this.expanded);const e=this.shadowRoot.querySelector(`#${this.tag}--button`);e&&e.setAttribute("aria-expanded",this.expanded)}} | ||
*/;class t extends e{static get version(){return"1.9.2"}get html(){return'\n<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([hidden]){display:none}:host>*{margin:0}:host button{--pfe-accordion--BorderBottomWidth:0;--pfe-accordion--ZIndex:3;--pfe-accordion__trigger--Padding:var(--pfe-accordion__base--Padding, var(--pfe-theme--container-spacer, 1rem)) 50px var(--pfe-accordion__base--Padding, var(--pfe-theme--container-spacer, 1rem)) calc(var(--pfe-accordion__base--Padding, var(--pfe-theme--container-spacer, 1rem)) * 1.5);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:#3c3f42;color:var(--pfe-accordion--Color,var(--pfe-broadcasted--text,#3c3f42));border-width:0;border-style:solid;border-style:var(--pfe-theme--surface--border-style,solid);border-color:#d2d2d2;border-color:var(--pfe-accordion--BorderColor,var(--pfe-theme--color--surface--border,#d2d2d2));border-top-width:1px;border-top-width:var(--pfe-accordion--BorderTopWidth,var(--pfe-theme--surface--border-width,1px));border-right-width:0;border-right-width:var(--pfe-accordion--BorderRightWidth,0);border-bottom-width:1px;border-bottom-width:var(--pfe-accordion--BorderBottomWidth,var(--pfe-theme--surface--border-width,1px));border-left-width:4px;border-left-width:var(--pfe-accordion--BorderLeftWidth,var(--pfe-theme--surface--border-width--heavy,4px));border-left-color:transparent;border-left-color:var(--pfe-accordion--BorderColor--accent,transparent);-webkit-box-shadow:var(--pfe-accordion--BoxShadow);box-shadow:var(--pfe-accordion--BoxShadow);z-index:var(--pfe-accordion--ZIndex);cursor:pointer;font-family:inherit;font-size:calc(1rem * 1.1);font-size:var(--pfe-accordion--FontSize--header,calc(var(--pfe-theme--font-size,1rem) * 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:var(--pfe-accordion__trigger--Padding)}@media screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none){:host button{border-top-width:1px;border-right-width:0;border-bottom-width:1px;border-left-width:4px}}:host button:focus,:host button:hover{--pfe-accordion--BorderColor--accent:var(--pfe-accordion--accent, var(--pfe-theme--color--ui-accent, #06c))}@media screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none){:host button:focus,:host button:hover{border-left-color:#06c}}:host button:hover{outline:0;border-left-width:4px;border-left-width:var(--pfe-theme--surface--border-width--heavy,4px)}:host button:focus{outline:0;text-decoration:underline}:host button::-moz-focus-inner{border:0}@supports (-ms-ime-align:auto){:host button{text-align:left}}@media screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none){:host button{padding:16px 24px;background-color:#fff!important;color:#151515!important}:host button:hover{border-left-color:#06c}}:host 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--BorderLeftWidth:var(--pfe-theme--surface--border-width--heavy, 4px);--pfe-accordion--BackgroundColor:white;--pfe-accordion--Color:var(--pfe-theme--color--text, #151515);--pfe-accordion--BorderColor--accent:var(--pfe-accordion--accent, var(--pfe-theme--color--ui-accent, #06c));--pfe-accordion--BoxShadow:0 5px var(--pfe-theme--surface--border-width--heavy, 4px) rgba(140, 140, 140, 0.35);--pfe-accordion--ZIndex:3}@media screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none){:host button[aria-expanded=true]{border-bottom-width:0;border-left-color:#06c;border-right-color:#d2d2d2}}:host(:not([disclosure=true])) button::after{content:"";position:absolute;top:calc(1rem + .4em);top:calc(var(--pfe-theme--container-spacer,1rem) + .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(1rem * 1.3125);right:calc(var(--pfe-theme--container-spacer,1rem) * 1.3125)}:host(:not([disclosure=true])) button[aria-expanded=true]::after{-webkit-transform:rotate(-135deg);transform:rotate(-135deg)}:host(:last-of-type) button:not([aria-expanded=true]){--pfe-accordion--BorderBottomWidth:var(--pfe-theme--surface--border-width, 1px)}:host(:last-of-type.animating) button{--pfe-accordion--BorderBottomWidth:0}:host([on=dark]) button[aria-expanded=true]{--pfe-accordion--BackgroundColor:rgba(247, 247, 249, 0.1);--pfe-accordion--Color:var(--pfe-broadcasted--text, #3c3f42);--pfe-accordion--BorderColor--accent:var(--pfe-theme--color--ui-accent--on-dark, #73bcf7);--pfe-accordion--BoxShadow:none}:host([on=saturated]) button[aria-expanded=true]{--pfe-accordion--BackgroundColor:rgba(0, 0, 0, 0.2);--pfe-accordion--Color:var(--pfe-broadcasted--text, #3c3f42);--pfe-accordion--BorderColor--accent:var(--pfe-theme--color--ui-accent--on-saturated, #fff);--pfe-accordion--BoxShadow:none}:host([disclosure=true]) button{padding-left:calc(1rem * 3);padding-left:calc(var(--pfe-accordion__base--Padding,var(--pfe-theme--container-spacer,1rem)) * 3)}@media screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none){:host([disclosure=true]) button{padding:16px 24px 16px 47px;border-right-color:#d2d2d2;border-left-color:#d2d2d2;border-left-width:1px}}:host([disclosure=true]) button::before{content:"";position:absolute;top:calc(1rem + .55em);top:calc(var(--pfe-theme--container-spacer,1rem) + .55em);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);left:calc(1rem * 1.3125);left:calc(var(--pfe-theme--container-spacer,1rem) * 1.3125);-webkit-transform:rotate(-45deg);transform:rotate(-45deg)}:host([disclosure=true]) button[aria-expanded=true]::before{-webkit-transform:rotate(45deg);transform:rotate(45deg)}:host([disclosure=true]) button:not([aria-expanded=true]):hover,:host([disclosure=true]) button[aria-expanded=true]{padding-left:calc(1rem * 3 - 4px + 1px);padding-left:calc(var(--pfe-accordion__base--Padding,var(--pfe-theme--container-spacer,1rem)) * 3 - var(--pfe-theme--surface--border-width--heavy,4px) + var(--pfe-theme--surface--border-width,1px))}:host([disclosure=true]) button:not([aria-expanded=true]):hover::before,:host([disclosure=true]) button[aria-expanded=true]::before{margin-left:calc((4px - 1px) * -1);margin-left:calc((var(--pfe-theme--surface--border-width--heavy,4px) - var(--pfe-theme--surface--border-width,1px)) * -1)}@media screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none){:host([disclosure=true]) button:not([aria-expanded=true]):hover,:host([disclosure=true]) button[aria-expanded=true]{border-left-color:#06c;border-left-width:4px;border-right-color:#d2d2d2}} /*# sourceMappingURL=pfe-accordion-header.min.css.map */</style>\n'}static get tag(){return"pfe-accordion-header"}get styleUrl(){return"pfe-accordion-header.scss"}get templateUrl(){return"pfe-accordion-header.html"}static get properties(){return{_id:{type:String,default:e=>""+e.randomId.replace("pfe",e.tag),prefix:!1},ariaControls:{type:String,prefix:!1},oldPfeId:{type:String,alias:"_id",attr:"pfe-id"},expanded:{title:"Expanded",type:Boolean,cascade:"#pfe-accordion-header--button",observer:"_expandedChanged"}}}static get events(){return{change:"pfe-accordion:change"}}constructor(){super(t),this._init=this._init.bind(this),this._clickHandler=this._clickHandler.bind(this),this._observer=new MutationObserver(this._init),this._slotObserver=new MutationObserver(this._init),this._getHeaderElement=this._getHeaderElement.bind(this),this._createButton=this._createButton.bind(this)}connectedCallback(){super.connectedCallback(),this.hasLightDOM()&&this._init(),this.addEventListener("click",this._clickHandler),this._observer.observe(this,{childList:!0})}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("click",this._clickHandler),this._observer.disconnect()}_init(){window.ShadyCSS&&this._observer.disconnect();const e=this.shadowRoot.querySelector(`#${this.tag}--button`),t=e||this._createButton(),r=e?e.parentElement:null,o=this._getHeaderElement();if(o){let e=document.createElement(o.tagName.toLowerCase()||"h3");r&&r.tagName===o.tagName?e=r:r&&r.tagName!==o.tagName&&r.remove(),t.innerText=o.innerText,e.appendChild(t),this.shadowRoot.appendChild(e)}else t.innerText=this.textContent.trim();window.ShadyCSS&&this._observer.observe(this,{childList:!0})}_getHeaderElement(){if(this.firstElementChild||this.firstChild){if(this.firstElementChild&&this.firstElementChild.tagName){if("SLOT"===this.firstElementChild.tagName){const e=this.firstElementChild.assignedNodes();if(0===e.length)return void this.warn("No heading information exists within this slot.");e.length>1&&this.warn("Heading currently only supports 1 tag.");const t=e.filter(e=>e.tagName.match(/^H[1-6]/)||"P"===e.tagName);return t.length>0?(e.forEach(e=>this._slotObserver.observe(e,{characterData:!0,childList:!0,subtree:!0})),t[0]):void 0}if(this.firstElementChild.tagName.match(/^H[1-6]/)||"P"===this.firstElementChild.tagName)return this.firstElementChild;this.warn("Heading should contain at least 1 heading tag for correct semantics.")}}else this.warn("No header content provided")}_createButton(e="false"){const t=document.createElement("button");return t.type="button",t.setAttribute("aria-expanded",e),t.id=this.tag+"--button",t}_clickHandler(e){this.emitEvent(t.events.change,{detail:{expanded:!this.expanded}})}_expandedChanged(){this.setAttribute("aria-expanded",this.expanded);const e=this.shadowRoot.querySelector(`#${this.tag}--button`);e&&e.setAttribute("aria-expanded",this.expanded)}} | ||
/*! | ||
* PatternFly Elements: PfeAccordion 1.9.1 | ||
* PatternFly Elements: PfeAccordion 1.9.2 | ||
* @license | ||
@@ -50,5 +50,5 @@ * Copyright 2021 Red Hat, Inc. | ||
* | ||
*/class r extends e{static get version(){return"1.9.1"}get html(){return'\n<style>.container{position:relative;display:block;width:100%;padding:1rem;padding:var(--pfe-theme--container-spacer,1rem)}: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:#3c3f42;color:var(--pfe-accordion--Color,var(--pfe-broadcasted--text,#3c3f42));border-width:0;border-style:solid;border-style:var(--pfe-theme--surface--border-style,solid);border-color:#d2d2d2;border-color:var(--pfe-accordion--BorderColor,var(--pfe-theme--color--surface--border,#d2d2d2));border-top-width:1px;border-top-width:var(--pfe-accordion--BorderTopWidth,var(--pfe-theme--surface--border-width,1px));border-right-width:0;border-right-width:var(--pfe-accordion--BorderRightWidth,0);border-bottom-width:1px;border-bottom-width:var(--pfe-accordion--BorderBottomWidth,var(--pfe-theme--surface--border-width,1px));border-left-width:4px;border-left-width:var(--pfe-accordion--BorderLeftWidth,var(--pfe-theme--surface--border-width--heavy,4px));border-left-color:transparent;border-left-color:var(--pfe-accordion--BorderColor--accent,transparent);-webkit-box-shadow:var(--pfe-accordion--BoxShadow);box-shadow:var(--pfe-accordion--BoxShadow);z-index:var(--pfe-accordion--ZIndex);-webkit-box-sizing:border-box;box-sizing:border-box}@media screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none){:host{border-top-width:1px;border-right-width:0;border-bottom-width:1px;border-left-width:4px}}:host:focus,:host:hover{--pfe-accordion--BorderColor--accent:var(--pfe-accordion--accent, var(--pfe-theme--color--ui-accent, #06c))}@media screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none){:host:focus,:host:hover{border-left-color:#06c}}:host *,:host ::after,:host ::before{-webkit-box-sizing:border-box;box-sizing:border-box}@media screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none){:host{background-color:#fff!important;color:#151515!important}}:host(.animating){display:block;-webkit-transition:height .3s ease-in-out;transition:height .3s ease-in-out}.container{--pfe-accordion--BoxShadow:none;padding:var(--pfe-accordion__panel-container--Padding);padding:0 calc(1rem * 3) 1rem calc(1rem * 1.5);padding:var(--pfe-accordion__panel-container--Padding,0 var(--pfe-accordion__panel--Padding,calc(var(--pfe-accordion__base--Padding,var(--pfe-theme--container-spacer,1rem)) * 3)) var(--pfe-accordion__base--Padding,var(--pfe-theme--container-spacer,1rem)) var(--pfe-accordion__panel--Padding,calc(var(--pfe-accordion__base--Padding,var(--pfe-theme--container-spacer,1rem)) * 1.5)))}.container::after{clear:both;content:"";display:table}:host([disclosure=true]) .container{padding:0 calc(1rem * 3) calc(1rem) calc(1rem * 1.5);padding:var(--pfe-accordion__panel-container--Padding,0 calc(var(--pfe-accordion__base--Padding,var(--pfe-theme--container-spacer,1rem)) * 3) calc(var(--pfe-accordion__base--Padding,var(--pfe-theme--container-spacer,1rem))) calc(var(--pfe-accordion__base--Padding,var(--pfe-theme--container-spacer,1rem)) * 1.5))}pfe-jump-links-nav .container{padding:0;padding:var(--pfe-accordion__panel-container--Padding,0);--pfe-accordion__panel-container--Padding:0}@media (max-width:767px){pfe-jump-links-nav .container{padding:0;padding:var(--pfe-accordion__panel-container--Padding,0)}}: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--BorderLeftWidth:var(--pfe-theme--surface--border-width--heavy, 4px);--pfe-accordion--BackgroundColor:white;--pfe-accordion--Color:var(--pfe-theme--color--text, #151515);--pfe-accordion--BorderColor--accent:var(--pfe-accordion--accent, var(--pfe-theme--color--ui-accent, #06c));--pfe-accordion--BoxShadow:0 5px var(--pfe-theme--surface--border-width--heavy, 4px) rgba(140, 140, 140, 0.35);--pfe-accordion--ZIndex:3;--pfe-accordion--accent:var(--pfe-theme--color--ui-accent, #06c);--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:#06c;border-left-color:var(--pfe-theme--color--ui-accent,#06c);border-right-color:#d2d2d2;border-right-color:var(--pfe-theme--color--surface--border,#d2d2d2)}}:host([on=dark].animating),:host([on=dark][expanded]){--pfe-accordion--BackgroundColor:rgba(247, 247, 249, 0.1);--pfe-accordion--Color:var(--pfe-broadcasted--text, #3c3f42);--pfe-accordion--BorderColor--accent:var(--pfe-theme--color--ui-accent--on-dark, #73bcf7);--pfe-accordion--BoxShadow:none;--pfe-accordion--accent:var(--pfe-theme--color--ui-accent, #06c);--pfe-accordion--BorderTopWidth:0;--pfe-accordion--BoxShadow:none}:host([on=saturated].animating),:host([on=saturated][expanded]){--pfe-accordion--BackgroundColor:rgba(0, 0, 0, 0.2);--pfe-accordion--Color:var(--pfe-broadcasted--text, #3c3f42);--pfe-accordion--BorderColor--accent:var(--pfe-theme--color--ui-accent--on-saturated, #fff);--pfe-accordion--BoxShadow:none;--pfe-accordion--accent:var(--pfe-theme--color--ui-accent, #06c);--pfe-accordion--BorderTopWidth:0;--pfe-accordion--BoxShadow:none} /*# sourceMappingURL=pfe-accordion-panel.min.css.map */</style>\n<div tabindex="-1">\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"}static get properties(){return{_id:{type:String,default:e=>""+e.randomId.replace("pfe",e.tag),prefix:!1},role:{type:String,default:"region",prefix:!1},oldPfeId:{type:String,alias:"_id",attr:"pfe-id"},expanded:{title:"Expanded",type:Boolean,default:!1},ariaLabelledby:{type:String,prefix:!1}}}constructor(){super(r)}connectedCallback(){super.connectedCallback()}} | ||
*/class r extends e{static get version(){return"1.9.2"}get html(){return'\n<style>.container{position:relative;display:block;width:100%;padding:1rem;padding:var(--pfe-theme--container-spacer,1rem)}: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:#3c3f42;color:var(--pfe-accordion--Color,var(--pfe-broadcasted--text,#3c3f42));border-width:0;border-style:solid;border-style:var(--pfe-theme--surface--border-style,solid);border-color:#d2d2d2;border-color:var(--pfe-accordion--BorderColor,var(--pfe-theme--color--surface--border,#d2d2d2));border-top-width:1px;border-top-width:var(--pfe-accordion--BorderTopWidth,var(--pfe-theme--surface--border-width,1px));border-right-width:0;border-right-width:var(--pfe-accordion--BorderRightWidth,0);border-bottom-width:1px;border-bottom-width:var(--pfe-accordion--BorderBottomWidth,var(--pfe-theme--surface--border-width,1px));border-left-width:4px;border-left-width:var(--pfe-accordion--BorderLeftWidth,var(--pfe-theme--surface--border-width--heavy,4px));border-left-color:transparent;border-left-color:var(--pfe-accordion--BorderColor--accent,transparent);-webkit-box-shadow:var(--pfe-accordion--BoxShadow);box-shadow:var(--pfe-accordion--BoxShadow);z-index:var(--pfe-accordion--ZIndex);-webkit-box-sizing:border-box;box-sizing:border-box}@media screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none){:host{border-top-width:1px;border-right-width:0;border-bottom-width:1px;border-left-width:4px}}:host:focus,:host:hover{--pfe-accordion--BorderColor--accent:var(--pfe-accordion--accent, var(--pfe-theme--color--ui-accent, #06c))}@media screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none){:host:focus,:host:hover{border-left-color:#06c}}:host *,:host ::after,:host ::before{-webkit-box-sizing:border-box;box-sizing:border-box}@media screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none){:host{background-color:#fff!important;color:#151515!important}}:host(.animating){display:block;-webkit-transition:height .3s ease-in-out;transition:height .3s ease-in-out}.container{--pfe-accordion--BoxShadow:none;padding:var(--pfe-accordion__panel-container--Padding);padding:0 calc(1rem * 3) 1rem calc(1rem * 1.5);padding:var(--pfe-accordion__panel-container--Padding,0 var(--pfe-accordion__panel--Padding,calc(var(--pfe-accordion__base--Padding,var(--pfe-theme--container-spacer,1rem)) * 3)) var(--pfe-accordion__base--Padding,var(--pfe-theme--container-spacer,1rem)) var(--pfe-accordion__panel--Padding,calc(var(--pfe-accordion__base--Padding,var(--pfe-theme--container-spacer,1rem)) * 1.5)))}.container::after{clear:both;content:"";display:table}:host([disclosure=true]) .container{padding:0 calc(1rem * 3) calc(1rem) calc(1rem * 1.5);padding:var(--pfe-accordion__panel-container--Padding,0 calc(var(--pfe-accordion__base--Padding,var(--pfe-theme--container-spacer,1rem)) * 3) calc(var(--pfe-accordion__base--Padding,var(--pfe-theme--container-spacer,1rem))) calc(var(--pfe-accordion__base--Padding,var(--pfe-theme--container-spacer,1rem)) * 1.5))}pfe-jump-links-nav .container{padding:0;padding:var(--pfe-accordion__panel-container--Padding,0);--pfe-accordion__panel-container--Padding:0}@media (max-width:767px){pfe-jump-links-nav .container{padding:0;padding:var(--pfe-accordion__panel-container--Padding,0)}}: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--BorderLeftWidth:var(--pfe-theme--surface--border-width--heavy, 4px);--pfe-accordion--BackgroundColor:white;--pfe-accordion--Color:var(--pfe-theme--color--text, #151515);--pfe-accordion--BorderColor--accent:var(--pfe-accordion--accent, var(--pfe-theme--color--ui-accent, #06c));--pfe-accordion--BoxShadow:0 5px var(--pfe-theme--surface--border-width--heavy, 4px) rgba(140, 140, 140, 0.35);--pfe-accordion--ZIndex:3;--pfe-accordion--accent:var(--pfe-theme--color--ui-accent, #06c);--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:#06c;border-left-color:var(--pfe-theme--color--ui-accent,#06c);border-right-color:#d2d2d2;border-right-color:var(--pfe-theme--color--surface--border,#d2d2d2)}}:host([on=dark].animating),:host([on=dark][expanded]){--pfe-accordion--BackgroundColor:rgba(247, 247, 249, 0.1);--pfe-accordion--Color:var(--pfe-broadcasted--text, #3c3f42);--pfe-accordion--BorderColor--accent:var(--pfe-theme--color--ui-accent--on-dark, #73bcf7);--pfe-accordion--BoxShadow:none;--pfe-accordion--accent:var(--pfe-theme--color--ui-accent, #06c);--pfe-accordion--BorderTopWidth:0;--pfe-accordion--BoxShadow:none}:host([on=saturated].animating),:host([on=saturated][expanded]){--pfe-accordion--BackgroundColor:rgba(0, 0, 0, 0.2);--pfe-accordion--Color:var(--pfe-broadcasted--text, #3c3f42);--pfe-accordion--BorderColor--accent:var(--pfe-theme--color--ui-accent--on-saturated, #fff);--pfe-accordion--BoxShadow:none;--pfe-accordion--accent:var(--pfe-theme--color--ui-accent, #06c);--pfe-accordion--BorderTopWidth:0;--pfe-accordion--BoxShadow:none} /*# sourceMappingURL=pfe-accordion-panel.min.css.map */</style>\n<div tabindex="-1">\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"}static get properties(){return{_id:{type:String,default:e=>""+e.randomId.replace("pfe",e.tag),prefix:!1},role:{type:String,default:"region",prefix:!1},oldPfeId:{type:String,alias:"_id",attr:"pfe-id"},expanded:{title:"Expanded",type:Boolean,default:!1},ariaLabelledby:{type:String,prefix:!1}}}constructor(){super(r)}connectedCallback(){super.connectedCallback()}} | ||
/*! | ||
* PatternFly Elements: PfeAccordion 1.9.1 | ||
* PatternFly Elements: PfeAccordion 1.9.2 | ||
* @license | ||
@@ -75,3 +75,3 @@ * Copyright 2021 Red Hat, Inc. | ||
* | ||
*/class o extends e{static get version(){return"1.9.1"}get html(){return"\n<style>: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--BorderLeftWidth:var(--pfe-theme--surface--border-width--heavy, 4px);--pfe-accordion--Color:var(--pfe-broadcasted--text, #3c3f42);--pfe-accordion--TextAlign:left;--pfe-accordion--accent:var(--pfe-theme--color--ui-accent, #06c);--pfe-accordion__base--Padding:var(--pfe-theme--container-spacer, 1rem);display:block;position:relative;overflow:hidden;margin:0;color:#3c3f42;color:var(--pfe-accordion--Color,var(--pfe-broadcasted--text,#3c3f42))}@media screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none){:host{background-color:#fff!important;color:#151515!important}}:host([on=dark]){--pfe-accordion--accent:var(--pfe-theme--color--ui-accent--on-dark, #73bcf7)}:host([on=saturated]){--pfe-accordion--accent:var(--pfe-theme--color--ui-accent--on-saturated, #fff)}:host([disclosure=true]){--pfe-accordion--BorderRightWidth:var(--pfe-theme--surface--border-width, 1px);--pfe-accordion--BorderLeftWidth:var(--pfe-theme--surface--border-width, 1px);--pfe-accordion--BorderColor--accent:var(--pfe-theme--color--surface--border, #d2d2d2)}:host([hidden]){display:none} /*# sourceMappingURL=pfe-accordion.min.css.map */</style>\n<slot></slot>"}static get tag(){return"pfe-accordion"}static get meta(){return{title:"Accordion",description:"This element renders content sets in an expandable format."}}get styleUrl(){return"pfe-accordion.scss"}get templateUrl(){return"pfe-accordion.html"}static get properties(){return{disclosure:{title:"Disclosure",type:String,values:["true","false"],cascade:["pfe-accordion-header","pfe-accordion-panel"]},oldDisclosure:{type:String,alias:"disclosure",attr:"pfe-disclosure"},expandedIndex:{title:"Expanded index(es)",type:String,observer:"_expandedIndexHandler"},history:{title:"History",type:Boolean,default:!1,observer:"_historyHandler"}}}static get slots(){return{default:{type:"array",namedSlot:!1,items:{oneOf:[{$ref:"pfe-accordion-header"},{$ref:"pfe-accordion-panel"}]}}}}static get events(){return{change:this.tag+":change",expand:this.tag+":expand",collapse:this.tag+":collapse"}}static get PfeType(){return e.PfeTypes.Container}static get contentTemplate(){return'\n <pfe-accordion-header content-type="header"></pfe-accordion-header>\n <pfe-accordion-panel content-type="panel"></pfe-accordion-panel>\n '}constructor(){super(o,{type:o.PfeType}),this._manualDisclosure=null,this._updateHistory=!0,this.expanded=[],this._init=this._init.bind(this),this._observer=new MutationObserver(this._init),this._updateStateFromURL=this._updateStateFromURL.bind(this),this._getIndexesFromURL=this._getIndexesFromURL.bind(this),this._updateURLHistory=this._updateURLHistory.bind(this)}connectedCallback(){super.connectedCallback(),this.hasLightDOM()&&(this._manualDisclosure=this.getAttribute("disclosure")||this.getAttribute("pfe-disclosure"),Promise.all([customElements.whenDefined(t.tag),customElements.whenDefined(r.tag)]).then(this._init)),this.addEventListener(o.events.change,this._changeHandler),this.addEventListener("keydown",this._keydownHandler),this._observer.observe(this,{childList:!0})}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(o.events.change,this._changeHandler),this.removeEventListener("keydown",this._keydownHandler),this._observer.disconnect(),window.removeEventListener("popstate",this._updateStateFromURL)}toggle(e){this._allHeaders()[e].expanded?this.collapse(e):this.expand(e)}expand(e){if(null==e)return;const t=parseInt(e,10),r=this._allHeaders()[t];if(!r)return;const a=this._panelForHeader(r);r&&a&&(this._expandHeader(r),this._expandPanel(a),r.focus(),this.emitEvent(o.events.expand))}expandAll(){const e=this._allHeaders(),t=this._allPanels();e.forEach(e=>this._expandHeader(e)),t.forEach(e=>this._expandPanel(e))}collapse(e){const t=this._allHeaders(),r=this._allPanels(),a=t[e],n=r[e];a&&n&&(this._collapseHeader(a),this._collapsePanel(n),this.emitEvent(o.events.collapse))}collapseAll(){const e=this._allHeaders(),t=this._allPanels();e.forEach(e=>this._collapseHeader(e)),t.forEach(e=>this._collapsePanel(e))}_init(){const e=this._allHeaders();e.forEach(e=>{const t=this._panelForHeader(e);t&&(e.ariaControls=t._id,t.ariaLabelledby=e._id)}),this._manualDisclosure||(1===e.length?this.disclosure="true":e.length>1&&(this.disclosure="false")),this.isIE11||this._updateStateFromURL()}_changeHandler(e){if(this.classList.contains("animating"))return;const t=this._getIndex(e.target);e.detail.expanded?this.expand(t):this.collapse(t),this._updateURLHistory()}_historyHandler(){this.history?window.addEventListener("popstate",this._updateStateFromURL):window.removeEventListener("popstate",this._updateStateFromURL)}_expandHeader(e){const t=this._getIndex(e);this.expanded.indexOf(t)<0&&t>-1&&this.expanded.push(t),e.expanded=!0}_expandPanel(e){if(!e)return void this.error("Trying to expand a panel that doesn't exist.");if(e.expanded)return;e.expanded=!0;const t=e.getBoundingClientRect().height;this._animate(e,0,t)}_collapseHeader(e){const t=this._getIndex(e);let r=this.expanded.indexOf(t);r>=0&&this.expanded.splice(r,1),e.expanded=!1}_collapsePanel(e){if(!e)return void this.error("Trying to collapse a panel that doesn't exist");if(!e.expanded)return;const t=e.getBoundingClientRect().height;e.expanded=!1,this._animate(e,t,0)}_animate(e,t,r){if(e){const o=e.previousElementSibling;o&&o.classList.add("animating"),e.classList.add("animating"),e.style.height=t+"px",requestAnimationFrame(()=>{requestAnimationFrame(()=>{e.style.height=r+"px",e.addEventListener("transitionend",this._transitionEndHandler)})})}}_keydownHandler(e){const t=e.target;if(!this._isHeader(t))return;let r;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}if(r){r.shadowRoot.querySelector("button").focus();const e=this._getIndex(r);this.expand(e),this._setFocus=!0}}_transitionEndHandler(e){const t=e.target.previousElementSibling;t&&t.classList.remove("animating"),e.target.style.height="",e.target.classList.remove("animating"),e.target.removeEventListener("transitionend",this._transitionEndHandler)}_allHeaders(){return this.isIE11?this.children.filter(e=>"pfe-accordion-header"===e.tagName.toLowerCase()):[...this.querySelectorAll(":scope > pfe-accordion-header")]}_allPanels(){return this.isIE11?this.children.filter(e=>"pfe-accordion-panel"===e.tagName.toLowerCase()):[...this.querySelectorAll(":scope > pfe-accordion-panel")]}_panelForHeader(e){const t=e.nextElementSibling;if(t){if(t.tagName.toLowerCase()===r.tag)return t;this.error("Sibling element to a header needs to be a panel")}}_previousHeader(){const e=this._allHeaders();let t=e.findIndex(e=>e===document.activeElement)-1;return e[(t+e.length)%e.length]}_nextHeader(){const e=this._allHeaders();let t=e.findIndex(e=>e===document.activeElement)+1;return e[t%e.length]}_firstHeader(){return this._allHeaders()[0]}_lastHeader(){const e=this._allHeaders();return e[e.length-1]}_isHeader(e){return e.tagName.toLowerCase()===t.tag}_isPanel(e){return e.tagName.toLowerCase()===r.tag}_expandedIndexHandler(e,t){if(e===t)return;t.split(",").map(e=>parseInt(e,10)-1).reverse().map(e=>this.expand(e))}_getIndex(e){if(this._isHeader(e)){return this._allHeaders().findIndex(t=>t.id===e.id)}if(this._isPanel(e)){return this._allPanels().findIndex(t=>t.id===e.id)}return this.warn("The _getIndex method expects to receive a header or panel element."),-1}_getIndexesFromURL(){if(!window.URLSearchParams)return[];const e=new URLSearchParams(window.location.search);if(e&&e.has(this.id)){const t=e.get(this.id).split("-");return t.length<0?[]:t.map(e=>parseInt(e.trim(),10)-1)}}_updateURLHistory(){if(!this.history||!this._updateHistory||!window.URLSearchParams)return;if(!this.id)return void this.error("The history feature cannot update the URL without an ID added to the pfe-accordion tag.");const e=new URLSearchParams(window.location.search),t=this.expanded.map(e=>e+1).sort((e,t)=>e-t).join("-");this.expanded.length>0?e.set(this.id,t):e.delete(this.id),history.replaceState({},"",`${window.location.pathname}${e?"?"+e.toString():""}${window.location.hash}`)}_updateStateFromURL(){const e=this._getIndexesFromURL()||[];this._updateHistory=!1,e.forEach(e=>this.expand(e)),this._updateHistory=!0}}e.create(t),e.create(r),e.create(o);export default o; | ||
*/class o extends e{static get version(){return"1.9.2"}get html(){return"\n<style>: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--BorderLeftWidth:var(--pfe-theme--surface--border-width--heavy, 4px);--pfe-accordion--Color:var(--pfe-broadcasted--text, #3c3f42);--pfe-accordion--TextAlign:left;--pfe-accordion--accent:var(--pfe-theme--color--ui-accent, #06c);--pfe-accordion__base--Padding:var(--pfe-theme--container-spacer, 1rem);display:block;position:relative;overflow:hidden;margin:0;color:#3c3f42;color:var(--pfe-accordion--Color,var(--pfe-broadcasted--text,#3c3f42))}@media screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none){:host{background-color:#fff!important;color:#151515!important}}:host([on=dark]){--pfe-accordion--accent:var(--pfe-theme--color--ui-accent--on-dark, #73bcf7)}:host([on=saturated]){--pfe-accordion--accent:var(--pfe-theme--color--ui-accent--on-saturated, #fff)}:host([disclosure=true]){--pfe-accordion--BorderRightWidth:var(--pfe-theme--surface--border-width, 1px);--pfe-accordion--BorderLeftWidth:var(--pfe-theme--surface--border-width, 1px);--pfe-accordion--BorderColor--accent:var(--pfe-theme--color--surface--border, #d2d2d2)}:host([hidden]){display:none} /*# sourceMappingURL=pfe-accordion.min.css.map */</style>\n<slot></slot>"}static get tag(){return"pfe-accordion"}static get meta(){return{title:"Accordion",description:"This element renders content sets in an expandable format."}}get styleUrl(){return"pfe-accordion.scss"}get templateUrl(){return"pfe-accordion.html"}static get properties(){return{disclosure:{title:"Disclosure",type:String,values:["true","false"],cascade:["pfe-accordion-header","pfe-accordion-panel"]},oldDisclosure:{type:String,alias:"disclosure",attr:"pfe-disclosure"},expandedIndex:{title:"Expanded index(es)",type:String,observer:"_expandedIndexHandler"},history:{title:"History",type:Boolean,default:!1,observer:"_historyHandler"}}}static get slots(){return{default:{type:"array",namedSlot:!1,items:{oneOf:[{$ref:"pfe-accordion-header"},{$ref:"pfe-accordion-panel"}]}}}}static get events(){return{change:this.tag+":change",expand:this.tag+":expand",collapse:this.tag+":collapse"}}static get PfeType(){return e.PfeTypes.Container}static get contentTemplate(){return'\n <pfe-accordion-header content-type="header"></pfe-accordion-header>\n <pfe-accordion-panel content-type="panel"></pfe-accordion-panel>\n '}constructor(){super(o,{type:o.PfeType}),this._manualDisclosure=null,this._updateHistory=!0,this.expanded=[],this._init=this._init.bind(this),this._observer=new MutationObserver(this._init),this._updateStateFromURL=this._updateStateFromURL.bind(this),this._getIndexesFromURL=this._getIndexesFromURL.bind(this),this._updateURLHistory=this._updateURLHistory.bind(this)}connectedCallback(){super.connectedCallback(),this.hasLightDOM()&&(this._manualDisclosure=this.getAttribute("disclosure")||this.getAttribute("pfe-disclosure"),Promise.all([customElements.whenDefined(t.tag),customElements.whenDefined(r.tag)]).then(this._init)),this.addEventListener(o.events.change,this._changeHandler),this.addEventListener("keydown",this._keydownHandler),this._observer.observe(this,{childList:!0})}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(o.events.change,this._changeHandler),this.removeEventListener("keydown",this._keydownHandler),this._observer.disconnect(),window.removeEventListener("popstate",this._updateStateFromURL)}toggle(e){this._allHeaders()[e].expanded?this.collapse(e):this.expand(e)}expand(e){if(null==e)return;const t=parseInt(e,10),r=this._allHeaders()[t];if(!r)return;const a=this._panelForHeader(r);r&&a&&(this._expandHeader(r),this._expandPanel(a),r.focus(),this.emitEvent(o.events.expand))}expandAll(){const e=this._allHeaders(),t=this._allPanels();e.forEach(e=>this._expandHeader(e)),t.forEach(e=>this._expandPanel(e))}collapse(e){const t=this._allHeaders(),r=this._allPanels(),a=t[e],n=r[e];a&&n&&(this._collapseHeader(a),this._collapsePanel(n),this.emitEvent(o.events.collapse))}collapseAll(){const e=this._allHeaders(),t=this._allPanels();e.forEach(e=>this._collapseHeader(e)),t.forEach(e=>this._collapsePanel(e))}_init(){const e=this._allHeaders();e.forEach(e=>{const t=this._panelForHeader(e);t&&(e.ariaControls=t._id,t.ariaLabelledby=e._id)}),this._manualDisclosure||(1===e.length?this.disclosure="true":e.length>1&&(this.disclosure="false")),this.isIE11||this._updateStateFromURL()}_changeHandler(e){if(this.classList.contains("animating"))return;const t=this._getIndex(e.target);e.detail.expanded?this.expand(t):this.collapse(t),this._updateURLHistory()}_historyHandler(){this.history?window.addEventListener("popstate",this._updateStateFromURL):window.removeEventListener("popstate",this._updateStateFromURL)}_expandHeader(e){const t=this._getIndex(e);this.expanded.indexOf(t)<0&&t>-1&&this.expanded.push(t),e.expanded=!0}_expandPanel(e){if(!e)return void this.error("Trying to expand a panel that doesn't exist.");if(e.expanded)return;e.expanded=!0;const t=e.getBoundingClientRect().height;this._animate(e,0,t)}_collapseHeader(e){const t=this._getIndex(e);let r=this.expanded.indexOf(t);r>=0&&this.expanded.splice(r,1),e.expanded=!1}_collapsePanel(e){if(!e)return void this.error("Trying to collapse a panel that doesn't exist");if(!e.expanded)return;const t=e.getBoundingClientRect().height;e.expanded=!1,this._animate(e,t,0)}_animate(e,t,r){if(e){const o=e.previousElementSibling;o&&o.classList.add("animating"),e.classList.add("animating"),e.style.height=t+"px",requestAnimationFrame(()=>{requestAnimationFrame(()=>{e.style.height=r+"px",e.addEventListener("transitionend",this._transitionEndHandler)})})}}_keydownHandler(e){const t=e.target;if(!this._isHeader(t))return;let r;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}if(r){r.shadowRoot.querySelector("button").focus();const e=this._getIndex(r);this.expand(e),this._setFocus=!0}}_transitionEndHandler(e){const t=e.target.previousElementSibling;t&&t.classList.remove("animating"),e.target.style.height="",e.target.classList.remove("animating"),e.target.removeEventListener("transitionend",this._transitionEndHandler)}_allHeaders(){return this.isIE11?this.children.filter(e=>"pfe-accordion-header"===e.tagName.toLowerCase()):[...this.querySelectorAll(":scope > pfe-accordion-header")]}_allPanels(){return this.isIE11?this.children.filter(e=>"pfe-accordion-panel"===e.tagName.toLowerCase()):[...this.querySelectorAll(":scope > pfe-accordion-panel")]}_panelForHeader(e){const t=e.nextElementSibling;if(t){if(t.tagName.toLowerCase()===r.tag)return t;this.error("Sibling element to a header needs to be a panel")}}_previousHeader(){const e=this._allHeaders();let t=e.findIndex(e=>e===document.activeElement)-1;return e[(t+e.length)%e.length]}_nextHeader(){const e=this._allHeaders();let t=e.findIndex(e=>e===document.activeElement)+1;return e[t%e.length]}_firstHeader(){return this._allHeaders()[0]}_lastHeader(){const e=this._allHeaders();return e[e.length-1]}_isHeader(e){return e.tagName.toLowerCase()===t.tag}_isPanel(e){return e.tagName.toLowerCase()===r.tag}_expandedIndexHandler(e,t){if(e===t)return;t.split(",").map(e=>parseInt(e,10)-1).reverse().map(e=>this.expand(e))}_getIndex(e){if(this._isHeader(e)){return this._allHeaders().findIndex(t=>t.id===e.id)}if(this._isPanel(e)){return this._allPanels().findIndex(t=>t.id===e.id)}return this.warn("The _getIndex method expects to receive a header or panel element."),-1}_getIndexesFromURL(){if(!window.URLSearchParams)return[];const e=new URLSearchParams(window.location.search);if(e&&e.has(this.id)){const t=e.get(this.id).split("-");return t.length<0?[]:t.map(e=>parseInt(e.trim(),10)-1)}}_updateURLHistory(){if(!this.history||!this._updateHistory||!window.URLSearchParams)return;if(!this.id)return void this.error("The history feature cannot update the URL without an ID added to the pfe-accordion tag.");const e=new URLSearchParams(window.location.search),t=this.expanded.map(e=>e+1).sort((e,t)=>e-t).join("-");this.expanded.length>0?e.set(this.id,t):e.delete(this.id),history.replaceState({},"",`${window.location.pathname}${e?"?"+e.toString():""}${window.location.hash}`)}_updateStateFromURL(){const e=this._getIndexesFromURL()||[];this._updateHistory=!1,e.forEach(e=>this.expand(e)),this._updateHistory=!0}}e.create(t),e.create(r),e.create(o);export default o; | ||
//# sourceMappingURL=pfe-accordion.min.js.map |
@@ -139,3 +139,3 @@ (function (global, factory) { | ||
/*! | ||
* PatternFly Elements: PfeAccordion 1.9.1 | ||
* PatternFly Elements: PfeAccordion 1.9.2 | ||
* @license | ||
@@ -190,3 +190,3 @@ * Copyright 2021 Red Hat, Inc. | ||
get: function get() { | ||
return "1.9.1"; | ||
return "1.9.2"; | ||
} | ||
@@ -383,3 +383,3 @@ }, { | ||
/*! | ||
* PatternFly Elements: PfeAccordion 1.9.1 | ||
* PatternFly Elements: PfeAccordion 1.9.2 | ||
* @license | ||
@@ -434,3 +434,3 @@ * Copyright 2021 Red Hat, Inc. | ||
get: function get() { | ||
return "1.9.1"; | ||
return "1.9.2"; | ||
} | ||
@@ -492,3 +492,3 @@ }, { | ||
/*! | ||
* PatternFly Elements: PfeAccordion 1.9.1 | ||
* PatternFly Elements: PfeAccordion 1.9.2 | ||
* @license | ||
@@ -543,3 +543,3 @@ * Copyright 2021 Red Hat, Inc. | ||
get: function get() { | ||
return "1.9.1"; | ||
return "1.9.2"; | ||
} | ||
@@ -546,0 +546,0 @@ }, { |
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("../../pfelement/dist/pfelement.umd.min")):"function"==typeof define&&define.amd?define(["../../pfelement/dist/pfelement.umd.min"],t):(e=e||self).PfeAccordion=t(e.PFElement)}(this,function(e){"use strict";e=e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e,Array.prototype.findIndex||Object.defineProperty(Array.prototype,"findIndex",{value:function(e){if(null==this)throw new TypeError('"this" is null or not defined');var t=Object(this),r=t.length>>>0;if("function"!=typeof e)throw new TypeError("predicate must be a function");for(var o=arguments[1],a=0;a<r;){var n=t[a];if(e.call(o,n,a,t))return a;a++}return-1}});var t=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},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 a(e,t,r){null===e&&(e=Function.prototype);var o=Object.getOwnPropertyDescriptor(e,t);if(void 0!==o){if("value"in o)return o.value;o=o.get;return void 0!==o?o.call(r):void 0}if(null!==(e=Object.getPrototypeOf(e)))return a(e,t,r)}function n(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 i(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)}var d=function(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},c=(n(s,e),r(s,[{key:"html",get:function(){return'\n<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([hidden]){display:none}:host>*{margin:0}:host button{--pfe-accordion--BorderBottomWidth:0;--pfe-accordion--ZIndex:3;--pfe-accordion__trigger--Padding:var(--pfe-accordion__base--Padding, var(--pfe-theme--container-spacer, 1rem)) 50px var(--pfe-accordion__base--Padding, var(--pfe-theme--container-spacer, 1rem)) calc(var(--pfe-accordion__base--Padding, var(--pfe-theme--container-spacer, 1rem)) * 1.5);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:#3c3f42;color:var(--pfe-accordion--Color,var(--pfe-broadcasted--text,#3c3f42));border-width:0;border-style:solid;border-style:var(--pfe-theme--surface--border-style,solid);border-color:#d2d2d2;border-color:var(--pfe-accordion--BorderColor,var(--pfe-theme--color--surface--border,#d2d2d2));border-top-width:1px;border-top-width:var(--pfe-accordion--BorderTopWidth,var(--pfe-theme--surface--border-width,1px));border-right-width:0;border-right-width:var(--pfe-accordion--BorderRightWidth,0);border-bottom-width:1px;border-bottom-width:var(--pfe-accordion--BorderBottomWidth,var(--pfe-theme--surface--border-width,1px));border-left-width:4px;border-left-width:var(--pfe-accordion--BorderLeftWidth,var(--pfe-theme--surface--border-width--heavy,4px));border-left-color:transparent;border-left-color:var(--pfe-accordion--BorderColor--accent,transparent);-webkit-box-shadow:var(--pfe-accordion--BoxShadow);box-shadow:var(--pfe-accordion--BoxShadow);z-index:var(--pfe-accordion--ZIndex);cursor:pointer;font-family:inherit;font-size:calc(1rem * 1.1);font-size:var(--pfe-accordion--FontSize--header,calc(var(--pfe-theme--font-size,1rem) * 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:var(--pfe-accordion__trigger--Padding)}@media screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none){:host button{border-top-width:1px;border-right-width:0;border-bottom-width:1px;border-left-width:4px}}:host button:focus,:host button:hover{--pfe-accordion--BorderColor--accent:var(--pfe-accordion--accent, var(--pfe-theme--color--ui-accent, #06c))}@media screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none){:host button:focus,:host button:hover{border-left-color:#06c}}:host button:hover{outline:0;border-left-width:4px;border-left-width:var(--pfe-theme--surface--border-width--heavy,4px)}:host button:focus{outline:0;text-decoration:underline}:host button::-moz-focus-inner{border:0}@supports (-ms-ime-align:auto){:host button{text-align:left}}@media screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none){:host button{padding:16px 24px;background-color:#fff!important;color:#151515!important}:host button:hover{border-left-color:#06c}}:host 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--BorderLeftWidth:var(--pfe-theme--surface--border-width--heavy, 4px);--pfe-accordion--BackgroundColor:white;--pfe-accordion--Color:var(--pfe-theme--color--text, #151515);--pfe-accordion--BorderColor--accent:var(--pfe-accordion--accent, var(--pfe-theme--color--ui-accent, #06c));--pfe-accordion--BoxShadow:0 5px var(--pfe-theme--surface--border-width--heavy, 4px) rgba(140, 140, 140, 0.35);--pfe-accordion--ZIndex:3}@media screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none){:host button[aria-expanded=true]{border-bottom-width:0;border-left-color:#06c;border-right-color:#d2d2d2}}:host(:not([disclosure=true])) button::after{content:"";position:absolute;top:calc(1rem + .4em);top:calc(var(--pfe-theme--container-spacer,1rem) + .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(1rem * 1.3125);right:calc(var(--pfe-theme--container-spacer,1rem) * 1.3125)}:host(:not([disclosure=true])) button[aria-expanded=true]::after{-webkit-transform:rotate(-135deg);transform:rotate(-135deg)}:host(:last-of-type) button:not([aria-expanded=true]){--pfe-accordion--BorderBottomWidth:var(--pfe-theme--surface--border-width, 1px)}:host(:last-of-type.animating) button{--pfe-accordion--BorderBottomWidth:0}:host([on=dark]) button[aria-expanded=true]{--pfe-accordion--BackgroundColor:rgba(247, 247, 249, 0.1);--pfe-accordion--Color:var(--pfe-broadcasted--text, #3c3f42);--pfe-accordion--BorderColor--accent:var(--pfe-theme--color--ui-accent--on-dark, #73bcf7);--pfe-accordion--BoxShadow:none}:host([on=saturated]) button[aria-expanded=true]{--pfe-accordion--BackgroundColor:rgba(0, 0, 0, 0.2);--pfe-accordion--Color:var(--pfe-broadcasted--text, #3c3f42);--pfe-accordion--BorderColor--accent:var(--pfe-theme--color--ui-accent--on-saturated, #fff);--pfe-accordion--BoxShadow:none}:host([disclosure=true]) button{padding-left:calc(1rem * 3);padding-left:calc(var(--pfe-accordion__base--Padding,var(--pfe-theme--container-spacer,1rem)) * 3)}@media screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none){:host([disclosure=true]) button{padding:16px 24px 16px 47px;border-right-color:#d2d2d2;border-left-color:#d2d2d2;border-left-width:1px}}:host([disclosure=true]) button::before{content:"";position:absolute;top:calc(1rem + .55em);top:calc(var(--pfe-theme--container-spacer,1rem) + .55em);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);left:calc(1rem * 1.3125);left:calc(var(--pfe-theme--container-spacer,1rem) * 1.3125);-webkit-transform:rotate(-45deg);transform:rotate(-45deg)}:host([disclosure=true]) button[aria-expanded=true]::before{-webkit-transform:rotate(45deg);transform:rotate(45deg)}:host([disclosure=true]) button:not([aria-expanded=true]):hover,:host([disclosure=true]) button[aria-expanded=true]{padding-left:calc(1rem * 3 - 4px + 1px);padding-left:calc(var(--pfe-accordion__base--Padding,var(--pfe-theme--container-spacer,1rem)) * 3 - var(--pfe-theme--surface--border-width--heavy,4px) + var(--pfe-theme--surface--border-width,1px))}:host([disclosure=true]) button:not([aria-expanded=true]):hover::before,:host([disclosure=true]) button[aria-expanded=true]::before{margin-left:calc((4px - 1px) * -1);margin-left:calc((var(--pfe-theme--surface--border-width--heavy,4px) - var(--pfe-theme--surface--border-width,1px)) * -1)}@media screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none){:host([disclosure=true]) button:not([aria-expanded=true]):hover,:host([disclosure=true]) button[aria-expanded=true]{border-left-color:#06c;border-left-width:4px;border-right-color:#d2d2d2}} /*# sourceMappingURL=pfe-accordion-header.min.css.map */</style>\n'}},{key:"styleUrl",get:function(){return"pfe-accordion-header.scss"}},{key:"templateUrl",get:function(){return"pfe-accordion-header.html"}}],[{key:"version",get:function(){return"1.9.1"}},{key:"tag",get:function(){return"pfe-accordion-header"}},{key:"properties",get:function(){return{_id:{type:String,default:function(e){return""+e.randomId.replace("pfe",e.tag)},prefix:!1},ariaControls:{type:String,prefix:!1},oldPfeId:{type:String,alias:"_id",attr:"pfe-id"},expanded:{title:"Expanded",type:Boolean,cascade:"#pfe-accordion-header--button",observer:"_expandedChanged"}}}},{key:"events",get:function(){return{change:"pfe-accordion:change"}}}]),r(s,[{key:"connectedCallback",value:function(){a(s.prototype.__proto__||Object.getPrototypeOf(s.prototype),"connectedCallback",this).call(this),this.hasLightDOM()&&this._init(),this.addEventListener("click",this._clickHandler),this._observer.observe(this,{childList:!0})}},{key:"disconnectedCallback",value:function(){a(s.prototype.__proto__||Object.getPrototypeOf(s.prototype),"disconnectedCallback",this).call(this),this.removeEventListener("click",this._clickHandler),this._observer.disconnect()}},{key:"_init",value:function(){window.ShadyCSS&&this._observer.disconnect();var e=this.shadowRoot.querySelector("#"+this.tag+"--button"),t=e||this._createButton(),r=e?e.parentElement:null,o=this._getHeaderElement();o?(e=document.createElement(o.tagName.toLowerCase()||"h3"),r&&r.tagName===o.tagName?e=r:r&&r.tagName!==o.tagName&&r.remove(),t.innerText=o.innerText,e.appendChild(t),this.shadowRoot.appendChild(e)):t.innerText=this.textContent.trim(),window.ShadyCSS&&this._observer.observe(this,{childList:!0})}},{key:"_getHeaderElement",value:function(){var t=this;if(this.firstElementChild||this.firstChild){if(this.firstElementChild&&this.firstElementChild.tagName){if("SLOT"===this.firstElementChild.tagName){var e=this.firstElementChild.assignedNodes();if(0===e.length)return void this.warn("No heading information exists within this slot.");1<e.length&&this.warn("Heading currently only supports 1 tag.");var r=e.filter(function(e){return e.tagName.match(/^H[1-6]/)||"P"===e.tagName});return 0<r.length?(e.forEach(function(e){return t._slotObserver.observe(e,{characterData:!0,childList:!0,subtree:!0})}),r[0]):void 0}if(this.firstElementChild.tagName.match(/^H[1-6]/)||"P"===this.firstElementChild.tagName)return this.firstElementChild;this.warn("Heading should contain at least 1 heading tag for correct semantics.")}}else this.warn("No header content provided")}},{key:"_createButton",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"false",t=document.createElement("button");return t.type="button",t.setAttribute("aria-expanded",e),t.id=this.tag+"--button",t}},{key:"_clickHandler",value:function(e){this.emitEvent(s.events.change,{detail:{expanded:!this.expanded}})}},{key:"_expandedChanged",value:function(){this.setAttribute("aria-expanded",this.expanded);var e=this.shadowRoot.querySelector("#"+this.tag+"--button");e&&e.setAttribute("aria-expanded",this.expanded)}}]),s);function s(){t(this,s);var e=d(this,(s.__proto__||Object.getPrototypeOf(s)).call(this,s));return e._init=e._init.bind(e),e._clickHandler=e._clickHandler.bind(e),e._observer=new MutationObserver(e._init),e._slotObserver=new MutationObserver(e._init),e._getHeaderElement=e._getHeaderElement.bind(e),e._createButton=e._createButton.bind(e),e}var l=(n(h,e),r(h,[{key:"html",get:function(){return'\n<style>.container{position:relative;display:block;width:100%;padding:1rem;padding:var(--pfe-theme--container-spacer,1rem)}: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:#3c3f42;color:var(--pfe-accordion--Color,var(--pfe-broadcasted--text,#3c3f42));border-width:0;border-style:solid;border-style:var(--pfe-theme--surface--border-style,solid);border-color:#d2d2d2;border-color:var(--pfe-accordion--BorderColor,var(--pfe-theme--color--surface--border,#d2d2d2));border-top-width:1px;border-top-width:var(--pfe-accordion--BorderTopWidth,var(--pfe-theme--surface--border-width,1px));border-right-width:0;border-right-width:var(--pfe-accordion--BorderRightWidth,0);border-bottom-width:1px;border-bottom-width:var(--pfe-accordion--BorderBottomWidth,var(--pfe-theme--surface--border-width,1px));border-left-width:4px;border-left-width:var(--pfe-accordion--BorderLeftWidth,var(--pfe-theme--surface--border-width--heavy,4px));border-left-color:transparent;border-left-color:var(--pfe-accordion--BorderColor--accent,transparent);-webkit-box-shadow:var(--pfe-accordion--BoxShadow);box-shadow:var(--pfe-accordion--BoxShadow);z-index:var(--pfe-accordion--ZIndex);-webkit-box-sizing:border-box;box-sizing:border-box}@media screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none){:host{border-top-width:1px;border-right-width:0;border-bottom-width:1px;border-left-width:4px}}:host:focus,:host:hover{--pfe-accordion--BorderColor--accent:var(--pfe-accordion--accent, var(--pfe-theme--color--ui-accent, #06c))}@media screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none){:host:focus,:host:hover{border-left-color:#06c}}:host *,:host ::after,:host ::before{-webkit-box-sizing:border-box;box-sizing:border-box}@media screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none){:host{background-color:#fff!important;color:#151515!important}}:host(.animating){display:block;-webkit-transition:height .3s ease-in-out;transition:height .3s ease-in-out}.container{--pfe-accordion--BoxShadow:none;padding:var(--pfe-accordion__panel-container--Padding);padding:0 calc(1rem * 3) 1rem calc(1rem * 1.5);padding:var(--pfe-accordion__panel-container--Padding,0 var(--pfe-accordion__panel--Padding,calc(var(--pfe-accordion__base--Padding,var(--pfe-theme--container-spacer,1rem)) * 3)) var(--pfe-accordion__base--Padding,var(--pfe-theme--container-spacer,1rem)) var(--pfe-accordion__panel--Padding,calc(var(--pfe-accordion__base--Padding,var(--pfe-theme--container-spacer,1rem)) * 1.5)))}.container::after{clear:both;content:"";display:table}:host([disclosure=true]) .container{padding:0 calc(1rem * 3) calc(1rem) calc(1rem * 1.5);padding:var(--pfe-accordion__panel-container--Padding,0 calc(var(--pfe-accordion__base--Padding,var(--pfe-theme--container-spacer,1rem)) * 3) calc(var(--pfe-accordion__base--Padding,var(--pfe-theme--container-spacer,1rem))) calc(var(--pfe-accordion__base--Padding,var(--pfe-theme--container-spacer,1rem)) * 1.5))}pfe-jump-links-nav .container{padding:0;padding:var(--pfe-accordion__panel-container--Padding,0);--pfe-accordion__panel-container--Padding:0}@media (max-width:767px){pfe-jump-links-nav .container{padding:0;padding:var(--pfe-accordion__panel-container--Padding,0)}}: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--BorderLeftWidth:var(--pfe-theme--surface--border-width--heavy, 4px);--pfe-accordion--BackgroundColor:white;--pfe-accordion--Color:var(--pfe-theme--color--text, #151515);--pfe-accordion--BorderColor--accent:var(--pfe-accordion--accent, var(--pfe-theme--color--ui-accent, #06c));--pfe-accordion--BoxShadow:0 5px var(--pfe-theme--surface--border-width--heavy, 4px) rgba(140, 140, 140, 0.35);--pfe-accordion--ZIndex:3;--pfe-accordion--accent:var(--pfe-theme--color--ui-accent, #06c);--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:#06c;border-left-color:var(--pfe-theme--color--ui-accent,#06c);border-right-color:#d2d2d2;border-right-color:var(--pfe-theme--color--surface--border,#d2d2d2)}}:host([on=dark].animating),:host([on=dark][expanded]){--pfe-accordion--BackgroundColor:rgba(247, 247, 249, 0.1);--pfe-accordion--Color:var(--pfe-broadcasted--text, #3c3f42);--pfe-accordion--BorderColor--accent:var(--pfe-theme--color--ui-accent--on-dark, #73bcf7);--pfe-accordion--BoxShadow:none;--pfe-accordion--accent:var(--pfe-theme--color--ui-accent, #06c);--pfe-accordion--BorderTopWidth:0;--pfe-accordion--BoxShadow:none}:host([on=saturated].animating),:host([on=saturated][expanded]){--pfe-accordion--BackgroundColor:rgba(0, 0, 0, 0.2);--pfe-accordion--Color:var(--pfe-broadcasted--text, #3c3f42);--pfe-accordion--BorderColor--accent:var(--pfe-theme--color--ui-accent--on-saturated, #fff);--pfe-accordion--BoxShadow:none;--pfe-accordion--accent:var(--pfe-theme--color--ui-accent, #06c);--pfe-accordion--BorderTopWidth:0;--pfe-accordion--BoxShadow:none} /*# sourceMappingURL=pfe-accordion-panel.min.css.map */</style>\n<div tabindex="-1">\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:"version",get:function(){return"1.9.1"}},{key:"tag",get:function(){return"pfe-accordion-panel"}},{key:"properties",get:function(){return{_id:{type:String,default:function(e){return""+e.randomId.replace("pfe",e.tag)},prefix:!1},role:{type:String,default:"region",prefix:!1},oldPfeId:{type:String,alias:"_id",attr:"pfe-id"},expanded:{title:"Expanded",type:Boolean,default:!1},ariaLabelledby:{type:String,prefix:!1}}}}]),r(h,[{key:"connectedCallback",value:function(){a(h.prototype.__proto__||Object.getPrototypeOf(h.prototype),"connectedCallback",this).call(this)}}]),h);function h(){return t(this,h),d(this,(h.__proto__||Object.getPrototypeOf(h)).call(this,h))}n(p,e),r(p,[{key:"html",get:function(){return"\n<style>: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--BorderLeftWidth:var(--pfe-theme--surface--border-width--heavy, 4px);--pfe-accordion--Color:var(--pfe-broadcasted--text, #3c3f42);--pfe-accordion--TextAlign:left;--pfe-accordion--accent:var(--pfe-theme--color--ui-accent, #06c);--pfe-accordion__base--Padding:var(--pfe-theme--container-spacer, 1rem);display:block;position:relative;overflow:hidden;margin:0;color:#3c3f42;color:var(--pfe-accordion--Color,var(--pfe-broadcasted--text,#3c3f42))}@media screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none){:host{background-color:#fff!important;color:#151515!important}}:host([on=dark]){--pfe-accordion--accent:var(--pfe-theme--color--ui-accent--on-dark, #73bcf7)}:host([on=saturated]){--pfe-accordion--accent:var(--pfe-theme--color--ui-accent--on-saturated, #fff)}:host([disclosure=true]){--pfe-accordion--BorderRightWidth:var(--pfe-theme--surface--border-width, 1px);--pfe-accordion--BorderLeftWidth:var(--pfe-theme--surface--border-width, 1px);--pfe-accordion--BorderColor--accent:var(--pfe-theme--color--surface--border, #d2d2d2)}:host([hidden]){display:none} /*# sourceMappingURL=pfe-accordion.min.css.map */</style>\n<slot></slot>"}},{key:"styleUrl",get:function(){return"pfe-accordion.scss"}},{key:"templateUrl",get:function(){return"pfe-accordion.html"}}],[{key:"version",get:function(){return"1.9.1"}},{key:"tag",get:function(){return"pfe-accordion"}},{key:"meta",get:function(){return{title:"Accordion",description:"This element renders content sets in an expandable format."}}},{key:"properties",get:function(){return{disclosure:{title:"Disclosure",type:String,values:["true","false"],cascade:["pfe-accordion-header","pfe-accordion-panel"]},oldDisclosure:{type:String,alias:"disclosure",attr:"pfe-disclosure"},expandedIndex:{title:"Expanded index(es)",type:String,observer:"_expandedIndexHandler"},history:{title:"History",type:Boolean,default:!1,observer:"_historyHandler"}}}},{key:"slots",get:function(){return{default:{type:"array",namedSlot:!1,items:{oneOf:[{$ref:"pfe-accordion-header"},{$ref:"pfe-accordion-panel"}]}}}}},{key:"events",get:function(){return{change:this.tag+":change",expand:this.tag+":expand",collapse:this.tag+":collapse"}}},{key:"PfeType",get:function(){return e.PfeTypes.Container}},{key:"contentTemplate",get:function(){return'\n <pfe-accordion-header content-type="header"></pfe-accordion-header>\n <pfe-accordion-panel content-type="panel"></pfe-accordion-panel>\n '}}]),r(p,[{key:"connectedCallback",value:function(){a(p.prototype.__proto__||Object.getPrototypeOf(p.prototype),"connectedCallback",this).call(this),this.hasLightDOM()&&(this._manualDisclosure=this.getAttribute("disclosure")||this.getAttribute("pfe-disclosure"),Promise.all([customElements.whenDefined(c.tag),customElements.whenDefined(l.tag)]).then(this._init)),this.addEventListener(p.events.change,this._changeHandler),this.addEventListener("keydown",this._keydownHandler),this._observer.observe(this,{childList:!0})}},{key:"disconnectedCallback",value:function(){a(p.prototype.__proto__||Object.getPrototypeOf(p.prototype),"disconnectedCallback",this).call(this),this.removeEventListener(p.events.change,this._changeHandler),this.removeEventListener("keydown",this._keydownHandler),this._observer.disconnect(),window.removeEventListener("popstate",this._updateStateFromURL)}},{key:"toggle",value:function(e){this._allHeaders()[e].expanded?this.collapse(e):this.expand(e)}},{key:"expand",value:function(e){var t;null!=e&&(t=parseInt(e,10),(e=this._allHeaders()[t])&&(t=this._panelForHeader(e),e&&t&&(this._expandHeader(e),this._expandPanel(t),e.focus(),this.emitEvent(p.events.expand))))}},{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(),t=t[e],e=r[e];t&&e&&(this._collapseHeader(t),this._collapsePanel(e),this.emitEvent(p.events.collapse))}},{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:"_init",value:function(){var r=this,e=this._allHeaders();e.forEach(function(e){var t=r._panelForHeader(e);t&&(e.ariaControls=t._id,t.ariaLabelledby=e._id)}),this._manualDisclosure||(1===e.length?this.disclosure="true":1<e.length&&(this.disclosure="false")),this.isIE11||this._updateStateFromURL()}},{key:"_changeHandler",value:function(e){var t;this.classList.contains("animating")||(t=this._getIndex(e.target),e.detail.expanded?this.expand(t):this.collapse(t),this._updateURLHistory())}},{key:"_historyHandler",value:function(){this.history?window.addEventListener("popstate",this._updateStateFromURL):window.removeEventListener("popstate",this._updateStateFromURL)}},{key:"_expandHeader",value:function(e){var t=this._getIndex(e);this.expanded.indexOf(t)<0&&-1<t&&this.expanded.push(t),e.expanded=!0}},{key:"_expandPanel",value:function(e){var t;e?e.expanded||(e.expanded=!0,t=e.getBoundingClientRect().height,this._animate(e,0,t)):this.error("Trying to expand a panel that doesn't exist.")}},{key:"_collapseHeader",value:function(e){var t=this._getIndex(e),t=this.expanded.indexOf(t);0<=t&&this.expanded.splice(t,1),e.expanded=!1}},{key:"_collapsePanel",value:function(e){var t;e?e.expanded&&(t=e.getBoundingClientRect().height,e.expanded=!1,this._animate(e,t,0)):this.error("Trying to collapse a panel that doesn't exist")}},{key:"_animate",value:function(e,t,r){var o,a=this;e&&((o=e.previousElementSibling)&&o.classList.add("animating"),e.classList.add("animating"),e.style.height=t+"px",requestAnimationFrame(function(){requestAnimationFrame(function(){e.style.height=r+"px",e.addEventListener("transitionend",a._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&&(r.shadowRoot.querySelector("button").focus(),e=this._getIndex(r),this.expand(e),this._setFocus=!0)}}},{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 this.isIE11?this.children.filter(function(e){return"pfe-accordion-header"===e.tagName.toLowerCase()}):[].concat(i(this.querySelectorAll(":scope > pfe-accordion-header")))}},{key:"_allPanels",value:function(){return this.isIE11?this.children.filter(function(e){return"pfe-accordion-panel"===e.tagName.toLowerCase()}):[].concat(i(this.querySelectorAll(":scope > pfe-accordion-panel")))}},{key:"_panelForHeader",value:function(e){e=e.nextElementSibling;if(e){if(e.tagName.toLowerCase()===l.tag)return e;this.error("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()===c.tag}},{key:"_isPanel",value:function(e){return e.tagName.toLowerCase()===l.tag}},{key:"_expandedIndexHandler",value:function(e,t){var r=this;e!==t&&t.split(",").map(function(e){return parseInt(e,10)-1}).reverse().map(function(e){return r.expand(e)})}},{key:"_getIndex",value:function(t){return this._isHeader(t)?this._allHeaders().findIndex(function(e){return e.id===t.id}):this._isPanel(t)?this._allPanels().findIndex(function(e){return e.id===t.id}):(this.warn("The _getIndex method expects to receive a header or panel element."),-1)}},{key:"_getIndexesFromURL",value:function(){if(!window.URLSearchParams)return[];var e=new URLSearchParams(window.location.search);if(e&&e.has(this.id)){e=e.get(this.id).split("-");return e.length<0?[]:e.map(function(e){return parseInt(e.trim(),10)-1})}}},{key:"_updateURLHistory",value:function(){var e,t;this.history&&this._updateHistory&&window.URLSearchParams&&(this.id?(e=new URLSearchParams(window.location.search),t=this.expanded.map(function(e){return e+1}).sort(function(e,t){return e-t}).join("-"),0<this.expanded.length?e.set(this.id,t):e.delete(this.id),history.replaceState({},"",window.location.pathname+(e?"?"+e.toString():"")+window.location.hash)):this.error("The history feature cannot update the URL without an ID added to the pfe-accordion tag."))}},{key:"_updateStateFromURL",value:function(){var t=this,e=this._getIndexesFromURL()||[];this._updateHistory=!1,e.forEach(function(e){return t.expand(e)}),this._updateHistory=!0}}]),r=p;function p(){t(this,p);var e=d(this,(p.__proto__||Object.getPrototypeOf(p)).call(this,p,{type:p.PfeType}));return e._manualDisclosure=null,e._updateHistory=!0,e.expanded=[],e._init=e._init.bind(e),e._observer=new MutationObserver(e._init),e._updateStateFromURL=e._updateStateFromURL.bind(e),e._getIndexesFromURL=e._getIndexesFromURL.bind(e),e._updateURLHistory=e._updateURLHistory.bind(e),e}return e.create(c),e.create(l),e.create(r),r}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("../../pfelement/dist/pfelement.umd.min")):"function"==typeof define&&define.amd?define(["../../pfelement/dist/pfelement.umd.min"],t):(e=e||self).PfeAccordion=t(e.PFElement)}(this,function(e){"use strict";e=e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e,Array.prototype.findIndex||Object.defineProperty(Array.prototype,"findIndex",{value:function(e){if(null==this)throw new TypeError('"this" is null or not defined');var t=Object(this),r=t.length>>>0;if("function"!=typeof e)throw new TypeError("predicate must be a function");for(var o=arguments[1],a=0;a<r;){var n=t[a];if(e.call(o,n,a,t))return a;a++}return-1}});var t=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},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 a(e,t,r){null===e&&(e=Function.prototype);var o=Object.getOwnPropertyDescriptor(e,t);if(void 0!==o){if("value"in o)return o.value;o=o.get;return void 0!==o?o.call(r):void 0}if(null!==(e=Object.getPrototypeOf(e)))return a(e,t,r)}function n(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 i(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)}var d=function(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},c=(n(s,e),r(s,[{key:"html",get:function(){return'\n<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([hidden]){display:none}:host>*{margin:0}:host button{--pfe-accordion--BorderBottomWidth:0;--pfe-accordion--ZIndex:3;--pfe-accordion__trigger--Padding:var(--pfe-accordion__base--Padding, var(--pfe-theme--container-spacer, 1rem)) 50px var(--pfe-accordion__base--Padding, var(--pfe-theme--container-spacer, 1rem)) calc(var(--pfe-accordion__base--Padding, var(--pfe-theme--container-spacer, 1rem)) * 1.5);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:#3c3f42;color:var(--pfe-accordion--Color,var(--pfe-broadcasted--text,#3c3f42));border-width:0;border-style:solid;border-style:var(--pfe-theme--surface--border-style,solid);border-color:#d2d2d2;border-color:var(--pfe-accordion--BorderColor,var(--pfe-theme--color--surface--border,#d2d2d2));border-top-width:1px;border-top-width:var(--pfe-accordion--BorderTopWidth,var(--pfe-theme--surface--border-width,1px));border-right-width:0;border-right-width:var(--pfe-accordion--BorderRightWidth,0);border-bottom-width:1px;border-bottom-width:var(--pfe-accordion--BorderBottomWidth,var(--pfe-theme--surface--border-width,1px));border-left-width:4px;border-left-width:var(--pfe-accordion--BorderLeftWidth,var(--pfe-theme--surface--border-width--heavy,4px));border-left-color:transparent;border-left-color:var(--pfe-accordion--BorderColor--accent,transparent);-webkit-box-shadow:var(--pfe-accordion--BoxShadow);box-shadow:var(--pfe-accordion--BoxShadow);z-index:var(--pfe-accordion--ZIndex);cursor:pointer;font-family:inherit;font-size:calc(1rem * 1.1);font-size:var(--pfe-accordion--FontSize--header,calc(var(--pfe-theme--font-size,1rem) * 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:var(--pfe-accordion__trigger--Padding)}@media screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none){:host button{border-top-width:1px;border-right-width:0;border-bottom-width:1px;border-left-width:4px}}:host button:focus,:host button:hover{--pfe-accordion--BorderColor--accent:var(--pfe-accordion--accent, var(--pfe-theme--color--ui-accent, #06c))}@media screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none){:host button:focus,:host button:hover{border-left-color:#06c}}:host button:hover{outline:0;border-left-width:4px;border-left-width:var(--pfe-theme--surface--border-width--heavy,4px)}:host button:focus{outline:0;text-decoration:underline}:host button::-moz-focus-inner{border:0}@supports (-ms-ime-align:auto){:host button{text-align:left}}@media screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none){:host button{padding:16px 24px;background-color:#fff!important;color:#151515!important}:host button:hover{border-left-color:#06c}}:host 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--BorderLeftWidth:var(--pfe-theme--surface--border-width--heavy, 4px);--pfe-accordion--BackgroundColor:white;--pfe-accordion--Color:var(--pfe-theme--color--text, #151515);--pfe-accordion--BorderColor--accent:var(--pfe-accordion--accent, var(--pfe-theme--color--ui-accent, #06c));--pfe-accordion--BoxShadow:0 5px var(--pfe-theme--surface--border-width--heavy, 4px) rgba(140, 140, 140, 0.35);--pfe-accordion--ZIndex:3}@media screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none){:host button[aria-expanded=true]{border-bottom-width:0;border-left-color:#06c;border-right-color:#d2d2d2}}:host(:not([disclosure=true])) button::after{content:"";position:absolute;top:calc(1rem + .4em);top:calc(var(--pfe-theme--container-spacer,1rem) + .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(1rem * 1.3125);right:calc(var(--pfe-theme--container-spacer,1rem) * 1.3125)}:host(:not([disclosure=true])) button[aria-expanded=true]::after{-webkit-transform:rotate(-135deg);transform:rotate(-135deg)}:host(:last-of-type) button:not([aria-expanded=true]){--pfe-accordion--BorderBottomWidth:var(--pfe-theme--surface--border-width, 1px)}:host(:last-of-type.animating) button{--pfe-accordion--BorderBottomWidth:0}:host([on=dark]) button[aria-expanded=true]{--pfe-accordion--BackgroundColor:rgba(247, 247, 249, 0.1);--pfe-accordion--Color:var(--pfe-broadcasted--text, #3c3f42);--pfe-accordion--BorderColor--accent:var(--pfe-theme--color--ui-accent--on-dark, #73bcf7);--pfe-accordion--BoxShadow:none}:host([on=saturated]) button[aria-expanded=true]{--pfe-accordion--BackgroundColor:rgba(0, 0, 0, 0.2);--pfe-accordion--Color:var(--pfe-broadcasted--text, #3c3f42);--pfe-accordion--BorderColor--accent:var(--pfe-theme--color--ui-accent--on-saturated, #fff);--pfe-accordion--BoxShadow:none}:host([disclosure=true]) button{padding-left:calc(1rem * 3);padding-left:calc(var(--pfe-accordion__base--Padding,var(--pfe-theme--container-spacer,1rem)) * 3)}@media screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none){:host([disclosure=true]) button{padding:16px 24px 16px 47px;border-right-color:#d2d2d2;border-left-color:#d2d2d2;border-left-width:1px}}:host([disclosure=true]) button::before{content:"";position:absolute;top:calc(1rem + .55em);top:calc(var(--pfe-theme--container-spacer,1rem) + .55em);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);left:calc(1rem * 1.3125);left:calc(var(--pfe-theme--container-spacer,1rem) * 1.3125);-webkit-transform:rotate(-45deg);transform:rotate(-45deg)}:host([disclosure=true]) button[aria-expanded=true]::before{-webkit-transform:rotate(45deg);transform:rotate(45deg)}:host([disclosure=true]) button:not([aria-expanded=true]):hover,:host([disclosure=true]) button[aria-expanded=true]{padding-left:calc(1rem * 3 - 4px + 1px);padding-left:calc(var(--pfe-accordion__base--Padding,var(--pfe-theme--container-spacer,1rem)) * 3 - var(--pfe-theme--surface--border-width--heavy,4px) + var(--pfe-theme--surface--border-width,1px))}:host([disclosure=true]) button:not([aria-expanded=true]):hover::before,:host([disclosure=true]) button[aria-expanded=true]::before{margin-left:calc((4px - 1px) * -1);margin-left:calc((var(--pfe-theme--surface--border-width--heavy,4px) - var(--pfe-theme--surface--border-width,1px)) * -1)}@media screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none){:host([disclosure=true]) button:not([aria-expanded=true]):hover,:host([disclosure=true]) button[aria-expanded=true]{border-left-color:#06c;border-left-width:4px;border-right-color:#d2d2d2}} /*# sourceMappingURL=pfe-accordion-header.min.css.map */</style>\n'}},{key:"styleUrl",get:function(){return"pfe-accordion-header.scss"}},{key:"templateUrl",get:function(){return"pfe-accordion-header.html"}}],[{key:"version",get:function(){return"1.9.2"}},{key:"tag",get:function(){return"pfe-accordion-header"}},{key:"properties",get:function(){return{_id:{type:String,default:function(e){return""+e.randomId.replace("pfe",e.tag)},prefix:!1},ariaControls:{type:String,prefix:!1},oldPfeId:{type:String,alias:"_id",attr:"pfe-id"},expanded:{title:"Expanded",type:Boolean,cascade:"#pfe-accordion-header--button",observer:"_expandedChanged"}}}},{key:"events",get:function(){return{change:"pfe-accordion:change"}}}]),r(s,[{key:"connectedCallback",value:function(){a(s.prototype.__proto__||Object.getPrototypeOf(s.prototype),"connectedCallback",this).call(this),this.hasLightDOM()&&this._init(),this.addEventListener("click",this._clickHandler),this._observer.observe(this,{childList:!0})}},{key:"disconnectedCallback",value:function(){a(s.prototype.__proto__||Object.getPrototypeOf(s.prototype),"disconnectedCallback",this).call(this),this.removeEventListener("click",this._clickHandler),this._observer.disconnect()}},{key:"_init",value:function(){window.ShadyCSS&&this._observer.disconnect();var e=this.shadowRoot.querySelector("#"+this.tag+"--button"),t=e||this._createButton(),r=e?e.parentElement:null,o=this._getHeaderElement();o?(e=document.createElement(o.tagName.toLowerCase()||"h3"),r&&r.tagName===o.tagName?e=r:r&&r.tagName!==o.tagName&&r.remove(),t.innerText=o.innerText,e.appendChild(t),this.shadowRoot.appendChild(e)):t.innerText=this.textContent.trim(),window.ShadyCSS&&this._observer.observe(this,{childList:!0})}},{key:"_getHeaderElement",value:function(){var t=this;if(this.firstElementChild||this.firstChild){if(this.firstElementChild&&this.firstElementChild.tagName){if("SLOT"===this.firstElementChild.tagName){var e=this.firstElementChild.assignedNodes();if(0===e.length)return void this.warn("No heading information exists within this slot.");1<e.length&&this.warn("Heading currently only supports 1 tag.");var r=e.filter(function(e){return e.tagName.match(/^H[1-6]/)||"P"===e.tagName});return 0<r.length?(e.forEach(function(e){return t._slotObserver.observe(e,{characterData:!0,childList:!0,subtree:!0})}),r[0]):void 0}if(this.firstElementChild.tagName.match(/^H[1-6]/)||"P"===this.firstElementChild.tagName)return this.firstElementChild;this.warn("Heading should contain at least 1 heading tag for correct semantics.")}}else this.warn("No header content provided")}},{key:"_createButton",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"false",t=document.createElement("button");return t.type="button",t.setAttribute("aria-expanded",e),t.id=this.tag+"--button",t}},{key:"_clickHandler",value:function(e){this.emitEvent(s.events.change,{detail:{expanded:!this.expanded}})}},{key:"_expandedChanged",value:function(){this.setAttribute("aria-expanded",this.expanded);var e=this.shadowRoot.querySelector("#"+this.tag+"--button");e&&e.setAttribute("aria-expanded",this.expanded)}}]),s);function s(){t(this,s);var e=d(this,(s.__proto__||Object.getPrototypeOf(s)).call(this,s));return e._init=e._init.bind(e),e._clickHandler=e._clickHandler.bind(e),e._observer=new MutationObserver(e._init),e._slotObserver=new MutationObserver(e._init),e._getHeaderElement=e._getHeaderElement.bind(e),e._createButton=e._createButton.bind(e),e}var l=(n(h,e),r(h,[{key:"html",get:function(){return'\n<style>.container{position:relative;display:block;width:100%;padding:1rem;padding:var(--pfe-theme--container-spacer,1rem)}: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:#3c3f42;color:var(--pfe-accordion--Color,var(--pfe-broadcasted--text,#3c3f42));border-width:0;border-style:solid;border-style:var(--pfe-theme--surface--border-style,solid);border-color:#d2d2d2;border-color:var(--pfe-accordion--BorderColor,var(--pfe-theme--color--surface--border,#d2d2d2));border-top-width:1px;border-top-width:var(--pfe-accordion--BorderTopWidth,var(--pfe-theme--surface--border-width,1px));border-right-width:0;border-right-width:var(--pfe-accordion--BorderRightWidth,0);border-bottom-width:1px;border-bottom-width:var(--pfe-accordion--BorderBottomWidth,var(--pfe-theme--surface--border-width,1px));border-left-width:4px;border-left-width:var(--pfe-accordion--BorderLeftWidth,var(--pfe-theme--surface--border-width--heavy,4px));border-left-color:transparent;border-left-color:var(--pfe-accordion--BorderColor--accent,transparent);-webkit-box-shadow:var(--pfe-accordion--BoxShadow);box-shadow:var(--pfe-accordion--BoxShadow);z-index:var(--pfe-accordion--ZIndex);-webkit-box-sizing:border-box;box-sizing:border-box}@media screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none){:host{border-top-width:1px;border-right-width:0;border-bottom-width:1px;border-left-width:4px}}:host:focus,:host:hover{--pfe-accordion--BorderColor--accent:var(--pfe-accordion--accent, var(--pfe-theme--color--ui-accent, #06c))}@media screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none){:host:focus,:host:hover{border-left-color:#06c}}:host *,:host ::after,:host ::before{-webkit-box-sizing:border-box;box-sizing:border-box}@media screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none){:host{background-color:#fff!important;color:#151515!important}}:host(.animating){display:block;-webkit-transition:height .3s ease-in-out;transition:height .3s ease-in-out}.container{--pfe-accordion--BoxShadow:none;padding:var(--pfe-accordion__panel-container--Padding);padding:0 calc(1rem * 3) 1rem calc(1rem * 1.5);padding:var(--pfe-accordion__panel-container--Padding,0 var(--pfe-accordion__panel--Padding,calc(var(--pfe-accordion__base--Padding,var(--pfe-theme--container-spacer,1rem)) * 3)) var(--pfe-accordion__base--Padding,var(--pfe-theme--container-spacer,1rem)) var(--pfe-accordion__panel--Padding,calc(var(--pfe-accordion__base--Padding,var(--pfe-theme--container-spacer,1rem)) * 1.5)))}.container::after{clear:both;content:"";display:table}:host([disclosure=true]) .container{padding:0 calc(1rem * 3) calc(1rem) calc(1rem * 1.5);padding:var(--pfe-accordion__panel-container--Padding,0 calc(var(--pfe-accordion__base--Padding,var(--pfe-theme--container-spacer,1rem)) * 3) calc(var(--pfe-accordion__base--Padding,var(--pfe-theme--container-spacer,1rem))) calc(var(--pfe-accordion__base--Padding,var(--pfe-theme--container-spacer,1rem)) * 1.5))}pfe-jump-links-nav .container{padding:0;padding:var(--pfe-accordion__panel-container--Padding,0);--pfe-accordion__panel-container--Padding:0}@media (max-width:767px){pfe-jump-links-nav .container{padding:0;padding:var(--pfe-accordion__panel-container--Padding,0)}}: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--BorderLeftWidth:var(--pfe-theme--surface--border-width--heavy, 4px);--pfe-accordion--BackgroundColor:white;--pfe-accordion--Color:var(--pfe-theme--color--text, #151515);--pfe-accordion--BorderColor--accent:var(--pfe-accordion--accent, var(--pfe-theme--color--ui-accent, #06c));--pfe-accordion--BoxShadow:0 5px var(--pfe-theme--surface--border-width--heavy, 4px) rgba(140, 140, 140, 0.35);--pfe-accordion--ZIndex:3;--pfe-accordion--accent:var(--pfe-theme--color--ui-accent, #06c);--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:#06c;border-left-color:var(--pfe-theme--color--ui-accent,#06c);border-right-color:#d2d2d2;border-right-color:var(--pfe-theme--color--surface--border,#d2d2d2)}}:host([on=dark].animating),:host([on=dark][expanded]){--pfe-accordion--BackgroundColor:rgba(247, 247, 249, 0.1);--pfe-accordion--Color:var(--pfe-broadcasted--text, #3c3f42);--pfe-accordion--BorderColor--accent:var(--pfe-theme--color--ui-accent--on-dark, #73bcf7);--pfe-accordion--BoxShadow:none;--pfe-accordion--accent:var(--pfe-theme--color--ui-accent, #06c);--pfe-accordion--BorderTopWidth:0;--pfe-accordion--BoxShadow:none}:host([on=saturated].animating),:host([on=saturated][expanded]){--pfe-accordion--BackgroundColor:rgba(0, 0, 0, 0.2);--pfe-accordion--Color:var(--pfe-broadcasted--text, #3c3f42);--pfe-accordion--BorderColor--accent:var(--pfe-theme--color--ui-accent--on-saturated, #fff);--pfe-accordion--BoxShadow:none;--pfe-accordion--accent:var(--pfe-theme--color--ui-accent, #06c);--pfe-accordion--BorderTopWidth:0;--pfe-accordion--BoxShadow:none} /*# sourceMappingURL=pfe-accordion-panel.min.css.map */</style>\n<div tabindex="-1">\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:"version",get:function(){return"1.9.2"}},{key:"tag",get:function(){return"pfe-accordion-panel"}},{key:"properties",get:function(){return{_id:{type:String,default:function(e){return""+e.randomId.replace("pfe",e.tag)},prefix:!1},role:{type:String,default:"region",prefix:!1},oldPfeId:{type:String,alias:"_id",attr:"pfe-id"},expanded:{title:"Expanded",type:Boolean,default:!1},ariaLabelledby:{type:String,prefix:!1}}}}]),r(h,[{key:"connectedCallback",value:function(){a(h.prototype.__proto__||Object.getPrototypeOf(h.prototype),"connectedCallback",this).call(this)}}]),h);function h(){return t(this,h),d(this,(h.__proto__||Object.getPrototypeOf(h)).call(this,h))}n(p,e),r(p,[{key:"html",get:function(){return"\n<style>: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--BorderLeftWidth:var(--pfe-theme--surface--border-width--heavy, 4px);--pfe-accordion--Color:var(--pfe-broadcasted--text, #3c3f42);--pfe-accordion--TextAlign:left;--pfe-accordion--accent:var(--pfe-theme--color--ui-accent, #06c);--pfe-accordion__base--Padding:var(--pfe-theme--container-spacer, 1rem);display:block;position:relative;overflow:hidden;margin:0;color:#3c3f42;color:var(--pfe-accordion--Color,var(--pfe-broadcasted--text,#3c3f42))}@media screen and (-ms-high-contrast:active),screen and (-ms-high-contrast:none){:host{background-color:#fff!important;color:#151515!important}}:host([on=dark]){--pfe-accordion--accent:var(--pfe-theme--color--ui-accent--on-dark, #73bcf7)}:host([on=saturated]){--pfe-accordion--accent:var(--pfe-theme--color--ui-accent--on-saturated, #fff)}:host([disclosure=true]){--pfe-accordion--BorderRightWidth:var(--pfe-theme--surface--border-width, 1px);--pfe-accordion--BorderLeftWidth:var(--pfe-theme--surface--border-width, 1px);--pfe-accordion--BorderColor--accent:var(--pfe-theme--color--surface--border, #d2d2d2)}:host([hidden]){display:none} /*# sourceMappingURL=pfe-accordion.min.css.map */</style>\n<slot></slot>"}},{key:"styleUrl",get:function(){return"pfe-accordion.scss"}},{key:"templateUrl",get:function(){return"pfe-accordion.html"}}],[{key:"version",get:function(){return"1.9.2"}},{key:"tag",get:function(){return"pfe-accordion"}},{key:"meta",get:function(){return{title:"Accordion",description:"This element renders content sets in an expandable format."}}},{key:"properties",get:function(){return{disclosure:{title:"Disclosure",type:String,values:["true","false"],cascade:["pfe-accordion-header","pfe-accordion-panel"]},oldDisclosure:{type:String,alias:"disclosure",attr:"pfe-disclosure"},expandedIndex:{title:"Expanded index(es)",type:String,observer:"_expandedIndexHandler"},history:{title:"History",type:Boolean,default:!1,observer:"_historyHandler"}}}},{key:"slots",get:function(){return{default:{type:"array",namedSlot:!1,items:{oneOf:[{$ref:"pfe-accordion-header"},{$ref:"pfe-accordion-panel"}]}}}}},{key:"events",get:function(){return{change:this.tag+":change",expand:this.tag+":expand",collapse:this.tag+":collapse"}}},{key:"PfeType",get:function(){return e.PfeTypes.Container}},{key:"contentTemplate",get:function(){return'\n <pfe-accordion-header content-type="header"></pfe-accordion-header>\n <pfe-accordion-panel content-type="panel"></pfe-accordion-panel>\n '}}]),r(p,[{key:"connectedCallback",value:function(){a(p.prototype.__proto__||Object.getPrototypeOf(p.prototype),"connectedCallback",this).call(this),this.hasLightDOM()&&(this._manualDisclosure=this.getAttribute("disclosure")||this.getAttribute("pfe-disclosure"),Promise.all([customElements.whenDefined(c.tag),customElements.whenDefined(l.tag)]).then(this._init)),this.addEventListener(p.events.change,this._changeHandler),this.addEventListener("keydown",this._keydownHandler),this._observer.observe(this,{childList:!0})}},{key:"disconnectedCallback",value:function(){a(p.prototype.__proto__||Object.getPrototypeOf(p.prototype),"disconnectedCallback",this).call(this),this.removeEventListener(p.events.change,this._changeHandler),this.removeEventListener("keydown",this._keydownHandler),this._observer.disconnect(),window.removeEventListener("popstate",this._updateStateFromURL)}},{key:"toggle",value:function(e){this._allHeaders()[e].expanded?this.collapse(e):this.expand(e)}},{key:"expand",value:function(e){var t;null!=e&&(t=parseInt(e,10),(e=this._allHeaders()[t])&&(t=this._panelForHeader(e),e&&t&&(this._expandHeader(e),this._expandPanel(t),e.focus(),this.emitEvent(p.events.expand))))}},{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(),t=t[e],e=r[e];t&&e&&(this._collapseHeader(t),this._collapsePanel(e),this.emitEvent(p.events.collapse))}},{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:"_init",value:function(){var r=this,e=this._allHeaders();e.forEach(function(e){var t=r._panelForHeader(e);t&&(e.ariaControls=t._id,t.ariaLabelledby=e._id)}),this._manualDisclosure||(1===e.length?this.disclosure="true":1<e.length&&(this.disclosure="false")),this.isIE11||this._updateStateFromURL()}},{key:"_changeHandler",value:function(e){var t;this.classList.contains("animating")||(t=this._getIndex(e.target),e.detail.expanded?this.expand(t):this.collapse(t),this._updateURLHistory())}},{key:"_historyHandler",value:function(){this.history?window.addEventListener("popstate",this._updateStateFromURL):window.removeEventListener("popstate",this._updateStateFromURL)}},{key:"_expandHeader",value:function(e){var t=this._getIndex(e);this.expanded.indexOf(t)<0&&-1<t&&this.expanded.push(t),e.expanded=!0}},{key:"_expandPanel",value:function(e){var t;e?e.expanded||(e.expanded=!0,t=e.getBoundingClientRect().height,this._animate(e,0,t)):this.error("Trying to expand a panel that doesn't exist.")}},{key:"_collapseHeader",value:function(e){var t=this._getIndex(e),t=this.expanded.indexOf(t);0<=t&&this.expanded.splice(t,1),e.expanded=!1}},{key:"_collapsePanel",value:function(e){var t;e?e.expanded&&(t=e.getBoundingClientRect().height,e.expanded=!1,this._animate(e,t,0)):this.error("Trying to collapse a panel that doesn't exist")}},{key:"_animate",value:function(e,t,r){var o,a=this;e&&((o=e.previousElementSibling)&&o.classList.add("animating"),e.classList.add("animating"),e.style.height=t+"px",requestAnimationFrame(function(){requestAnimationFrame(function(){e.style.height=r+"px",e.addEventListener("transitionend",a._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&&(r.shadowRoot.querySelector("button").focus(),e=this._getIndex(r),this.expand(e),this._setFocus=!0)}}},{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 this.isIE11?this.children.filter(function(e){return"pfe-accordion-header"===e.tagName.toLowerCase()}):[].concat(i(this.querySelectorAll(":scope > pfe-accordion-header")))}},{key:"_allPanels",value:function(){return this.isIE11?this.children.filter(function(e){return"pfe-accordion-panel"===e.tagName.toLowerCase()}):[].concat(i(this.querySelectorAll(":scope > pfe-accordion-panel")))}},{key:"_panelForHeader",value:function(e){e=e.nextElementSibling;if(e){if(e.tagName.toLowerCase()===l.tag)return e;this.error("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()===c.tag}},{key:"_isPanel",value:function(e){return e.tagName.toLowerCase()===l.tag}},{key:"_expandedIndexHandler",value:function(e,t){var r=this;e!==t&&t.split(",").map(function(e){return parseInt(e,10)-1}).reverse().map(function(e){return r.expand(e)})}},{key:"_getIndex",value:function(t){return this._isHeader(t)?this._allHeaders().findIndex(function(e){return e.id===t.id}):this._isPanel(t)?this._allPanels().findIndex(function(e){return e.id===t.id}):(this.warn("The _getIndex method expects to receive a header or panel element."),-1)}},{key:"_getIndexesFromURL",value:function(){if(!window.URLSearchParams)return[];var e=new URLSearchParams(window.location.search);if(e&&e.has(this.id)){e=e.get(this.id).split("-");return e.length<0?[]:e.map(function(e){return parseInt(e.trim(),10)-1})}}},{key:"_updateURLHistory",value:function(){var e,t;this.history&&this._updateHistory&&window.URLSearchParams&&(this.id?(e=new URLSearchParams(window.location.search),t=this.expanded.map(function(e){return e+1}).sort(function(e,t){return e-t}).join("-"),0<this.expanded.length?e.set(this.id,t):e.delete(this.id),history.replaceState({},"",window.location.pathname+(e?"?"+e.toString():"")+window.location.hash)):this.error("The history feature cannot update the URL without an ID added to the pfe-accordion tag."))}},{key:"_updateStateFromURL",value:function(){var t=this,e=this._getIndexesFromURL()||[];this._updateHistory=!1,e.forEach(function(e){return t.expand(e)}),this._updateHistory=!0}}]),r=p;function p(){t(this,p);var e=d(this,(p.__proto__||Object.getPrototypeOf(p)).call(this,p,{type:p.PfeType}));return e._manualDisclosure=null,e._updateHistory=!0,e.expanded=[],e._init=e._init.bind(e),e._observer=new MutationObserver(e._init),e._updateStateFromURL=e._updateStateFromURL.bind(e),e._getIndexesFromURL=e._getIndexesFromURL.bind(e),e._updateURLHistory=e._updateURLHistory.bind(e),e}return e.create(c),e.create(l),e.create(r),r}); | ||
//# sourceMappingURL=pfe-accordion.umd.min.js.map |
@@ -13,3 +13,3 @@ { | ||
}, | ||
"version": "1.9.1", | ||
"version": "1.9.2", | ||
"publishConfig": { | ||
@@ -64,6 +64,6 @@ "access": "public" | ||
"devDependencies": { | ||
"@patternfly/pfe-sass": "^1.9.1" | ||
"@patternfly/pfe-sass": "^1.9.2" | ||
}, | ||
"dependencies": { | ||
"@patternfly/pfelement": "^1.9.1" | ||
"@patternfly/pfelement": "^1.9.2" | ||
}, | ||
@@ -74,3 +74,3 @@ "generator-pfelement-version": "0.5.5", | ||
}, | ||
"gitHead": "89e1d44d4b98421b268d1b9d1207dbb9293e50ad" | ||
"gitHead": "04c85f5a53eeec1ea4ff49f74ca07c0ca5e531b8" | ||
} |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Updated@patternfly/pfelement@^1.9.2