@abgov/react-components 4.17.0-alpha.6 → 4.17.0-alpha.8
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/package.json +1 -1
- package/react-components.esm.js +38 -39
- package/react-components.umd.js +38 -39
package/package.json
CHANGED
package/react-components.esm.js
CHANGED
|
@@ -165,35 +165,33 @@ function create_if_block_2$c(ctx){let div;let t;return {c(){div=element("div");t
|
|
|
165
165
|
goa-container--${/*type*/ctx[0]}
|
|
166
166
|
padding--${/*padding*/ctx[2]}
|
|
167
167
|
accent--${/*accent*/ctx[1]}
|
|
168
|
-
`)){attr(div3,"class",div3_class_value);}},i:noop,o:noop,d(detaching){if(detaching)detach(div3);}};}function instance$J($$self,$$props,$$invalidate){const[Types,validateType]=typeValidator("Container type",["interactive","info","error","success","important","non-interactive"]);const[Accents,validateAccent]=typeValidator("Container accent",["thick","thin","filled"]);const[Paddings,validatePadding]=typeValidator("Container padding",["relaxed","compact"]);let{type="interactive"}=$$props;let{accent="filled"}=$$props;let{padding="relaxed"}=$$props;let{testid=""}=$$props;let{mt=null}=$$props;let{mr=null}=$$props;let{mb="m"}=$$props;let{ml=null}=$$props;onMount(()=>{validateType(type);validateAccent(accent);validatePadding(padding);});$$self.$$set=$$props=>{if('type'in $$props)$$invalidate(0,type=$$props.type);if('accent'in $$props)$$invalidate(1,accent=$$props.accent);if('padding'in $$props)$$invalidate(2,padding=$$props.padding);if('testid'in $$props)$$invalidate(3,testid=$$props.testid);if('mt'in $$props)$$invalidate(4,mt=$$props.mt);if('mr'in $$props)$$invalidate(5,mr=$$props.mr);if('mb'in $$props)$$invalidate(6,mb=$$props.mb);if('ml'in $$props)$$invalidate(7,ml=$$props.ml);};return [type,accent,padding,testid,mt,mr,mb,ml];}class Container extends SvelteElement{constructor(options){super();const style=document.createElement('style');style.textContent=`:host{box-sizing:border-box;font-family:var(--goa-font-family-sans);font-size:var(--goa-font-size-4);display:flex;flex:1 1 auto}.goa-container{box-sizing:border-box;display:flex;flex:1 1 auto;flex-direction:column}.goa-container *{box-sizing:border-box}header{display:flex;align-items:center;justify-content:space-between;font-weight:700;font-size:var(--goa-font-size-4);border-width:1px;border-style:solid;border-top-left-radius:var(--goa-border-radius-m);border-top-right-radius:var(--goa-border-radius-m)}.content{border-bottom:1px solid var(--goa-color-greyscale-200);border-left:1px solid var(--goa-color-greyscale-200);border-right:1px solid var(--goa-color-greyscale-200);border-bottom-left-radius:var(--goa-border-radius-m);border-bottom-right-radius:var(--goa-border-radius-m);display:flex;flex:1 1 auto;flex-direction:column}.content ::slotted(p:last-child){margin-bottom:0 !important}.goa-container--non-interactive.accent--filled .content{border-color:var(--goa-color-greyscale-200);background-color:var(--goa-color-greyscale-100)}.goa-container--important.accent--filled .content{border-color:var(--goa-color-warning-default);background-color:var(--goa-color-warning-background)}.goa-container--error.accent--filled .content{border-color:var(--goa-color-emergency-default);background-color:var(--goa-color-emergency-background)}.goa-container--success.accent--filled .content{border-color:var(--goa-color-success-default);background-color:var(--goa-color-success-background)}.goa-container--info.accent--filled .content{border-color:var(--goa-color-info-default);background-color:var(--goa-color-info-background)}.title,.actions{padding:0.5rem 0}.padding--relaxed header{padding:0 1.5rem}.padding--relaxed .content{padding:1.5rem}.padding--compact header,.padding--compact .content{padding:0 1rem}.padding--compact header{padding:0 1rem}.padding--compact .content{padding:1rem}@media screen and (max-width: 623px){.padding--relaxed header{padding:0 1rem}.padding--relaxed .content{padding:1rem}}.goa-container--non-interactive header{background-color:var(--goa-color-greyscale-100);border-color:var(--goa-color-greyscale-200);color:var(--goa-color-greyscale-black)}.goa-container--interactive header{background-color:var(--goa-color-brand-default);border-color:var(--goa-color-brand-default);color:var(--goa-color-greyscale-white)}.goa-container--info header{background-color:var(--goa-color-info-default);border-color:var(--goa-color-info-default);color:var(--goa-color-greyscale-white)}.goa-container--error header{background-color:var(--goa-color-emergency-default);border-color:var(--goa-color-emergency-default);color:var(--goa-color-greyscale-white)}.goa-container--success header{background-color:var(--goa-color-success-default);border-color:var(--goa-color-success-default);color:var(--goa-color-greyscale-white)}.goa-container--important header{background-color:var(--goa-color-warning-default);border-color:var(--goa-color-warning-default);color:var(--goa-color-greyscale-white)}.heading--thick{padding:0.5rem 1.5rem;max-height:3rem;min-height:1rem}.heading--thick .title{line-height:2rem}.heading--thin{height:0.5rem}.heading--filled{display:none}.heading--filled~.content{border-top:1px solid var(--goa-color-greyscale-200);border-top-left-radius:var(--goa-border-radius-m);border-top-right-radius:var(--goa-border-radius-m)}.heading--thin .title,.heading--thin .actions{display:none}.actions{display:flex;align-items:center}`;this.shadowRoot.appendChild(style);init(this,{target:this.shadowRoot,props:attribute_to_object(this.attributes),customElement:true},instance$J,create_fragment$M,safe_not_equal,{type:0,accent:1,padding:2,testid:3,mt:4,mr:5,mb:6,ml:7},null);if(options){if(options.target){insert(options.target,this,options.anchor);}if(options.props){this.$set(options.props);flush();}}}static get observedAttributes(){return ["type","accent","padding","testid","mt","mr","mb","ml"];}get type(){return this.$$.ctx[0];}set type(type){this.$$set({type});flush();}get accent(){return this.$$.ctx[1];}set accent(accent){this.$$set({accent});flush();}get padding(){return this.$$.ctx[2];}set padding(padding){this.$$set({padding});flush();}get testid(){return this.$$.ctx[3];}set testid(testid){this.$$set({testid});flush();}get mt(){return this.$$.ctx[4];}set mt(mt){this.$$set({mt});flush();}get mr(){return this.$$.ctx[5];}set mr(mr){this.$$set({mr});flush();}get mb(){return this.$$.ctx[6];}set mb(mb){this.$$set({mb});flush();}get ml(){return this.$$.ctx[7];}set ml(ml){this.$$set({ml});flush();}}customElements.define("goa-container",Container);/* src/components/details/Details.svelte generated by Svelte v3.59.2 */function create_fragment$L(ctx){let details;let summary;let goa_icon;let goa_icon_fillcolor_value;let t0;let span;let t1;let t2;let div;let details_style_value;let mounted;let dispose;return {c(){details=element("details");summary=element("summary");goa_icon=element("goa-icon");t0=space();span=element("span");t1=text(/*heading*/ctx[1]);t2=space();div=element("div");div.innerHTML=`<slot></slot>`;this.c=noop;set_custom_element_data(goa_icon,"mt","1");set_custom_element_data(goa_icon,"mr","2");set_custom_element_data(goa_icon,"type","chevron-forward");set_custom_element_data(goa_icon,"fillcolor",goa_icon_fillcolor_value=/*_isMouseOver*/ctx[6]?"var(--goa-color-interactive-hover)":"var(--goa-color-interactive-default)");attr(div,"class","content");details.open=/*_isOpen*/ctx[9];attr(details,"style",details_style_value=calculateMargin(/*mt*/ctx[2],/*mr*/ctx[3],/*mb*/ctx[4],/*ml*/ctx[5]));},m(target,anchor){insert(target,details,anchor);append(details,summary);append(summary,goa_icon);append(summary,t0);append(summary,span);append(span,t1);/*summary_binding*/ctx[10](summary);append(details,t2);append(details,div);/*details_binding*/ctx[11](details);if(!mounted){dispose=listen(details,"toggle",/*toggle_handler*/ctx[12]);mounted=true;}},p(ctx,[dirty]){if(dirty&/*_isMouseOver*/64&&goa_icon_fillcolor_value!==(goa_icon_fillcolor_value=/*_isMouseOver*/ctx[6]?"var(--goa-color-interactive-hover)":"var(--goa-color-interactive-default)")){set_custom_element_data(goa_icon,"fillcolor",goa_icon_fillcolor_value);}if(dirty&/*heading*/2)set_data(t1,/*heading*/ctx[1]);if(dirty&/*_isOpen*/512){details.open=/*_isOpen*/ctx[9];}if(dirty&/*mt, mr, mb, ml*/60&&details_style_value!==(details_style_value=calculateMargin(/*mt*/ctx[2],/*mr*/ctx[3],/*mb*/ctx[4],/*ml*/ctx[5]))){attr(details,"style",details_style_value);}},i:noop,o:noop,d(detaching){if(detaching)detach(details);/*summary_binding*/ctx[10](null);/*details_binding*/ctx[11](null);mounted=false;dispose();}};}function instance$I($$self,$$props,$$invalidate){let _isOpen;let{heading}=$$props;let{mt=null}=$$props;let{mr=null}=$$props;let{mb=null}=$$props;let{ml=null}=$$props;let{open="false"}=$$props;let _isMouseOver=false;let _summaryEl;let _detailsEl;onMount(()=>{validateRequired("Details",{heading});_summaryEl.addEventListener("mouseover",()=>{$$invalidate(6,_isMouseOver=true);});_summaryEl.addEventListener("mouseout",()=>{$$invalidate(6,_isMouseOver=false);});});function summary_binding($$value){binding_callbacks[$$value?'unshift':'push'](()=>{_summaryEl=$$value;$$invalidate(7,_summaryEl);});}function details_binding($$value){binding_callbacks[$$value?'unshift':'push'](()=>{_detailsEl=$$value;$$invalidate(8,_detailsEl);});}const toggle_handler=({target})=>$$invalidate(0,open=`${target.open}`);$$self.$$set=$$props=>{if('heading'in $$props)$$invalidate(1,heading=$$props.heading);if('mt'in $$props)$$invalidate(2,mt=$$props.mt);if('mr'in $$props)$$invalidate(3,mr=$$props.mr);if('mb'in $$props)$$invalidate(4,mb=$$props.mb);if('ml'in $$props)$$invalidate(5,ml=$$props.ml);if('open'in $$props)$$invalidate(0,open=$$props.open);};$$self.$$.update=()=>{if($$self.$$.dirty&/*open*/1){$$invalidate(9,_isOpen=toBoolean(open));}};return [open,heading,mt,mr,mb,ml,_isMouseOver,_summaryEl,_detailsEl,_isOpen,summary_binding,details_binding,toggle_handler];}class Details extends SvelteElement{constructor(options){super();const style=document.createElement('style');style.textContent=`:host{font-family:var(--goa-font-family-sans)}details{max-width:75ch;position:relative}details ::slotted(*){font:var(--goa-typography-body-m)}summary{padding:0.5rem;margin-bottom:0.5rem;cursor:pointer;list-style:none;display:flex;align-items:flex-start}goa-icon{position:absolute}details[open] goa-icon{transform:translateX(-1px) rotate(90deg);top:0.75rem}details summary::-webkit-details-marker{display:none}summary{border-radius:var(--goa-border-radius-m)}summary:focus,summary:active{outline:3px solid var(--goa-color-interactive-focus);border-radius:var(--goa-border-radius-m);color:var(--goa-color-interactive-hover);background-color:var(--goa-color-greyscale-100)}summary:hover{background-color:var(--goa-color-greyscale-100)}summary span{margin-left:2rem;text-decoration:underline;color:var(--goa-color-interactive-default);padding-bottom:var(--font-valign-fix);line-height:var(--goa-line-height-3)}summary:hover span{color:var(--goa-color-interactive-hover)}.content{border-left:4px solid var(--goa-color-greyscale-200);padding:1rem;margin-left:1.1rem;margin-bottom:var(--goa-space-s)}.content ::slotted(p:last-child){margin-bottom:0 !important}`;this.shadowRoot.appendChild(style);init(this,{target:this.shadowRoot,props:attribute_to_object(this.attributes),customElement:true},instance$I,create_fragment$L,safe_not_equal,{heading:1,mt:2,mr:3,mb:4,ml:5,open: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","mt","mr","mb","ml","open"];}get heading(){return this.$$.ctx[1];}set heading(heading){this.$$set({heading});flush();}get mt(){return this.$$.ctx[2];}set mt(mt){this.$$set({mt});flush();}get mr(){return this.$$.ctx[3];}set mr(mr){this.$$set({mr});flush();}get mb(){return this.$$.ctx[4];}set mb(mb){this.$$set({mb});flush();}get ml(){return this.$$.ctx[5];}set ml(ml){this.$$set({ml});flush();}get open(){return this.$$.ctx[0];}set open(open){this.$$set({open});flush();}}customElements.define("goa-details",Details);/* src/components/divider/Divider.svelte generated by Svelte v3.59.2 */function create_fragment$K(ctx){let hr;let hr_style_value;return {c(){hr=element("hr");this.c=noop;attr(hr,"data-testid",/*testid*/ctx[0]);attr(hr,"style",hr_style_value=calculateMargin(/*mt*/ctx[1],/*mr*/ctx[2],/*mb*/ctx[3],/*ml*/ctx[4]));},m(target,anchor){insert(target,hr,anchor);},p(ctx,[dirty]){if(dirty&/*testid*/1){attr(hr,"data-testid",/*testid*/ctx[0]);}if(dirty&/*mt, mr, mb, ml*/30&&hr_style_value!==(hr_style_value=calculateMargin(/*mt*/ctx[1],/*mr*/ctx[2],/*mb*/ctx[3],/*ml*/ctx[4]))){attr(hr,"style",hr_style_value);}},i:noop,o:noop,d(detaching){if(detaching)detach(hr);}};}function instance$H($$self,$$props,$$invalidate){let{testid=""}=$$props;let{mt=null}=$$props;let{mr=null}=$$props;let{mb=null}=$$props;let{ml=null}=$$props;$$self.$$set=$$props=>{if('testid'in $$props)$$invalidate(0,testid=$$props.testid);if('mt'in $$props)$$invalidate(1,mt=$$props.mt);if('mr'in $$props)$$invalidate(2,mr=$$props.mr);if('mb'in $$props)$$invalidate(3,mb=$$props.mb);if('ml'in $$props)$$invalidate(4,ml=$$props.ml);};return [testid,mt,mr,mb,ml];}class Divider extends SvelteElement{constructor(options){super();const style=document.createElement('style');style.textContent=`hr{padding:0;margin:0;height:1px;background-color:var(--goa-color-greyscale-200);border:none}`;this.shadowRoot.appendChild(style);init(this,{target:this.shadowRoot,props:attribute_to_object(this.attributes),customElement:true},instance$H,create_fragment$K,safe_not_equal,{testid:0,mt:1,mr:2,mb:3,ml:4},null);if(options){if(options.target){insert(options.target,this,options.anchor);}if(options.props){this.$set(options.props);flush();}}}static get observedAttributes(){return ["testid","mt","mr","mb","ml"];}get testid(){return this.$$.ctx[0];}set testid(testid){this.$$set({testid});flush();}get mt(){return this.$$.ctx[1];}set mt(mt){this.$$set({mt});flush();}get mr(){return this.$$.ctx[2];}set mr(mr){this.$$set({mr});flush();}get mb(){return this.$$.ctx[3];}set mb(mb){this.$$set({mb});flush();}get ml(){return this.$$.ctx[4];}set ml(ml){this.$$set({ml});flush();}}customElements.define("goa-divider",Divider);/* src/components/dropdown/Dropdown.svelte generated by Svelte v3.59.2 */function get_each_context_1$1(ctx,list,i){const child_ctx=ctx.slice();child_ctx[61]=list[i];child_ctx[65]=i;return child_ctx;}function get_each_context$8(ctx,list,i){const child_ctx=ctx.slice();child_ctx[61]=list[i];return child_ctx;}// (444:2) {:else}
|
|
169
|
-
function create_else_block$a(ctx){let slot;let t0;let goa_popover;let div;let t1;let input;let input_style_value;let input_aria_controls_value;let input_aria_label_value;let input_aria_owns_value;let input_readonly_value;let t2;let
|
|
170
|
-
cursor: ${!/*_disabled*/ctx[
|
|
171
|
-
`);attr(input,"data-testid","input");attr(input,"type","text");attr(input,"role","combobox");attr(input,"autocomplete","off");attr(input,"aria-autocomplete","list");attr(input,"aria-controls",input_aria_controls_value=`menu-${/*name*/ctx[0]}`);attr(input,"aria-expanded",/*_isMenuVisible*/ctx[
|
|
172
|
-
width: ${/*_width*/ctx[19]};
|
|
168
|
+
`)){attr(div3,"class",div3_class_value);}},i:noop,o:noop,d(detaching){if(detaching)detach(div3);}};}function instance$J($$self,$$props,$$invalidate){const[Types,validateType]=typeValidator("Container type",["interactive","info","error","success","important","non-interactive"]);const[Accents,validateAccent]=typeValidator("Container accent",["thick","thin","filled"]);const[Paddings,validatePadding]=typeValidator("Container padding",["relaxed","compact"]);let{type="interactive"}=$$props;let{accent="filled"}=$$props;let{padding="relaxed"}=$$props;let{testid=""}=$$props;let{mt=null}=$$props;let{mr=null}=$$props;let{mb="m"}=$$props;let{ml=null}=$$props;onMount(()=>{validateType(type);validateAccent(accent);validatePadding(padding);});$$self.$$set=$$props=>{if('type'in $$props)$$invalidate(0,type=$$props.type);if('accent'in $$props)$$invalidate(1,accent=$$props.accent);if('padding'in $$props)$$invalidate(2,padding=$$props.padding);if('testid'in $$props)$$invalidate(3,testid=$$props.testid);if('mt'in $$props)$$invalidate(4,mt=$$props.mt);if('mr'in $$props)$$invalidate(5,mr=$$props.mr);if('mb'in $$props)$$invalidate(6,mb=$$props.mb);if('ml'in $$props)$$invalidate(7,ml=$$props.ml);};return [type,accent,padding,testid,mt,mr,mb,ml];}class Container extends SvelteElement{constructor(options){super();const style=document.createElement('style');style.textContent=`:host{box-sizing:border-box;font-family:var(--goa-font-family-sans);font-size:var(--goa-font-size-4);display:flex;flex:1 1 auto}.goa-container{box-sizing:border-box;display:flex;flex:1 1 auto;flex-direction:column}.goa-container *{box-sizing:border-box}header{display:flex;align-items:center;justify-content:space-between;font-weight:700;font-size:var(--goa-font-size-4);border-width:1px;border-style:solid;border-top-left-radius:var(--goa-border-radius-m);border-top-right-radius:var(--goa-border-radius-m)}.content{border-bottom:1px solid var(--goa-color-greyscale-200);border-left:1px solid var(--goa-color-greyscale-200);border-right:1px solid var(--goa-color-greyscale-200);border-bottom-left-radius:var(--goa-border-radius-m);border-bottom-right-radius:var(--goa-border-radius-m);display:flex;flex:1 1 auto;flex-direction:column}.content ::slotted(p:last-child){margin-bottom:0 !important}.goa-container--non-interactive.accent--filled .content{border-color:var(--goa-color-greyscale-200);background-color:var(--goa-color-greyscale-100)}.goa-container--important.accent--filled .content{border-color:var(--goa-color-warning-default);background-color:var(--goa-color-warning-background)}.goa-container--error.accent--filled .content{border-color:var(--goa-color-emergency-default);background-color:var(--goa-color-emergency-background)}.goa-container--success.accent--filled .content{border-color:var(--goa-color-success-default);background-color:var(--goa-color-success-background)}.goa-container--info.accent--filled .content{border-color:var(--goa-color-info-default);background-color:var(--goa-color-info-background)}.title,.actions{padding:0.5rem 0}.padding--relaxed header{padding:0 1.5rem}.padding--relaxed .content{padding:1.5rem}.padding--compact header,.padding--compact .content{padding:0 1rem}.padding--compact header{padding:0 1rem}.padding--compact .content{padding:1rem}@media screen and (max-width: 623px){.padding--relaxed header{padding:0 1rem}.padding--relaxed .content{padding:1rem}}.goa-container--non-interactive header{background-color:var(--goa-color-greyscale-100);border-color:var(--goa-color-greyscale-200);color:var(--goa-color-greyscale-black)}.goa-container--interactive header{background-color:var(--goa-color-brand-default);border-color:var(--goa-color-brand-default);color:var(--goa-color-greyscale-white)}.goa-container--info header{background-color:var(--goa-color-info-default);border-color:var(--goa-color-info-default);color:var(--goa-color-greyscale-white)}.goa-container--error header{background-color:var(--goa-color-emergency-default);border-color:var(--goa-color-emergency-default);color:var(--goa-color-greyscale-white)}.goa-container--success header{background-color:var(--goa-color-success-default);border-color:var(--goa-color-success-default);color:var(--goa-color-greyscale-white)}.goa-container--important header{background-color:var(--goa-color-warning-default);border-color:var(--goa-color-warning-default);color:var(--goa-color-greyscale-white)}.heading--thick{padding:0.5rem 1.5rem;max-height:3rem;min-height:1rem}.heading--thick .title{line-height:2rem}.heading--thin{height:0.5rem}.heading--filled{display:none}.heading--filled~.content{border-top:1px solid var(--goa-color-greyscale-200);border-top-left-radius:var(--goa-border-radius-m);border-top-right-radius:var(--goa-border-radius-m)}.heading--thin .title,.heading--thin .actions{display:none}.actions{display:flex;align-items:center}`;this.shadowRoot.appendChild(style);init(this,{target:this.shadowRoot,props:attribute_to_object(this.attributes),customElement:true},instance$J,create_fragment$M,safe_not_equal,{type:0,accent:1,padding:2,testid:3,mt:4,mr:5,mb:6,ml:7},null);if(options){if(options.target){insert(options.target,this,options.anchor);}if(options.props){this.$set(options.props);flush();}}}static get observedAttributes(){return ["type","accent","padding","testid","mt","mr","mb","ml"];}get type(){return this.$$.ctx[0];}set type(type){this.$$set({type});flush();}get accent(){return this.$$.ctx[1];}set accent(accent){this.$$set({accent});flush();}get padding(){return this.$$.ctx[2];}set padding(padding){this.$$set({padding});flush();}get testid(){return this.$$.ctx[3];}set testid(testid){this.$$set({testid});flush();}get mt(){return this.$$.ctx[4];}set mt(mt){this.$$set({mt});flush();}get mr(){return this.$$.ctx[5];}set mr(mr){this.$$set({mr});flush();}get mb(){return this.$$.ctx[6];}set mb(mb){this.$$set({mb});flush();}get ml(){return this.$$.ctx[7];}set ml(ml){this.$$set({ml});flush();}}customElements.define("goa-container",Container);/* src/components/details/Details.svelte generated by Svelte v3.59.2 */function create_fragment$L(ctx){let details;let summary;let goa_icon;let goa_icon_fillcolor_value;let t0;let span;let t1;let t2;let div;let details_style_value;let mounted;let dispose;return {c(){details=element("details");summary=element("summary");goa_icon=element("goa-icon");t0=space();span=element("span");t1=text(/*heading*/ctx[1]);t2=space();div=element("div");div.innerHTML=`<slot></slot>`;this.c=noop;set_custom_element_data(goa_icon,"mt","1");set_custom_element_data(goa_icon,"mr","2");set_custom_element_data(goa_icon,"type","chevron-forward");set_custom_element_data(goa_icon,"fillcolor",goa_icon_fillcolor_value=/*_isMouseOver*/ctx[6]?"var(--goa-color-interactive-hover)":"var(--goa-color-interactive-default)");attr(div,"class","content");details.open=/*_isOpen*/ctx[9];attr(details,"style",details_style_value=calculateMargin(/*mt*/ctx[2],/*mr*/ctx[3],/*mb*/ctx[4],/*ml*/ctx[5]));},m(target,anchor){insert(target,details,anchor);append(details,summary);append(summary,goa_icon);append(summary,t0);append(summary,span);append(span,t1);/*summary_binding*/ctx[10](summary);append(details,t2);append(details,div);/*details_binding*/ctx[11](details);if(!mounted){dispose=listen(details,"toggle",/*toggle_handler*/ctx[12]);mounted=true;}},p(ctx,[dirty]){if(dirty&/*_isMouseOver*/64&&goa_icon_fillcolor_value!==(goa_icon_fillcolor_value=/*_isMouseOver*/ctx[6]?"var(--goa-color-interactive-hover)":"var(--goa-color-interactive-default)")){set_custom_element_data(goa_icon,"fillcolor",goa_icon_fillcolor_value);}if(dirty&/*heading*/2)set_data(t1,/*heading*/ctx[1]);if(dirty&/*_isOpen*/512){details.open=/*_isOpen*/ctx[9];}if(dirty&/*mt, mr, mb, ml*/60&&details_style_value!==(details_style_value=calculateMargin(/*mt*/ctx[2],/*mr*/ctx[3],/*mb*/ctx[4],/*ml*/ctx[5]))){attr(details,"style",details_style_value);}},i:noop,o:noop,d(detaching){if(detaching)detach(details);/*summary_binding*/ctx[10](null);/*details_binding*/ctx[11](null);mounted=false;dispose();}};}function instance$I($$self,$$props,$$invalidate){let _isOpen;let{heading}=$$props;let{mt=null}=$$props;let{mr=null}=$$props;let{mb=null}=$$props;let{ml=null}=$$props;let{open="false"}=$$props;let _isMouseOver=false;let _summaryEl;let _detailsEl;onMount(()=>{validateRequired("Details",{heading});_summaryEl.addEventListener("mouseover",()=>{$$invalidate(6,_isMouseOver=true);});_summaryEl.addEventListener("mouseout",()=>{$$invalidate(6,_isMouseOver=false);});});function summary_binding($$value){binding_callbacks[$$value?'unshift':'push'](()=>{_summaryEl=$$value;$$invalidate(7,_summaryEl);});}function details_binding($$value){binding_callbacks[$$value?'unshift':'push'](()=>{_detailsEl=$$value;$$invalidate(8,_detailsEl);});}const toggle_handler=({target})=>$$invalidate(0,open=`${target.open}`);$$self.$$set=$$props=>{if('heading'in $$props)$$invalidate(1,heading=$$props.heading);if('mt'in $$props)$$invalidate(2,mt=$$props.mt);if('mr'in $$props)$$invalidate(3,mr=$$props.mr);if('mb'in $$props)$$invalidate(4,mb=$$props.mb);if('ml'in $$props)$$invalidate(5,ml=$$props.ml);if('open'in $$props)$$invalidate(0,open=$$props.open);};$$self.$$.update=()=>{if($$self.$$.dirty&/*open*/1){$$invalidate(9,_isOpen=toBoolean(open));}};return [open,heading,mt,mr,mb,ml,_isMouseOver,_summaryEl,_detailsEl,_isOpen,summary_binding,details_binding,toggle_handler];}class Details extends SvelteElement{constructor(options){super();const style=document.createElement('style');style.textContent=`:host{font-family:var(--goa-font-family-sans)}details{max-width:75ch;position:relative}details ::slotted(*){font:var(--goa-typography-body-m)}summary{padding:0.5rem;margin-bottom:0.5rem;cursor:pointer;list-style:none;display:flex;align-items:flex-start}goa-icon{position:absolute}details[open] goa-icon{transform:translateX(-1px) rotate(90deg);top:0.75rem}details summary::-webkit-details-marker{display:none}summary{border-radius:var(--goa-border-radius-m)}summary:focus,summary:active{outline:3px solid var(--goa-color-interactive-focus);border-radius:var(--goa-border-radius-m);color:var(--goa-color-interactive-hover);background-color:var(--goa-color-greyscale-100)}summary:hover{background-color:var(--goa-color-greyscale-100)}summary span{margin-left:2rem;text-decoration:underline;color:var(--goa-color-interactive-default);padding-bottom:var(--font-valign-fix);line-height:var(--goa-line-height-3)}summary:hover span{color:var(--goa-color-interactive-hover)}.content{border-left:4px solid var(--goa-color-greyscale-200);padding:1rem;margin-left:1.1rem;margin-bottom:var(--goa-space-s)}.content ::slotted(p:last-child){margin-bottom:0 !important}`;this.shadowRoot.appendChild(style);init(this,{target:this.shadowRoot,props:attribute_to_object(this.attributes),customElement:true},instance$I,create_fragment$L,safe_not_equal,{heading:1,mt:2,mr:3,mb:4,ml:5,open: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","mt","mr","mb","ml","open"];}get heading(){return this.$$.ctx[1];}set heading(heading){this.$$set({heading});flush();}get mt(){return this.$$.ctx[2];}set mt(mt){this.$$set({mt});flush();}get mr(){return this.$$.ctx[3];}set mr(mr){this.$$set({mr});flush();}get mb(){return this.$$.ctx[4];}set mb(mb){this.$$set({mb});flush();}get ml(){return this.$$.ctx[5];}set ml(ml){this.$$set({ml});flush();}get open(){return this.$$.ctx[0];}set open(open){this.$$set({open});flush();}}customElements.define("goa-details",Details);/* src/components/divider/Divider.svelte generated by Svelte v3.59.2 */function create_fragment$K(ctx){let hr;let hr_style_value;return {c(){hr=element("hr");this.c=noop;attr(hr,"data-testid",/*testid*/ctx[0]);attr(hr,"style",hr_style_value=calculateMargin(/*mt*/ctx[1],/*mr*/ctx[2],/*mb*/ctx[3],/*ml*/ctx[4]));},m(target,anchor){insert(target,hr,anchor);},p(ctx,[dirty]){if(dirty&/*testid*/1){attr(hr,"data-testid",/*testid*/ctx[0]);}if(dirty&/*mt, mr, mb, ml*/30&&hr_style_value!==(hr_style_value=calculateMargin(/*mt*/ctx[1],/*mr*/ctx[2],/*mb*/ctx[3],/*ml*/ctx[4]))){attr(hr,"style",hr_style_value);}},i:noop,o:noop,d(detaching){if(detaching)detach(hr);}};}function instance$H($$self,$$props,$$invalidate){let{testid=""}=$$props;let{mt=null}=$$props;let{mr=null}=$$props;let{mb=null}=$$props;let{ml=null}=$$props;$$self.$$set=$$props=>{if('testid'in $$props)$$invalidate(0,testid=$$props.testid);if('mt'in $$props)$$invalidate(1,mt=$$props.mt);if('mr'in $$props)$$invalidate(2,mr=$$props.mr);if('mb'in $$props)$$invalidate(3,mb=$$props.mb);if('ml'in $$props)$$invalidate(4,ml=$$props.ml);};return [testid,mt,mr,mb,ml];}class Divider extends SvelteElement{constructor(options){super();const style=document.createElement('style');style.textContent=`hr{padding:0;margin:0;height:1px;background-color:var(--goa-color-greyscale-200);border:none}`;this.shadowRoot.appendChild(style);init(this,{target:this.shadowRoot,props:attribute_to_object(this.attributes),customElement:true},instance$H,create_fragment$K,safe_not_equal,{testid:0,mt:1,mr:2,mb:3,ml:4},null);if(options){if(options.target){insert(options.target,this,options.anchor);}if(options.props){this.$set(options.props);flush();}}}static get observedAttributes(){return ["testid","mt","mr","mb","ml"];}get testid(){return this.$$.ctx[0];}set testid(testid){this.$$set({testid});flush();}get mt(){return this.$$.ctx[1];}set mt(mt){this.$$set({mt});flush();}get mr(){return this.$$.ctx[2];}set mr(mr){this.$$set({mr});flush();}get mb(){return this.$$.ctx[3];}set mb(mb){this.$$set({mb});flush();}get ml(){return this.$$.ctx[4];}set ml(ml){this.$$set({ml});flush();}}customElements.define("goa-divider",Divider);/* src/components/dropdown/Dropdown.svelte generated by Svelte v3.59.2 */function get_each_context_1$1(ctx,list,i){const child_ctx=ctx.slice();child_ctx[61]=list[i];child_ctx[65]=i;return child_ctx;}function get_each_context$8(ctx,list,i){const child_ctx=ctx.slice();child_ctx[61]=list[i];return child_ctx;}// (459:2) {:else}
|
|
169
|
+
function create_else_block$a(ctx){let slot;let t0;let goa_popover;let div;let t1;let input;let input_style_value;let input_aria_controls_value;let input_aria_label_value;let input_aria_owns_value;let input_readonly_value;let t2;let t3;let ul;let each_blocks=[];let each_1_lookup=new Map();let ul_id_value;let ul_aria_label_value;let ul_style_value;let mounted;let dispose;let if_block0=/*leadingicon*/ctx[4]&&create_if_block_2$b(ctx);function select_block_type_1(ctx,dirty){var _ctx$;if(/*_inputEl*/(_ctx$=ctx[22])!==null&&_ctx$!==void 0&&_ctx$.value&&/*_filterable*/ctx[23])return create_if_block_1$d;return create_else_block_2;}let current_block_type=select_block_type_1(ctx);let if_block1=current_block_type(ctx);let each_value_1=/*_filteredOptions*/ctx[14];const get_key=ctx=>/*index*/ctx[65];for(let i=0;i<each_value_1.length;i+=1){let child_ctx=get_each_context_1$1(ctx,each_value_1,i);let key=get_key(child_ctx);each_1_lookup.set(key,each_blocks[i]=create_each_block_1$1(key,child_ctx));}let each_1_else=null;if(!each_value_1.length){each_1_else=create_else_block_1();}return {c(){slot=element("slot");t0=space();goa_popover=element("goa-popover");div=element("div");if(if_block0)if_block0.c();t1=space();input=element("input");t2=space();if_block1.c();t3=space();ul=element("ul");for(let i=0;i<each_blocks.length;i+=1){each_blocks[i].c();}if(each_1_else){each_1_else.c();}attr(input,"style",input_style_value=`
|
|
170
|
+
cursor: ${!/*_disabled*/ctx[25]?/*_filterable*/ctx[23]?"auto":"pointer":"default"};
|
|
171
|
+
`);attr(input,"data-testid","input");attr(input,"type","text");attr(input,"role","combobox");attr(input,"autocomplete","off");attr(input,"aria-autocomplete","list");attr(input,"aria-controls",input_aria_controls_value=`menu-${/*name*/ctx[0]}`);attr(input,"aria-expanded",/*_isMenuVisible*/ctx[17]);attr(input,"aria-label",input_aria_label_value=/*arialabel*/ctx[1]||/*name*/ctx[0]);attr(input,"aria-labelledby",/*arialabelledby*/ctx[2]);attr(input,"id",/*name*/ctx[0]);attr(input,"aria-activedescendant",/*_activeDescendantId*/ctx[24]);attr(input,"aria-disabled",/*_disabled*/ctx[25]);attr(input,"aria-owns",input_aria_owns_value=/*_isMenuVisible*/ctx[17]?`menu-${/*name*/ctx[0]}`:undefined);attr(input,"aria-haspopup","listbox");input.disabled=/*_disabled*/ctx[25];input.readOnly=input_readonly_value=!/*_filterable*/ctx[23];attr(input,"placeholder",/*placeholder*/ctx[6]);attr(input,"name",/*name*/ctx[0]);attr(div,"slot","target");attr(div,"class","dropdown-input-group");toggle_class(div,"dropdown-input-group--disabled",/*_disabled*/ctx[25]);toggle_class(div,"error",/*_error*/ctx[26]);attr(ul,"id",ul_id_value=`menu-${/*name*/ctx[0]}`);attr(ul,"role","listbox");attr(ul,"tabindex","-1");attr(ul,"data-testid","dropdown-menu");attr(ul,"aria-label",ul_aria_label_value=/*arialabel*/ctx[1]||/*name*/ctx[0]);attr(ul,"aria-labelledby",/*arialabelledby*/ctx[2]);attr(ul,"style",ul_style_value=`
|
|
173
172
|
outline: none;
|
|
174
173
|
overflow-y: auto;
|
|
175
174
|
max-height: ${/*maxheight*/ctx[5]};
|
|
176
|
-
`);set_custom_element_data(goa_popover,"disabled",/*disabled*/ctx[
|
|
177
|
-
cursor: ${!/*_disabled*/ctx[
|
|
178
|
-
`)){attr(input,"style",input_style_value);}if(dirty[0]&/*name*/1&&input_aria_controls_value!==(input_aria_controls_value=`menu-${/*name*/ctx[0]}`)){attr(input,"aria-controls",input_aria_controls_value);}if(dirty[0]&/*_isMenuVisible*/
|
|
179
|
-
width: ${/*_width*/ctx[19]};
|
|
175
|
+
`);set_custom_element_data(goa_popover,"disabled",/*disabled*/ctx[7]);set_custom_element_data(goa_popover,"relative",/*relative*/ctx[8]);set_custom_element_data(goa_popover,"data-testid","option-list");set_custom_element_data(goa_popover,"maxwidth","99999px");set_custom_element_data(goa_popover,"open",/*_isMenuVisible*/ctx[17]);set_custom_element_data(goa_popover,"padded","false");set_custom_element_data(goa_popover,"tabindex","-1");set_custom_element_data(goa_popover,"width",/*_width*/ctx[18]);},m(target,anchor){insert(target,slot,anchor);insert(target,t0,anchor);insert(target,goa_popover,anchor);append(goa_popover,div);if(if_block0)if_block0.m(div,null);append(div,t1);append(div,input);/*input_binding*/ctx[42](input);append(div,t2);if_block1.m(div,null);append(goa_popover,t3);append(goa_popover,ul);for(let i=0;i<each_blocks.length;i+=1){if(each_blocks[i]){each_blocks[i].m(ul,null);}}if(each_1_else){each_1_else.m(ul,null);}/*ul_binding*/ctx[44](ul);if(!mounted){dispose=[listen(input,"keydown",/*onInputKeyDown*/ctx[31]),listen(input,"keyup",/*onInputKeyUp*/ctx[30]),listen(goa_popover,"_open",/*showMenu*/ctx[27]),listen(goa_popover,"_close",/*hideMenu*/ctx[28])];mounted=true;}},p(ctx,dirty){if(/*leadingicon*/ctx[4]){if(if_block0){if_block0.p(ctx,dirty);}else {if_block0=create_if_block_2$b(ctx);if_block0.c();if_block0.m(div,t1);}}else if(if_block0){if_block0.d(1);if_block0=null;}if(dirty[0]&/*_disabled, _filterable*/41943040&&input_style_value!==(input_style_value=`
|
|
176
|
+
cursor: ${!/*_disabled*/ctx[25]?/*_filterable*/ctx[23]?"auto":"pointer":"default"};
|
|
177
|
+
`)){attr(input,"style",input_style_value);}if(dirty[0]&/*name*/1&&input_aria_controls_value!==(input_aria_controls_value=`menu-${/*name*/ctx[0]}`)){attr(input,"aria-controls",input_aria_controls_value);}if(dirty[0]&/*_isMenuVisible*/131072){attr(input,"aria-expanded",/*_isMenuVisible*/ctx[17]);}if(dirty[0]&/*arialabel, name*/3&&input_aria_label_value!==(input_aria_label_value=/*arialabel*/ctx[1]||/*name*/ctx[0])){attr(input,"aria-label",input_aria_label_value);}if(dirty[0]&/*arialabelledby*/4){attr(input,"aria-labelledby",/*arialabelledby*/ctx[2]);}if(dirty[0]&/*name*/1){attr(input,"id",/*name*/ctx[0]);}if(dirty[0]&/*_activeDescendantId*/16777216){attr(input,"aria-activedescendant",/*_activeDescendantId*/ctx[24]);}if(dirty[0]&/*_disabled*/33554432){attr(input,"aria-disabled",/*_disabled*/ctx[25]);}if(dirty[0]&/*_isMenuVisible, name*/131073&&input_aria_owns_value!==(input_aria_owns_value=/*_isMenuVisible*/ctx[17]?`menu-${/*name*/ctx[0]}`:undefined)){attr(input,"aria-owns",input_aria_owns_value);}if(dirty[0]&/*_disabled*/33554432){input.disabled=/*_disabled*/ctx[25];}if(dirty[0]&/*_filterable*/8388608&&input_readonly_value!==(input_readonly_value=!/*_filterable*/ctx[23])){input.readOnly=input_readonly_value;}if(dirty[0]&/*placeholder*/64){attr(input,"placeholder",/*placeholder*/ctx[6]);}if(dirty[0]&/*name*/1){attr(input,"name",/*name*/ctx[0]);}if(current_block_type===(current_block_type=select_block_type_1(ctx))&&if_block1){if_block1.p(ctx,dirty);}else {if_block1.d(1);if_block1=current_block_type(ctx);if(if_block1){if_block1.c();if_block1.m(div,null);}}if(dirty[0]&/*_disabled*/33554432){toggle_class(div,"dropdown-input-group--disabled",/*_disabled*/ctx[25]);}if(dirty[0]&/*_error*/67108864){toggle_class(div,"error",/*_error*/ctx[26]);}if(dirty[0]&/*_filteredOptions, _inputEl, _highlightedIndex, onSelect*/541089792){each_value_1=/*_filteredOptions*/ctx[14];each_blocks=update_keyed_each(each_blocks,dirty,get_key,1,ctx,each_value_1,each_1_lookup,ul,destroy_block,create_each_block_1$1,null,get_each_context_1$1);if(!each_value_1.length&&each_1_else){each_1_else.p(ctx,dirty);}else if(!each_value_1.length){each_1_else=create_else_block_1();each_1_else.c();each_1_else.m(ul,null);}else if(each_1_else){each_1_else.d(1);each_1_else=null;}}if(dirty[0]&/*name*/1&&ul_id_value!==(ul_id_value=`menu-${/*name*/ctx[0]}`)){attr(ul,"id",ul_id_value);}if(dirty[0]&/*arialabel, name*/3&&ul_aria_label_value!==(ul_aria_label_value=/*arialabel*/ctx[1]||/*name*/ctx[0])){attr(ul,"aria-label",ul_aria_label_value);}if(dirty[0]&/*arialabelledby*/4){attr(ul,"aria-labelledby",/*arialabelledby*/ctx[2]);}if(dirty[0]&/*maxheight*/32&&ul_style_value!==(ul_style_value=`
|
|
180
178
|
outline: none;
|
|
181
179
|
overflow-y: auto;
|
|
182
180
|
max-height: ${/*maxheight*/ctx[5]};
|
|
183
|
-
`)){attr(ul,"style",ul_style_value);}if(dirty[0]&/*disabled*/
|
|
184
|
-
function create_if_block$p(ctx){let select;let slot;let select_aria_label_value;let mounted;let dispose;let each_value=/*_options*/ctx[
|
|
185
|
-
function create_if_block_2$b(ctx){let goa_icon;return {c(){goa_icon=element("goa-icon");set_custom_element_data(goa_icon,"class","dropdown-input--leading-icon");set_custom_element_data(goa_icon,"data-testid","leading-icon");set_custom_element_data(goa_icon,"type",/*leadingicon*/ctx[4]);},m(target,anchor){insert(target,goa_icon,anchor);},p(ctx,dirty){if(dirty[0]&/*leadingicon*/16){set_custom_element_data(goa_icon,"type",/*leadingicon*/ctx[4]);}},d(detaching){if(detaching)detach(goa_icon);}};}// (
|
|
186
|
-
function create_else_block_2(ctx){let goa_icon;let goa_icon_arialabel_value;let goa_icon_ariacontrols_value;let goa_icon_ariaexpanded_value;let goa_icon_type_value;let mounted;let dispose;return {c(){goa_icon=element("goa-icon");set_custom_element_data(goa_icon,"role","button");set_custom_element_data(goa_icon,"tabindex","-1");set_custom_element_data(goa_icon,"id",/*name*/ctx[0]);set_custom_element_data(goa_icon,"arialabel",goa_icon_arialabel_value=/*arialabel*/ctx[1]||/*name*/ctx[0]);set_custom_element_data(goa_icon,"ariacontrols",goa_icon_ariacontrols_value=`menu-${/*name*/ctx[0]}`);set_custom_element_data(goa_icon,"ariaexpanded",goa_icon_ariaexpanded_value=fromBoolean(/*_isMenuVisible*/ctx[
|
|
187
|
-
function create_if_block_1$d(ctx){let goa_icon;let goa_icon_tabindex_value;let goa_icon_arialabel_value;let goa_icon_ariacontrols_value;let goa_icon_ariaexpanded_value;let mounted;let dispose;return {c(){goa_icon=element("goa-icon");set_custom_element_data(goa_icon,"id",/*name*/ctx[0]);set_custom_element_data(goa_icon,"tabindex",goa_icon_tabindex_value=/*_disabled*/ctx[
|
|
188
|
-
function create_else_block_1(ctx){let li;return {c(){li=element("li");li.textContent="No matches found\n ";attr(li,"class","dropdown-item");attr(li,"data-testid","dropdown-item-not-found");},m(target,anchor){insert(target,li,anchor);},p:noop,d(detaching){if(detaching)detach(li);}};}// (
|
|
189
|
-
function create_each_block_1$1(key_1,ctx){let li;let t0_value=(/*option*/ctx[61].label||/*option*/ctx[61].value)+"";let t0;let t1;let li_id_value;let li_aria_selected_value;let li_data_index_value;let li_data_testid_value;let li_data_value_value;let mounted;let dispose;function click_handler(){return(/*click_handler*/ctx[43](/*option*/ctx[61]));}return {key:key_1,first:null,c(){li=element("li");t0=text(t0_value);t1=space();attr(li,"id",li_id_value=/*option*/ctx[61].value);attr(li,"aria-selected",li_aria_selected_value=/*_inputEl*/ctx[
|
|
190
|
-
function create_each_block$8(ctx){let option;let t0_value=/*option*/ctx[61].label+"";let t0;let t1;let option_selected_value;let option_value_value;return {c(){option=element("option");t0=text(t0_value);t1=space();option.selected=option_selected_value=/*value*/ctx[3]===/*option*/ctx[61].value;option.__value=option_value_value=/*option*/ctx[61].value;option.value=option.__value;},m(target,anchor){insert(target,option,anchor);append(option,t0);append(option,t1);},p(ctx,dirty){if(dirty[0]&/*_options*/
|
|
191
|
-
|
|
192
|
-
${
|
|
193
|
-
`);toggle_class(div,"dropdown-native",/*_native*/ctx[
|
|
194
|
-
|
|
195
|
-
${
|
|
196
|
-
`)){attr(div,"style",div_style_value);}if(dirty[0]&/*_native*/
|
|
181
|
+
`)){attr(ul,"style",ul_style_value);}if(dirty[0]&/*disabled*/128){set_custom_element_data(goa_popover,"disabled",/*disabled*/ctx[7]);}if(dirty[0]&/*relative*/256){set_custom_element_data(goa_popover,"relative",/*relative*/ctx[8]);}if(dirty[0]&/*_isMenuVisible*/131072){set_custom_element_data(goa_popover,"open",/*_isMenuVisible*/ctx[17]);}if(dirty[0]&/*_width*/262144){set_custom_element_data(goa_popover,"width",/*_width*/ctx[18]);}},d(detaching){if(detaching)detach(slot);if(detaching)detach(t0);if(detaching)detach(goa_popover);if(if_block0)if_block0.d();/*input_binding*/ctx[42](null);if_block1.d();for(let i=0;i<each_blocks.length;i+=1){each_blocks[i].d();}if(each_1_else)each_1_else.d();/*ul_binding*/ctx[44](null);mounted=false;run_all(dispose);}};}// (439:2) {#if _native}
|
|
182
|
+
function create_if_block$p(ctx){let select;let slot;let select_aria_label_value;let mounted;let dispose;let each_value=/*_options*/ctx[16];let each_blocks=[];for(let i=0;i<each_value.length;i+=1){each_blocks[i]=create_each_block$8(get_each_context$8(ctx,each_value,i));}return {c(){select=element("select");slot=element("slot");for(let i=0;i<each_blocks.length;i+=1){each_blocks[i].c();}attr(select,"name",/*name*/ctx[0]);attr(select,"aria-label",select_aria_label_value=/*arialabel*/ctx[1]||/*name*/ctx[0]);attr(select,"aria-labelledby",/*arialabelledby*/ctx[2]);select.disabled=/*_disabled*/ctx[25];attr(select,"id",/*name*/ctx[0]);toggle_class(select,"error",/*_error*/ctx[26]);},m(target,anchor){insert(target,select,anchor);append(select,slot);for(let i=0;i<each_blocks.length;i+=1){if(each_blocks[i]){each_blocks[i].m(select,null);}}/*select_binding*/ctx[41](select);if(!mounted){dispose=listen(select,"change",/*onNativeSelect*/ctx[34]);mounted=true;}},p(ctx,dirty){if(dirty[0]&/*value, _options*/65544){each_value=/*_options*/ctx[16];let i;for(i=0;i<each_value.length;i+=1){const child_ctx=get_each_context$8(ctx,each_value,i);if(each_blocks[i]){each_blocks[i].p(child_ctx,dirty);}else {each_blocks[i]=create_each_block$8(child_ctx);each_blocks[i].c();each_blocks[i].m(select,null);}}for(;i<each_blocks.length;i+=1){each_blocks[i].d(1);}each_blocks.length=each_value.length;}if(dirty[0]&/*name*/1){attr(select,"name",/*name*/ctx[0]);}if(dirty[0]&/*arialabel, name*/3&&select_aria_label_value!==(select_aria_label_value=/*arialabel*/ctx[1]||/*name*/ctx[0])){attr(select,"aria-label",select_aria_label_value);}if(dirty[0]&/*arialabelledby*/4){attr(select,"aria-labelledby",/*arialabelledby*/ctx[2]);}if(dirty[0]&/*_disabled*/33554432){select.disabled=/*_disabled*/ctx[25];}if(dirty[0]&/*name*/1){attr(select,"id",/*name*/ctx[0]);}if(dirty[0]&/*_error*/67108864){toggle_class(select,"error",/*_error*/ctx[26]);}},d(detaching){if(detaching)detach(select);destroy_each(each_blocks,detaching);/*select_binding*/ctx[41](null);mounted=false;dispose();}};}// (481:8) {#if leadingicon}
|
|
183
|
+
function create_if_block_2$b(ctx){let goa_icon;return {c(){goa_icon=element("goa-icon");set_custom_element_data(goa_icon,"class","dropdown-input--leading-icon");set_custom_element_data(goa_icon,"data-testid","leading-icon");set_custom_element_data(goa_icon,"type",/*leadingicon*/ctx[4]);},m(target,anchor){insert(target,goa_icon,anchor);},p(ctx,dirty){if(dirty[0]&/*leadingicon*/16){set_custom_element_data(goa_icon,"type",/*leadingicon*/ctx[4]);}},d(detaching){if(detaching)detach(goa_icon);}};}// (531:8) {:else}
|
|
184
|
+
function create_else_block_2(ctx){let goa_icon;let goa_icon_arialabel_value;let goa_icon_ariacontrols_value;let goa_icon_ariaexpanded_value;let goa_icon_type_value;let mounted;let dispose;return {c(){goa_icon=element("goa-icon");set_custom_element_data(goa_icon,"role","button");set_custom_element_data(goa_icon,"tabindex","-1");set_custom_element_data(goa_icon,"id",/*name*/ctx[0]);set_custom_element_data(goa_icon,"arialabel",goa_icon_arialabel_value=/*arialabel*/ctx[1]||/*name*/ctx[0]);set_custom_element_data(goa_icon,"ariacontrols",goa_icon_ariacontrols_value=`menu-${/*name*/ctx[0]}`);set_custom_element_data(goa_icon,"ariaexpanded",goa_icon_ariaexpanded_value=fromBoolean(/*_isMenuVisible*/ctx[17]));set_custom_element_data(goa_icon,"class","dropdown-icon--arrow");set_custom_element_data(goa_icon,"size","medium");set_custom_element_data(goa_icon,"type",goa_icon_type_value=/*_isMenuVisible*/ctx[17]?"chevron-up":"chevron-down");},m(target,anchor){insert(target,goa_icon,anchor);if(!mounted){dispose=listen(goa_icon,"click",/*onChevronClick*/ctx[35]);mounted=true;}},p(ctx,dirty){if(dirty[0]&/*name*/1){set_custom_element_data(goa_icon,"id",/*name*/ctx[0]);}if(dirty[0]&/*arialabel, name*/3&&goa_icon_arialabel_value!==(goa_icon_arialabel_value=/*arialabel*/ctx[1]||/*name*/ctx[0])){set_custom_element_data(goa_icon,"arialabel",goa_icon_arialabel_value);}if(dirty[0]&/*name*/1&&goa_icon_ariacontrols_value!==(goa_icon_ariacontrols_value=`menu-${/*name*/ctx[0]}`)){set_custom_element_data(goa_icon,"ariacontrols",goa_icon_ariacontrols_value);}if(dirty[0]&/*_isMenuVisible*/131072&&goa_icon_ariaexpanded_value!==(goa_icon_ariaexpanded_value=fromBoolean(/*_isMenuVisible*/ctx[17]))){set_custom_element_data(goa_icon,"ariaexpanded",goa_icon_ariaexpanded_value);}if(dirty[0]&/*_isMenuVisible*/131072&&goa_icon_type_value!==(goa_icon_type_value=/*_isMenuVisible*/ctx[17]?"chevron-up":"chevron-down")){set_custom_element_data(goa_icon,"type",goa_icon_type_value);}},d(detaching){if(detaching)detach(goa_icon);mounted=false;dispose();}};}// (516:8) {#if _inputEl?.value && _filterable}
|
|
185
|
+
function create_if_block_1$d(ctx){let goa_icon;let goa_icon_tabindex_value;let goa_icon_arialabel_value;let goa_icon_ariacontrols_value;let goa_icon_ariaexpanded_value;let mounted;let dispose;return {c(){goa_icon=element("goa-icon");set_custom_element_data(goa_icon,"id",/*name*/ctx[0]);set_custom_element_data(goa_icon,"tabindex",goa_icon_tabindex_value=/*_disabled*/ctx[25]?-1:0);set_custom_element_data(goa_icon,"role","button");set_custom_element_data(goa_icon,"arialabel",goa_icon_arialabel_value=`clear ${/*arialabel*/ctx[1]||/*name*/ctx[0]}`);set_custom_element_data(goa_icon,"ariacontrols",goa_icon_ariacontrols_value=`menu-${/*name*/ctx[0]}`);set_custom_element_data(goa_icon,"ariaexpanded",goa_icon_ariaexpanded_value=fromBoolean(/*_isMenuVisible*/ctx[17]));set_custom_element_data(goa_icon,"class","dropdown-icon--clear");set_custom_element_data(goa_icon,"size","medium");set_custom_element_data(goa_icon,"type","close");toggle_class(goa_icon,"disabled",/*_disabled*/ctx[25]);},m(target,anchor){insert(target,goa_icon,anchor);if(!mounted){dispose=[listen(goa_icon,"click",stop_propagation(/*onClearIconClick*/ctx[33])),listen(goa_icon,"keydown",/*onClearIconKeyDown*/ctx[32])];mounted=true;}},p(ctx,dirty){if(dirty[0]&/*name*/1){set_custom_element_data(goa_icon,"id",/*name*/ctx[0]);}if(dirty[0]&/*_disabled*/33554432&&goa_icon_tabindex_value!==(goa_icon_tabindex_value=/*_disabled*/ctx[25]?-1:0)){set_custom_element_data(goa_icon,"tabindex",goa_icon_tabindex_value);}if(dirty[0]&/*arialabel, name*/3&&goa_icon_arialabel_value!==(goa_icon_arialabel_value=`clear ${/*arialabel*/ctx[1]||/*name*/ctx[0]}`)){set_custom_element_data(goa_icon,"arialabel",goa_icon_arialabel_value);}if(dirty[0]&/*name*/1&&goa_icon_ariacontrols_value!==(goa_icon_ariacontrols_value=`menu-${/*name*/ctx[0]}`)){set_custom_element_data(goa_icon,"ariacontrols",goa_icon_ariacontrols_value);}if(dirty[0]&/*_isMenuVisible*/131072&&goa_icon_ariaexpanded_value!==(goa_icon_ariaexpanded_value=fromBoolean(/*_isMenuVisible*/ctx[17]))){set_custom_element_data(goa_icon,"ariaexpanded",goa_icon_ariaexpanded_value);}if(dirty[0]&/*_disabled*/33554432){toggle_class(goa_icon,"disabled",/*_disabled*/ctx[25]);}},d(detaching){if(detaching)detach(goa_icon);mounted=false;run_all(dispose);}};}// (578:8) {:else}
|
|
186
|
+
function create_else_block_1(ctx){let li;return {c(){li=element("li");li.textContent="No matches found\n ";attr(li,"class","dropdown-item");attr(li,"data-testid","dropdown-item-not-found");},m(target,anchor){insert(target,li,anchor);},p:noop,d(detaching){if(detaching)detach(li);}};}// (562:8) {#each _filteredOptions as option, index (index)}
|
|
187
|
+
function create_each_block_1$1(key_1,ctx){let li;let t0_value=(/*option*/ctx[61].label||/*option*/ctx[61].value)+"";let t0;let t1;let li_id_value;let li_aria_selected_value;let li_data_index_value;let li_data_testid_value;let li_data_value_value;let mounted;let dispose;function click_handler(){return(/*click_handler*/ctx[43](/*option*/ctx[61]));}return {key:key_1,first:null,c(){li=element("li");t0=text(t0_value);t1=space();attr(li,"id",li_id_value=/*option*/ctx[61].value);attr(li,"aria-selected",li_aria_selected_value=/*_inputEl*/ctx[22].value===(/*option*/ctx[61].label||/*option*/ctx[61].value));attr(li,"class","dropdown-item");attr(li,"data-index",li_data_index_value=/*index*/ctx[65]);attr(li,"data-testid",li_data_testid_value=`dropdown-item-${/*option*/ctx[61].value}`);attr(li,"data-value",li_data_value_value=/*option*/ctx[61].value);attr(li,"role","option");set_style(li,"display","block");toggle_class(li,"dropdown-item--highlighted",/*index*/ctx[65]===/*_highlightedIndex*/ctx[13]);toggle_class(li,"selected",/*_inputEl*/ctx[22].value===(/*option*/ctx[61].label||/*option*/ctx[61].value));this.first=li;},m(target,anchor){insert(target,li,anchor);append(li,t0);append(li,t1);if(!mounted){dispose=listen(li,"click",click_handler);mounted=true;}},p(new_ctx,dirty){ctx=new_ctx;if(dirty[0]&/*_filteredOptions*/16384&&t0_value!==(t0_value=(/*option*/ctx[61].label||/*option*/ctx[61].value)+""))set_data(t0,t0_value);if(dirty[0]&/*_filteredOptions*/16384&&li_id_value!==(li_id_value=/*option*/ctx[61].value)){attr(li,"id",li_id_value);}if(dirty[0]&/*_inputEl, _filteredOptions*/4210688&&li_aria_selected_value!==(li_aria_selected_value=/*_inputEl*/ctx[22].value===(/*option*/ctx[61].label||/*option*/ctx[61].value))){attr(li,"aria-selected",li_aria_selected_value);}if(dirty[0]&/*_filteredOptions*/16384&&li_data_index_value!==(li_data_index_value=/*index*/ctx[65])){attr(li,"data-index",li_data_index_value);}if(dirty[0]&/*_filteredOptions*/16384&&li_data_testid_value!==(li_data_testid_value=`dropdown-item-${/*option*/ctx[61].value}`)){attr(li,"data-testid",li_data_testid_value);}if(dirty[0]&/*_filteredOptions*/16384&&li_data_value_value!==(li_data_value_value=/*option*/ctx[61].value)){attr(li,"data-value",li_data_value_value);}if(dirty[0]&/*_filteredOptions, _highlightedIndex*/24576){toggle_class(li,"dropdown-item--highlighted",/*index*/ctx[65]===/*_highlightedIndex*/ctx[13]);}if(dirty[0]&/*_inputEl, _filteredOptions*/4210688){toggle_class(li,"selected",/*_inputEl*/ctx[22].value===(/*option*/ctx[61].label||/*option*/ctx[61].value));}},d(detaching){if(detaching)detach(li);mounted=false;dispose();}};}// (451:6) {#each _options as option}
|
|
188
|
+
function create_each_block$8(ctx){let option;let t0_value=/*option*/ctx[61].label+"";let t0;let t1;let option_selected_value;let option_value_value;return {c(){option=element("option");t0=text(t0_value);t1=space();option.selected=option_selected_value=/*value*/ctx[3]===/*option*/ctx[61].value;option.__value=option_value_value=/*option*/ctx[61].value;option.value=option.__value;},m(target,anchor){insert(target,option,anchor);append(option,t0);append(option,t1);},p(ctx,dirty){if(dirty[0]&/*_options*/65536&&t0_value!==(t0_value=/*option*/ctx[61].label+""))set_data(t0,t0_value);if(dirty[0]&/*value, _options*/65544&&option_selected_value!==(option_selected_value=/*value*/ctx[3]===/*option*/ctx[61].value)){option.selected=option_selected_value;}if(dirty[0]&/*_options*/65536&&option_value_value!==(option_value_value=/*option*/ctx[61].value)){option.__value=option_value_value;option.value=option.__value;}},d(detaching){if(detaching)detach(option);}};}function create_fragment$J(ctx){let div;let div_data_testid_value;let div_style_value;function select_block_type(ctx,dirty){if(/*_native*/ctx[15])return create_if_block$p;return create_else_block$a;}let current_block_type=select_block_type(ctx);let if_block=current_block_type(ctx);return {c(){div=element("div");if_block.c();this.c=noop;attr(div,"data-testid",div_data_testid_value=`${/*name*/ctx[0]}-dropdown`);attr(div,"class","dropdown");attr(div,"style",div_style_value=`
|
|
189
|
+
${calculateMargin(/*mt*/ctx[9],/*mr*/ctx[10],/*mb*/ctx[11],/*ml*/ctx[12])};
|
|
190
|
+
--width: ${/*_width*/ctx[18]};
|
|
191
|
+
`);toggle_class(div,"dropdown-native",/*_native*/ctx[15]);},m(target,anchor){insert(target,div,anchor);if_block.m(div,null);/*div_binding*/ctx[45](div);},p(ctx,dirty){if(current_block_type===(current_block_type=select_block_type(ctx))&&if_block){if_block.p(ctx,dirty);}else {if_block.d(1);if_block=current_block_type(ctx);if(if_block){if_block.c();if_block.m(div,null);}}if(dirty[0]&/*name*/1&&div_data_testid_value!==(div_data_testid_value=`${/*name*/ctx[0]}-dropdown`)){attr(div,"data-testid",div_data_testid_value);}if(dirty[0]&/*mt, mr, mb, ml, _width*/269824&&div_style_value!==(div_style_value=`
|
|
192
|
+
${calculateMargin(/*mt*/ctx[9],/*mr*/ctx[10],/*mb*/ctx[11],/*ml*/ctx[12])};
|
|
193
|
+
--width: ${/*_width*/ctx[18]};
|
|
194
|
+
`)){attr(div,"style",div_style_value);}if(dirty[0]&/*_native*/32768){toggle_class(div,"dropdown-native",/*_native*/ctx[15]);}},i:noop,o:noop,d(detaching){if(detaching)detach(div);if_block.d();/*div_binding*/ctx[45](null);}};}function parseValues(selectedValue){let rawValue;try{rawValue=JSON.parse(selectedValue||`[""]`);}catch(e){rawValue=[selectedValue];}const rawValues=typeof rawValue==="object"?rawValue:[rawValue];// convert all values to strings to avoid later type comparison issues
|
|
197
195
|
return rawValues.map(val=>`${val}`);}function isFilterMatch(option,filter){if(filter.length===0)return true;let value=option.filter||option.label||option.value;value=value.toLowerCase();filter=filter.toLowerCase();return value.startsWith(filter)||value.includes(" "+filter);}function instance$G($$self,$$props,$$invalidate){let _disabled;let _error;let _multiselect;let _native;let _filterable;let _activeDescendantId;let{name}=$$props;let{arialabel=""}=$$props;let{arialabelledby=""}=$$props;let{value=""}=$$props;let{filterable="false"}=$$props;let{leadingicon=null}=$$props;let{maxheight="276px"}=$$props;let{placeholder=""}=$$props;let{width=""}=$$props;let{disabled="false"}=$$props;let{error="false"}=$$props;let{multiselect="false"}=$$props;let{native="false"}=$$props;let{relative="false"}=$$props;let{mt=null}=$$props;let{mr=null}=$$props;let{mb=null}=$$props;let{ml=null}=$$props;//
|
|
198
196
|
// Private
|
|
199
197
|
//
|
|
@@ -202,33 +200,34 @@ let _options=[];let _isMenuVisible=false;let _highlightedIndex=-1;let _width;let
|
|
|
202
200
|
//
|
|
203
201
|
onMount(async()=>{var _a,_b;_eventHandler=_filterable?new ComboboxKeyUpHandler(_inputEl):new DropdownKeyUpHandler(_inputEl);// the following is required to appease the jest testing gods in that they don't respond
|
|
204
202
|
// to the slotchange event
|
|
205
|
-
$$invalidate(
|
|
206
|
-
|
|
203
|
+
$$invalidate(16,_options=getOptions());if(!_native){$$invalidate(22,_inputEl.value=(_b=(_a=_options.find(o=>o.value===value))===null||_a===void 0?void 0:_a.label)!==null&&_b!==void 0?_b:"",_inputEl);if(width){if(width.endsWith("%")){const percent=parseInt(width)/100;const rootRect=_rootEl.getBoundingClientRect();$$invalidate(18,_width=percent*rootRect.width+"px");}else {$$invalidate(18,_width=width);}}// This is only here to allow the Jest tests to pass :(
|
|
204
|
+
if(!width&&_options.length>0){$$invalidate(18,_width=getLongestChildWidth(_options));}}syncFilteredOptions();// watch for DOM changes within the slot => dynamic binding
|
|
205
|
+
const slot=_rootEl.querySelector("slot");slot===null||slot===void 0?void 0:slot.addEventListener("slotchange",_=>{var _a,_b;$$invalidate(16,_options=getOptions());syncFilteredOptions();if(!width){$$invalidate(18,_width=getLongestChildWidth(_options));}if(!_native){$$invalidate(22,_inputEl.value=(_b=(_a=_options.find(o=>o.value===value))===null||_a===void 0?void 0:_a.label)!==null&&_b!==void 0?_b:"",_inputEl);}});});//
|
|
207
206
|
// Functions
|
|
208
207
|
//
|
|
209
208
|
// prevents unwanted reactive updates.
|
|
210
209
|
function setDisplayedValue(){var _a,_b;if(_inputEl){const option=_options.find(o=>o.value==_values[0]);// possible string number comparison
|
|
211
|
-
$$invalidate(
|
|
210
|
+
$$invalidate(22,_inputEl.value=(_b=(_a=option===null||option===void 0?void 0:option.label)!==null&&_a!==void 0?_a:option===null||option===void 0?void 0:option.value)!==null&&_b!==void 0?_b:"",_inputEl);}}function getChildren(){const slot=_rootEl.querySelector("slot");if(slot){// default
|
|
212
211
|
return slot.assignedElements();}// unit tests
|
|
213
212
|
const el=_native?_selectEl:_rootEl;return [...el.children];}// Create a list of the options based on the children within the slot
|
|
214
213
|
// The children don't have to be goa-dropdown-item elements. Any child element
|
|
215
214
|
// work as long as it has a value and label content
|
|
216
215
|
function getOptions(){return getChildren().filter(child=>child.tagName==="GOA-DROPDOWN-ITEM").map(el=>{const option=el;const value=el.getAttribute("value")||option.value||"";const label=el.getAttribute("label")||option.label||el.innerHTML||value;const filter=el.getAttribute("filter")||label||value||"";return {value,label,filter};});}// compute the required width to ensure all children fit
|
|
217
|
-
function
|
|
216
|
+
function getLongestChildWidth(options){// set width to longest item
|
|
218
217
|
const optionsWidth=options.map(option=>{const label=`${option.label}`||`${option.value}`||"";return label.length;}).sort((a,b)=>a>b?1:-1).pop();// longest one defines the width
|
|
219
218
|
let maxWidth=Math.max(optionsWidth,placeholder.length)+8;// compensate for icon width
|
|
220
219
|
if(leadingicon){maxWidth+=2;}return `${maxWidth}ch`;}// Change the direction of highlighted options for Arrow up and down
|
|
221
220
|
function changeHighlightedOption(offset){let index=_highlightedIndex+offset;let items=!(_filteredOptions===null||_filteredOptions===void 0?void 0:_filteredOptions.length)?_options:_filteredOptions;if(items.length===0)return;// if index is out of scope
|
|
222
|
-
if(index<0){index=_filterable?items.length-1:0;}else if(index>=items.length){index=_filterable?0:items.length-1;}$$invalidate(
|
|
221
|
+
if(index<0){index=_filterable?items.length-1:0;}else if(index>=items.length){index=_filterable?0:items.length-1;}$$invalidate(13,_highlightedIndex=index);scrollToOption(index);}function scrollToOption(index){const liNode=_menuEl.querySelector(`li[data-index="${index}"]`);if(!liNode)return;const liOptionRect=liNode.getBoundingClientRect();const ulRect=_menuEl.getBoundingClientRect();const isInView=liOptionRect.top>=0&&liOptionRect.left>=0&&liOptionRect.bottom<=ulRect.height&&liOptionRect.right<=ulRect.width;if(isInView)return;liNode.scrollIntoView({behavior:"smooth",block:"nearest"});}function syncFilteredOptions(){$$invalidate(14,_filteredOptions=_filterable?_options.filter(option=>isFilterMatch(option,_inputEl.value)):_options);}function showMenu(){if(_disabled){return;}setTimeout(()=>{syncFilteredOptions();$$invalidate(17,_isMenuVisible=true);_inputEl.focus();},0);}function hideMenu(){$$invalidate(17,_isMenuVisible=false);}function dispatchValue(value){const detail=_multiselect?{name,values:[value,..._values]}:{name,value};setTimeout(()=>{_rootEl.dispatchEvent(new CustomEvent("_change",{composed:true,detail}));_isDirty=false;},1);}//
|
|
223
222
|
// Event handlers
|
|
224
223
|
//
|
|
225
|
-
function onSelect(option){if(_disabled)return;if(!_native){_isDirty=true;hideMenu();$$invalidate(
|
|
224
|
+
function onSelect(option){if(_disabled)return;if(!_native){_isDirty=true;hideMenu();$$invalidate(22,_inputEl.value=option.label,_inputEl);}dispatchValue(option.value);}function onInputKeyUp(e){if(_disabled)return;_eventHandler.handleKeyUp(e);}function onInputKeyDown(e){if(_disabled)return;_eventHandler.handleKeyDown(e);}function onClearIconKeyDown(e){if(e.key==="Enter"||e.key===" "){e.stopPropagation();reset();showMenu();}}function onClearIconClick(e){reset();showMenu();e.stopPropagation();}function onNativeSelect(e){const target=e.currentTarget;const option=_options[target.selectedIndex];onSelect(option);}function reset(){if(_disabled)return;$$invalidate(24,_activeDescendantId=undefined);$$invalidate(13,_highlightedIndex=-1);$$invalidate(22,_inputEl.value="",_inputEl);_isDirty=false;syncFilteredOptions();dispatchValue("");}function onChevronClick(e){showMenu();e.stopPropagation();}class ComboboxKeyUpHandler{constructor(input){this.input=input;input.addEventListener("blur",async function(e){if(!_isDirty)return;if(!_filterable)return;const input=e.target;const selectedOption=_filteredOptions.find(o=>o.label===input.value);if(!selectedOption){dispatchValue("");input.value="";}});}onEscape(e){reset();_inputEl.focus();e.preventDefault();e.stopPropagation();}onEnter(e){const option=_filteredOptions[_highlightedIndex];if(option){onSelect(option);}if(_inputEl.value){hideMenu();}else {showMenu();}e.stopPropagation();}onArrow(e,direction){if(!_isMenuVisible)showMenu();changeHighlightedOption(direction==="up"?-1:1);e.stopPropagation();}onTab(_){const matchedOption=_filteredOptions.find(option=>option.label.toLowerCase()===this.input.value.toLowerCase());if(matchedOption){onSelect(matchedOption);}hideMenu();}onKeyUp(_){showMenu();_isDirty=true;}handleKeyUp(e){switch(e.key){case"Enter":this.onEnter(e);break;case"ArrowUp":this.onArrow(e,"up");break;case"ArrowDown":this.onArrow(e,"down");break;case"Home":this.input.setSelectionRange(0,0);break;case"End":this.input.setSelectionRange(this.input.value.length,this.input.value.length);break;default:this.onKeyUp(e);break;}}handleKeyDown(e){switch(e.key){case"Escape":this.onEscape(e);break;case"Tab":this.onTab(e);break;}}}class DropdownKeyUpHandler{constructor(_input){}onEnter(e){if(_isMenuVisible){const option=_filteredOptions[_highlightedIndex];if(option){onSelect(option);}hideMenu();}else {showMenu();}e.preventDefault();e.stopPropagation();}onArrow(e,direction){if(!_isMenuVisible)showMenu();changeHighlightedOption(direction==="up"?-1:1);e.preventDefault();e.stopPropagation();}handleKeyDown(e){switch(e.key){case" ":case"Enter":this.onEnter(e);break;case"ArrowUp":this.onArrow(e,"up");break;case"ArrowDown":this.onArrow(e,"down");break;case"Tab":hideMenu();break;}return false;}handleKeyUp(e){switch(e.key){case"ArrowUp":case"ArrowDown":case" ":case"Enter":e.preventDefault();e.stopPropagation();}}}function select_binding($$value){binding_callbacks[$$value?'unshift':'push'](()=>{_selectEl=$$value;$$invalidate(21,_selectEl);$$invalidate(16,_options);});}function input_binding($$value){binding_callbacks[$$value?'unshift':'push'](()=>{_inputEl=$$value;$$invalidate(22,_inputEl);});}const click_handler=option=>onSelect(option);function ul_binding($$value){binding_callbacks[$$value?'unshift':'push'](()=>{_menuEl=$$value;$$invalidate(20,_menuEl);});}function div_binding($$value){binding_callbacks[$$value?'unshift':'push'](()=>{_rootEl=$$value;$$invalidate(19,_rootEl);});}$$self.$$set=$$props=>{if('name'in $$props)$$invalidate(0,name=$$props.name);if('arialabel'in $$props)$$invalidate(1,arialabel=$$props.arialabel);if('arialabelledby'in $$props)$$invalidate(2,arialabelledby=$$props.arialabelledby);if('value'in $$props)$$invalidate(3,value=$$props.value);if('filterable'in $$props)$$invalidate(36,filterable=$$props.filterable);if('leadingicon'in $$props)$$invalidate(4,leadingicon=$$props.leadingicon);if('maxheight'in $$props)$$invalidate(5,maxheight=$$props.maxheight);if('placeholder'in $$props)$$invalidate(6,placeholder=$$props.placeholder);if('width'in $$props)$$invalidate(37,width=$$props.width);if('disabled'in $$props)$$invalidate(7,disabled=$$props.disabled);if('error'in $$props)$$invalidate(38,error=$$props.error);if('multiselect'in $$props)$$invalidate(39,multiselect=$$props.multiselect);if('native'in $$props)$$invalidate(40,native=$$props.native);if('relative'in $$props)$$invalidate(8,relative=$$props.relative);if('mt'in $$props)$$invalidate(9,mt=$$props.mt);if('mr'in $$props)$$invalidate(10,mr=$$props.mr);if('mb'in $$props)$$invalidate(11,mb=$$props.mb);if('ml'in $$props)$$invalidate(12,ml=$$props.ml);};$$self.$$.update=()=>{if($$self.$$.dirty[0]&/*disabled*/128){//
|
|
226
225
|
// Reactive
|
|
227
226
|
//
|
|
228
|
-
$$invalidate(
|
|
229
|
-
$$invalidate(
|
|
227
|
+
$$invalidate(25,_disabled=toBoolean(disabled));}if($$self.$$.dirty[1]&/*error*/128){$$invalidate(26,_error=toBoolean(error));}if($$self.$$.dirty[1]&/*multiselect*/256){_multiselect=toBoolean(multiselect);}if($$self.$$.dirty[1]&/*native*/512){$$invalidate(15,_native=toBoolean(native));}if($$self.$$.dirty[0]&/*_native*/32768|$$self.$$.dirty[1]&/*filterable*/32){$$invalidate(23,_filterable=toBoolean(filterable)&&!_native);}if($$self.$$.dirty[0]&/*_filteredOptions, _highlightedIndex*/24576){// To keep track of active descendant for the accessibility
|
|
228
|
+
$$invalidate(24,_activeDescendantId=_filteredOptions[_highlightedIndex]?_filteredOptions[_highlightedIndex].value:undefined);}if($$self.$$.dirty[0]&/*value*/8){{_values=parseValues(value);// updating _inputEl.value is done within seperate function
|
|
230
229
|
// to prevent unwanted reactive updates.
|
|
231
|
-
setDisplayedValue();}}};return [name,arialabel,arialabelledby,value,leadingicon,maxheight,placeholder,
|
|
230
|
+
setDisplayedValue();}}};return [name,arialabel,arialabelledby,value,leadingicon,maxheight,placeholder,disabled,relative,mt,mr,mb,ml,_highlightedIndex,_filteredOptions,_native,_options,_isMenuVisible,_width,_rootEl,_menuEl,_selectEl,_inputEl,_filterable,_activeDescendantId,_disabled,_error,showMenu,hideMenu,onSelect,onInputKeyUp,onInputKeyDown,onClearIconKeyDown,onClearIconClick,onNativeSelect,onChevronClick,filterable,width,error,multiselect,native,select_binding,input_binding,click_handler,ul_binding,div_binding];}class Dropdown extends SvelteElement{constructor(options){super();const style=document.createElement('style');style.textContent=`:host{box-sizing:border-box;font-family:var(--goa-font-family-sans)}.dropdown{cursor:pointer;width:var(--width, 100%)}.dropdown-input-group{box-sizing:border-box;outline:none;transition:box-shadow 0.1s ease-in;border:1px solid var(--goa-color-greyscale-700);border-radius:var(--goa-border-radius-m);display:inline-flex;align-items:stretch;vertical-align:middle;background-color:var(--goa-color-greyscale-white);cursor:pointer;width:var(--width, 100%)}.dropdown-input-group:hover{border-color:var(--goa-color-interactive-hover);box-shadow:0 0 0 var(--goa-border-width-m) var(--goa-color-interactive-hover)}.dropdown-input-group:focus,.dropdown-input-group:focus-within{box-shadow:0 0 0 3px var(--goa-color-interactive-focus)}@media screen and (max-width: 623px){@media not (max-color:2147477350){.dropdown-input-group{width:var(--width)}}}@media not screen and (max-width: 623px){@media not (color:2147477350){.dropdown-input-group{width:var(--width)}}}.dropdown-input-group.error,.dropdown-input-group.error:hover{border:2px solid var(--goa-color-interactive-error);box-shadow:0 0 0 1px var(--goa-color-interactive-error)}.dropdown-input-group.error:focus-within,.dropdown-input-group.error:focus{border:2px solid var(--goa-color-interactive-error);box-shadow:0 0 0 3px var(--goa-color-interactive-focus)}.dropdown-icon--arrow,.dropdown-icon--clear{margin-right:var(--goa-space-s)}.dropdown-icon--clear:focus:not(.disabled),.dropdown-icon--clear:active:not(.disabled){color:var(--goa-color-interactive-focus);outline:none}.dropdown-input--leading-icon{margin-left:0.75rem}.dropdown-input--leading-icon+input{padding-left:0.5rem}input{display:inline-block;color:var(--goa-color-text-default);font-size:var(--goa-font-size-4);padding:var(--goa-space-xs);padding-left:var(--goa-space-s);line-height:calc(40px - calc(var(--goa-space-xs) * 2));background-color:transparent;width:100%;flex:1 1 auto;font-family:var(--goa-font-family-sans);z-index:1}input,input:focus,input:hover,input:active{outline:none;border:none}input[aria-disabled="true"]{color:var(--goa-color-text-secondary)}.dropdown-input-group--disabled,.dropdown-input-group--disabled:hover,.dropdown-input-group--disabled:active,.dropdown-input-group--disabled:focus{background-color:var(--goa-color-greyscale-100);border-color:var(--goa-color-greyscale-200) !important;cursor:default;box-shadow:none !important}ul[role="listbox"]{border-radius:var(--goa-border-radius-m)}.dropdown-item{margin:0;padding:0.5rem;cursor:pointer;color:var(--goa-color-greyscale-black);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dropdown-item:hover,.dropdown-item--highlighted{background:var(--goa-color-greyscale-100);color:var(--goa-color-interactive-hover)}.dropdown-item[aria-selected="true"]{background:var(--goa-color-interactive-default);color:var(--goa-color-greyscale-white)}.dropdown-item[aria-selected="true"]:hover,.dropdown-item[aria-selected="true"].dropdown-item--highlighted{background:var(--goa-color-interactive-hover);color:var(--goa-color-greyscale-white)}.dropdown-native{position:relative;border:1px solid var(--goa-color-greyscale-700);border-radius:var(--goa-border-radius-m);background-color:var(--goa-color-greyscale-white);transition:box-shadow 0.1s ease-in}.dropdown-native:has(select:disabled){background-color:var(--goa-color-greyscale-100);border-color:var(--goa-color-greyscale-200);box-shadow:none;color:var(--goa-color-text-secondary);cursor:default}.dropdown-native:has(select.error){border:2px solid var(--goa-color-interactive-error)}.dropdown-native:hover{border-color:var(--goa-color-interactive-hover);box-shadow:0 0 0 var(--goa-border-width-m) var(--goa-color-interactive-hover)}select{border:none;font:var(--goa-font-family-sans);background-color:transparent;color:var(--goa-color-text-default);font-size:var(--goa-font-size-4);-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:calc(var(--goa-space-xs) + 1px);padding-left:var(--goa-space-s);padding-right:3rem;outline:none;width:100%}.dropdown-native::after{content:"";position:absolute;right:0.6rem;top:0.6rem;pointer-events:none;width:1.5rem;height:1.5rem;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'><path fill='none' stroke='%23333333' stroke-linecap='round' stroke-linejoin='round' stroke-width='48' d='M112 184l144 144 144-144' /%3E%3C/svg%3E");background-repeat:none}.dropdown-native:focus-within{box-shadow:0 0 0 3px var(--goa-color-interactive-focus)}`;this.shadowRoot.appendChild(style);init(this,{target:this.shadowRoot,props:attribute_to_object(this.attributes),customElement:true},instance$G,create_fragment$J,safe_not_equal,{name:0,arialabel:1,arialabelledby:2,value:3,filterable:36,leadingicon:4,maxheight:5,placeholder:6,width:37,disabled:7,error:38,multiselect:39,native:40,relative:8,mt:9,mr:10,mb:11,ml:12},null,[-1,-1,-1]);if(options){if(options.target){insert(options.target,this,options.anchor);}if(options.props){this.$set(options.props);flush();}}}static get observedAttributes(){return ["name","arialabel","arialabelledby","value","filterable","leadingicon","maxheight","placeholder","width","disabled","error","multiselect","native","relative","mt","mr","mb","ml"];}get name(){return this.$$.ctx[0];}set name(name){this.$$set({name});flush();}get arialabel(){return this.$$.ctx[1];}set arialabel(arialabel){this.$$set({arialabel});flush();}get arialabelledby(){return this.$$.ctx[2];}set arialabelledby(arialabelledby){this.$$set({arialabelledby});flush();}get value(){return this.$$.ctx[3];}set value(value){this.$$set({value});flush();}get filterable(){return this.$$.ctx[36];}set filterable(filterable){this.$$set({filterable});flush();}get leadingicon(){return this.$$.ctx[4];}set leadingicon(leadingicon){this.$$set({leadingicon});flush();}get maxheight(){return this.$$.ctx[5];}set maxheight(maxheight){this.$$set({maxheight});flush();}get placeholder(){return this.$$.ctx[6];}set placeholder(placeholder){this.$$set({placeholder});flush();}get width(){return this.$$.ctx[37];}set width(width){this.$$set({width});flush();}get disabled(){return this.$$.ctx[7];}set disabled(disabled){this.$$set({disabled});flush();}get error(){return this.$$.ctx[38];}set error(error){this.$$set({error});flush();}get multiselect(){return this.$$.ctx[39];}set multiselect(multiselect){this.$$set({multiselect});flush();}get native(){return this.$$.ctx[40];}set native(native){this.$$set({native});flush();}get relative(){return this.$$.ctx[8];}set relative(relative){this.$$set({relative});flush();}get mt(){return this.$$.ctx[9];}set mt(mt){this.$$set({mt});flush();}get mr(){return this.$$.ctx[10];}set mr(mr){this.$$set({mr});flush();}get mb(){return this.$$.ctx[11];}set mb(mb){this.$$set({mb});flush();}get ml(){return this.$$.ctx[12];}set ml(ml){this.$$set({ml});flush();}}customElements.define("goa-dropdown",Dropdown);/* src/components/dropdown/DropdownItem.svelte generated by Svelte v3.59.2 */function create_fragment$I(ctx){return {c(){this.c=noop;},m:noop,p:noop,i:noop,o:noop,d:noop};}function instance$F($$self,$$props,$$invalidate){let{filter=""}=$$props;let{label=""}=$$props;let{value=""}=$$props;$$self.$$set=$$props=>{if('filter'in $$props)$$invalidate(0,filter=$$props.filter);if('label'in $$props)$$invalidate(1,label=$$props.label);if('value'in $$props)$$invalidate(2,value=$$props.value);};return [filter,label,value];}class DropdownItem extends SvelteElement{constructor(options){super();init(this,{target:this.shadowRoot,props:attribute_to_object(this.attributes),customElement:true},instance$F,create_fragment$I,safe_not_equal,{filter:0,label:1,value: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 ["filter","label","value"];}get filter(){return this.$$.ctx[0];}set filter(filter){this.$$set({filter});flush();}get label(){return this.$$.ctx[1];}set label(label){this.$$set({label});flush();}get value(){return this.$$.ctx[2];}set value(value){this.$$set({value});flush();}}customElements.define("goa-dropdown-item",DropdownItem);/* src/components/focus-trap/FocusTrap.svelte generated by Svelte v3.59.2 */function create_fragment$H(ctx){let div;return {c(){div=element("div");div.innerHTML=`<span data-tab-boundry="start" tabindex="0"></span>
|
|
232
231
|
<slot></slot>
|
|
233
232
|
|
|
234
233
|
<span data-tab-boundry="end" tabindex="0"></span>`;this.c=noop;},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 isFocusable(node){var _a;const element=node;const isTabbable=element.tabIndex>0||element.tabIndex===0&&element.getAttribute('tabIndex')!==null;if(isTabbable)return node;if(element["disabled"])return null;if(element.tabIndex<0||((_a=element.getAttribute)===null||_a===void 0?void 0:_a.call(element,"tabindex"))==="-1")return null;switch(element.nodeName){case'A':{const el=element;if(!!el.href&&el.rel!=='ignore')return node;}case'INPUT':{const el=element;if(el.type!=='hidden'&&el.type!=='file')return node;}case'BUTTON':case'SELECT':case'TEXTAREA':return node;default:return null;}}function instance$E($$self,$$props,$$invalidate){let rootEl;let boundryStartEl;let boundryEndEl;let isShiftPressed;// Hooks
|
|
@@ -319,7 +318,8 @@ $$invalidate(8,_pageCount=Math.ceil(itemcount/perpagecount));}};return [pagenumb
|
|
|
319
318
|
max-width: ${/*maxwidth*/ctx[1]};
|
|
320
319
|
padding: ${/*_padded*/ctx[19]?"var(--goa-space-m)":"0"};
|
|
321
320
|
`)){attr(section,"style",section_style_value);}},d(detaching){if(detaching)detach(div0);if(detaching)detach(t);if(detaching)detach(div2);/*div1_binding*/ctx[28](null);section_resize_listener();/*section_binding*/ctx[30](null);mounted=false;dispose();}};}function create_fragment$s(ctx){let div1;let div0;let slot;let div0_tabindex_value;let t;let div1_style_value;let mounted;let dispose;let if_block=/*_open*/ctx[13]&&create_if_block$f(ctx);return {c(){div1=element("div");div0=element("div");slot=element("slot");t=space();if(if_block)if_block.c();this.c=noop;attr(slot,"name","target");attr(div0,"class","popover-target");attr(div0,"tabindex",div0_tabindex_value=+/*tabindex*/ctx[7]);attr(div0,"data-testid","popover-target");attr(div1,"data-testid",/*testid*/ctx[0]);attr(div1,"style",div1_style_value=`
|
|
322
|
-
${/*
|
|
321
|
+
${/*width*/ctx[2]&&`width: ${/*width*/ctx[2]};`}
|
|
322
|
+
${/*_relative*/ctx[18]&&"position: relative;"||""}
|
|
323
323
|
${calculateMargin(/*mt*/ctx[3],/*mr*/ctx[4],/*mb*/ctx[5],/*ml*/ctx[6])}
|
|
324
324
|
${cssVar("--offset-top",/*voffset*/ctx[8])}
|
|
325
325
|
${cssVar("--offset-bottom",/*voffset*/ctx[8])}
|
|
@@ -327,9 +327,9 @@ $$invalidate(8,_pageCount=Math.ceil(itemcount/perpagecount));}};return [pagenumb
|
|
|
327
327
|
${cssVar("--offset-right",/*hoffset*/ctx[9])}
|
|
328
328
|
${cssVar("--focus-border-width",/*focusborderwidth*/ctx[10])}
|
|
329
329
|
${cssVar("--border-radius",/*borderradius*/ctx[11])}
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
${/*_relative*/ctx[18]&&"position: relative;"}
|
|
330
|
+
`);},m(target,anchor){insert(target,div1,anchor);append(div1,div0);append(div0,slot);/*div0_binding*/ctx[27](div0);append(div1,t);if(if_block)if_block.m(div1,null);/*div1_binding_1*/ctx[31](div1);if(!mounted){dispose=listen(div0,"click",/*openPopover*/ctx[20]);mounted=true;}},p(ctx,dirty){if(dirty[0]&/*tabindex*/128&&div0_tabindex_value!==(div0_tabindex_value=+/*tabindex*/ctx[7])){attr(div0,"tabindex",div0_tabindex_value);}if(/*_open*/ctx[13]){if(if_block){if_block.p(ctx,dirty);}else {if_block=create_if_block$f(ctx);if_block.c();if_block.m(div1,null);}}else if(if_block){if_block.d(1);if_block=null;}if(dirty[0]&/*testid*/1){attr(div1,"data-testid",/*testid*/ctx[0]);}if(dirty[0]&/*width, _relative, mt, mr, mb, ml, voffset, hoffset, focusborderwidth, borderradius*/266108&&div1_style_value!==(div1_style_value=`
|
|
331
|
+
${/*width*/ctx[2]&&`width: ${/*width*/ctx[2]};`}
|
|
332
|
+
${/*_relative*/ctx[18]&&"position: relative;"||""}
|
|
333
333
|
${calculateMargin(/*mt*/ctx[3],/*mr*/ctx[4],/*mb*/ctx[5],/*ml*/ctx[6])}
|
|
334
334
|
${cssVar("--offset-top",/*voffset*/ctx[8])}
|
|
335
335
|
${cssVar("--offset-bottom",/*voffset*/ctx[8])}
|
|
@@ -337,8 +337,7 @@ $$invalidate(8,_pageCount=Math.ceil(itemcount/perpagecount));}};return [pagenumb
|
|
|
337
337
|
${cssVar("--offset-right",/*hoffset*/ctx[9])}
|
|
338
338
|
${cssVar("--focus-border-width",/*focusborderwidth*/ctx[10])}
|
|
339
339
|
${cssVar("--border-radius",/*borderradius*/ctx[11])}
|
|
340
|
-
|
|
341
|
-
`)){attr(div1,"style",div1_style_value);}},i:noop,o:noop,d(detaching){if(detaching)detach(div1);/*div0_binding*/ctx[27](null);if(if_block)if_block.d();/*div1_binding_1*/ctx[31](null);mounted=false;dispose();}};}function getBoundingClientRectWithMargins(el){const rect=el.getBoundingClientRect();const style=window.getComputedStyle(el);const mTop=parseInt(style.marginTop,10)||0;const mRight=parseInt(style.marginRight,10)||0;const mBottom=parseInt(style.marginBottom,10)||0;const mLeft=parseInt(style.marginLeft,10)||0;return {top:rect.top-mTop,right:rect.right+mRight,bottom:rect.bottom+mBottom,left:rect.left-mLeft,width:rect.width+mLeft+mRight,height:rect.height+mTop+mBottom,x:rect.x-mLeft,y:rect.y-mTop};}function instance$p($$self,$$props,$$invalidate){let _padded;let _open;let _disabled;let _relative;let{testid="popover"}=$$props;let{maxwidth="320px"}=$$props;let{width=""}=$$props;let{padded="true"}=$$props;let{position="auto"}=$$props;let{relative="false"}=$$props;let{mt=null}=$$props;let{mr=null}=$$props;let{mb=null}=$$props;let{ml=null}=$$props;let{open="false"}=$$props;let{disabled="false"}=$$props;let{tabindex="0"}=$$props;let{voffset=""}=$$props;let{hoffset=""}=$$props;let{focusborderwidth="var(--goa-border-width-l)"}=$$props;let{borderradius="var(--goa-border-radius-m)"}=$$props;// Private
|
|
340
|
+
`)){attr(div1,"style",div1_style_value);}},i:noop,o:noop,d(detaching){if(detaching)detach(div1);/*div0_binding*/ctx[27](null);if(if_block)if_block.d();/*div1_binding_1*/ctx[31](null);mounted=false;dispose();}};}function getBoundingClientRectWithMargins(el){const rect=el.getBoundingClientRect();const style=window.getComputedStyle(el);const mTop=parseInt(style.marginTop,10)||0;const mRight=parseInt(style.marginRight,10)||0;const mBottom=parseInt(style.marginBottom,10)||0;const mLeft=parseInt(style.marginLeft,10)||0;return {top:rect.top-mTop,right:rect.right+mRight,bottom:rect.bottom+mBottom,left:rect.left-mLeft,width:rect.width+mLeft+mRight,height:rect.height+mTop+mBottom,x:rect.x-mLeft,y:rect.y-mTop};}function instance$p($$self,$$props,$$invalidate){let _padded;let _open;let _disabled;let _relative;let{testid="popover"}=$$props;let{maxwidth="320px"}=$$props;let{width=""}=$$props;let{padded="true"}=$$props;let{position="auto"}=$$props;let{relative="false"}=$$props;let{mt=null}=$$props;let{mr=null}=$$props;let{mb=null}=$$props;let{ml=null}=$$props;let{open="false"}=$$props;let{disabled="false"}=$$props;let{tabindex="0"}=$$props;let{voffset=""}=$$props;let{hoffset=""}=$$props;let{focusborderwidth="var(--goa-border-width-l)"}=$$props;let{borderradius="var(--goa-border-radius-m)"}=$$props;// Private
|
|
342
341
|
let _rootEl;let _targetEl;let _popoverEl;let _focusTrapEl;let _initFocusedEl;let _sectionHeight;// Hooks
|
|
343
342
|
onMount(async()=>{await tick();_targetEl.addEventListener("keydown",onTargetEvent);const slot=_targetEl.querySelector("slot");let children;if(slot){children=slot.assignedElements();}else {// for unit tests only
|
|
344
343
|
children=[..._targetEl.children];}_initFocusedEl=children.find(el=>el.tabIndex>=0)||_targetEl;});// Functions
|
|
@@ -374,7 +373,7 @@ return [...el.children];}/**
|
|
|
374
373
|
* @param newValue Selected value
|
|
375
374
|
*/function onChange(newValue){if(newValue===value)return;$$invalidate(0,value=newValue);el.dispatchEvent(new CustomEvent("_change",{composed:true,detail:{name,value}}));}onMount(()=>{validateOrientation(orientation);});const change_handler=option=>onChange(option.value);function div_binding($$value){binding_callbacks[$$value?'unshift':'push'](()=>{el=$$value;$$invalidate(10,el);});}$$self.$$set=$$props=>{if('name'in $$props)$$invalidate(1,name=$$props.name);if('value'in $$props)$$invalidate(0,value=$$props.value);if('orientation'in $$props)$$invalidate(2,orientation=$$props.orientation);if('disabled'in $$props)$$invalidate(14,disabled=$$props.disabled);if('error'in $$props)$$invalidate(15,error=$$props.error);if('testid'in $$props)$$invalidate(3,testid=$$props.testid);if('arialabel'in $$props)$$invalidate(4,arialabel=$$props.arialabel);if('mt'in $$props)$$invalidate(5,mt=$$props.mt);if('mr'in $$props)$$invalidate(6,mr=$$props.mr);if('mb'in $$props)$$invalidate(7,mb=$$props.mb);if('ml'in $$props)$$invalidate(8,ml=$$props.ml);};$$self.$$.update=()=>{if($$self.$$.dirty&/*disabled*/16384){// private
|
|
376
375
|
$$invalidate(12,isDisabled=toBoolean(disabled));}if($$self.$$.dirty&/*error*/32768){$$invalidate(11,isError=toBoolean(error));}};return [value,name,orientation,testid,arialabel,mt,mr,mb,ml,options,el,isError,isDisabled,onChange,disabled,error,change_handler,div_binding];}class RadioGroup extends SvelteElement{constructor(options){super();const style=document.createElement('style');style.textContent=`:host{box-sizing:border-box;font-family:var(--goa-font-family-sans)}.goa-radio-group--horizontal{display:flex;flex-direction:row}.goa-radio-group--vertical{display:inline-block}label.goa-radio{--goa-radio-outline-width:3px;--goa-radio-diameter:1.5rem;--goa-radio-border-width:1px;--goa-radio-border-width--checked:7px;display:inline-block;box-sizing:border-box;display:flex}.goa-radio-container{padding-bottom:1rem}.goa-radio:hover{cursor:pointer}.goa-radio *,.goa-radio *:before,.goa-radio *:after{box-sizing:border-box}.goa-radio input[type="radio"]{width:0;height:0;margin:0;opacity:0}.goa-radio-label{padding:0 0.5rem;font-weight:var(--goa-font-weight-regular)}.goa-radio-description{font:var(--goa-typography-body-xs);margin-left:var(--goa-space-xl);margin-top:var(--goa-space-2xs)}.goa-radio-icon{display:inline-block;height:var(--goa-radio-diameter);width:var(--goa-radio-diameter);border-radius:50%;background-color:#fff;transition:box-shadow 100ms ease-in-out;flex:0 0 auto;margin-top:var(--font-valign-fix)}.goa-radio:focus>input:not(:disabled)~.goa-radio-icon{box-shadow:0 0 0 var(--goa-radio-outline-width) var(--goa-color-interactive-focus)}.goa-radio--disabled .goa-radio-label{opacity:0.4}.goa-radio--disabled:hover{cursor:default}input[type="radio"]:not(:checked)~.goa-radio-icon{border:var(--goa-radio-border-width) solid var(--goa-color-greyscale-700)}input[type="radio"]:hover~.goa-radio-icon{border:1px solid var(--goa-color-interactive-hover);box-shadow:0 0 0 1px var(--goa-color-interactive-hover)}input[type="radio"]:checked:hover~.goa-radio-icon{border:7px solid var(--goa-color-interactive-hover);box-shadow:0 0 0 1px var(--goa-color-interactive-hover)}input[type="radio"]:focus~.goa-radio-icon,input[type="radio"]:hover:active~.goa-radio-icon,input[type="radio"]:hover:focus~.goa-radio-icon,input[type="radio"]:active~.goa-radio-icon{box-shadow:0 0 0 var(--goa-radio-outline-width) var(--goa-color-interactive-focus)}input[type="radio"]:checked~.goa-radio-icon{border:var(--goa-radio-border-width--checked) solid var(--goa-color-interactive-default)}input[type="radio"]:disabled~.goa-radio-icon{border:var(--goa-radio-border-width) solid var(--goa-color-greyscale-700);box-shadow:none;opacity:40%}input[type="radio"]:disabled:checked~.goa-radio-icon{border:var(--goa-radio-border-width--checked) solid
|
|
377
|
-
var(--goa-color-interactive-hover);box-shadow:none}.goa-radio--error input[type="radio"]:checked~.goa-radio-icon{border:7px solid var(--goa-color-emergency-default)}.goa-radio--error input[type="radio"]:hover~.goa-radio-icon{box-shadow:0 0 0 1px var(--goa-color-emergency-default)}.goa-radio--error input[type="radio"]:disabled:hover~.goa-radio-icon{box-shadow:none}.goa-radio--error input[type="radio"]:not(:checked)~.goa-radio-icon{border:2px solid var(--goa-color-emergency-default)}`;this.shadowRoot.appendChild(style);init(this,{target:this.shadowRoot,props:attribute_to_object(this.attributes),customElement:true},instance$o,create_fragment$r,safe_not_equal,{name:1,value:0,orientation:2,disabled:14,error:15,testid:3,arialabel:4,mt:5,mr:6,mb:7,ml:8},null);if(options){if(options.target){insert(options.target,this,options.anchor);}if(options.props){this.$set(options.props);flush();}}}static get observedAttributes(){return ["name","value","orientation","disabled","error","testid","arialabel","mt","mr","mb","ml"];}get name(){return this.$$.ctx[1];}set name(name){this.$$set({name});flush();}get value(){return this.$$.ctx[0];}set value(value){this.$$set({value});flush();}get orientation(){return this.$$.ctx[2];}set orientation(orientation){this.$$set({orientation});flush();}get disabled(){return this.$$.ctx[14];}set disabled(disabled){this.$$set({disabled});flush();}get error(){return this.$$.ctx[15];}set error(error){this.$$set({error});flush();}get testid(){return this.$$.ctx[3];}set testid(testid){this.$$set({testid});flush();}get arialabel(){return this.$$.ctx[4];}set arialabel(arialabel){this.$$set({arialabel});flush();}get mt(){return this.$$.ctx[5];}set mt(mt){this.$$set({mt});flush();}get mr(){return this.$$.ctx[6];}set mr(mr){this.$$set({mr});flush();}get mb(){return this.$$.ctx[7];}set mb(mb){this.$$set({mb});flush();}get ml(){return this.$$.ctx[8];}set ml(ml){this.$$set({ml});flush();}}customElements.define("goa-radio-group",RadioGroup);/* src/components/scrollable/Scrollable.svelte generated by Svelte v3.59.2 */function create_fragment$q(ctx){let div;let slot;let div_style_value;let mounted;let dispose;return {c(){div=element("div");slot=element("slot");this.c=noop;attr(div,"class","goa-scrollable");attr(div,"style",div_style_value=`
|
|
376
|
+
var(--goa-color-interactive-hover);box-shadow:none}.goa-radio--error input[type="radio"]:checked~.goa-radio-icon{border:7px solid var(--goa-color-emergency-default)}.goa-radio--error input[type="radio"]:hover~.goa-radio-icon{box-shadow:0 0 0 1px var(--goa-color-emergency-default)}.goa-radio--error input[type="radio"]:hover:active~.goa-radio-icon,.goa-radio--error input[type="radio"]:hover:focus~.goa-radio-icon{box-shadow:0 0 0 var(--goa-radio-outline-width) var(--goa-color-interactive-focus)}.goa-radio--error input[type="radio"]:disabled:hover~.goa-radio-icon{box-shadow:none}.goa-radio--error input[type="radio"]:not(:checked)~.goa-radio-icon{border:2px solid var(--goa-color-emergency-default)}`;this.shadowRoot.appendChild(style);init(this,{target:this.shadowRoot,props:attribute_to_object(this.attributes),customElement:true},instance$o,create_fragment$r,safe_not_equal,{name:1,value:0,orientation:2,disabled:14,error:15,testid:3,arialabel:4,mt:5,mr:6,mb:7,ml:8},null);if(options){if(options.target){insert(options.target,this,options.anchor);}if(options.props){this.$set(options.props);flush();}}}static get observedAttributes(){return ["name","value","orientation","disabled","error","testid","arialabel","mt","mr","mb","ml"];}get name(){return this.$$.ctx[1];}set name(name){this.$$set({name});flush();}get value(){return this.$$.ctx[0];}set value(value){this.$$set({value});flush();}get orientation(){return this.$$.ctx[2];}set orientation(orientation){this.$$set({orientation});flush();}get disabled(){return this.$$.ctx[14];}set disabled(disabled){this.$$set({disabled});flush();}get error(){return this.$$.ctx[15];}set error(error){this.$$set({error});flush();}get testid(){return this.$$.ctx[3];}set testid(testid){this.$$set({testid});flush();}get arialabel(){return this.$$.ctx[4];}set arialabel(arialabel){this.$$set({arialabel});flush();}get mt(){return this.$$.ctx[5];}set mt(mt){this.$$set({mt});flush();}get mr(){return this.$$.ctx[6];}set mr(mr){this.$$set({mr});flush();}get mb(){return this.$$.ctx[7];}set mb(mb){this.$$set({mb});flush();}get ml(){return this.$$.ctx[8];}set ml(ml){this.$$set({ml});flush();}}customElements.define("goa-radio-group",RadioGroup);/* src/components/scrollable/Scrollable.svelte generated by Svelte v3.59.2 */function create_fragment$q(ctx){let div;let slot;let div_style_value;let mounted;let dispose;return {c(){div=element("div");slot=element("slot");this.c=noop;attr(div,"class","goa-scrollable");attr(div,"style",div_style_value=`
|
|
378
377
|
max-height: ${/*maxheight*/ctx[3]||"50vh"};
|
|
379
378
|
overflow-y: ${/*direction*/ctx[0]==="vertical"?'auto':'hidden'};
|
|
380
379
|
overflow-x: ${/*direction*/ctx[0]==="horizontal"?'auto':'hidden'};
|
package/react-components.umd.js
CHANGED
|
@@ -167,35 +167,33 @@
|
|
|
167
167
|
goa-container--${/*type*/ctx[0]}
|
|
168
168
|
padding--${/*padding*/ctx[2]}
|
|
169
169
|
accent--${/*accent*/ctx[1]}
|
|
170
|
-
`)){attr(div3,"class",div3_class_value);}},i:noop,o:noop,d(detaching){if(detaching)detach(div3);}};}function instance$J($$self,$$props,$$invalidate){const[Types,validateType]=typeValidator("Container type",["interactive","info","error","success","important","non-interactive"]);const[Accents,validateAccent]=typeValidator("Container accent",["thick","thin","filled"]);const[Paddings,validatePadding]=typeValidator("Container padding",["relaxed","compact"]);let{type="interactive"}=$$props;let{accent="filled"}=$$props;let{padding="relaxed"}=$$props;let{testid=""}=$$props;let{mt=null}=$$props;let{mr=null}=$$props;let{mb="m"}=$$props;let{ml=null}=$$props;onMount(()=>{validateType(type);validateAccent(accent);validatePadding(padding);});$$self.$$set=$$props=>{if('type'in $$props)$$invalidate(0,type=$$props.type);if('accent'in $$props)$$invalidate(1,accent=$$props.accent);if('padding'in $$props)$$invalidate(2,padding=$$props.padding);if('testid'in $$props)$$invalidate(3,testid=$$props.testid);if('mt'in $$props)$$invalidate(4,mt=$$props.mt);if('mr'in $$props)$$invalidate(5,mr=$$props.mr);if('mb'in $$props)$$invalidate(6,mb=$$props.mb);if('ml'in $$props)$$invalidate(7,ml=$$props.ml);};return [type,accent,padding,testid,mt,mr,mb,ml];}class Container extends SvelteElement{constructor(options){super();const style=document.createElement('style');style.textContent=`:host{box-sizing:border-box;font-family:var(--goa-font-family-sans);font-size:var(--goa-font-size-4);display:flex;flex:1 1 auto}.goa-container{box-sizing:border-box;display:flex;flex:1 1 auto;flex-direction:column}.goa-container *{box-sizing:border-box}header{display:flex;align-items:center;justify-content:space-between;font-weight:700;font-size:var(--goa-font-size-4);border-width:1px;border-style:solid;border-top-left-radius:var(--goa-border-radius-m);border-top-right-radius:var(--goa-border-radius-m)}.content{border-bottom:1px solid var(--goa-color-greyscale-200);border-left:1px solid var(--goa-color-greyscale-200);border-right:1px solid var(--goa-color-greyscale-200);border-bottom-left-radius:var(--goa-border-radius-m);border-bottom-right-radius:var(--goa-border-radius-m);display:flex;flex:1 1 auto;flex-direction:column}.content ::slotted(p:last-child){margin-bottom:0 !important}.goa-container--non-interactive.accent--filled .content{border-color:var(--goa-color-greyscale-200);background-color:var(--goa-color-greyscale-100)}.goa-container--important.accent--filled .content{border-color:var(--goa-color-warning-default);background-color:var(--goa-color-warning-background)}.goa-container--error.accent--filled .content{border-color:var(--goa-color-emergency-default);background-color:var(--goa-color-emergency-background)}.goa-container--success.accent--filled .content{border-color:var(--goa-color-success-default);background-color:var(--goa-color-success-background)}.goa-container--info.accent--filled .content{border-color:var(--goa-color-info-default);background-color:var(--goa-color-info-background)}.title,.actions{padding:0.5rem 0}.padding--relaxed header{padding:0 1.5rem}.padding--relaxed .content{padding:1.5rem}.padding--compact header,.padding--compact .content{padding:0 1rem}.padding--compact header{padding:0 1rem}.padding--compact .content{padding:1rem}@media screen and (max-width: 623px){.padding--relaxed header{padding:0 1rem}.padding--relaxed .content{padding:1rem}}.goa-container--non-interactive header{background-color:var(--goa-color-greyscale-100);border-color:var(--goa-color-greyscale-200);color:var(--goa-color-greyscale-black)}.goa-container--interactive header{background-color:var(--goa-color-brand-default);border-color:var(--goa-color-brand-default);color:var(--goa-color-greyscale-white)}.goa-container--info header{background-color:var(--goa-color-info-default);border-color:var(--goa-color-info-default);color:var(--goa-color-greyscale-white)}.goa-container--error header{background-color:var(--goa-color-emergency-default);border-color:var(--goa-color-emergency-default);color:var(--goa-color-greyscale-white)}.goa-container--success header{background-color:var(--goa-color-success-default);border-color:var(--goa-color-success-default);color:var(--goa-color-greyscale-white)}.goa-container--important header{background-color:var(--goa-color-warning-default);border-color:var(--goa-color-warning-default);color:var(--goa-color-greyscale-white)}.heading--thick{padding:0.5rem 1.5rem;max-height:3rem;min-height:1rem}.heading--thick .title{line-height:2rem}.heading--thin{height:0.5rem}.heading--filled{display:none}.heading--filled~.content{border-top:1px solid var(--goa-color-greyscale-200);border-top-left-radius:var(--goa-border-radius-m);border-top-right-radius:var(--goa-border-radius-m)}.heading--thin .title,.heading--thin .actions{display:none}.actions{display:flex;align-items:center}`;this.shadowRoot.appendChild(style);init(this,{target:this.shadowRoot,props:attribute_to_object(this.attributes),customElement:true},instance$J,create_fragment$M,safe_not_equal,{type:0,accent:1,padding:2,testid:3,mt:4,mr:5,mb:6,ml:7},null);if(options){if(options.target){insert(options.target,this,options.anchor);}if(options.props){this.$set(options.props);flush();}}}static get observedAttributes(){return ["type","accent","padding","testid","mt","mr","mb","ml"];}get type(){return this.$$.ctx[0];}set type(type){this.$$set({type});flush();}get accent(){return this.$$.ctx[1];}set accent(accent){this.$$set({accent});flush();}get padding(){return this.$$.ctx[2];}set padding(padding){this.$$set({padding});flush();}get testid(){return this.$$.ctx[3];}set testid(testid){this.$$set({testid});flush();}get mt(){return this.$$.ctx[4];}set mt(mt){this.$$set({mt});flush();}get mr(){return this.$$.ctx[5];}set mr(mr){this.$$set({mr});flush();}get mb(){return this.$$.ctx[6];}set mb(mb){this.$$set({mb});flush();}get ml(){return this.$$.ctx[7];}set ml(ml){this.$$set({ml});flush();}}customElements.define("goa-container",Container);/* src/components/details/Details.svelte generated by Svelte v3.59.2 */function create_fragment$L(ctx){let details;let summary;let goa_icon;let goa_icon_fillcolor_value;let t0;let span;let t1;let t2;let div;let details_style_value;let mounted;let dispose;return {c(){details=element("details");summary=element("summary");goa_icon=element("goa-icon");t0=space();span=element("span");t1=text(/*heading*/ctx[1]);t2=space();div=element("div");div.innerHTML=`<slot></slot>`;this.c=noop;set_custom_element_data(goa_icon,"mt","1");set_custom_element_data(goa_icon,"mr","2");set_custom_element_data(goa_icon,"type","chevron-forward");set_custom_element_data(goa_icon,"fillcolor",goa_icon_fillcolor_value=/*_isMouseOver*/ctx[6]?"var(--goa-color-interactive-hover)":"var(--goa-color-interactive-default)");attr(div,"class","content");details.open=/*_isOpen*/ctx[9];attr(details,"style",details_style_value=calculateMargin(/*mt*/ctx[2],/*mr*/ctx[3],/*mb*/ctx[4],/*ml*/ctx[5]));},m(target,anchor){insert(target,details,anchor);append(details,summary);append(summary,goa_icon);append(summary,t0);append(summary,span);append(span,t1);/*summary_binding*/ctx[10](summary);append(details,t2);append(details,div);/*details_binding*/ctx[11](details);if(!mounted){dispose=listen(details,"toggle",/*toggle_handler*/ctx[12]);mounted=true;}},p(ctx,[dirty]){if(dirty&/*_isMouseOver*/64&&goa_icon_fillcolor_value!==(goa_icon_fillcolor_value=/*_isMouseOver*/ctx[6]?"var(--goa-color-interactive-hover)":"var(--goa-color-interactive-default)")){set_custom_element_data(goa_icon,"fillcolor",goa_icon_fillcolor_value);}if(dirty&/*heading*/2)set_data(t1,/*heading*/ctx[1]);if(dirty&/*_isOpen*/512){details.open=/*_isOpen*/ctx[9];}if(dirty&/*mt, mr, mb, ml*/60&&details_style_value!==(details_style_value=calculateMargin(/*mt*/ctx[2],/*mr*/ctx[3],/*mb*/ctx[4],/*ml*/ctx[5]))){attr(details,"style",details_style_value);}},i:noop,o:noop,d(detaching){if(detaching)detach(details);/*summary_binding*/ctx[10](null);/*details_binding*/ctx[11](null);mounted=false;dispose();}};}function instance$I($$self,$$props,$$invalidate){let _isOpen;let{heading}=$$props;let{mt=null}=$$props;let{mr=null}=$$props;let{mb=null}=$$props;let{ml=null}=$$props;let{open="false"}=$$props;let _isMouseOver=false;let _summaryEl;let _detailsEl;onMount(()=>{validateRequired("Details",{heading});_summaryEl.addEventListener("mouseover",()=>{$$invalidate(6,_isMouseOver=true);});_summaryEl.addEventListener("mouseout",()=>{$$invalidate(6,_isMouseOver=false);});});function summary_binding($$value){binding_callbacks[$$value?'unshift':'push'](()=>{_summaryEl=$$value;$$invalidate(7,_summaryEl);});}function details_binding($$value){binding_callbacks[$$value?'unshift':'push'](()=>{_detailsEl=$$value;$$invalidate(8,_detailsEl);});}const toggle_handler=({target})=>$$invalidate(0,open=`${target.open}`);$$self.$$set=$$props=>{if('heading'in $$props)$$invalidate(1,heading=$$props.heading);if('mt'in $$props)$$invalidate(2,mt=$$props.mt);if('mr'in $$props)$$invalidate(3,mr=$$props.mr);if('mb'in $$props)$$invalidate(4,mb=$$props.mb);if('ml'in $$props)$$invalidate(5,ml=$$props.ml);if('open'in $$props)$$invalidate(0,open=$$props.open);};$$self.$$.update=()=>{if($$self.$$.dirty&/*open*/1){$$invalidate(9,_isOpen=toBoolean(open));}};return [open,heading,mt,mr,mb,ml,_isMouseOver,_summaryEl,_detailsEl,_isOpen,summary_binding,details_binding,toggle_handler];}class Details extends SvelteElement{constructor(options){super();const style=document.createElement('style');style.textContent=`:host{font-family:var(--goa-font-family-sans)}details{max-width:75ch;position:relative}details ::slotted(*){font:var(--goa-typography-body-m)}summary{padding:0.5rem;margin-bottom:0.5rem;cursor:pointer;list-style:none;display:flex;align-items:flex-start}goa-icon{position:absolute}details[open] goa-icon{transform:translateX(-1px) rotate(90deg);top:0.75rem}details summary::-webkit-details-marker{display:none}summary{border-radius:var(--goa-border-radius-m)}summary:focus,summary:active{outline:3px solid var(--goa-color-interactive-focus);border-radius:var(--goa-border-radius-m);color:var(--goa-color-interactive-hover);background-color:var(--goa-color-greyscale-100)}summary:hover{background-color:var(--goa-color-greyscale-100)}summary span{margin-left:2rem;text-decoration:underline;color:var(--goa-color-interactive-default);padding-bottom:var(--font-valign-fix);line-height:var(--goa-line-height-3)}summary:hover span{color:var(--goa-color-interactive-hover)}.content{border-left:4px solid var(--goa-color-greyscale-200);padding:1rem;margin-left:1.1rem;margin-bottom:var(--goa-space-s)}.content ::slotted(p:last-child){margin-bottom:0 !important}`;this.shadowRoot.appendChild(style);init(this,{target:this.shadowRoot,props:attribute_to_object(this.attributes),customElement:true},instance$I,create_fragment$L,safe_not_equal,{heading:1,mt:2,mr:3,mb:4,ml:5,open: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","mt","mr","mb","ml","open"];}get heading(){return this.$$.ctx[1];}set heading(heading){this.$$set({heading});flush();}get mt(){return this.$$.ctx[2];}set mt(mt){this.$$set({mt});flush();}get mr(){return this.$$.ctx[3];}set mr(mr){this.$$set({mr});flush();}get mb(){return this.$$.ctx[4];}set mb(mb){this.$$set({mb});flush();}get ml(){return this.$$.ctx[5];}set ml(ml){this.$$set({ml});flush();}get open(){return this.$$.ctx[0];}set open(open){this.$$set({open});flush();}}customElements.define("goa-details",Details);/* src/components/divider/Divider.svelte generated by Svelte v3.59.2 */function create_fragment$K(ctx){let hr;let hr_style_value;return {c(){hr=element("hr");this.c=noop;attr(hr,"data-testid",/*testid*/ctx[0]);attr(hr,"style",hr_style_value=calculateMargin(/*mt*/ctx[1],/*mr*/ctx[2],/*mb*/ctx[3],/*ml*/ctx[4]));},m(target,anchor){insert(target,hr,anchor);},p(ctx,[dirty]){if(dirty&/*testid*/1){attr(hr,"data-testid",/*testid*/ctx[0]);}if(dirty&/*mt, mr, mb, ml*/30&&hr_style_value!==(hr_style_value=calculateMargin(/*mt*/ctx[1],/*mr*/ctx[2],/*mb*/ctx[3],/*ml*/ctx[4]))){attr(hr,"style",hr_style_value);}},i:noop,o:noop,d(detaching){if(detaching)detach(hr);}};}function instance$H($$self,$$props,$$invalidate){let{testid=""}=$$props;let{mt=null}=$$props;let{mr=null}=$$props;let{mb=null}=$$props;let{ml=null}=$$props;$$self.$$set=$$props=>{if('testid'in $$props)$$invalidate(0,testid=$$props.testid);if('mt'in $$props)$$invalidate(1,mt=$$props.mt);if('mr'in $$props)$$invalidate(2,mr=$$props.mr);if('mb'in $$props)$$invalidate(3,mb=$$props.mb);if('ml'in $$props)$$invalidate(4,ml=$$props.ml);};return [testid,mt,mr,mb,ml];}class Divider extends SvelteElement{constructor(options){super();const style=document.createElement('style');style.textContent=`hr{padding:0;margin:0;height:1px;background-color:var(--goa-color-greyscale-200);border:none}`;this.shadowRoot.appendChild(style);init(this,{target:this.shadowRoot,props:attribute_to_object(this.attributes),customElement:true},instance$H,create_fragment$K,safe_not_equal,{testid:0,mt:1,mr:2,mb:3,ml:4},null);if(options){if(options.target){insert(options.target,this,options.anchor);}if(options.props){this.$set(options.props);flush();}}}static get observedAttributes(){return ["testid","mt","mr","mb","ml"];}get testid(){return this.$$.ctx[0];}set testid(testid){this.$$set({testid});flush();}get mt(){return this.$$.ctx[1];}set mt(mt){this.$$set({mt});flush();}get mr(){return this.$$.ctx[2];}set mr(mr){this.$$set({mr});flush();}get mb(){return this.$$.ctx[3];}set mb(mb){this.$$set({mb});flush();}get ml(){return this.$$.ctx[4];}set ml(ml){this.$$set({ml});flush();}}customElements.define("goa-divider",Divider);/* src/components/dropdown/Dropdown.svelte generated by Svelte v3.59.2 */function get_each_context_1$1(ctx,list,i){const child_ctx=ctx.slice();child_ctx[61]=list[i];child_ctx[65]=i;return child_ctx;}function get_each_context$8(ctx,list,i){const child_ctx=ctx.slice();child_ctx[61]=list[i];return child_ctx;}// (444:2) {:else}
|
|
171
|
-
function create_else_block$a(ctx){let slot;let t0;let goa_popover;let div;let t1;let input;let input_style_value;let input_aria_controls_value;let input_aria_label_value;let input_aria_owns_value;let input_readonly_value;let t2;let
|
|
172
|
-
cursor: ${!/*_disabled*/ctx[
|
|
173
|
-
`);attr(input,"data-testid","input");attr(input,"type","text");attr(input,"role","combobox");attr(input,"autocomplete","off");attr(input,"aria-autocomplete","list");attr(input,"aria-controls",input_aria_controls_value=`menu-${/*name*/ctx[0]}`);attr(input,"aria-expanded",/*_isMenuVisible*/ctx[
|
|
174
|
-
width: ${/*_width*/ctx[19]};
|
|
170
|
+
`)){attr(div3,"class",div3_class_value);}},i:noop,o:noop,d(detaching){if(detaching)detach(div3);}};}function instance$J($$self,$$props,$$invalidate){const[Types,validateType]=typeValidator("Container type",["interactive","info","error","success","important","non-interactive"]);const[Accents,validateAccent]=typeValidator("Container accent",["thick","thin","filled"]);const[Paddings,validatePadding]=typeValidator("Container padding",["relaxed","compact"]);let{type="interactive"}=$$props;let{accent="filled"}=$$props;let{padding="relaxed"}=$$props;let{testid=""}=$$props;let{mt=null}=$$props;let{mr=null}=$$props;let{mb="m"}=$$props;let{ml=null}=$$props;onMount(()=>{validateType(type);validateAccent(accent);validatePadding(padding);});$$self.$$set=$$props=>{if('type'in $$props)$$invalidate(0,type=$$props.type);if('accent'in $$props)$$invalidate(1,accent=$$props.accent);if('padding'in $$props)$$invalidate(2,padding=$$props.padding);if('testid'in $$props)$$invalidate(3,testid=$$props.testid);if('mt'in $$props)$$invalidate(4,mt=$$props.mt);if('mr'in $$props)$$invalidate(5,mr=$$props.mr);if('mb'in $$props)$$invalidate(6,mb=$$props.mb);if('ml'in $$props)$$invalidate(7,ml=$$props.ml);};return [type,accent,padding,testid,mt,mr,mb,ml];}class Container extends SvelteElement{constructor(options){super();const style=document.createElement('style');style.textContent=`:host{box-sizing:border-box;font-family:var(--goa-font-family-sans);font-size:var(--goa-font-size-4);display:flex;flex:1 1 auto}.goa-container{box-sizing:border-box;display:flex;flex:1 1 auto;flex-direction:column}.goa-container *{box-sizing:border-box}header{display:flex;align-items:center;justify-content:space-between;font-weight:700;font-size:var(--goa-font-size-4);border-width:1px;border-style:solid;border-top-left-radius:var(--goa-border-radius-m);border-top-right-radius:var(--goa-border-radius-m)}.content{border-bottom:1px solid var(--goa-color-greyscale-200);border-left:1px solid var(--goa-color-greyscale-200);border-right:1px solid var(--goa-color-greyscale-200);border-bottom-left-radius:var(--goa-border-radius-m);border-bottom-right-radius:var(--goa-border-radius-m);display:flex;flex:1 1 auto;flex-direction:column}.content ::slotted(p:last-child){margin-bottom:0 !important}.goa-container--non-interactive.accent--filled .content{border-color:var(--goa-color-greyscale-200);background-color:var(--goa-color-greyscale-100)}.goa-container--important.accent--filled .content{border-color:var(--goa-color-warning-default);background-color:var(--goa-color-warning-background)}.goa-container--error.accent--filled .content{border-color:var(--goa-color-emergency-default);background-color:var(--goa-color-emergency-background)}.goa-container--success.accent--filled .content{border-color:var(--goa-color-success-default);background-color:var(--goa-color-success-background)}.goa-container--info.accent--filled .content{border-color:var(--goa-color-info-default);background-color:var(--goa-color-info-background)}.title,.actions{padding:0.5rem 0}.padding--relaxed header{padding:0 1.5rem}.padding--relaxed .content{padding:1.5rem}.padding--compact header,.padding--compact .content{padding:0 1rem}.padding--compact header{padding:0 1rem}.padding--compact .content{padding:1rem}@media screen and (max-width: 623px){.padding--relaxed header{padding:0 1rem}.padding--relaxed .content{padding:1rem}}.goa-container--non-interactive header{background-color:var(--goa-color-greyscale-100);border-color:var(--goa-color-greyscale-200);color:var(--goa-color-greyscale-black)}.goa-container--interactive header{background-color:var(--goa-color-brand-default);border-color:var(--goa-color-brand-default);color:var(--goa-color-greyscale-white)}.goa-container--info header{background-color:var(--goa-color-info-default);border-color:var(--goa-color-info-default);color:var(--goa-color-greyscale-white)}.goa-container--error header{background-color:var(--goa-color-emergency-default);border-color:var(--goa-color-emergency-default);color:var(--goa-color-greyscale-white)}.goa-container--success header{background-color:var(--goa-color-success-default);border-color:var(--goa-color-success-default);color:var(--goa-color-greyscale-white)}.goa-container--important header{background-color:var(--goa-color-warning-default);border-color:var(--goa-color-warning-default);color:var(--goa-color-greyscale-white)}.heading--thick{padding:0.5rem 1.5rem;max-height:3rem;min-height:1rem}.heading--thick .title{line-height:2rem}.heading--thin{height:0.5rem}.heading--filled{display:none}.heading--filled~.content{border-top:1px solid var(--goa-color-greyscale-200);border-top-left-radius:var(--goa-border-radius-m);border-top-right-radius:var(--goa-border-radius-m)}.heading--thin .title,.heading--thin .actions{display:none}.actions{display:flex;align-items:center}`;this.shadowRoot.appendChild(style);init(this,{target:this.shadowRoot,props:attribute_to_object(this.attributes),customElement:true},instance$J,create_fragment$M,safe_not_equal,{type:0,accent:1,padding:2,testid:3,mt:4,mr:5,mb:6,ml:7},null);if(options){if(options.target){insert(options.target,this,options.anchor);}if(options.props){this.$set(options.props);flush();}}}static get observedAttributes(){return ["type","accent","padding","testid","mt","mr","mb","ml"];}get type(){return this.$$.ctx[0];}set type(type){this.$$set({type});flush();}get accent(){return this.$$.ctx[1];}set accent(accent){this.$$set({accent});flush();}get padding(){return this.$$.ctx[2];}set padding(padding){this.$$set({padding});flush();}get testid(){return this.$$.ctx[3];}set testid(testid){this.$$set({testid});flush();}get mt(){return this.$$.ctx[4];}set mt(mt){this.$$set({mt});flush();}get mr(){return this.$$.ctx[5];}set mr(mr){this.$$set({mr});flush();}get mb(){return this.$$.ctx[6];}set mb(mb){this.$$set({mb});flush();}get ml(){return this.$$.ctx[7];}set ml(ml){this.$$set({ml});flush();}}customElements.define("goa-container",Container);/* src/components/details/Details.svelte generated by Svelte v3.59.2 */function create_fragment$L(ctx){let details;let summary;let goa_icon;let goa_icon_fillcolor_value;let t0;let span;let t1;let t2;let div;let details_style_value;let mounted;let dispose;return {c(){details=element("details");summary=element("summary");goa_icon=element("goa-icon");t0=space();span=element("span");t1=text(/*heading*/ctx[1]);t2=space();div=element("div");div.innerHTML=`<slot></slot>`;this.c=noop;set_custom_element_data(goa_icon,"mt","1");set_custom_element_data(goa_icon,"mr","2");set_custom_element_data(goa_icon,"type","chevron-forward");set_custom_element_data(goa_icon,"fillcolor",goa_icon_fillcolor_value=/*_isMouseOver*/ctx[6]?"var(--goa-color-interactive-hover)":"var(--goa-color-interactive-default)");attr(div,"class","content");details.open=/*_isOpen*/ctx[9];attr(details,"style",details_style_value=calculateMargin(/*mt*/ctx[2],/*mr*/ctx[3],/*mb*/ctx[4],/*ml*/ctx[5]));},m(target,anchor){insert(target,details,anchor);append(details,summary);append(summary,goa_icon);append(summary,t0);append(summary,span);append(span,t1);/*summary_binding*/ctx[10](summary);append(details,t2);append(details,div);/*details_binding*/ctx[11](details);if(!mounted){dispose=listen(details,"toggle",/*toggle_handler*/ctx[12]);mounted=true;}},p(ctx,[dirty]){if(dirty&/*_isMouseOver*/64&&goa_icon_fillcolor_value!==(goa_icon_fillcolor_value=/*_isMouseOver*/ctx[6]?"var(--goa-color-interactive-hover)":"var(--goa-color-interactive-default)")){set_custom_element_data(goa_icon,"fillcolor",goa_icon_fillcolor_value);}if(dirty&/*heading*/2)set_data(t1,/*heading*/ctx[1]);if(dirty&/*_isOpen*/512){details.open=/*_isOpen*/ctx[9];}if(dirty&/*mt, mr, mb, ml*/60&&details_style_value!==(details_style_value=calculateMargin(/*mt*/ctx[2],/*mr*/ctx[3],/*mb*/ctx[4],/*ml*/ctx[5]))){attr(details,"style",details_style_value);}},i:noop,o:noop,d(detaching){if(detaching)detach(details);/*summary_binding*/ctx[10](null);/*details_binding*/ctx[11](null);mounted=false;dispose();}};}function instance$I($$self,$$props,$$invalidate){let _isOpen;let{heading}=$$props;let{mt=null}=$$props;let{mr=null}=$$props;let{mb=null}=$$props;let{ml=null}=$$props;let{open="false"}=$$props;let _isMouseOver=false;let _summaryEl;let _detailsEl;onMount(()=>{validateRequired("Details",{heading});_summaryEl.addEventListener("mouseover",()=>{$$invalidate(6,_isMouseOver=true);});_summaryEl.addEventListener("mouseout",()=>{$$invalidate(6,_isMouseOver=false);});});function summary_binding($$value){binding_callbacks[$$value?'unshift':'push'](()=>{_summaryEl=$$value;$$invalidate(7,_summaryEl);});}function details_binding($$value){binding_callbacks[$$value?'unshift':'push'](()=>{_detailsEl=$$value;$$invalidate(8,_detailsEl);});}const toggle_handler=({target})=>$$invalidate(0,open=`${target.open}`);$$self.$$set=$$props=>{if('heading'in $$props)$$invalidate(1,heading=$$props.heading);if('mt'in $$props)$$invalidate(2,mt=$$props.mt);if('mr'in $$props)$$invalidate(3,mr=$$props.mr);if('mb'in $$props)$$invalidate(4,mb=$$props.mb);if('ml'in $$props)$$invalidate(5,ml=$$props.ml);if('open'in $$props)$$invalidate(0,open=$$props.open);};$$self.$$.update=()=>{if($$self.$$.dirty&/*open*/1){$$invalidate(9,_isOpen=toBoolean(open));}};return [open,heading,mt,mr,mb,ml,_isMouseOver,_summaryEl,_detailsEl,_isOpen,summary_binding,details_binding,toggle_handler];}class Details extends SvelteElement{constructor(options){super();const style=document.createElement('style');style.textContent=`:host{font-family:var(--goa-font-family-sans)}details{max-width:75ch;position:relative}details ::slotted(*){font:var(--goa-typography-body-m)}summary{padding:0.5rem;margin-bottom:0.5rem;cursor:pointer;list-style:none;display:flex;align-items:flex-start}goa-icon{position:absolute}details[open] goa-icon{transform:translateX(-1px) rotate(90deg);top:0.75rem}details summary::-webkit-details-marker{display:none}summary{border-radius:var(--goa-border-radius-m)}summary:focus,summary:active{outline:3px solid var(--goa-color-interactive-focus);border-radius:var(--goa-border-radius-m);color:var(--goa-color-interactive-hover);background-color:var(--goa-color-greyscale-100)}summary:hover{background-color:var(--goa-color-greyscale-100)}summary span{margin-left:2rem;text-decoration:underline;color:var(--goa-color-interactive-default);padding-bottom:var(--font-valign-fix);line-height:var(--goa-line-height-3)}summary:hover span{color:var(--goa-color-interactive-hover)}.content{border-left:4px solid var(--goa-color-greyscale-200);padding:1rem;margin-left:1.1rem;margin-bottom:var(--goa-space-s)}.content ::slotted(p:last-child){margin-bottom:0 !important}`;this.shadowRoot.appendChild(style);init(this,{target:this.shadowRoot,props:attribute_to_object(this.attributes),customElement:true},instance$I,create_fragment$L,safe_not_equal,{heading:1,mt:2,mr:3,mb:4,ml:5,open: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","mt","mr","mb","ml","open"];}get heading(){return this.$$.ctx[1];}set heading(heading){this.$$set({heading});flush();}get mt(){return this.$$.ctx[2];}set mt(mt){this.$$set({mt});flush();}get mr(){return this.$$.ctx[3];}set mr(mr){this.$$set({mr});flush();}get mb(){return this.$$.ctx[4];}set mb(mb){this.$$set({mb});flush();}get ml(){return this.$$.ctx[5];}set ml(ml){this.$$set({ml});flush();}get open(){return this.$$.ctx[0];}set open(open){this.$$set({open});flush();}}customElements.define("goa-details",Details);/* src/components/divider/Divider.svelte generated by Svelte v3.59.2 */function create_fragment$K(ctx){let hr;let hr_style_value;return {c(){hr=element("hr");this.c=noop;attr(hr,"data-testid",/*testid*/ctx[0]);attr(hr,"style",hr_style_value=calculateMargin(/*mt*/ctx[1],/*mr*/ctx[2],/*mb*/ctx[3],/*ml*/ctx[4]));},m(target,anchor){insert(target,hr,anchor);},p(ctx,[dirty]){if(dirty&/*testid*/1){attr(hr,"data-testid",/*testid*/ctx[0]);}if(dirty&/*mt, mr, mb, ml*/30&&hr_style_value!==(hr_style_value=calculateMargin(/*mt*/ctx[1],/*mr*/ctx[2],/*mb*/ctx[3],/*ml*/ctx[4]))){attr(hr,"style",hr_style_value);}},i:noop,o:noop,d(detaching){if(detaching)detach(hr);}};}function instance$H($$self,$$props,$$invalidate){let{testid=""}=$$props;let{mt=null}=$$props;let{mr=null}=$$props;let{mb=null}=$$props;let{ml=null}=$$props;$$self.$$set=$$props=>{if('testid'in $$props)$$invalidate(0,testid=$$props.testid);if('mt'in $$props)$$invalidate(1,mt=$$props.mt);if('mr'in $$props)$$invalidate(2,mr=$$props.mr);if('mb'in $$props)$$invalidate(3,mb=$$props.mb);if('ml'in $$props)$$invalidate(4,ml=$$props.ml);};return [testid,mt,mr,mb,ml];}class Divider extends SvelteElement{constructor(options){super();const style=document.createElement('style');style.textContent=`hr{padding:0;margin:0;height:1px;background-color:var(--goa-color-greyscale-200);border:none}`;this.shadowRoot.appendChild(style);init(this,{target:this.shadowRoot,props:attribute_to_object(this.attributes),customElement:true},instance$H,create_fragment$K,safe_not_equal,{testid:0,mt:1,mr:2,mb:3,ml:4},null);if(options){if(options.target){insert(options.target,this,options.anchor);}if(options.props){this.$set(options.props);flush();}}}static get observedAttributes(){return ["testid","mt","mr","mb","ml"];}get testid(){return this.$$.ctx[0];}set testid(testid){this.$$set({testid});flush();}get mt(){return this.$$.ctx[1];}set mt(mt){this.$$set({mt});flush();}get mr(){return this.$$.ctx[2];}set mr(mr){this.$$set({mr});flush();}get mb(){return this.$$.ctx[3];}set mb(mb){this.$$set({mb});flush();}get ml(){return this.$$.ctx[4];}set ml(ml){this.$$set({ml});flush();}}customElements.define("goa-divider",Divider);/* src/components/dropdown/Dropdown.svelte generated by Svelte v3.59.2 */function get_each_context_1$1(ctx,list,i){const child_ctx=ctx.slice();child_ctx[61]=list[i];child_ctx[65]=i;return child_ctx;}function get_each_context$8(ctx,list,i){const child_ctx=ctx.slice();child_ctx[61]=list[i];return child_ctx;}// (459:2) {:else}
|
|
171
|
+
function create_else_block$a(ctx){let slot;let t0;let goa_popover;let div;let t1;let input;let input_style_value;let input_aria_controls_value;let input_aria_label_value;let input_aria_owns_value;let input_readonly_value;let t2;let t3;let ul;let each_blocks=[];let each_1_lookup=new Map();let ul_id_value;let ul_aria_label_value;let ul_style_value;let mounted;let dispose;let if_block0=/*leadingicon*/ctx[4]&&create_if_block_2$b(ctx);function select_block_type_1(ctx,dirty){var _ctx$;if(/*_inputEl*/(_ctx$=ctx[22])!==null&&_ctx$!==void 0&&_ctx$.value&&/*_filterable*/ctx[23])return create_if_block_1$d;return create_else_block_2;}let current_block_type=select_block_type_1(ctx);let if_block1=current_block_type(ctx);let each_value_1=/*_filteredOptions*/ctx[14];const get_key=ctx=>/*index*/ctx[65];for(let i=0;i<each_value_1.length;i+=1){let child_ctx=get_each_context_1$1(ctx,each_value_1,i);let key=get_key(child_ctx);each_1_lookup.set(key,each_blocks[i]=create_each_block_1$1(key,child_ctx));}let each_1_else=null;if(!each_value_1.length){each_1_else=create_else_block_1();}return {c(){slot=element("slot");t0=space();goa_popover=element("goa-popover");div=element("div");if(if_block0)if_block0.c();t1=space();input=element("input");t2=space();if_block1.c();t3=space();ul=element("ul");for(let i=0;i<each_blocks.length;i+=1){each_blocks[i].c();}if(each_1_else){each_1_else.c();}attr(input,"style",input_style_value=`
|
|
172
|
+
cursor: ${!/*_disabled*/ctx[25]?/*_filterable*/ctx[23]?"auto":"pointer":"default"};
|
|
173
|
+
`);attr(input,"data-testid","input");attr(input,"type","text");attr(input,"role","combobox");attr(input,"autocomplete","off");attr(input,"aria-autocomplete","list");attr(input,"aria-controls",input_aria_controls_value=`menu-${/*name*/ctx[0]}`);attr(input,"aria-expanded",/*_isMenuVisible*/ctx[17]);attr(input,"aria-label",input_aria_label_value=/*arialabel*/ctx[1]||/*name*/ctx[0]);attr(input,"aria-labelledby",/*arialabelledby*/ctx[2]);attr(input,"id",/*name*/ctx[0]);attr(input,"aria-activedescendant",/*_activeDescendantId*/ctx[24]);attr(input,"aria-disabled",/*_disabled*/ctx[25]);attr(input,"aria-owns",input_aria_owns_value=/*_isMenuVisible*/ctx[17]?`menu-${/*name*/ctx[0]}`:undefined);attr(input,"aria-haspopup","listbox");input.disabled=/*_disabled*/ctx[25];input.readOnly=input_readonly_value=!/*_filterable*/ctx[23];attr(input,"placeholder",/*placeholder*/ctx[6]);attr(input,"name",/*name*/ctx[0]);attr(div,"slot","target");attr(div,"class","dropdown-input-group");toggle_class(div,"dropdown-input-group--disabled",/*_disabled*/ctx[25]);toggle_class(div,"error",/*_error*/ctx[26]);attr(ul,"id",ul_id_value=`menu-${/*name*/ctx[0]}`);attr(ul,"role","listbox");attr(ul,"tabindex","-1");attr(ul,"data-testid","dropdown-menu");attr(ul,"aria-label",ul_aria_label_value=/*arialabel*/ctx[1]||/*name*/ctx[0]);attr(ul,"aria-labelledby",/*arialabelledby*/ctx[2]);attr(ul,"style",ul_style_value=`
|
|
175
174
|
outline: none;
|
|
176
175
|
overflow-y: auto;
|
|
177
176
|
max-height: ${/*maxheight*/ctx[5]};
|
|
178
|
-
`);set_custom_element_data(goa_popover,"disabled",/*disabled*/ctx[
|
|
179
|
-
cursor: ${!/*_disabled*/ctx[
|
|
180
|
-
`)){attr(input,"style",input_style_value);}if(dirty[0]&/*name*/1&&input_aria_controls_value!==(input_aria_controls_value=`menu-${/*name*/ctx[0]}`)){attr(input,"aria-controls",input_aria_controls_value);}if(dirty[0]&/*_isMenuVisible*/
|
|
181
|
-
width: ${/*_width*/ctx[19]};
|
|
177
|
+
`);set_custom_element_data(goa_popover,"disabled",/*disabled*/ctx[7]);set_custom_element_data(goa_popover,"relative",/*relative*/ctx[8]);set_custom_element_data(goa_popover,"data-testid","option-list");set_custom_element_data(goa_popover,"maxwidth","99999px");set_custom_element_data(goa_popover,"open",/*_isMenuVisible*/ctx[17]);set_custom_element_data(goa_popover,"padded","false");set_custom_element_data(goa_popover,"tabindex","-1");set_custom_element_data(goa_popover,"width",/*_width*/ctx[18]);},m(target,anchor){insert(target,slot,anchor);insert(target,t0,anchor);insert(target,goa_popover,anchor);append(goa_popover,div);if(if_block0)if_block0.m(div,null);append(div,t1);append(div,input);/*input_binding*/ctx[42](input);append(div,t2);if_block1.m(div,null);append(goa_popover,t3);append(goa_popover,ul);for(let i=0;i<each_blocks.length;i+=1){if(each_blocks[i]){each_blocks[i].m(ul,null);}}if(each_1_else){each_1_else.m(ul,null);}/*ul_binding*/ctx[44](ul);if(!mounted){dispose=[listen(input,"keydown",/*onInputKeyDown*/ctx[31]),listen(input,"keyup",/*onInputKeyUp*/ctx[30]),listen(goa_popover,"_open",/*showMenu*/ctx[27]),listen(goa_popover,"_close",/*hideMenu*/ctx[28])];mounted=true;}},p(ctx,dirty){if(/*leadingicon*/ctx[4]){if(if_block0){if_block0.p(ctx,dirty);}else {if_block0=create_if_block_2$b(ctx);if_block0.c();if_block0.m(div,t1);}}else if(if_block0){if_block0.d(1);if_block0=null;}if(dirty[0]&/*_disabled, _filterable*/41943040&&input_style_value!==(input_style_value=`
|
|
178
|
+
cursor: ${!/*_disabled*/ctx[25]?/*_filterable*/ctx[23]?"auto":"pointer":"default"};
|
|
179
|
+
`)){attr(input,"style",input_style_value);}if(dirty[0]&/*name*/1&&input_aria_controls_value!==(input_aria_controls_value=`menu-${/*name*/ctx[0]}`)){attr(input,"aria-controls",input_aria_controls_value);}if(dirty[0]&/*_isMenuVisible*/131072){attr(input,"aria-expanded",/*_isMenuVisible*/ctx[17]);}if(dirty[0]&/*arialabel, name*/3&&input_aria_label_value!==(input_aria_label_value=/*arialabel*/ctx[1]||/*name*/ctx[0])){attr(input,"aria-label",input_aria_label_value);}if(dirty[0]&/*arialabelledby*/4){attr(input,"aria-labelledby",/*arialabelledby*/ctx[2]);}if(dirty[0]&/*name*/1){attr(input,"id",/*name*/ctx[0]);}if(dirty[0]&/*_activeDescendantId*/16777216){attr(input,"aria-activedescendant",/*_activeDescendantId*/ctx[24]);}if(dirty[0]&/*_disabled*/33554432){attr(input,"aria-disabled",/*_disabled*/ctx[25]);}if(dirty[0]&/*_isMenuVisible, name*/131073&&input_aria_owns_value!==(input_aria_owns_value=/*_isMenuVisible*/ctx[17]?`menu-${/*name*/ctx[0]}`:undefined)){attr(input,"aria-owns",input_aria_owns_value);}if(dirty[0]&/*_disabled*/33554432){input.disabled=/*_disabled*/ctx[25];}if(dirty[0]&/*_filterable*/8388608&&input_readonly_value!==(input_readonly_value=!/*_filterable*/ctx[23])){input.readOnly=input_readonly_value;}if(dirty[0]&/*placeholder*/64){attr(input,"placeholder",/*placeholder*/ctx[6]);}if(dirty[0]&/*name*/1){attr(input,"name",/*name*/ctx[0]);}if(current_block_type===(current_block_type=select_block_type_1(ctx))&&if_block1){if_block1.p(ctx,dirty);}else {if_block1.d(1);if_block1=current_block_type(ctx);if(if_block1){if_block1.c();if_block1.m(div,null);}}if(dirty[0]&/*_disabled*/33554432){toggle_class(div,"dropdown-input-group--disabled",/*_disabled*/ctx[25]);}if(dirty[0]&/*_error*/67108864){toggle_class(div,"error",/*_error*/ctx[26]);}if(dirty[0]&/*_filteredOptions, _inputEl, _highlightedIndex, onSelect*/541089792){each_value_1=/*_filteredOptions*/ctx[14];each_blocks=update_keyed_each(each_blocks,dirty,get_key,1,ctx,each_value_1,each_1_lookup,ul,destroy_block,create_each_block_1$1,null,get_each_context_1$1);if(!each_value_1.length&&each_1_else){each_1_else.p(ctx,dirty);}else if(!each_value_1.length){each_1_else=create_else_block_1();each_1_else.c();each_1_else.m(ul,null);}else if(each_1_else){each_1_else.d(1);each_1_else=null;}}if(dirty[0]&/*name*/1&&ul_id_value!==(ul_id_value=`menu-${/*name*/ctx[0]}`)){attr(ul,"id",ul_id_value);}if(dirty[0]&/*arialabel, name*/3&&ul_aria_label_value!==(ul_aria_label_value=/*arialabel*/ctx[1]||/*name*/ctx[0])){attr(ul,"aria-label",ul_aria_label_value);}if(dirty[0]&/*arialabelledby*/4){attr(ul,"aria-labelledby",/*arialabelledby*/ctx[2]);}if(dirty[0]&/*maxheight*/32&&ul_style_value!==(ul_style_value=`
|
|
182
180
|
outline: none;
|
|
183
181
|
overflow-y: auto;
|
|
184
182
|
max-height: ${/*maxheight*/ctx[5]};
|
|
185
|
-
`)){attr(ul,"style",ul_style_value);}if(dirty[0]&/*disabled*/
|
|
186
|
-
function create_if_block$p(ctx){let select;let slot;let select_aria_label_value;let mounted;let dispose;let each_value=/*_options*/ctx[
|
|
187
|
-
function create_if_block_2$b(ctx){let goa_icon;return {c(){goa_icon=element("goa-icon");set_custom_element_data(goa_icon,"class","dropdown-input--leading-icon");set_custom_element_data(goa_icon,"data-testid","leading-icon");set_custom_element_data(goa_icon,"type",/*leadingicon*/ctx[4]);},m(target,anchor){insert(target,goa_icon,anchor);},p(ctx,dirty){if(dirty[0]&/*leadingicon*/16){set_custom_element_data(goa_icon,"type",/*leadingicon*/ctx[4]);}},d(detaching){if(detaching)detach(goa_icon);}};}// (
|
|
188
|
-
function create_else_block_2(ctx){let goa_icon;let goa_icon_arialabel_value;let goa_icon_ariacontrols_value;let goa_icon_ariaexpanded_value;let goa_icon_type_value;let mounted;let dispose;return {c(){goa_icon=element("goa-icon");set_custom_element_data(goa_icon,"role","button");set_custom_element_data(goa_icon,"tabindex","-1");set_custom_element_data(goa_icon,"id",/*name*/ctx[0]);set_custom_element_data(goa_icon,"arialabel",goa_icon_arialabel_value=/*arialabel*/ctx[1]||/*name*/ctx[0]);set_custom_element_data(goa_icon,"ariacontrols",goa_icon_ariacontrols_value=`menu-${/*name*/ctx[0]}`);set_custom_element_data(goa_icon,"ariaexpanded",goa_icon_ariaexpanded_value=fromBoolean(/*_isMenuVisible*/ctx[
|
|
189
|
-
function create_if_block_1$d(ctx){let goa_icon;let goa_icon_tabindex_value;let goa_icon_arialabel_value;let goa_icon_ariacontrols_value;let goa_icon_ariaexpanded_value;let mounted;let dispose;return {c(){goa_icon=element("goa-icon");set_custom_element_data(goa_icon,"id",/*name*/ctx[0]);set_custom_element_data(goa_icon,"tabindex",goa_icon_tabindex_value=/*_disabled*/ctx[
|
|
190
|
-
function create_else_block_1(ctx){let li;return {c(){li=element("li");li.textContent="No matches found\n ";attr(li,"class","dropdown-item");attr(li,"data-testid","dropdown-item-not-found");},m(target,anchor){insert(target,li,anchor);},p:noop,d(detaching){if(detaching)detach(li);}};}// (
|
|
191
|
-
function create_each_block_1$1(key_1,ctx){let li;let t0_value=(/*option*/ctx[61].label||/*option*/ctx[61].value)+"";let t0;let t1;let li_id_value;let li_aria_selected_value;let li_data_index_value;let li_data_testid_value;let li_data_value_value;let mounted;let dispose;function click_handler(){return(/*click_handler*/ctx[43](/*option*/ctx[61]));}return {key:key_1,first:null,c(){li=element("li");t0=text(t0_value);t1=space();attr(li,"id",li_id_value=/*option*/ctx[61].value);attr(li,"aria-selected",li_aria_selected_value=/*_inputEl*/ctx[
|
|
192
|
-
function create_each_block$8(ctx){let option;let t0_value=/*option*/ctx[61].label+"";let t0;let t1;let option_selected_value;let option_value_value;return {c(){option=element("option");t0=text(t0_value);t1=space();option.selected=option_selected_value=/*value*/ctx[3]===/*option*/ctx[61].value;option.__value=option_value_value=/*option*/ctx[61].value;option.value=option.__value;},m(target,anchor){insert(target,option,anchor);append(option,t0);append(option,t1);},p(ctx,dirty){if(dirty[0]&/*_options*/
|
|
193
|
-
|
|
194
|
-
${
|
|
195
|
-
`);toggle_class(div,"dropdown-native",/*_native*/ctx[
|
|
196
|
-
|
|
197
|
-
${
|
|
198
|
-
`)){attr(div,"style",div_style_value);}if(dirty[0]&/*_native*/
|
|
183
|
+
`)){attr(ul,"style",ul_style_value);}if(dirty[0]&/*disabled*/128){set_custom_element_data(goa_popover,"disabled",/*disabled*/ctx[7]);}if(dirty[0]&/*relative*/256){set_custom_element_data(goa_popover,"relative",/*relative*/ctx[8]);}if(dirty[0]&/*_isMenuVisible*/131072){set_custom_element_data(goa_popover,"open",/*_isMenuVisible*/ctx[17]);}if(dirty[0]&/*_width*/262144){set_custom_element_data(goa_popover,"width",/*_width*/ctx[18]);}},d(detaching){if(detaching)detach(slot);if(detaching)detach(t0);if(detaching)detach(goa_popover);if(if_block0)if_block0.d();/*input_binding*/ctx[42](null);if_block1.d();for(let i=0;i<each_blocks.length;i+=1){each_blocks[i].d();}if(each_1_else)each_1_else.d();/*ul_binding*/ctx[44](null);mounted=false;run_all(dispose);}};}// (439:2) {#if _native}
|
|
184
|
+
function create_if_block$p(ctx){let select;let slot;let select_aria_label_value;let mounted;let dispose;let each_value=/*_options*/ctx[16];let each_blocks=[];for(let i=0;i<each_value.length;i+=1){each_blocks[i]=create_each_block$8(get_each_context$8(ctx,each_value,i));}return {c(){select=element("select");slot=element("slot");for(let i=0;i<each_blocks.length;i+=1){each_blocks[i].c();}attr(select,"name",/*name*/ctx[0]);attr(select,"aria-label",select_aria_label_value=/*arialabel*/ctx[1]||/*name*/ctx[0]);attr(select,"aria-labelledby",/*arialabelledby*/ctx[2]);select.disabled=/*_disabled*/ctx[25];attr(select,"id",/*name*/ctx[0]);toggle_class(select,"error",/*_error*/ctx[26]);},m(target,anchor){insert(target,select,anchor);append(select,slot);for(let i=0;i<each_blocks.length;i+=1){if(each_blocks[i]){each_blocks[i].m(select,null);}}/*select_binding*/ctx[41](select);if(!mounted){dispose=listen(select,"change",/*onNativeSelect*/ctx[34]);mounted=true;}},p(ctx,dirty){if(dirty[0]&/*value, _options*/65544){each_value=/*_options*/ctx[16];let i;for(i=0;i<each_value.length;i+=1){const child_ctx=get_each_context$8(ctx,each_value,i);if(each_blocks[i]){each_blocks[i].p(child_ctx,dirty);}else {each_blocks[i]=create_each_block$8(child_ctx);each_blocks[i].c();each_blocks[i].m(select,null);}}for(;i<each_blocks.length;i+=1){each_blocks[i].d(1);}each_blocks.length=each_value.length;}if(dirty[0]&/*name*/1){attr(select,"name",/*name*/ctx[0]);}if(dirty[0]&/*arialabel, name*/3&&select_aria_label_value!==(select_aria_label_value=/*arialabel*/ctx[1]||/*name*/ctx[0])){attr(select,"aria-label",select_aria_label_value);}if(dirty[0]&/*arialabelledby*/4){attr(select,"aria-labelledby",/*arialabelledby*/ctx[2]);}if(dirty[0]&/*_disabled*/33554432){select.disabled=/*_disabled*/ctx[25];}if(dirty[0]&/*name*/1){attr(select,"id",/*name*/ctx[0]);}if(dirty[0]&/*_error*/67108864){toggle_class(select,"error",/*_error*/ctx[26]);}},d(detaching){if(detaching)detach(select);destroy_each(each_blocks,detaching);/*select_binding*/ctx[41](null);mounted=false;dispose();}};}// (481:8) {#if leadingicon}
|
|
185
|
+
function create_if_block_2$b(ctx){let goa_icon;return {c(){goa_icon=element("goa-icon");set_custom_element_data(goa_icon,"class","dropdown-input--leading-icon");set_custom_element_data(goa_icon,"data-testid","leading-icon");set_custom_element_data(goa_icon,"type",/*leadingicon*/ctx[4]);},m(target,anchor){insert(target,goa_icon,anchor);},p(ctx,dirty){if(dirty[0]&/*leadingicon*/16){set_custom_element_data(goa_icon,"type",/*leadingicon*/ctx[4]);}},d(detaching){if(detaching)detach(goa_icon);}};}// (531:8) {:else}
|
|
186
|
+
function create_else_block_2(ctx){let goa_icon;let goa_icon_arialabel_value;let goa_icon_ariacontrols_value;let goa_icon_ariaexpanded_value;let goa_icon_type_value;let mounted;let dispose;return {c(){goa_icon=element("goa-icon");set_custom_element_data(goa_icon,"role","button");set_custom_element_data(goa_icon,"tabindex","-1");set_custom_element_data(goa_icon,"id",/*name*/ctx[0]);set_custom_element_data(goa_icon,"arialabel",goa_icon_arialabel_value=/*arialabel*/ctx[1]||/*name*/ctx[0]);set_custom_element_data(goa_icon,"ariacontrols",goa_icon_ariacontrols_value=`menu-${/*name*/ctx[0]}`);set_custom_element_data(goa_icon,"ariaexpanded",goa_icon_ariaexpanded_value=fromBoolean(/*_isMenuVisible*/ctx[17]));set_custom_element_data(goa_icon,"class","dropdown-icon--arrow");set_custom_element_data(goa_icon,"size","medium");set_custom_element_data(goa_icon,"type",goa_icon_type_value=/*_isMenuVisible*/ctx[17]?"chevron-up":"chevron-down");},m(target,anchor){insert(target,goa_icon,anchor);if(!mounted){dispose=listen(goa_icon,"click",/*onChevronClick*/ctx[35]);mounted=true;}},p(ctx,dirty){if(dirty[0]&/*name*/1){set_custom_element_data(goa_icon,"id",/*name*/ctx[0]);}if(dirty[0]&/*arialabel, name*/3&&goa_icon_arialabel_value!==(goa_icon_arialabel_value=/*arialabel*/ctx[1]||/*name*/ctx[0])){set_custom_element_data(goa_icon,"arialabel",goa_icon_arialabel_value);}if(dirty[0]&/*name*/1&&goa_icon_ariacontrols_value!==(goa_icon_ariacontrols_value=`menu-${/*name*/ctx[0]}`)){set_custom_element_data(goa_icon,"ariacontrols",goa_icon_ariacontrols_value);}if(dirty[0]&/*_isMenuVisible*/131072&&goa_icon_ariaexpanded_value!==(goa_icon_ariaexpanded_value=fromBoolean(/*_isMenuVisible*/ctx[17]))){set_custom_element_data(goa_icon,"ariaexpanded",goa_icon_ariaexpanded_value);}if(dirty[0]&/*_isMenuVisible*/131072&&goa_icon_type_value!==(goa_icon_type_value=/*_isMenuVisible*/ctx[17]?"chevron-up":"chevron-down")){set_custom_element_data(goa_icon,"type",goa_icon_type_value);}},d(detaching){if(detaching)detach(goa_icon);mounted=false;dispose();}};}// (516:8) {#if _inputEl?.value && _filterable}
|
|
187
|
+
function create_if_block_1$d(ctx){let goa_icon;let goa_icon_tabindex_value;let goa_icon_arialabel_value;let goa_icon_ariacontrols_value;let goa_icon_ariaexpanded_value;let mounted;let dispose;return {c(){goa_icon=element("goa-icon");set_custom_element_data(goa_icon,"id",/*name*/ctx[0]);set_custom_element_data(goa_icon,"tabindex",goa_icon_tabindex_value=/*_disabled*/ctx[25]?-1:0);set_custom_element_data(goa_icon,"role","button");set_custom_element_data(goa_icon,"arialabel",goa_icon_arialabel_value=`clear ${/*arialabel*/ctx[1]||/*name*/ctx[0]}`);set_custom_element_data(goa_icon,"ariacontrols",goa_icon_ariacontrols_value=`menu-${/*name*/ctx[0]}`);set_custom_element_data(goa_icon,"ariaexpanded",goa_icon_ariaexpanded_value=fromBoolean(/*_isMenuVisible*/ctx[17]));set_custom_element_data(goa_icon,"class","dropdown-icon--clear");set_custom_element_data(goa_icon,"size","medium");set_custom_element_data(goa_icon,"type","close");toggle_class(goa_icon,"disabled",/*_disabled*/ctx[25]);},m(target,anchor){insert(target,goa_icon,anchor);if(!mounted){dispose=[listen(goa_icon,"click",stop_propagation(/*onClearIconClick*/ctx[33])),listen(goa_icon,"keydown",/*onClearIconKeyDown*/ctx[32])];mounted=true;}},p(ctx,dirty){if(dirty[0]&/*name*/1){set_custom_element_data(goa_icon,"id",/*name*/ctx[0]);}if(dirty[0]&/*_disabled*/33554432&&goa_icon_tabindex_value!==(goa_icon_tabindex_value=/*_disabled*/ctx[25]?-1:0)){set_custom_element_data(goa_icon,"tabindex",goa_icon_tabindex_value);}if(dirty[0]&/*arialabel, name*/3&&goa_icon_arialabel_value!==(goa_icon_arialabel_value=`clear ${/*arialabel*/ctx[1]||/*name*/ctx[0]}`)){set_custom_element_data(goa_icon,"arialabel",goa_icon_arialabel_value);}if(dirty[0]&/*name*/1&&goa_icon_ariacontrols_value!==(goa_icon_ariacontrols_value=`menu-${/*name*/ctx[0]}`)){set_custom_element_data(goa_icon,"ariacontrols",goa_icon_ariacontrols_value);}if(dirty[0]&/*_isMenuVisible*/131072&&goa_icon_ariaexpanded_value!==(goa_icon_ariaexpanded_value=fromBoolean(/*_isMenuVisible*/ctx[17]))){set_custom_element_data(goa_icon,"ariaexpanded",goa_icon_ariaexpanded_value);}if(dirty[0]&/*_disabled*/33554432){toggle_class(goa_icon,"disabled",/*_disabled*/ctx[25]);}},d(detaching){if(detaching)detach(goa_icon);mounted=false;run_all(dispose);}};}// (578:8) {:else}
|
|
188
|
+
function create_else_block_1(ctx){let li;return {c(){li=element("li");li.textContent="No matches found\n ";attr(li,"class","dropdown-item");attr(li,"data-testid","dropdown-item-not-found");},m(target,anchor){insert(target,li,anchor);},p:noop,d(detaching){if(detaching)detach(li);}};}// (562:8) {#each _filteredOptions as option, index (index)}
|
|
189
|
+
function create_each_block_1$1(key_1,ctx){let li;let t0_value=(/*option*/ctx[61].label||/*option*/ctx[61].value)+"";let t0;let t1;let li_id_value;let li_aria_selected_value;let li_data_index_value;let li_data_testid_value;let li_data_value_value;let mounted;let dispose;function click_handler(){return(/*click_handler*/ctx[43](/*option*/ctx[61]));}return {key:key_1,first:null,c(){li=element("li");t0=text(t0_value);t1=space();attr(li,"id",li_id_value=/*option*/ctx[61].value);attr(li,"aria-selected",li_aria_selected_value=/*_inputEl*/ctx[22].value===(/*option*/ctx[61].label||/*option*/ctx[61].value));attr(li,"class","dropdown-item");attr(li,"data-index",li_data_index_value=/*index*/ctx[65]);attr(li,"data-testid",li_data_testid_value=`dropdown-item-${/*option*/ctx[61].value}`);attr(li,"data-value",li_data_value_value=/*option*/ctx[61].value);attr(li,"role","option");set_style(li,"display","block");toggle_class(li,"dropdown-item--highlighted",/*index*/ctx[65]===/*_highlightedIndex*/ctx[13]);toggle_class(li,"selected",/*_inputEl*/ctx[22].value===(/*option*/ctx[61].label||/*option*/ctx[61].value));this.first=li;},m(target,anchor){insert(target,li,anchor);append(li,t0);append(li,t1);if(!mounted){dispose=listen(li,"click",click_handler);mounted=true;}},p(new_ctx,dirty){ctx=new_ctx;if(dirty[0]&/*_filteredOptions*/16384&&t0_value!==(t0_value=(/*option*/ctx[61].label||/*option*/ctx[61].value)+""))set_data(t0,t0_value);if(dirty[0]&/*_filteredOptions*/16384&&li_id_value!==(li_id_value=/*option*/ctx[61].value)){attr(li,"id",li_id_value);}if(dirty[0]&/*_inputEl, _filteredOptions*/4210688&&li_aria_selected_value!==(li_aria_selected_value=/*_inputEl*/ctx[22].value===(/*option*/ctx[61].label||/*option*/ctx[61].value))){attr(li,"aria-selected",li_aria_selected_value);}if(dirty[0]&/*_filteredOptions*/16384&&li_data_index_value!==(li_data_index_value=/*index*/ctx[65])){attr(li,"data-index",li_data_index_value);}if(dirty[0]&/*_filteredOptions*/16384&&li_data_testid_value!==(li_data_testid_value=`dropdown-item-${/*option*/ctx[61].value}`)){attr(li,"data-testid",li_data_testid_value);}if(dirty[0]&/*_filteredOptions*/16384&&li_data_value_value!==(li_data_value_value=/*option*/ctx[61].value)){attr(li,"data-value",li_data_value_value);}if(dirty[0]&/*_filteredOptions, _highlightedIndex*/24576){toggle_class(li,"dropdown-item--highlighted",/*index*/ctx[65]===/*_highlightedIndex*/ctx[13]);}if(dirty[0]&/*_inputEl, _filteredOptions*/4210688){toggle_class(li,"selected",/*_inputEl*/ctx[22].value===(/*option*/ctx[61].label||/*option*/ctx[61].value));}},d(detaching){if(detaching)detach(li);mounted=false;dispose();}};}// (451:6) {#each _options as option}
|
|
190
|
+
function create_each_block$8(ctx){let option;let t0_value=/*option*/ctx[61].label+"";let t0;let t1;let option_selected_value;let option_value_value;return {c(){option=element("option");t0=text(t0_value);t1=space();option.selected=option_selected_value=/*value*/ctx[3]===/*option*/ctx[61].value;option.__value=option_value_value=/*option*/ctx[61].value;option.value=option.__value;},m(target,anchor){insert(target,option,anchor);append(option,t0);append(option,t1);},p(ctx,dirty){if(dirty[0]&/*_options*/65536&&t0_value!==(t0_value=/*option*/ctx[61].label+""))set_data(t0,t0_value);if(dirty[0]&/*value, _options*/65544&&option_selected_value!==(option_selected_value=/*value*/ctx[3]===/*option*/ctx[61].value)){option.selected=option_selected_value;}if(dirty[0]&/*_options*/65536&&option_value_value!==(option_value_value=/*option*/ctx[61].value)){option.__value=option_value_value;option.value=option.__value;}},d(detaching){if(detaching)detach(option);}};}function create_fragment$J(ctx){let div;let div_data_testid_value;let div_style_value;function select_block_type(ctx,dirty){if(/*_native*/ctx[15])return create_if_block$p;return create_else_block$a;}let current_block_type=select_block_type(ctx);let if_block=current_block_type(ctx);return {c(){div=element("div");if_block.c();this.c=noop;attr(div,"data-testid",div_data_testid_value=`${/*name*/ctx[0]}-dropdown`);attr(div,"class","dropdown");attr(div,"style",div_style_value=`
|
|
191
|
+
${calculateMargin(/*mt*/ctx[9],/*mr*/ctx[10],/*mb*/ctx[11],/*ml*/ctx[12])};
|
|
192
|
+
--width: ${/*_width*/ctx[18]};
|
|
193
|
+
`);toggle_class(div,"dropdown-native",/*_native*/ctx[15]);},m(target,anchor){insert(target,div,anchor);if_block.m(div,null);/*div_binding*/ctx[45](div);},p(ctx,dirty){if(current_block_type===(current_block_type=select_block_type(ctx))&&if_block){if_block.p(ctx,dirty);}else {if_block.d(1);if_block=current_block_type(ctx);if(if_block){if_block.c();if_block.m(div,null);}}if(dirty[0]&/*name*/1&&div_data_testid_value!==(div_data_testid_value=`${/*name*/ctx[0]}-dropdown`)){attr(div,"data-testid",div_data_testid_value);}if(dirty[0]&/*mt, mr, mb, ml, _width*/269824&&div_style_value!==(div_style_value=`
|
|
194
|
+
${calculateMargin(/*mt*/ctx[9],/*mr*/ctx[10],/*mb*/ctx[11],/*ml*/ctx[12])};
|
|
195
|
+
--width: ${/*_width*/ctx[18]};
|
|
196
|
+
`)){attr(div,"style",div_style_value);}if(dirty[0]&/*_native*/32768){toggle_class(div,"dropdown-native",/*_native*/ctx[15]);}},i:noop,o:noop,d(detaching){if(detaching)detach(div);if_block.d();/*div_binding*/ctx[45](null);}};}function parseValues(selectedValue){let rawValue;try{rawValue=JSON.parse(selectedValue||`[""]`);}catch(e){rawValue=[selectedValue];}const rawValues=typeof rawValue==="object"?rawValue:[rawValue];// convert all values to strings to avoid later type comparison issues
|
|
199
197
|
return rawValues.map(val=>`${val}`);}function isFilterMatch(option,filter){if(filter.length===0)return true;let value=option.filter||option.label||option.value;value=value.toLowerCase();filter=filter.toLowerCase();return value.startsWith(filter)||value.includes(" "+filter);}function instance$G($$self,$$props,$$invalidate){let _disabled;let _error;let _multiselect;let _native;let _filterable;let _activeDescendantId;let{name}=$$props;let{arialabel=""}=$$props;let{arialabelledby=""}=$$props;let{value=""}=$$props;let{filterable="false"}=$$props;let{leadingicon=null}=$$props;let{maxheight="276px"}=$$props;let{placeholder=""}=$$props;let{width=""}=$$props;let{disabled="false"}=$$props;let{error="false"}=$$props;let{multiselect="false"}=$$props;let{native="false"}=$$props;let{relative="false"}=$$props;let{mt=null}=$$props;let{mr=null}=$$props;let{mb=null}=$$props;let{ml=null}=$$props;//
|
|
200
198
|
// Private
|
|
201
199
|
//
|
|
@@ -204,33 +202,34 @@
|
|
|
204
202
|
//
|
|
205
203
|
onMount(_async(function(){var _a,_b;_eventHandler=_filterable?new ComboboxKeyUpHandler(_inputEl):new DropdownKeyUpHandler(_inputEl);// the following is required to appease the jest testing gods in that they don't respond
|
|
206
204
|
// to the slotchange event
|
|
207
|
-
$$invalidate(
|
|
208
|
-
|
|
205
|
+
$$invalidate(16,_options=getOptions());if(!_native){$$invalidate(22,_inputEl.value=(_b=(_a=_options.find(o=>o.value===value))===null||_a===void 0?void 0:_a.label)!==null&&_b!==void 0?_b:"",_inputEl);if(width){if(width.endsWith("%")){const percent=parseInt(width)/100;const rootRect=_rootEl.getBoundingClientRect();$$invalidate(18,_width=percent*rootRect.width+"px");}else {$$invalidate(18,_width=width);}}// This is only here to allow the Jest tests to pass :(
|
|
206
|
+
if(!width&&_options.length>0){$$invalidate(18,_width=getLongestChildWidth(_options));}}syncFilteredOptions();// watch for DOM changes within the slot => dynamic binding
|
|
207
|
+
const slot=_rootEl.querySelector("slot");slot===null||slot===void 0?void 0:slot.addEventListener("slotchange",_=>{var _a,_b;$$invalidate(16,_options=getOptions());syncFilteredOptions();if(!width){$$invalidate(18,_width=getLongestChildWidth(_options));}if(!_native){$$invalidate(22,_inputEl.value=(_b=(_a=_options.find(o=>o.value===value))===null||_a===void 0?void 0:_a.label)!==null&&_b!==void 0?_b:"",_inputEl);}});return _await();}));//
|
|
209
208
|
// Functions
|
|
210
209
|
//
|
|
211
210
|
// prevents unwanted reactive updates.
|
|
212
211
|
function setDisplayedValue(){var _a,_b;if(_inputEl){const option=_options.find(o=>o.value==_values[0]);// possible string number comparison
|
|
213
|
-
$$invalidate(
|
|
212
|
+
$$invalidate(22,_inputEl.value=(_b=(_a=option===null||option===void 0?void 0:option.label)!==null&&_a!==void 0?_a:option===null||option===void 0?void 0:option.value)!==null&&_b!==void 0?_b:"",_inputEl);}}function getChildren(){const slot=_rootEl.querySelector("slot");if(slot){// default
|
|
214
213
|
return slot.assignedElements();}// unit tests
|
|
215
214
|
const el=_native?_selectEl:_rootEl;return [...el.children];}// Create a list of the options based on the children within the slot
|
|
216
215
|
// The children don't have to be goa-dropdown-item elements. Any child element
|
|
217
216
|
// work as long as it has a value and label content
|
|
218
217
|
function getOptions(){return getChildren().filter(child=>child.tagName==="GOA-DROPDOWN-ITEM").map(el=>{const option=el;const value=el.getAttribute("value")||option.value||"";const label=el.getAttribute("label")||option.label||el.innerHTML||value;const filter=el.getAttribute("filter")||label||value||"";return {value,label,filter};});}// compute the required width to ensure all children fit
|
|
219
|
-
function
|
|
218
|
+
function getLongestChildWidth(options){// set width to longest item
|
|
220
219
|
const optionsWidth=options.map(option=>{const label=`${option.label}`||`${option.value}`||"";return label.length;}).sort((a,b)=>a>b?1:-1).pop();// longest one defines the width
|
|
221
220
|
let maxWidth=Math.max(optionsWidth,placeholder.length)+8;// compensate for icon width
|
|
222
221
|
if(leadingicon){maxWidth+=2;}return `${maxWidth}ch`;}// Change the direction of highlighted options for Arrow up and down
|
|
223
222
|
function changeHighlightedOption(offset){let index=_highlightedIndex+offset;let items=!(_filteredOptions===null||_filteredOptions===void 0?void 0:_filteredOptions.length)?_options:_filteredOptions;if(items.length===0)return;// if index is out of scope
|
|
224
|
-
if(index<0){index=_filterable?items.length-1:0;}else if(index>=items.length){index=_filterable?0:items.length-1;}$$invalidate(
|
|
223
|
+
if(index<0){index=_filterable?items.length-1:0;}else if(index>=items.length){index=_filterable?0:items.length-1;}$$invalidate(13,_highlightedIndex=index);scrollToOption(index);}function scrollToOption(index){const liNode=_menuEl.querySelector(`li[data-index="${index}"]`);if(!liNode)return;const liOptionRect=liNode.getBoundingClientRect();const ulRect=_menuEl.getBoundingClientRect();const isInView=liOptionRect.top>=0&&liOptionRect.left>=0&&liOptionRect.bottom<=ulRect.height&&liOptionRect.right<=ulRect.width;if(isInView)return;liNode.scrollIntoView({behavior:"smooth",block:"nearest"});}function syncFilteredOptions(){$$invalidate(14,_filteredOptions=_filterable?_options.filter(option=>isFilterMatch(option,_inputEl.value)):_options);}function showMenu(){if(_disabled){return;}setTimeout(()=>{syncFilteredOptions();$$invalidate(17,_isMenuVisible=true);_inputEl.focus();},0);}function hideMenu(){$$invalidate(17,_isMenuVisible=false);}function dispatchValue(value){const detail=_multiselect?{name,values:[value,..._values]}:{name,value};setTimeout(()=>{_rootEl.dispatchEvent(new CustomEvent("_change",{composed:true,detail}));_isDirty=false;},1);}//
|
|
225
224
|
// Event handlers
|
|
226
225
|
//
|
|
227
|
-
function onSelect(option){if(_disabled)return;if(!_native){_isDirty=true;hideMenu();$$invalidate(
|
|
226
|
+
function onSelect(option){if(_disabled)return;if(!_native){_isDirty=true;hideMenu();$$invalidate(22,_inputEl.value=option.label,_inputEl);}dispatchValue(option.value);}function onInputKeyUp(e){if(_disabled)return;_eventHandler.handleKeyUp(e);}function onInputKeyDown(e){if(_disabled)return;_eventHandler.handleKeyDown(e);}function onClearIconKeyDown(e){if(e.key==="Enter"||e.key===" "){e.stopPropagation();reset();showMenu();}}function onClearIconClick(e){reset();showMenu();e.stopPropagation();}function onNativeSelect(e){const target=e.currentTarget;const option=_options[target.selectedIndex];onSelect(option);}function reset(){if(_disabled)return;$$invalidate(24,_activeDescendantId=undefined);$$invalidate(13,_highlightedIndex=-1);$$invalidate(22,_inputEl.value="",_inputEl);_isDirty=false;syncFilteredOptions();dispatchValue("");}function onChevronClick(e){showMenu();e.stopPropagation();}class ComboboxKeyUpHandler{constructor(input){this.input=input;input.addEventListener("blur",_async(function(e){if(!_isDirty)return;if(!_filterable)return;const input=e.target;const selectedOption=_filteredOptions.find(o=>o.label===input.value);if(!selectedOption){dispatchValue("");input.value="";}return _await();}));}onEscape(e){reset();_inputEl.focus();e.preventDefault();e.stopPropagation();}onEnter(e){const option=_filteredOptions[_highlightedIndex];if(option){onSelect(option);}if(_inputEl.value){hideMenu();}else {showMenu();}e.stopPropagation();}onArrow(e,direction){if(!_isMenuVisible)showMenu();changeHighlightedOption(direction==="up"?-1:1);e.stopPropagation();}onTab(_){const matchedOption=_filteredOptions.find(option=>option.label.toLowerCase()===this.input.value.toLowerCase());if(matchedOption){onSelect(matchedOption);}hideMenu();}onKeyUp(_){showMenu();_isDirty=true;}handleKeyUp(e){switch(e.key){case"Enter":this.onEnter(e);break;case"ArrowUp":this.onArrow(e,"up");break;case"ArrowDown":this.onArrow(e,"down");break;case"Home":this.input.setSelectionRange(0,0);break;case"End":this.input.setSelectionRange(this.input.value.length,this.input.value.length);break;default:this.onKeyUp(e);break;}}handleKeyDown(e){switch(e.key){case"Escape":this.onEscape(e);break;case"Tab":this.onTab(e);break;}}}class DropdownKeyUpHandler{constructor(_input){}onEnter(e){if(_isMenuVisible){const option=_filteredOptions[_highlightedIndex];if(option){onSelect(option);}hideMenu();}else {showMenu();}e.preventDefault();e.stopPropagation();}onArrow(e,direction){if(!_isMenuVisible)showMenu();changeHighlightedOption(direction==="up"?-1:1);e.preventDefault();e.stopPropagation();}handleKeyDown(e){switch(e.key){case" ":case"Enter":this.onEnter(e);break;case"ArrowUp":this.onArrow(e,"up");break;case"ArrowDown":this.onArrow(e,"down");break;case"Tab":hideMenu();break;}return false;}handleKeyUp(e){switch(e.key){case"ArrowUp":case"ArrowDown":case" ":case"Enter":e.preventDefault();e.stopPropagation();}}}function select_binding($$value){binding_callbacks[$$value?'unshift':'push'](()=>{_selectEl=$$value;$$invalidate(21,_selectEl);$$invalidate(16,_options);});}function input_binding($$value){binding_callbacks[$$value?'unshift':'push'](()=>{_inputEl=$$value;$$invalidate(22,_inputEl);});}const click_handler=option=>onSelect(option);function ul_binding($$value){binding_callbacks[$$value?'unshift':'push'](()=>{_menuEl=$$value;$$invalidate(20,_menuEl);});}function div_binding($$value){binding_callbacks[$$value?'unshift':'push'](()=>{_rootEl=$$value;$$invalidate(19,_rootEl);});}$$self.$$set=$$props=>{if('name'in $$props)$$invalidate(0,name=$$props.name);if('arialabel'in $$props)$$invalidate(1,arialabel=$$props.arialabel);if('arialabelledby'in $$props)$$invalidate(2,arialabelledby=$$props.arialabelledby);if('value'in $$props)$$invalidate(3,value=$$props.value);if('filterable'in $$props)$$invalidate(36,filterable=$$props.filterable);if('leadingicon'in $$props)$$invalidate(4,leadingicon=$$props.leadingicon);if('maxheight'in $$props)$$invalidate(5,maxheight=$$props.maxheight);if('placeholder'in $$props)$$invalidate(6,placeholder=$$props.placeholder);if('width'in $$props)$$invalidate(37,width=$$props.width);if('disabled'in $$props)$$invalidate(7,disabled=$$props.disabled);if('error'in $$props)$$invalidate(38,error=$$props.error);if('multiselect'in $$props)$$invalidate(39,multiselect=$$props.multiselect);if('native'in $$props)$$invalidate(40,native=$$props.native);if('relative'in $$props)$$invalidate(8,relative=$$props.relative);if('mt'in $$props)$$invalidate(9,mt=$$props.mt);if('mr'in $$props)$$invalidate(10,mr=$$props.mr);if('mb'in $$props)$$invalidate(11,mb=$$props.mb);if('ml'in $$props)$$invalidate(12,ml=$$props.ml);};$$self.$$.update=()=>{if($$self.$$.dirty[0]&/*disabled*/128){//
|
|
228
227
|
// Reactive
|
|
229
228
|
//
|
|
230
|
-
$$invalidate(
|
|
231
|
-
$$invalidate(
|
|
229
|
+
$$invalidate(25,_disabled=toBoolean(disabled));}if($$self.$$.dirty[1]&/*error*/128){$$invalidate(26,_error=toBoolean(error));}if($$self.$$.dirty[1]&/*multiselect*/256){_multiselect=toBoolean(multiselect);}if($$self.$$.dirty[1]&/*native*/512){$$invalidate(15,_native=toBoolean(native));}if($$self.$$.dirty[0]&/*_native*/32768|$$self.$$.dirty[1]&/*filterable*/32){$$invalidate(23,_filterable=toBoolean(filterable)&&!_native);}if($$self.$$.dirty[0]&/*_filteredOptions, _highlightedIndex*/24576){// To keep track of active descendant for the accessibility
|
|
230
|
+
$$invalidate(24,_activeDescendantId=_filteredOptions[_highlightedIndex]?_filteredOptions[_highlightedIndex].value:undefined);}if($$self.$$.dirty[0]&/*value*/8){{_values=parseValues(value);// updating _inputEl.value is done within seperate function
|
|
232
231
|
// to prevent unwanted reactive updates.
|
|
233
|
-
setDisplayedValue();}}};return [name,arialabel,arialabelledby,value,leadingicon,maxheight,placeholder,
|
|
232
|
+
setDisplayedValue();}}};return [name,arialabel,arialabelledby,value,leadingicon,maxheight,placeholder,disabled,relative,mt,mr,mb,ml,_highlightedIndex,_filteredOptions,_native,_options,_isMenuVisible,_width,_rootEl,_menuEl,_selectEl,_inputEl,_filterable,_activeDescendantId,_disabled,_error,showMenu,hideMenu,onSelect,onInputKeyUp,onInputKeyDown,onClearIconKeyDown,onClearIconClick,onNativeSelect,onChevronClick,filterable,width,error,multiselect,native,select_binding,input_binding,click_handler,ul_binding,div_binding];}class Dropdown extends SvelteElement{constructor(options){super();const style=document.createElement('style');style.textContent=`:host{box-sizing:border-box;font-family:var(--goa-font-family-sans)}.dropdown{cursor:pointer;width:var(--width, 100%)}.dropdown-input-group{box-sizing:border-box;outline:none;transition:box-shadow 0.1s ease-in;border:1px solid var(--goa-color-greyscale-700);border-radius:var(--goa-border-radius-m);display:inline-flex;align-items:stretch;vertical-align:middle;background-color:var(--goa-color-greyscale-white);cursor:pointer;width:var(--width, 100%)}.dropdown-input-group:hover{border-color:var(--goa-color-interactive-hover);box-shadow:0 0 0 var(--goa-border-width-m) var(--goa-color-interactive-hover)}.dropdown-input-group:focus,.dropdown-input-group:focus-within{box-shadow:0 0 0 3px var(--goa-color-interactive-focus)}@media screen and (max-width: 623px){@media not (max-color:2147477350){.dropdown-input-group{width:var(--width)}}}@media not screen and (max-width: 623px){@media not (color:2147477350){.dropdown-input-group{width:var(--width)}}}.dropdown-input-group.error,.dropdown-input-group.error:hover{border:2px solid var(--goa-color-interactive-error);box-shadow:0 0 0 1px var(--goa-color-interactive-error)}.dropdown-input-group.error:focus-within,.dropdown-input-group.error:focus{border:2px solid var(--goa-color-interactive-error);box-shadow:0 0 0 3px var(--goa-color-interactive-focus)}.dropdown-icon--arrow,.dropdown-icon--clear{margin-right:var(--goa-space-s)}.dropdown-icon--clear:focus:not(.disabled),.dropdown-icon--clear:active:not(.disabled){color:var(--goa-color-interactive-focus);outline:none}.dropdown-input--leading-icon{margin-left:0.75rem}.dropdown-input--leading-icon+input{padding-left:0.5rem}input{display:inline-block;color:var(--goa-color-text-default);font-size:var(--goa-font-size-4);padding:var(--goa-space-xs);padding-left:var(--goa-space-s);line-height:calc(40px - calc(var(--goa-space-xs) * 2));background-color:transparent;width:100%;flex:1 1 auto;font-family:var(--goa-font-family-sans);z-index:1}input,input:focus,input:hover,input:active{outline:none;border:none}input[aria-disabled="true"]{color:var(--goa-color-text-secondary)}.dropdown-input-group--disabled,.dropdown-input-group--disabled:hover,.dropdown-input-group--disabled:active,.dropdown-input-group--disabled:focus{background-color:var(--goa-color-greyscale-100);border-color:var(--goa-color-greyscale-200) !important;cursor:default;box-shadow:none !important}ul[role="listbox"]{border-radius:var(--goa-border-radius-m)}.dropdown-item{margin:0;padding:0.5rem;cursor:pointer;color:var(--goa-color-greyscale-black);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dropdown-item:hover,.dropdown-item--highlighted{background:var(--goa-color-greyscale-100);color:var(--goa-color-interactive-hover)}.dropdown-item[aria-selected="true"]{background:var(--goa-color-interactive-default);color:var(--goa-color-greyscale-white)}.dropdown-item[aria-selected="true"]:hover,.dropdown-item[aria-selected="true"].dropdown-item--highlighted{background:var(--goa-color-interactive-hover);color:var(--goa-color-greyscale-white)}.dropdown-native{position:relative;border:1px solid var(--goa-color-greyscale-700);border-radius:var(--goa-border-radius-m);background-color:var(--goa-color-greyscale-white);transition:box-shadow 0.1s ease-in}.dropdown-native:has(select:disabled){background-color:var(--goa-color-greyscale-100);border-color:var(--goa-color-greyscale-200);box-shadow:none;color:var(--goa-color-text-secondary);cursor:default}.dropdown-native:has(select.error){border:2px solid var(--goa-color-interactive-error)}.dropdown-native:hover{border-color:var(--goa-color-interactive-hover);box-shadow:0 0 0 var(--goa-border-width-m) var(--goa-color-interactive-hover)}select{border:none;font:var(--goa-font-family-sans);background-color:transparent;color:var(--goa-color-text-default);font-size:var(--goa-font-size-4);-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:calc(var(--goa-space-xs) + 1px);padding-left:var(--goa-space-s);padding-right:3rem;outline:none;width:100%}.dropdown-native::after{content:"";position:absolute;right:0.6rem;top:0.6rem;pointer-events:none;width:1.5rem;height:1.5rem;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'><path fill='none' stroke='%23333333' stroke-linecap='round' stroke-linejoin='round' stroke-width='48' d='M112 184l144 144 144-144' /%3E%3C/svg%3E");background-repeat:none}.dropdown-native:focus-within{box-shadow:0 0 0 3px var(--goa-color-interactive-focus)}`;this.shadowRoot.appendChild(style);init(this,{target:this.shadowRoot,props:attribute_to_object(this.attributes),customElement:true},instance$G,create_fragment$J,safe_not_equal,{name:0,arialabel:1,arialabelledby:2,value:3,filterable:36,leadingicon:4,maxheight:5,placeholder:6,width:37,disabled:7,error:38,multiselect:39,native:40,relative:8,mt:9,mr:10,mb:11,ml:12},null,[-1,-1,-1]);if(options){if(options.target){insert(options.target,this,options.anchor);}if(options.props){this.$set(options.props);flush();}}}static get observedAttributes(){return ["name","arialabel","arialabelledby","value","filterable","leadingicon","maxheight","placeholder","width","disabled","error","multiselect","native","relative","mt","mr","mb","ml"];}get name(){return this.$$.ctx[0];}set name(name){this.$$set({name});flush();}get arialabel(){return this.$$.ctx[1];}set arialabel(arialabel){this.$$set({arialabel});flush();}get arialabelledby(){return this.$$.ctx[2];}set arialabelledby(arialabelledby){this.$$set({arialabelledby});flush();}get value(){return this.$$.ctx[3];}set value(value){this.$$set({value});flush();}get filterable(){return this.$$.ctx[36];}set filterable(filterable){this.$$set({filterable});flush();}get leadingicon(){return this.$$.ctx[4];}set leadingicon(leadingicon){this.$$set({leadingicon});flush();}get maxheight(){return this.$$.ctx[5];}set maxheight(maxheight){this.$$set({maxheight});flush();}get placeholder(){return this.$$.ctx[6];}set placeholder(placeholder){this.$$set({placeholder});flush();}get width(){return this.$$.ctx[37];}set width(width){this.$$set({width});flush();}get disabled(){return this.$$.ctx[7];}set disabled(disabled){this.$$set({disabled});flush();}get error(){return this.$$.ctx[38];}set error(error){this.$$set({error});flush();}get multiselect(){return this.$$.ctx[39];}set multiselect(multiselect){this.$$set({multiselect});flush();}get native(){return this.$$.ctx[40];}set native(native){this.$$set({native});flush();}get relative(){return this.$$.ctx[8];}set relative(relative){this.$$set({relative});flush();}get mt(){return this.$$.ctx[9];}set mt(mt){this.$$set({mt});flush();}get mr(){return this.$$.ctx[10];}set mr(mr){this.$$set({mr});flush();}get mb(){return this.$$.ctx[11];}set mb(mb){this.$$set({mb});flush();}get ml(){return this.$$.ctx[12];}set ml(ml){this.$$set({ml});flush();}}customElements.define("goa-dropdown",Dropdown);/* src/components/dropdown/DropdownItem.svelte generated by Svelte v3.59.2 */function create_fragment$I(ctx){return {c(){this.c=noop;},m:noop,p:noop,i:noop,o:noop,d:noop};}function instance$F($$self,$$props,$$invalidate){let{filter=""}=$$props;let{label=""}=$$props;let{value=""}=$$props;$$self.$$set=$$props=>{if('filter'in $$props)$$invalidate(0,filter=$$props.filter);if('label'in $$props)$$invalidate(1,label=$$props.label);if('value'in $$props)$$invalidate(2,value=$$props.value);};return [filter,label,value];}class DropdownItem extends SvelteElement{constructor(options){super();init(this,{target:this.shadowRoot,props:attribute_to_object(this.attributes),customElement:true},instance$F,create_fragment$I,safe_not_equal,{filter:0,label:1,value: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 ["filter","label","value"];}get filter(){return this.$$.ctx[0];}set filter(filter){this.$$set({filter});flush();}get label(){return this.$$.ctx[1];}set label(label){this.$$set({label});flush();}get value(){return this.$$.ctx[2];}set value(value){this.$$set({value});flush();}}customElements.define("goa-dropdown-item",DropdownItem);/* src/components/focus-trap/FocusTrap.svelte generated by Svelte v3.59.2 */function create_fragment$H(ctx){let div;return {c(){div=element("div");div.innerHTML=`<span data-tab-boundry="start" tabindex="0"></span>
|
|
234
233
|
<slot></slot>
|
|
235
234
|
|
|
236
235
|
<span data-tab-boundry="end" tabindex="0"></span>`;this.c=noop;},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 isFocusable(node){var _a;const element=node;const isTabbable=element.tabIndex>0||element.tabIndex===0&&element.getAttribute('tabIndex')!==null;if(isTabbable)return node;if(element["disabled"])return null;if(element.tabIndex<0||((_a=element.getAttribute)===null||_a===void 0?void 0:_a.call(element,"tabindex"))==="-1")return null;switch(element.nodeName){case'A':{const el=element;if(!!el.href&&el.rel!=='ignore')return node;}case'INPUT':{const el=element;if(el.type!=='hidden'&&el.type!=='file')return node;}case'BUTTON':case'SELECT':case'TEXTAREA':return node;default:return null;}}function instance$E($$self,$$props,$$invalidate){let rootEl;let boundryStartEl;let boundryEndEl;let isShiftPressed;// Hooks
|
|
@@ -321,7 +320,8 @@
|
|
|
321
320
|
max-width: ${/*maxwidth*/ctx[1]};
|
|
322
321
|
padding: ${/*_padded*/ctx[19]?"var(--goa-space-m)":"0"};
|
|
323
322
|
`)){attr(section,"style",section_style_value);}},d(detaching){if(detaching)detach(div0);if(detaching)detach(t);if(detaching)detach(div2);/*div1_binding*/ctx[28](null);section_resize_listener();/*section_binding*/ctx[30](null);mounted=false;dispose();}};}function create_fragment$s(ctx){let div1;let div0;let slot;let div0_tabindex_value;let t;let div1_style_value;let mounted;let dispose;let if_block=/*_open*/ctx[13]&&create_if_block$f(ctx);return {c(){div1=element("div");div0=element("div");slot=element("slot");t=space();if(if_block)if_block.c();this.c=noop;attr(slot,"name","target");attr(div0,"class","popover-target");attr(div0,"tabindex",div0_tabindex_value=+/*tabindex*/ctx[7]);attr(div0,"data-testid","popover-target");attr(div1,"data-testid",/*testid*/ctx[0]);attr(div1,"style",div1_style_value=`
|
|
324
|
-
${/*
|
|
323
|
+
${/*width*/ctx[2]&&`width: ${/*width*/ctx[2]};`}
|
|
324
|
+
${/*_relative*/ctx[18]&&"position: relative;"||""}
|
|
325
325
|
${calculateMargin(/*mt*/ctx[3],/*mr*/ctx[4],/*mb*/ctx[5],/*ml*/ctx[6])}
|
|
326
326
|
${cssVar("--offset-top",/*voffset*/ctx[8])}
|
|
327
327
|
${cssVar("--offset-bottom",/*voffset*/ctx[8])}
|
|
@@ -329,9 +329,9 @@
|
|
|
329
329
|
${cssVar("--offset-right",/*hoffset*/ctx[9])}
|
|
330
330
|
${cssVar("--focus-border-width",/*focusborderwidth*/ctx[10])}
|
|
331
331
|
${cssVar("--border-radius",/*borderradius*/ctx[11])}
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
${/*_relative*/ctx[18]&&"position: relative;"}
|
|
332
|
+
`);},m(target,anchor){insert(target,div1,anchor);append(div1,div0);append(div0,slot);/*div0_binding*/ctx[27](div0);append(div1,t);if(if_block)if_block.m(div1,null);/*div1_binding_1*/ctx[31](div1);if(!mounted){dispose=listen(div0,"click",/*openPopover*/ctx[20]);mounted=true;}},p(ctx,dirty){if(dirty[0]&/*tabindex*/128&&div0_tabindex_value!==(div0_tabindex_value=+/*tabindex*/ctx[7])){attr(div0,"tabindex",div0_tabindex_value);}if(/*_open*/ctx[13]){if(if_block){if_block.p(ctx,dirty);}else {if_block=create_if_block$f(ctx);if_block.c();if_block.m(div1,null);}}else if(if_block){if_block.d(1);if_block=null;}if(dirty[0]&/*testid*/1){attr(div1,"data-testid",/*testid*/ctx[0]);}if(dirty[0]&/*width, _relative, mt, mr, mb, ml, voffset, hoffset, focusborderwidth, borderradius*/266108&&div1_style_value!==(div1_style_value=`
|
|
333
|
+
${/*width*/ctx[2]&&`width: ${/*width*/ctx[2]};`}
|
|
334
|
+
${/*_relative*/ctx[18]&&"position: relative;"||""}
|
|
335
335
|
${calculateMargin(/*mt*/ctx[3],/*mr*/ctx[4],/*mb*/ctx[5],/*ml*/ctx[6])}
|
|
336
336
|
${cssVar("--offset-top",/*voffset*/ctx[8])}
|
|
337
337
|
${cssVar("--offset-bottom",/*voffset*/ctx[8])}
|
|
@@ -339,8 +339,7 @@
|
|
|
339
339
|
${cssVar("--offset-right",/*hoffset*/ctx[9])}
|
|
340
340
|
${cssVar("--focus-border-width",/*focusborderwidth*/ctx[10])}
|
|
341
341
|
${cssVar("--border-radius",/*borderradius*/ctx[11])}
|
|
342
|
-
|
|
343
|
-
`)){attr(div1,"style",div1_style_value);}},i:noop,o:noop,d(detaching){if(detaching)detach(div1);/*div0_binding*/ctx[27](null);if(if_block)if_block.d();/*div1_binding_1*/ctx[31](null);mounted=false;dispose();}};}function getBoundingClientRectWithMargins(el){const rect=el.getBoundingClientRect();const style=window.getComputedStyle(el);const mTop=parseInt(style.marginTop,10)||0;const mRight=parseInt(style.marginRight,10)||0;const mBottom=parseInt(style.marginBottom,10)||0;const mLeft=parseInt(style.marginLeft,10)||0;return {top:rect.top-mTop,right:rect.right+mRight,bottom:rect.bottom+mBottom,left:rect.left-mLeft,width:rect.width+mLeft+mRight,height:rect.height+mTop+mBottom,x:rect.x-mLeft,y:rect.y-mTop};}function instance$p($$self,$$props,$$invalidate){const setPopoverPosition=function setPopoverPosition(){return _call(tick,function(){// Get target and content rectangles
|
|
342
|
+
`)){attr(div1,"style",div1_style_value);}},i:noop,o:noop,d(detaching){if(detaching)detach(div1);/*div0_binding*/ctx[27](null);if(if_block)if_block.d();/*div1_binding_1*/ctx[31](null);mounted=false;dispose();}};}function getBoundingClientRectWithMargins(el){const rect=el.getBoundingClientRect();const style=window.getComputedStyle(el);const mTop=parseInt(style.marginTop,10)||0;const mRight=parseInt(style.marginRight,10)||0;const mBottom=parseInt(style.marginBottom,10)||0;const mLeft=parseInt(style.marginLeft,10)||0;return {top:rect.top-mTop,right:rect.right+mRight,bottom:rect.bottom+mBottom,left:rect.left-mLeft,width:rect.width+mLeft+mRight,height:rect.height+mTop+mBottom,x:rect.x-mLeft,y:rect.y-mTop};}function instance$p($$self,$$props,$$invalidate){const setPopoverPosition=function setPopoverPosition(){return _call(tick,function(){// Get target and content rectangles
|
|
344
343
|
const rootRect=_rootEl.getBoundingClientRect();const targetRect=getBoundingClientRectWithMargins(_targetEl);const contentRect=getBoundingClientRectWithMargins(_popoverEl);// Calculate available space above and below the target element
|
|
345
344
|
const spaceAbove=targetRect.top;const spaceBelow=window.innerHeight-targetRect.bottom;// Determine if there's more space above or below the target element
|
|
346
345
|
const displayOnTop=position==="auto"?spaceBelow<contentRect.height&&spaceAbove>contentRect.height&&spaceAbove>spaceBelow:position==="above";// when popover is within a modal and the scrollbars are hidden we don't need to take into
|
|
@@ -376,7 +375,7 @@
|
|
|
376
375
|
* @param newValue Selected value
|
|
377
376
|
*/function onChange(newValue){if(newValue===value)return;$$invalidate(0,value=newValue);el.dispatchEvent(new CustomEvent("_change",{composed:true,detail:{name,value}}));}onMount(()=>{validateOrientation(orientation);});const change_handler=option=>onChange(option.value);function div_binding($$value){binding_callbacks[$$value?'unshift':'push'](()=>{el=$$value;$$invalidate(10,el);});}$$self.$$set=$$props=>{if('name'in $$props)$$invalidate(1,name=$$props.name);if('value'in $$props)$$invalidate(0,value=$$props.value);if('orientation'in $$props)$$invalidate(2,orientation=$$props.orientation);if('disabled'in $$props)$$invalidate(14,disabled=$$props.disabled);if('error'in $$props)$$invalidate(15,error=$$props.error);if('testid'in $$props)$$invalidate(3,testid=$$props.testid);if('arialabel'in $$props)$$invalidate(4,arialabel=$$props.arialabel);if('mt'in $$props)$$invalidate(5,mt=$$props.mt);if('mr'in $$props)$$invalidate(6,mr=$$props.mr);if('mb'in $$props)$$invalidate(7,mb=$$props.mb);if('ml'in $$props)$$invalidate(8,ml=$$props.ml);};$$self.$$.update=()=>{if($$self.$$.dirty&/*disabled*/16384){// private
|
|
378
377
|
$$invalidate(12,isDisabled=toBoolean(disabled));}if($$self.$$.dirty&/*error*/32768){$$invalidate(11,isError=toBoolean(error));}};return [value,name,orientation,testid,arialabel,mt,mr,mb,ml,options,el,isError,isDisabled,onChange,disabled,error,change_handler,div_binding];}class RadioGroup extends SvelteElement{constructor(options){super();const style=document.createElement('style');style.textContent=`:host{box-sizing:border-box;font-family:var(--goa-font-family-sans)}.goa-radio-group--horizontal{display:flex;flex-direction:row}.goa-radio-group--vertical{display:inline-block}label.goa-radio{--goa-radio-outline-width:3px;--goa-radio-diameter:1.5rem;--goa-radio-border-width:1px;--goa-radio-border-width--checked:7px;display:inline-block;box-sizing:border-box;display:flex}.goa-radio-container{padding-bottom:1rem}.goa-radio:hover{cursor:pointer}.goa-radio *,.goa-radio *:before,.goa-radio *:after{box-sizing:border-box}.goa-radio input[type="radio"]{width:0;height:0;margin:0;opacity:0}.goa-radio-label{padding:0 0.5rem;font-weight:var(--goa-font-weight-regular)}.goa-radio-description{font:var(--goa-typography-body-xs);margin-left:var(--goa-space-xl);margin-top:var(--goa-space-2xs)}.goa-radio-icon{display:inline-block;height:var(--goa-radio-diameter);width:var(--goa-radio-diameter);border-radius:50%;background-color:#fff;transition:box-shadow 100ms ease-in-out;flex:0 0 auto;margin-top:var(--font-valign-fix)}.goa-radio:focus>input:not(:disabled)~.goa-radio-icon{box-shadow:0 0 0 var(--goa-radio-outline-width) var(--goa-color-interactive-focus)}.goa-radio--disabled .goa-radio-label{opacity:0.4}.goa-radio--disabled:hover{cursor:default}input[type="radio"]:not(:checked)~.goa-radio-icon{border:var(--goa-radio-border-width) solid var(--goa-color-greyscale-700)}input[type="radio"]:hover~.goa-radio-icon{border:1px solid var(--goa-color-interactive-hover);box-shadow:0 0 0 1px var(--goa-color-interactive-hover)}input[type="radio"]:checked:hover~.goa-radio-icon{border:7px solid var(--goa-color-interactive-hover);box-shadow:0 0 0 1px var(--goa-color-interactive-hover)}input[type="radio"]:focus~.goa-radio-icon,input[type="radio"]:hover:active~.goa-radio-icon,input[type="radio"]:hover:focus~.goa-radio-icon,input[type="radio"]:active~.goa-radio-icon{box-shadow:0 0 0 var(--goa-radio-outline-width) var(--goa-color-interactive-focus)}input[type="radio"]:checked~.goa-radio-icon{border:var(--goa-radio-border-width--checked) solid var(--goa-color-interactive-default)}input[type="radio"]:disabled~.goa-radio-icon{border:var(--goa-radio-border-width) solid var(--goa-color-greyscale-700);box-shadow:none;opacity:40%}input[type="radio"]:disabled:checked~.goa-radio-icon{border:var(--goa-radio-border-width--checked) solid
|
|
379
|
-
var(--goa-color-interactive-hover);box-shadow:none}.goa-radio--error input[type="radio"]:checked~.goa-radio-icon{border:7px solid var(--goa-color-emergency-default)}.goa-radio--error input[type="radio"]:hover~.goa-radio-icon{box-shadow:0 0 0 1px var(--goa-color-emergency-default)}.goa-radio--error input[type="radio"]:disabled:hover~.goa-radio-icon{box-shadow:none}.goa-radio--error input[type="radio"]:not(:checked)~.goa-radio-icon{border:2px solid var(--goa-color-emergency-default)}`;this.shadowRoot.appendChild(style);init(this,{target:this.shadowRoot,props:attribute_to_object(this.attributes),customElement:true},instance$o,create_fragment$r,safe_not_equal,{name:1,value:0,orientation:2,disabled:14,error:15,testid:3,arialabel:4,mt:5,mr:6,mb:7,ml:8},null);if(options){if(options.target){insert(options.target,this,options.anchor);}if(options.props){this.$set(options.props);flush();}}}static get observedAttributes(){return ["name","value","orientation","disabled","error","testid","arialabel","mt","mr","mb","ml"];}get name(){return this.$$.ctx[1];}set name(name){this.$$set({name});flush();}get value(){return this.$$.ctx[0];}set value(value){this.$$set({value});flush();}get orientation(){return this.$$.ctx[2];}set orientation(orientation){this.$$set({orientation});flush();}get disabled(){return this.$$.ctx[14];}set disabled(disabled){this.$$set({disabled});flush();}get error(){return this.$$.ctx[15];}set error(error){this.$$set({error});flush();}get testid(){return this.$$.ctx[3];}set testid(testid){this.$$set({testid});flush();}get arialabel(){return this.$$.ctx[4];}set arialabel(arialabel){this.$$set({arialabel});flush();}get mt(){return this.$$.ctx[5];}set mt(mt){this.$$set({mt});flush();}get mr(){return this.$$.ctx[6];}set mr(mr){this.$$set({mr});flush();}get mb(){return this.$$.ctx[7];}set mb(mb){this.$$set({mb});flush();}get ml(){return this.$$.ctx[8];}set ml(ml){this.$$set({ml});flush();}}customElements.define("goa-radio-group",RadioGroup);/* src/components/scrollable/Scrollable.svelte generated by Svelte v3.59.2 */function create_fragment$q(ctx){let div;let slot;let div_style_value;let mounted;let dispose;return {c(){div=element("div");slot=element("slot");this.c=noop;attr(div,"class","goa-scrollable");attr(div,"style",div_style_value=`
|
|
378
|
+
var(--goa-color-interactive-hover);box-shadow:none}.goa-radio--error input[type="radio"]:checked~.goa-radio-icon{border:7px solid var(--goa-color-emergency-default)}.goa-radio--error input[type="radio"]:hover~.goa-radio-icon{box-shadow:0 0 0 1px var(--goa-color-emergency-default)}.goa-radio--error input[type="radio"]:hover:active~.goa-radio-icon,.goa-radio--error input[type="radio"]:hover:focus~.goa-radio-icon{box-shadow:0 0 0 var(--goa-radio-outline-width) var(--goa-color-interactive-focus)}.goa-radio--error input[type="radio"]:disabled:hover~.goa-radio-icon{box-shadow:none}.goa-radio--error input[type="radio"]:not(:checked)~.goa-radio-icon{border:2px solid var(--goa-color-emergency-default)}`;this.shadowRoot.appendChild(style);init(this,{target:this.shadowRoot,props:attribute_to_object(this.attributes),customElement:true},instance$o,create_fragment$r,safe_not_equal,{name:1,value:0,orientation:2,disabled:14,error:15,testid:3,arialabel:4,mt:5,mr:6,mb:7,ml:8},null);if(options){if(options.target){insert(options.target,this,options.anchor);}if(options.props){this.$set(options.props);flush();}}}static get observedAttributes(){return ["name","value","orientation","disabled","error","testid","arialabel","mt","mr","mb","ml"];}get name(){return this.$$.ctx[1];}set name(name){this.$$set({name});flush();}get value(){return this.$$.ctx[0];}set value(value){this.$$set({value});flush();}get orientation(){return this.$$.ctx[2];}set orientation(orientation){this.$$set({orientation});flush();}get disabled(){return this.$$.ctx[14];}set disabled(disabled){this.$$set({disabled});flush();}get error(){return this.$$.ctx[15];}set error(error){this.$$set({error});flush();}get testid(){return this.$$.ctx[3];}set testid(testid){this.$$set({testid});flush();}get arialabel(){return this.$$.ctx[4];}set arialabel(arialabel){this.$$set({arialabel});flush();}get mt(){return this.$$.ctx[5];}set mt(mt){this.$$set({mt});flush();}get mr(){return this.$$.ctx[6];}set mr(mr){this.$$set({mr});flush();}get mb(){return this.$$.ctx[7];}set mb(mb){this.$$set({mb});flush();}get ml(){return this.$$.ctx[8];}set ml(ml){this.$$set({ml});flush();}}customElements.define("goa-radio-group",RadioGroup);/* src/components/scrollable/Scrollable.svelte generated by Svelte v3.59.2 */function create_fragment$q(ctx){let div;let slot;let div_style_value;let mounted;let dispose;return {c(){div=element("div");slot=element("slot");this.c=noop;attr(div,"class","goa-scrollable");attr(div,"style",div_style_value=`
|
|
380
379
|
max-height: ${/*maxheight*/ctx[3]||"50vh"};
|
|
381
380
|
overflow-y: ${/*direction*/ctx[0]==="vertical"?'auto':'hidden'};
|
|
382
381
|
overflow-x: ${/*direction*/ctx[0]==="horizontal"?'auto':'hidden'};
|