@abgov/react-components 4.15.0 → 4.15.1-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/modal/modal.d.ts
CHANGED
package/package.json
CHANGED
package/react-components.esm.js
CHANGED
|
@@ -1526,15 +1526,15 @@ $$invalidate(11,_progress=(_maxProgressStep-1)/(_steps.length-1)*100);}if($$self
|
|
|
1526
1526
|
let _rootEl;// Hooks
|
|
1527
1527
|
onMount(async()=>{await tick();setCurrentPage(current);});function setCurrentPage(current){if(!_rootEl)return;const children=getChildren();children.forEach((child,index)=>{const _child=child;_child.style.display=index+1===+current?"block":"none";});}function getChildren(){const slot=_rootEl.querySelector("slot");if(slot){return [...slot.assignedElements()];}else {return [..._rootEl.children];// unit tests
|
|
1528
1528
|
}}function div_binding($$value){binding_callbacks[$$value?'unshift':'push'](()=>{_rootEl=$$value;$$invalidate(4,_rootEl);});}$$self.$$set=$$props=>{if('current'in $$props)$$invalidate(5,current=$$props.current);if('mt'in $$props)$$invalidate(0,mt=$$props.mt);if('mr'in $$props)$$invalidate(1,mr=$$props.mr);if('mb'in $$props)$$invalidate(2,mb=$$props.mb);if('ml'in $$props)$$invalidate(3,ml=$$props.ml);};$$self.$$.update=()=>{if($$self.$$.dirty&/*current*/32){// Reactive
|
|
1529
|
-
setCurrentPage(current);}};return [mt,mr,mb,ml,_rootEl,current,div_binding];}class Pages extends SvelteElement{constructor(options){super();init(this,{target:this.shadowRoot,props:attribute_to_object(this.attributes),customElement:true},instance$5,create_fragment$5,safe_not_equal,{current:5,mt:0,mr:1,mb:2,ml:3},null);if(options){if(options.target){insert(options.target,this,options.anchor);}if(options.props){this.$set(options.props);flush();}}}static get observedAttributes(){return ["current","mt","mr","mb","ml"];}get current(){return this.$$.ctx[5];}set current(current){this.$$set({current});flush();}get mt(){return this.$$.ctx[0];}set mt(mt){this.$$set({mt});flush();}get mr(){return this.$$.ctx[1];}set mr(mr){this.$$set({mr});flush();}get mb(){return this.$$.ctx[2];}set mb(mb){this.$$set({mb});flush();}get ml(){return this.$$.ctx[3];}set ml(ml){this.$$set({ml});flush();}}customElements.define("goa-pages",Pages)
|
|
1530
|
-
let currentLocation=document.location.href;const observer=new MutationObserver(_mutationList=>{if(
|
|
1531
|
-
window.addEventListener("popstate",()=>{
|
|
1532
|
-
function create_if_block$2(ctx){let goa_icon;return {c(){goa_icon=element("goa-icon");set_custom_element_data(goa_icon,"type","chevron-down");},m(target,anchor){insert(target,goa_icon,anchor);},d(detaching){if(detaching)detach(goa_icon);}};}function create_fragment$3(ctx){let div1;let a;let t0;let t1;let a_href_value;let t2;let div0;let mounted;let dispose;function select_block_type(ctx,dirty){if(/*_open*/ctx[1])return create_if_block$2;return create_else_block;}let current_block_type=select_block_type(ctx);let if_block=current_block_type(ctx);return {c(){div1=element("div");a=element("a");t0=text(/*heading*/ctx[0]);t1=space();if_block.c();t2=space();div0=element("div");div0.innerHTML=`<slot></slot>`;this.c=noop;attr(a,"href",a_href_value=`#${/*_slug*/ctx[4]}`);attr(a,"class","heading");attr(div0,"class","group");attr(div0,"data-testid","group");toggle_class(div0,"hidden",!/*_open*/ctx[1]);attr(div1,"class","side-menu-group");toggle_class(div1,"current",/*_current*/ctx[2]);},m(target,anchor){insert(target,div1,anchor);append(div1,a);append(a,t0);append(a,t1);if_block.m(a,null);append(div1,t2);append(div1,div0);/*div1_binding*/ctx[6](div1);if(!mounted){dispose=listen(a,"click",/*handleClick*/ctx[5]);mounted=true;}},p(ctx,[dirty]){if(dirty&/*heading*/1)set_data(t0,/*heading*/ctx[0]);if(current_block_type!==(current_block_type=select_block_type(ctx))){if_block.d(1);if_block=current_block_type(ctx);if(if_block){if_block.c();if_block.m(a,null);}}if(dirty&/*_slug*/16&&a_href_value!==(a_href_value=`#${/*_slug*/ctx[4]}`)){attr(a,"href",a_href_value);}if(dirty&/*_open*/2){toggle_class(div0,"hidden",!/*_open*/ctx[1]);}if(dirty&/*_current*/4){toggle_class(div1,"current",/*_current*/ctx[2]);}},i:noop,o:noop,d(detaching){if(detaching)detach(div1);if_block.d();/*div1_binding*/ctx[6](null);mounted=false;dispose();}};}function toSlug(path){return path===null||path===void 0?void 0:path.toLowerCase().replace(/ /g,"-");}function
|
|
1533
|
-
checkUrlMatches();setCurrent();addEventListeners();});function checkUrlMatches(){
|
|
1529
|
+
setCurrentPage(current);}};return [mt,mr,mb,ml,_rootEl,current,div_binding];}class Pages extends SvelteElement{constructor(options){super();init(this,{target:this.shadowRoot,props:attribute_to_object(this.attributes),customElement:true},instance$5,create_fragment$5,safe_not_equal,{current:5,mt:0,mr:1,mb:2,ml:3},null);if(options){if(options.target){insert(options.target,this,options.anchor);}if(options.props){this.$set(options.props);flush();}}}static get observedAttributes(){return ["current","mt","mr","mb","ml"];}get current(){return this.$$.ctx[5];}set current(current){this.$$set({current});flush();}get mt(){return this.$$.ctx[0];}set mt(mt){this.$$set({mt});flush();}get mr(){return this.$$.ctx[1];}set mr(mr){this.$$set({mr});flush();}get mb(){return this.$$.ctx[2];}set mb(mb){this.$$set({mb});flush();}get ml(){return this.$$.ctx[3];}set ml(ml){this.$$set({ml});flush();}}customElements.define("goa-pages",Pages);function isUrlMatch(windowUrl,testUrl){if(!testUrl)return false;const pathParts=windowUrl.pathname.split("/");testUrl=testUrl.replace(/^\//,"");for(const part of pathParts){if(part===testUrl)return true;}if(windowUrl.hash===testUrl){return true;}return false;}/* src/components/side-menu/SideMenu.svelte generated by Svelte v3.59.2 */function create_fragment$4(ctx){let div;return {c(){div=element("div");div.innerHTML=`<slot></slot>`;this.c=noop;attr(div,"class","side-menu");},m(target,anchor){insert(target,div,anchor);/*div_binding*/ctx[1](div);},p:noop,i:noop,o:noop,d(detaching){if(detaching)detach(div);/*div_binding*/ctx[1](null);}};}function instance$4($$self,$$props,$$invalidate){let _rootEl;onMount(async()=>{await tick();setCurrentUrl();addEventListeners();});function setCurrentUrl(){const slot=_rootEl.querySelector("slot");if(!slot){return false;}const links=slot.assignedElements().filter(el=>el.tagName==="A");links.forEach(child=>{const current=isUrlMatch(document.location,child.getAttribute("href"));if(current){child.classList.add("current");}else {child.classList.remove("current");}});}function addEventListeners(){// watch path changes
|
|
1530
|
+
let currentLocation=document.location.href;const observer=new MutationObserver(_mutationList=>{if(isUrlMatch(document.location,currentLocation)){currentLocation=document.location.href;setCurrentUrl();}});observer.observe(document.body,{childList:true,subtree:true});// watch hash / browser history changes
|
|
1531
|
+
window.addEventListener("popstate",()=>{setCurrentUrl();});}function div_binding($$value){binding_callbacks[$$value?'unshift':'push'](()=>{_rootEl=$$value;$$invalidate(0,_rootEl);});}return [_rootEl,div_binding];}class SideMenu extends SvelteElement{constructor(options){super();const style=document.createElement('style');style.textContent=`::slotted(a),::slotted(a:visited){color:var(--goa-color-text-default) !important;display:block;font:var(--goa-typography-body-m);padding:0.5rem 1rem 0.5rem 2rem;text-decoration:none}::slotted(a.current){font:var(--goa-typography-heading-s);background:#CEDFEE}::slotted(a:hover:not(.current)){background:#CEDFEE}::slotted(a:focus-visible){outline:var(--goa-border-width-l) solid var(--goa-color-interactive-focus)}.side-menu{display:block}`;this.shadowRoot.appendChild(style);init(this,{target:this.shadowRoot,props:attribute_to_object(this.attributes),customElement:true},instance$4,create_fragment$4,safe_not_equal,{},null);if(options){if(options.target){insert(options.target,this,options.anchor);}}}}customElements.define("goa-side-menu",SideMenu);/* src/components/side-menu-group/SideMenuGroup.svelte generated by Svelte v3.59.2 */function create_else_block(ctx){let goa_icon;return {c(){goa_icon=element("goa-icon");set_custom_element_data(goa_icon,"type","chevron-forward");},m(target,anchor){insert(target,goa_icon,anchor);},d(detaching){if(detaching)detach(goa_icon);}};}// (190:4) {#if _open}
|
|
1532
|
+
function create_if_block$2(ctx){let goa_icon;return {c(){goa_icon=element("goa-icon");set_custom_element_data(goa_icon,"type","chevron-down");},m(target,anchor){insert(target,goa_icon,anchor);},d(detaching){if(detaching)detach(goa_icon);}};}function create_fragment$3(ctx){let div1;let a;let t0;let t1;let a_href_value;let t2;let div0;let mounted;let dispose;function select_block_type(ctx,dirty){if(/*_open*/ctx[1])return create_if_block$2;return create_else_block;}let current_block_type=select_block_type(ctx);let if_block=current_block_type(ctx);return {c(){div1=element("div");a=element("a");t0=text(/*heading*/ctx[0]);t1=space();if_block.c();t2=space();div0=element("div");div0.innerHTML=`<slot></slot>`;this.c=noop;attr(a,"href",a_href_value=`#${/*_slug*/ctx[4]}`);attr(a,"class","heading");attr(div0,"class","group");attr(div0,"data-testid","group");toggle_class(div0,"hidden",!/*_open*/ctx[1]);attr(div1,"class","side-menu-group");toggle_class(div1,"current",/*_current*/ctx[2]);},m(target,anchor){insert(target,div1,anchor);append(div1,a);append(a,t0);append(a,t1);if_block.m(a,null);append(div1,t2);append(div1,div0);/*div1_binding*/ctx[6](div1);if(!mounted){dispose=listen(a,"click",/*handleClick*/ctx[5]);mounted=true;}},p(ctx,[dirty]){if(dirty&/*heading*/1)set_data(t0,/*heading*/ctx[0]);if(current_block_type!==(current_block_type=select_block_type(ctx))){if_block.d(1);if_block=current_block_type(ctx);if(if_block){if_block.c();if_block.m(a,null);}}if(dirty&/*_slug*/16&&a_href_value!==(a_href_value=`#${/*_slug*/ctx[4]}`)){attr(a,"href",a_href_value);}if(dirty&/*_open*/2){toggle_class(div0,"hidden",!/*_open*/ctx[1]);}if(dirty&/*_current*/4){toggle_class(div1,"current",/*_current*/ctx[2]);}},i:noop,o:noop,d(detaching){if(detaching)detach(div1);if_block.d();/*div1_binding*/ctx[6](null);mounted=false;dispose();}};}function toSlug(path){return path===null||path===void 0?void 0:path.toLowerCase().replace(/ /g,"-");}function instance$3($$self,$$props,$$invalidate){let _slug;let{heading}=$$props;let _open=false;let _current=false;let _rootEl;onMount(async()=>{await tick();// needed to allow for window location to be read
|
|
1533
|
+
checkUrlMatches();setCurrent();addEventListeners();});function checkUrlMatches(){$$invalidate(1,_open=matchesMenu()||matchesChild(_rootEl));if(_open){notifyParent(true);}}function addEventListeners(){// listen to events by children (if child is open the parent also has to be open)
|
|
1534
1534
|
_rootEl.addEventListener("_open",()=>{$$invalidate(1,_open=true);$$invalidate(2,_current=true);});// watch path changes
|
|
1535
1535
|
let currentLocation=document.location.href;const observer=new MutationObserver(_mutationList=>{// if path change occurs
|
|
1536
1536
|
if(currentLocation!==document.location.href){currentLocation=document.location.href;setCurrent();}});observer.observe(document.body,{childList:true,subtree:true});// watch hash / browser history changes
|
|
1537
|
-
window.addEventListener("popstate",()=>{setCurrent();});}function matchesMenu(
|
|
1537
|
+
window.addEventListener("popstate",()=>{setCurrent();});}function matchesMenu(){return isUrlMatch(document.location,_slug);}function matchesChild(el){if(isUrlMatch(document.location,toSlug(el.heading))){return true;}const slot=el.querySelector("slot");if(!slot){return false;}const children=slot.assignedElements();return !!children.find(child=>{return isUrlMatch(document.location,child.getAttribute("href"));});}function setCurrent(){document.location.href;const slot=_rootEl.querySelector("slot");if(!slot){return false;}const children=slot.assignedElements();$$invalidate(2,_current=false);children.forEach(child=>{const url=child.getAttribute("href");const current=isUrlMatch(document.location,url);if(current){$$invalidate(2,_current=true);child.classList.add("current");notifyParent(true);}else {child.classList.remove("current");}// get side-menu-group (level >= 2) marked as children
|
|
1538
1538
|
if(child.tagName==="GOA-SIDE-MENU-GROUP"){child.setAttribute("child","true");}});}function handleClick(e){$$invalidate(1,_open=!_open);e.preventDefault();}function notifyParent(current){_rootEl.dispatchEvent(new CustomEvent("_open",{bubbles:true,composed:true,detail:{current}}));}function div1_binding($$value){binding_callbacks[$$value?'unshift':'push'](()=>{_rootEl=$$value;$$invalidate(3,_rootEl);});}$$self.$$set=$$props=>{if('heading'in $$props)$$invalidate(0,heading=$$props.heading);};$$self.$$.update=()=>{if($$self.$$.dirty&/*heading*/1){$$invalidate(4,_slug=toSlug(heading));}};return [heading,_open,_current,_rootEl,_slug,handleClick,div1_binding];}class SideMenuGroup extends SvelteElement{constructor(options){super();const style=document.createElement('style');style.textContent=`::slotted(a),::slotted(goa-side-menu-heading),::slotted(a:visited){color:var(--goa-color-text-default) !important;display:block;font:var(--goa-typography-body-m);margin-left:1rem}::slotted(a),::slotted(a:visited){padding:0.5rem 1rem;text-decoration:none;border-left:4px solid var(--goa-color-greyscale-100)}::slotted(a.current){font:var(--goa-typography-heading-s);border-left:4px solid var(--goa-color-interactive-disabled);background:var(--goa-color-info-background)}::slotted(a:hover:not(.current)){background:var(--goa-color-info-background);border-color:var(--goa-color-greyscale-200)}::slotted(a:focus-visible),.heading:focus-visible{outline:var(--goa-border-width-l) solid var(--goa-color-interactive-focus)}:host([child=true]) a.heading,.heading{color:var(--goa-color-text-default);display:flex;align-items:center;justify-content:space-between;line-height:2rem;padding:0.5rem 1rem 0.5rem 2rem;text-decoration:none}:host([child=true]) a.heading{margin-left:1rem;border-left:4px solid var(--goa-color-greyscale-100);padding:0.5rem 1rem 0.5rem 1rem}:host([child=true]) a.heading:hover{border-color:var(--goa-color-greyscale-200);background:var(--goa-color-info-background)}:host([child=true]) .side-menu-group.current a.heading{background:var(--goa-color-info-background);border-left:4px solid var(--goa-color-interactive-disabled)}.side-menu-group.current .heading{background:#CEDFEE}.heading:hover{background:#CEDFEE}.hidden{display:none}.group{padding-left:1rem}`;this.shadowRoot.appendChild(style);init(this,{target:this.shadowRoot,props:attribute_to_object(this.attributes),customElement:true},instance$3,create_fragment$3,safe_not_equal,{heading:0},null);if(options){if(options.target){insert(options.target,this,options.anchor);}if(options.props){this.$set(options.props);flush();}}}static get observedAttributes(){return ["heading"];}get heading(){return this.$$.ctx[0];}set heading(heading){this.$$set({heading});flush();}}customElements.define("goa-side-menu-group",SideMenuGroup);/* src/components/side-menu-heading/SideMenuHeading.svelte generated by Svelte v3.59.2 */function create_if_block$1(ctx){let goa_icon;return {c(){goa_icon=element("goa-icon");set_custom_element_data(goa_icon,"id","heading-icon");set_custom_element_data(goa_icon,"type",/*icon*/ctx[0]);set_custom_element_data(goa_icon,"theme","filled");},m(target,anchor){insert(target,goa_icon,anchor);},p(ctx,dirty){if(dirty&/*icon*/1){set_custom_element_data(goa_icon,"type",/*icon*/ctx[0]);}},d(detaching){if(detaching)detach(goa_icon);}};}function create_fragment$2(ctx){let h2;let t0;let slot0;let t1;let slot1;let if_block=/*icon*/ctx[0]&&create_if_block$1(ctx);return {c(){h2=element("h2");if(if_block)if_block.c();t0=space();slot0=element("slot");t1=space();slot1=element("slot");this.c=noop;attr(slot1,"name","meta");attr(h2,"data-testid","section-heading");toggle_class(h2,"icon",/*icon*/ctx[0]);},m(target,anchor){insert(target,h2,anchor);if(if_block)if_block.m(h2,null);append(h2,t0);append(h2,slot0);append(h2,t1);append(h2,slot1);},p(ctx,[dirty]){if(/*icon*/ctx[0]){if(if_block){if_block.p(ctx,dirty);}else {if_block=create_if_block$1(ctx);if_block.c();if_block.m(h2,t0);}}else if(if_block){if_block.d(1);if_block=null;}if(dirty&/*icon*/1){toggle_class(h2,"icon",/*icon*/ctx[0]);}},i:noop,o:noop,d(detaching){if(detaching)detach(h2);if(if_block)if_block.d();}};}function instance$2($$self,$$props,$$invalidate){let{icon=null}=$$props;$$self.$$set=$$props=>{if('icon'in $$props)$$invalidate(0,icon=$$props.icon);};return [icon];}class SideMenuHeading extends SvelteElement{constructor(options){super();const style=document.createElement('style');style.textContent=`h2{border-top:var(--goa-border-width-m) solid var(--goa-color-greyscale-200, #DCDCDC);background:var(--goa-color-greyscale-100, #F1F1F1);padding:0.75rem 0.75rem 0.5rem 1.5rem;margin:0;color:var(--goa-color-text-secondary, #666);font:var(--goa-typography-heading-s);display:flex;align-items:flex-start;gap:0.5rem}`;this.shadowRoot.appendChild(style);init(this,{target:this.shadowRoot,props:attribute_to_object(this.attributes),customElement:true},instance$2,create_fragment$2,safe_not_equal,{icon:0},null);if(options){if(options.target){insert(options.target,this,options.anchor);}if(options.props){this.$set(options.props);flush();}}}static get observedAttributes(){return ["icon"];}get icon(){return this.$$.ctx[0];}set icon(icon){this.$$set({icon});flush();}}customElements.define("goa-side-menu-heading",SideMenuHeading);/* src/components/tab/Tab.svelte generated by Svelte v3.59.2 */function create_if_block(ctx){let div;return {c(){div=element("div");div.innerHTML=`<slot></slot>`;attr(div,"role","tabpanel");},m(target,anchor){insert(target,div,anchor);},d(detaching){if(detaching)detach(div);}};}function create_fragment$1(ctx){let slot;let t0;let t1;let if_block_anchor;let if_block=/*_isOpen*/ctx[1]&&create_if_block();return {c(){slot=element("slot");t0=text(/*heading*/ctx[0]);t1=space();if(if_block)if_block.c();if_block_anchor=empty();this.c=noop;set_style(slot,"display","none");attr(slot,"name","heading");},m(target,anchor){insert(target,slot,anchor);append(slot,t0);insert(target,t1,anchor);if(if_block)if_block.m(target,anchor);insert(target,if_block_anchor,anchor);},p(ctx,[dirty]){if(dirty&/*heading*/1)set_data(t0,/*heading*/ctx[0]);if(/*_isOpen*/ctx[1]){if(if_block);else {if_block=create_if_block();if_block.c();if_block.m(if_block_anchor.parentNode,if_block_anchor);}}else if(if_block){if_block.d(1);if_block=null;}},i:noop,o:noop,d(detaching){if(detaching)detach(slot);if(detaching)detach(t1);if(if_block)if_block.d(detaching);if(detaching)detach(if_block_anchor);}};}function instance$1($$self,$$props,$$invalidate){let{heading=""}=$$props;let{open="false"}=$$props;let _isOpen;$$self.$$set=$$props=>{if('heading'in $$props)$$invalidate(0,heading=$$props.heading);if('open'in $$props)$$invalidate(2,open=$$props.open);};$$self.$$.update=()=>{if($$self.$$.dirty&/*open*/4){$$invalidate(1,_isOpen=toBoolean(open));}};return [heading,_isOpen,open];}class Tab extends SvelteElement{constructor(options){super();const style=document.createElement('style');style.textContent=`[role=tabpanel]{padding-top:2rem}`;this.shadowRoot.appendChild(style);init(this,{target:this.shadowRoot,props:attribute_to_object(this.attributes),customElement:true},instance$1,create_fragment$1,safe_not_equal,{heading:0,open:2},null);if(options){if(options.target){insert(options.target,this,options.anchor);}if(options.props){this.$set(options.props);flush();}}}static get observedAttributes(){return ["heading","open"];}get heading(){return this.$$.ctx[0];}set heading(heading){this.$$set({heading});flush();}get open(){return this.$$.ctx[2];}set open(open){this.$$set({open});flush();}}customElements.define("goa-tab",Tab);/* src/components/tabs/Tabs.svelte generated by Svelte v3.59.2 */function create_fragment(ctx){let div2;let div0;let t0;let div1;let t1;let button0;let t2;let button1;return {c(){div2=element("div");div0=element("div");t0=space();div1=element("div");div1.innerHTML=`<slot></slot>`;t1=space();button0=element("button");button0.innerHTML=`<div class="tab"></div>`;t2=space();button1=element("button");this.c=noop;attr(div0,"class","tabs");attr(div1,"class","tabpanel");attr(div1,"tabindex","0");attr(div1,"role","tabpanel");attr(div2,"role","tablist");attr(button0,"role","tab");attr(button0,"aria-selected","false");set_style(button0,"display","none");attr(button1,"role","tab");attr(button1,"aria-selected","true");set_style(button1,"display","none");},m(target,anchor){insert(target,div2,anchor);append(div2,div0);/*div0_binding*/ctx[4](div0);append(div2,t0);append(div2,div1);/*div1_binding*/ctx[5](div1);/*div2_binding*/ctx[6](div2);insert(target,t1,anchor);insert(target,button0,anchor);insert(target,t2,anchor);insert(target,button1,anchor);},p:noop,i:noop,o:noop,d(detaching){if(detaching)detach(div2);/*div0_binding*/ctx[4](null);/*div1_binding*/ctx[5](null);/*div2_binding*/ctx[6](null);if(detaching)detach(t1);if(detaching)detach(button0);if(detaching)detach(t2);if(detaching)detach(button1);}};}function instance($$self,$$props,$$invalidate){let{initialtab=1}=$$props;// Private
|
|
1539
1539
|
let _rootEl;let _tabItems=[];let _tabs;let _panelEl;let _currentTab=1;// ========
|
|
1540
1540
|
// Hooks
|
|
@@ -2919,7 +2919,6 @@ const GoAModal = ({
|
|
|
2919
2919
|
ref: el,
|
|
2920
2920
|
open: open,
|
|
2921
2921
|
closable: !!onClose,
|
|
2922
|
-
scrollable: true,
|
|
2923
2922
|
maxwidth: maxWidth,
|
|
2924
2923
|
transition: transition,
|
|
2925
2924
|
calloutVariant: calloutVariant,
|
package/react-components.umd.js
CHANGED
|
@@ -1528,15 +1528,15 @@
|
|
|
1528
1528
|
let _rootEl;// Hooks
|
|
1529
1529
|
onMount(function(){return _call(tick,function(){setCurrentPage(current);});});function setCurrentPage(current){if(!_rootEl)return;const children=getChildren();children.forEach((child,index)=>{const _child=child;_child.style.display=index+1===+current?"block":"none";});}function getChildren(){const slot=_rootEl.querySelector("slot");if(slot){return [...slot.assignedElements()];}else {return [..._rootEl.children];// unit tests
|
|
1530
1530
|
}}function div_binding($$value){binding_callbacks[$$value?'unshift':'push'](()=>{_rootEl=$$value;$$invalidate(4,_rootEl);});}$$self.$$set=$$props=>{if('current'in $$props)$$invalidate(5,current=$$props.current);if('mt'in $$props)$$invalidate(0,mt=$$props.mt);if('mr'in $$props)$$invalidate(1,mr=$$props.mr);if('mb'in $$props)$$invalidate(2,mb=$$props.mb);if('ml'in $$props)$$invalidate(3,ml=$$props.ml);};$$self.$$.update=()=>{if($$self.$$.dirty&/*current*/32){// Reactive
|
|
1531
|
-
setCurrentPage(current);}};return [mt,mr,mb,ml,_rootEl,current,div_binding];}class Pages extends SvelteElement{constructor(options){super();init(this,{target:this.shadowRoot,props:attribute_to_object(this.attributes),customElement:true},instance$5,create_fragment$5,safe_not_equal,{current:5,mt:0,mr:1,mb:2,ml:3},null);if(options){if(options.target){insert(options.target,this,options.anchor);}if(options.props){this.$set(options.props);flush();}}}static get observedAttributes(){return ["current","mt","mr","mb","ml"];}get current(){return this.$$.ctx[5];}set current(current){this.$$set({current});flush();}get mt(){return this.$$.ctx[0];}set mt(mt){this.$$set({mt});flush();}get mr(){return this.$$.ctx[1];}set mr(mr){this.$$set({mr});flush();}get mb(){return this.$$.ctx[2];}set mb(mb){this.$$set({mb});flush();}get ml(){return this.$$.ctx[3];}set ml(ml){this.$$set({ml});flush();}}customElements.define("goa-pages",Pages)
|
|
1532
|
-
let currentLocation=document.location.href;const observer=new MutationObserver(_mutationList=>{if(
|
|
1533
|
-
window.addEventListener("popstate",()=>{
|
|
1534
|
-
function create_if_block$2(ctx){let goa_icon;return {c(){goa_icon=element("goa-icon");set_custom_element_data(goa_icon,"type","chevron-down");},m(target,anchor){insert(target,goa_icon,anchor);},d(detaching){if(detaching)detach(goa_icon);}};}function create_fragment$3(ctx){let div1;let a;let t0;let t1;let a_href_value;let t2;let div0;let mounted;let dispose;function select_block_type(ctx,dirty){if(/*_open*/ctx[1])return create_if_block$2;return create_else_block;}let current_block_type=select_block_type(ctx);let if_block=current_block_type(ctx);return {c(){div1=element("div");a=element("a");t0=text(/*heading*/ctx[0]);t1=space();if_block.c();t2=space();div0=element("div");div0.innerHTML=`<slot></slot>`;this.c=noop;attr(a,"href",a_href_value=`#${/*_slug*/ctx[4]}`);attr(a,"class","heading");attr(div0,"class","group");attr(div0,"data-testid","group");toggle_class(div0,"hidden",!/*_open*/ctx[1]);attr(div1,"class","side-menu-group");toggle_class(div1,"current",/*_current*/ctx[2]);},m(target,anchor){insert(target,div1,anchor);append(div1,a);append(a,t0);append(a,t1);if_block.m(a,null);append(div1,t2);append(div1,div0);/*div1_binding*/ctx[6](div1);if(!mounted){dispose=listen(a,"click",/*handleClick*/ctx[5]);mounted=true;}},p(ctx,[dirty]){if(dirty&/*heading*/1)set_data(t0,/*heading*/ctx[0]);if(current_block_type!==(current_block_type=select_block_type(ctx))){if_block.d(1);if_block=current_block_type(ctx);if(if_block){if_block.c();if_block.m(a,null);}}if(dirty&/*_slug*/16&&a_href_value!==(a_href_value=`#${/*_slug*/ctx[4]}`)){attr(a,"href",a_href_value);}if(dirty&/*_open*/2){toggle_class(div0,"hidden",!/*_open*/ctx[1]);}if(dirty&/*_current*/4){toggle_class(div1,"current",/*_current*/ctx[2]);}},i:noop,o:noop,d(detaching){if(detaching)detach(div1);if_block.d();/*div1_binding*/ctx[6](null);mounted=false;dispose();}};}function toSlug(path){return path===null||path===void 0?void 0:path.toLowerCase().replace(/ /g,"-");}function
|
|
1535
|
-
checkUrlMatches();setCurrent();addEventListeners();});});function checkUrlMatches(){
|
|
1531
|
+
setCurrentPage(current);}};return [mt,mr,mb,ml,_rootEl,current,div_binding];}class Pages extends SvelteElement{constructor(options){super();init(this,{target:this.shadowRoot,props:attribute_to_object(this.attributes),customElement:true},instance$5,create_fragment$5,safe_not_equal,{current:5,mt:0,mr:1,mb:2,ml:3},null);if(options){if(options.target){insert(options.target,this,options.anchor);}if(options.props){this.$set(options.props);flush();}}}static get observedAttributes(){return ["current","mt","mr","mb","ml"];}get current(){return this.$$.ctx[5];}set current(current){this.$$set({current});flush();}get mt(){return this.$$.ctx[0];}set mt(mt){this.$$set({mt});flush();}get mr(){return this.$$.ctx[1];}set mr(mr){this.$$set({mr});flush();}get mb(){return this.$$.ctx[2];}set mb(mb){this.$$set({mb});flush();}get ml(){return this.$$.ctx[3];}set ml(ml){this.$$set({ml});flush();}}customElements.define("goa-pages",Pages);function isUrlMatch(windowUrl,testUrl){if(!testUrl)return false;const pathParts=windowUrl.pathname.split("/");testUrl=testUrl.replace(/^\//,"");for(const part of pathParts){if(part===testUrl)return true;}if(windowUrl.hash===testUrl){return true;}return false;}/* src/components/side-menu/SideMenu.svelte generated by Svelte v3.59.2 */function create_fragment$4(ctx){let div;return {c(){div=element("div");div.innerHTML=`<slot></slot>`;this.c=noop;attr(div,"class","side-menu");},m(target,anchor){insert(target,div,anchor);/*div_binding*/ctx[1](div);},p:noop,i:noop,o:noop,d(detaching){if(detaching)detach(div);/*div_binding*/ctx[1](null);}};}function instance$4($$self,$$props,$$invalidate){let _rootEl;onMount(function(){return _call(tick,function(){setCurrentUrl();addEventListeners();});});function setCurrentUrl(){const slot=_rootEl.querySelector("slot");if(!slot){return false;}const links=slot.assignedElements().filter(el=>el.tagName==="A");links.forEach(child=>{const current=isUrlMatch(document.location,child.getAttribute("href"));if(current){child.classList.add("current");}else {child.classList.remove("current");}});}function addEventListeners(){// watch path changes
|
|
1532
|
+
let currentLocation=document.location.href;const observer=new MutationObserver(_mutationList=>{if(isUrlMatch(document.location,currentLocation)){currentLocation=document.location.href;setCurrentUrl();}});observer.observe(document.body,{childList:true,subtree:true});// watch hash / browser history changes
|
|
1533
|
+
window.addEventListener("popstate",()=>{setCurrentUrl();});}function div_binding($$value){binding_callbacks[$$value?'unshift':'push'](()=>{_rootEl=$$value;$$invalidate(0,_rootEl);});}return [_rootEl,div_binding];}class SideMenu extends SvelteElement{constructor(options){super();const style=document.createElement('style');style.textContent=`::slotted(a),::slotted(a:visited){color:var(--goa-color-text-default) !important;display:block;font:var(--goa-typography-body-m);padding:0.5rem 1rem 0.5rem 2rem;text-decoration:none}::slotted(a.current){font:var(--goa-typography-heading-s);background:#CEDFEE}::slotted(a:hover:not(.current)){background:#CEDFEE}::slotted(a:focus-visible){outline:var(--goa-border-width-l) solid var(--goa-color-interactive-focus)}.side-menu{display:block}`;this.shadowRoot.appendChild(style);init(this,{target:this.shadowRoot,props:attribute_to_object(this.attributes),customElement:true},instance$4,create_fragment$4,safe_not_equal,{},null);if(options){if(options.target){insert(options.target,this,options.anchor);}}}}customElements.define("goa-side-menu",SideMenu);/* src/components/side-menu-group/SideMenuGroup.svelte generated by Svelte v3.59.2 */function create_else_block(ctx){let goa_icon;return {c(){goa_icon=element("goa-icon");set_custom_element_data(goa_icon,"type","chevron-forward");},m(target,anchor){insert(target,goa_icon,anchor);},d(detaching){if(detaching)detach(goa_icon);}};}// (190:4) {#if _open}
|
|
1534
|
+
function create_if_block$2(ctx){let goa_icon;return {c(){goa_icon=element("goa-icon");set_custom_element_data(goa_icon,"type","chevron-down");},m(target,anchor){insert(target,goa_icon,anchor);},d(detaching){if(detaching)detach(goa_icon);}};}function create_fragment$3(ctx){let div1;let a;let t0;let t1;let a_href_value;let t2;let div0;let mounted;let dispose;function select_block_type(ctx,dirty){if(/*_open*/ctx[1])return create_if_block$2;return create_else_block;}let current_block_type=select_block_type(ctx);let if_block=current_block_type(ctx);return {c(){div1=element("div");a=element("a");t0=text(/*heading*/ctx[0]);t1=space();if_block.c();t2=space();div0=element("div");div0.innerHTML=`<slot></slot>`;this.c=noop;attr(a,"href",a_href_value=`#${/*_slug*/ctx[4]}`);attr(a,"class","heading");attr(div0,"class","group");attr(div0,"data-testid","group");toggle_class(div0,"hidden",!/*_open*/ctx[1]);attr(div1,"class","side-menu-group");toggle_class(div1,"current",/*_current*/ctx[2]);},m(target,anchor){insert(target,div1,anchor);append(div1,a);append(a,t0);append(a,t1);if_block.m(a,null);append(div1,t2);append(div1,div0);/*div1_binding*/ctx[6](div1);if(!mounted){dispose=listen(a,"click",/*handleClick*/ctx[5]);mounted=true;}},p(ctx,[dirty]){if(dirty&/*heading*/1)set_data(t0,/*heading*/ctx[0]);if(current_block_type!==(current_block_type=select_block_type(ctx))){if_block.d(1);if_block=current_block_type(ctx);if(if_block){if_block.c();if_block.m(a,null);}}if(dirty&/*_slug*/16&&a_href_value!==(a_href_value=`#${/*_slug*/ctx[4]}`)){attr(a,"href",a_href_value);}if(dirty&/*_open*/2){toggle_class(div0,"hidden",!/*_open*/ctx[1]);}if(dirty&/*_current*/4){toggle_class(div1,"current",/*_current*/ctx[2]);}},i:noop,o:noop,d(detaching){if(detaching)detach(div1);if_block.d();/*div1_binding*/ctx[6](null);mounted=false;dispose();}};}function toSlug(path){return path===null||path===void 0?void 0:path.toLowerCase().replace(/ /g,"-");}function instance$3($$self,$$props,$$invalidate){let _slug;let{heading}=$$props;let _open=false;let _current=false;let _rootEl;onMount(function(){return _call(tick,function(){// needed to allow for window location to be read
|
|
1535
|
+
checkUrlMatches();setCurrent();addEventListeners();});});function checkUrlMatches(){$$invalidate(1,_open=matchesMenu()||matchesChild(_rootEl));if(_open){notifyParent(true);}}function addEventListeners(){// listen to events by children (if child is open the parent also has to be open)
|
|
1536
1536
|
_rootEl.addEventListener("_open",()=>{$$invalidate(1,_open=true);$$invalidate(2,_current=true);});// watch path changes
|
|
1537
1537
|
let currentLocation=document.location.href;const observer=new MutationObserver(_mutationList=>{// if path change occurs
|
|
1538
1538
|
if(currentLocation!==document.location.href){currentLocation=document.location.href;setCurrent();}});observer.observe(document.body,{childList:true,subtree:true});// watch hash / browser history changes
|
|
1539
|
-
window.addEventListener("popstate",()=>{setCurrent();});}function matchesMenu(
|
|
1539
|
+
window.addEventListener("popstate",()=>{setCurrent();});}function matchesMenu(){return isUrlMatch(document.location,_slug);}function matchesChild(el){if(isUrlMatch(document.location,toSlug(el.heading))){return true;}const slot=el.querySelector("slot");if(!slot){return false;}const children=slot.assignedElements();return !!children.find(child=>{return isUrlMatch(document.location,child.getAttribute("href"));});}function setCurrent(){document.location.href;const slot=_rootEl.querySelector("slot");if(!slot){return false;}const children=slot.assignedElements();$$invalidate(2,_current=false);children.forEach(child=>{const url=child.getAttribute("href");const current=isUrlMatch(document.location,url);if(current){$$invalidate(2,_current=true);child.classList.add("current");notifyParent(true);}else {child.classList.remove("current");}// get side-menu-group (level >= 2) marked as children
|
|
1540
1540
|
if(child.tagName==="GOA-SIDE-MENU-GROUP"){child.setAttribute("child","true");}});}function handleClick(e){$$invalidate(1,_open=!_open);e.preventDefault();}function notifyParent(current){_rootEl.dispatchEvent(new CustomEvent("_open",{bubbles:true,composed:true,detail:{current}}));}function div1_binding($$value){binding_callbacks[$$value?'unshift':'push'](()=>{_rootEl=$$value;$$invalidate(3,_rootEl);});}$$self.$$set=$$props=>{if('heading'in $$props)$$invalidate(0,heading=$$props.heading);};$$self.$$.update=()=>{if($$self.$$.dirty&/*heading*/1){$$invalidate(4,_slug=toSlug(heading));}};return [heading,_open,_current,_rootEl,_slug,handleClick,div1_binding];}class SideMenuGroup extends SvelteElement{constructor(options){super();const style=document.createElement('style');style.textContent=`::slotted(a),::slotted(goa-side-menu-heading),::slotted(a:visited){color:var(--goa-color-text-default) !important;display:block;font:var(--goa-typography-body-m);margin-left:1rem}::slotted(a),::slotted(a:visited){padding:0.5rem 1rem;text-decoration:none;border-left:4px solid var(--goa-color-greyscale-100)}::slotted(a.current){font:var(--goa-typography-heading-s);border-left:4px solid var(--goa-color-interactive-disabled);background:var(--goa-color-info-background)}::slotted(a:hover:not(.current)){background:var(--goa-color-info-background);border-color:var(--goa-color-greyscale-200)}::slotted(a:focus-visible),.heading:focus-visible{outline:var(--goa-border-width-l) solid var(--goa-color-interactive-focus)}:host([child=true]) a.heading,.heading{color:var(--goa-color-text-default);display:flex;align-items:center;justify-content:space-between;line-height:2rem;padding:0.5rem 1rem 0.5rem 2rem;text-decoration:none}:host([child=true]) a.heading{margin-left:1rem;border-left:4px solid var(--goa-color-greyscale-100);padding:0.5rem 1rem 0.5rem 1rem}:host([child=true]) a.heading:hover{border-color:var(--goa-color-greyscale-200);background:var(--goa-color-info-background)}:host([child=true]) .side-menu-group.current a.heading{background:var(--goa-color-info-background);border-left:4px solid var(--goa-color-interactive-disabled)}.side-menu-group.current .heading{background:#CEDFEE}.heading:hover{background:#CEDFEE}.hidden{display:none}.group{padding-left:1rem}`;this.shadowRoot.appendChild(style);init(this,{target:this.shadowRoot,props:attribute_to_object(this.attributes),customElement:true},instance$3,create_fragment$3,safe_not_equal,{heading:0},null);if(options){if(options.target){insert(options.target,this,options.anchor);}if(options.props){this.$set(options.props);flush();}}}static get observedAttributes(){return ["heading"];}get heading(){return this.$$.ctx[0];}set heading(heading){this.$$set({heading});flush();}}customElements.define("goa-side-menu-group",SideMenuGroup);/* src/components/side-menu-heading/SideMenuHeading.svelte generated by Svelte v3.59.2 */function create_if_block$1(ctx){let goa_icon;return {c(){goa_icon=element("goa-icon");set_custom_element_data(goa_icon,"id","heading-icon");set_custom_element_data(goa_icon,"type",/*icon*/ctx[0]);set_custom_element_data(goa_icon,"theme","filled");},m(target,anchor){insert(target,goa_icon,anchor);},p(ctx,dirty){if(dirty&/*icon*/1){set_custom_element_data(goa_icon,"type",/*icon*/ctx[0]);}},d(detaching){if(detaching)detach(goa_icon);}};}function create_fragment$2(ctx){let h2;let t0;let slot0;let t1;let slot1;let if_block=/*icon*/ctx[0]&&create_if_block$1(ctx);return {c(){h2=element("h2");if(if_block)if_block.c();t0=space();slot0=element("slot");t1=space();slot1=element("slot");this.c=noop;attr(slot1,"name","meta");attr(h2,"data-testid","section-heading");toggle_class(h2,"icon",/*icon*/ctx[0]);},m(target,anchor){insert(target,h2,anchor);if(if_block)if_block.m(h2,null);append(h2,t0);append(h2,slot0);append(h2,t1);append(h2,slot1);},p(ctx,[dirty]){if(/*icon*/ctx[0]){if(if_block){if_block.p(ctx,dirty);}else {if_block=create_if_block$1(ctx);if_block.c();if_block.m(h2,t0);}}else if(if_block){if_block.d(1);if_block=null;}if(dirty&/*icon*/1){toggle_class(h2,"icon",/*icon*/ctx[0]);}},i:noop,o:noop,d(detaching){if(detaching)detach(h2);if(if_block)if_block.d();}};}function instance$2($$self,$$props,$$invalidate){let{icon=null}=$$props;$$self.$$set=$$props=>{if('icon'in $$props)$$invalidate(0,icon=$$props.icon);};return [icon];}class SideMenuHeading extends SvelteElement{constructor(options){super();const style=document.createElement('style');style.textContent=`h2{border-top:var(--goa-border-width-m) solid var(--goa-color-greyscale-200, #DCDCDC);background:var(--goa-color-greyscale-100, #F1F1F1);padding:0.75rem 0.75rem 0.5rem 1.5rem;margin:0;color:var(--goa-color-text-secondary, #666);font:var(--goa-typography-heading-s);display:flex;align-items:flex-start;gap:0.5rem}`;this.shadowRoot.appendChild(style);init(this,{target:this.shadowRoot,props:attribute_to_object(this.attributes),customElement:true},instance$2,create_fragment$2,safe_not_equal,{icon:0},null);if(options){if(options.target){insert(options.target,this,options.anchor);}if(options.props){this.$set(options.props);flush();}}}static get observedAttributes(){return ["icon"];}get icon(){return this.$$.ctx[0];}set icon(icon){this.$$set({icon});flush();}}customElements.define("goa-side-menu-heading",SideMenuHeading);/* src/components/tab/Tab.svelte generated by Svelte v3.59.2 */function create_if_block(ctx){let div;return {c(){div=element("div");div.innerHTML=`<slot></slot>`;attr(div,"role","tabpanel");},m(target,anchor){insert(target,div,anchor);},d(detaching){if(detaching)detach(div);}};}function create_fragment$1(ctx){let slot;let t0;let t1;let if_block_anchor;let if_block=/*_isOpen*/ctx[1]&&create_if_block();return {c(){slot=element("slot");t0=text(/*heading*/ctx[0]);t1=space();if(if_block)if_block.c();if_block_anchor=empty();this.c=noop;set_style(slot,"display","none");attr(slot,"name","heading");},m(target,anchor){insert(target,slot,anchor);append(slot,t0);insert(target,t1,anchor);if(if_block)if_block.m(target,anchor);insert(target,if_block_anchor,anchor);},p(ctx,[dirty]){if(dirty&/*heading*/1)set_data(t0,/*heading*/ctx[0]);if(/*_isOpen*/ctx[1]){if(if_block);else {if_block=create_if_block();if_block.c();if_block.m(if_block_anchor.parentNode,if_block_anchor);}}else if(if_block){if_block.d(1);if_block=null;}},i:noop,o:noop,d(detaching){if(detaching)detach(slot);if(detaching)detach(t1);if(if_block)if_block.d(detaching);if(detaching)detach(if_block_anchor);}};}function instance$1($$self,$$props,$$invalidate){let{heading=""}=$$props;let{open="false"}=$$props;let _isOpen;$$self.$$set=$$props=>{if('heading'in $$props)$$invalidate(0,heading=$$props.heading);if('open'in $$props)$$invalidate(2,open=$$props.open);};$$self.$$.update=()=>{if($$self.$$.dirty&/*open*/4){$$invalidate(1,_isOpen=toBoolean(open));}};return [heading,_isOpen,open];}class Tab extends SvelteElement{constructor(options){super();const style=document.createElement('style');style.textContent=`[role=tabpanel]{padding-top:2rem}`;this.shadowRoot.appendChild(style);init(this,{target:this.shadowRoot,props:attribute_to_object(this.attributes),customElement:true},instance$1,create_fragment$1,safe_not_equal,{heading:0,open:2},null);if(options){if(options.target){insert(options.target,this,options.anchor);}if(options.props){this.$set(options.props);flush();}}}static get observedAttributes(){return ["heading","open"];}get heading(){return this.$$.ctx[0];}set heading(heading){this.$$set({heading});flush();}get open(){return this.$$.ctx[2];}set open(open){this.$$set({open});flush();}}customElements.define("goa-tab",Tab);/* src/components/tabs/Tabs.svelte generated by Svelte v3.59.2 */function create_fragment(ctx){let div2;let div0;let t0;let div1;let t1;let button0;let t2;let button1;return {c(){div2=element("div");div0=element("div");t0=space();div1=element("div");div1.innerHTML=`<slot></slot>`;t1=space();button0=element("button");button0.innerHTML=`<div class="tab"></div>`;t2=space();button1=element("button");this.c=noop;attr(div0,"class","tabs");attr(div1,"class","tabpanel");attr(div1,"tabindex","0");attr(div1,"role","tabpanel");attr(div2,"role","tablist");attr(button0,"role","tab");attr(button0,"aria-selected","false");set_style(button0,"display","none");attr(button1,"role","tab");attr(button1,"aria-selected","true");set_style(button1,"display","none");},m(target,anchor){insert(target,div2,anchor);append(div2,div0);/*div0_binding*/ctx[4](div0);append(div2,t0);append(div2,div1);/*div1_binding*/ctx[5](div1);/*div2_binding*/ctx[6](div2);insert(target,t1,anchor);insert(target,button0,anchor);insert(target,t2,anchor);insert(target,button1,anchor);},p:noop,i:noop,o:noop,d(detaching){if(detaching)detach(div2);/*div0_binding*/ctx[4](null);/*div1_binding*/ctx[5](null);/*div2_binding*/ctx[6](null);if(detaching)detach(t1);if(detaching)detach(button0);if(detaching)detach(t2);if(detaching)detach(button1);}};}function instance($$self,$$props,$$invalidate){let{initialtab=1}=$$props;// Private
|
|
1541
1541
|
let _rootEl;let _tabItems=[];let _tabs;let _panelEl;let _currentTab=1;// ========
|
|
1542
1542
|
// Hooks
|
|
@@ -2911,7 +2911,6 @@
|
|
|
2911
2911
|
ref: el,
|
|
2912
2912
|
open: open,
|
|
2913
2913
|
closable: !!onClose,
|
|
2914
|
-
scrollable: true,
|
|
2915
2914
|
maxwidth: maxWidth,
|
|
2916
2915
|
transition: transition,
|
|
2917
2916
|
calloutVariant: calloutVariant,
|